(self.webpackChunk=self.webpackChunk||[]).push([[779,42441,43428],{680:function(t,e,n){"use strict";n.d(e,{Z:function(){return l}});var i=n(5891),r=n(59301),a={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},o=n(22589),s=function(t,e){return r.createElement(o.Z,(0,i.Z)({},t,{ref:e,icon:a}))};var l=r.forwardRef(s)},20553:function(t,e,n){"use strict";n.d(e,{kJ:function(){return GT},RN:function(){return tS}});var i={};n.r(i),n.d(i,{add:function(){return Pt},adjoint:function(){return $},clone:function(){return H},copy:function(){return V},create:function(){return U},determinant:function(){return K},equals:function(){return It},exactEquals:function(){return kt},frob:function(){return Nt},fromQuat:function(){return yt},fromQuat2:function(){return dt},fromRotation:function(){return st},fromRotationTranslation:function(){return ht},fromRotationTranslationScale:function(){return mt},fromRotationTranslationScaleOrigin:function(){return vt},fromScaling:function(){return ot},fromTranslation:function(){return at},fromValues:function(){return Z},fromXRotation:function(){return lt},fromYRotation:function(){return ut},fromZRotation:function(){return ct},frustum:function(){return xt},getRotation:function(){return gt},getScaling:function(){return pt},getTranslation:function(){return ft},identity:function(){return X},invert:function(){return q},lookAt:function(){return Ct},mul:function(){return Bt},multiply:function(){return Q},multiplyScalar:function(){return Rt},multiplyScalarAndAdd:function(){return Dt},ortho:function(){return St},orthoNO:function(){return Tt},orthoZO:function(){return Mt},perspective:function(){return _t},perspectiveFromFieldOfView:function(){return wt},perspectiveNO:function(){return bt},perspectiveZO:function(){return Et},rotate:function(){return et},rotateX:function(){return nt},rotateY:function(){return it},rotateZ:function(){return rt},scale:function(){return tt},set:function(){return W},str:function(){return Ot},sub:function(){return Ft},subtract:function(){return Lt},targetTo:function(){return At},translate:function(){return J},transpose:function(){return Y}});var r={};n.r(r),n.d(r,{circle:function(){return Bg},diamond:function(){return zg},rect:function(){return jg},simple:function(){return Hg},triangle:function(){return Fg},triangleRect:function(){return Ug},vee:function(){return Gg}});var a=n(57259),o=n(79545),s=n(68550),l=n(26390),u=n(43962),c=n(67785),h=n(81058);function d(t,e,n){return e=(0,u.Z)(e),(0,h.Z)(t,(0,c.Z)()?Reflect.construct(e,n||[],(0,u.Z)(t).constructor):e.apply(t,n))}var f=n(17928),p=n(29043),g=n(37271),m=1e-6,v="undefined"!=typeof Float32Array?Float32Array:Array;Math.random;Math.PI;function y(){var t=new v(3);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function x(t){var e=new v(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function b(t){var e=t[0],n=t[1],i=t[2];return Math.hypot(e,n,i)}function _(t,e,n){var i=new v(3);return i[0]=t,i[1]=e,i[2]=n,i}function E(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function w(t,e,n,i){return t[0]=e,t[1]=n,t[2]=i,t}function T(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function S(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function M(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t}function C(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function A(t,e){var n=e[0],i=e[1],r=e[2],a=n*n+i*i+r*r;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function O(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function N(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2];return t[0]=r*l-a*s,t[1]=a*o-i*l,t[2]=i*s-r*o,t}function P(t,e,n,i){var r=e[0],a=e[1],o=e[2];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t[2]=o+i*(n[2]-o),t}function L(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,t}function R(t,e,n){var i=n[0],r=n[1],a=n[2],o=n[3],s=e[0],l=e[1],u=e[2],c=r*u-a*l,h=a*s-i*u,d=i*l-r*s,f=r*d-a*h,p=a*c-i*d,g=i*h-r*c,m=2*o;return c*=m,h*=m,d*=m,f*=2,p*=2,g*=2,t[0]=s+c+f,t[1]=l+h+p,t[2]=u+d+g,t}function D(t,e){var n=t[0],i=t[1],r=t[2],a=e[0],o=e[1],s=e[2];return Math.abs(n-a)<=m*Math.max(1,Math.abs(n),Math.abs(a))&&Math.abs(i-o)<=m*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(r-s)<=m*Math.max(1,Math.abs(r),Math.abs(s))}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var k,I=S,B=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2];return Math.hypot(n,i,r)},F=b;k=y();function z(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function G(t,e,n,i){var r=new v(4);return r[0]=t,r[1]=e,r[2]=n,r[3]=i,r}function j(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,t}!function(){var t=z()}();function U(){var t=new v(16);return v!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function H(t){var e=new v(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function V(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function Z(t,e,n,i,r,a,o,s,l,u,c,h,d,f,p,g){var m=new v(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=i,m[4]=r,m[5]=a,m[6]=o,m[7]=s,m[8]=l,m[9]=u,m[10]=c,m[11]=h,m[12]=d,m[13]=f,m[14]=p,m[15]=g,m}function W(t,e,n,i,r,a,o,s,l,u,c,h,d,f,p,g,m){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=a,t[5]=o,t[6]=s,t[7]=l,t[8]=u,t[9]=c,t[10]=h,t[11]=d,t[12]=f,t[13]=p,t[14]=g,t[15]=m,t}function X(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Y(t,e){if(t===e){var n=e[1],i=e[2],r=e[3],a=e[6],o=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=a,t[11]=e[14],t[12]=r,t[13]=o,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function q(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15],y=n*s-i*o,x=n*l-r*o,b=n*u-a*o,_=i*l-r*s,E=i*u-a*s,w=r*u-a*l,T=c*g-h*p,S=c*m-d*p,M=c*v-f*p,C=h*m-d*g,A=h*v-f*g,O=d*v-f*m,N=y*O-x*A+b*C+_*M-E*S+w*T;return N?(N=1/N,t[0]=(s*O-l*A+u*C)*N,t[1]=(r*A-i*O-a*C)*N,t[2]=(g*w-m*E+v*_)*N,t[3]=(d*E-h*w-f*_)*N,t[4]=(l*M-o*O-u*S)*N,t[5]=(n*O-r*M+a*S)*N,t[6]=(m*b-p*w-v*x)*N,t[7]=(c*w-d*b+f*x)*N,t[8]=(o*A-s*M+u*T)*N,t[9]=(i*M-n*A-a*T)*N,t[10]=(p*E-g*b+v*y)*N,t[11]=(h*b-c*E-f*y)*N,t[12]=(s*S-o*C-l*T)*N,t[13]=(n*C-i*S+r*T)*N,t[14]=(g*x-p*_-m*y)*N,t[15]=(c*_-h*x+d*y)*N,t):null}function $(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],p=e[12],g=e[13],m=e[14],v=e[15];return t[0]=s*(d*v-f*m)-h*(l*v-u*m)+g*(l*f-u*d),t[1]=-(i*(d*v-f*m)-h*(r*v-a*m)+g*(r*f-a*d)),t[2]=i*(l*v-u*m)-s*(r*v-a*m)+g*(r*u-a*l),t[3]=-(i*(l*f-u*d)-s*(r*f-a*d)+h*(r*u-a*l)),t[4]=-(o*(d*v-f*m)-c*(l*v-u*m)+p*(l*f-u*d)),t[5]=n*(d*v-f*m)-c*(r*v-a*m)+p*(r*f-a*d),t[6]=-(n*(l*v-u*m)-o*(r*v-a*m)+p*(r*u-a*l)),t[7]=n*(l*f-u*d)-o*(r*f-a*d)+c*(r*u-a*l),t[8]=o*(h*v-f*g)-c*(s*v-u*g)+p*(s*f-u*h),t[9]=-(n*(h*v-f*g)-c*(i*v-a*g)+p*(i*f-a*h)),t[10]=n*(s*v-u*g)-o*(i*v-a*g)+p*(i*u-a*s),t[11]=-(n*(s*f-u*h)-o*(i*f-a*h)+c*(i*u-a*s)),t[12]=-(o*(h*m-d*g)-c*(s*m-l*g)+p*(s*d-l*h)),t[13]=n*(h*m-d*g)-c*(i*m-r*g)+p*(i*d-r*h),t[14]=-(n*(s*m-l*g)-o*(i*m-r*g)+p*(i*l-r*s)),t[15]=n*(s*d-l*h)-o*(i*d-r*h)+c*(i*l-r*s),t}function K(t){var e=t[0],n=t[1],i=t[2],r=t[3],a=t[4],o=t[5],s=t[6],l=t[7],u=t[8],c=t[9],h=t[10],d=t[11],f=t[12],p=t[13],g=t[14],m=t[15];return(e*o-n*a)*(h*m-d*g)-(e*s-i*a)*(c*m-d*p)+(e*l-r*a)*(c*g-h*p)+(n*s-i*o)*(u*m-d*f)-(n*l-r*o)*(u*g-h*f)+(i*l-r*s)*(u*p-c*f)}function Q(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],v=e[14],y=e[15],x=n[0],b=n[1],_=n[2],E=n[3];return t[0]=x*i+b*s+_*h+E*g,t[1]=x*r+b*l+_*d+E*m,t[2]=x*a+b*u+_*f+E*v,t[3]=x*o+b*c+_*p+E*y,x=n[4],b=n[5],_=n[6],E=n[7],t[4]=x*i+b*s+_*h+E*g,t[5]=x*r+b*l+_*d+E*m,t[6]=x*a+b*u+_*f+E*v,t[7]=x*o+b*c+_*p+E*y,x=n[8],b=n[9],_=n[10],E=n[11],t[8]=x*i+b*s+_*h+E*g,t[9]=x*r+b*l+_*d+E*m,t[10]=x*a+b*u+_*f+E*v,t[11]=x*o+b*c+_*p+E*y,x=n[12],b=n[13],_=n[14],E=n[15],t[12]=x*i+b*s+_*h+E*g,t[13]=x*r+b*l+_*d+E*m,t[14]=x*a+b*u+_*f+E*v,t[15]=x*o+b*c+_*p+E*y,t}function J(t,e,n){var i,r,a,o,s,l,u,c,h,d,f,p,g=n[0],m=n[1],v=n[2];return e===t?(t[12]=e[0]*g+e[4]*m+e[8]*v+e[12],t[13]=e[1]*g+e[5]*m+e[9]*v+e[13],t[14]=e[2]*g+e[6]*m+e[10]*v+e[14],t[15]=e[3]*g+e[7]*m+e[11]*v+e[15]):(i=e[0],r=e[1],a=e[2],o=e[3],s=e[4],l=e[5],u=e[6],c=e[7],h=e[8],d=e[9],f=e[10],p=e[11],t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t[6]=u,t[7]=c,t[8]=h,t[9]=d,t[10]=f,t[11]=p,t[12]=i*g+s*m+h*v+e[12],t[13]=r*g+l*m+d*v+e[13],t[14]=a*g+u*m+f*v+e[14],t[15]=o*g+c*m+p*v+e[15]),t}function tt(t,e,n){var i=n[0],r=n[1],a=n[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function et(t,e,n,i){var r,a,o,s,l,u,c,h,d,f,p,g,v,y,x,b,_,E,w,T,S,M,C,A,O=i[0],N=i[1],P=i[2],L=Math.hypot(O,N,P);return L0?(n[0]=2*(s*o+c*i+l*a-u*r)/h,n[1]=2*(l*o+c*r+u*i-s*a)/h,n[2]=2*(u*o+c*a+s*r-l*i)/h):(n[0]=2*(s*o+c*i+l*a-u*r),n[1]=2*(l*o+c*r+u*i-s*a),n[2]=2*(u*o+c*a+s*r-l*i)),ht(t,e,n),t}function ft(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function pt(t,e){var n=e[0],i=e[1],r=e[2],a=e[4],o=e[5],s=e[6],l=e[8],u=e[9],c=e[10];return t[0]=Math.hypot(n,i,r),t[1]=Math.hypot(a,o,s),t[2]=Math.hypot(l,u,c),t}function gt(t,e){var n=new v(3);pt(n,e);var i=1/n[0],r=1/n[1],a=1/n[2],o=e[0]*i,s=e[1]*r,l=e[2]*a,u=e[4]*i,c=e[5]*r,h=e[6]*a,d=e[8]*i,f=e[9]*r,p=e[10]*a,g=o+c+p,m=0;return g>0?(m=2*Math.sqrt(g+1),t[3]=.25*m,t[0]=(h-f)/m,t[1]=(d-l)/m,t[2]=(s-u)/m):o>c&&o>p?(m=2*Math.sqrt(1+o-c-p),t[3]=(h-f)/m,t[0]=.25*m,t[1]=(s+u)/m,t[2]=(d+l)/m):c>p?(m=2*Math.sqrt(1+c-o-p),t[3]=(d-l)/m,t[0]=(s+u)/m,t[1]=.25*m,t[2]=(h+f)/m):(m=2*Math.sqrt(1+p-o-c),t[3]=(s-u)/m,t[0]=(d+l)/m,t[1]=(h+f)/m,t[2]=.25*m),t}function mt(t,e,n,i){var r=e[0],a=e[1],o=e[2],s=e[3],l=r+r,u=a+a,c=o+o,h=r*l,d=r*u,f=r*c,p=a*u,g=a*c,m=o*c,v=s*l,y=s*u,x=s*c,b=i[0],_=i[1],E=i[2];return t[0]=(1-(p+m))*b,t[1]=(d+x)*b,t[2]=(f-y)*b,t[3]=0,t[4]=(d-x)*_,t[5]=(1-(h+m))*_,t[6]=(g+v)*_,t[7]=0,t[8]=(f+y)*E,t[9]=(g-v)*E,t[10]=(1-(h+p))*E,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function vt(t,e,n,i,r){var a=e[0],o=e[1],s=e[2],l=e[3],u=a+a,c=o+o,h=s+s,d=a*u,f=a*c,p=a*h,g=o*c,m=o*h,v=s*h,y=l*u,x=l*c,b=l*h,_=i[0],E=i[1],w=i[2],T=r[0],S=r[1],M=r[2],C=(1-(g+v))*_,A=(f+b)*_,O=(p-x)*_,N=(f-b)*E,P=(1-(d+v))*E,L=(m+y)*E,R=(p+x)*w,D=(m-y)*w,k=(1-(d+g))*w;return t[0]=C,t[1]=A,t[2]=O,t[3]=0,t[4]=N,t[5]=P,t[6]=L,t[7]=0,t[8]=R,t[9]=D,t[10]=k,t[11]=0,t[12]=n[0]+T-(C*T+N*S+R*M),t[13]=n[1]+S-(A*T+P*S+D*M),t[14]=n[2]+M-(O*T+L*S+k*M),t[15]=1,t}function yt(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n+n,s=i+i,l=r+r,u=n*o,c=i*o,h=i*s,d=r*o,f=r*s,p=r*l,g=a*o,m=a*s,v=a*l;return t[0]=1-h-p,t[1]=c+v,t[2]=d-m,t[3]=0,t[4]=c-v,t[5]=1-u-p,t[6]=f+g,t[7]=0,t[8]=d+m,t[9]=f-g,t[10]=1-u-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function xt(t,e,n,i,r,a,o){var s=1/(n-e),l=1/(r-i),u=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(r+i)*l,t[10]=(o+a)*u,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*u,t[15]=0,t}function bt(t,e,n,i,r){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=(r+i)*a,t[14]=2*r*i*a):(t[10]=-1,t[14]=-2*i),t}var _t=bt;function Et(t,e,n,i,r){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(a=1/(i-r),t[10]=r*a,t[14]=r*i*a):(t[10]=-1,t[14]=-i),t}function wt(t,e,n,i){var r=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),u=2/(r+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=u,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(r-a)*u*.5,t[10]=i/(n-i),t[11]=-1,t[12]=0,t[13]=0,t[14]=i*n/(n-i),t[15]=0,t}function Tt(t,e,n,i,r,a,o){var s=1/(e-n),l=1/(i-r),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*u,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*l,t[14]=(o+a)*u,t[15]=1,t}var St=Tt;function Mt(t,e,n,i,r,a,o){var s=1/(e-n),l=1/(i-r),u=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=u,t[11]=0,t[12]=(e+n)*s,t[13]=(r+i)*l,t[14]=a*u,t[15]=1,t}function Ct(t,e,n,i){var r,a,o,s,l,u,c,h,d,f,p=e[0],g=e[1],v=e[2],y=i[0],x=i[1],b=i[2],_=n[0],E=n[1],w=n[2];return Math.abs(p-_)0&&(c*=f=1/Math.sqrt(f),h*=f,d*=f);var p=l*d-u*h,g=u*c-s*d,m=s*h-l*c;return(f=p*p+g*g+m*m)>0&&(p*=f=1/Math.sqrt(f),g*=f,m*=f),t[0]=p,t[1]=g,t[2]=m,t[3]=0,t[4]=h*m-d*g,t[5]=d*p-c*m,t[6]=c*g-h*p,t[7]=0,t[8]=c,t[9]=h,t[10]=d,t[11]=0,t[12]=r,t[13]=a,t[14]=o,t[15]=1,t}function Ot(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"}function Nt(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function Pt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t}function Lt(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}function Rt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t}function Dt(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t[4]=e[4]+n[4]*i,t[5]=e[5]+n[5]*i,t[6]=e[6]+n[6]*i,t[7]=e[7]+n[7]*i,t[8]=e[8]+n[8]*i,t[9]=e[9]+n[9]*i,t[10]=e[10]+n[10]*i,t[11]=e[11]+n[11]*i,t[12]=e[12]+n[12]*i,t[13]=e[13]+n[13]*i,t[14]=e[14]+n[14]*i,t[15]=e[15]+n[15]*i,t}function kt(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function It(t,e){var n=t[0],i=t[1],r=t[2],a=t[3],o=t[4],s=t[5],l=t[6],u=t[7],c=t[8],h=t[9],d=t[10],f=t[11],p=t[12],g=t[13],v=t[14],y=t[15],x=e[0],b=e[1],_=e[2],E=e[3],w=e[4],T=e[5],S=e[6],M=e[7],C=e[8],A=e[9],O=e[10],N=e[11],P=e[12],L=e[13],R=e[14],D=e[15];return Math.abs(n-x)<=m*Math.max(1,Math.abs(n),Math.abs(x))&&Math.abs(i-b)<=m*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(r-_)<=m*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(a-E)<=m*Math.max(1,Math.abs(a),Math.abs(E))&&Math.abs(o-w)<=m*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(s-T)<=m*Math.max(1,Math.abs(s),Math.abs(T))&&Math.abs(l-S)<=m*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(u-M)<=m*Math.max(1,Math.abs(u),Math.abs(M))&&Math.abs(c-C)<=m*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(h-A)<=m*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(d-O)<=m*Math.max(1,Math.abs(d),Math.abs(O))&&Math.abs(f-N)<=m*Math.max(1,Math.abs(f),Math.abs(N))&&Math.abs(p-P)<=m*Math.max(1,Math.abs(p),Math.abs(P))&&Math.abs(g-L)<=m*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(v-R)<=m*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(y-D)<=m*Math.max(1,Math.abs(y),Math.abs(D))}var Bt=Q,Ft=Lt;function zt(){var t=new v(9);return v!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function Gt(){var t=new v(4);return v!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function jt(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t}function Ut(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=n[0],l=n[1],u=n[2],c=n[3];return t[0]=i*c+o*s+r*u-a*l,t[1]=r*c+o*l+a*s-i*u,t[2]=a*c+o*u+i*l-r*s,t[3]=o*c-i*s-r*l-a*u,t}function Ht(t,e,n,i){var r,a,o,s,l,u=e[0],c=e[1],h=e[2],d=e[3],f=n[0],p=n[1],g=n[2],v=n[3];return(a=u*f+c*p+h*g+d*v)<0&&(a=-a,f=-f,p=-p,g=-g,v=-v),1-a>m?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(s=1-i,l=i),t[0]=s*u+l*f,t[1]=s*c+l*p,t[2]=s*h+l*g,t[3]=s*d+l*v,t}function Vt(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=a*s,t}function Zt(t,e,n,i){var r=.5*Math.PI/180;e*=r,n*=r,i*=r;var a=Math.sin(e),o=Math.cos(e),s=Math.sin(n),l=Math.cos(n),u=Math.sin(i),c=Math.cos(i);return t[0]=a*l*c-o*s*u,t[1]=o*s*c+a*l*u,t[2]=o*l*u-a*s*c,t[3]=o*l*c+a*s*u,t}var Wt,Xt,Yt,qt,$t,Kt,Qt=G,Jt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},te=function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},ee=Ut,ne=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=i*o,t[2]=r*o,t[3]=a*o,t};Wt=y(),Xt=_(1,0,0),Yt=_(0,1,0),qt=Gt(),$t=Gt(),Kt=zt();function ie(){var t=new v(2);return v!=Float32Array&&(t[0]=0,t[1]=0),t}function re(t,e){return t[0]=e[0],t[1]=e[1],t}function ae(t,e,n){return t[0]=e,t[1]=n,t}!function(){var t=ie()}();var oe=n(25719);function se(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var le=n(23481),ue=n(18756),ce=function(t,e,n){return tn?n:t},he=n(80813),de={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function fe(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return de[e]===t.length-1&&"achlmqstvz".includes(e)}))}function pe(t){return fe(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function ge(t){return pe(t)&&t.every((function(t){var e=t[0];return"ACLMQZ".includes(e)}))}var me={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function ve(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),i=t.data;i.length>=de[n]&&("m"===n&&i.length>2?(t.segments.push([e].concat(i.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(i.splice(0,de[n]))),de[n]););}function ye(t){var e=t.index,n=t.pathValue,i=n.charCodeAt(e);return 48===i?(t.param=0,void(t.index+=1)):49===i?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'.concat(n[e],'", expecting 0 or 1 at index ').concat(e))}function xe(t){return t>=48&&t<=57||43===t||45===t||46===t}function be(t){return t>=48&&t<=57}function _e(t){var e,n=t.max,i=t.pathValue,r=t.index,a=r,o=!1,s=!1,l=!1,u=!1;if(a>=n)t.err="[path-util]: Invalid path value at index ".concat(a,', "pathValue" is missing param');else if(43!==(e=i.charCodeAt(a))&&45!==e||(a+=1,e=i.charCodeAt(a)),be(e)||46===e){if(46!==e){if(o=48===e,a+=1,e=i.charCodeAt(a),o&&a=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function we(t){var e=t.max,n=t.pathValue,i=t.index,r=n.charCodeAt(i),a=de[n[i].toLowerCase()];if(t.segmentStart=i,function(t){switch(32|t){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}}(r))if(t.index+=1,Ee(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|r)||3!==o&&4!==o?_e(t):ye(t),t.err.length)return;t.data.push(t.param),Ee(t),t.index=t.max)break;if(!xe(n.charCodeAt(t.index)))break}ve(t)}else ve(t);else t.err='[path-util]: Invalid path value "'.concat(n[i],'" is not a path command')}var Te=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function Se(t){if(pe(t))return[].concat(t);var e=function(t){if(fe(t))return[].concat(t);var e=new Te(t);for(Ee(e);e.index=a)o={x:n,y:i};else{var s=Ae([t,e],[n,i],r/a);o={x:s[0],y:s[1]}}return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,i)},max:{x:Math.max(t,n),y:Math.max(e,i)}}}function Ne(t,e){var n=t.x,i=t.y,r=e.x,a=e.y,o=n*r+i*a,s=Math.sqrt((Math.pow(n,2)+Math.pow(i,2))*(Math.pow(r,2)+Math.pow(a,2)));return(n*a-i*r<0?-1:1)*Math.acos(o/s)}function Pe(t,e,n,i,r,a,o,s,l,u){var c=Math.abs,h=Math.sin,d=Math.cos,f=Math.sqrt,p=Math.PI,g=c(n),m=c(i),v=(r%360+360)%360*(p/180);if(t===s&&e===l)return{x:t,y:e};if(0===g||0===m)return Oe(t,e,s,l,u).point;var y=(t-s)/2,x=(e-l)/2,b={x:d(v)*y+h(v)*x,y:-h(v)*y+d(v)*x},_=Math.pow(b.x,2)/Math.pow(g,2)+Math.pow(b.y,2)/Math.pow(m,2);_>1&&(g*=f(_),m*=f(_));var E=(Math.pow(g,2)*Math.pow(m,2)-Math.pow(g,2)*Math.pow(b.y,2)-Math.pow(m,2)*Math.pow(b.x,2))/(Math.pow(g,2)*Math.pow(b.y,2)+Math.pow(m,2)*Math.pow(b.x,2)),w=(a!==o?1:-1)*f(E=E<0?0:E),T=w*(g*b.y/m),S=w*(-m*b.x/g),M=d(v)*T-h(v)*S+(t+s)/2,C=h(v)*T+d(v)*S+(e+l)/2,A={x:(b.x-T)/g,y:(b.y-S)/m},O=Ne({x:1,y:0},A),N=Ne(A,{x:(-b.x-T)/g,y:(-b.y-S)/m});!o&&N>0?N-=2*p:o&&N<0&&(N+=2*p);var P=O+(N%=2*p)*u,L=g*d(P),R=m*h(P);return{x:d(v)*L-h(v)*R+M,y:h(v)*L+d(v)*R+C}}function Le(t,e,n,i,r,a,o,s,l,u,c){var h,d=c.bbox,f=void 0===d||d,p=c.length,g=void 0===p||p,m=c.sampleSize,v=void 0===m?30:m,y="number"==typeof u,x=t,b=e,_=0,E=[x,b,_],w=[x,b],T={x:0,y:0},S=[{x:x,y:b}];y&&u<=0&&(T={x:x,y:b});for(var M=0;M<=v;M+=1){if(x=(h=Pe(t,e,n,i,r,a,o,s,l,M/v)).x,b=h.y,f&&S.push({x:x,y:b}),g&&(_+=se(w,[x,b])),w=[x,b],y&&_>=u&&u>E[2]){var C=(_-u)/(_-E[2]);T={x:w[0]*(1-C)+E[0]*C,y:w[1]*(1-C)+E[1]*C}}E=[x,b,_]}return y&&u>=_&&(T={x:s,y:l}),{length:_,point:T,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Re(t,e,n,i,r,a,o,s,l){var u=1-l;return{x:Math.pow(u,3)*t+3*Math.pow(u,2)*l*n+3*u*Math.pow(l,2)*r+Math.pow(l,3)*o,y:Math.pow(u,3)*e+3*Math.pow(u,2)*l*i+3*u*Math.pow(l,2)*a+Math.pow(l,3)*s}}function De(t,e,n,i,r,a,o,s,l,u){var c,h=u.bbox,d=void 0===h||h,f=u.length,p=void 0===f||f,g=u.sampleSize,m=void 0===g?10:g,v="number"==typeof l,y=t,x=e,b=0,_=[y,x,b],E=[y,x],w={x:0,y:0},T=[{x:y,y:x}];v&&l<=0&&(w={x:y,y:x});for(var S=0;S<=m;S+=1){if(y=(c=Re(t,e,n,i,r,a,o,s,S/m)).x,x=c.y,d&&T.push({x:y,y:x}),p&&(b+=se(E,[y,x])),E=[y,x],v&&b>=l&&l>_[2]){var M=(b-l)/(b-_[2]);w={x:E[0]*(1-M)+_[0]*M,y:E[1]*(1-M)+_[1]*M}}_=[y,x,b]}return v&&l>=b&&(w={x:o,y:s}),{length:b,point:w,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function ke(t,e,n,i,r,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*r,y:Math.pow(s,2)*e+2*s*o*i+Math.pow(o,2)*a}}function Ie(t,e,n,i,r,a,o,s){var l,u=s.bbox,c=void 0===u||u,h=s.length,d=void 0===h||h,f=s.sampleSize,p=void 0===f?10:f,g="number"==typeof o,m=t,v=e,y=0,x=[m,v,y],b=[m,v],_={x:0,y:0},E=[{x:m,y:v}];g&&o<=0&&(_={x:m,y:v});for(var w=0;w<=p;w+=1){if(m=(l=ke(t,e,n,i,r,a,w/p)).x,v=l.y,c&&E.push({x:m,y:v}),d&&(y+=se(b,[m,v])),b=[m,v],g&&y>=o&&o>x[2]){var T=(y-o)/(y-x[2]);_={x:b[0]*(1-T)+x[0]*T,y:b[1]*(1-T)+x[1]*T}}x=[m,v,y]}return g&&o>=y&&(_={x:r,y:a}),{length:y,point:_,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function Be(t,e,n){for(var i,r,a,o,s,l,u,c,h,d=Ce(t),f="number"==typeof e,p=[],g=0,m=0,v=0,y=0,x=[],b=[],_=0,E={x:0,y:0},w=E,T=E,S=E,M=0,C=0,A=d.length;C=e&&(S=T),b.push(w),x.push(E),M+=_,g=(l="Z"!==c?h.slice(-2):[v,y])[0],m=l[1];return f&&e>=M&&(S={x:g,y:m}),{length:M,point:S,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}var Fe=n(1623),ze=function(t){if((0,Fe.Z)(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])};function Ge(t){if(!Array.isArray(t))return-1/0;var e=t.length;if(!e)return-1/0;for(var n=t[0],i=1;i7){t[n].shift();for(var i=t[n],r=n;i.length;)e[n]="A",t.splice(r+=1,0,["C"].concat(i.splice(0,6)));t.splice(n,1)}}function Ve(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Ze(t,e,n,i,r,a,o,s,l,u){var c,h,d,f,p,g=t,m=e,v=n,y=i,x=s,b=l,_=120*Math.PI/180,E=Math.PI/180*(+r||0),w=[];if(u)h=u[0],d=u[1],f=u[2],p=u[3];else{g=(c=Ve(g,m,-E)).x,m=c.y;var T=(g-(x=(c=Ve(x,b,-E)).x))/2,S=(m-(b=c.y))/2,M=T*T/(v*v)+S*S/(y*y);M>1&&(v*=M=Math.sqrt(M),y*=M);var C=v*v,A=y*y,O=(a===o?-1:1)*Math.sqrt(Math.abs((C*A-C*S*S-A*T*T)/(C*S*S+A*T*T)));f=O*v*S/y+(g+x)/2,p=O*-y*T/v+(m+b)/2,h=Math.asin(((m-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),d=Math.asin(((b-p)/y*Math.pow(10,9)>>0)/Math.pow(10,9)),h=gd&&(h-=2*Math.PI),!o&&d>h&&(d-=2*Math.PI)}var N=d-h;if(Math.abs(N)>_){var P=d,L=x,R=b;d=h+_*(o&&d>h?1:-1),w=Ze(x=f+v*Math.cos(d),b=p+y*Math.sin(d),v,y,r,0,o,L,R,[d,P,f,p])}N=d-h;var D=Math.cos(h),k=Math.sin(h),I=Math.cos(d),B=Math.sin(d),F=Math.tan(N/4),z=4/3*v*F,G=4/3*y*F,j=[g,m],U=[g+z*k,m-G*D],H=[x+z*B,b-G*I],V=[x,b];if(U[0]=2*j[0]-U[0],U[1]=2*j[1]-U[1],u)return U.concat(H,V,w);for(var Z=[],W=0,X=(w=U.concat(H,V,w)).length;W=d[e],f[e]-=p?1:0,p?t.ss:[t.s]})).flat()}));return g[0].length===g[1].length?g:$e(g[0],g[1],h)}function Ke(t){return function(t){var e=0,n=0,i=0;return Ye(t).map((function(t){var r;if("M"===t[0])return e=t[1],n=t[2],0;var a=t.slice(1),o=a[0],s=a[1],l=a[2],u=a[3],c=a[4],h=a[5];return i=function(t,e,n,i,r,a,o,s){return 3*((s-e)*(n+r)-(o-t)*(i+a)+i*(t-r)-n*(e-a)+s*(r+t/3)-o*(a+e/3))/20}(e,n,o,s,l,u,c,h),r=t.slice(-2),e=r[0],n=r[1],i})).reduce((function(t,e){return t+e}),0)}(t)>=0}var Qe=function(t){return void 0===t},Je=n(25737),tn=function(t){return(0,Je.Z)(t,"Boolean")},en=n(77817),nn=n(85266);function rn(t,e,n){return Be(t,e,(0,he.pi)((0,he.pi)({},n),{bbox:!1,length:!0})).point}var an=n(80962);function on(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=(0,u.Z)(t)););return t}function sn(){return sn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=on(t,e);if(i){var r=Object.getOwnPropertyDescriptor(i,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},sn.apply(null,arguments)}function ln(t,e,n,i){var r=sn((0,u.Z)(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof r?function(t){return r.apply(n,t)}:r}function un(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function cn(t,e){var n=Object.create(t.prototype);for(var i in e)n[i]=e[i];return n}function hn(){}var dn=.7,fn=1/dn,pn="\\s*([+-]?\\d+)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",mn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",vn=/^#([0-9a-f]{3,8})$/,yn=new RegExp("^rgb\\(".concat(pn,",").concat(pn,",").concat(pn,"\\)$")),xn=new RegExp("^rgb\\(".concat(mn,",").concat(mn,",").concat(mn,"\\)$")),bn=new RegExp("^rgba\\(".concat(pn,",").concat(pn,",").concat(pn,",").concat(gn,"\\)$")),_n=new RegExp("^rgba\\(".concat(mn,",").concat(mn,",").concat(mn,",").concat(gn,"\\)$")),En=new RegExp("^hsl\\(".concat(gn,",").concat(mn,",").concat(mn,"\\)$")),wn=new RegExp("^hsla\\(".concat(gn,",").concat(mn,",").concat(mn,",").concat(gn,"\\)$")),Tn={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};function Sn(){return this.rgb().formatHex()}function Mn(){return this.rgb().formatRgb()}function Cn(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=vn.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?An(e):3===n?new Pn(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?On(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?On(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=yn.exec(t))?new Pn(e[1],e[2],e[3],1):(e=xn.exec(t))?new Pn(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=bn.exec(t))?On(e[1],e[2],e[3],e[4]):(e=_n.exec(t))?On(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=En.exec(t))?Bn(e[1],e[2]/100,e[3]/100,1):(e=wn.exec(t))?Bn(e[1],e[2]/100,e[3]/100,e[4]):Tn.hasOwnProperty(t)?An(Tn[t]):"transparent"===t?new Pn(NaN,NaN,NaN,0):null}function An(t){return new Pn(t>>16&255,t>>8&255,255&t,1)}function On(t,e,n,i){return i<=0&&(t=e=n=NaN),new Pn(t,e,n,i)}function Nn(t){return t instanceof hn||(t=Cn(t)),t?new Pn((t=t.rgb()).r,t.g,t.b,t.opacity):new Pn}function Pn(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}function Ln(){return"#".concat(In(this.r)).concat(In(this.g)).concat(In(this.b))}function Rn(){var t=Dn(this.opacity);return"".concat(1===t?"rgb(":"rgba(").concat(kn(this.r),", ").concat(kn(this.g),", ").concat(kn(this.b)).concat(1===t?")":", ".concat(t,")"))}function Dn(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function kn(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function In(t){return((t=kn(t))<16?"0":"")+t.toString(16)}function Bn(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new zn(t,e,n,i)}function Fn(t){if(t instanceof zn)return new zn(t.h,t.s,t.l,t.opacity);if(t instanceof hn||(t=Cn(t)),!t)return new zn;if(t instanceof zn)return t;var e=(t=t.rgb()).r/255,n=t.g/255,i=t.b/255,r=Math.min(e,n,i),a=Math.max(e,n,i),o=NaN,s=a-r,l=(a+r)/2;return s?(o=e===a?(n-i)/s+6*(n0&&l<1?0:o,new zn(o,s,l,t.opacity)}function zn(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}function Gn(t){return(t=(t||0)%360)<0?t+360:t}function jn(t){return Math.max(0,Math.min(1,t||0))}function Un(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Hn(t,e,n,i){var r=t-n,a=e-i;return Math.sqrt(r*r+a*a)}function Vn(t,e){var n=Math.min.apply(Math,(0,he.ev)([],(0,he.CR)(t),!1)),i=Math.min.apply(Math,(0,he.ev)([],(0,he.CR)(e),!1));return{x:n,y:i,width:Math.max.apply(Math,(0,he.ev)([],(0,he.CR)(t),!1))-n,height:Math.max.apply(Math,(0,he.ev)([],(0,he.CR)(e),!1))-i}}function Zn(t,e,n,i,r,a){return n*Math.cos(r)*Math.cos(a)-i*Math.sin(r)*Math.sin(a)+t}function Wn(t,e,n,i,r,a){return n*Math.sin(r)*Math.cos(a)+i*Math.cos(r)*Math.sin(a)+e}function Xn(t,e,n,i,r,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,i,r),l=1/0,u=-1/0,c=[a,o],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var d=s+h;au&&(u=f)}var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,i,r),g=1/0,m=-1/0,v=[a,o];for(h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var y=p+h;am&&(m=x)}return{x:l,y:g,width:u-l,height:m-g}}un(hn,Cn,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Sn,formatHex:Sn,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Fn(this).formatHsl()},formatRgb:Mn,toString:Mn}),un(Pn,(function(t,e,n,i){return 1===arguments.length?Nn(t):new Pn(t,e,n,null==i?1:i)}),cn(hn,{brighter:function(t){return t=null==t?fn:Math.pow(fn,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?dn:Math.pow(dn,t),new Pn(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},clamp:function(){return new Pn(kn(this.r),kn(this.g),kn(this.b),Dn(this.opacity))},displayable:function(){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:Ln,formatHex:Ln,formatHex8:function(){return"#".concat(In(this.r)).concat(In(this.g)).concat(In(this.b)).concat(In(255*(isNaN(this.opacity)?1:this.opacity)))},formatRgb:Rn,toString:Rn})),un(zn,(function(t,e,n,i){return 1===arguments.length?Fn(t):new zn(t,e,n,null==i?1:i)}),cn(hn,{brighter:function(t){return t=null==t?fn:Math.pow(fn,t),new zn(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?dn:Math.pow(dn,t),new zn(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,r=2*n-i;return new Pn(Un(t>=240?t-240:t+120,r,i),Un(t,r,i),Un(t<120?t+240:t-120,r,i),this.opacity)},clamp:function(){return new zn(Gn(this.h),jn(this.s),jn(this.l),Dn(this.opacity))},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=Dn(this.opacity);return"".concat(1===t?"hsl(":"hsla(").concat(Gn(this.h),", ").concat(100*jn(this.s),"%, ").concat(100*jn(this.l),"%").concat(1===t?")":", ".concat(t,")"))}}));function Yn(t,e,n,i,r,a){var o=-1,s=1/0,l=[n,i],u=20;a&&a>200&&(u=a/10);for(var c=1/u,h=c/10,d=0;d<=u;d++){var f=d*c,p=[r.apply(void 0,(0,he.ev)([],(0,he.CR)(t.concat([f])),!1)),r.apply(void 0,(0,he.ev)([],(0,he.CR)(e.concat([f])),!1))];(y=Hn(l[0],l[1],p[0],p[1]))=0&&y0&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r}(s,s);var l=[r-t,a-e];return Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}(l,s))}function Qn(t,e,n,i,r){var a=1-r;return a*a*a*t+3*e*r*a*a+3*n*r*r*a+i*r*r*r}function Jn(t,e,n,i){var r,a,o,s=-3*t+9*e-9*n+3*i,l=6*t-12*e+6*n,u=3*e-3*t,c=[];if(je(s,0))je(l,0)||(r=-u/l)>=0&&r<=1&&c.push(r);else{var h=l*l-4*s*u;je(h,0)?c.push(-l/(2*s)):h>0&&(a=(-l-(o=Math.sqrt(h)))/(2*s),(r=(-l+o)/(2*s))>=0&&r<=1&&c.push(r),a>=0&&a<=1&&c.push(a))}return c}function ti(t,e,n,i,r,a,o,s){for(var l=[t,o],u=[e,s],c=Jn(t,n,r,o),h=Jn(e,i,a,s),d=0;d=0?[r]:[]}function ai(t,e,n,i,r,a){var o=ri(t,n,r)[0],s=ri(e,i,a)[0],l=[t,r],u=[e,a];return void 0!==o&&l.push(ii(t,n,r,o)),void 0!==s&&u.push(ii(e,i,a,s)),Vn(l,u)}function oi(t,e,n,i,r,a,o,s){var l=function(t,e,n,i,r,a,o,s){return Yn([t,n,r],[e,i,a],o,s,ii)}(t,e,n,i,r,a,o,s);return Hn(l.x,l.y,o,s)}var si=n(50204),li=n(20959),ui=n(36541);function ci(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=(0,ui.Z)(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}var hi=n(19149),di=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self&&self,{exports:{}});di.exports=function(){function t(t,n,r,a,o){e(t,n,r||0,a||t.length-1,o||i)}function e(t,i,r,a,o){for(;a>r;){if(a-r>600){var s=a-r+1,l=i-r+1,u=Math.log(s),c=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*c*(s-c)/s)*(l-s/2<0?-1:1);e(t,i,Math.max(r,Math.floor(i-l*c/s+h)),Math.min(a,Math.floor(i+(s-l)*c/s+h)),o)}var d=t[i],f=r,p=a;for(n(t,r,i),o(t[a],d)>0&&n(t,r,a);f0;)p--}0===o(t[r],d)?n(t,r,p):n(t,++p,a),p<=i&&(r=p+1),i<=p&&(a=p-1)}}function n(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function i(t,e){return te?1:0}var r=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i=t.minX&&e.maxY>=t.minY}function v(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,i,r,a){for(var o=[n,i];o.length;)if(!((i=o.pop())-(n=o.pop())<=r)){var s=n+Math.ceil((i-n)/r/2)*r;t(e,s,n,i,a),o.push(n,s,s,i)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var i=this.toBBox,r=[];e;){for(var a=0;a=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)},r.prototype._split=function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var a=this._chooseSplitIndex(n,r,i),s=v(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(t,e){this.data=v([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(t,e,n){for(var i,r=1/0,a=1/0,o=e;o<=n-e;o++){var l=s(t,0,o,this.toBBox),u=s(t,o,n,this.toBBox),c=p(l,u),d=h(l)+h(u);c=e;f--){var p=t.children[f];l(o,t.leaf?r(p):p),u+=d(o)}return u},r.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)l(e[i],t)},r.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},r}();var fi=di.exports,pi=function(t){return t.GROUP="g",t.FRAGMENT="fragment",t.CIRCLE="circle",t.ELLIPSE="ellipse",t.IMAGE="image",t.RECT="rect",t.LINE="line",t.POLYLINE="polyline",t.POLYGON="polygon",t.TEXT="text",t.PATH="path",t.HTML="html",t.MESH="mesh",t}({}),gi=function(t){return t[t.ZERO=0]="ZERO",t[t.NEGATIVE_ONE=1]="NEGATIVE_ONE",t}({}),mi=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.plugins=[]}),[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value:function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);n>=0&&t.context.renderingPlugins.splice(n,1)}))}}])}(),vi=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.clipSpaceNearZ=gi.NEGATIVE_ONE,this.plugins=[],this.config=(0,a.Z)({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0,enableRenderingOptimization:!1},e)}),[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}])}(),yi=T,xi=E,bi=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t},_i=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t},Ei=C,wi=I,Ti=function(){function t(){(0,o.Z)(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return(0,s.Z)(t,[{key:"update",value:function(t,e){xi(this.center,t),xi(this.halfExtents,e),wi(this.min,this.center,this.halfExtents),yi(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){yi(this.center,e,t),Ei(this.center,this.center,.5),wi(this.halfExtents,e,t),Ei(this.halfExtents,this.halfExtents,.5),xi(this.min,t),xi(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value:function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,i=n[0],r=n[1],a=n[2],o=this.halfExtents,s=o[0],l=o[1],u=o[2],c=i-s,h=i+s,d=r-l,f=r+l,p=a-u,g=a+u,m=e.center,v=m[0],y=m[1],x=m[2],b=e.halfExtents,_=b[0],E=b[1],w=b[2],T=v-_,S=v+_,M=y-E,C=y+E,A=x-w,O=x+w;Th&&(h=S),Mf&&(f=C),Ag&&(g=O),n[0]=.5*(c+h),n[1]=.5*(d+f),n[2]=.5*(p+g),o[0]=.5*(h-c),o[1]=.5*(f-d),o[2]=.5*(g-p),this.min[0]=c,this.min[1]=d,this.min[2]=p,this.max[0]=h,this.max[1]=f,this.max[2]=g}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,i=this.halfExtents,r=t.center,a=t.halfExtents,o=e[0],s=e[4],l=e[8],u=e[1],c=e[5],h=e[9],d=e[2],f=e[6],p=e[10],g=Math.abs(o),m=Math.abs(s),v=Math.abs(l),y=Math.abs(u),x=Math.abs(c),b=Math.abs(h),_=Math.abs(d),E=Math.abs(f),w=Math.abs(p);n[0]=e[12]+o*r[0]+s*r[1]+l*r[2],n[1]=e[13]+u*r[0]+c*r[1]+h*r[2],n[2]=e[14]+d*r[0]+f*r[1]+p*r[2],i[0]=g*a[0]+m*a[1]+v*a[2],i[1]=y*a[0]+x*a[1]+b*a[2],i[2]=_*a[0]+E*a[1]+w*a[2],wi(this.min,n,i),yi(this.max,n,i)}},{key:"intersects",value:function(t){var e=this.getMax(),n=this.getMin(),i=t.getMax(),r=t.getMin();return n[0]<=i[0]&&e[0]>=r[0]&&n[1]<=i[1]&&e[1]>=r[1]&&n[2]<=i[2]&&e[2]>=r[2]}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n=new t,i=bi([0,0,0],this.getMin(),e.getMin()),r=_i([0,0,0],this.getMax(),e.getMax());return n.setMinMax(i,r),n}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?xi([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?xi([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}])}(),Si=function(){return(0,s.Z)((function t(e,n){(0,o.Z)(this,t),this.distance=e||0,this.normal=n||_(0,1,0),this.updatePNVertexFlag()}),[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return O(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/F(this.normal);C(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var i=this.distanceToPoint(t),r=i/(i-this.distanceToPoint(e)),a=r>=0&&r<=1;return a&&n&&P(n,t,e,r),a}}])}(),Mi=function(t){return t[t.OUTSIDE=4294967295]="OUTSIDE",t[t.INSIDE=0]="INSIDE",t[t.INDETERMINATE=2147483647]="INDETERMINATE",t}({}),Ci=function(){return(0,s.Z)((function t(e){if((0,o.Z)(this,t),this.planes=[],e)this.planes=e;else for(var n=0;n<6;n++)this.planes.push(new Si)}),[{key:"extractFromVPMatrix",value:function(t){var e=(0,p.Z)(t,16),n=e[0],i=e[1],r=e[2],a=e[3],o=e[4],s=e[5],l=e[6],u=e[7],c=e[8],h=e[9],d=e[10],f=e[11],g=e[12],m=e[13],v=e[14],y=e[15];w(this.planes[0].normal,a-n,u-o,f-c),this.planes[0].distance=y-g,w(this.planes[1].normal,a+n,u+o,f+c),this.planes[1].distance=y+g,w(this.planes[2].normal,a+i,u+s,f+h),this.planes[2].distance=y+m,w(this.planes[3].normal,a-i,u-s,f-h),this.planes[3].distance=y-m,w(this.planes[4].normal,a-r,u-l,f-d),this.planes[4].distance=y-v,w(this.planes[5].normal,a+r,u+l,f+d),this.planes[5].distance=y+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}])}(),Ai=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,o.Z)(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return(0,s.Z)(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}])}(),Oi=function(){function t(e,n,i,r){(0,o.Z)(this,t),this.x=e,this.y=n,this.width=i,this.height=r,this.left=e,this.right=e+i,this.top=n,this.bottom=n+r}return(0,s.Z)(t,[{key:"toJSON",value:function(){}}],[{key:"fromRect",value:function(e){return new t(e.x,e.y,e.width,e.height)}},{key:"applyTransform",value:function(e,n){var i=G(e.x,e.y,0,1),r=G(e.x+e.width,e.y,0,1),a=G(e.x,e.y+e.height,0,1),o=G(e.x+e.width,e.y+e.height,0,1),s=z(),l=z(),u=z(),c=z();j(s,i,n),j(l,r,n),j(u,a,n),j(c,o,n);var h=Math.min(s[0],l[0],u[0],c[0]),d=Math.min(s[1],l[1],u[1],c[1]),f=Math.max(s[0],l[0],u[0],c[0]),p=Math.max(s[1],l[1],u[1],c[1]);return t.fromRect({x:h,y:d,width:f-h,height:p-d})}}])}(),Ni="Method not implemented.",Pi="Use document.documentElement instead.";function Li(t){return void 0===t?0:t>360||t<-360?t%360:t}var Ri=y();function Di(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return Array.isArray(t)&&3===t.length?i?x(t):E(Ri,t):(0,oe.Z)(t)?i?_(t,e,n):w(Ri,t,e,n):i?_(t[0],t[1]||e,t[2]||n):w(Ri,t[0],t[1]||e,t[2]||n)}var ki=Math.PI/180;function Ii(t){return t*ki}var Bi=180/Math.PI;function Fi(t){return t*Bi}var zi=Math.PI/2;function Gi(t,e){return 16===e.length?function(t,e){var n,i,r=pt(y(),e),a=(0,p.Z)(r,3),o=a[0],s=a[1],l=a[2],u=Math.asin(-e[2]/o);return u-zi?(n=Math.atan2(e[6]/s,e[10]/l),i=Math.atan2(e[1]/o,e[0]/o)):(i=0,n=-Math.atan2(e[4]/s,e[5]/s)):(i=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=u,t[2]=i,t}(t,e):function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=i*i,s=r*r,l=a*a,u=n*n+o+s+l,c=n*a-i*r;return c>.499995*u?(t[0]=zi,t[1]=2*Math.atan2(i,n),t[2]=0):c<-.499995*u?(t[0]=-zi,t[1]=2*Math.atan2(i,n),t[2]=0):(t[0]=Math.asin(2*(n*r-a*i)),t[1]=Math.atan2(2*(n*a+i*r),1-2*(s+l)),t[2]=Math.atan2(2*(n*i+r*a),1-2*(o+s))),t}(t,e)}function ji(t,e,n,i,r){var a,o,s,l,u,c,h,d,f,p,g=Math.cos(t),m=Math.sin(t);return a=i*g,o=r*m,s=0,l=-i*m,u=r*g,c=0,h=e,d=n,f=1,(p=new v(9))[0]=a,p[1]=o,p[2]=s,p[3]=l,p[4]=u,p[5]=c,p[6]=h,p[7]=d,p[8]=f,p}function Ui(t){var e=t[0],n=t[1],i=t[3],r=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(i*i+r*r);if(e*r-n*i<0&&(e7&&void 0!==arguments[7]&&arguments[7],c=2*a,h=n-e,d=i-r,f=c/h,p=c/d,g=(n+e)/h,m=(i+r)/d,v=o-a,y=o*a;u?(s=-o/v,l=-y/v):(s=-(o+a)/v,l=-2*y/v),t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=p,t[6]=0,t[7]=0,t[8]=g,t[9]=m,t[10]=s,t[11]=-1,t[12]=0,t[13]=0,t[14]=l,t[15]=0}(this.projectionMatrix,l,l+s,a-o,a,t,this.far,this.clipSpaceNearZ===gi.ZERO),q(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(t,e,n,i,r,a){var o;this.projectionMode=Ki.ORTHOGRAPHIC,this.rright=e,this.left=t,this.top=n,this.bottom=i,this.near=r,this.far=a;var s=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,c=(this.top+this.bottom)/2,h=u-s,d=u+s,f=c+l,p=c-l;if(null!==(o=this.view)&&void 0!==o&&o.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d=(h+=g*this.view.offsetX)+g*this.view.width,p=(f-=m*this.view.offsetY)-m*this.view.height}return this.clipSpaceNearZ===gi.NEGATIVE_ONE?St(this.projectionMatrix,h,d,f,p,r,a):Mt(this.projectionMatrix,h,d,f,p,r,a),q(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2],i=Di(t,e,n);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],i=_(0,1,0);if(this.focalPoint=Di(t,e,n),this.trackingMode===$i.CINEMATIC){var r=S(y(),this.focalPoint,this.position);t=r[0],e=r[1],n=r[2];var a=b(r),o=Fi(Math.asin(e/a)),s=90+Fi(Math.atan2(n,t)),l=U();it(l,l,Ii(s)),nt(l,l,Ii(o)),i=L(y(),[0,1,0],l)}return q(this.matrix,Ct(U(),this.position,this.focalPoint,i)),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(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance=hr.kUnitType&&this.getType()<=hr.kClampType}}],[{key:"isAngle",value:function(t){return t===or.kDegrees||t===or.kRadians||t===or.kGradians||t===or.kTurns}},{key:"isLength",value:function(t){return t>=or.kEms&&t1&&void 0!==arguments[1]?arguments[1]:or.kNumber;return(0,o.Z)(this,e),n=d(this,e),i="string"==typeof r?dr(r):r,n.unit=i,n.value=t,n}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.value,this.unit)}},{key:"equals",value:function(t){var e=t;return this.value===e.value&&this.unit===e.unit}},{key:"getType",value:function(){return hr.kUnitType}},{key:"convertTo",value:function(t){if(this.unit===t)return new e(this.value,this.unit);var n=br(this.unit);if(n!==br(t)||n===or.kUnknown)return null;var i=fr(this.unit)/fr(t);return new e(this.value*i,t)}},{key:"buildCSSText",value:function(t,e,n){var i;switch(this.unit){case or.kUnknown:break;case or.kInteger:i=Number(this.value).toFixed(0);break;case or.kNumber:case or.kPercentage:case or.kEms:case or.kRems:case or.kPixels:case or.kDegrees:case or.kRadians:case or.kGradians:case or.kMilliseconds:case or.kSeconds:case or.kTurns:var r=this.value,a=pr(this.unit);if(r<-999999||r>999999){var o=pr(this.unit);i=!Number.isFinite(r)||Number.isNaN(r)?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(Number.isFinite(t)?"NaN":t>0?"infinity":"-infinity")+e}(r,o):r+(o||"")}else i="".concat(r).concat(a)}return n+=i}}])}(gr),Er=new _r(0,"px");new _r(1,"px");var wr=new _r(0,"deg"),Tr=function(t){function e(t,n,i){var r,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return(0,o.Z)(this,e),(r=d(this,e,["rgb"])).r=t,r.g=n,r.b=i,r.alpha=a,r.isNone=s,r}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"clone",value:function(){return new e(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return"".concat(n,"rgba(").concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}])}(mr),Sr=new xr("unset"),Mr={"":Sr,unset:Sr,initial:new xr("initial"),inherit:new xr("inherit")},Cr=new Tr(0,0,0,0,!0),Ar=new Tr(0,0,0,0),Or=ar((function(t,e,n,i){return new Tr(t,e,n,i)}),(function(t,e,n,i){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(i,")")})),Nr=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:or.kNumber;return new _r(t,e)};function Pr(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}new _r(50,"%");var Lr=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,i=/^(repeating\-radial\-gradient)/i,r=/^(conic\-gradient)/i,a=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,o=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,d=/^\(/,f=/^\)/,p=/^,/,g=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,v=/^rgb/i,y=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,b="";function _(t){throw new Error("".concat(b,": ").concat(t))}function E(){var t=L(w);return b.length>0&&_("Invalid input not EOF"),t}function w(){return T("linear-gradient",t,M)||T("repeating-linear-gradient",e,M)||T("radial-gradient",n,C)||T("repeating-radial-gradient",i,C)||T("conic-gradient",r,C)}function T(t,e,n){return S(e,(function(e){var i=n();return i&&(F(p)||_("Missing comma before color stops")),{type:t,orientation:i,colorStops:L(R)}}))}function S(t,e){var n=F(t);if(n){F(d)||_("Missing (");var i=e(n);return F(f)||_("Missing )"),i}}function M(){return B("directional",a,1)||B("angular",h,1)}function C(){var t,e,n=A();return n&&((t=[]).push(n),e=b,F(p)&&((n=A())?t.push(n):b=e)),t}function A(){var t=function(){var t=B("shape",/^(circle)/i,0);t&&(t.style=I()||O());return t}()||function(){var t=B("shape",/^(ellipse)/i,0);t&&(t.style=k()||O());return t}();if(t)t.at=N();else{var e=O();if(e){t=e;var n=N();n&&(t.at=n)}else{var i=P();i&&(t={type:"default-radial",at:i})}}return t}function O(){return B("extent-keyword",o,1)}function N(){if(B("position",/^at/,0)){var t=P();return t||_("Missing positioning value"),t}}function P(){var t={x:k(),y:k()};if(t.x||t.y)return{type:"position",value:t}}function L(t){var e=t(),n=[];if(e)for(n.push(e);F(p);)(e=t())?n.push(e):_("One extra comma");return n}function R(){var t=B("hex",g,1)||S(y,(function(){return{type:"rgba",value:L(D)}}))||S(v,(function(){return{type:"rgb",value:L(D)}}))||B("literal",m,0);return t||_("Expected color definition"),t.length=k(),t}function D(){return F(x)[1]}function k(){return B("%",u,1)||B("position-keyword",s,1)||I()}function I(){return B("px",l,1)||B("em",c,1)}function B(t,e,n){var i=F(e);if(i)return{type:t,value:i[n]}}function F(t){var e=/^[\n\r\t\s]+/.exec(b);e&&z(e[0].length);var n=t.exec(b);return n&&z(n[0].length),n}function z(t){b=b.substring(t)}return function(t){return b=t,E()}}();var Rr=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Dr=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,kr=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Ir=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Br={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},Fr=ar((function(t){var e;return e="angular"===t.type?Number(t.value):Br[t.value]||0,Nr(e,"deg")})),zr=ar((function(t){var e=50,n=50,i="%",r="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(i=null==o?void 0:o.type,e=Number(o.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(r=null==s?void 0:s.type,n=Number(s.value))}return{cx:Nr(e,i),cy:Nr(n,r)}})),Gr=ar((function(t){if(t.indexOf("linear")>-1||t.indexOf("radial")>-1)return Lr(t).map((function(t){var e=t.type,n=t.orientation,i=t.colorStops;!function(t){var e,n,i=t.length;t[i-1].length=null!==(e=t[i-1].length)&&void 0!==e?e:{type:"%",value:"100"},i>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var r=0,a=Number(t[0].length.value),o=1;o=0)return Nr(Number(e),"px");if("deg".search(t)>=0)return Nr(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U".concat(t)}));var i="U(".concat(t.source,")");return n.map((function(t){return Nr(Number(e.replace(new RegExp("U".concat(t),"g"),"").replace(new RegExp(i,"g"),"*0")),t)}))[0]}var Wr=function(t){return Zr(new RegExp("px","g"),t)},Xr=ar(Wr);ar((function(t){return Zr(new RegExp("%","g"),t)}));var Yr=function(t){return(0,oe.Z)(t)||isFinite(Number(t))?Nr(Number(t)||0,"px"):Zr(new RegExp("px|%|em|rem","g"),t)},qr=ar(Yr),$r=function(t){return Zr(new RegExp("deg|rad|grad|turn","g"),t)},Kr=ar($r);function Qr(t,e,n,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,l=br(t.unit),u=t.convertTo(l),c=e.convertTo(l);return u&&c?(o=u.value,s=c.value,a=pr(t.unit)):(_r.isLength(t.unit)||_r.isLength(e.unit))&&(o=ea(t,r,n),s=ea(e,r,n),a="px"),[o,s,function(t){return i&&(t=Math.max(t,0)),t+a}]}function Jr(t){var e=0;return t.unit===or.kDegrees?e=t.value:t.unit===or.kRadians?e=Fi(Number(t.value)):t.unit===or.kTurns?e=360*Number(t.value):t.value&&(e=t.value),e}function ta(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):(0,ue.Z)(t)?n=t.split(" ").map((function(t){return Number(t)})):(0,oe.Z)(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function ea(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(t.unit===or.kPixels)return Number(t.value);if(t.unit===or.kPercentage&&n){var r=n.nodeName===pi.GROUP?n.getLocalBounds():n.getGeometryBounds();return(i?r.min[e]:0)+t.value/100*r.halfExtents[e]*2}return 0}var na=function(t){return Zr(/deg|rad|grad|turn|px|%/g,t)},ia=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function ra(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,i=[],r=0;e=n.exec(t);){if(e.index!==r)return[];if(r=e.index+e[0].length,ia.indexOf(e[1])>-1&&i.push({name:e[1],params:e[2].split(" ").map((function(t){return na(t)||Hr(t)}))}),n.lastIndex===t.length)return i}return[]}function aa(t){return t.toString()}var oa=function(t){return"number"==typeof t?Nr(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Nr(Number(t)):Nr(0)},sa=ar(oa);function la(t,e){return[t,e,aa]}function ua(t,e){return function(n,i){return[n,i,function(n){return aa(ce(n,t,e))}]}}function ca(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}function ha(t){var e;return 0===t.parsedStyle.d.totalLength&&(t.parsedStyle.d.totalLength=Be(t.parsedStyle.d.absolutePath,void 0,(0,he.pi)((0,he.pi)({},e),{bbox:!1,length:!0})).length),t.parsedStyle.d.totalLength}function da(t){return 0===t.parsedStyle.points.totalLength&&(t.parsedStyle.points.totalLength=ni(t.parsedStyle.points.points)),t.parsedStyle.points.totalLength}function fa(t,e){return t[0]===e[0]&&t[1]===e[1]}function pa(t,e){var n=t.prePoint,i=t.currentPoint,r=t.nextPoint,a=Math.pow(i[0]-n[0],2)+Math.pow(i[1]-n[1],2),o=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(n[0]-r[0],2)+Math.pow(n[1]-r[1],2),l=Math.acos((a+o-s)/(2*Math.sqrt(a)*Math.sqrt(o)));if(!l||0===Math.sin(l)||je(l,0))return{xExtra:0,yExtra:0};var u=Math.abs(Math.atan2(r[1]-i[1],r[0]-i[0])),c=Math.abs(Math.atan2(r[0]-i[0],r[1]-i[1]));return u=u>Math.PI/2?Math.PI-u:u,c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(l/2-u)*(e/2*(1/Math.sin(l/2)))-e/2||0,yExtra:Math.cos(c-l/2)*(e/2*(1/Math.sin(l/2)))-e/2||0}}function ga(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}ar((function(t){return(0,ue.Z)(t)?t.split(" ").map(sa):t.map(sa)}));var ma=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)));return(t.x*e.y-t.y*e.x<0?-1:1)*Math.acos(n/i)},va=function(t,e,n,i,r,a,o,s){e=Math.abs(e),n=Math.abs(n);var l=Ii(i=Ue(i,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var u=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(l)*u+Math.sin(l)*c,y:-Math.sin(l)*u+Math.cos(l)*c},d=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);d>1&&(e*=Math.sqrt(d),n*=Math.sqrt(d));var f=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2));f=f<0?0:f;var p=(r!==a?1:-1)*Math.sqrt(f),g=p*(e*h.y/n),m=p*(-n*h.x/e),v={x:Math.cos(l)*g-Math.sin(l)*m+(t.x+o.x)/2,y:Math.sin(l)*g+Math.cos(l)*m+(t.y+o.y)/2},y={x:(h.x-g)/e,y:(h.y-m)/n},x=ma({x:1,y:0},y),b=ma(y,{x:(-h.x-g)/e,y:(-h.y-m)/n});!a&&b>0?b-=2*Math.PI:a&&b<0&&(b+=2*Math.PI);var _=x+(b%=2*Math.PI)*s,E=e*Math.cos(_),w=n*Math.sin(_);return{x:Math.cos(l)*E-Math.sin(l)*w+v.x,y:Math.sin(l)*E+Math.cos(l)*w+v.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+b,ellipticalArcAngle:_,ellipticalArcCenter:v,resultantRx:e,resultantRy:n}};function ya(t,e){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=t.arcParams,r=i.rx,a=void 0===r?0:r,o=i.ry,s=void 0===o?0:o,l=i.xRotation,u=i.arcFlag,c=i.sweepFlag,h=va({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!u,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),d=va({x:t.prePoint[0],y:t.prePoint[1]},a,s,l,!!u,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),f=d.x-h.x,p=d.y-h.y,g=Math.sqrt(f*f+p*p);return{x:-f/g,y:-p/g}}function xa(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ba(t,e){return xa(t)*xa(e)?(t[0]*e[0]+t[1]*e[1])/(xa(t)*xa(e)):1}function _a(t,e){return(t[0]*e[1]1&&(n*=Math.sqrt(f),i*=Math.sqrt(f));var p=n*n*(d*d)+i*i*(h*h),g=p?Math.sqrt((n*n*(i*i)-p)/p):1;a===o&&(g*=-1),isNaN(g)&&(g=0);var m=i?g*n*d/i:0,v=n?g*-i*h/n:0,y=(s+u)/2+Math.cos(r)*m-Math.sin(r)*v,x=(l+c)/2+Math.sin(r)*m+Math.cos(r)*v,b=[(h-m)/n,(d-v)/i],_=[(-1*h-m)/n,(-1*d-v)/i],E=_a([1,0],b),w=_a(b,_);return ba(b,_)<=-1&&(w=Math.PI),ba(b,_)>=1&&(w=0),0===o&&w>0&&(w-=2*Math.PI),1===o&&w<0&&(w+=2*Math.PI),{cx:y,cy:x,rx:fa(t,[u,c])?0:n,ry:fa(t,[u,c])?0:i,startAngle:E,endAngle:E+w,xRotation:r,arcFlag:a,sweepFlag:o}}var wa=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Ce(t)}catch(n){e=Ce(""),console.error("[g]: Invalid SVG Path definition: ".concat(t))}!function(t){for(var e=0;e0&&n.push(i),{polygons:e,polylines:n}}(e),r=i.polygons,a=i.polylines,o=function(t){for(var e=[],n=null,i=null,r=null,a=0,o=t.length,s=0;s=e&&(s-=n),t[s])}))}))}(l),f.forEach((function(t,e){l.slice(1).forEach((function(t,n){d+=se(l[(e+n)%c].slice(-2),u[n%c].slice(-2))})),h[e]=d,d=0})),f[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Ca(t,e){return{points:(0,ue.Z)(t)?t.split(" ").map((function(t){var e=t.split(","),n=(0,p.Z)(e,2),i=n[0],r=n[1];return[Number(i),Number(r)]})):t,totalLength:0,segments:[]}}function Aa(t,e){return[t.points,e.points,function(t){return t}]}var Oa=null,Na=/\s*(\w+)\(([^)]*)\)/g;function Pa(t){return function(e){var n=0;return t.map((function(t){return t===Oa?e[n++]:t}))}}function La(t){return t}var Ra={matrix:["NNNNNN",[Oa,Oa,0,0,Oa,Oa,0,0,0,0,1,0,Oa,Oa,0,1],La],matrix3d:["NNNNNNNNNNNNNNNN",La],rotate:["A"],rotateX:["A"],rotateY:["A"],rotateZ:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Pa([Oa,Oa,new _r(1)]),La],scaleX:["N",Pa([Oa,new _r(1),new _r(1)]),Pa([Oa,new _r(1)])],scaleY:["N",Pa([new _r(1),Oa,new _r(1)]),Pa([new _r(1),Oa])],scaleZ:["N",Pa([new _r(1),new _r(1),Oa])],scale3d:["NNN",La],skew:["Aa",null,La],skewX:["A",null,Pa([Oa,wr])],skewY:["A",null,Pa([wr,Oa])],translate:["Tt",Pa([Oa,Oa,Er]),La],translateX:["T",Pa([Oa,Er,Er]),Pa([Oa,Er])],translateY:["T",Pa([Er,Oa,Er]),Pa([Er,Oa])],translateZ:["L",Pa([Er,Er,Oa])],translate3d:["TTL",La]};function Da(t){for(var e=[],n=t.length,i=0;iWi[1][2]&&(a[0]=-a[0]),Wi[0][2]>Wi[2][0]&&(a[1]=-a[1]),Wi[1][0]>Wi[0][1]&&(a[2]=-a[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Ba).reduce(Fa)}(t),e,n,i,r,a),[[e,n,i,a,r]]}var Ga=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],i=0;i<4;i++)for(var r=0;r<4;r++)for(var a=0;a<4;a++)n[i][r]+=e[i][a]*t[a][r];return n}return function(e,n,i,r,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;s<4;s++)o[s][3]=a[s];for(var l=0;l<3;l++)for(var u=0;u<3;u++)o[3][l]+=e[u]*o[u][l];var c=r[0],h=r[1],d=r[2],f=r[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(h*h+d*d),p[0][1]=2*(c*h-d*f),p[0][2]=2*(c*d+h*f),p[1][0]=2*(c*h+d*f),p[1][1]=1-2*(c*c+d*d),p[1][2]=2*(h*d-c*f),p[2][0]=2*(c*d-h*f),p[2][1]=2*(h*d+c*f),p[2][2]=1-2*(c*c+h*h),o=t(o,p);var g,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];i[2]&&(m[2][1]=i[2],o=t(o,m)),i[1]&&(m[2][1]=0,m[2][0]=i[0],o=t(o,m)),i[0]&&(m[2][0]=0,m[1][0]=i[0],o=t(o,m));for(var v=0;v<3;v++)for(var y=0;y<3;y++)o[v][y]*=n[v];return 0===(g=o)[0][2]&&0===g[0][3]&&0===g[1][2]&&0===g[1][3]&&0===g[2][0]&&0===g[2][1]&&1===g[2][2]&&0===g[2][3]&&0===g[3][2]&&1===g[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function ja(t){return t.toFixed(6).replace(".000000","")}function Ua(t,e){var n,i;return t.decompositionPair!==e&&(t.decompositionPair=e,n=za(t)),e.decompositionPair!==t&&(e.decompositionPair=t,i=za(e)),null===n[0]||null===i[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),i[0].push(1),[n,i,function(t){var e=function(t,e,n){var i=function(t,e){for(var n=0,i=0;i2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0};Object.assign(t.attributes,e);var i=t.parsedStyle.clipPath,r=t.parsedStyle.offsetPath;Qa(t,e);var o=!!n.forceUpdateGeometry;if(!o)for(var s in e)if(qa.has(s)){o=!0;break}e.fill&&(t.parsedStyle.fill=Hr(e.fill)),e.stroke&&(t.parsedStyle.stroke=Hr(e.stroke)),e.shadowColor&&(t.parsedStyle.shadowColor=Hr(e.shadowColor)),e.filter&&(t.parsedStyle.filter=ra(e.filter)),(0,le.Z)(e.radius)||(t.parsedStyle.radius=ta(e.radius,4)),(0,le.Z)(e.lineDash)||(t.parsedStyle.lineDash=ta(e.lineDash,2)),e.points&&(t.parsedStyle.points=Ca(e.points)),""===e.d&&(t.parsedStyle.d=(0,a.Z)({},ir)),e.d&&(t.parsedStyle.d=Sa(e.d)),e.textTransform&&this.runtime.CSSPropertySyntaxFactory[rr.TEXT_TRANSFORM].calculator(null,null,{value:e.textTransform},t,null),Qe(e.clipPath)||this.runtime.CSSPropertySyntaxFactory[rr.DEFINED_PATH].calculator("clipPath",i,e.clipPath,t,this.runtime),e.offsetPath&&this.runtime.CSSPropertySyntaxFactory[rr.DEFINED_PATH].calculator("offsetPath",r,e.offsetPath,t,this.runtime),e.transform&&(t.parsedStyle.transform=ka(e.transform)),e.transformOrigin&&(t.parsedStyle.transformOrigin=Wa(e.transformOrigin)),e.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory[rr.MARKER].calculator(null,e.markerStart,e.markerStart,null,null)),e.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory[rr.MARKER].calculator(null,e.markerEnd,e.markerEnd,null,null)),e.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory[rr.MARKER].calculator("",e.markerMid,e.markerMid,null,null)),(0,le.Z)(e.zIndex)||this.runtime.CSSPropertySyntaxFactory[rr.Z_INDEX].postProcessor(t),(0,le.Z)(e.offsetDistance)||this.runtime.CSSPropertySyntaxFactory[rr.OFFSET_DISTANCE].postProcessor(t),e.transform&&this.runtime.CSSPropertySyntaxFactory[rr.TRANSFORM].postProcessor(t),e.transformOrigin&&this.runtime.CSSPropertySyntaxFactory[rr.TRANSFORM_ORIGIN].postProcessor(t),o&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,n.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},{key:"updateGeometry",value:function(t){var e=t.nodeName,n=this.runtime.geometryUpdaterFactory[e];if(n){var i=t.geometry;i.contentBounds||(i.contentBounds=new Ti),i.renderBounds||(i.renderBounds=new Ti);var r=t.parsedStyle,a=n.update(r,t),o=a.cx,s=void 0===o?0:o,l=a.cy,u=void 0===l?0:l,c=a.cz,h=void 0===c?0:c,d=a.hwidth,f=void 0===d?0:d,p=a.hheight,g=void 0===p?0:p,m=a.hdepth,v=void 0===m?0:m,y=[Math.abs(f),Math.abs(g),v],x=r.stroke,b=r.lineWidth,_=void 0===b?1:b,E=r.increasedLineWidthForHitTesting,w=void 0===E?0:E,S=r.shadowType,M=void 0===S?"outer":S,C=r.shadowColor,A=r.filter,O=void 0===A?[]:A,N=r.transformOrigin,P=[s,u,h];i.contentBounds.update(P,y);var L=e===pi.POLYLINE||e===pi.POLYGON||e===pi.PATH?Math.SQRT2:.5;if(x&&!x.isNone){var R=((_||0)+(w||0))*L;y[0]+=R,y[1]+=R}if(i.renderBounds.update(P,y),C&&M&&"inner"!==M){var D=i.renderBounds,k=D.min,I=D.max,B=r.shadowBlur||0,F=r.shadowOffsetX||0,z=r.shadowOffsetY||0,G=k[0]-B+F,j=I[0]+B+F,U=k[1]-B+z,H=I[1]+B+z;k[0]=Math.min(k[0],G),I[0]=Math.max(I[0],j),k[1]=Math.min(k[1],U),I[1]=Math.max(I[1],H),i.renderBounds.setMinMax(k,I)}O.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,T(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,l=i.renderBounds,u=l.min,c=l.max,h=u[0]-s+a,d=c[0]+s+a,f=u[1]-s+o,p=c[1]+s+o;u[0]=Math.min(u[0],h),c[0]=Math.max(c[0],d),u[1]=Math.min(u[1],f),c[1]=Math.max(c[1],p),i.renderBounds.setMinMax(u,c)}})),t.geometry.dirty=!1;var V=g<0,Z=(f<0?-1:1)*(N?ea(N[0],0,t,!0):0),W=(V?-1:1)*(N?ea(N[1],1,t,!0):0);(Z||W)&&t.setOrigin(Z,W)}}},{key:"updateSizeAttenuation",value:function(t,e){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/e,t.nodeName===pi.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/e)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===pi.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))}}])}();function Qa(t,e){if(al.enableMassiveParsedStyleAssignOptimization){var n=t.constructor.PARSED_STYLE_LIST;for(var i in e)n.has(i)&&(t.parsedStyle[i]=e[i])}else Object.assign(t.parsedStyle,e)}var Ja=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=la}),[{key:"calculator",value:function(t,e,n,i){return Jr(n)}}])}(),to=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,i,r){return n instanceof xr&&(n=null),r.sceneGraphService.updateDisplayObjectDependency(t,e,n,i),"clipPath"===t&&i.forEach((function(t){0===t.childNodes.length&&r.sceneGraphService.dirtifyToRoot(t)})),n}}])}(),eo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.parser=Hr,this.mixer=Vr}),[{key:"calculator",value:function(t,e,n,i){return n instanceof xr?"none"===n.value?Cr:Ar:n}}])}(),no=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n){return n instanceof xr?[]:n}}])}();function io(t){var e=t.parsedStyle.fontSize;return(0,le.Z)(e)?null:e}var ro=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=la}),[{key:"calculator",value:function(t,e,n,i,r){if((0,oe.Z)(n))return n;if(!_r.isRelativeUnit(n.unit))return n.value;if(n.unit===or.kPercentage)return 0;if(n.unit===or.kEms){if(i.parentNode){var a=io(i.parentNode);if(a)return a*=n.value}return 0}if(n.unit===or.kRems){var o;if(null!=i&&null!==(o=i.ownerDocument)&&void 0!==o&&o.documentElement){var s=io(i.ownerDocument.documentElement);if(s)return s*=n.value}return 0}}}])}(),ao=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ca}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),oo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ca}),[{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}])}(),so=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"calculator",value:function(t,e,n,i){var r;n instanceof xr&&(n=null);var a=null===(r=n)||void 0===r?void 0:r.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}])}(),lo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=la}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),uo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ua(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value:function(t){var e=t.parsedStyle,n=e.offsetPath,i=e.offsetDistance;if(n){var r=n.nodeName;if(r===pi.LINE||r===pi.PATH||r===pi.POLYLINE){var a=n.getPoint(i);a&&t.setLocalPosition(a.x,a.y)}}}}])}(),co=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=ua(0,1)}),[{key:"calculator",value:function(t,e,n){return n.value}}])}(),ho=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.parser=Sa,this.mixer=Ma}),[{key:"calculator",value:function(t,e,n){return n instanceof xr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Oi(0,0,0,0)}:n}}])}(),fo=(0,s.Z)((function t(){(0,o.Z)(this,t),this.mixer=Aa})),po=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:"auto",e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,i=!1,r=!1,a=!!e&&!e.isNone,o=!!n&&!n.isNone;return"visiblepainted"===t||"painted"===t||"auto"===t?(i=a,r=o):"visiblefill"===t||"fill"===t?i=!0:"visiblestroke"===t||"stroke"===t?r=!0:"visible"!==t&&"all"!==t||(i=!0,r=!0),[i,r]}var Ao=1,Oo="object"==typeof self&&self.self===self?self:"object"==typeof n.g&&n.g.global===n.g?n.g:{},No=Date.now(),Po={},Lo=Date.now(),Ro=function(t){if("function"!=typeof t)throw new TypeError("".concat(t," is not a function"));var e=Date.now(),n=e-Lo,i=n>16?0:16-n,r=Ao++;return Po[r]=t,Object.keys(Po).length>1||setTimeout((function(){Lo=e;var t=Po;Po={},Object.keys(t).forEach((function(e){return t[e](Oo.performance&&"function"==typeof Oo.performance.now?Oo.performance.now():Date.now()-No)}))}),i),r},Do=function(t){delete Po[t]},ko=function(t){return"string"!=typeof t?Ro:""===t?Oo.requestAnimationFrame:Oo["".concat(t,"RequestAnimationFrame")]},Io=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!ko(t)})),Bo=ko(Io),Fo=function(t){return"string"!=typeof t?Do:""===t?Oo.cancelAnimationFrame:Oo["".concat(t,"CancelAnimationFrame")]||Oo["".concat(t,"CancelRequestAnimationFrame")]}(Io);Oo.requestAnimationFrame=Bo,Oo.cancelAnimationFrame=Fo;var zo=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.callbacks=[]}),[{key:"getCallbacksNum",value:function(){return this.callbacks.length}},{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=new Array(t),n=0;n1&&void 0!==arguments[1]&&arguments[1],i=ms.get(this);i||(i=this.document?this:this.defaultView?this.defaultView:null===(e=this.ownerDocument)||void 0===e?void 0:e.defaultView)&&ms.set(this,i);if(i){if(t.manager=i.getEventService(),!t.manager)return!1;t.defaultPrevented=!1,t.path?t.path.length=0:t.page=[],n||(t.target=this),t.manager.dispatchEvent(t,t.type,n)}else this.emitter.emit(t.type,t);return!t.defaultPrevented}}])}(),ys=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw new Error(Ni)}},{key:"lookupNamespaceURI",value:function(t){throw new Error(Ni)}},{key:"lookupPrefix",value:function(t){throw new Error(Ni)}},{key:"normalize",value:function(){throw new Error(Ni)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{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(t){if(t===this)return 0;for(var n=t,i=this,r=[n],a=[i];null!==(o=n.parentNode)&&void 0!==o?o:i.parentNode;){var o;n=n.parentNode?(r.push(n.parentNode),n.parentNode):n,i=i.parentNode?(a.push(i.parentNode),i.parentNode):i}if(n!==i)return e.DOCUMENT_POSITION_DISCONNECTED|e.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|e.DOCUMENT_POSITION_PRECEDING;var s=r.length>a.length?r:a,l=s===r?a:r;if(s[s.length-l.length]===l[0])return s===r?e.DOCUMENT_POSITION_CONTAINED_BY|e.DOCUMENT_POSITION_FOLLOWING:e.DOCUMENT_POSITION_CONTAINS|e.DOCUMENT_POSITION_PRECEDING;for(var u=s.length-l.length,c=l.length-1;c>=0;c--){var h=l[c],d=s[u+c];if(d!==h){var f=h.parentNode.childNodes;return f.indexOf(h)0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){for(var e=[this];e.length>0;){var n=e.pop();if(!1===t(n))break;for(var i=n.childNodes.length-1;i>=0;i--)e.push(n.childNodes[i])}}}],[{key:"isNode",value:function(t){return!!t.childNodes}}])}(vs);ys.DOCUMENT_POSITION_DISCONNECTED=1,ys.DOCUMENT_POSITION_PRECEDING=2,ys.DOCUMENT_POSITION_FOLLOWING=4,ys.DOCUMENT_POSITION_CONTAINS=8,ys.DOCUMENT_POSITION_CONTAINED_BY=16,ys.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var xs=function(){return(0,s.Z)((function t(e,n){var i=this;(0,o.Z)(this,t),this.emitter=new g,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=U(),this.tmpVec3=y(),this.onPointerDown=function(t){var e=i.createPointerEvent(t);if(i.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)i.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){var n=2===e.button;i.dispatchEvent(e,n?"rightdown":"mousedown")}i.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),i.freeEvent(e)},this.onPointerUp=function(t){var e=So.now(),n=i.createPointerEvent(t,void 0,void 0,i.context.config.alwaysTriggerPointerEventOnCanvas?i.rootTarget:void 0);if(i.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)i.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){var r=2===n.button;i.dispatchEvent(n,r?"rightup":"mouseup")}var a=i.trackingData(t.pointerId),o=i.findMountedTarget(a.pressTargetsByButton[t.button]),s=o;if(o&&!n.composedPath().includes(o)){for(var l=o;l&&!n.composedPath().includes(l);){if(n.currentTarget=l,i.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)i.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){var u=2===n.button;i.notifyTarget(n,u?"rightupoutside":"mouseupoutside")}ys.isNode(l)&&(l=l.parentNode)}delete a.pressTargetsByButton[t.button],s=l}if(s){var c,h=i.clonePointerEvent(n,"click");h.target=s,h.path=[],a.clicksByButton[t.button]||(a.clicksByButton[t.button]={clickCount:0,target:h.target,timeStamp:e});var d=i.context.renderingContext.root.ownerDocument.defaultView,f=a.clicksByButton[t.button];f.target===h.target&&e-f.timeStamp=1;i--)if(t.currentTarget=n[i],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var r=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var a=r+1;ar||n>a?null:!o&&this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value:function(t,e){var n,i=null==e?void 0:e.target;if(null!==(n=i)&&void 0!==n&&n.shadowRoot&&(i=e.composedPath()[0]),i){if(i===t)return!0;if(t&&t.contains)return t.contains(i)}return!(null==e||!e.composedPath)&&e.composedPath().indexOf(t)>-1}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath)for(var e=0,n=t.nativeEvent.composedPath();e=0;n--){var i=t[n];if(!(i===this.rootTarget||ys.isNode(i)&&i.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=bo(e)&&e.getAttribute("cursor");if(n)return n;e=ys.isNode(e)&&e.parentNode}}}])}(),bs=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t||al.offscreenCanvas)this.canvas=t||al.offscreenCanvas,this.context=this.canvas.getContext("2d",(0,a.Z)({willReadFrequently:!0},e));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",(0,a.Z)({willReadFrequently:!0},e)),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",(0,a.Z)({willReadFrequently:!0},e))}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}],[{key:"createCanvas",value:function(){try{return new window.OffscreenCanvas(0,0)}catch(t){}try{return document.createElement("canvas")}catch(t){}return null}}])}(),_s=function(t){return t[t.CAMERA_CHANGED=0]="CAMERA_CHANGED",t[t.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",t[t.NONE=2]="NONE",t}({}),Es=function(){return(0,s.Z)((function t(e,n){(0,o.Z)(this,t),this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new jo,initAsync:new zo,dirtycheck:new Uo,cull:new Uo,beginFrame:new jo,beforeRender:new jo,render:new jo,afterRender:new jo,endFrame:new jo,destroy:new jo,pick:new Go,pickSync:new Uo,pointerDown:new jo,pointerUp:new jo,pointerMove:new jo,pointerOut:new jo,pointerOver:new jo,pointerWheel:new jo,pointerCancel:new jo,click:new jo},this.globalRuntime=e,this.context=n}),[{key:"init",value:function(t){var e=this,n=(0,a.Z)((0,a.Z)({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach((function(t){t.apply(n,e.globalRuntime)})),this.hooks.init.call(),0===this.hooks.initAsync.getCallbacksNum()?(this.inited=!0,t()):this.hooks.initAsync.promise().then((function(){e.inited=!0,t()})).catch((function(t){}))}},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(_s.CAMERA_CHANGED)}},{key:"render",value:function(t,e,n){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited){r.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=1===r.renderReasons.size&&r.renderReasons.has(_s.CAMERA_CHANGED),o=!t.disableRenderHooks||!(t.disableRenderHooks&&a);o&&this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(e),o&&r.renderListCurrentFrame.forEach((function(t){i.hooks.beforeRender.call(t),i.hooks.render.call(t),i.hooks.afterRender.call(t)})),this.hooks.endFrame.call(e),r.renderListCurrentFrame=[],r.renderReasons.clear(),n()}}},{key:"renderDisplayObject",value:function(t,e,n){var i=this,r=e.renderer.getConfig(),a=r.enableDirtyCheck,o=r.enableCulling;function s(t){var e=t.renderable,r=t.sortable,s=a?e.dirty||n.dirtyRectangleRenderingDisabled?t:null:t;if(s){var l=o?i.hooks.cull.call(s,i.context.camera):s;l&&(i.stats.rendered+=1,n.renderListCurrentFrame.push(l))}e.dirty=!1,r.renderOrder=i.zIndexCounter,i.zIndexCounter+=1,i.stats.total+=1,r.dirty&&(i.sort(t,r),r.dirty=!1,r.dirtyChildren=[],r.dirtyReason=void 0)}for(var l=[t];l.length>0;){var u=l.pop();s(u);for(var c=u.sortable.sorted||u.childNodes,h=c.length-1;h>=0;h--)l.push(c[h])}}},{key:"sort",value:function(t,e){e.sorted&&e.dirtyReason!==nr.Z_INDEX_CHANGED?e.dirtyChildren.forEach((function(n){if(-1===t.childNodes.indexOf(n)){var i=e.sorted.indexOf(n);i>=0&&e.sorted.splice(i,1)}else if(0===e.sorted.length)e.sorted.push(n);else{var r=function(t,e){for(var n=0,i=t.length;n>>1;_o(t[r],e)<0?n=r+1:i=r}return n}(e.sorted,n);e.sorted.splice(r,0,n)}})):e.sorted=t.childNodes.slice().sort(_o)}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(_s.DISPLAY_OBJECT_CHANGED)}}])}(),ws=/\[\s*(.*)=(.*)\s*\]/,Ts=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t)}),[{key:"selectOne",value:function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,a=i.value;return r?e.find((function(t){return e!==t&&("name"===r?t.name===a:n.attributeToString(t,r)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value:function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(i){return e!==i&&((null==i?void 0:i.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(i){return e!==i&&i.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var i=this.getAttribute(t),r=i.name,a=i.value;return r?e.findAll((function(t){return e!==t&&("name"===r?t.name===a:n.attributeToString(t,r)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value:function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),i=n.name,r=n.value;return"name"===i?e.name===r:this.attributeToString(e,i)===r}return e.nodeName===t}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value:function(t){var e=t.match(ws),n="",i="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),i=e[2].replace(/"/g,"")),{name:n,value:i}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return(0,le.Z)(n)?"":n.toString?n.toString():""}}])}(),Ss=function(t){return t.REPARENT="reparent",t.DESTROY="destroy",t.ATTR_MODIFIED="DOMAttrModified",t.INSERTED="DOMNodeInserted",t.REMOVED="removed",t.MOUNTED="DOMNodeInsertedIntoDocument",t.UNMOUNTED="DOMNodeRemovedFromDocument",t.BOUNDS_CHANGED="bounds-changed",t.CULLED="culled",t}({}),Ms=function(t){function e(t,n,i,r,a,s,l,u){var c;return(0,o.Z)(this,e),(c=d(this,e,[null])).relatedNode=n,c.prevValue=i,c.newValue=r,c.attrName=a,c.attrChange=s,c.prevParsedValue=l,c.newParsedValue=u,c.type=t,c}return(0,f.Z)(e,t),(0,s.Z)(e)}(hs);function Cs(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}Ms.ADDITION=2,Ms.MODIFICATION=1,Ms.REMOVAL=3;var As,Os,Ns,Ps,Ls,Rs,Ds=new Ms(Ss.REPARENT,null,"","","",0,"",""),ks=ie(),Is=y(),Bs=_(1,1,1),Fs=U(),zs=ie(),Gs=y(),js=U(),Us=Gt(),Hs=y(),Vs=Gt(),Zs=y(),Ws=y(),Xs=y(),Ys=U(),qs=Gt(),$s=Gt(),Ks=Gt(),Qs={affectChildren:!0},Js=function(){return(0,s.Z)((function t(e){(0,o.Z)(this,t),this.pendingEvents=new Map,this.boundsChangedEvent=new gs(Ss.BOUNDS_CHANGED),this.displayObjectDependencyMap=new WeakMap,this.runtime=e}),[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var i,r=!1;t.parentNode&&(r=t.parentNode!==e,this.detach(t));var a=t.nodeName===pi.FRAGMENT,o=Mo(e);t.parentNode=e;var s=a?t.childNodes:[t];(0,oe.Z)(n)?s.forEach((function(t){e.childNodes.splice(n,0,t),t.parentNode=e})):s.forEach((function(t){e.childNodes.push(t),t.parentNode=e}));var l=e.sortable;if((null!=l&&null!==(i=l.sorted)&&void 0!==i&&i.length||t.parsedStyle.zIndex)&&(-1===l.dirtyChildren.indexOf(t)&&l.dirtyChildren.push(t),l.dirty=!0,l.dirtyReason=nr.ADDED),!o){if(a)this.dirtifyFragment(t);else{var u=t.transformable;u&&this.dirtifyWorld(t,u)}r&&t.dispatchEvent(Ds)}}},{key:"detach",value:function(t){if(t.parentNode){var e,n,i=t.transformable,r=t.parentNode.sortable;(null!=r&&null!==(e=r.sorted)&&void 0!==e&&e.length||null!==(n=t.style)&&void 0!==n&&n.zIndex)&&(-1===r.dirtyChildren.indexOf(t)&&r.dirtyChildren.push(t),r.dirty=!0,r.dirtyReason=nr.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(t,i),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.getGeometryBounds(),t.transformable.origin}},{key:"setOrigin",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=[e,n,i]);var r=t.transformable;if(e[0]!==r.origin[0]||e[1]!==r.origin[1]||e[2]!==r.origin[2]){var a=r.origin;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,this.dirtifyLocal(t,r)}}},{key:"rotate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=Us;Zt(a,e[0],e[1],e[2]);var o=this.getRotation(t),s=this.getRotation(t.parentNode);Jt(Ks,s),Vt(Ks,Ks),Ut(a,Ks,a),Ut(r.localRotation,a,o),ne(r.localRotation,r.localRotation),this.dirtifyLocal(t,r)}else this.rotateLocal(t,e)}},{key:"rotateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;Zt($s,e[0],e[1],e[2]),ee(r.localRotation,r.localRotation,$s),this.dirtifyLocal(t,r)}},{key:"setEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Zt(r.localRotation,e[0],e[1],e[2]);var a=this.getRotation(t.parentNode);Jt(qs,Vt(Us,a)),ee(r.localRotation,r.localRotation,qs),this.dirtifyLocal(t,r)}else this.setLocalEulerAngles(t,e)}},{key:"setLocalEulerAngles",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];"number"==typeof e&&(e=_(e,n,i));var a=t.transformable;Zt(a.localRotation,e[0],e[1],e[2]),r&&this.dirtifyLocal(t,a)}},{key:"translateLocal",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=_(e,n,i));var r=t.transformable;D(e,Is)||(R(e,e,r.localRotation),T(r.localPosition,r.localPosition,e),this.dirtifyLocal(t,r))}},{key:"setPosition",value:function(t,e){var n,i=t.transformable;if(Xs[0]=e[0],Xs[1]=e[1],Xs[2]=null!==(n=e[2])&&void 0!==n?n:0,!D(this.getPosition(t),Xs)){if(E(i.position,Xs),null!==t.parentNode&&t.parentNode.transformable){var r=t.parentNode.transformable;V(Ys,r.worldTransform),q(Ys,Ys),L(i.localPosition,Xs,Ys)}else E(i.localPosition,Xs);this.dirtifyLocal(t,i)}}},{key:"setLocalPosition",value:function(t,e){var n,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.transformable;Ws[0]=e[0],Ws[1]=e[1],Ws[2]=null!==(n=e[2])&&void 0!==n?n:0,D(r.localPosition,Ws)||(E(r.localPosition,Ws),i&&this.dirtifyLocal(t,r))}},{key:"scaleLocal",value:function(t,e){var n,i=t.transformable;M(i.localScale,i.localScale,w(Gs,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:1)),this.dirtifyLocal(t,i)}},{key:"setLocalScale",value:function(t,e){var n,i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=t.transformable;w(Gs,e[0],e[1],null!==(n=e[2])&&void 0!==n?n:r.localScale[2]),D(Gs,r.localScale)||(E(r.localScale,Gs),i&&this.dirtifyLocal(t,r))}},{key:"translate",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;"number"==typeof e&&(e=w(Gs,e,n,i)),D(e,Is)||(T(Gs,this.getPosition(t),e),this.setPosition(t,Gs))}},{key:"setRotation",value:function(t,e,n,i,r){var a=t.transformable;if("number"==typeof e&&(e=Qt(e,n,i,r)),null!==t.parentNode&&t.parentNode.transformable){var o=this.getRotation(t.parentNode);Jt(Us,o),Vt(Us,Us),Ut(a.localRotation,Us,e),ne(a.localRotation,a.localRotation),this.dirtifyLocal(t,a)}else this.setLocalRotation(t,e)}},{key:"setLocalRotation",value:function(t,e,n,i,r){var a=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];"number"==typeof e&&(e=te(Us,e,n,i,r));var o=t.transformable;Jt(o.localRotation,e),a&&this.dirtifyLocal(t,o)}},{key:"setLocalSkew",value:function(t,e,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];"number"==typeof e&&(e=ae(zs,e,n));var r=t.transformable;re(r.localSkew,e),i&&this.dirtifyLocal(t,r)}},{key:"dirtifyLocal",value:function(t,e){Mo(t)||e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"dirtifyFragment",value:function(t){var e=t.transformable;e&&(e.frozen=!1,e.dirtyFlag=!0,e.localDirtyFlag=!0);var n=t.renderable;n&&(n.renderBoundsDirty=!0,n.boundsDirty=!0,n.dirty=!0);for(var i=t.childNodes.length,r=0;r1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)Cs(n),n=n.parentNode;e&&t.forEach((function(t){Cs(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.set(t,e)}},{key:"updateDisplayObjectDependency",value:function(t,e,n,i){if(e&&e!==n){var r=this.displayObjectDependencyMap.get(e);if(r&&r[t]){var a=r[t].indexOf(i);r[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(i)}}},{key:"informDependentDisplayObjects",value:function(t){var e=this,n=this.displayObjectDependencyMap.get(t);n&&Object.keys(n).forEach((function(t){n[t].forEach((function(n){e.dirtifyToRoot(n,!0),n.dispatchEvent(new Ms(Ss.ATTR_MODIFIED,n,e,e,t,Ms.MODIFICATION,e,e)),n.isCustomElement&&n.isConnected&&n.attributeChangedCallback&&n.attributeChangedCallback(t,e,e)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return ft(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return gt(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return pt(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"calcLocalTransform",value:function(t){if(0!==t.localSkew[0]||0!==t.localSkew[1]){vt(t.localTransform,t.localRotation,t.localPosition,_(1,1,1),t.origin),0===t.localSkew[0]&&0===t.localSkew[1]||(X(js),js[4]=Math.tan(t.localSkew[0]),js[1]=Math.tan(t.localSkew[1]),Q(t.localTransform,t.localTransform,js));var e=vt(js,te(Us,0,0,0,1),w(Gs,1,1,1),t.localScale,t.origin);Q(t.localTransform,t.localTransform,e)}else{var n=t.localTransform,i=t.localPosition,r=t.localRotation,a=t.localScale,o=t.origin,s=0!==i[0]||0!==i[1]||0!==i[2],l=1!==r[3]||0!==r[0]||0!==r[1]||0!==r[2],u=1!==a[0]||1!==a[1]||1!==a[2],c=0!==o[0]||0!==o[1]||0!==o[2];l||u||c?vt(n,r,i,a,o):s?at(n,i):X(n)}}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=ft(Hs,e),i=gt(Vs,e),r=pt(Zs,e);this.setLocalScale(t,r,!1),this.setLocalPosition(t,n,!1),this.setLocalRotation(t,i,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"resetLocalTransform",value:function(t){this.setLocalScale(t,Bs,!1),this.setLocalPosition(t,Is,!1),this.setLocalEulerAngles(t,Is,void 0,void 0,!1),this.setLocalSkew(t,ks,void 0,!1),this.dirtifyLocal(t,t.transformable)}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0,i=this.getGeometryBounds(t,e);if(!Ti.isEmpty(i)){var r=n||new Ti;return r.setFromTransformedAABB(i,this.getWorldTransform(t)),r}return null}},{key:"getGeometryBounds",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t,i=n.geometry;i.dirty&&al.styleValueRegistry.updateGeometry(t);var r=e?i.renderBounds:i.contentBounds||null;return r||new Ti}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=t,r=i.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var a=n?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,n,a),s=t.childNodes;if(s.forEach((function(t){var i=e.getBounds(t,n);i&&(o?o.add(i):(o=a||new Ti).update(i.center,i.halfExtents))})),o||(o=new Ti),n){var l=Eo(t);if(l){var u=l.parsedStyle.clipPath.getBounds(n);o?u&&(o=u.intersection(o)):o.update(u.center,u.halfExtents)}}return n?(r.renderBounds=o,r.renderBoundsDirty=!1):(r.bounds=o,r.boundsDirty=!1),o}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=Fs;t.parentNode.transformable&&(e=q(js,this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ti.isEmpty(n)){var i=new Ti;return i.setFromTransformedAABB(n,e),i}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,i=this.getGeometryBounds(t);Ti.isEmpty(i)||(n=new Ti).setFromTransformedAABB(i,this.getWorldTransform(t));var r=null===(e=t.ownerDocument)||void 0===e||null===(e=e.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(n){var a=n.getMin(),o=(0,p.Z)(a,2),s=o[0],l=o[1],u=n.getMax(),c=(0,p.Z)(u,2),h=c[0],d=c[1];return new Oi(s+((null==r?void 0:r.left)||0),l+((null==r?void 0:r.top)||0),h-s,d-l)}return new Oi((null==r?void 0:r.left)||0,(null==r?void 0:r.top)||0,0,0)}},{key:"dirtifyWorldInternal",value:function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}}},{key:"syncHierarchy",value:function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,i=0;is;--d){for(var m=0;m=0;f--){var p=d[f].trim();!Vo.test(p)&&Ho.indexOf(p)<0&&(p='"'.concat(p,'"')),d[f]=p}return"".concat(o," ").concat(l," ").concat(c," ").concat(h," ").concat(d.join(","))}(e),b=this.measureFont(x,n);0===b.fontSize&&(b.fontSize=r,b.ascent=r);var _=this.runtime.offscreenCanvasCreator.getOrCreateContext(n);_.font=x,e.isOverflowing=!1;var E=(o?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),w=new Array(E.length),T=0;if(!m){for(var S=0;Sd)){for(var e=p[t].length,n=0,i=e,r=0;rd){i=r;break}n+=a}p[t]=(p[t]||"").slice(0,i)+f}}for(var _=Array.from(t),E=0;E<_.length;E++){var w=_[E],T=t[E-1],S=t[E+1],M=y(w);if(this.isNewline(w)){if(++g>=u){e.isOverflowing=!0,E<_.length-1&&b(g-1);break}m=0,p[g]=""}else{if(m>0&&m+M>d){if(g+1>=u){e.isOverflowing=!0,b(g);break}if(g++,m=0,p[g]="",this.isBreakingSpace(w))continue;this.canBreakInLastChar(w)||(p=this.trimToBreakable(p),m=this.sumTextWidthByCache(p[g]||"",v)),this.shouldBreakByKinsokuShorui(w,S)&&(p=this.trimByKinsokuShorui(p),m+=y(T||""))}m+=M,p[g]=(p[g]||"")+w}}return p.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&tl.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&tl.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=(0,l.Z)(t),n=e[e.length-2],i=this.findBreakableIndex(n);if(-1===i||!n)return e;var r=n.slice(i,i+1),a=i+1,o=i+(this.isBreakingSpace(r)?0:1);return e[e.length-1]+=n.slice(a,n.length),e[e.length-2]=n.slice(0,o),e}},{key:"canBreakInLastChar",value:function(t){return!t||!el.test(t)}},{key:"sumTextWidthByCache",value:function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!el.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,i){var r=n[t];if("number"!=typeof r){var a=t.length*e;r=i.measureText(t).width+a,n[t]=r}return r}}])}(),al={},ol=(Os=new ss,Ns=new os,As={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(As,pi.FRAGMENT,null),pi.CIRCLE,new ns),pi.ELLIPSE,new is),pi.RECT,Os),pi.IMAGE,Os),pi.GROUP,new us),pi.LINE,new rs),pi.TEXT,new ls(al)),pi.POLYLINE,Ns),pi.POLYGON,Ns),(0,an.Z)((0,an.Z)((0,an.Z)(As,pi.PATH,new as),pi.HTML,new cs),pi.MESH,null)),sl=(Ls=new eo,Rs=new ro,Ps={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(Ps,rr.PERCENTAGE,null),rr.NUMBER,new lo),rr.ANGLE,new Ja),rr.DEFINED_PATH,new to),rr.PAINT,Ls),rr.COLOR,Ls),rr.FILTER,new no),rr.LENGTH,Rs),rr.LENGTH_PERCENTAGE,Rs),rr.LENGTH_PERCENTAGE_12,new ao),(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(Ps,rr.LENGTH_PERCENTAGE_14,new oo),rr.COORDINATE,new ro),rr.OFFSET_DISTANCE,new uo),rr.OPACITY_VALUE,new co),rr.PATH,new ho),rr.LIST_OF_POINTS,new fo),rr.SHADOW_BLUR,new po),rr.TEXT,new go),rr.TEXT_TRANSFORM,new mo),rr.TRANSFORM,new Jo),(0,an.Z)((0,an.Z)((0,an.Z)(Ps,rr.TRANSFORM_ORIGIN,new ts),rr.Z_INDEX,new es),rr.MARKER,new so));al.CameraContribution=tr,al.AnimationTimeline=null,al.EasingFunction=null,al.offscreenCanvasCreator=new bs,al.sceneGraphSelector=new Ts,al.sceneGraphService=new Js(al),al.textService=new rl(al),al.geometryUpdaterFactory=ol,al.CSSPropertySyntaxFactory=sl,al.styleValueRegistry=new Ka(al),al.layoutRegistry=null,al.globalThis="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},al.enableStyleSyntax=!0,al.enableSizeAttenuation=!1;var ll=0;var ul=new Ms(Ss.INSERTED,null,"","","",0,"",""),cl=new Ms(Ss.REMOVED,null,"","","",0,"",""),hl=new gs(Ss.DESTROY),dl=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r=0;t--){var e=this.childNodes[t];this.removeChild(e)}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length>0&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return al.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return al.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return al.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return al.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return al.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return al.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return al.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(al.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(i){return i===e||!t(i)||(n=i,!1)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(i){i!==e&&t(i)&&n.push(i)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e={forceUpdateGeometry:!0};al.styleValueRegistry.processProperties(this,t,e),this.renderable.dirty=!0}},{key:"setAttribute",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];Qe(n)||(i||n!==this.attributes[t])&&(this.internalSetAttribute(t,n,{memoize:r}),ln(e,"setAttribute",this,3)([t,n]))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.renderable,r=this.attributes[t],a=this.parsedStyle[t];al.styleValueRegistry.processProperties(this,(0,an.Z)({},t,e),n),i.dirty=!0;var o,s,l=this.parsedStyle[t];(this.isConnected&&(gl.relatedNode=this,gl.prevValue=r,gl.newValue=e,gl.attrName=t,gl.prevParsedValue=a,gl.newParsedValue=l,this.isMutationObserved?this.dispatchEvent(gl):(gl.target=this,this.ownerDocument.defaultView.dispatchEvent(gl,!0))),this.isCustomElement&&this.isConnected||!this.isCustomElement)&&(null===(o=(s=this).attributeChangedCallback)||void 0===o||o.call(s,t,r,e,a,l))}},{key:"getBBox",value:function(){var t=this.getBounds(),e=t.getMin(),n=(0,p.Z)(e,2),i=n[0],r=n[1],a=t.getMax(),o=(0,p.Z)(a,2),s=o[0],l=o[1];return new Oi(i,r,s-i,l-r)}},{key:"setOrigin",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return al.sceneGraphService.setOrigin(this,Di(t,e,n,!1)),this}},{key:"getOrigin",value:function(){return al.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return al.sceneGraphService.setPosition(this,Di(t,e,n,!1)),this}},{key:"setLocalPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return al.sceneGraphService.setLocalPosition(this,Di(t,e,n,!1)),this}},{key:"translate",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return al.sceneGraphService.translate(this,Di(t,e,n,!1)),this}},{key:"translateLocal",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return al.sceneGraphService.translateLocal(this,Di(t,e,n,!1)),this}},{key:"getPosition",value:function(){return al.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return al.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Di(t,e=e||t,n=n||t,!1)),al.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Di(t,e=e||t,n=n||t,!1)),al.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return al.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return al.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){var t=Gi(ml,al.sceneGraphService.getWorldTransform(this));return Fi((0,p.Z)(t,3)[2])}},{key:"getLocalEulerAngles",value:function(){var t=Gi(ml,al.sceneGraphService.getLocalRotation(this));return Fi((0,p.Z)(t,3)[2])}},{key:"setEulerAngles",value:function(t){return al.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return al.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return(0,le.Z)(e)&&(0,le.Z)(n)?al.sceneGraphService.rotateLocal(this,0,0,t):al.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return(0,le.Z)(e)&&(0,le.Z)(n)?al.sceneGraphService.rotate(this,0,0,t):al.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,i){return al.sceneGraphService.setRotation(this,t,e,n,i),this}},{key:"setLocalRotation",value:function(t,e,n,i){return al.sceneGraphService.setLocalRotation(this,t,e,n,i),this}},{key:"setLocalSkew",value:function(t,e){return al.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return al.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return al.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return al.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return al.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return al.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return al.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){al.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value:function(t,e){var n,i=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return i?i.play(this,t,e):null}},{key:"isVisible",value:function(){var t;return"hidden"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{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,l.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,(0,l.Z)(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=new Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"move",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this.setPosition(t,e,n),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}])}(dl);yl.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 xl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.CIRCLE},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(yl);xl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["cx","cy","cz","r","isBillboard","isSizeAttenuation"]));var bl=["style"],_l=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,bl);return(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({style:i},r)])).isCustomElement=!0,t}return(0,f.Z)(e,t),(0,s.Z)(e)}(yl),El=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.ELLIPSE},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(yl);El.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["cx","cy","cz","rx","ry","isBillboard","isSizeAttenuation"]));var wl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.GROUP},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(yl);wl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["width","height"]));var Tl=["style"],Sl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Tl);return(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.HTML,style:i},r)])).cullable.enable=!1,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=q(U(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ti.isEmpty(e)){var n=new Ti;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}])}(yl);Sl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["x","y","$el","innerHTML","width","height"]));var Ml=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.IMAGE},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(yl);Ml.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["x","y","z","src","width","height","isBillboard","billboardRotation","isSizeAttenuation","keepAspectRatio"]));var Cl=["style"],Al=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Cl);(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.LINE,style:(0,a.Z)({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},r)])).markerStartAngle=0,t.markerEndAngle=0;var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd;return l&&fl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),u&&fl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&fl(i)&&(this.markerStartAngle=0,i.remove()),r&&fl(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t&&(i&&fl(i)&&(this.markerEndAngle=0,i.remove()),r&&fl(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,i=e.markerEnd,r=e.markerStartOffset,a=e.markerEndOffset,o=e.x1,s=e.x2,l=e.y1,u=e.y2,c=t?n:i;if(c&&fl(c)){var h,d,f,p,g,m,v;t?(p=o,g=l,d=s-o,f=u-l,m=r||0,v=this.markerStartAngle):(p=s,g=u,d=o-s,f=l-u,m=a||0,v=this.markerEndAngle),h=Math.atan2(f,d),c.setLocalEulerAngles(180*h/Math.PI+v),c.setLocalPosition(p+Math.cos(h)*m,g+Math.sin(h)*m)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,i=n.x1,r=n.y1,a=n.x2,o=n.y2,s=$n(i,r,a,o,t),l=s.x,u=s.y,c=L(y(),_(l,u,0),e?this.getWorldTransform():this.getLocalTransform());return new Ai(c[0],c[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return qn(t.x1,t.y1,t.x2,t.y2)}}])}(yl);Al.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["x1","y1","x2","y2","z1","z2","isBillboard","isSizeAttenuation","markerStart","markerEnd","markerStartOffset","markerEndOffset"]));var Ol=["style"],Nl=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Ol);(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.PATH,style:i,initialParsedStyle:{miterLimit:4,d:(0,a.Z)({},ir)}},r)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd,c=s.markerMid;return l&&fl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),c&&fl(c)&&t.placeMarkerMid(c),u&&fl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"d"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&fl(i)&&(this.markerStartAngle=0,i.remove()),r&&fl(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t?(i&&fl(i)&&(this.markerEndAngle=0,i.remove()),r&&fl(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,i=e.markerEnd,r=e.markerStartOffset,a=e.markerEndOffset,o=t?n:i;if(o&&fl(o)){var s,l,u,c,h,d,f;if(t){var g=this.getStartTangent(),m=(0,p.Z)(g,2),v=m[0],y=m[1];c=y[0],h=y[1],l=v[0]-y[0],u=v[1]-y[1],d=r||0,f=this.markerStartAngle}else{var x=this.getEndTangent(),b=(0,p.Z)(x,2),_=b[0],E=b[1];c=E[0],h=E[1],l=_[0]-E[0],u=_[1]-E[1],d=a||0,f=this.markerEndAngle}s=Math.atan2(u,l),o.setLocalEulerAngles(180*s/Math.PI+f),o.setLocalPosition(c+Math.cos(s)*d,h+Math.sin(s)*d)}}},{key:"placeMarkerMid",value:function(t){var e=this.parsedStyle.d.segments;if(this.markerMidList.forEach((function(t){t.remove()})),t&&fl(t))for(var n=1;n1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.d.absolutePath,i=rn(n,t),r=i.x,a=i.y,o=L(y(),_(r,a,0),e?this.getWorldTransform():this.getLocalTransform());return new Ai(o[0],o[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*ha(this),e)}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.d.segments,e=[];if(t.length>1){var n=t[0].currentPoint,i=t[1].currentPoint,r=t[1].startTangent;e=[],r?(e.push([n[0]-r[0],n[1]-r[1]]),e.push([n[0],n[1]])):(e.push([i[0],i[1]]),e.push([n[0],n[1]]))}return e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.d.segments,e=t.length,n=[];if(e>1){var i=t[e-2].currentPoint,r=t[e-1].currentPoint,a=t[e-1].endTangent;n=[],a?(n.push([r[0]-a[0],r[1]-a[1]]),n.push([r[0],r[1]])):(n.push([i[0],i[1]]),n.push([r[0],r[1]]))}return n}}])}(yl);Nl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["d","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard","isSizeAttenuation"]));var Pl=["style"],Ll=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=n.style,r=(0,hi.Z)(n,Pl);(0,o.Z)(this,e),(t=d(this,e,[(0,a.Z)({type:pi.POLYGON,style:i,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},r)])).markerStartAngle=0,t.markerEndAngle=0,t.markerMidList=[];var s=t.parsedStyle,l=s.markerStart,u=s.markerEnd,c=s.markerMid;return l&&fl(l)&&(t.markerStartAngle=l.getLocalEulerAngles(),t.appendChild(l)),c&&fl(c)&&t.placeMarkerMid(c),u&&fl(u)&&(t.markerEndAngle=u.getLocalEulerAngles(),t.appendChild(u)),t.transformMarker(!0),t.transformMarker(!1),t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"attributeChangedCallback",value:function(t,e,n,i,r){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(i&&fl(i)&&(this.markerStartAngle=0,i.remove()),r&&fl(r)&&(this.markerStartAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!0))):"markerEnd"===t?(i&&fl(i)&&(this.markerEndAngle=0,i.remove()),r&&fl(r)&&(this.markerEndAngle=r.getLocalEulerAngles(),this.appendChild(r),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(r)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStart,i=e.markerEnd,r=e.markerStartOffset,a=e.markerEndOffset,o=(e.points||{}).points,s=t?n:i;if(s&&fl(s)&&o){var l,u,c,h,d,f,p;if(h=o[0][0],d=o[0][1],t)u=o[1][0]-o[0][0],c=o[1][1]-o[0][1],f=r||0,p=this.markerStartAngle;else{var g=o.length;this.parsedStyle.isClosed?(u=o[g-1][0]-o[0][0],c=o[g-1][1]-o[0][1]):(h=o[g-1][0],d=o[g-1][1],u=o[g-2][0]-o[g-1][0],c=o[g-2][1]-o[g-1][1]),f=a||0,p=this.markerEndAngle}l=Math.atan2(c,u),s.setLocalEulerAngles(180*l/Math.PI+p),s.setLocalPosition(h+Math.cos(l)*f,d+Math.sin(l)*f)}}},{key:"placeMarkerMid",value:function(t){var e=(this.parsedStyle.points||{}).points;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&fl(t)&&e)for(var n=1;n<(this.parsedStyle.isClosed?e.length:e.length-1);n++){var i=e[n][0],r=e[n][1],a=1===n?t:t.cloneNode(!0);this.markerMidList.push(a),this.appendChild(a),a.setLocalPosition(i,r)}}}])}(yl);Ll.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isClosed","isBillboard","isSizeAttenuation"]));var Rl=["style"],Dl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,i=(0,hi.Z)(t,Rl);return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.POLYLINE,style:n,initialParsedStyle:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i)])}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getTotalLength",value:function(){return da(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle.points.points;if(0===this.parsedStyle.points.segments.length){var i,r,a=[],o=0,s=this.getTotalLength();n.forEach((function(t,e){n[e+1]&&((i=[0,0])[0]=o/s,r=qn(t[0],t[1],n[e+1][0],n[e+1][1]),o+=r,i[1]=o/s,a.push(i))})),this.parsedStyle.points.segments=a}var l=0,u=0;this.parsedStyle.points.segments.forEach((function(e,n){t>=e[0]&&t<=e[1]&&(l=(t-e[0])/(e[1]-e[0]),u=n)}));var c=$n(n[u][0],n[u][1],n[u+1][0],n[u+1][1],l),h=c.x,d=c.y,f=L(y(),_(h,d,0),e?this.getWorldTransform():this.getLocalTransform());return new Ai(f[0],f[1])}},{key:"getStartTangent",value:function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e}},{key:"getEndTangent",value:function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n}}])}(Ll);Dl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(Ll.PARSED_STYLE_LIST),["points","markerStart","markerMid","markerEnd","markerStartOffset","markerEndOffset","isBillboard"]));var kl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.RECT},t)])}return(0,f.Z)(e,t),(0,s.Z)(e)}(yl);kl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.PARSED_STYLE_LIST),["x","y","z","width","height","isBillboard","isSizeAttenuation","radius"]));var Il=["style"],Bl=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.style,i=(0,hi.Z)(t,Il);return(0,o.Z)(this,e),d(this,e,[(0,a.Z)({type:pi.TEXT,style:(0,a.Z)({fill:"black"},n)},i)])}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"getComputedTextLength",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return this.getGeometryBounds(),(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing}}])}(yl);Bl.PARSED_STYLE_LIST=new Set([].concat((0,l.Z)(yl.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 Fl=function(){return(0,s.Z)((function t(){(0,o.Z)(this,t),this.registry={},this.define(pi.CIRCLE,xl),this.define(pi.ELLIPSE,El),this.define(pi.RECT,kl),this.define(pi.IMAGE,Ml),this.define(pi.LINE,Al),this.define(pi.GROUP,wl),this.define(pi.PATH,Nl),this.define(pi.POLYGON,Ll),this.define(pi.POLYLINE,Dl),this.define(pi.TEXT,Bl),this.define(pi.HTML,Sl)}),[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}])}(),zl=function(t){function e(){var t;(0,o.Z)(this,e),(t=d(this,e)).defaultView=null,t.ownerDocument=null,t.nodeName="document";try{t.timeline=new al.AnimationTimeline(t)}catch(t){}var n={};return Ya.forEach((function(t){var e=t.n,i=t.inh,r=t.d;i&&r&&(n[e]=(0,en.Z)(r)?r(pi.GROUP):r)})),t.documentElement=new wl({id:"g-root",style:n}),t.documentElement.ownerDocument=t,t.documentElement.parentNode=t,t.childNodes=[t.documentElement],t}return(0,f.Z)(e,t),(0,s.Z)(e,[{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(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?Bl:wl);var i=new n(e);return i.ownerDocument=this,i}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw new Error(Ni)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,i){var r=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:i}),a=[];return r.forEach((function(t){var e=t.displayObject,n=e.parsedStyle.pointerEvents,i=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(void 0===n?"auto":n);(!i||i&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),i=n.x,r=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(i<0||r<0||i>o||r>s)return null;var l=this.defaultView.viewport2Client({x:i,y:r}),u=l.x,c=l.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:i,viewportY:r,clientX:u,clientY:c},picked:[]}).picked;return h&&h[0]||this.documentElement}},{key:"elementFromPoint",value:(i=(0,li.Z)((0,si.Z)().mark((function t(e,n){var i,r,a,o,s,l,u,c,h,d,f;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,a=i.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(r<0||a<0||r>s||a>l)){t.next=4;break}return t.abrupt("return",null);case 4:return u=this.defaultView.viewport2Client({x:r,y:a}),c=u.x,h=u.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:r,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return d=t.sent,f=d.picked,t.abrupt("return",f&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return i.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),i=n.x,r=n.y,a=this.defaultView.getConfig(),o=a.width,s=a.height;if(i<0||r<0||i>o||r>s)return[];var l=this.defaultView.viewport2Client({x:i,y:r}),u=l.x,c=l.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:i,viewportY:r,clientX:u,clientY:c},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h}},{key:"elementsFromPoint",value:(n=(0,li.Z)((0,si.Z)().mark((function t(e,n){var i,r,a,o,s,l,u,c,h,d,f;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.defaultView.canvas2Viewport({x:e,y:n}),r=i.x,a=i.y,o=this.defaultView.getConfig(),s=o.width,l=o.height,!(r<0||a<0||r>s||a>l)){t.next=4;break}return t.abrupt("return",[]);case 4:return u=this.defaultView.viewport2Client({x:r,y:a}),c=u.x,h=u.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:r,viewportY:a,clientX:c,clientY:h},picked:[]});case 7:return d=t.sent,(f=d.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw new Error(Pi)}},{key:"insertBefore",value:function(t,e){throw new Error(Pi)}},{key:"removeChild",value:function(t,e){throw new Error(Pi)}},{key:"replaceChild",value:function(t,e,n){throw new Error(Pi)}},{key:"append",value:function(){throw new Error(Pi)}},{key:"prepend",value:function(){throw new Error(Pi)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]);var n,i}(ys),Gl=function(){function t(e){(0,o.Z)(this,t),this.strategies=e}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=e.camera,i=e.renderingService,r=e.renderingContext,a=this.strategies;i.hooks.cull.tap(t.tag,(function(t){if(t){var e=t.cullable;return 0===a.length?e.visible=r.unculledEntities.indexOf(t.entity)>-1:e.visible=a.every((function(e){return e.isVisible(n,t)})),!t.isCulled()&&t.isVisible()?t:(t.dispatchEvent(new gs(Ss.CULLED)),null)}return t})),i.hooks.afterRender.tap(t.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}])}();Gl.tag="Culling";var jl=function(){function t(){var e=this;(0,o.Z)(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new fs(null),this.rootWheelEvent=new ps(null),this.onPointerMove=function(t){var n,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var r,a=ci(e.normalizeToPointerEvent(t,i));try{for(a.s();!(r=a.n()).done;){var o=r.value,s=e.bootstrapEvent(e.rootPointerEvent,o,i,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}},this.onClick=function(t){var n,i,r=null===(n=e.context.renderingContext.root)||void 0===n||null===(n=n.ownerDocument)||void 0===n?void 0:n.defaultView,a=ci(e.normalizeToPointerEvent(t,r));try{for(a.s();!(i=a.n()).done;){var o=i.value,s=e.bootstrapEvent(e.rootPointerEvent,o,r,t);e.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}e.setCursor(e.context.eventService.cursor)}}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=this;this.context=e;var i=e.renderingService,r=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),i.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),i.hooks.pointerDown.tap(t.tag,(function(t){if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,r);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();var i,a=ci(e);try{for(a.s();!(i=a.n()).done;){var o=i.value,s=n.bootstrapEvent(n.rootPointerEvent,o,r,t);n.context.eventService.mapEvent(s)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),i.hooks.pointerUp.tap(t.tag,(function(t){if(!r.supportsTouchEvents||"touch"!==t.pointerType){var e,i=n.context.contextService.getDomElement(),a=n.context.eventService.isNativeEventFromCanvas(i,t)?"":"outside",o=ci(n.normalizeToPointerEvent(t,r));try{for(o.s();!(e=o.n()).done;){var s=e.value,l=n.bootstrapEvent(n.rootPointerEvent,s,r,t);l.type+=a,n.context.eventService.mapEvent(l)}}catch(t){o.e(t)}finally{o.f()}n.setCursor(n.context.eventService.cursor)}})),i.hooks.pointerMove.tap(t.tag,this.onPointerMove),i.hooks.pointerOver.tap(t.tag,this.onPointerMove),i.hooks.pointerOut.tap(t.tag,this.onPointerMove),i.hooks.click.tap(t.tag,this.onClick),i.hooks.pointerCancel.tap(t.tag,(function(t){var e,i=ci(n.normalizeToPointerEvent(t,r));try{for(i.s();!(e=i.n()).done;){var a=e.value,o=n.bootstrapEvent(n.rootPointerEvent,a,r,t);n.context.eventService.mapEvent(o)}}catch(t){i.e(t)}finally{i.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"bootstrapEvent",value:function(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);var r=this.context.eventService.client2Viewport({x:e.clientX,y:e.clientY}),a=r.x,o=r.y;t.viewport.x=a,t.viewport.y=o;var s=this.context.eventService.viewport2Canvas(t.viewport),l=s.x,u=s.y;return t.canvas.x=l,t.canvas.y=u,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=To[t.type]||t.type),t}},{key:"normalizeWheelEvent",value:function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=n.x,r=n.y;e.viewport.x=i,e.viewport.y=r;var a=this.context.eventService.viewport2Canvas(e.viewport),o=a.x,s=a.y;return e.canvas.x=o,e.canvas.y=s,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value:function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=So.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}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var i=0;i-1,o=0,s=i.length;o1&&void 0!==arguments[1]&&arguments[1];if(t.isConnected){var n=t.rBushNode;n.aabb&&this.rBush.remove(n.aabb);var i=t.getRenderBounds();if(i){var r=t.renderable;e&&(r.dirtyRenderBounds||(r.dirtyRenderBounds=new Ti),r.dirtyRenderBounds.update(i.center,i.halfExtents));var a=i.getMin(),o=(0,p.Z)(a,2),s=o[0],l=o[1],u=i.getMax(),c=(0,p.Z)(u,2),h=c[0],d=c[1];n.aabb||(n.aabb={}),n.aabb.displayObject=t,n.aabb.minX=s,n.aabb.minY=l,n.aabb.maxX=h,n.aabb.maxY=d}return n.aabb&&!(isNaN(n.aabb.maxX)||isNaN(n.aabb.maxX)||isNaN(n.aabb.minX)||isNaN(n.aabb.minY))?n.aabb:void 0}}},{key:"syncRTree",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e||!this.syncing&&0!==this.syncTasks.size){this.syncing=!0;var n=[],i=new Set,r=function(r){if(!i.has(r)&&r.renderable){var a=t.syncNode(r,e);a&&(n.push(a),i.add(r))}};this.syncTasks.forEach((function(t,e){t&&e.forEach(r);for(var n=e;n;)r(n),n=n.parentElement})),this.rBush.load(n),n.length=0,this.syncing=!1}}}])}();Vl.tag="Prepare";var Zl=function(t){return t.READY="ready",t.BEFORE_RENDER="beforerender",t.RERENDER="rerender",t.AFTER_RENDER="afterrender",t.BEFORE_DESTROY="beforedestroy",t.AFTER_DESTROY="afterdestroy",t.RESIZE="resize",t.DIRTY_RECTANGLE="dirtyrectangle",t.RENDERER_CHANGED="rendererchanged",t}({}),Wl=new gs(Ss.MOUNTED),Xl=new gs(Ss.UNMOUNTED),Yl=new gs(Zl.BEFORE_RENDER),ql=new gs(Zl.RERENDER),$l=new gs(Zl.AFTER_RENDER),Kl=function(t){function e(t){var n;(0,o.Z)(this,e),(n=d(this,e)).Element=yl,n.inited=!1,n.context={},n.document=new zl,n.document.defaultView=n,n.customElements=new Fl;var i=t.container,r=t.canvas,a=t.offscreenCanvas,s=t.width,l=t.height,u=t.devicePixelRatio,c=t.renderer,h=t.background,f=t.cursor,p=t.document,g=t.requestAnimationFrame,m=t.cancelAnimationFrame,v=t.createImage,y=t.enableLargeImageOptimization,x=t.supportsPointerEvents,b=t.supportsTouchEvents,_=t.supportsCSSTransform,E=t.cleanUpOnDestroy,w=void 0===E||E,T=t.supportsMutipleCanvasesInOneContainer,S=t.useNativeClickEvent,M=t.alwaysTriggerPointerEventOnCanvas,C=t.isTouchEvent,A=t.isMouseEvent,O=t.dblClickSpeed;T||yo(i,n,w);var N=s,P=l,L=u;return r&&(L=(L=u||xo&&window.devicePixelRatio||1)>=1?Math.ceil(L):1,N=s||function(t){var e=wo(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(r)||r.width/L,P=l||function(t){var e=wo(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(r)||r.height/L),a&&(al.offscreenCanvas=a),n.devicePixelRatio=L,n.requestAnimationFrame=null!=g?g:Bo.bind(al.globalThis),n.cancelAnimationFrame=null!=m?m:Fo.bind(al.globalThis),n.supportsTouchEvents=null!=b?b:"ontouchstart"in al.globalThis,n.supportsPointerEvents=null!=x?x:!!al.globalThis.PointerEvent,n.isTouchEvent=null!=C?C:function(t){return n.supportsTouchEvents&&t instanceof al.globalThis.TouchEvent},n.isMouseEvent=null!=A?A:function(t){return!al.globalThis.MouseEvent||t instanceof al.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof al.globalThis.PointerEvent))},n.dblClickSpeed=null!=O?O:200,n.initRenderingContext({container:i,canvas:r,width:N,height:P,renderer:c,offscreenCanvas:a,devicePixelRatio:L,cursor:f||"default",background:h||"transparent",createImage:v,enableLargeImageOptimization:y,document:p,supportsCSSTransform:_,useNativeClickEvent:S,cleanUpOnDestroy:w,alwaysTriggerPointerEventOnCanvas:M}),n.initDefaultCamera(N,P,c.clipSpaceNearZ),n.initRenderer(c,!0),n}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(t,e,n){var i=this,r=new al.CameraContribution;r.clipSpaceNearZ=n,r.setType(qi.EXPLORING,$i.DEFAULT).setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0).setOrthographic(t/-2,t/2,e/2,e/-2,.1,1e3),r.canvas=this,r.eventEmitter.on(Qi,(function(){i.context.renderingContext.renderReasons.add(_s.CAMERA_CHANGED),al.enableSizeAttenuation&&i.getConfig().renderer.getConfig().enableSizeAttenuation&&i.updateSizeAttenuation()})),this.context.camera=r}},{key:"updateSizeAttenuation",value:function(){var t=this.getCamera().getZoom();this.document.documentElement.forEach((function(e){al.styleValueRegistry.updateSizeAttenuation(e,t)}))}},{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 t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}},{key:"destroy",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1?arguments[1]:void 0;void 0===e&&(e=this.getConfig().fastCleanExistingCanvas),e||this.dispatchEvent(new gs(Zl.BEFORE_DESTROY)),this.frameId&&this.cancelAnimationFrame(this.frameId);var n=this.getRoot();this.unmountChildren(n),t&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),t&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),e||this.dispatchEvent(new gs(Zl.AFTER_DESTROY));var i=function(t){t.currentTarget=null,t.manager=null,t.target=null,t.relatedNode=null};i(Wl),i(Xl),i(Yl),i(ql),i($l),i(gl),i(ul),i(cl),i(hl)}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(t,e){var n=this.context.config;n.width=t,n.height=e,this.getContextService().resize(t,e);var i=this.context.camera,r=i.getProjectionMode();i.setPosition(t/2,e/2,500).setFocalPoint(t/2,e/2,0),r===Ki.ORTHOGRAPHIC?i.setOrthographic(t/-2,t/2,e/2,e/-2,i.getNear(),i.getFar()):i.setAspect(t/e),this.dispatchEvent(new gs(Zl.RESIZE,{width:t,height:e}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(t){var e=this;t&&(Yl.detail=t,$l.detail=t),this.dispatchEvent(Yl),this.getRenderingService().render(this.getConfig(),t,(function(){e.dispatchEvent(ql)})),this.dispatchEvent($l)}},{key:"run",value:function(){var t=this,e=function(n,i){t.render(i),t.frameId=t.requestAnimationFrame(e)};e()}},{key:"initRenderer",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new fi,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new jl,new Vl,new Gl([new Hl])),this.loadRendererContainerModule(t),this.context.contextService=new this.context.ContextService((0,a.Z)((0,a.Z)({},al),this.context)),this.context.renderingService=new Es(al,this.context),this.context.eventService=new xs(al,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(t,n,!0)):this.context.contextService.initAsync().then((function(){e.initRenderingService(t,n)}))}},{key:"initRenderingService",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.context.renderingService.init((function(){e.inited=!0,n?i?e.requestAnimationFrame((function(){e.dispatchEvent(new gs(Zl.READY))})):e.dispatchEvent(new gs(Zl.READY)):e.dispatchEvent(new gs(Zl.RENDERER_CHANGED)),e.readyPromise&&e.resolveReadyPromise(),n||e.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),e.mountChildren(e.getRoot()),t.getConfig().enableAutoRendering&&e.run()}))}},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(al)}))}},{key:"setRenderer",value:function(t){var e=this.getConfig();if(e.renderer!==t){var n=e.renderer;e.renderer=t,this.destroy(!1,!0),(0,l.Z)((null==n?void 0:n.getPlugins())||[]).reverse().forEach((function(t){t.destroy(al)})),this.initRenderer(t)}}},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Xl):(Xl.target=t,this.dispatchEvent(Xl,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mo(t);this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,n||(t.isMutationObserved?t.dispatchEvent(Wl):(Wl.target=t,this.dispatchEvent(Wl,!0)))):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: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t,n)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()}},{key:"mountFragment",value:function(t){this.mountChildren(t,!1)}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}])}(vs),Ql=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r90)return this;this.computeMatrix()}return this._getAxes(),this.type===qi.ORBITING||this.type===qi.EXPLORING?this._getPosition():this.type===qi.TRACKING&&this._getFocalPoint(),this._update(),this}},{key:"pan",value:function(t,e){var n=Di(t,e,0),i=x(this.position);return T(i,i,C(y(),this.right,n[0])),T(i,i,C(y(),this.up,n[1])),this._setPosition(i),this.triggerUpdate(),this}},{key:"dolly",value:function(t){var e=this.forward,n=x(this.position),i=this.dollyingStep,r=this.distance+t*this.dollyingStep;return i=Math.max(Math.min(r,this.maxDistance),this.minDistance)-this.distance,n[0]+=i*e[0],n[1]+=i*e[1],n[2]+=i*e[2],this._setPosition(n),this.type===qi.ORBITING||this.type===qi.EXPLORING?this._getDistance():this.type===qi.TRACKING&&T(this.focalPoint,n,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,i,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,l=a.focalPoint,u=void 0===l?this.focalPoint:l,c=a.roll,h=a.zoom,d=new al.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),d.setFocalPoint(u[0],null!==(i=u[1])&&void 0!==i?i:this.focalPoint[1],null!==(r=u[2])&&void 0!==r?r:this.focalPoint[2]),d.setRoll(null!=c?c:this.roll),d.setZoom(null!=h?h:this.zoom);var f={name:t,matrix:H(d.getWorldTransform()),right:x(d.right),up:x(d.up),forward:x(d.forward),position:x(d.getPosition()),focalPoint:x(d.getFocalPoint()),distanceVector:x(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(f),f}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=(0,ue.Z)(t)?this.landmarks.find((function(e){return e.name===t})):t;if(i){var r=(0,oe.Z)(n)?{duration:n}:n,a=r.easing,o=void 0===a?"linear":a,s=r.duration,l=void 0===s?100:s,u=r.easingFunction,c=void 0===u?void 0:u,h=r.onfinish,d=void 0===h?void 0:h,f=r.onframe,p=void 0===f?void 0:f,g=.01;this.cancelLandmarkAnimation();var m,v=i.position,x=i.focalPoint,b=i.zoom,_=i.roll,E=c||al.EasingFunction(o),w=function(){e.setFocalPoint(x),e.setPosition(v),e.setRoll(_),e.setZoom(b),e.computeMatrix(),e.triggerUpdate(),null==d||d()};if(0===l)return w();var T=function(t){void 0===m&&(m=t);var n=t-m;if(n>=l)w();else{var i,r,a=E(n/l),o=y(),s=y();if(P(o,e.focalPoint,x,a),P(s,e.position,v,a),r=e.roll*(1-a)+_*a,i=e.zoom*(1-a)+b*a,e.setFocalPoint(o),e.setPosition(s),e.setRoll(r),e.setZoom(i),B(o,x)+B(s,v)<=g&&void 0===b&&void 0===_)return w();e.computeMatrix(),e.triggerUpdate(),n0&&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||"running"===this.playState||!this._finishedFlag}},{key:"updatePromises",value:function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,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),-1===this.timeline.animations.indexOf(this)&&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._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,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 t=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 e=new Jl(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value:function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))}},{key:"rewind",value:function(){if(this.playbackRate>=0)this.currentTime=0;else{if(!(this._totalDuration<1/0))throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}}},{key:"persist",value:function(){throw new Error(Ni)}},{key:"addEventListener",value:function(t,e,n){throw new Error(Ni)}},{key:"removeEventListener",value:function(t,e,n){throw new Error(Ni)}},{key:"dispatchEvent",value:function(t){throw new Error(Ni)}},{key:"commitStyles",value:function(){throw new Error(Ni)}},{key:"ensureAlive",value:function(){var t,e;this.playbackRate<0&&0===this.currentTime?this._inEffect=!(null===(t=this.effect)||void 0===t||!t.update(-1)):this._inEffect=!(null===(e=this.effect)||void 0===e||!e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Jl(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var i=new Jl(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}}}])}(),nu=.1,iu="function"==typeof Float32Array,ru=function(t,e){return 1-3*e+3*t},au=function(t,e){return 3*e-6*t},ou=function(t){return 3*t},su=function(t,e,n){return((ru(e,n)*t+au(e,n))*t+ou(e))*t},lu=function(t,e,n){return 3*ru(e,n)*t*t+2*au(e,n)*t+ou(e)},uu=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(t){return t};for(var r=iu?new Float32Array(11):new Array(11),a=0;a<11;++a)r[a]=su(a*nu,t,n);var o=function(e){for(var i=0,a=1;10!==a&&r[a]<=e;++a)i+=nu;--a;var o=i+(e-r[a])/(r[a+1]-r[a])*nu,s=lu(o,t,n);return s>=.001?function(t,e,n,i){for(var r=0;r<4;++r){var a=lu(e,n,i);if(0===a)return e;e-=(su(e,n,i)-t)/a}return e}(e,o,t,n):0===s?o:function(t,e,n,i,r){var a,o,s=0;do{(a=su(o=e+(n-e)/2,i,r)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,i,i+nu,t,n)};return function(t){return 0===t||1===t?t:su(o(t),e,i)}},cu=function(t){return Math.pow(t,2)},hu=function(t){return Math.pow(t,3)},du=function(t){return Math.pow(t,4)},fu=function(t){return Math.pow(t,5)},pu=function(t){return Math.pow(t,6)},gu=function(t){return 1-Math.cos(t*Math.PI/2)},mu=function(t){return 1-Math.sqrt(1-t*t)},vu=function(t){return t*t*(3*t-2)},yu=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((3*e-2)/22-t,2)},xu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,p.Z)(e,2),i=n[0],r=void 0===i?1:i,a=n[1],o=void 0===a?.5:a,s=ce(Number(r),1,10),l=ce(Number(o),.1,2);return 0===t||1===t?t:-s*Math.pow(2,10*(t-1))*Math.sin((t-1-l/(2*Math.PI)*Math.asin(1/s))*(2*Math.PI)/l)},bu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,i=(0,p.Z)(e,4),r=i[0],a=void 0===r?1:r,o=i[1],s=void 0===o?100:o,l=i[2],u=void 0===l?10:l,c=i[3],h=void 0===c?0:c;a=ce(a,.1,1e3),s=ce(s,.1,1e3),u=ce(u,.1,1e3),h=ce(h,.1,1e3);var d=Math.sqrt(s/a),f=u/(2*Math.sqrt(s*a)),g=f<1?d*Math.sqrt(1-f*f):0,m=1,v=f<1?(f*d-h)/g:-h+d,y=n?n*t/1e3:t;return y=f<1?Math.exp(-y*f*d)*(m*Math.cos(g*y)+v*Math.sin(g*y)):(m+v*y)*Math.exp(-y*d),0===t||1===t?t:1-y},_u=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e,i=(0,p.Z)(n,2),r=i[0],a=void 0===r?10:r,o=i[1],s="start"===o?Math.ceil:Math.floor;return s(ce(t,0,1)*a)/a},Eu=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=(0,p.Z)(e,4),i=n[0],r=n[1],a=n[2],o=n[3];return uu(i,r,a,o)(t)},wu=uu(.42,0,1,1),Tu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return 1-t(1-e,n,i)}},Su=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?t(2*e,n,i)/2:1-t(-2*e+2,n,i)/2}},Mu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0;return e<.5?(1-t(1-2*e,n,i))/2:(t(2*e-1,n,i)+1)/2}},Cu={steps:_u,"step-start":function(t){return _u(t,[1,"start"])},"step-end":function(t){return _u(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Eu,ease:function(t){return Eu(t,[.25,.1,.25,1])},in:wu,out:Tu(wu),"in-out":Su(wu),"out-in":Mu(wu),"in-quad":cu,"out-quad":Tu(cu),"in-out-quad":Su(cu),"out-in-quad":Mu(cu),"in-cubic":hu,"out-cubic":Tu(hu),"in-out-cubic":Su(hu),"out-in-cubic":Mu(hu),"in-quart":du,"out-quart":Tu(du),"in-out-quart":Su(du),"out-in-quart":Mu(du),"in-quint":fu,"out-quint":Tu(fu),"in-out-quint":Su(fu),"out-in-quint":Mu(fu),"in-expo":pu,"out-expo":Tu(pu),"in-out-expo":Su(pu),"out-in-expo":Mu(pu),"in-sine":gu,"out-sine":Tu(gu),"in-out-sine":Su(gu),"out-in-sine":Mu(gu),"in-circ":mu,"out-circ":Tu(mu),"in-out-circ":Su(mu),"out-in-circ":Mu(mu),"in-back":vu,"out-back":Tu(vu),"in-out-back":Su(vu),"out-in-back":Mu(vu),"in-bounce":yu,"out-bounce":Tu(yu),"in-out-bounce":Su(yu),"out-in-bounce":Mu(yu),"in-elastic":xu,"out-elastic":Tu(xu),"in-out-elastic":Su(xu),"out-in-elastic":Mu(xu),spring:bu,"spring-in":bu,"spring-out":Tu(bu),"spring-in-out":Su(bu),"spring-out-in":Mu(bu)},Au=function(t){return t};function Ou(t,e){return function(n){if(n>=1)return 1;var i=1/t;return(n+=e*i)-n%i}}var Nu="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Pu=new RegExp("cubic-bezier\\(".concat(Nu,",").concat(Nu,",").concat(Nu,",").concat(Nu,"\\)")),Lu=/steps\(\s*(\d+)\s*\)/,Ru=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Du(t){var e=Pu.exec(t);if(e)return uu.apply(void 0,(0,l.Z)(e.slice(1).map(Number)));var n=Lu.exec(t);if(n)return Ou(Number(n[1]),0);var i=Ru.exec(t);return i?Ou(Number(i[1]),{start:1,middle:.5,end:0}[i[2]]):Cu[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Cu.linear}function ku(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function Iu(t,e,n){var i=function(t,e,n){if(null===e)return 0;var i=n.endTime;return e=Math.min(n.delay+t+n.endDelay,i)?2:3}(t,e,n),r=function(t,e,n,i,r){switch(i){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-r;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,i,n.delay);if(null===r)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,i,r){var a=r;return 0===t?1!==e&&(a+=n):a+=i/t,a}(a,i,n.iterations,r,n.iterationStart),s=function(t,e,n,i,r,a){var o=t===1/0?e%1:t%1;return 0!==o||2!==n||0===i||0===r&&0!==a||(o=1),o}(o,n.iterationStart,i,n.iterations,r,a),l=function(t,e,n,i){return 2===t&&e===1/0?1/0:1===n?Math.floor(i)-1:Math.floor(i)}(i,n.iterations,s,o),u=function(t,e,n){var i=t;if("normal"!==t&&"reverse"!==t){var r=e;"alternate-reverse"===t&&(r+=1),i="normal",r!==1/0&&r%2!=0&&(i="reverse")}return"normal"===i?n:1-n}(n.direction,l,s);return n.currentIteration=l,n.progress=u,n.easingFunction(u)}function Bu(t,e,n){var i=function(t,e){for(var n={},i=0;i=t.applyFrom&&e1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=r}}else if("composite"===i&&-1===["replace","add","accumulate","auto"].indexOf(r))throw new Error("".concat(r," compositing is not supported"));n[i]=r}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),i=!0,r=-1/0,a=0;a=0&&Number(t.offset)<=1})),i||function(){var t,e,i=n.length;n[i-1].computedOffset=Number(null!==(t=n[i-1].offset)&&void 0!==t?t:1),i>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var r=0,a=Number(n[0].computedOffset),o=1;o{!bc.mute&&console.debug(xc(t))},info:t=>{!bc.mute&&console.info(xc(t))},warn:t=>{!bc.mute&&console.warn(xc(t))},error:t=>{!bc.mute&&console.error(xc(t))}};function _c(t){const{theme:e}=t;if(!e)return{};const n=yc(mc.THEME,e);return n||(bc.warn(`The theme of ${e} is not registered.`),{})}function Ec(t,e){if(Array.isArray(t)&&0===t.length)return null;const n=Array.isArray(t)?t[0]:t,i=Array.isArray(t)?t.slice(1):e||[];return new Proxy(n,{get(t,e){return"function"!=typeof t[e]||["onframe","onfinish"].includes(e)?"finished"===e?Promise.all([n.finished,...i.map((t=>t.finished))]):Reflect.get(t,e):(...n)=>{t[e](...n),i.forEach((t=>{var i;return null===(i=t[e])||void 0===i?void 0:i.call(t,...n)}))}},set(t,e,n){return["onframe","onfinish"].includes(e)||i.forEach((t=>{t[e]=n})),Reflect.set(t,e,n)}})}function wc(t){const e=t.reduce(((t,e)=>(Object.entries(e).forEach((([e,n])=>{void 0===t[e]?t[e]=[n]:t[e].push(n)})),t)),{});Object.entries(e).forEach((([n,i])=>{(i.length!==t.length||i.some((t=>(0,le.Z)(t)))||i.every((t=>!["sourceNode","targetNode","childrenNode"].includes(n)&&ec(t,i[0]))))&&delete e[n]}));const n=Object.entries(e).reduce(((t,[e,n])=>(n.forEach(((n,i)=>{t[i]?t[i][e]=n:t[i]={[e]:n}})),t)),[]);return 0!==t.length&&0===n.length&&n.push({_:0},{_:0}),n}function Tc(t){switch(t){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 Sc(t,e){const{animation:n}=t;if(!1===n||!1===e)return!1;const i=Object.assign({},nc);return(0,nn.Z)(n)&&Object.assign(i,n),(0,nn.Z)(e)&&Object.assign(i,e),i}function Mc(t,e,n,i){var r,a;const{animation:o}=t,s=null===(r=null==t?void 0:t[e])||void 0===r?void 0:r.animation;if(!1===s)return[];const l=null==s?void 0:s[n];if(!1===l)return[];if(!1===o||!1===i)return[];const u=null===(a=_c(t)[e])||void 0===a?void 0:a.animation,c=(t=[])=>function(t){if("string"==typeof t){return yc(mc.ANIMATION,t)||(bc.warn(`The animation of ${t} is not registered.`),[])}return t}(t).map((t=>Object.assign(Object.assign(Object.assign(Object.assign({},ic),(0,nn.Z)(o)&&o),t),(0,nn.Z)(i)&&i)));if(l)return c(l);if(!u)return[];const h=u[n];return!1===h?[]:c(h)}function Cc(t,e,n,i){if(Array.isArray(i)){let r=!1;const a=[];for(let o=0;o{if(!n.length)return null;const[i,r]=e;let a;const o=n.map((e=>{var{fields:n,shape:o,states:s}=e,l=Ac(e,["fields","shape","states"]);const u=(e=>{var n;if(e){const a=t.getShape(e);if(!a)return null;const o=`get${Ku(e)}Style`,s=(null===(n=null==t?void 0:t[o])||void 0===n?void 0:n.bind(t))||(t=>t);return{shape:a,fromStyle:(null==s?void 0:s(i))||{},toStyle:(null==s?void 0:s(r))||{}}}return{shape:t,fromStyle:i,toStyle:r}})(o);if(!u)return null;const{shape:c,fromStyle:h,toStyle:d}=u,f=[{},{}];if(n.forEach((t=>{var e,n;Object.assign(f[0],{[t]:null!==(e=h[t])&&void 0!==e?e:Tc(t)}),Object.assign(f[1],{[t]:null!==(n=d[t])&&void 0!==n?n:Tc(t)})})),f.some((t=>Object.keys(t).some((t=>["x","y","z"].includes(t)))))){const{x:t=0,y:e=0,z:n=0,transform:i=""}=c.attributes||{};f.forEach((r=>{r.transform=Cc(r.x||t,r.y||e,r.z||n,i)}))}const p=c.animate(wc(f),l);return void 0===o&&(a=p),p})).filter(Boolean),s=a||(null==o?void 0:o[0]);return s?Ec(s,o.filter((t=>t!=t))):null},Nc=[{fields:["x","y"]}],Pc=Nc,Lc=[{fields:["sourceNode","targetNode"]}],Rc=Lc,Dc=[{fields:["childrenNode","x","y"]}],kc=Dc;var Ic=Object.prototype.hasOwnProperty;var Bc=function(t,e){if(!e||!(0,Fe.Z)(t))return{};for(var n,i={},r=(0,en.Z)(e)?e:function(t){return t[e]},a=0;ae?(i&&(clearTimeout(i),i=null),s=u,o=t.apply(r,a),i||(r=a=null)):i||!1===n.trailing||(i=setTimeout(l,c)),o};return u.cancel=function(){clearTimeout(i),s=0,i=r=a=null},u},zc=n(83559);function Gc(t){return t instanceof Float32Array||!(!Array.isArray(t)||2!==t.length&&3!==t.length)&&t.every((t=>"number"==typeof t))}function jc(t,e,n){return t>=e&&t<=n}function Uc(t=0){if(Array.isArray(t)){const[e=0,n=e,i=e,r=n]=t;return[e,n,i,r]}return[t,t,t,t]}function Hc(t=0){const e=Uc(t);return e[0]+e[2]}function Vc(t){return t.max[0]-t.min[0]}function Zc(t){return t.max[1]-t.min[1]}function Wc(t){return[Vc(t),Zc(t)]}function Xc(t,e){const n=Gc(t)?Yc(t):t.getShape("key").getBounds();return e?qc(n,e):n}function Yc(t){const[e,n,i=0]=t,r=new Ti;return r.setMinMax([e,n,i],[e,n,i]),r}function qc(t,e){const[n,i,r,a]=Uc(e),[o,s,l]=t.min,[u,c,h]=t.max,d=new Ti;return d.setMinMax([o-a,s-n,l],[u+i,c+r,h]),d}function $c(t){if(0===t.length)return new Ti;if(1===t.length)return t[0];const e=new Ti;e.setMinMax(t[0].min,t[0].max);for(let n=1;nc[e.id]+s?(c[o]=c[e.id]+s,h[o]=[e.id]):c[o]===c[e.id]+s&&h[o].push(e.id)}))},p=0;p0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.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)}},t.prototype.moveDown=function(t){var e,n=t,i=this.getLeft(t),r=this.getRight(t),a=this.list.length;null!==i&&i0?n=i:null!==r&&r0&&(n=r),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))}}(),function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var i,r=1,a=0,o=1e3,s=t.nodes,l=void 0===s?[]:s,u=t.edges,c=void 0===u?[]:u,h=l.length,d={},f={},p=0;p0&&r>e;){a=0;for(p=0;p0&&(i+=f[x]/b)}d[m]=n*i,a+=d[m]}}a=(1-a)/h,r=0;for(p=0;p=0;e--){var n=this.dfsEdgeList[e],i=n.fromNode,r=n.toNode;ih||i.hasNode(a[c.to])||(e.labelp;m--){if("break"===g(m))break}if(d){var v=t.findMinLabel(h);a.dfsEdgeList.push(new Ph(c,f,Ch,v.edgeLabel,Ch));var y=a.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[y]===a.dfsEdgeList[y]&&o(h[v.edgeLabel].projected)}var x={};d=!1;var b=0;s.forEach((function(e){var n=new Rh(e),a=t.findForwardPureEdges(i,n.edges[l[0]],u,n);a.length>0&&(d=!0,b=c,a.forEach((function(t){var n="".concat(t.label,"-").concat(r[t.to].label);x[n]||(x[n]={projected:[],edgeLabel:t.label,nodeLabel2:r[t.to].label}),x[n].projected.push({graphId:i.id,edge:t,preNode:e})})))}));var _=l.length,E=function(e){if(d)return"break";var n=l[e];s.forEach((function(e){var o=new Rh(e),s=t.findForwardRmpathEdges(i,o.edges[n],u,o);s.length>0&&(d=!0,b=a.dfsEdgeList[n].fromNode,s.forEach((function(t){var n="".concat(t.label,"-").concat(r[t.to].label);x[n]||(x[n]={projected:[],edgeLabel:t.label,nodeLabel2:r[t.to].label}),x[n].projected.push({graphId:i.id,edge:t,preNode:e})})))}))};for(m=0;m<_;m++){if("break"===E(m))break}if(!d)return!0;var w=t.findMinLabel(x);a.dfsEdgeList.push(new Ph(b,c+1,Ch,w.edgeLabel,w.nodeLabel2));var T=a.dfsEdgeList.length-1;return e.dfsEdgeList[T]===a.dfsEdgeList[T]&&o(x["".concat(w.edgeLabel,"-").concat(w.nodeLabel2)].projected)}(o[l].projected)}},t.prototype.report=function(){if(!(this.dfsCode.getNodeNum()=0;h--){var d=e.findBackwardEdge(l,c.edges[i[h]],c.edges[i[0]],c);if(d){var f="".concat(e.dfsCode.dfsEdgeList[i[h]].fromNode,"-").concat(d.label);s[f]||(s[f]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[i[h]].fromNode,edgeLabel:d.label}),s[f].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(l,c.edges[i[0]],a,c).forEach((function(e){var n="".concat(r,"-").concat(e.label,"-").concat(u[e.to].label);o[n]||(o[n]={projected:[],fromNodeId:r,edgeLabel:e.label,nodeLabel2:u[e.to].label}),o[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var p=function(n){e.findForwardRmpathEdges(l,c.edges[i[n]],a,c).forEach((function(r){var a="".concat(e.dfsCode.dfsEdgeList[i[n]].fromNode,"-").concat(r.label,"-").concat(u[r.to].label);o[a]||(o[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[i[n]].fromNode,edgeLabel:r.label,nodeLabel2:u[r.to].label}),o[a].projected.push({graphId:t.graphId,edge:r,preNode:t})}))};for(h=0;hr){var o=r;r=i,i=o}var c=t.label,h="".concat(n,"-").concat(i,"-").concat(c,"-").concat(r),d="".concat(i,"-").concat(c,"-").concat(r);if(!a[d]){var f=a[d]||0;f++,a[d]=f}s[h]={graphId:n,nodeLabel1:i,edgeLabel:c,nodeLabel2:r}}))}))})),Object.keys(r).forEach((function(t){if(!(r[t]=this.maxStep},t.prototype.peek=function(){return this.isEmpty()?null:this.linkedList.head.value},t.prototype.push=function(t){this.linkedList.prepend(t),this.length>this.maxStep&&this.linkedList.deleteTail()},t.prototype.pop=function(){var t=this.linkedList.deleteHead();return t?t.value:null},t.prototype.toArray=function(){return this.linkedList.toArray().map((function(t){return t.value}))},t.prototype.clear=function(){for(;!this.isEmpty();)this.pop()}}();function Dh(t){if(void 0!==t.id)return t.id;if(void 0!==t.source&&void 0!==t.target)return`${t.source}-${t.target}`;throw new Error(xc("The datum does not have available id."))}function kh(t){return t.combo}function Ih(t,e){const n={nodes:(t.nodes||[]).map(Dh),edges:(t.edges||[]).map(Dh),combos:(t.combos||[]).map(Dh)};return e?Object.values(n).flat():n}const Bh=(t,e,n)=>{var i;switch(n.type){case"degree":{const r=new Map;return null===(i=t.nodes)||void 0===i||i.forEach((t=>{const i=e(Dh(t),n.direction).length;r.set(Dh(t),i)})),r}case"betweenness":return zh(t,n.directed,n.weightPropertyName);case"closeness":return Gh(t,n.directed,n.weightPropertyName);case"eigenvector":return Uh(t,n.directed);case"pagerank":return jh(t,n.epsilon,n.linkProb);default:return Fh(t)}},Fh=t=>{var e;const n=new Map;return null===(e=t.nodes)||void 0===e||e.forEach((t=>{n.set(Dh(t),0)})),n},zh=(t,e,n)=>{const i=Fh(t),{nodes:r=[]}=t;return r.forEach((a=>{r.forEach((r=>{if(a!==r){const{allPath:o}=Th(t,Dh(a),Dh(r),e,n),s=o.length;o.flat().forEach((t=>{t!==Dh(a)&&t!==Dh(r)&&i.set(t,i.get(t)+1/s)}))}}))})),i},Gh=(t,e,n)=>{const i=new Map,{nodes:r=[]}=t;return r.forEach((a=>{const o=r.reduce(((i,r)=>{if(a!==r){const{length:o}=Th(t,Dh(a),Dh(r),e,n);i+=o}return i}),0);i.set(Dh(a),1/o)})),i},jh=(t,e,n)=>{var i;const r=new Map,a=Mh(t,e,n);return null===(i=t.nodes)||void 0===i||i.forEach((t=>{r.set(Dh(t),a[Dh(t)])})),r},Uh=(t,e)=>{const{nodes:n=[]}=t,i=Hh(t,e),r=Vh(i,n.length),a=new Map;return n.forEach(((t,e)=>{a.set(Dh(t),r[e])})),a},Hh=(t,e)=>{const{nodes:n=[],edges:i=[]}=t,r=Array(n.length).fill(null).map((()=>Array(n.length).fill(0)));return i.forEach((({source:t,target:i})=>{const a=n.findIndex((e=>Dh(e)===t)),o=n.findIndex((t=>Dh(t)===i));e?r[a][o]=1:(r[a][o]=1,r[o][a]=1)})),r},Vh=(t,e,n=100,i=1e-6)=>{let r=Array(e).fill(1),a=1/0;for(let o=0;oi;o++){const n=Array(e).fill(0);for(let i=0;it+e*e),0));for(let t=0;tt+(e-r[n])*e),0)),r=n}return r};function Zh(t,e,n,i=ec){const r=new Map(t.map((t=>[n(t),t]))),a=new Map(e.map((t=>[n(t),t]))),o=new Set(r.keys()),s=new Set(a.keys()),l=[],u=[],c=[],h=[];return s.forEach((t=>{o.has(t)?i(r.get(t),a.get(t))?h.push(a.get(t)):u.push(a.get(t)):l.push(a.get(t))})),o.forEach((t=>{s.has(t)||c.push(r.get(t))})),{enter:l,exit:c,keep:h,update:u}}const Wh=new WeakMap;function Xh(t,e,n=!1,i){if(void 0===e)return;const r=(a,o=e)=>{const s=(t=o)=>a.childNodes.forEach((e=>r(e,t)));if(i&&!i(a))return s();if(n||a!==t){Wh.has(a)||Wh.set(a,a.style.visibility);const t="hidden"===o||"hidden"===function(t){return Wh.has(t)?Wh.get(t):t.style.visibility}(a)?"hidden":"visible";a.style.visibility=t,s(t)}else t.style.visibility=e,Wh.delete(t),s(e)};r(t)}class Yh{constructor(t){this.extensions=[],this.extensionMap={},this.context=t}setExtensions(t){const e=function(t,e,n){const i={},r=t=>(t in i||(i[t]=0),`${e}-${t}-${i[t]++}`);return n.map((e=>"string"==typeof e?{type:e,key:r(e)}:"function"==typeof e?e.call(t):e.key?e:Object.assign(Object.assign({},e),{key:r(e.type)})))}(this.context.graph,this.category,t),{enter:n,update:i,exit:r,keep:a}=Zh(this.extensions,e,(t=>t.key));this.createExtensions(n),this.updateExtensions([...i,...a]),this.destroyExtensions(r),this.extensions=e}createExtension(t){const{category:e}=this,{key:n,type:i}=t,r=yc(e,i);if(!r)return bc.warn(`The extension ${i} of ${e} is not registered.`);const a=new r(this.context,t);this.extensionMap[n]=a}createExtensions(t){t.forEach((t=>this.createExtension(t)))}updateExtension(t){const{key:e}=t,n=this.extensionMap[e];n&&n.update(t)}updateExtensions(t){t.forEach((t=>this.updateExtension(t)))}destroyExtension(t){const e=this.extensionMap[t];e&&(e.destroy(),delete this.extensionMap[t])}destroyExtensions(t){t.forEach((({key:t})=>this.destroyExtension(t)))}destroy(){Object.values(this.extensionMap).forEach((t=>t.destroy())),this.context={},this.extensions=[],this.extensionMap={}}}class qh{constructor(t,e){this.events=[],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 $h extends qh{}class Kh extends $h{constructor(t,e){super(t,Object.assign({},Kh.defaultOptions,e)),this.isOverlapping=(t,e)=>e.some((e=>t.intersects(e))),this.occupiedBounds=[],this.detectLabelCollision=t=>{const e=this.context.viewport,n={show:[],hide:[]};return this.occupiedBounds=[],t.forEach((t=>{const i=t.getShape("label").getRenderBounds();e.isInViewport(i,!0)&&!this.isOverlapping(i,this.occupiedBounds)?(n.show.push(t),this.occupiedBounds.push(qc(i,this.options.padding))):n.hide.push(t)})),n},this.hideLabelIfExceedViewport=(t,e)=>{const{exit:n}=Zh(t,e,(t=>t.id));null==n||n.forEach(this.hideLabel)},this.nodeCentralities=new Map,this.sortNodesByCentrality=(t,e)=>{const{model:n}=this.context,i=n.getData(),r=n.getRelatedEdgesData.bind(n);return t.map((t=>(this.nodeCentralities.has(t.id)||(this.nodeCentralities=Bh(i,r,e)),{node:t,centrality:this.nodeCentralities.get(t.id)}))).sort(((t,e)=>e.centrality-t.centrality)).map((t=>t.node))},this.sortLabelElementsInView=t=>{const{sort:e,sortNode:n,sortCombo:i,sortEdge:r}=this.options,{model:a}=this.context;if((0,en.Z)(e))return t.sort(((t,n)=>e(a.getElementDataById(t.id),a.getElementDataById(n.id))));const{node:o=[],edge:s=[],combo:l=[]}=Bc(t,(t=>t.type));return[...(0,en.Z)(i)?l.sort(((t,e)=>i(...a.getComboData([t.id,e.id])))):l,...(0,en.Z)(n)?o.sort(((t,e)=>n(...a.getNodeData([t.id,e.id])))):this.sortNodesByCentrality(o,n),...(0,en.Z)(r)?s.sort(((t,e)=>r(...a.getEdgeData([t.id,e.id])))):s]},this.labelElementsInView=[],this.isFirstRender=!0,this.onToggleVisibility=t=>{var e;if("zIndex"===(null===(e=t.data)||void 0===e?void 0:e.stage))return;if(!this.validate(t))return void(this.hiddenElements.size>0&&(this.hiddenElements.forEach(this.showLabel),this.hiddenElements.clear()));const n=this.isFirstRender?this.getLabelElements():this.getLabelElementsInView();this.hideLabelIfExceedViewport(this.labelElementsInView,n),this.labelElementsInView=n;const i=this.sortLabelElementsInView(this.labelElementsInView),{show:r,hide:a}=this.detectLabelCollision(i);for(let t=r.length-1;t>=0;t--)this.showLabel(r[t]);a.forEach(this.hideLabel)},this.hiddenElements=new Map,this.hideLabel=t=>{const e=t.getShape("label");e&&Xh(e,"hidden"),this.hiddenElements.set(t.id,t)},this.showLabel=t=>{const e=t.getShape("label");e&&Xh(e,"visible"),t.toFront(),this.hiddenElements.delete(t.id)},this.onTransform=Fc(this.onToggleVisibility,this.options.throttle,{leading:!0}),this.enableToggle=!0,this.toggle=t=>{this.enableToggle&&this.onToggleVisibility(t)},this.onBeforeRender=()=>{this.enableToggle=!1},this.onAfterRender=t=>{this.onToggleVisibility(t),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(hc.BEFORE_RENDER,this.onBeforeRender),t.on(hc.AFTER_RENDER,this.onAfterRender),t.on(hc.AFTER_DRAW,this.toggle),t.on(hc.AFTER_LAYOUT,this.toggle),t.on(hc.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(hc.BEFORE_RENDER,this.onBeforeRender),t.off(hc.AFTER_RENDER,this.onAfterRender),t.off(hc.AFTER_DRAW,this.toggle),t.off(hc.AFTER_LAYOUT,this.toggle),t.off(hc.AFTER_TRANSFORM,this.onTransform)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Kh.defaultOptions={enable:!0,throttle:100,padding:0,sortNode:{type:"degree"}};var Qh=n(58212);const Jh=[0,0,0];function td(t,e){return t.map(((t,n)=>t+e[n]))}function ed(t,e){return t.map(((t,n)=>t-e[n]))}function nd(t,e){return"number"==typeof e?t.map((t=>t*e)):t.map(((t,n)=>t*e[n]))}function id(t,e){return"number"==typeof e?t.map((t=>t/e)):t.map(((t,n)=>t/e[n]))}function rd(t,e){return t.map((t=>t*e))}function ad(t,e){return Math.sqrt(t.reduce(((t,n,i)=>t+Math.pow(n-e[i]||0,2)),0))}function od(t,e){return t.reduce(((t,n,i)=>t+Math.abs(n-e[i])),0)}function sd(t){const e=t.reduce(((t,e)=>t+Math.pow(e,2)),0);return t.map((t=>t/Math.sqrt(e)))}function ld(t,e,n=!1){const i=t[0]*e[1]-t[1]*e[0];let r=Math.acos(nd(t,e).reduce(((t,e)=>t+e),0)/(ad(t,Jh)*ad(e,Jh)));return n&&i<0&&(r=2*Math.PI-r),r}function ud(t,e=!0){return e?[-t[1],t[0]]:[t[1],-t[0]]}function cd(t){return[t[0],t[1]]}function hd(t){return function(t){return 2===t.length}(t)?[t[0],t[1],0]:t}function dd(t){const[e,n]=t;return e||n?Math.atan2(n,e):0}function fd(t,e){const[n,i]=t,[r,a]=e;return function(t,e){const n=hd(t),i=hd(e);return[n[1]*i[2]-n[2]*i[1],n[2]*i[0]-n[0]*i[2],n[0]*i[1]-n[1]*i[0]]}(ed(n,i),ed(r,a)).every((t=>0===t))}function pd(t,e,n=!1){if(fd(t,e))return;const[i,r]=t,[a,o]=e,s=((i[0]-a[0])*(a[1]-o[1])-(i[1]-a[1])*(a[0]-o[0]))/((i[0]-r[0])*(a[1]-o[1])-(i[1]-r[1])*(a[0]-o[0])),l=o[0]-a[0]?(i[0]-a[0]+s*(r[0]-i[0]))/(o[0]-a[0]):(i[1]-a[1]+s*(r[1]-i[1]))/(o[1]-a[1]);return n||jc(s,0,1)&&jc(l,0,1)?[i[0]+s*(r[0]-i[0]),i[1]+s*(r[1]-i[1])]:void 0}function gd(t){if(Array.isArray(t))return jc(t[0],0,1)&&jc(t[1],0,1)?t:[.5,.5];const e=t.split("-");return[e.includes("left")?0:e.includes("right")?1:.5,e.includes("top")?0:e.includes("bottom")?1:.5]}function md(t){const{x:e=0,y:n=0,z:i=0}=t.style||{};return[+e,+n,+i]}function vd(t){const{x:e,y:n,z:i}=t.style||{};return void 0!==e||void 0!==n||void 0!==i}function yd(t,e){const[n,i]=e,{min:r,max:a}=t;return[r[0]+n*(a[0]-r[0]),r[1]+i*(a[1]-r[1])]}function xd(t,e="center"){return yd(t,gd(e))}function bd(t){var e;return[t.x,t.y,null!==(e=t.z)&&void 0!==e?e:0]}function _d(t){var e;return{x:t[0],y:t[1],z:null!==(e=t[2])&&void 0!==e?e:0}}function Ed(t,e=0){return t.map((t=>parseFloat(t.toFixed(e))))}function wd(t,e,n,i=!1){if(ec(t,e))return t;const r=sd(i?ed(t,e):ed(e,t)),a=[r[0]*n,r[1]*n];return td(cd(t),a)}function Td(t,e){return t[1]===e[1]}function Sd(t,e){return[2*e[0]-t[0],2*e[1]-t[1]]}function Md(t,e,n,i=!0,r=!1){for(let a=0;a{const r=function(t,e){const n=Od(t,e);return ad(t,n)}(t,e);r1?c=1:c<0&&(c=0);return[n+c*l,i+c*u]}function Nd(t,e=!0){const n=function(t){return id(t.reduce(((t,e)=>td(t,e)),[0,0]),t.length)}(t);return t.sort((([t,i],[r,a])=>{const o=Math.atan2(i-n[1],t-n[0]),s=Math.atan2(a-n[1],r-n[0]);return e?s-o:o-s}))}function Pd(t,e){return[t,[t[0],e[1]],e,[e[0],t[1]]]}const Ld=t=>t.map((t=>(0,ue.Z)(t)?t.toLocaleLowerCase():t));class Rd{constructor(t){this.map=new Map,this.recordKey=new Set,this.onKeyDown=t=>{(null==t?void 0:t.key)&&(this.recordKey.add(t.key),this.trigger(t))},this.onKeyUp=t=>{(null==t?void 0:t.key)&&this.recordKey.delete(t.key)},this.onWheel=t=>{this.triggerExtendKey(lc.WHEEL,t)},this.onDrag=t=>{this.triggerExtendKey(lc.DRAG,t)},this.onFocus=()=>{this.recordKey.clear()},this.emitter=t,this.bindEvents()}bind(t,e){0!==t.length&&this.map.set(t,e)}unbind(t,e){this.map.forEach(((n,i)=>{ec(i,t)&&(e&&e!==n||this.map.delete(i))}))}unbindAll(){this.map.clear()}match(t){const e=Ld(Array.from(this.recordKey)).sort(),n=Ld(t).sort();return ec(e,n)}bindEvents(){var t;const{emitter:e}=this;e.on(lc.KEY_DOWN,this.onKeyDown),e.on(lc.KEY_UP,this.onKeyUp),e.on(lc.WHEEL,this.onWheel),e.on(lc.DRAG,this.onDrag),null===(t=globalThis.addEventListener)||void 0===t||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)&&ec(Array.from(this.recordKey),i.filter((e=>e!==t)))&&n(e)}))}destroy(){var t;this.unbindAll(),this.emitter.off(lc.KEY_DOWN,this.onKeyDown),this.emitter.off(lc.KEY_UP,this.onKeyUp),this.emitter.off(lc.WHEEL,this.onWheel),this.emitter.off(lc.DRAG,this.onDrag),null===(t=globalThis.removeEventListener)||void 0===t||t.call(globalThis,"blur",this.onFocus)}}class Dd extends $h{constructor(t,e){super(t,(0,Qh.Z)({},Dd.defaultOptions,e)),this.shortcut=new Rd(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 kl({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=kd(t),null===(e=this.rectShape)||void 0===e||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&&"default"===i&&this.updateElementsStates(Pd(this.startPoint,this.endPoint))}onPointerUp(t){this.startPoint&&(this.endPoint?(this.endPoint=kd(t),this.updateElementsStates(Pd(this.startPoint,this.endPoint)),this.clearBrush()):this.clearBrush())}clearStates(){this.endPoint||this.clearElementsStates()}clearElementsStates(){const{graph:t}=this.context,e=Object.values(t.getData()).reduce(((t,e)=>Object.assign({},t,e.reduce(((t,e)=>(t[Dh(e)]=[],t)),{}))),{});t.setElementState(e,this.options.animation)}updateElementsStates(t){const{graph:e}=this.context,{enableElements:n,state:i,mode:r,onSelect:a}=this.options,o=this.selector(e,t,n);let s={};switch(r){case"union":o.forEach((t=>{s[t]=[...e.getElementState(t),i]}));break;case"diff":o.forEach((t=>{const n=e.getElementState(t);s[t]=n.includes(i)?n.filter((t=>t!==i)):[...n,i]}));break;case"intersect":o.forEach((t=>{const n=e.getElementState(t);s[t]=n.includes(i)?[i]:[]}));break;default:o.forEach((t=>{s[t]=[i]}))}(0,en.Z)(a)&&(s=a(s)),e.setElementState(s,this.options.animation)}selector(t,e,n){if(!n||0===n.length)return[];const i=[],r=t.getData();if(n.forEach((n=>{r[`${n}s`].forEach((n=>{const r=Dh(n);"hidden"!==t.getElementVisibility(r)&&function(t,e,n,i){const r=t[0],a=t[1];let o=!1;void 0===n&&(n=0),void 0===i&&(i=e.length);const s=i-n;for(let t=0,i=s-1;ta!=c>a&&r<(u-s)*(a-l)/(c-l)+s&&(o=!o)}return o}(t.getElementPosition(r),e)&&i.push(r)}))})),n.includes("edge")){const t=r.edges;null==t||t.forEach((t=>{const{source:e,target:n}=t;i.includes(e)&&i.includes(n)&&i.push(Dh(t))}))}return i}clearBrush(){var t;null===(t=this.rectShape)||void 0===t||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((t=>"drag"!==t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}bindEvents(){const{graph:t}=this.context;t.on(lc.POINTER_DOWN,this.onPointerDown),t.on(lc.POINTER_MOVE,this.onPointerMove),t.on(lc.POINTER_UP,this.onPointerUp),t.on(oc.CLICK,this.clearStates)}unbindEvents(){const{graph:t}=this.context;t.off(lc.POINTER_DOWN,this.onPointerDown),t.off(lc.POINTER_MOVE,this.onPointerMove),t.off(lc.POINTER_UP,this.onPointerUp),t.off(oc.CLICK,this.clearStates)}update(t){this.unbindEvents(),this.options=(0,Qh.Z)(this.options,t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}Dd.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 kd=t=>[t.canvas.x,t.canvas.y],Id=.8,Bd=["node","edge","combo"];function Fd(t,e,n,i,r=0){"TB"===i&&e(t,r);const a=n(t);if(a)for(const t of a)Fd(t,e,n,i,r+1);"BT"===i&&e(t,r)}function zd(t,e,n,i,r="both"){if("combo"===e||"node"===e)return Gd(t,n,i,r);const a=t.getEdgeData(n);if(!a)return[];const o=Gd(t,a.source,i-1,r),s=Gd(t,a.target,i-1,r);return Array.from(new Set([...o,...s,n]))}function Gd(t,e,n,i="both"){const r=new Set,a=new Set,o=new Set;return function(t,e,n){const i=[[t,0]];for(;i.length;){const[t,r]=i.shift();e(t,r);const a=n(t);if(a)for(const t of a)i.push([t,r+1])}}(e,((e,r)=>{r>n||(o.add(e),t.getRelatedEdgesData(e,i).forEach((t=>{const e=Dh(t);!a.has(e)&&rt.getRelatedEdgesData(e,i).map((t=>t.source===e?t.target:t.source)).filter((t=>!r.has(t)&&(r.add(t),!0))))),Array.from(o)}function jd(t){return t.states||[]}var Ud=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Hd extends $h{constructor(t,e){super(t,Object.assign({},Hd.defaultOptions,e)),this.onClickSelect=t=>Ud(this,void 0,void 0,(function*(){var e,n;this.validate(t)&&(yield this.updateState(t),null===(n=(e=this.options).onClick)||void 0===n||n.call(e,t))})),this.onClickCanvas=t=>Ud(this,void 0,void 0,(function*(){var e,n;this.validate(t)&&(yield this.clearState(),null===(n=(e=this.options).onClick)||void 0===n||n.call(e,t))})),this.shortcut=new Rd(t.graph),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Bd.forEach((e=>{t.on(`${e}:${lc.CLICK}`,this.onClickSelect)})),t.on(oc.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:r}=this.options;return zd(i,n,e.id,"function"==typeof r?r(t):r).filter((t=>t!==e.id))}updateState(t){return Ud(this,void 0,void 0,(function*(){const{state:e,unselectedState:n,neighborState:i,animation:r}=this.options;if(!e&&!i&&!n)return;const{target:a}=t,{graph:o}=this.context,s=jd(o.getElementData(a.id)).includes(e)?"unselect":"select",l={},u=this.isMultipleSelect,c=[a.id],h=this.getNeighborIds(t);if(u)if(Object.assign(l,this.getDataStates()),"select"===s){const t=(t,e)=>{t.forEach((t=>{const i=new Set(o.getElementState(t));i.add(e),i.delete(n),l[t]=Array.from(i)}))};t(c,e),t(h,i),n&&Object.keys(l).forEach((t=>{const r=l[t];r.includes(e)||r.includes(i)||r.includes(n)||l[t].push(n)}))}else{const t=l[a.id];l[a.id]=t.filter((t=>t!==e&&t!==i)),t.includes(n)||l[a.id].push(n),h.forEach((t=>{l[t]=l[t].filter((t=>t!==i)),l[t].includes(e)||l[t].push(n)}))}else if("select"===s){Object.assign(l,this.getClearStates(!!n));const t=(t,e)=>{t.forEach((t=>{l[t]||(l[t]=o.getElementState(t)),l[t].push(e)}))};t(c,e),t(h,i),n&&Object.keys(l).forEach((t=>{c.includes(t)||h.includes(t)||l[t].push(n)}))}else Object.assign(l,this.getClearStates());yield o.setElementState(l,r)}))}getDataStates(){const{graph:t}=this.context,{nodes:e,edges:n,combos:i}=t.getData(),r={};return[...e,...n,...i].forEach((t=>{r[Dh(t)]=jd(t)})),r}getClearStates(t=!1){const{graph:e}=this.context,{state:n,unselectedState:i,neighborState:r}=this.options,a=new Set([n,i,r]),{nodes:o,edges:s,combos:l}=e.getData(),u={};return[...o,...s,...l].forEach((e=>{const n=jd(e),i=n.filter((t=>!a.has(t)));(t||i.length!==n.length)&&(u[Dh(e)]=i)})),u}clearState(){return Ud(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(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Bd.forEach((e=>{t.off(`${e}:${lc.CLICK}`,this.onClickSelect)})),t.off(oc.CLICK,this.onClickCanvas)}destroy(){this.unbindEvents(),super.destroy()}}function Vd(t){var e;return!!(null===(e=t.style)||void 0===e?void 0:e.collapsed)}Hd.defaultOptions={animation:!0,enable:!0,multiple:!1,trigger:["shift"],state:"selected",neighborState:"selected",unselectedState:void 0,degree:0};var Zd=function(t,e,n){for(var i=0,r=(0,ue.Z)(e)?e.split("."):e;t&&i="A"&&n<="Z"}function qd(t,e){return`${e}${Ku(t)}`}function $d(t,e,n=!0){if(!e)return t;if(!Yd(t,e))return t;const i=t.slice(e.length);return n?Xd(i):i}function Kd(t,e){const n=Object.entries(t).reduce(((t,[n,i])=>("className"===n||"class"===n||Yd(n,e)&&Object.assign(t,{[$d(n,e)]:i}),t)),{});if("opacity"in t){const i=qd("opacity",e),r=t.opacity;if(i in t){const e=t[i];Object.assign(n,{opacity:r*e})}else Object.assign(n,{opacity:r})}return n}function Qd(t,e){const n=e.length;return Object.keys(t).reduce(((i,r)=>{if(r.startsWith(e)){i[r.slice(n)]=t[r]}return i}),{})}function Jd(t,e){const n="string"==typeof e?[e]:e,i={};return Object.keys(t).forEach((e=>{n.find((t=>e.startsWith(t)))||(i[e]=t[e])})),i}function tf(t=0){if("number"==typeof t)return[t,t,t];const[e,n=e,i=e]=t;return[e,n,i]}var ef=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r"function"==typeof e?[t,e.call(i,n)]:[t,e])))}function rf(t,e){const n=(null==t?void 0:t.style)||{},i=(null==e?void 0:e.style)||{};return Object.assign({},t,e,{style:(null==t?void 0:t.style)?Object.assign({},n,i):i})}const af=new WeakMap;function of(t,e,n){af.has(t)||af.set(t,{});const i=af.get(t);if(!i[e])return i[e]=n,!0;const r=i[e];return!sf(r,n)&&(i[e]=n,!0)}const sf=(t,e,n=2)=>{if("object"!=typeof t||"object"!=typeof e)return t===e;const i=Object.keys(t),r=Object.keys(e);if(i.length!==r.length)return!1;for(const r of i){const i=t[r],a=e[r];if(n>1&&"object"==typeof i&&"object"==typeof a){if(!sf(i,a,n-1))return!1}else if(i!==a)return!1}return!0};function lf(t){if(t)return"string"==typeof t||"function"==typeof t||Array.isArray(t)?{type:"group",field:t=>t.id,color:t,invert:!1}:t}function uf(t){const e="string"==typeof t?yc("palette",t):t;if("function"!=typeof e)return e}function cf(t,e){let n=2*t;return"string"==typeof e?n=t*Number(e.replace("%",""))/100:"number"==typeof e&&(n=e),isNaN(n)&&(n=2*t),n}function hf(t,e,n=1,i=!1){const r=i?n:1;return cf((t.max[0]-t.min[0])*r,e)}var df={}.toString,ff=function(t){return df.call(t).replace(/^\[object /,"").replace(/]$/,"")},pf=Object.prototype,gf=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||pf)},mf=Object.prototype.hasOwnProperty;var vf=function(t){if((0,le.Z)(t))return!0;if(Ju(t))return!t.length;var e=ff(t);if("Map"===e||"Set"===e)return!t.size;if(gf(t))return!Object.keys(t).length;for(var n in t)if(mf.call(t,n))return!1;return!0};class yf extends _l{constructor(t){super(t),this.shapeMap={},this.animateMap={},this.transformPosition(this.attributes),this.render(this.attributes,this),this.setVisibility(),this.bindEvents()}get parsedAttributes(){return this.attributes}upsert(t,e,n,i,r){var a,o,s,l,u,c,h,d;const f=this.shapeMap[t];if(!1===n)return void(f&&(null===(a=null==r?void 0:r.beforeDestroy)||void 0===a||a.call(r,f),i.removeChild(f),delete this.shapeMap[t],null===(o=null==r?void 0:r.afterDestroy)||void 0===o||o.call(r,f)));const p="string"==typeof e?yc(mc.SHAPE,e):e;if(!p)throw new Error(xc(`Shape ${e} not found`));if(!f||f.destroyed||!(f instanceof p)){f&&(null===(s=null==r?void 0:r.beforeDestroy)||void 0===s||s.call(r,f),null==f||f.destroy(),null===(l=null==r?void 0:r.afterDestroy)||void 0===l||l.call(r,f)),null===(u=null==r?void 0:r.beforeCreate)||void 0===u||u.call(r);const e=new p({className:t,style:n});return i.appendChild(e),this.shapeMap[t]=e,null===(c=null==r?void 0:r.afterCreate)||void 0===c||c.call(r,e),e}return null===(h=null==r?void 0:r.beforeUpdate)||void 0===h||h.call(r,f),Em(f,n),null===(d=null==r?void 0:r.afterUpdate)||void 0===d||d.call(r,f),f}transformPosition(t){if("x"in t||"y"in t||"z"in t){const{x:e=0,y:n=0,z:i=0,transform:r}=t,a=Cc(+e,+n,+i,r);a&&(this.style.transform=a)}}update(t={}){const e=Object.assign({},this.attributes,t);this.attr(e),this.render(e,this),this.transformPosition(e),this.setVisibility()}bindEvents(){}getGraphicStyle(t){return function(t){const{x:e,y:n,z:i,class:r,className:a,transform:o,transformOrigin:s,zIndex:l,visibility:u}=t;return ef(t,["x","y","z","class","className","transform","transformOrigin","zIndex","visibility"])}(t)}get compositeShapes(){return[["badges","badge-"],["ports","port-"]]}animate(t,e){if(0===t.length)return null;const n=[];if(void 0!==t[0].x||void 0!==t[0].y||void 0!==t[0].z){const{x:e=0,y:n=0,z:i=0}=this.attributes;t.forEach((t=>{const{x:r=e,y:a=n,z:o=i}=t;Object.assign(t,{transform:o?[["translate3d",r,a,o]]:[["translate",r,a]]})}))}const i=super.animate(t,e);if(i&&(xf(this,i),n.push(i)),Array.isArray(t)&&t.length>0){const i=["transform","transformOrigin","x","y","z","zIndex"];if(Object.keys(t[0]).some((t=>!i.includes(t)))){Object.entries(this.shapeMap).forEach((([i,r])=>{const a=this[`get${Ku(i)}Style`];if((0,en.Z)(a)){const i=t.map((t=>a.call(this,Object.assign(Object.assign({},this.attributes),t)))),o=r.animate(wc(i),e);o&&(xf(r,o),n.push(o))}}));const i=(i,r)=>{if(!vf(i)){const a=this[`get${Ku(r)}Style`];if((0,en.Z)(a)){const r=t.map((t=>a.call(this,Object.assign(Object.assign({},this.attributes),t))));Object.entries(r[0]).map((([t])=>{const a=r.map((e=>e[t])),o=i[t];if(o){const t=o.animate(wc(a),e);t&&(xf(o,t),n.push(t))}}))}}};this.compositeShapes.forEach((([t,e])=>{const n=Qd(this.shapeMap,e);i(n,t)}))}}return Ec(n)}getShape(t){return this.shapeMap[t]}setVisibility(){const{visibility:t}=this.attributes;Xh(this,t,!0)}destroy(){this.shapeMap={},this.animateMap={},super.destroy()}}function xf(t,e){null==e||e.finished.then((()=>{const n=t.activeAnimations.findIndex((t=>t===e));n>-1&&t.activeAnimations.splice(n,1)}))}var bf=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r0;){let t=e.shift();t in wf?i=t:e.unshift(t),r={type:i},wf[i].forEach((n=>{t=e.shift(),r[n]=t})),"M"===i?i="L":"m"===i&&(i="l");const[a,...o]=Object.values(r);n.push([a,...o.map(Number)])}return n}(t):t;return n.forEach((t=>{const n=t[0];if("Z"!==n)if("A"!==n)for(let n=1;n{if(t.length<2)return[["M",0,0],["L",0,0]];const e=t[0],n=t[1],i=t[t.length-1],r=t[t.length-2];t.unshift(r,i),t.push(e,n);const a=[["M",i[0],i[1]]];for(let e=1;e{const n=t,i=c[(e+1)%c.length];return ec(n,i)?null:[n,i]})).filter(Boolean),d=Ad([s,l],h),f=Od([s,l],d);if(f&&d&&(u.transform=[["translate",f[0]+n,f[1]+i]],o)){const t=Math.atan((d[0][1]-d[1][1])/(d[0][0]-d[1][0]));u.transform.push(["rotate",t/Math.PI*180]),u.textAlign="center","right"!==e&&"left"!==e||(u.textBaseline=t>0?"right"===e?"bottom":"top":"right"===e?"top":"bottom")}return u}(c,o,i,r,s,t.d,a),{wordWrapWidth:hf(c,n)},l)}getKeyStyle(t){return this.getGraphicStyle(t)}render(t,e){this.upsert("key",Nl,this.getKeyStyle(t),e),this.upsert("label",_f,this.getLabelStyle(t),e)}}Cf.defaultStyleProps={label:!0,labelPlacement:"bottom",labelCloseToPath:!0,labelAutoRotate:!0,labelOffsetX:0,labelOffsetY:0};class Af extends Ml{constructor(t){super(t),this.onMounted=()=>{this.handleRadius()},this.onAttrModified=()=>{this.handleRadius()},Nf=this,this.isMutationObserved=!0,this.addEventListener(Ss.MOUNTED,this.onMounted),this.addEventListener(Ss.ATTR_MODIFIED,this.onAttrModified)}handleRadius(){const{radius:t,clipPath:e,width:n=0,height:i=0}=this.attributes;if(t&&n&&i){const[r,a]=this.getBounds().min,o={x:r,y:a,radius:t,width:n,height:i};if(e)Object.assign(this.parsedStyle.clipPath.style,o);else{const t=new kl({style:o});this.style.clipPath=t}}else e&&(this.style.clipPath=null)}}const Of=new WeakMap;let Nf=null;const Pf=t=>{if(Nf&&function(t){const e=[];let n=t.parentNode;for(;n;)e.push(n),n=n.parentNode;return e}(Nf).includes(t)){const e=Of.get(t);e?e.includes(Nf)||e.push(Nf):Of.set(t,[Nf])}},Lf=t=>{const e=Of.get(t);e&&e.forEach((t=>t.handleRadius()))};class Rf extends yf{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()?Af:Bl,this.getIconStyle(t),e)}}class Df extends yf{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 kf=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{i[t]=!1})),!1===t.badge||!(null===(e=t.badges)||void 0===e?void 0:e.length))return i;const{badges:r=[],badgePalette:a,opacity:o=1}=t,s=kf(t,["badges","badgePalette","opacity"]),l=uf(a),u=Kd(this.getGraphicStyle(s),"badge");return r.forEach(((t,e)=>{i[e]=Object.assign(Object.assign({backgroundFill:l?l[e%(null==l?void 0:l.length)]:void 0,opacity:o},u),this.getBadgeStyle(t))})),i}getBadgeStyle(t){const e=this.getShape("key"),{placement:n="top",offsetX:i,offsetY:r}=t,a=kf(t,["placement","offsetX","offsetY"]),o=_m(e.getLocalBounds(),n,i,r,!0);return Object.assign(Object.assign({},o),a)}getPortsStyle(t){var e;const n=this.getPorts(),i={};if(Object.keys(n).forEach((t=>{i[t]=!1})),!1===t.port||!(null===(e=t.ports)||void 0===e?void 0:e.length))return i;const r=Kd(this.getGraphicStyle(t),"port"),{ports:a=[]}=t;return a.forEach(((e,n)=>{const a=e.key||n,o=Object.assign(Object.assign({},r),e);if(gm(o))i[a]=!1;else{const[n,r]=this.getPortXY(t,e);i[a]=Object.assign({transform:[["translate",n,r]]},o)}})),i}getPortXY(t,e){const{placement:n="left"}=e,i=this.getShape("key");return fm(function(t,e){if(!t)return e.getLocalBounds();const n=t.canvas.getLayer(),i=e.cloneNode();Xh(i,"hidden"),n.appendChild(i);const r=i.getLocalBounds();return i.destroy(),r}(this.context,i),n)}getPorts(){return Qd(this.shapeMap,"port-")}getCenter(){return this.getShape("key").getBounds().center}getIntersectPoint(t,e=!1){return function(t,e,n=!1){return Md(t,xd(e,"center"),[xd(e,"left-top"),xd(e,"right-top"),xd(e,"right-bottom"),xd(e,"left-bottom")],!1,n).point}(t,this.getShape("key").getBounds(),e)}drawHaloShape(t,e){const n=this.getHaloStyle(t);if(!of(this,"halo",n))return;const i=this.getShape("key");this.upsert("halo",i.constructor,n,e)}drawIconShape(t,e){const n=this.getIconStyle(t);of(this,"icon",n)&&(this.upsert("icon",Rf,n,e),Pf(this))}drawBadgeShapes(t,e){const n=this.getBadgesStyle(t);Object.keys(n).forEach((t=>{const i=n[t];of(this,`badge-${t}`,i)&&this.upsert(`badge-${t}`,Ef,i,e)}))}drawPortShapes(t,e){const n=this.getPortsStyle(t);Object.keys(n).forEach((t=>{const i=n[t],r=`port-${t}`;of(this,r,i)&&this.upsert(r,xl,i,e)}))}drawLabelShape(t,e){const n=this.getLabelStyle(t);of(this,"label",n)&&this.upsert("label",_f,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)&&Lf(this)}onframe(){this.drawBadgeShapes(this.parsedAttributes,this),this.drawLabelShape(this.parsedAttributes,this)}}If.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};class Bf extends If{constructor(t){super(rf({style:Bf.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",xl,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=2*n*Id;return!!e&&Object.assign({width:i,height:i},e)}getIntersectPoint(t,e=!1){return Cd(t,this.getShape("key").getBounds(),e)}}Bf.defaultStyleProps={size:32};class Ff extends If{constructor(t){super(t)}get parsedAttributes(){return this.attributes}drawKeyShape(t,e){return this.upsert("key",Ll,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:r}=this.getShape("key").attributes;return Md(t,[+((null===(n=this.attributes)||void 0===n?void 0:n.x)||0),+((null===(i=this.attributes)||void 0===i?void 0:i.y)||0)],r,!0,e).point}}var zf=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r(0,oe.Z)(t)?{value:t}:t)),r=Kd(this.getGraphicStyle(t),"donut"),a=uf(t.donutPalette);if(!a)return;const o=i.reduce(((t,e)=>{var n;return t+(null!==(n=e.value)&&void 0!==n?n:0)}),0),s=this.parseOuterR(),l=this.parseInnerR();let u=0;i.forEach(((t,n)=>{const{value:c=0,color:h=a[n%a.length]}=t,d=zf(t,["value","color"]),f=360*(0===o?1/i.length:c/o);this.upsert(`round${n}`,Nl,Object.assign(Object.assign(Object.assign({},r),{d:Uf(s,l,u,u+f),fill:h}),d),e),u+=f}))}render(t,e=this){super.render(t,e),this.drawDonutShape(t,e)}}Gf.defaultStyleProps={innerR:"50%",donuts:[],donutPalette:"tableau"};const jf=(t,e,n,i)=>[t+Math.sin(i)*n,e-Math.cos(i)*n],Uf=(t=0,e=0,n,i)=>{const[r,a]=[0,0];return Math.abs(n-i)%360<1e-6?((t,e,n,i)=>i<=0||n<=i?[["M",t-n,e],["A",n,n,0,1,1,t+n,e],["A",n,n,0,1,1,t-n,e],["Z"]]:[["M",t-n,e],["A",n,n,0,1,1,t+n,e],["A",n,n,0,1,1,t-n,e],["Z"],["M",t+i,e],["A",i,i,0,1,0,t-i,e],["A",i,i,0,1,0,t+i,e],["Z"]])(r,a,t,e):((t,e,n,i,r,a)=>{const[o,s]=[r/360*2*Math.PI,a/360*2*Math.PI],l=[jf(t,e,i,o),jf(t,e,n,o),jf(t,e,n,s),jf(t,e,i,s)],u=s-o>Math.PI?1:0;return[["M",l[0][0],l[0][1]],["L",l[1][0],l[1][1]],["A",n,n,0,u,1,l[2][0],l[2][1]],["L",l[3][0],l[3][1]],["A",i,i,0,u,0,l[0][0],l[0][1]],["Z"]]})(r,a,t,e,n,i)};class Hf extends If{constructor(t){super(rf({style:Hf.defaultStyleProps},t))}drawKeyShape(t,e){return this.upsert("key",El,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,r=2*Math.min(+n,+i)*Id;return!!e&&Object.assign({width:r,height:r},e)}getIntersectPoint(t,e=!1){return Cd(t,this.getShape("key").getBounds(),e)}}Hf.defaultStyleProps={size:[45,35]};function Vf(t,e){var n=e.cx,i=void 0===n?0:n,r=e.cy,a=void 0===r?0:r,o=e.r;t.arc(i,a,o,0,2*Math.PI,!1)}function Zf(t,e){var n=e.cx,i=void 0===n?0:n,r=e.cy,a=void 0===r?0:r,o=e.rx,s=e.ry;if(t.ellipse)t.ellipse(i,a,o,s,0,0,2*Math.PI,!1);else{var l=o>s?o:s,u=o>s?1:o/s,c=o>s?s/o:1;t.save(),t.scale(u,c),t.arc(i,a,l,0,2*Math.PI)}}function Wf(t,e){var n,i,r=e.x1,a=e.y1,o=e.x2,s=e.y2,l=e.markerStart,u=e.markerEnd,c=e.markerStartOffset,h=e.markerEndOffset,d=0,f=0,p=0,g=0,m=0;l&&fl(l)&&c&&(n=o-r,i=s-a,m=Math.atan2(i,n),d=Math.cos(m)*(c||0),f=Math.sin(m)*(c||0)),u&&fl(u)&&h&&(n=r-o,i=a-s,m=Math.atan2(i,n),p=Math.cos(m)*(h||0),g=Math.sin(m)*(h||0)),t.moveTo(r+d,a+f),t.lineTo(o+p,s+g)}function Xf(t,e){var n,i,r=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.d,u=l.absolutePath,c=l.segments,h=0,d=0,f=0,g=0,m=0;if(r&&fl(r)&&o){var v=r.parentNode.getStartTangent(),y=(0,p.Z)(v,2),x=y[0],b=y[1];n=x[0]-b[0],i=x[1]-b[1],m=Math.atan2(i,n),h=Math.cos(m)*(o||0),d=Math.sin(m)*(o||0)}if(a&&fl(a)&&s){var _=a.parentNode.getEndTangent(),E=(0,p.Z)(_,2),w=E[0],T=E[1];n=w[0]-T[0],i=w[1]-T[1],m=Math.atan2(i,n),f=Math.cos(m)*(s||0),g=Math.sin(m)*(s||0)}for(var S=0;SH?U:H,q=U>H?1:U/H,$=U>H?H/U:1;t.translate(G,j),t.rotate(W),t.scale(q,$),t.arc(0,0,Y,V,Z,!!(1-X)),t.scale(1/q,1/$),t.rotate(-W),t.translate(-G,-j)}N&&t.lineTo(M[6]+f,M[7]+g);break;case"Z":t.closePath()}}}function Yf(t,e){var n,i,r=e.markerStart,a=e.markerEnd,o=e.markerStartOffset,s=e.markerEndOffset,l=e.points.points,u=l.length,c=l[0][0],h=l[0][1],d=l[u-1][0],f=l[u-1][1],p=0,g=0,m=0,v=0,y=0;r&&fl(r)&&o&&(n=l[1][0]-l[0][0],i=l[1][1]-l[0][1],y=Math.atan2(i,n),p=Math.cos(y)*(o||0),g=Math.sin(y)*(o||0)),a&&fl(a)&&s&&(n=l[u-1][0]-l[0][0],i=l[u-1][1]-l[0][1],y=Math.atan2(i,n),m=Math.cos(y)*(s||0),v=Math.sin(y)*(s||0)),t.moveTo(c+(p||m),h+(g||v));for(var x=1;x0?1:-1,d=l>0?1:-1,f=h+d===0,g=o.map((function(t){return ce(t,0,Math.min(Math.abs(u)/2,Math.abs(c)/2))})),m=(0,p.Z)(g,4),v=m[0],y=m[1],x=m[2],b=m[3];t.moveTo(h*v+i,a),t.lineTo(u-h*y+i,a),0!==y&&t.arc(u-h*y+i,d*y+a,y,-d*Math.PI/2,h>0?0:Math.PI,f),t.lineTo(u+i,c-d*x+a),0!==x&&t.arc(u-h*x+i,c-d*x+a,x,h>0?0:Math.PI,d>0?Math.PI/2:1.5*Math.PI,f),t.lineTo(h*b+i,c+a),0!==b&&t.arc(h*b+i,c-d*b+a,b,d>0?Math.PI/2:-Math.PI/2,h>0?Math.PI:0,f),t.lineTo(i,d*v+a),0!==v&&t.arc(h*v+i,d*v+a,v,h>0?Math.PI:0,d>0?1.5*Math.PI:Math.PI/2,f)}else t.rect(i,a,u,c)}var Kf=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r=l-y&&x<=l+y)}function rp(t,e,n,i){return t/(n*n)+e/(i*i)}function ap(t,e,n){var i=t.parsedStyle,r=i.cx,a=void 0===r?0:r,o=i.cy,s=void 0===o?0:o,l=i.rx,u=i.ry,c=i.fill,h=i.stroke,d=i.lineWidth,f=void 0===d?1:d,g=i.increasedLineWidthForHitTesting,m=void 0===g?0:g,v=i.pointerEvents,y=void 0===v?"auto":v,x=e.x,b=e.y,_=Co(y,c,h),E=(0,p.Z)(_,2),w=E[0],T=E[1],S=(f+m)/2,M=(x-a)*(x-a),C=(b-s)*(b-s);return w&&T||n?rp(M,C,l+S,u+S)<=1:w?rp(M,C,l,u)<=1:!!T&&(rp(M,C,l-S,u-S)>=1&&rp(M,C,l+S,u+S)<=1)}function op(t,e,n,i,r,a){return r>=t&&r<=t+n&&a>=e&&a<=e+i}function sp(t,e,n,i,r,a,o,s){var l=(Math.atan2(s-e,o-t)+2*Math.PI)%(2*Math.PI),u={x:t+n*Math.cos(l),y:e+n*Math.sin(l)};return Hn(u.x,u.y,o,s)<=a/2}function lp(t,e,n,i,r,a,o){var s=Math.min(t,n),l=Math.max(t,n),u=Math.min(e,i),c=Math.max(e,i),h=r/2;return a>=s-h&&a<=l+h&&o>=u-h&&o<=c+h&&Kn(t,e,n,i,a,o)<=r/2}function up(t,e,n,i,r){var a=t.length;if(a<2)return!1;for(var o=0;o0!=cp(s[1]-n)>0&&cp(e-(n-o[1])*(o[0]-s[0])/(o[1]-s[1])-o[0])<0&&(i=!i)}return i}function fp(t,e,n){for(var i=!1,r=0;r=r.min[0]&&e.y>=r.min[1]&&e.x<=r.max[0]&&e.y<=r.max[1]}var _p=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r0&&void 0!==arguments[0]?arguments[0]:t.api;t.rafId&&(e.cancelAnimationFrame(t.rafId),t.rafId=null)}},{key:"executeTask",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.api;Mp.length<=0&&Cp.length<=0||(Cp.forEach((function(t){return t()})),Cp=Mp.splice(0,t.TASK_NUM_PER_FRAME),t.rafId=e.requestAnimationFrame((function(){t.executeTask(e)})))}},{key:"sliceImage",value:function(e,n,i,r){for(var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t.api,s=e.naturalWidth||e.width,l=e.naturalHeight||e.height,u=n-a,c=i-a,h=Math.ceil(s/u),d=Math.ceil(l/c),f={tileSize:[n,i],gridSize:[d,h],tiles:Array(d).fill(null).map((function(){return Array(h).fill(null)}))},p=function(t){for(var a=function(a){Mp.push((function(){var h=a*u,d=t*c,p=[Math.min(n,s-h),Math.min(i,l-d)],g=p[0],m=p[1],v=o.createCanvas();v.width=n,v.height=i,v.getContext("2d").drawImage(e,h,d,g,m,0,0,g,m),f.tiles[t][a]={x:h,y:d,tileX:a,tileY:t,data:v},r()}))},d=0;du&&m>c,e&&("function"==typeof e.resetTransform?e.resetTransform():e.setTransform(1,0,0,1,0,0),i.clearFullScreen&&i.clearRect(e,0,0,r*n,o*n,a.background))}));var v=function(t,e){for(var r=[t];r.length>0;){var a=r.pop();a.isVisible()&&!a.isCulled()&&(d?i.renderDisplayObjectOptimized(a,e,i.context,Ep(i,Dp)[Dp],n):i.renderDisplayObject(a,e,i.context,Ep(i,Dp)[Dp],n));for(var o=a.sortable.sorted||a.childNodes,s=o.length-1;s>=0;s--)r.push(o[s])}};s.hooks.endFrame.tap(t.tag,(function(){if(0!==u.root.childNodes.length){d=a.renderer.getConfig().enableRenderingOptimization,Ep(i,Dp)[Dp]={restoreStack:[],prevObject:null,currentContext:Ep(i,Dp)[Dp].currentContext},Ep(i,Dp)[Dp].currentContext.clear(),i.clearFullScreenLastFrame=!1;var t=f.getContext(),e=f.getDPR();if(ot(i.dprMatrix,[e,e,1]),Q(i.vpMatrix,i.dprMatrix,o.getOrthoMatrix()),i.clearFullScreen)d?(t.save(),v(u.root,t),t.restore()):v(u.root,t),i.removedRBushNodeAABBs=[];else{var r=i.safeMergeAABB.apply(i,[i.mergeDirtyAABBs(i.renderQueue)].concat((0,l.Z)(i.removedRBushNodeAABBs.map((function(t){var e=t.minX,n=t.minY,i=t.maxX,r=t.maxY,a=new Ti;return a.setMinMax([e,n,0],[i,r,0]),a})))));if(i.removedRBushNodeAABBs=[],Ti.isEmpty(r))return void(i.renderQueue=[]);var s=i.convertAABB2Rect(r),c=s.x,h=s.y,g=s.width,m=s.height,y=L(i.vec3a,[c,h,0],i.vpMatrix),x=L(i.vec3b,[c+g,h,0],i.vpMatrix),b=L(i.vec3c,[c,h+m,0],i.vpMatrix),_=L(i.vec3d,[c+g,h+m,0],i.vpMatrix),E=Math.min(y[0],x[0],_[0],b[0]),w=Math.min(y[1],x[1],_[1],b[1]),T=Math.max(y[0],x[0],_[0],b[0]),S=Math.max(y[1],x[1],_[1],b[1]),M=Math.floor(E),C=Math.floor(w),A=Math.ceil(T-E),O=Math.ceil(S-w);t.save(),i.clearRect(t,M,C,A,O,a.background),t.beginPath(),t.rect(M,C,A,O),t.clip(),t.setTransform(i.vpMatrix[0],i.vpMatrix[1],i.vpMatrix[4],i.vpMatrix[5],i.vpMatrix[12],i.vpMatrix[13]),a.renderer.getConfig().enableDirtyRectangleRenderingDebug&&p.dispatchEvent(new gs(Zl.DIRTY_RECTANGLE,{dirtyRect:{x:M,y:C,width:A,height:O}})),i.searchDirtyObjects(r).sort((function(t,e){return t.sortable.renderOrder-e.sortable.renderOrder})).forEach((function(e){e&&e.isVisible()&&!e.isCulled()&&i.renderDisplayObject(e,t,i.context,Ep(i,Dp)[Dp],n)})),t.restore(),i.renderQueue.forEach((function(t){i.saveDirtyAABB(t)})),i.renderQueue=[]}Ep(i,Dp)[Dp].restoreStack.forEach((function(){t.restore()})),Ep(i,Dp)[Dp].restoreStack=[]}else i.clearFullScreenLastFrame=!0})),s.hooks.render.tap(t.tag,(function(t){i.clearFullScreen||i.renderQueue.push(t)}))}},{key:"clearRect",value:function(t,e,n,i,r,a){t.clearRect(e,n,i,r),a&&(t.fillStyle=a,t.fillRect(e,n,i,r))}},{key:"renderDisplayObjectOptimized",value:function(t,e,n,i,r){var a=t.nodeName,o=!1,s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],u=t.parsedStyle.clipPath;if(u){(!i.prevObject||!kt(u.getWorldTransform(),i.prevObject.getWorldTransform()))&&(this.applyWorldTransform(e,u),i.prevObject=null);var c=this.pathGeneratorFactory[u.nodeName];c&&(e.save(),o=!0,e.beginPath(),c(e,u.parsedStyle),e.closePath(),e.clip())}if(s){(!i.prevObject||!kt(t.getWorldTransform(),i.prevObject.getWorldTransform()))&&this.applyWorldTransform(e,t);var h=!i.prevObject;if(!h){var d=i.prevObject.nodeName;h=a===pi.TEXT?d!==pi.TEXT:a===pi.IMAGE?d!==pi.IMAGE:d===pi.TEXT||d===pi.IMAGE}s.applyStyleToContext(e,t,h,i),i.prevObject=t}l&&(e.beginPath(),l(e,t.parsedStyle),a!==pi.LINE&&a!==pi.PATH&&a!==pi.POLYLINE&&e.closePath()),s&&s.drawToContext(e,t,Ep(this,Dp)[Dp],this,r),o&&e.restore(),t.renderable.dirty=!1}},{key:"renderDisplayObject",value:function(t,e,n,i,r){var a=t.nodeName,o=i.restoreStack[i.restoreStack.length-1];!o||t.compareDocumentPosition(o)&ys.DOCUMENT_POSITION_CONTAINS||(e.restore(),i.restoreStack.pop());var s=this.context.styleRendererFactory[a],l=this.pathGeneratorFactory[a],u=t.parsedStyle.clipPath;if(u){this.applyWorldTransform(e,u);var c=this.pathGeneratorFactory[u.nodeName];c&&(e.save(),i.restoreStack.push(t),e.beginPath(),c(e,u.parsedStyle),e.closePath(),e.clip())}s&&(this.applyWorldTransform(e,t),e.save(),this.applyAttributesToContext(e,t)),l&&(e.beginPath(),l(e,t.parsedStyle),a!==pi.LINE&&a!==pi.PATH&&a!==pi.POLYLINE&&e.closePath()),s&&(s.render(e,t.parsedStyle,t,n,this,r),e.restore()),t.renderable.dirty=!1}},{key:"applyAttributesToContext",value:function(t,e){var n=e.parsedStyle,i=n.stroke,r=n.fill,a=n.opacity,o=n.lineDash,s=n.lineDashOffset;o&&t.setLineDash(o),(0,le.Z)(s)||(t.lineDashOffset=s),(0,le.Z)(a)||(t.globalAlpha*=a),(0,le.Z)(i)||Array.isArray(i)||i.isNone||(t.strokeStyle=e.attributes.stroke),(0,le.Z)(r)||Array.isArray(r)||r.isNone||(t.fillStyle=e.attributes.fill)}},{key:"convertAABB2Rect",value:function(t){var e=t.getMin(),n=t.getMax(),i=Math.floor(e[0]),r=Math.floor(e[1]);return{x:i,y:r,width:Math.ceil(n[0])-i,height:Math.ceil(n[1])-r}}},{key:"mergeDirtyAABBs",value:function(t){var e=new Ti;return t.forEach((function(t){var n=t.getRenderBounds();e.add(n);var i=t.renderable.dirtyRenderBounds;i&&e.add(i)})),e}},{key:"searchDirtyObjects",value:function(t){var e=t.getMin(),n=(0,p.Z)(e,2),i=n[0],r=n[1],a=t.getMax(),o=(0,p.Z)(a,2),s=o[0],l=o[1];return this.rBush.search({minX:i,minY:r,maxX:s,maxY:l}).map((function(t){return t.displayObject}))}},{key:"saveDirtyAABB",value:function(t){var e=t.renderable;e.dirtyRenderBounds||(e.dirtyRenderBounds=new Ti);var n=t.getRenderBounds();n&&e.dirtyRenderBounds.update(n.center,n.halfExtents)}},{key:"applyWorldTransform",value:function(t,e,n){n?(V(this.tmpMat4,e.getLocalTransform()),Q(this.tmpMat4,n,this.tmpMat4),Q(this.tmpMat4,this.vpMatrix,this.tmpMat4)):(V(this.tmpMat4,e.getWorldTransform()),Q(this.tmpMat4,this.vpMatrix,this.tmpMat4)),t.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 t=new Ti,e=arguments.length,n=new Array(e),i=0;i0){if(n||e.attributes.stroke!==i.prevObject.attributes.stroke)Up(t,"strokeStyle",(0,le.Z)(a.stroke)||Array.isArray(a.stroke)||a.stroke.isNone?Gp.strokeStyle:e.attributes.stroke,i.currentContext);(n||a.lineWidth!==r.lineWidth)&&Up(t,"lineWidth",(0,le.Z)(a.lineWidth)?Gp.lineWidth:a.lineWidth,i.currentContext),(n||a.lineDash!==r.lineDash)&&Up(t,"lineDash",a.lineDash||Gp.lineDash,i.currentContext),(n||a.lineDashOffset!==r.lineDashOffset)&&Up(t,"lineDashOffset",(0,le.Z)(a.lineDashOffset)?Gp.lineDashOffset:a.lineDashOffset,i.currentContext);for(var u=0;u4&&void 0!==arguments[4]&&arguments[4];if(e){Up(t,"shadowColor",Gp.shadowColor,i.currentContext);for(var a=0;a-1&&Up(t,"filter",s.replace(/drop-shadow\([^)]*\)/,"").trim()||Gp.filter,i.currentContext)}else Up(t,"filter",Gp.filter,i.currentContext)}},{key:"fillToContext",value:function(t,e,n,i,r){var a=this,o=e.parsedStyle,s=o.fill,l=o.fillRule,u=null;if(Array.isArray(s)&&s.length>0)s.forEach((function(i){var r,o=Up(t,"fillStyle",Bp(i,e,t,a.imagePool),n.currentContext);u=null!==(r=u)&&void 0!==r?r:o,l?t.fill(l):t.fill()}));else{if(jr(s)){var c=Ip(s,e,t,e.ownerDocument.defaultView.context,i,r,this.imagePool);c&&(t.fillStyle=c,u=!0)}l?t.fill(l):t.fill()}null!==u&&Up(t,"fillStyle",u,n.currentContext)}},{key:"strokeToContext",value:function(t,e,n,i,r){var a=this,o=e.parsedStyle.stroke,s=null;if(Array.isArray(o)&&o.length>0)o.forEach((function(i){var r,o=Up(t,"strokeStyle",Bp(i,e,t,a.imagePool),n.currentContext);s=null!==(r=s)&&void 0!==r?r:o,t.stroke()}));else{if(jr(o)){var l=Ip(o,e,t,e.ownerDocument.defaultView.context,i,r,this.imagePool);if(l){var u,c=Up(t,"strokeStyle",l,n.currentContext);s=null!==(u=s)&&void 0!==u?u:c}}t.stroke()}null!==s&&Up(t,"strokeStyle",s,n.currentContext)}},{key:"drawToContext",value:function(t,e,n,i,r){var a,o=e.nodeName,s=e.parsedStyle,l=s.opacity,u=void 0===l?Gp.globalAlpha:l,c=s.fillOpacity,h=void 0===c?Gp.fillOpacity:c,d=s.strokeOpacity,f=void 0===d?Gp.strokeOpacity:d,p=s.lineWidth,g=void 0===p?Gp.lineWidth:p,m=s.fill&&!s.fill.isNone,v=s.stroke&&!s.stroke.isNone&&g>0;if(m||v){var y=!(0,le.Z)(s.shadowColor)&&s.shadowBlur>0,x="inner"===s.shadowType,b=0===(null===(a=s.fill)||void 0===a?void 0:a.alpha),_=!(!s.filter||!s.filter.length),E=y&&v&&(o===pi.PATH||o===pi.LINE||o===pi.POLYLINE||b||x),w=null;if(m)E||this.applyShadowAndFilterStyleToContext(t,e,y,n),w=Up(t,"globalAlpha",u*h,n.currentContext),this.fillToContext(t,e,n,i,r),E||this.clearShadowAndFilterStyleForContext(t,y,_,n);if(v){var T=!1,S=Up(t,"globalAlpha",u*f,n.currentContext);if(w=m?w:S,E&&(this.applyShadowAndFilterStyleToContext(t,e,y,n),T=!0,x)){var M=t.globalCompositeOperation;t.globalCompositeOperation="source-atop",this.strokeToContext(t,e,n,i,r),t.globalCompositeOperation=M,this.clearShadowAndFilterStyleForContext(t,y,_,n,!0)}this.strokeToContext(t,e,n,i,r),T&&this.clearShadowAndFilterStyleForContext(t,y,_,n)}null!==w&&Up(t,"globalAlpha",w,n.currentContext)}}}])}(),Vp=function(t){function e(){return(0,o.Z)(this,e),d(this,e,arguments)}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"render",value:function(t,e,n,i,r,a){var o=e.fill,s=e.fillRule,l=e.opacity,u=void 0===l?1:l,c=e.fillOpacity,h=void 0===c?1:c,d=e.stroke,f=e.strokeOpacity,p=void 0===f?1:f,g=e.lineWidth,m=void 0===g?1:g,v=e.lineCap,y=e.lineJoin,x=e.shadowType,b=e.shadowColor,_=e.shadowBlur,E=e.filter,w=e.miterLimit,T=o&&!o.isNone,S=d&&!d.isNone&&m>0,M=0===(null==o?void 0:o.alpha),C=!(!E||!E.length),A=!(0,le.Z)(b)&&_>0,O=n.nodeName,N="inner"===x,P=S&&A&&(O===pi.PATH||O===pi.LINE||O===pi.POLYLINE||M||N);T&&(t.globalAlpha=u*h,P||Zp(n,t,A),Wp(t,n,o,s,i,r,a,this.imagePool),P||this.clearShadowAndFilter(t,C,A)),S&&(t.globalAlpha=u*p,t.lineWidth=m,(0,le.Z)(w)||(t.miterLimit=w),(0,le.Z)(v)||(t.lineCap=v),(0,le.Z)(y)||(t.lineJoin=y),P&&(N&&(t.globalCompositeOperation="source-atop"),Zp(n,t,!0),N&&(Xp(t,n,d,i,r,a,this.imagePool),t.globalCompositeOperation=Gp.globalCompositeOperation,this.clearShadowAndFilter(t,C,!0))),Xp(t,n,d,i,r,a,this.imagePool))}},{key:"clearShadowAndFilter",value:function(t,e,n){if(n&&(t.shadowColor="transparent",t.shadowBlur=0),e){var i=t.filter;!(0,le.Z)(i)&&i.indexOf("drop-shadow")>-1&&(t.filter=i.replace(/drop-shadow\([^)]*\)/,"").trim()||"none")}}}])}(Hp);function Zp(t,e,n){var i=t.parsedStyle,r=i.filter,a=i.shadowColor,o=i.shadowBlur,s=i.shadowOffsetX,l=i.shadowOffsetY;r&&r.length&&(e.filter=t.style.filter),n&&(e.shadowColor=a.toString(),e.shadowBlur=o||0,e.shadowOffsetX=s||0,e.shadowOffsetY=l||0)}function Wp(t,e,n,i,r,a,o,s){var l=arguments.length>8&&void 0!==arguments[8]&&arguments[8];Array.isArray(n)?n.forEach((function(n){t.fillStyle=Bp(n,e,t,s),l||(i?t.fill(i):t.fill())})):(jr(n)&&(t.fillStyle=Ip(n,e,t,r,a,o,s)),l||(i?t.fill(i):t.fill()))}function Xp(t,e,n,i,r,a,o){var s=arguments.length>7&&void 0!==arguments[7]&&arguments[7];Array.isArray(n)?n.forEach((function(n){t.strokeStyle=Bp(n,e,t,o),s||t.stroke()})):(jr(n)&&(t.strokeStyle=Ip(n,e,t,i,r,a,o)),s||t.stroke())}var Yp=function(t){function e(){return(0,o.Z)(this,e),d(this,e,arguments)}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"renderDownSampled",value:function(t,e,n,i){var r=i.src,a=i.imageCache;a.downSampled?t.drawImage(a.downSampled,Math.floor(i.drawRect[0]),Math.floor(i.drawRect[1]),Math.ceil(i.drawRect[2]),Math.ceil(i.drawRect[3])):this.imagePool.createDownSampledImage(r,n).then((function(t){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()})).catch((function(){}))}},{key:"renderTile",value:function(t,e,n,i){var r=i.src,a=i.imageCache,o=i.imageRect,s=i.drawRect,l=a.size,u=t.getTransform(),c=u.a,h=u.b,d=u.c,f=u.d,p=u.e,g=u.f;if(t.resetTransform(),null!=a&&a.gridSize){for(var m=[l[0]/o[2],l[1]/o[3]],v=[a.tileSize[0]/m[0],a.tileSize[1]/m[1]],y=[Math.floor((s[0]-o[0])/v[0]),Math.ceil((s[0]+s[2]-o[0])/v[0])],x=y[0],b=y[1],_=[Math.floor((s[1]-o[1])/v[1]),Math.ceil((s[1]+s[3]-o[1])/v[1])],E=_[1],w=_[0];w<=E;w++)for(var T=x;T<=b;T++){var S=a.tiles[w][T];if(S){var M=[Math.floor(o[0]+S.tileX*v[0]),Math.floor(o[1]+S.tileY*v[1]),Math.ceil(v[0]),Math.ceil(v[1])];t.drawImage(S.data,M[0],M[1],M[2],M[3])}}t.setTransform(c,h,d,f,p,g)}else this.imagePool.createImageTiles(r,[],(function(){n.renderable.dirty=!0,n.ownerDocument.defaultView.context.renderingService.dirtify()}),n).catch((function(){}))}},{key:"render",value:function(t,n,i){var r=n.x,a=void 0===r?0:r,o=n.y,s=void 0===o?0:o,l=n.width,u=n.height,c=n.src,h=n.shadowColor,d=n.shadowBlur,f=this.imagePool.getImageSync(c,i),g=null==f?void 0:f.img,m=l,v=u;if(g){var x,b,_,E,w,T,S,M,C,A,O,N,P,R,D,k;m||(m=g.width),v||(v=g.height),Zp(i,t,!(0,le.Z)(h)&&d>0);try{var I=i.ownerDocument.defaultView.getContextService().getDomElement(),B=I.width,F=I.height,z=t.getTransform(),G=z.a,j=z.b,U=function(t,e){var n=L(y(),[t[0],t[1],0],e),i=L(y(),[t[0]+t[2],t[1],0],e),r=L(y(),[t[0],t[1]+t[3],0],e),a=L(y(),[t[0]+t[2],t[1]+t[3],0],e);return[Math.min(n[0],i[0],r[0],a[0]),Math.min(n[1],i[1],r[1],a[1]),Math.max(n[0],i[0],r[0],a[0])-Math.min(n[0],i[0],r[0],a[0]),Math.max(n[1],i[1],r[1],a[1])-Math.min(n[1],i[1],r[1],a[1])]}([a,s,m,v],Z(G,z.c,0,0,j,z.d,0,0,0,0,1,0,z.e,z.f,0,1)),H=(x=[0,0,B,F],b=U,_=(0,p.Z)(x,4),E=_[0],w=_[1],T=_[2],S=_[3],M=(0,p.Z)(b,4),C=M[0],A=M[1],O=M[2],N=M[3],P=Math.max(E,C),R=Math.max(w,A),D=Math.min(E+T,C+O),k=Math.min(w+S,A+N),D<=P||k<=R?null:[P,R,D-P,k-R]);if(!H)return;if(!i.ownerDocument.defaultView.getConfig().enableLargeImageOptimization)return void e.renderFull(t,n,i,{image:g,drawRect:[a,s,m,v]});if(U[2]/f.size[0]<(f.downSamplingRate||.5))return void this.renderDownSampled(t,n,i,{src:c,imageCache:f,drawRect:[a,s,m,v]});if(!Np.isSupportTile)return void e.renderFull(t,n,i,{image:g,drawRect:[a,s,m,v]});this.renderTile(t,n,i,{src:c,imageCache:f,imageRect:U,drawRect:H})}catch(t){}}}},{key:"drawToContext",value:function(t,e,n,i,r){this.render(t,e.parsedStyle,e)}}],[{key:"renderFull",value:function(t,e,n,i){t.drawImage(i.image,Math.floor(i.drawRect[0]),Math.floor(i.drawRect[1]),Math.ceil(i.drawRect[2]),Math.ceil(i.drawRect[3]))}}])}(Vp),qp=function(t){function e(){return(0,o.Z)(this,e),d(this,e,arguments)}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"render",value:function(t,e,n,i,r,a){n.getBounds();var o=e.lineWidth,s=void 0===o?1:o,l=e.textAlign,u=void 0===l?"start":l,c=e.textBaseline,h=void 0===c?"alphabetic":c,d=e.lineJoin,f=void 0===d?"miter":d,p=e.miterLimit,g=void 0===p?10:p,m=e.letterSpacing,v=void 0===m?0:m,y=e.stroke,x=e.fill,b=e.fillRule,_=e.fillOpacity,E=void 0===_?1:_,w=e.strokeOpacity,T=void 0===w?1:w,S=e.opacity,M=void 0===S?1:S,C=e.metrics,A=e.x,O=void 0===A?0:A,N=e.y,P=void 0===N?0:N,L=e.dx,R=e.dy,D=e.shadowColor,k=e.shadowBlur,I=C.font,B=C.lines,F=C.height,z=C.lineHeight,G=C.lineMetrics;t.font=I,t.lineWidth=s,t.textAlign="middle"===u?"center":u;var j=h;"alphabetic"===j&&(j="bottom"),t.lineJoin=f,(0,le.Z)(g)||(t.miterLimit=g);var U=P;"middle"===h?U+=-F/2-z/2:"bottom"===h||"alphabetic"===h||"ideographic"===h?U+=-F:"top"!==h&&"hanging"!==h||(U+=-z);var H=O+(L||0);U+=R||0,1===B.length&&("bottom"===j?(j="middle",U-=.5*F):"top"===j&&(j="middle",U+=.5*F)),t.textBaseline=j,Zp(n,t,!(0,le.Z)(D)&&k>0);for(var V=0;V0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),(t=d(this,e)).name="canvas-renderer",t.options=n,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){var t,e=(0,a.Z)({dirtyObjectNumThreshold:500,dirtyObjectRatioThreshold:.8},this.options),n=this.context.imagePool,i=new Vp(n),r=(t={},(0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)((0,an.Z)(t,pi.CIRCLE,i),pi.ELLIPSE,i),pi.RECT,i),pi.IMAGE,new Yp(n)),pi.TEXT,new qp(n)),pi.LINE,i),pi.POLYLINE,i),pi.POLYGON,i),pi.PATH,i),pi.GROUP,void 0),(0,an.Z)((0,an.Z)((0,an.Z)(t,pi.HTML,void 0),pi.MESH,void 0),pi.FRAGMENT,void 0));this.context.defaultStyleRendererFactory=r,this.context.styleRendererFactory=r,this.addRenderingPlugin(new kp(e))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins(),delete this.context.defaultStyleRendererFactory,delete this.context.styleRendererFactory}}])}(mi),Kp=function(){function t(){(0,o.Z)(this,t)}return(0,s.Z)(t,[{key:"apply",value:function(e,n){var i=this,r=e.renderingService,a=e.renderingContext,o=e.config;this.context=e;var s=a.root.ownerDocument.defaultView,l=function(t){r.hooks.pointerMove.call(t)},u=function(t){r.hooks.pointerUp.call(t)},c=function(t){r.hooks.pointerDown.call(t)},h=function(t){r.hooks.pointerOver.call(t)},d=function(t){r.hooks.pointerOut.call(t)},f=function(t){r.hooks.pointerCancel.call(t)},p=function(t){r.hooks.pointerWheel.call(t)},g=function(t){r.hooks.click.call(t)};r.hooks.init.tap(t.tag,(function(){var t=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="none",t.style.msTouchAction="none"):s.supportsPointerEvents&&(t.style.touchAction="none"),s.supportsPointerEvents?function(t){n.globalThis.document.addEventListener("pointermove",l,!0),t.addEventListener("pointerdown",c,!0),t.addEventListener("pointerleave",d,!0),t.addEventListener("pointerover",h,!0),n.globalThis.addEventListener("pointerup",u,!0),n.globalThis.addEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.addEventListener("mousemove",l,!0),t.addEventListener("mousedown",c,!0),t.addEventListener("mouseout",d,!0),t.addEventListener("mouseover",h,!0),n.globalThis.addEventListener("mouseup",u,!0)}(t),s.supportsTouchEvents&&function(t){t.addEventListener("touchstart",c,!0),t.addEventListener("touchend",u,!0),t.addEventListener("touchmove",l,!0),t.addEventListener("touchcancel",f,!0)}(t),o.useNativeClickEvent&&t.addEventListener("click",g,!0),t.addEventListener("wheel",p,{passive:!0,capture:!0})})),r.hooks.destroy.tap(t.tag,(function(){var t=i.context.contextService.getDomElement();n.globalThis.navigator.msPointerEnabled?(t.style.msContentZooming="",t.style.msTouchAction=""):s.supportsPointerEvents&&(t.style.touchAction=""),s.supportsPointerEvents?function(t){n.globalThis.document.removeEventListener("pointermove",l,!0),t.removeEventListener("pointerdown",c,!0),t.removeEventListener("pointerleave",d,!0),t.removeEventListener("pointerover",h,!0),n.globalThis.removeEventListener("pointerup",u,!0),n.globalThis.removeEventListener("pointercancel",f,!0)}(t):function(t){n.globalThis.document.removeEventListener("mousemove",l,!0),t.removeEventListener("mousedown",c,!0),t.removeEventListener("mouseout",d,!0),t.removeEventListener("mouseover",h,!0),n.globalThis.removeEventListener("mouseup",u,!0)}(t),s.supportsTouchEvents&&function(t){t.removeEventListener("touchstart",c,!0),t.removeEventListener("touchend",u,!0),t.removeEventListener("touchmove",l,!0),t.removeEventListener("touchcancel",f,!0)}(t),o.useNativeClickEvent&&t.removeEventListener("click",g,!0),t.removeEventListener("wheel",p,!0)}))}}])}();Kp.tag="DOMInteraction";var Qp=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return"matrix(".concat([t[0],t[1],t[4],t[5],t[12]+e[0],t[13]+e[1]].join(","),")")}},{key:"apply",value:function(e,n){var i=this,r=e.camera,a=e.renderingContext,o=e.renderingService;this.context=e;var s=a.root.ownerDocument.defaultView,l=s.context.eventService.nativeHTMLMap,u=function(t,e){e.style.transform=i.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())},c=function(t){var e=t.target;if(e.nodeName===pi.HTML){i.$camera||(i.$camera=i.createCamera(r));var n=i.getOrCreateEl(e);i.$camera.appendChild(n),Object.keys(e.attributes).forEach((function(t){i.updateAttribute(t,e)})),u(e,n),l.set(n,e)}},h=function(t){var e=t.target;if(e.nodeName===pi.HTML&&i.$camera){var n=i.getOrCreateEl(e);n&&(n.remove(),l.delete(n))}},d=function(t){var e=t.target;if(e.nodeName===pi.HTML){var n=t.attrName;i.updateAttribute(n,e)}},f=function(t){var e=t.target;(e.nodeName===pi.FRAGMENT?e.childNodes:[e]).forEach((function(t){if(t.nodeName===pi.HTML){var e=i.getOrCreateEl(t);u(t,e)}}))},p=function(){if(i.$camera){var t=i.context.config,e=t.width,n=t.height;i.$camera.parentElement.style.width="".concat(e||0,"px"),i.$camera.parentElement.style.height="".concat(n||0,"px")}};o.hooks.init.tap(t.tag,(function(){s.addEventListener(Zl.RESIZE,p),s.addEventListener(Ss.MOUNTED,c),s.addEventListener(Ss.UNMOUNTED,h),s.addEventListener(Ss.ATTR_MODIFIED,d),s.addEventListener(Ss.BOUNDS_CHANGED,f)})),o.hooks.endFrame.tap(t.tag,(function(){i.$camera&&a.renderReasons.has(_s.CAMERA_CHANGED)&&(i.$camera.style.transform=i.joinTransformMatrix(r.getOrthoMatrix()))})),o.hooks.destroy.tap(t.tag,(function(){i.$camera&&i.$camera.remove(),s.removeEventListener(Zl.RESIZE,p),s.removeEventListener(Ss.MOUNTED,c),s.removeEventListener(Ss.UNMOUNTED,h),s.removeEventListener(Ss.ATTR_MODIFIED,d),s.removeEventListener(Ss.BOUNDS_CHANGED,f)}))}},{key:"createCamera",value:function(t){var e=this.context.config,n=e.document,i=e.width,r=e.height,a=this.context.contextService.getDomElement(),o=a.parentNode;if(o){var s="g-canvas-camera",l=o.querySelector("#".concat(s));if(!l){var u=(n||document).createElement("div");u.style.overflow="hidden",u.style.pointerEvents="none",u.style.position="absolute",u.style.left="0px",u.style.top="0px",u.style.width="".concat(i||0,"px"),u.style.height="".concat(r||0,"px");var c=(n||document).createElement("div");l=c,c.id=s,c.style.position="absolute",c.style.left="".concat(a.offsetLeft||0,"px"),c.style.top="".concat(a.offsetTop||0,"px"),c.style.transformOrigin="left top",c.style.transform=this.joinTransformMatrix(t.getOrthoMatrix()),c.style.pointerEvents="none",c.style.width="100%",c.style.height="100%",u.appendChild(c),o.appendChild(u)}return l}return null}},{key:"getOrCreateEl",value:function(t){var e=this.context.config.document,n=this.displayObjectHTMLElementMap.get(t);return n||(n=(e||document).createElement("div"),t.parsedStyle.$el=n,this.displayObjectHTMLElementMap.set(t,n),t.id&&(n.id=t.id),t.name&&n.setAttribute("name",t.name),t.className&&(n.className=t.className),n.style.position="absolute",n.style["will-change"]="transform",n.style.transform=this.joinTransformMatrix(t.getWorldTransform(),t.getOrigin())),n}},{key:"updateAttribute",value:function(t,e){var n=this.getOrCreateEl(e);switch(t){case"innerHTML":var i=e.parsedStyle.innerHTML;(0,ue.Z)(i)?n.innerHTML=i:(n.innerHTML="",n.appendChild(i));break;case"x":n.style.left="".concat(e.parsedStyle.x,"px");break;case"y":n.style.top="".concat(e.parsedStyle.y,"px");break;case"transformOrigin":var r=e.parsedStyle.transformOrigin;n.style["transform-origin"]="".concat(r[0].buildCSSText(null,null,"")," ").concat(r[1].buildCSSText(null,null,""));break;case"width":var a=e.parsedStyle.width;n.style.width=(0,oe.Z)(a)?"".concat(a,"px"):a.toString();break;case"height":var o=e.parsedStyle.height;n.style.height=(0,oe.Z)(o)?"".concat(o,"px"):o.toString();break;case"zIndex":var s=e.parsedStyle.zIndex;n.style["z-index"]="".concat(s);break;case"visibility":var l=e.parsedStyle.visibility;n.style.visibility=l;break;case"pointerEvents":var u=e.parsedStyle.pointerEvents,c=void 0===u?"auto":u;n.style.pointerEvents=c;break;case"opacity":var h=e.parsedStyle.opacity;n.style.opacity="".concat(h);break;case"fill":var d=e.parsedStyle.fill,f="";Ur(d)?f=d.isNone?"transparent":e.getAttribute("fill"):Array.isArray(d)?f=e.getAttribute("fill"):jr(d),n.style.background=f;break;case"stroke":var p=e.parsedStyle.stroke,g="";Ur(p)?g=p.isNone?"transparent":e.getAttribute("stroke"):Array.isArray(p)?g=e.getAttribute("stroke"):jr(p),n.style["border-color"]=g,n.style["border-style"]="solid";break;case"lineWidth":var m=e.parsedStyle.lineWidth;n.style["border-width"]="".concat(m||0,"px");break;case"lineDash":n.style["border-style"]="dashed";break;case"filter":var v=e.style.filter;n.style.filter=v;break;default:(0,le.Z)(e.style[t])||""===e.style[t]||(n.style[t]=e.style[t])}}}])}();Jp.tag="HTMLRendering";var tg=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r=1?Math.ceil(n):1,this.dpr=n,this.$canvas&&(this.$canvas.width=this.dpr*t,this.$canvas.height=this.dpr*e,function(t,e,n){xo&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")}(this.$canvas,t,e)),this.renderingContext.renderReasons.add(_s.CAMERA_CHANGED)}},{key:"applyCursorStyle",value:function(t){this.$container&&this.$container.style&&(this.$container.style.cursor=t)}},{key:"toDataURL",value:(t=(0,li.Z)((0,si.Z)().mark((function t(){var e,n,i,r=arguments;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.length>0&&void 0!==r[0]?r[0]:{},n=e.type,i=e.encoderOptions,t.abrupt("return",this.context.canvas.toDataURL(n,i));case 3:case"end":return t.stop()}}),t,this)}))),function(){return t.apply(this,arguments)})}]);var t}(),ng=function(t){function e(){var t;(0,o.Z)(this,e);for(var n=arguments.length,i=new Array(n),r=0;r{const e=this.context.canvas,n=e.context.renderingContext.root.ownerDocument.defaultView;this.normalizeToPointerEvent(t,n).forEach((i=>{const r=this.bootstrapEvent(this.rootPointerEvent,i,n,t);Wd(e.context.eventService,"mappingTable.pointerupoutside",[]),e.context.eventService.mapEvent(r)}))}}get eventService(){return this.context.canvas.context.eventService}get events(){return[lc.CLICK,lc.POINTER_DOWN,lc.POINTER_MOVE,lc.POINTER_UP,lc.POINTER_OVER,lc.POINTER_LEAVE]}getDomElement(){return this.getShape("key").getDomElement()}getKeyStyle(t){const e=(0,rg.Z)(t,["dx","dy","innerHTML","pointerEvents","cursor"]),{dx:n=0,dy:i=0}=e,r=ag(e,["dx","dy"]),[a,o]=this.getSize(t);return Object.assign(Object.assign({x:n,y:i},r),{width:a,height:o})}drawKeyShape(t,e){const n=this.getKeyStyle(t),{x:i,y:r,width:a=0,height:o=0}=n,s=this.upsert("key-container",kl,{x:i,y:r,width:a,height:o,opacity:0},e);return this.upsert("key",Sl,n,s)}connectedCallback(){if(!(this.context.canvas.getRenderer("main")instanceof ig))return;const t=this.getDomElement();this.events.forEach((e=>{t.addEventListener(e,this.forwardEvents)}))}attributeChangedCallback(t,e,n){"zIndex"===t&&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 e=0;ethis.context.element.getElement(t))).filter(Boolean);if(0===i.length){const e=new Ti,{x:n=0,y:i=0,size:r}=t,[a,o]=tf(r);return e.setMinMax([n-a/2,i-o/2,0],[n+a/2,i+o/2,0]),e}const r=$c(i.map((t=>t.getBounds())));return n?qc(r,n):r}drawCollapsedMarkerShape(t,e){const n=this.getCollapsedMarkerStyle(t);of(this,"collapsedMarker",n)&&(this.upsert("collapsed-marker",Rf,n,e),Pf(this))}getCollapsedMarkerStyle(t){if(!t.collapsed||!t.collapsedMarker)return!1;const e=Kd(this.getGraphicStyle(t),"collapsedMarker"),{type:n}=e,i=cg(e,["type"]),r=this.getShape("key"),[a,o]=xd(r.getLocalBounds(),"center"),s=Object.assign(Object.assign({},i),{x:a,y:o});if(n){const e=this.getCollapsedMarkerText(n,t);Object.assign(s,{text:e})}return s}getCollapsedMarkerText(t,e){const{childrenData:n=[]}=e,{model:i}=this.context;return"descendant-count"===t?i.getDescendantsData(this.id).length.toString():"child-count"===t?n.length.toString():"node-count"===t?i.getDescendantsData(this.id).filter((t=>"node"===i.getElementType(Dh(t)))).length.toString():(0,en.Z)(t)?t(n):""}getComboPosition(t){const{x:e=0,y:n=0,collapsed:i,childrenData:r=[]}=t;if(0===r.length)return[+e,+n,0];if(i){const{model:t}=this.context,i=t.getDescendantsData(this.id).filter((e=>!t.isCombo(Dh(e))));if(i.length>0&&i.some(vd)){return id(i.reduce(((t,e)=>td(t,md(e))),[0,0,0]),i.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.syncComboDatum({id:this.id,style:{x:n,y:i}}),Lf(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((t=>{var{x:e,y:n,z:i,transform:r}=t;return cg(t,["x","y","z","transform"])})),e);return n?new Proxy(n,{set:(t,e,n)=>("currentTime"===e&&Promise.resolve().then((()=>this.onframe())),Reflect.set(t,e,n))}):n}}hg.defaultStyleProps={childrenNode:[],droppable:!0,draggable:!0,collapsed:!1,collapsedSize:32,collapsedMarker:!0,collapsedMarkerZIndex:1,collapsedMarkerFontSize:12,collapsedMarkerTextAlign:"center",collapsedMarkerTextBaseline:"middle",collapsedMarkerType:"child-count"};var dg=function(t,e){if(!Ju(t))return t;for(var n=[],i=0;i-1},pg=function(t,e){return void 0===e&&(e=[]),dg(t,(function(t){return!fg(e,t)}))};const gg={padding:10};function mg(t,e,n,i,r,a){const{padding:o}=Object.assign(gg,a),s=Xc(n,o),l=Xc(i,o),u=[t,...r,e];let c=null;const h=[];for(let t=0,e=u.length;ta?"N":"S":i===a?n>r?"W":"E":null}function bg(t,e){return"N"===e||"S"===e?Zc(t):Vc(t)}function _g(t,e,n){const i=[t[0],e[1]],r=[e[0],t[1]],a=xg(t,i),o=xg(t,r),s=a===n||a!==(n?vg[n]:null)&&o!==n?i:r;return{points:[s],direction:xg(s,e)}}function Eg(t,e,n){if(Jc(t,n)){const i=Mg(t,e,n);return{points:[i],direction:xg(i,e)}}{const i=eh(t,n),r=["left","right"].includes(th(t,n))?[e[0],i[1]]:[i[0],e[1]];return{points:[r],direction:xg(r,e)}}}function wg(t,e,n,i){const r=Jc(e,n)?e:eh(e,n),a=[[r[0],t[1]],[t[0],r[1]]],o=a.filter((t=>function(t,e){return!Kc(t,e)}(t,n)&&!Qc(t,n,!0))),s=o.filter((e=>xg(e,t)!==i));if(s.length>0){const n=s.find((e=>xg(t,e)===i))||s[0];return{points:[n],direction:xg(n,e)}}{const r=wd(e,pg(a,o)[0],bg(n,i)/2);return{points:[Mg(r,t,n),r],direction:xg(r,e)}}}function Tg(t,e,n,i){let r=Eg(t,e,n);const a=hd(r.points[0]);if(Kc(a,i)){r=Eg(e,t,i);const o=hd(r.points[0]);if(Kc(o,n)){const s=wd(t,a,bg(n,xg(t,a))/2),l=wd(e,o,bg(i,xg(e,o))/2),u=[(s[0]+l[0])/2,(s[1]+l[1])/2],c=Eg(t,u,n),h=wg(u,e,i,c.direction);r.points=[c.points[0],h.points[0]],r.direction=h.direction}}return r}function Sg(t,e,n,i,r){const a=.01,o=$c([n,i]),s=ad(e,o.center)>ad(t,o.center),[l,u]=s?[e,t]:[t,e],c=Zc(o)+Vc(o);let h;if(r){const t=[l[0]+c*Math.cos(yg[r]),l[1]+c*Math.sin(yg[r])];h=wd(eh(t,o),t,a)}else h=wd(eh(l,o),l,-.01);let d=Mg(h,u,o),f=[Ed(h,2),Ed(d,2)];if(ec(Ed(h),Ed(d))){const t=ld(ed(h,l),[1,0,0])+Math.PI/2;d=[u[0]+c*Math.cos(t),u[1]+c*Math.sin(t),0],d=Ed(wd(eh(d,o),u,-.01),2);f=[h,Mg(h,d,o),d]}return{points:s?f.reverse():f,direction:xg(s?h:d,e)}}function Mg(t,e,n){let i=[t[0],e[1]];return Kc(i,n)&&(i=[e[0],t[1]]),i}function Cg(t,e,n,i,r){let a="number"==typeof e?e:.5;"start"===e&&(a=0),"end"===e&&(a=.99);const o=bd(t.getPoint(a)),s=bd(t.getPoint(a+.01));let l="start"===e?"left":"end"===e?"right":"center";if(Td(o,s)||!n){const[e,n]=Ag(t,a,i,r);return{transform:[["translate",e,n]],textAlign:l}}let u=Math.atan2(s[1]-o[1],s[0]-o[0]);s[0]{const s=a[n-1]||i,l=a[n+1]||r;if(!fd([s,u=t],[u,l])&&e){const[n,i]=function(t,e,n,i){const r=od(t,e),a=od(n,e),o=Math.min(i,Math.min(r,a)/2),s=[e[0]-o/r*(e[0]-t[0]),e[1]-o/r*(e[1]-t[1])],l=[e[0]-o/a*(e[0]-n[0]),e[1]-o/a*(e[1]-n[1])];return[s,l]}(s,t,l,e);o.push(["L",n[0],n[1]],["Q",t[0],t[1],i[0],i[1]],["L",i[0],i[1]])}else o.push(["L",t[0],t[1]]);var u})),o.push(["L",r[0],r[1]]),n&&o.push(["Z"]),o}function Lg(t,e,n,i,r){const a=Xc(t),o=t.getCenter();let s=i&&mm(i),l=r&&mm(r);if(!s||!l){const i=(t=>{const e=Math.PI/2,n=Zc(t)/2,i=Vc(t)/2,r=Math.atan2(n,i)/2,a=Math.atan2(i,n)/2;return{top:[-e-a,-e+a],"top-right":[-e+a,-r],"right-top":[-e+a,-r],right:[-r,r],"bottom-right":[r,e-a],"right-bottom":[r,e-a],bottom:[e-a,e+a],"bottom-left":[e+a,Math.PI-r],"left-bottom":[e+a,Math.PI-r],left:[Math.PI-r,Math.PI+r],"top-left":[Math.PI+r,-e-a],"left-top":[Math.PI+r,-e-a]}})(a),r=i[e][0],u=i[e][1],[c,h]=Wc(a),d=Math.max(c,h),f=td(o,[d*Math.cos(r),d*Math.sin(r),0]),p=td(o,[d*Math.cos(u),d*Math.sin(u),0]);s=bm(t,f),l=bm(t,p),n||([s,l]=[l,s])}return[s,l]}function Rg(t,e,n,i,r,a){const o=t.getPorts()[r||a],s=t.getPorts()[a||r];let[l,u]=Lg(t,e,n,o,s);const c=function(t,e,n,i){const r=t.getCenter();if(ec(e,n)){const t=ed(e,r),a=[i*Math.sign(t[0])||i/2,i*Math.sign(t[1])||-i/2,0];return[td(e,a),td(n,nd(a,[1,-1,1]))]}return[wd(r,e,ad(r,e)+i),wd(r,n,ad(r,n)+i)]}(t,l,u,i);return o&&(l=xm(o,c[0])),s&&(u=xm(s,c[c.length-1])),Ng(l,u,c)}function Dg(t,e,n,i,r,a,o){const s=pm(t),l=s[a||o],u=s[o||a];let[c,h]=Lg(t,n,i,l,u);const d=function(t,e,n,i){const r=[],a=Xc(t);if(ec(e,n)){switch(th(e,a)){case"left":r.push([e[0]-i,e[1]]),r.push([e[0]-i,e[1]+i]),r.push([e[0],e[1]+i]);break;case"right":r.push([e[0]+i,e[1]]),r.push([e[0]+i,e[1]+i]),r.push([e[0],e[1]+i]);break;case"top":r.push([e[0],e[1]-i]),r.push([e[0]+i,e[1]-i]),r.push([e[0]+i,e[1]]);break;case"bottom":r.push([e[0],e[1]+i]),r.push([e[0]+i,e[1]+i]),r.push([e[0]+i,e[1]])}}else{const t=th(e,a),o=th(n,a);if(t===o){let a,o;switch(t){case"left":a=Math.min(e[0],n[0])-i,r.push([a,e[1]]),r.push([a,n[1]]);break;case"right":a=Math.max(e[0],n[0])+i,r.push([a,e[1]]),r.push([a,n[1]]);break;case"top":o=Math.min(e[1],n[1])-i,r.push([e[0],o]),r.push([n[0],o]);break;case"bottom":o=Math.max(e[1],n[1])+i,r.push([e[0],o]),r.push([n[0],o])}}else{const s=(t,e)=>({left:[e[0]-i,e[1]],right:[e[0]+i,e[1]],top:[e[0],e[1]-i],bottom:[e[0],e[1]+i]}[t]),l=s(t,e),u=s(o,n),c=Mg(l,u,a);r.push(l,c,u)}}return r}(t,c,h,r);return l&&(c=xm(l,d[0])),u&&(h=xm(u,d[d.length-1])),Pg([c,...d,h],e)}function kg(t,e){const n=new Set,i=new Set,r=new Set;return t.forEach((a=>{e(a).forEach((e=>{n.add(e),t.includes(e.source)&&t.includes(e.target)?i.add(e):r.add(e)}))})),{edges:Array.from(n),internal:Array.from(i),external:Array.from(r)}}function Ig(t,e){const n=[];let i=t;for(;i;){n.push(i);const t=e(Dh(i));if(!t)break;i=t}if(n.some((t=>{var e;return null===(e=t.style)||void 0===e?void 0:e.collapsed}))){const t=n.reverse().findIndex(Vd);return n[t]||n.at(-1)}return t}const Bg=(t,e)=>{const n=Math.max(t,e)/2;return[["M",-t/2,0],["A",n,n,0,1,0,2*n-t/2,0],["A",n,n,0,1,0,-t/2,0],["Z"]]},Fg=(t,e)=>[["M",-t/2,0],["L",t/2,-e/2],["L",t/2,e/2],["Z"]],zg=(t,e)=>[["M",-t/2,0],["L",0,-e/2],["L",t/2,0],["L",0,e/2],["Z"]],Gg=(t,e)=>[["M",-t/2,0],["L",t/2,-e/2],["L",4*t/5-t/2,0],["L",t/2,e/2],["Z"]],jg=(t,e)=>[["M",-t/2,-e/2],["L",t/2,-e/2],["L",t/2,e/2],["L",-t/2,e/2],["Z"]],Ug=(t,e)=>{const n=t/2,i=t/7,r=t-i;return[["M",-n,0],["L",0,-e/2],["L",0,e/2],["Z"],["M",r-n,-e/2],["L",r+i-n,-e/2],["L",r+i-n,e/2],["L",r-n,e/2],["Z"]]},Hg=(t,e)=>[["M",t/2,-e/2],["L",-t/2,0],["L",t/2,0],["L",-t/2,0],["L",t/2,e/2]];var Vg=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r("currentTime"===e&&Promise.resolve().then((()=>this.onframe())),Reflect.set(t,e,n))}):n}}Zg.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 Wg extends Zg{constructor(t){super(rf({style:Wg.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t),{controlPoints:i,curvePosition:r,curveOffset:a}=t,o=this.getControlPoints(e,n,function(t){return(0,oe.Z)(t)?[t,1-t]:t}(r),function(t){return(0,oe.Z)(t)?[t,-t]:t}(a),i);return Ng(e,n,o)}getControlPoints(t,e,n,i,r){return 2===(null==r?void 0:r.length)?r:[Og(t,e,n[0],i[0]),Og(t,e,n[1],i[1])]}}Wg.defaultStyleProps={curvePosition:.5,curveOffset:20};class Xg extends Wg{constructor(t){super(rf({style:Xg.defaultStyleProps},t))}getControlPoints(t,e,n,i){const r=e[0]-t[0];return[[t[0]+r*n[0]+i[0],t[1]],[e[0]-r*n[1]+i[1],e[1]]]}}Xg.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class Yg extends Wg{constructor(t){super(rf({style:Yg.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=md(this.ref);return[this.sourceNode.getIntersectPoint(e,!0),this.targetNode.getIntersectPoint(e)]}toRadialCoordinate(t){const e=md(this.ref);return[ad(t,e),dd(ed(t,e))]}getControlPoints(t,e,n,i){const[r,a]=this.toRadialCoordinate(t),[o]=this.toRadialCoordinate(e),s=o-r;return[[t[0]+(s*n[0]+i[0])*Math.cos(a),t[1]+(s*n[0]+i[0])*Math.sin(a)],[e[0]-(s*n[1]-i[0])*Math.cos(a),e[1]-(s*n[1]-i[0])*Math.sin(a)]]}}Yg.defaultStyleProps={curvePosition:.5,curveOffset:20};class qg extends Wg{constructor(t){super(rf({style:qg.defaultStyleProps},t))}getControlPoints(t,e,n,i){const r=e[1]-t[1];return[[t[0],t[1]+r*n[0]+i[0]],[e[0],e[1]-r*n[1]+i[1]]]}}qg.defaultStyleProps={curvePosition:[.5,.5],curveOffset:[0,0]};class $g extends Zg{constructor(t){super(rf({style:$g.defaultStyleProps},t))}getKeyPath(t){const[e,n]=this.getEndpoints(t);return[["M",e[0],e[1]],["L",n[0],n[1]]]}}$g.defaultStyleProps={};const Kg={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:od},Qg=t=>`${Math.round(t[0])}|||${Math.round(t[1])}`;function Jg(t,e){const n=t=>Math.round(t/e);return(0,oe.Z)(t)?n(t):t.map(n)}function tm(t,e){const n=e[0]-t[0],i=e[1]-t[1];return n||i?Math.atan2(i,n):0}function em(t,e,n,i){const r=tm(t,e),a=n[Qg(t)];return function(t,e){const n=Math.abs(t-e);return n>Math.PI?2*Math.PI-n:n}(tm(a||i,t),r)}function nm(t,e,n){return Math.min(...e.map((e=>n(t,e))))}const im=(t,e,n,i)=>{if(!e)return[t];const{directionMap:r,offset:a}=i,o=qc(e.getRenderBounds(),a),s=Object.keys(r).reduce(((e,i)=>{if(n.includes(i)){const n=r[i],[a,s]=Wc(o),l=[t[0]+n.stepX*a,t[1]+n.stepY*s],u=function(t){const{min:[e,n],max:[i,r]}=t,a=[e,r],o=[i,r],s=[i,n],l=[e,n];return[[a,o],[o,s],[s,l],[l,a]]}(o);for(let n=0;nJg(t,i.gridSize)))},rm=(t,e,n,i,r,a,o)=>{const s=[];let l=[a[0]===i[0]?i[0]:t[0]*o,a[1]===i[1]?i[1]:t[1]*o];s.unshift(l);let u=t,c=e[Qg(u)];for(;c;){const t=c,i=u;em(t,i,e,n)&&(l=[t[0]===i[0]?l[0]:t[0]*o,t[1]===i[1]?l[1]:t[1]*o],s.unshift(l)),c=e[Qg(t)],u=t}const h=r.map((t=>[t[0]*o,t[1]*o])),d=function(t,e,n){let i=t[0],r=n(t[0],e);for(let a=0;a{const{offset:n,gridSize:i}=e,r={};return t.forEach((t=>{if(!t||t.destroyed||!t.isVisible())return;const e=qc(t.getRenderBounds(),n);for(let t=Jg(e.min[0],i);t<=Jg(e.max[0],i);t+=1)for(let n=Jg(e.min[1],i);n<=Jg(e.max[1],i);n+=1)r[`${t}|||${n}`]=!0})),r})(o.enableObstacleAvoidance?n:[t,e],o),u=Jg(r,s),c=Jg(a,s),h=im(r,t,o.startDirections,o),d=im(a,e,o.endDirections,o);h.forEach((t=>delete l[Qg(t)])),d.forEach((t=>delete l[Qg(t)]));const f={},p={},g={},m={},v={},y=new om;for(let t=0;tQg(t)));let b,_=o.maximumLoops,E=1/0;for(const[t,e]of Object.entries(f))v[t]<=E&&(E=v[t],b=e);for(;Object.keys(f).length>0&&_>0;){const t=y.minId(!1);if(!t)break;b=f[t];const e=Qg(b);if(x.includes(e))return rm(b,g,u,a,h,c,s);delete f[e],y.remove(e),p[e]=!0;for(const t of Object.values(o.directionMap)){const n=td(b,[t.stepX,t.stepY]),i=Qg(n);if(p[i])continue;const r=em(b,n,g,u);if(r>o.maxAllowedDirectionChange)continue;if(l[i])continue;f[i]||(f[i]=n);const a=o.penalties[r],c=o.distFunc(b,n)+(isNaN(a)?s:a),h=m[e]+c,x=m[i];x&&h>=x||(g[i]=b,m[i]=h,v[i]=h+nm(n,d,o.distFunc),y.add({id:i,value:v[i]}))}_-=1}return[]}class om{constructor(){this.arr=[],this.map={},this.arr=[],this.map={}}_innerAdd(t,e){let n=0,i=e-1;for(;i-n>1;){const e=Math.floor((n+i)/2);if(this.arr[e].value>t.value)i=e;else{if(!(this.arr[e].value=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 sm extends Zg{constructor(t){super(rf({style:sm.defaultStyleProps},t))}getControlPoints(t){const{router:e}=t,{sourceNode:n,targetNode:i}=this,[r,a]=this.getEndpoints(t,!1);let o=[];if(e)if("shortest-path"===e.type){o=am(n,i,this.context.element.getNodes(),e),o.length||(o=mg(r,a,n,i,t.controlPoints,{padding:e.offset}))}else"orth"===e.type&&(o=mg(r,a,n,i,t.controlPoints,e));else o=t.controlPoints;return o}getPoints(t){const e=this.getControlPoints(t),[n,i]=this.getEndpoints(t,!0,e);return[n,...e,i]}getKeyPath(t){return Pg(this.getPoints(t),t.radius)}getLoopPath(t){const{sourcePort:e,targetPort:n,radius:i}=t,r=this.sourceNode,a=Xc(r),o=Math.max(Vc(a),Zc(a))/4,{placement:s,clockwise:l,dist:u=o}=Kd(this.getGraphicStyle(t),"loop");return Dg(r,i,s,l,u,e,n)}}sm.defaultStyleProps={radius:0,controlPoints:[],router:!1};class lm extends Zg{constructor(t){super(rf({style:lm.defaultStyleProps},t))}getKeyPath(t){const{curvePosition:e,curveOffset:n}=t,[i,r]=this.getEndpoints(t);return function(t,e,n){return[["M",t[0],t[1]],["Q",n[0],n[1],e[0],e[1]]]}(i,r,t.controlPoint||Og(i,r,e,n))}}function um(t){return t instanceof If&&"node"===t.type}function cm(t){return t instanceof Zg}function hm(t){return t instanceof hg}lm.defaultStyleProps={curvePosition:.5,curveOffset:30};const dm={top:[.5,0],right:[1,.5],bottom:[.5,1],left:[0,.5],default:[.5,.5]};function fm(t,e,n=dm,i=!0){const r=[.5,.5],a=(0,ue.Z)(e)?Zd(n,e.toLocaleLowerCase(),r):e;if(!i&&(0,ue.Z)(e))return a;const[o,s]=a||r;return[t.min[0]+Vc(t)*o,t.min[1]+Zc(t)*s]}function pm(t){if(!t)return{};const e=t.getPorts();return(t.attributes.ports||[]).forEach(((n,i)=>{var r;const{key:a,placement:o}=n;gm(n)&&(e[r=a||i]||(e[r]=xd(t.getShape("key").getBounds(),o)))})),e}function gm(t){const{r:e}=t;return!e||0===Number(e)}function mm(t){return Gc(t)?t:t.getPosition()}function vm(t,e,n,i){const r=pm(t);if(n)return r[n];const a=Object.values(r);if(0===a.length)return;const o=a.map((t=>mm(t))),s=function(t,e){const n=pm(t);if(e)return[mm(n[e])];const i=Object.values(n);return i.length>0?i.map((t=>mm(t))):[t.getCenter()]}(e,i),[l]=function(t,e){let n=1/0,i=[t[0],e[0]];return t.forEach((t=>{e.forEach((e=>{const r=ad(t,e);rmm(t)===l))}function ym(t,e){return hm(t)||um(t)?bm(t,e):xm(t,e)}function xm(t,e){if(!t||!e)return[0,0,0];if(Gc(t))return t;if(t.attributes.linkToCenter)return t.getPosition();return Cd(Gc(e)?e:um(e)?e.getCenter():e.getPosition(),t.getBounds())}function bm(t,e){if(!t||!e)return[0,0,0];const n=Gc(e)?e:um(e)?e.getCenter():e.getPosition();return t.getIntersectPoint(n)||t.getCenter()}function _m(t,e="bottom",n=0,i=0,r=!1){const a=e.split("-"),[o,s]=xd(t,e),l=a.includes("left")?"right":a.includes("right")?"left":"center";let u=a.includes("top")?"bottom":a.includes("bottom")?"top":"middle";return r&&(u="top"===u?"bottom":"bottom"===u?"top":u),{transform:[["translate",o+n,s+i]],textBaseline:u,textAlign:l}}function Em(t,e){"update"in t?t.update(e):t.attr(e)}function wm(t){return Zd(t,"__to_be_destroyed__",!1)}var Tm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Sm extends $h{constructor(t,e){super(t,Object.assign({},Sm.defaultOptions,e)),this.onCollapseExpand=t=>Tm(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{target:e}=t;if(!(um(n=e)||cm(n)||hm(n)))return;var n;const i=e.id,{model:r,graph:a}=this.context,o=r.getElementDataById(i);if(!o)return!1;const{onCollapse:s,onExpand:l,animation:u}=this.options;Vd(o)?(yield a.expandElement(i,u),null==l||l(i)):(yield a.collapseElement(i,u),null==s||s(i))})),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(0,en.Z)(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Sm.defaultOptions={enable:!0,animation:!0,trigger:lc.DBLCLICK};var Mm={},Cm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};const Am="g6-create-edge-assist-node-id";class Om extends $h{constructor(t,e){super(t,Object.assign({},Om.defaultOptions,e)),this.drop=t=>Cm(this,void 0,void 0,(function*(){const{targetType:e}=t;["combo","node"].includes(e)&&this.source?yield this.handleCreateEdge(t):yield this.cancelEdge()})),this.handleCreateEdge=t=>Cm(this,void 0,void 0,(function*(){var e,n,i;if(!this.validate(t))return;const{graph:r,canvas:a,batch:o,element:s}=this.context,{style:l}=this.options;if(this.source)return this.createEdge(t),void(yield this.cancelEdge());o.startBatch(),a.setCursor("crosshair"),this.source=this.getSelectedNodeIDs([t.target.id])[0];const u=r.getElementData(this.source);r.addNodeData([{id:Am,style:{visibility:"hidden",ports:[{key:"port-1",placement:[.5,.5]}],x:null===(e=u.style)||void 0===e?void 0:e.x,y:null===(n=u.style)||void 0===n?void 0:n.y}}]),r.addEdgeData([{id:"g6-create-edge-assist-edge-id",source:this.source,target:Am,style:Object.assign({pointerEvents:"none"},l)}]),yield null===(i=s.draw({animation:!1}))||void 0===i?void 0:i.finished})),this.updateAssistEdge=t=>Cm(this,void 0,void 0,(function*(){var e;if(!this.source)return;const{model:n,element:i}=this.context;n.translateNodeTo(Am,[t.canvas.x,t.canvas.y]),yield null===(e=i.draw({animation:!1,silence:!0}))||void 0===e?void 0:e.finished})),this.createEdge=t=>{var e,n;const{graph:i}=this.context,{style:r,onFinish:a,onCreate:o}=this.options;if(void 0===(null===(e=t.target)||void 0===e?void 0:e.id)||void 0===this.source)return;const s=null===(n=this.getSelectedNodeIDs([t.target.id]))||void 0===n?void 0:n[0];var l;const u=o({id:`${this.source}-${s}-${Mm[l=l||"g"]?Mm[l]+=1:Mm[l]=1,l+Mm[l]}`,source:this.source,target:s,style:r});i.addEdgeData([u]),a(u)},this.cancelEdge=()=>Cm(this,void 0,void 0,(function*(){var t;if(!this.source)return;const{graph:e,element:n,batch:i}=this.context;e.removeNodeData([Am]),this.source=void 0,yield null===(t=n.draw({animation:!1}))||void 0===t?void 0:t.finished,i.endBatch()})),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){const{graph:t}=this.context,{trigger:e}=this.options;this.unbindEvents(),"click"===e?(t.on(fc.CLICK,this.handleCreateEdge),t.on(sc.CLICK,this.handleCreateEdge),t.on(oc.CLICK,this.cancelEdge),t.on(cc.CLICK,this.cancelEdge)):(t.on(fc.DRAG_START,this.handleCreateEdge),t.on(sc.DRAG_START,this.handleCreateEdge),t.on(lc.POINTER_UP,this.drop)),t.on(lc.POINTER_MOVE,this.updateAssistEdge)}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map((t=>t.id)).concat(t)))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;t.off(fc.CLICK,this.handleCreateEdge),t.off(sc.CLICK,this.handleCreateEdge),t.off(oc.CLICK,this.cancelEdge),t.off(cc.CLICK,this.cancelEdge),t.off(fc.DRAG_START,this.handleCreateEdge),t.off(sc.DRAG_START,this.handleCreateEdge),t.off(lc.POINTER_UP,this.drop),t.off(lc.POINTER_MOVE,this.updateAssistEdge)}destroy(){this.unbindEvents(),super.destroy()}}Om.defaultOptions={animation:!0,enable:!0,style:{},trigger:"drag",onCreate:t=>t,onFinish:()=>{}};var Nm=function(t,e,n){var i;return function(){var r=this,a=arguments,o=function(){i=null,n||t.apply(r,a)},s=n&&!i;clearTimeout(i),i=setTimeout(o,e),s&&t.apply(r,a)}},Pm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Lm extends $h{constructor(t,e){super(t,Object.assign({},Lm.defaultOptions,e)),this.isDragging=!1,this.onDragStart=t=>{this.validate(t)&&(this.isDragging=!0,this.context.canvas.setCursor("grabbing"))},this.onDrag=t=>{if(!this.isDragging)return;const{x:e,y:n}=t.movement;0!=(e|n)&&this.translate([e,n],!1)},this.onDragEnd=()=>{var t,e;this.isDragging=!1,this.context.canvas.setCursor(this.defaultCursor),null===(e=(t=this.options).onFinish)||void 0===e||e.call(t)},this.invokeOnFinish=Nm((()=>{var t,e;null===(e=(t=this.options).onFinish)||void 0===e||e.call(t)}),300),this.shortcut=new Rd(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((0,nn.Z)(t)){const{up:e=[],down:n=[],left:i=[],right:r=[]}=t;this.shortcut.bind(e,(t=>this.onTranslate([0,1],t))),this.shortcut.bind(n,(t=>this.onTranslate([0,-1],t))),this.shortcut.bind(i,(t=>this.onTranslate([1,0],t))),this.shortcut.bind(r,(t=>this.onTranslate([-1,0],t)))}else{const{graph:t}=this.context;t.on(lc.DRAG_START,this.onDragStart),t.on(lc.DRAG,this.onDrag),t.on(lc.DRAG_END,this.onDragEnd)}}onTranslate(t,e){return Pm(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{sensitivity:n}=this.options,i=-1*n;yield this.translate(nd(t,i),this.options.animation),this.invokeOnFinish()}))}translate(t,e){return Pm(this,void 0,void 0,(function*(){t=this.clampByDirection(t),t=this.clampByRange(t),yield this.context.graph.translateBy(t,e)}))}clampByDirection([t,e]){const{direction:n}=this.options;return"x"===n?e=0:"y"===n&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[r,a]=i.getSize(),[o,s,l,u]=Uc(this.options.range),c=[a*o,r*s,a*l,r*u],h=qc(Yc(n.getCanvasCenter()),c),d=ed(n.getViewportCenter(),[t,e,0]);if(!Kc(d,h)){const{min:[n,i],max:[r,a]}=h;(d[0]0||d[0]>r&&t<0)&&(t=0),(d[1]0||d[1]>a&&e<0)&&(e=0)}return[t,e]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return"function"==typeof e?e(t):!!e}unbindEvents(){this.shortcut.unbindAll();const{graph:t}=this.context;t.off(lc.DRAG_START,this.onDragStart),t.off(lc.DRAG,this.onDrag),t.off(lc.DRAG_END,this.onDragEnd)}destroy(){this.shortcut.destroy(),this.unbindEvents(),this.context.canvas.setCursor(this.defaultCursor),super.destroy()}}Lm.defaultOptions={enable:t=>!("targetType"in t)||"canvas"===t.targetType,sensitivity:10,direction:"both",range:1/0};var Rm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Dm extends $h{constructor(t,e){super(t,Object.assign({},Dm.defaultOptions,e)),this.enable=!1,this.enableElements=["node","combo"],this.target=[],this.shadowOrigin=[0,0],this.hiddenEdges=[],this.isDragging=!1,this.onDrop=t=>Rm(this,void 0,void 0,(function*(){var e;if("link"!==this.options.dropEffect)return;const{model:n,element:i}=this.context,r=t.target.id;this.target.forEach((t=>{const e=n.getParentData(t,pc);e&&Dh(e)===r&&n.refreshComboData(r),n.setParent(t,r,pc)})),yield null===(e=null==i?void 0:i.draw({animation:!0}))||void 0===e?void 0:e.finished})),this.setCursor=t=>{if(this.isDragging)return;const{type:e}=t,{canvas:n}=this.context,{cursor:i}=this.options;e===lc.POINTER_ENTER?n.setCursor((null==i?void 0:i.grab)||"grab"):n.setCursor((null==i?void 0:i.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((e=>{t.on(`${e}:${lc.DRAG_START}`,this.onDragStart),t.on(`${e}:${lc.DRAG}`,this.onDrag),t.on(`${e}:${lc.DRAG_END}`,this.onDragEnd),t.on(`${e}:${lc.POINTER_ENTER}`,this.setCursor),t.on(`${e}:${lc.POINTER_LEAVE}`,this.setCursor)})),["link"].includes(this.options.dropEffect)&&(t.on(sc.DROP,this.onDrop),t.on(oc.DROP,this.onDrop))}getSelectedNodeIDs(t){return Array.from(new Set(this.context.graph.getElementDataByState("node",this.options.state).map((t=>t.id)).concat(t)))}getDelta(t){const e=this.context.graph.getZoom();return id([t.dx,t.dy],e)}onDragStart(t){var e;if(this.enable=this.validate(t),!this.enable)return;const{batch:n,canvas:i}=this.context;i.setCursor((null===(e=this.options.cursor)||void 0===e?void 0:e.grabbing)||"grabbing"),this.isDragging=!0,n.startBatch(),this.target=this.getSelectedNodeIDs([t.target.id]),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=!1,this.options.shadow){if(!this.shadow)return;this.shadow.style.visibility="hidden";const{x:t=0,y:e=0}=this.shadow.attributes,[n,i]=ed([+t,+e],this.shadowOrigin);this.moveElement(this.target,[n,i])}this.showEdges(),null===(e=(t=this.options).onFinish)||void 0===e||e.call(t,this.target);const{batch:i,canvas:r}=this.context;i.endBatch(),r.setCursor((null===(n=this.options.cursor)||void 0===n?void 0:n.grab)||"grab"),this.isDragging=!1,this.target=[]}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}moveElement(t,e){return Rm(this,void 0,void 0,(function*(){const{graph:n,model:i}=this.context,{dropEffect:r}=this.options;"move"===r&&t.forEach((t=>i.refreshComboData(t))),n.translateElementBy(Object.fromEntries(t.map((t=>[t,e]))),!1)}))}moveShadow(t){if(!this.shadow)return;const{x:e=0,y:n=0}=this.shadow.attributes,[i,r]=t;this.shadow.attr({x:+e+i,y:+n+r})}createShadow(t){const e=Kd(this.options,"shadow"),n=$c(t.map((t=>this.context.element.getElement(t).getBounds()))),[i,r]=n.min;this.shadowOrigin=[i,r];const[a,o]=Wc(n),s={width:a,height:o,x:i,y:r};this.shadow?this.shadow.attr(Object.assign(Object.assign(Object.assign({},e),s),{visibility:"visible"})):(this.shadow=new kl({style:Object.assign(Object.assign(Object.assign({$layer:"transient"},e),s),{pointerEvents:"none"})}),this.context.canvas.appendChild(this.shadow))}showEdges(){this.options.shadow||0===this.hiddenEdges.length||(this.context.graph.showElement(this.hiddenEdges),this.hiddenEdges=[])}hideEdge(){const{hideEdge:t,shadow:e}=this.options;if("none"===t||e)return;const{graph:n}=this.context;this.hiddenEdges="all"===t?n.getEdgeData().map(Dh):Array.from(new Set(this.target.map((e=>n.getRelatedEdgesData(e,t).map(Dh))).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((e=>{t.off(`${e}:${lc.DRAG_START}`,this.onDragStart),t.off(`${e}:${lc.DRAG}`,this.onDrag),t.off(`${e}:${lc.DRAG_END}`,this.onDragEnd),t.off(`${e}:${lc.POINTER_ENTER}`,this.setCursor),t.off(`${e}:${lc.POINTER_LEAVE}`,this.setCursor)})),t.off(`combo:${lc.DROP}`,this.onDrop),t.off(`canvas:${lc.DROP}`,this.onDrop)}destroy(){var t;this.unbindEvents(),null===(t=this.shadow)||void 0===t||t.destroy(),super.destroy()}}Dm.defaultOptions={animation:!0,enable:t=>["node","combo"].includes(t.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 km=n(56354);class Im{constructor(t,e){this.context=t,this.options=e||{}}}var Bm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},Fm=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{const e=t.data._isCombo?i.combos:i.nodes,{x:n,y:r,z:a=0}=t.data;null==e||e.push({id:t.id,style:{x:n,y:r,z:a}})})),n.forEach((t=>{const{id:e,source:n,target:r,data:{points:a=[],controlPoints:o=a.slice(1,a.length-1)}}=t;i.edges.push({id:e,source:n,target:r,style:Object.assign({},(null==o?void 0:o.length)?{controlPoints:o.map(bd)}:{})})})),i}function Gm(t,e,...n){if(e in t)return t[e](...n);if("instance"in t){const i=t.instance;if(e in i)return i[e](...n)}return null}function jm(t,e){if(e in t)return t[e];if("instance"in t){const n=t.instance;if(e in n)return n[e]}return null}var Um=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};var Hm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Vm extends $h{constructor(t,e){super(t,Object.assign({},Vm.defaultOptions,e)),this.isZoomEvent=t=>Boolean(t.data&&"scale"in t.data),this.relatedEdgeToUpdate=new Set,this.zoom=this.context.graph.getZoom(),this.fixElementSize=t=>Hm(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{graph:e}=this.context,{state:n,nodeFilter:i,edgeFilter:r,comboFilter:a}=this.options,o=(n?e.getElementDataByState("node",n):e.getNodeData()).filter(i),s=(n?e.getElementDataByState("edge",n):e.getEdgeData()).filter(r),l=(n?e.getElementDataByState("combo",n):e.getComboData()).filter(a),u=this.isZoomEvent(t)?this.zoom=Math.max(.01,Math.min(t.data.scale,10)):this.zoom,c=[...o,...l];c.length>0&&c.forEach((t=>this.fixNodeLike(t,u))),this.updateRelatedEdges(),s.length>0&&s.forEach((t=>this.fixEdge(t,u)))})),this.cachedStyles=new Map,this.getOriginalFieldValue=(t,e,n)=>{var i;const r=this.cachedStyles.get(t)||[],a=(null===(i=r.find((t=>t.shape===e)))||void 0===i?void 0:i.style)||{};return n in a||(a[n]=e.attributes[n],this.cachedStyles.set(t,[...r.filter((t=>t.shape!==e)),{shape:e,style:a}])),a[n]},this.scaleEntireElement=(t,e,n)=>{e.setLocalScale(1/n);const i=this.cachedStyles.get(t)||[];i.push({shape:e}),this.cachedStyles.set(t,i)},this.scaleSpecificShapes=(t,e,n)=>{const i=function(t){const e=[],n=t=>{(null==t?void 0:t.children.length)&&t.children.forEach((t=>{e.push(t),n(t)}))};return n(t),e}(t);(Array.isArray(n)?n:[n]).forEach((n=>{const{shape:r,fields:a}=n,o="function"==typeof r?r(i):t.getShape(r);o&&(a?a.forEach((n=>{const i=this.getOriginalFieldValue(t.id,o,n);(0,oe.Z)(i)&&(o.style[n]=i/e)})):this.scaleEntireElement(t.id,o,e))}))},this.skipIfExceedViewport=t=>{const{viewport:e}=this.context;return!(null==e?void 0:e.isInViewport(t.getRenderBounds(),!1,30))},this.fixNodeLike=(t,e)=>{const n=Dh(t),{element:i,model:r}=this.context,a=i.getElement(n);if(!a||this.skipIfExceedViewport(a))return;r.getRelatedEdgesData(n).forEach((t=>this.relatedEdgeToUpdate.add(Dh(t))));const o=this.options[a.type];o?this.scaleSpecificShapes(a,e,o):this.scaleEntireElement(n,a,e)},this.fixEdge=(t,e)=>{const n=Dh(t),i=this.context.element.getElement(n);if(!i||this.skipIfExceedViewport(i))return;const r=this.options.edge;if(!r)return i.style.transformOrigin="center",void this.scaleEntireElement(n,i,e);this.scaleSpecificShapes(i,e,r)},this.updateRelatedEdges=()=>{const{element:t}=this.context;this.relatedEdgeToUpdate.size>0&&this.relatedEdgeToUpdate.forEach((e=>{const n=t.getElement(e);null==n||n.update({})})),this.relatedEdgeToUpdate.clear()},this.resetTransform=t=>Hm(this,void 0,void 0,(function*(){var e;(null===(e=t.data)||void 0===e?void 0:e.firstRender)||(this.options.reset?this.restoreCachedStyles():this.fixElementSize({data:{scale:this.zoom}}))})),this.bindEvents()}restoreCachedStyles(){if(this.cachedStyles.size>0){this.cachedStyles.forEach((t=>{t.forEach((({shape:t,style:e})=>{if(vf(e))t.setLocalScale(1);else{if(this.options.state)return;Object.entries(e).forEach((([e,n])=>t.style[e]=n))}}))}));const{graph:t,element:e}=this.context,n=Object.keys(Object.fromEntries(this.cachedStyles)).filter((e=>e&&"node"===t.getElementType(e)));if(n.length>0){const i=new Set;n.forEach((e=>{t.getRelatedEdgesData(e).forEach((t=>i.add(Dh(t))))})),i.forEach((t=>{const n=null==e?void 0:e.getElement(t);null==n||n.update({})}))}}}bindEvents(){const{graph:t}=this.context;t.on(hc.AFTER_DRAW,this.resetTransform),t.on(hc.AFTER_TRANSFORM,this.fixElementSize)}unbindEvents(){const{graph:t}=this.context;t.off(hc.AFTER_DRAW,this.resetTransform),t.off(hc.AFTER_TRANSFORM,this.fixElementSize)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){this.unbindEvents(),super.destroy()}}Vm.defaultOptions={enable:t=>t.data.scale<1,nodeFilter:()=>!0,edgeFilter:()=>!0,comboFilter:()=>!0,edge:[{shape:"key",fields:["lineWidth"]},{shape:"halo",fields:["lineWidth"]},{shape:"label"}],reset:!1};var Zm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Wm extends $h{constructor(t,e){super(t,Object.assign({},Wm.defaultOptions,e)),this.focus=t=>Zm(this,void 0,void 0,(function*(){if(!this.validate(t))return;const{graph:e}=this.context;yield e.focusElement(t.target.id,this.options.animation)})),this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Bd.forEach((e=>{t.on(`${e}:${lc.CLICK}`,this.focus)}))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Bd.forEach((e=>{t.off(`${e}:${lc.CLICK}`,this.focus)}))}destroy(){this.unbindEvents(),super.destroy()}}Wm.defaultOptions={animation:{easing:"ease-in",duration:500},enable:!0};class Xm extends $h{constructor(t,e){super(t,Object.assign({},Xm.defaultOptions,e)),this.isFrozen=!1,this.toggleFrozen=t=>{this.isFrozen="dragstart"===t.type},this.hoverElement=t=>{if(!this.validate(t))return;const e=t.type===lc.POINTER_ENTER;this.updateElementsState(t,e);const{onHover:n,onHoverEnd:i}=this.options;e?null==n||n(t):null==i||i(t)},this.updateElementsState=(t,e)=>{if(!this.options.state&&!this.options.inactiveState)return;const{graph:n}=this.context,{state:i,animation:r,inactiveState:a}=this.options,o=this.getActiveIds(t),s={};if(i&&Object.assign(s,this.getElementsState(o,i,e)),a){const t=Ih(n.getData(),!0).filter((t=>!o.includes(t)));Object.assign(s,this.getElementsState(t,a,e))}n.setElementState(s,r)},this.getElementsState=(t,e,n)=>{const{graph:i}=this.context,r={};return t.forEach((t=>{const a=i.getElementState(t);r[t]=n?a.includes(e)?a:[...a,e]:a.filter((t=>t!==e))})),r},this.bindEvents()}bindEvents(){const{graph:t}=this.context;this.unbindEvents(),Bd.forEach((e=>{t.on(`${e}:${lc.POINTER_ENTER}`,this.hoverElement),t.on(`${e}:${lc.POINTER_LEAVE}`,this.hoverElement)}));const e=this.context.canvas.document;e.addEventListener(`${lc.DRAG_START}`,this.toggleFrozen),e.addEventListener(`${lc.DRAG_END}`,this.toggleFrozen)}getActiveIds(t){const{graph:e}=this.context,{degree:n,direction:i}=this.options,r=t.target.id;return n?zd(e,t.targetType,r,"function"==typeof n?n(t):n,i):[r]}validate(t){if(this.destroyed||this.isFrozen||wm(t.target)||this.context.graph.isCollapsingExpanding)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}unbindEvents(){const{graph:t}=this.context;Bd.forEach((e=>{t.off(`${e}:${lc.POINTER_ENTER}`,this.hoverElement),t.off(`${e}:${lc.POINTER_LEAVE}`,this.hoverElement)}));const e=this.context.canvas.document;e.removeEventListener(`${lc.DRAG_START}`,this.toggleFrozen),e.removeEventListener(`${lc.DRAG_END}`,this.toggleFrozen)}destroy(){this.unbindEvents(),super.destroy()}}Xm.defaultOptions={animation:!1,enable:!0,degree:0,direction:"both",state:"active",inactiveState:void 0};class Ym extends $h{constructor(t,e){super(t,Object.assign({},Ym.defaultOptions,e)),this.hiddenShapes=[],this.isVisible=!0,this.setElementsVisibility=(t,e,n)=>{t.filter(Boolean).forEach((t=>{"hidden"!==e||t.isVisible()?"visible"===e&&this.hiddenShapes.includes(t)?this.hiddenShapes.splice(this.hiddenShapes.indexOf(t),1):Xh(t,e,!1,n):this.hiddenShapes.push(t)}))},this.filterShapes=(t,e)=>{if((0,en.Z)(e))return n=>!e(t,n);const n=null==e?void 0:e[t];return t=>!t.className||!(null==n?void 0:n.includes(t.className))},this.hideShapes=t=>{if(!this.validate(t)||!this.isVisible)return;const{element:e}=this.context,{shapes:n={}}=this.options;this.setElementsVisibility(e.getNodes(),"hidden",this.filterShapes("node",n)),this.setElementsVisibility(e.getEdges(),"hidden",this.filterShapes("edge",n)),this.setElementsVisibility(e.getCombos(),"hidden",this.filterShapes("combo",n)),this.isVisible=!1},this.showShapes=Nm((t=>{if(!this.validate(t)||this.isVisible)return;const{element:e}=this.context;this.setElementsVisibility(e.getNodes(),"visible"),this.setElementsVisibility(e.getEdges(),"visible"),this.setElementsVisibility(e.getCombos(),"visible"),this.isVisible=!0}),this.options.debounce),this.bindEvents()}bindEvents(){const{graph:t}=this.context;t.on(hc.BEFORE_TRANSFORM,this.hideShapes),t.on(hc.AFTER_TRANSFORM,this.showShapes)}unbindEvents(){const{graph:t}=this.context;t.off(hc.BEFORE_TRANSFORM,this.hideShapes),t.off(hc.AFTER_TRANSFORM,this.showShapes)}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),super.destroy()}}Ym.defaultOptions={enable:!0,debounce:200,shapes:t=>"node"===t};var qm=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class $m extends $h{constructor(t,e){super(t,Object.assign({},$m.defaultOptions,e)),this.onWheel=t=>qm(this,void 0,void 0,(function*(){this.options.preventDefault&&t.preventDefault();const e=t.deltaX,n=t.deltaY;yield this.scroll([-e,-n],t)})),this.shortcut=new Rd(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t,e;const{trigger:n}=this.options;if(this.shortcut.unbindAll(),(0,nn.Z)(n)){null===(t=this.graphDom)||void 0===t||t.removeEventListener(lc.WHEEL,this.onWheel);const{up:e=[],down:i=[],left:r=[],right:a=[]}=n;this.shortcut.bind(e,(t=>this.scroll([0,-10],t))),this.shortcut.bind(i,(t=>this.scroll([0,10],t))),this.shortcut.bind(r,(t=>this.scroll([-10,0],t))),this.shortcut.bind(a,(t=>this.scroll([10,0],t)))}else null===(e=this.graphDom)||void 0===e||e.addEventListener(lc.WHEEL,this.onWheel,{passive:!1})}get graphDom(){return this.context.graph.getCanvas().getContextService().getDomElement()}formatDisplacement(t){const{sensitivity:e}=this.options;return t=nd(t,e),t=this.clampByDirection(t),t=this.clampByRange(t)}clampByDirection([t,e]){const{direction:n}=this.options;return"x"===n?e=0:"y"===n&&(t=0),[t,e]}clampByRange([t,e]){const{viewport:n,canvas:i}=this.context,[r,a]=i.getSize(),[o,s,l,u]=Uc(this.options.range),c=[a*o,r*s,a*l,r*u],h=qc(Yc(n.getCanvasCenter()),c),d=ed(n.getViewportCenter(),[t,e,0]);if(!Kc(d,h)){const{min:[n,i],max:[r,a]}=h;(d[0]0||d[0]>r&&t<0)&&(t=0),(d[1]0||d[1]>a&&e<0)&&(e=0)}return[t,e]}scroll(t,e){return qm(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{onFinish:n}=this.options,i=this.context.graph,r=this.formatDisplacement(t);yield i.translateBy(r,!1),null==n||n()}))}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),null===(t=this.graphDom)||void 0===t||t.removeEventListener(lc.WHEEL,this.onWheel),super.destroy()}}$m.defaultOptions={enable:!0,sensitivity:1,preventDefault:!0,range:1/0};var Km=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class Qm extends $h{constructor(t,e){super(t,Object.assign({},Qm.defaultOptions,e)),this.zoom=(t,e,n)=>Km(this,void 0,void 0,(function*(){if(!this.validate(e))return;const{graph:i}=this.context;let r;"viewport"in e&&(r=bd(e.viewport));const{sensitivity:a,onFinish:o}=this.options,s=1+ce(t,-50,50)*a/100,l=i.getZoom();yield i.zoomTo(l*s,n,r),null==o||o()})),this.onReset=()=>Km(this,void 0,void 0,(function*(){yield this.context.graph.zoomTo(1,this.options.animation)})),this.preventDefault=t=>{this.options.preventDefault&&t.preventDefault()},this.shortcut=new Rd(t.graph),this.bindEvents()}update(t){super.update(t),this.bindEvents()}bindEvents(){var t;const{trigger:e}=this.options;if(this.shortcut.unbindAll(),Array.isArray(e)&&(null===(t=this.context.canvas.getContainer())||void 0===t||t.addEventListener(lc.WHEEL,this.preventDefault),this.shortcut.bind([...e,lc.WHEEL],(t=>{const{deltaX:e,deltaY:n}=t;this.zoom(-(null!=n?n:e),t,!1)}))),"object"==typeof e){const{zoomIn:t=[],zoomOut:n=[],reset:i=[]}=e;this.shortcut.bind(t,(t=>this.zoom(10,t,this.options.animation))),this.shortcut.bind(n,(t=>this.zoom(-10,t,this.options.animation))),this.shortcut.bind(i,this.onReset)}}validate(t){if(this.destroyed)return!1;const{enable:e}=this.options;return(0,en.Z)(e)?e(t):!!e}destroy(){var t;this.shortcut.destroy(),null===(t=this.context.canvas.getContainer())||void 0===t||t.removeEventListener(lc.WHEEL,this.preventDefault),super.destroy()}}Qm.defaultOptions={animation:{duration:200},enable:!0,sensitivity:1,trigger:[],preventDefault:!0};var Jm=n(13722),tv=n(7499),ev=n(64589),nv=n(70709),iv=n(73510),rv=n(31392),av=n(14742),ov=n(71636),sv=n(93712),lv=n(79189),uv=n(93786),cv=n(8421),hv=n(16589),dv=n(61649);function fv(t){var e,n,i,r=t||1;function a(t,a){++e>r&&(i=n,o(1),++e),n[t]=a}function o(t){e=0,n=Object.create(null),t||(i=Object.create(null))}return o(),{clear:o,has:function(t){return void 0!==n[t]||void 0!==i[t]},get:function(t){var e=n[t];return void 0!==e?e:void 0!==(e=i[t])?(a(t,e),e):void 0},set:function(t,e){void 0!==n[t]?n[t]=e:a(t,e)}}}var pv=new Map;function gv(t,e,n){void 0===n&&(n=128);return function(){for(var i=[],r=0;rsuper.update}});return Sv(this,void 0,void 0,(function*(){e.update.call(this,t),Object.assign(this.$element.style,xv(this.options,["key","type"]))}))}destroy(){super.destroy(),this.$element.remove()}}function Cv(t,e,n,i,r,a){const o=n-t,s=i-e;let l=r-t,u=a-e,c=l*o+u*s,h=0;c<=0?h=0:(l=o-l,u=s-u,c=l*o+u*s,h=c<=0?0:c*c/(o*o+s*s));const d=l*l+u*u-h;return d<0?0:d}function Av(t,e,n,i){return(t-n)*(t-n)+(e-i)*(e-i)}function Ov(t,e,n,i,r){return Av(t,e,n,i)this.y1&&e>=this.y2)return!1;if(t>this.x1&&t>=this.x2)return!1;if(tthis.x2+n)return!1}else if(tthis.x1+n)return!1;if(this.y1this.y2+n)return!1}else if(ethis.y1+n)return!1;return!0}}!function(t){t[t.POINT=1]="POINT",t[t.PARALLEL=2]="PARALLEL",t[t.COINCIDENT=3]="COINCIDENT",t[t.NONE=4]="NONE"}(wv||(wv={}));class Lv{constructor(t,e=0,n=0){this.state=t,this.x=e,this.y=n}}function Rv(t,e){const n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),r=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(r){const e=n/r,a=i/r;return 0<=e&&e<=1&&0<=a&&a<=1?new Lv(wv.POINT,t.x1+e*(t.x2-t.x1),t.y1+e*(t.y2-t.y1)):new Lv(wv.NONE)}return new Lv(0===n||0===i?wv.COINCIDENT:wv.PARALLEL)}function Dv(t,e){const n=(e.x2-e.x1)*(t.y1-e.y1)-(e.y2-e.y1)*(t.x1-e.x1),i=(t.x2-t.x1)*(t.y1-e.y1)-(t.y2-t.y1)*(t.x1-e.x1),r=(e.y2-e.y1)*(t.x2-t.x1)-(e.x2-e.x1)*(t.y2-t.y1);if(r){const t=n/r,e=i/r;if(0<=t&&t<=1&&0<=e&&e<=1)return t}return Number.POSITIVE_INFINITY}function kv(t,e,n){const i=new Set;return t.width<=0?(i.add(Tv.LEFT),i.add(Tv.RIGHT)):et.x+t.width&&i.add(Tv.RIGHT),t.height<=0?(i.add(Tv.TOP),i.add(Tv.BOTTOM)):nt.y+t.height&&i.add(Tv.BOTTOM),i}function Iv(t,e){let n=e.x1,i=e.y1;const r=e.x2,a=e.y2,o=Array.from(kv(t,r,a));if(0===o.length)return!0;let s=kv(t,n,i);for(;0!==s.size;){for(const t of o)if(s.has(t))return!1;if(s.has(Tv.RIGHT)||s.has(Tv.LEFT)){let e=t.x;s.has(Tv.RIGHT)&&(e+=t.width),i+=(e-n)*(a-i)/(r-n),n=e}else{let e=t.y;s.has(Tv.BOTTOM)&&(e+=t.height),n+=(e-i)*(r-n)/(a-i),i=e}s=kv(t,n,i)}return!0}function Bv(t,e){let n=Number.POSITIVE_INFINITY,i=0;function r(t,r,a,o){let s=Dv(e,new Pv(t,r,a,o));s=Math.abs(s-.5),s>=0&&s<=1&&(i++,s1?n:(r(t.x,t.y2,t.x2,t.y2),i>1?n:(r(t.x2,t.y,t.x2,t.y2),0===i?-1:n))}function Fv(t,e){let n=0;const i=Rv(t,new Pv(e.x,e.y,e.x2,e.y));n+=i.state===wv.POINT?1:0;const r=Rv(t,new Pv(e.x,e.y,e.x,e.y2));n+=r.state===wv.POINT?1:0;const a=Rv(t,new Pv(e.x,e.y2,e.x2,e.y2));n+=a.state===wv.POINT?1:0;const o=Rv(t,new Pv(e.x2,e.y,e.x2,e.y2));return n+=o.state===wv.POINT?1:0,{top:i,left:r,bottom:a,right:o,count:n}}!function(t){t[t.LEFT=0]="LEFT",t[t.TOP=1]="TOP",t[t.RIGHT=2]="RIGHT",t[t.BOTTOM=3]="BOTTOM"}(Tv||(Tv={}));class zv{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 zv(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 zv(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),r=Math.max(this.y2,t.y+t.height);this.x=e,this.y=n,this.width=i-e,this.height=r-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),r=Math.max(this.y2,t.y);this.x=e,this.y=n,this.width=i-e,this.height=r-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)&&(t.x+t.width>this.x&&t.y+t.height>this.y&&t.x=this.width?this.width-1:t}boundY(t){return 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)),r=this.boundY(Math.ceil((t.y+t.height-this.pixelY)/this.pixelGroup));return new zv(e,n,i-e,r-n)}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),r=this.boundY(t.y-n),a=this.boundX(t.x2+n),o=this.boundY(t.y2+n);return new zv(i,r,a-i,o-r)}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||0===e)return;const n=this.width,i=t.width,r=Math.max(0,t.i),a=Math.max(0,t.j),o=Math.min(t.i+t.width,n),s=Math.min(t.j+t.height,this.height);if(!(s<=0||o<=0||r>=n||s>=this.height))for(let l=a;lMath.min(t,e)),Number.POSITIVE_INFINITY),i=this.area.reduce(((t,e)=>Math.max(t,e)),Number.NEGATIVE_INFINITY),r=t=>(t-n)/(i-n);t.scale(this.pixelGroup,this.pixelGroup);for(let e=0;ee?"black":"white",t.fillRect(n,i,1,1)}t.restore()}}}function Uv(t,e){const n=t=>({x:t.x-e,y:t.y-e,width:t.width+2*e,height:t.height+2*e});return Array.isArray(t)?t.map(n):n(t)}function Hv(t,e,n){return Vv(Object.assign(Nv(t),{distSquare:(e,n)=>Cv(t.x1,t.y1,t.x2,t.y2,e,n)}),e,n)}function Vv(t,e,n){const i=Uv(t,n),r=e.scale(i),a=e.createSub(r,i);return function(t,e,n,i){const r=n*n;for(let a=0;at.distSquare(e,n))),a}function Zv(t,e){return{x:t,y:e}}function Wv(t,e,n,i){if(0===t.length)return[];const r=function(t){if(t.length<2)return t;let e=0,n=0;return t.forEach((t=>{e+=t.cx,n+=t.cy})),e/=t.length,n/=t.length,t.map((t=>{const i=e-t.cx,r=n-t.cy;return[t,i*i+r*r]})).sort(((t,e)=>t[1]-e[1])).map((t=>t[0]))}(t);return r.map(((t,a)=>{const o=r.slice(0,a);return function(t,e,n,i,r){const a=Zv(e.cx,e.cy),o=function(t,e,n){let i=Number.POSITIVE_INFINITY;return e.reduce(((e,r)=>{const a=Av(t.x,t.y,r.cx,r.cy);if(a>i)return e;const o=new Pv(t.x,t.y,r.cx,r.cy),s=function(t,e){return t.reduce(((t,n)=>Iv(n,e)&&function(t,e){function n(t,n,i,r){let a=Dv(e,new Pv(t,n,i,r));return a=Math.abs(a-.5),a>=0&&a<=1?1:0}let i=n(t.x,t.y,t.x2,t.y);return i+=n(t.x,t.y,t.x,t.y2),i>1||(i+=n(t.x,t.y2,t.x2,t.y2),i>1||(i+=n(t.x2,t.y,t.x2,t.y2),i>0))}(n,e)?t+1:t),0)}(n,o);return a*(s+1)*(s+1)0;){const t=a.pop(),n=qv(e,t),s=n?Fv(t,n):null;if(!n||!s||2!==s.count){o||r.push(t);continue}let l=i,u=$v(n,l,s,!0),c=Yv(u,a)||Yv(u,r),h=Xv(u,e);for(;!c&&h&&l>=1;)l/=1.5,u=$v(n,l,s,!0),c=Yv(u,a)||Yv(u,r),h=Xv(u,e);if(!u||c||h||(a.push(new Pv(t.x1,t.y1,u.x,u.y)),a.push(new Pv(u.x,u.y,t.x2,t.y2)),o=!0),o)continue;l=i,u=$v(n,l,s,!1);let d=Yv(u,a)||Yv(u,r);for(h=Xv(u,e);!d&&h&&l>=1;)l/=1.5,u=$v(n,l,s,!1),d=Yv(u,a)||Yv(u,r),h=Xv(u,e);u&&!d&&(a.push(new Pv(t.x1,t.y1,u.x,u.y)),a.push(new Pv(u.x,u.y,t.x2,t.y2)),o=!0),o||r.push(t)}for(;a.length>0;)r.push(a.pop());return r}(new Pv(a.x,a.y,o.cx,o.cy),t,i,r);return function(t,e){const n=[];for(;t.length>0;){const i=t.pop();if(0===t.length){n.push(i);break}const r=t.pop(),a=new Pv(i.x1,i.y1,r.x2,r.y2);qv(e,a)?(n.push(i),t.push(r)):t.push(a)}return n}(s,t)}(e,t,o,n,i)})).flat()}function Xv(t,e){return e.some((e=>e.containsPt(t.x,t.y)))}function Yv(t,e){return e.some((e=>!!Ov(e.x1,e.y1,t.x,t.y,.001)||!!Ov(e.x2,e.y2,t.x,t.y,.001)))}function qv(t,e){let n=Number.POSITIVE_INFINITY,i=null;for(const r of t){if(!Iv(r,e))continue;const t=Bv(r,e);t>=0&&ts.y?Zv(t.x-e,t.y-e):Zv(t.x2+e,t.y-e):a.yo.x?Zv(t.x-e,t.y-e):Zv(t.x-e,t.y2+e):r.xs.y?Zv(t.x2+e,t.y2+e):Zv(t.x-e,t.y2+e):a.yo.x?Zv(t.x2+e,t.y2+e):Zv(t.x2+e,t.y-e):r.xi)return!1}return!0}function Qv(t,e){switch(t){case-2:return(((3-e)*e-3)*e+1)/6;case-1:return((3*e-6)*e*e+4)/6;case 0:return(((-3*e+3)*e+3)*e+1)/6;case 1:return e*e*e/6;default:throw new Error("unknown error")}}class Jv{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(0===e.length)return"";const n="function"==typeof t?t:function(t){if(!Number.isFinite(t))return t=>t;if(0===t)return Math.round;const e=Math.pow(10,t);return t=>Math.round(t*e)/e}(t);let i="M";for(const t of e)i+=`${n(t.x)},${n(t.y)} L`;return i=i.slice(0,-1),this.closed&&(i+=" Z"),i}draw(t){const e=this.points;if(0!==e.length){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 function(t=8){return e=>{let n=t,i=e.length;if(n>1)for(i=Math.floor(e.length/n);i<3&&n>1;)n-=1,i=Math.floor(e.length/n);const r=[];for(let t=0,a=0;a{if(t<0||e.length<3)return e;const n=[];let i=0;const r=t*t;for(;i{if(n.length<3)return n;const i=[],r=n.closed,a=n.length+3-1+(r?0:2);i.push(e(n,2-(r?0:2),0));for(let o=2-(r?0:2);oe.containsPt(t.cx,t.cy)&&this.withinArea(t.cx,t.cy)))}withinArea(t,e){if(0===this.length)return!1;let n=0;const i=this.points[0],r=new Pv(i.x,i.y,i.x,i.y);for(let i=1;ie?r+a:r}function a(t,e){let n=0;return n=r(t,e,n,1),n=r(t+1,e,n,2),n=r(t,e+1,n,4),n=r(t+1,e+1,n,8),Number.isNaN(n)?-1:n}let o=1;function s(e,n){let r=e,s=n,l=t.invertScaleX(r),u=t.invertScaleY(s);for(let e=0;ery(e.raw,t)));return!(e<0)&&(this.members.splice(e,1),this.dirty.add(ay.MEMBERS),!0)}removeNonMember(t){const e=this.nonMembers.findIndex((e=>ry(e.raw,t)));return!(e<0)&&(this.nonMembers.splice(e,1),this.dirty.add(ay.NON_MEMBERS),!0)}removeEdge(t){const e=this.edges.findIndex((e=>e.obj.equals(t)));return!(e<0)&&(this.edges.splice(e,1),this.dirty.add(ay.NON_MEMBERS),!0)}pushNonMember(...t){if(0!==t.length){this.dirty.add(ay.NON_MEMBERS);for(const e of t)this.nonMembers.push({raw:e,obj:iy(e)?Gv.from(e):zv.from(e),area:null})}}pushEdge(...t){if(0!==t.length){this.dirty.add(ay.EDGES);for(const e of t)this.edges.push({raw:e,obj:Pv.from(e),area:null})}}update(){const t=this.dirty.has(ay.MEMBERS),e=this.dirty.has(ay.NON_MEMBERS);let n=this.dirty.has(ay.EDGES);this.dirty.clear();const i=this.members.map((t=>t.obj));if(this.o.virtualEdges&&(t||e)){const t=Wv(i,this.nonMembers.map((t=>t.obj)),this.o.maxRoutingIterations,this.o.morphBuffer),e=new Map(this.virtualEdges.map((t=>[t.obj.toString(),t.area])));this.virtualEdges=t.map((t=>{var n;return{raw:t,obj:t,area:null!==(n=e.get(t.toString()))&&void 0!==n?n:null}})),n=!0}let r=!1;if(t||n){const t=function(t,e){if(0===t.length)return new zv(0,0,0,0);const n=zv.from(t[0]);for(const e of t)n.add(e);for(const t of e)n.add(Nv(t));return n}(i,this.virtualEdges.concat(this.edges).map((t=>t.obj))),e=Math.max(this.o.edgeR1,this.o.nodeR1)+this.o.morphBuffer,n=zv.from(Uv(t,e));n.equals(this.activeRegion)||(r=!0,this.activeRegion=n)}if(r){const t=Math.ceil(this.activeRegion.width/this.o.pixelGroup),e=Math.ceil(this.activeRegion.height/this.o.pixelGroup);this.activeRegion.x!==this.potentialArea.pixelX||this.activeRegion.y!==this.potentialArea.pixelY?(this.potentialArea=jv.fromPixelRegion(this.activeRegion,this.o.pixelGroup),this.members.forEach((t=>t.area=null)),this.nonMembers.forEach((t=>t.area=null)),this.edges.forEach((t=>t.area=null)),this.virtualEdges.forEach((t=>t.area=null))):t===this.potentialArea.width&&e===this.potentialArea.height||(this.potentialArea=jv.fromPixelRegion(this.activeRegion,this.o.pixelGroup))}const a=new Map,o=t=>{if(t.area){const e=`${t.obj.width}x${t.obj.height}x${t.obj instanceof zv?"R":"C"}`;a.set(e,t.area)}},s=t=>{if(t.area)return;const e=`${t.obj.width}x${t.obj.height}x${t.obj instanceof zv?"R":"C"}`;if(a.has(e)){const n=a.get(e);return void(t.area=this.potentialArea.copy(n,{x:t.obj.x-this.o.nodeR1,y:t.obj.y-this.o.nodeR1}))}const n=t.obj instanceof zv?function(t,e,n){const i=e.scale(t),r=e.addPadding(i,n),a=e.createSub(r,{x:t.x-n,y:t.y-n}),o=i.x-r.x,s=i.y-r.y,l=r.x2-i.x2,u=r.y2-i.y2,c=r.width-o-l,h=r.height-s-u,d=n*n;a.fillArea({x:o,y:s,width:c+1,height:h+1},d);const f=[0],p=Math.max(s,o,l,u);{const r=e.invertScaleX(i.x+i.width/2);for(let a=1;a{this.activeRegion.intersects(t.obj)?s(t):t.area=null})),this.edges.forEach((t=>{t.area||(t.area=Hv(t.obj,this.potentialArea,this.o.edgeR1))})),this.virtualEdges.forEach((t=>{t.area||(t.area=Hv(t.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(0===this.members.length)return new Jv([]);this.dirty.size>0&&this.update();const{o:t,potentialArea:e}=this,n=this.members.map((t=>t.area)),i=this.virtualEdges.concat(this.edges).map((t=>t.area)),r=this.nonMembers.filter((t=>null!=t.area)).map((t=>t.area)),a=this.members.map((t=>t.obj));return function(t,e,n,i,r,a={}){const o=Object.assign({},ny,a);let s=o.threshold,l=o.memberInfluenceFactor,u=o.edgeInfluenceFactor,c=o.nonMemberInfluenceFactor;const h=(o.nodeR0-o.nodeR1)*(o.nodeR0-o.nodeR1),d=(o.edgeR0-o.edgeR1)*(o.edgeR0-o.edgeR1);for(let a=0;a0))break;c*=.8}}return new Jv([])}(e,n,i,r,(t=>t.containsElements(a)),t)}}var sy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{const{style:t,bubbleSetOptions:e}=this.parseOptions();ec(this.bubbleSetOptions,e)||this.init(),this.bubbleSetOptions=Object.assign({},e);const n=Object.assign(Object.assign({},t),{d:this.getPath()});this.shape?this.shape.update(n):(this.shape=new Cf({style:n}),this.context.canvas.appendChild(this.shape))},this.updateBubbleSetsPath=t=>{if(!this.shape)return;const e=Dh(t.data);[...this.options.members,...this.options.avoidMembers].includes(e)&&this.shape.update(Object.assign(Object.assign({},this.parseOptions().style),{d:this.getPath(e)}))},this.getPath=t=>{const{graph:e}=this.context,n=this.options.members,i=[...this.members.keys()],r=this.options.avoidMembers,a=[...this.avoidMembers.keys()];if(!t&&ec(n,i)&&ec(r,a))return this.path;const{enter:o=[],exit:s=[]}=Zh(i,n,(t=>t)),{enter:l=[],exit:u=[]}=Zh(a,r,(t=>t));t&&(s.push(t),o.push(t));const c=(t,n,i)=>{t.forEach((t=>{const r=i?this.members:this.avoidMembers,a=i?"pushMember":"pushNonMember",o=i?"removeMember":"removeNonMember";if(n){let n;"edge"===e.getElementType(t)?([n]=cy(e,t),this.bubbleSets.pushEdge(n)):([n]=uy(e,t),this.bubbleSets[a](n)),r.set(t,n)}else{const n=r.get(t);n&&("edge"===e.getElementType(t)?this.bubbleSets.removeEdge(n):this.bubbleSets[o](n),r.delete(t))}}))};c(s,!1,!0),c(o,!0,!0),c(u,!1,!1),c(l,!0,!1);const h=this.bubbleSets.compute().sample(8).simplify(0).bSplines().simplify(0);return this.path=Sf(h.points.map(bd)),this.path},this.bindEvents(),this.bubbleSets=new oy(this.options)}bindEvents(){this.context.graph.on(hc.AFTER_RENDER,this.drawBubbleSets),this.context.graph.on(hc.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath)}init(){this.bubbleSets=new oy(this.options),this.members=new Map,this.avoidMembers=new Map}parseOptions(){const t=this.options,{type:e,key:n,members:i,avoidMembers:r}=t,a=sy(t,["type","key","members","avoidMembers"]),o=Object.keys(a).reduce(((t,e)=>(e in ny?t.bubbleSetOptions[e]=a[e]:t.style[e]=a[e],t)),{style:{},bubbleSetOptions:{}});return Object.assign({type:e,key:n,members:i,avoidMembers:r},o)}addMember(t){const e=Array.isArray(t)?t:[t];e.some((t=>this.options.avoidMembers.includes(t)))&&(this.options.avoidMembers=this.options.avoidMembers.filter((t=>!e.includes(t)))),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((t=>!e.includes(t))),this.drawBubbleSets()}updateMember(t){this.options.members=(0,en.Z)(t)?t(this.options.members):t,this.drawBubbleSets()}getMember(){return this.options.members}addAvoidMember(t){const e=Array.isArray(t)?t:[t];e.some((t=>this.options.members.includes(t)))&&(this.options.members=this.options.members.filter((t=>!e.includes(t)))),this.options.avoidMembers=[...new Set([...this.options.avoidMembers,...e])],this.drawBubbleSets()}removeAvoidMember(t){const e=Array.isArray(t)?t:[t];this.options.avoidMembers.some((t=>e.includes(t)))&&(this.options.avoidMembers=this.options.avoidMembers.filter((t=>!e.includes(t))),this.drawBubbleSets())}updateAvoidMember(t){this.options.avoidMembers=Array.isArray(t)?t:[t],this.drawBubbleSets()}getAvoidMember(){return this.options.avoidMembers}destroy(){this.context.graph.off(hc.AFTER_RENDER,this.drawBubbleSets),this.context.graph.off(hc.AFTER_ELEMENT_UPDATE,this.updateBubbleSetsPath),this.shape.destroy(),super.destroy()}}ly.defaultOptions=Object.assign({members:[],avoidMembers:[],fill:"lightblue",fillOpacity:.2,stroke:"blue",strokeOpacity:.2},ny);const uy=(t,e)=>(Array.isArray(e)?e:[e]).map((e=>{const n=t.getElementRenderBounds(e);return new zv(n.min[0],n.min[1],Vc(n),Zc(n))})),cy=(t,e)=>(Array.isArray(e)?e:[e]).map((e=>{const n=t.getEdgeData(e),i=t.getElementPosition(n.source),r=t.getElementPosition(n.target);return Pv.from({x1:i[0],y1:i[1],x2:r[0],y2:r[1]})}));var hy=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class dy extends bv{constructor(t,e){super(t,Object.assign({},dy.defaultOptions,e)),this.targetElement=null,this.onTriggerEvent=t=>{var e;null===(e=t.preventDefault)||void 0===e||e.call(t),this.show(t)},this.onMenuItemClick=t=>{const{onClick:e,trigger:n}=this.options;if(t.target instanceof HTMLElement&&t.target.className.includes("g6-contextmenu-li")){const n=t.target.getAttribute("value");null==e||e(n,t.target,this.targetElement),this.hide()}"click"!==n&&this.hide()},this.initElement(),this.update(e)}initElement(){this.$element=_v("contextmenu",!1,{zIndex:"99"});const{className:t}=this.options;t&&this.$element.classList.add(t);this.context.canvas.getContainer().appendChild(this.$element),Ev("g6-contextmenu-css","style",{},"\n .g6-contextmenu {\n font-size: 12px;\n background-color: rgba(255, 255, 255, 0.96);\n border-radius: 4px;\n overflow: hidden;\n box-shadow: rgba(0, 0, 0, 0.12) 0px 6px 12px 0px;\n 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;\n }\n\n .g6-contextmenu-ul {\n max-width: 256px;\n min-width: 96px;\n list-style: none;\n padding: 0;\n margin: 0;\n }\n\n .g6-contextmenu-li {\n padding: 8px 12px;\n cursor: pointer;\n user-select: none;\n }\n\n .g6-contextmenu-li:hover {\n background-color: #f5f5f5;\n cursor: pointer;\n }\n",document.head)}show(t){return hy(this,void 0,void 0,(function*(){const{enable:e,offset:n}=this.options;if("function"==typeof e&&!e(t)||!e)return void this.hide();const i=yield this.getDOMContent(t);i instanceof HTMLElement?(this.$element.innerHTML="",this.$element.appendChild(i)):this.$element.innerHTML=i;const r=this.context.graph.getCanvas().getContainer().getBoundingClientRect();this.$element.style.left=`${t.client.x-r.left+n[0]}px`,this.$element.style.top=`${t.client.y-r.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 hy(this,void 0,void 0,(function*(){const{getContent:e,getItems:n}=this.options;return n?`\n
    \n ${(yield n(t)).map((t=>`
  • ${t.name}
  • `)).join("")}\n
\n `: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)}}dy.defaultOptions={trigger:"contextmenu",offset:[4,4],loadingContent:'
Loading...
',getContent:()=>"It is a empty context menu.",enable:()=>!0};class fy extends bv{constructor(t,e){super(t,Object.assign({},fy.defaultOptions,e)),this.edgeBundles={},this.edgePoints={},this.onBundle=()=>{const{model:t,element:e}=this.context,n=t.getEdgeData();this.divideEdges(this.options.divisions);const{cycles:i,iterRate:r,divRate:a}=this.options;let{lambda:o,divisions:s,iterations:l}=this.options;for(let t=0;t{var n;if(e.source===e.target)return;const i=Dh(e);t[i]=this.getEdgeForces(e,s,o);for(let e=0;e{const n=Dh(t),i=e.getElement(n);null==i||i.update({d:Pg(this.edgePoints[n])})}))},this.bindEvents()}get nodeMap(){const t=this.context.model.getNodeData();return Object.fromEntries(t.map((t=>[Dh(t),cd(md(t))])))}divideEdges(t){this.context.model.getEdgeData().forEach((e=>{var n;const i=Dh(e);(n=this.edgePoints)[i]||(n[i]=[]);const r=this.nodeMap[e.source],a=this.nodeMap[e.target];if(1===t)this.edgePoints[i].push(r),this.edgePoints[i].push(id(td(r,a),2)),this.edgePoints[i].push(a);else{const e=(0===this.edgePoints[i].length?ad(r,a):by(this.edgePoints[i]))/(t+1);let n=e;const o=[r];for(let t=1;tn;){const t=n/s,i=td(r,nd(ed(a,r),t));o.push(i),s-=n,n=e}n-=s}o.push(a),this.edgePoints[i]=o}}))}getVectorPosition(t){const e=this.nodeMap[t.source],n=this.nodeMap[t.target],[i,r]=ed(n,e);return{source:e,target:n,vx:i,vy:r,length:ad(e,n)}}measureEdgeCompatibility(t,e){const n=this.getVectorPosition(t),i=this.getVectorPosition(e);return py(n,i)*gy(n,i)*my(n,i)*xy(n,i)}getEdgeBundles(){const t={},e=this.options.bundleThreshold,n=this.context.model.getEdgeData();return n.forEach(((i,r)=>{n.forEach(((n,a)=>{var o,s;if(a<=r)return;this.measureEdgeCompatibility(i,n)>=e&&(t[o=Dh(i)]||(t[o]=[]),t[Dh(i)].push(n),t[s=Dh(n)]||(t[s]=[]),t[Dh(n)].push(i))}))})),t}getSpringForce(t,e){const{pre:n,cur:i,next:r}=t;return nd(ed(td(n,r),nd(i,2)),e)}getElectrostaticForce(t,e){vf(this.edgeBundles)&&(this.edgeBundles=this.getEdgeBundles());const n=this.edgeBundles[Dh(e)];let i=[0,0];return null==n||n.forEach((n=>{const r=this.edgePoints[Dh(n)][t],a=this.edgePoints[Dh(e)][t],o=ed(r,a),s=ad(r,a);i=td(i,nd(o,1/s))})),i}getEdgeForces(t,e,n){const i=this.nodeMap[t.source],r=this.nodeMap[t.target],a=this.options.K/(ad(i,r)*(e+1)),o=[[0,0]],s=Dh(t);for(let i=1;i{return Math.abs((n=[t.vx,t.vy],i=[e.vx,e.vy],n.reduce(((t,e,n)=>t+e*i[n]),0)/(t.length*e.length)));var n,i},gy=(t,e)=>{const n=(t.length+e.length)/2;return 2/(n/Math.min(t.length,e.length)+Math.max(t.length,e.length)/n)},my=(t,e)=>{const n=(t.length+e.length)/2;return n/(n+ad(id(td(t.source,t.target),2),id(td(e.source,e.target),2)))},vy=(t,e)=>{if(e.source[0]===e.target[0])return[e.source[0],t[1]];if(e.source[1]===e.target[1])return[t[0],e.source[1]];const n=(e.source[1]-e.target[1])/(e.source[0]-e.target[0]),i=(n*n*e.source[0]+n*(t[1]-e.source[1])+t[0])/(n*n+1);return[i,n*(i-e.source[0])+e.source[1]]},yy=(t,e)=>{const n=vy(e.source,t),i=vy(e.target,t),r=id(td(n,i),2),a=id(td(t.source,t.target),2);return 0===ad(n,i)?0:Math.max(0,1-2*ad(a,r)/ad(n,i))},xy=(t,e)=>Math.min(yy(t,e),yy(e,t)),by=t=>{let e=0;for(let n=1;n{if("drag"===this.options.trigger&&this.isLensOn)return;const e=bd(t.canvas);this.renderLens(e),this.renderFocusElements()},this.renderLens=t=>{const e=Object.assign({},_y,this.options.style);this.isLensOn||(this.lens=new Bf({style:e}),this.canvas.appendChild(this.lens)),Object.assign(e,_d(t),{size:2*this.r}),this.lens.update(e)},this.getFilterData=()=>{const{filter:t}=this.options,{model:e}=this.context,n=e.getData();if(!t)return n;const{nodes:i,edges:r,combos:a}=n;return{nodes:i.filter((e=>t(Dh(e),"node"))),edges:r.filter((e=>t(Dh(e),"edge"))),combos:a.filter((e=>t(Dh(e),"combo")))}},this.getFocusElements=t=>{const{nodes:e,edges:n}=this.getFilterData(),i=e.filter((e=>ad(md(e),t)Dh(t)));return{nodes:i,edges:n.filter((t=>{const{source:e,target:n}=t,i=r.includes(e),a=r.includes(n);switch(this.options.nodeType){case"both":return i&&a;case"either":return i!==a;case"source":return i&&!a;case"target":return!i&&a;default:return!1}}))}},this.renderFocusElements=()=>{const{element:t,graph:e}=this.context;if(!this.isLensOn)return;const n=this.lens.getCenter(),{nodes:i,edges:r}=this.getFocusElements(n),a=new Set,o=n=>{const i=Dh(n);a.add(i);const r=t.getElement(i);if(!r)return;const o=this.shapes.get(i)||r.cloneNode();o.setPosition(r.getPosition()),o.id=r.id,this.shapes.has(i)?Object.entries(r.attributes).forEach((([t,e])=>{o.style[t]!==e&&(o.style[t]=e)})):(this.canvas.appendChild(o),this.shapes.set(i,o));const s=e.getElementType(i),l=this.getElementStyle(s,n);o.update(l)};i.forEach(o),r.forEach(o),this.shapes.forEach(((t,e)=>{a.has(e)||(t.destroy(),this.shapes.delete(e))}))},this.scaleRByWheel=t=>{var e;this.options.preventDefault&&t.preventDefault();const{clientX:n,clientY:i,deltaX:r,deltaY:a}=t,{graph:o,canvas:s}=this.context,l=o.getCanvasByClient([n,i]),u=null===(e=this.lens)||void 0===e?void 0:e.getCenter();if(!this.isLensOn||ad(l,u)>this.r)return;const{maxR:c,minR:h}=this.options,d=r+a>0?1/.95:.95,f=Math.min(...s.getSize())/2;this.r=Math.max(h||0,Math.min(c||f,this.r*d)),this.renderLens(u),this.renderFocusElements()},this.isLensDragging=!1,this.onDragStart=t=>{var e;const n=bd(t.canvas),i=null===(e=this.lens)||void 0===e?void 0:e.getCenter();!this.isLensOn||ad(n,i)>this.r||(this.isLensDragging=!0)},this.onDrag=t=>{if(!this.isLensDragging)return;const e=bd(t.canvas);this.renderLens(e),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="node"===t?this.options.nodeStyle:this.options.edgeStyle;return"function"==typeof n?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,r=e.getCanvas().getLayer();["click","drag"].includes(n)&&r.addEventListener(lc.CLICK,this.onEdgeFilter),"pointermove"===n?r.addEventListener(lc.POINTER_MOVE,this.onEdgeFilter):"drag"===n&&(r.addEventListener(lc.DRAG_START,this.onDragStart),r.addEventListener(lc.DRAG,this.onDrag),r.addEventListener(lc.DRAG_END,this.onDragEnd)),"wheel"===i&&(null===(t=this.graphDom)||void 0===t||t.addEventListener(lc.WHEEL,this.scaleRByWheel,{passive:!1}))}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i}=this.options,r=e.getCanvas().getLayer();["click","drag"].includes(n)&&r.removeEventListener(lc.CLICK,this.onEdgeFilter),"pointermove"===n?r.removeEventListener(lc.POINTER_MOVE,this.onEdgeFilter):"drag"===n&&(r.removeEventListener(lc.DRAG_START,this.onDragStart),r.removeEventListener(lc.DRAG,this.onDrag),r.removeEventListener(lc.DRAG_END,this.onDragEnd)),"wheel"===i&&(null===(t=this.graphDom)||void 0===t||t.removeEventListener(lc.WHEEL,this.scaleRByWheel))}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){this.unbindEvents(),this.isLensOn&&this.lens.destroy(),this.shapes.forEach(((t,e)=>{t.destroy(),this.shapes.delete(e)})),super.destroy()}}Ey.defaultOptions={trigger:"pointermove",r:60,nodeType:"both",filter:()=>!0,style:{lineWidth:2},nodeStyle:{label:!1},edgeStyle:{label:!0},scaleRBy:"wheel",preventDefault:!0};const wy={fill:"#ccc",fillOpacity:.1,lineWidth:2,stroke:"#000",strokeOpacity:.8,labelFontSize:12};class Ty extends bv{constructor(t,e){super(t,Object.assign({},Ty.defaultOptions,e)),this.r=this.options.r,this.d=this.options.d,this.onCreateFisheye=t=>{if("drag"===this.options.trigger&&this.isLensOn)return;const e=bd(t.canvas);this.onMagnify(e)},this.onMagnify=t=>{t.some(isNaN)||(this.renderLens(t),this.renderFocusElements())},this.renderLens=t=>{const e=Object.assign({},wy,this.options.style);this.isLensOn||(this.lens=new Bf({style:e}),this.canvas.appendChild(this.lens)),Object.assign(e,_d(t),{size:2*this.r,label:this.options.showDPercent,labelText:this.getDPercent()}),this.lens.update(e)},this.getDPercent=()=>{const{minD:t,maxD:e}=this.options;return`${Math.round((this.d-t)/(e-t)*100)}%`},this.prevMagnifiedStyleMap=new Map,this.prevOriginStyleMap=new Map,this.renderFocusElements=()=>{if(!this.isLensOn)return;const{graph:t}=this.context,e=this.lens.getCenter(),n=(this.d+1)*this.r,i=new Map,r=new Map;t.getNodeData().forEach((a=>{const o=md(a),s=ad(o,e);if(s>this.r)return;const l=n*s/(this.d*s+this.r),[u,c]=o,[h,d]=e,f=[h+l*((u-h)/s),d+l*((c-d)/s)],p=Dh(a),g=this.getNodeStyle(a),m=(0,rg.Z)(t.getElementRenderStyle(p),Object.keys(g));i.set(p,Object.assign(Object.assign({},_d(f)),g)),r.set(p,Object.assign(Object.assign({},_d(o)),m))})),this.updateStyle(i,r)},this.getNodeStyle=t=>{const{nodeStyle:e}=this.options;return"function"==typeof e?e(t):e},this.updateStyle=(t,e)=>{const{graph:n,element:i}=this.context,{enter:r,exit:a,keep:o}=Zh(Array.from(this.prevMagnifiedStyleMap.keys()),Array.from(t.keys()),(t=>t)),s=new Set,l=(t,e)=>{const r=i.getElement(t);null==r||r.update(e),n.getRelatedEdgesData(t).forEach((t=>{s.add(Dh(t))}))};[...r,...o].forEach((e=>{l(e,t.get(e))})),a.forEach((t=>{l(t,this.prevOriginStyleMap.get(t)),this.prevOriginStyleMap.delete(t)})),s.forEach((t=>{const e=i.getElement(t);null==e||e.update({})})),this.prevMagnifiedStyleMap=t,e.forEach(((t,e)=>{this.prevOriginStyleMap.has(e)||this.prevOriginStyleMap.set(e,t)}))},this.isWheelValid=t=>{if(this.options.preventDefault&&t.preventDefault(),!this.isLensOn)return!1;const{clientX:e,clientY:n}=t;return!(ad(this.context.graph.getCanvasByClient([e,n]),this.lens.getCenter())>this.r)},this.scaleR=t=>{const{maxR:e,minR:n}=this.options,i=t?1/.95:.95,r=Math.min(...this.context.canvas.getSize())/2;this.r=Math.max(n||0,Math.min(e||r,this.r*i))},this.scaleD=t=>{const{maxD:e,minD:n}=this.options,i=t?this.d+.1:this.d-.1;this.d=Math.max(n,Math.min(e,i))},this.scaleRByWheel=t=>{if(!this.isWheelValid(t))return;const{deltaX:e,deltaY:n}=t;this.scaleR(e+n>0);const i=this.lens.getCenter();this.onMagnify(i)},this.scaleDByWheel=t=>{if(!this.isWheelValid(t))return;const{deltaX:e,deltaY:n}=t;this.scaleD(e+n>0);const i=this.lens.getCenter();this.onMagnify(i)},this.isDragValid=t=>{if(this.options.preventDefault&&t.preventDefault(),!this.isLensOn)return!1;return!(ad(bd(t.canvas),this.lens.getCenter())>this.r)},this.isLensDragging=!1,this.onDragStart=t=>{this.isDragValid(t)&&(this.isLensDragging=!0)},this.onDrag=t=>{if(!this.isLensDragging)return;const e=bd(t.canvas);this.onMagnify(e)},this.onDragEnd=()=>{this.isLensDragging=!1},this.scaleRByDrag=t=>{if(!this.isLensDragging)return;const{dx:e,dy:n}=t;this.scaleR(e-n>0);const i=this.lens.getCenter();this.onMagnify(i)},this.scaleDByDrag=t=>{if(!this.isLensDragging)return;const{dx:e,dy:n}=t;this.scaleD(e-n>0);const i=this.lens.getCenter();this.onMagnify(i)},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:r}=this.options,a=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&a.addEventListener(lc.CLICK,this.onCreateFisheye),"pointermove"===n&&a.addEventListener(lc.POINTER_MOVE,this.onCreateFisheye),"drag"===n||"drag"===i||"drag"===r){a.addEventListener(lc.DRAG_START,this.onDragStart),a.addEventListener(lc.DRAG_END,this.onDragEnd);const t="drag"===n?this.onDrag:"drag"===i?this.scaleRByDrag:this.scaleDByDrag;a.addEventListener(lc.DRAG,t)}if("wheel"===i||"wheel"===r){const e="wheel"===i?this.scaleRByWheel:this.scaleDByWheel;null===(t=this.graphDom)||void 0===t||t.addEventListener(lc.WHEEL,e,{passive:!1})}}unbindEvents(){var t;const{graph:e}=this.context,{trigger:n,scaleRBy:i,scaleDBy:r}=this.options,a=e.getCanvas().getLayer();if(["click","drag"].includes(n)&&a.removeEventListener(lc.CLICK,this.onCreateFisheye),"pointermove"===n&&a.removeEventListener(lc.POINTER_MOVE,this.onCreateFisheye),"drag"===n||"drag"===i||"drag"===r){a.removeEventListener(lc.DRAG_START,this.onDragStart),a.removeEventListener(lc.DRAG_END,this.onDragEnd);const t="drag"===n?this.onDrag:"drag"===i?this.scaleRByDrag:this.scaleDByDrag;a.removeEventListener(lc.DRAG,t)}if("wheel"===i||"wheel"===r){const e="wheel"===i?this.scaleRByWheel:this.scaleDByWheel;null===(t=this.graphDom)||void 0===t||t.removeEventListener(lc.WHEEL,e)}}update(t){this.unbindEvents(),super.update(t),this.bindEvents()}destroy(){var t;this.unbindEvents(),this.isLensOn&&(null===(t=this.lens)||void 0===t||t.destroy()),this.prevMagnifiedStyleMap.clear(),this.prevOriginStyleMap.clear(),super.destroy()}}Ty.defaultOptions={trigger:"pointermove",r:120,d:1.5,maxD:5,minD:0,showDPercent:!0,style:{},nodeStyle:{label:!0},preventDefault:!0};class Sy extends bv{constructor(t,e){super(t,Object.assign({},Sy.defaultOptions,e)),this.$el=this.context.canvas.getContainer(),this.graphSize=[0,0],this.onFullscreenChange=()=>{var t,e,n,i;const r=!!document.fullscreenElement;this.options.autoFit&&this.setGraphSize(r),r?null===(e=(t=this.options).onEnter)||void 0===e||e.call(t):null===(i=(n=this.options).onExit)||void 0===i||i.call(n)},this.shortcut=new Rd(t.graph),this.bindEvents(),this.style=document.createElement("style"),document.head.appendChild(this.style),this.style.innerHTML="\n :not(:root):fullscreen::backdrop {\n background: transparent;\n }\n "}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((t=>{document.addEventListener(t,this.onFullscreenChange,!1)}))}unbindEvents(){this.shortcut.unbindAll();["webkitfullscreenchange","mozfullscreenchange","fullscreenchange","MSFullscreenChange"].forEach((t=>{document.removeEventListener(t,this.onFullscreenChange,!1)}))}setGraphSize(t=!0){var e,n;let i,r;t?(i=(null===(e=globalThis.screen)||void 0===e?void 0:e.width)||0,r=(null===(n=globalThis.screen)||void 0===n?void 0:n.height)||0,this.graphSize=this.context.graph.getSize()):[i,r]=this.graphSize,this.context.graph.setSize(i,r),this.context.graph.render()}request(){!document.fullscreenElement&&(document.fullscreenEnabled||Reflect.get(document,"webkitFullscreenEnabled")||Reflect.get(document,"mozFullscreenEnabled")||Reflect.get(document,"msFullscreenEnabled"))&&this.$el.requestFullscreen().catch((t=>{bc.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()}}Sy.defaultOptions={trigger:{},autoFit:!0};class My extends bv{constructor(t,e){super(t,Object.assign({},My.defaultOptions,e)),this.$element=_v("grid-line",!0),this.offset=[0,0],this.onTransform=t=>{if(!this.options.follow)return;const{data:{translate:e}}=t;e&&this.updateOffset(e)};this.context.canvas.getContainer().prepend(this.$element),this.updateStyle(),this.bindEvents()}update(t){super.update(t),this.updateStyle()}bindEvents(){const{graph:t}=this.context;t.on(hc.AFTER_TRANSFORM,this.onTransform)}updateStyle(){const{size:t,stroke:e,lineWidth:n,border:i,borderLineWidth:r,borderStroke:a,borderStyle:o}=this.options;Object.assign(this.$element.style,{border:i?`${r}px ${o} ${a}`:"none",backgroundImage:`linear-gradient(${e} ${n}px, transparent ${n}px), linear-gradient(90deg, ${e} ${n}px, transparent ${n}px)`,backgroundSize:`${t}px ${t}px`})}updateOffset(t){var e,n;this.offset=(e=td(this.offset,t),n=this.options.size,e.map((t=>t%n))),this.$element.style.backgroundPosition=`${this.offset[0]}px ${this.offset[1]}px`}destroy(){this.context.graph.off(hc.AFTER_TRANSFORM,this.onTransform),this.$element.remove(),super.destroy()}}My.defaultOptions={border:!0,borderLineWidth:1,borderStroke:"#eee",borderStyle:"solid",lineWidth:1,size:20,stroke:"#eee"};var Cy=n(49336);function Ay(t){const e={Added:new Map,Updated:new Map,Removed:new Map};return t.forEach((t=>{const{type:n,value:i}=t,r=Dh(i);if("NodeAdded"===n||"EdgeAdded"===n||"ComboAdded"===n)e.Added.set(r,t);else if("NodeUpdated"===n||"EdgeUpdated"===n||"ComboUpdated"===n)if(e.Added.has(r))e.Added.set(r,{type:n.replace("Updated","Added"),value:i});else if(e.Updated.has(r)){const{original:t}=e.Updated.get(r);e.Updated.set(r,{type:n,value:i,original:t})}else e.Removed.has(r)||e.Updated.set(r,t);else"NodeRemoved"!==n&&"EdgeRemoved"!==n&&"ComboRemoved"!==n||(e.Added.has(r)?e.Added.delete(r):e.Updated.has(r)?(e.Updated.delete(r),e.Removed.set(r,t)):e.Removed.set(r,t))})),[...Array.from(e.Added.values()),...Array.from(e.Updated.values()),...Array.from(e.Removed.values())]}function Oy(t){const{NodeAdded:e=[],NodeUpdated:n=[],NodeRemoved:i=[],EdgeAdded:r=[],EdgeUpdated:a=[],EdgeRemoved:o=[],ComboAdded:s=[],ComboUpdated:l=[],ComboRemoved:u=[]}=Bc(t,(t=>t.type));return{add:{nodes:e,edges:r,combos:s},update:{nodes:n,edges:a,combos:l},remove:{nodes:i,edges:o,combos:u}}}function Ny(t,e){for(const n in t)(0,nn.Z)(t[n])&&!Array.isArray(t[n])&&null!==t[n]?(e[n]||(e[n]={}),Ny(t[n],e[n])):void 0===e[n]&&(e[n]=Tc(n))}function Py(t,e=!1,n){const i={animation:e,current:{add:{},update:{},remove:{}},original:{add:{},update:{},remove:{}}},{add:r,update:a,remove:o}=Oy(Ay(t));return["nodes","edges","combos"].forEach((t=>{a[t]&&a[t].forEach((e=>{var r,a;const o=Object.assign({},e.value);let s=Object.assign({},e.original);if(n){const t=n.graph.getElementType(Dh(e.original)),i="edge"===t?"stroke":"fill",r=n.element.getElementComputedStyle(t,e.original);s=Object.assign(Object.assign({},e.original),{style:Object.assign({[i]:r[i]},e.original.style)})}Ny(o,s),(r=i.current.update)[t]||(r[t]=[]),i.current.update[t].push(o),(a=i.original.update)[t]||(a[t]=[]),i.original.update[t].push(s)})),r[t]&&r[t].forEach((e=>{var n,r;const a=Object.assign({},e.value);(n=i.current.add)[t]||(n[t]=[]),i.current.add[t].push(a),(r=i.original.remove)[t]||(r[t]=[]),i.original.remove[t].push(a)})),o[t]&&o[t].forEach((e=>{var n,r;const a=Object.assign({},e.value);(n=i.current.remove)[t]||(n[t]=[]),i.current.remove[t].push(a),(r=i.original.add)[t]||(r[t]=[]),i.original.add[t].push(a)}))})),i}class Ly extends bv{constructor(t,e){super(t,Object.assign({},Ly.defaultOptions,e)),this.batchChanges=null,this.batchAnimation=!1,this.undoStack=[],this.redoStack=[],this.freezed=!1,this.executeCommand=(t,e=!0)=>{var n,i,r;this.freezed=!0,null===(i=(n=this.options).executeCommand)||void 0===i||i.call(n,t);const a=e?t.original:t.current;this.context.graph.addData(a.add),this.context.graph.updateData(a.update),this.context.graph.removeData(Ih(a.remove,!1)),null===(r=this.context.element)||void 0===r||r.draw({silence:!0,animation:t.animation}),this.freezed=!1},this.addCommand=t=>{var e;if(!this.freezed){if(t.type===hc.AFTER_DRAW){const{dataChanges:n=[],animation:i=!0}=t.data;if(null===(e=this.context.batch)||void 0===e?void 0:e.isBatching){if(!this.batchChanges)return;return this.batchChanges.push(n),void(this.batchAnimation&&(this.batchAnimation=i))}this.batchChanges=[n],this.batchAnimation=i}this.undoStackPush(Py(this.batchChanges.flat(),this.batchAnimation,this.context)),this.notify(dc.ADD,this.undoStack[this.undoStack.length-1])}},this.initBatchCommand=t=>{const{initiate:e}=t.data;if(this.batchAnimation=!1,e)this.batchChanges=[];else{this.undoStack.pop()||(this.batchChanges=null)}},this.emitter=new Cy.Z;const{graph:n}=this.context;n.on(hc.AFTER_DRAW,this.addCommand),n.on(hc.BATCH_START,this.initBatchCommand),n.on(hc.BATCH_END,this.addCommand)}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}undo(){var t,e,n,i;const r=this.undoStack.pop();if(r){this.executeCommand(r);if(!1===(null===(e=(t=this.options).beforeAddCommand)||void 0===e?void 0:e.call(t,r,!1)))return;this.redoStack.push(r),null===(i=(n=this.options).afterAddCommand)||void 0===i||i.call(n,r,!1),this.notify(dc.UNDO,r)}return this}redo(){const t=this.redoStack.pop();return t&&(this.executeCommand(t,!1),this.undoStackPush(t),this.notify(dc.REDO,t)),this}undoAndCancel(){const t=this.undoStack.pop();return t&&(this.executeCommand(t,!1),this.redoStack=[],this.notify(dc.CANCEL,t)),this}undoStackPush(t){var e,n,i,r;const{stackSize:a}=this.options;0!==a&&this.undoStack.length>=a&&this.undoStack.shift();!1!==(null===(n=(e=this.options).beforeAddCommand)||void 0===n?void 0:n.call(e,t,!0))&&(this.undoStack.push(t),null===(r=(i=this.options).afterAddCommand)||void 0===r||r.call(i,t,!0))}clear(){this.undoStack=[],this.redoStack=[],this.batchChanges=null,this.batchAnimation=!1,this.notify(dc.CLEAR,null)}notify(t,e){this.emitter.emit(t,{cmd:e}),this.emitter.emit(dc.CHANGE,{cmd:e})}on(t,e){this.emitter.on(t,e)}destroy(){const{graph:t}=this.context;t.off(hc.AFTER_DRAW,this.addCommand),t.off(hc.BATCH_START,this.initBatchCommand),t.off(hc.BATCH_END,this.addCommand),this.emitter.off(),super.destroy(),this.undoStack=[],this.redoStack=[]}}Ly.defaultOptions={stackSize:0};var Ry=n(76117),Dy=n.n(Ry);const ky=(t,e,n)=>{if("sharp"===n)return[["M",t[0]-e,t[1]-e],["L",t[0]+e,t[1]-e],["L",t[0]+e,t[1]+e],["L",t[0]-e,t[1]+e],["Z"]];const i=[e,e,0,0,0];return[["M",t[0],t[1]-e],["A",...i,t[0],t[1]+e],["A",...i,t[0],t[1]-e]]},Iy=(t,e,n)=>{const i=[e,e,0,0,0],r="sharp"===n?td(t[0],rd(sd(ed(t[0],t[1])),e)):t[0],a="sharp"===n?td(t[1],rd(sd(ed(t[1],t[0])),e)):t[1],o=rd(sd(ud(ed(r,a),!1)),e),s=rd(o,-1),l=td(r,o),u=td(a,o),c=td(a,s),h=td(r,s);return"sharp"===n?[["M",l[0],l[1]],["L",u[0],u[1]],["L",c[0],c[1]],["L",h[0],h[1]],["Z"]]:[["M",l[0],l[1]],["L",u[0],u[1]],["A",...i,c[0],c[1]],["L",h[0],h[1]],["A",...i,l[0],l[1]]]},By=(t,e)=>{const n=Nd(t).map(((n,i)=>{const r=(i-2+t.length)%t.length,a=(i-1+t.length)%t.length,o=(i+1)%t.length,s=t[r],l=t[a],u=t[o],c=ed(s,l),h=ed(l,n),d=ed(n,u),f=(t,e)=>ld(t,e,!0)rd(sd(ud(t,!1)),e),v=m(h);return[{p:cd(td(l,p?m(c):v)),concave:p&&l},{p:cd(td(n,g?m(d):v)),concave:g&&n}]})),i=[e,e,0,0,0],r=n.findIndex(((t,e)=>!(n[(e-1+n.length)%n.length][0].concave||n[(e-1+n.length)%n.length][1].concave||t[0].concave||t[0].concave||t[1].concave))),a=n.slice(r).concat(n.slice(0,r));let o=[];return a.flatMap(((t,e)=>{const r=[],s=a[n.length-1];return 0===e&&r.push(["M",...s[1].p]),t[0].concave?o.push(t[0].p,t[1].p):r.push(["A",...i,...t[0].p]),t[1].concave?o.unshift(t[1].p):r.push(["L",...t[1].p]),3===o.length&&(r.pop(),r.push(["C",...o.flat()]),o=[]),r}))},Fy=(t,e)=>{const n=Nd(t).map(((e,n)=>({p:e,v:sd(ed(t[(n+1)%t.length],e))})));return n.forEach(((i,r)=>{const a=r>0?r-1:t.length-1,o=n[a].v,s=sd(td(o,rd(i.v,ld(o,i.v,!0)t.p)))},zy=(t,e)=>{const n=t.map(((n,i)=>{const r=t[0===i?t.length-1:i-1],a=hd(rd(sd(ud(ed(r,n),!1)),e));return[td(r,a),td(n,a)]})),i=n.flat();return i.map(((t,e)=>{if(e%2==0)return null;return pd([i[(e-1)%i.length],i[e%i.length]],[i[(e+1)%i.length],i[(e+2)%i.length]],!0)})).filter(Boolean).map(((t,e)=>[0===e?"M":"L",t[0],t[1]])).concat([["Z"]])};var Gy=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{if(this.shape){const t=!ec(this.optionsCache,this.options);this.shape.update(this.getHullStyle(t))}else this.shape=new Cf({style:this.getHullStyle()}),this.context.canvas.appendChild(this.shape);this.optionsCache=Object.assign({},this.options)},this.updateHullPath=t=>{this.shape&&this.options.members.includes(Dh(t.data))&&this.shape.update({d:this.getHullPath(!0)})},this.getHullPath=(t=!1)=>{const{graph:e}=this.context,n=this.getMember();if(0===n.length)return"";const i=n.map((t=>e.getNodeData(t))),r=Dy()(i.map(md),this.options.concavity).slice(1).reverse(),a=r.flatMap((t=>i.filter((e=>ec(md(e),t))).map(Dh)));return ec(a,this.hullMemberIds)&&!t||(this.hullMemberIds=a,this.path=function(t,e,n){if(1===t.length)return ky(t[0],e,n);if(2===t.length)return Iy(t,e,n);switch(n){case"smooth":return Fy(t,e);case"sharp":return zy(t,e);default:return By(t,e)}}(r,this.getPadding(),this.options.corner)),this.path},this.bindEvents()}bindEvents(){this.context.graph.on(hc.AFTER_RENDER,this.drawHull),this.context.graph.on(hc.AFTER_ELEMENT_UPDATE,this.updateHullPath)}getHullStyle(t){const e=this.options,{members:n,padding:i,corner:r}=e,a=Gy(e,["members","padding","corner"]);return Object.assign(Object.assign({},a),{d:this.getHullPath(t)})}getPadding(){const{graph:t}=this.context,e=this.hullMemberIds.reduce(((e,n)=>{const{halfExtents:i}=t.getElementRenderBounds(n),r=Math.max(i[0],i[1]);return Math.max(e,r)}),0);return e+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((t=>!e.includes(t))),e.some((t=>this.hullMemberIds.includes(t)))&&this.shape.update({d:this.getHullPath()})}updateMember(t){this.options.members=(0,en.Z)(t)?t(this.options.members):t,this.shape.update(this.getHullStyle(!0))}getMember(){return this.options.members}destroy(){this.context.graph.off(hc.AFTER_DRAW,this.drawHull),this.shape.destroy(),this.hullMemberIds=[],super.destroy()}}function Uy(t,e){e(t),t.children&&t.children.forEach((function(t){t&&Uy(t,e)}))}function Hy(t){Zy(t,!0)}function Vy(t){Zy(t,!1)}function Zy(t,e){var n=e?"visible":"hidden";Uy(t,(function(t){t.attr("visibility",n)}))}jy.defaultOptions={members:[],padding:10,corner:"rounded",concavity:1/0,fill:"lightblue",fillOpacity:.2,labelOpacity:1,stroke:"blue",strokeOpacity:.2};var Wy=function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=5),Object.entries(e).forEach((function(r){var a=(0,he.CR)(r,2),o=a[0],s=a[1],l=t;Object.prototype.hasOwnProperty.call(e,o)&&(s?(0,vv.Z)(s)?((0,vv.Z)(t[o])||(l[o]={}),n="A"&&n<="Z"};function ex(t,e,n){void 0===n&&(n=!1);var i={};return Object.entries(t).forEach((function(t){var r=(0,he.CR)(t,2),a=r[0],o=r[1];if("className"===a||"class"===a);else if(tx(a,"show")&&tx(Jy(a,"show"),e)!==n)a===function(t,e){return"".concat(e).concat(Qy(t))}(e,"show")?i[a]=o:i[a.replace(new RegExp(Qy(e)),"")]=o;else if(!tx(a,"show")&&tx(a,e)!==n){var s=Jy(a,e);"filter"===s&&"function"==typeof o||(i[s]=o)}})),i}function nx(t,e){return Object.entries(t).reduce((function(t,n){var i=(0,he.CR)(n,2),r=i[0],a=i[1];return r.startsWith("show")?t["show".concat(e).concat(r.slice(4))]=a:t["".concat(e).concat(Qy(r))]=a,t}),{})}function ix(t,e){void 0===e&&(e=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],i={},r={};return Object.entries(t).forEach((function(t){var a=(0,he.CR)(t,2),o=a[0],s=a[1];e.includes(o)||(-1!==n.indexOf(o)?r[o]=s:i[o]=s)})),[i,r]}var rx=function(t){function e(e){void 0===e&&(e={});var n=e.style,i=(0,he._T)(e,["style"]);return t.call(this,(0,he.pi)({style:(0,he.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(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=qy(this)),this._offscreen},enumerable:!1,configurable:!0}),e.prototype.disconnectedCallback=function(){var t;null===(t=this._offscreen)||void 0===t||t.destroy()},e}(Bl);var ax=function(){function t(t,n,i,r,a,o,s){void 0===t&&(t=null),void 0===n&&(n=null),void 0===i&&(i=null),void 0===r&&(r=null),void 0===a&&(a=[null,null,null,null,null]),void 0===o&&(o=[]),void 0===s&&(s=[]),e.add(this),this._elements=Array.from(t),this._data=n,this._parent=i,this._document=r,this._enter=a[0],this._update=a[1],this._exit=a[2],this._merge=a[3],this._split=a[4],this._transitions=o,this._facetElements=s}var e,n,i;return t.prototype.selectAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(e,null,this._elements[0],this._document)},t.prototype.selectFacetAll=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t):t;return new n(this._elements,null,this._parent,this._document,void 0,void 0,e)},t.prototype.select=function(t){var e="string"==typeof t?this._parent.querySelectorAll(t)[0]||null:t;return new n([e],null,e,this._document)},t.prototype.append=function(t){var e=this,i="function"==typeof t?t:function(){return e.createElement(t)},r=[];if(null!==this._data){for(var a=0;a=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom},t}();var lx=function(t,e){var n=function(t){return"".concat(e,"-").concat(t)},i=Object.fromEntries(Object.entries(t).map((function(t){var e=(0,he.CR)(t,2),i=e[0],r=e[1],a=n(r);return[i,{name:a,class:".".concat(a),id:"#".concat(a),toString:function(){return a}}]})));return Object.assign(i,{prefix:n}),i};function ux(t){if((0,oe.Z)(t))return[t,t,t,t];if((0,Fe.Z)(t)){var e=t.length;if(1===e)return[t[0],t[0],t[0],t[0]];if(2===e)return[t[0],t[1],t[0],t[1]];if(3===e)return[t[0],t[1],t[2],t[1]];if(4===e)return t}return[0,0,0,0]}function cx(t,e,n,i,r){return void 0===i&&(i=!0),void 0===r&&(r=function(t){t.node().removeChildren()}),t?n(e):(i&&r(e),null)}var hx=lx({text:"text"},"title");function dx(t){return/\S+-\S+/g.test(t)?t.split("-").map((function(t){return t[0]})):t.length>2?[t[0]]:t.split("")}function fx(t,e){var n=Object.entries(e).reduce((function(e,n){var i=(0,he.CR)(n,2),r=i[0],a=i[1];return t.node().attr(r)||(e[r]=a),e}),{});t.styles(n)}var px=function(t){function e(e){return t.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(0,he.ZT)(e,t),e.prototype.getAvailableSpace=function(){var t=this.attributes,e=t.width,n=t.height,i=t.position,r=t.spacing,a=t.inset,o=this.querySelector(hx.text.class);if(!o)return new sx(0,0,+e,+n);var s=o.getBBox(),l=s.width,u=s.height,c=(0,he.CR)(ux(r),4),h=c[0],d=c[1],f=c[2],p=c[3],g=(0,he.CR)([0,0,+e,+n],4),m=g[0],v=g[1],y=g[2],x=g[3],b=dx(i);if(b.includes("i"))return new sx(m,v,y,x);b.forEach((function(t,i){var r,a,o,s;"t"===t&&(r=(0,he.CR)(0===i?[u+f,+n-u-f]:[0,+n],2),v=r[0],x=r[1]),"r"===t&&(a=(0,he.CR)([+e-l-p],1),y=a[0]),"b"===t&&(o=(0,he.CR)([+n-u-h],1),x=o[0]),"l"===t&&(s=(0,he.CR)(0===i?[l+d,+e-l-d]:[0,+e],2),m=s[0],y=s[1])}));var _=(0,he.CR)(ux(a),4),E=_[0],w=_[1],T=_[2],S=_[3],M=(0,he.CR)([S+w,E+T],2),C=M[0],A=M[1];return new sx(m+S,v+E,y-C,x-A)},e.prototype.getBBox=function(){return this.title?this.title.getBBox():new sx(0,0,0,0)},e.prototype.render=function(t,e){var n=this,i=(t.width,t.height,t.position,t.spacing,(0,he._T)(t,["width","height","position","spacing"])),r=(0,he.CR)(ix(i),1)[0],a=function(t){var e,n,i,r,a=t,o=a.width,s=a.height,l=a.position,u=(0,he.CR)([+o/2,+s/2],2),c=u[0],h=u[1],d=(0,he.CR)([+c,+h,"center","middle"],4),f=d[0],p=d[1],g=d[2],m=d[3],v=dx(l);return v.includes("l")&&(f=(e=(0,he.CR)([0,"start"],2))[0],g=e[1]),v.includes("r")&&(f=(n=(0,he.CR)([+o,"end"],2))[0],g=n[1]),v.includes("t")&&(p=(i=(0,he.CR)([0,"top"],2))[0],m=i[1]),v.includes("b")&&(p=(r=(0,he.CR)([+s,"bottom"],2))[0],m=r[1]),{x:f,y:p,textAlign:g,textBaseline:m}}(t),o=a.x,s=a.y,l=a.textAlign,u=a.textBaseline;cx(!!i.text,ox(e),(function(t){n.title=t.maybeAppendByClassName(hx.text,"text").styles(r).call(fx,{x:o,y:s,textAlign:l,textBaseline:u}).node()}))},e}(Ky),gx=function(){};function mx(t,e){return(0,en.Z)(t)?t.apply(void 0,(0,he.ev)([],(0,he.CR)(e),!1)):t}function vx(t){if(!t)return{enter:!1,update:!1,exit:!1};var e=["enter","update","exit"],n=Object.fromEntries(Object.entries(t).filter((function(t){var n=(0,he.CR)(t,1)[0];return!e.includes(n)})));return Object.fromEntries(e.map((function(e){return function(t){return"boolean"!=typeof t&&"enter"in t&&"update"in t&&"exit"in t}(t)?!1===t[e]?[e,!1]:[e,(0,he.pi)((0,he.pi)({},t[e]),n)]:[e,n]})))}function yx(t,e){t?t.finished.then(e):e()}function xx(t,e){"update"in t?t.update(e):t.attr(e)}function bx(t,e,n){return 0===e.length?null:n?t.animate(e,n):(xx(t,{style:e.slice(-1)[0]}),null)}function _x(t,e,n){var i={},r={};return Object.entries(e).forEach((function(e){var n=(0,he.CR)(e,2),a=n[0],o=n[1];if(!(0,le.Z)(o)){var s=t.style[a]||t.parsedStyle[a]||0;s!==o&&(i[a]=s,r[a]=o)}})),n?bx(t,[i,r],(0,he.pi)({fill:"both"},n)):(xx(t,r),null)}function Ex(t,e,n){void 0===n&&(n=!1);var i=t.getBBox(),r=i.width,a=i.height,o=e/Math.max(r,a);return n&&(t.style.transform="scale(".concat(o,")")),o}var wx=function(t,e,n){return[["M",t-n,e],["A",n,n,0,1,0,t+n,e],["A",n,n,0,1,0,t-n,e],["Z"]]},Tx=wx,Sx=function(t,e,n){return[["M",t,e+n],["L",t,e-n]]},Mx=function(t,e,n){return[["M",t-n,e],["L",t+n,e]]},Cx=Mx;var Ax=lx({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"),Ox=function(t){function e(e){var n,i,r,a=t.call(this,e,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:(n=0,i=0,r=6,[["M",n-r,i-r],["L",n+r,i],["L",n-r,i+r],["Z"]]),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(t,e){return"".concat(t,"/").concat(e)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return a.playState="idle",a.contentGroup=a.appendChild(new wl({class:Ax.contentGroup.name})),a.playWindow=a.contentGroup.appendChild(new wl({class:Ax.playWindow.name})),a.innerCurrPage=a.defaultPage,a}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"defaultPage",{get:function(){var t=this.attributes.defaultPage;return ce(t,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageShape",{get:function(){var t=this.pageViews,e=(0,he.CR)(function(t){var e;return(null===(e=t[0])||void 0===e?void 0:e.map((function(e,n){return t.map((function(t){return t[n]}))})))||[]}(t.map((function(t){var e=t.getBBox();return[e.width,e.height]}))).map((function(t){return Math.max.apply(Math,(0,he.ev)([],(0,he.CR)(t),!1))})),2),n=e[0],i=e[1],r=this.attributes,a=r.pageWidth,o=void 0===a?n:a,s=r.pageHeight;return{pageWidth:o,pageHeight:void 0===s?i:s}},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(e.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e=t.prototype.getBBox.call(this),n=e.x,i=e.y,r=this.controllerShape,a=this.pageShape,o=a.pageWidth,s=a.pageHeight;return new sx(n,i,o+r.width,s)},e.prototype.goTo=function(t){var e=this,n=this.attributes.animate,i=this,r=i.currPage,a=i.playState,o=i.playWindow,s=i.pageViews;if("idle"!==a||t<0||s.length<=0||t>=s.length)return null;s[r].setLocalPosition(0,0),this.prepareFollowingPage(t);var l=(0,he.CR)(this.getFollowingPageDiff(t),2),u=l[0],c=l[1];this.playState="running";var h=bx(o,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-u,", ").concat(-c,")")}],n);return yx(h,(function(){e.innerCurrPage=t,e.playState="idle",e.setVisiblePages([t]),e.updatePageInfo()})),h},e.prototype.prev=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n<=0)return null;var i=t?(n-1+e)%e:ce(n-1,0,e);return this.goTo(i)},e.prototype.next=function(){var t=this.attributes.loop,e=this.pageViews.length,n=this.currPage;if(!t&&n>=e-1)return null;var i=t?(n+1)%e:ce(n+1,0,e);return this.goTo(i)},e.prototype.renderClipPath=function(t){var e=this.pageShape,n=e.pageWidth,i=e.pageHeight;n&&i?(this.clipPath=t.maybeAppendByClassName(Ax.clipPath,"rect").styles({width:n,height:i}),this.contentGroup.attr("clipPath",this.clipPath.node())):this.contentGroup.style.clipPath=void 0},e.prototype.setVisiblePages=function(t){this.playWindow.children.forEach((function(e,n){t.includes(n)?Hy(e):Vy(e)}))},e.prototype.adjustControllerLayout=function(){var t=this,e=t.prevBtnGroup,n=t.nextBtnGroup,i=t.pageInfoGroup,r=this.attributes,a=r.orientation,o=r.controllerPadding,s=i.getBBox(),l=s.width,u=(s.height,(0,he.CR)("horizontal"===a?[-180,0]:[-90,90],2)),c=u[0],h=u[1];e.setLocalEulerAngles(c),n.setLocalEulerAngles(h);var d=e.getBBox(),f=d.width,p=d.height,g=n.getBBox(),m=g.width,v=g.height,y=Math.max(f,l,m),x="horizontal"===a?{offset:[[0,0],[f/2+o,0],[f+l+2*o,0]],textAlign:"start"}:{offset:[[y/2,-p-o],[y/2,0],[y/2,v+o]],textAlign:"center"},b=(0,he.CR)(x.offset,3),_=(0,he.CR)(b[0],2),E=_[0],w=_[1],T=(0,he.CR)(b[1],2),S=T[0],M=T[1],C=(0,he.CR)(b[2],2),A=C[0],O=C[1],N=x.textAlign,P=i.querySelector("text");P&&(P.style.textAlign=N),e.setLocalPosition(E,w),i.setLocalPosition(S,M),n.setLocalPosition(A,O)},e.prototype.updatePageInfo=function(){var t,e=this,n=e.currPage,i=e.pageViews,r=e.attributes.formatter;i.length<2||(null===(t=this.pageInfoGroup.querySelector(Ax.pageInfo.class))||void 0===t||t.attr("text",r(n+1,i.length)),this.adjustControllerLayout())},e.prototype.getFollowingPageDiff=function(t){var e=this.currPage;if(e===t)return[0,0];var n=this.attributes.orientation,i=this.pageShape,r=i.pageWidth,a=i.pageHeight,o=t=2,s=t.maybeAppendByClassName(Ax.controller,"g");if(Zy(s.node(),o),o){var l=ex(this.attributes,"button"),u=ex(this.attributes,"pageNum"),c=(0,he.CR)(ix(l),2),h=c[0],d=c[1],f=h.size,p=(0,he._T)(h,["size"]),g=!s.select(Ax.prevBtnGroup.class).node(),m=s.maybeAppendByClassName(Ax.prevBtnGroup,"g").styles(d);this.prevBtnGroup=m.node();var v=m.maybeAppendByClassName(Ax.prevBtn,"path"),y=s.maybeAppendByClassName(Ax.nextBtnGroup,"g").styles(d);this.nextBtnGroup=y.node(),[v,y.maybeAppendByClassName(Ax.nextBtn,"path")].forEach((function(t){t.styles((0,he.pi)((0,he.pi)({},p),{transformOrigin:"center"})),Ex(t.node(),f,!0)}));var x=s.maybeAppendByClassName(Ax.pageInfoGroup,"g");this.pageInfoGroup=x.node(),x.maybeAppendByClassName(Ax.pageInfo,"text").styles(u),this.updatePageInfo(),s.node().setLocalPosition(r+n,a/2),g&&(this.prevBtnGroup.addEventListener("click",(function(){e.prev()})),this.nextBtnGroup.addEventListener("click",(function(){e.next()})))}},e.prototype.render=function(t,e){var n=t.x,i=void 0===n?0:n,r=t.y,a=void 0===r?0:r;this.attr("transform","translate(".concat(i,", ").concat(a,")"));var o=ox(e);this.renderClipPath(o),this.renderController(o),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},e.prototype.bindEvents=function(){var t=this,e=Nm((function(){return t.render(t.attributes,t)}),50);this.playWindow.addEventListener(Ss.INSERTED,e),this.playWindow.addEventListener(Ss.REMOVED,e)},e}(Ky);function Nx(t){var e=function(t){var e="default";if((0,nn.Z)(t)&&t instanceof Image)e="image";else if((0,en.Z)(t))e="symbol";else if((0,ue.Z)(t)){var n=new RegExp("data:(image|text)");e=t.match(n)?"base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(t)?"url":"symbol"}return e}(t);return["base64","url","image"].includes(e)?"image":t&&"symbol"===e?"path":null}var Px=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,n){var i=t.x,r=void 0===i?0:i,a=t.y,o=void 0===a?0:a,s=this.getSubShapeStyle(t),l=s.symbol,u=s.size,c=void 0===u?16:u,h=(0,he._T)(s,["symbol","size"]),d=Nx(l);cx(!!d,ox(n),(function(t){t.maybeAppendByClassName("marker",d).attr("className","marker ".concat(d,"-marker")).call((function(t){if("image"===d){var n=2*c;t.styles({img:l,width:n,height:n,x:r-c,y:o-c})}else{n=c/2;var i=(0,en.Z)(l)?l:e.getSymbol(l);t.styles((0,he.pi)({d:null==i?void 0:i(r,o,n)},h))}}))}))},e.MARKER_SYMBOL_MAP=new Map,e.registerSymbol=function(t,n){e.MARKER_SYMBOL_MAP.set(t,n)},e.getSymbol=function(t){return e.MARKER_SYMBOL_MAP.get(t)},e.getSymbols=function(){return Array.from(e.MARKER_SYMBOL_MAP.keys())},e}(Ky);Px.registerSymbol("cross",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e+n],["M",t+n,e-n],["L",t-n,e+n]]})),Px.registerSymbol("hyphen",(function(t,e,n){return[["M",t-n,e],["L",t+n,e]]})),Px.registerSymbol("line",Sx),Px.registerSymbol("plus",(function(t,e,n){return[["M",t-n,e],["L",t+n,e],["M",t,e-n],["L",t,e+n]]})),Px.registerSymbol("tick",(function(t,e,n){return[["M",t-n/2,e-n],["L",t+n/2,e-n],["M",t,e-n],["L",t,e+n],["M",t-n/2,e+n],["L",t+n/2,e+n]]})),Px.registerSymbol("circle",wx),Px.registerSymbol("point",Tx),Px.registerSymbol("bowtie",(function(t,e,n){var i=n-1.5;return[["M",t-n,e-i],["L",t+n,e+i],["L",t+n,e-i],["L",t-n,e+i],["Z"]]})),Px.registerSymbol("hexagon",(function(t,e,n){var i=n/2*Math.sqrt(3);return[["M",t,e-n],["L",t+i,e-n/2],["L",t+i,e+n/2],["L",t,e+n],["L",t-i,e+n/2],["L",t-i,e-n/2],["Z"]]})),Px.registerSymbol("square",(function(t,e,n){return[["M",t-n,e-n],["L",t+n,e-n],["L",t+n,e+n],["L",t-n,e+n],["Z"]]})),Px.registerSymbol("diamond",(function(t,e,n){return[["M",t-n,e],["L",t,e-n],["L",t+n,e],["L",t,e+n],["Z"]]})),Px.registerSymbol("triangle",(function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e+i],["L",t,e-i],["L",t+n,e+i],["Z"]]})),Px.registerSymbol("triangle-down",(function(t,e,n){var i=n*Math.sin(1/3*Math.PI);return[["M",t-n,e-i],["L",t+n,e-i],["L",t,e+i],["Z"]]})),Px.registerSymbol("line",Sx),Px.registerSymbol("dot",Mx),Px.registerSymbol("dash",Cx),Px.registerSymbol("smooth",(function(t,e,n){return[["M",t-n,e],["A",n/2,n/2,0,1,1,t,e],["A",n/2,n/2,0,1,0,t+n,e]]})),Px.registerSymbol("hv",(function(t,e,n){return[["M",t-n-1,e-2.5],["L",t,e-2.5],["L",t,e+2.5],["L",t+n+1,e+2.5]]})),Px.registerSymbol("vh",(function(t,e,n){return[["M",t-n-1,e+2.5],["L",t,e+2.5],["L",t,e-2.5],["L",t+n+1,e-2.5]]})),Px.registerSymbol("hvh",(function(t,e,n){return[["M",t-(n+1),e+2.5],["L",t-n/2,e+2.5],["L",t-n/2,e-2.5],["L",t+n/2,e-2.5],["L",t+n/2,e+2.5],["L",t+n+1,e+2.5]]})),Px.registerSymbol("vhv",(function(t,e){return[["M",t-5,e+2.5],["L",t-5,e],["L",t,e],["L",t,e-3],["L",t,e+3],["L",t+6.5,e+3]]}));Px.registerSymbol("hiddenHandle",(function(t,e,n){var i=1.4*n;return[["M",t-n,e-i],["L",t+n,e-i],["L",t+n,e+i],["L",t-n,e+i],["Z"]]})),Px.registerSymbol("verticalHandle",(function(t,e,n){var i=1.4*n,r=n/2,a=n/6,o=t+.4*i;return[["M",t,e],["L",o,e+r],["L",t+i,e+r],["L",t+i,e-r],["L",o,e-r],["Z"],["M",o,e+a],["L",t+i-2,e+a],["M",o,e-a],["L",t+i-2,e-a]]})),Px.registerSymbol("horizontalHandle",(function(t,e,n){var i=1.4*n,r=n/2,a=n/6,o=e+.4*i;return[["M",t,e],["L",t-r,o],["L",t-r,e+i],["L",t+r,e+i],["L",t+r,o],["Z"],["M",t-a,o],["L",t-a,e+i-2],["M",t+a,o],["L",t+a,e+i-2]]}));var Lx,Rx;function Dx(t,e,n){return void 0===t&&(t="horizontal"),"horizontal"===t?e:n}function kx(t){var e=t.getLocalBounds(),n=e.min,i=e.max,r=(0,he.CR)([n,i],2),a=(0,he.CR)(r[0],2),o=a[0],s=a[1],l=(0,he.CR)(r[1],2),u=l[0],c=l[1];return{x:o,y:s,width:u-o,height:c-s,left:o,bottom:c,top:s,right:u}}function Ix(t,e){var n=(0,he.CR)(t,2),i=n[0],r=n[1],a=(0,he.CR)(e,2),o=a[0],s=a[1];return i!==o&&r===s}function Bx(t){return"function"==typeof t?t():(0,ue.Z)(t)||(0,oe.Z)(t)?new rx({style:{text:String(t)}}):t}var Fx=gv((function(t,e){var n=e.fontSize,i=e.fontFamily,r=e.fontWeight,a=e.fontStyle,o=e.fontVariant;return Rx?Rx(t,n):(Lx||(Lx=al.offscreenCanvasCreator.getOrCreateContext(void 0)),Lx.font=[a,o,r,"".concat(n,"px"),i].join(" "),Lx.measureText(t).width)}),(function(t,e){return[t,Object.values(e||zx(t)).join()].join("")}),4096),zx=function(t){var e=t.style.fontFamily||"sans-serif",n=t.style.fontWeight||"normal",i=t.style.fontStyle||"normal",r=t.style.fontVariant,a=t.style.fontSize;return{fontSize:a="object"==typeof a?a.value:a,fontFamily:e,fontWeight:n,fontStyle:i,fontVariant:r}};function Gx(t){return"text"===t.nodeName?t:"g"===t.nodeName&&1===t.children.length&&"text"===t.children[0].nodeName?t.children[0]:null}function jx(t,e){var n=Gx(t);n&&n.attr(e)}function Ux(t,e,n){void 0===n&&(n="..."),jx(t,{wordWrap:!0,wordWrapWidth:e,maxLines:1,textOverflow:n})}var Hx=lx({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");var Vx=function(t){function e(e){return t.call(this,e,{span:[1,1],marker:function(){return new xl({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"showValue",{get:function(){var t=this.attributes.valueText;return!!t&&("string"==typeof t||"number"==typeof t?""!==t:"function"==typeof t||""!==t.attr("text"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"actualSpace",{get:function(){var t=this.labelGroup,e=this.valueGroup,n=this.attributes.markerSize,i=t.node().getBBox(),r=i.width,a=i.height,o=e.node().getBBox(),s=o.width,l=o.height;return{markerWidth:n,labelWidth:r,valueWidth:s,height:Math.max(n,a,l)}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"span",{get:function(){var t=this.attributes.span;if(!t)return[1,1];var e=(0,he.CR)(ux(t),2),n=e[0],i=e[1],r=this.showValue?i:0,a=n+r;return[n/a,r/a]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t,e=this.attributes,n=e.markerSize,i=e.width,r=this.actualSpace,a=r.markerWidth,o=r.height,s=this.actualSpace,l=s.labelWidth,u=s.valueWidth,c=(0,he.CR)(this.spacing,2),h=c[0],d=c[1];if(i){var f=i-n-h-d,p=(0,he.CR)(this.span,2),g=p[0],m=p[1];l=(t=(0,he.CR)([g*f,m*f],2))[0],u=t[1]}return{width:a+l+u+h+d,height:o,markerWidth:a,labelWidth:l,valueWidth:u}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"spacing",{get:function(){var t=this.attributes.spacing;if(!t)return[0,0];var e=(0,he.CR)(ux(t),2),n=e[0],i=e[1];return this.showValue?[n,i]:[n,0]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){var t=this.shape,e=t.markerWidth,n=t.labelWidth,i=t.valueWidth,r=t.width,a=t.height,o=(0,he.CR)(this.spacing,2),s=o[0];return{height:a,width:r,markerWidth:e,labelWidth:n,valueWidth:i,position:[e/2,e+s,e+n+s+o[1]]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scaleSize",{get:function(){var t=function(t){var e=t.querySelector(Hx.marker.class);return e?e.style:{}}(this.markerGroup.node()),e=this.attributes,n=e.markerSize,i=e.markerStrokeWidth,r=void 0===i?t.strokeWidth:i,a=e.markerLineWidth,o=void 0===a?t.lineWidth:a,s=e.markerStroke,l=void 0===s?t.stroke:s,u=+(r||o||(l?1:0))*Math.sqrt(2),c=this.markerGroup.node().getBBox(),h=c.width,d=c.height;return(1-u/Math.max(h,d))*n},enumerable:!1,configurable:!0}),e.prototype.renderMarker=function(t){var e=this,n=this.attributes.marker,i=ex(this.attributes,"marker");this.markerGroup=t.maybeAppendByClassName(Hx.markerGroup,"g").style("zIndex",0),cx(!!n,this.markerGroup,(function(){var t,r=e.markerGroup.node(),a=null===(t=r.childNodes)||void 0===t?void 0:t[0],o="string"==typeof n?new Px({style:{symbol:n},className:Hx.marker.name}):n();a?o.nodeName===a.nodeName?a instanceof Px?a.update((0,he.pi)((0,he.pi)({},i),{symbol:n})):(!function(t,e){var n,i,r=e.attributes;try{for(var a=(0,he.XA)(Object.entries(r)),o=a.next();!o.done;o=a.next()){var s=(0,he.CR)(o.value,2),l=s[0],u=s[1];"id"!==l&&"className"!==l&&t.attr(l,u)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}}(a,o),ox(a).styles(i)):(a.remove(),ox(o).attr("className",Hx.marker.name).styles(i),r.appendChild(o)):(o instanceof Px||ox(o).attr("className",Hx.marker.name).styles(i),r.appendChild(o)),e.markerGroup.node().scale(1/e.markerGroup.node().getScale()[0]);var s=Ex(e.markerGroup.node(),e.scaleSize,!0);e.markerGroup.node().style._transform="scale(".concat(s,")")}))},e.prototype.renderLabel=function(t){var e=ex(this.attributes,"label"),n=e.text,i=(0,he._T)(e,["text"]);this.labelGroup=t.maybeAppendByClassName(Hx.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(Hx.label,(function(){return Bx(n)})).styles(i)},e.prototype.renderValue=function(t){var e=this,n=ex(this.attributes,"value"),i=n.text,r=(0,he._T)(n,["text"]);this.valueGroup=t.maybeAppendByClassName(Hx.valueGroup,"g").style("zIndex",0),cx(this.showValue,this.valueGroup,(function(){e.valueGroup.maybeAppendByClassName(Hx.value,(function(){return Bx(i)})).styles(r)}))},e.prototype.renderBackground=function(t){var e=this.shape,n=e.width,i=e.height,r=ex(this.attributes,"background");this.background=t.maybeAppendByClassName(Hx.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(Hx.background,"rect").styles((0,he.pi)({width:n,height:i},r))},e.prototype.adjustLayout=function(){var t=this.layout,e=t.labelWidth,n=t.valueWidth,i=t.height,r=(0,he.CR)(t.position,3),a=r[0],o=r[1],s=r[2],l=i/2;this.markerGroup.styles({transform:"translate(".concat(a,", ").concat(l,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(o,", ").concat(l,")")}),Ux(this.labelGroup.select(Hx.label.class).node(),Math.ceil(e)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(s,", ").concat(l,")")}),Ux(this.valueGroup.select(Hx.value.class).node(),Math.ceil(n)))},e.prototype.render=function(t,e){var n=ox(e),i=t.x,r=void 0===i?0:i,a=t.y,o=void 0===a?0:a;n.styles({transform:"translate(".concat(r,", ").concat(o,")")}),this.renderMarker(n),this.renderLabel(n),this.renderValue(n),this.renderBackground(n),this.adjustLayout()},e}(Ky),Zx=lx({page:"item-page",navigator:"navigator",item:"item"},"items"),Wx=function(t,e,n){return void 0===n&&(n=!0),t?e(t):n},Xx=function(t){function e(e){var n=t.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:gx,mouseenter:gx,mouseleave:gx})||this;return n.navigatorShape=[0,0],n}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"grid",{get:function(){var t=this.attributes,e=t.gridRow,n=t.gridCol,i=t.data;if(!e&&!n)throw new Error("gridRow and gridCol can not be set null at the same time");return e&&n?[e,n]:e?[e,i.length]:[i.length,n]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"renderData",{get:function(){var t=this.attributes,e=t.data,n=t.layout,i=ex(this.attributes,"item"),r=e.map((function(t,r){var a=t.id,o=void 0===a?r:a,s=t.label,l=t.value;return{id:"".concat(o),index:r,style:(0,he.pi)({layout:n,labelText:s,valueText:l},Object.fromEntries(Object.entries(i).map((function(n){var i=(0,he.CR)(n,2);return[i[0],mx(i[1],[t,r,e])]}))))}}));return r},enumerable:!1,configurable:!0}),e.prototype.getGridLayout=function(){var t=this,e=this.attributes,n=e.orientation,i=e.width,r=e.rowPadding,a=e.colPadding,o=(0,he.CR)(this.navigatorShape,1)[0],s=(0,he.CR)(this.grid,2),l=s[0],u=s[1],c=u*l,h=0;return this.pageViews.children.map((function(e,s){var d,f,p=Math.floor(s/c),g=s%c,m=t.ifHorizontal(u,l),v=[Math.floor(g/m),g%m];"vertical"===n&&v.reverse();var y=(0,he.CR)(v,2),x=y[0],b=y[1],_=(i-o-(u-1)*a)/u,E=e.getBBox().height,w=(0,he.CR)([0,0],2),T=w[0],S=w[1];return"horizontal"===n?(T=(d=(0,he.CR)([h,x*(E+r)],2))[0],S=d[1],h=b===u-1?0:h+_+a):(T=(f=(0,he.CR)([b*(_+a),h],2))[0],S=f[1],h=x===l-1?0:h+E+r),{page:p,index:s,row:x,col:b,pageIndex:g,width:_,height:E,x:T,y:S}}))},e.prototype.getFlexLayout=function(){var t=this.attributes,e=t.width,n=t.height,i=t.rowPadding,r=t.colPadding,a=(0,he.CR)(this.navigatorShape,1)[0],o=(0,he.CR)(this.grid,2),s=o[0],l=o[1],u=(0,he.CR)([e-a,n],2),c=u[0],h=u[1],d=(0,he.CR)([0,0,0,0,0,0,0,0],8),f=d[0],p=d[1],g=d[2],m=d[3],v=d[4],y=d[5],x=d[6],b=d[7];return this.pageViews.children.map((function(t,e){var n,a,o,u,d=t.getBBox(),_=d.width,E=d.height,w=0===x?0:r,T=x+w+_;return T<=c&&Wx(v,(function(t){return t0?(this.navigatorShape=[55,0],t.call(this)):e},enumerable:!1,configurable:!0}),e.prototype.ifHorizontal=function(t,e){return Dx(this.attributes.orientation,t,e)},e.prototype.flattenPage=function(t){t.querySelectorAll(Zx.item.class).forEach((function(e){t.appendChild(e)})),t.querySelectorAll(Zx.page.class).forEach((function(e){t.removeChild(e).destroy()}))},e.prototype.renderItems=function(t){var e=this.attributes,n=e.click,i=e.mouseenter,r=e.mouseleave;this.flattenPage(t);var a=this.dispatchCustomEvent.bind(this);ox(t).selectAll(Zx.item.class).data(this.renderData,(function(t){return t.id})).join((function(t){return t.append((function(t){var e=t.style;return new Vx({style:e})})).attr("className",Zx.item.name).on("click",(function(){null==n||n(this),a("itemClick",{item:this})})).on("pointerenter",(function(){null==i||i(this),a("itemMouseenter",{item:this})})).on("pointerleave",(function(){null==r||r(this),a("itemMouseleave",{item:this})}))}),(function(t){return t.each((function(t){var e=t.style;this.update(e)}))}),(function(t){return t.remove()}))},e.prototype.relayoutNavigator=function(){var t,e=this.attributes,n=e.layout,i=e.width,r=(null===(t=this.pageViews.children[0])||void 0===t?void 0:t.getBBox().height)||0,a=(0,he.CR)(this.navigatorShape,2),o=a[0],s=a[1];this.navigator.update("grid"===n?{pageWidth:i-o,pageHeight:r-s}:{})},e.prototype.adjustLayout=function(){var t,e,n=this,i=Object.entries((t=this.itemsLayout,e="page",t.reduce((function(t,n){return(t[n[e]]=t[n[e]]||[]).push(n),t}),{}))).map((function(t){var e=(0,he.CR)(t,2);return{page:e[0],layouts:e[1]}})),r=(0,he.ev)([],(0,he.CR)(this.navigator.getContainer().children),!1);i.forEach((function(t){var e=t.layouts,i=n.pageViews.appendChild(new wl({className:Zx.page.name}));e.forEach((function(t){var e=t.x,n=t.y,a=t.index,o=t.width,s=t.height,l=r[a];i.appendChild(l),Wd(l,"__layout__",t),l.update({x:e,y:n,width:o,height:s})}))})),this.relayoutNavigator()},e.prototype.renderNavigator=function(t){var e=this.attributes.orientation,n=ex(this.attributes,"nav"),i=Xy({orientation:e},n),r=this;return t.selectAll(Zx.navigator.class).data(["nav"]).join((function(t){return t.append((function(){return new Ox({style:i})})).attr("className",Zx.navigator.name).each((function(){r.navigator=this}))}),(function(t){return t.each((function(){this.update(i)}))}),(function(t){return t.remove()})),this.navigator},e.prototype.getBBox=function(){return this.navigator.getBBox()},e.prototype.render=function(t,e){var n=this.attributes.data;if(n&&0!==n.length){var i=this.renderNavigator(ox(e));this.renderItems(i.getContainer()),this.adjustLayout()}},e.prototype.dispatchCustomEvent=function(t,e){var n=new gs(t,{detail:e});this.dispatchEvent(n)},e}(Ky),Yx=lx({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),qx={showLabel:!0,formatter:function(t){return t.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},$x=(function(t){function e(e){return t.call(this,e,qx)||this}(0,he.ZT)(e,t),e.prototype.render=function(t,e){var n=ox(e).maybeAppendByClassName(Yx.markerGroup,"g");this.renderMarker(n);var i=ox(e).maybeAppendByClassName(Yx.labelGroup,"g");this.renderLabel(i)},e.prototype.renderMarker=function(t){var e=this,n=this.attributes,i=n.orientation,r=n.markerSymbol,a=void 0===r?Dx(i,"horizontalHandle","verticalHandle"):r;cx(!!a,t,(function(t){var n=ex(e.attributes,"marker"),i=(0,he.pi)({symbol:a},n);e.marker=t.maybeAppendByClassName(Yx.marker,(function(){return new Px({style:i})})).update(i)}))},e.prototype.renderLabel=function(t){var e=this,n=this.attributes,i=n.showLabel,r=n.orientation,a=n.spacing,o=void 0===a?0:a,s=n.formatter;cx(i,t,(function(t){var n,i=ex(e.attributes,"label"),a=i.text,l=(0,he._T)(i,["text"]),u=(null===(n=t.select(Yx.marker.class))||void 0===n?void 0:n.node().getBBox())||{},c=u.width,h=void 0===c?0:c,d=u.height,f=void 0===d?0:d,p=(0,he.CR)(Dx(r,[0,f+o,"center","top"],[h+o,0,"start","middle"]),4),g=p[0],m=p[1],v=p[2],y=p[3];t.maybeAppendByClassName(Yx.label,"text").styles((0,he.pi)((0,he.pi)({},l),{x:g,y:m,text:s(a).toString(),textAlign:v,textBaseline:y}))}))}}(Ky),{showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12}),Kx=Xy({},$x,{}),Qx=(Xy({},$x,nx(qx,"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"}),lx({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")),Jx=function(t){function e(e){return t.call(this,e,Kx)||this}return(0,he.ZT)(e,t),e.prototype.renderTitle=function(t,e,n){var i=this.attributes,r=i.showTitle,a=i.titleText,o=ex(this.attributes,"title"),s=(0,he.CR)(ix(o),2),l=s[0],u=s[1];this.titleGroup=t.maybeAppendByClassName(Qx.titleGroup,"g").styles(u);var c=(0,he.pi)((0,he.pi)({width:e,height:n},l),{text:r?a:""});this.title=this.titleGroup.maybeAppendByClassName(Qx.title,(function(){return new px({style:c})})).update(c)},e.prototype.renderItems=function(t,e){var n=e.x,i=e.y,r=e.width,a=e.height,o=ex(this.attributes,"title",!0),s=(0,he.CR)(ix(o),2),l=s[0],u=s[1],c=(0,he.pi)((0,he.pi)({},l),{width:r,height:a,x:0,y:0});this.itemsGroup=t.maybeAppendByClassName(Qx.itemsGroup,"g").styles((0,he.pi)((0,he.pi)({},u),{transform:"translate(".concat(n,", ").concat(i,")")}));var h=this;this.itemsGroup.selectAll(Qx.items.class).data(["items"]).join((function(t){return t.append((function(){return new Xx({style:c})})).attr("className",Qx.items.name).each((function(){h.items=ox(this)}))}),(function(t){return t.update(c)}),(function(t){return t.remove()}))},e.prototype.adjustLayout=function(){if(this.attributes.showTitle){var t=this.title.node().getAvailableSpace(),e=t.x,n=t.y;this.itemsGroup.node().style.transform="translate(".concat(e,", ").concat(n,")")}},Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=t.showTitle,n=t.width,i=t.height;return e?this.title.node().getAvailableSpace():new sx(0,0,n,i)},enumerable:!1,configurable:!0}),e.prototype.getBBox=function(){var e,n,i=null===(e=this.title)||void 0===e?void 0:e.node(),r=null===(n=this.items)||void 0===n?void 0:n.node();return i&&r?function(t,e){var n=t.attributes,i=n.position,r=n.spacing,a=n.inset,o=n.text,s=t.getBBox(),l=e.getBBox(),u=dx(i),c=(0,he.CR)(ux(o?r:0),4),h=c[0],d=c[1],f=c[2],p=c[3],g=(0,he.CR)(ux(a),4),m=g[0],v=g[1],y=g[2],x=g[3],b=(0,he.CR)([p+d,h+f],2),_=b[0],E=b[1],w=(0,he.CR)([x+v,m+y],2),T=w[0],S=w[1];if("l"===u[0])return new sx(s.x,s.y,l.width+s.width+_+T,Math.max(l.height+S,s.height));if("t"===u[0])return new sx(s.x,s.y,Math.max(l.width+T,s.width),l.height+s.height+E+S);var M=(0,he.CR)([e.attributes.width||l.width,e.attributes.height||l.height],2),C=M[0],A=M[1];return new sx(l.x,l.y,C+s.width+_+T,A+s.height+E+S)}(i,r):t.prototype.getBBox.call(this)},e.prototype.render=function(t,e){var n=this.attributes,i=n.width,r=n.height,a=n.x,o=void 0===a?0:a,s=n.y,l=void 0===s?0:s,u=ox(e);e.style.transform="translate(".concat(o,", ").concat(l,")"),this.renderTitle(u,i,r),this.renderItems(u,this.availableSpace),this.adjustLayout()},e}(Ky);function tb(t){const{width:e,height:n,renderer:i,containerStyle:r}=t,a=function(t){var e;const{container:n,className:i,graphCanvas:r}=t;if(n)return"string"==typeof n?document.getElementById(n):n;const a=_v(i,!1);return null===(e=r.getContainer())||void 0===e||e.appendChild(a),a}(t),[o,s]=function(t){const{width:e,height:n,placement:i,graphCanvas:r}=t,[a,o]=r.getSize(),[s,l]=gd(i);return[s*(a-e),l*(o-n)]}(t);Object.assign(a.style,Object.assign({position:"absolute",left:o+"px",top:s+"px",width:e+"px",height:n+"px"},r));return[a,new Kl({width:e,height:n,container:a,renderer:i||new ig})]}var eb=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{const{graph:t}=this.context;t.on(hc.AFTER_DRAW,this.createElement)},this.changeState=(t,e)=>{const{graph:n}=this.context,{typePrefix:i}=this,r=Zd(t,[i,"id"]),a=Zd(t,[i,"style","labelText"]),[o]=r.split("__"),s=this.fieldMap[o].get(a)||[];n.setElementState(Object.fromEntries(null==s?void 0:s.map((t=>[t,e]))))},this.click=t=>{if("hover"===this.options.trigger)return;const e=Zd(t,[this.typePrefix,"id"]);this.selectedItems.includes(e)?(this.selectedItems=this.selectedItems.filter((t=>t!==e)),this.changeState(t,[])):(this.selectedItems.push(e),this.changeState(t,"selected"))},this.mouseleave=t=>{"click"!==this.options.trigger&&(this.selectedItems=[],this.changeState(t,[]))},this.mouseenter=t=>{if("click"===this.options.trigger)return;const e=Zd(t,[this.typePrefix,"id"]);this.selectedItems.includes(e)?this.selectedItems=this.selectedItems.filter((t=>t!==e)):(this.selectedItems.push(e),this.changeState(t,"active"))},this.setFieldMap=(t,e,n)=>{if(!t)return;const i=this.fieldMap[n];if(i)if(i.has(t)){const n=i.get(t);n&&(n.push(e),i.set(t,n))}else i.set(t,[e])},this.getEvents=()=>({mouseenter:this.mouseenter,mouseleave:this.mouseleave,click:this.click}),this.getMarkerData=(t,e)=>{if(!t)return[];const{model:n,element:i}=this.context,{nodes:r,edges:a,combos:o}=n.getData(),s={},l=e=>(0,en.Z)(t)?t(e):t,u={node:"circle",edge:"line",combo:"rect"},c={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"},h=(t,e)=>{t.forEach((t=>{const{id:n}=t,r=Zd(t,["data",l(t)]),a=(null==i?void 0:i.getElementType(e,t))||"circle",o=((t,e)=>null==i?void 0:i.getElementComputedStyle(t,e))(e,t),h=("edge"===e?null==o?void 0:o.stroke:null==o?void 0:o.fill)||"#1783ff";n&&r&&r.replace(/\s+/g,"")&&(this.setFieldMap(r,n,e),s[r]||(s[r]={id:`${e}__${n}`,label:r,marker:c[a]||u[e],elementType:e,lineWidth:1,stroke:h,fill:h}))}))};switch(e){case"node":h(r,"node");break;case"edge":h(a,"edge");break;case"combo":h(o,"combo");break;default:return[]}return Object.values(s)},this.createElement=()=>{if(this.draw)return void this.updateElement();const t=this.options,{width:e,height:n,nodeField:i,edgeField:r,comboField:a,trigger:o,position:s,container:l,containerStyle:u,className:c}=t,h=eb(t,["width","height","nodeField","edgeField","comboField","trigger","position","container","containerStyle","className"]),d=this.getMarkerData(i,"node"),f=this.getMarkerData(r,"edge"),p=this.getMarkerData(a,"combo"),g=[...d,...p,...f],m=Object.assign({width:e,height:n,data:g,itemMarkerLineWidth:({lineWidth:t})=>t,itemMarker:({marker:t})=>t,itemMarkerStroke:({stroke:t})=>t,itemMarkerFill:({fill:t})=>t,gridCol:d.length},h,this.getEvents()),v=new Jx({className:"legend",style:m});this.category=v;this.upsertCanvas().appendChild(v),this.draw=!0},this.bindEvents()}update(t){super.update(t),this.clear(),this.createElement()}clear(){var t,e;null===(t=this.canvas)||void 0===t||t.destroy(),null===(e=this.container)||void 0===e||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:r=n,position:a,container:o,containerStyle:s,className:l}=this.options,[u,c]=tb({width:i,height:r,graphCanvas:t,container:o,containerStyle:s,placement:a,className:"legend"});return this.container=u,l&&u.classList.add(l),this.canvas=c,this.canvas}destroy(){this.clear(),this.context.graph.off(hc.AFTER_DRAW,this.createElement),super.destroy()}}nb.defaultOptions={position:"bottom",trigger:"hover",orientation:"horizontal",layout:"flex",itemSpacing:4,rowPadding:10,colPadding:10,itemMarkerSize:16,itemLabelFontSize:16,width:240,height:160};class ib extends bv{constructor(t,e){super(t,Object.assign({},ib.defaultOptions,e)),this.onDraw=t=>{var e;(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.render)||this.onRender()},this.shapes=new Map,this.landmarkMap=new Map,this.mask=null,this.isMaskDragging=!1,this.onMaskDragStart=t=>{this.mask&&(this.isMaskDragging=!0,this.mask.setPointerCapture(t.pointerId),this.mask.addEventListener("pointermove",this.onMaskDrag),this.mask.addEventListener("pointerup",this.onMaskDragEnd),this.mask.addEventListener("pointercancel",this.onMaskDragEnd))},this.onMaskDrag=t=>{if(!this.mask||!this.isMaskDragging)return;const{size:[e,n]}=this.options,{movementX:i,movementY:r}=t,{left:a,top:o,width:s,height:l}=this.mask.style,[,,u,c]=this.maskBBox;let h=parseInt(a)+i,d=parseInt(o)+r,f=parseInt(s),p=parseInt(l);h<0&&(h=0),d<0&&(d=0),h+f>e&&(h=ab(e-f,0)),d+p>n&&(d=ab(n-p,0)),f0?(h=ab(h-i,0),f=rb(f+i,e)):i<0&&(f=rb(f-i,e))),p0?(d=ab(d-r,0),p=rb(p+r,n)):r<0&&(p=rb(p-r,n))),Object.assign(this.mask.style,{left:h+"px",top:d+"px",width:f+"px",height:p+"px"});const g=parseInt(a)-h,m=parseInt(o)-d;if(0===g&&0===m)return;const v=this.context.canvas.getCamera().getZoom()/this.canvas.getCamera().getZoom();this.context.graph.translateBy([g*v,m*v],!1)},this.onMaskDragEnd=t=>{this.mask&&(this.isMaskDragging=!1,this.mask.releasePointerCapture(t.pointerId),this.mask.removeEventListener("pointermove",this.onMaskDrag),this.mask.removeEventListener("pointerup",this.onMaskDragEnd),this.mask.removeEventListener("pointercancel",this.onMaskDragEnd))},this.onTransform=Fc((()=>{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=Nm((()=>{this.renderMinimap(),this.renderMask()}),this.options.delay,!0)}bindEvents(){const{graph:t}=this.context;t.on(hc.AFTER_DRAW,this.onDraw),t.on(hc.AFTER_RENDER,this.onRender),t.on(hc.AFTER_TRANSFORM,this.onTransform)}unbindEvents(){const{graph:t}=this.context;t.off(hc.AFTER_DRAW,this.onDraw),t.off(hc.AFTER_RENDER,this.onRender),t.off(hc.AFTER_TRANSFORM,this.onTransform)}renderMinimap(){const t=this.getElements(),e=this.initCanvas();this.setShapes(e,t)}getElements(){const{filter:t}=this.options,{model:e}=this.context,n=e.getData();if(!t)return n;const{nodes:i,edges:r,combos:a}=n;return{nodes:i.filter((e=>t(Dh(e),"node"))),edges:r.filter((e=>t(Dh(e),"edge"))),combos:a.filter((e=>t(Dh(e),"combo")))}}setShapes(t,e){const{nodes:n,edges:i,combos:r}=e,{shape:a}=this.options,{element:o}=this.context;if("key"===a){const e=new Set,a=n=>{const i=Dh(n);e.add(i);const r=o.getElement(i);if(!r)return;const a=r.getShape("key"),s=this.shapes.get(i)||a.cloneNode();s.setPosition(a.getPosition()),r.style.zIndex&&(s.style.zIndex=r.style.zIndex),s.id=r.id,this.shapes.has(i)?Object.entries(a.attributes).forEach((([t,e])=>{s.style[t]!==e&&(s.style[t]=e)})):(t.appendChild(s),this.shapes.set(i,s))};return i.forEach(a),r.forEach(a),n.forEach(a),void this.shapes.forEach(((n,i)=>{e.has(i)||(t.removeChild(n),this.shapes.delete(i))}))}const s=(t,e)=>{const n=o.getElement(t).getPosition();return e.setPosition(n),e};t.removeChildren(),i.forEach((e=>t.appendChild(a(Dh(e),"edge")))),r.forEach((e=>{t.appendChild(s(Dh(e),a(Dh(e),"combo")))})),n.forEach((e=>{t.appendChild(s(Dh(e),a(Dh(e),"node")))}))}initCanvas(){const{renderer:t,size:[e,n]}=this.options;if(this.canvas){const{width:i,height:r}=this.canvas.getConfig();e===i&&n===r||this.canvas.resize(e,n),t&&this.canvas.setRenderer(t)}else{const{className:i,position:r,container:a,containerStyle:o}=this.options,[s,l]=tb({renderer:t,width:e,height:n,placement:r,className:"minimap",container:a,containerStyle:o,graphCanvas:this.context.canvas});i&&s.classList.add(i),this.container=s,this.canvas=l}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 r=this.canvas.getCamera().createLandmark(i,{position:t,focalPoint:e,zoom:n});return this.landmarkMap.set(i,r),r}setCamera(){var t;const{canvas:e}=this.context,n=null===(t=this.canvas)||void 0===t?void 0:t.getCamera();if(!n)return;const{size:[i,r],padding:a}=this.options,[o,s,l,u]=Uc(a),{min:c,max:h,center:d}=e.getBounds("elements"),f=(i-u-s)/(h[0]-c[0]),p=(r-o-l)/(h[1]-c[1]),g=Math.min(f,p),m=this.createLandmark(d,d,g);n.gotoLandmark(m,0)}get maskBBox(){const{canvas:t}=this.context,e=t.getSize(),n=t.getCanvasByViewport([0,0]),i=t.getCanvasByViewport(e),r=this.canvas.canvas2Viewport(_d(n)),a=this.canvas.canvas2Viewport(_d(i)),o=a.x-r.x,s=a.y-r.y;return[r.x,r.y,o,s]}calculateMaskBBox(){const{size:[t,e]}=this.options;let[n,i,r,a]=this.maskBBox;return n<0&&(r=rb(r+n,t),n=0),i<0&&(a=rb(a+i,e),i=0),n+r>t&&(r=ab(t-n,0)),i+a>e&&(a=ab(e-i,0)),[rb(n,t),rb(i,e),ab(r,0),ab(a,0)]}renderMask(){const{maskStyle:t}=this.options;this.mask||(this.mask=document.createElement("div"),this.mask.addEventListener("pointerdown",this.onMaskDragStart)),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;this.unbindEvents(),this.canvas.destroy(),null===(t=this.mask)||void 0===t||t.remove(),super.destroy()}}ib.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 rb=(t,e)=>Math.min(t,e),ab=(t,e)=>Math.max(t,e);var ob=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};const sb={x1:0,y1:0,x2:0,y2:0,visibility:"hidden"};class lb extends bv{constructor(t,e){super(t,Object.assign({},lb.defaultOptions,e)),this.initSnapline=()=>{const t=this.context.canvas.getLayer("transient");this.horizontalLine||(this.horizontalLine=t.appendChild(new Al({style:Object.assign(Object.assign({},sb),this.options.horizontalLineStyle)}))),this.verticalLine||(this.verticalLine=t.appendChild(new Al({style:Object.assign(Object.assign({},sb),this.options.verticalLineStyle)})))},this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!0,this.autoSnapToLine=(t,e,n)=>ob(this,void 0,void 0,(function*(){const{verticalX:i,horizontalY:r}=n,{tolerance:a}=this.options,{min:[o,s],max:[l,u],center:[c,h]}=e;let d=0,f=0;null!==i&&(ub(l,i){const{target:e}=t,n=.5;if(this.isHorizontalSticking||this.isVerticalSticking){const[i,r]=this.getDelta(t);if(this.isHorizontalSticking&&this.isVerticalSticking&&Math.abs(i)<=n&&Math.abs(r)<=n)return this.context.graph.translateElementBy({[e.id]:[-i,-r]},!1),!1;if(this.isHorizontalSticking&&Math.abs(r)<=n)return this.context.graph.translateElementBy({[e.id]:[0,-r]},!1),!1;if(this.isVerticalSticking&&Math.abs(i)<=n)return this.context.graph.translateElementBy({[e.id]:[-i,0]},!1),!1;this.isHorizontalSticking=!1,this.isVerticalSticking=!1,this.enableStick=!1,setTimeout((()=>{this.enableStick=!0}),200)}return this.enableStick},this.calcSnaplineMetadata=(t,e)=>{const{tolerance:n,shape:i}=this.options,{min:[r,a],max:[o,s],center:[l,u]}=e;let c=null,h=null,d=null,f=null,p=null,g=null;return this.getNodes().some((e=>{if(ec(t.id,e.id))return!1;const m=cb(e,i).getRenderBounds(),{min:[v,y],max:[x,b],center:[_,E]}=m;return null===c&&(ub(_,l){this.initSnapline()},this.onDrag=t=>ob(this,void 0,void 0,(function*(){const{target:e}=t;if(this.options.autoSnap){if(!this.enableSnap(t))return}const n=cb(e,this.options.shape).getRenderBounds(),i=this.calcSnaplineMetadata(e,n);this.hideSnapline(),null===i.verticalX&&null===i.horizontalY||this.updateSnapline(i),this.options.autoSnap&&(yield this.autoSnapToLine(e.id,n,i))})),this.onDragEnd=()=>{this.hideSnapline()},this.bindEvents()}getNodes(){var t;const{filter:e}=this.options,n=((null===(t=this.context.element)||void 0===t?void 0:t.getNodes())||[]).filter((t=>{var e;return"hidden"!==Zd(t,["style","visibility"])&&(null===(e=this.context.viewport)||void 0===e?void 0:e.isInViewport(t.getRenderBounds()))}));return e?n.filter((t=>e(t))):n}hideSnapline(){this.horizontalLine.style.visibility="hidden",this.verticalLine.style.visibility="hidden"}getLineWidth(t){const{lineWidth:e}=this.options[`${t}LineStyle`];return+(e||sb.lineWidth||1)/this.context.graph.getZoom()}updateSnapline(t){const{verticalX:e,verticalMinY:n,verticalMaxY:i,horizontalY:r,horizontalMinX:a,horizontalMaxX:o}=t,[s,l]=this.context.canvas.getSize(),{offset:u}=this.options;null!==r?Object.assign(this.horizontalLine.style,{x1:u===1/0?0:a-u,y1:r,x2:u===1/0?s:o+u,y2:r,visibility:"visible",lineWidth:this.getLineWidth("horizontal")}):this.horizontalLine.style.visibility="hidden",null!==e?Object.assign(this.verticalLine.style,{x1:e,y1:u===1/0?0:n-u,x2:e,y2:u===1/0?l:i+u,visibility:"visible",lineWidth:this.getLineWidth("vertical")}):this.verticalLine.style.visibility="hidden"}getDelta(t){const e=this.context.graph.getZoom();return id([t.dx,t.dy],e)}bindEvents(){return ob(this,void 0,void 0,(function*(){const{graph:t}=this.context;t.on(fc.DRAG_START,this.onDragStart),t.on(fc.DRAG,this.onDrag),t.on(fc.DRAG_END,this.onDragEnd)}))}unbindEvents(){const{graph:t}=this.context;t.off(fc.DRAG_START,this.onDragStart),t.off(fc.DRAG,this.onDrag),t.off(fc.DRAG_END,this.onDragEnd)}destroyElements(){var t,e;null===(t=this.horizontalLine)||void 0===t||t.destroy(),null===(e=this.verticalLine)||void 0===e||e.destroy()}destroy(){this.destroyElements(),this.unbindEvents(),super.destroy()}}lb.defaultOptions={tolerance:5,offset:20,autoSnap:!0,shape:"key",verticalLineStyle:{stroke:"#1783FF"},horizontalLineStyle:{stroke:"#1783FF"},filter:()=>!0};const ub=(t,e)=>Math.abs(t-e),cb=(t,e)=>"function"==typeof e?e(t):t.getShape(e);function hb(t,e){var n={YYYY:t.getFullYear(),MM:t.getMonth()+1,DD:t.getDate(),HH:t.getHours(),mm:t.getMinutes(),ss:t.getSeconds()},i=e;return Object.keys(n).forEach((function(t){var e=n[t];i=i.replace(t,"YYYY"===t?"".concat(e):"".concat(e).padStart(2,"0"))})),i}var db={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 Nl({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:[]},fb=((0,Qh.Z)({},db,{style:{type:"arc"}}),(0,Qh.Z)({},db,{style:{}}),lx({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 pb(t,e){return[t[0]*e,t[1]*e]}function gb(t,e){return[t[0]+e[0],t[1]+e[1]]}function mb(t,e){return[t[0]-e[0],t[1]-e[1]]}function vb(t,e){return[Math.min(t[0],e[0]),Math.min(t[1],e[1])]}function yb(t,e){return[Math.max(t[0],e[0]),Math.max(t[1],e[1])]}function xb(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))}function bb(t){if(0===t[0]&&0===t[1])return[0,0];var e=Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2));return[t[0]/e,t[1]/e]}function _b(t){return t*Math.PI/180}function Eb(t){return Number((180*t/Math.PI).toPrecision(5))}function wb(t,e){return t.style.opacity||(t.style.opacity=1),_x(t,{opacity:0},e)}var Tb=["$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 Sb(t){return Tb.includes(t)}function Mb(t){var e={};for(var n in t)Sb(n)&&(e[n]=t[n]);return e}var Cb=lx({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Ab(t){return t.reduce((function(t,e,n){return t.push((0,he.ev)([0===n?"M":"L"],(0,he.CR)(e),!1)),t}),[])}function Ob(t,e,n){return"surround"===e.type?function(t,e,n){var i=e.connect,r=void 0===i?"line":i,a=e.center;if("line"===r)return Ab(t);if(!a)return[];var o=xb(t[0],a),s=n?0:1;return t.reduce((function(t,e,n){return 0===n?t.push((0,he.ev)(["M"],(0,he.CR)(e),!1)):t.push((0,he.ev)(["A",o,o,0,0,s],(0,he.CR)(e),!1)),t}),[])}(t,e,n):Ab(t)}function Nb(t,e,n){var i=n.type,r=n.connect,a=n.center,o=n.closed?[["Z"]]:[],s=(0,he.CR)([Ob(t,n),Ob(e.slice().reverse(),n,!0)],2),l=s[0],u=s[1],c=(0,he.CR)([t[0],e.slice(-1)[0]],2),h=c[0],d=c[1],f=function(t,e){return[l,t,u,e,o].flat()};if("line"===r||"surround"===i)return f([(0,he.ev)(["L"],(0,he.CR)(d),!1)],[(0,he.ev)(["L"],(0,he.CR)(h),!1)]);if(!a)throw new Error("Arc grid need to specified center");var p=(0,he.CR)([xb(d,a),xb(h,a)],2),g=p[0],m=p[1];return f([(0,he.ev)(["A",g,g,0,0,1],(0,he.CR)(d),!1),(0,he.ev)(["L"],(0,he.CR)(d),!1)],[(0,he.ev)(["A",m,m,0,0,0],(0,he.CR)(h),!1),(0,he.ev)(["L"],(0,he.CR)(h),!1)])}var Pb=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,e){t.type,t.center,t.areaFill,t.closed;var n=(0,he._T)(t,["type","center","areaFill","closed"]),i=function(t){var e=t.data,n=void 0===e?[]:e;return t.closed?n.map((function(t){var e=t.points,n=(0,he.CR)(e,1)[0];return(0,he.pi)((0,he.pi)({},t),{points:(0,he.ev)((0,he.ev)([],(0,he.CR)(e),!1),[n],!1)})})):n}(t),r=ox(e).maybeAppendByClassName(Cb.lineGroup,"g"),a=ox(e).maybeAppendByClassName(Cb.regionGroup,"g"),o=function(t,e,n,i){var r=n.animate,a=n.isBillboard,o=e.map((function(t,e){return{id:t.id||"grid-line-".concat(e),d:Ob(t.points,n)}}));return t.selectAll(Cb.line.class).data(o,(function(t){return t.id})).join((function(t){return t.append("path").each((function(t,e){var n=mx(Mb((0,he.pi)({d:t.d},i)),[t,e,o]);this.attr((0,he.pi)({class:Cb.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:a},n))}))}),(function(t){return t.transition((function(t,e){return _x(this,mx(Mb((0,he.pi)({d:t.d},i)),[t,e,o]),r.update)}))}),(function(t){return t.transition((function(){var t=this,e=wb(this,r.exit);return yx(e,(function(){return t.remove()})),e}))})).transitions()}(r,i,t,n),s=function(t,e,n){var i=n.animate,r=n.connect,a=n.areaFill;if(e.length<2||!a||!r)return[];for(var o=Array.isArray(a)?a:[a,"transparent"],s=function(t){return o[t%o.length]},l=[],u=0;u180?1:0,E=t>e?0:1;return"M".concat(p,",").concat(g,",A").concat(s,",").concat(l,",0,").concat(_,",").concat(E,",").concat(v,",").concat(y)}function Zb(t,e,n,i){var r=e.startAngle,a=e.endAngle,o=e.center,s=e.radius;return t.selectAll(fb.line.class).data([{d:Vb.apply(void 0,(0,he.ev)((0,he.ev)([r,a],(0,he.CR)(o),!1),[s],!1))}],(function(t,e){return e})).join((function(t){return t.append("path").attr("className",fb.line.name).styles(e).styles({d:function(t){return t.d}})}),(function(t){return t.transition((function(){var t=this,e=function(t,e,n,i){if(!i)return t.attr("__keyframe_data__",n),null;var r=i.duration,a=void 0===r?0:r,o=Lb(e,n),s=Math.ceil(+a/16),l=new Array(s).fill(0).map((function(t,e,n){return{__keyframe_data__:o(e/(n.length-1))}}));return t.animate(l,(0,he.pi)({fill:"both"},i))}(this,function(t){var e=t.attributes,n=e.startAngle,i=e.endAngle,r=e.center,a=e.radius;return(0,he.ev)((0,he.ev)([n,i],(0,he.CR)(r),!1),[a],!1)}(this),(0,he.ev)((0,he.ev)([r,a],(0,he.CR)(o),!1),[s],!1),i.update);if(e){var n=function(){var e=Zd(t.attributes,"__keyframe_data__");t.style.d=Vb.apply(void 0,(0,he.ev)([],(0,he.CR)(e),!1))};e.onframe=n,e.onfinish=n}return e})).styles(e)}),(function(t){return t.remove()})).styles(n).transitions()}function Wb(t){var e=(0,he.CR)(t,2),n=(0,he.CR)(e[0],2),i=n[0],r=n[1],a=(0,he.CR)(e[1],2);return{x1:i,y1:r,x2:a[0],y2:a[1]}}function Xb(t,e,n,i){var r=e.showTrunc,a=e.startPos,o=e.endPos,s=e.truncRange,l=e.lineExtension,u=(0,he.CR)([a,o],2),c=(0,he.CR)(u[0],2),h=c[0],d=c[1],f=(0,he.CR)(u[1],2),p=f[0],g=f[1],m=(0,he.CR)(l?function(t,e,n){void 0===n&&(n=[0,0]);var i=(0,he.CR)([t,e,n],3),r=(0,he.CR)(i[0],2),a=r[0],o=r[1],s=(0,he.CR)(i[1],2),l=s[0],u=s[1],c=(0,he.CR)(i[2],2),h=c[0],d=c[1],f=(0,he.CR)([l-a,u-o],2),p=f[0],g=f[1],m=Math.sqrt(Math.pow(p,2)+Math.pow(g,2)),v=(0,he.CR)([-h/m,d/m],2),y=v[0],x=v[1];return[y*p,y*g,x*p,x*g]}(a,o,l):new Array(4).fill(0),4),v=m[0],y=m[1],x=m[2],b=m[3],_=function(e){return t.selectAll(fb.line.class).data(e,(function(t,e){return e})).join((function(t){return t.append("line").attr("className",(function(t){return"".concat(fb.line.name," ").concat(t.className)})).styles(n).transition((function(t){return _x(this,Wb(t.line),!1)}))}),(function(t){return t.styles(n).transition((function(t){return _x(this,Wb(t.line),i.update)}))}),(function(t){return t.remove()})).transitions()};if(!r||!s)return _([{line:[[h+v,d+y],[p+x,g+b]],className:fb.line.name}]);var E=(0,he.CR)(s,2),w=E[0],T=E[1],S=p-h,M=g-d,C=(0,he.CR)([h+S*w,d+M*w],2),A=C[0],O=C[1],N=(0,he.CR)([h+S*T,d+M*T],2),P=N[0],L=N[1],R=_([{line:[[h+v,d+y],[A,O]],className:fb.lineFirst.name},{line:[[P,L],[p+x,g+b]],className:fb.lineSecond.name}]);return function(t,e){e.truncRange,e.truncShape,e.lineExtension}(0,e),R}function Yb(t,e,n){var i,r=e.type,a=ex(e,"line");return i="linear"===r?Xb(t,e,Rb(a,"arrow"),n):Zb(t,e,Rb(a,"arrow"),n),function(t,e,n,i){var r,a=n.showArrow,o=n.showTrunc,s=n.lineArrow,l=n.lineArrowOffset,u=n.lineArrowSize;if(r="arc"===e?t.select(fb.line.class):o?t.select(fb.lineSecond.class):t.select(fb.line.class),!a||!s||"arc"===n.type&&Hb(n.startAngle,n.endAngle)){var c=r.node();c&&(c.style.markerEnd=void 0)}else{var h=Bx(s);h.attr(i),Ex(h,u,!0),r.style("markerEnd",h).style("markerEndOffset",-l)}}(t,r,e,a),i}function qb(t){var e=t.type,n=t.gridCenter;return"linear"===e?n:n||t.center}function $b(t,e){var n=e.gridLength;return t.map((function(t,i){var r=t.value,a=(0,he.CR)(Gb(r,e),2),o=a[0],s=a[1],l=(0,he.CR)(pb(function(t,e){return Fb(t,e.gridDirection,e)}(r,e),n),2);return{id:i,points:[[o,s],[o+l[0],s+l[1]]]}}))}function Kb(t,e,n,i){var r=ex(n,"grid"),a=r.type,o=r.areaFill,s=qb(n),l=kb(e,n.gridFilter),u="segment"===a?$b(l,n):function(t,e){var n=e.gridControlAngles,i=qb(e);if(!i)throw new Error("grid center is not provide");if(t.length<2)throw new Error("Invalid grid data");if(!n||0===n.length)throw new Error("Invalid gridControlAngles");var r=(0,he.CR)(i,2),a=r[0],o=r[1];return t.map((function(t,i){var r=t.value,s=(0,he.CR)(Gb(r,e),2),l=s[0],u=s[1],c=(0,he.CR)([l-a,u-o],2),h=c[0],d=c[1],f=[];return n.forEach((function(t){var e=_b(t),n=(0,he.CR)([Math.cos(e),Math.sin(e)],2),i=n[0],r=n[1],s=h*i-d*r+a,l=h*r+d*i+o;f.push([s,l])})),{points:f,id:i}}))}(l,n),c=(0,he.pi)((0,he.pi)({},r),{center:s,areaFill:(0,en.Z)(o)?l.map((function(t,e){return mx(o,[t,e,l])})):o,animate:i,data:u});return t.selectAll(fb.grid.class).data([1]).join((function(t){return t.append((function(){return new Pb({style:c})})).attr("className",fb.grid.name)}),(function(t){return t.transition((function(){return this.update(c)}))}),(function(t){return t.remove()})).transitions()}function Qb(t,e,n,i,r){return void 0===i&&(i=!0),void 0===r&&(r=!1),!!(i&&t===e||r&&t===n)||t>e&&t0,m=i-l,v=r-u,y=c*v-h*m;if(y<0===g)return!1;var x=d*v-f*m;return x<0!==g&&(y>p!==g&&x>p!==g)}function s_(t,e){return[[t[0],t[1],t[2],t[3]],[t[2],t[3],t[4],t[5]],[t[4],t[5],t[6],t[7]],[t[6],t[7],t[0],t[1]]].some((function(t){return o_(e,t)}))}function l_(t,e,n){var i,r,a=e.crossPadding,o=new Set,s=null,l=function(t,e){var n=t.type,i=t.labelDirection,r=t.crossSize;if(!r)return!1;if("arc"===n){var a=t.center,o=t.radius,s=(0,he.CR)(a,2),l=s[0],u=s[1],c="negative"===i?0:r,h=-o-c,d=o+c,f=(0,he.CR)(ux(e),4),p=f[0],g=f[1],m=f[2],v=f[3];return new e_(l+h-v,u+h-p,l+d+g,u+d+m)}var y=(0,he.CR)(t.startPos,2),x=y[0],b=y[1],_=(0,he.CR)(t.endPos,2),E=_[0],w=_[1],T=(0,he.CR)(Ub(t)?[-e,0,e,0]:[0,e,0,-e],4),S=T[0],M=T[1],C=T[2],A=T[3],O=pb(zb(0,t),r),N=new e_(x,b,E,w);return N.x1+=A,N.y1+=S,N.x2+=M+O[0],N.y2+=C+O[1],N}(e,a),u=function(t){return!l||function(t,e,n){var i=t.x1,r=t.x2,a=t.y1,o=t.y2;return a_([[i,a],[r,a],[r,o],[i,o]],n_(e,n))}(l,t)},c=function(t,e){return!t||!t.firstChild||!function(t,e,n){var i,r,a=n_(t,n).flat(1),o=n_(e,n).flat(1),s=[[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,he.XA)(s),u=l.next();!u.done;u=l.next())if(s_(o,u.value))return!0}catch(t){i={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(i)throw i.error}}return!1}(t.firstChild,e.firstChild,ux(n))};try{for(var h=(0,he.XA)(t),d=h.next();!d.done;d=h.next()){var f=d.value;u(f)?!s||c(s,f)?s=f:(o.add(s),o.add(f)):o.add(f)}}catch(t){i={error:t}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(i)throw i.error}}return Array.from(o)}function u_(t,e){return void 0===e&&(e={}),(0,le.Z)(t)?0:"number"==typeof t?t:Math.floor(Fx(t,e))}var c_=function(t,e){var n=e.seq,i=void 0===n?2:n;return t.filter((function(t,e){return!(e%i)||(Vy(t),!1)}))};var h_=new Map([["hide",function(t,e,n,i){var r=t.length,a=e.keepHeader,o=e.keepTail;if(!(r<=1||2===r&&a&&o)){var s,l,u,c=c_,h=function(t){return t.forEach(i.show),t},d=2,f=t.slice(),p=t.slice(),g=Math.min.apply(Math,(0,he.ev)([1],(0,he.CR)(t.map((function(t){return t.getBBox().width}))),!1));if("linear"===n.type&&(jb(n)||Ub(n))){var m=kx(t[0]).left,v=kx(t[r-1]).right,y=Math.abs(v-m)||1;d=Math.max(Math.floor(r*g/y),d)}for(a&&(s=f.splice(0,1)[0]),o&&(l=f.splice(-1,1)[0],f.reverse()),h(f);dg+p;b-=p){var _=x(b);if("object"==typeof _)return _.value}}}],["wrap",function(t,e,n,i){var r=e.wordWrapWidth,a=void 0===r?50:r,o=e.maxLines,s=void 0===o?3:o,l=e.recoverWhenFailed,u=void 0===l||l,c=e.margin,h=void 0===c?[0,0,0,0]:c,d=t.map((function(t){return t.attr("maxLines")||1})),f=Math.min.apply(Math,(0,he.ev)([],(0,he.CR)(d),!1)),p=function(t){var e=t.type,n=t.labelDirection;return"linear"===e&&jb(t)?"negative"===n?"bottom":"top":"middle"}(n),g=function(e){return t.forEach((function(t,n){var r=Array.isArray(e)?e[n]:e;i.wrap(t,a,r,p)}))};if(!(f>s)){for(var m=f;m<=s;m++)if(g(m),l_(t,n,h).length<1)return;u&&g(d)}}]]);function d_(){for(var t=[],e=0;e1)})(t,e,r)&&(null==a||a(t,i,e,n))}))}(this.node().childNodes,t,{hide:Vy,show:Hy,rotate:function(e,n){!function(t,e,n){e.setLocalEulerAngles(t);var i=m_(e.__data__.value,t,n),r=e.querySelector(fb.labelItem.class);r&&y_(r,i)}(+n,e,t)},ellipsis:function(t,e,n){t&&Ux(t,e||1/0,n)},wrap:function(t,e,n){var i,r;t&&(void 0===(i=n)&&(i=2),void 0===r&&(r="top"),jx(t,{wordWrap:!0,wordWrapWidth:e,maxLines:i,textBaseline:r}))},getTextShape:function(t){return t.querySelector("text")}})}function b_(t,e,n,i,r){var a=n.indexOf(e),o=ox(t).append(function(t,e,n,i){var r=i.labelFormatter;return(0,en.Z)(r)?function(){return Bx(mx(r,[t,e,n,zb(t.value,i)]))}:function(){return Bx(t.label||"")}}(e,a,n,r)).attr("className",fb.labelItem.name).node(),s=(0,he.CR)(ix(Db(i,[e,a,n])),2),l=s[0],u=s[1],c=u.transform,h=(0,he._T)(u,["transform"]);Jb(o,c);var d=g_(e,o,r);return o.getLocalEulerAngles()||o.setLocalEulerAngles(d),y_(o,(0,he.pi)((0,he.pi)({},m_(e.value,d,r)),l)),t.attr(h),o}function __(t,e,n,i){var r=kb(e,n.labelFilter),a=ex(n,"label");return t.selectAll(fb.label.class).data(r,(function(t,e){return e})).join((function(i){return i.append("g").attr("className",fb.label.name).transition((function(t){b_(this,t,e,a,n);var i=v_(t,e,n),r=i.x,o=i.y;return this.style.transform="translate(".concat(r,", ").concat(o,")"),null})).call((function(){x_.call(t,n)}))}),(function(r){return r.transition((function(t){var r=function(t,e,n,i){if(void 0===i&&(i="destroy"),function(t,e){return"text"===t.nodeName&&"text"===e.nodeName&&t.attributes.text===e.attributes.text}(t,e))return t.remove(),[null];var r=function(){"destroy"===i?t.destroy():"hide"===i&&Vy(t),e.isVisible()&&Hy(e)};if(!n)return r(),[null];var a=n.duration,o=void 0===a?0:a,s=n.delay,l=void 0===s?0:s,u=Math.ceil(+o/2),c=+o/4,h=(0,he.CR)(t.getGeometryBounds().center,2),d=h[0],f=h[1],p=(0,he.CR)(e.getGeometryBounds().center,2),g=p[0],m=p[1],v=(0,he.CR)([(d+g)/2-d,(f+m)/2-f],2),y=v[0],x=v[1],b=t.style.opacity,_=void 0===b?1:b,E=e.style.opacity,w=void 0===E?1:E,T=t.style.transform||"",S=e.style.transform||"",M=t.animate([{opacity:_,transform:"translate(0, 0) ".concat(T)},{opacity:0,transform:"translate(".concat(y,", ").concat(x,") ").concat(T)}],(0,he.pi)((0,he.pi)({fill:"both"},n),{duration:l+u+c})),C=e.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-x,") ").concat(S),offset:.01},{opacity:w,transform:"translate(0, 0) ".concat(S)}],(0,he.pi)((0,he.pi)({fill:"both"},n),{duration:u+c,delay:l+u-c}));return yx(C,r),[M,C]}(this.querySelector(fb.labelItem.class),b_(this,t,e,a,n),i.update),o=v_(t,e,n),s=o.x,l=o.y,u=_x(this,{transform:"translate(".concat(s,", ").concat(l,")")},i.update);return(0,he.ev)((0,he.ev)([],(0,he.CR)(r),!1),[u],!1)})).call((function(e){var i,r,a=Zd(e,"_transitions").flat().filter(t_);r=function(){x_.call(t,n)},0===(i=a).length?r():Promise.all(i.map((function(t){return null==t?void 0:t.finished}))).then(r)}))}),(function(t){return t.transition((function(){var t=this,e=wb(this.childNodes[0],i.exit);return yx(e,(function(){return ox(t).remove()})),e}))})).transitions()}function E_(t,e){return Fb(t,e.tickDirection,e)}function w_(t,e,n,i,r){var a=r.tickLength,o=(0,he.CR)(function(t,e){var n=(0,he.CR)(t,2);return[[0,0],[n[0]*e,n[1]*e]]}(i,mx(a,[t,e,n])),2),s=(0,he.CR)(o[0],2),l=s[0],u=s[1],c=(0,he.CR)(o[1],2);return{x1:l,x2:c[0],y1:u,y2:c[1]}}function T_(t,e,n,i,r,a){var o=function(t,e,n,i,r){var a=r.tickFormatter,o=E_(e.value,r),s="line";return(0,en.Z)(a)&&(s=function(){return mx(a,[e,n,i,o])}),t.append(s).attr("className",fb.tickItem.name)}(ox(this),t,e,n,i);!function(t,e,n,i,r,a,o){var s=E_(t.value,a),l=w_(t,e,n,s,a),u=l.x1,c=l.x2,h=l.y1,d=l.y2,f=(0,he.CR)(ix(Db(o,[t,e,n,s])),2),p=f[0],g=f[1];"line"===i.node().nodeName&&i.styles((0,he.pi)({x1:u,x2:c,y1:h,y2:d},p)),r.attr(g),i.styles(p)}(t,e,n,o,this,i,r);var s=(0,he.CR)(Gb(t.value,i),2),l=s[0],u=s[1];return _x(this,{transform:"translate(".concat(l,", ").concat(u,")")},a)}function S_(t,e,n,i,r){var a=ex(i,"title"),o=(0,he.CR)(ix(a),2),s=o[0],l=o[1],u=l.transform,c=l.transformOrigin,h=(0,he._T)(l,["transform","transformOrigin"]);e.styles(h);var d=u||function(t,e,n){var i=2*t.getGeometryBounds().halfExtents[1];if("vertical"===e){if("left"===n)return"rotate(-90) translate(0, ".concat(i/2,")");if("right"===n)return"rotate(-90) translate(0, -".concat(i/2,")")}return""}(t.node(),s.direction,s.position);t.styles((0,he.pi)((0,he.pi)({},s),{transformOrigin:c})),Jb(t.node(),d);var f=function(t,e,n){var i=n.titlePosition,r=void 0===i?"lb":i,a=n.titleSpacing,o=dx(r),s=t.node().getLocalBounds(),l=(0,he.CR)(s.min,2),u=l[0],c=l[1],h=(0,he.CR)(s.halfExtents,2),d=h[0],f=h[1],p=(0,he.CR)(e.node().getLocalBounds().halfExtents,2),g=p[0],m=p[1],v=(0,he.CR)([u+d,c+f],2),y=v[0],x=v[1],b=(0,he.CR)(ux(a),4),_=b[0],E=b[1],w=b[2],T=b[3];if(["start","end"].includes(r)&&"linear"===n.type){var S=n.startPos,M=n.endPos,C=(0,he.CR)("start"===r?[S,M]:[M,S],2),A=C[0],O=C[1],N=bb([-O[0]+A[0],-O[1]+A[1]]),P=(0,he.CR)(pb(N,_),2),L=P[0],R=P[1];return{x:A[0]+L,y:A[1]+R}}return o.includes("t")&&(x-=f+m+_),o.includes("r")&&(y+=d+g+E),o.includes("l")&&(y-=d+g+T),o.includes("b")&&(x+=f+m+w),{x:y,y:x}}(ox(n._offscreen||n.querySelector(fb.mainGroup.class)),e,i),p=f.x,g=f.y;return _x(e.node(),{transform:"translate(".concat(p,", ").concat(g,")")},r)}function M_(t,e,n,i){var r=t.showLine,a=t.showTick,o=t.showLabel,s=cx(r,e.maybeAppendByClassName(fb.lineGroup,"g"),(function(e){return Yb(e,t,i)}))||[],l=cx(a,e.maybeAppendByClassName(fb.tickGroup,"g"),(function(e){return function(t,e,n,i){var r=kb(e,n.tickFilter),a=ex(n,"tick");return t.selectAll(fb.tick.class).data(r,(function(t){return t.id||t.label})).join((function(t){return t.append("g").attr("className",fb.tick.name).transition((function(t,e){return T_.call(this,t,e,r,n,a,!1)}))}),(function(t){return t.transition((function(t,e){return this.removeChildren(),T_.call(this,t,e,r,n,a,i.update)}))}),(function(t){return t.transition((function(){var t=this,e=wb(this.childNodes[0],i.exit);return yx(e,(function(){return t.remove()})),e}))})).transitions()}(e,n,t,i)}))||[],u=cx(o,e.maybeAppendByClassName(fb.labelGroup,"g"),(function(e){return __(e,n,t,i)}))||[];return(0,he.ev)((0,he.ev)((0,he.ev)([],(0,he.CR)(s),!1),(0,he.CR)(l),!1),(0,he.CR)(u),!1).filter((function(t){return!!t}))}var C_=function(t){function e(e){return t.call(this,e,db)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,e,n){var i=this,r=t.titleText,a=t.data,o=t.animate,s=t.showTitle,l=t.showGrid,u=t.dataThreshold,c=t.truncRange,h=function(t,e){if(t.length<=e)return t;for(var n=Math.floor(t.length/e),i=[],r=0;rc[0]&&e(n-t)/(e-t):t=>.5}function R_(t,...e){return e.reduce(((t,e)=>n=>t(e(n))),t)}var D_=n(75196),k_=n.n(D_);function I_(t,e,n){let i=n;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function B_(t){const e=k_().get(t);if(!e)return null;const{model:n,value:i}=e;return"rgb"===n?i:"hsl"===n?function(t){const e=t[0]/360,n=t[1]/100,i=t[2]/100,r=t[3];if(0===n)return[255*i,255*i,255*i,r];const a=i<.5?i*(1+n):i+n-i*n,o=2*i-a;return[255*I_(o,a,e+1/3),255*I_(o,a,e),255*I_(o,a,e-1/3),r]}(i):null}const F_=(t,e)=>n=>t*(1-n)+e*n,z_=(t,e)=>"number"==typeof t&&"number"==typeof e?F_(t,e):"string"==typeof t&&"string"==typeof e?((t,e)=>{const n=B_(t),i=B_(e);return null===n||null===i?n?()=>t:()=>e:t=>{const e=new Array(4);for(let r=0;r<4;r+=1){const a=n[r],o=i[r];e[r]=a*(1-t)+o*t}const[r,a,o,s]=e;return`rgba(${Math.round(r)}, ${Math.round(a)}, ${Math.round(o)}, ${s})`}})(t,e):()=>t,G_=(t,e)=>{const n=F_(t,e);return t=>Math.round(n(t))};function j_(t){return!(Qe(t)||(e=t,null===e)||Number.isNaN(t));var e}const U_=Math.sqrt(50),H_=Math.sqrt(10),V_=Math.sqrt(2);function Z_(t,e,n){const i=(e-t)/Math.max(0,n),r=Math.floor(Math.log(i)/Math.LN10),a=i/10**r;return r>=0?(a>=U_?10:a>=H_?5:a>=V_?2:1)*10**r:-(10**-r)/(a>=U_?10:a>=H_?5:a>=V_?2:1)}const W_=(t,e,n=5)=>{const i=[t,e];let r,a=0,o=i.length-1,s=i[a],l=i[o];return l0?(s=Math.floor(s/r)*r,l=Math.ceil(l/r)*r,r=Z_(s,l,n)):r<0&&(s=Math.ceil(s*r)/r,l=Math.floor(l*r)/r,r=Z_(s,l,n)),r>0?(i[a]=Math.floor(s/r)*r,i[o]=Math.ceil(l/r)*r):r<0&&(i[a]=Math.ceil(s*r)/r,i[o]=Math.floor(l*r)/r),i};const X_=(t,e,n)=>{const[i,r]=t,[a,o]=e;let s,l;return i{const i=Math.min(t.length,e.length)-1,r=new Array(i),a=new Array(i),o=t[0]>t[i],s=o?[...t].reverse():t,l=o?[...e].reverse():e;for(let t=0;t{const n=function(t,e,n,i,r){let a=n||0,o=i||t.length;const s=r||(t=>t);for(;ae?o=n:a=n+1}return a}(t,e,1,i)-1,o=r[n];return R_(a[n],o)(e)}},q_=(t,e,n,i)=>(Math.min(t.length,e.length)>2?Y_:X_)(t,e,i?G_:n);class $_ extends P_{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:F_,tickCount:5}}map(t){return j_(t)?this.output(t):this.options.unknown}invert(t){return j_(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,...r]=this.getTickMethodOptions();return t(e,n,i,...r)}getTickMethodOptions(){const{domain:t,tickCount:e}=this.options;return[t[0],t[t.length-1],e]}chooseNice(){return W_}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),r=Math.min(i.length,n.length);return e?function(t,e){const n=ee?t:e;return t=>Math.min(Math.max(n,t),i)}(i[0],i[r-1]):N_}composeOutput(t,e){const{domain:n,range:i,round:r,interpolate:a}=this.options,o=q_(n.map(t),i,a,r);this.output=R_(o,e,t)}composeInput(t,e,n){const{domain:i,range:r}=this.options,a=q_(r,i.map(t),F_);this.input=R_(e,n,a)}}const K_=(t,e,n)=>{let i,r,a=t,o=e;if(a===o&&n>0)return[a];let s=Z_(a,o,n);if(0===s||!Number.isFinite(s))return[];if(s>0){a=Math.ceil(a/s),o=Math.floor(o/s),r=new Array(i=Math.ceil(o-a+1));for(let t=0;t`${t}`:"object"==typeof t?t=>JSON.stringify(t):t=>t}class oE extends P_{getDefaultOptions(){return{domain:[],range:[],unknown:nE}}constructor(t){super(t)}map(t){return 0===this.domainIndexMap.size&&iE(this.domainIndexMap,this.getDomain(),this.domainKey),rE({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return 0===this.rangeIndexMap.size&&iE(this.rangeIndexMap,this.getRange(),this.rangeKey),rE({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=aE(e),this.rangeKey=aE(n),!this.rangeIndexMap)return this.rangeIndexMap=new Map,void(this.domainIndexMap=new Map);t&&!t.range||this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new oE(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 sE(t){return Math.round(1e12*t)/1e12}function lE(t){const{domain:e,range:n,paddingOuter:i,paddingInner:r,flex:a,round:o,align:s}=t,l=e.length,u=function(t,e){const n=e-t.length;return n>0?[...t,...new Array(n).fill(1)]:n<0?t.slice(0,e):t}(a,l),[c,h]=n,d=h-c,f=d/(2/l*i+1-1/l*r),p=f*r/l,g=f-l*p,m=function(t){const e=Math.min(...t);return t.map((t=>t/e))}(u),v=g/m.reduce(((t,e)=>t+e)),y=new eE(e.map(((t,e)=>{const n=m[e]*v;return[t,o?Math.floor(n):n]}))),x=new eE(e.map(((t,e)=>{const n=m[e]*v+p;return[t,o?Math.floor(n):n]}))),b=Array.from(x.values()).reduce(((t,e)=>t+e)),_=c+(d-(b-b/l*r))*s;let E=o?Math.round(_):_;const w=new Array(l);for(let t=0;t0?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:r}=this.options,{adjustedRange:a,valueBandWidth:o,valueStep:s}=function(t){var e;const{domain:n}=t,i=n.length;if(0===i)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(null===(e=t.flex)||void 0===e?void 0:e.length)return lE(t);const{range:r,paddingOuter:a,paddingInner:o,round:s,align:l}=t;let u,c,h=r[0];const d=r[1]-h,f=2*a,p=i-o;u=d/Math.max(1,f+p),s&&(u=Math.floor(u)),h+=(d-u*(i-o))*l,c=u*(1-o),s&&(h=Math.round(h),c=Math.round(c));const g=new Array(i).fill(0).map(((t,e)=>h+e*u));return{valueStep:u,valueBandWidth:c,adjustedRange:g}}({align:t,range:n,round:i,flex:r,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:e});this.valueStep=s,this.valueBandWidth=o,this.adjustedRange=a}}var cE=function(t){function e(e){var n=this,i=e.style,r=(0,he._T)(e,["style"]);return(n=t.call(this,(0,Qh.Z)({},{type:"column"},(0,he.pi)({style:i},r)))||this).columnsGroup=new wl({name:"columns"}),n.appendChild(n.columnsGroup),n.render(),n}return(0,he.ZT)(e,t),e.prototype.render=function(){var t=this.attributes,e=t.columns,n=t.x,i=t.y;this.columnsGroup.style.transform="translate(".concat(n,", ").concat(i,")"),ox(this.columnsGroup).selectAll(".column").data(e.flat()).join((function(t){return t.append("rect").attr("className","column").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.update=function(t){this.attr(Xy({},this.attributes,t)),this.render()},e.prototype.clear=function(){this.removeChildren()},e}(yl),hE=function(t){function e(e){var n=this,i=e.style,r=(0,he._T)(e,["style"]);return(n=t.call(this,(0,Qh.Z)({},{type:"lines"},(0,he.pi)({style:i},r)))||this).linesGroup=n.appendChild(new wl),n.areasGroup=n.appendChild(new wl),n.render(),n}return(0,he.ZT)(e,t),e.prototype.render=function(){var t=this.attributes,e=t.lines,n=t.areas,i=t.x,r=t.y;this.style.transform="translate(".concat(i,", ").concat(r,")"),e&&this.renderLines(e),n&&this.renderAreas(n)},e.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},e.prototype.update=function(t){this.attr(Xy({},this.attributes,t)),this.render()},e.prototype.renderLines=function(t){ox(this.linesGroup).selectAll(".line").data(t).join((function(t){return t.append("path").attr("className","line").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.attr(t)}))}),(function(t){return t.remove()}))},e.prototype.renderAreas=function(t){ox(this.linesGroup).selectAll(".area").data(t).join((function(t){return t.append("path").attr("className","area").each((function(t){this.attr(t)}))}),(function(t){return t.each((function(t){this.style(t)}))}),(function(t){return t.remove()}))},e}(yl);function dE(t,e,n){void 0===e&&(e=!1),void 0===n&&(n=[[0,0],[1,1]]);for(var i=!!e,r=[],a=0,o=t.length;ai&&(n=a,i=o)}return n}};function yE(t){return 0===t.length?[0,0]:[ze(mE(t,(function(t){return ze(t)||0}))),Ge(vE(t,(function(t){return Ge(t)||0})))]}function xE(t){for(var e=(0,zc.Z)(t),n=e[0].length,i=(0,he.CR)([Array(n).fill(0),Array(n).fill(0)],2),r=i[0],a=i[1],o=0;o=0?(s[l]+=r[l],r[l]=s[l]):(s[l]+=a[l],a[l]=s[l]);return e}var bE=function(t){function e(e){return t.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(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"rawData",{get:function(){var t=this.attributes.data;if(!t||0===(null==t?void 0:t.length))return[[]];var e=(0,zc.Z)(t);return(0,oe.Z)(e[0])?[e]:e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.attributes.isStack?xE(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseline",{get:function(){var t=this.scales.y,e=(0,he.CR)(t.getOptions().domain||[0,0],2),n=e[0],i=e[1];return i<0?t.map(i):t.map(n<0?0:n)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"containerShape",{get:function(){var t=this.attributes;return{width:t.width,height:t.height}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"linesStyle",{get:function(){var t=this,e=this.attributes,n=e.type,i=e.isStack,r=e.smooth;if("line"!==n)throw new Error("linesStyle can only be used in line type");var a=ex(this.attributes,"area"),o=ex(this.attributes,"line"),s=this.containerShape.width,l=this.data;if(0===l[0].length)return{lines:[],areas:[]};var u=this.scales,c=function(t,e){var n,i=e.x,r=e.y,a=(0,he.CR)(r.getOptions().range||[0,0],2),o=a[0],s=a[1];return s>o&&(n=(0,he.CR)([o,s],2),s=n[0],o=n[1]),t.map((function(t){return t.map((function(t,e){return[i.map(e),ce(r.map(t),s,o)]}))}))}(l,{type:"line",x:u.x,y:u.y}),h=[];if(a){var d=this.baseline;h=i?r?function(t,e,n){for(var i=[],r=t.length-1;r>=0;r-=1){var a=t[r],o=pE(a),s=void 0;if(0===r)s=gE(o,e,n);else{var l=pE(t[r-1],!0),u=a[0];l[0][0]="L",s=(0,he.ev)((0,he.ev)((0,he.ev)([],(0,he.CR)(o),!1),(0,he.CR)(l),!1),[(0,he.ev)(["M"],(0,he.CR)(u),!1),["Z"]],!1)}i.push(s)}return i}(c,s,d):function(t,e,n){for(var i=[],r=t.length-1;r>=0;r-=1){var a=fE(t[r]),o=void 0;if(0===r)o=gE(a,e,n);else{var s=fE(t[r-1],!0);s[0][0]="L",o=(0,he.ev)((0,he.ev)((0,he.ev)([],(0,he.CR)(a),!1),(0,he.CR)(s),!1),[["Z"]],!1)}i.push(o)}return i}(c,s,d):function(t,e,n,i){return t.map((function(t){return gE(e?pE(t):fE(t),n,i)}))}(c,r,s,d)}return{lines:c.map((function(e,n){return(0,he.pi)({stroke:t.getColor(n),d:r?pE(e):fE(e)},o)})),areas:h.map((function(e,n){return(0,he.pi)({d:e,fill:t.getColor(n)},a)}))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"columnsStyle",{get:function(){var t=this,e=ex(this.attributes,"column"),n=this.attributes,i=n.isStack,r=n.type,a=n.scale;if("column"!==r)throw new Error("columnsStyle can only be used in column type");var o=this.containerShape.height,s=this.rawData;if(!s)return{columns:[]};i&&(s=xE(s));var l=this.createScales(s),u=l.x,c=l.y,h=(0,he.CR)(yE(s),2),d=h[0],f=h[1],p=new Q_({domain:[0,f-(d>0?0:d)],range:[0,o*a]}),g=u.getBandWidth(),m=this.rawData;return{columns:s.map((function(n,r){return n.map((function(n,a){var o=g/s.length;return(0,he.pi)((0,he.pi)({fill:t.getColor(r)},e),i?{x:u.map(a),y:c.map(n),width:g,height:p.map(m[r][a])}:{x:u.map(a)+o*r,y:n>=0?c.map(n):c.map(0),width:o,height:p.map(Math.abs(n))})}))}))}},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){var n,i,r;(n=e,i=".container",r="rect",n.querySelector(i)?ox(n).select(i):ox(n).append(r)).attr("className","container").node();var a=t.type,o=t.x,s=t.y,l="spark".concat(a),u=(0,he.pi)({x:o,y:s},"line"===a?this.linesStyle:this.columnsStyle);ox(e).selectAll(".spark").data([a]).join((function(t){return t.append((function(t){return"line"===t?new hE({className:l,style:u}):new cE({className:l,style:u})})).attr("className","spark ".concat(l))}),(function(t){return t.update(u)}),(function(t){return t.remove()}))},e.prototype.getColor=function(t){var e=this.attributes.color;return(0,Fe.Z)(e)?e[t%e.length]:(0,en.Z)(e)?e.call(null,t):e},e.prototype.createScales=function(t){var e,n,i=this.attributes,r=i.type,a=i.scale,o=i.range,s=void 0===o?[]:o,l=i.spacing,u=this.containerShape,c=u.width,h=u.height,d=(0,he.CR)(yE(t),2),f=d[0],p=d[1],g=new Q_({domain:[null!==(e=s[0])&&void 0!==e?e:f,null!==(n=s[1])&&void 0!==n?n:p],range:[h,h*(1-a)]});return"line"===r?{type:r,x:new Q_({domain:[0,t[0].length-1],range:[0,c]}),y:g}:{type:r,x:new uE({domain:t[0].map((function(t,e){return e})),range:[0,c],paddingInner:l,paddingOuter:l/2,align:.5}),y:g}},e.tag="sparkline",e}(Ky),_E={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},EE={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},wE={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},TE=lx({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),SE=lx({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),ME=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return(0,he.ZT)(e,t),e.prototype.render=function(t,e){var n=t.x,i=t.y,r=t.size,a=void 0===r?10:r,o=t.radius,s=void 0===o?a/4:o,l=t.orientation,u=(0,he._T)(t,["x","y","size","radius","orientation"]),c=a,h=2.4*c,d=ox(e).maybeAppendByClassName(SE.iconRect,"rect").styles((0,he.pi)((0,he.pi)({},u),{width:c,height:h,radius:s,x:n-c/2,y:i-h/2,transformOrigin:"center"})),f=n+1/3*c-c/2,p=n+2/3*c-c/2,g=i+1/4*h-h/2,m=i+3/4*h-h/2;d.maybeAppendByClassName("".concat(SE.iconLine,"-1"),"line").styles((0,he.pi)({x1:f,x2:f,y1:g,y2:m},u)),d.maybeAppendByClassName("".concat(SE.iconLine,"-2"),"line").styles((0,he.pi)({x1:p,x2:p,y1:g,y2:m},u)),"vertical"===l&&(d.node().style.transform="rotate(90)")},e}(Ky),CE=function(t){function e(e){return t.call(this,e,wE)||this}return(0,he.ZT)(e,t),e.prototype.renderLabel=function(t){var e=this,n=this.attributes,i=n.x,r=n.y,a=n.showLabel,o=ex(this.attributes,"label"),s=o.x,l=void 0===s?0:s,u=o.y,c=void 0===u?0:u,h=o.transform,d=o.transformOrigin,f=(0,he._T)(o,["x","y","transform","transformOrigin"]),p=(0,he.CR)(ix(f,[]),2),g=p[0],m=p[1],v=ox(t).maybeAppendByClassName(SE.labelGroup,"g").styles(m),y=(0,he.pi)((0,he.pi)({},EE),g),x=y.text,b=(0,he._T)(y,["text"]);cx(!!a,v,(function(t){e.label=t.maybeAppendByClassName(SE.label,"text").styles((0,he.pi)((0,he.pi)({},b),{x:i+l,y:r+c,transform:h,transformOrigin:d,text:"".concat(x)})),e.label.on("mousedown",(function(t){t.stopPropagation()})),e.label.on("touchstart",(function(t){t.stopPropagation()}))}))},e.prototype.renderIcon=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.orientation,a=e.type,o=(0,he.pi)((0,he.pi)({x:n,y:i,orientation:r},_E),ex(this.attributes,"icon")),s=this.attributes.iconShape,l=void 0===s?function(){return new ME({style:o})}:s;ox(t).maybeAppendByClassName(SE.iconGroup,"g").selectAll(SE.icon.class).data([l]).join((function(t){return t.append("string"==typeof l?l:function(){return l(a)}).attr("className",SE.icon.name)}),(function(t){return t.update(o)}),(function(t){return t.remove()}))},e.prototype.render=function(t,e){this.renderIcon(e),this.renderLabel(e)},e}(Ky),AE=function(t){function e(e){var n=t.call(this,e,(0,he.pi)((0,he.pi)((0,he.pi)({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(t){return t.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},nx(wE,"handle")),nx(_E,"handleIcon")),nx(EE,"handleLabel")))||this;return n.range=[0,1],n.onDragStart=function(t){return function(e){e.stopPropagation(),n.target=t,n.prevPos=n.getOrientVal(A_(e));var i=n.availableSpace,r=i.x,a=i.y,o=n.getBBox(),s=o.x,l=o.y;n.selectionStartPos=n.getRatio(n.prevPos-n.getOrientVal([r,a])-n.getOrientVal([+s,+l])),n.selectionWidth=0,document.addEventListener("pointermove",n.onDragging),document.addEventListener("pointerup",n.onDragEnd)}},n.onDragging=function(t){var e=n.attributes,i=e.slidable,r=e.brushable,a=e.type;t.stopPropagation();var o=n.getOrientVal(A_(t)),s=o-n.prevPos;if(s){var l=n.getRatio(s);switch(n.target){case"start":i&&n.setValuesOffset(l);break;case"end":i&&n.setValuesOffset(0,l);break;case"selection":i&&n.setValuesOffset(l,l);break;case"track":if(!r)return;n.selectionWidth+=l,"range"===a?n.innerSetValues([n.selectionStartPos,n.selectionStartPos+n.selectionWidth].sort(),!0):n.innerSetValues([0,n.selectionStartPos+n.selectionWidth],!0)}n.prevPos=o}},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(t){var e=n.attributes,i=e.onChange,r=e.type,a="range"===r?t:t[1],o="range"===r?n.getValues():n.getValues()[1],s=new gs("valuechange",{detail:{oldValue:a,value:o}});n.dispatchEvent(s),null==i||i(o)},n.selectionStartPos=0,n.selectionWidth=0,n.prevPos=0,n.target="",n}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"values",{get:function(){return this.attributes.values},set:function(t){this.attributes.values=this.clampValues(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sparklineStyle",{get:function(){if("horizontal"!==this.attributes.orientation)return null;var t=ex(this.attributes,"sparkline");return(0,he.pi)((0,he.pi)({zIndex:0},this.availableSpace),t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shape",{get:function(){var t=this.attributes,e=t.trackLength,n=t.trackSize,i=(0,he.CR)(this.getOrientVal([[e,n],[n,e]]),2);return{width:i[0],height:i[1]}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"availableSpace",{get:function(){var t=this.attributes,e=(t.x,t.y,t.padding),n=(0,he.CR)(ux(e),4),i=n[0],r=n[1],a=n[2],o=n[3],s=this.shape;return{x:o,y:i,width:s.width-(o+r),height:s.height-(i+a)}},enumerable:!1,configurable:!0}),e.prototype.getValues=function(){return this.values},e.prototype.setValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1),this.attributes.values=t;var n=!1!==e&&this.attributes.animate;this.updateSelectionArea(n),this.updateHandlesPosition(n)},e.prototype.updateSelectionArea=function(t){var e=this.calcSelectionArea();this.foregroundGroup.selectAll(TE.selection.class).each((function(n,i){_x(this,e[i],t)}))},e.prototype.updateHandlesPosition=function(t){this.attributes.showHandle&&(this.startHandle&&_x(this.startHandle,this.getHandleStyle("start"),t),this.endHandle&&_x(this.endHandle,this.getHandleStyle("end"),t))},e.prototype.innerSetValues=function(t,e){void 0===t&&(t=[0,0]),void 0===e&&(e=!1);var n=this.values,i=this.clampValues(t);this.attributes.values=i,this.setValues(i),e&&this.onValueChange(n)},e.prototype.renderTrack=function(t){var e=this.attributes,n=e.x,i=e.y,r=ex(this.attributes,"track");this.trackShape=ox(t).maybeAppendByClassName(TE.track,"rect").styles((0,he.pi)((0,he.pi)({x:n,y:i},this.shape),r))},e.prototype.renderBrushArea=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.brushable;this.brushArea=ox(t).maybeAppendByClassName(TE.brushArea,"rect").styles((0,he.pi)({x:n,y:i,fill:"transparent",cursor:r?"crosshair":"default"},this.shape))},e.prototype.renderSparkline=function(t){var e=this,n=this.attributes,i=n.x,r=n.y;cx("horizontal"===n.orientation,ox(t).maybeAppendByClassName(TE.sparklineGroup,"g"),(function(t){var n=(0,he.pi)((0,he.pi)({},e.sparklineStyle),{x:i,y:r});t.maybeAppendByClassName(TE.sparkline,(function(){return new bE({style:n})})).update(n)}))},e.prototype.renderHandles=function(){var t,e=this,n=this.attributes,i=n.showHandle,r=n.type,a=i?"range"===r?["start","end"]:["end"]:[],o=this;null===(t=this.foregroundGroup)||void 0===t||t.selectAll(TE.handle.class).data(a.map((function(t){return{type:t}})),(function(t){return t.type})).join((function(t){return t.append((function(t){var n=t.type;return new CE({style:e.getHandleStyle(n)})})).each((function(t){var e=t.type;this.attr("class","".concat(TE.handle.name," ").concat(e,"-handle"));var n="".concat(e,"Handle");o[n]=this,this.addEventListener("pointerdown",o.onDragStart(e))}))}),(function(t){return t.each((function(t){var e=t.type;this.update(o.getHandleStyle(e))}))}),(function(t){return t.each((function(t){var e=t.type,n="".concat(e,"Handle");o[n]=void 0})).remove()}))},e.prototype.renderSelection=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.type,a=e.selectionType;this.foregroundGroup=ox(t).maybeAppendByClassName(TE.foreground,"g");var o=ex(this.attributes,"selection"),s=function(t){return t.style("visibility",(function(t){return t.show?"visible":"hidden"})).style("cursor",(function(t){return"select"===a?"grab":"invert"===a?"crosshair":"default"})).styles((0,he.pi)((0,he.pi)({},o),{transform:"translate(".concat(n,", ").concat(i,")")}))},l=this;this.foregroundGroup.selectAll(TE.selection.class).data("value"===r?[]:this.calcSelectionArea().map((function(t,e){return{style:(0,he.pi)({},t),index:e,show:"select"===a?1===e:1!==e}})),(function(t){return t.index})).join((function(t){return t.append("rect").attr("className",TE.selection.name).call(s).each((function(t,e){var n=this;1===e?(l.selectionShape=ox(this),this.on("pointerdown",(function(t){n.attr("cursor","grabbing"),l.onDragStart("selection")(t)})),l.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),l.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),l.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",(function(){n.attr("cursor","grabbing")})),this.addEventListener("pointerup",(function(){n.attr("cursor","pointer")})),this.addEventListener("pointerover",(function(){n.attr("cursor","pointer")}))):this.on("pointerdown",l.onDragStart("track"))}))}),(function(t){return t.call(s)}),(function(t){return t.remove()})),this.updateSelectionArea(!1),this.renderHandles()},e.prototype.render=function(t,e){this.renderTrack(e),this.renderSparkline(e),this.renderBrushArea(e),this.renderSelection(e)},e.prototype.clampValues=function(t,e){var n;void 0===e&&(e=4);var i=(0,he.CR)(this.range,2),r=i[0],a=i[1],o=(0,he.CR)(this.getValues().map((function(t){return O_(t,e)})),2),s=o[0],l=o[1],u=Array.isArray(t)?t:[s,null!=t?t:l],c=(0,he.CR)((u||[s,l]).map((function(t){return O_(t,e)})),2),h=c[0],d=c[1];if("value"===this.attributes.type)return[0,ce(d,r,a)];h>d&&(h=(n=(0,he.CR)([d,h],2))[0],d=n[1]);var f=d-h;return f>a-r?[r,a]:ha?l===a&&s===h?[h,a]:[a-f,a]:[h,d]},e.prototype.calcSelectionArea=function(t){var e=(0,he.CR)(this.clampValues(t),2),n=e[0],i=e[1],r=this.availableSpace,a=r.x,o=r.y,s=r.width,l=r.height;return this.getOrientVal([[{y:o,height:l,x:a,width:n*s},{y:o,height:l,x:n*s+a,width:(i-n)*s},{y:o,height:l,x:i*s,width:(1-i)*s}],[{x:a,width:s,y:o,height:n*l},{x:a,width:s,y:n*l+o,height:(i-n)*l},{x:a,width:s,y:i*l,height:(1-i)*l}]])},e.prototype.calcHandlePosition=function(t){var e=this.attributes.handleIconOffset,n=this.availableSpace,i=n.x,r=n.y,a=n.width,o=n.height,s=(0,he.CR)(this.clampValues(),2),l=s[0],u=s[1],c="start"===t?-e:e,h=("start"===t?l:u)*this.getOrientVal([a,o])+c;return{x:i+this.getOrientVal([h,a/2]),y:r+this.getOrientVal([o/2,h])}},e.prototype.inferTextStyle=function(t){return"horizontal"===this.attributes.orientation?{}:"start"===t?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:"end"===t?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},e.prototype.calcHandleText=function(t){var e,n=this.attributes,i=n.type,r=n.orientation,a=n.formatter,o=n.autoFitLabel,s=ex(this.attributes,"handle"),l=ex(s,"label"),u=s.spacing,c=this.getHandleSize(),h=this.clampValues(),d=a("start"===t?h[0]:h[1]),f=new rx({style:(0,he.pi)((0,he.pi)((0,he.pi)({},l),this.inferTextStyle(t)),{text:d})}),p=f.getBBox(),g=p.width,m=p.height;if(f.destroy(),!o){if("value"===i)return{text:d,x:0,y:-m-u};var v=u+c+("horizontal"===r?g/2:0);return(e={text:d})["horizontal"===r?"x":"y"]="start"===t?-v:v,e}var y=0,x=0,b=this.availableSpace,_=b.width,E=b.height,w=this.calcSelectionArea()[1],T=w.x,S=w.y,M=w.width,C=w.height,A=u+c;if("horizontal"===r){var O=A+g/2;if("start"===t)y=T-A-g>0?-O:O;else y=_-T-M-A>g?O:-O}else{var N=m+A;x="start"===t?S-c>m?-N:A:E-(S+C)-c>m?N:-A}return{x:y,y:x,text:d}},e.prototype.getHandleLabelStyle=function(t){var e=ex(this.attributes,"handleLabel");return(0,he.pi)((0,he.pi)((0,he.pi)({},e),this.calcHandleText(t)),this.inferTextStyle(t))},e.prototype.getHandleIconStyle=function(){var t=this.attributes.handleIconShape,e=ex(this.attributes,"handleIcon"),n=this.getOrientVal(["ew-resize","ns-resize"]),i=this.getHandleSize();return(0,he.pi)({cursor:n,shape:t,size:i},e)},e.prototype.getHandleStyle=function(t){var e=this.attributes,n=e.x,i=e.y,r=e.showLabel,a=e.showLabelOnInteraction,o=e.orientation,s=this.calcHandlePosition(t),l=s.x,u=s.y,c=this.calcHandleText(t),h=r;return!r&&a&&(h=!!this.target),(0,he.pi)((0,he.pi)((0,he.pi)({},nx(this.getHandleIconStyle(),"icon")),nx((0,he.pi)((0,he.pi)({},this.getHandleLabelStyle(t)),c),"label")),{transform:"translate(".concat(l+n,", ").concat(u+i,")"),orientation:o,showLabel:h,type:t,zIndex:3})},e.prototype.getHandleSize=function(){var t=this.attributes,e=t.handleIconSize,n=t.width,i=t.height;return e||Math.floor((this.getOrientVal([+i,+n])+4)/2.4)},e.prototype.getOrientVal=function(t){var e=(0,he.CR)(t,2),n=e[0],i=e[1];return"horizontal"===this.attributes.orientation?n:i},e.prototype.setValuesOffset=function(t,e,n){void 0===e&&(e=0),void 0===n&&(n=!1);var i=this.attributes.type,r=(0,he.CR)(this.getValues(),2),a=[r[0]+("range"===i?t:0),r[1]+e].sort();n?this.setValues(a):this.innerSetValues(a,!0)},e.prototype.getRatio=function(t){var e=this.availableSpace,n=e.width,i=e.height;return t/this.getOrientVal([n,i])},e.prototype.dispatchCustomEvent=function(t,e,n){var i=this;t.on(e,(function(t){t.stopPropagation(),i.dispatchEvent(new gs(n,{detail:t}))}))},e.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var t=this.brushArea;this.dispatchCustomEvent(t,"click","trackClick"),this.dispatchCustomEvent(t,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(t,"pointerleave","trackMouseleave"),t.on("pointerdown",this.onDragStart("track"))},e.prototype.onScroll=function(t){if(this.attributes.scrollable){var e=t.deltaX,n=t.deltaY||e,i=this.getRatio(n);this.setValuesOffset(i,i,!0)}},e.tag="slider",e}(Ky),OE={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(t){return t.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},NE=lx({background:"background",labelGroup:"label-group",label:"label"},"indicator"),PE=function(t){function e(e){var n=t.call(this,e,OE)||this;return n.point=[0,0],n.group=n.appendChild(new wl({})),n.isMutationObserved=!0,n}return(0,he.ZT)(e,t),e.prototype.renderBackground=function(){if(this.label){var t=this.attributes,e=t.position,n=t.padding,i=(0,he.CR)(ux(n),4),r=i[0],a=i[1],o=i[2],s=i[3],l=this.label.node().getLocalBounds(),u=l.min,c=l.max,h=new sx(u[0]-s,u[1]-r,c[0]+a-u[0]+s,c[1]+o-u[1]+r),d=this.getPath(e,h),f=ex(this.attributes,"background");this.background=ox(this.group).maybeAppendByClassName(NE.background,"path").styles((0,he.pi)((0,he.pi)({},f),{d:d})),this.group.appendChild(this.label.node())}},e.prototype.renderLabel=function(){var t=this.attributes,e=t.formatter,n=t.labelText,i=ex(this.attributes,"label"),r=(0,he.CR)(ix(i),2),a=r[0],o=r[1],s=(a.text,(0,he._T)(a,["text"]));(this.label=ox(this.group).maybeAppendByClassName(NE.labelGroup,"g").styles(o),n)&&this.label.maybeAppendByClassName(NE.label,(function(){return Bx(e(n))})).style("text",e(n).toString()).selectAll("text").styles(s)},e.prototype.adjustLayout=function(){var t=(0,he.CR)(this.point,2),e=t[0],n=t[1],i=this.attributes,r=i.x,a=i.y;this.group.attr("transform","translate(".concat(r-e,", ").concat(a-n,")"))},e.prototype.getPath=function(t,e){var n=this.attributes.radius,i=e.x,r=e.y,a=e.width,o=e.height,s=[["M",i+n,r],["L",i+a-n,r],["A",n,n,0,0,1,i+a,r+n],["L",i+a,r+o-n],["A",n,n,0,0,1,i+a-n,r+o],["L",i+n,r+o],["A",n,n,0,0,1,i,r+o-n],["L",i,r+n],["A",n,n,0,0,1,i+n,r],["Z"]],l={top:4,right:6,bottom:0,left:2}[t],u=this.createCorner([s[l].slice(-2),s[l+1].slice(-2)]);return s.splice.apply(s,(0,he.ev)([l+1,1],(0,he.CR)(u),!1)),s[0][0]="M",s},e.prototype.createCorner=function(t,e){void 0===e&&(e=10);var n=Ix.apply(void 0,(0,he.ev)([],(0,he.CR)(t),!1)),i=(0,he.CR)(t,2),r=(0,he.CR)(i[0],2),a=r[0],o=r[1],s=(0,he.CR)(i[1],2),l=s[0],u=s[1],c=(0,he.CR)(n?[l-a,[a,l]]:[u-o,[o,u]],2),h=c[0],d=(0,he.CR)(c[1],2),f=d[0],p=d[1],g=h/2,m=e*(h/Math.abs(h)),v=m/2,y=m*Math.sqrt(3)/2*.8,x=(0,he.CR)([f,f+g-v,f+g,f+g+v,p],5),b=x[0],_=x[1],E=x[2],w=x[3],T=x[4];return n?(this.point=[E,o-y],[["L",b,o],["L",_,o],["L",E,o-y],["L",w,o],["L",T,o]]):(this.point=[a+y,E],[["L",a,b],["L",a,_],["L",a+y,E],["L",a,w],["L",a,T]])},e.prototype.applyVisibility=function(){"hidden"===this.attributes.visibility?Vy(this):Hy(this)},e.prototype.bindEvents=function(){this.label.on(Ss.BOUNDS_CHANGED,this.renderBackground)},e.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},e}(Ky),LE=function(t){function e(n){var i=t.call(this,Xy({},e.defaultOptions,n))||this;return i.hoverColor="#f5f5f5",i.selectedColor="#e6f7ff",i.background=i.appendChild(new kl({})),i.label=i.background.appendChild(new wl({})),i}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"padding",{get:function(){return ux(this.style.padding)},enumerable:!1,configurable:!0}),e.prototype.renderLabel=function(){var t=this.style,e=t.label,n=t.value,i=ex(this.attributes,"label");ox(this.label).maybeAppend(".label",(function(){return Bx(e)})).attr("className","label").styles(i),this.label.attr("__data__",n)},e.prototype.renderBackground=function(){var t=this.label.getBBox(),e=(0,he.CR)(this.padding,4),n=e[0],i=e[1],r=e[2],a=e[3],o=t.width,s=t.height,l=o+a+i,u=s+n+r,c=ex(this.attributes,"background"),h=this.style,d=h.width,f=void 0===d?0:d,p=h.height,g=void 0===p?0:p,m=h.selected;this.background.attr((0,he.pi)((0,he.pi)({},c),{width:Math.max(l,f),height:Math.max(u,g),fill:m?this.selectedColor:"#fff"})),this.label.attr({transform:"translate(".concat(a,", ").concat((u-s)/2,")")})},e.prototype.render=function(){this.renderLabel(),this.renderBackground()},e.prototype.bindEvents=function(){var t=this;this.addEventListener("pointerenter",(function(){t.style.selected||t.background.attr("fill",t.hoverColor)})),this.addEventListener("pointerleave",(function(){t.style.selected||t.background.attr("fill",t.style.backgroundFill)}));var e=this;this.addEventListener("click",(function(){var n=t.style,i=n.label,r=n.value,a=n.onClick;null==a||a(r,{label:i,value:r},e)}))},e.defaultOptions={style:{value:"",label:"",cursor:"pointer"}},e}(Ky),RE=function(t){function e(n){var i,r,a=t.call(this,Xy({},e.defaultOptions,n))||this;a.currentValue=null===(i=e.defaultOptions.style)||void 0===i?void 0:i.defaultValue,a.isPointerInSelect=!1,a.select=a.appendChild(new kl({className:"select",style:{cursor:"pointer",width:0,height:0}})),a.dropdown=a.appendChild(new kl({className:"dropdown"}));var o=a.style.defaultValue;return o&&(null===(r=a.style.options)||void 0===r?void 0:r.some((function(t){return t.value===o})))&&(a.currentValue=o),a}return(0,he.ZT)(e,t),e.prototype.setValue=function(t){this.currentValue=t,this.render()},e.prototype.getValue=function(){return this.currentValue},Object.defineProperty(e.prototype,"dropdownPadding",{get:function(){return ux(this.style.dropdownPadding)},enumerable:!1,configurable:!0}),e.prototype.renderSelect=function(){var t,e=this,n=this.style,i=n.x,r=n.y,a=n.width,o=n.height,s=n.bordered,l=n.showDropdownIcon,u=ex(this.attributes,"select"),c=ex(this.attributes,"placeholder");this.select.attr((0,he.pi)((0,he.pi)({x:i,y:r,width:a,height:o},u),{fill:"#fff",strokeWidth:s?1:0}));var h=this.dropdownPadding;l&&ox(this.select).maybeAppend(".dropdown-icon","path").style("d","M-5,-3.5 L0,3.5 L5,-3.5").style("transform","translate(".concat(i+a-10-h[1]-h[3],", ").concat(r+o/2,")")).style("lineWidth",1).style("stroke",this.select.style.stroke);var d=null===(t=this.style.options)||void 0===t?void 0:t.find((function(t){return t.value===e.currentValue})),f=(0,he.pi)({x:i+h[3]},c);ox(this.select).selectAll(".placeholder").data(d?[]:[1]).join((function(t){return t.append("text").attr("className","placeholder").styles(f).style("y",(function(){var t=this.getBBox();return r+(o-t.height)/2}))}),(function(t){return t.styles(f)}),(function(t){return t.remove()}));var p=ex(this.attributes,"optionLabel"),g=(0,he.pi)({x:i+h[3]},p);ox(this.select).selectAll(".value").data(d?[d]:[]).join((function(t){return t.append((function(t){return Bx(t.label)})).attr("className","value").styles(g).style("y",(function(){var t=this.getBBox();return r+(o-t.height)/2}))}),(function(t){return t.styles(g)}),(function(t){return t.remove()}))},e.prototype.renderDropdown=function(){var t,e,n=this,i=this.style,r=i.x,a=i.y,o=i.width,s=i.height,l=i.options,u=i.onSelect,c=i.open,h=ex(this.attributes,"dropdown"),d=ex(this.attributes,"option"),f=this.dropdownPadding;ox(this.dropdown).maybeAppend(".dropdown-container","g").attr("className","dropdown-container").selectAll(".dropdown-item").data(l,(function(t){return t.value})).join((function(t){return t.append((function(t){return new LE({className:"dropdown-item",style:(0,he.pi)((0,he.pi)((0,he.pi)({},t),d),{width:o-f[1]-f[3],selected:t.value===n.currentValue,onClick:function(t,e,i){n.setValue(t),null==u||u(t,e,i),n.dispatchEvent(new gs("change",{detail:{value:t,option:e,item:i}})),Vy(n.dropdown)}})})})).each((function(t,e){var n,i=(null===(n=this.parentNode)||void 0===n?void 0:n.children).reduce((function(t,n,i){return ie.time?1:0}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"space",{get:function(){var t=this.attributes,e=t.x,n=t.y,i=t.width,r=t.height,a=t.type,o=t.controllerHeight,s=ce(+r-o,0,+r),l=new sx(e,n+ +r-o,+i,o),u=0,c="time"===a?10:s;return{axisBBox:"chart"===a?new sx(e,n+s-(u=35),+i,u):new sx,controllerBBox:l,timelineBBox:new sx(e,n+("time"===a?s:s-c),+i,c-u)}},enumerable:!1,configurable:!0}),e.prototype.setBySliderValues=function(t){var e,n,i=this.data,r=(0,he.CR)(Array.isArray(t)?t:[0,t],2),a=r[0],o=r[1],s=i.length,l=i[Math.floor(a*s)],u=i[Math.ceil(o*s)-(Array.isArray(t)?0:1)];this.states.values=[null!==(e=null==l?void 0:l.time)&&void 0!==e?e:i[0].time,null!==(n=null==u?void 0:u.time)&&void 0!==n?n:1/0]},e.prototype.setByTimebarValues=function(t){var e,n,i,r=this.data,a=(0,he.CR)(Array.isArray(t)?t:[void 0,t],2),o=a[0],s=a[1],l=r.find((function(t){return t.time===o})),u=r.find((function(t){return t.time===s}));this.states.values=[null!==(e=null==l?void 0:l.time)&&void 0!==e?e:null===(n=r[0])||void 0===n?void 0:n.time,null!==(i=null==u?void 0:u.time)&&void 0!==i?i:1/0]},e.prototype.setByIndex=function(t){var e,n,i,r,a=this.data,o=(0,he.CR)(t,2),s=o[0],l=o[1];this.states.values=[null!==(n=null===(e=a[s])||void 0===e?void 0:e.time)&&void 0!==n?n:a[0].time,null!==(r=null===(i=this.data[l])||void 0===i?void 0:i.time)&&void 0!==r?r:1/0]},Object.defineProperty(e.prototype,"sliderValues",{get:function(){var t,e=this.states,n=e.values,i=e.selectionType,r=(0,he.CR)(Array.isArray(n)?n:[void 0,n],2),a=r[0],o=r[1],s=this.data,l=s.length,u="value"===i;return[(t=s.findIndex((function(t){return t.time===a})),u?0:t>-1?t/l:0),function(){if(o===1/0)return 1;var t=s.findIndex((function(t){return t.time===o}));return t>-1?t/l:u?.5:1}()]},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){var t=this.states,e=t.values,n=t.selectionType,i=(0,he.CR)(Array.isArray(e)?e:[this.data[0].time,e],2),r=i[0],a=i[1];return"value"===n?a:[r,a]},enumerable:!1,configurable:!0}),e.prototype.getDatumByRatio=function(t){var e=this.data,n=e.length;return e[Math.floor(t*(n-1))]},Object.defineProperty(e.prototype,"chartHandleIconShape",{get:function(){var t=this.states.selectionType,e=this.space.timelineBBox.height;return"range"===t?function(t){return new ew({style:{type:t,height:e,iconSize:e/6}})}:function(){return new Al({style:{x1:0,y1:-e/2,x2:0,y2:e/2,lineWidth:2,stroke:"#c8c8c8"}})}},enumerable:!1,configurable:!0}),e.prototype.getChartStyle=function(t){var e=this,n=t.x,i=t.y,r=t.width,a=t.height,o=this.states,s=o.selectionType,l=o.chartType,u=this.data,c=this.attributes,h=c.type,d=c.labelFormatter,f=ex(this.attributes,"chart"),p=(f.type,(0,he._T)(f,["type"])),g="range"===s;if("time"===h)return(0,he.pi)({handleIconShape:function(){return new tw({})},selectionFill:"#2e7ff8",selectionFillOpacity:1,showLabelOnInteraction:!0,handleLabelDy:g?-15:0,autoFitLabel:g,handleSpacing:g?-15:0,trackFill:"#edeeef",trackLength:r,trackOpacity:.5,trackRadius:a/2,trackSize:a/2,type:s,values:this.sliderValues,formatter:function(t){if(d)return d(t);var n=e.getDatumByRatio(t).time;return"number"==typeof n?iw(n):hb(n,"YYYY-MM-DD HH:mm:ss")},transform:"translate(".concat(n,", ").concat(i,")"),zIndex:1},p);var m="range"===s?5:0,v=u.map((function(t){return t.value}));return(0,he.pi)({handleIconOffset:m,handleIconShape:this.chartHandleIconShape,selectionFill:"#fff",selectionFillOpacity:.5,selectionType:"invert",sparklineSpacing:.1,sparklineColumnLineWidth:0,sparklineColor:"#d4e5fd",sparklineAreaOpacity:1,sparklineAreaLineWidth:0,sparklineData:v,sparklineType:l,sparklineScale:.8,trackLength:r,trackSize:a,type:s,values:this.sliderValues,transform:"translate(".concat(n,", ").concat(i,")"),zIndex:1},p)},e.prototype.renderChart=function(t){void 0===t&&(t=this.space.timelineBBox),this.timeline.update(this.getChartStyle(t))},e.prototype.updateSelection=function(){this.timeline.setValues(this.sliderValues,!0),this.handleSliderChange(this.sliderValues)},e.prototype.getAxisStyle=function(t){var e=this.data,n=this.attributes,i=n.interval,r=n.labelFormatter,a=ex(this.attributes,"axis"),o=t.x,s=t.y,l=t.width,u=(0,he.ev)((0,he.ev)([],(0,he.CR)(e),!1),[{time:0}],!1).map((function(t,e,n){var i=t.time;return{label:"".concat(i),value:e/(n.length-1),time:i}})),c=(0,he.pi)({startPos:[o,s],endPos:[o+l,s],data:u,labelFilter:function(t,e){return ei?"value"===o?[0,0]:"acc"===s?[a(n),a(n)]:[0,a(r-n)]:n<0?"acc"===s?[0,a(r)]:[a(n+i-r),i]:[a(n),a(r)]}(f);return this.setByIndex(g),this.updateSelection(),g},e.prototype.internalBackward=function(t){var e,n,i=this.moveSelection("backward",t);return t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onBackward)||void 0===n||n.call(e),this.dispatchOnChange()),i},e.prototype.backward=function(){this.internalBackward()},e.prototype.internalPlay=function(t){var e,n,i=this,r=this.data,a=this.attributes.loop,o=this.states.speed,s=void 0===o?1:o;this.playInterval=window.setInterval((function(){i.internalForward()[1]!==r.length||a||(i.internalPause(),i.renderController())}),1e3/s),this.states.state="play",!t&&(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onPlay)||void 0===n||n.call(e))},e.prototype.play=function(){this.internalPlay()},e.prototype.internalPause=function(t){var e,n;clearInterval(this.playInterval),this.states.state="pause",!t&&(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onPause)||void 0===n||n.call(e))},e.prototype.pause=function(){this.internalPause()},e.prototype.internalForward=function(t){var e,n,i=this.moveSelection("forward",t);return t||(null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onForward)||void 0===n||n.call(e),this.dispatchOnChange()),i},e.prototype.forward=function(){this.internalForward()},e.prototype.handleSpeedChange=function(t){var e,n;this.states.speed=t,"play"===this.states.state&&(this.internalPause(!0),this.internalPlay(!0)),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onSpeedChange)||void 0===n||n.call(e,t)},e.prototype.handleSelectionTypeChange=function(t){var e,n;this.states.selectionType=t,this.renderChart(),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onSelectionTypeChange)||void 0===n||n.call(e,t)},e.prototype.handleChartTypeChange=function(t){var e,n;this.states.chartType=t,this.renderChart(),null===(n=null===(e=this.attributes)||void 0===e?void 0:e.onChartTypeChange)||void 0===n||n.call(e,t)},e.prototype.render=function(){var t=this.space,e=t.axisBBox,n=t.controllerBBox,i=t.timelineBBox;this.renderController(n),this.renderAxis(e),this.renderChart(i),"play"===this.states.state&&this.internalPlay()},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.internalPause(!0)},e.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"}},e}(Ky);var aw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},ow=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{var t;const e=Object.assign(Object.assign({x:h[0]/2-s/2,y:d,onChange:t=>{const e=((0,Fe.Z)(t)?t:[t,t]).map((t=>function(t){return t instanceof Date}(t)?t.getTime():t));"modify"===this.options.mode?this.filterElements(e):this.hiddenElements(e),null==n||n(e)}},c),{data:r.map((t=>(0,oe.Z)(t)?{time:t,value:0}:t)),width:s,height:l,type:i});this.timebar?this.timebar.update(e):(this.timebar=new rw({style:e}),null===(t=this.canvas)||void 0===t||t.appendChild(this.timebar))}))}upsertCanvas(){if(this.canvas)return this.canvas;const{className:t,height:e,position:n}=this.options,i=this.context.canvas,[r]=i.getSize(),[a,,o]=this.padding,[s,l]=tb({width:r,height:e+a+o,graphCanvas:i,className:"timebar",placement:n});return this.container=s,t&&s.classList.add(t),this.canvas=l,this.canvas}filterElements(t){return aw(this,void 0,void 0,(function*(){var e;if(!this.originalData)return;const{elementTypes:n,getTime:i}=this.options,{graph:r,element:a}=this.context,o=uw(this.originalData);n.forEach((e=>{const n=`${e}s`;o[n]=(this.originalData[n]||[]).filter((e=>{const n=i(e);return!!cw(n,t)}))}));const s=[...o.nodes,...o.combos].map((t=>Dh(t)));o.edges=o.edges.filter((t=>{const e=t.source,n=t.target;return s.includes(e)&&s.includes(n)})),r.setData(o),yield null===(e=a.draw({animation:!1,silence:!0}))||void 0===e?void 0:e.finished}))}hiddenElements(t){const{graph:e}=this.context,{elementTypes:n,getTime:i}=this.options,r=[],a=[];n.forEach((e=>{var n;const o=`${e}s`;((null===(n=this.originalData)||void 0===n?void 0:n[o])||[]).forEach((e=>{const n=Dh(e),o=i(e);cw(o,t)?a.push(n):r.push(n)}))})),e.hideElement(r,!1),e.showElement(a,!1)}destroy(){var t,e,n;const{graph:i}=this.context;this.originalData&&i.setData(Object.assign({},this.originalData)),null===(t=this.timebar)||void 0===t||t.destroy(),null===(e=this.canvas)||void 0===e||e.destroy(),null===(n=this.container)||void 0===n||n.remove(),this.originalData=void 0,this.container=void 0,this.timebar=void 0,this.canvas=void 0,super.destroy()}}lw.defaultOptions={position:"bottom",enable:!0,timebarType:"time",className:"g6-timebar",width:450,height:60,zIndex:3,elementTypes:["node"],padding:10,mode:"modify",getTime:t=>hw(t,sw,void 0),loop:!1};const uw=t=>{const{nodes:e=[],edges:n=[],combos:i=[]}=t;return{nodes:[...e],edges:[...n],combos:[...i]}},cw=(t,e)=>{if((0,oe.Z)(e))return t===e;const[n,i]=e;return t>=n&&t<=i},hw=(t,e,n)=>{var i;for(let n=0;n{const{onClick:e}=this.options;if(t.target instanceof Element&&t.target.className.includes("g6-toolbar-item")){const n=t.target.getAttribute("value");null==e||e(n,t.target)}};const n=this.context.canvas.getContainer();this.$element.style.display="flex",n.appendChild(this.$element),Ev("g6-toolbar-css","style",{},"\n .g6-toolbar {\n position: absolute;\n z-index: 100;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.1);\n opacity: 0.65;\n }\n .g6-toolbar .g6-toolbar-item {\n display: inline-block;\n width: 16px;\n height: 16px;\n padding: 4px;\n cursor: pointer;\n box-sizing: content-box;\n }\n\n .g6-toolbar .g6-toolbar-item:hover {\n background-color: #f0f0f0;\n }\n\n .g6-toolbar .g6-toolbar-item svg {\n display: inline-block;\n width: 100%;\n height: 100%;\n pointer-events: none;\n }\n",document.head),Ev("g6-toolbar-svgicon","div",{display:"none"},'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n'),this.$element.addEventListener("click",this.onToolbarItemClick),this.update(e)}update(t){const e=Object.create(null,{update:{get:()=>super.update}});return dw(this,void 0,void 0,(function*(){e.update.call(this,t);const{className:n,position:i,style:r}=this.options;this.$element.className=`g6-toolbar ${n||""}`,Object.assign(this.$element.style,r,function(t){const e={top:"unset",right:"unset",bottom:"unset",left:"unset"};return t.split("-").forEach((t=>{e[t]="8px"})),e.flexDirection=t.startsWith("top")||t.startsWith("bottom")?"row":"column",e}(i)),this.$element.innerHTML=yield this.getDOMContent()}))}destroy(){this.$element.removeEventListener("click",this.onToolbarItemClick),this.$element.remove(),super.destroy()}getDOMContent(){return dw(this,void 0,void 0,(function*(){return(yield this.options.getItems()).map((t=>`\n
\n \n
`)).join("")}))}}function pw(t){var e=document.createElement("div");e.innerHTML=t;var n=e.childNodes[0];return n&&e.contains(n)&&e.removeChild(n),n}fw.defaultOptions={position:"top-left"};var gw=function(t,e){return t&&e?t.replace(/\\?\{([^{}]+)\}/g,(function(t,n){return"\\"===t.charAt(0)?t.slice(1):void 0===e[n]?"":e[n]})):t},mw=function(t,e){null!=e?t.replaceChildren?Array.isArray(e)?t.replaceChildren.apply(t,(0,he.ev)([],(0,he.CR)(e),!1)):t.replaceChildren(e):(t.innerHTML="",Array.isArray(e)?e.forEach((function(e){return t.appendChild(e)})):t.appendChild(e)):t.innerHTML=""};function vw(t){return void 0===t&&(t=""),{CONTAINER:"".concat(t,"tooltip"),TITLE:"".concat(t,"tooltip-title"),LIST:"".concat(t,"tooltip-list"),LIST_ITEM:"".concat(t,"tooltip-list-item"),NAME:"".concat(t,"tooltip-list-item-name"),MARKER:"".concat(t,"tooltip-list-item-marker"),NAME_LABEL:"".concat(t,"tooltip-list-item-name-label"),VALUE:"".concat(t,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(t,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(t,"tooltip-crosshair-y")}}var yw={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function xw(t){var e;void 0===t&&(t="");var n=vw(t);return(e={})[".".concat(n.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"},e[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},e[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},e[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},e[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},e[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},e[".".concat(n.NAME_LABEL)]=(0,he.pi)({flex:1},yw),e[".".concat(n.VALUE)]=(0,he.pi)({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},yw),e[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},e}var bw=function(t){function e(e){var n,i,r=this,a=null===(i=null===(n=e.style)||void 0===n?void 0:n.template)||void 0===i?void 0:i.prefixCls,o=vw(a);return(r=t.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:'
'),title:'
'),item:'
  • \n \n \n {name}\n \n {value}\n
  • ')},style:xw(a)})||this).timestamp=-1,r.prevCustomContentKey=r.attributes.contentKey,r.initShape(),r.render(r.attributes,r),r}return(0,he.ZT)(e,t),Object.defineProperty(e.prototype,"HTMLTooltipElement",{get:function(){return this.element},enumerable:!1,configurable:!0}),e.prototype.getContainer=function(){return this.element},Object.defineProperty(e.prototype,"elementSize",{get:function(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"HTMLTooltipItemsElements",{get:function(){var t=this.attributes,e=t.data,n=t.template;return e.map((function(t,e){var i=t.name,r=void 0===i?"":i,a=t.color,o=void 0===a?"black":a,s=t.index,l=(0,he._T)(t,["name","color","index"]),u=(0,he.pi)({name:r,color:o,index:null!=s?s:e},l);return pw(gw(n.item,u))}))},enumerable:!1,configurable:!0}),e.prototype.render=function(t,e){this.renderHTMLTooltipElement(),this.updatePosition()},e.prototype.destroy=function(){var e;null===(e=this.element)||void 0===e||e.remove(),t.prototype.destroy.call(this)},e.prototype.show=function(t,e){var n=this;if(void 0!==t&&void 0!==e){var i=function(){n.attributes.x=null!=t?t:n.attributes.x,n.attributes.y=null!=e?e:n.attributes.y,n.updatePosition()};"hidden"===this.element.style.visibility?this.closeTransition(i):i()}this.element.style.visibility="visible"},e.prototype.hide=function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.attributes.enterable&&this.isCursorEntered(t,e)||(this.element.style.visibility="hidden")},e.prototype.initShape=function(){var t=this.attributes.template;this.element=pw(t.container),this.id&&this.element.setAttribute("id",this.id)},e.prototype.renderCustomContent=function(){if(void 0===this.prevCustomContentKey||this.prevCustomContentKey!==this.attributes.contentKey){this.prevCustomContentKey=this.attributes.contentKey;var t=this.attributes.content;t&&("string"==typeof t?this.element.innerHTML=t:mw(this.element,t))}},e.prototype.renderHTMLTooltipElement=function(){var t,e,n=this.attributes,i=n.template,r=n.title,a=n.enterable,o=n.style,s=n.content,l=vw(i.prefixCls),u=this.element;if(this.element.style.pointerEvents=a?"auto":"none",s)this.renderCustomContent();else{r?(u.innerHTML=i.title,u.getElementsByClassName(l.TITLE)[0].innerHTML=r):null===(e=null===(t=u.getElementsByClassName(l.TITLE))||void 0===t?void 0:t[0])||void 0===e||e.remove();var c=this.HTMLTooltipItemsElements,h=document.createElement("ul");h.className=l.LIST,mw(h,c);var d=this.element.querySelector(".".concat(l.LIST));d?d.replaceWith(h):u.appendChild(h)}!function(t,e){Object.entries(e).forEach((function(e){var n=(0,he.CR)(e,2),i=n[0],r=n[1];(0,he.ev)([t],(0,he.CR)(t.querySelectorAll(i)),!1).filter((function(t){return t.matches(i)})).forEach((function(t){t&&(t.style.cssText+=Object.entries(r).reduce((function(t,e){return"".concat(t).concat(e.join(":"),";")}),""))}))}))}(u,o)},e.prototype.getRelativeOffsetFromCursor=function(t){var e=this.attributes,n=e.position,i=e.offset,r=(t||n).split("-"),a={left:[-1,0],right:[1,0],top:[0,-1],bottom:[0,1]},o=this.elementSize,s=o.width,l=o.height,u=[-s/2,-l/2];return r.forEach((function(t){var e=(0,he.CR)(u,2),n=e[0],r=e[1],o=(0,he.CR)(a[t],2),c=o[0],h=o[1];u=[n+(s/2+i[0])*c,r+(l/2+i[1])*h]})),u},e.prototype.setOffsetPosition=function(t){var e=(0,he.CR)(t,2),n=e[0],i=e[1],r=this.attributes,a=r.x,o=void 0===a?0:a,s=r.y,l=void 0===s?0:s,u=r.container,c=u.x,h=u.y;this.element.style.left="".concat(+o+c+n,"px"),this.element.style.top="".concat(+l+h+i,"px")},e.prototype.updatePosition=function(){var t=this.attributes.showDelay,e=void 0===t?60:t,n=Date.now();this.timestamp>0&&n-this.timestampm+s.width,top:pv+s.height},x=[];l.split("-").forEach((function(t){y[t]?x.push(g[t]):x.push(t)}));var b=x.join("-");return this.getRelativeOffsetFromCursor(b)},e.prototype.isCursorEntered=function(t,e){if(this.element){var n=this.element.getBoundingClientRect(),i=n.x,r=n.y,a=n.width,o=n.height;return new sx(i,r,a,o).isPointIn(t,e)}return!1},e.prototype.closeTransition=function(t){var e=this,n=this.element.style.transition;this.element.style.transition="none",t(),setTimeout((function(){e.element.style.transition=n}),10)},e.tag="tooltip",e}(Ky);class _w extends bv{constructor(t,e){super(t,Object.assign({},_w.defaultOptions,e)),this.currentTarget=null,this.tooltipElement=null,this.container=null,this.isEnable=t=>{const{enable:e}=this.options;return"function"==typeof e?e(t):e},this.onClick=t=>{const{target:{id:e}}=t;this.currentTarget===e?(this.hide(t),this.currentTarget=null):(this.currentTarget=e,this.show(t))},this.onPointerMove=t=>{const{target:e}=t;this.currentTarget&&e.id!==this.currentTarget&&this.show(t)},this.onPointerLeave=t=>{this.hide(t),this.currentTarget=null},this.onCanvasMove=t=>{this.hide(t),this.currentTarget=null},this.onPointerEnter=t=>{this.show(t)},this.showById=t=>{const e={target:{id:t}};this.show(e)},this.getElementData=(t,e)=>{const{model:n}=this.context;switch(e){case"node":return n.getNodeData([t]);case"edge":return n.getEdgeData([t]);case"combo":return n.getComboData([t]);default:return[]}},this.show=t=>{const{client:e,target:{id:n}}=t;if(wm(t.target))return;if(!this.tooltipElement||!this.isEnable(t))return;const i=this.context.graph.getElementType(n),{getContent:r,title:a}=this.options;this.currentTarget=n;const o=this.getElementData(n,i);let s,l;if(e)s=e.x,l=e.y;else{const t=Zd(o,"0.style",{x:0,y:0});s=t.x,l=t.y}let u={};if(r)u.content=r(t,o);else{const t=this.context.graph.getElementRenderStyle(n),e="node"===i?t.fill:t.stroke;u={title:a||i,data:o.map((t=>({name:"ID",value:t.id||`${t.source} -> ${t.target}`,color:e})))}}this.tooltipElement.update(Object.assign(Object.assign(Object.assign({},this.tooltipStyleProps),{x:s,y:l,style:{".tooltip":{visibility:"visible"}}}),u))},this.hide=t=>{var e;if(!t)return void(null===(e=this.tooltipElement)||void 0===e||e.hide());if(!this.tooltipElement)return;if(!this.currentTarget)return;const{client:{x:n,y:i}}=t;this.tooltipElement.hide(n,i)},this.initTooltip=()=>{var t;const e=new bw({className:"tooltip",style:this.tooltipStyleProps});return null===(t=this.container)||void 0===t||t.appendChild(e.HTMLTooltipElement),e},this.render(),this.bindEvents()}getEvents(){return"click"===this.options.trigger?{"node:click":this.onClick,"edge:click":this.onClick,"combo:click":this.onClick,"canvas:click":this.onPointerLeave,contextmenu:this.onPointerLeave,drag:this.onPointerLeave}:{"node:pointerenter":this.onPointerEnter,"node:pointermove":this.onPointerMove,"canvas:pointermove":this.onCanvasMove,"edge:pointerenter":this.onPointerEnter,"edge:pointermove":this.onPointerMove,"combo:pointerenter":this.onPointerEnter,"combo:pointermove":this.onPointerMove,contextmenu:this.onPointerLeave,"node:drag":this.onPointerLeave}}update(t){var e;this.unbindEvents(),super.update(t),this.tooltipElement&&(null===(e=this.container)||void 0===e||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:r}=n.getBoundingClientRect(),{style:a,position:o,enterable:s,container:l={x:-r,y:-i},title:u,offset:c}=this.options,[h,d]=e,[f,p]=t.getSize();return{x:h,y:d,container:l,title:u,bounding:{x:0,y:0,width:f,height:p},position:o,enterable:s,offset:c,style:a}}destroy(){var t;this.unbindEvents(),this.tooltipElement&&(null===(t=this.container)||void 0===t||t.removeChild(this.tooltipElement.HTMLTooltipElement)),super.destroy()}}_w.defaultOptions={trigger:"hover",position:"top-right",enterable:!1,enable:!0,offset:[10,10],style:{".tooltip":{visibility:"hidden"}}};var Ew=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};let ww;function Tw(t,e){ww||(ww=document.createElement("canvas")),ww.width=t,ww.height=e;return ww.getContext("2d").clearRect(0,0,t,e),ww}var Sw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},Mw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);rsuper.update}});return Sw(this,void 0,void 0,(function*(){e.update.call(this,t);const n=this.options,{width:i,height:r,text:a,imageURL:o}=n,s=Mw(n,["width","height","text","imageURL"]);Object.keys(s).forEach((e=>{e.startsWith("background")&&(this.$element.style[e]=t[e])}));const l=o?yield function(t,e,n,i){return Ew(this,void 0,void 0,(function*(){const r=Tw(t,e),a=r.getContext("2d"),{rotate:o,opacity:s}=i;o&&a.rotate(o),s&&(a.globalAlpha=s);const l=new Image;return l.crossOrigin="anonymous",l.src=n,new Promise((n=>{l.onload=function(){const i=t>l.width?(t-l.width)/2:0,o=e>l.height?(e-l.height)/2:0;a.drawImage(l,0,0,l.width,l.height,i,o,t-2*i,e-2*o),n(r.toDataURL())}}))}))}(i,r,o,s):yield function(t,e,n,i){return Ew(this,void 0,void 0,(function*(){const r=Tw(t,e),a=r.getContext("2d"),{rotate:o,opacity:s,textFill:l,textFontSize:u,textFontFamily:c,textFontVariant:h,textFontWeight:d,textAlign:f,textBaseline:p}=i;return a.textAlign=f,a.textBaseline=p,a.translate(t/2,e/2),a.font=`${u}px ${c} ${h} ${d}`,o&&a.rotate(o),s&&(a.globalAlpha=s),l&&(a.fillStyle=l,a.fillText(`${n}`,0,0)),r.toDataURL()}))}(i,r,a,s);this.$element.style.backgroundImage=`url(${l})`}))}destroy(){super.destroy(),this.$element.remove()}}Cw.defaultOptions={width:200,height:100,opacity:.2,rotate:Math.PI/12,text:"",textFill:"#000",textFontSize:16,textAlign:"center",textBaseline:"middle",backgroundRepeat:"repeat"};var Aw=function(){function t(e){(0,o.Z)(this,t),this.dragndropPluginOptions=e}return(0,s.Z)(t,[{key:"apply",value:function(e){var n=this,i=e.renderingService,r=e.renderingContext.root.ownerDocument,a=r.defaultView,o=function(t){var e=t.target,i=e===r,o=i&&n.dragndropPluginOptions.isDocumentDraggable?r:e.closest&&e.closest("[draggable=true]");if(o){var s=!1,l=t.timeStamp,u=[t.clientX,t.clientY],c=null,h=[t.clientX,t.clientY],d=function(){var t=(0,li.Z)((0,si.Z)().mark((function t(a){var d,f,p,g,m,v;return(0,si.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s){t.next=8;break}if(d=a.timeStamp-l,f=se([a.clientX,a.clientY],u),!(d<=n.dragndropPluginOptions.dragstartTimeThreshold||f<=n.dragndropPluginOptions.dragstartDistanceThreshold)){t.next=5;break}return t.abrupt("return");case 5:a.type="dragstart",o.dispatchEvent(a),s=!0;case 8:if(a.type="drag",a.dx=a.clientX-h[0],a.dy=a.clientY-h[1],o.dispatchEvent(a),h=[a.clientX,a.clientY],i){t.next=21;break}return p="pointer"===n.dragndropPluginOptions.overlap?[a.canvasX,a.canvasY]:e.getBounds().center,t.next=17,r.elementsFromPoint(p[0],p[1]);case 17:g=t.sent,m=g[g.indexOf(e)+1],v=(null==m?void 0:m.closest("[droppable=true]"))||(n.dragndropPluginOptions.isDocumentDroppable?r:null),c!==v&&(c&&(a.type="dragleave",a.target=c,c.dispatchEvent(a)),v&&(a.type="dragenter",a.target=v,v.dispatchEvent(a)),(c=v)&&(a.type="dragover",a.target=c,c.dispatchEvent(a)));case 21:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}();a.addEventListener("pointermove",d);var f=function(t){if(s){t.detail={preventClick:!0};var e=t.clone();c&&(e.type="drop",e.target=c,c.dispatchEvent(e)),e.type="dragend",o.dispatchEvent(e),s=!1}a.removeEventListener("pointermove",d)};e.addEventListener("pointerup",f,{once:!0}),e.addEventListener("pointerupoutside",f,{once:!0})}};i.hooks.init.tap(t.tag,(function(){a.addEventListener("pointerdown",o)})),i.hooks.destroy.tap(t.tag,(function(){a.removeEventListener("pointerdown",o)}))}}])}();Aw.tag="Dragndrop";var Ow=function(t){function e(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,o.Z)(this,e),(t=d(this,e)).name="dragndrop",t.options=n,t}return(0,f.Z)(e,t),(0,s.Z)(e,[{key:"init",value:function(){this.addRenderingPlugin(new Aw((0,a.Z)({overlap:"pointer",isDocumentDraggable:!1,isDocumentDroppable:!1,dragstartDistanceThreshold:0,dragstartTimeThreshold:0},this.options)))}},{key:"destroy",value:function(){this.removeAllRenderingPlugins()}},{key:"setOptions",value:function(t){Object.assign(this.plugins[0].dragndropPluginOptions,t)}}])}(mi),Nw=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},Pw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r[t,new Kl(Object.assign(Object.assign({},o),{supportsMutipleCanvasesInOneContainer:a,renderer:l[t],background:a?"background"===t?i:void 0:i}))])));Iw(u),this.extends={config:this.config,renderer:n,renderers:l,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(),r=i.getPosition(),a=i.getFocalPoint();n.resize(t,e),i.setPosition(r),i.setFocalPoint(a)}))}getBounds(t){return $c(Object.values(this.getLayers()).map((e=>t?e.getRoot().childNodes.find((e=>e.classList.includes(t))):e.getRoot())).filter((t=>(null==t?void 0:t.childNodes.length)>0)).map((t=>t.getBounds())))}getContainer(){const t=this.extends.config.container;return"string"==typeof t?document.getElementById(t):t}getSize(){return[this.extends.config.width||0,this.extends.config.height||0]}appendChild(t,e){var n;const i=(null===(n=t.style)||void 0===n?void 0:n.$layer)||"main";return this.getLayer(i).appendChild(t,e)}setRenderer(t){if(t===this.extends.renderer)return;const e=kw(t,this.config.enableMultiLayer?Rw:Lw);this.extends.renderers=e,Object.entries(e).forEach((([t,e])=>this.getLayer(t).setRenderer(e))),Iw(this.getLayers())}getCanvasByViewport(t){return bd(this.getLayer().viewport2Canvas(_d(t)))}getViewportByCanvas(t){return bd(this.getLayer().canvas2Viewport(_d(t)))}getViewportByClient(t){return bd(this.getLayer().client2Viewport(_d(t)))}getClientByViewport(t){return bd(this.getLayer().viewport2Client(_d(t)))}getClientByCanvas(t){return this.getClientByViewport(this.getViewportByCanvas(t))}getCanvasByClient(t){const e=this.getLayer(),n=e.client2Viewport(_d(t));return bd(e.viewport2Canvas(n))}toDataURL(){return Nw(this,arguments,void 0,(function*(t={}){const e=globalThis.devicePixelRatio||1,{mode:n="viewport"}=t,i=Pw(t,["mode"]);let[r,a,o,s]=[0,0,0,0];if("viewport"===n)[o,s]=this.getSize();else if("overall"===n){const t=this.getBounds(),e=Wc(t);[r,a]=t.min,[o,s]=e}const l=pw('
    '),u=new Kl({width:o,height:s,renderer:new ig,devicePixelRatio:e,container:l,background:this.extends.config.background});yield u.ready,u.appendChild(this.getLayer("background").getRoot().cloneNode(!0)),u.appendChild(this.getRoot().cloneNode(!0));const c=this.getLayer("label").getRoot().cloneNode(!0),h=u.viewport2Canvas({x:0,y:0}),d=this.getCanvasByViewport([0,0]);c.translate([d[0]-h.x,d[1]-h.y]),c.scale(1/this.getCamera().getZoom()),u.appendChild(c),u.appendChild(this.getLayer("transient").getRoot().cloneNode(!0));const f=this.getCamera(),p=u.getCamera();if("viewport"===n)p.setZoom(f.getZoom()),p.setPosition(f.getPosition()),p.setFocalPoint(f.getFocalPoint());else if("overall"===n){const[t,e,n]=p.getPosition(),[i,o,s]=p.getFocalPoint();p.setPosition([t+r,e+a,n]),p.setFocalPoint([i+r,o+a,s])}const g=u.getContextService();return new Promise((t=>{u.addEventListener(Zl.RERENDER,(()=>Nw(this,void 0,void 0,(function*(){yield new Promise((t=>setTimeout(t,300)));const e=yield g.toDataURL(i);t(e)}))))}))}))}destroy(){Object.values(this.getLayers()).forEach((t=>{t.getCamera().cancelLandmarkAnimation(),t.destroy()}))}}function kw(t,e){return Object.fromEntries(e.map((e=>{const n=(null==t?void 0:t(e))||new ig;return"main"===e?n.registerPlugin(new Ow({isDocumentDraggable:!0,isDocumentDroppable:!0,dragstartDistanceThreshold:10,dragstartTimeThreshold:100})):n.unregisterPlugin(n.getPlugin("dom-interaction")),[e,n]})))}function Iw(t){Object.entries(t).forEach((([t,e])=>{const n=e.getContextService().getDomElement();(null==n?void 0:n.style)&&(n.style.gridArea="1 / 1 / 2 / 2",n.style.outline="none",n.tabIndex=1,"main"!==t&&(n.style.pointerEvents="none")),(null==n?void 0:n.parentElement)&&(n.parentElement.style.display="grid")}))}const Bw=t=>t?parseInt(t):0;function Fw(t){if(!t)return[0,0];let e=640,n=480;const[i,r]=function(t){const e=getComputedStyle(t),n=t.clientWidth||Bw(e.width),i=t.clientHeight||Bw(e.height);return[n-(Bw(e.paddingLeft)+Bw(e.paddingRight)),i-(Bw(e.paddingTop)+Bw(e.paddingBottom))]}(t);e=i||e,n=r||n;return[Math.max((0,oe.Z)(e)?e:1,1),Math.max((0,oe.Z)(n)?n:1,1)]}class zw{constructor(t){this.type=t}}class Gw extends zw{constructor(t,e){super(t),this.data=e}}class jw extends zw{constructor(t,e,n,i){super(t),this.animationType=e,this.animation=n,this.data=i}}class Uw extends zw{constructor(t,e,n){super(t),this.elementType=e,this.data=n}}class Hw extends zw{constructor(t,e){super(t),this.data=e}}function Vw(t,e){t.emit(e.type,e)}function Zw(t){var e;return(null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.zIndex)||0}const Ww="cachedStyle",Xw=t=>`__${t}__`;function Yw(t,e){return Zd(t,[Ww,Xw(e)])}class qw{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,r,a;null===(i=null==e?void 0:e.before)||void 0===i||i.call(e);const o=this.getTasks().map((([e,i])=>{var r,a,o;const{element:s,elementType:l,stage:u}=e,c=Mc(this.context.options,l,u,t);null===(r=null==i?void 0:i.before)||void 0===r||r.call(i);const h=c.length?Oc(s,this.inferStyle(e,n),c):null;return h?(null===(a=null==i?void 0:i.beforeAnimate)||void 0===a||a.call(i,h),h.finished.then((()=>{var t,e;null===(t=null==i?void 0:i.afterAnimate)||void 0===t||t.call(i,h),null===(e=null==i?void 0:i.after)||void 0===e||e.call(i),this.animations.delete(h)}))):null===(o=null==i?void 0:i.after)||void 0===o||o.call(i),h})).filter(Boolean);o.forEach((t=>this.animations.add(t)));const s=Ec(o);return s?(null===(r=null==e?void 0:e.beforeAnimate)||void 0===r||r.call(e,s),s.finished.then((()=>{var t,n;null===(t=null==e?void 0:e.afterAnimate)||void 0===t||t.call(e,s),null===(n=null==e?void 0:e.after)||void 0===n||n.call(e),this.release()}))):null===(a=null==e?void 0:e.after)||void 0===a||a.call(e),s}inferStyle(t,e){var n,i;const{element:r,elementType:a,stage:o,originalStyle:s,updatedStyle:l={}}=t;t.modifiedStyle||(t.modifiedStyle=Object.assign(Object.assign({},s),l));const{modifiedStyle:u}=t,c={},h={};if("enter"===o)Object.assign(c,{opacity:0});else if("exit"===o)Object.assign(h,{opacity:0});else if("show"===o)Object.assign(c,{opacity:0}),Object.assign(h,{opacity:null!==(n=Yw(r,"opacity"))&&void 0!==n?n:Tc("opacity")});else if("hide"===o)Object.assign(c,{opacity:null!==(i=Yw(r,"opacity"))&&void 0!==i?i:Tc("opacity")}),Object.assign(h,{opacity:0});else if("collapse"===o){const{collapse:t}=e||{},{target:n,descendants:i,position:o}=t;if("node"===a){if(i.includes(r.id)){const[t,e,n]=o;Object.assign(h,{x:t,y:e,z:n})}}else if("combo"===a){if(r.id===n||i.includes(r.id)){const[t,e]=o;Object.assign(h,{x:t,y:e,childrenNode:s.childrenNode})}}else"edge"===a&&Object.assign(h,{sourceNode:u.sourceNode,targetNode:u.targetNode})}else if("expand"===o){const{expand:t}=e||{},{target:n,descendants:i,position:o}=t;if("node"===a){if(r.id===n||i.includes(r.id)){const[t,e,n]=o;Object.assign(c,{x:t,y:e,z:n})}}else if("combo"===a){if(r.id===n||i.includes(r.id)){const[t,e,n]=o;Object.assign(c,{x:t,y:e,z:n,childrenNode:u.childrenNode})}}else"edge"===a&&Object.assign(c,{sourceNode:u.sourceNode,targetNode:u.targetNode})}return[Object.keys(c).length>0?Object.assign({},s,c):s,Object.keys(h).length>0?Object.assign({},u,h):u]}stop(){this.animations.forEach((t=>t.cancel()))}clear(){this.tasks=[]}release(){var t,e;const{canvas:n}=this.context,i=null===(e=null===(t=n.document)||void 0===t?void 0:t.timeline)||void 0===e?void 0:e.animationsWithPromises;i&&(n.document.timeline.animationsWithPromises=i.filter((t=>"finished"!==t.playState)))}destroy(){this.stop(),this.animations.clear(),this.tasks=[]}}class $w{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++,1===this.batchCount&&this.emit(new Gw(hc.BATCH_START,{initiate:t}))}endBatch(){this.batchCount--,0===this.batchCount&&this.emit(new Gw(hc.BATCH_END))}get isBatching(){return this.batchCount>0}destroy(){this.context=null}}class Kw extends Yh{constructor(t){super(t),this.currentTarget=null,this.currentTargetType=null,this.category="behavior",this.forwardCanvasEvents=t=>{const{target:e}=t,n=function(t){if(!t)return null;if(t instanceof zl)return{type:"canvas",element:t};let e=t;for(;e;){if(um(e))return{type:"node",element:e};if(cm(e))return{type:"edge",element:e};if(hm(e))return{type:"combo",element:e};e=e.parentElement}return null}(e);if(!n)return;const{graph:i,canvas:r}=this.context,{type:a,element:o}=n;if("destroyed"in o&&(wm(o)||o.destroyed))return;const{type:s,detail:l,button:u}=t,c=Object.assign(Object.assign({},t),{target:o,targetType:a,originalTarget:e});s===lc.POINTER_MOVE&&(this.currentTarget!==o&&(this.currentTarget&&i.emit(`${this.currentTargetType}:${lc.POINTER_LEAVE}`,Object.assign(Object.assign({},c),{type:lc.POINTER_LEAVE,target:this.currentTarget,targetType:this.currentTargetType})),o&&(Object.assign(c,{type:lc.POINTER_ENTER}),i.emit(`${a}:${lc.POINTER_ENTER}`,c))),this.currentTarget=o,this.currentTargetType=a),s===lc.CLICK&&2===u||(i.emit(`${a}:${s}`,c),i.emit(s,c)),s===lc.CLICK&&2===l&&(Object.assign(c,{type:lc.DBLCLICK}),i.emit(`${a}:${lc.DBLCLICK}`,c),i.emit(lc.DBLCLICK,c)),s===lc.POINTER_DOWN&&2===u&&(Object.assign(c,{type:lc.CONTEXT_MENU,preventDefault:()=>{var t;null===(t=r.getContainer())||void 0===t||t.addEventListener(lc.CONTEXT_MENU,(t=>t.preventDefault()),{once:!0})}}),i.emit(`${a}:${lc.CONTEXT_MENU}`,c),i.emit(lc.CONTEXT_MENU,c))},this.forwardContainerEvents=t=>{this.context.graph.emit(t.type,t)},this.forwardEvents(),this.setBehaviors(this.context.options.behaviors||[])}setBehaviors(t){this.setExtensions(t)}forwardEvents(){const t=this.context.canvas.getContainer();t&&[uc.KEY_DOWN,uc.KEY_UP].forEach((e=>{t.addEventListener(e,this.forwardContainerEvents)}));const e=this.context.canvas.document;e&&[lc.CLICK,lc.DBLCLICK,lc.POINTER_OVER,lc.POINTER_LEAVE,lc.POINTER_ENTER,lc.POINTER_MOVE,lc.POINTER_OUT,lc.POINTER_DOWN,lc.POINTER_UP,lc.CONTEXT_MENU,lc.DRAG_START,lc.DRAG,lc.DRAG_END,lc.DRAG_ENTER,lc.DRAG_OVER,lc.DRAG_LEAVE,lc.DROP,lc.WHEEL].forEach((t=>{e.addEventListener(t,this.forwardCanvasEvents)}))}destroy(){const t=this.context.canvas.getContainer();t&&[uc.KEY_DOWN,uc.KEY_UP].forEach((e=>{t.removeEventListener(e,this.forwardContainerEvents)})),this.context.canvas.document.removeAllEventListeners(),super.destroy()}}var Qw=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);rt.length===e.length&&t.every(((t,n)=>t===e[n])),d=(t,e)=>{const n=Object.keys(t),i=Object.keys(e);return n.length===i.length&&n.every((n=>t[n]===e[n]))};return!!d(o,Qw(e,["states","data","style","children"]))&&(!!h(a,c)&&(!!h(n,s)&&(!!d(i,l)&&!!d(r,u))))}var nT=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r0}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=rT(n);return this.isCombo(Dh(i))||(void 0===t||t.includes(Dh(i)))&&e.push(i),e}),[])}getEdgeDatum(t){return rT(this.model.getEdge(t))}getEdgeData(t){return this.model.getAllEdges().reduce(((e,n)=>{const i=rT(n);return(void 0===t||t.includes(Dh(i)))&&e.push(i),e}),[])}getComboData(t){return this.model.getAllNodes().reduce(((e,n)=>{const i=rT(n);return this.isCombo(Dh(i))?((void 0===t||t.includes(Dh(i)))&&e.push(i),e):e}),[])}getRootsData(t=gc){return this.model.getRoots(t).map(rT)}getAncestorsData(t,e){const{model:n}=this;return n.hasNode(t)&&n.hasTreeStructure(e)?n.getAncestors(t,e).map(rT):[]}getDescendantsData(t){const e=this.getElementDataById(t),n=[];return Fd(e,(t=>{t!==e&&n.push(t)}),(t=>this.getChildrenData(Dh(t))),"TB"),n}getParentData(t,e){const{model:n}=this;if(!e)return void bc.warn("The hierarchy structure key is not specified");if(!n.hasNode(t)||!n.hasTreeStructure(e))return;const i=n.getParent(t,e);return i?rT(i):void 0}getChildrenData(t){const e="node"===this.getElementType(t)?gc:pc,{model:n}=this;return n.hasNode(t)&&n.hasTreeStructure(e)?n.getChildren(t,e).map(rT):[]}getElementsDataByType(t){return"node"===t?this.getNodeData():"edge"===t?this.getEdgeData():"combo"===t?this.getComboData():[]}getElementDataById(t){return"edge"===this.getElementType(t)?this.getEdgeDatum(t):this.getNodeLikeDatum(t)}getNodeLikeDatum(t){return rT(this.model.getNode(t))}getNodeLikeData(t){return this.model.getAllNodes().reduce(((e,n)=>{const i=rT(n);return t?t.includes(Dh(i))&&e.push(i):e.push(i),e}),[])}getElementDataByState(t,e){return this.getElementsDataByType(t).filter((t=>{var n;return null===(n=t.states)||void 0===n?void 0:n.includes(e)}))}getElementState(t){var e;return(null===(e=this.getElementDataById(t))||void 0===e?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(rT)}getNeighborNodesData(t){return this.model.getNeighbors(t).map(rT)}setData(t){const{nodes:e=[],edges:n=[],combos:i=[]}=t,{nodes:r,edges:a,combos:o}=this.getData(),s=Zh(r,e,(t=>Dh(t)),eT),l=Zh(a,n,(t=>Dh(t)),eT),u=Zh(o,i,(t=>Dh(t)),eT);this.batch((()=>{const t={nodes:s.enter,edges:l.enter,combos:u.enter};this.addData(t),this.computeZIndex(t,"add",!0);const e={nodes:s.update,edges:l.update,combos:u.update};this.updateData(e),this.computeZIndex(e,"update",!0);const n={nodes:s.exit.map(Dh),edges:l.exit.map(Dh),combos:u.exit.map(Dh)};this.removeData(n)}))}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((t=>(this.pushChange({value:t,type:rc.NodeAdded}),iT(t))))),this.updateNodeLikeHierarchy(t),this.computeZIndex({nodes:t},"add"))}addEdgeData(t=[]){t.length&&(this.model.addEdges(t.map((t=>(this.pushChange({value:t,type:rc.EdgeAdded}),iT(t))))),this.computeZIndex({edges:t},"add"))}addComboData(t=[]){if(!t.length)return;const{model:e}=this;e.hasTreeStructure(pc)||e.attachTreeStructure(pc),e.addNodes(t.map((t=>(this.comboIds.add(Dh(t)),this.pushChange({value:t,type:rc.ComboAdded}),iT(t))))),this.updateNodeLikeHierarchy(t),this.computeZIndex({combos:t},"add")}addChildrenData(t,e){const n=this.getNodeLikeDatum(t),i=e.map(Dh);this.addNodeData(e),this.updateNodeData([{id:t,children:[...n.children||[],...i]}]),this.addEdgeData(i.map((e=>({source:t,target:e}))))}computeZIndex(t,e,n=!1){!n&&this.isBatching()||this.batch((()=>{const{nodes:n=[],edges:i=[],combos:r=[]}=t;r.forEach((t=>{var n,i,r;const a=Dh(t);if("add"===e&&(0,oe.Z)(null===(n=t.style)||void 0===n?void 0:n.zIndex))return;if("update"===e&&!("combo"in t))return;const o=this.getParentData(a,pc),s=o?(null!==(r=null===(i=o.style)||void 0===i?void 0:i.zIndex)&&void 0!==r?r:0)+1:0;this.preventUpdateNodeLikeHierarchy((()=>{this.updateComboData([{id:a,style:{zIndex:s}}])}))})),n.forEach((t=>{var n,i,r;const a=Dh(t);if("add"===e&&(0,oe.Z)(null===(n=t.style)||void 0===n?void 0:n.zIndex))return;if("update"===e&&!("combo"in t)&&!("children"in t))return;let o=0;const s=this.getParentData(a,pc);if(s)o=((null===(i=s.style)||void 0===i?void 0:i.zIndex)||0)+1;else{const t=this.getParentData(a,gc);t&&(o=(null===(r=null==t?void 0:t.style)||void 0===r?void 0:r.zIndex)||0)}this.preventUpdateNodeLikeHierarchy((()=>{this.updateNodeData([{id:a,style:{zIndex:o}}])}))})),i.forEach((t=>{var e,n,i,r,a;if((0,oe.Z)(null===(e=t.style)||void 0===e?void 0:e.zIndex))return;let{id:o,source:s,target:l}=t;if(o){const t=this.getEdgeDatum(o);s=t.source,l=t.target}else o=Dh(t);if(!s||!l)return;const u=(null===(i=null===(n=this.getNodeLikeDatum(s))||void 0===n?void 0:n.style)||void 0===i?void 0:i.zIndex)||0,c=(null===(a=null===(r=this.getNodeLikeDatum(l))||void 0===r?void 0:r.style)||void 0===a?void 0:a.zIndex)||0;this.updateEdgeData([{id:Dh(t),style:{zIndex:Math.max(u,c)-1}}])}))}))}getFrontZIndex(t){var e;const n=this.getElementType(t),i=this.getElementDataById(t),r=this.getData();if(Object.assign(r,{[`${n}s`]:r[`${n}s`].filter((e=>Dh(e)!==t))}),"combo"===n&&!Vd(i)){const e=new Set(this.getAncestorsData(t,pc).map(Dh));r.nodes=r.nodes.filter((t=>!e.has(Dh(t)))),r.combos=r.combos.filter((t=>!e.has(Dh(t)))),r.edges=r.edges.filter((({source:t,target:n})=>!e.has(t)&&!e.has(n)))}return Math.max((null===(e=i.style)||void 0===e?void 0:e.zIndex)||0,0,...Object.values(r).flat().map((t=>{var e;return((null===(e=null==t?void 0:t.style)||void 0===e?void 0:e.zIndex)||0)+1})))}updateNodeLikeHierarchy(t){if(!this.enableUpdateNodeLikeHierarchy)return;const{model:e}=this;t.forEach((t=>{const n=Dh(t);kh(t)&&(e.hasTreeStructure(pc)||e.attachTreeStructure(pc),this.setParent(n,kh(t),pc));const i=t.children||[];if(i.length){e.hasTreeStructure(gc)||e.attachTreeStructure(gc);const t=i.filter((t=>e.hasNode(t)));t.forEach((t=>this.setParent(t,n,gc))),t.length!==i.length&&this.updateNodeData([{id:n,children:t}])}}))}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((t=>{const i=Dh(t),r=rT(e.getNode(i));if(eT(r,t))return;const a=Jw(r,t);this.pushChange({value:a,original:r,type:rc.NodeUpdated}),e.mergeNodeData(i,a),n.push(a)})),this.updateNodeLikeHierarchy(n)})),this.computeZIndex({nodes:t},"update")}refreshData(){const{nodes:t,edges:e,combos:n}=this.getData();t.forEach((t=>{this.pushChange({value:t,original:t,type:rc.NodeUpdated})})),e.forEach((t=>{this.pushChange({value:t,original:t,type:rc.EdgeUpdated})})),n.forEach((t=>{this.pushChange({value:t,original:t,type:rc.ComboUpdated})}))}syncNodeDatum(t){const{model:e}=this,n=Dh(t),i=Jw(rT(e.getNode(n)),t);e.mergeNodeData(n,i)}updateEdgeData(t=[]){if(!t.length)return;const{model:e}=this;this.batch((()=>{t.forEach((t=>{const n=Dh(t),i=rT(e.getEdge(n));if(eT(i,t))return;t.source&&i.source!==t.source&&e.updateEdgeSource(n,t.source),t.target&&i.target!==t.target&&e.updateEdgeTarget(n,t.target);const r=Jw(i,t);this.pushChange({value:r,original:i,type:rc.EdgeUpdated}),e.mergeEdgeData(n,r)}))})),this.computeZIndex({edges:t},"update")}updateComboData(t=[]){if(!t.length)return;const{model:e}=this;e.batch((()=>{const n=[];t.forEach((t=>{const i=Dh(t),r=rT(e.getNode(i));if(eT(r,t))return;const a=Jw(r,t);this.pushChange({value:a,original:r,type:rc.ComboUpdated}),e.mergeNodeData(i,a),n.push(a)})),this.updateNodeLikeHierarchy(n)})),this.computeZIndex({combos:t},"update")}setParent(t,e,n,i=!0){if(t===e)return;const r=kh(this.getNodeLikeDatum(t));if(r!==e&&n===pc){const n={id:t,combo:e};this.isCombo(t)?this.syncComboDatum(n):this.syncNodeDatum(n)}this.model.setParent(t,e,n),i&&n===pc&&function(t,e){void 0===e&&(e=new Map);var n=[];if(Array.isArray(t))for(var i=0,r=t.length;i{void 0!==t&&this.refreshComboData(t)}))}refreshComboData(t){const e=this.getComboData([t])[0],n=this.getAncestorsData(t,pc);e&&this.pushChange({value:e,original:e,type:rc.ComboUpdated}),n.forEach((t=>{this.pushChange({value:t,original:t,type:rc.ComboUpdated})}))}syncComboDatum(t){const{model:e}=this,n=Dh(t);if(!e.hasNode(n))return;const i=Jw(rT(e.getNode(n)),t);e.mergeNodeData(n,i)}getElementPosition(t){return md(this.getElementDataById(t))}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=td(this.getElementPosition(t),[...e,0].slice(0,3));this.translateNodeTo(t,n)}translateNodeTo(t,e){const[n=0,i=0,r=0]=e;this.preventUpdateNodeLikeHierarchy((()=>{this.updateNodeData([{id:t,style:{x:n,y:i,z:r}}])}))}translateComboBy(t,e){const[n=0,i=0,r=0]=e;if([n,i,r].some(isNaN)||[n,i,r].every((t=>0===t)))return;const a=this.getComboData([t])[0];if(!a)return;const o=new Set;Fd(a,(t=>{const e=Dh(t);if(o.has(e))return;o.add(e);const[a,s,l]=md(t),u=Jw(t,{style:{x:a+n,y:s+i,z:l+r}});this.pushChange({value:u,original:t,type:this.isCombo(e)?rc.ComboUpdated:rc.NodeUpdated}),this.model.mergeNodeData(e,u)}),(t=>this.getChildrenData(Dh(t))),"BT")}translateComboTo(t,e){var n;if(e.some(isNaN))return;const[i=0,r=0,a=0]=e,o=null===(n=this.getComboData([t]))||void 0===n?void 0:n[0];if(!o)return;const[s,l,u]=md(o),c=i-s,h=r-l,d=a-u;Fd(o,(t=>{const e=Dh(t),[n,i,r]=md(t),a=Jw(t,{style:{x:n+c,y:i+h,z:r+d}});this.pushChange({value:a,original:t,type:this.isCombo(e)?rc.ComboUpdated:rc.NodeUpdated}),this.model.mergeNodeData(e,a)}),(t=>this.getChildrenData(Dh(t))),"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((t=>{this.removeEdgeData(this.getRelatedEdgesData(t).map(Dh)),this.pushChange({value:this.getNodeData([t])[0],type:rc.NodeRemoved}),this.removeNodeLikeHierarchy(t)})),this.model.removeNodes(t)}))}removeEdgeData(t=[]){t.length&&(t.forEach((t=>this.pushChange({value:this.getEdgeData([t])[0],type:rc.EdgeRemoved}))),this.model.removeEdges(t))}removeComboData(t=[]){t.length&&this.batch((()=>{t.forEach((t=>{this.pushChange({value:this.getComboData([t])[0],type:rc.ComboRemoved}),this.removeNodeLikeHierarchy(t),this.comboIds.delete(t)})),this.model.removeNodes(t)}))}removeNodeLikeHierarchy(t){if(this.model.hasTreeStructure(pc)){const e=kh(this.getNodeLikeDatum(t));this.setParent(t,void 0,pc,!1),this.model.getChildren(t,pc).forEach((t=>{const n=rT(t),i=Dh(n);this.setParent(Dh(n),e,pc,!1);const r=Jw(n,{id:Dh(n),combo:e});this.pushChange({value:r,original:n,type:this.isCombo(i)?rc.ComboUpdated:rc.NodeUpdated}),this.model.mergeNodeData(Dh(n),r)})),Qe(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(xc(`Unknown element type of id: ${t}`))}destroy(){const{model:t}=this,e=t.getAllNodes(),n=t.getAllEdges();t.removeEdges(n.map((t=>t.id))),t.removeNodes(e.map((t=>t.id))),this.context={}}}var oT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class sT{constructor(t){this.elementMap={},this.shapeTypeMap={},this.paletteStyle={},this.defaultStyle={},this.stateStyle={},this.visibilityCache=new WeakMap,this.context=t}init(){if(!this.container){const{canvas:t}=this.context;this.container=t.appendChild(new wl({className:"elements"}))}}emit(t,e){e.silence||Vw(this.context.graph,t)}forEachElementData(t){Bd.forEach((e=>{const n=this.context.model.getElementsDataByType(e);t(e,n)}))}getElementType(t,e){var n;const{options:i,graph:r}=this.context,a=(null===(n=i[t])||void 0===n?void 0:n.type)||e.type;return a?"string"==typeof a?a:a.call(r,e):"edge"===t?"line":"circle"}getTheme(t){return _c(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((t=>n[t]||{})))}computePaletteStyle(){const{options:t}=this.context;this.paletteStyle={},this.forEachElementData(((e,n)=>{var i,r;const a=Object.assign({},lf(null===(i=this.getTheme(e))||void 0===i?void 0:i.palette),lf(null===(r=t[e])||void 0===r?void 0:r.palette));(null==a?void 0:a.field)&&Object.assign(this.paletteStyle,function(t,e){if(!e)return{};const{type:n,color:i,field:r,invert:a}=e,o=t=>{const e="string"==typeof i?yc("palette",i):i;if("function"==typeof e){const n={};return t.forEach((([t,i])=>{n[t]=e(a?1-i:i)})),n}if(Array.isArray(e)){const n=a?[...e].reverse():e,i={};return t.forEach((([t,r])=>{i[t]=n[r%e.length]})),i}return{}},s=(t,e)=>{var n;return"string"==typeof t?null===(n=e.data)||void 0===n?void 0:n[t]:null==t?void 0:t(e)};if("group"===n){const e=Bc(t,(t=>{if(!r)return"default";const e=s(r,t);return e?String(e):"default"})),n=o(Object.keys(e).map(((t,e)=>[t,e]))),i={};return Object.entries(e).forEach((([t,e])=>{e.forEach((e=>{i[Dh(e)]=n[t]}))})),i}if("value"===n){const[e,n]=t.reduce((([t,e],n)=>{const i=s(r,n);if("number"!=typeof i)throw new Error(xc(`Palette field ${r} is not a number`));return[Math.min(t,i),Math.max(e,i)]}),[1/0,-1/0]),i=n-e;return o(t.map((t=>[t.id,(s(r,t)-e)/i])))}}(n,a))}))}getPaletteStyle(t,e){const n=this.paletteStyle[e];return n?"edge"===t?{stroke:n}:{fill:n}:{}}computeElementDefaultStyle(t,e){var n;const{options:i}=this.context,r=(null===(n=i[t])||void 0===n?void 0:n.style)||{};"transform"in r&&Array.isArray(r.transform)&&(r.transform=[...r.transform]),this.defaultStyle[Dh(e.datum)]=nf(r,e)}computeElementsDefaultStyle(t){const{graph:e}=this.context;this.forEachElementData(((n,i)=>{const r=i.length;for(let a=0;athis.getElementStateStyle(t,e,n))))}computeElementsStatesStyle(t){const{graph:e}=this.context;this.forEachElementData(((n,i)=>{const r=i.length;for(let a=0;athis.elementMap[t]))}getEdges(){return this.context.model.getEdgeData().map((t=>this.elementMap[Dh(t)]))}getCombos(){return this.context.model.getComboData().map((({id:t})=>this.elementMap[t]))}getElementComputedStyle(t,e){const n=Dh(e),i=this.getThemeStyle(t),r=this.getPaletteStyle(t,n),a=e.style||{},o=this.getDefaultStyle(n),s=this.getThemeStateStyle(t,this.getElementState(n)),l=this.getStateStyle(n),u=Object.assign({},i,r,a,o,s,l);if("combo"===t){const t=this.context.model.getChildrenData(n),e=!!u.collapsed?[]:t.map(Dh).filter((t=>this.getElement(t)));Object.assign(u,{childrenNode:e,childrenData:t})}return u}draw(t={animation:!0}){this.init();const e=this.computeChangesAndDrawData(t);if(!e)return null;const{type:n="draw",stage:i=n,animation:r,silence:a}=t,{dataChanges:o,drawData:s}=e;this.markDestroyElement(s),this.computeStyle(i);const{add:l,update:u,remove:c}=s;return this.destroyElements(c,t),this.createElements(l,t),this.updateElements(u,t),this.context.animation.animate(r,a?{}:{before:()=>this.emit(new Gw(hc.BEFORE_DRAW,{dataChanges:o,animation:r,stage:i,render:"render"===n}),t),beforeAnimate:e=>this.emit(new jw(hc.BEFORE_ANIMATE,ac.DRAW,e,s),t),afterAnimate:e=>this.emit(new jw(hc.AFTER_ANIMATE,ac.DRAW,e,s),t),after:()=>this.emit(new Gw(hc.AFTER_DRAW,{dataChanges:o,animation:r,stage:i,render:"render"===n,firstRender:!1===this.context.graph.rendered}),t)})}computeChangesAndDrawData(t){const{model:e}=this.context,n=e.getChanges(),i=Ay(n);if(0===i.length)return null;const{NodeAdded:r=[],NodeUpdated:a=[],NodeRemoved:o=[],EdgeAdded:s=[],EdgeUpdated:l=[],EdgeRemoved:u=[],ComboAdded:c=[],ComboUpdated:h=[],ComboRemoved:d=[]}=Bc(i,(t=>t.type)),f=t=>new Map(t.map((t=>{const e=t.value;return[Dh(e),e]}))),p={add:{nodes:f(r),edges:f(s),combos:f(c)},update:{nodes:f(a),edges:f(l),combos:f(h)},remove:{nodes:f(o),edges:f(u),combos:f(d)}},g=this.transformData(p,t);return e.clearChanges(),{dataChanges:n,drawData:g}}transformData(t,e){const n=this.context.transform.getTransformInstance();return Object.values(n).reduce(((t,n)=>n.beforeDraw(t,e)),t)}createElement(t,e,n){var i;const r=Dh(e);if(this.getElement(r))return;const a=this.getElementType(t,e),o=this.getElementComputedStyle(t,e),s=yc(t,a);if(!s)return bc.warn(`The element ${a} of ${t} is not registered.`);this.emit(new Uw(hc.BEFORE_ELEMENT_CREATE,t,e),n);const l=this.container.appendChild(new s({id:r,context:this.context,style:Object.assign({},o)}));this.shapeTypeMap[r]=a,this.elementMap[r]=l;const{stage:u="enter"}=n;null===(i=this.context.animation)||void 0===i||i.add({element:l,elementType:t,stage:u,originalStyle:Object.assign({},l.attributes),updatedStyle:o},{after:()=>{var i;this.emit(new Uw(hc.AFTER_ELEMENT_CREATE,t,e),n),null===(i=l.onCreate)||void 0===i||i.call(l)}})}createElements(t,e){const{nodes:n,edges:i,combos:r}=t;[["node",n],["combo",r],["edge",i]].forEach((([t,n])=>{n.forEach((n=>this.createElement(t,n,e)))}))}getUpdateStageStyle(t,e,n){const{stage:i="update"}=n;if("translate"===i){if("node"===t||"combo"===t){const{style:{x:t=0,y:n=0,z:i=0}={}}=e;return{x:t,y:n,z:i}}return{}}return this.getElementComputedStyle(t,e)}updateElement(t,e,n){var i;const r=Dh(e),{stage:a="update"}=n,o=this.getElement(r);if(!o)return()=>null;this.emit(new Uw(hc.BEFORE_ELEMENT_UPDATE,t,e),n);const s=this.getElementType(t,e),l=this.getUpdateStageStyle(t,e,n);this.shapeTypeMap[r]!==s&&(o.destroy(),delete this.shapeTypeMap[r],delete this.elementMap[r],this.createElement(t,e,{animation:!1,silence:!0}));const u="visibility"!==a?a:"hidden"===l.visibility?"hide":"show";"hide"===u&&delete l.visibility,null===(i=this.context.animation)||void 0===i||i.add({element:o,elementType:t,stage:u,originalStyle:Object.assign({},o.attributes),updatedStyle:l},{before:()=>{const t=this.elementMap[r];"collapse"!==a&&Em(t,l),"visibility"===a&&(function(t,e){return Xw(e)in(Zd(t,Ww)||{})}(t,"opacity")||function(t,e){const n=Array.isArray(e)?e:[e];Zd(t,Ww)||Wd(t,Ww,{}),n.forEach((e=>{Wd(Zd(t,Ww),Xw(e),t.attributes[e])}))}(t,"opacity"),this.visibilityCache.set(t,"show"===u?"visible":"hidden"),"show"===u&&Xh(t,"visible"))},after:()=>{var i;const o=this.elementMap[r];"collapse"===a&&Em(o,l),"hide"===u&&Xh(o,this.visibilityCache.get(o)),this.emit(new Uw(hc.AFTER_ELEMENT_UPDATE,t,e),n),null===(i=o.onUpdate)||void 0===i||i.call(o)}})}updateElements(t,e){const{nodes:n,edges:i,combos:r}=t;[["node",n],["combo",r],["edge",i]].forEach((([t,n])=>{n.forEach((n=>this.updateElement(t,n,e)))}))}markDestroyElement(t){Object.values(t.remove).forEach((t=>{t.forEach((t=>{const e=Dh(t),n=this.getElement(e);n&&function(t){Wd(t,"__to_be_destroyed__",!0)}(n)}))}))}destroyElement(t,e,n){var i;const{stage:r="exit"}=n,a=Dh(e),o=this.elementMap[a];if(!o)return()=>null;this.emit(new Uw(hc.BEFORE_ELEMENT_DESTROY,t,e),n),null===(i=this.context.animation)||void 0===i||i.add({element:o,elementType:t,stage:r,originalStyle:Object.assign({},o.attributes),updatedStyle:{}},{after:()=>{var i;this.clearElement(a),o.destroy(),null===(i=o.onDestroy)||void 0===i||i.call(o),this.emit(new Uw(hc.AFTER_ELEMENT_DESTROY,t,e),n)}})}destroyElements(t,e){const{nodes:n,edges:i,combos:r}=t;[["combo",r],["edge",i],["node",n]].forEach((([t,n])=>{n.forEach((n=>this.destroyElement(t,n,e)))}))}clearElement(t){delete this.paletteStyle[t],delete this.defaultStyle[t],delete this.stateStyle[t],delete this.elementMap[t],delete this.shapeTypeMap[t]}collapseNode(t,e){return oT(this,void 0,void 0,(function*(){var n;const{model:i,layout:r}=this.context,a=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!a)return;this.markDestroyElement(a.drawData);const o=yield r.simulate();i.updateData(o);const s=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!s)return;const{drawData:l}=s,{add:u,remove:c,update:h}=l;this.markDestroyElement(l);const d={animation:e,stage:"collapse",data:l};this.destroyElements(c,d),this.createElements(u,d),this.updateElements(h,d),yield null===(n=this.context.animation.animate(e,{beforeAnimate:t=>this.emit(new jw(hc.BEFORE_ANIMATE,ac.COLLAPSE,t,l),d),afterAnimate:t=>this.emit(new jw(hc.AFTER_ANIMATE,ac.COLLAPSE,t,l),d)},{collapse:{target:t,descendants:Array.from(c.nodes).map((([,t])=>Dh(t))),position:md(h.nodes.get(t))}}))||void 0===n?void 0:n.finished}))}expandNode(t,e){return oT(this,void 0,void 0,(function*(){var n;const{model:i,layout:r}=this.context;if(!i.getAncestorsData(t,pc).every((t=>Vd(t))))return;const a=md(i.getNodeData([t])[0]),o=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!o)return;const{drawData:{add:s}}=o;this.createElements(s,{animation:!1,stage:"expand",target:t}),this.context.animation.clear();const l=yield r.simulate();i.updateData(l),this.computeStyle("expand");const u=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!u)return;const{drawData:c}=u,{update:h}=c,d={animation:e,stage:"expand",data:c};s.edges.forEach((t=>h.edges.set(Dh(t),t))),s.nodes.forEach((t=>h.nodes.set(Dh(t),t))),this.updateElements(h,d),yield null===(n=this.context.animation.animate(e,{beforeAnimate:t=>this.emit(new jw(hc.BEFORE_ANIMATE,ac.EXPAND,t,c),d),afterAnimate:t=>this.emit(new jw(hc.AFTER_ANIMATE,ac.EXPAND,t,c),d)},{expand:{target:t,descendants:Array.from(s.nodes).map((([,t])=>Dh(t))),position:a}}))||void 0===n?void 0:n.finished}))}collapseCombo(t,e){return oT(this,void 0,void 0,(function*(){var n;const{model:i,element:r}=this.context;if(i.getAncestorsData(t,pc).some((t=>Vd(t))))return;const a=r.getElement(t),o=a.getComboPosition(Object.assign(Object.assign({},a.attributes),{collapsed:!0})),s=this.computeChangesAndDrawData({stage:"collapse",animation:e});if(!s)return;const{dataChanges:l,drawData:u}=s;this.markDestroyElement(u);const{update:c,remove:h}=u,d={animation:e,stage:"collapse",data:u};this.destroyElements(h,d),this.updateElements(c,d);const f=t=>Array.from(t).map((([,t])=>Dh(t)));yield null===(n=this.context.animation.animate(e,{before:()=>this.emit(new Gw(hc.BEFORE_DRAW,{dataChanges:l,animation:e}),d),beforeAnimate:t=>this.emit(new jw(hc.BEFORE_ANIMATE,ac.COLLAPSE,t,u),d),afterAnimate:t=>this.emit(new jw(hc.AFTER_ANIMATE,ac.COLLAPSE,t,u),d),after:()=>this.emit(new Gw(hc.AFTER_DRAW,{dataChanges:l,animation:e}),d)},{collapse:{target:t,descendants:[...f(h.nodes),...f(h.combos)],position:o}}))||void 0===n?void 0:n.finished}))}expandCombo(t,e){return oT(this,void 0,void 0,(function*(){var n;const{model:i}=this.context,r=md(i.getComboData([t])[0]);this.computeStyle("expand");const a=this.computeChangesAndDrawData({stage:"expand",animation:e});if(!a)return;const{dataChanges:o,drawData:s}=a,{add:l,update:u}=s,c={animation:e,stage:"expand",data:s,target:t};this.createElements(l,c),this.updateElements(u,c);const h=t=>Array.from(t).map((([,t])=>Dh(t)));yield null===(n=this.context.animation.animate(e,{before:()=>this.emit(new Gw(hc.BEFORE_DRAW,{dataChanges:o,animation:e}),c),beforeAnimate:t=>this.emit(new jw(hc.BEFORE_ANIMATE,ac.EXPAND,t,s),c),afterAnimate:t=>this.emit(new jw(hc.AFTER_ANIMATE,ac.EXPAND,t,s),c),after:()=>this.emit(new Gw(hc.AFTER_DRAW,{dataChanges:o,animation:e}),c)},{expand:{target:t,descendants:[...h(l.nodes),...h(l.combos)],position:r}}))||void 0===n?void 0:n.finished}))}destroy(){this.container.destroy(),this.elementMap={},this.shapeTypeMap={},this.defaultStyle={},this.stateStyle={},this.paletteStyle={},this.context={}}}const lT=Symbol("Comlink.proxy"),uT=Symbol("Comlink.endpoint"),cT=Symbol("Comlink.releaseProxy"),hT=Symbol("Comlink.finalizer"),dT=Symbol("Comlink.thrown"),fT=t=>"object"==typeof t&&null!==t||"function"==typeof t,pT=new Map([["proxy",{canHandle:t=>fT(t)&&t[lT],serialize(t){const{port1:e,port2:n}=new MessageChannel;return gT(t,e),[n,[n]]},deserialize(t){return t.start(),vT(t)}}],["throw",{canHandle:t=>fT(t)&&dT in t,serialize({value:t}){let e;return e=t instanceof Error?{isError:!0,value:{message:t.message,name:t.name,stack:t.stack}}:{isError:!1,value:t},[e,[]]},deserialize(t){if(t.isError)throw Object.assign(new Error(t.value.message),t.value);throw t.value}}]]);function gT(t,e=globalThis,n=["*"]){e.addEventListener("message",(function i(r){if(!r||!r.data)return;if(!function(t,e){for(const n of t){if(e===n||"*"===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}return!1}(n,r.origin))return void console.warn(`Invalid origin '${r.origin}' for comlink proxy`);const{id:a,type:o,path:s}=Object.assign({path:[]},r.data),l=(r.data.argumentList||[]).map(MT);let u;try{const e=s.slice(0,-1).reduce(((t,e)=>t[e]),t),n=s.reduce(((t,e)=>t[e]),t);switch(o){case"GET":u=n;break;case"SET":e[s.slice(-1)[0]]=MT(r.data.value),u=!0;break;case"APPLY":u=n.apply(e,l);break;case"CONSTRUCT":u=function(t){return Object.assign(t,{[lT]:!0})}(new n(...l));break;case"ENDPOINT":{const{port1:e,port2:n}=new MessageChannel;gT(t,n),u=function(t,e){return TT.set(t,e),t}(e,[e])}break;case"RELEASE":u=void 0;break;default:return}}catch(t){u={value:t,[dT]:0}}Promise.resolve(u).catch((t=>({value:t,[dT]:0}))).then((n=>{const[r,s]=ST(n);e.postMessage(Object.assign(Object.assign({},r),{id:a}),s),"RELEASE"===o&&(e.removeEventListener("message",i),mT(e),hT in t&&"function"==typeof t[hT]&&t[hT]())})).catch((t=>{const[n,i]=ST({value:new TypeError("Unserializable return value"),[dT]:0});e.postMessage(Object.assign(Object.assign({},n),{id:a}),i)}))})),e.start&&e.start()}function mT(t){(function(t){return"MessagePort"===t.constructor.name})(t)&&t.close()}function vT(t,e){const n=new Map;return t.addEventListener("message",(function(t){const{data:e}=t;if(!e||!e.id)return;const i=n.get(e.id);if(i)try{i(e)}finally{n.delete(e.id)}})),ET(t,n,[],e)}function yT(t){if(t)throw new Error("Proxy has been released and is not useable")}function xT(t){return CT(t,new Map,{type:"RELEASE"}).then((()=>{mT(t)}))}const bT=new WeakMap,_T="FinalizationRegistry"in globalThis&&new FinalizationRegistry((t=>{const e=(bT.get(t)||0)-1;bT.set(t,e),0===e&&xT(t)}));function ET(t,e,n=[],i=function(){}){let r=!1;const a=new Proxy(i,{get(i,o){if(yT(r),o===cT)return()=>{!function(t){_T&&_T.unregister(t)}(a),xT(t),e.clear(),r=!0};if("then"===o){if(0===n.length)return{then:()=>a};const i=CT(t,e,{type:"GET",path:n.map((t=>t.toString()))}).then(MT);return i.then.bind(i)}return ET(t,e,[...n,o])},set(i,a,o){yT(r);const[s,l]=ST(o);return CT(t,e,{type:"SET",path:[...n,a].map((t=>t.toString())),value:s},l).then(MT)},apply(i,a,o){yT(r);const s=n[n.length-1];if(s===uT)return CT(t,e,{type:"ENDPOINT"}).then(MT);if("bind"===s)return ET(t,e,n.slice(0,-1));const[l,u]=wT(o);return CT(t,e,{type:"APPLY",path:n.map((t=>t.toString())),argumentList:l},u).then(MT)},construct(i,a){yT(r);const[o,s]=wT(a);return CT(t,e,{type:"CONSTRUCT",path:n.map((t=>t.toString())),argumentList:o},s).then(MT)}});return function(t,e){const n=(bT.get(e)||0)+1;bT.set(e,n),_T&&_T.register(t,e,t)}(a,t),a}function wT(t){const e=t.map(ST);return[e.map((t=>t[0])),(n=e.map((t=>t[1])),Array.prototype.concat.apply([],n))];var n}const TT=new WeakMap;function ST(t){for(const[e,n]of pT)if(n.canHandle(t)){const[i,r]=n.serialize(t);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:t},TT.get(t)||[]]}function MT(t){switch(t.type){case"HANDLER":return pT.get(t.name).deserialize(t.value);case"RAW":return t.value}}function CT(t,e,n,i){return new Promise((r=>{const a=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.set(a,r),t.start&&t.start(),t.postMessage(Object.assign({id:a},n),i)}))}class AT extends Cy.Z{constructor(t,e,n){super(),this.graph=t,this.layout=e,this.options=n,this.spawnWorker()}spawnWorker(){this.proxy=vT(new Worker(new URL(n.p+n.u(46122),n.b),{type:void 0})),this.running&&(this.running=!1,this.execute())}execute(){var t;return(0,he.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,he._T)(e,["onTick"]),r={};Object.keys(i).forEach((t=>{(0,en.Z)(i[t])||(r[t]=i[t])}));const a={layout:{id:this.layout.id,options:r,iterations:null===(t=this.options)||void 0===t?void 0:t.iterations},nodes:this.graph.getAllNodes(),edges:this.graph.getAllEdges()},o=new Float32Array([0]),[s]=yield this.proxy.calculateLayout(a,[o]);return s}))}stop(){return this.running=!1,this.proxy.stopLayout(),this}kill(){this.proxy[cT]()}isRunning(){return this.running}}var OT=n(31350),NT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))},PT=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);rt.afterLayout()))}simulate(){return NT(this,void 0,void 0,(function*(){if(!this.options)return{};const t=Array.isArray(this.options)?this.options:[this.options];let e={};for(const n of t){const i=t.indexOf(n),r=this.getLayoutData(n);e=yield this.stepLayout(r,Object.assign(Object.assign(Object.assign({},this.presetOptions),n),{animation:!1}),i)}return e}))}stepLayout(t,e,n){return NT(this,void 0,void 0,(function*(){return function(t){const{type:e}=t;return["compact-box","mindmap","dendrogram","indented"].includes(e)}(e)?yield this.treeLayout(t,e,n):yield this.graphLayout(t,e,n)}))}graphLayout(t,e,n){return NT(this,void 0,void 0,(function*(){const{animation:i,enableWorker:r,iterations:a=300}=e,o=this.initGraphLayout(e);if(!o)return{};if(this.instances[n]=o,this.instance=o,r){const e=o;return this.supervisor=new AT(e.graphData2LayoutModel(t),e.instance,{iterations:a}),zm(yield this.supervisor.execute())}if((0,OT.h)(o))return i?yield o.execute(t,{onTick:t=>{this.updateElementPosition(t,!1)}}):(o.execute(t),o.stop(),o.tick(a));const s=yield o.execute(t);if(i){const t=this.updateElementPosition(s,i);yield null==t?void 0:t.finished}return s}))}treeLayout(t,e,n){return NT(this,void 0,void 0,(function*(){const{type:n,animation:i}=e,r=yc("layout",n);if(!r)return{};const{nodes:a=[],edges:o=[]}=t,s=new km.k({nodes:a.map((t=>({id:Dh(t),data:t.data||{}}))),edges:o.map((t=>({id:Dh(t),source:t.source,target:t.target,data:t.data||{}})))});!function(t){if(t.hasTreeStructure(gc))return;t.attachTreeStructure(gc);const e=t.getAllEdges();for(const n of e){const{source:e,target:i}=n;t.setParent(i,e,gc)}}(s);const l={nodes:[],edges:[]},u={nodes:[],edges:[]};s.getRoots(gc).forEach((t=>{Fd(t,(t=>{t.children=s.getSuccessors(t.id)}),(t=>s.getSuccessors(t.id)),"TB");const n=r(t,e),{x:i,y:a,z:o=0}=n;Fd(n,(t=>{const{id:e,x:n,y:r,z:s=0}=t;l.nodes.push({id:e,style:{x:i,y:a,z:o}}),u.nodes.push({id:e,style:{x:n,y:r,z:s}})}),(t=>t.children),"TB")}));const c=this.inferTreeLayoutOffset(u);if(RT(u,c),i){RT(l,c),this.updateElementPosition(l,!1);const t=this.updateElementPosition(u,i);yield null==t?void 0:t.finished}return u}))}inferTreeLayoutOffset(t){var e;let[n,i]=[1/0,-1/0],[r,a]=[1/0,-1/0];null===(e=t.nodes)||void 0===e||e.forEach((t=>{const{x:e=0,y:o=0}=t.style||{};n=Math.min(n,e),i=Math.max(i,e),r=Math.min(r,o),a=Math.max(a,o)}));const{canvas:o}=this.context,s=o.getSize(),[l,u]=o.getCanvasByViewport([0,0]),[c,h]=o.getCanvasByViewport(s);if(n>=l&&i<=c&&r>=u&&a<=h)return[0,0];return[(l+c)/2-(n+i)/2,(u+h)/2-(r+a)/2]}stopLayout(){this.instance&&(0,OT.h)(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)}=t,{nodes:n,edges:i,combos:r}=this.context.model.getData(),a=t=>this.context.element.getElement(t),o=n.filter((t=>{const n=Dh(t),i=a(n);return!!i&&(!wm(i)&&e(t))})),s=new Map(o.map((t=>[Dh(t),t])));return{nodes:o,edges:i.filter((t=>{const{source:e,target:n}=t;return!(!s.has(e)||!s.has(n))})),combos:r}}initGraphLayout(t){var e;const{element:n,viewport:i}=this.context,{type:r,enableWorker:a,animation:o,iterations:s}=t,l=PT(t,["type","enableWorker","animation","iterations"]),[u,c]=i.getCanvasSize(),h=[u/2,c/2],d=null!==(e=null==t?void 0:t.nodeSize)&&void 0!==e?e:t=>{const e=null==n?void 0:n.getElement(t.id),{size:i}=(null==e?void 0:e.attributes)||{};return i},f=yc("layout",r);if(!f)return bc.warn(`The layout of ${r} is not registered.`);const p=Object.getPrototypeOf(f.prototype)===Im.prototype?f:function(t,e){return class extends Im{constructor(e,n){if(super(e,n),this.instance=new t({}),this.id=this.instance.id,"stop"in this.instance&&"tick"in this.instance){const t=this.instance;this.stop=t.stop.bind(t),this.tick=e=>zm(t.tick(e))}}execute(t,e){return Bm(this,void 0,void 0,(function*(){return zm(yield this.instance.execute(this.graphData2LayoutModel(t),this.transformOptions((0,Qh.Z)({},this.options,e))))}))}transformOptions(t){const{onTick:e}=t;return e?(t.onTick=t=>e(zm(t)),t):t}graphData2LayoutModel(t){const{nodes:n=[],edges:i=[],combos:r=[]}=t,a=n.map((t=>{const e=Dh(t),{data:n,style:i,combo:r}=t,a=Fm(t,["data","style","combo"]),o={id:e,data:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n),{data:n}),r?{parentId:r}:{}),{style:i}),a)};return(null==i?void 0:i.x)&&Object.assign(o.data,{x:i.x}),(null==i?void 0:i.y)&&Object.assign(o.data,{y:i.y}),(null==i?void 0:i.z)&&Object.assign(o.data,{z:i.z}),o})),o=new Map(a.map((t=>[t.id,t]))),s=i.filter((t=>{const{source:e,target:n}=t;return o.has(e)&&o.has(n)})).map((t=>{const{source:e,target:n,data:i,style:r}=t;return{id:Dh(t),source:e,target:n,data:Object.assign({},i),style:Object.assign({},r)}})),l=r.map((t=>({id:Dh(t),data:Object.assign({_isCombo:!0},t.data),style:Object.assign({},t.style)}))),u=new km.k({nodes:[...a,...l],edges:s});return e.model.model.hasTreeStructure(pc)&&(u.attachTreeStructure(pc),a.forEach((t=>{const n=e.model.model.getParent(t.id,pc);n&&u.hasNode(n.id)&&u.setParent(t.id,n.id,pc)}))),u}}}(f,this.context),g=new p(this.context),m={nodeSize:d,width:u,height:c,center:h};switch(g.id){case"d3-force":case"d3-force-3d":Object.assign(m,{center:{x:u/2,y:c/2,z:0}})}return(0,Qh.Z)(g.options,m,l),g}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={},null===(t=this.supervisor)||void 0===t||t.kill(),this.supervisor=void 0,this.instance=void 0,this.instances=[],this.animationResult=void 0}}const RT=(t,e)=>{var n;const[i,r]=e;null===(n=t.nodes)||void 0===n||n.forEach((t=>{if(t.style){const{x:e=0,y:n=0}=t.style;t.style.x=e+i,t.style.y=n+r}else t.style={x:i,y:r}}))};class DT extends Yh{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;bc.warn(`Cannot find the plugin ${t}, will try to find it by type.`);const n=this.extensions.find((e=>e.type===t));return n?this.extensionMap[n.key]:void 0}}const kT=["update-related-edges","collapse-expand-node","collapse-expand-combo","get-edge-actual-ends","arrange-draw-order"];class IT extends Yh{constructor(t){super(t),this.category="transform",this.setTransforms(this.context.options.transforms||[])}getTransforms(){}setTransforms(t){this.setExtensions([...kT.slice(0,kT.length-1),...t,kT[kT.length-1]])}getTransformInstance(t){return t?this.extensionMap[t]:this.extensionMap}}var BT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class FT{get padding(){return Uc(this.context.options.padding)}get paddingOffset(){const[t,e,n,i]=this.padding,[r,a,o]=[(i-e)/2,(t-n)/2,0];return[r,a,o]}constructor(t){this.landmarkCounter=0,this.context=t;const[e,n]=this.paddingOffset,{zoom:i,rotation:r,x:a=e,y:o=n}=t.options;this.transform({mode:"absolute",scale:i,translate:[a,o],rotate:r},!1)}get camera(){const{canvas:t}=this.context;return new Proxy(t.getCamera(),{get:(e,n)=>{const i=Object.entries(t.getLayers()).filter((([t])=>!["main"].includes(t))).map((([,t])=>t.getCamera())),r=e[n];if("function"==typeof r)return(...t)=>{const a=r.apply(e,t);return i.forEach((e=>{e[n].apply(e,t)})),a}}})}createLandmark(t){return this.camera.createLandmark("landmark-"+this.landmarkCounter++,t)}getAnimation(t){const e=Sc(this.context.options,t);return!!e&&(0,rg.Z)(Object.assign({},e),["easing","duration"])}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,r=this.getZoom(),a=e.getPosition(),o=e.getFocalPoint(),[s,l]=this.getCanvasCenter(),[u=0,c=0,h=0]=i,d=id([-u,-c,-h],r);return"relative"===n?{position:td(a,d),focalPoint:td(o,d)}:{position:td([s,l,a[2]],d),focalPoint:td([s,l,o[2]],d)}}getRotateOptions(t){const{mode:e,rotate:n=0}=t;return{roll:"relative"===e?this.camera.getRoll()+n:n}}getZoomOptions(t){const{zoomRange:e}=this.context.options,n=this.camera.getZoom(),{mode:i,scale:r=1}=t;return ce("relative"===i?n*r:r,...e)}transform(t,e){return BT(this,void 0,void 0,(function*(){const{graph:n}=this.context,{translate:i,rotate:r,scale:a,origin:o}=t;this.cancelAnimation();const s=this.getAnimation(e);if(Vw(n,new Hw(hc.BEFORE_TRANSFORM,t)),!r&&a&&!i&&o&&!s)return this.camera.setZoomByViewportPoint(this.getZoomOptions(t),o),void Vw(n,new Hw(hc.AFTER_TRANSFORM,t));const l={};if(i&&Object.assign(l,this.getTranslateOptions(t)),(0,oe.Z)(r)&&Object.assign(l,this.getRotateOptions(t)),(0,oe.Z)(a)&&Object.assign(l,{zoom:this.getZoomOptions(t)}),s)return Vw(n,new jw(hc.BEFORE_ANIMATE,ac.TRANSFORM,null,t)),new Promise((e=>{this.transformResolver=e,this.camera.gotoLandmark(this.createLandmark(l),Object.assign(Object.assign({},s),{onfinish:()=>{Vw(n,new jw(hc.AFTER_ANIMATE,ac.TRANSFORM,null,t)),Vw(n,new Hw(hc.AFTER_TRANSFORM,t)),this.transformResolver=void 0,e()}}))}));this.camera.gotoLandmark(this.createLandmark(l),{duration:0}),Vw(n,new Hw(hc.AFTER_TRANSFORM,t))}))}fitView(t,e){return BT(this,void 0,void 0,(function*(){const[n,i,r,a]=this.padding,{when:o="always",direction:s="both"}=t||{},[l,u]=this.context.canvas.getSize(),c=l-a-i,h=u-n-r,d=this.context.canvas.getBounds(),f=this.getBBoxInViewport(d),[p,g]=Wc(f);if("overflow"===o&&!("x"===s&&p>=c||"y"===s&&g>=h||"both"===s&&p>=c&&g>=h))return yield this.fitCenter(e);const m=c/p,v=h/g,y="x"===s?m:"y"===s?v:Math.min(m,v),x=this.getAnimation(e);yield this.transform({mode:"relative",scale:y,translate:td(ed(this.getCanvasCenter(),this.getBBoxInViewport(d).center),id(this.paddingOffset,y))},x)}))}fitCenter(t){return BT(this,void 0,void 0,(function*(){const e=this.context.canvas.getBounds();yield this.focus(e,t)}))}focusElements(t,e){return BT(this,void 0,void 0,(function*(){const{element:n}=this.context;if(!n)return;const i=$c(t.map((t=>n.getElement(t).getRenderBounds())));yield this.focus(i,e)}))}focus(t,e){return BT(this,void 0,void 0,(function*(){const n=this.context.graph.getViewportByCanvas(t.center),i=ed(this.getCanvasCenter(),n);yield this.transform({mode:"relative",translate:td(i,this.paddingOffset)},e)}))}getBBoxInViewport(t){const{min:e,max:n}=t,{graph:i}=this.context,[r,a]=i.getViewportByCanvas(e),[o,s]=i.getViewportByCanvas(n),l=new Ti;return l.setMinMax([r,a,0],[o,s,0]),l}isInViewport(t,e=!1,n=0){const{graph:i}=this.context,r=this.getCanvasSize(),[a,o]=i.getCanvasByViewport([0,0]),[s,l]=i.getCanvasByViewport(r);let u=new Ti;return u.setMinMax([a,o,0],[s,l,0]),n&&(u=qc(u,n)),Gc(t)?Kc(t,u):e?function(t,e){const[n,i]=t.min,[r,a]=t.max,[o,s]=e.min,[l,u]=e.max;return n>=o&&r<=l&&i>=s&&a<=u}(t,u):u.intersects(t)}cancelAnimation(){var t,e;(null===(t=this.camera.landmarks)||void 0===t?void 0:t.length)&&this.camera.cancelLandmarkAnimation(),null===(e=this.transformResolver)||void 0===e||e.call(this)}}var zT=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class GT extends Cy.Z{constructor(t){var e;super(),this.rendered=!1,this.destroyed=!1,this.context={model:new aT},this.isCollapsingExpanding=!1,this.onResize=Nm((()=>{this.resize()}),300),this.options=Object.assign({},GT.defaultOptions,t),this._setOptions(this.options,!0),this.context.graph=this,this.options.autoResize&&(null===(e=globalThis.addEventListener)||void 0===e||e.call(globalThis,"resize",this.onResize))}getOptions(){return this.options}setOptions(t){this._setOptions(t,!1)}_setOptions(t,e){if(this.updateCanvas(t),e){const{data:e}=t;return void(e&&this.addData(e))}Object.assign(this.options,t);const{behaviors:n,combo:i,data:r,edge:a,layout:o,node:s,plugins:l,theme:u,transforms:c}=t;n&&this.setBehaviors(n),r&&this.setData(r),s&&this.setNode(s),a&&this.setEdge(a),i&&this.setCombo(i),o&&this.setLayout(o),u&&this.setTheme(u),l&&this.setPlugins(l),c&&this.setTransforms(c)}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=(0,en.Z)(t)?t(this.getTheme()):t}setLayout(t){this.options.layout=(0,en.Z)(t)?t(this.getLayout()):t}getLayout(){return this.options.layout}setBehaviors(t){var e;this.options.behaviors=(0,en.Z)(t)?t(this.getBehaviors()):t,null===(e=this.context.behavior)||void 0===e||e.setBehaviors(this.options.behaviors)}updateBehavior(t){this.setBehaviors((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e))))}getBehaviors(){return this.options.behaviors||[]}setPlugins(t){var e;this.options.plugins=(0,en.Z)(t)?t(this.getPlugins()):t,null===(e=this.context.plugin)||void 0===e||e.setPlugins(this.options.plugins)}updatePlugin(t){this.setPlugins((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e))))}getPlugins(){return this.options.plugins||[]}getPluginInstance(t){return this.context.plugin.getPluginInstance(t)}setTransforms(t){var e;this.options.transforms=(0,en.Z)(t)?t(this.getTransforms()):t,null===(e=this.context.transform)||void 0===e||e.setTransforms(this.options.transforms)}updateTransform(t){this.setTransforms((e=>e.map((e=>"object"==typeof e&&e.key===t.key?Object.assign(Object.assign({},e),t):e)))),this.context.model.refreshData()}getTransforms(){return this.options.transforms||[]}getData(){return this.context.model.getData()}getElementData(t){return Array.isArray(t)?t.map((t=>this.context.model.getElementDataById(t))):this.context.model.getElementDataById(t)}getNodeData(t){var e;return void 0===t?this.context.model.getNodeData():Array.isArray(t)?this.context.model.getNodeData(t):null===(e=this.context.model.getNodeData([t]))||void 0===e?void 0:e[0]}getEdgeData(t){var e;return void 0===t?this.context.model.getEdgeData():Array.isArray(t)?this.context.model.getEdgeData(t):null===(e=this.context.model.getEdgeData([t]))||void 0===e?void 0:e[0]}getComboData(t){var e;return void 0===t?this.context.model.getComboData():Array.isArray(t)?this.context.model.getComboData(t):null===(e=this.context.model.getComboData([t]))||void 0===e?void 0:e[0]}setData(t){this.context.model.setData((0,en.Z)(t)?t(this.getData()):t)}addData(t){this.context.model.addData((0,en.Z)(t)?t(this.getData()):t)}addNodeData(t){this.context.model.addNodeData((0,en.Z)(t)?t(this.getNodeData()):t)}addEdgeData(t){this.context.model.addEdgeData((0,en.Z)(t)?t(this.getEdgeData()):t)}addComboData(t){this.context.model.addComboData((0,en.Z)(t)?t(this.getComboData()):t)}addChildrenData(t,e){this.context.model.addChildrenData(t,e)}updateData(t){this.context.model.updateData((0,en.Z)(t)?t(this.getData()):t)}updateNodeData(t){this.context.model.updateNodeData((0,en.Z)(t)?t(this.getNodeData()):t)}updateEdgeData(t){this.context.model.updateEdgeData((0,en.Z)(t)?t(this.getEdgeData()):t)}updateComboData(t){this.context.model.updateComboData((0,en.Z)(t)?t(this.getComboData()):t)}removeData(t){this.context.model.removeData((0,en.Z)(t)?t(this.getData()):t)}removeNodeData(t){this.context.model.removeNodeData((0,en.Z)(t)?t(this.getNodeData()):t)}removeEdgeData(t){this.context.model.removeEdgeData((0,en.Z)(t)?t(this.getEdgeData()):t)}removeComboData(t){this.context.model.removeComboData((0,en.Z)(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 zT(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:r,cursor:a,background:o,canvas:s,devicePixelRatio:l=(null!==(t=globalThis.devicePixelRatio)&&void 0!==t?t:1)}=this.options;if(e instanceof Dw)this.context.canvas=e,a&&e.setCursor(a),r&&e.setRenderer(r),yield e.ready;else{const t=(0,ue.Z)(e)?document.getElementById(e):e,u=Fw(t);this.emit(hc.BEFORE_CANVAS_INIT,{container:t,width:n,height:i});const c=Object.assign(Object.assign({},s),{container:t,width:n||u[0],height:i||u[1],background:o,renderer:r,cursor:a,devicePixelRatio:l}),h=new Dw(c);this.context.canvas=h,yield h.ready,this.emit(hc.AFTER_CANVAS_INIT,{canvas:h})}}))}updateCanvas(t){var e,n;const{renderer:i,cursor:r,height:a,width:o}=t,s=this.context.canvas;s&&(i&&(this.emit(hc.BEFORE_RENDERER_CHANGE,{renderer:this.options.renderer}),s.setRenderer(i),this.emit(hc.AFTER_RENDERER_CHANGE,{renderer:i})),r&&s.setCursor(r),((0,oe.Z)(o)||(0,oe.Z)(a))&&this.setSize(null!==(e=null!=o?o:this.options.width)&&void 0!==e?e:0,null!==(n=null!=a?a:this.options.height)&&void 0!==n?n:0))}initRuntime(){this.context.options=this.options,this.context.batch||(this.context.batch=new $w(this.context)),this.context.plugin||(this.context.plugin=new DT(this.context)),this.context.viewport||(this.context.viewport=new FT(this.context)),this.context.transform||(this.context.transform=new IT(this.context)),this.context.element||(this.context.element=new sT(this.context)),this.context.animation||(this.context.animation=new qw(this.context)),this.context.layout||(this.context.layout=new LT(this.context)),this.context.behavior||(this.context.behavior=new Kw(this.context))}prepare(){return zT(this,void 0,void 0,(function*(){if(yield Promise.resolve(),this.destroyed)throw new Error(xc("The graph instance has been destroyed"));yield this.initCanvas(),this.initRuntime()}))}render(){return zT(this,void 0,void 0,(function*(){yield this.prepare(),Vw(this,new Gw(hc.BEFORE_RENDER));const t=this.context.element.draw({type:"render"});yield Promise.all([null==t?void 0:t.finished,this.context.layout.layout()]),yield this.autoFit(),this.rendered=!0,Vw(this,new Gw(hc.AFTER_RENDER))}))}draw(){return zT(this,void 0,void 0,(function*(){var t;yield this.prepare(),yield null===(t=this.context.element.draw())||void 0===t?void 0:t.finished}))}layout(){return zT(this,void 0,void 0,(function*(){yield this.context.layout.layout()}))}stopLayout(){this.context.layout.stopLayout()}clear(){return zT(this,void 0,void 0,(function*(){this.context.model.setData({}),yield this.draw()}))}destroy(){var t;Vw(this,new Gw(hc.BEFORE_DESTROY));const{layout:e,animation:n,element:i,model:r,canvas:a,behavior:o,plugin:s}=this.context;null==s||s.destroy(),null==o||o.destroy(),null==e||e.destroy(),null==n||n.destroy(),null==i||i.destroy(),r.destroy(),null==a||a.destroy(),this.options={},this.context={},this.off(),null===(t=globalThis.removeEventListener)||void 0===t||t.call(globalThis,"resize",this.onResize),this.destroyed=!0,Vw(this,new Gw(hc.AFTER_DESTROY))}getCanvas(){return this.context.canvas}resize(t,e){var n;const i=Fw(null===(n=this.context.canvas)||void 0===n?void 0:n.getContainer()),r=[t||i[0],e||i[1]];if(!this.context.canvas)return;const a=this.context.canvas.getSize();ec(r,a)||(Vw(this,new Gw(hc.BEFORE_SIZE_CHANGE,{size:r})),this.context.canvas.resize(...r),Vw(this,new Gw(hc.AFTER_SIZE_CHANGE,{size:r})))}fitView(t,e){return zT(this,void 0,void 0,(function*(){var n;yield null===(n=this.context.viewport)||void 0===n?void 0:n.fitView(t,e)}))}fitCenter(t){return zT(this,void 0,void 0,(function*(){var e;yield null===(e=this.context.viewport)||void 0===e?void 0:e.fitCenter(t)}))}autoFit(){return zT(this,void 0,void 0,(function*(){const{autoFit:t}=this.context.options;if(t)if((0,ue.Z)(t))"view"===t?yield this.fitView():"center"===t&&(yield this.fitCenter());else{const{type:e,animation:n}=t;"view"===e?yield this.fitView(t.options,n):"center"===e&&(yield this.fitCenter(n))}}))}focusElement(t,e){return zT(this,void 0,void 0,(function*(){var n;yield null===(n=this.context.viewport)||void 0===n?void 0:n.focusElements(Array.isArray(t)?t:[t],e)}))}zoomBy(t,e,n){return zT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",scale:t,origin:n},e)}))}zoomTo(t,e,n){return zT(this,void 0,void 0,(function*(){this.context.viewport.transform({mode:"absolute",scale:t,origin:n},e)}))}getZoom(){return this.context.viewport.getZoom()}rotateBy(t,e,n){return zT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",rotate:t,origin:n},e)}))}rotateTo(t,e,n){return zT(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 zT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"relative",translate:t},e)}))}translateTo(t,e){return zT(this,void 0,void 0,(function*(){yield this.context.viewport.transform({mode:"absolute",translate:t},e)}))}getPosition(){return ed([0,0],this.getCanvasByViewport([0,0]))}translateElementBy(t,e){return zT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n];Object.entries(a).forEach((([t,e])=>this.context.model.translateNodeLikeBy(t,e))),yield null===(r=this.context.element.draw({animation:o,stage:"translate"}))||void 0===r?void 0:r.finished}))}translateElementTo(t,e){return zT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n];Object.entries(a).forEach((([t,e])=>this.context.model.translateNodeLikeTo(t,e))),yield null===(r=this.context.element.draw({animation:o,stage:"translate"}))||void 0===r?void 0:r.finished}))}getElementPosition(t){return this.context.model.getElementPosition(t)}getElementRenderStyle(t){return xv(this.context.element.getElement(t).attributes,["context"])}setElementVisibility(t,e){return zT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n],s={nodes:[],edges:[],combos:[]};Object.entries(a).forEach((([t,e])=>{const n=this.getElementType(t);s[`${n}s`].push({id:t,style:{visibility:e}})}));const{model:l,element:u}=this.context;l.preventUpdateNodeLikeHierarchy((()=>{l.updateData(s)})),yield null===(r=u.draw({animation:o,stage:"visibility"}))||void 0===r?void 0:r.finished}))}showElement(t,e){return zT(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map((t=>[t,"visible"]))),e)}))}hideElement(t,e){return zT(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t:[t];yield this.setElementVisibility(Object.fromEntries(n.map((t=>[t,"hidden"]))),e)}))}getElementVisibility(t){var e,n;const i=this.context.element.getElement(t);return null!==(n=null===(e=null==i?void 0:i.style)||void 0===e?void 0:e.visibility)&&void 0!==n?n:"visible"}setElementZIndex(t,e){return zT(this,void 0,void 0,(function*(){var n;const i={nodes:[],edges:[],combos:[]},r=(0,nn.Z)(t)?t:{[t]:e};Object.entries(r).forEach((([t,e])=>{const n=this.getElementType(t);i[`${n}s`].push({id:t,style:{zIndex:e}})}));const{model:a,element:o}=this.context;a.preventUpdateNodeLikeHierarchy((()=>a.updateData(i))),yield null===(n=o.draw({animation:!1,stage:"zIndex"}))||void 0===n?void 0:n.finished}))}frontElement(t){return zT(this,void 0,void 0,(function*(){const e=Array.isArray(t)?t:[t],{model:n}=this.context,i={};e.map((t=>{const e=n.getFrontZIndex(t);if("combo"===n.getElementType(t)){const r=n.getAncestorsData(t,pc).at(-1)||this.getComboData(t),a=[r,...n.getDescendantsData(Dh(r))],o=e-Zw(r);a.forEach((t=>{i[Dh(t)]=this.getElementZIndex(Dh(t))+o}));const{internal:s}=kg(a.map(Dh),(t=>n.getRelatedEdgesData(t)));s.forEach((t=>{const e=Dh(t);i[e]=this.getElementZIndex(e)+o}))}else i[t]=e})),yield this.setElementZIndex(i)}))}getElementZIndex(t){return Zw(this.context.model.getElementDataById(t))}setElementState(t,e){return zT(this,arguments,void 0,(function*(t,e,n=!0){var i,r;const[a,o]=(0,nn.Z)(t)?[t,null===(i=e)||void 0===i||i]:[{[t]:e},n],s={nodes:[],edges:[],combos:[]};Object.entries(a).forEach((([t,e])=>{const n=this.getElementType(t);var i;s[`${n}s`].push({id:t,states:(i=e,i?Array.isArray(i)?i:[i]:[])})})),this.updateData(s),yield null===(r=this.context.element.draw({animation:o,stage:"state"}))||void 0===r?void 0:r.finished}))}getElementState(t){return this.context.model.getElementState(t)}getElementRenderBounds(t){return this.context.element.getElement(t).getRenderBounds()}collapseElement(t){return zT(this,arguments,void 0,(function*(t,e=!0){const{model:n,element:i}=this.context;if(Vd(n.getNodeLikeData([t])[0]))return;if(this.isCollapsingExpanding)return;const r=n.getElementType(t);yield this.frontElement(t),this.isCollapsingExpanding=!0,this.setElementCollapsibility(t,!0),"node"===r?yield i.collapseNode(t,e):"combo"===r&&(yield i.collapseCombo(t,e)),this.isCollapsingExpanding=!1}))}expandElement(t){return zT(this,arguments,void 0,(function*(t,e=!0){const{model:n,element:i}=this.context;if(!Vd(n.getNodeLikeData([t])[0]))return;if(this.isCollapsingExpanding)return;const r=n.getElementType(t);this.isCollapsingExpanding=!0,this.setElementCollapsibility(t,!1),"node"===r?yield i.expandNode(t,e):"combo"===r&&(yield i.expandCombo(t,e)),this.isCollapsingExpanding=!1}))}setElementCollapsibility(t,e){const n=this.getElementType(t);"node"===n?this.updateNodeData([{id:t,style:{collapsed:e}}]):"combo"===n&&this.updateComboData([{id:t,style:{collapsed:e}}])}toDataURL(){return zT(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)}}GT.defaultOptions={autoResize:!1,theme:"light",rotation:0,zoom:1,zoomRange:[.01,10]};class jT extends qh{beforeDraw(t,e){return t}afterLayout(){}}function UT(t,e,n,i,r){const a=Dh(i),o=`${n}s`,s=r?i:t.add[o].get(a)||t.update[o].get(a)||t.remove[o].get(a)||i;Object.entries(t).forEach((([t,n])=>{e===t?n[o].set(a,s):n[o].delete(a)}))}function HT(t,e){return Object.keys(t).every((n=>t[n]===e[n]))}const VT=(t,e,n,i)=>{const r=`${n}s`,a=Dh(i);t.add[r].has(a)||t.update[r].has(a)||t[e][r].set(Dh(i),i)};const ZT=(t,e)=>{const{source:n,target:i}=e,r=t.getElementDataById(n),a=t.getElementDataById(i),o=Ig(r,(e=>t.getParentData(e,pc))),s=Ig(a,(e=>t.getParentData(e,pc))),l={sourceNode:Dh(o),targetNode:Dh(s)};return e.style?Object.assign(e.style,l):e.style=l,e};class WT extends jT{constructor(t,e){super(t,(0,Qh.Z)({},WT.defaultOptions,e)),this.assignSizeByCentrality=(t,e,n,i,r,a)=>{const o=[e,n],s=[i[0],r[0]],l=[i[1],r[1]],u=[i[2],r[2]],c=(t,e)=>{if("function"==typeof a)return a(t,o,e);switch(a){case"linear":return((t,e,n)=>{const[i,r]=e,[a,o]=n;return r===i?a:a+(t-i)/(r-i)*(o-a)})(t,o,e);case"log":return((t,e,n)=>{const[i,r]=e,[a,o]=n;return a+Math.log(t-i+1)/Math.log(r-i+1)*(o-a)})(t,o,e);case"pow":return((t,e,n,i=2)=>{const[r,a]=e,[o,s]=n;return o+Math.pow((t-r)/(a-r),i)*(s-o)})(t,o,e,2);case"sqrt":return((t,e,n)=>{const[i,r]=e,[a,o]=n;return a+Math.sqrt((t-i)/(r-i))*(o-a)})(t,o,e);default:return e[0]}};return[c(t,s),c(t,l),c(t,u)]}}beforeDraw(t){const{model:e}=this.context,n=e.getNodeData(),i=tf(this.options.maxSize),r=tf(this.options.minSize),a=this.getCentralities(this.options.centrality),o=a.size>0?Math.max(...a.values()):0,s=a.size>0?Math.min(...a.values()):0;return n.forEach((e=>{var n;const l=this.assignSizeByCentrality(a.get(Dh(e))||0,s,o,r,i,this.options.scale),u=null===(n=this.context.element)||void 0===n?void 0:n.getElement(Dh(e)),c={size:l};this.assignLabelStyle(c,l,e,u),u&&HT(c,u.attributes)||UT(t,u?"update":"add","node",(0,Qh.Z)(e,{style:c}),!0)})),t}assignLabelStyle(t,e,n,i){var r;const a=i?i.config.style:null===(r=this.context.element)||void 0===r?void 0:r.getElementComputedStyle("node",n);if(Object.assign(t,(0,rg.Z)(a,["labelFontSize","labelLineHeight"])),this.options.mapLabelSize){const n=this.getLabelSizeByNodeSize(e,1/0,Number(t.labelFontSize));Object.assign(t,{labelFontSize:n,labelLineHeight:n+Hc(t.labelPadding)})}return t}getLabelSizeByNodeSize(t,e,n){const i=Math.min(...t)/2,[r,a]=Array.isArray(this.options.mapLabelSize)?this.options.mapLabelSize:[n,e];return Math.min(a,Math.max(i,r))}getCentralities(t){const{model:e}=this.context,n=e.getData();if("function"==typeof t)return t(n);const i=e.getRelatedEdgesData.bind(e);return Bh(n,i,t)}}WT.defaultOptions={centrality:{type:"degree"},maxSize:80,minSize:20,scale:"linear",mapLabelSize:!1};class XT extends jT{constructor(t,e){super(t,Object.assign({},XT.defaultOptions,e))}get ref(){return this.context.model.getRootsData()[0]}afterLayout(){var t;const e=md(this.ref),{graph:n,model:i}=this.context;null===(t=i.getData().nodes)||void 0===t||t.forEach((t=>{if(Dh(t)===Dh(this.ref))return;const r=dd(ed(md(t),e)),a=Math.abs(r)>Math.PI/2,o=!t.children||0===t.children.length,s=(o?1:-1)*(tf(n.getElementRenderStyle(Dh(t)).size)[0]/2+this.options.offset),l=[["translate",s*Math.cos(r),s*Math.sin(r)],["rotate",a?Fi(r)+180:Fi(r)]];i.updateNodeData([{id:Dh(t),style:{labelTextAlign:a===o?"right":"left",labelTextBaseline:"middle",labelTransform:l}}])})),n.draw()}}XT.defaultOptions={offset:5};const YT=["top","top-right","right","right-bottom","bottom","bottom-left","left","left-top"];class qT extends jT{constructor(t,e){super(t,Object.assign({},qT.defaultOptions,e)),this.cacheMergeStyle=new Map,this.getAffectedParallelEdges=t=>{const{add:{edges:e},update:{nodes:n,edges:i,combos:r},remove:{edges:a}}=t,{model:o}=this.context,s=new Map,l=(t,e)=>{o.getRelatedEdgesData(e).forEach((t=>!s.has(Dh(t))&&s.set(Dh(t),t)))};n.forEach(l),r.forEach(l);const u=t=>{const e=o.getEdgeData().map((t=>ZT(o,t)));KT(t,e,!0).forEach((t=>!s.has(Dh(t))&&s.set(Dh(t),t)))};if(a.size&&a.forEach(u),e.size&&e.forEach(u),i.size){const t=Oy(Ay(o.getChanges())).update.edges;i.forEach((e=>{var n;u(e);const i=null===(n=t.find((t=>Dh(t.value)===Dh(e))))||void 0===n?void 0:n.original;i&&!QT(e,i)&&u(i)}))}vf(this.options.edges)||s.forEach(((t,e)=>!this.options.edges.includes(e)&&s.delete(e)));const c=o.getEdgeData().map(Dh);return new Map([...s].sort(((t,e)=>c.indexOf(t[0])-c.indexOf(e[0]))))},this.applyBundlingStyle=(t,e,n)=>{const{edgeMap:i,reverses:r}=$T(e);i.forEach((e=>{e.forEach(((e,i,a)=>{var o;const s=a.length,l=e.style||{};if(e.source===e.target){const t=YT.length;l.loopPlacement=YT[i%t],l.loopDist=Math.floor(i/t)*n+50}else if(1===s)l.curveOffset=0;else{const t=(i%2==0?1:-1)*(r[`${e.source}|${e.target}|${i}`]?-1:1);l.curveOffset=s%2==1?t*Math.ceil(i/2)*n*2:t*(Math.floor(i/2)*n*2+n)}const u=Object.assign(e,{type:"quadratic",style:l}),c=null===(o=this.context.element)||void 0===o?void 0:o.getElement(Dh(e));c&&HT(u.style,c.attributes)||UT(t,c?"update":"add","edge",u,!0)}))}))},this.resetEdgeStyle=t=>{const e=t.style||{},n=this.cacheMergeStyle.get(Dh(t))||{};return Object.keys(n).forEach((i=>{ec(e[i],n[i])&&(t[i]?e[i]=t[i]:delete e[i])})),Object.assign(t,{style:e})},this.applyMergingStyle=(t,e)=>{const{edgeMap:n,reverses:i}=$T(e);n.forEach((e=>{var n;if(1===e.length){const i=e[0],r=null===(n=this.context.element)||void 0===n?void 0:n.getElement(Dh(i)),a=this.resetEdgeStyle(i);return void(r&&HT(a,r.attributes)||UT(t,r?"update":"add","edge",a))}const r=e.map((({source:t,target:e,style:n={}},r)=>{const{startArrow:a,endArrow:o}=n,s={},[l,u]=i[`${t}|${e}|${r}`]?["endArrow","startArrow"]:["startArrow","endArrow"];return tn(a)&&(s[l]=a),tn(o)&&(s[u]=o),s})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{});e.forEach(((e,n,i)=>{var a;if(0!==n)return void UT(t,"remove","edge",e);const o=Object.assign({},(0,en.Z)(this.options.style)?this.options.style(i):this.options.style,{childrenData:i});this.cacheMergeStyle.set(Dh(e),o);const s=Object.assign(Object.assign({},e),{type:"line",style:Object.assign(Object.assign(Object.assign({},e.style),r),o)}),l=null===(a=this.context.element)||void 0===a?void 0:a.getElement(Dh(e));l&&HT(s.style,l.attributes)||UT(t,l?"update":"add","edge",s,!0)}))}))}}beforeDraw(t){const e=this.getAffectedParallelEdges(t);return 0===e.size||("bundle"===this.options.mode?this.applyBundlingStyle(t,e,this.options.distance):this.applyMergingStyle(t,e)),t}}qT.defaultOptions={mode:"bundle",distance:15};const $T=t=>{const e=new Map,n=new Set,i={};for(const[r,a]of t){if(n.has(r))continue;const{source:o,target:s}=a,l=`${o}-${s}`;e.has(l)||e.set(l,[]),e.get(l).push(a),n.add(r);for(const[r,u]of t)n.has(r)||QT(a,u)&&(e.get(l).push(u),n.add(r),o===u.target&&s===u.source&&(i[`${u.source}|${u.target}|${e.get(l).length-1}`]=!0))}return{edgeMap:e,reverses:i}},KT=(t,e,n)=>e.filter((e=>(n||Dh(e)!==Dh(t))&&QT(e,t))),QT=(t,e)=>{const{sourceNode:n,targetNode:i}=t.style||{},{sourceNode:r,targetNode:a}=e.style||{};return n===r&&i===a||n===a&&i===r};var JT=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{if(t.depth=e,!t.children)return t;const{children:n}=t,i=JT(t,["children"]);return Object.assign(Object.assign({},i),{children:n.map((t=>t.id))})}),getEdgeData:i=((t,e)=>({source:t.id,target:e.id})),getChildren:r=(t=>t.children||[])}=e||{},a=[],o=[];return Fd(t,((t,e)=>{a.push(n(t,e));const s=r(t);for(const e of s)o.push(i(t,e))}),(t=>r(t)),"TB"),{nodes:a,edges:o}}var eS=function(t,e,n,i){return new(n||(n=Promise))((function(r,a){function o(t){try{l(i.next(t))}catch(t){a(t)}}function s(t){try{l(i.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}l((i=i.apply(t,e||[])).next())}))};class nS extends Im{constructor(){super(...arguments),this.id="fishbone"}getRoot(){const t=this.context.model.getRootsData();if(!(vf(t)||t.length>2))return t[0]}formatSize(t){const e="function"==typeof t?t:()=>t;return t=>tf(e(t))}doLayout(t,e){const{hGap:n,getRibSep:i,vGap:r,nodeSize:a,height:o}=e,{model:s}=this.context,l=this.formatSize(a);let u=l(t)[0]+i(t);const c=(t,e=0)=>{var i;return e+=n*((t.children||[]).length+1),null===(i=t.children)||void 0===i||i.forEach((t=>{var n;null===(n=s.getNodeLikeDatum(t).children)||void 0===n||n.forEach((t=>{const n=s.getNodeLikeDatum(t);e=c(n,e)}))})),e},h=t=>{if(1===t.depth)return u;const e=s.getParentData(t.id,"tree");if(aS(t)){const i=s.getParentData(e.id,"tree"),a=p(t)-p(i);return h(e)+a*n/r}{const n=(e.children||[]).indexOf(t.id),i=s.getNodeData((e.children||[]).slice(n));return d(e)-i.reduce(((t,e)=>t+c(e)),0)-l(e)[0]/2}},d=gv((t=>{if(rS(t))return l(t)[0]/2;const e=s.getParentData(t.id,"tree");if(aS(t))return h(t)+c(t)+l(t)[0]/2;{const i=p(t)-p(e),a=n/r;return h(t)+i*a}}),(t=>t.id)),f=t=>p(s.getParentData(t,"tree")),p=gv((t=>{if(rS(t))return o/2;if(aS(t)){const e=s.getParentData(t.id,"tree"),n=e.children.indexOf(t.id);if(0===n)return f(e.id)+r;const i=s.getNodeLikeDatum(e.children[n-1]);if(vf(i.children))return p(i)+r;const a=s.getDescendantsData(i.id);return Math.max(...a.map((t=>aS(t)?f(t.id):p(t))))+r}{if(vf(t.children))return f(t.id)+r;const e=s.getNodeLikeDatum(t.children.slice(-1)[0]);if(vf(e.children))return p(e)+r;const n=s.getDescendantsData(t.id).slice(-1)[0];return(aS(n)?f(n.id):p(n))+r}}),(t=>t.id));let g=0;const m={nodes:[],edges:[]},v=t=>{var e;null===(e=t.children)||void 0===e||e.forEach((t=>v(s.getNodeLikeDatum(t))));const n=p(t),r=d(t);if(m.nodes.push({id:t.id,x:r,y:n}),rS(t))return;const a=s.getRelatedEdgesData(t.id,"in")[0],o=[h(t),aS(t)?n:f(t.id)];m.edges.push({id:Dh(a),controlPoints:[o],relatedNodeId:t.id}),g=Math.max(g,r+i(t)),1===t.depth&&(u=g)};return v(t),m}placeAlterative(t,e){const n=(e.children||[]).filter(((t,e)=>e%2!=0));if(0===n.length)return t;const{model:i}=this.context,r=t.nodes.find((t=>t.id===e.id)).y,a=t=>{const e=i.getAncestorsData(t,"tree");if(vf(e))return!1;const r=1===e.length?t:e[e.length-2].id;return n.includes(r)};t.nodes.forEach((t=>{a(t.id)&&(t.y=2*r-t.y)})),t.edges.forEach((t=>{a(t.relatedNodeId)&&(t.controlPoints=t.controlPoints.map((t=>[t[0],2*r-t[1]])))}))}rightToLeft(t,e){return t.nodes.forEach((t=>t.x=e.width-t.x)),t.edges.forEach((t=>{t.controlPoints=t.controlPoints.map((t=>[e.width-t[0],t[1]]))})),t}execute(t,e){return eS(this,void 0,void 0,(function*(){const n=Object.assign(Object.assign(Object.assign({},nS.defaultOptions),this.options),e),{direction:i,nodeSize:r}=n,a=this.getRoot();if(!a)return t;const o=this.formatSize(r);n.vGap||(n.vGap=Math.max(...(t.nodes||[]).map((t=>o(t)[1])))),n.hGap||(n.hGap=Math.max(...(t.nodes||[]).map((t=>o(t)[0]))));let s=this.doLayout(a,n);this.placeAlterative(s,a),"RL"===i&&(s=this.rightToLeft(s,n));const{model:l}=this.context,u=[],c=[];return s.nodes.forEach((t=>{const{id:e,x:n,y:i}=t,r=l.getNodeLikeDatum(e);u.push(iS(r,{x:n,y:i}))})),s.edges.forEach((t=>{const{id:e,controlPoints:n}=t,i=l.getEdgeDatum(e);c.push(iS(i,{controlPoints:n}))})),{nodes:u,edges:c}}))}}nS.defaultOptions={direction:"RL",getRibSep:()=>60};const iS=(t,e)=>Object.assign(Object.assign({},t),{style:Object.assign(Object.assign({},t.style||{}),e)}),rS=t=>0===t.depth,aS=t=>(t.depth||(t.depth=0))%2==0,oS=["#7E92B5","#F4664A","#FFBE3A"],sS={type:"group",color:["#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]},lS={type:"group",color:["#99ADD1","#1783FF","#00C9C9","#F08F56","#D580FF","#7863FF","#DB9D0D","#60C42D","#FF80CA","#2491B3","#17C76F"]};function uS(t){const{bgColor:e,textColor:n,nodeColor:i,nodeColorDisabled:r,nodeStroke:a,nodeHaloStrokeOpacityActive:o=.15,nodeHaloStrokeOpacitySelected:s=.25,nodeOpacityDisabled:l=.06,nodeIconOpacityInactive:u=.85,nodeOpacityInactive:c=.25,nodeBadgePalette:h=oS,nodePaletteOptions:d=sS,edgeColor:f,edgeColorDisabled:p,edgePaletteOptions:g=lS,comboColor:m,comboColorDisabled:v,comboStroke:y,comboStrokeDisabled:x,edgeColorInactive:b}=t;return{background:e,node:{palette:d,style:{donutOpacity:1,badgeBackgroundOpacity:1,badgeFill:"#fff",badgeFontSize:8,badgePadding:[0,4],badgePalette:h,fill:i,fillOpacity:1,halo:!1,iconFill:"#fff",iconOpacity:1,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelFill:n,labelFillOpacity:.85,labelLineHeight:16,labelPadding:[0,2],labelFontSize:12,labelFontWeight:400,labelOpacity:1,labelOffsetY:2,lineWidth:0,portFill:i,portLineWidth:1,portStroke:a,portStrokeOpacity:.65,size:32,stroke:a,strokeOpacity:1,zIndex:2},state:{selected:{halo:!0,haloLineWidth:24,haloStrokeOpacity:s,labelFontSize:12,labelFontWeight:"bold",lineWidth:4,stroke:a},active:{halo:!0,haloLineWidth:12,haloStrokeOpacity:o},highlight:{labelFontWeight:"bold",lineWidth:4,stroke:a,strokeOpacity:.85},inactive:{badgeBackgroundOpacity:c,donutOpacity:c,fillOpacity:c,iconOpacity:u,labelFill:n,labelFillOpacity:c,strokeOpacity:c},disabled:{badgeBackgroundOpacity:.25,donutOpacity:l,fill:r,fillOpacity:l,iconFill:r,iconOpacity:.25,labelFill:n,labelFillOpacity:.25,strokeOpacity:l}},animation:{enter:"fade",exit:"fade",show:"fade",hide:"fade",expand:"node-expand",collapse:"node-collapse",update:[{fields:["x","y","fill","stroke"]}],translate:[{fields:["x","y"]}]}},edge:{palette:g,style:{badgeBackgroundFill:f,badgeFill:"#fff",badgeFontSize:8,badgeOffsetX:10,fillOpacity:1,halo:!1,haloLineWidth:12,haloStrokeOpacity:1,increasedLineWidthForHitTesting:2,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[4,4,4,4],labelFill:n,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:b,fillOpacity:.08,labelOpacity:.25,strokeOpacity:.08,badgeBackgroundOpacity:.25},disabled:{stroke:p,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:e,collapsedMarkerFontSize:12,collapsedMarkerFillOpacity:1,collapsedSize:32,collapsedFillOpacity:1,fill:m,halo:!1,haloLineWidth:12,haloStroke:y,haloStrokeOpacity:.25,labelBackground:!1,labelBackgroundFill:e,labelBackgroundLineWidth:0,labelBackgroundOpacity:.75,labelBackgroundPadding:[2,4,2,4],labelFill:n,labelFontSize:12,labelFontWeight:400,labelOpacity:1,lineDash:0,lineWidth:1,fillOpacity:.04,strokeOpacity:1,padding:10,stroke:y},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:v,fillOpacity:.25,labelOpacity:.25,stroke:x,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 cS=uS({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"}),hS=uS({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"}),dS={animation:{"combo-collapse":Dc,"combo-expand":kc,"node-collapse":Nc,"node-expand":Pc,"path-in":Lc,"path-out":Rc,fade:[{fields:["opacity"]}],translate:[{fields:["x","y"]}]},behavior:{"brush-select":Dd,"click-select":Hd,"collapse-expand":Sm,"create-edge":Om,"drag-canvas":Lm,"drag-element-force":class extends Dm{get forceLayoutInstance(){return this.context.layout.getLayoutInstance().find((t=>["d3-force","d3-force-3d"].includes(null==t?void 0:t.id)))}validate(t){return!!this.context.layout&&(this.forceLayoutInstance?super.validate(t):(bc.warn("DragElementForce only works with d3-force or d3-force-3d layout"),!1))}moveElement(t,e){return Um(this,void 0,void 0,(function*(){const n=this.forceLayoutInstance;this.context.graph.getNodeData(t).forEach(((i,r)=>{const{x:a=0,y:o=0}=i.style||{};n&&Gm(n,"setFixedPosition",t[r],[...td([+a,+o],e)])}))}))}onDragStart(t){if(this.enable=this.validate(t),!this.enable)return;this.target=this.getSelectedNodeIDs([t.target.id]),this.hideEdge(),this.context.graph.frontElement(this.target);const e=this.forceLayoutInstance;e&&jm(e,"simulation").alphaTarget(.3).restart(),this.context.graph.getNodeData(this.target).forEach((t=>{const{x:n=0,y:i=0}=t.style||{};e&&Gm(e,"setFixedPosition",Dh(t),[+n,+i])}))}onDrag(t){if(!this.enable)return;const e=this.getDelta(t);this.moveElement(this.target,e)}onDragEnd(){const t=this.forceLayoutInstance;t&&jm(t,"simulation").alphaTarget(0),this.context.graph.getNodeData(this.target).forEach((e=>{t&&Gm(t,"setFixedPosition",Dh(e),[null,null,null])}))}},"drag-element":Dm,"fix-element-size":Vm,"focus-element":Wm,"hover-activate":Xm,"lasso-select":class extends Dd{onPointerDown(t){if(!super.validate(t)||!super.isKeydown()||this.points)return;const{canvas:e}=this.context;this.pathShape=new Nl({id:"g6-lasso-select",style:this.options.style}),e.appendChild(this.pathShape),this.points=[kd(t)]}onPointerMove(t){var e;if(!this.points)return;const{immediately:n,mode:i}=this.options;this.points.push(kd(t)),null===(e=this.pathShape)||void 0===e||e.setAttribute("d",function(t,e=!0){const n=[];return t.forEach(((t,e)=>{n.push([0===e?"M":"L",...t])})),e&&n.push(["Z"]),n}(this.points)),n&&"default"===i&&this.points.length>2&&super.updateElementsStates(this.points)}onPointerUp(){this.points&&(this.points.length<2||super.updateElementsStates(this.points),this.clearLasso())}clearLasso(){var t;null===(t=this.pathShape)||void 0===t||t.remove(),this.pathShape=void 0,this.points=void 0}},"auto-adapt-label":Kh,"optimize-viewport-transform":Ym,"scroll-canvas":$m,"zoom-canvas":Qm},combo:{circle:class extends hg{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",xl,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&&Kd(n,"collapsed")),{r:i/2})}getCollapsedKeySize(t){const[e,n]=tf(t.collapsedSize),i=Math.max(e,n)/2;return[2*i,2*i,0]}getExpandedKeySize(t){const e=this.getContentBBox(t),[n,i]=Wc(e),r=Math.sqrt(Math.pow(n,2)+Math.pow(i,2))/2;return[2*r,2*r,0]}getIntersectPoint(t,e=!1){return Cd(t,this.getShape("key").getBounds(),e)}},rect:class extends hg{constructor(t){super(t)}drawKeyShape(t,e){return this.upsert("key",kl,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&&Kd(e,"collapsed")),{width:n,height:i,x:-n/2,y:-i/2})}}},edge:{cubic:Wg,line:$g,polyline:sm,quadratic:lm,"cubic-horizontal":Xg,"cubic-radial":Yg,"cubic-vertical":qg},layout:{"antv-dagre":tv.b,"combo-combined":nv.u,"compact-box":Jm.compactBox,"d3-force":rv.j,"force-atlas2":ov.E,circular:ev.S,concentric:iv.W,dagre:av.V,dendrogram:Jm.dendrogram,fishbone:nS,force:sv.y,fruchterman:lv.O,grid:uv.M,indented:Jm.indented,mds:cv.A,mindmap:Jm.mindmap,radial:hv.D,random:dv._},node:{circle:Bf,diamond:class extends Ff{constructor(t){super(t)}getPoints(t){const[e,n]=this.getSize(t);return function(t,e){return[[0,-e/2],[t/2,0],[0,e/2],[-t/2,0]]}(e,n)}},ellipse:Hf,hexagon:class extends Ff{constructor(t){super(t)}getOuterR(t){return t.outerR||Math.min(...this.getSize(t))/2}getPoints(t){return[[0,e=this.getOuterR(t)],[e*Math.sqrt(3)/2,e/2],[e*Math.sqrt(3)/2,-e/2],[0,-e],[-e*Math.sqrt(3)/2,-e/2],[-e*Math.sqrt(3)/2,e/2]];var e}getIconStyle(t){const e=super.getIconStyle(t),n=this.getOuterR(t)*Id;return!!e&&Object.assign({width:n,height:n},e)}},html:og,image:lg,rect:class extends If{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*Id,height:i*Id},e)}drawKeyShape(t,e){return this.upsert("key",kl,this.getKeyStyle(t),e)}},star:class extends Ff{constructor(t){super(t)}getInnerR(t){return t.innerR||3*this.getOuterR(t)/8}getOuterR(t){return Math.min(...this.getSize(t))/2}getPoints(t){return e=this.getOuterR(t),n=this.getInnerR(t),[[0,-e],[n*Math.cos(3*Math.PI/10),-n*Math.sin(3*Math.PI/10)],[e*Math.cos(Math.PI/10),-e*Math.sin(Math.PI/10)],[n*Math.cos(Math.PI/10),n*Math.sin(Math.PI/10)],[e*Math.cos(3*Math.PI/10),e*Math.sin(3*Math.PI/10)],[0,n],[-e*Math.cos(3*Math.PI/10),e*Math.sin(3*Math.PI/10)],[-n*Math.cos(Math.PI/10),n*Math.sin(Math.PI/10)],[-e*Math.cos(Math.PI/10),-e*Math.sin(Math.PI/10)],[-n*Math.cos(3*Math.PI/10),-n*Math.sin(3*Math.PI/10)]];var e,n}getIconStyle(t){const e=super.getIconStyle(t),n=2*this.getInnerR(t)*Id;return!!e&&Object.assign({width:n,height:n},e)}getPortXY(t,e){const{placement:n="top"}=e;return fm(this.getShape("key").getLocalBounds(),n,function(t,e){const n={};return n.top=[0,-t],n.left=[-t*Math.cos(Math.PI/10),-t*Math.sin(Math.PI/10)],n["left-bottom"]=[-t*Math.cos(3*Math.PI/10),t*Math.sin(3*Math.PI/10)],n.bottom=[0,e],n["right-bottom"]=[t*Math.cos(3*Math.PI/10),t*Math.sin(3*Math.PI/10)],n.right=n.default=[t*Math.cos(Math.PI/10),-t*Math.sin(Math.PI/10)],n}(this.getOuterR(t),this.getInnerR(t)),!1)}},donut:Gf,triangle:ug},palette:{spectral:["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)"],tableau:["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)"],oranges:["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)"],greens:["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)"],blues:["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)"]},theme:{dark:cS,light:hS},plugin:{"bubble-sets":ly,"edge-bundling":fy,"edge-filter-lens":Ey,"grid-line":My,background:Mv,contextmenu:dy,fisheye:Ty,fullscreen:Sy,history:Ly,hull:jy,legend:nb,minimap:ib,snapline:lb,timebar:lw,toolbar:fw,tooltip:_w,watermark:Cw},transform:{"arrange-draw-order":class extends jT{beforeDraw(t){const{model:e}=this.context,n=t.add.combos,i=t=>{const n=[];return t.forEach(((t,i)=>{const r=e.getAncestorsData(i,"combo").map((t=>Dh(t))).reverse();n.push([i,t,r.length])})),new Map(n.sort((([,,t],[,,e])=>e-t)).map((([t,e])=>[t,e])))};return t.add.combos=i(n),t.update.combos=i(t.update.combos),t}},"collapse-expand-combo":class extends jT{beforeDraw(t,e){if("visibility"===e.stage)return t;if(!this.context.model.model.hasTreeStructure(pc))return t;const{model:n}=this.context,{add:i,update:r}=t,a=[...t.update.combos.entries(),...t.add.combos.entries()];for(;a.length;){const[e,o]=a.pop();if(Vd(o)){const o=n.getDescendantsData(e),s=o.map(Dh),{internal:l,external:u}=kg(s,(t=>n.getRelatedEdgesData(t)));o.forEach((e=>{const i=Dh(e),r=a.findIndex((([t])=>t===i));-1!==r&&a.splice(r,1);const o=n.getElementType(i);UT(t,"remove",o,e)})),l.forEach((e=>UT(t,"remove","edge",e))),u.forEach((t=>{var e;const n=Dh(t);(null===(e=this.context.element)||void 0===e?void 0:e.getElement(n))?r.edges.set(n,t):i.edges.set(n,t)}))}else{const i=n.getChildrenData(e),r=i.map(Dh),{edges:o}=kg(r,(t=>n.getRelatedEdgesData(t)));[...i,...o].forEach((e=>{var i;const r=Dh(e),o=n.getElementType(r),s=null===(i=this.context.element)||void 0===i?void 0:i.getElement(r);UT(t,s?"update":"add",o,e),"combo"===o&&a.push([r,e])}))}}return t}},"collapse-expand-node":class extends jT{getElement(t){return this.context.element.getElement(t)}handleExpand(t,e){if(VT(e,"add","node",t),Vd(t))return;const n=Dh(t);VT(e,"add","node",t);this.context.model.getRelatedEdgesData(n,"out").forEach((t=>{UT(e,"add","edge",t)}));this.context.model.getChildrenData(n).forEach((t=>{this.handleExpand(t,e)}))}beforeDraw(t){const{graph:e,model:n}=this.context;if(!n.model.hasTreeStructure(gc))return t;const{add:{nodes:i,edges:r},update:{nodes:a}}=t,o=new Map,s=new Map;i.forEach(((t,e)=>{Vd(t)&&o.set(e,t)})),r.forEach((t=>{if("node"!==e.getElementType(t.source))return;const n=e.getNodeData(t.source);Vd(n)&&o.set(t.source,n)})),a.forEach(((t,e)=>{const n=this.getElement(e);if(!n)return;const i=n.attributes.collapsed;Vd(t)?i||o.set(e,t):i&&s.set(e,t)}));const l=new Set;return o.forEach(((e,i)=>{n.getDescendantsData(i).forEach((e=>{const i=Dh(e);if(l.has(i))return;UT(t,"remove","node",e);n.getRelatedEdgesData(i).forEach((e=>{UT(t,"remove","edge",e)})),l.add(i)}))})),s.forEach(((e,i)=>{n.getAncestorsData(i,gc).some(Vd)?UT(t,"remove","node",e):this.handleExpand(e,t)})),t}},"get-edge-actual-ends":class extends jT{beforeDraw(t){const{add:e,update:n}=t,{model:i}=this.context;return[...e.edges.entries(),...n.edges.entries()].forEach((([,t])=>{ZT(i,t)})),t}},"map-node-size":WT,"place-radial-labels":XT,"process-parallel-edges":qT,"update-related-edges":class extends jT{beforeDraw(t,e){const{stage:n}=e;if("visibility"===n)return t;const{model:i}=this.context,{update:{nodes:r,edges:a,combos:o}}=t,s=(t,e)=>{i.getRelatedEdgesData(e).forEach((t=>!a.has(Dh(t))&&a.set(Dh(t),t)))};return r.forEach(s),o.forEach(s),t}}},shape:{circle:xl,ellipse:El,group:wl,html:Sl,image:Af,line:Al,path:Nl,polygon:Ll,polyline:Dl,rect:kl,text:Bl,label:_f,badge:Ef}};al.enableMassiveParsedStyleAssignOptimization=!0,Object.entries(dS).forEach((([t,e])=>{Object.entries(e).forEach((([e,n])=>{!function(t,e,n,i=!1){const r=vc[t][e];!i&&r?r!==n&&bc.warn(`The extension ${e} of ${t} has been registered before.`):Object.assign(vc[t],{[e]:n})}(t,e,n)}))}))},13722:function(t){var e;"undefined"!=typeof self&&self,e=function(){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e){t.exports={assign:Object.assign,getHeight:function(t,e,n,i){return void 0===i&&(i="height"),"center"===n?(t[i]+e[i])/2:t.height}}},function(t,e,n){var i=n(3),r=function(){function t(t,e){void 0===e&&(e={}),this.options=e,this.rootNode=i(t,e)}return t.prototype.execute=function(){throw new Error("please override this method")},t}();t.exports=r},function(t,e,n){var i=n(4),r=["LR","RL","TB","BT","H","V"],a=["LR","RL","H"],o=r[0];t.exports=function(t,e,n){var s=e.direction||o;if(e.isHorizontal=function(t){return a.indexOf(t)>-1}(s),s&&-1===r.indexOf(s))throw new TypeError("Invalid direction: "+s);if(s===r[0])n(t,e);else if(s===r[1])n(t,e),t.right2left();else if(s===r[2])n(t,e);else if(s===r[3])n(t,e),t.bottom2top();else if(s===r[4]||s===r[5]){var l=i(t,e),u=l.left,c=l.right;n(u,e),n(c,e),e.isHorizontal?u.right2left():u.bottom2top(),c.translate(u.x-c.x,u.y-c.y),t.x=u.x,t.y=c.y;var h=t.getBoundingBox();e.isHorizontal?h.top<0&&t.translate(0,-h.top):h.left<0&&t.translate(-h.left,0)}var d=e.fixedRoot;return void 0===d&&(d=!0),d&&t.translate(-(t.x+t.width/2+t.hgap),-(t.y+t.height/2+t.vgap)),function(t,e){if(e.radial){var n=e.isHorizontal?["x","y"]:["y","x"],i=n[0],r=n[1],a={x:1/0,y:1/0},o={x:-1/0,y:-1/0},s=0;t.DFTraverse((function(t){s++;var e=t.x,n=t.y;a.x=Math.min(a.x,e),a.y=Math.min(a.y,n),o.x=Math.max(o.x,e),o.y=Math.max(o.y,n)}));var l=o[r]-a[r];if(0===l)return;var u=2*Math.PI/s;t.DFTraverse((function(e){var n=(e[r]-a[r])/l*(2*Math.PI-u)+u,o=e[i]-t[i];e.x=Math.cos(n)*o,e.y=Math.sin(n)*o}))}}(t,e),t}},function(t,e,n){var i=n(0),r={getId:function(t){return t.id||t.name},getPreH:function(t){return t.preH||0},getPreV:function(t){return t.preV||0},getHGap:function(t){return t.hgap||18},getVGap:function(t){return t.vgap||18},getChildren:function(t){return t.children},getHeight:function(t){return t.height||36},getWidth:function(t){var e=t.label||" ";return t.width||18*e.split("").length}};function a(t,e){var n=this;if(n.vgap=n.hgap=0,t instanceof a)return t;n.data=t;var i=e.getHGap(t),r=e.getVGap(t);return n.preH=e.getPreH(t),n.preV=e.getPreV(t),n.width=e.getWidth(t),n.height=e.getHeight(t),n.width+=n.preH,n.height+=n.preV,n.id=e.getId(t),n.x=n.y=0,n.depth=0,n.children||(n.children=[]),n.addGap(i,r),n}i.assign(a.prototype,{isRoot:function(){return 0===this.depth},isLeaf:function(){return 0===this.children.length},addGap:function(t,e){var n=this;n.hgap+=t,n.vgap+=e,n.width+=2*t,n.height+=2*e},eachNode:function(t){for(var e,n=[this];e=n.shift();)t(e),n=e.children.concat(n)},DFTraverse:function(t){this.eachNode(t)},BFTraverse:function(t){for(var e,n=[this];e=n.shift();)t(e),n=n.concat(e.children)},getBoundingBox:function(){var t={left:Number.MAX_VALUE,top:Number.MAX_VALUE,width:0,height:0};return this.eachNode((function(e){t.left=Math.min(t.left,e.x),t.top=Math.min(t.top,e.y),t.width=Math.max(t.width,e.x+e.width),t.height=Math.max(t.height,e.y+e.height)})),t},translate:function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.eachNode((function(n){n.x+=t,n.y+=e,n.x+=n.preH,n.y+=n.preV}))},right2left:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.x=t.x-2*(t.x-e.left)-t.width})),t.translate(e.width,0)},bottom2top:function(){var t=this,e=t.getBoundingBox();t.eachNode((function(t){t.y=t.y-2*(t.y-e.top)-t.height})),t.translate(0,e.height)}}),t.exports=function(t,e,n){void 0===e&&(e={});var o,s=new a(t,e=i.assign({},r,e)),l=[s];if(!n&&!t.collapsed)for(;o=l.shift();)if(!o.data.collapsed){var u=e.getChildren(o.data),c=u?u.length:0;if(o.children=new Array(c),u&&c)for(var h=0;hn.low&&(n=n.nxt);var s=r+i.prelim+i.w-(o+a.prelim);s>0&&(o+=s,u(t,e,n.index,s));var l=d(i),f=d(a);l<=f&&null!==(i=h(i))&&(r+=i.mod),l>=f&&null!==(a=c(a))&&(o+=a.mod)}!i&&a?function(t,e,n,i){var r=t.c[0].el;r.tl=n;var a=i-n.mod-t.c[0].msel;r.mod+=a,r.prelim-=a,t.c[0].el=t.c[e].el,t.c[0].msel=t.c[e].msel}(t,e,a,o):i&&!a&&function(t,e,n,i){var r=t.c[e].er;r.tr=n;var a=i-n.mod-t.c[e].mser;r.mod+=a,r.prelim-=a,t.c[e].er=t.c[e-1].er,t.c[e].mser=t.c[e-1].mser}(t,e,i,r)}function u(t,e,n,i){t.c[e].mod+=i,t.c[e].msel+=i,t.c[e].mser+=i,function(t,e,n,i){if(n!==e-1){var r=e-n;t.c[n+1].shift+=i/r,t.c[e].shift-=i/r,t.c[e].change-=i-i/r}}(t,e,n,i)}function c(t){return 0===t.cs?t.tl:t.c[0]}function h(t){return 0===t.cs?t.tr:t.c[t.cs-1]}function d(t){return t.y+t.h}function f(t,e,n){for(;null!==n&&t>=n.low;)n=n.nxt;return{low:t,index:e,nxt:n}}s(t,i);var p=n.fromNode(t,i);return function t(e){if(0!==e.cs){t(e.c[0]);for(var n=f(d(e.c[0].el),0,null),i=1;is&&(s=e.depth);var n=e.children,i=n.length,a=new r(e.height,[]);return n.forEach((function(e,n){var r=t(e);a.children.push(r),0===n&&(a.leftChild=r),n===i-1&&(a.rightChild=r)})),a.originNode=e,a.isLeaf=e.isLeaf(),a}(t);return function t(e){if(e.isLeaf||0===e.children.length)e.drawingDepth=s;else{var n=e.children.map((function(e){return t(e)})),i=Math.min.apply(null,n);e.drawingDepth=i-1}return e.drawingDepth}(l),function t(i){i.x=i.drawingDepth*e.rankSep,i.isLeaf?(i.y=0,n&&(i.y=n.y+n.height+e.nodeSep,i.originNode.parent!==n.originNode.parent&&(i.y+=e.subTreeSep)),n=i):(i.children.forEach((function(e){t(e)})),i.y=(i.leftChild.y+i.rightChild.y)/2)}(l),o(l,t,e.isHorizontal),t}},function(t,e,n){function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var r=n(1),a=n(11),o=n(4),s=n(0),l=["LR","RL","H"],u=l[0],c=function(t){function e(){return t.apply(this,arguments)||this}var n,r;return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r),e.prototype.execute=function(){var t=this.options,e=this.rootNode;t.isHorizontal=!0;var n=t.indent,i=void 0===n?20:n,r=t.dropCap,s=void 0===r||r,c=t.direction,h=void 0===c?u:c,d=t.align;if(h&&-1===l.indexOf(h))throw new TypeError("Invalid direction: "+h);if(h===l[0])a(e,i,s,d);else if(h===l[1])a(e,i,s,d),e.right2left();else if(h===l[2]){var f=o(e,t),p=f.left,g=f.right;a(p,i,s,d),p.right2left(),a(g,i,s,d);var m=p.getBoundingBox();g.translate(m.width,0),e.x=g.x-e.width/2}return e},e}(r),h={};t.exports=function(t,e){return e=s.assign({},h,e),new c(t,e).execute()}},function(t,e,n){var i=n(0);t.exports=function(t,e,n,r){var a=null;t.eachNode((function(t){!function(t,e,n,r,a){var o=("function"==typeof n?n(t):n)*t.depth;if(!r)try{if(t.id===t.parent.children[0].id)return t.x+=o,void(t.y=e?e.y:0)}catch(t){}if(t.x+=o,e){if(t.y=e.y+i.getHeight(e,t,a),e.parent&&t.parent.id!==e.parent.id){var s=e.parent,l=s.y+i.getHeight(s,t,a);t.y=l>t.y?l:t.y}}else t.y=0}(t,a,e,n,r),a=t}))}},function(t,e,n){function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}var r=n(1),a=n(13),o=n(2),s=n(0),l=function(t){function e(){return t.apply(this,arguments)||this}var n,r;return r=t,(n=e).prototype=Object.create(r.prototype),n.prototype.constructor=n,i(n,r),e.prototype.execute=function(){return o(this.rootNode,this.options,a)},e}(r),u={};t.exports=function(t,e){return e=s.assign({},u,e),new l(t,e).execute()}},function(t,e,n){var i=n(0);function r(t,e){var n=0;return t.children.length?t.children.forEach((function(t){n+=r(t,e)})):n=t.height,t._subTreeSep=e.getSubTreeSep(t.data),t.totalHeight=Math.max(t.height,n)+2*t._subTreeSep,t.totalHeight}function a(t){var e=t.children,n=e.length;if(n){e.forEach((function(t){a(t)}));var i=e[0],r=e[n-1],o=r.y-i.y+r.height,s=0;if(e.forEach((function(t){s+=t.totalHeight})),o>t.height)t.y=i.y+o/2-t.height/2;else if(1!==e.length||t.height>s){var l=t.y+(t.height-o)/2-i.y;e.forEach((function(t){t.translate(0,l)}))}else t.y=(i.y+i.height/2+r.y+r.height/2)/2-t.height/2}}var o={getSubTreeSep:function(){return 0}};t.exports=function(t,e){void 0===e&&(e={}),e=i.assign({},o,e),t.parent={x:0,width:0,height:0,y:0},t.BFTraverse((function(t){t.x=t.parent.x+t.parent.width})),t.parent=null,r(t,e),t.startY=0,t.y=t.totalHeight/2-t.height/2,t.eachNode((function(t){var e=t.children,n=e.length;if(n){var i=e[0];if(i.startY=t.startY+t._subTreeSep,1===n)i.y=t.y+t.height/2-i.height/2;else{i.y=i.startY+i.totalHeight/2-i.height/2;for(var r=1;r{const{prefixCls:n,className:i,popupClassName:l,dropdownClassName:p,children:g,dataSource:m}=t,v=(0,a.Z)(g);let y;1===v.length&&(0,u.l$)(v[0])&&!f(v[0])&&([y]=v);const x=y?()=>y:void 0;let b;b=v.length&&f(v[0])?g:m?m.map((t=>{if((0,u.l$)(t))return t;switch(typeof t){case"string":return s.createElement(d,{key:t,value:t},t);case"object":{const{value:e}=t;return s.createElement(d,{key:e,value:e},t.text)}default:return}})):[];const{getPrefixCls:_}=s.useContext(c.E_),E=_("select",n);return s.createElement(h.default,Object.assign({ref:e,suffixIcon:null},(0,o.Z)(t,["dataSource","dropdownClassName"]),{prefixCls:E,popupClassName:l||p,className:r()(`${E}-auto-complete`,i),mode:h.default.SECRET_COMBOBOX_MODE_DO_NOT_USE},{getInputElement:x}),b)},g=s.forwardRef(p),m=(0,l.Z)(g);g.Option=d,g._InternalPanelDoNotUseOrYouWillBeFired=m,e.Z=g},28103:function(t,e,n){"use strict";n.d(e,{Z:function(){return f}});var i=n(92310),r=n.n(i),a=n(59301),o=n(36355),s=n(17313),l=n(83116),u=n(37613);const c=t=>{const{componentCls:e,sizePaddingEdgeHorizontal:n,colorSplit:i,lineWidth:r,textPaddingInline:a,orientationMargin:o,verticalMarginInline:l}=t;return{[e]:Object.assign(Object.assign({},(0,s.Wf)(t)),{borderBlockStart:`${r}px solid ${i}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:l,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${r}px solid ${i}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${t.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${e}-with-text`]:{display:"flex",alignItems:"center",margin:`${t.dividerHorizontalWithTextGutterMargin}px 0`,color:t.colorTextHeading,fontWeight:500,fontSize:t.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${i}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${r}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${e}-with-text-left`]:{"&::before":{width:100*o+"%"},"&::after":{width:100-100*o+"%"}},[`&-horizontal${e}-with-text-right`]:{"&::before":{width:100-100*o+"%"},"&::after":{width:100*o+"%"}},[`${e}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:a},"&-dashed":{background:"none",borderColor:i,borderStyle:"dashed",borderWidth:`${r}px 0 0`},[`&-horizontal${e}-with-text${e}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${e}-dashed`]:{borderInlineStartWidth:r,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${e}-with-text`]:{color:t.colorText,fontWeight:"normal",fontSize:t.fontSize},[`&-horizontal${e}-with-text-left${e}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${e}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${e}-with-text-right${e}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${e}-inner-text`]:{paddingInlineEnd:n}}})}};var h=(0,l.Z)("Divider",(t=>{const e=(0,u.TS)(t,{dividerHorizontalWithTextGutterMargin:t.margin,dividerHorizontalGutterMargin:t.marginLG,sizePaddingEdgeHorizontal:0});return[c(e)]}),(t=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:t.marginXS}))),d=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{const{getPrefixCls:e,direction:n,divider:i}=a.useContext(o.E_),{prefixCls:s,type:l="horizontal",orientation:u="center",orientationMargin:c,className:f,rootClassName:p,children:g,dashed:m,plain:v,style:y}=t,x=d(t,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),b=e("divider",s),[_,E]=h(b),w=u.length>0?`-${u}`:u,T=!!g,S="left"===u&&null!=c,M="right"===u&&null!=c,C=r()(b,null==i?void 0:i.className,E,`${b}-${l}`,{[`${b}-with-text`]:T,[`${b}-with-text${w}`]:T,[`${b}-dashed`]:!!m,[`${b}-plain`]:!!v,[`${b}-rtl`]:"rtl"===n,[`${b}-no-default-orientation-margin-left`]:S,[`${b}-no-default-orientation-margin-right`]:M},f,p),A=a.useMemo((()=>"number"==typeof c?c:/^\d+$/.test(c)?Number(c):c),[c]),O=Object.assign(Object.assign({},S&&{marginLeft:A}),M&&{marginRight:A});return _(a.createElement("div",Object.assign({className:C,style:Object.assign(Object.assign({},null==i?void 0:i.style),y)},x,{role:"separator"}),g&&"vertical"!==l&&a.createElement("span",{className:`${b}-inner-text`,style:O},g)))}},43428:function(t,e,n){"use strict";n.d(e,{Z:function(){return j}});var i=n(92310),r=n.n(i),a=n(57259),o=n(29043),s=n(43403),l=n(19171),u=n(59301),c=u.createContext(null),h=u.createContext({}),d=c,f=n(80962),p=n(5891),g=n(43167),m=n(20287),v=n(47413),y=n(83794);var x=function(t){var e=t.prefixCls,n=t.className,i=t.style,o=t.children,s=t.containerRef,l=t.id,c={onMouseEnter:t.onMouseEnter,onMouseOver:t.onMouseOver,onMouseLeave:t.onMouseLeave,onClick:t.onClick,onKeyDown:t.onKeyDown,onKeyUp:t.onKeyUp},d=u.useContext(h).panel,f=(0,y.useComposeRef)(d,s);return u.createElement(u.Fragment,null,u.createElement("div",(0,p.Z)({id:l,className:r()("".concat(e,"-content"),n),style:(0,a.Z)({},i),"aria-modal":"true",role:"dialog",ref:f},c),o))},b=n(85870);function _(t){return"string"==typeof t&&String(Number(t))===t?((0,b.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(t)):t}var E={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function w(t,e){var n,i,s,l,c=t.prefixCls,h=t.open,y=t.placement,b=t.inline,w=t.push,T=t.forceRender,S=t.autoFocus,M=t.keyboard,C=t.rootClassName,A=t.rootStyle,O=t.zIndex,N=t.className,P=t.id,L=t.style,R=t.motion,D=t.width,k=t.height,I=t.children,B=t.contentWrapperStyle,F=t.mask,z=t.maskClosable,G=t.maskMotion,j=t.maskClassName,U=t.maskStyle,H=t.afterOpenChange,V=t.onClose,Z=t.onMouseEnter,W=t.onMouseOver,X=t.onMouseLeave,Y=t.onClick,q=t.onKeyDown,$=t.onKeyUp,K=u.useRef(),Q=u.useRef(),J=u.useRef();u.useImperativeHandle(e,(function(){return K.current}));u.useEffect((function(){var t;h&&S&&(null===(t=K.current)||void 0===t||t.focus({preventScroll:!0}))}),[h]);var tt=u.useState(!1),et=(0,o.Z)(tt,2),nt=et[0],it=et[1],rt=u.useContext(d),at=null!==(n=null!==(i=null===(s=!1===w?{distance:0}:!0===w?{}:w||{})||void 0===s?void 0:s.distance)&&void 0!==i?i:null==rt?void 0:rt.pushDistance)&&void 0!==n?n:180,ot=u.useMemo((function(){return{pushDistance:at,push:function(){it(!0)},pull:function(){it(!1)}}}),[at]);u.useEffect((function(){var t,e;h?null==rt||null===(t=rt.push)||void 0===t||t.call(rt):null==rt||null===(e=rt.pull)||void 0===e||e.call(rt)}),[h]),u.useEffect((function(){return function(){var t;null==rt||null===(t=rt.pull)||void 0===t||t.call(rt)}}),[]);var st=F&&u.createElement(g.default,(0,p.Z)({key:"mask"},G,{visible:h}),(function(t,e){var n=t.className,i=t.style;return u.createElement("div",{className:r()("".concat(c,"-mask"),n,j),style:(0,a.Z)((0,a.Z)({},i),U),onClick:z&&h?V:void 0,ref:e})})),lt="function"==typeof R?R(y):R,ut={};if(nt&&at)switch(y){case"top":ut.transform="translateY(".concat(at,"px)");break;case"bottom":ut.transform="translateY(".concat(-at,"px)");break;case"left":ut.transform="translateX(".concat(at,"px)");break;default:ut.transform="translateX(".concat(-at,"px)")}"left"===y||"right"===y?ut.width=_(D):ut.height=_(k);var ct={onMouseEnter:Z,onMouseOver:W,onMouseLeave:X,onClick:Y,onKeyDown:q,onKeyUp:$},ht=u.createElement(g.default,(0,p.Z)({key:"panel"},lt,{visible:h,forceRender:T,onVisibleChanged:function(t){null==H||H(t)},removeOnLeave:!1,leavedClassName:"".concat(c,"-content-wrapper-hidden")}),(function(e,n){var i=e.className,o=e.style;return u.createElement("div",(0,p.Z)({className:r()("".concat(c,"-content-wrapper"),i),style:(0,a.Z)((0,a.Z)((0,a.Z)({},ut),o),B)},(0,v.Z)(t,{data:!0})),u.createElement(x,(0,p.Z)({id:P,containerRef:n,prefixCls:c,className:N,style:L},ct),I))})),dt=(0,a.Z)({},A);return O&&(dt.zIndex=O),u.createElement(d.Provider,{value:ot},u.createElement("div",{className:r()(c,"".concat(c,"-").concat(y),C,(l={},(0,f.Z)(l,"".concat(c,"-open"),h),(0,f.Z)(l,"".concat(c,"-inline"),b),l)),style:dt,tabIndex:-1,ref:K,onKeyDown:function(t){var e=t.keyCode,n=t.shiftKey;switch(e){case m.Z.TAB:var i;if(e===m.Z.TAB)if(n||document.activeElement!==J.current){if(n&&document.activeElement===Q.current){var r;null===(r=J.current)||void 0===r||r.focus({preventScroll:!0})}}else null===(i=Q.current)||void 0===i||i.focus({preventScroll:!0});break;case m.Z.ESC:V&&M&&(t.stopPropagation(),V(t))}}},st,u.createElement("div",{tabIndex:0,ref:Q,style:E,"aria-hidden":"true","data-sentinel":"start"}),ht,u.createElement("div",{tabIndex:0,ref:J,style:E,"aria-hidden":"true","data-sentinel":"end"})))}var T=u.forwardRef(w);var S=function(t){var e=t.open,n=void 0!==e&&e,i=t.prefixCls,r=void 0===i?"rc-drawer":i,c=t.placement,d=void 0===c?"right":c,f=t.autoFocus,p=void 0===f||f,g=t.keyboard,m=void 0===g||g,v=t.width,y=void 0===v?378:v,x=t.mask,b=void 0===x||x,_=t.maskClosable,E=void 0===_||_,w=t.getContainer,S=t.forceRender,M=t.afterOpenChange,C=t.destroyOnClose,A=t.onMouseEnter,O=t.onMouseOver,N=t.onMouseLeave,P=t.onClick,L=t.onKeyDown,R=t.onKeyUp,D=t.panelRef,k=u.useState(!1),I=(0,o.Z)(k,2),B=I[0],F=I[1];var z=u.useState(!1),G=(0,o.Z)(z,2),j=G[0],U=G[1];(0,l.Z)((function(){U(!0)}),[]);var H=!!j&&n,V=u.useRef(),Z=u.useRef();(0,l.Z)((function(){H&&(Z.current=document.activeElement)}),[H]);var W=u.useMemo((function(){return{panel:D}}),[D]);if(!S&&!B&&!H&&C)return null;var X={onMouseEnter:A,onMouseOver:O,onMouseLeave:N,onClick:P,onKeyDown:L,onKeyUp:R},Y=(0,a.Z)((0,a.Z)({},t),{},{open:H,prefixCls:r,placement:d,autoFocus:p,keyboard:m,width:y,mask:b,maskClosable:E,inline:!1===w,afterOpenChange:function(t){var e,n;(F(t),null==M||M(t),t||!Z.current||null!==(e=V.current)&&void 0!==e&&e.contains(Z.current))||(null===(n=Z.current)||void 0===n||n.focus({preventScroll:!0}))},ref:V},X);return u.createElement(h.Provider,{value:W},u.createElement(s.Z,{open:H||S||B,autoDestroy:!1,getContainer:w,autoLock:b&&(H||B)},u.createElement(T,Y)))},M=n(62892),C=n(36355),A=n(32441),O=n(47729);var N=t=>{const{prefixCls:e,title:n,footer:i,extra:a,closeIcon:o,closable:s,onClose:l,headerStyle:c,drawerStyle:h,bodyStyle:d,footerStyle:f,children:p}=t,g=u.useCallback((t=>u.createElement("button",{type:"button",onClick:l,"aria-label":"Close",className:`${e}-close`},t)),[l]),[m,v]=(0,O.Z)(s,o,g,void 0,!0),y=u.useMemo((()=>n||m?u.createElement("div",{style:c,className:r()(`${e}-header`,{[`${e}-header-close-only`]:m&&!n&&!a})},u.createElement("div",{className:`${e}-header-title`},v,n&&u.createElement("div",{className:`${e}-title`},n)),a&&u.createElement("div",{className:`${e}-extra`},a)):null),[m,v,a,c,e,n]),x=u.useMemo((()=>{if(!i)return null;const t=`${e}-footer`;return u.createElement("div",{className:t,style:f},i)}),[i,f,e]);return u.createElement("div",{className:`${e}-wrapper-body`,style:h},y,u.createElement("div",{className:`${e}-body`,style:d},p),x)},P=n(33234),L=n(83116),R=n(37613);var D=t=>{const{componentCls:e,motionDurationSlow:n}=t,i={"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${n}`}}};return{[e]:{[`${e}-mask-motion`]:{"&-enter, &-appear, &-leave":{"&-active":{transition:`all ${n}`}},"&-enter, &-appear":{opacity:0,"&-active":{opacity:1}},"&-leave":{opacity:1,"&-active":{opacity:0}}},[`${e}-panel-motion`]:{"&-left":[i,{"&-enter, &-appear":{"&-start":{transform:"translateX(-100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(-100%)"}}}],"&-right":[i,{"&-enter, &-appear":{"&-start":{transform:"translateX(100%) !important"},"&-active":{transform:"translateX(0)"}},"&-leave":{transform:"translateX(0)","&-active":{transform:"translateX(100%)"}}}],"&-top":[i,{"&-enter, &-appear":{"&-start":{transform:"translateY(-100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(-100%)"}}}],"&-bottom":[i,{"&-enter, &-appear":{"&-start":{transform:"translateY(100%) !important"},"&-active":{transform:"translateY(0)"}},"&-leave":{transform:"translateY(0)","&-active":{transform:"translateY(100%)"}}}]}}}};const k=t=>{const{componentCls:e,zIndexPopup:n,colorBgMask:i,colorBgElevated:r,motionDurationSlow:a,motionDurationMid:o,padding:s,paddingLG:l,fontSizeLG:u,lineHeightLG:c,lineWidth:h,lineType:d,colorSplit:f,marginSM:p,colorIcon:g,colorIconHover:m,colorText:v,fontWeightStrong:y,footerPaddingBlock:x,footerPaddingInline:b}=t,_=`${e}-content-wrapper`;return{[e]:{position:"fixed",inset:0,zIndex:n,pointerEvents:"none","&-pure":{position:"relative",background:r,[`&${e}-left`]:{boxShadow:t.boxShadowDrawerLeft},[`&${e}-right`]:{boxShadow:t.boxShadowDrawerRight},[`&${e}-top`]:{boxShadow:t.boxShadowDrawerUp},[`&${e}-bottom`]:{boxShadow:t.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${e}-mask`]:{position:"absolute",inset:0,zIndex:n,background:i,pointerEvents:"auto"},[_]:{position:"absolute",zIndex:n,maxWidth:"100vw",transition:`all ${a}`,"&-hidden":{display:"none"}},[`&-left > ${_}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:t.boxShadowDrawerLeft},[`&-right > ${_}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:t.boxShadowDrawerRight},[`&-top > ${_}`]:{top:0,insetInline:0,boxShadow:t.boxShadowDrawerUp},[`&-bottom > ${_}`]:{bottom:0,insetInline:0,boxShadow:t.boxShadowDrawerDown},[`${e}-content`]:{width:"100%",height:"100%",overflow:"auto",background:r,pointerEvents:"auto"},[`${e}-wrapper-body`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%"},[`${e}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${s}px ${l}px`,fontSize:u,lineHeight:c,borderBottom:`${h}px ${d} ${f}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${e}-extra`]:{flex:"none"},[`${e}-close`]:{display:"inline-block",marginInlineEnd:p,color:g,fontWeight:y,fontSize:u,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,outline:0,cursor:"pointer",transition:`color ${o}`,textRendering:"auto","&:focus, &:hover":{color:m,textDecoration:"none"}},[`${e}-title`]:{flex:1,margin:0,color:v,fontWeight:t.fontWeightStrong,fontSize:u,lineHeight:c},[`${e}-body`]:{flex:1,minWidth:0,minHeight:0,padding:l,overflow:"auto"},[`${e}-footer`]:{flexShrink:0,padding:`${x}px ${b}px`,borderTop:`${h}px ${d} ${f}`},"&-rtl":{direction:"rtl"}}}};var I=(0,L.Z)("Drawer",(t=>{const e=(0,R.TS)(t,{});return[k(e),D(e)]}),(t=>({zIndexPopup:t.zIndexPopupBase,footerPaddingBlock:t.paddingXS,footerPaddingInline:t.padding}))),B=n(11575),F=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r{const{rootClassName:e,width:n,height:i,size:a="default",mask:o=!0,push:s=z,open:l,afterOpenChange:c,onClose:h,prefixCls:d,getContainer:f,style:p,className:g,visible:m,afterVisibleChange:v}=t,y=F(t,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange"]),{getPopupContainer:x,getPrefixCls:b,direction:_,drawer:E}=u.useContext(C.E_),w=b("drawer",d),[T,O]=I(w),L=void 0===f&&x?()=>x(document.body):f,R=r()({"no-mask":!o,[`${w}-rtl`]:"rtl"===_},e,O);const D=u.useMemo((()=>null!=n?n:"large"===a?736:378),[n,a]),k=u.useMemo((()=>null!=i?i:"large"===a?736:378),[i,a]),G={motionName:(0,M.m)(w,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},j=(0,B.H)();return T(u.createElement(P.BR,null,u.createElement(A.Ux,{status:!0,override:!0},u.createElement(S,Object.assign({prefixCls:w,onClose:h,maskMotion:G,motion:t=>({motionName:(0,M.m)(w,`panel-motion-${t}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},y,{open:null!=l?l:m,mask:o,push:s,width:D,height:k,style:Object.assign(Object.assign({},null==E?void 0:E.style),p),className:r()(null==E?void 0:E.className,g),rootClassName:R,getContainer:L,afterOpenChange:null!=c?c:v,panelRef:j}),u.createElement(N,Object.assign({prefixCls:w},y,{onClose:h}))))))};G._InternalPanelDoNotUseOrYouWillBeFired=t=>{const{prefixCls:e,style:n,className:i,placement:a="right"}=t,o=F(t,["prefixCls","style","className","placement"]),{getPrefixCls:s}=u.useContext(C.E_),l=s("drawer",e),[c,h]=I(l),d=r()(l,`${l}-pure`,`${l}-${a}`,h,i);return c(u.createElement("div",{className:d,style:n},u.createElement(N,Object.assign({prefixCls:l},o))))};var j=G},45411:function(t){"use strict";t.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(t,e,n){var i=n(45411),r=n(75029),a=Object.hasOwnProperty,o=Object.create(null);for(var s in i)a.call(i,s)&&(o[i[s]]=s);var l=t.exports={to:{},get:{}};function u(t,e,n){return Math.min(Math.max(e,t),n)}function c(t){var e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}l.get=function(t){var e,n;switch(t.substring(0,3).toLowerCase()){case"hsl":e=l.get.hsl(t),n="hsl";break;case"hwb":e=l.get.hwb(t),n="hwb";break;default:e=l.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},l.get.rgb=function(t){if(!t)return null;var e,n,r,o=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){var s=2*n;o[n]=parseInt(e.slice(s,s+2),16)}r&&(o[3]=parseInt(r,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(r=(e=e[1])[3],n=0;n<3;n++)o[n]=parseInt(e[n]+e[n],16);r&&(o[3]=parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)o[n]=parseInt(e[n+1],0);e[4]&&(e[5]?o[3]=.01*parseFloat(e[4]):o[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:a.call(i,e[1])?((o=i[e[1]])[3]=1,o):null:null;for(n=0;n<3;n++)o[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?o[3]=.01*parseFloat(e[4]):o[3]=parseFloat(e[4]))}for(n=0;n<3;n++)o[n]=u(o[n],0,255);return o[3]=u(o[3],0,1),o},l.get.hsl=function(t){if(!t)return null;var e=t.match(/^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*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.get.hwb=function(t){if(!t)return null;var e=t.match(/^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*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,u(parseFloat(e[2]),0,100),u(parseFloat(e[3]),0,100),u(isNaN(n)?1:n,0,1)]}return null},l.to.hex=function(){var t=r(arguments);return"#"+c(t[0])+c(t[1])+c(t[2])+(t[3]<1?c(Math.round(255*t[3])):"")},l.to.rgb=function(){var t=r(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},l.to.rgb.percent=function(){var t=r(arguments),e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),i=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+i+"%)":"rgba("+e+"%, "+n+"%, "+i+"%, "+t[3]+")"},l.to.hsl=function(){var t=r(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},l.to.hwb=function(){var t=r(arguments),e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},l.to.keyword=function(t){return o[t.slice(0,3)]}},97774:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=Object.assign||function(t){for(var e=1;e0&&(r=1/Math.sqrt(r),t[0]=e[0]*r,t[1]=e[1]*r),t},s.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},s.cross=function(t,e,n){var i=e[0]*n[1]-e[1]*n[0];return t[0]=t[1]=0,t[2]=i,t},s.lerp=function(t,e,n,i){var r=e[0],a=e[1];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t},s.random=function(t,e){e=e||1;var n=2*i()*Math.PI;return t[0]=Math.cos(n)*e,t[1]=Math.sin(n)*e,t},s.transformMat2=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r,t[1]=n[1]*i+n[3]*r,t},s.transformMat2d=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},s.transformMat3=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[3]*r+n[6],t[1]=n[1]*i+n[4]*r+n[7],t},s.transformMat4=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[4]*r+n[12],t[1]=n[1]*i+n[5]*r+n[13],t},s.forEach=(o=s.create(),function(t,e,n,i,r,a){var s,l;for(e||(e=2),n||(n=0),l=i?Math.min(i*e+n,t.length):t.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},l.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},l.cross=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2];return t[0]=r*l-a*s,t[1]=a*o-i*l,t[2]=i*s-r*o,t},l.lerp=function(t,e,n,i){var r=e[0],a=e[1],o=e[2];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t[2]=o+i*(n[2]-o),t},l.random=function(t,e){e=e||1;var n=2*i()*Math.PI,r=2*i()-1,a=Math.sqrt(1-r*r)*e;return t[0]=Math.cos(n)*a,t[1]=Math.sin(n)*a,t[2]=r*e,t},l.transformMat4=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[3]*i+n[7]*r+n[11]*a+n[15];return o=o||1,t[0]=(n[0]*i+n[4]*r+n[8]*a+n[12])/o,t[1]=(n[1]*i+n[5]*r+n[9]*a+n[13])/o,t[2]=(n[2]*i+n[6]*r+n[10]*a+n[14])/o,t},l.transformMat3=function(t,e,n){var i=e[0],r=e[1],a=e[2];return t[0]=i*n[0]+r*n[3]+a*n[6],t[1]=i*n[1]+r*n[4]+a*n[7],t[2]=i*n[2]+r*n[5]+a*n[8],t},l.transformQuat=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2],u=n[3],c=u*i+s*a-l*r,h=u*r+l*i-o*a,d=u*a+o*r-s*i,f=-o*i-s*r-l*a;return t[0]=c*u+f*-o+h*-l-d*-s,t[1]=h*u+f*-s+d*-o-c*-l,t[2]=d*u+f*-l+c*-s-h*-o,t},l.rotateX=function(t,e,n,i){var r=[],a=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],a[0]=r[0],a[1]=r[1]*Math.cos(i)-r[2]*Math.sin(i),a[2]=r[1]*Math.sin(i)+r[2]*Math.cos(i),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},l.rotateY=function(t,e,n,i){var r=[],a=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],a[0]=r[2]*Math.sin(i)+r[0]*Math.cos(i),a[1]=r[1],a[2]=r[2]*Math.cos(i)-r[0]*Math.sin(i),t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},l.rotateZ=function(t,e,n,i){var r=[],a=[];return r[0]=e[0]-n[0],r[1]=e[1]-n[1],r[2]=e[2]-n[2],a[0]=r[0]*Math.cos(i)-r[1]*Math.sin(i),a[1]=r[0]*Math.sin(i)+r[1]*Math.cos(i),a[2]=r[2],t[0]=a[0]+n[0],t[1]=a[1]+n[1],t[2]=a[2]+n[2],t},l.forEach=function(){var t=l.create();return function(e,n,i,r,a,o){var s,l;for(n||(n=3),i||(i=0),l=r?Math.min(r*n+i,e.length):e.length,s=i;s1?0:Math.acos(r)},l.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},void 0!==t&&(t.vec3=l);var u={create:function(){var t=new n(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},clone:function(t){var e=new n(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},fromValues:function(t,e,i,r){var a=new n(4);return a[0]=t,a[1]=e,a[2]=i,a[3]=r,a},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},set:function(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t},subtract:function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t}};u.sub=u.subtract,u.multiply=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t[2]=e[2]*n[2],t[3]=e[3]*n[3],t},u.mul=u.multiply,u.divide=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t[2]=e[2]/n[2],t[3]=e[3]/n[3],t},u.div=u.divide,u.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t[3]=Math.min(e[3],n[3]),t},u.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t[2]=Math.max(e[2],n[2]),t[3]=Math.max(e[3],n[3]),t},u.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t},u.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t[2]=e[2]+n[2]*i,t[3]=e[3]+n[3]*i,t},u.distance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(n*n+i*i+r*r+a*a)},u.dist=u.distance,u.squaredDistance=function(t,e){var n=e[0]-t[0],i=e[1]-t[1],r=e[2]-t[2],a=e[3]-t[3];return n*n+i*i+r*r+a*a},u.sqrDist=u.squaredDistance,u.length=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return Math.sqrt(e*e+n*n+i*i+r*r)},u.len=u.length,u.squaredLength=function(t){var e=t[0],n=t[1],i=t[2],r=t[3];return e*e+n*n+i*i+r*r},u.sqrLen=u.squaredLength,u.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},u.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t},u.normalize=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a;return o>0&&(o=1/Math.sqrt(o),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t[3]=e[3]*o),t},u.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},u.lerp=function(t,e,n,i){var r=e[0],a=e[1],o=e[2],s=e[3];return t[0]=r+i*(n[0]-r),t[1]=a+i*(n[1]-a),t[2]=o+i*(n[2]-o),t[3]=s+i*(n[3]-s),t},u.random=function(t,e){return e=e||1,t[0]=i(),t[1]=i(),t[2]=i(),t[3]=i(),u.normalize(t,t),u.scale(t,t,e),t},u.transformMat4=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3];return t[0]=n[0]*i+n[4]*r+n[8]*a+n[12]*o,t[1]=n[1]*i+n[5]*r+n[9]*a+n[13]*o,t[2]=n[2]*i+n[6]*r+n[10]*a+n[14]*o,t[3]=n[3]*i+n[7]*r+n[11]*a+n[15]*o,t},u.transformQuat=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=n[0],s=n[1],l=n[2],u=n[3],c=u*i+s*a-l*r,h=u*r+l*i-o*a,d=u*a+o*r-s*i,f=-o*i-s*r-l*a;return t[0]=c*u+f*-o+h*-l-d*-s,t[1]=h*u+f*-s+d*-o-c*-l,t[2]=d*u+f*-l+c*-s-h*-o,t},u.forEach=function(){var t=u.create();return function(e,n,i,r,a,o){var s,l;for(n||(n=4),i||(i=0),l=r?Math.min(r*n+i,e.length):e.length,s=i;s.999999?(t[0]=0,t[1]=0,t[2]=0,t[3]=1,t):(l.cross(p,e,n),t[0]=p[0],t[1]=p[1],t[2]=p[2],t[3]=1+i,y.normalize(t,t))}),y.setAxes=(v=d.create(),function(t,e,n,i){return v[0]=n[0],v[3]=n[1],v[6]=n[2],v[1]=i[0],v[4]=i[1],v[7]=i[2],v[2]=-e[0],v[5]=-e[1],v[8]=-e[2],y.normalize(t,y.fromMat3(t,v))}),y.clone=u.clone,y.fromValues=u.fromValues,y.copy=u.copy,y.set=u.set,y.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},y.setAxisAngle=function(t,e,n){n*=.5;var i=Math.sin(n);return t[0]=i*e[0],t[1]=i*e[1],t[2]=i*e[2],t[3]=Math.cos(n),t},y.add=u.add,y.multiply=function(t,e,n){var i=e[0],r=e[1],a=e[2],o=e[3],s=n[0],l=n[1],u=n[2],c=n[3];return t[0]=i*c+o*s+r*u-a*l,t[1]=r*c+o*l+a*s-i*u,t[2]=a*c+o*u+i*l-r*s,t[3]=o*c-i*s-r*l-a*u,t},y.mul=y.multiply,y.scale=u.scale,y.rotateX=function(t,e,n){n*=.5;var i=e[0],r=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l+o*s,t[1]=r*l+a*s,t[2]=a*l-r*s,t[3]=o*l-i*s,t},y.rotateY=function(t,e,n){n*=.5;var i=e[0],r=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l-a*s,t[1]=r*l+o*s,t[2]=a*l+i*s,t[3]=o*l-r*s,t},y.rotateZ=function(t,e,n){n*=.5;var i=e[0],r=e[1],a=e[2],o=e[3],s=Math.sin(n),l=Math.cos(n);return t[0]=i*l+r*s,t[1]=r*l-i*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},y.calculateW=function(t,e){var n=e[0],i=e[1],r=e[2];return t[0]=n,t[1]=i,t[2]=r,t[3]=Math.sqrt(Math.abs(1-n*n-i*i-r*r)),t},y.dot=u.dot,y.lerp=u.lerp,y.slerp=function(t,e,n,i){var r,a,o,s,l,u=e[0],c=e[1],h=e[2],d=e[3],f=n[0],p=n[1],g=n[2],m=n[3];return(a=u*f+c*p+h*g+d*m)<0&&(a=-a,f=-f,p=-p,g=-g,m=-m),1-a>1e-6?(r=Math.acos(a),o=Math.sin(r),s=Math.sin((1-i)*r)/o,l=Math.sin(i*r)/o):(s=1-i,l=i),t[0]=s*u+l*f,t[1]=s*c+l*p,t[2]=s*h+l*g,t[3]=s*d+l*m,t},y.invert=function(t,e){var n=e[0],i=e[1],r=e[2],a=e[3],o=n*n+i*i+r*r+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-i*s,t[2]=-r*s,t[3]=a*s,t},y.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},y.length=u.length,y.len=y.length,y.squaredLength=u.squaredLength,y.sqrLen=y.squaredLength,y.normalize=u.normalize,y.fromMat3=function(t,e){var n,i=e[0]+e[4]+e[8];if(i>0)n=Math.sqrt(i+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var a=(r+1)%3,o=(r+2)%3;n=Math.sqrt(e[3*r+r]-e[3*a+a]-e[3*o+o]+1),t[r]=.5*n,n=.5/n,t[3]=(e[3*a+o]-e[3*o+a])*n,t[a]=(e[3*a+r]+e[3*r+a])*n,t[o]=(e[3*o+r]+e[3*r+o])*n}return t},y.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},void 0!==t&&(t.quat=y)}(n.exports)}()},function(t,e,n){"use strict";var i=n(24),r=n(46),a=n(5),o=n(6),s=n(7),l=n(17),u=n(28),c=n(13),h=n(0),d=n.n(h),f=n(29),p=n(53),g=n.n(p),m=n(54),v=n(106),y=n(107),x=n(113),b=n(114),_=n(3),E=n(68),w=n(37),T=n(69),S=n(116),M=n(70),C=n(71),A=n(72),O=n(36),N=n(30),P=n(23),L=n(4),R=n(117),D=n(50),k=n(118),I=n(119),B=n(120),F=n(9),z=n(67),G=n(49),j=n(15),U=n(52),H=n(121),V=n(126),Z=n(63),W=n(127),X=n(128),Y=n(129),q=n(130),$=n(131),K=n(132);function Q(t){return t instanceof HTMLCanvasElement||t instanceof HTMLImageElement||t instanceof Image}d.a.util.extend(u.a.prototype,H.a),s.a.import(V.a),s.a.import(Z.a),s.a.import(W.a),s.a.import(X.a),s.a.import(Y.a),s.a.import(q.a),s.a.import($.a),s.a.import(K.a);var J=f.a.prototype.addToScene,tt=f.a.prototype.removeFromScene;f.a.prototype.addToScene=function(t){if(J.call(this,t),this.__zr){var e=this.__zr;t.traverse((function(t){t.__zr=e,t.addAnimatorsToZr&&t.addAnimatorsToZr(e)}))}},f.a.prototype.removeFromScene=function(t){tt.call(this,t),t.traverse((function(t){var e=t.__zr;t.__zr=null,e&&t.removeAnimatorsFromZr&&t.removeAnimatorsFromZr(e)}))},l.a.prototype.setTextureImage=function(t,e,n,i){if(this.shader){var r,a,o=n.getZr(),s=this;return s.autoUpdateTextureStatus=!1,s.disableTexture(t),(a=e)&&"none"!==a&&(r=et.loadTexture(e,n,i,(function(e){s.enableTexture(t),o&&o.refresh()})),s.set(t,r)),r}};var et={};et.Renderer=r.a,et.Node=u.a,et.Mesh=i.a,et.Shader=s.a,et.Material=l.a,et.Texture=o.a,et.Texture2D=a.a,et.Geometry=c.a,et.SphereGeometry=E.a,et.PlaneGeometry=w.a,et.CubeGeometry=T.a,et.AmbientLight=S.a,et.DirectionalLight=M.a,et.PointLight=C.a,et.SpotLight=A.a,et.PerspectiveCamera=O.a,et.OrthographicCamera=N.a,et.Vector2=P.a,et.Vector3=L.a,et.Vector4=R.a,et.Quaternion=D.a,et.Matrix2=k.a,et.Matrix2d=I.a,et.Matrix3=B.a,et.Matrix4=F.a,et.Plane=z.a,et.Ray=G.a,et.BoundingBox=j.a,et.Frustum=U.a;var nt=m.a.createBlank("rgba(255,255,255,0)").image;function it(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}function rt(t){if((t.wrapS===o.a.REPEAT||t.wrapT===o.a.REPEAT)&&t.image){var e=it(t.width),n=it(t.height);if(e!==t.width||n!==t.height){var i=document.createElement("canvas");i.width=e,i.height=n,i.getContext("2d").drawImage(t.image,0,0,e,n),t.image=i}}}et.loadTexture=function(t,e,n,i){"function"==typeof n&&(i=n,n={}),n=n||{};for(var r=Object.keys(n).sort(),a="",o=0;o3?e[3]=t[3]:e[3]=1,e):((e=d.a.color.parse(t||"#000",e)||[0,0,0,0])[0]/=255,e[1]/=255,e[2]/=255,e)},et.directionFromAlphaBeta=function(t,e){var n=t/180*Math.PI+Math.PI/2,i=-e/180*Math.PI+Math.PI/2,r=[],a=Math.sin(n);return r[0]=a*Math.cos(i),r[1]=-Math.cos(n),r[2]=a*Math.sin(i),r},et.getShadowResolution=function(t){var e=1024;switch(t){case"low":e=512;break;case"medium":break;case"high":e=2048;break;case"ultra":e=4096}return e},et.COMMON_SHADERS=["lambert","color","realistic","hatching"],et.createShader=function(t){var e=s.a.source(t+".vertex"),n=s.a.source(t+".fragment");e||console.error("Vertex shader of '%s' not exits",t),n||console.error("Fragment shader of '%s' not exits",t);var i=new s.a(e,n);return i.name=t,i},et.createMaterial=function(t,e){e instanceof Array||(e=[e]);var n=et.createShader(t),i=new l.a({shader:n});return e.forEach((function(t){"string"==typeof t&&i.define(t)})),i},et.setMaterialFromModel=function(t,e,n,i){e.autoUpdateTextureStatus=!1;var r=n.getModel(t+"Material"),a=r.get("detailTexture"),o=_.a.firstNotNull(r.get("textureTiling"),1),s=_.a.firstNotNull(r.get("textureOffset"),0);"number"==typeof o&&(o=[o,o]),"number"==typeof s&&(s=[s,s]);var l=o[0]>1||o[1]>1?et.Texture.REPEAT:et.Texture.CLAMP_TO_EDGE,u={anisotropic:8,wrapS:l,wrapT:l};if("realistic"===t){var c=r.get("roughness"),h=r.get("metalness");null!=h?isNaN(h)&&(e.setTextureImage("metalnessMap",h,i,u),h=_.a.firstNotNull(r.get("metalnessAdjust"),.5)):h=0,null!=c?isNaN(c)&&(e.setTextureImage("roughnessMap",c,i,u),c=_.a.firstNotNull(r.get("roughnessAdjust"),.5)):c=.5;var d=r.get("normalTexture");e.setTextureImage("detailMap",a,i,u),e.setTextureImage("normalMap",d,i,u),e.set({roughness:c,metalness:h,detailUvRepeat:o,detailUvOffset:s})}else if("lambert"===t)e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if("color"===t)e.setTextureImage("detailMap",a,i,u),e.set({detailUvRepeat:o,detailUvOffset:s});else if("hatching"===t){var f=r.get("hatchingTextures")||[];f.length<6&&console.error("Invalid hatchingTextures.");for(var p=0;p<6;p++)e.setTextureImage("hatch"+(p+1),f[p],i,{anisotropic:8,wrapS:et.Texture.REPEAT,wrapT:et.Texture.REPEAT});e.set({detailUvRepeat:o,detailUvOffset:s})}},et.updateVertexAnimation=function(t,e,n,i){var r=i.get("animation"),a=i.get("animationDurationUpdate"),o=i.get("animationEasingUpdate"),s=n.shadowDepthMaterial;if(r&&e&&a>0&&e.geometry.vertexCount===n.geometry.vertexCount){n.material.define("vertex","VERTEX_ANIMATION"),n.ignorePreZ=!0,s&&s.define("vertex","VERTEX_ANIMATION");for(var l=0;ln?n:t}a.add=function(t,e,n){return r.add(t.array,e.array,n.array),t._dirty=!0,t},a.set=function(t,e,n,i){r.set(t.array,e,n,i),t._dirty=!0},a.copy=function(t,e){return r.copy(t.array,e.array),t._dirty=!0,t},a.cross=function(t,e,n){return r.cross(t.array,e.array,n.array),t._dirty=!0,t},a.distance=a.dist=function(t,e){return r.distance(t.array,e.array)},a.divide=a.div=function(t,e,n){return r.divide(t.array,e.array,n.array),t._dirty=!0,t},a.dot=function(t,e){return r.dot(t.array,e.array)},a.len=function(t){return r.length(t.array)},a.lerp=function(t,e,n,i){return r.lerp(t.array,e.array,n.array,i),t._dirty=!0,t},a.min=function(t,e,n){return r.min(t.array,e.array,n.array),t._dirty=!0,t},a.max=function(t,e,n){return r.max(t.array,e.array,n.array),t._dirty=!0,t},a.multiply=a.mul=function(t,e,n){return r.multiply(t.array,e.array,n.array),t._dirty=!0,t},a.negate=function(t,e){return r.negate(t.array,e.array),t._dirty=!0,t},a.normalize=function(t,e){return r.normalize(t.array,e.array),t._dirty=!0,t},a.random=function(t,e){return r.random(t.array,e),t._dirty=!0,t},a.scale=function(t,e,n){return r.scale(t.array,e.array,n),t._dirty=!0,t},a.scaleAndAdd=function(t,e,n,i){return r.scaleAndAdd(t.array,e.array,n.array,i),t._dirty=!0,t},a.squaredDistance=a.sqrDist=function(t,e){return r.sqrDist(t.array,e.array)},a.squaredLength=a.sqrLen=function(t){return r.sqrLen(t.array)},a.subtract=a.sub=function(t,e,n){return r.subtract(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat3=function(t,e,n){return r.transformMat3(t.array,e.array,n.array),t._dirty=!0,t},a.transformMat4=function(t,e,n){return r.transformMat4(t.array,e.array,n.array),t._dirty=!0,t},a.transformQuat=function(t,e,n){return r.transformQuat(t.array,e.array,n.array),t._dirty=!0,t};var u=Math.atan2,c=Math.asin,h=Math.abs;a.eulerFromQuat=function(t,e,n){t._dirty=!0,e=e.array;var i=t.array,r=e[0],a=e[1],o=e[2],s=e[3],h=r*r,d=a*a,f=o*o,p=s*s;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":i[0]=u(2*(r*s-a*o),p-h-d+f),i[1]=c(l(2*(r*o+a*s),-1,1)),i[2]=u(2*(o*s-r*a),p+h-d-f);break;case"YXZ":i[0]=c(l(2*(r*s-a*o),-1,1)),i[1]=u(2*(r*o+a*s),p-h-d+f),i[2]=u(2*(r*a+o*s),p-h+d-f);break;case"ZXY":i[0]=c(l(2*(r*s+a*o),-1,1)),i[1]=u(2*(a*s-o*r),p-h-d+f),i[2]=u(2*(o*s-r*a),p-h+d-f);break;case"ZYX":i[0]=u(2*(r*s+o*a),p-h-d+f),i[1]=c(l(2*(a*s-r*o),-1,1)),i[2]=u(2*(r*a+o*s),p+h-d-f);break;case"YZX":i[0]=u(2*(r*s-o*a),p-h+d-f),i[1]=u(2*(a*s-r*o),p+h-d-f),i[2]=c(l(2*(r*a+o*s),-1,1));break;case"XZY":i[0]=u(2*(r*s+a*o),p-h+d-f),i[1]=u(2*(r*o+a*s),p+h-d-f),i[2]=c(l(2*(o*s-r*a),-1,1));break;default:console.warn("Unkown order: "+n)}return t},a.eulerFromMat3=function(t,e,n){var i=e.array,r=i[0],a=i[3],o=i[6],s=i[1],d=i[4],f=i[7],p=i[2],g=i[5],m=i[8],v=t.array;switch(n=(n||"XYZ").toUpperCase()){case"XYZ":v[1]=c(l(o,-1,1)),h(o)<.99999?(v[0]=u(-f,m),v[2]=u(-a,r)):(v[0]=u(g,d),v[2]=0);break;case"YXZ":v[0]=c(-l(f,-1,1)),h(f)<.99999?(v[1]=u(o,m),v[2]=u(s,d)):(v[1]=u(-p,r),v[2]=0);break;case"ZXY":v[0]=c(l(g,-1,1)),h(g)<.99999?(v[1]=u(-p,m),v[2]=u(-a,d)):(v[1]=0,v[2]=u(s,r));break;case"ZYX":v[1]=c(-l(p,-1,1)),h(p)<.99999?(v[0]=u(g,m),v[2]=u(s,r)):(v[0]=0,v[2]=u(-a,d));break;case"YZX":v[2]=c(l(s,-1,1)),h(s)<.99999?(v[0]=u(-f,d),v[1]=u(-p,r)):(v[0]=0,v[1]=u(o,m));break;case"XZY":v[2]=c(-l(a,-1,1)),h(a)<.99999?(v[0]=u(g,d),v[1]=u(o,r)):(v[0]=u(-f,m),v[1]=0);break;default:console.warn("Unkown order: "+n)}return t._dirty=!0,t},a.POSITIVE_X=new a(1,0,0),a.NEGATIVE_X=new a(-1,0,0),a.POSITIVE_Y=new a(0,1,0),a.NEGATIVE_Y=new a(0,-1,0),a.POSITIVE_Z=new a(0,0,1),a.NEGATIVE_Z=new a(0,0,-1),a.UP=new a(0,1,0),a.ZERO=new a(0,0,0),e.a=a},function(t,e,n){"use strict";var i=n(6),r=n(11),a=n(66).a.isPowerOfTwo,o=i.a.extend((function(){return{image:null,pixels:null,mipmaps:[]}}),{update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,i=this.type;e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var a=t.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_2D,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i&&(t.getGLExtension("OES_texture_half_float")||(i=r.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l=i.a.COMPRESSED_RGB_S3TC_DXT1_EXT?t.compressedTexImage2D(t.TEXTURE_2D,n,o,r,a,0,e.pixels):t.texImage2D(t.TEXTURE_2D,n,o,r,a,0,o,s,e.pixels)},generateMipmap:function(t){var e=t.gl;this.useMipmap&&!this.NPOT&&(e.bindTexture(e.TEXTURE_2D,this._cache.get("webgl_texture")),e.generateMipmap(e.TEXTURE_2D))},isPowerOfTwo:function(){var t,e;return this.image?(t=this.image.width,e=this.image.height):(t=this.width,e=this.height),a(t)&&a(e)},isRenderable:function(){return this.image?"CANVAS"===this.image.nodeName||"VIDEO"===this.image.nodeName||this.image.complete:!(!this.width||!this.height)},bind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,this.getWebGLTexture(t))},unbind:function(t){t.gl.bindTexture(t.gl.TEXTURE_2D,null)},load:function(t,e){var n=new Image;e&&(n.crossOrigin=e);var i=this;return n.onload=function(){i.dirty(),i.trigger("success",i),n.onload=null},n.onerror=function(){i.trigger("error",i),n.onerror=null},n.src=t,this.image=n,this}});Object.defineProperty(o.prototype,"width",{get:function(){return this.image?this.image.width:this._width},set:function(t){this.image?console.warn("Texture from image can't set width"):(this._width!==t&&this.dirty(),this._width=t)}}),Object.defineProperty(o.prototype,"height",{get:function(){return this.image?this.image.height:this._height},set:function(t){this.image?console.warn("Texture from image can't set height"):(this._height!==t&&this.dirty(),this._height=t)}}),e.a=o},function(t,e,n){"use strict";var i=n(8),r=n(11),a=n(48),o=i.a.extend({width:512,height:512,type:r.a.UNSIGNED_BYTE,format:r.a.RGBA,wrapS:r.a.REPEAT,wrapT:r.a.REPEAT,minFilter:r.a.LINEAR_MIPMAP_LINEAR,magFilter:r.a.LINEAR,useMipmap:!0,anisotropic:1,flipY:!0,sRGB:!0,unpackAlignment:4,premultiplyAlpha:!1,dynamic:!1,NPOT:!1},(function(){this._cache=new a.a}),{getWebGLTexture:function(t){var e=t.gl,n=this._cache;return n.use(t.__uid__),n.miss("webgl_texture")&&n.put("webgl_texture",e.createTexture()),this.dynamic?this.update(t):n.isDirty()&&(this.update(t),n.fresh()),n.get("webgl_texture")},bind:function(){},unbind:function(){},dirty:function(){this._cache&&this._cache.dirtyAll()},update:function(t){},updateCommon:function(t){var e=t.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,this.flipY),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this.premultiplyAlpha),e.pixelStorei(e.UNPACK_ALIGNMENT,this.unpackAlignment),this.format===r.a.DEPTH_COMPONENT&&(this.useMipmap=!1);var n=t.getGLExtension("EXT_sRGB");this.format!==o.SRGB||n||(this.format=o.RGB),this.format!==o.SRGB_ALPHA||n||(this.format=o.RGBA),this.NPOT=!this.isPowerOfTwo()},getAvailableWrapS:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapS},getAvailableWrapT:function(){return this.NPOT?r.a.CLAMP_TO_EDGE:this.wrapT},getAvailableMinFilter:function(){var t=this.minFilter;return this.NPOT||!this.useMipmap?t==r.a.NEAREST_MIPMAP_NEAREST||t==r.a.NEAREST_MIPMAP_LINEAR?r.a.NEAREST:t==r.a.LINEAR_MIPMAP_LINEAR||t==r.a.LINEAR_MIPMAP_NEAREST?r.a.LINEAR:t:t},getAvailableMagFilter:function(){return this.magFilter},nextHighestPowerOfTwo:function(t){--t;for(var e=1;e<32;e<<=1)t|=t>>e;return t+1},dispose:function(t){var e=this._cache;e.use(t.__uid__);var n=e.get("webgl_texture");n&&t.gl.deleteTexture(n),e.deleteContext(t.__uid__)},isRenderable:function(){},isPowerOfTwo:function(){}});Object.defineProperty(o.prototype,"width",{get:function(){return this._width},set:function(t){this._width=t}}),Object.defineProperty(o.prototype,"height",{get:function(){return this._height},set:function(t){this._height=t}}),o.BYTE=r.a.BYTE,o.UNSIGNED_BYTE=r.a.UNSIGNED_BYTE,o.SHORT=r.a.SHORT,o.UNSIGNED_SHORT=r.a.UNSIGNED_SHORT,o.INT=r.a.INT,o.UNSIGNED_INT=r.a.UNSIGNED_INT,o.FLOAT=r.a.FLOAT,o.HALF_FLOAT=36193,o.UNSIGNED_INT_24_8_WEBGL=34042,o.DEPTH_COMPONENT=r.a.DEPTH_COMPONENT,o.DEPTH_STENCIL=r.a.DEPTH_STENCIL,o.ALPHA=r.a.ALPHA,o.RGB=r.a.RGB,o.RGBA=r.a.RGBA,o.LUMINANCE=r.a.LUMINANCE,o.LUMINANCE_ALPHA=r.a.LUMINANCE_ALPHA,o.SRGB=35904,o.SRGB_ALPHA=35906,o.COMPRESSED_RGB_S3TC_DXT1_EXT=33776,o.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777,o.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778,o.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779,o.NEAREST=r.a.NEAREST,o.LINEAR=r.a.LINEAR,o.NEAREST_MIPMAP_NEAREST=r.a.NEAREST_MIPMAP_NEAREST,o.LINEAR_MIPMAP_NEAREST=r.a.LINEAR_MIPMAP_NEAREST,o.NEAREST_MIPMAP_LINEAR=r.a.NEAREST_MIPMAP_LINEAR,o.LINEAR_MIPMAP_LINEAR=r.a.LINEAR_MIPMAP_LINEAR,o.REPEAT=r.a.REPEAT,o.CLAMP_TO_EDGE=r.a.CLAMP_TO_EDGE,o.MIRRORED_REPEAT=r.a.MIRRORED_REPEAT,e.a=o},function(t,e,n){"use strict";var i=n(21),r=n(18),a=n(1),o=n.n(a),s=o.a.mat2,l=o.a.mat3,u=o.a.mat4,c=/uniform\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\s+([\w\,]+)?(\[.*?\])?\s*(:\s*([\S\s]+?))?;/g,h=/attribute\s+(float|int|vec2|vec3|vec4)\s+(\w*)\s*(:\s*(\w+))?;/g,d=/#define\s+(\w+)?(\s+[\w-.]+)?\s*;?\s*\n/g,f={bool:"1i",int:"1i",sampler2D:"t",samplerCube:"t",float:"1f",vec2:"2f",vec3:"3f",vec4:"4f",ivec2:"2i",ivec3:"3i",ivec4:"4i",mat2:"m2",mat3:"m3",mat4:"m4"},p={bool:function(){return!0},int:function(){return 0},float:function(){return 0},sampler2D:function(){return null},samplerCube:function(){return null},vec2:function(){return[0,0]},vec3:function(){return[0,0,0]},vec4:function(){return[0,0,0,0]},ivec2:function(){return[0,0]},ivec3:function(){return[0,0,0]},ivec4:function(){return[0,0,0,0]},mat2:function(){return s.create()},mat3:function(){return l.create()},mat4:function(){return u.create()},array:function(){return[]}},g=["POSITION","NORMAL","BINORMAL","TANGENT","TEXCOORD","TEXCOORD_0","TEXCOORD_1","COLOR","JOINT","WEIGHT"],m=["SKIN_MATRIX","VIEWPORT_SIZE","VIEWPORT","DEVICEPIXELRATIO","WINDOW_SIZE","NEAR","FAR","TIME"],v=["WORLD","VIEW","PROJECTION","WORLDVIEW","VIEWPROJECTION","WORLDVIEWPROJECTION","WORLDINVERSE","VIEWINVERSE","PROJECTIONINVERSE","WORLDVIEWINVERSE","VIEWPROJECTIONINVERSE","WORLDVIEWPROJECTIONINVERSE","WORLDTRANSPOSE","VIEWTRANSPOSE","PROJECTIONTRANSPOSE","WORLDVIEWTRANSPOSE","VIEWPROJECTIONTRANSPOSE","WORLDVIEWPROJECTIONTRANSPOSE","WORLDINVERSETRANSPOSE","VIEWINVERSETRANSPOSE","PROJECTIONINVERSETRANSPOSE","WORLDVIEWINVERSETRANSPOSE","VIEWPROJECTIONINVERSETRANSPOSE","WORLDVIEWPROJECTIONINVERSETRANSPOSE"],y={},x={};function b(t,e){"object"==typeof t&&(e=t.fragment,t=t.vertex),this._shaderID=function(t,e){var n="vertex:"+t+"fragment:"+e;if(y[n])return y[n];var r=i.a.genGUID();return y[n]=r,x[r]={vertex:t,fragment:e},r}(t,e),this._vertexCode=b.parseImport(t),this._fragmentCode=b.parseImport(e),this.attributeSemantics={},this.matrixSemantics={},this.uniformSemantics={},this.matrixSemanticKeys=[],this.uniformTemplates={},this.attributes={},this.textures={},this.vertexDefines={},this.fragmentDefines={},this._parseAttributes(),this._parseUniforms(),this._parseDefines()}b.prototype={constructor:b,createUniforms:function(){var t={};for(var e in this.uniformTemplates){var n=this.uniformTemplates[e];t[e]={type:n.type,value:n.value()}}return t},_parseImport:function(){this._vertexCode=b.parseImport(this.vertex),this._fragmentCode=b.parseImport(this.fragment)},_parseUniforms:function(){var t={},e=this;function n(n,i,r,a,o,s){if(i&&r){var l,u=f[i],c=!0;if(u){if(e._uniformList.push(r),"sampler2D"!==i&&"samplerCube"!==i||(e.textures[r]={shaderType:"fragment",type:i}),a&&(u+="v"),s)if(g.indexOf(s)>=0)e.attributeSemantics[s]={symbol:r,type:u},c=!1;else if(v.indexOf(s)>=0){var h=!1,d=s;s.match(/TRANSPOSE$/)&&(h=!0,d=s.slice(0,-9)),e.matrixSemantics[s]={symbol:r,type:u,isTranspose:h,semanticNoTranspose:d},c=!1}else if(m.indexOf(s)>=0)e.uniformSemantics[s]={symbol:r,type:u},c=!1;else if("unconfigurable"===s)c=!1;else{if(!(l=e._parseDefaultValue(i,s)))throw new Error('Unkown semantic "'+s+'"');s=""}c&&(t[r]={type:u,value:a?p.array:l||p[i],semantic:s||null})}return["uniform",i,r,a].join(" ")+";\n"}}this._uniformList=[],this._vertexCode=this._vertexCode.replace(c,n),this._fragmentCode=this._fragmentCode.replace(c,n),e.matrixSemanticKeys=Object.keys(this.matrixSemantics),this.uniformTemplates=t},_parseDefaultValue:function(t,e){if("vec2"!==t&&"vec3"!==t&&"vec4"!==t)return"bool"===t?function(){return"true"===e.toLowerCase()}:"float"===t?function(){return parseFloat(e)}:"int"===t?function(){return parseInt(e)}:void 0;var n=/\[\s*(.*)\s*\]/.exec(e)[1];if(n){var i=n.split(/\s*,\s*/);return function(){return new r.a.Float32Array(i)}}},_parseAttributes:function(){var t={},e=this;this._vertexCode=this._vertexCode.replace(h,(function(n,i,r,a,o){if(i&&r){var s=1;switch(i){case"vec4":s=4;break;case"vec3":s=3;break;case"vec2":s=2;break;case"float":s=1}if(t[r]={type:"float",size:s,semantic:o||null},o){if(g.indexOf(o)<0)throw new Error('Unkown semantic "'+o+'"');e.attributeSemantics[o]={symbol:r,type:i}}}return["attribute",i,r].join(" ")+";\n"})),this.attributes=t},_parseDefines:function(){var t=this;function e(e,n,i){var r=t.fragmentDefines;return r[n]||(r[n]="false"!=i&&("true"==i||(i?isNaN(parseFloat(i))?i.trim():parseFloat(i):null))),""}this._vertexCode=this._vertexCode.replace(d,e),this._fragmentCode=this._fragmentCode.replace(d,e)},clone:function(){var t=x[this._shaderID];return new b(t.vertex,t.fragment)}},Object.defineProperty&&(Object.defineProperty(b.prototype,"shaderID",{get:function(){return this._shaderID}}),Object.defineProperty(b.prototype,"vertex",{get:function(){return this._vertexCode}}),Object.defineProperty(b.prototype,"fragment",{get:function(){return this._fragmentCode}}),Object.defineProperty(b.prototype,"uniforms",{get:function(){return this._uniformList}}));var _=/(@import)\s*([0-9a-zA-Z_\-\.]*)/g;b.parseImport=function(t){return t=t.replace(_,(function(t,e,n){return(t=b.source(n))?b.parseImport(t):(console.error('Shader chunk "'+n+'" not existed in library'),"")}))};var E=/(@export)\s*([0-9a-zA-Z_\-\.]*)\s*\n([\s\S]*?)@end/g;b.import=function(t){t.replace(E,(function(t,e,n,i){if(i=i.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+\x24)/g,"")){for(var r,a=n.split("."),o=b.codes,s=0;sa[0]&&(a[0]=s),l>a[1]&&(a[1]=l),h>a[2]&&(a[2]=h)}n._dirty=!0,i._dirty=!0}},dirty:function(){for(var t=this.getEnabledAttributes(),e=0;e=0){e||(e=d());var n=this.indices;return e[0]=n[3*t],e[1]=n[3*t+1],e[2]=n[3*t+2],e}},setTriangleIndices:function(t,e){var n=this.indices;n[3*t]=e[0],n[3*t+1]=e[1],n[3*t+2]=e[2]},isUseIndices:function(){return!!this.indices},initIndicesFromArray:function(t){var e,n=this.vertexCount>65535?o.a.Uint32Array:o.a.Uint16Array;if(t[0]&&t[0].length){var i=0;e=new n(3*t.length);for(var r=0;r=0&&(e.splice(n,1),delete this.attributes[t],!0)},getAttribute:function(t){return this.attributes[t]},getEnabledAttributes:function(){var t=this._enabledAttributes,e=this._attributeList;if(t)return t;for(var n=[],i=this.vertexCount,r=0;r65535&&(this.indices=new o.a.Uint32Array(this.indices));for(var t=this.attributes,e=this.indices,n=this.getEnabledAttributes(),i={},r=0;r=n.COLOR_ATTACHMENT0&&a<=n.COLOR_ATTACHMENT0+8&&r.push(a);i.drawBuffersEXT(r)}}this.trigger("beforerender",this,t);var o=this.clearDepth?n.DEPTH_BUFFER_BIT:0;if(n.depthMask(!0),this.clearColor){o|=n.COLOR_BUFFER_BIT,n.colorMask(!0,!0,!0,!0);var s=this.clearColor;Array.isArray(s)&&n.clearColor(s[0],s[1],s[2],s[3])}n.clear(o),this.blendWithPrevious?(n.enable(n.BLEND),this.material.transparent=!0):(n.disable(n.BLEND),this.material.transparent=!1),this.renderQuad(t),this.trigger("afterrender",this,t),e&&this.unbind(t,e)},renderQuad:function(t){d.material=this.material,t.renderPass([d],f)},dispose:function(t){}});e.a=p},function(t,e,n){"use strict";var i,r,a,o,s,l,u=n(4),c=n(1),h=n.n(c).a.vec3,d=h.copy,f=h.set,p=function(t,e){this.min=t||new u.a(1/0,1/0,1/0),this.max=e||new u.a(-1/0,-1/0,-1/0)};p.prototype={constructor:p,updateFromVertices:function(t){if(t.length>0){var e=this.min,n=this.max,i=e.array,r=n.array;d(i,t[0]),d(r,t[0]);for(var a=1;ar[0]&&(r[0]=o[0]),o[1]>r[1]&&(r[1]=o[1]),o[2]>r[2]&&(r[2]=o[2])}e._dirty=!0,n._dirty=!0}},union:function(t){var e=this.min,n=this.max;return h.min(e.array,e.array,t.min.array),h.max(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersection:function(t){var e=this.min,n=this.max;return h.max(e.array,e.array,t.min.array),h.min(n.array,n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},intersectBoundingBox:function(t){var e=this.min.array,n=this.max.array,i=t.min.array,r=t.max.array;return!(e[0]>r[0]||e[1]>r[1]||e[2]>r[2]||n[0]=r[0]&&n[1]>=r[1]&&n[2]>=r[2]},containPoint:function(t){var e=this.min.array,n=this.max.array,i=t.array;return e[0]<=i[0]&&e[1]<=i[1]&&e[2]<=i[2]&&n[0]>=i[0]&&n[1]>=i[1]&&n[2]>=i[2]},isFinite:function(){var t=this.min.array,e=this.max.array;return isFinite(t[0])&&isFinite(t[1])&&isFinite(t[2])&&isFinite(e[0])&&isFinite(e[1])&&isFinite(e[2])},applyTransform:(i=h.create(),r=h.create(),a=h.create(),o=h.create(),s=h.create(),l=h.create(),function(t){var e=this.min.array,n=this.max.array,u=t.array;return i[0]=u[0]*e[0],i[1]=u[1]*e[0],i[2]=u[2]*e[0],r[0]=u[0]*n[0],r[1]=u[1]*n[0],r[2]=u[2]*n[0],a[0]=u[4]*e[1],a[1]=u[5]*e[1],a[2]=u[6]*e[1],o[0]=u[4]*n[1],o[1]=u[5]*n[1],o[2]=u[6]*n[1],s[0]=u[8]*e[2],s[1]=u[9]*e[2],s[2]=u[10]*e[2],l[0]=u[8]*n[2],l[1]=u[9]*n[2],l[2]=u[10]*n[2],e[0]=Math.min(i[0],r[0])+Math.min(a[0],o[0])+Math.min(s[0],l[0])+u[12],e[1]=Math.min(i[1],r[1])+Math.min(a[1],o[1])+Math.min(s[1],l[1])+u[13],e[2]=Math.min(i[2],r[2])+Math.min(a[2],o[2])+Math.min(s[2],l[2])+u[14],n[0]=Math.max(i[0],r[0])+Math.max(a[0],o[0])+Math.max(s[0],l[0])+u[12],n[1]=Math.max(i[1],r[1])+Math.max(a[1],o[1])+Math.max(s[1],l[1])+u[13],n[2]=Math.max(i[2],r[2])+Math.max(a[2],o[2])+Math.max(s[2],l[2])+u[14],this.min._dirty=!0,this.max._dirty=!0,this}),applyProjection:function(t){var e=this.min.array,n=this.max.array,i=t.array,r=e[0],a=e[1],o=e[2],s=n[0],l=n[1],u=e[2],c=n[0],h=n[1],d=n[2];if(1===i[15])e[0]=i[0]*r+i[12],e[1]=i[5]*a+i[13],n[2]=i[10]*o+i[14],n[0]=i[0]*c+i[12],n[1]=i[5]*h+i[13],e[2]=i[10]*d+i[14];else{var f=-1/o;e[0]=i[0]*r*f,e[1]=i[5]*a*f,n[2]=(i[10]*o+i[14])*f,f=-1/u,n[0]=i[0]*s*f,n[1]=i[5]*l*f,f=-1/d,e[2]=(i[10]*d+i[14])*f}return this.min._dirty=!0,this.max._dirty=!0,this},updateVertices:function(){if(!(t=this.vertices)){for(var t=[],e=0;e<8;e++)t[e]=h.fromValues(0,0,0);this.vertices=t}var n=this.min.array,i=this.max.array;return f(t[0],n[0],n[1],n[2]),f(t[1],n[0],i[1],n[2]),f(t[2],i[0],n[1],n[2]),f(t[3],i[0],i[1],n[2]),f(t[4],n[0],n[1],i[2]),f(t[5],n[0],i[1],i[2]),f(t[6],i[0],n[1],i[2]),f(t[7],i[0],i[1],i[2]),this},copy:function(t){var e=this.min,n=this.max;return d(e.array,t.min.array),d(n.array,t.max.array),e._dirty=!0,n._dirty=!0,this},clone:function(){var t=new p;return t.copy(this),t}},e.a=p},function(t,e,n){"use strict";e.a=function(t,e,n){return{seriesType:t,reset:function(t,e){var n=t.getData(),i=t.visualColorAccessPath.split(".");i[i.length-1]="opacity";var r=t.get(i);return n.setVisual("opacity",null==r?1:r),{dataEach:n.hasItemOption?function(t){var e=n.getItemModel(t).get(i);null!=e&&n.setItemVisual(t,"opacity",e)}:null}}}}},function(t,e,n){"use strict";var i=n(8),r=n(6),a=n(21),o=n(93).a.parseToFloat,s={};function l(t,e,n){var i=Object.keys(t);i.sort();for(var r=[],a=0;a=0},getEnabledUniforms:function(){return this._enabledUniforms},getTextureUniforms:function(){return this._textureUniforms},set:function(t,e){if("object"==typeof t)for(var n in t){var i=t[n];this.setUniform(n,i)}else this.setUniform(t,e)},get:function(t){var e=this.uniforms[t];if(e)return e.value},attachShader:function(t,e){var n=this.uniforms;this.uniforms=t.createUniforms(),this.shader=t;var i=this.uniforms;this._enabledUniforms=Object.keys(i),this._enabledUniforms.sort(),this._textureUniforms=this._enabledUniforms.filter((function(t){var e=this.uniforms[t].type;return"t"===e||"tv"===e}),this);var r=this.vertexDefines,o=this.fragmentDefines;if(this.vertexDefines=a.a.clone(t.vertexDefines),this.fragmentDefines=a.a.clone(t.fragmentDefines),e){for(var s in n)i[s]&&(i[s].value=n[s].value);a.a.defaults(this.vertexDefines,r),a.a.defaults(this.fragmentDefines,o)}var l={};for(var u in t.textures)l[u]={shaderType:t.textures[u].shaderType,type:t.textures[u].type,enabled:!(!e||!this._textureStatus[u])&&this._textureStatus[u].enabled};this._textureStatus=l,this._programKey=""},clone:function(){var t=new this.constructor({name:this.name,shader:this.shader});for(var e in this.uniforms)t.uniforms[e].value=this.uniforms[e].value;return t.depthTest=this.depthTest,t.depthMask=this.depthMask,t.transparent=this.transparent,t.blend=this.blend,t.vertexDefines=a.a.clone(this.vertexDefines),t.fragmentDefines=a.a.clone(this.fragmentDefines),t.enableTexture(this.getEnabledTextures()),t.precision=this.precision,t},define:function(t,e,n){var i=this.vertexDefines,r=this.fragmentDefines;"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<3&&(n=e,e=t,t="both"),n=null!=n?n:null,"vertex"!==t&&"both"!==t||i[e]!==n&&(i[e]=n,this._programKey=""),"fragment"!==t&&"both"!==t||r[e]!==n&&(r[e]=n,"both"!==t&&(this._programKey=""))},undefine:function(t,e){"vertex"!==t&&"fragment"!==t&&"both"!==t&&arguments.length<2&&(e=t,t="both"),"vertex"!==t&&"both"!==t||this.isDefined("vertex",e)&&(delete this.vertexDefines[e],this._programKey=""),"fragment"!==t&&"both"!==t||this.isDefined("fragment",e)&&(delete this.fragmentDefines[e],"both"!==t&&(this._programKey=""))},isDefined:function(t,e){switch(t){case"vertex":return void 0!==this.vertexDefines[e];case"fragment":return void 0!==this.fragmentDefines[e]}},getDefine:function(t,e){switch(t){case"vertex":return this.vertexDefines[e];case"fragment":return this.fragmentDefines[e]}},enableTexture:function(t){if(Array.isArray(t))for(var e=0;e=n.x&&e>=n.y&&t<=n.x+n.width&&e<=n.y+n.height};var v=new h.a;m.prototype.castRay=function(t,e,n){var i=this.layer.renderer,r=i.viewport;return i.viewport=this.viewport,i.screenToNDC(t,e,v),this.camera.castRay(v,n),i.viewport=r,n},m.prototype.prepareRender=function(){this.scene.update(),this.camera.update(),this._needsSortProgressively=!1;for(var t=0;t30},m.prototype._doRender=function(t,e,n){var i,r=this.scene,a=this.camera;n=n||0,this._updateTransparent(t,r,a,n),e||(this._shadowMapPass.kernelPCF=this._pcfKernels[0],this._shadowMapPass.render(t,r,a,!0)),this._updateShadowPCFKernel(n),t.gl.clearColor(0,0,0,0),this._enablePostEffect&&(this.needsTemporalSS()&&this._temporalSS.jitterProjection(t,a),this._compositor.updateNormal(t,r,a,this._temporalSS.getFrame())),this._updateSSAO(t,r,a,this._temporalSS.getFrame()),this._enablePostEffect?((i=this._compositor.getSourceFrameBuffer()).bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),t.render(r,a,!0,!0),i.unbind(t),this.needsTemporalSS()&&e?(this._compositor.composite(t,a,this._temporalSS.getSourceFrameBuffer(),this._temporalSS.getFrame()),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),this._compositor.composite(t,a,null,0))):this.needsTemporalSS()&&e?((i=this._temporalSS.getSourceFrameBuffer()).bind(t),t.saveClear(),t.clearBit=t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT,t.render(r,a,!0,!0),t.restoreClear(),i.unbind(t),t.setViewport(this.viewport),this._temporalSS.render(t)):(t.setViewport(this.viewport),t.render(r,a,!0,!0))},m.prototype._updateTransparent=function(t,e,n,i){for(var r=new c.a,a=new u.a,o=n.getWorldPosition(),s=0;sthis.camera.far||t65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,i){return 1/(l.dist(t,e)+l.dist(n,e)+l.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(u)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(u)},getPolylineVertexCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/3,this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/3,this.useNativeLine?0:2*Math.max(e-1,0)},addCubicCurve:function(t,e,n,i,r,a){null==a&&(a=1);var o=t[0],s=t[1],l=t[2],u=e[0],c=e[1],h=e[2],d=n[0],f=n[1],p=n[2],g=i[0],m=i[1],v=i[2],y=this._getCubicCurveApproxStep(t,e,n,i),x=y*y,b=x*y,_=3*y,E=3*x,w=6*x,T=6*b,S=o-2*u+d,M=s-2*c+f,C=l-2*h+p,A=3*(u-d)-o+g,O=3*(c-f)-s+m,N=3*(h-p)-l+v,P=o,L=s,R=l,D=(u-o)*_+S*E+A*b,k=(c-s)*_+M*E+O*b,I=(h-l)*_+C*E+N*b,B=S*w+A*T,F=M*w+O*T,z=C*w+N*T,G=A*T,j=O*T,U=N*T,H=0,V=0,Z=Math.ceil(1/y),W=new Float32Array(3*(Z+1)),X=(W=[],0);for(V=0;V1&&(P=D>0?Math.min(P,g):Math.max(P,g),L=k>0?Math.min(L,m):Math.max(L,m),R=I>0?Math.min(R,v):Math.max(R,v));return this.addPolyline(W,r,a)},addLine:function(t,e,n,i){return this.addPolyline([t,e],n,i)},addPolyline:function(t,e,n,i,r){if(t.length){var a="number"!=typeof t[0];if(null==r&&(r=a?t.length:t.length/3),!(r<2)){null==i&&(i=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);var o,s,l=(a="number"!=typeof t[0])?"number"!=typeof e[0]:e.length/4===r,u=this.attributes.position,c=this.attributes.positionPrev,h=this.attributes.positionNext,d=this.attributes.color,f=this.attributes.offset,p=this.indices,g=this._vertexOffset;n=Math.max(n,.01);for(var m=i;m1&&(u.copy(g,g-1),d.copy(g,g-1),g++):(m0&&(h.set(g-2,o),h.set(g-1,o)),u.set(g,o),u.set(g+1,o),d.set(g,s),d.set(g+1,s),f.set(g,n/2),f.set(g+1,-n/2),g+=2),this.useNativeLine)d.set(g,s),u.set(g,o),g++;else if(m>0){var x=3*this._triangleOffset;(p=this.indices)[x]=g-4,p[x+1]=g-3,p[x+2]=g-2,p[x+3]=g-3,p[x+4]=g-1,p[x+5]=g-2,this._triangleOffset+=2}}if(!this.useNativeLine){var b=this._vertexOffset,_=this._vertexOffset+2*r;c.copy(b,b+2),c.copy(b+1,b+3),h.copy(_-1,_-3),h.copy(_-2,_-4)}return this._vertexOffset=g,this._vertexOffset}}},setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],i=t0)},render:function(t,e,n){var r=t.gl;if(this.skeleton){this.skeleton.update();var a=this.skeleton.getSubSkinMatrices(this.__uid__,this.joints);n.setUniformOfSemantic(r,"SKIN_MATRIX",a)}return i.a.prototype.render.call(this,t,e,n)},getSkinMatricesTexture:function(){return this._skinMatricesTexture=this._skinMatricesTexture||new a.a({type:r.a.FLOAT,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST,useMipmap:!1,flipY:!1}),this._skinMatricesTexture}});o.POINTS=r.a.POINTS,o.LINES=r.a.LINES,o.LINE_LOOP=r.a.LINE_LOOP,o.LINE_STRIP=r.a.LINE_STRIP,o.TRIANGLES=r.a.TRIANGLES,o.TRIANGLE_STRIP=r.a.TRIANGLE_STRIP,o.TRIANGLE_FAN=r.a.TRIANGLE_FAN,o.BACK=r.a.BACK,o.FRONT=r.a.FRONT,o.FRONT_AND_BACK=r.a.FRONT_AND_BACK,o.CW=r.a.CW,o.CCW=r.a.CCW,e.a=o},function(t,e,n){"use strict";var i=n(6),r=n(11),a=n(21),o=n(66).a.isPowerOfTwo,s=["px","nx","py","ny","pz","nz"],l=i.a.extend((function(){return{image:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},pixels:{px:null,nx:null,py:null,ny:null,pz:null,nz:null},mipmaps:[]}}),{update:function(t){var e=t.gl;e.bindTexture(e.TEXTURE_CUBE_MAP,this._cache.get("webgl_texture")),this.updateCommon(t);var n=this.format,i=this.type;e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_S,this.getAvailableWrapS()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_WRAP_T,this.getAvailableWrapT()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MAG_FILTER,this.getAvailableMagFilter()),e.texParameteri(e.TEXTURE_CUBE_MAP,e.TEXTURE_MIN_FILTER,this.getAvailableMinFilter());var a=t.getGLExtension("EXT_texture_filter_anisotropic");if(a&&this.anisotropic>1&&e.texParameterf(e.TEXTURE_CUBE_MAP,a.TEXTURE_MAX_ANISOTROPY_EXT,this.anisotropic),36193===i&&(t.getGLExtension("OES_texture_half_float")||(i=r.a.FLOAT)),this.mipmaps.length)for(var o=this.width,s=this.height,l=0;l0&&console.warn("Found multiple camera in one scene. Use the fist one."),this._cameraList.push(t)),t.name&&(this._nodeRepository[t.name]=t)},removeFromScene:function(t){if(t instanceof a.a){var e=this._cameraList.indexOf(t);e>=0&&this._cameraList.splice(e,1)}t.name&&delete this._nodeRepository[t.name]},getNode:function(t){return this._nodeRepository[t]},cloneNode:function(t){var e=t.clone(),n={},i=function(r,a){r.skeleton&&(a.skeleton=r.skeleton.clone(t,e),a.joints=r.joints.slice()),r.material&&(n[r.material.__uid__]={oldMat:r.material});for(var o=0;o0&&this._updateRenderList(i)}},_updateLightUniforms:function(){var t=this.lights;t.sort(h);var e=this._lightUniforms;for(var n in e)for(var i in e[n])e[n][i].value.length=0;for(var r=0;r0?t[e].value=new Float32Array(t[e].value):t[e].value=null;this.indices&&this.indices.length>0&&(this.indices=this.vertexCount>65535?new Uint32Array(this.indices):new Uint16Array(this.indices)),this.dirty()}}},function(t,e,n){"use strict";var i=n(2),r=n(57),a=n(56),o=n(0),s=n.n(o);function l(){}l.prototype={constructor:l,setScene:function(t){this._scene=t,this._skybox&&this._skybox.attachScene(this._scene)},initLight:function(t){this._lightRoot=t,this.mainLight=new i.a.DirectionalLight({shadowBias:.005}),this.ambientLight=new i.a.AmbientLight,t.add(this.mainLight),t.add(this.ambientLight)},dispose:function(){this._lightRoot&&(this._lightRoot.remove(this.mainLight),this._lightRoot.remove(this.ambientLight))},updateLight:function(t){var e=this.mainLight,n=this.ambientLight,r=t.getModel("light"),a=r.getModel("main"),o=r.getModel("ambient");e.intensity=a.get("intensity"),n.intensity=o.get("intensity"),e.color=i.a.parseColor(a.get("color")).slice(0,3),n.color=i.a.parseColor(o.get("color")).slice(0,3);var s=a.get("alpha")||0,l=a.get("beta")||0;e.position.setArray(i.a.directionFromAlphaBeta(s,l)),e.lookAt(i.a.Vector3.ZERO),e.castShadow=a.get("shadow"),e.shadowResolution=i.a.getShadowResolution(a.get("shadowQuality"))},updateAmbientCubemap:function(t,e,n){var a=e.getModel("light.ambientCubemap"),o=a.get("texture");if(o){this._cubemapLightsCache=this._cubemapLightsCache||{};var s=this._cubemapLightsCache[o];if(!s){var l=this;s=this._cubemapLightsCache[o]=i.a.createAmbientCubemap(a.option,t,n,(function(){l._skybox instanceof r.a&&l._skybox.setEnvironmentMap(s.specular.cubemap),n.getZr().refresh()}))}this._lightRoot.add(s.diffuse),this._lightRoot.add(s.specular),this._currentCubemapLights=s}else this._currentCubemapLights&&(this._lightRoot.remove(this._currentCubemapLights.diffuse),this._lightRoot.remove(this._currentCubemapLights.specular),this._currentCubemapLights=null)},updateSkybox:function(t,e,n){var o=e.get("environment"),l=this;function u(){return l._skybox instanceof a.a||(l._skybox&&l._skybox.dispose(t),l._skybox=new a.a),l._skybox}if(o&&"none"!==o)if("auto"===o)if(this._currentCubemapLights){var c=(l._skybox instanceof r.a||(l._skybox&&l._skybox.dispose(t),l._skybox=new r.a),l._skybox),h=this._currentCubemapLights.specular.cubemap;c.setEnvironmentMap(h),this._scene&&c.attachScene(this._scene),c.material.set("lod",2)}else this._skybox&&this._skybox.detachScene();else if("object"==typeof o&&o.colorStops||"string"==typeof o&&s.a.color.parse(o)){var d=u(),f=new i.a.Texture2D({anisotropic:8,flipY:!1});d.setEnvironmentMap(f);var p=f.image=document.createElement("canvas");p.width=p.height=16;var g=p.getContext("2d");new s.a.graphic.Rect({shape:{x:0,y:0,width:16,height:16},style:{fill:o}}).brush(g),d.attachScene(this._scene)}else d=u(),f=i.a.loadTexture(o,n,{anisotropic:8,flipY:!1}),d.setEnvironmentMap(f),d.attachScene(this._scene);else this._skybox&&this._skybox.detachScene(this._scene),this._skybox=null;var m=e.coordinateSystem;if(this._skybox)if(!m||!m.viewGL||"auto"===o||o.match&&o.match(/.hdr$/))this._skybox.material.undefine("fragment","SRGB_DECODE");else{var v=m.viewGL.isLinearSpace()?"define":"undefine";this._skybox.material[v]("fragment","SRGB_DECODE")}}},e.a=l},function(t,e,n){"use strict";var i=n(0),r=n.n(i);e.a=function(t,e,n){var i=t.getData(),a=t.getRawValue(e),o=r.a.util.isArray(a)?function(t){var a=[],o=function(t,e){var n=[];return r.a.util.each(t.dimensions,(function(i){var r=t.getDimensionInfo(i),a=r.otherDims[e];null!=a&&!1!==a&&(n[a]=r.name)})),n}(i,"tooltip");function s(t,e){var o=i.getDimensionInfo(e);if(o&&!1!==o.otherDims.tooltip){var s=o.type,l="- "+(o.tooltipName||o.name)+": "+("ordinal"===s?t+"":"time"===s?n?"":r.a.format.formatTime("yyyy/MM/dd hh:mm:ss",t):r.a.format.addCommas(t));l&&a.push(r.a.format.encodeHTML(l))}}return o.length?r.a.util.each(o,(function(t){s(i.get(t,e),t)})):r.a.util.each(t,s),"
    "+a.join("
    ")}(a):r.a.format.encodeHTML(r.a.format.addCommas(a)),s=i.getName(e),l=i.getItemVisual(e,"color");r.a.util.isObject(l)&&l.colorStops&&(l=(l.colorStops[0]||{}).color),l=l||"transparent";var u=r.a.format.getTooltipMarker(l),c=t.name;return"\0-"===c&&(c=""),c=c?r.a.format.encodeHTML(c)+(n?": ":"
    "):"",n?u+c+o:c+u+(s?r.a.format.encodeHTML(s)+": "+o:o)}},function(t,e,n){"use strict";var i=n(51),r=i.a.extend({fov:50,aspect:1,near:.1,far:2e3},{updateProjectionMatrix:function(){var t=this.fov/180*Math.PI;this.projectionMatrix.perspective(t,this.aspect,this.near,this.far)},decomposeProjectionMatrix:function(){var t=this.projectionMatrix.array,e=2*Math.atan(1/t[5]);this.fov=e/Math.PI*180,this.aspect=t[5]/t[0],this.near=t[14]/(t[10]-1),this.far=t[14]/(t[10]+1)},clone:function(){var t=i.a.prototype.clone.call(this);return t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t}});e.a=r},function(t,e,n){"use strict";var i=n(13),r=n(15),a=i.a.extend({dynamic:!1,widthSegments:1,heightSegments:1},(function(){this.build()}),{build:function(){for(var t=this.heightSegments,e=this.widthSegments,n=this.attributes,i=[],a=[],o=[],s=[],l=0;l<=t;l++)for(var u=l/t,c=0;c<=e;c++){var h=c/e;if(i.push([2*h-1,2*u-1,0]),a&&a.push([h,u]),o&&o.push([0,0,1]),c0&&this._notFirst?this.animateTo({alpha:c,beta:h,center:d,distance:a,targetOrthographicSize:s,easing:u.animationEasingUpdate,duration:u.animationDurationUpdate}):(this.setDistance(a),this.setAlpha(c),this.setBeta(h),this.setCenter(d),this.setOrthographicSize(s)),this._notFirst=!0,this._validateProperties()},_validateProperties:function(){null==s[this.panMouseButton]&&console.error("Unkown panMouseButton %s. It should be left|middle|right",this.panMouseButton),null==s[this.rotateMouseButton]&&console.error("Unkown rotateMouseButton %s. It should be left|middle|right",this.rotateMouseButton),"cw"!==this.autoRotateDirection&&"ccw"!==this.autoRotateDirection&&console.error("Unkown autoRotateDirection %s. It should be cw|ccw",this.autoRotateDirection)},animateTo:function(t){var e=this.zr,n=this,i={},r={};return null!=t.distance&&(i.distance=this.getDistance(),r.distance=t.distance),null!=t.orthographicSize&&(i.orthographicSize=this.getOrthographicSize(),r.orthographicSize=t.orthographicSize),null!=t.alpha&&(i.alpha=this.getAlpha(),r.alpha=t.alpha),null!=t.beta&&(i.beta=this.getBeta(),r.beta=t.beta),null!=t.center&&(i.center=this.getCenter(),r.center=t.center),this._addAnimator(e.animation.animate(i).when(t.duration||1e3,r).during((function(){null!=i.alpha&&n.setAlpha(i.alpha),null!=i.beta&&n.setBeta(i.beta),null!=i.distance&&n.setDistance(i.distance),null!=i.center&&n.setCenter(i.center),null!=i.orthographicSize&&n.setOrthographicSize(i.orthographicSize),n._needsUpdate=!0}))).start(t.easing||"linear")},stopAllAnimation:function(){for(var t=0;t0},_update:function(t){if(this._rotating){var e=("cw"===this.autoRotateDirection?1:-1)*this.autoRotateSpeed/180*Math.PI;this._phi-=e*t/1e3,this._needsUpdate=!0}else this._rotateVelocity.len()>0&&(this._needsUpdate=!0);(Math.abs(this._zoomSpeed)>.1||this._panVelocity.len()>0)&&(this._needsUpdate=!0),this._needsUpdate&&(t=Math.min(t,50),this._updateDistanceOrSize(t),this._updatePan(t),this._updateRotate(t),this._updateTransform(),this.getCamera().update(),this.zr&&this.zr.refresh(),this.trigger("update"),this._needsUpdate=!1)},_updateRotate:function(t){var e=this._rotateVelocity;this._phi=e.y*t/20+this._phi,this._theta=e.x*t/20+this._theta,this.setAlpha(this.getAlpha()),this.setBeta(this.getBeta()),this._vectorDamping(e,Math.pow(this.damping,t/16))},_updateDistanceOrSize:function(t){"perspective"===this._projection?this._setDistance(this._distance+this._zoomSpeed*t/20):this._setOrthoSize(this._orthoSize+this._zoomSpeed*t/20),this._zoomSpeed*=Math.pow(this.damping,t/16)},_setDistance:function(t){this._distance=Math.max(Math.min(t,this.maxDistance),this.minDistance)},_setOrthoSize:function(t){this._orthoSize=Math.max(Math.min(t,this.maxOrthographicSize),this.minOrthographicSize);var e=this.getCamera(),n=this._orthoSize,i=n/this.viewGL.viewport.height*this.viewGL.viewport.width;e.left=-i/2,e.right=i/2,e.top=n/2,e.bottom=-n/2},_updatePan:function(t){var e=this._panVelocity,n=this._distance,i=this.getCamera(),r=i.worldTransform.y,a=i.worldTransform.x;this._center.scaleAndAdd(a,-e.x*n/200).scaleAndAdd(r,-e.y*n/200),this._vectorDamping(e,0)},_updateTransform:function(){var t=this.getCamera(),e=new a.a,n=this._theta+Math.PI/2,i=this._phi+Math.PI/2,r=Math.sin(n);e.x=r*Math.cos(i),e.y=-Math.cos(n),e.z=r*Math.sin(i),t.position.copy(this._center).scaleAndAdd(e,this._distance),t.rotation.identity().rotateY(-this._phi).rotateX(-this._theta)},_startCountingStill:function(){clearTimeout(this._stillTimeout);var t=this.autoRotateAfterStill,e=this;!isNaN(t)&&t>0&&(this._stillTimeout=setTimeout((function(){e._rotating=!0}),1e3*t))},_vectorDamping:function(t,e){var n=t.len();(n*=e)<1e-4&&(n=0),t.normalize().scale(n)},_decomposeTransform:function(){if(this.getCamera()){this.getCamera().updateWorldTransform();var t=this.getCamera().worldTransform.z,e=Math.asin(t.y),n=Math.atan2(t.x,t.z);this._theta=e,this._phi=-n,this.setBeta(this.getBeta()),this.setAlpha(this.getAlpha()),this.getCamera().aspect?this._setDistance(this.getCamera().position.dist(this._center)):this._setOrthoSize(this.getCamera().top-this.getCamera().bottom)}},_mouseDownHandler:function(t){if(!t.target&&!this._isAnimating()){var e=t.offsetX,n=t.offsetY;this.viewGL&&!this.viewGL.containPoint(e,n)||(this.zr.on("mousemove",this._mouseMoveHandler),this.zr.on("mouseup",this._mouseUpHandler),t.event.targetTouches?1===t.event.targetTouches.length&&(this._mode="rotate"):t.event.button===s[this.rotateMouseButton]?this._mode="rotate":t.event.button===s[this.panMouseButton]?this._mode="pan":this._mode="",this._rotateVelocity.set(0,0),this._rotating=!1,this.autoRotate&&this._startCountingStill(),this._mouseX=t.offsetX,this._mouseY=t.offsetY)}},_mouseMoveHandler:function(t){if(!(t.target&&t.target.__isGLToZRProxy||this._isAnimating())){var e=l(this.panSensitivity),n=l(this.rotateSensitivity);"rotate"===this._mode?(this._rotateVelocity.y=(t.offsetX-this._mouseX)/this.zr.getHeight()*2*n[0],this._rotateVelocity.x=(t.offsetY-this._mouseY)/this.zr.getWidth()*2*n[1]):"pan"===this._mode&&(this._panVelocity.x=(t.offsetX-this._mouseX)/this.zr.getWidth()*e[0]*400,this._panVelocity.y=(-t.offsetY+this._mouseY)/this.zr.getHeight()*e[1]*400),this._mouseX=t.offsetX,this._mouseY=t.offsetY,t.event.preventDefault()}},_mouseWheelHandler:function(t){if(!this._isAnimating()){var e=t.event.wheelDelta||-t.event.detail;this._zoomHandler(t,e)}},_pinchHandler:function(t){this._isAnimating()||(this._zoomHandler(t,t.pinchScale>1?1:-1),this._mode="")},_zoomHandler:function(t,e){if(0!==e){var n,i=t.offsetX,r=t.offsetY;this.viewGL&&!this.viewGL.containPoint(i,r)||(n="perspective"===this._projection?Math.max(Math.max(Math.min(this._distance-this.minDistance,this.maxDistance-this._distance))/20,.5):Math.max(Math.max(Math.min(this._orthoSize-this.minOrthographicSize,this.maxOrthographicSize-this._orthoSize))/20,.5),this._zoomSpeed=(e>0?-1:1)*n*this.zoomSensitivity,this._rotating=!1,this.autoRotate&&"rotate"===this._mode&&this._startCountingStill(),t.event.preventDefault())}},_mouseUpHandler:function(){this.zr.off("mousemove",this._mouseMoveHandler),this.zr.off("mouseup",this._mouseUpHandler)},_isRightMouseButtonUsed:function(){return"right"===this.rotateMouseButton||"right"===this.panMouseButton},_contextMenuHandler:function(t){this._isRightMouseButtonUsed()&&t.preventDefault()},_addAnimator:function(t){var e=this._animators;return e.push(t),t.done((function(){var n=e.indexOf(t);n>=0&&e.splice(n,1)})),t}});Object.defineProperty(u.prototype,"autoRotate",{get:function(t){return this._autoRotate},set:function(t){this._autoRotate=t,this._rotating=t}}),e.a=u},function(t,e,n){"use strict";e.a="@export ecgl.lines3D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, 1.0);\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n}\n@end\n\n\n\n@export ecgl.lines3D.clipNear\n\nvec4 clipNear(vec4 p1, vec4 p2) {\n float n = (p1.w - near) / (p1.w - p2.w);\n return vec4(mix(p1.xy, p2.xy, n), -near, near);\n}\n\n@end\n\n@export ecgl.lines3D.expandLine\n#ifdef VERTEX_ANIMATION\n vec4 prevProj = worldViewProjection * vec4(mix(prevPositionPrev, positionPrev, percent), 1.0);\n vec4 currProj = worldViewProjection * vec4(mix(prevPosition, position, percent), 1.0);\n vec4 nextProj = worldViewProjection * vec4(mix(prevPositionNext, positionNext, percent), 1.0);\n#else\n vec4 prevProj = worldViewProjection * vec4(positionPrev, 1.0);\n vec4 currProj = worldViewProjection * vec4(position, 1.0);\n vec4 nextProj = worldViewProjection * vec4(positionNext, 1.0);\n#endif\n\n if (currProj.w < 0.0) {\n if (nextProj.w > 0.0) {\n currProj = clipNear(currProj, nextProj);\n }\n else if (prevProj.w > 0.0) {\n currProj = clipNear(currProj, prevProj);\n }\n }\n\n vec2 prevScreen = (prevProj.xy / abs(prevProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 currScreen = (currProj.xy / abs(currProj.w) + 1.0) * 0.5 * viewport.zw;\n vec2 nextScreen = (nextProj.xy / abs(nextProj.w) + 1.0) * 0.5 * viewport.zw;\n\n vec2 dir;\n float len = offset;\n if (position == positionPrev) {\n dir = normalize(nextScreen - currScreen);\n }\n else if (position == positionNext) {\n dir = normalize(currScreen - prevScreen);\n }\n else {\n vec2 dirA = normalize(currScreen - prevScreen);\n vec2 dirB = normalize(nextScreen - currScreen);\n\n vec2 tanget = normalize(dirA + dirB);\n\n float miter = 1.0 / max(dot(tanget, dirA), 0.5);\n len *= miter;\n dir = tanget;\n }\n\n dir = vec2(-dir.y, dir.x) * len;\n currScreen += dir;\n\n currProj.xy = (currScreen / viewport.zw - 0.5) * 2.0 * abs(currProj.w);\n@end\n\n\n@export ecgl.meshLines3D.vertex\n\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevPositionPrev;\nattribute vec3 prevPositionNext;\nuniform float percent : 1.0;\n#endif\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n}\n@end\n\n\n@export ecgl.meshLines3D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(t,e,n){var i=n(12),r=n(75),a=n(78).parsePercent,o=n(149),s=i.each,l=["left","right","top","bottom","width","height"],u=[["width","left","right"],["height","top","bottom"]];function c(t,e,n,i,r){var a=0,o=0;null==i&&(i=1/0),null==r&&(r=1/0);var s=0;e.eachChild((function(l,u){var c,h,d=l.position,f=l.getBoundingRect(),p=e.childAt(u+1),g=p&&p.getBoundingRect();if("horizontal"===t){var m=f.width+(g?-g.x+f.x:0);(c=a+m)>i||l.newline?(a=0,c=m,o+=s+n,s=f.height):s=Math.max(s,f.height)}else{var v=f.height+(g?-g.y+f.y:0);(h=o+v)>r||l.newline?(a+=s+n,o=0,h=v,s=f.width):s=Math.max(s,f.width)}l.newline||(d[0]=a,d[1]=o,"horizontal"===t?a=c+n:o=h+n)}))}var h=c,d=i.curry(c,"vertical"),f=i.curry(c,"horizontal");function p(t,e,n){n=o.normalizeCssArray(n||0);var i=e.width,s=e.height,l=a(t.left,i),u=a(t.top,s),c=a(t.right,i),h=a(t.bottom,s),d=a(t.width,i),f=a(t.height,s),p=n[2]+n[0],g=n[1]+n[3],m=t.aspect;switch(isNaN(d)&&(d=i-c-g-l),isNaN(f)&&(f=s-h-p-u),null!=m&&(isNaN(d)&&isNaN(f)&&(m>i/s?d=.8*i:f=.8*s),isNaN(d)&&(d=m*f),isNaN(f)&&(f=d/m)),isNaN(l)&&(l=i-c-d-g),isNaN(u)&&(u=s-h-f-p),t.left||t.right){case"center":l=i/2-d/2-n[3];break;case"right":l=i-d-g}switch(t.top||t.bottom){case"middle":case"center":u=s/2-f/2-n[0];break;case"bottom":u=s-f-p}l=l||0,u=u||0,isNaN(d)&&(d=i-g-l-(c||0)),isNaN(f)&&(f=s-p-u-(h||0));var v=new r(l+n[3],u+n[0],d,f);return v.margin=n,v}function g(t,e){return e&&t&&s(l,(function(n){e.hasOwnProperty(n)&&(t[n]=e[n])})),t}e.LOCATION_PARAMS=l,e.HV_NAMES=u,e.box=h,e.vbox=d,e.hbox=f,e.getAvailableSize=function(t,e,n){var i=e.width,r=e.height,s=a(t.x,i),l=a(t.y,r),u=a(t.x2,i),c=a(t.y2,r);return(isNaN(s)||isNaN(parseFloat(t.x)))&&(s=0),(isNaN(u)||isNaN(parseFloat(t.x2)))&&(u=i),(isNaN(l)||isNaN(parseFloat(t.y)))&&(l=0),(isNaN(c)||isNaN(parseFloat(t.y2)))&&(c=r),n=o.normalizeCssArray(n||0),{width:Math.max(u-s-n[1]-n[3],0),height:Math.max(c-l-n[0]-n[2],0)}},e.getLayoutRect=p,e.positionElement=function(t,e,n,a,o){var s=!o||!o.hv||o.hv[0],l=!o||!o.hv||o.hv[1],u=o&&o.boundingMode||"all";if(s||l){var c;if("raw"===u)c="group"===t.type?new r(0,0,+e.width||0,+e.height||0):t.getBoundingRect();else if(c=t.getBoundingRect(),t.needLocalTransform()){var h=t.getLocalTransform();(c=c.clone()).applyTransform(h)}e=p(i.defaults({width:c.width,height:c.height},e),n,a);var d=t.position,f=s?e.x-c.x:0,g=l?e.y-c.y:0;t.attr("position","raw"===u?[f,g]:[d[0]+f,d[1]+g])}},e.sizeCalculable=function(t,e){return null!=t[u[e][0]]||null!=t[u[e][1]]&&null!=t[u[e][2]]},e.mergeLayoutParam=function(t,e,n){!i.isObject(n)&&(n={});var r=n.ignoreSize;!i.isArray(r)&&(r=[r,r]);var a=l(u[0],0),o=l(u[1],1);function l(n,i){var a={},o=0,l={},u=0;if(s(n,(function(e){l[e]=t[e]})),s(n,(function(t){c(e,t)&&(a[t]=l[t]=e[t]),h(a,t)&&o++,h(l,t)&&u++})),r[i])return h(e,n[1])?l[n[2]]=null:h(e,n[2])&&(l[n[1]]=null),l;if(2!==u&&o){if(o>=2)return a;for(var d=0;d0&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))}});e.a=i},function(t,e,n){"use strict";e.a=function(t,e){for(var n=0,i=1/e,r=t;r>0;)n+=i*(r%e),r=Math.floor(r/e),i/=e;return n}},function(t,e,n){"use strict";var i=n(0),r=n.n(i);e.a=function(t,e,n){n=n||t.getSource();var i=e||r.a.getCoordinateSystemDimensions(t.get("coordinateSystem"))||["x","y","z"],a=r.a.helper.createDimensions(n,{dimensionsDefine:n.dimensionsDefine||t.get("dimensions"),encodeDefine:n.encodeDefine||t.get("encode"),coordDimensions:i.map((function(e){var n=t.getReferringComponents(e+"Axis3D")[0];return{type:n&&"category"===n.get("type")?"ordinal":"float",name:e,stackable:"z"===e}}))});"cartesian3D"===t.get("coordinateSystem")&&a.forEach((function(e){if(i.indexOf(e.coordDim)>=0){var n=t.getReferringComponents(e.coordDim+"Axis3D")[0];n&&"category"===n.get("type")&&(e.ordinalMeta=n.getOrdinalMeta())}}));var o=new r.a.List(a,t);return o.initData(n),o}},function(t,e){t.exports=function(t,e,n){return{seriesType:t,performRawSeries:!0,reset:function(t,i,r){var a=t.getData(),o=t.get("symbol")||e,s=t.get("symbolSize");if(a.setVisual({legendSymbol:n||o,symbol:o,symbolSize:s}),!i.isSeriesFiltered(t)){var l="function"==typeof s;return{dataEach:a.hasItemOption||l?function(e,n){if("function"==typeof s){var i=t.getRawValue(n),r=t.getDataParams(n);e.setItemVisual(n,"symbolSize",s(i,r))}if(e.hasItemOption){var a=e.getItemModel(n),o=a.getShallow("symbol",!0),l=a.getShallow("symbolSize",!0);null!=o&&e.setItemVisual(n,"symbol",o),null!=l&&e.setItemVisual(n,"symbolSize",l)}}:null}}}}}},function(t,e,n){"use strict";var i=n(8),r=n(92),a=n(11),o=(n(18),n(15)),s=n(9),l=n(17),u=n(23),c=n(96),h=n(7),d=n(98),f=n(63),p=n(1),g=n.n(p);h.a.import(d.a),h.a.import(f.a);var m=g.a.mat4,v=g.a.vec3,y=m.create,x={};function b(t){return t.material}function _(){}var E,w,T=i.a.extend((function(){return{canvas:null,_width:100,_height:100,devicePixelRatio:window.devicePixelRatio||1,clearColor:[0,0,0,0],clearBit:17664,alpha:!0,depth:!0,stencil:!1,antialias:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!1,throwError:!0,gl:null,viewport:{},__currentFrameBuffer:null,_viewportStack:[],_clearStack:[],_sceneRendering:null}}),(function(){this.canvas||(this.canvas=document.createElement("canvas"));var t=this.canvas;try{var e={alpha:this.alpha,depth:this.depth,stencil:this.stencil,antialias:this.antialias,premultipliedAlpha:this.premultipliedAlpha,preserveDrawingBuffer:this.preserveDrawingBuffer};if(this.gl=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!this.gl)throw new Error;this._glinfo=new r.a(this.gl),this.gl.targetRenderer&&console.error("Already created a renderer"),this.gl.targetRenderer=this,this.resize()}catch(t){throw"Error creating WebGL Context "+t}this._programMgr=new c.a(this)}),{resize:function(t,e){var n=this.canvas,i=this.devicePixelRatio;null!=t?(n.style.width=t+"px",n.style.height=e+"px",n.width=t*i,n.height=e*i,this._width=t,this._height=e):(this._width=n.width/i,this._height=n.height/i),this.setViewport(0,0,this._width,this._height)},getWidth:function(){return this._width},getHeight:function(){return this._height},getViewportAspect:function(){var t=this.viewport;return t.width/t.height},setDevicePixelRatio:function(t){this.devicePixelRatio=t,this.resize(this._width,this._height)},getDevicePixelRatio:function(){return this.devicePixelRatio},getGLExtension:function(t){return this._glinfo.getExtension(t)},getGLParameter:function(t){return this._glinfo.getParameter(t)},setViewport:function(t,e,n,i,r){if("object"==typeof t){var a=t;t=a.x,e=a.y,n=a.width,i=a.height,r=a.devicePixelRatio}r=r||this.devicePixelRatio,this.gl.viewport(t*r,e*r,n*r,i*r),this.viewport={x:t,y:e,width:n,height:i,devicePixelRatio:r}},saveViewport:function(){this._viewportStack.push(this.viewport)},restoreViewport:function(){this._viewportStack.length>0&&this.setViewport(this._viewportStack.pop())},saveClear:function(){this._clearStack.push({clearBit:this.clearBit,clearColor:this.clearColor})},restoreClear:function(){if(this._clearStack.length>0){var t=this._clearStack.pop();this.clearColor=t.clearColor,this.clearBit=t.clearBit}},bindSceneRendering:function(t){this._sceneRendering=t},render:function(t,e,n,i){var r=this.gl,a=this.clearColor;if(this.clearBit){r.colorMask(!0,!0,!0,!0),r.depthMask(!0);var o=this.viewport,s=!1,l=o.devicePixelRatio;(o.width!==this._width||o.height!==this._height||l&&l!==this.devicePixelRatio||o.x||o.y)&&(s=!0,r.enable(r.SCISSOR_TEST),r.scissor(o.x*l,o.y*l,o.width*l,o.height*l)),r.clearColor(a[0],a[1],a[2],a[3]),r.clear(this.clearBit),s&&r.disable(r.SCISSOR_TEST)}if(n||t.update(!1),e=e||t.getMainCamera()){e.getScene()||e.update(!0),this._sceneRendering=t,t.viewBoundingBoxLastFrame.min.set(1/0,1/0,1/0),t.viewBoundingBoxLastFrame.max.set(-1/0,-1/0,-1/0);var u=this.cullRenderList(t.opaqueList,t,e),c=this.cullRenderList(t.transparentList,t,e),h=t.material;t.trigger("beforerender",this,t,e),i?(this.renderPreZ(u,t,e),r.depthFunc(r.LEQUAL)):r.depthFunc(r.LESS);for(var d=y(),f=v.create(),p=0;p0){var s=t[r-1],l=s.joints?s.joints.length:0;if((a.joints.length?a.joints.length:0)===l&&a.material===s.material&&a.lightGroup===s.lightGroup){a.__program=s.__program;continue}}var u=this._programMgr.getProgram(a,o,e);this.validateProgram(u),a.__program=u}},cullRenderList:function(t,e,n){for(var i=[],r=0;r0&&E.min.array[2]<0&&(E.max.array[2]=-1e-20),E.applyProjection(w);var o=E.min.array,s=E.max.array;if(s[0]<-1||o[0]>1||s[1]<-1||o[1]>1||s[2]<-1||o[2]>1)return!0}return!1}),disposeScene:function(t){this.disposeNode(t,!0,!0),t.dispose()},disposeNode:function(t,e,n){t.getParent()&&t.getParent().remove(t),t.traverse((function(t){t.geometry&&e&&t.geometry.dispose(this),t.dispose&&t.dispose(this)}),this)},disposeGeometry:function(t){t.dispose(this)},disposeTexture:function(t){t.dispose(this)},disposeFrameBuffer:function(t){t.dispose(this)},dispose:function(){},screenToNDC:function(t,e,n){n||(n=new u.a),e=this._height-e;var i=this.viewport,r=n.array;return r[0]=(t-i.x)/i.width,r[0]=2*r[0]-1,r[1]=(e-i.y)/i.height,r[1]=2*r[1]-1,n}});T.opaqueSortCompare=T.prototype.opaqueSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.renderOrder-e.renderOrder},T.transparentSortCompare=T.prototype.transparentSortCompare=function(t,e){return t.renderOrder===e.renderOrder?t.__depth===e.__depth?t.__program===e.__program?t.material===e.material?t.geometry.__uid__-e.geometry.__uid__:t.material.__uid__-e.material.__uid__:t.__program&&e.__program?t.__program.__uid__-e.__program.__uid__:0:t.__depth-e.__depth:t.renderOrder-e.renderOrder};var S={IDENTITY:y(),WORLD:y(),VIEW:y(),PROJECTION:y(),WORLDVIEW:y(),VIEWPROJECTION:y(),WORLDVIEWPROJECTION:y(),WORLDINVERSE:y(),VIEWINVERSE:y(),PROJECTIONINVERSE:y(),WORLDVIEWINVERSE:y(),VIEWPROJECTIONINVERSE:y(),WORLDVIEWPROJECTIONINVERSE:y(),WORLDTRANSPOSE:y(),VIEWTRANSPOSE:y(),PROJECTIONTRANSPOSE:y(),WORLDVIEWTRANSPOSE:y(),VIEWPROJECTIONTRANSPOSE:y(),WORLDVIEWPROJECTIONTRANSPOSE:y(),WORLDINVERSETRANSPOSE:y(),VIEWINVERSETRANSPOSE:y(),PROJECTIONINVERSETRANSPOSE:y(),WORLDVIEWINVERSETRANSPOSE:y(),VIEWPROJECTIONINVERSETRANSPOSE:y(),WORLDVIEWPROJECTIONINVERSETRANSPOSE:y()};T.COLOR_BUFFER_BIT=a.a.COLOR_BUFFER_BIT,T.DEPTH_BUFFER_BIT=a.a.DEPTH_BUFFER_BIT,T.STENCIL_BUFFER_BIT=a.a.STENCIL_BUFFER_BIT,e.a=T},function(t,e,n){"use strict";function i(t,e){this.action=t,this.context=e}var r={trigger:function(t){if(this.hasOwnProperty("__handlers__")&&this.__handlers__.hasOwnProperty(t)){var e=this.__handlers__[t],n=e.length,i=-1,r=arguments;switch(r.length){case 1:for(;++iu)){var h=Math.sqrt(u-s),d=o-h,f=o+h;return i||(i=new l.a),d<0?f<0?null:(c.scaleAndAdd(i.array,r,a,f),i):(c.scaleAndAdd(i.array,r,a,d),i)}}}(),intersectBoundingBox:function(t,e){var n,i,r,a,o,s,u=this.direction.array,h=this.origin.array,d=t.min.array,f=t.max.array,p=1/u[0],g=1/u[1],m=1/u[2];if(p>=0?(n=(d[0]-h[0])*p,i=(f[0]-h[0])*p):(i=(d[0]-h[0])*p,n=(f[0]-h[0])*p),g>=0?(r=(d[1]-h[1])*g,a=(f[1]-h[1])*g):(a=(d[1]-h[1])*g,r=(f[1]-h[1])*g),n>a||r>i)return null;if((r>n||n!=n)&&(n=r),(a=0?(o=(d[2]-h[2])*m,s=(f[2]-h[2])*m):(s=(d[2]-h[2])*m,o=(f[2]-h[2])*m),n>s||o>i)return null;if((o>n||n!=n)&&(n=o),(s=0?n:i;return e||(e=new l.a),c.scaleAndAdd(e.array,h,u,v),e},intersectTriangle:(i=c.create(),r=c.create(),a=c.create(),o=c.create(),function(t,e,n,s,u,d){var f=this.direction.array,p=this.origin.array;t=t.array,e=e.array,n=n.array,c.sub(i,e,t),c.sub(r,n,t),c.cross(o,r,f);var g=c.dot(i,o);if(s){if(g>-1e-5)return null}else if(g>-1e-5&&g1)return null;c.cross(o,i,a);var v=c.dot(f,o)/g;if(v<0||v>1||m+v>1)return null;c.cross(o,i,r);var y=-c.dot(a,o)/g;return y<0?null:(u||(u=new l.a),d&&l.a.set(d,1-m-v,m,v),c.scaleAndAdd(u.array,p,f,y),u)}),applyTransform:function(t){l.a.add(this.direction,this.direction,this.origin),l.a.transformMat4(this.origin,this.origin,t),l.a.transformMat4(this.direction,this.direction,t),l.a.sub(this.direction,this.direction,this.origin),l.a.normalize(this.direction,this.direction)},copy:function(t){l.a.copy(this.origin,t.origin),l.a.copy(this.direction,t.direction)},clone:function(){var t=new d;return t.copy(this),t}},e.a=d},function(t,e,n){"use strict";var i,r,a=n(1),o=n.n(a),s=o.a.quat,l=function(t,e,n,i){t=t||0,e=e||0,n=n||0,i=void 0===i?1:i,this.array=s.fromValues(t,e,n,i),this._dirty=!0};l.prototype={constructor:l,add:function(t){return s.add(this.array,this.array,t.array),this._dirty=!0,this},calculateW:function(){return s.calculateW(this.array,this.array),this._dirty=!0,this},set:function(t,e,n,i){return this.array[0]=t,this.array[1]=e,this.array[2]=n,this.array[3]=i,this._dirty=!0,this},setArray:function(t){return this.array[0]=t[0],this.array[1]=t[1],this.array[2]=t[2],this.array[3]=t[3],this._dirty=!0,this},clone:function(){return new l(this.x,this.y,this.z,this.w)},conjugate:function(){return s.conjugate(this.array,this.array),this._dirty=!0,this},copy:function(t){return s.copy(this.array,t.array),this._dirty=!0,this},dot:function(t){return s.dot(this.array,t.array)},fromMat3:function(t){return s.fromMat3(this.array,t.array),this._dirty=!0,this},fromMat4:(i=o.a.mat3,r=i.create(),function(t){return i.fromMat4(r,t.array),i.transpose(r,r),s.fromMat3(this.array,r),this._dirty=!0,this}),identity:function(){return s.identity(this.array),this._dirty=!0,this},invert:function(){return s.invert(this.array,this.array),this._dirty=!0,this},len:function(){return s.len(this.array)},length:function(){return s.length(this.array)},lerp:function(t,e,n){return s.lerp(this.array,t.array,e.array,n),this._dirty=!0,this},mul:function(t){return s.mul(this.array,this.array,t.array),this._dirty=!0,this},mulLeft:function(t){return s.multiply(this.array,t.array,this.array),this._dirty=!0,this},multiply:function(t){return s.multiply(this.array,this.array,t.array),this._dirty=!0,this},multiplyLeft:function(t){return s.multiply(this.array,t.array,this.array),this._dirty=!0,this},normalize:function(){return s.normalize(this.array,this.array),this._dirty=!0,this},rotateX:function(t){return s.rotateX(this.array,this.array,t),this._dirty=!0,this},rotateY:function(t){return s.rotateY(this.array,this.array,t),this._dirty=!0,this},rotateZ:function(t){return s.rotateZ(this.array,this.array,t),this._dirty=!0,this},rotationTo:function(t,e){return s.rotationTo(this.array,t.array,e.array),this._dirty=!0,this},setAxes:function(t,e,n){return s.setAxes(this.array,t.array,e.array,n.array),this._dirty=!0,this},setAxisAngle:function(t,e){return s.setAxisAngle(this.array,t.array,e),this._dirty=!0,this},slerp:function(t,e,n){return s.slerp(this.array,t.array,e.array,n),this._dirty=!0,this},sqrLen:function(){return s.sqrLen(this.array)},squaredLength:function(){return s.squaredLength(this.array)},fromEuler:function(t,e){return l.fromEuler(this,t,e)},toString:function(){return"["+Array.prototype.join.call(this.array,",")+"]"},toArray:function(){return Array.prototype.slice.call(this.array)}};var u=Object.defineProperty;if(u){var c=l.prototype;u(c,"x",{get:function(){return this.array[0]},set:function(t){this.array[0]=t,this._dirty=!0}}),u(c,"y",{get:function(){return this.array[1]},set:function(t){this.array[1]=t,this._dirty=!0}}),u(c,"z",{get:function(){return this.array[2]},set:function(t){this.array[2]=t,this._dirty=!0}}),u(c,"w",{get:function(){return this.array[3]},set:function(t){this.array[3]=t,this._dirty=!0}})}l.add=function(t,e,n){return s.add(t.array,e.array,n.array),t._dirty=!0,t},l.set=function(t,e,n,i,r){s.set(t.array,e,n,i,r),t._dirty=!0},l.copy=function(t,e){return s.copy(t.array,e.array),t._dirty=!0,t},l.calculateW=function(t,e){return s.calculateW(t.array,e.array),t._dirty=!0,t},l.conjugate=function(t,e){return s.conjugate(t.array,e.array),t._dirty=!0,t},l.identity=function(t){return s.identity(t.array),t._dirty=!0,t},l.invert=function(t,e){return s.invert(t.array,e.array),t._dirty=!0,t},l.dot=function(t,e){return s.dot(t.array,e.array)},l.len=function(t){return s.length(t.array)},l.lerp=function(t,e,n,i){return s.lerp(t.array,e.array,n.array,i),t._dirty=!0,t},l.slerp=function(t,e,n,i){return s.slerp(t.array,e.array,n.array,i),t._dirty=!0,t},l.multiply=l.mul=function(t,e,n){return s.multiply(t.array,e.array,n.array),t._dirty=!0,t},l.rotateX=function(t,e,n){return s.rotateX(t.array,e.array,n),t._dirty=!0,t},l.rotateY=function(t,e,n){return s.rotateY(t.array,e.array,n),t._dirty=!0,t},l.rotateZ=function(t,e,n){return s.rotateZ(t.array,e.array,n),t._dirty=!0,t},l.setAxisAngle=function(t,e,n){return s.setAxisAngle(t.array,e.array,n),t._dirty=!0,t},l.normalize=function(t,e){return s.normalize(t.array,e.array),t._dirty=!0,t},l.squaredLength=l.sqrLen=function(t){return s.sqrLen(t.array)},l.fromMat3=function(t,e){return s.fromMat3(t.array,e.array),t._dirty=!0,t},l.setAxes=function(t,e,n,i){return s.setAxes(t.array,e.array,n.array,i.array),t._dirty=!0,t},l.rotationTo=function(t,e,n){return s.rotationTo(t.array,e.array,n.array),t._dirty=!0,t},l.fromEuler=function(t,e,n){t._dirty=!0,e=e.array;var i=t.array,r=Math.cos(e[0]/2),a=Math.cos(e[1]/2),o=Math.cos(e[2]/2),s=Math.sin(e[0]/2),l=Math.sin(e[1]/2),u=Math.sin(e[2]/2);switch(n=(n||"XYZ").toUpperCase()){case"XYZ":i[0]=s*a*o+r*l*u,i[1]=r*l*o-s*a*u,i[2]=r*a*u+s*l*o,i[3]=r*a*o-s*l*u;break;case"YXZ":i[0]=s*a*o+r*l*u,i[1]=r*l*o-s*a*u,i[2]=r*a*u-s*l*o,i[3]=r*a*o+s*l*u;break;case"ZXY":i[0]=s*a*o-r*l*u,i[1]=r*l*o+s*a*u,i[2]=r*a*u+s*l*o,i[3]=r*a*o-s*l*u;break;case"ZYX":i[0]=s*a*o-r*l*u,i[1]=r*l*o+s*a*u,i[2]=r*a*u-s*l*o,i[3]=r*a*o+s*l*u;break;case"YZX":i[0]=s*a*o+r*l*u,i[1]=r*l*o+s*a*u,i[2]=r*a*u-s*l*o,i[3]=r*a*o-s*l*u;break;case"XZY":i[0]=s*a*o-r*l*u,i[1]=r*l*o-s*a*u,i[2]=r*a*u+s*l*o,i[3]=r*a*o+s*l*u}},e.a=l},function(t,e,n){"use strict";var i,r=n(28),a=n(9),o=n(52),s=n(49),l=n(1),u=n.n(l),c=u.a.vec3,h=u.a.vec4,d=r.a.extend((function(){return{projectionMatrix:new a.a,invProjectionMatrix:new a.a,viewMatrix:new a.a,frustum:new o.a}}),(function(){this.update(!0)}),{update:function(t){r.a.prototype.update.call(this,t),a.a.invert(this.viewMatrix,this.worldTransform),this.updateProjectionMatrix(),a.a.invert(this.invProjectionMatrix,this.projectionMatrix),this.frustum.setFromProjection(this.projectionMatrix)},setViewMatrix:function(t){a.a.copy(this.viewMatrix,t),a.a.invert(this.worldTransform,t),this.decomposeWorldTransform()},decomposeProjectionMatrix:function(){},setProjectionMatrix:function(t){a.a.copy(this.projectionMatrix,t),a.a.invert(this.invProjectionMatrix,t),this.decomposeProjectionMatrix()},updateProjectionMatrix:function(){},castRay:(i=h.create(),function(t,e){var n=void 0!==e?e:new s.a,r=t.array[0],a=t.array[1];return h.set(i,r,a,-1,1),h.transformMat4(i,i,this.invProjectionMatrix.array),h.transformMat4(i,i,this.worldTransform.array),c.scale(n.origin.array,i,1/i[3]),h.set(i,r,a,1,1),h.transformMat4(i,i,this.invProjectionMatrix.array),h.transformMat4(i,i,this.worldTransform.array),c.scale(i,i,1/i[3]),c.sub(n.direction.array,i,n.origin.array),c.normalize(n.direction.array,n.direction.array),n.direction._dirty=!0,n.origin._dirty=!0,n})});e.a=d},function(t,e,n){"use strict";n(4);var i,r=n(15),a=n(67),o=n(1),s=n.n(o).a.vec3,l=s.set,u=s.copy,c=s.transformMat4,h=Math.min,d=Math.max,f=function(){this.planes=[];for(var t=0;t<6;t++)this.planes.push(new a.a);for(this.boundingBox=new r.a,this.vertices=[],t=0;t<8;t++)this.vertices[t]=s.fromValues(0,0,0)};f.prototype={setFromProjection:function(t){var e=this.planes,n=t.array,i=n[0],r=n[1],a=n[2],o=n[3],s=n[4],u=n[5],c=n[6],h=n[7],d=n[8],f=n[9],p=n[10],g=n[11],m=n[12],v=n[13],y=n[14],x=n[15];l(e[0].normal.array,o-i,h-s,g-d),e[0].distance=-(x-m),e[0].normalize(),l(e[1].normal.array,o+i,h+s,g+d),e[1].distance=-(x+m),e[1].normalize(),l(e[2].normal.array,o+r,h+u,g+f),e[2].distance=-(x+v),e[2].normalize(),l(e[3].normal.array,o-r,h-u,g-f),e[3].distance=-(x-v),e[3].normalize(),l(e[4].normal.array,o-a,h-c,g-p),e[4].distance=-(x-y),e[4].normalize(),l(e[5].normal.array,o+a,h+c,g+p),e[5].distance=-(x+y),e[5].normalize();var b=this.boundingBox;if(0===x){var _=u/i,E=-y/(p-1),w=-y/(p+1),T=-w/u,S=-E/u;b.min.set(-T*_,-T,w),b.max.set(T*_,T,E);var M=this.vertices;l(M[0],-T*_,-T,w),l(M[1],-T*_,T,w),l(M[2],T*_,-T,w),l(M[3],T*_,T,w),l(M[4],-S*_,-S,E),l(M[5],-S*_,S,E),l(M[6],S*_,-S,E),l(M[7],S*_,S,E)}else{var C=(-1-m)/i,A=(1-m)/i,O=(1-v)/u,N=(-1-v)/u,P=(-1-y)/p,L=(1-y)/p;b.min.set(Math.min(C,A),Math.min(N,O),Math.min(L,P)),b.max.set(Math.max(A,C),Math.max(O,N),Math.max(P,L));var R=b.min.array,D=b.max.array;M=this.vertices,l(M[0],R[0],R[1],R[2]),l(M[1],R[0],D[1],R[2]),l(M[2],D[0],R[1],R[2]),l(M[3],D[0],D[1],R[2]),l(M[4],R[0],R[1],D[2]),l(M[5],R[0],D[1],D[2]),l(M[6],D[0],R[1],D[2]),l(M[7],D[0],D[1],D[2])}},getTransformedBoundingBox:(i=s.create(),function(t,e){var n=this.vertices,r=e.array,a=t.min,o=t.max,s=a.array,l=o.array,f=n[0];c(i,f,r),u(s,i),u(l,i);for(var p=1;p<8;p++)f=n[p],c(i,f,r),s[0]=h(i[0],s[0]),s[1]=h(i[1],s[1]),s[2]=h(i[2],s[2]),l[0]=d(i[0],l[0]),l[1]=d(i[1],l[1]),l[2]=d(i[2],l[2]);return a._dirty=!0,o._dirty=!0,t})},e.a=f},function(t,e){var n=function(){this.head=null,this.tail=null,this._len=0},i=n.prototype;i.insert=function(t){var e=new r(t);return this.insertEntry(e),e},i.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t):this.head=this.tail=t,this._len++},i.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._len--},i.len=function(){return this._len},i.clear=function(){this.head=this.tail=null,this._len=0};var r=function(t){this.value=t,this.next,this.prev},a=function(t){this._list=new n,this._map={},this._maxSize=t||10,this._lastRemovedEntry=null},o=a.prototype;o.put=function(t,e){var n=this._list,i=this._map,a=null;if(null==i[t]){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=e:s=new r(e),s.key=t,n.insertEntry(s),i[t]=s}return a},o.get=function(t){var e=this._map[t],n=this._list;if(null!=e)return e!==n.tail&&(n.remove(e),n.insertEntry(e)),e.value},o.clear=function(){this._list.clear(),this._map={}};var s=a;t.exports=s},function(t,e,n){"use strict";var i=n(5),r=n(25),a=n(102),o=n(55),s=n(56),l=n(29),u=n(104),c=n(105),h={loadTexture:function(t,e,n,a){if("function"==typeof e?(a=n=e,e={}):e=e||{},"string"==typeof t){if(t.match(/.hdr$/)||"hdr"===e.fileType)return o=new i.a({width:0,height:0,sRGB:!1}),h._fetchTexture(t,(function(t){c.a.parseRGBE(t,o,e.exposure),o.dirty(),n&&n(o)}),a),o;t.match(/.dds$/)||"dds"===e.fileType?(o=new i.a({width:0,height:0}),h._fetchTexture(t,(function(t){u.a.parse(t,o),o.dirty(),n&&n(o)}),a)):((o=new i.a).load(t),o.success(n),o.error(a))}else if("object"==typeof t&&void 0!==t.px){var o;(o=new r.a).load(t),o.success(n),o.error(a)}return o},loadPanorama:function(t,e,n,i,r,a){var o=this;"function"==typeof i?(a=r=i,i={}):i=i||{},h.loadTexture(e,i,(function(e){e.flipY=i.flipY||!1,o.panoramaToCubeMap(t,e,n,i),e.dispose(t),r&&r(n)}),a)},panoramaToCubeMap:function(t,e,n,i){var r=new o.a,a=new s.a({scene:new l.a});return a.material.set("diffuseMap",e),(i=i||{}).encodeRGBM&&a.material.define("fragment","RGBM_ENCODE"),n.sRGB=e.sRGB,r.texture=n,r.render(t,a.scene),r.texture=null,r.dispose(t),n},heightToNormal:function(t,e){var n=document.createElement("canvas"),i=n.width=t.width,r=n.height=t.height,a=n.getContext("2d");a.drawImage(t,0,0,i,r),e=e||!1;for(var o=a.getImageData(0,0,i,r),s=a.createImageData(i,r),l=0;l20)return console.warn("Given image is not a height map"),t}var d,f,p,g;l%(4*i)==0?(d=o.data[l],p=o.data[l+4]):l%(4*i)==4*(i-1)?(d=o.data[l-4],p=o.data[l]):(d=o.data[l-4],p=o.data[l+4]),l<4*i?(f=o.data[l],g=o.data[l+4*i]):l>i*(r-1)*4?(f=o.data[l-4*i],g=o.data[l]):(f=o.data[l-4*i],g=o.data[l+4*i]),s.data[l]=d-p+127,s.data[l+1]=f-g+127,s.data[l+2]=255,s.data[l+3]=255}return a.putImageData(s,0,0),n},isHeightImage:function(t,e,n){if(!t||!t.width||!t.height)return!1;var i=document.createElement("canvas"),r=i.getContext("2d"),a=e||32;n=n||20,i.width=i.height=a,r.drawImage(t,0,0,a,a);for(var o=r.getImageData(0,0,a,a),s=0;sn)return!1}return!0},_fetchTexture:function(t,e,n){a.a.get({url:t,responseType:"arraybuffer",onload:e,onerror:n})},createChessboard:function(t,e,n,r){t=t||512,e=e||64,n=n||"black",r=r||"white";var a=Math.ceil(t/e),o=document.createElement("canvas");o.width=t,o.height=t;var s=o.getContext("2d");s.fillStyle=r,s.fillRect(0,0,t,t),s.fillStyle=n;for(var l=0;l0?this.material.define("fragment","LOD"):this.material.undefine("fragment","LOD"),t.renderPass([this],e)}});e.a=l},function(t,e,n){"use strict";var i=n(2),r=n(143),a=n(144);i.a.Shader.import(a.a),e.a=i.a.Mesh.extend((function(){return{geometry:new r.a({dynamic:!0}),material:new i.a.Material({shader:i.a.createShader("ecgl.labels"),transparent:!0,depthMask:!1}),culling:!1,castShadow:!1,ignorePicking:!0}}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(186),s=n(22),l=n(3),u=n(1),c=n.n(u),h=n(60),d=n(61),f=n(40),p=c.a.vec3;function g(t){this.rootNode=new a.a.Node,this._triangulationResults={},this._shadersMap=a.a.COMMON_SHADERS.reduce((function(t,e){return t[e]=a.a.createShader("ecgl."+e),t}),{}),this._linesShader=a.a.createShader("ecgl.meshLines3D");var e={};a.a.COMMON_SHADERS.forEach((function(t){e[t]=new a.a.Material({shader:a.a.createShader("ecgl."+t)})})),this._groundMaterials=e,this._groundMesh=new a.a.Mesh({geometry:new a.a.PlaneGeometry({dynamic:!0}),castShadow:!1,renderNormal:!0,$ignorePicking:!0}),this._groundMesh.rotation.rotateX(-Math.PI/2),this._labelsBuilder=new d.a(512,512,t),this._labelsBuilder.getMesh().renderOrder=100,this._labelsBuilder.getMesh().material.depthTest=!1,this.rootNode.add(this._labelsBuilder.getMesh()),this._initMeshes(),this._api=t}a.a.Shader.import(f.a),g.prototype={constructor:g,extrudeY:!0,update:function(t,e,n,i,r){var a=t.getData();null==i&&(i=0),null==r&&(r=a.count()),this._startIndex=i,this._endIndex=r-1,this._triangulation(t,i,r);var o=this._getShader(t.get("shading"));this._prepareMesh(t,o,n,i,r),this.rootNode.updateWorldTransform(),this._updateRegionMesh(t,n,i,r);var s=t.coordinateSystem;"geo3D"===s.type&&this._updateGroundPlane(t,s,n);var l=this;this._labelsBuilder.updateData(a,i,r),this._labelsBuilder.getLabelPosition=function(t,e,n){var i=a.getName(t),r=n;if("geo3D"===s.type)return u=s.getRegion(i).center,s.dataToPoint([u[0],u[1],r]);var o=l._triangulationResults[t-l._startIndex],u=l.extrudeY?[(o.max[0]+o.min[0])/2,o.max[1]+r,(o.max[2]+o.min[2])/2]:[(o.max[0]+o.min[0])/2,(o.max[1]+o.min[1])/2,o.max[2]+r]},this._data=a,this._labelsBuilder.updateLabels(),this._updateDebugWireframe(t),this._lastHoverDataIndex=0},_initMeshes:function(){this.rootNode.removeAll();var t,e=this,n=(t=new a.a.Mesh({name:"Polygon",material:new a.a.Material({shader:e._shadersMap.lambert}),culling:!1,geometry:new a.a.Geometry({sortTriangles:!0,dynamic:!0}),ignorePicking:!0,renderNormal:!0}),r.a.util.extend(t.geometry,h.a),t),i=new a.a.Mesh({material:new a.a.Material({shader:this._linesShader}),castShadow:!1,ignorePicking:!0,$ignorePicking:!0,geometry:new s.a({useNativeLine:!1})});this.rootNode.add(n),this.rootNode.add(i),n.material.define("both","VERTEX_COLOR"),n.material.define("fragment","DOUBLE_SIDED"),this._polygonMesh=n,this._linesMesh=i,this.rootNode.add(this._groundMesh)},_getShader:function(t){var e=this._shadersMap[t];return e||(console.warn("Unkown shading "+t),e=this._shadersMap.lambert),e.__shading=t,e},_prepareMesh:function(t,e,n,i,r){for(var o=0,s=0,l=0,u=0,c=i;c65535?new Uint32Array(3*s):new Uint16Array(3*s),f.material.shader!==e&&f.material.attachShader(e,!0),a.a.setMaterialFromModel(e.__shading,f.material,t,n),l>0&&(this._linesMesh.geometry.resetOffset(),this._linesMesh.geometry.setVertexCount(l),this._linesMesh.geometry.setTriangleCount(u)),this._dataIndexOfVertex=new Uint32Array(o),this._vertexRangeOfDataIndex=new Uint32Array(2*(r-i))},_updateRegionMesh:function(t,e,n,i){for(var r=t.getData(),o=0,s=0,u=!1,c=this._polygonMesh,h=this._linesMesh,d=n;d0;T&&(w*=e.getDevicePixelRatio(),this._updateLinesGeometry(h.geometry,t,d,b,w,t.coordinateSystem.transform)),h.invisible=!T,h.material.set({color:y})}(c=this._polygonMesh).material.transparent=u,c.material.depthMask=!u,c.geometry.updateBoundingBox(),c.material.get("normalMap")&&c.geometry.generateTangents(),c.seriesIndex=t.seriesIndex,c.on("mousemove",this._onmousemove,this),c.on("mouseout",this._onmouseout,this)},_updateDebugWireframe:function(t){var e=t.getModel("debug.wireframe");if(e.get("show")){var n=a.a.parseColor(e.get("lineStyle.color")||"rgba(0,0,0,0.5)"),i=l.a.firstNotNull(e.get("lineStyle.width"),1),r=this._polygonMesh;r.geometry.generateBarycentric(),r.material.define("both","WIREFRAME_TRIANGLE"),r.material.set("wireframeLineColor",n),r.material.set("wireframeLineWidth",i)}},_onmousemove:function(t){var e=this._dataIndexOfVertex[t.triangle[0]];null==e&&(e=-1),e!==this._lastHoverDataIndex&&(this.downplay(this._lastHoverDataIndex),this.highlight(e)),this._lastHoverDataIndex=e,this._polygonMesh.dataIndex=e},_onmouseover:function(t){if(t.target){var e=t.target.eventData?this._data.indexOfName(t.target.eventData.name):t.target.dataIndex;null!=e&&(this.highlight(e),this._labelsBuilder.updateLabels([e]))}},_onmouseout:function(t){t.target&&(this.downplay(this._lastHoverDataIndex),this._lastHoverDataIndex=-1,this._polygonMesh.dataIndex=-1)},_updateGroundPlane:function(t,e,n){var i=t.getModel("groundPlane",t);if(this._groundMesh.invisible=!i.get("show",!0),!this._groundMesh.invisible){var r=t.get("shading"),o=this._groundMaterials[r];o||(console.warn("Unkown shading "+r),o=this._groundMaterials.lambert),a.a.setMaterialFromModel(r,o,i,n),o.get("normalMap")&&this._groundMesh.geometry.generateTangents(),this._groundMesh.material=o,this._groundMesh.material.set("color",a.a.parseColor(i.get("color"))),this._groundMesh.scale.set(e.size[0],e.size[2],1)}},_triangulation:function(t,e,n){this._triangulationResults=[];for(var i=[1/0,1/0,1/0],r=[-1/0,-1/0,-1/0],a=t.coordinateSystem,s=e;s1?i:0,P[j][v]=C.points[H+2],l.set(r+j,P[j]),s?(k[0]=(C.points[H]*y[0]-x[0])/_,k[1]=(C.points[H+2]*y[v]-x[v])/_):(k[0]=(U?I:I+G)/_,k[1]=(P[j][m]*y[m]-x[m])/_),c.set(r+j,k)}for(p.sub(L,P[1],P[0]),p.sub(R,P[3],P[0]),p.cross(D,L,R),p.normalize(D,D),j=0;j<4;j++)u.set(r+j,D),f&&h.set(r+j,o);for(j=0;j<6;j++)g[3*a+j]=N[j]+r;r+=4,a+=2,I+=G}}return e.dirty(),{vertexOffset:r,triangleOffset:a}},_getRegionLinesInfo:function(t,e,n){var i=0,r=0;return e.getRegionModel(t).getModel("itemStyle").get("borderWidth")>0&&e.getRegionPolygonCoords(t).forEach((function(t){var e=t.exterior,a=t.interiors;i+=n.getPolylineVertexCount(e),r+=n.getPolylineTriangleCount(e);for(var o=0;othis._endIndex)){e-=this._startIndex;for(var i=this._vertexRangeOfDataIndex[2*e];i=2e4},doSortTriangles:function(t,e){var n=this.indices;if(0===e){var i=this.attributes.position;t=t.array,this._triangleZList&&this._triangleZList.length===this.triangleCount||(this._triangleZList=new Float32Array(this.triangleCount),this._sortedTriangleIndices=new Uint32Array(this.triangleCount),this._indicesTmp=new n.constructor(n.length),this._triangleZListTmp=new Float32Array(this.triangleCount));for(var r,u=0,c=0;c0,n={},i=0;i2?(m=this._updateSymbolSprite(t,p,d,f),u.enableTexture("sprite")):u.disableTexture("sprite"),h.position.init(r-i);var v=[];if(g){u.undefine("VERTEX_SIZE"),u.undefine("VERTEX_COLOR");var y=l.getVisual("color"),x=l.getVisual("opacity");a.a.parseColor(y,v),v[3]*=x,u.set({color:v,u_Size:d.maxSize*this._sizeScale})}else u.set({color:[1,1,1,1]}),u.define("VERTEX_SIZE"),u.define("VERTEX_COLOR"),h.size.init(r-i),h.color.init(r-i),this._originalOpacity=new Float32Array(r-i);for(var b=l.getLayout("points"),_=h.position.value,E=0;E1?(s[0]=n.maxSize,s[1]=n.maxSize/n.aspect):(s[1]=n.maxSize,s[0]=n.maxSize*n.aspect),s[0]=s[0]||1,s[1]=s[1]||1,this._symbolType===n.type&&(r=this._symbolSize,a=s,r&&a&&r[0]===a[0]&&r[1]===a[1])&&this._lineWidth===e.lineWidth||(o.a.createSymbolSprite(n.type,s,{fill:"#fff",lineWidth:e.lineWidth,stroke:"transparent",shadowColor:"transparent",minMargin:Math.min(s[0]/2,10)},this._spriteImageCanvas),o.a.createSDFFromCanvas(this._spriteImageCanvas,Math.min(this._spriteImageCanvas.width,32),20,this._mesh.material.get("sprite").image),this._symbolType=n.type,this._symbolSize=s,this._lineWidth=e.lineWidth),this._spriteImageCanvas.width/n.maxSize*i},_updateMaterial:function(t,e){var n="lighter"===t.get("blendMode")?a.a.additiveBlend:null,i=this._mesh.material;i.blend=n,i.set("lineWidth",e.lineWidth/20);var r=a.a.parseColor(e.stroke);i.set("strokeColor",r),i.transparent=!0,i.depthMask=!1,i.depthTest=!this.is2D,i.sortVertices=!this.is2D},_updateLabelBuilder:function(t,e,n){var i=t.getData(),r=this._mesh.geometry,a=r.attributes.position.value,o=(e=this._startDataIndex,this._mesh.sizeScale);this._labelsBuilder.updateData(i,e,n),this._labelsBuilder.getLabelPosition=function(t,n,i){var r=3*(t-e);return[a[r],a[r+1],a[r+2]]},this._labelsBuilder.getLabelDistance=function(t,n,i){return r.attributes.size.get(t-e)/o/2+i},this._labelsBuilder.updateLabels()},_updateAnimation:function(t){a.a.updateVertexAnimation([["prevPosition","position"],["prevSize","size"]],this._prevMesh,this._mesh,t)},_updateHandler:function(t,e,n){var i,r=t.getData(),a=this._mesh,o=this,s=-1,l=t.coordinateSystem&&"cartesian3D"===t.coordinateSystem.type;l&&(i=t.coordinateSystem.model),a.seriesIndex=t.seriesIndex,a.off("mousemove"),a.off("mouseout"),a.on("mousemove",(function(e){var u=e.vertexIndex+o._startDataIndex;u!==s&&(this.highlightOnMouseover&&(this.downplay(r,s),this.highlight(r,u),this._labelsBuilder.updateLabels([u])),l&&n.dispatchAction({type:"grid3DShowAxisPointer",value:[r.get(t.coordDimToDataDim("x")[0],u),r.get(t.coordDimToDataDim("y")[0],u),r.get(t.coordDimToDataDim("z")[0],u)],grid3DIndex:i.componentIndex})),a.dataIndex=u,s=u}),this),a.on("mouseout",(function(t){var e=t.vertexIndex+o._startDataIndex;this.highlightOnMouseover&&(this.downplay(r,e),this._labelsBuilder.updateLabels()),s=-1,a.dataIndex=-1,l&&n.dispatchAction({type:"grid3DHideAxisPointer",grid3DIndex:i.componentIndex})}),this)},updateLayout:function(t,e,n){var i=t.getData();if(this._mesh){var r=this._mesh.geometry.attributes.position.value,a=i.getLayout("points");if(this.is2D)for(var o=0;othis._endDataIndex||ethis._endDataIndex||e.05&&(a=!0),f!==o&&(s=!0),o=f,i=h}return a&&console.warn("Different symbol width / height ratio will be ignored."),s&&console.warn("Different symbol type will be ignored."),{maxSize:l,type:o,aspect:i}}},e.a=h},function(t,e,n){"use strict";e.a="@export clay.prez.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nattribute vec3 position : POSITION;\n@import clay.chunk.skinning_header\nvoid main()\n{\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);\n}\n@end\n@export clay.prez.fragment\nvoid main()\n{\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);\n}\n@end"},function(t,e,n){"use strict";var i,r=n(28),a=n(11),o=0,s=null,l=!0,u=function(){this.triangleCount=0,this.vertexCount=0,this.drawCallCount=0};function c(t,e,n){this.availableAttributes=t,this.availableAttributeSymbols=e,this.indicesBuffer=n,this.vao=null}var h,d=r.a.extend({material:null,geometry:null,mode:a.a.TRIANGLES,_drawCache:null,_renderInfo:null},(function(){this._drawCache={},this._renderInfo=new u}),{__program:null,lightGroup:0,renderOrder:0,lineWidth:1,culling:!0,cullFace:a.a.BACK,frontFace:a.a.CCW,frustumCulling:!0,receiveShadow:!0,castShadow:!0,ignorePicking:!1,ignorePreZ:!1,ignoreGBuffer:!1,isRenderable:function(){return this.geometry&&this.material&&this.material.shader&&!this.invisible&&this.geometry.vertexCount>0},beforeRender:function(t){},afterRender:function(t,e){},getBoundingBox:function(t,e){return e=r.a.prototype.getBoundingBox.call(this,t,e),this.geometry&&this.geometry.boundingBox&&e.union(this.geometry.boundingBox),e},render:function(t,e,n){var r=t.gl,u=(e=e||this.material).shader,h=this.geometry,d=this.mode,f=h.vertexCount,p=(h.isUseIndices(),t.getGLExtension("OES_element_index_uint")&&f>65535?r.UNSIGNED_INT:r.UNSIGNED_SHORT),g=t.getGLExtension("OES_vertex_array_object"),m=!h.dynamic,v=this._renderInfo;v.vertexCount=f,v.triangleCount=0,v.drawCallCount=0;var y=!1;if(((i=t.__uid__+"-"+h.__uid__+"-"+n.__uid__)!==o||g&&m||h._cache.isDirty("any"))&&(y=!0),o=i,y){var x=this._drawCache[i];if(!x){var b=h.getBufferChunks(t);if(!b)return;x=[];for(var _=0;_>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t},nearestPowerOfTwo:function(t){return Math.pow(2,Math.round(Math.log(t)/Math.LN2))}};e.a=i},function(t,e,n){"use strict";var i,r,a,o,s=n(4),l=n(1),u=n.n(l),c=u.a.vec3,h=u.a.mat4,d=u.a.vec4,f=function(t,e){this.normal=t||new s.a(0,1,0),this.distance=e||0};f.prototype={constructor:f,distanceToPoint:function(t){return c.dot(t.array,this.normal.array)-this.distance},projectPoint:function(t,e){e||(e=new s.a);var n=this.distanceToPoint(t);return c.scaleAndAdd(e.array,t.array,this.normal.array,-n),e._dirty=!0,e},normalize:function(){var t=1/c.len(this.normal.array);c.scale(this.normal.array,t),this.distance*=t},intersectFrustum:function(t){for(var e=t.vertices,n=this.normal.array,i=c.dot(e[0].array,n)>this.distance,r=1;r<8;r++)if(c.dot(e[r].array,n)>this.distance!=i)return!0},intersectLine:(o=c.create(),function(t,e,n){var i=this.distanceToPoint(t),r=this.distanceToPoint(e);if(i>0&&r>0||i<0&&r<0)return null;var a=this.normal.array,l=this.distance,u=t.array;c.sub(o,e.array,t.array),c.normalize(o,o);var h=c.dot(a,o);if(0===h)return null;n||(n=new s.a);var d=(c.dot(a,u)-l)/h;return c.scaleAndAdd(n.array,u,o,-d),n._dirty=!0,n}),applyTransform:(i=h.create(),r=d.create(),a=d.create(),a[3]=1,function(t){t=t.array,c.scale(a,this.normal.array,this.distance),d.transformMat4(a,a,t),this.distance=c.dot(a,this.normal.array),h.invert(i,t),h.transpose(i,i),r[3]=0,c.copy(r,this.normal.array),d.transformMat4(r,r,i),c.copy(this.normal.array,r)}),copy:function(t){c.copy(this.normal.array,t.normal.array),this.normal._dirty=!0,this.distance=t.distance},clone:function(){var t=new f;return t.copy(this),t}},e.a=f},function(t,e,n){"use strict";var i=n(13),r=n(15),a=i.a.extend({dynamic:!1,widthSegments:40,heightSegments:20,phiStart:0,phiLength:2*Math.PI,thetaStart:0,thetaLength:Math.PI,radius:1},(function(){this.build()}),{build:function(){var t=this.heightSegments,e=this.widthSegments,n=this.attributes.position,i=this.attributes.texcoord0,a=this.attributes.normal,o=(e+1)*(t+1);n.init(o),i.init(o),a.init(o);var s,l,u,c,h,d,f,p,g,m,v,y=o>65535?Uint32Array:Uint16Array,x=this.indices=new y(e*t*6),b=this.radius,_=this.phiStart,E=this.phiLength,w=this.thetaStart,T=this.thetaLength,S=[],M=[],C=0,A=1/(b=this.radius);for(f=0;f<=t;f++)for(d=0;d<=e;d++)c=d/e,h=f/t,s=-b*Math.cos(_+c*E)*Math.sin(w+h*T),l=b*Math.cos(w+h*T),u=b*Math.sin(_+c*E)*Math.sin(w+h*T),S[0]=s,S[1]=l,S[2]=u,M[0]=c,M[1]=h,n.set(C,S),i.set(C,M),S[0]*=A,S[1]*=A,S[2]*=A,a.set(C,S),C++;var O=e+1,N=0;for(f=0;fo&&(r=this._x=0,a+=this._rowHeight+l,this._y=a,this._rowHeight=0),this._x+=e+l,this._rowHeight=Math.max(this._rowHeight,n),a+n+l>s)return null;t.position[0]+=this.offsetX*this.dpr+r,t.position[1]+=this.offsetY*this.dpr+a,this._zr.add(t);var u=[this.offsetX/this.width,this.offsetY/this.height];return[[r/o+u[0],a/s+u[1]],[(r+e)/o+u[0],(a+n)/s+u[1]]]},_fitElement:function(t,e,n){var i=t.getBoundingRect(),r=e/i.width,a=n/i.height;t.position=[-i.x*r,-i.y*a],t.scale=[r,a],t.update()}},s.prototype={clear:function(){for(var t=0;t=t)){var r=(n+this._nodeWidth)*this._dpr,a=(i+this._nodeHeight)*this._dpr;try{this._zr.resize({width:r,height:a})}catch(t){this._canvas.width=r,this._canvas.height=a}var s=new o(this._zr,n,i,this._nodeWidth,this._nodeHeight,this._gap,this._dpr);return this._textureAtlasNodes.push(s),s}console.error("Too much labels. Some will be ignored.")},add:function(t,e,n){if(this._coords[t.id])return console.warn("Element already been add"),this._coords[t.id];var i=this._getCurrentNode().add(t,e,n);if(!i){var r=this._expand();if(!r)return;i=r.add(t,e,n)}return this._coords[t.id]=i,i},getCoordsScale:function(){var t=this._dpr;return[this._nodeWidth/this._canvas.width*t,this._nodeHeight/this._canvas.height*t]},getCoords:function(t){return this._coords[t]}},e.a=s},function(t,e,n){"use strict";e.a=function(t,e,n){var i,r=t.scale;return"ordinal"===r.type&&("function"==typeof n?(i=r.getTicks()[e],!n(i,r.getLabel(i))):e%(n+1))}},function(t,e,n){var i,r,a,o,s=n(76),l=n(77),u=s.applyTransform,c=Math.min,h=Math.max;function d(t,e,n,i){n<0&&(t+=n,n=-n),i<0&&(e+=i,i=-i),this.x=t,this.y=e,this.width=n,this.height=i}d.prototype={constructor:d,union:function(t){var e=c(t.x,this.x),n=c(t.y,this.y);this.width=h(t.x+t.width,this.x+this.width)-e,this.height=h(t.y+t.height,this.y+this.height)-n,this.x=e,this.y=n},applyTransform:(i=[],r=[],a=[],o=[],function(t){if(t){i[0]=a[0]=this.x,i[1]=o[1]=this.y,r[0]=o[0]=this.x+this.width,r[1]=a[1]=this.y+this.height,u(i,i,t),u(r,r,t),u(a,a,t),u(o,o,t),this.x=c(i[0],r[0],a[0],o[0]),this.y=c(i[1],r[1],a[1],o[1]);var e=h(i[0],r[0],a[0],o[0]),n=h(i[1],r[1],a[1],o[1]);this.width=e-this.x,this.height=n-this.y}}),calculateTransform:function(t){var e=this,n=t.width/e.width,i=t.height/e.height,r=l.create();return l.translate(r,r,[-e.x,-e.y]),l.scale(r,r,[n,i]),l.translate(r,r,[t.x,t.y]),r},intersect:function(t){if(!t)return!1;t instanceof d||(t=d.create(t));var e=this,n=e.x,i=e.x+e.width,r=e.y,a=e.y+e.height,o=t.x,s=t.x+t.width,l=t.y,u=t.y+t.height;return!(i=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height},clone:function(){return new d(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},d.create=function(t){return new d(t.x,t.y,t.width,t.height)};var f=d;t.exports=f},function(t,e){var n="undefined"==typeof Float32Array?Array:Float32Array;function i(t){return Math.sqrt(a(t))}var r=i;function a(t){return t[0]*t[0]+t[1]*t[1]}var o=a;function s(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var l=s;function u(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var c=u;e.create=function(t,e){var i=new n(2);return null==t&&(t=0),null==e&&(e=0),i[0]=t,i[1]=e,i},e.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},e.clone=function(t){var e=new n(2);return e[0]=t[0],e[1]=t[1],e},e.set=function(t,e,n){return t[0]=e,t[1]=n,t},e.add=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t},e.scaleAndAdd=function(t,e,n,i){return t[0]=e[0]+n[0]*i,t[1]=e[1]+n[1]*i,t},e.sub=function(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t},e.len=i,e.length=r,e.lenSquare=a,e.lengthSquare=o,e.mul=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t},e.div=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t},e.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},e.scale=function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t},e.normalize=function(t,e){var n=i(e);return 0===n?(t[0]=0,t[1]=0):(t[0]=e[0]/n,t[1]=e[1]/n),t},e.distance=s,e.dist=l,e.distanceSquare=u,e.distSquare=c,e.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},e.lerp=function(t,e,n,i){return t[0]=e[0]+i*(n[0]-e[0]),t[1]=e[1]+i*(n[1]-e[1]),t},e.applyTransform=function(t,e,n){var i=e[0],r=e[1];return t[0]=n[0]*i+n[2]*r+n[4],t[1]=n[1]*i+n[3]*r+n[5],t},e.min=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t},e.max=function(t,e,n){return t[0]=Math.max(e[0],n[0]),t[1]=Math.max(e[1],n[1]),t}},function(t,e){var n="undefined"==typeof Float32Array?Array:Float32Array;function i(){var t=new n(6);return r(t),t}function r(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function a(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}e.create=i,e.identity=r,e.copy=a,e.mul=function(t,e,n){var i=e[0]*n[0]+e[2]*n[1],r=e[1]*n[0]+e[3]*n[1],a=e[0]*n[2]+e[2]*n[3],o=e[1]*n[2]+e[3]*n[3],s=e[0]*n[4]+e[2]*n[5]+e[4],l=e[1]*n[4]+e[3]*n[5]+e[5];return t[0]=i,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=l,t},e.translate=function(t,e,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+n[0],t[5]=e[5]+n[1],t},e.rotate=function(t,e,n){var i=e[0],r=e[2],a=e[4],o=e[1],s=e[3],l=e[5],u=Math.sin(n),c=Math.cos(n);return t[0]=i*c+o*u,t[1]=-i*u+o*c,t[2]=r*c+s*u,t[3]=-r*u+c*s,t[4]=c*a+u*l,t[5]=c*l-u*a,t},e.scale=function(t,e,n){var i=n[0],r=n[1];return t[0]=e[0]*i,t[1]=e[1]*r,t[2]=e[2]*i,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*r,t},e.invert=function(t,e){var n=e[0],i=e[2],r=e[4],a=e[1],o=e[3],s=e[5],l=n*o-a*i;return l?(l=1/l,t[0]=o*l,t[1]=-a*l,t[2]=-i*l,t[3]=n*l,t[4]=(i*s-o*r)*l,t[5]=(a*r-n*s)*l,t):null},e.clone=function(t){var e=i();return a(e,t),e}},function(t,e,n){var i=n(12),r=1e-4,a=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function o(t){return Math.floor(Math.log(t)/Math.LN10)}e.linearMap=function(t,e,n,i){var r=e[1]-e[0],a=n[1]-n[0];if(0===r)return 0===a?n[0]:(n[0]+n[1])/2;if(i)if(r>0){if(t<=e[0])return n[0];if(t>=e[1])return n[1]}else{if(t>=e[0])return n[0];if(t<=e[1])return n[1]}else{if(t===e[0])return n[0];if(t===e[1])return n[1]}return(t-e[0])/r*a+n[0]},e.parsePercent=function(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%"}return"string"==typeof t?(n=t,n.replace(/^\s+/,"").replace(/\s+$/,"")).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):null==t?NaN:+t;var n},e.round=function(t,e,n){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),t=(+t).toFixed(e),n?t:+t},e.asc=function(t){return t.sort((function(t,e){return t-e})),t},e.getPrecision=function(t){if(t=+t,isNaN(t))return 0;for(var e=1,n=0;Math.round(t*e)/e!==t;)e*=10,n++;return n},e.getPrecisionSafe=function(t){var e=t.toString(),n=e.indexOf("e");if(n>0){var i=+e.slice(n+1);return i<0?-i:0}var r=e.indexOf(".");return r<0?0:e.length-1-r},e.getPixelPrecision=function(t,e){var n=Math.log,i=Math.LN10,r=Math.floor(n(t[1]-t[0])/i),a=Math.round(n(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-r+a,0),20);return isFinite(o)?o:20},e.getPercentWithPrecision=function(t,e,n){if(!t[e])return 0;var r=i.reduce(t,(function(t,e){return t+(isNaN(e)?0:e)}),0);if(0===r)return 0;for(var a=Math.pow(10,n),o=i.map(t,(function(t){return(isNaN(t)?0:t)/r*a*100})),s=100*a,l=i.map(o,(function(t){return Math.floor(t)})),u=i.reduce(l,(function(t,e){return t+e}),0),c=i.map(o,(function(t,e){return t-l[e]}));uh&&(h=c[f],d=f);++l[d],c[d]=0,++u}return l[e]/a},e.MAX_SAFE_INTEGER=9007199254740991,e.remRadian=function(t){var e=2*Math.PI;return(t%e+e)%e},e.isRadianAroundZero=function(t){return t>-1e-4&&t=-20?+t.toFixed(n<0?-n:0):t},e.reformIntervals=function(t){t.sort((function(t,e){return s(t,e,0)?-1:1}));for(var e=-1/0,n=1,i=0;i=0}},function(t,e,n){"use strict";var i=n(5),r=n(11),a=n(21),o=function(){this._pool={},this._allocatedTextures=[]};o.prototype={constructor:o,get:function(t){var e=u(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]);var n=this._pool[e];if(!n.length){var r=new i.a(t);return this._allocatedTextures.push(r),r}return n.pop()},put:function(t){var e=u(t);this._pool.hasOwnProperty(e)||(this._pool[e]=[]),this._pool[e].push(t)},clear:function(t){for(var e=0;eh&&u.push({pivot:Math.floor((c+h)/2),left:h,right:c}),h=s[l].pivot+1,(c=s[l].right)>h&&u.push({pivot:Math.floor((c+h)/2),left:h,right:c})}s=this._parts=u}else for(l=0;l65535?this.indices instanceof Uint16Array&&(this.indices=new Uint32Array(this.indices)):this.indices instanceof Uint32Array&&(this.indices=new Uint16Array(this.indices)))},setTriangleCount:function(t){this.triangleCount!==t&&(this.indices=0===t?null:this.vertexCount>65535?new Uint32Array(3*t):new Uint16Array(3*t))},_getCubicCurveApproxStep:function(t,e,n,i){return 1/(g.dist(t,e)+g.dist(n,e)+g.dist(i,n)+1)*this.segmentScale},getCubicCurveVertexCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?2*a:2*a+2},getCubicCurveTriangleCount:function(t,e,n,i){var r=this._getCubicCurveApproxStep(t,e,n,i),a=Math.ceil(1/r);return this.useNativeLine?0:2*a},getLineVertexCount:function(){return this.getPolylineVertexCount(m)},getLineTriangleCount:function(){return this.getPolylineTriangleCount(m)},getPolylineVertexCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/2,this.useNativeLine?2*(e-1):2*(e-1)+2},getPolylineTriangleCount:function(t){var e;return e="number"==typeof t?t:"number"!=typeof t[0]?t.length:t.length/2,this.useNativeLine?0:2*(e-1)},addCubicCurve:function(t,e,n,i,r,a){null==a&&(a=1);var o=t[0],s=t[1],l=e[0],u=e[1],c=n[0],h=n[1],d=i[0],f=i[1],p=this._getCubicCurveApproxStep(t,e,n,i),g=p*p,m=g*p,v=3*p,y=3*g,x=6*g,b=6*m,_=o-2*l+c,E=s-2*u+h,w=3*(l-c)-o+d,T=3*(u-h)-s+f,S=o,M=s,C=(l-o)*v+_*y+w*m,A=(u-s)*v+E*y+T*m,O=_*x+w*b,N=E*x+T*b,P=w*b,L=T*b,R=0,D=0,k=Math.ceil(1/p),I=new Float32Array(3*(k+1)),B=(I=[],0);for(D=0;D1&&(S=C>0?Math.min(S,d):Math.max(S,d),M=A>0?Math.min(M,f):Math.max(M,f));this.addPolyline(I,r,a)},addLine:function(t,e,n,i){this.addPolyline([t,e],n,i)},addPolyline:(i=g.create(),r=g.create(),a=g.create(),o=g.create(),s=[],l=[],u=[],function(t,e,n,c,h){if(t.length){var d="number"!=typeof t[0];if(null==h&&(h=d?t.length:t.length/2),!(h<2)){null==c&&(c=0),null==n&&(n=1),this._itemVertexOffsets.push(this._vertexOffset);for(var f,p=d?"number"!=typeof e[0]:e.length/4===h,m=this.attributes.position,v=this.attributes.color,y=this.attributes.offset,x=this.attributes.normal,b=this.indices,_=this._vertexOffset,E=0;E1&&(m.copy(_,_-1),v.copy(_,_-1),_++);else{var S;if(E0){g.sub(i,s,u),g.sub(r,l,s),g.normalize(i,i),g.normalize(r,r),g.add(o,i,r),g.normalize(o,o);var M=n/2*Math.min(1/g.dot(i,o),2);a[0]=-o[1],a[1]=o[0],S=M}else g.sub(i,l,s),g.normalize(i,i),a[0]=-i[1],a[1]=i[0],S=n/2;else g.sub(i,s,u),g.normalize(i,i),a[0]=-i[1],a[1]=i[0],S=n/2;x.set(_,a),x.set(_+1,a),y.set(_,S),y.set(_+1,-S),g.copy(u,s),m.set(_,s),m.set(_+1,s),v.set(_,f),v.set(_+1,f),_+=2}if(this.useNativeLine)v.set(_,f),m.set(_,s),_++;else if(E>0){var C=3*this._faceOffset;(b=this.indices)[C]=_-4,b[C+1]=_-3,b[C+2]=_-2,b[C+3]=_-3,b[C+4]=_-1,b[C+5]=_-2,this._faceOffset+=2}}this._vertexOffset=_}}}),setItemColor:function(t,e){for(var n=this._itemVertexOffsets[t],i=tt&&o=0&&this._viewsToDispose.splice(e,1),this.views.push(t),t.layer=this;var n=this.zr;t.scene.traverse((function(t){t.__zr=n,t.addAnimatorsToZr&&t.addAnimatorsToZr(n)}))}},h.prototype.removeView=function(t){if(t.layer===this){var e=this.views.indexOf(t);e>=0&&(this.views.splice(e,1),t.scene.traverse(d,this),t.layer=null,this._viewsToDispose.push(t))}},h.prototype.removeViewsAll=function(){this.views.forEach((function(t){t.scene.traverse(d,this),t.layer=null,this._viewsToDispose.push(t)}),this),this.views.length=0},h.prototype.resize=function(t,e){this.renderer.resize(t,e)},h.prototype.clear=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.depthMask(!0),t.colorMask(!0,!0,!0,!0),t.clear(t.DEPTH_BUFFER_BIT|t.COLOR_BUFFER_BIT)},h.prototype.clearDepth=function(){var t=this.renderer.gl;t.clear(t.DEPTH_BUFFER_BIT)},h.prototype.clearColor=function(){var t=this.renderer.gl;t.clearColor(0,0,0,0),t.clear(t.COLOR_BUFFER_BIT)},h.prototype.needsRefresh=function(){this.zr.refresh()},h.prototype.refresh=function(){for(var t=0;t20)){t=t.event;var i=this.pickObject(t.offsetX,t.offsetY);i&&(this._dispatchEvent(t.type,t,i),this._dispatchDataEvent(t.type,t,i));var r=this._clickToSetFocusPoint(t);r&&r.view.setDOFFocusOnPoint(r.distance)&&this.zr.refresh()}}},h.prototype._clickToSetFocusPoint=function(t){for(var e=this.renderer,n=e.viewport,i=this.views.length-1;i>=0;i--){var r=this.views[i];if(r.hasDOF()&&r.containPoint(t.offsetX,t.offsetY)){this._picking.scene=r.scene,this._picking.camera=r.camera,e.viewport=r.viewport;var a=this._picking.pick(t.offsetX,t.offsetY,!0);if(a)return a.view=r,a}}e.viewport=n},h.prototype.onglobalout=function(t){var e=this._hovered;e&&this._dispatchEvent("mouseout",t,{target:e.target})},h.prototype.pickObject=function(t,e){for(var n=[],i=this.renderer,r=i.viewport,a=0;a=0&&(l.dataIndex=this._lastDataIndex,l.seriesIndex=this._lastSeriesIndex,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0):null!=o&&o!==this._lastEventData&&(null!=this._lastEventData&&(l.eventData=this._lastEventData,this.zr.handler.dispatchToElement(u,"mouseout",e)),s=!0),this._lastEventData=o,this._lastDataIndex=r,this._lastSeriesIndex=a),l.eventData=o,l.dataIndex=r,l.seriesIndex=a,(null!=o||parseInt(r,10)>=0)&&(this.zr.handler.dispatchToElement(u,t,e),s&&this.zr.handler.dispatchToElement(u,"mouseover",e))},h.prototype._dispatchToView=function(t,e){for(var n=0;n255?255:t}function s(t){return t<0?0:t>1?1:t}function l(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100*255):o(parseInt(t,10))}function u(t){return t.length&&"%"===t.charAt(t.length-1)?s(parseFloat(t)/100):s(parseFloat(t))}function c(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function h(t,e,n){return t+(e-t)*n}function d(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var p=new i.a(20),g=null;function m(t,e){g&&f(g,e),g=p.put(t,g||e.slice())}function v(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=u(t[1]),r=u(t[2]),a=r<=.5?r*(i+1):r+i-r*i,s=2*r-a;return d(e=e||[],o(255*c(s,a,n+1/3)),o(255*c(s,a,n)),o(255*c(s,a,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}r.parse=function(t,e){if(t){e=e||[];var n=p.get(t);if(n)return f(e,n);var i,r=(t+="").replace(/ /g,"").toLowerCase();if(r in a)return f(e,a[r]),m(t,e),e;if("#"===r.charAt(0))return 4===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=4095?(d(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),m(t,e),e):void d(e,0,0,0,1):7===r.length?(i=parseInt(r.substr(1),16))>=0&&i<=16777215?(d(e,(16711680&i)>>16,(65280&i)>>8,255&i,1),m(t,e),e):void d(e,0,0,0,1):void 0;var o=r.indexOf("("),s=r.indexOf(")");if(-1!==o&&s+1===r.length){var c=r.substr(0,o),h=r.substr(o+1,s-(o+1)).split(","),g=1;switch(c){case"rgba":if(4!==h.length)return void d(e,0,0,0,1);g=u(h.pop());case"rgb":return 3!==h.length?void d(e,0,0,0,1):(d(e,l(h[0]),l(h[1]),l(h[2]),g),m(t,e),e);case"hsla":return 4!==h.length?void d(e,0,0,0,1):(h[3]=u(h[3]),v(h,e),m(t,e),e);case"hsl":return 3!==h.length?void d(e,0,0,0,1):(v(h,e),m(t,e),e);default:return}}d(e,0,0,0,1)}},r.parseToFloat=function(t,e){if(e=r.parse(t,e))return e[0]/=255,e[1]/=255,e[2]/=255,e},r.lift=function(t,e){var n=r.parse(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return r.stringify(n,4===n.length?"rgba":"rgb")}},r.toHex=function(t){var e=r.parse(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},r.fastLerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),a=Math.ceil(i),l=e[r],u=e[a],c=i-r;return n[0]=o(h(l[0],u[0],c)),n[1]=o(h(l[1],u[1],c)),n[2]=o(h(l[2],u[2],c)),n[3]=s(h(l[3],u[3],c)),n}},r.fastMapToColor=r.fastLerp,r.lerp=function(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),a=Math.floor(i),l=Math.ceil(i),u=r.parse(e[a]),c=r.parse(e[l]),d=i-a,f=r.stringify([o(h(u[0],c[0],d)),o(h(u[1],c[1],d)),o(h(u[2],c[2],d)),s(h(u[3],c[3],d))],"rgba");return n?{color:f,leftIndex:a,rightIndex:l,value:i}:f}},r.mapToColor=r.lerp,r.modifyHSL=function(t,e,n,i){if(t=r.parse(t))return t=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;i===s?e=d-h:r===s?e=1/3+c-d:a===s&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(t),null!=e&&(t[0]=(a=e,(a=Math.round(a))<0?0:a>360?360:a)),null!=n&&(t[1]=u(n)),null!=i&&(t[2]=u(i)),r.stringify(v(t),"rgba");var a},r.modifyAlpha=function(t,e){if((t=r.parse(t))&&null!=e)return t[3]=s(e),r.stringify(t,"rgba")},r.stringify=function(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}},e.a=r},function(t,e,n){"use strict";var i=n(95),r=function(t){this._list=new i.a,this._map={},this._maxSize=t||10};r.prototype.setMaxSize=function(t){this._maxSize=t},r.prototype.put=function(t,e){if(void 0===this._map[t]){var n=this._list.length();if(n>=this._maxSize&&n>0){var i=this._list.head;this._list.remove(i),delete this._map[i.key]}var r=this._list.insert(e);r.key=t,this._map[t]=r}},r.prototype.get=function(t){var e=this._map[t];if(void 0!==e)return e!==this._list.tail&&(this._list.remove(e),this._list.insertEntry(e)),e.value},r.prototype.remove=function(t){var e=this._map[t];void 0!==e&&(delete this._map[t],this._list.remove(e))},r.prototype.clear=function(){this._list.clear(),this._map={}},e.a=r},function(t,e,n){"use strict";var i=function(){this.head=null,this.tail=null,this._length=0};i.prototype.insert=function(t){var e=new i.Entry(t);return this.insertEntry(e),e},i.prototype.insertAt=function(t,e){if(!(t<0)){for(var n=this.head,r=0;n&&r!=t;)n=n.next,r++;if(n){var a=new i.Entry(e),o=n.prev;o?(o.next=a,a.prev=o):this.head=a,a.next=n,n.prev=a}else this.insert(e)}},i.prototype.insertBeforeEntry=function(t,e){var n=new i.Entry(t),r=e.prev;r?(r.next=n,n.prev=r):this.head=n,n.next=e,e.prev=n,this._length++},i.prototype.insertEntry=function(t){this.head?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this._length++},i.prototype.remove=function(t){var e=t.prev,n=t.next;e?e.next=n:this.head=n,n?n.prev=e:this.tail=e,t.next=t.prev=null,this._length--},i.prototype.removeAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e?(this.remove(e),e.value):void 0}},i.prototype.getHead=function(){if(this.head)return this.head.value},i.prototype.getTail=function(){if(this.tail)return this.tail.value},i.prototype.getAt=function(t){if(!(t<0)){for(var e=this.head,n=0;e&&n!=t;)e=e.next,n++;return e.value}},i.prototype.indexOf=function(t){for(var e=this.head,n=0;e;){if(e.value===t)return n;e=e.next,n++}},i.prototype.length=function(){return this._length},i.prototype.isEmpty=function(){return 0===this._length},i.prototype.forEach=function(t,e){for(var n=this.head,i=0,r=void 0!==e;n;)r?t.call(e,n.value,i):t(n.value,i),n=n.next,i++},i.prototype.clear=function(){this.tail=this.head=null,this._length=0},i.Entry=function(t){this.value=t,this.next=null,this.prev=null},e.a=i},function(t,e,n){"use strict";var i=n(97),r=/for\s*?\(int\s*?_idx_\s*\=\s*([\w-]+)\;\s*_idx_\s*<\s*([\w-]+);\s*_idx_\s*\+\+\s*\)\s*\{\{([\s\S]+?)(?=\}\})\}\}/g;function a(t,e,n){var i={};for(var a in n)i[a+"_COUNT"]=n[a];return t.replace(r,(function(t,n,r,a){var o="";isNaN(n)&&(n=n in e?e[n]:i[n]),isNaN(r)&&(r=r in e?e[r]:i[r]);for(var s=parseInt(n);s0&&i.push("#define "+r.toUpperCase()+"_COUNT "+a)}if(n)for(var o=0;o=0&&S[w]>1e-4&&(m.transformMat4(A,T,_[M[w]]),m.scaleAndAdd(C,C,A,S[w]));O.set(E,C)}}for(E=0;E=0&&(function(t){o(t,"itemStyle"),o(t,"lineStyle"),o(t,"areaStyle"),o(t,"label")}(e),"mapbox"===e.coordinateSystem&&(e.coordinateSystem="mapbox3D",t.mapbox3D=t.mapbox))})),s(t.xAxis3D),s(t.yAxis3D),s(t.zAxis3D),s(t.grid3D),o(t.geo3D)}},function(t,e,n){"use strict";e.a={get:function(t){var e=new XMLHttpRequest;e.open("get",t.url),e.responseType=t.responseType||"text",t.onprogress&&(e.onprogress=function(e){if(e.lengthComputable){var n=e.loaded/e.total;t.onprogress(n,e.loaded,e.total)}else t.onprogress(null)}),e.onload=function(n){e.status>=400?t.onerror&&t.onerror():t.onload&&t.onload(e.response)},t.onerror&&(e.onerror=t.onerror),e.send(null)}}},function(t,e,n){"use strict";e.a="@export clay.basic.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position : POSITION;\nattribute vec3 barycentric;\n@import clay.chunk.skinning_header\nvarying vec2 v_Texcoord;\nvarying vec3 v_Barycentric;\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\nvoid main()\n{\n vec3 skinnedPosition = position;\n#ifdef SKINNING\n @import clay.chunk.skin_matrix\n skinnedPosition = (skinMatrixWS * vec4(position, 1.0)).xyz;\n#endif\n v_Texcoord = texcoord * uvRepeat + uvOffset;\n v_Barycentric = barycentric;\n gl_Position = worldViewProjection * vec4(skinnedPosition, 1.0);\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n}\n@end\n@export clay.basic.fragment\nvarying vec2 v_Texcoord;\nuniform sampler2D diffuseMap;\nuniform vec3 color : [1.0, 1.0, 1.0];\nuniform vec3 emission : [0.0, 0.0, 0.0];\nuniform float alpha : 1.0;\n#ifdef ALPHA_TEST\nuniform float alphaCutoff: 0.9;\n#endif\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\nuniform float lineWidth : 0.0;\nuniform vec4 lineColor : [0.0, 0.0, 0.0, 0.6];\nvarying vec3 v_Barycentric;\n@import clay.util.edge_factor\n@import clay.util.rgbm\n@import clay.util.srgb\n@import clay.util.ACES\nvoid main()\n{\n#ifdef RENDER_TEXCOORD\n gl_FragColor = vec4(v_Texcoord, 1.0, 1.0);\n return;\n#endif\n gl_FragColor = vec4(color, alpha);\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n#ifdef DIFFUSEMAP_ENABLED\n vec4 tex = decodeHDR(texture2D(diffuseMap, v_Texcoord));\n#ifdef SRGB_DECODE\n tex = sRGBToLinear(tex);\n#endif\n#if defined(DIFFUSEMAP_ALPHA_ALPHA)\n gl_FragColor.a = tex.a;\n#endif\n gl_FragColor.rgb *= tex.rgb;\n#endif\n gl_FragColor.rgb += emission;\n if( lineWidth > 0.)\n {\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor(lineWidth)) * lineColor.a);\n }\n#ifdef ALPHA_TEST\n if (gl_FragColor.a < alphaCutoff) {\n discard;\n }\n#endif\n#ifdef TONEMAPPING\n gl_FragColor.rgb = ACESToneMapping(gl_FragColor.rgb);\n#endif\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n gl_FragColor = encodeHDR(gl_FragColor);\n}\n@end"},function(t,e,n){"use strict";var i=n(6),r=n(5);function a(t){return t.charCodeAt(0)+(t.charCodeAt(1)<<8)+(t.charCodeAt(2)<<16)+(t.charCodeAt(3)<<24)}n(25);var o=a("DXT1"),s=a("DXT3"),l=a("DXT5"),u={parse:function(t,e){var n=new Int32Array(t,0,31);if(542327876!==n[0])return null;if(4&!n(20))return null;var a,u,c=n(21),h=n[4],d=n[3],f=512&n[28],p=131072&n[2];switch(c){case o:a=8,u=i.a.COMPRESSED_RGB_S3TC_DXT1_EXT;break;case s:a=16,u=i.a.COMPRESSED_RGBA_S3TC_DXT3_EXT;break;case l:a=16,u=i.a.COMPRESSED_RGBA_S3TC_DXT5_EXT;break;default:return null}var g=n[1]+4,m=f?6:1,v=1;p&&(v=Math.max(1,n[7]));for(var y=[],x=0;x0){var r=Math.pow(2,t[3]-128-8+i);e[n+0]=t[0]*r,e[n+1]=t[1]*r,e[n+2]=t[2]*r}else e[n+0]=0,e[n+1]=0,e[n+2]=0;return e[n+3]=1,e}function s(t,e,n,i){for(var r,a,o=0,s=0,l=i;l>0;)if(t[s][0]=e[n++],t[s][1]=e[n++],t[s][2]=e[n++],t[s][3]=e[n++],1===t[s][0]&&1===t[s][1]&&1===t[s][2]){for(var u=t[s][3]<>>0;u>0;u--)r=t[s-1],(a=t[s])[0]=r[0],a[1]=r[1],a[2]=r[2],a[3]=r[3],s++,l--;o+=8}else s++,l--,o=0;return n}function l(t,e,n,i){if(i<8|i>32767)return s(t,e,n,i);if(2!=(r=e[n++]))return s(t,e,n-1,i);if(t[0][1]=e[n++],t[0][2]=e[n++],r=e[n++],(t[0][2]<<8>>>0|r)>>>0!==i)return null;for(var r=0;r<4;r++)for(var a=0;a128){o=(127&o)>>>0;for(var l=e[n++];o--;)t[a++][r]=l}else for(;o--;)t[a++][r]=e[n++]}return n}var u={parseRGBE:function(t,e,n){null==n&&(n=0);var s=new Uint8Array(t),u=s.length;if("#?"===function(t,e,n){for(var i="",r=e;r=u)){c+=2;for(var h="";c=0||(o.forEach((function(e){t.on(e,this[s(e)],this)}),this),this._meshes.push(t))},detachFromMesh:function(t){var e=this._meshes.indexOf(t);e>=0&&this._meshes.splice(e,1),o.forEach((function(e){t.off(e,this[s(e)])}),this)},dispose:function(){this._meshes.forEach((function(t){this.detachFromMesh(t)}),this)}},e.a=m},function(t,e,n){"use strict";var i=n(19),r=n(108),a=i.a.extend({cubemap:null,castShadow:!1,_normalDistribution:null,_brdfLookup:null},{type:"AMBIENT_CUBEMAP_LIGHT",prefilter:function(t,e){this._brdfLookup||(this._normalDistribution=r.a.generateNormalDistribution(),this._brdfLookup=r.a.integrateBRDF(t,this._normalDistribution));var n=this.cubemap;if(!n.__prefiltered){var i=r.a.prefilterEnvironmentMap(t,n,{encodeRGBM:!0,width:e,height:e},this._normalDistribution,this._brdfLookup);this.cubemap=i.environmentMap,this.cubemap.__prefiltered=!0,n.dispose(t)}},uniformTemplates:{ambientCubemapLightColor:{type:"3f",value:function(t){var e=t.color,n=t.intensity;return[e[0]*n,e[1]*n,e[2]*n]}},ambientCubemapLightCubemap:{type:"t",value:function(t){return t.cubemap}},ambientCubemapLightBRDFLookup:{type:"t",value:function(t){return t._brdfLookup}}}});e.a=a},function(t,e,n){"use strict";var i=n(5),r=n(25),a=n(6),o=n(10),s=n(14),l=n(17),u=n(7),c=n(57),h=n(29),d=n(55),f=n(18),p=n(54),g=n(111),m=n(112),v={},y=["px","nx","py","ny","pz","nz"];v.prefilterEnvironmentMap=function(t,e,n,s,g){g&&s||(s=v.generateNormalDistribution(),g=v.integrateBRDF(t,s));var x=(n=n||{}).width||64,b=n.height||64,_=n.type||e.type,E=new r.a({width:x,height:b,type:_,flipY:!1,mipmaps:[]});E.isPowerOfTwo()||console.warn("Width and height must be power of two to enable mipmap.");var w=Math.min(x,b),T=Math.log(w)/Math.log(2)+1,S=new l.a({shader:new u.a({vertex:u.a.source("clay.skybox.vertex"),fragment:m.a})});S.set("normalDistribution",s),n.encodeRGBM&&S.define("fragment","RGBM_ENCODE"),n.decodeRGBM&&S.define("fragment","RGBM_DECODE");var M,C=new h.a;if(e instanceof i.a){var A=new r.a({width:x,height:b,type:_===a.a.FLOAT?a.a.HALF_FLOAT:_});p.a.panoramaToCubeMap(t,e,A,{encodeRGBM:n.decodeRGBM}),e=A}(M=new c.a({scene:C,material:S})).material.set("environmentMap",e);var O=new d.a({texture:E});n.encodeRGBM&&(_=E.type=a.a.UNSIGNED_BYTE);for(var N=new i.a({width:x,height:b,type:_}),P=new o.a({depthBuffer:!1}),L=f.a[_===a.a.UNSIGNED_BYTE?"Uint8Array":"Float32Array"],R=0;R>>16)>>>0;l=(((16711935&(l=((252645135&(l=((858993459&(l=((1431655765&l)<<1|(2863311530&l)>>>1)>>>0))<<2|(3435973836&l)>>>2)>>>0))<<4|(4042322160&l)>>>4)>>>0))<<8|(4278255360&l)>>>8)>>>0)/4294967296;for(var u=0;u=0&&l.splice(t,1)})),l.push(u),this.__zr&&this.__zr.animation.addAnimator(u),u},stopAnimation:function(t){this._animators=this._animators||[];for(var e=this._animators,n=e.length,i=0;i.5?e:t}function h(t,e,n,i,r){var a=t.length;if(1==r)for(var o=0;or)t.length=r;else for(var a=i;a=0&&!(C[n]<=e);n--);n=Math.min(n,b-2)}else{for(n=G;ne);n++);n=Math.min(n-1,b-2)}G=n,j=e;var i=C[n+1]-C[n];if(0!==i)if(k=(e-C[n])/i,x)if(B=A[n],I=A[0===n?n:n-1],F=A[n>b-2?b-1:n+1],z=A[n>b-3?b-1:n+2],w)p(I,B,F,z,k,k*k,k*k*k,m(t,s),M);else{if(T)r=p(I,B,F,z,k,k*k,k*k*k,U,1),r=v(U);else{if(S)return c(B,F,k);r=g(I,B,F,z,k,k*k,k*k*k)}y(t,s,r)}else if(w)h(A[n],A[n+1],k,m(t,s),M);else{var r;if(T)h(A[n],A[n+1],k,U,1),r=v(U);else{if(S)return c(A[n],A[n+1],k);r=u(A[n],A[n+1],k)}y(t,s,r)}},ondestroy:n});return e&&"spline"!==e&&(H.easing=e),H}}}var x=function(t,e,n,i){this._tracks={},this._target=t,this._loop=e||!1,this._getter=n||s,this._setter=i||l,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};x.prototype={when:function(t,e){var n=this._tracks;for(var i in e)if(e.hasOwnProperty(i)){if(!n[i]){n[i]=[];var r=this._getter(this._target,i);if(null==r)continue;0!==t&&n[i].push({time:0,value:m(r)})}n[i].push({time:t,value:e[i]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t255?255:t}function o(t){return t<0?0:t>1?1:t}function s(t){return t.length&&"%"===t.charAt(t.length-1)?a(parseFloat(t)/100*255):a(parseInt(t,10))}function l(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100):o(parseFloat(t))}function u(t,e,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?t+(e-t)*n*6:2*n<1?e:3*n<2?t+(e-t)*(2/3-n)*6:t}function c(t,e,n){return t+(e-t)*n}function h(t,e,n,i,r){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t}function d(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var f=new i(20),p=null;function g(t,e){p&&d(p,e),p=f.put(t,p||e.slice())}function m(t,e){if(t){e=e||[];var n=f.get(t);if(n)return d(e,n);var i,a=(t+="").replace(/ /g,"").toLowerCase();if(a in r)return d(e,r[a]),g(t,e),e;if("#"===a.charAt(0))return 4===a.length?(i=parseInt(a.substr(1),16))>=0&&i<=4095?(h(e,(3840&i)>>4|(3840&i)>>8,240&i|(240&i)>>4,15&i|(15&i)<<4,1),g(t,e),e):void h(e,0,0,0,1):7===a.length?(i=parseInt(a.substr(1),16))>=0&&i<=16777215?(h(e,(16711680&i)>>16,(65280&i)>>8,255&i,1),g(t,e),e):void h(e,0,0,0,1):void 0;var o=a.indexOf("("),u=a.indexOf(")");if(-1!==o&&u+1===a.length){var c=a.substr(0,o),p=a.substr(o+1,u-(o+1)).split(","),m=1;switch(c){case"rgba":if(4!==p.length)return void h(e,0,0,0,1);m=l(p.pop());case"rgb":return 3!==p.length?void h(e,0,0,0,1):(h(e,s(p[0]),s(p[1]),s(p[2]),m),g(t,e),e);case"hsla":return 4!==p.length?void h(e,0,0,0,1):(p[3]=l(p[3]),v(p,e),g(t,e),e);case"hsl":return 3!==p.length?void h(e,0,0,0,1):(v(p,e),g(t,e),e);default:return}}h(e,0,0,0,1)}}function v(t,e){var n=(parseFloat(t[0])%360+360)%360/360,i=l(t[1]),r=l(t[2]),o=r<=.5?r*(i+1):r+i-r*i,s=2*r-o;return h(e=e||[],a(255*u(s,o,n+1/3)),a(255*u(s,o,n)),a(255*u(s,o,n-1/3)),1),4===t.length&&(e[3]=t[3]),e}function y(t,e,n){if(e&&e.length&&t>=0&&t<=1){n=n||[];var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=e[r],u=e[s],h=i-r;return n[0]=a(c(l[0],u[0],h)),n[1]=a(c(l[1],u[1],h)),n[2]=a(c(l[2],u[2],h)),n[3]=o(c(l[3],u[3],h)),n}}var x=y;function b(t,e,n){if(e&&e.length&&t>=0&&t<=1){var i=t*(e.length-1),r=Math.floor(i),s=Math.ceil(i),l=m(e[r]),u=m(e[s]),h=i-r,d=E([a(c(l[0],u[0],h)),a(c(l[1],u[1],h)),a(c(l[2],u[2],h)),o(c(l[3],u[3],h))],"rgba");return n?{color:d,leftIndex:r,rightIndex:s,value:i}:d}}var _=b;function E(t,e){if(t&&t.length){var n=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(n+=","+t[3]),e+"("+n+")"}}e.parse=m,e.lift=function(t,e){var n=m(t);if(n){for(var i=0;i<3;i++)n[i]=e<0?n[i]*(1-e)|0:(255-n[i])*e+n[i]|0;return E(n,4===n.length?"rgba":"rgb")}},e.toHex=function(t){var e=m(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)},e.fastLerp=y,e.fastMapToColor=x,e.lerp=b,e.mapToColor=_,e.modifyHSL=function(t,e,n,i){if(t=m(t))return t=function(t){if(t){var e,n,i=t[0]/255,r=t[1]/255,a=t[2]/255,o=Math.min(i,r,a),s=Math.max(i,r,a),l=s-o,u=(s+o)/2;if(0===l)e=0,n=0;else{n=u<.5?l/(s+o):l/(2-s-o);var c=((s-i)/6+l/2)/l,h=((s-r)/6+l/2)/l,d=((s-a)/6+l/2)/l;i===s?e=d-h:r===s?e=1/3+c-d:a===s&&(e=2/3+h-c),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,n,u];return null!=t[3]&&f.push(t[3]),f}}(t),null!=e&&(t[0]=(r=e,(r=Math.round(r))<0?0:r>360?360:r)),null!=n&&(t[1]=l(n)),null!=i&&(t[2]=l(i)),E(v(t),"rgba");var r},e.modifyAlpha=function(t,e){if((t=m(t))&&null!=e)return t[3]=o(e),E(t,"rgba")},e.stringify=E},function(t,e,n){"use strict";e.a="\n@export clay.util.rand\nhighp float rand(vec2 uv) {\n const highp float a = 12.9898, b = 78.233, c = 43758.5453;\n highp float dt = dot(uv.xy, vec2(a,b)), sn = mod(dt, 3.141592653589793);\n return fract(sin(sn) * c);\n}\n@end\n@export clay.util.calculate_attenuation\nuniform float attenuationFactor : 5.0;\nfloat lightAttenuation(float dist, float range)\n{\n float attenuation = 1.0;\n attenuation = dist*dist/(range*range+1.0);\n float att_s = attenuationFactor;\n attenuation = 1.0/(attenuation*att_s+1.0);\n att_s = 1.0/(att_s+1.0);\n attenuation = attenuation - att_s;\n attenuation /= 1.0 - att_s;\n return clamp(attenuation, 0.0, 1.0);\n}\n@end\n@export clay.util.edge_factor\nfloat edgeFactor(float width)\n{\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * width, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n@end\n@export clay.util.encode_float\nvec4 encodeFloat(const in float depth)\n{\n const vec4 bitShifts = vec4(256.0*256.0*256.0, 256.0*256.0, 256.0, 1.0);\n const vec4 bit_mask = vec4(0.0, 1.0/256.0, 1.0/256.0, 1.0/256.0);\n vec4 res = fract(depth * bitShifts);\n res -= res.xxyz * bit_mask;\n return res;\n}\n@end\n@export clay.util.decode_float\nfloat decodeFloat(const in vec4 color)\n{\n const vec4 bitShifts = vec4(1.0/(256.0*256.0*256.0), 1.0/(256.0*256.0), 1.0/256.0, 1.0);\n return dot(color, bitShifts);\n}\n@end\n@export clay.util.float\n@import clay.util.encode_float\n@import clay.util.decode_float\n@end\n@export clay.util.rgbm_decode\nvec3 RGBMDecode(vec4 rgbm, float range) {\n return range * rgbm.rgb * rgbm.a;\n}\n@end\n@export clay.util.rgbm_encode\nvec4 RGBMEncode(vec3 color, float range) {\n if (dot(color, color) == 0.0) {\n return vec4(0.0);\n }\n vec4 rgbm;\n color /= range;\n rgbm.a = clamp(max(max(color.r, color.g), max(color.b, 1e-6)), 0.0, 1.0);\n rgbm.a = ceil(rgbm.a * 255.0) / 255.0;\n rgbm.rgb = color / rgbm.a;\n return rgbm;\n}\n@end\n@export clay.util.rgbm\n@import clay.util.rgbm_decode\n@import clay.util.rgbm_encode\nvec4 decodeHDR(vec4 color)\n{\n#if defined(RGBM_DECODE) || defined(RGBM)\n return vec4(RGBMDecode(color, 51.5), 1.0);\n#else\n return color;\n#endif\n}\nvec4 encodeHDR(vec4 color)\n{\n#if defined(RGBM_ENCODE) || defined(RGBM)\n return RGBMEncode(color.xyz, 51.5);\n#else\n return color;\n#endif\n}\n@end\n@export clay.util.srgb\nvec4 sRGBToLinear(in vec4 value) {\n return vec4(mix(pow(value.rgb * 0.9478672986 + vec3(0.0521327014), vec3(2.4)), value.rgb * 0.0773993808, vec3(lessThanEqual(value.rgb, vec3(0.04045)))), value.w);\n}\nvec4 linearTosRGB(in vec4 value) {\n return vec4(mix(pow(value.rgb, vec3(0.41666)) * 1.055 - vec3(0.055), value.rgb * 12.92, vec3(lessThanEqual(value.rgb, vec3(0.0031308)))), value.w);\n}\n@end\n@export clay.chunk.skinning_header\n#ifdef SKINNING\nattribute vec3 weight : WEIGHT;\nattribute vec4 joint : JOINT;\nuniform mat4 skinMatrix[JOINT_COUNT] : SKIN_MATRIX;\nmat4 getSkinMatrix(float idx) {\n return skinMatrix[int(idx)];\n}\n#endif\n@end\n@export clay.chunk.skin_matrix\nmat4 skinMatrixWS = getSkinMatrix(joint.x) * weight.x;\nif (weight.y > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.y) * weight.y;\n}\nif (weight.z > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.z) * weight.z;\n}\nfloat weightW = 1.0-weight.x-weight.y-weight.z;\nif (weightW > 1e-4)\n{\n skinMatrixWS += getSkinMatrix(joint.w) * weightW;\n}\n@end\n@export clay.util.parallax_correct\nvec3 parallaxCorrect(in vec3 dir, in vec3 pos, in vec3 boxMin, in vec3 boxMax) {\n vec3 first = (boxMax - pos) / dir;\n vec3 second = (boxMin - pos) / dir;\n vec3 further = max(first, second);\n float dist = min(further.x, min(further.y, further.z));\n vec3 fixedPos = pos + dir * dist;\n vec3 boxCenter = (boxMax + boxMin) * 0.5;\n return normalize(fixedPos - boxCenter);\n}\n@end\n@export clay.util.clamp_sample\nvec4 clampSample(const in sampler2D texture, const in vec2 coord)\n{\n#ifdef STEREO\n float eye = step(0.5, coord.x) * 0.5;\n vec2 coordClamped = clamp(coord, vec2(eye, 0.0), vec2(0.5 + eye, 1.0));\n#else\n vec2 coordClamped = clamp(coord, vec2(0.0), vec2(1.0));\n#endif\n return texture2D(texture, coordClamped);\n}\n@end\n@export clay.util.ACES\nvec3 ACESToneMapping(vec3 color)\n{\n const float A = 2.51;\n const float B = 0.03;\n const float C = 2.43;\n const float D = 0.59;\n const float E = 0.14;\n return (color * (A * color + B)) / (color * (C * color + D) + E);\n}\n@end"},function(t,e,n){"use strict";e.a="\n@export ecgl.common.transformUniforms\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform mat4 worldInverseTranspose : WORLDINVERSETRANSPOSE;\nuniform mat4 world : WORLD;\n@end\n\n@export ecgl.common.attributes\nattribute vec3 position : POSITION;\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 normal : NORMAL;\n@end\n\n@export ecgl.common.uv.header\nuniform vec2 uvRepeat : [1.0, 1.0];\nuniform vec2 uvOffset : [0.0, 0.0];\nuniform vec2 detailUvRepeat : [1.0, 1.0];\nuniform vec2 detailUvOffset : [0.0, 0.0];\n\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n@export ecgl.common.uv.main\nv_Texcoord = texcoord * uvRepeat + uvOffset;\nv_DetailTexcoord = texcoord * detailUvRepeat + detailUvOffset;\n@end\n\n@export ecgl.common.uv.fragmentHeader\nvarying vec2 v_Texcoord;\nvarying vec2 v_DetailTexcoord;\n@end\n\n\n@export ecgl.common.albedo.main\n\n vec4 albedoTexel = vec4(1.0);\n#ifdef DIFFUSEMAP_ENABLED\n albedoTexel = texture2D(diffuseMap, v_Texcoord);\n #ifdef SRGB_DECODE\n albedoTexel = sRGBToLinear(albedoTexel);\n #endif\n#endif\n\n#ifdef DETAILMAP_ENABLED\n vec4 detailTexel = texture2D(detailMap, v_DetailTexcoord);\n #ifdef SRGB_DECODE\n detailTexel = sRGBToLinear(detailTexel);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, detailTexel.rgb, detailTexel.a);\n albedoTexel.a = detailTexel.a + (1.0 - detailTexel.a) * albedoTexel.a;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexHeader\n\n#ifdef WIREFRAME_QUAD\nattribute vec4 barycentric;\nvarying vec4 v_Barycentric;\n#elif defined(WIREFRAME_TRIANGLE)\nattribute vec3 barycentric;\nvarying vec3 v_Barycentric;\n#endif\n\n@end\n\n@export ecgl.common.wireframe.vertexMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n v_Barycentric = barycentric;\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentHeader\n\nuniform float wireframeLineWidth : 1;\nuniform vec4 wireframeLineColor: [0, 0, 0, 0.5];\n\n#ifdef WIREFRAME_QUAD\nvarying vec4 v_Barycentric;\nfloat edgeFactor () {\n vec4 d = fwidth(v_Barycentric);\n vec4 a4 = smoothstep(vec4(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(min(a4.x, a4.y), a4.z), a4.w);\n}\n#elif defined(WIREFRAME_TRIANGLE)\nvarying vec3 v_Barycentric;\nfloat edgeFactor () {\n vec3 d = fwidth(v_Barycentric);\n vec3 a3 = smoothstep(vec3(0.0), d * wireframeLineWidth, v_Barycentric);\n return min(min(a3.x, a3.y), a3.z);\n}\n#endif\n\n@end\n\n\n@export ecgl.common.wireframe.fragmentMain\n\n#if defined(WIREFRAME_QUAD) || defined(WIREFRAME_TRIANGLE)\n if (wireframeLineWidth > 0.) {\n vec4 lineColor = wireframeLineColor;\n#ifdef SRGB_DECODE\n lineColor = sRGBToLinear(lineColor);\n#endif\n\n gl_FragColor.rgb = mix(gl_FragColor.rgb, lineColor.rgb, (1.0 - edgeFactor()) * lineColor.a);\n }\n#endif\n@end\n\n\n\n\n@export ecgl.common.bumpMap.header\n\n#ifdef BUMPMAP_ENABLED\nuniform sampler2D bumpMap;\nuniform float bumpScale : 1.0;\n\n\nvec3 bumpNormal(vec3 surfPos, vec3 surfNormal, vec3 baseNormal)\n{\n vec2 dSTdx = dFdx(v_Texcoord);\n vec2 dSTdy = dFdy(v_Texcoord);\n\n float Hll = bumpScale * texture2D(bumpMap, v_Texcoord).x;\n float dHx = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdx).x - Hll;\n float dHy = bumpScale * texture2D(bumpMap, v_Texcoord + dSTdy).x - Hll;\n\n vec3 vSigmaX = dFdx(surfPos);\n vec3 vSigmaY = dFdy(surfPos);\n vec3 vN = surfNormal;\n\n vec3 R1 = cross(vSigmaY, vN);\n vec3 R2 = cross(vN, vSigmaX);\n\n float fDet = dot(vSigmaX, R1);\n\n vec3 vGrad = sign(fDet) * (dHx * R1 + dHy * R2);\n return normalize(abs(fDet) * baseNormal - vGrad);\n\n}\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexHeader\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.vertexMain\n\n#ifdef NORMALMAP_ENABLED\n if (dot(tangent, tangent) > 0.0) {\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n }\n#endif\n\n@end\n\n\n@export ecgl.common.normalMap.fragmentHeader\n\n#ifdef NORMALMAP_ENABLED\nuniform sampler2D normalMap;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@end\n\n@export ecgl.common.normalMap.fragmentMain\n#ifdef NORMALMAP_ENABLED\n if (dot(v_Tangent, v_Tangent) > 0.0) {\n vec3 normalTexel = texture2D(normalMap, v_DetailTexcoord).xyz;\n if (dot(normalTexel, normalTexel) > 0.0) { N = normalTexel * 2.0 - 1.0;\n mat3 tbn = mat3(v_Tangent, v_Bitangent, v_Normal);\n N = normalize(tbn * N);\n }\n }\n#endif\n@end\n\n\n\n@export ecgl.common.vertexAnimation.header\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute vec3 prevNormal;\nuniform float percent;\n#endif\n\n@end\n\n@export ecgl.common.vertexAnimation.main\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n vec3 norm = mix(prevNormal, normal, percent);\n#else\n vec3 pos = position;\n vec3 norm = normal;\n#endif\n\n@end\n\n\n@export ecgl.common.ssaoMap.header\n#ifdef SSAOMAP_ENABLED\nuniform sampler2D ssaoMap;\nuniform vec4 viewport : VIEWPORT;\n#endif\n@end\n\n@export ecgl.common.ssaoMap.main\n float ao = 1.0;\n#ifdef SSAOMAP_ENABLED\n ao = texture2D(ssaoMap, (gl_FragCoord.xy - viewport.xy) / viewport.zw).r;\n#endif\n@end\n\n\n\n\n@export ecgl.common.diffuseLayer.header\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\nuniform float layerDiffuseIntensity[LAYER_DIFFUSEMAP_COUNT];\nuniform sampler2D layerDiffuseMap[LAYER_DIFFUSEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.header\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\nuniform float layerEmissionIntensity[LAYER_EMISSIVEMAP_COUNT];\nuniform sampler2D layerEmissiveMap[LAYER_EMISSIVEMAP_COUNT];\n#endif\n\n@end\n\n@export ecgl.common.layers.header\n@import ecgl.common.diffuseLayer.header\n@import ecgl.common.emissiveLayer.header\n@end\n\n@export ecgl.common.diffuseLayer.main\n\n#if (LAYER_DIFFUSEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_DIFFUSEMAP_COUNT; _idx_++) {{\n float intensity = layerDiffuseIntensity[_idx_];\n vec4 texel2 = texture2D(layerDiffuseMap[_idx_], v_Texcoord);\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n albedoTexel.rgb = mix(albedoTexel.rgb, texel2.rgb * intensity, texel2.a);\n albedoTexel.a = texel2.a + (1.0 - texel2.a) * albedoTexel.a;\n }}\n#endif\n\n@end\n\n@export ecgl.common.emissiveLayer.main\n\n#if (LAYER_EMISSIVEMAP_COUNT > 0)\n for (int _idx_ = 0; _idx_ < LAYER_EMISSIVEMAP_COUNT; _idx_++)\n {{\n vec4 texel2 = texture2D(layerEmissiveMap[_idx_], v_Texcoord) * layerEmissionIntensity[_idx_];\n #ifdef SRGB_DECODE\n texel2 = sRGBToLinear(texel2);\n #endif\n float intensity = layerEmissionIntensity[_idx_];\n gl_FragColor.rgb += texel2.rgb * texel2.a * intensity;\n }}\n#endif\n\n@end\n"},function(t,e,n){"use strict";e.a="@export ecgl.color.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\n@import ecgl.common.uv.header\n\nattribute vec2 texcoord : TEXCOORD_0;\nattribute vec3 position: POSITION;\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvoid main()\n{\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n @import ecgl.common.uv.main\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n@export ecgl.color.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.layers.header\n\n@import ecgl.common.uv.fragmentHeader\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n\n}\n@end"},function(t,e,n){"use strict";e.a="/**\n * http: */\n\n@export ecgl.lambert.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n\n@import ecgl.common.attributes\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.vertexAnimation.header\n\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n}\n\n@end\n\n\n@export ecgl.lambert.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\nuniform sampler2D detailMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color);\n#else\n gl_FragColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n gl_FragColor *= sRGBToLinear(v_Color);\n #else\n gl_FragColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n gl_FragColor *= albedoTexel;\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseColor = vec3(0.0, 0.0, 0.0);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n diffuseColor += ambientLightColor[i] * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseColor += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n vec3 lightColor = directionalLightColor[i];\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n diffuseColor += lightColor * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor.rgb *= diffuseColor;\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(t,e,n){"use strict";e.a="@export ecgl.realistic.vertex\n\n@import ecgl.common.transformUniforms\n\n@import ecgl.common.uv.header\n\n@import ecgl.common.attributes\n\n\n@import ecgl.common.wireframe.vertexHeader\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\nattribute vec4 tangent : TANGENT;\nvarying vec3 v_Tangent;\nvarying vec3 v_Bitangent;\n#endif\n\n@import ecgl.common.vertexAnimation.header\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nvoid main()\n{\n\n @import ecgl.common.uv.main\n\n @import ecgl.common.vertexAnimation.main\n\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n\n v_Normal = normalize((worldInverseTranspose * vec4(norm, 0.0)).xyz);\n v_WorldPosition = (world * vec4(pos, 1.0)).xyz;\n\n#ifdef VERTEX_COLOR\n v_Color = a_Color;\n#endif\n\n#ifdef NORMALMAP_ENABLED\n v_Tangent = normalize((worldInverseTranspose * vec4(tangent.xyz, 0.0)).xyz);\n v_Bitangent = normalize(cross(v_Normal, v_Tangent) * tangent.w);\n#endif\n\n @import ecgl.common.wireframe.vertexMain\n\n}\n\n@end\n\n\n\n@export ecgl.realistic.fragment\n\n#define LAYER_DIFFUSEMAP_COUNT 0\n#define LAYER_EMISSIVEMAP_COUNT 0\n#define PI 3.14159265358979\n#define ROUGHNESS_CHANEL 0\n#define METALNESS_CHANEL 1\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform sampler2D diffuseMap;\n\nuniform sampler2D detailMap;\nuniform sampler2D metalnessMap;\nuniform sampler2D roughnessMap;\n\n@import ecgl.common.layers.header\n\nuniform float emissionIntensity: 1.0;\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nuniform float metalness : 0.0;\nuniform float roughness : 0.5;\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n@import clay.header.ambient_cubemap_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n@import ecgl.common.normalMap.fragmentHeader\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import clay.util.rgbm\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nvec3 F_Schlick(float ndv, vec3 spec) {\n return spec + (1.0 - spec) * pow(1.0 - ndv, 5.0);\n}\n\nfloat D_Phong(float g, float ndh) {\n float a = pow(8192.0, g);\n return (a + 2.0) / 8.0 * pow(ndh, a);\n}\n\nvoid main()\n{\n vec4 albedoColor = color;\n\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n albedoColor *= sRGBToLinear(v_Color);\n #else\n albedoColor *= v_Color;\n #endif\n#endif\n\n @import ecgl.common.albedo.main\n\n @import ecgl.common.diffuseLayer.main\n\n albedoColor *= albedoTexel;\n\n float m = metalness;\n\n#ifdef METALNESSMAP_ENABLED\n float m2 = texture2D(metalnessMap, v_DetailTexcoord)[METALNESS_CHANEL];\n m = clamp(m2 + (m - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 baseColor = albedoColor.rgb;\n albedoColor.rgb = baseColor * (1.0 - m);\n vec3 specFactor = mix(vec3(0.04), baseColor, m);\n\n float g = 1.0 - roughness;\n\n#ifdef ROUGHNESSMAP_ENABLED\n float g2 = 1.0 - texture2D(roughnessMap, v_DetailTexcoord)[ROUGHNESS_CHANEL];\n g = clamp(g2 + (g - 0.5) * 2.0, 0.0, 1.0);\n#endif\n\n vec3 N = v_Normal;\n\n#ifdef DOUBLE_SIDED\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n@import ecgl.common.normalMap.fragmentMain\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n vec3 diffuseTerm = vec3(0.0);\n vec3 specularTerm = vec3(0.0);\n\n float ndv = clamp(dot(N, V), 0.0, 1.0);\n vec3 fresnelTerm = F_Schlick(ndv, specFactor);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += ambientLightColor[_idx_] * ambientFactor * ao;\n }}\n#endif\n\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n diffuseTerm += calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_] * ao;\n }}\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int _idx_ = 0; _idx_ < DIRECTIONAL_LIGHT_COUNT; _idx_++)\n {{\n vec3 L = -directionalLightDirection[_idx_];\n vec3 lc = directionalLightColor[_idx_];\n\n vec3 H = normalize(L + V);\n float ndl = clamp(dot(N, normalize(L)), 0.0, 1.0);\n float ndh = clamp(dot(N, H), 0.0, 1.0);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[_idx_];\n }\n#endif\n\n vec3 li = lc * ndl * shadowContrib;\n\n diffuseTerm += li;\n specularTerm += li * fresnelTerm * D_Phong(g, ndh);\n }}\n#endif\n\n\n#ifdef AMBIENT_CUBEMAP_LIGHT_COUNT\n vec3 L = reflect(-V, N);\n L = vec3(L.x, L[NORMAL_UP_AXIS], L[NORMAL_FRONT_AXIS]);\n float rough2 = clamp(1.0 - g, 0.0, 1.0);\n float bias2 = rough2 * 5.0;\n vec2 brdfParam2 = texture2D(ambientCubemapLightBRDFLookup[0], vec2(rough2, ndv)).xy;\n vec3 envWeight2 = specFactor * brdfParam2.x + brdfParam2.y;\n vec3 envTexel2;\n for(int _idx_ = 0; _idx_ < AMBIENT_CUBEMAP_LIGHT_COUNT; _idx_++)\n {{\n envTexel2 = RGBMDecode(textureCubeLodEXT(ambientCubemapLightCubemap[_idx_], L, bias2), 51.5);\n specularTerm += ambientCubemapLightColor[_idx_] * envTexel2 * envWeight2 * ao;\n }}\n#endif\n\n gl_FragColor.rgb = albedoColor.rgb * diffuseTerm + specularTerm;\n gl_FragColor.a = albedoColor.a;\n\n#ifdef SRGB_ENCODE\n gl_FragColor = linearTosRGB(gl_FragColor);\n#endif\n\n @import ecgl.common.emissiveLayer.main\n\n @import ecgl.common.wireframe.fragmentMain\n}\n\n@end"},function(t,e,n){"use strict";e.a="@export ecgl.hatching.vertex\n\n@import ecgl.realistic.vertex\n\n@end\n\n\n@export ecgl.hatching.fragment\n\n#define NORMAL_UP_AXIS 1\n#define NORMAL_FRONT_AXIS 2\n\n@import ecgl.common.uv.fragmentHeader\n\nvarying vec3 v_Normal;\nvarying vec3 v_WorldPosition;\n\nuniform vec4 color : [0.0, 0.0, 0.0, 1.0];\nuniform vec4 paperColor : [1.0, 1.0, 1.0, 1.0];\n\nuniform mat4 viewInverse : VIEWINVERSE;\n\n#ifdef AMBIENT_LIGHT_COUNT\n@import clay.header.ambient_light\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n@import clay.header.ambient_sh_light\n#endif\n\n#ifdef DIRECTIONAL_LIGHT_COUNT\n@import clay.header.directional_light\n#endif\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\n\n@import ecgl.common.ssaoMap.header\n\n@import ecgl.common.bumpMap.header\n\n@import clay.util.srgb\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.plugin.compute_shadow_map\n\nuniform sampler2D hatch1;\nuniform sampler2D hatch2;\nuniform sampler2D hatch3;\nuniform sampler2D hatch4;\nuniform sampler2D hatch5;\nuniform sampler2D hatch6;\n\nfloat shade(in float tone) {\n vec4 c = vec4(1. ,1., 1., 1.);\n float step = 1. / 6.;\n vec2 uv = v_DetailTexcoord;\n if (tone <= step / 2.0) {\n c = mix(vec4(0.), texture2D(hatch6, uv), 12. * tone);\n }\n else if (tone <= step) {\n c = mix(texture2D(hatch6, uv), texture2D(hatch5, uv), 6. * tone);\n }\n if(tone > step && tone <= 2. * step){\n c = mix(texture2D(hatch5, uv), texture2D(hatch4, uv) , 6. * (tone - step));\n }\n if(tone > 2. * step && tone <= 3. * step){\n c = mix(texture2D(hatch4, uv), texture2D(hatch3, uv), 6. * (tone - 2. * step));\n }\n if(tone > 3. * step && tone <= 4. * step){\n c = mix(texture2D(hatch3, uv), texture2D(hatch2, uv), 6. * (tone - 3. * step));\n }\n if(tone > 4. * step && tone <= 5. * step){\n c = mix(texture2D(hatch2, uv), texture2D(hatch1, uv), 6. * (tone - 4. * step));\n }\n if(tone > 5. * step){\n c = mix(texture2D(hatch1, uv), vec4(1.), 6. * (tone - 5. * step));\n }\n\n return c.r;\n}\n\nconst vec3 w = vec3(0.2125, 0.7154, 0.0721);\n\nvoid main()\n{\n#ifdef SRGB_DECODE\n vec4 inkColor = sRGBToLinear(color);\n#else\n vec4 inkColor = color;\n#endif\n\n#ifdef VERTEX_COLOR\n #ifdef SRGB_DECODE\n inkColor *= sRGBToLinear(v_Color);\n #else\n inkColor *= v_Color;\n #endif\n#endif\n\n vec3 N = v_Normal;\n#ifdef DOUBLE_SIDED\n vec3 eyePos = viewInverse[3].xyz;\n vec3 V = normalize(eyePos - v_WorldPosition);\n\n if (dot(N, V) < 0.0) {\n N = -N;\n }\n#endif\n\n float tone = 0.0;\n\n float ambientFactor = 1.0;\n\n#ifdef BUMPMAP_ENABLED\n N = bumpNormal(v_WorldPosition, v_Normal, N);\n ambientFactor = dot(v_Normal, N);\n#endif\n\n vec3 N2 = vec3(N.x, N[NORMAL_UP_AXIS], N[NORMAL_FRONT_AXIS]);\n\n @import ecgl.common.ssaoMap.main\n\n#ifdef AMBIENT_LIGHT_COUNT\n for(int i = 0; i < AMBIENT_LIGHT_COUNT; i++)\n {\n tone += dot(ambientLightColor[i], w) * ambientFactor * ao;\n }\n#endif\n#ifdef AMBIENT_SH_LIGHT_COUNT\n for(int _idx_ = 0; _idx_ < AMBIENT_SH_LIGHT_COUNT; _idx_++)\n {{\n tone += dot(calcAmbientSHLight(_idx_, N2) * ambientSHLightColor[_idx_], w) * ao;\n }}\n#endif\n#ifdef DIRECTIONAL_LIGHT_COUNT\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n float shadowContribsDir[DIRECTIONAL_LIGHT_COUNT];\n if(shadowEnabled)\n {\n computeShadowOfDirectionalLights(v_WorldPosition, shadowContribsDir);\n }\n#endif\n for(int i = 0; i < DIRECTIONAL_LIGHT_COUNT; i++)\n {\n vec3 lightDirection = -directionalLightDirection[i];\n float lightTone = dot(directionalLightColor[i], w);\n\n float shadowContrib = 1.0;\n#if defined(DIRECTIONAL_LIGHT_SHADOWMAP_COUNT)\n if (shadowEnabled)\n {\n shadowContrib = shadowContribsDir[i];\n }\n#endif\n\n float ndl = dot(N, normalize(lightDirection)) * shadowContrib;\n\n tone += lightTone * clamp(ndl, 0.0, 1.0);\n }\n#endif\n\n gl_FragColor = mix(inkColor, paperColor, shade(clamp(tone, 0.0, 1.0)));\n }\n@end\n"},function(t,e,n){"use strict";e.a="@export ecgl.sm.depth.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nuniform float percent : 1.0;\n#endif\n\nvarying vec4 v_ViewPosition;\n\nvoid main(){\n\n#ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n#else\n vec3 pos = position;\n#endif\n\n v_ViewPosition = worldViewProjection * vec4(pos, 1.0);\n gl_Position = v_ViewPosition;\n\n}\n@end\n\n\n\n@export ecgl.sm.depth.fragment\n\n@import clay.sm.depth.fragment\n\n@end"},function(t,e,n){"use strict";n(134),n(138),n(139),n(145);var i=n(0),r=n.n(i);r.a.registerAction({type:"grid3DChangeCamera",event:"grid3dcamerachanged",update:"series:updateCamera"},(function(t,e){e.eachComponent({mainType:"grid3D",query:t},(function(e){e.setView(t)}))})),r.a.registerAction({type:"grid3DShowAxisPointer",event:"grid3dshowaxispointer",update:"grid3D:showAxisPointer"},(function(t,e){})),r.a.registerAction({type:"grid3DHideAxisPointer",event:"grid3dhideaxispointer",update:"grid3D:hideAxisPointer"},(function(t,e){}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(135),o=r.a.extendComponentModel({type:"cartesian3DAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid3D",index:this.option.gridIndex,id:this.option.gridId})[0]}});function s(t,e){return e.type||(e.data?"category":"value")}r.a.helper.mixinAxisModelCommonMethods(o),Object(a.a)("x",o,s,{name:"X"}),Object(a.a)("y",o,s,{name:"Y"}),Object(a.a)("z",o,s,{name:"Z"})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(136),o=n(137),s=n.n(o),l=["value","category","time","log"];e.a=function(t,e,n,i){r.a.util.each(l,(function(o){e.extend({type:t+"Axis3D."+o,__ordinalMeta:null,mergeDefaultAndTheme:function(e,i){var a=i.getTheme();r.a.util.merge(e,a.get(o+"Axis3D")),r.a.util.merge(e,this.getDefaultOption()),e.type=n(t,e)},optionUpdated:function(){"category"===this.option.type&&(this.__ordinalMeta=s.a.createByAxisModel(this))},getCategories:function(){if("category"===this.option.type)return this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:r.a.util.merge(r.a.util.clone(a.a[o+"Axis3D"]),i||{},!0)})})),e.superClass.registerSubTypeDefaulter(t+"Axis3D",r.a.util.curry(n,t))}},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a={show:!0,grid3DIndex:0,inverse:!1,name:"",nameLocation:"middle",nameTextStyle:{fontSize:16},nameGap:20,axisPointer:{},axisLine:{},axisTick:{},axisLabel:{},splitArea:{}},o=r.a.util.merge({boundaryGap:!0,axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"},axisPointer:{label:{show:!1}}},a),s=r.a.util.merge({boundaryGap:[0,0],splitNumber:5,axisPointer:{label:{}}},a),l=r.a.util.defaults({scale:!0,min:"dataMin",max:"dataMax"},s),u=r.a.util.defaults({logBase:10},s);u.scale=!0,e.a={categoryAxis3D:o,valueAxis3D:s,timeAxis3D:l,logAxis3D:u}},function(t,e,n){var i=n(12),r=i.createHashMap,a=i.isObject,o=i.map;function s(t){this.categories=t.categories||[],this._needCollect=t.needCollect,this._deduplication=t.deduplication,this._map}s.createByAxisModel=function(t){var e=t.option,n=e.data,i=n&&o(n,c);return new s({categories:i,needCollect:!i,deduplication:!1!==e.dedplication})};var l=s.prototype;function u(t){return t._map||(t._map=r(t.categories))}function c(t){return a(t)&&null!=t.value?t.value:t+""}l.getOrdinal=function(t){return u(this).get(t)},l.parseAndCollect=function(t){var e,n=this._needCollect;if("string"!=typeof t&&!n)return t;if(n&&!this._deduplication)return e=this.categories.length,this.categories[e]=t,e;var i=u(this);return null==(e=i.get(t))&&(n?(e=this.categories.length,this.categories[e]=t,i.set(t,e)):e=NaN),e};var h=s;t.exports=h},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(38),o=n(31),s=n(32),l=r.a.extendComponentModel({type:"grid3D",dependencies:["xAxis3D","yAxis3D","zAxis3D"],defaultOption:{show:!0,zlevel:-10,left:0,top:0,width:"100%",height:"100%",environment:"auto",boxWidth:100,boxHeight:100,boxDepth:100,axisPointer:{show:!0,lineStyle:{color:"rgba(0, 0, 0, 0.8)",width:1},label:{show:!0,formatter:null,margin:8,textStyle:{fontSize:14,color:"#fff",backgroundColor:"rgba(0,0,0,0.5)",padding:3,borderRadius:3}}},axisLine:{show:!0,lineStyle:{color:"#333",width:2,type:"solid"}},axisTick:{show:!0,inside:!1,length:3,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,margin:8,textStyle:{fontSize:12}},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}},light:{main:{alpha:30,beta:40},ambient:{intensity:.4}},viewControl:{alpha:20,beta:40,autoRotate:!1,distance:200,minDistance:40,maxDistance:400}}});r.a.util.merge(l.prototype,a.a),r.a.util.merge(l.prototype,o.a),r.a.util.merge(l.prototype,s.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(39),s=n(22),l=n(3),u=n(73),c=n(34),h=n(140),d=n(142),f=n(58),p=n(40),g=l.a.firstNotNull;a.a.Shader.import(p.a),["x","y","z"].forEach((function(t){r.a.extendComponentView({type:t+"Axis3D"})}));var m={x:0,y:2,z:1};r.a.extendComponentView({type:"grid3D",__ecgl__:!0,init:function(t,e){var n=new a.a.Material({shader:a.a.createShader("ecgl.color"),depthMask:!1,transparent:!0}),i=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),depthMask:!1,transparent:!0});n.define("fragment","DOUBLE_SIDED"),n.define("both","VERTEX_COLOR"),this.groupGL=new a.a.Node,this._control=new o.a({zr:e.getZr()}),this._control.init(),this._faces=[["y","z","x",-1,"left"],["y","z","x",1,"right"],["x","y","z",-1,"bottom"],["x","y","z",1,"top"],["x","z","y",-1,"far"],["x","z","y",1,"near"]].map((function(t){var e=new h.a(t,i,n);return this.groupGL.add(e.rootNode),e}),this),this._axes=["x","y","z"].map((function(t){var e=new d.a(t,i);return this.groupGL.add(e.rootNode),e}),this);var r=e.getDevicePixelRatio();this._axisLabelSurface=new u.a({width:256,height:256,devicePixelRatio:r}),this._axisLabelSurface.onupdate=function(){e.getZr().refresh()},this._axisPointerLineMesh=new a.a.Mesh({geometry:new s.a({useNativeLine:!1}),material:i,castShadow:!1,ignorePicking:!0,renderOrder:3}),this.groupGL.add(this._axisPointerLineMesh),this._axisPointerLabelsSurface=new u.a({width:128,height:128,devicePixelRatio:r}),this._axisPointerLabelsMesh=new f.a({ignorePicking:!0,renderOrder:4,castShadow:!1}),this._axisPointerLabelsMesh.material.set("textureAtlas",this._axisPointerLabelsSurface.getTexture()),this.groupGL.add(this._axisPointerLabelsMesh),this._lightRoot=new a.a.Node,this._sceneHelper=new c.a,this._sceneHelper.initLight(this._lightRoot)},render:function(t,e,n){this._model=t,this._api=n;var i=t.coordinateSystem;i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(i.viewGL);var a=t.getModel("viewControl");r.setFromViewControlModel(a,0),this._axisLabelSurface.clear();var o=["x","y","z"].reduce((function(e,n){var r=i.getAxis(n),a=r.model;return e[n]=g(a.get("axisLabel.interval"),t.get("axisLabel.interval")),"ordinal"===r.scale.type&&(null!=e[n]&&"auto"!=e[n]||(e[n]=Math.floor(r.scale.getTicks().length/8))),e}),{});r.off("update"),t.get("show")&&(this._faces.forEach((function(i){i.update(o,t,e,n)}),this),this._axes.forEach((function(e){e.update(t,o,this._axisLabelSurface,n)}),this)),r.on("update",this._onCameraChange.bind(this,t,n),this),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._initMouseHandler(t)},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},showAxisPointer:function(t,e,n,i){this._doShowAxisPointer(),this._updateAxisPointer(i.value)},hideAxisPointer:function(t,e,n,i){this._doHideAxisPointer()},_initMouseHandler:function(t){var e=t.coordinateSystem.viewGL;t.get("show")&&t.get("axisPointer.show")?e.on("mousemove",this._updateAxisPointerOnMousePosition,this):e.off("mousemove",this._updateAxisPointerOnMousePosition)},_updateAxisPointerOnMousePosition:function(t){if(!t.target){for(var e,n=this._model.coordinateSystem,i=n.viewGL,r=i.castRay(t.offsetX,t.offsetY,new a.a.Ray),o=0;oi[1]?0:1,s=this._faces[2*n+o],l=this._faces[2*n+1-o];s.rootNode.invisible=!0,l.rootNode.invisible=!1}},_updateAxisLinePosition:function(){var t=this._model.coordinateSystem,e=t.getAxis("x"),n=t.getAxis("y"),i=t.getAxis("z"),r=i.getExtentMax(),a=i.getExtentMin(),o=e.getExtentMin(),s=e.getExtentMax(),l=n.getExtentMax(),u=n.getExtentMin(),c=this._axes[0].rootNode,h=this._axes[1].rootNode,d=this._axes[2].rootNode,f=this._faces,p=f[4].rootNode.invisible?u:l,g=f[2].rootNode.invisible?r:a,m=f[0].rootNode.invisible?o:s,v=f[2].rootNode.invisible?r:a,y=f[0].rootNode.invisible?s:o,x=f[4].rootNode.invisible?u:l;c.rotation.identity(),h.rotation.identity(),d.rotation.identity(),f[4].rootNode.invisible&&(this._axes[0].flipped=!0,c.rotation.rotateX(Math.PI)),f[0].rootNode.invisible&&(this._axes[1].flipped=!0,h.rotation.rotateZ(Math.PI)),f[4].rootNode.invisible&&(this._axes[2].flipped=!0,d.rotation.rotateY(Math.PI)),c.position.set(0,g,p),h.position.set(m,v,0),d.position.set(y,0,x),c.update(),h.update(),d.update(),this._updateAxisLabelAlign()},_updateAxisLabelAlign:function(){var t=this._control.getCamera(),e=[new a.a.Vector4,new a.a.Vector4],n=new a.a.Vector4;this.groupGL.getWorldPosition(n),n.w=1,n.transformMat4(t.viewMatrix).transformMat4(t.projectionMatrix),n.x/=n.w,n.y/=n.w,this._axes.forEach((function(i){for(var r=i.axisLineCoords,a=(i.labelsMesh.geometry,0);an.y?"bottom":"top"):(s="middle",o=c>n.x?"left":"right"),i.setSpriteAlign(o,s,this._api)}),this)},_doShowAxisPointer:function(){this._axisPointerLineMesh.invisible&&(this._axisPointerLineMesh.invisible=!1,this._axisPointerLabelsMesh.invisible=!1,this._api.getZr().refresh())},_doHideAxisPointer:function(){this._axisPointerLineMesh.invisible||(this._axisPointerLineMesh.invisible=!0,this._axisPointerLabelsMesh.invisible=!0,this._api.getZr().refresh())},_updateAxisPointer:function(t){var e=this._model.coordinateSystem,n=e.dataToPoint(t),i=this._axisPointerLineMesh.geometry,r=this._model.getModel("axisPointer"),o=this._api.getDevicePixelRatio();function s(t){return l.a.firstNotNull(t.model.get("axisPointer.show"),r.get("show"))}function u(t){var e=t.model.getModel("axisPointer",r).getModel("lineStyle"),n=a.a.parseColor(e.get("color")),i=g(e.get("width"),1),o=g(e.get("opacity"),1);return n[3]*=o,{color:n,lineWidth:i}}i.convertToDynamicArray(!0);for(var c=0;c0&&t.rotation.rotateY(Math.PI),e.normal.z=-i)}(this.rootNode,this.plane,l,this.faceInfo[3])},d.prototype._updateSplitLines=function(t,e,n,i,o){var s=o.getDevicePixelRatio();e.forEach((function(o,l){var h=o.model,d=e[1-l].getExtent();if(!o.scale.isBlank()){var f=h.getModel("splitLine",n.getModel("splitLine"));if(f.get("show")){var p=f.getModel("lineStyle"),g=p.get("color"),m=c(p.get("opacity"),1),v=c(p.get("width"),1),y=f.get("interval");null!=y&&"auto"!==y||(y=i[o.dim]),g=r.a.util.isArray(g)?g:[g];for(var x=o.getTicksCoords(),b=0,_=0;_65535?new Uint32Array(3*i):new Uint16Array(3*i))},getQuadVertexCount:function(){return 4},getQuadTriangleCount:function(){return 2},addQuad:(i=d.create(),r=d.create(),a=d.create(),o=[0,3,1,3,2,1],function(t,e){var n=this.attributes.position,s=this.attributes.normal,l=this.attributes.color;d.sub(i,t[1],t[0]),d.sub(r,t[2],t[1]),d.cross(a,i,r),d.normalize(a,a);for(var u=0;u<4;u++)n.set(this._vertexOffset+u,t[u]),l.set(this._vertexOffset+u,e),s.set(this._vertexOffset+u,a);var c=3*this._faceOffset;for(u=0;u<6;u++)this.indices[c+u]=o[u]+this._vertexOffset;this._vertexOffset+=4,this._faceOffset+=2})});u.a.util.defaults(f.prototype,c.a),e.a=f},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(22),s=n(3),l=n(58),u=n(74),c=s.a.firstNotNull,h={x:0,y:2,z:1};function d(t,e){var n=new a.a.Mesh({geometry:new o.a({useNativeLine:!1}),material:e,castShadow:!1,ignorePicking:!0,renderOrder:2}),i=new l.a;i.material.depthMask=!1;var r=new a.a.Node;r.add(n),r.add(i),this.rootNode=r,this.dim=t,this.linesMesh=n,this.labelsMesh=i,this.axisLineCoords=null,this.labelElements=[]}var f={x:"y",y:"x",z:"y"};d.prototype.update=function(t,e,n,i){var o=t.coordinateSystem.getAxis(this.dim),s=e[this.dim],l=this.linesMesh.geometry,d=this.labelsMesh.geometry;l.convertToDynamicArray(!0),d.convertToDynamicArray(!0);var p=o.model,g=o.getExtent(),m=i.getDevicePixelRatio(),v=p.getModel("axisLine",t.getModel("axisLine")),y=p.getModel("axisTick",t.getModel("axisTick")),x=p.getModel("axisLabel",t.getModel("axisLabel")),b=v.get("lineStyle.color");if(v.get("show")){var _=v.getModel("lineStyle"),E=[0,0,0];(L=[0,0,0])[R=h[o.dim]]=g[0],E[R]=g[1],this.axisLineCoords=[L,E];var w=a.a.parseColor(b),T=c(_.get("width"),1),S=c(_.get("opacity"),1);w[3]*=S,l.addLine(L,E,w,T*m)}if(y.get("show")){var M=y.getModel("lineStyle"),C=a.a.parseColor(c(M.get("color"),b));T=c(M.get("width"),1),C[3]*=c(M.get("opacity"),1);var A=o.getTicksCoords();null!=(B=y.get("interval"))&&"auto"!==B||(B=s);for(var O=y.get("length"),N=0;N65535?new Uint32Array(3*n):new Uint16Array(3*n))},setSpriteAlign:function(t,e,n,i,r){var a,o,s,l;switch(null==n&&(n="left"),null==i&&(i="top"),r=r||0,n){case"left":a=r,s=e[0]+r;break;case"center":case"middle":a=-e[0]/2,s=e[0]/2;break;case"right":a=-e[0]-r,s=-r}switch(i){case"bottom":o=r,l=e[1]+r;break;case"middle":o=-e[1]/2,l=e[1]/2;break;case"top":o=-e[1]-r,l=-r}var u=4*t,c=this.attributes.offset;c.set(u,[a,l]),c.set(u+1,[s,l]),c.set(u+2,[s,o]),c.set(u+3,[a,o])},addSprite:function(t,e,n,i,r,a){var o=this._vertexOffset;this.setSprite(this._vertexOffset/4,t,e,n,i,r,a);for(var l=0;l/g,">").replace(/"/g,""").replace(/'/g,"'")}var l=["a","b","c","d","e","f","g"],u=function(t,e){return"{"+t+(null==e?"":e)+"}"},c=function(t){return t<10?"0"+t:t},h=r.truncateText,d=r.getBoundingRect;e.addCommas=function(t){return isNaN(t)?"-":(t=(t+"").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(t.length>1?"."+t[1]:"")},e.toCamelCase=function(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,(function(t,e){return e.toUpperCase()})),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t},e.normalizeCssArray=o,e.encodeHTML=s,e.formatTpl=function(t,e,n){i.isArray(e)||(e=[e]);var r=e.length;if(!r)return"";for(var a=e[0].$vars||[],o=0;o':'':""},e.formatTime=function(t,e,n){"week"!==t&&"month"!==t&&"quarter"!==t&&"half-year"!==t&&"year"!==t||(t="MM-dd\nyyyy");var i=a.parseDate(e),r=n?"UTC":"",o=i["get"+r+"FullYear"](),s=i["get"+r+"Month"]()+1,l=i["get"+r+"Date"](),u=i["get"+r+"Hours"](),h=i["get"+r+"Minutes"](),d=i["get"+r+"Seconds"]();return t=t.replace("MM",c(s)).replace("M",s).replace("yyyy",o).replace("yy",o%100).replace("dd",c(l)).replace("d",l).replace("hh",c(u)).replace("h",u).replace("mm",c(h)).replace("m",h).replace("ss",c(d)).replace("s",d)},e.capitalFirst=function(t){return t?t.charAt(0).toUpperCase()+t.substr(1):t},e.truncateText=h,e.getTextRect=d},function(t,e,n){var i=n(75),r=n(151),a=n(12),o=a.getContext,s=a.extend,l=a.retrieve2,u=a.retrieve3,c={},h=0,d=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,f="12px sans-serif",p={};function g(t,e){var n=t+":"+(e=e||f);if(c[n])return c[n];for(var i=(t+"").split("\n"),r=0,a=0,o=i.length;a5e3&&(h=0,c={}),h++,c[n]=r,r}function m(t,e,n){return"right"===n?t-=e:"center"===n&&(t-=e/2),t}function v(t,e,n){return"middle"===n?t-=e/2:"bottom"===n&&(t-=e),t}function y(t,e,n,i,r){if(!e)return"";var a=(t+"").split("\n");r=x(e,n,i,r);for(var o=0,s=a.length;o=a;u++)o-=a;var c=g(n);return c>o&&(n="",c=0),o=t-c,i.ellipsis=n,i.ellipsisWidth=c,i.contentWidth=o,i.containerWidth=t,i}function b(t,e){var n=e.containerWidth,i=e.font,r=e.contentWidth;if(!n)return"";var a=g(t,i);if(a<=n)return t;for(var o=0;;o++){if(a<=r||o>=e.maxIterations){t+=e.ellipsis;break}var s=0===o?_(t,r,e.ascCharWidth,e.cnCharWidth):a>0?Math.floor(t.length*r/a):0;a=g(t=t.substr(0,s),i)}return""===t&&(t=e.placeholder),t}function _(t,e,n,i){for(var r=0,a=0,o=t.length;al)t="",a=[];else if(null!=u)for(var c=x(u-(n?n[1]+n[3]:0),e,i.ellipsis,{minChar:i.minChar,placeholder:i.placeholder}),h=0,d=a.length;ha&&M(n,t.substring(a,o)),M(n,i[2],i[1]),a=d.lastIndex}ax)return{lines:[],width:0,height:0};B.textWidth=g(B.text,O);var P=C.textWidth,L=null==P||"auto"===P;if("string"==typeof P&&"%"===P.charAt(P.length-1))B.percentWidth=P,f.push(B),P=0;else{if(L){P=B.textWidth;var R=C.textBackgroundColor,D=R&&R.image;D&&(D=r.findExistImage(D),r.isImageReady(D)&&(P=Math.max(P,D.width*N/D.height)))}var k=A?A[1]+A[3]:0;P+=k;var I=null!=v?v-T:null;null!=I&&I4){console.warn("Support at most 4 cascade");continue}v.shadowCascade>1&&(o=v.shadowCascade),this.renderDirectionalLightShadow(t,e,n,v,this._opaqueCasters,p,c,u)}else v instanceof h.a?this.renderSpotLightShadow(t,e,v,this._opaqueCasters,l,s):v instanceof f.a&&this.renderPointLightShadow(t,e,v,this._opaqueCasters,g);this._shadowMapNumber[v.type]++}for(var y in this._shadowMapNumber){var x=this._shadowMapNumber[y],b=y+"_SHADOWMAP_COUNT";for(m=0;m0?_.define("fragment",b,x):_.isDefined("fragment",b)&&_.undefine("fragment",b))}for(m=0;m0){var w=u.map(C);if(E.directionalLightShadowMaps={value:u,type:"tv"},E.directionalLightMatrices={value:c,type:"m4v"},E.directionalLightShadowMapSizes={value:w,type:"1fv"},o){var T=p.slice(),S=p.slice();T.pop(),S.shift(),T.reverse(),S.reverse(),c.reverse(),E.shadowCascadeClipsNear={value:T,type:"1fv"},E.shadowCascadeClipsFar={value:S,type:"1fv"}}}if(s.length>0){var M=s.map(C);(E=e.shadowUniforms).spotLightShadowMaps={value:s,type:"tv"},E.spotLightMatrices={value:l,type:"m4v"},E.spotLightShadowMapSizes={value:M,type:"1fv"}}g.length>0&&(E.pointLightShadowMaps={value:g,type:"tv"})}function C(t){return t.height}},renderDirectionalLightShadow:(A=new s.a,O=new l.a,N=new o.a,P=new l.a,L=new l.a,R=new l.a,D=new l.a,function(t,e,n,i,r,a,o,s){var c=this._getDepthMaterial(i),h={getMaterial:function(t){return t.shadowDepthMaterial||c},sortCompare:u.a.opaqueSortCompare};if(!e.viewBoundingBoxLastFrame.isFinite()){var d=e.getBoundingBox();e.viewBoundingBoxLastFrame.copy(d).applyTransform(n.viewMatrix)}var f=Math.min(-e.viewBoundingBoxLastFrame.min.z,n.far),p=Math.max(-e.viewBoundingBoxLastFrame.max.z,n.near),g=this._getDirectionalLightCamera(i,e,n),m=R.array;D.copy(g.projectionMatrix),M.invert(L.array,g.worldTransform.array),M.multiply(L.array,L.array,n.worldTransform.array),M.multiply(m,D.array,L.array);for(var v=[],y=n instanceof x.a,b=(n.near+n.far)/(n.near-n.far),_=2*n.near*n.far/(n.near-n.far),E=0;E<=i.shadowCascade;E++){var w=p*Math.pow(f/p,E/i.shadowCascade),T=p+(f-p)*E/i.shadowCascade,S=w*i.cascadeSplitLogFactor+T*(1-i.cascadeSplitLogFactor);v.push(S),a.push(-(-S*b+_)/-S)}var C=this._getTexture(i,i.shadowCascade);s.push(C);var I=t.viewport,B=t.gl;for(this._frameBuffer.attach(C),this._frameBuffer.bind(t),B.clear(B.COLOR_BUFFER_BIT|B.DEPTH_BUFFER_BIT),E=0;E=0||(this.nodes.push(t),this._dirty=!0)},removeNode:function(t){"string"==typeof t&&(t=this.getNodeByName(t));var e=this.nodes.indexOf(t);e>=0&&(this.nodes.splice(e,1),this._dirty=!0)},getNodeByName:function(t){for(var e=0;e=n.COLOR_ATTACHMENT0&&h<=n.COLOR_ATTACHMENT0+8&&c.push(h);u.drawBuffersEXT(c)}t.saveClear(),t.clearBit=r.a.DEPTH_BUFFER_BIT|r.a.COLOR_BUFFER_BIT,e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ),t.restoreClear(),i.unbind(t)}else e=t.render(this.scene,this.camera,!this.autoUpdateScene,this.preZ);this.trigger("afterrender",e),this._rendering=!1,this._rendered=!0}});e.a=o},function(t,e,n){"use strict";var i=n(42).a.extend((function(){return{texture:null,outputs:{color:{}}}}),(function(){}),{getOutput:function(t,e){return this.texture},beforeFrame:function(){},afterFrame:function(){}});e.a=i},function(t,e,n){"use strict";var i=n(14),r=n(42),a=r.a.extend((function(){return{name:"",inputs:{},outputs:null,shader:"",inputLinks:{},outputLinks:{},pass:null,_prevOutputTextures:{},_outputTextures:{},_outputReferences:{},_rendering:!1,_rendered:!1,_compositor:null}}),(function(){var t=new i.a({fragment:this.shader});this.pass=t}),{render:function(t,e){this.trigger("beforerender",t),this._rendering=!0;var n=t.gl;for(var i in this.inputLinks){var r=(h=this.inputLinks[i]).node.getOutput(t,h.pin);this.pass.setUniform(i,r)}if(this.outputs){this.pass.outputs={};var a={};for(var o in this.outputs){var s=this.updateParameter(o,t);isNaN(s.width)&&this.updateParameter(o,t);var l=this.outputs[o],u=this._compositor.allocateTexture(s);this._outputTextures[o]=u,"string"==typeof(c=l.attachment||n.COLOR_ATTACHMENT0)&&(c=n[c]),a[c]=u}for(var c in this._compositor.getFrameBuffer().bind(t),a)this._compositor.getFrameBuffer().attach(a[c],c);this.pass.render(t),this._compositor.getFrameBuffer().updateMipmap(t.gl)}else this.pass.outputs=null,this._compositor.getFrameBuffer().unbind(t),this.pass.render(t,e);for(var i in this.inputLinks){var h;(h=this.inputLinks[i]).node.removeReference(h.pin)}this._rendering=!1,this._rendered=!0,this.trigger("afterrender",t)},updateParameter:function(t,e){var n,i,r=this.outputs[t],a=r.parameters,o=r._parametersCopy;if(o||(o=r._parametersCopy={}),a)for(var s in a)"width"!==s&&"height"!==s&&(o[s]=a[s]);return n=a.width instanceof Function?a.width.call(this,e):a.width,i=a.height instanceof Function?a.height.call(this,e):a.height,o.width===n&&o.height===i||this._outputTextures[t]&&this._outputTextures[t].dispose(e),o.width=n,o.height=i,o},setParameter:function(t,e){this.pass.setUniform(t,e)},getParameter:function(t){return this.pass.getUniform(t)},setParameters:function(t){for(var e in t)this.setParameter(e,t[e])},define:function(t,e){this.pass.material.define("fragment",t,e)},undefine:function(t){this.pass.material.undefine("fragment",t)},removeReference:function(t){this._outputReferences[t]--,0===this._outputReferences[t]&&(this.outputs[t].keepLastFrame?(this._prevOutputTextures[t]&&this._compositor.releaseTexture(this._prevOutputTextures[t]),this._prevOutputTextures[t]=this._outputTextures[t]):this._compositor.releaseTexture(this._outputTextures[t]))},clear:function(){r.a.prototype.clear.call(this),this.pass.material.disableTexturesAll()}});e.a=a},function(t,e,n){"use strict";var i=n(9),r=n(4),a=n(5),o=n(6),s=n(14),l=n(7),u=n(10),c=n(43),h=n(163);function d(t){for(var e=new Uint8Array(t*t*4),n=0,i=new r.a,a=0;a=this._haltonSequence.length},render:function(t,e,n){var i=this._blendPass;0===this._frame?(i.setUniform("weight1",0),i.setUniform("weight2",1)):(i.setUniform("weight1",.9),i.setUniform("weight2",.1)),i.setUniform("texture1",this._prevFrameTex),i.setUniform("texture2",e||this._sourceTex),this._blendFb.attach(this._outputTex),this._blendFb.bind(t),i.render(t),this._blendFb.unbind(t),n||(this._outputPass.setUniform("texture",this._outputTex),this._outputPass.render(t));var r=this._prevFrameTex;this._prevFrameTex=this._outputTex,this._outputTex=r,this._frame++},dispose:function(t){this._sourceFb.dispose(t),this._blendFb.dispose(t),this._prevFrameTex.dispose(t),this._outputTex.dispose(t),this._sourceTex.dispose(t),this._outputPass.dispose(t),this._blendPass.dispose(t)}},e.a=u},function(t,e,n){"use strict";var i=n(0),r=n.n(i);n(184),n(185),n(82),r.a.registerAction({type:"geo3DChangeCamera",event:"geo3dcamerachanged",update:"series:updateCamera"},(function(t,e){e.eachComponent({mainType:"geo3D",query:t},(function(e){e.setView(t)}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(38),o=n(31),s=n(32),l=n(26),u=n(80),c=r.a.extendComponentModel({type:"geo3D",layoutMode:"box",coordinateSystem:null,optionUpdated:function(){var t=this.option;t.regions=this.getFilledRegions(t.regions,t.map);var e=r.a.helper.completeDimensions(["value"],t.data,{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),n=new r.a.List(e,this);n.initData(t.regions);var i={};n.each((function(t){var e=n.getName(t),r=n.getItemModel(t);i[e]=r})),this._regionModelMap=i,this._data=n},getData:function(){return this._data},getRegionModel:function(t){var e=this.getData().getName(t);return this._regionModelMap[e]||new r.a.Model(null,this)},getRegionPolygonCoords:function(t){var e=this.getData().getName(t),n=this.coordinateSystem.getRegion(e);return n?n.geometries:[]},getFormattedLabel:function(t,e){var n=this._data.getName(t),i=this.getRegionModel(n),r=i.get("normal"===e?["label","formatter"]:["emphasis","label","formatter"]);null==r&&(r=i.get(["label","formatter"]));var a={name:n};if("function"==typeof r)return a.status=e,r(a);if("string"==typeof r){var o=a.seriesName;return r.replace("{a}",null!=o?o:"")}return n},defaultOption:{regions:[]}});r.a.util.merge(c.prototype,u.a),r.a.util.merge(c.prototype,a.a),r.a.util.merge(c.prototype,o.a),r.a.util.merge(c.prototype,s.a),r.a.util.merge(c.prototype,l.a)},function(t,e,n){"use strict";var i=n(59),r=n(0),a=n.n(r),o=n(2),s=n(39),l=n(34);a.a.extendComponentView({type:"geo3D",__ecgl__:!0,init:function(t,e){this._geo3DBuilder=new i.a(e),this.groupGL=new o.a.Node,this._lightRoot=new o.a.Node,this._sceneHelper=new l.a(this._lightRoot),this._sceneHelper.initLight(this._lightRoot),this._control=new s.a({zr:e.getZr()}),this._control.init()},render:function(t,e,n){this.groupGL.add(this._geo3DBuilder.rootNode);var i=t.coordinateSystem;if(i&&i.viewGL){i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL);var r=this._control;r.setViewGL(i.viewGL);var a=t.getModel("viewControl");r.setFromViewControlModel(a,0),this._sceneHelper.setScene(i.viewGL.scene),this._sceneHelper.updateLight(t),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling")),this._geo3DBuilder.update(t,e,n,0,t.getData().count());var o=i.viewGL.isLinearSpace()?"define":"undefine";this._geo3DBuilder.rootNode.traverse((function(t){t.material&&t.material[o]("fragment","SRGB_DECODE")})),r.off("update"),r.on("update",(function(){n.dispatchAction({type:"geo3DChangeCamera",alpha:r.getAlpha(),beta:r.getBeta(),distance:r.getDistance(),center:r.getCenter(),from:this.uid,geo3DId:t.id})}))}},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},dispose:function(){this._control.dispose()}})},function(t,e,n){"use strict";function i(t,e,n){n=n||2;var i,s,l,u,c,f,g,m=e&&e.length,v=m?e[0]*n:t.length,y=r(t,0,v,n,!0),x=[];if(!y)return x;if(m&&(y=function(t,e,n,i){var o,s,l,u=[];for(o=0,s=e.length;o80*n){i=l=t[0],s=u=t[1];for(var b=n;bl&&(l=c),f>u&&(u=f);g=Math.max(l-i,u-s)}return o(y,x,n,i,s,g),x}function r(t,e,n,i,r){var a,o;if(r===S(t,e,n,i)>0)for(a=e;a=e;a-=i)o=E(a,t[a],t[a+1],o);return o&&y(o,o.next)&&(w(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var n,i=t;do{if(n=!1,i.steiner||!y(i,i.next)&&0!==v(i.prev,i,i.next))i=i.next;else{if(w(i),(i=e=i.prev)===i.next)return null;n=!0}}while(n||i!==e);return e}function o(t,e,n,i,r,h,d){if(t){!d&&h&&function(t,e,n,i){var r=t;do{null===r.z&&(r.z=f(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,n,i,r,a,o,s,l,u=1;do{for(n=t,t=null,a=null,o=0;n;){for(o++,i=n,s=0,e=0;e0||l>0&&i;)0!==s&&(0===l||!i||n.z<=i.z)?(r=n,n=n.nextZ,s--):(r=i,i=i.nextZ,l--),a?a.nextZ=r:t=r,r.prevZ=a,a=r;n=i}a.nextZ=null,u*=2}while(o>1)}(r)}(t,i,r,h);for(var p,g,m=t;t.prev!==t.next;)if(p=t.prev,g=t.next,h?l(t,i,r,h):s(t))e.push(p.i/n),e.push(t.i/n),e.push(g.i/n),w(t),t=g.next,m=g.next;else if((t=g)===m){d?1===d?o(t=u(t,e,n),e,n,i,r,h,2):2===d&&c(t,e,n,i,r,h):o(a(t),e,n,i,r,h,1);break}}}function s(t){var e=t.prev,n=t,i=t.next;if(v(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(g(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&v(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function l(t,e,n,i){var r=t.prev,a=t,o=t.next;if(v(r,a,o)>=0)return!1;for(var s=r.xa.x?r.x>o.x?r.x:o.x:a.x>o.x?a.x:o.x,c=r.y>a.y?r.y>o.y?r.y:o.y:a.y>o.y?a.y:o.y,h=f(s,l,e,n,i),d=f(u,c,e,n,i),p=t.nextZ;p&&p.z<=d;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&g(r.x,r.y,a.x,a.y,o.x,o.y,p.x,p.y)&&v(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function u(t,e,n){var i=t;do{var r=i.prev,a=i.next.next;!y(r,a)&&x(r,i,i.next,a)&&b(r,a)&&b(a,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(a.i/n),w(i),w(i.next),i=t=a),i=i.next}while(i!==t);return i}function c(t,e,n,i,r,s){var l=t;do{for(var u=l.next.next;u!==l.prev;){if(l.i!==u.i&&m(l,u)){var c=_(l,u);return l=a(l,l.next),c=a(c,c.next),o(l,e,n,i,r,s),void o(c,e,n,i,r,s)}u=u.next}l=l.next}while(l!==t)}function h(t,e){return t.x-e.x}function d(t,e){if(e=function(t,e){var n,i=e,r=t.x,a=t.y,o=-1/0;do{if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){var s=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=r&&s>o){if(o=s,s===r){if(a===i.y)return i;if(a===i.next.y)return i.next}n=i.x=i.x&&i.x>=c&&r!==i.x&&g(an.x)&&b(i,t)&&(n=i,d=l),i=i.next;return n}(t,e),e){var n=_(e,t);a(n,n.next)}}function f(t,e,n,i,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)/r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)/r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,n=t;do{e.x=0&&(t-o)*(i-s)-(n-o)*(e-s)>=0&&(n-o)*(a-s)-(r-o)*(i-s)>=0}function m(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&x(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&b(t,e)&&b(e,t)&&function(t,e){var n=t,i=!1,r=(t.x+e.x)/2,a=(t.y+e.y)/2;do{n.y>a!=n.next.y>a&&n.next.y!==n.y&&r<(n.next.x-n.x)*(a-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}(t,e)}function v(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function y(t,e){return t.x===e.x&&t.y===e.y}function x(t,e,n,i){return!!(y(t,e)&&y(n,i)||y(t,i)&&y(n,e))||v(t,e,n)>0!=v(t,e,i)>0&&v(n,i,t)>0!=v(n,i,e)>0}function b(t,e){return v(t.prev,t,t.next)<0?v(t,e,t.next)>=0&&v(t,t.prev,e)>=0:v(t,e,t.prev)<0||v(t,t.next,e)<0}function _(t,e){var n=new T(t.i,t.x,t.y),i=new T(e.i,e.x,e.y),r=t.next,a=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,a.next=i,i.prev=a,i}function E(t,e,n,i){var r=new T(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function w(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function T(t,e,n){this.i=t,this.x=e,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function S(t,e,n,i){for(var r=0,a=e,o=n-i;a0},_displacementChanged:!0,_displacementScale:0,updateDisplacementHash:function(){var t=this.getDisplacementTexture(),e=this.getDisplacemenScale();this._displacementChanged=this._displacementTexture!==t||this._displacementScale!==e,this._displacementTexture=t,this._displacementScale=e},isDisplacementChanged:function(){return this._displacementChanged}});r.a.util.merge(c.prototype,a.a),r.a.util.merge(c.prototype,o.a),r.a.util.merge(c.prototype,s.a),r.a.util.merge(c.prototype,l.a)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(39),s=n(34),l=n(192),u=n(3);r.a.extendComponentView({type:"globe",__ecgl__:!0,_displacementScale:0,init:function(t,e){this.groupGL=new a.a.Node,this._sphereGeometry=new a.a.SphereGeometry({widthSegments:200,heightSegments:100,dynamic:!0}),this._overlayGeometry=new a.a.SphereGeometry({widthSegments:80,heightSegments:40}),this._planeGeometry=new a.a.PlaneGeometry,this._earthMesh=new a.a.Mesh({renderNormal:!0}),this._lightRoot=new a.a.Node,this._sceneHelper=new s.a,this._sceneHelper.initLight(this._lightRoot),this.groupGL.add(this._earthMesh),this._control=new o.a({zr:e.getZr()}),this._control.init(),this._layerMeshes={}},render:function(t,e,n){var i=t.coordinateSystem,r=t.get("shading");i.viewGL.add(this._lightRoot),t.get("show")?i.viewGL.add(this.groupGL):i.viewGL.remove(this.groupGL),this._sceneHelper.setScene(i.viewGL.scene),i.viewGL.setPostEffect(t.getModel("postEffect"),n),i.viewGL.setTemporalSuperSampling(t.getModel("temporalSuperSampling"));var o=this._earthMesh;o.geometry=this._sphereGeometry;var s="ecgl."+r;o.material&&o.material.shader.name===s||(o.material=a.a.createMaterial(s)),a.a.setMaterialFromModel(r,o.material,t,n),["roughnessMap","metalnessMap","detailMap","normalMap"].forEach((function(t){var e=o.material.get(t);e&&(e.flipY=!1)})),o.material.set("color",a.a.parseColor(t.get("baseColor")));var l=.99*i.radius;o.scale.set(l,l,l);var u=o.material.setTextureImage("diffuseMap",t.get("baseTexture"),n,{flipY:!1,anisotropic:8});u&&u.surface&&u.surface.attachToMesh(o);var c=o.material.setTextureImage("bumpMap",t.get("heightTexture"),n,{flipY:!1,anisotropic:8});c&&c.surface&&c.surface.attachToMesh(o),o.material[t.get("postEffect.enable")?"define":"undefine"]("fragment","SRGB_DECODE"),this._updateLight(t,n),this._displaceVertices(t,n),this._updateViewControl(t,n),this._updateLayers(t,n)},afterRender:function(t,e,n,i){var r=i.renderer;this._sceneHelper.updateAmbientCubemap(r,t,n),this._sceneHelper.updateSkybox(r,t,n)},_updateLayers:function(t,e){var n=t.coordinateSystem,i=t.get("layers"),o=n.radius,s=[],l=[],c=[],h=[];r.a.util.each(i,(function(t){var i=new r.a.Model(t),d=i.get("type"),f=a.a.loadTexture(i.get("texture"),e,{flipY:!1,anisotropic:8});if(f.surface&&f.surface.attachToMesh(this._earthMesh),"blend"===d){var p=i.get("blendTo"),g=u.a.firstNotNull(i.get("intensity"),1);"emission"===p?(c.push(f),h.push(g)):(s.push(f),l.push(g))}else{var m=i.get("id"),v=this._layerMeshes[m];v||(v=this._layerMeshes[m]=new a.a.Mesh({geometry:this._overlayGeometry,castShadow:!1,ignorePicking:!0})),"lambert"===i.get("shading")?(v.material=v.__lambertMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.lambert"),transparent:!0,depthMask:!1}),v.__lambertMaterial=v.material):(v.material=v.__colorMaterial||new a.a.Material({autoUpdateTextureStatus:!1,shader:a.a.createShader("ecgl.color"),transparent:!0,depthMask:!1}),v.__colorMaterial=v.material),v.material.enableTexture("diffuseMap");var y=i.get("distance"),x=o+(null==y?n.radius/100:y);v.scale.set(x,x,x),o=x;var b=this._blankTexture||(this._blankTexture=a.a.createBlankTexture("rgba(255, 255, 255, 0)"));v.material.set("diffuseMap",b),a.a.loadTexture(i.get("texture"),e,{flipY:!1,anisotropic:8},(function(t){t.surface&&t.surface.attachToMesh(v),v.material.set("diffuseMap",t),e.getZr().refresh()})),i.get("show")?this.groupGL.add(v):this.groupGL.remove(v)}}),this);var d=this._earthMesh.material;d.define("fragment","LAYER_DIFFUSEMAP_COUNT",s.length),d.define("fragment","LAYER_EMISSIVEMAP_COUNT",c.length),d.set("layerDiffuseMap",s),d.set("layerDiffuseIntensity",l),d.set("layerEmissiveMap",c),d.set("layerEmissionIntensity",h);var f=t.getModel("debug.wireframe");if(f.get("show")){d.define("both","WIREFRAME_TRIANGLE");var p=a.a.parseColor(f.get("lineStyle.color")||"rgba(0,0,0,0.5)"),g=u.a.firstNotNull(f.get("lineStyle.width"),1);d.set("wireframeLineWidth",g),d.set("wireframeLineColor",p)}else d.undefine("both","WIREFRAME_TRIANGLE")},_updateViewControl:function(t,e){var n=t.coordinateSystem,i=t.getModel("viewControl"),r=(n.viewGL.camera,this),a=this._control;a.setViewGL(n.viewGL);var o,s,l=i.get("targetCoord");null!=l&&(s=l[0]+90,o=l[1]),a.setFromViewControlModel(i,{baseDistance:n.radius,alpha:o,beta:s}),a.off("update"),a.on("update",(function(){e.dispatchAction({type:"globeChangeCamera",alpha:a.getAlpha(),beta:a.getBeta(),distance:a.getDistance()-n.radius,center:a.getCenter(),from:r.uid,globeId:t.id})}))},_displaceVertices:function(t,e){var n=t.get("displacementQuality"),i=t.get("debug.wireframe.show"),r=t.coordinateSystem;if(t.isDisplacementChanged()||n!==this._displacementQuality||i!==this._showDebugWireframe){this._displacementQuality=n,this._showDebugWireframe=i;var a=this._sphereGeometry,o={low:100,medium:200,high:400,ultra:800}[n]||200,s=o/2;(a.widthSegments!==o||i)&&(a.widthSegments=o,a.heightSegments=s,a.build()),this._doDisplaceVertices(a,r),i&&a.generateBarycentric()}},_doDisplaceVertices:function(t,e){var n=t.attributes.position.value,i=t.attributes.texcoord0.value,r=t.__originalPosition;r&&r.length===n.length||((r=new Float32Array(n.length)).set(n),t.__originalPosition=r);for(var a=e.displacementWidth,o=e.displacementHeight,s=e.displacementData,l=0;l0&&f>0||d<0&&f<0)),m=["x","y","z"].map((function(e){return t.coordDimToDataDim(e)[0]}));n.each(m,(function(t,r,a,s){var l=n.get(m[2],s,!0),u=n.stackedOn?l-a:g?0:p[0],c=e.dataToPoint([t,r,u]),h=e.dataToPoint([t,r,l]),d=o.dist(c,h),f=[0,h[1]0&&(p++,h[3]<.99&&(g=!0))}})),s.geometry.setBarCount(p);var m=n.getLayout("orient"),v=this._barIndexOfData=new Int32Array(n.count());p=0,n.each((function(t){if(n.hasValue(t)){var e=n.getItemLayout(t),i=e[0],r=e[1],a=e[2],s=4*t;h[0]=d[s++],h[1]=d[s++],h[2]=d[s++],h[3]=d[s++],h[3]>0&&(o._barMesh.geometry.addBar(i,r,m,a,h,t),v[t]=p++)}else v[t]=-1})),s.geometry.dirty(),s.geometry.updateBoundingBox();var y=s.material;y.transparent=g,y.depthMask=!g,s.geometry.sortTriangles=g,this._initHandler(t,e)},_initHandler:function(t,e){var n=t.getData(),i=this._barMesh,r="cartesian3D"===t.coordinateSystem.type;i.seriesIndex=t.seriesIndex;var a=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(t){var o=i.geometry.getDataIndexOfVertex(t.triangle[0]);o!==a&&(this._downplay(a),this._highlight(o),this._labelsBuilder.updateLabels([o]),r&&e.dispatchAction({type:"grid3DShowAxisPointer",value:[n.get("x",o),n.get("y",o),n.get("z",o,!0)]})),a=o,i.dataIndex=o}),this),i.on("mouseout",(function(t){this._downplay(a),this._labelsBuilder.updateLabels(),a=-1,i.dataIndex=-1,r&&e.dispatchAction({type:"grid3DHideAxisPointer"})}),this)},_highlight:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var i=e.getItemModel(t).getModel("emphasis.itemStyle"),o=i.get("color"),s=i.get("opacity");if(null==o){var l=e.getItemVisual(t,"color");o=r.a.color.lift(l,-.4)}null==s&&(s=e.getItemVisual(t,"opacity"));var u=a.a.parseColor(o);u[3]*=s,this._barMesh.geometry.setColor(n,u),this._api.getZr().refresh()}}},_downplay:function(t){var e=this._data;if(e){var n=this._barIndexOfData[t];if(!(n<0)){var i=e.getItemVisual(t,"color"),r=e.getItemVisual(t,"opacity"),o=a.a.parseColor(i);o[3]*=r,this._barMesh.geometry.setColor(n,o),this._api.getZr().refresh()}}},highlight:function(t,e,n,i){this._toggleStatus("highlight",t,e,n,i)},downplay:function(t,e,n,i){this._toggleStatus("downplay",t,e,n,i)},_toggleStatus:function(t,e,n,i,a){var l=e.getData(),u=o.a.queryDataIndex(l,a),c=this;null!=u?r.a.util.each(s.a.normalizeToArray(u),(function(e){"highlight"===t?this._highlight(e):this._downplay(e)}),this):l.each((function(e){"highlight"===t?c._highlight(e):c._downplay(e)}))},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i,r,a,o,s,l,u,c,h=n(0),d=n.n(h),f=n(33),p=n(60),g=n(13),m=n(1),v=n.n(m),y=v.a.vec3,x=v.a.mat3,b=g.a.extend((function(){return{attributes:{position:new g.a.Attribute("position","float",3,"POSITION"),normal:new g.a.Attribute("normal","float",3,"NORMAL"),color:new g.a.Attribute("color","float",4,"COLOR"),prevPosition:new g.a.Attribute("prevPosition","float",3),prevNormal:new g.a.Attribute("prevNormal","float",3)},dynamic:!0,enableNormal:!1,bevelSize:1,bevelSegments:0,_dataIndices:null,_vertexOffset:0,_triangleOffset:0}}),{resetOffset:function(){this._vertexOffset=0,this._triangleOffset=0},setBarCount:function(t){var e=this.enableNormal,n=this.getBarVertexCount()*t,i=this.getBarTriangleCount()*t;this.vertexCount!==n&&(this.attributes.position.init(n),e?this.attributes.normal.init(n):this.attributes.normal.value=null,this.attributes.color.init(n)),this.triangleCount!==i&&(this.indices=n>65535?new Uint32Array(3*i):new Uint16Array(3*i),this._dataIndices=new Uint32Array(n))},getBarVertexCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarVertexCount(t):this.enableNormal?24:8},getBarTriangleCount:function(){var t=this.bevelSize>0?this.bevelSegments:0;return t>0?this._getBevelBarTriangleCount(t):12},_getBevelBarVertexCount:function(t){return 4*(t+1)*(t+1)*2},_getBevelBarTriangleCount:function(t){return(4*t+3+1)*(2*t+1)*2+4},setColor:function(t,e){for(var n=this.getBarVertexCount(),i=n*(t+1),r=n*t;r0&&this.bevelSegments>0)this._addBevelBar(t,h,g,m,this.bevelSize,this.bevelSegments,v);else{y.copy(r,h),y.normalize(r,r),y.cross(a,g,r),y.normalize(a,a),y.cross(i,r,a),y.normalize(a,a),y.negate(o,i),y.negate(s,r),y.negate(l,a),e(u[0],t,i,m[0]/2),e(u[0],u[0],a,m[2]/2),e(u[1],t,i,m[0]/2),e(u[1],u[1],l,m[2]/2),e(u[2],t,o,m[0]/2),e(u[2],u[2],l,m[2]/2),e(u[3],t,o,m[0]/2),e(u[3],u[3],a,m[2]/2),e(n,t,r,m[1]),e(u[4],n,i,m[0]/2),e(u[4],u[4],a,m[2]/2),e(u[5],n,i,m[0]/2),e(u[5],u[5],l,m[2]/2),e(u[6],n,o,m[0]/2),e(u[6],u[6],l,m[2]/2),e(u[7],n,o,m[0]/2),e(u[7],u[7],a,m[2]/2);var _=this.attributes;if(this.enableNormal){c[0]=i,c[1]=o,c[2]=r,c[3]=s,c[4]=a,c[5]=l;for(var E=this._vertexOffset,w=0;w=0){var y=3*l,x=new u.a(this._points[y],this._points[y+1],this._points[y+2]);a.push({dataIndex:l,point:x,pointWorld:x.clone(),target:this._line3DMesh,distance:this._camera.getWorldPosition().dist(x)})}},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(t,e){e.containStroke=function(t,e,n,i,r,a,o){if(0===r)return!1;var s=r,l=0;if(o>e+s&&o>i+s||ot+s&&a>n+s||al?u.position[1]+=(c-l)/2:u.position[0]+=(c-s)/2;var h=u.getBoundingRect();return u.position[0]-=h.x,u.position[1]-=h.y,u.setStyle(n),u.update(),u.__size=c,u}(t,e,n),l=o.getMarginByStyle(n);return{image:a(s.__size,i,(function(t){s.brush(t)})),margin:l}},createSDFFromCanvas:function(t,e,n,i){return a(e,i,(function(e){var i=t.getContext("2d").getImageData(0,0,t.width,t.height);e.putImageData(function(t,e,n){var i=e.width,r=e.height,a=t.canvas.width,o=t.canvas.height,s=i/a,l=r/o;function u(t){return t<128?1:-1}function c(t,a){var o=1/0;t=Math.floor(t*s);for(var c=(a=Math.floor(a*l))*i+t,h=u(e.data[4*c]),d=Math.max(a-n,0);d=0;h--){var d,f=s[2*(d=this.geometry.indices?this.geometry.indices[h]:h)],p=s[2*d+1],g=this.geometry.attributes.size.get(d)/this.sizeScale/2;if(t>f-g*u&&tp-g*c&&e=2e4},doSortVertices:function(t,e){var n=this.indices,i=a.create();if(!n){n=this.indices=this.vertexCount>65535?new Uint32Array(this.vertexCount):new Uint16Array(this.vertexCount);for(var r=0;r.05);else for(r=0;r<3;r++)this._progressiveQuickSort(3*e+r);this.dirtyIndices()},_simpleSort:function(t){var e=this._zList,n=this.indices;function r(t,n){return e[n]-e[t]}t?Array.prototype.sort.call(n,r):i.a.sort(n,r,0,n.length-1)},_progressiveQuickSort:function(t){var e=this._zList,n=this.indices;this._quickSort=this._quickSort||new i.a,this._quickSort.step(n,(function(t,n){return e[n]-e[t]}),t)}}},function(t,e,n){"use strict";e.a="@export ecgl.sdfSprite.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform float elapsedTime : 0;\n\nattribute vec3 position : POSITION;\n\n#ifdef VERTEX_SIZE\nattribute float size;\n#else\nuniform float u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\nattribute vec4 a_FillColor: COLOR;\nvarying vec4 v_Color;\n#endif\n\n#ifdef VERTEX_ANIMATION\nattribute vec3 prevPosition;\nattribute float prevSize;\nuniform float percent : 1.0;\n#endif\n\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvarying float v_Size;\n\nvoid main()\n{\n\n#ifdef POSITIONTEXTURE_ENABLED\n gl_Position = worldViewProjection * vec4(texture2D(positionTexture, position.xy).xy, -10.0, 1.0);\n#else\n\n #ifdef VERTEX_ANIMATION\n vec3 pos = mix(prevPosition, position, percent);\n #else\n vec3 pos = position;\n #endif\n gl_Position = worldViewProjection * vec4(pos, 1.0);\n#endif\n\n#ifdef VERTEX_SIZE\n#ifdef VERTEX_ANIMATION\n v_Size = mix(prevSize, size, percent);\n#else\n v_Size = size;\n#endif\n#else\n v_Size = u_Size;\n#endif\n\n#ifdef VERTEX_COLOR\n v_Color = a_FillColor;\n #endif\n\n gl_PointSize = v_Size;\n}\n\n@end\n\n@export ecgl.sdfSprite.fragment\n\nuniform vec4 color: [1, 1, 1, 1];\nuniform vec4 strokeColor: [1, 1, 1, 1];\nuniform float smoothing: 0.07;\n\nuniform float lineWidth: 0.0;\n\n#ifdef VERTEX_COLOR\nvarying vec4 v_Color;\n#endif\n\nvarying float v_Size;\n\nuniform sampler2D sprite;\n\n@import clay.util.srgb\n\nvoid main()\n{\n gl_FragColor = color;\n\n vec4 _strokeColor = strokeColor;\n\n#ifdef VERTEX_COLOR\n gl_FragColor *= v_Color;\n #endif\n\n#ifdef SPRITE_ENABLED\n float d = texture2D(sprite, gl_PointCoord).r;\n gl_FragColor.a *= smoothstep(0.5 - smoothing, 0.5 + smoothing, d);\n\n if (lineWidth > 0.0) {\n float sLineWidth = lineWidth / 2.0;\n\n float outlineMaxValue0 = 0.5 + sLineWidth;\n float outlineMaxValue1 = 0.5 + sLineWidth + smoothing;\n float outlineMinValue0 = 0.5 - sLineWidth - smoothing;\n float outlineMinValue1 = 0.5 - sLineWidth;\n\n if (d <= outlineMaxValue1 && d >= outlineMinValue0) {\n float a = _strokeColor.a;\n if (d <= outlineMinValue1) {\n a = a * smoothstep(outlineMinValue0, outlineMinValue1, d);\n }\n else {\n a = a * smoothstep(outlineMaxValue1, outlineMaxValue0, d);\n }\n gl_FragColor.rgb = mix(gl_FragColor.rgb * gl_FragColor.a, _strokeColor.rgb, a);\n gl_FragColor.a = gl_FragColor.a * (1.0 - a) + a;\n }\n }\n#endif\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(gl_FragColor);\n#endif\n}\n@end"},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(221),n(222),n(225),n(16));r.a.registerVisual(Object(a.a)("lines3D")),r.a.registerAction({type:"lines3DPauseEffect",event:"lines3deffectpaused",update:"series.lines3D:pauseEffect"},(function(){})),r.a.registerAction({type:"lines3DResumeEffect",event:"lines3deffectresumed",update:"series.lines3D:resumeEffect"},(function(){})),r.a.registerAction({type:"lines3DToggleEffect",event:"lines3deffectchanged",update:"series.lines3D:toggleEffect"},(function(){}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(1),o=n.n(a),s=o.a.vec3,l=o.a.vec2,u=s.normalize,c=s.cross,h=s.sub,d=s.add,f=s.create,p=f(),g=f(),m=f(),v=f(),y=[],x=[];function b(t,e){l.copy(y,t[0]),l.copy(x,t[1]);var n=[],i=n[0]=f(),r=n[1]=f(),a=n[2]=f(),o=n[3]=f();e.dataToPoint(y,i),e.dataToPoint(x,o),u(p,i),h(g,o,i),u(g,g),c(m,g,p),u(m,m),c(g,p,m),d(r,p,g),u(r,r),u(p,o),h(g,i,o),u(g,g),c(m,g,p),u(m,m),c(g,p,m),d(a,p,g),u(a,a),d(v,i,o),u(v,v);var b=s.dot(i,v),_=s.dot(v,r),E=(Math.max(s.len(i),s.len(o))-b)/_*2;return s.scaleAndAdd(r,i,r,E),s.scaleAndAdd(a,o,a,E),n}function _(t,e){for(var n=new Float32Array(3*t.length),i=0,r=[],a=0;a0&&r[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(r)+". Lines must have 2d coords array in data item.");e.push(r)})),{coordsList:e}}function w(t,e,n){var i=t.getData(),r=t.get("polyline"),a=E(i);i.setLayout("lineType",r?"polyline":"cubicBezier"),i.each((function(t){var o=a.coordsList[t],l=r?_(o,e):function(t,e,n){var i=[],r=i[0]=s.create(),a=i[1]=s.create(),o=i[2]=s.create(),l=i[3]=s.create();e.dataToPoint(t[0],r),e.dataToPoint(t[1],l);var u=s.dist(r,l);return s.lerp(a,r,l,.3),s.lerp(o,r,l,.3),s.scaleAndAdd(a,a,n,Math.min(.1*u,10)),s.scaleAndAdd(o,o,n,Math.min(.1*u,10)),i}(o,e,n);i.setItemLayout(t,l)}))}r.a.registerLayout((function(t,e){t.eachSeriesByType("lines3D",(function(t){var e=t.coordinateSystem;"globe"===e.type?function(t,e){var n=t.getData(),i=t.get("polyline");n.setLayout("lineType",i?"polyline":"cubicBezier");var r=E(n);n.each((function(t){var a=r.coordsList[t],o=i?_:b;n.setItemLayout(t,o(a,e))}))}(t,e):"geo3D"===e.type?w(t,e,[0,1,0]):"mapbox3D"===e.type&&w(t,e,[0,0,1])}))}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(22),s=n(223),l=n(40);a.a.Shader.import(l.a),r.a.extendChartView({type:"lines3D",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this._meshLinesMaterial=new a.a.Material({shader:a.a.createShader("ecgl.meshLines3D"),transparent:!0,depthMask:!1}),this._linesMesh=new a.a.Mesh({geometry:new o.a,material:this._meshLinesMaterial,$ignorePicking:!0}),this._trailMesh=new s.a},render:function(t,e,n){this.groupGL.add(this._linesMesh);var i=t.coordinateSystem,r=t.getData();if(i&&i.viewGL){i.viewGL.add(this.groupGL),this._updateLines(t,e,n);var o=i.viewGL.isLinearSpace()?"define":"undefine";this._linesMesh.material[o]("fragment","SRGB_DECODE"),this._trailMesh.material[o]("fragment","SRGB_DECODE")}var s=this._trailMesh;if(s.stopAnimation(),t.get("effect.show")){this.groupGL.add(s),s.updateData(r,n,this._linesMesh.geometry),s.__time=s.__time||0;var l=36e5;this._curveEffectsAnimator=s.animate("",{loop:!0}).when(l,{__time:l}).during((function(){s.setAnimationTime(s.__time)})).start()}else this.groupGL.remove(s),this._curveEffectsAnimator=null;this._linesMesh.material.blend=this._trailMesh.material.blend="lighter"===t.get("blendMode")?a.a.additiveBlend:null},pauseEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.pause()},resumeEffect:function(){this._curveEffectsAnimator&&this._curveEffectsAnimator.resume()},toggleEffect:function(){var t=this._curveEffectsAnimator;t&&(t.isPaused()?t.resume():t.pause())},_updateLines:function(t,e,n){var i=t.getData(),r=t.coordinateSystem,o=this._linesMesh.geometry,s=t.get("polyline");o.expandLine=!0;var l=function(t){return null!=t.radius?t.radius:null!=t.size?Math.max(t.size[0],t.size[1],t.size[2]):100}(r);o.segmentScale=l/20;var u="lineStyle.width".split("."),c=n.getDevicePixelRatio(),h=0;i.each((function(t){var e=i.getItemModel(t).get(u);null==e&&(e=1),i.setItemVisual(t,"lineWidth",e),h=Math.max(e,h)})),o.useNativeLine=!1;var d=0,f=0;i.each((function(t){var e=i.getItemLayout(t);s?(d+=o.getPolylineVertexCount(e),f+=o.getPolylineTriangleCount(e)):(d+=o.getCubicCurveVertexCount(e[0],e[1],e[2],e[3]),f+=o.getCubicCurveTriangleCount(e[0],e[1],e[2],e[3]))})),o.setVertexCount(d),o.setTriangleCount(f),o.resetOffset();var p=[];i.each((function(t){var e=i.getItemLayout(t),n=i.getItemVisual(t,"color"),r=i.getItemVisual(t,"opacity"),l=i.getItemVisual(t,"lineWidth")*c;null==r&&(r=1),(p=a.a.parseColor(n,p))[3]*=r,s?o.addPolyline(e,p,l):o.addCubicCurve(e[0],e[1],e[2],e[3],p,l)})),o.dirty()},remove:function(){this.groupGL.removeAll()},dispose:function(){this.groupGL.removeAll()}})},function(t,e,n){"use strict";var i=n(0),r=(n.n(i),n(2)),a=n(1),o=n.n(a),s=n(22),l=n(224),u=o.a.vec3;r.a.Shader.import(l.a),e.a=r.a.Mesh.extend((function(){var t=new r.a.Material({shader:new r.a.Shader(r.a.Shader.source("ecgl.trail2.vertex"),r.a.Shader.source("ecgl.trail2.fragment")),transparent:!0,depthMask:!1}),e=new s.a({dynamic:!0});return e.createAttribute("dist","float",1),e.createAttribute("distAll","float",1),e.createAttribute("start","float",1),{geometry:e,material:t,culling:!1,$ignorePicking:!0}}),{updateData:function(t,e,n){var i=t.hostModel,a=this.geometry,o=i.getModel("effect"),s=o.get("trailWidth")*e.getDevicePixelRatio(),l=o.get("trailLength"),c=i.get("effect.constantSpeed"),h=1e3*i.get("effect.period"),d=null!=c;this.getScene()||console.error("TrailMesh must been add to scene before updateData"),d?this.material.set("speed",c/1e3):this.material.set("period",h),this.material[d?"define":"undefine"]("vertex","CONSTANT_SPEED");var f=i.get("polyline");a.trailLength=l,this.material.set("trailLength",l),a.resetOffset(),["position","positionPrev","positionNext"].forEach((function(t){a.attributes[t].value=n.attributes[t].value})),["dist","distAll","start","offset","color"].forEach((function(t){a.attributes[t].init(a.vertexCount)})),a.indices=n.indices;var p=[],g=o.get("trailColor"),m=o.get("trailOpacity"),v=null!=g,y=null!=m;this.updateWorldTransform();var x=this.worldTransform.x.len(),b=this.worldTransform.y.len(),_=this.worldTransform.z.len(),E=0,w=0;t.each((function(e){var i=t.getItemLayout(e),o=y?m:t.getItemVisual(e,"opacity"),l=t.getItemVisual(e,"color");null==o&&(o=1),(p=r.a.parseColor(v?g:l,p))[3]*=o;for(var c=f?n.getPolylineVertexCount(i):n.getCubicCurveVertexCount(i[0],i[1],i[2],i[3]),T=0,S=[],M=[],C=E;CE&&(T+=u.dist(S,M)),a.attributes.dist.set(C,T),u.copy(M,S);w=Math.max(w,T);var A=Math.random()*(d?T:h);for(C=E;C0?1:-1)*s/2),a.attributes.color.set(C,p);E+=c})),this.material.set("spotSize",.1*w*l),this.material.set("spotIntensity",o.get("spotIntensity")),a.dirty()},setAnimationTime:function(t){this.material.set("time",t)}})},function(t,e,n){"use strict";e.a="@export ecgl.trail2.vertex\nattribute vec3 position: POSITION;\nattribute vec3 positionPrev;\nattribute vec3 positionNext;\nattribute float offset;\nattribute float dist;\nattribute float distAll;\nattribute float start;\n\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\nuniform float near : NEAR;\n\nuniform float speed : 0;\nuniform float trailLength: 0.3;\nuniform float time;\nuniform float period: 1000;\n\nuniform float spotSize: 1;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.vertexHeader\n\n@import ecgl.lines3D.clipNear\n\nvoid main()\n{\n @import ecgl.lines3D.expandLine\n\n gl_Position = currProj;\n\n v_Color = a_Color;\n\n @import ecgl.common.wireframe.vertexMain\n\n#ifdef CONSTANT_SPEED\n float t = mod((speed * time + start) / distAll, 1. + trailLength) - trailLength;\n#else\n float t = mod((time + start) / period, 1. + trailLength) - trailLength;\n#endif\n\n float trailLen = distAll * trailLength;\n\n v_Percent = (dist - t * distAll) / trailLen;\n\n v_SpotPercent = spotSize / distAll;\n\n }\n@end\n\n\n@export ecgl.trail2.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform float spotIntensity: 5;\n\nvarying vec4 v_Color;\nvarying float v_Percent;\nvarying float v_SpotPercent;\n\n@import ecgl.common.wireframe.fragmentHeader\n\n@import clay.util.srgb\n\nvoid main()\n{\n if (v_Percent > 1.0 || v_Percent < 0.0) {\n discard;\n }\n\n float fade = v_Percent;\n\n#ifdef SRGB_DECODE\n gl_FragColor = sRGBToLinear(color * v_Color);\n#else\n gl_FragColor = color * v_Color;\n#endif\n\n @import ecgl.common.wireframe.fragmentMain\n\n if (v_Percent > (1.0 - v_SpotPercent)) {\n gl_FragColor.rgb *= spotIntensity;\n }\n\n gl_FragColor.a *= fade;\n}\n\n@end"},function(t,e,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.lines3D",dependencies:["globe"],visualColorAccessPath:"lineStyle.color",getInitialData:function(t,e){var n=new r.a.List(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],(function(t,e,i,r){if(t instanceof Array)return NaN;n.hasItemOption=!0;var a=t.value;return null!=a?a instanceof Array?a[r]:a:void 0})),n},defaultOption:{coordinateSystem:"globe",globeIndex:0,geo3DIndex:0,zlevel:-10,polyline:!1,effect:{show:!1,period:4,trailWidth:4,trailLength:.2,spotIntensity:6},silent:!0,blendMode:"source-over",lineStyle:{width:1,opacity:.5}}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(227),n(228),n(16));r.a.registerVisual(Object(a.a)("polygons3D"))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(26);function o(t,e){for(var n=[],i=0;i0;this._updateSurfaceMesh(this._surfaceMesh,t,h,p);var g=this._surfaceMesh.material;p?(g.define("WIREFRAME_QUAD"),g.set("wireframeLineWidth",f),g.set("wireframeLineColor",a.a.parseColor(d.get("lineStyle.color")))):g.undefine("WIREFRAME_QUAD"),this._initHandler(t,n),this._updateAnimation(t)},_updateAnimation:function(t){a.a.updateVertexAnimation([["prevPosition","position"],["prevNormal","normal"]],this._prevSurfaceMesh,this._surfaceMesh,t)},_createSurfaceMesh:function(){var t=new a.a.Mesh({geometry:new a.a.Geometry({dynamic:!0,sortTriangles:!0}),shadowDepthMaterial:new a.a.Material({shader:new a.a.Shader(a.a.Shader.source("ecgl.sm.depth.vertex"),a.a.Shader.source("ecgl.sm.depth.fragment"))}),culling:!1,renderOrder:10,renderNormal:!0});return t.geometry.createAttribute("barycentric","float",4),t.geometry.createAttribute("prevPosition","float",3),t.geometry.createAttribute("prevNormal","float",3),r.a.util.extend(t.geometry,l.a),t},_initHandler:function(t,e){var n=t.getData(),i=this._surfaceMesh,r=t.coordinateSystem;i.seriesIndex=t.seriesIndex;var a=-1;i.off("mousemove"),i.off("mouseout"),i.on("mousemove",(function(t){var o=function(t,e){for(var n=1/0,r=-1,a=[],o=0;o=0){var s=[];i.geometry.attributes.position.get(o,s);for(var l=r.pointToData(s),c=1/0,h=-1,d=[],f=0;f65535?Uint32Array:Uint16Array)((m-1)*(v-1)*6),T=function(t,e,n){n[1]=t*v+e,n[0]=t*v+e+1,n[3]=(t+1)*v+e+1,n[2]=(t+1)*v+e},S=!1;if(c){var M=[],C=[],A=0;y?d.init(r.vertexCount):d.value=null;for(var O=[[],[],[]],N=[],P=[],L=u.create(),R=function(t,e,n){var i=3*e;return n[0]=t[i],n[1]=t[i+1],n[2]=t[i+2],n},D=new Float32Array(s.length),k=new Float32Array(s.length/3*4),I=0;I ")),a.value&&(c+=" : "+r.a.format.encodeHTML(a.value)),c}return s.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var t=(this.option.categories||[]).map((function(t){return null!=t.value?t:r.a.util.extend({value:0},t)})),e=new r.a.List(["value"],this);e.initData(t),this._categoriesData=e,this._categoriesModels=e.mapArray((function(t){return e.getItemModel(t,!0)}))},setView:function(t){null!=t.zoom&&(this.option.zoom=t.zoom),null!=t.offset&&(this.option.offset=t.offset)},setNodePosition:function(t){for(var e=0;e "+v)),p++)}var y=r.a.helper.completeDimensions(["value"],t);(h=new r.a.List(y,n)).initData(t);var x=new r.a.List(["value"],n);return x.initData(f,d),a&&a(h,x),l()({mainData:h,struct:s,structAttr:"graph",datas:{node:h,edge:x},datasAttr:{node:"data",edge:"edgeData"}}),s.update(),s}},function(t,e,n){n(85).__DEV__;var i=n(12),r=n(244).enableClassCheck;function a(t){return"_EC_"+t}var o=function(t){this._directed=t||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},s=o.prototype;function l(t,e){this.id=null==t?"":t,this.inEdges=[],this.outEdges=[],this.edges=[],this.hostGraph,this.dataIndex=null==e?-1:e}function u(t,e,n){this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}s.type="graph",s.isDirected=function(){return this._directed},s.addNode=function(t,e){t=t||""+e;var n=this._nodesMap;if(!n[a(t)]){var i=new l(t,e);return i.hostGraph=this,this.nodes.push(i),n[a(t)]=i,i}},s.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},s.getNodeById=function(t){return this._nodesMap[a(t)]},s.addEdge=function(t,e,n){var i=this._nodesMap,r=this._edgesMap;if("number"==typeof t&&(t=this.nodes[t]),"number"==typeof e&&(e=this.nodes[e]),l.isInstance(t)||(t=i[a(t)]),l.isInstance(e)||(e=i[a(e)]),t&&e){var o=t.id+"-"+e.id;if(!r[o]){var s=new u(t,e,n);return s.hostGraph=this,this._directed&&(t.outEdges.push(s),e.inEdges.push(s)),t.edges.push(s),t!==e&&e.edges.push(s),this.edges.push(s),r[o]=s,s}}},s.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},s.getEdge=function(t,e){l.isInstance(t)&&(t=t.id),l.isInstance(e)&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},s.eachNode=function(t,e){for(var n=this.nodes,i=n.length,r=0;r=0&&t.call(e,n[r],r)},s.eachEdge=function(t,e){for(var n=this.edges,i=n.length,r=0;r=0&&n[r].node1.dataIndex>=0&&n[r].node2.dataIndex>=0&&t.call(e,n[r],r)},s.breadthFirstTraverse=function(t,e,n,i){if(l.isInstance(e)||(e=this._nodesMap[a(e)]),e){for(var r="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o=0&&n.node2.dataIndex>=0})),r=0,a=i.length;r=0&&this[t][e].setItemVisual(this.dataIndex,n,i)},getVisual:function(n,i){return this[t][e].getItemVisual(this.dataIndex,n,i)},setLayout:function(n,i){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,i)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}};i.mixin(l,c("hostGraph","data")),i.mixin(u,c("hostGraph","edgeData")),o.Node=l,o.Edge=u,r(l),r(u);var h=o;t.exports=h},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){n(85).__DEV__;var i=n(12),r="___EC__COMPONENT__CONTAINER___";function a(t){var e={main:"",sub:""};return t&&(t=t.split("."),e.main=t[0]||"",e.sub=t[1]||""),e}var o=0;function s(t,e){var n=i.slice(arguments,2);return this.superClass.prototype[e].apply(t,n)}function l(t,e,n){return this.superClass.prototype[e].apply(t,n)}e.parseClassType=a,e.enableClassExtend=function(t,e){t.$constructor=t,t.extend=function(t){var e=this,n=function(){t.$constructor?t.$constructor.apply(this,arguments):e.apply(this,arguments)};return i.extend(n.prototype,t),n.extend=this.extend,n.superCall=s,n.superApply=l,i.inherits(n,this),n.superClass=e,n}},e.enableClassCheck=function(t){var e=["__\0is_clz",o++,Math.random().toFixed(3)].join("_");t.prototype[e]=!0,t.isInstance=function(t){return!(!t||!t[e])}},e.enableClassManagement=function(t,e){e=e||{};var n={};if(t.registerClass=function(t,e){if(e)if(function(t){i.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}(e),(e=a(e)).sub){if(e.sub!==r){var o=function(t){var e=n[t.main];return e&&e[r]||((e=n[t.main]={})[r]=!0),e}(e);o[e.sub]=t}}else n[e.main]=t;return t},t.getClass=function(t,e,i){var a=n[t];if(a&&a[r]&&(a=e?a[e]:null),i&&!a)throw new Error(e?"Component "+t+"."+(e||"")+" not exists. Load it first.":t+".type should be specified.");return a},t.getClassesByMainType=function(t){t=a(t);var e=[],o=n[t.main];return o&&o[r]?i.each(o,(function(t,n){n!==r&&e.push(t)})):e.push(o),e},t.hasClass=function(t){return t=a(t),!!n[t.main]},t.getAllClassMainTypes=function(){var t=[];return i.each(n,(function(e,n){t.push(n)})),t},t.hasSubTypes=function(t){t=a(t);var e=n[t.main];return e&&e[r]},t.parseClassType=a,e.registerWhenExtend){var o=t.extend;o&&(t.extend=function(e){var n=o.call(this,e);return t.registerClass(n,e.type)})}return t},e.setReadOnly=function(t,e){}},function(t,e,n){var i=n(12),r=i.each,a="\0__link_datas",o="\0__link_mainData";function s(t,e){if((r=this)[o]===r){var n=i.extend({},this[a]);n[this.dataType]=e,h(e,n,t)}else d(e,this.dataType,this[o],t);var r;return e}function l(t,e){return t.struct&&t.struct.update(this),e}function u(t,e){return r(e[a],(function(n,i){n!==e&&d(n.cloneShallow(),i,e,t)})),e}function c(t){var e=this[o];return null==t||null==e?e:e[a][t]}function h(t,e,n){t[a]={},r(e,(function(e,i){d(e,i,t,n)}))}function d(t,e,n,i){n[a][e]=t,t[o]=n,t.dataType=e,i.struct&&(t[i.structAttr]=i.struct,i.struct[i.datasAttr[e]]=t),t.getLinkedData=c}var f=function(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,h(e,n,t),r(n,(function(n){r(e.TRANSFERABLE_METHODS,(function(e){n.wrapMethod(e,i.curry(s,t))}))})),e.wrapMethod("cloneShallow",i.curry(u,t)),r(e.CHANGABLE_METHODS,(function(n){e.wrapMethod(n,i.curry(l,t))})),i.assert(n[e.dataType]===e)};t.exports=f},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(41),o=n.n(a),s=n(2),l=n(20),u=n(86),c=n(3),h=n(247),d=n(249),f=n(65),p=n.n(f),g=n(1),m=n.n(g),v=n(251),y=n(62),x=n(252),b=m.a.vec2;s.a.Shader.import(x.a);var _,E=1;r.a.extendChartView({type:"graphGL",__ecgl__:!0,init:function(t,e){this.groupGL=new s.a.Node,this.viewGL=new l.a("orthographic"),this.viewGL.camera.left=this.viewGL.camera.right=0,this.viewGL.add(this.groupGL),this._pointsBuilder=new y.a(!0,e),this._forceEdgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.forceAtlas2.edges"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new s.a.Geometry({attributes:{node:new s.a.Geometry.Attribute("node","float",2),color:new s.a.Geometry.Attribute("color","float",4,"COLOR")},dynamic:!0,mainAttribute:"node"}),renderOrder:-1,mode:s.a.Mesh.LINES}),this._edgesMesh=new s.a.Mesh({material:new s.a.Material({shader:s.a.createShader("ecgl.meshLines2D"),transparent:!0,depthMask:!1,depthTest:!1}),$ignorePicking:!0,geometry:new u.a({useNativeLine:!1,dynamic:!0}),renderOrder:-1,culling:!1}),this._layoutId=0,this._control=new v.a({zr:e.getZr(),viewGL:this.viewGL}),this._control.setTarget(this.groupGL),this._control.init(),this._clickHandler=this._clickHandler.bind(this)},render:function(t,e,n){this.groupGL.add(this._pointsBuilder.rootNode),this._model=t,this._api=n,this._initLayout(t,e,n),this._pointsBuilder.update(t,e,n),this._forceLayoutInstance instanceof h.a||this.groupGL.remove(this._forceEdgesMesh),this._updateCamera(t,n),this._control.off("update"),this._control.on("update",(function(){n.dispatchAction({type:"graphGLRoam",seriesId:t.id,zoom:this._control.getZoom(),offset:this._control.getOffset()}),this._pointsBuilder.updateView(this.viewGL.camera)}),this),this._control.setZoom(c.a.firstNotNull(t.get("zoom"),1)),this._control.setOffset(t.get("offset")||[0,0]);var i=this._pointsBuilder.getPointsMesh();if(i.off("mousemove",this._mousemoveHandler),i.off("mouseout",this._mouseOutHandler,this),n.getZr().off("click",this._clickHandler),this._pointsBuilder.highlightOnMouseover=!0,t.get("focusNodeAdjacency")){var r=t.get("focusNodeAdjacencyOn");"click"===r?n.getZr().on("click",this._clickHandler):"mouseover"===r?(i.on("mousemove",this._mousemoveHandler,this),i.on("mouseout",this._mouseOutHandler,this),this._pointsBuilder.highlightOnMouseover=!1):console.warn("Unkown focusNodeAdjacencyOn value s"+r)}this._lastMouseOverDataIndex=-1},_clickHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id})}},_mousemoveHandler:function(t){if(!this._layouting){var e=this._pointsBuilder.getPointsMesh().dataIndex;e>=0?e!==this._lastMouseOverDataIndex&&this._api.dispatchAction({type:"graphGLFocusNodeAdjacency",seriesId:this._model.id,dataIndex:e}):this._mouseOutHandler(t),this._lastMouseOverDataIndex=e}},_mouseOutHandler:function(t){this._layouting||(this._api.dispatchAction({type:"graphGLUnfocusNodeAdjacency",seriesId:this._model.id}),this._lastMouseOverDataIndex=-1)},_updateForceEdgesGeometry:function(t,e){var n=this._forceEdgesMesh.geometry,i=e.getEdgeData(),r=0,a=this._forceLayoutInstance,o=2*i.count();n.attributes.node.init(o),n.attributes.color.init(o),i.each((function(e){var o=t[e];n.attributes.node.set(r,a.getNodeUV(o.node1)),n.attributes.node.set(r+1,a.getNodeUV(o.node2));var l=i.getItemVisual(o.dataIndex,"color"),u=s.a.parseColor(l);u[3]*=c.a.firstNotNull(i.getItemVisual(o.dataIndex,"opacity"),1),n.attributes.color.set(r,u),n.attributes.color.set(r+1,u),r+=2})),n.dirty()},_updateMeshLinesGeometry:function(){var t=this._model.getEdgeData(),e=this._edgesMesh.geometry,n=(t=this._model.getEdgeData(),this._model.getData().getLayout("points"));e.resetOffset(),e.setVertexCount(t.count()*e.getLineVertexCount()),e.setTriangleCount(t.count()*e.getLineTriangleCount());var i=[],r=[],a=["lineStyle","width"];this._originalEdgeColors=new Float32Array(4*t.count()),this._edgeIndicesMap=new Float32Array(t.count()),t.each((function(o){var l=t.graph.getEdgeByIndex(o),u=2*l.node1.dataIndex,h=2*l.node2.dataIndex;i[0]=n[u],i[1]=n[u+1],r[0]=n[h],r[1]=n[h+1];var d=t.getItemVisual(l.dataIndex,"color"),f=s.a.parseColor(d);f[3]*=c.a.firstNotNull(t.getItemVisual(l.dataIndex,"opacity"),1);var p=t.getItemModel(l.dataIndex),g=c.a.firstNotNull(p.get(a),1)*this._api.getDevicePixelRatio();e.addLine(i,r,f,g);for(var m=0;m<4;m++)this._originalEdgeColors[4*l.dataIndex+m]=f[m];this._edgeIndicesMap[l.dataIndex]=o}),!1,this),e.dirty()},_updateForceNodesGeometry:function(t){for(var e=this._pointsBuilder.getPointsMesh(),n=[],i=0;i=f&&(l._syncNodePosition(t),d=0),n.getZr().refresh(),p()((function(){g(e)}))}))};p()((function(){l._forceLayoutInstanceToDispose&&(l._forceLayoutInstanceToDispose.dispose(r.layer.renderer),l._forceLayoutInstanceToDispose=null),g(u)})),this._layouting=!0}}else console.error("None layout don't have startLayout action")}},stopLayout:function(t,e,n,i){i&&null!=i.from&&i.from!==this.uid||(this._layoutId=0,this.groupGL.remove(this._forceEdgesMesh),this.groupGL.add(this._edgesMesh),this._forceLayoutInstance&&this.viewGL.layer&&(i&&i.beforeLayout||(this._syncNodePosition(t),this._updateAfterLayout(t,e,n)),this._api.getZr().refresh(),this._layouting=!1))},_syncNodePosition:function(t){var e=this._forceLayoutInstance.getNodePosition(this.viewGL.layer.renderer);t.getData().setLayout("points",e),t.setNodePosition(e)},_updateAfterLayout:function(t,e,n){this._updateMeshLinesGeometry(),this._pointsBuilder.removePositionTexture(),this._pointsBuilder.updateLayout(t,e,n),this._pointsBuilder.updateView(this.viewGL.camera),this._pointsBuilder.updateLabels(),this._pointsBuilder.showLabels()},focusNodeAdjacency:function(t,e,n,i){var r=this._model.getData();this._downplayAll();var a=i.dataIndex,o=r.graph,s=[],l=o.getNodeByIndex(a);s.push(l),l.edges.forEach((function(t){t.dataIndex<0||(t.node1!==l&&s.push(t.node1),t.node2!==l&&s.push(t.node2))}),this),this._pointsBuilder.fadeOutAll(.05),this._fadeOutEdgesAll(.05),s.forEach((function(t){this._pointsBuilder.highlight(r,t.dataIndex)}),this),this._pointsBuilder.updateLabels(s.map((function(t){return t.dataIndex})));var u=[];l.edges.forEach((function(t){t.dataIndex>=0&&(this._highlightEdge(t.dataIndex),u.push(t))}),this),this._focusNodes=s,this._focusEdges=u},unfocusNodeAdjacency:function(t,e,n,i){this._downplayAll(),this._pointsBuilder.fadeInAll(),this._fadeInEdgesAll(),this._pointsBuilder.updateLabels()},_highlightEdge:function(t){var e=this._model.getEdgeData().getItemModel(t),n=s.a.parseColor(e.get("emphasis.lineStyle.color")||e.get("lineStyle.color")),i=c.a.firstNotNull(e.get("emphasis.lineStyle.opacity"),e.get("lineStyle.opacity"),1);n[3]*=i,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],n)},_downplayAll:function(){this._focusNodes&&this._focusNodes.forEach((function(t){this._pointsBuilder.downplay(this._model.getData(),t.dataIndex)}),this),this._focusEdges&&this._focusEdges.forEach((function(t){this._downplayEdge(t.dataIndex)}),this)},_downplayEdge:function(t){var e=this._getColor(t,[]);this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],e)},_setEdgeFade:(_=[],function(t,e){this._getColor(t,_),_[3]*=e,this._edgesMesh.geometry.setItemColor(this._edgeIndicesMap[t],_)}),_getColor:function(t,e){for(var n=0;n<4;n++)e[n]=this._originalEdgeColors[4*t+n];return e},_fadeOutEdgesAll:function(t){this._model.getData().graph.eachEdge((function(e){this._setEdgeFade(e.dataIndex,t)}),this)},_fadeInEdgesAll:function(){this._fadeOutEdgesAll(1)},_updateCamera:function(t,e){this.viewGL.setViewport(0,0,e.getWidth(),e.getHeight(),e.getDevicePixelRatio());for(var n=this.viewGL.camera,i=t.getData().getLayout("points"),r=b.create(1/0,1/0),a=b.create(-1/0,-1/0),o=[],s=0;sn.left&&un.top)){var c=Math.max(a[0]-r[0],10),h=c/e.getWidth()*e.getHeight();c*=1.4,h*=1.4,r[0]-=.2*c,n.left=r[0],n.top=l-h/2,n.bottom=l+h/2,n.right=c+r[0],n.near=0,n.far=100}},dispose:function(){var t=this.viewGL.layer.renderer;this._forceLayoutInstance&&this._forceLayoutInstance.dispose(t),this.groupGL.removeAll(),this._layoutId=-1},remove:function(){this.groupGL.removeAll(),this._control.dispose()}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(14),s=n(10),l=n(248);a.a.Shader.import(l.a);var u={repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null};function c(t){var e={type:a.a.Texture.FLOAT,minFilter:a.a.Texture.NEAREST,magFilter:a.a.Texture.NEAREST};this._positionSourceTex=new a.a.Texture2D(e),this._positionSourceTex.flipY=!1,this._positionTex=new a.a.Texture2D(e),this._positionPrevTex=new a.a.Texture2D(e),this._forceTex=new a.a.Texture2D(e),this._forcePrevTex=new a.a.Texture2D(e),this._weightedSumTex=new a.a.Texture2D(e),this._weightedSumTex.width=this._weightedSumTex.height=1,this._globalSpeedTex=new a.a.Texture2D(e),this._globalSpeedPrevTex=new a.a.Texture2D(e),this._globalSpeedTex.width=this._globalSpeedTex.height=1,this._globalSpeedPrevTex.width=this._globalSpeedPrevTex.height=1,this._nodeRepulsionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updateNodeRepulsion")}),this._positionPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.updatePosition")}),this._globalSpeedPass=new o.a({fragment:a.a.Shader.source("ecgl.forceAtlas2.calcGlobalSpeed")}),this._copyPass=new o.a({fragment:a.a.Shader.source("clay.compositor.output")});var n=function(t){t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE)};this._edgeForceMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node1:new a.a.Geometry.Attribute("node1","float",2),node2:new a.a.Geometry.Attribute("node2","float",2),weight:new a.a.Geometry.Attribute("weight","float",1)},dynamic:!0,mainAttribute:"node1"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.updateEdgeAttraction"),blend:n,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._weightedSumMesh=new a.a.Mesh({geometry:new a.a.Geometry({attributes:{node:new a.a.Geometry.Attribute("node","float",2)},dynamic:!0,mainAttribute:"node"}),material:new a.a.Material({transparent:!0,shader:a.a.createShader("ecgl.forceAtlas2.calcWeightedSum"),blend:n,depthMask:!1,depthText:!1}),mode:a.a.Mesh.POINTS}),this._framebuffer=new s.a({depthBuffer:!1}),this._dummyCamera=new a.a.OrthographicCamera({left:-1,right:1,top:1,bottom:-1,near:0,far:100}),this._globalSpeed=0}c.prototype.updateOption=function(t){for(var e in u)this[e]=u[e];var n=this._nodes.length;if(this.jitterTolerence=n>5e4?10:n>5e3?1:.1,this.scaling=n>100?2:10,t)for(var e in u)null!=t[e]&&(this[e]=t[e]);if(this.repulsionByDegree)for(var i=this._positionSourceTex.pixels,r=0;rt},c.prototype._swapTexture=function(){var t=this._positionPrevTex;this._positionPrevTex=this._positionTex,this._positionTex=t,t=this._forcePrevTex,this._forcePrevTex=this._forceTex,this._forceTex=t,t=this._globalSpeedPrevTex,this._globalSpeedPrevTex=this._globalSpeedTex,this._globalSpeedTex=t},c.prototype._initFromSource=function(t){this._framebuffer.attach(this._positionPrevTex),this._framebuffer.bind(t),this._copyPass.setUniform("texture",this._positionSourceTex),this._copyPass.render(t),t.gl.clearColor(0,0,0,0),this._framebuffer.attach(this._forcePrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.attach(this._globalSpeedPrevTex),t.gl.clear(t.gl.COLOR_BUFFER_BIT),this._framebuffer.unbind(t)},c.prototype._resize=function(t,e){["_positionSourceTex","_positionTex","_positionPrevTex","_forceTex","_forcePrevTex"].forEach((function(n){this[n].width=t,this[n].height=e,this[n].dirty()}),this)},c.prototype.dispose=function(t){this._framebuffer.dispose(t),this._copyPass.dispose(t),this._nodeRepulsionPass.dispose(t),this._positionPass.dispose(t),this._globalSpeedPass.dispose(t),this._edgeForceMesh.geometry.dispose(t),this._weightedSumMesh.geometry.dispose(t),this._positionSourceTex.dispose(t),this._positionTex.dispose(t),this._positionPrevTex.dispose(t),this._forceTex.dispose(t),this._forcePrevTex.dispose(t),this._weightedSumTex.dispose(t),this._globalSpeedTex.dispose(t),this._globalSpeedPrevTex.dispose(t)},r.a.ForceAtlas2GPU=c,e.a=c},function(t,e,n){"use strict";e.a="@export ecgl.forceAtlas2.updateNodeRepulsion\n\n#define NODE_COUNT 0\n\nuniform sampler2D positionTex;\n\nuniform vec2 textureSize;\nuniform float gravity;\nuniform float scaling;\nuniform vec2 gravityCenter;\n\nuniform bool strongGravityMode;\nuniform bool preventOverlap;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, v_Texcoord);\n\n vec2 force = vec2(0.0);\n for (int i = 0; i < NODE_COUNT; i++) {\n vec2 uv = vec2(\n mod(float(i), textureSize.x) / (textureSize.x - 1.0),\n floor(float(i) / textureSize.x) / (textureSize.y - 1.0)\n );\n vec4 n1 = texture2D(positionTex, uv);\n\n vec2 dir = n0.xy - n1.xy;\n float d2 = dot(dir, dir);\n\n if (d2 > 0.0) {\n float factor = 0.0;\n if (preventOverlap) {\n float d = sqrt(d2);\n d = d - n0.w - n1.w;\n if (d > 0.0) {\n factor = scaling * n0.z * n1.z / (d * d);\n }\n else if (d < 0.0) {\n factor = scaling * 100.0 * n0.z * n1.z;\n }\n }\n else {\n factor = scaling * n0.z * n1.z / d2;\n }\n force += dir * factor;\n }\n }\n\n vec2 dir = gravityCenter - n0.xy;\n float d = 1.0;\n if (!strongGravityMode) {\n d = length(dir);\n }\n\n force += dir * n0.z * gravity / (d + 1.0);\n\n gl_FragColor = vec4(force, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.vertex\n\nattribute vec2 node1;\nattribute vec2 node2;\nattribute float weight;\n\nuniform sampler2D positionTex;\nuniform float edgeWeightInfluence;\nuniform bool preventOverlap;\nuniform bool linLogMode;\n\nuniform vec2 windowSize: WINDOW_SIZE;\n\nvarying vec2 v_Force;\n\nvoid main() {\n\n vec4 n0 = texture2D(positionTex, node1);\n vec4 n1 = texture2D(positionTex, node2);\n\n vec2 dir = n1.xy - n0.xy;\n float d = length(dir);\n float w;\n if (edgeWeightInfluence == 0.0) {\n w = 1.0;\n }\n else if (edgeWeightInfluence == 1.0) {\n w = weight;\n }\n else {\n w = pow(weight, edgeWeightInfluence);\n }\n vec2 offset = vec2(1.0 / windowSize.x, 1.0 / windowSize.y);\n vec2 scale = vec2((windowSize.x - 1.0) / windowSize.x, (windowSize.y - 1.0) / windowSize.y);\n vec2 pos = node1 * scale * 2.0 - 1.0;\n gl_Position = vec4(pos + offset, 0.0, 1.0);\n gl_PointSize = 1.0;\n\n float factor;\n if (preventOverlap) {\n d = d - n1.w - n0.w;\n }\n if (d <= 0.0) {\n v_Force = vec2(0.0);\n return;\n }\n\n if (linLogMode) {\n factor = w * log(d) / d;\n }\n else {\n factor = w;\n }\n v_Force = dir * factor;\n}\n@end\n\n@export ecgl.forceAtlas2.updateEdgeAttraction.fragment\n\nvarying vec2 v_Force;\n\nvoid main() {\n gl_FragColor = vec4(v_Force, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.vertex\n\nattribute vec2 node;\n\nvarying vec2 v_NodeUv;\n\nvoid main() {\n\n v_NodeUv = node;\n gl_Position = vec4(0.0, 0.0, 0.0, 1.0);\n gl_PointSize = 1.0;\n}\n@end\n\n@export ecgl.forceAtlas2.calcWeightedSum.fragment\n\nvarying vec2 v_NodeUv;\n\nuniform sampler2D positionTex;\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_NodeUv).rg;\n vec2 forcePrev = texture2D(forcePrevTex, v_NodeUv).rg;\n\n float mass = texture2D(positionTex, v_NodeUv).z;\n float swing = length(force - forcePrev) * mass;\n float traction = length(force + forcePrev) * 0.5 * mass;\n\n gl_FragColor = vec4(swing, traction, 0.0, 0.0);\n}\n@end\n\n@export ecgl.forceAtlas2.calcGlobalSpeed\n\nuniform sampler2D globalSpeedPrevTex;\nuniform sampler2D weightedSumTex;\nuniform float jitterTolerence;\n\nvoid main() {\n vec2 weightedSum = texture2D(weightedSumTex, vec2(0.5)).xy;\n float prevGlobalSpeed = texture2D(globalSpeedPrevTex, vec2(0.5)).x;\n float globalSpeed = jitterTolerence * jitterTolerence\n * weightedSum.y / weightedSum.x;\n if (prevGlobalSpeed > 0.0) {\n globalSpeed = min(globalSpeed / prevGlobalSpeed, 1.5) * prevGlobalSpeed;\n }\n gl_FragColor = vec4(globalSpeed, 0.0, 0.0, 1.0);\n}\n@end\n\n@export ecgl.forceAtlas2.updatePosition\n\nuniform sampler2D forceTex;\nuniform sampler2D forcePrevTex;\nuniform sampler2D positionTex;\nuniform sampler2D globalSpeedTex;\n\nvarying vec2 v_Texcoord;\n\nvoid main() {\n vec2 force = texture2D(forceTex, v_Texcoord).xy;\n vec2 forcePrev = texture2D(forcePrevTex, v_Texcoord).xy;\n vec4 node = texture2D(positionTex, v_Texcoord);\n\n float globalSpeed = texture2D(globalSpeedTex, vec2(0.5)).r;\n float swing = length(force - forcePrev);\n float speed = 0.1 * globalSpeed / (0.1 + globalSpeed * sqrt(swing));\n\n float df = length(force);\n if (df > 0.0) {\n speed = min(df * speed, 10.0) / df;\n\n gl_FragColor = vec4(node.xy + speed * force, node.zw);\n }\n else {\n gl_FragColor = node;\n }\n}\n@end\n\n@export ecgl.forceAtlas2.edges.vertex\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 node;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\nuniform sampler2D positionTex;\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(\n texture2D(positionTex, node).xy, -10.0, 1.0\n );\n v_Color = a_Color;\n}\n@end\n\n@export ecgl.forceAtlas2.edges.fragment\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nvarying vec4 v_Color;\nvoid main() {\n gl_FragColor = color * v_Color;\n}\n@end"},function(t,e,n){"use strict";var i=n(5),r=n(6),a=n(250).a.toString();a=a.slice(a.indexOf("{")+1,a.lastIndexOf("}"));var o={barnesHutOptimize:!0,barnesHutTheta:1.5,repulsionByDegree:!0,linLogMode:!1,strongGravityMode:!1,gravity:1,scaling:1,edgeWeightInfluence:1,jitterTolerence:.1,preventOverlap:!1,dissuadeHubs:!1,gravityCenter:null},s=function(t){for(var e in o)this[e]=o[e];if(t)for(var e in t)this[e]=t[e];this._nodes=[],this._edges=[],this._disposed=!1,this._positionTex=new i.a({type:r.a.FLOAT,flipY:!1,minFilter:r.a.NEAREST,magFilter:r.a.NEAREST})};s.prototype.initData=function(t,e){var n=new Blob([a]),i=window.URL.createObjectURL(n);this._worker=new Worker(i),this._worker.onmessage=this._$onupdate.bind(this),this._nodes=t,this._edges=e,this._frame=0;for(var r=t.length,o=e.length,s=new Float32Array(2*r),l=new Float32Array(r),u=new Float32Array(r),c=new Float32Array(2*o),h=new Float32Array(o),d=0;d5e4?10:a>5e3?1:.1,e.scaling=a>100?2:10,e.barnesHutOptimize=a>1e3,t)for(var n in o)null!=t[n]&&(e[n]=t[n]);if(!e.gravityCenter){for(var s=[1/0,1/0],l=[-1/0,-1/0],u=0;ut},s.prototype.getNodePosition=function(t,e){if(e||(e=new Float32Array(2*this._nodes.length)),this._positionArr)for(var n=0;n=t&&this.bbox[1]<=e&&this.bbox[3]>=e},u.setBBox=function(t,e,n,i){this.bbox[0]=t,this.bbox[1]=e,this.bbox[2]=n,this.bbox[3]=i,this.size=(n-t+i-e)/2},u._newSubRegion=function(){var t=this.subRegions[this.nSubRegions];return t||(t=new l,this.subRegions[this.nSubRegions]=t),this.nSubRegions++,t},u._addNodeToSubRegion=function(t){var e=this.findSubRegion(t.position[0],t.position[1]),n=this.bbox;if(!e){var i=(n[0]+n[2])/2,r=(n[1]+n[3])/2,a=(n[2]-n[0])/2,o=(n[3]-n[1])/2,s=t.position[0]>=i?1:0,l=t.position[1]>=r?1:0;(e=this._newSubRegion()).setBBox(s*a+n[0],l*o+n[1],(s+1)*a+n[0],(l+1)*o+n[1])}e.addNode(t)},u._updateCenterOfMass=function(t){null==this.centerOfMass&&(this.centerOfMass=new Float32Array(2));var e=this.centerOfMass[0]*this.mass,n=this.centerOfMass[1]*this.mass;e+=t.position[0]*t.mass,n+=t.position[1]*t.mass,this.mass+=t.mass,this.centerOfMass[0]=e/this.mass,this.centerOfMass[1]=n/this.mass};var f,p=d.prototype;p.initNodes=function(t,e,n){var i=e.length;this.nodes.length=0;for(var r=void 0!==n,a=0;a0&&(this.strongGravityMode?this.applyNodeStrongGravity(c):this.applyNodeGravity(c))}for(l=0;l0&&(m=Math.min(m/this._globalSpeed,1.5)*this._globalSpeed),this._globalSpeed=m,l=0;l0&&(y=Math.min(x*y,10)/x,i(u.position,u.position,u.force,y))}},p.applyRegionToNodeRepulsion=(f=t(),function(t,e){if(t.node)this.applyNodeToNodeRepulsion(t.node,e,!0);else{a(f,e.position,t.centerOfMass);var n=f[0]*f[0]+f[1]*f[1];if(n>this.barnesHutTheta*t.size*t.size){var r=this.scaling*e.mass*t.mass/n;i(e.force,e.force,f,r)}else for(var o=0;o0)s=this.scaling*t.mass*n.mass/(l*l);else{if(!(l<0))return;s=100*this.scaling*t.mass*n.mass}}else s=this.scaling*t.mass*n.mass/o;i(t.force,t.force,e,s),i(n.force,n.force,e,-s)}}}}(),p.applyEdgeAttraction=function(){var e=t();return function(t){var r=t.source,o=t.target;a(e,r.position,o.position);var s,l,u=n(e);s=0===this.edgeWeightInfluence?1:1===this.edgeWeightInfluence?t.weight:Math.pow(t.weight,this.edgeWeightInfluence),this.preventOverlap&&(u=u-r.size-o.size)<=0||(l=this.linLogMode?-s*Math.log(u+1)/(u+1):-s,i(r.force,r.force,e,l),i(o.force,o.force,e,-l))}}(),p.applyNodeGravity=function(){var e=t();return function(t){a(e,this.gravityCenter,t.position);var r=n(e);i(t.force,t.force,e,this.gravity*t.mass/(r+1))}}(),p.applyNodeStrongGravity=function(){var e=t();return function(t){a(e,this.gravityCenter,t.position),i(t.force,t.force,e,this.gravity*t.mass)}}(),p.updateBBox=function(){for(var t=1/0,e=1/0,n=-1/0,i=-1/0,r=0;r0?1.1:.9,a=Math.max(Math.min(this._zoom*r,this.maxZoom),this.minZoom);r=a/this._zoom;var o=this._convertPos(n,i),s=(o.x-this._dx)*(r-1),l=(o.y-this._dy)*(r-1);this._dx-=s,this._dy-=l,this._zoom=a,this._needsUpdate=!0}}},dispose:function(){var t=this.zr;t.off("mousedown",this._mouseDownHandler),t.off("mousemove",this._mouseMoveHandler),t.off("mouseup",this._mouseUpHandler),t.off("mousewheel",this._mouseWheelHandler),t.off("globalout",this._mouseUpHandler),t.animation.off("frame",this._update)}}));e.a=r},function(t,e,n){"use strict";e.a="@export ecgl.lines2D.vertex\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nattribute vec2 position: POSITION;\nattribute vec4 a_Color : COLOR;\nvarying vec4 v_Color;\n\n#ifdef POSITIONTEXTURE_ENABLED\nuniform sampler2D positionTexture;\n#endif\n\nvoid main()\n{\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n v_Color = a_Color;\n}\n\n@end\n\n@export ecgl.lines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.vertex\n\nattribute vec2 position: POSITION;\nattribute vec2 normal;\nattribute float offset;\nattribute vec4 a_Color : COLOR;\n\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\nuniform vec4 viewport : VIEWPORT;\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n vec4 p2 = worldViewProjection * vec4(position + normal, -10.0, 1.0);\n gl_Position = worldViewProjection * vec4(position, -10.0, 1.0);\n\n p2.xy /= p2.w;\n gl_Position.xy /= gl_Position.w;\n\n vec2 N = normalize(p2.xy - gl_Position.xy);\n gl_Position.xy += N * offset / viewport.zw * 2.0;\n\n gl_Position.xy *= gl_Position.w;\n\n v_Color = a_Color;\n}\n@end\n\n\n@export ecgl.meshLines2D.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\n\nvarying vec4 v_Color;\nvarying float v_Miter;\n\nvoid main()\n{\n gl_FragColor = color * v_Color;\n}\n\n@end"},function(t,e,n){"use strict";var i=n(0);n.n(i),n(254),n(258)},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(3),s=n(20),l=n(255);r.a.extendChartView({type:"flowGL",__ecgl__:!0,init:function(t,e){this.viewGL=new s.a("orthographic"),this.groupGL=new a.a.Node,this.viewGL.add(this.groupGL),this._particleSurface=new l.a;var n=new a.a.Mesh({geometry:new a.a.PlaneGeometry,material:new a.a.Material({shader:new a.a.Shader({vertex:a.a.Shader.source("ecgl.color.vertex"),fragment:a.a.Shader.source("ecgl.color.fragment")}),transparent:!0})});n.material.enableTexture("diffuseMap"),this.groupGL.add(n),this._planeMesh=n},render:function(t,e,n){var i=this._particleSurface;i.setParticleType(t.get("particleType")),i.setSupersampling(t.get("supersampling")),this._updateData(t,n),this._updateCamera(n.getWidth(),n.getHeight(),n.getDevicePixelRatio());var r=o.a.firstNotNull(t.get("particleDensity"),128);i.setParticleDensity(r,r);var s=this._planeMesh,l=+new Date,u=this,c=!0;s.__percent=0,s.stopAnimation(),s.animate("",{loop:!0}).when(1e5,{__percent:1}).during((function(){var t=+new Date,e=Math.min(t-l,20);l+=e,u._renderer&&(i.update(u._renderer,n,e/1e3,c),s.material.set("diffuseMap",i.getSurfaceTexture())),c=!1})).start();var h=t.getModel("itemStyle"),d=a.a.parseColor(h.get("color"));d[3]*=o.a.firstNotNull(h.get("opacity"),1),s.material.set("color",d),i.setColorTextureImage(t.get("colorTexture"),n),i.setParticleSize(t.get("particleSize")),i.particleSpeedScaling=t.get("particleSpeed"),i.motionBlurFactor=1-Math.pow(.1,t.get("particleTrail"))},updateTransform:function(t,e,n){this._updateData(t,n)},afterRender:function(t,e,n,i){var r=i.renderer;this._renderer=r},_updateData:function(t,e){var n=t.coordinateSystem,i=n.dimensions.map((function(e){return t.coordDimToDataDim(e)[0]})),r=t.getData(),a=r.getDataExtent(i[0]),o=r.getDataExtent(i[1]),s=t.get("gridWidth"),l=t.get("gridHeight");if(null==s||"auto"===s){var u=(a[1]-a[0])/(o[1]-o[0]);s=Math.round(Math.sqrt(u*r.count()))}null!=l&&"auto"!==l||(l=Math.ceil(r.count()/s));var c=this._particleSurface.vectorFieldTexture,h=c.pixels;if(h&&h.length===l*s*4)for(var d=0;d=359&&(r[0]>0&&(r[0]=0),a[0]0?t[t.length-1]:this._lastFrameTexture},setRegion:function(t){this._particlePass.setUniform("region",t)},resize:function(t,e){this._lastFrameTexture.width=t*this._supersampling,this._lastFrameTexture.height=e*this._supersampling,this._thisFrameTexture.width=t*this._supersampling,this._thisFrameTexture.height=e*this._supersampling,this._width=t,this._height=e},setParticleSize:function(t){var e=this._getParticleMesh();if(t<=2)return e.material.disableTexture("spriteTexture"),void(e.material.transparent=!1);this._spriteTexture||(this._spriteTexture=new l.a),this._spriteTexture.image&&this._spriteTexture.image.width===t||(this._spriteTexture.image=function(t){var e=document.createElement("canvas");e.width=e.height=t;var n=e.getContext("2d");return n.fillStyle="#fff",n.arc(t/2,t/2,t/2,0,2*Math.PI),n.fill(),e}(t),this._spriteTexture.dirty()),e.material.transparent=!0,e.material.enableTexture("spriteTexture"),e.material.set("spriteTexture",this._spriteTexture),this._particleSize=t},setGradientTexture:function(t){var e=this._getParticleMesh().material;e[t?"enableTexture":"disableTexture"]("gradientTexture"),e.setUniform("gradientTexture",t)},setColorTextureImage:function(t,e){this._getParticleMesh().material.setTextureImage("colorTexture",t,e,{flipY:!0})},setParticleType:function(t){this._particleType=t},clearFrame:function(t){var e=this._frameBuffer;e.attach(this._lastFrameTexture),e.bind(t),t.gl.clear(t.gl.DEPTH_BUFFER_BIT|t.gl.COLOR_BUFFER_BIT),e.unbind(t)},setSupersampling:function(t){this._supersampling=t,this.resize(this._width,this._height)},_updateDownsampleTextures:function(t,e){for(var n=this._downsampleTextures,i=Math.max(Math.floor(Math.log(this._supersampling/e.getDevicePixelRatio())/Math.log(2)),0),r=2,a=this._width*this._supersampling,o=this._height*this._supersampling,s=0;s65535?new Uint32Array(3*i):new Uint16Array(3*i))},addLine:function(t){var e=this._vertexOffset;this.attributes.position.set(e,[t[0],t[1],1]),this.attributes.position.set(e+1,[t[0],t[1],-1]),this.attributes.position.set(e+2,[t[0],t[1],2]),this.attributes.position.set(e+3,[t[0],t[1],-2]),this.setTriangleIndices(this._faceOffset++,[e,e+1,e+2]),this.setTriangleIndices(this._faceOffset++,[e+1,e+2,e+3]),this._vertexOffset+=4}}));e.a=a},function(t,e,n){"use strict";e.a="@export ecgl.vfParticle.particle.fragment\n\nuniform sampler2D particleTexture;\nuniform sampler2D spawnTexture;\nuniform sampler2D velocityTexture;\n\nuniform float deltaTime;\nuniform float elapsedTime;\n\nuniform float speedScaling : 1.0;\n\nuniform vec2 textureSize;\nuniform vec4 region : [0, 0, 1, 1];\nuniform float firstFrameTime;\n\nvarying vec2 v_Texcoord;\n\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, v_Texcoord);\n bool spawn = false;\n if (p.w <= 0.0) {\n p = texture2D(spawnTexture, fract(v_Texcoord + elapsedTime / 10.0));\n p.w -= firstFrameTime;\n spawn = true;\n }\n vec2 v = texture2D(velocityTexture, fract(p.xy * region.zw + region.xy)).xy;\n v = (v - 0.5) * 2.0;\n p.z = length(v);\n p.xy += v * deltaTime / 10.0 * speedScaling;\n p.w -= deltaTime;\n\n if (spawn || p.xy != fract(p.xy)) {\n p.z = 0.0;\n }\n p.xy = fract(p.xy);\n\n gl_FragColor = p;\n}\n@end\n\n@export ecgl.vfParticle.renderPoints.vertex\n\n#define PI 3.1415926\n\nattribute vec2 texcoord : TEXCOORD_0;\n\nuniform sampler2D particleTexture;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nuniform float size : 1.0;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, texcoord);\n\n if (p.w > 0.0 && p.z > 1e-5) {\n gl_Position = worldViewProjection * vec4(p.xy * 2.0 - 1.0, 0.0, 1.0);\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n\n v_Mag = p.z;\n v_Uv = p.xy;\n\n gl_PointSize = size;\n}\n\n@end\n\n@export ecgl.vfParticle.renderPoints.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\nuniform sampler2D spriteTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n#ifdef SPRITETEXTURE_ENABLED\n gl_FragColor *= texture2D(spriteTexture, gl_PointCoord);\n if (color.a == 0.0) {\n discard;\n }\n#endif\n#ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.vertex\n\n#define PI 3.1415926\n\nattribute vec3 position : POSITION;\n\nuniform sampler2D particleTexture;\nuniform sampler2D prevParticleTexture;\n\nuniform float size : 1.0;\nuniform vec4 vp: VIEWPORT;\nuniform mat4 worldViewProjection : WORLDVIEWPROJECTION;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\n@import clay.util.rand\n\nvoid main()\n{\n vec4 p = texture2D(particleTexture, position.xy);\n vec4 p2 = texture2D(prevParticleTexture, position.xy);\n\n p.xy = p.xy * 2.0 - 1.0;\n p2.xy = p2.xy * 2.0 - 1.0;\n\n if (p.w > 0.0 && p.z > 1e-5) {\n vec2 dir = normalize(p.xy - p2.xy);\n vec2 norm = vec2(dir.y / vp.z, -dir.x / vp.w) * sign(position.z) * size;\n if (abs(position.z) == 2.0) {\n gl_Position = vec4(p.xy + norm, 0.0, 1.0);\n v_Uv = p.xy;\n v_Mag = p.z;\n }\n else {\n gl_Position = vec4(p2.xy + norm, 0.0, 1.0);\n v_Mag = p2.z;\n v_Uv = p2.xy;\n }\n gl_Position = worldViewProjection * gl_Position;\n }\n else {\n gl_Position = vec4(100000.0, 100000.0, 100000.0, 1.0);\n }\n}\n\n@end\n\n@export ecgl.vfParticle.renderLines.fragment\n\nuniform vec4 color : [1.0, 1.0, 1.0, 1.0];\nuniform sampler2D gradientTexture;\nuniform sampler2D colorTexture;\n\nvarying float v_Mag;\nvarying vec2 v_Uv;\n\nvoid main()\n{\n gl_FragColor = color;\n #ifdef GRADIENTTEXTURE_ENABLED\n gl_FragColor *= texture2D(gradientTexture, vec2(v_Mag, 0.5));\n#endif\n#ifdef COLORTEXTURE_ENABLED\n gl_FragColor *= texture2D(colorTexture, v_Uv);\n#endif\n}\n\n@end\n"},function(t,e,n){"use strict";var i=n(0),r=n.n(i);r.a.extendSeriesModel({type:"series.flowGL",dependencies:["geo","grid","bmap"],visualColorAccessPath:"itemStyle.color",getInitialData:function(t,e){var n=r.a.getCoordinateSystemDimensions(this.get("coordinateSystem"))||["x","y"];if(n.length>2)throw new Error("flowGL can only be used on 2d coordinate systems.");n.push("vx","vy");var i=r.a.helper.completeDimensions(n,this.getSource(),{encodeDef:this.get("encode"),dimsDef:this.get("dimensions")}),a=new r.a.List(i,this);return a.initData(this.getSource()),a},defaultOption:{coordinateSystem:"cartesian2d",zlevel:10,supersampling:1,particleType:"point",particleDensity:128,particleSize:1,particleSpeed:1,particleTrail:2,colorTexture:null,gridWidth:"auto",gridHeight:"auto",itemStyle:{color:"#fff",opacity:.8}}})},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=(n(260),n(261),n(16));r.a.registerVisual(Object(a.a)("linesGL"))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(12),o=(n.n(a),r.a.extendSeriesModel({type:"series.linesGL",dependencies:["grid","geo"],visualColorAccessPath:"lineStyle.color",streamEnabled:!0,init:function(t){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),o.superApply(this,"init",arguments)},mergeOption:function(t){var e=this._processFlatCoordsArray(t.data);this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset,e.flatCoords&&(t.data=new Float32Array(e.count)),o.superApply(this,"mergeOption",arguments)},appendData:function(t){var e=this._processFlatCoordsArray(t.data);e.flatCoords&&(this._flatCoords?(this._flatCoords=Object(a.concatArray)(this._flatCoords,e.flatCoords),this._flatCoordsOffset=Object(a.concatArray)(this._flatCoordsOffset,e.flatCoordsOffset)):(this._flatCoords=e.flatCoords,this._flatCoordsOffset=e.flatCoordsOffset),t.data=new Float32Array(e.count)),this.getRawData().appendData(t.data)},_getCoordsFromItemModel:function(t){var e=this.getData().getItemModel(t),n=e.option instanceof Array?e.option:e.getShallow("coords");if(!(n instanceof Array&&n.length>0&&n[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(n)+". Lines must have 2d coords array in data item.");return n},getLineCoordsCount:function(t){return this._flatCoordsOffset?this._flatCoordsOffset[2*t+1]:this._getCoordsFromItemModel(t).length},getLineCoords:function(t,e){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[2*t],i=this._flatCoordsOffset[2*t+1],r=0;rn)throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(i.buffer,0,o),flatCoords:r,count:s}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},getInitialData:function(t,e){var n=new r.a.List(["value"],this);return n.hasItemOption=!1,n.initData(t.data,[],(function(t,e,i,r){if(t instanceof Array)return NaN;n.hasItemOption=!0;var a=t.value;return null!=a?a instanceof Array?a[r]:a:void 0})),n},defaultOption:{coordinateSystem:"geo",zlevel:10,progressive:1e4,progressiveThreshold:5e4,blendMode:"source-over",lineStyle:{opacity:.8},postEffect:{enable:!1,colorCorrection:{exposure:0,brightness:0,contrast:1,saturation:1,enable:!0}}}}))},function(t,e,n){"use strict";var i=n(0),r=n.n(i),a=n(2),o=n(20),s=n(86),l=n(84),u=n(3);r.a.extendChartView({type:"linesGL",__ecgl__:!0,init:function(t,e){this.groupGL=new a.a.Node,this.viewGL=new o.a("orthographic"),this.viewGL.add(this.groupGL),this._glViewHelper=new l.a(this.viewGL),this._nativeLinesShader=a.a.createShader("ecgl.lines3D"),this._meshLinesShader=a.a.createShader("ecgl.meshLines3D"),this._linesMeshes=[],this._currentStep=0},render:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n);var i=this._linesMeshes[0];i||(i=this._linesMeshes[0]=this._createLinesMesh(t)),this._linesMeshes.length=1,this.groupGL.add(i),this._updateLinesMesh(t,i,0,t.getData().count()),this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalPrepareRender:function(t,e,n){this.groupGL.removeAll(),this._glViewHelper.reset(t,n),this._currentStep=0,this.viewGL.setPostEffect(t.getModel("postEffect"),n)},incrementalRender:function(t,e,n,i){var r=this._linesMeshes[this._currentStep];r||(r=this._createLinesMesh(e),this._linesMeshes[this._currentStep]=r),this._updateLinesMesh(e,r,t.start,t.end),this.groupGL.add(r),i.getZr().refresh(),this._currentStep++},updateTransform:function(t,e,n){t.coordinateSystem.getRoamTransform&&this._glViewHelper.updateTransform(t,n)},_createLinesMesh:function(t){return new a.a.Mesh({$ignorePicking:!0,material:new a.a.Material({shader:a.a.createShader("ecgl.lines3D"),transparent:!0,depthMask:!1,depthTest:!1}),geometry:new s.a({segmentScale:10,useNativeLine:!0,dynamic:!1}),mode:a.a.Mesh.LINES,culling:!1})},_updateLinesMesh:function(t,e,n,i){var r=t.getData();e.material.blend="lighter"===t.get("blendMode")?a.a.additiveBlend:null;var o=t.get("lineStyle.curveness")||0,s=t.get("polyline"),l=e.geometry,c=t.coordinateSystem,h=u.a.firstNotNull(t.get("lineStyle.width"),1);h>1?(e.material.shader!==this._meshLinesShader&&e.material.attachShader(this._meshLinesShader),e.mode=a.a.Mesh.TRIANGLES):(e.material.shader!==this._nativeLinesShader&&e.material.attachShader(this._nativeLinesShader),e.mode=a.a.Mesh.LINES),n=n||0,i=i||r.count(),l.resetOffset();var d=0,f=0,p=[],g=[],m=[],v=[],y=[],x=.3,b=.7;function _(){g[0]=p[0]*b+v[0]*x-(p[1]-v[1])*o,g[1]=p[1]*b+v[1]*x-(v[0]-p[0])*o,m[0]=p[0]*x+v[0]*b-(p[1]-v[1])*o,m[1]=p[1]*x+v[1]*b-(v[0]-p[0])*o}if(s||0!==o)for(var E=n;E=2&&e(n[n.length-2],n[n.length-1],t[i])<=0;)n.pop();n.push(t[i])}return n.pop(),n}(t),i=function(t){const n=t.reverse(),i=[];for(let t=0;t=2&&e(i[i.length-2],i[i.length-1],n[t])<=0;)i.pop();i.push(n[t])}return i.pop(),i}(t).concat(n);return i.push(t[0]),i}},11950:function(t){t.exports={toXy:function(t,e){return void 0===e?t.slice():t.map((function(t){return new Function("pt","return [pt"+e[0]+",pt"+e[1]+"];")(t)}))},fromXy:function(t,e){return void 0===e?t.slice():t.map((function(t){return new Function("pt","const o = {}; o"+e[0]+"= pt[0]; o"+e[1]+"= pt[1]; return o;")(t)}))}}},98204:function(t){function e(t,e){this._cells=[],this._cellSize=e,this._reverseCellSize=1/e;for(let e=0;eo&&r>s&&!u([t[0],e[c]],n)&&!u([t[1],e[c]],n)&&(o=i,s=r,a=e[c]);return a}function d(t,e,n,i,r){let a=!1;for(let o=0;od||n[1]>f));d>=n[0]&&f>=n[1]&&r.add(u),null!==p&&(t.splice(o+1,0,p),i.removePoint(p),a=!0)}return a?d(t,e,n,i,r):t}const f=Math.cos(90/(180/Math.PI)),p=.6;t.exports=function(t,e,n){let i=e||20;const s=function(t){const e=[t[0]];let n=t[0];for(let i=1;i=0;a--)t[a][0]i&&(i=t[a][0]),t[a][1]>r&&(r=t[a][1]);return[i-e,r-n]}(s),u=[l[0]*p,l[1]*p],c=o(s),h=s.filter((function(t){return c.indexOf(t)<0})),f=Math.ceil(1/(s.length/(l[0]*l[1]))),g=d(c,Math.pow(i,2),u,r(h,f),new Set);return n?a.fromXy(g,n):g}},86972:function(t){function e(t,e,n,i,r,a){const o=(a-e)*(n-t)-(i-e)*(r-t);return o>0||!(o<0)}t.exports=function(t,n){const i=t[0][0],r=t[0][1],a=t[1][0],o=t[1][1],s=n[0][0],l=n[0][1],u=n[1][0],c=n[1][1];return e(i,r,s,l,u,c)!==e(a,o,s,l,u,c)&&e(i,r,a,o,s,l)!==e(i,r,a,o,u,c)}},22948:function(t){t.exports=function(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},51581:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(e,["children","element","hasMore","initialLoad","isReverse","loader","loadMore","pageStart","ref","threshold","useCapture","useWindow","getScrollParent"]));u.ref=function(e){t.scrollComponent=e,l&&l(e)};var c=[n];return r&&(s?o?c.unshift(s):c.push(s):this.defaultLoader&&(o?c.unshift(this.defaultLoader):c.push(this.defaultLoader))),a.default.createElement(i,u,c)}}]),e}(r.Component);l.propTypes={children:o.default.node.isRequired,element:o.default.node,hasMore:o.default.bool,initialLoad:o.default.bool,isReverse:o.default.bool,loader:o.default.node,loadMore:o.default.func.isRequired,pageStart:o.default.number,ref:o.default.func,getScrollParent:o.default.func,threshold:o.default.number,useCapture:o.default.bool,useWindow:o.default.bool},l.defaultProps={element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null},e.default=l,t.exports=e.default},26724:function(t,e,n){t.exports=n(51581)},75029:function(t,e,n){"use strict";var i=n(22948),r=Array.prototype.concat,a=Array.prototype.slice,o=t.exports=function(t){for(var e=[],n=0,o=t.length;n1&&void 0!==arguments[1]?arguments[1]:60,n=null;return function(){for(var i=this,r=arguments.length,a=new Array(r),o=0;o0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var i,r,a=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(t){r={error:t}}finally{try{i&&!i.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return o}function h(){for(var t=0,e=0,n=arguments.length;e