suyiScreen/public/htWeb/lib/core/ht.js

1 line
843 KiB
JavaScript

!function(C,L,H){"use strict";function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=L.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Eh(t,e)}function c(t){t=L.prototype.toString.call(t);return"Array]"===t.substring(t.length-6)}function v(t,e,i,n,r,o){e=e||[],i=i||[],n=n||[];try{e.push(t);var a=Function.apply(0,e);return i[i.length]="return "+a,Function.apply(0,i).apply(0,n)}catch(t){return o&&o(t),r}}function h(i){var n={};return{get:function(t){if(n[t]!==H)return n[t];var e;switch(t){case"WEBGL_depth_texture":e=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":e=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;case"WEBGL_compressed_texture_etc1":e=i.getExtension("WEBGL_compressed_texture_etc1");break;default:e=i.getExtension(t)}return n[t]=e}}}function l(e,i,t){function n(t){if("highp"===t){if(0<e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision&&0<e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision)return"highp";t="mediump"}return"mediump"===t&&0<e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision&&0<e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision?"mediump":"lowp"}var r;t=t||{};var o="undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext,a=t.precision!==H?t.precision:"highp",s=n(a);s!==a&&(console.warn("WebGL:",a,"not supported, using",s,"instead."),a=s);var h=!0===t.logarithmicDepthBuffer,c=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),l=e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),u=e.getParameter(e.MAX_TEXTURE_SIZE),d=e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),f=e.getParameter(e.MAX_VERTEX_ATTRIBS),g=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),p=e.getParameter(e.MAX_VARYING_VECTORS),_=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),s=0<l,t=o||!!i.get("OES_texture_float");return{getMaxAnisotropy:function(){if(r!==H)return r;var t=i.get("EXT_texture_filter_anisotropic");return r=null!==t?e.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},getMaxPrecision:n,precision:a,logarithmicDepthBuffer:h,maxTextures:c,maxVertexTextures:l,maxTextureSize:u,maxCubemapSize:d,maxAttributes:f,maxVertexUniforms:g,maxVaryings:p,maxFragmentUniforms:_,vertexTextures:s,floatFragmentTextures:t,elementTypeUint:(o||!!i.get("OES_element_index_uint"))&&"undefined"!=typeof Uint32Array,floatVertexTextures:s&&t,maxSamples:o?e.getParameter(e.MAX_SAMPLES):0}}function t(t,e){return t.z!==e.z?t.z-e.z:t.id-e.id}function u(t,e){return t.z!==e.z?e.z-t.z:t.id-e.id}var d,U,G,F,a,f,y,m,r,e,z,V,i,o,s,g,p,S,k,j,W,N,q,X,Q,Y,Z,K,b,P,J,I,x,T,$,tt,n,w,E,M,R,A,D,O,B,et,it,nt,rt,ot,at,st,ht,ct,lt,ut,dt,ft,gt,pt,_t,vt,yt,mt,bt,xt,wt,Et,Tt,St,It,Ct,Mt,Rt,At,Pt,Dt,Ot,Bt,zt,Vt,Lt,Ft,kt,jt,Nt,Ut,Gt,Ht,Wt,qt,Xt,Qt,Yt,Zt,Kt,Jt,$t,te,ee,ie,ne,re,oe,ae,se,he,ce,le,ue,de,fe,ge,pe,_e,ve,ye,me,be,xe,we,Ee,Te,Se,Ie,Ce,Me,Re,Ae,Pe,De,Oe,Be,ze,Ve,Le,Fe,ke,je,Ne,Ue,Ge,He,We,qe,Xe,Qe,Ye,Ze,Ke,Je,$e,ti,ei,ii,ni,ri,oi,ai,si,hi,ci,li,ui,di,fi,gi,pi,_i,vi,yi,mi,bi,xi,wi,Ei,Ti,Si,Ii,Ci,Mi,Ri,Ai,Pi,Di,Oi,Bi,zi,Vi,Li,Fi,ki,ji,Ni,Ui,Gi,Hi,Wi,qi,Xi,Qi,Yi,Zi,Ki,Ji,$i,tn,en,nn,rn,on,an,sn,hn,cn,ln,un,dn,fn,gn,pn,_n,vn,yn,mn,bn,xn,wn,En,Tn,Sn,In,Cn,Mn,Rn,An,Pn,Dn,On,Bn,zn,Vn,Ln,Fn,kn,jn,Nn,Un,Gn,Hn,Wn,qn,Xn,Qn,Yn,Zn,Kn,Jn,$n,tr,er,ir,nr,rr,or,ar,sr,hr,cr,lr,ur,dr,fr,gr,pr,_r,vr,yr,mr,br,xr,wr,Er,Tr,Sr,Ir,Cr,Mr,Rr,Ar,Pr,Dr,Or,Br,zr,Vr,Lr,Fr,kr,jr,Nr,Ur,Gr,Hr,Wr,qr,Xr,Qr,Yr,Zr,Kr,Jr,$r,to,eo,io,no,ro,oo,ao,so,ho,co,lo,uo,fo,go,po,_o,vo,yo,mo,bo,xo,wo,Eo,To,So,Io,Co,Mo,Ro,Ao,Po,Do,Oo,Bo,zo,Vo,Lo,Fo,ko,jo,No,Uo,Go,Ho,Wo,qo,Xo,Qo,Yo,Zo,Ko,Jo,$o,ta,ea,ia,na,ra,oa,aa,sa,ha,ca,la,ua,da,fa,ga,pa,_a,va,ya,ma,ba,xa,wa,Ea,Ta,Sa,Ia,Ca,Ma,Ra,Aa,Pa,Da,Oa,Ba,za,Va,La,Fa,ka,ja,Na,Ua,Ga,Ha,Wa,qa,Xa,Qa,Ya,Za,Ka,Ja,$a,ts,es,is,ns,rs,os,as,ss,hs,cs,ls,us,ds,fs,gs,ps,_s,vs,ys,ms,bs,xs,ws,Es,Ts,Ss,Is,Cs,Ms,Rs,As,Ps,Ds,Os,Bs,zs,Vs,Ls,Fs,ks,js,Ns,Us,Gs,Hs,Ws,qs,Xs,Qs,Ys,Zs,Ks,Js,$s,th,eh,ih,nh,rh,oh,ah,sh,hh,ch,lh,uh,dh,fh,gh,ph,_h,vh,yh,mh,bh,xh,wh,Eh,Th,Sh,Ih,Ch,Mh,Rh,Ah,Ph,Dh,Oh,Bh,zh,Vh,Lh,Fh,kh,jh,Nh,Uh,Gh,Hh,Wh,qh,Xh,Qh,Yh,Zh,Kh,Jh,$h,tc,ec,ic,nc,rc,oc,ac,sc,hc,cc,lc,uc,dc,fc,gc,pc,_c,vc,yc,mc,bc,xc,wc,Ec,Tc,Sc,Ic,Cc,Mc,Rc,Ac,Pc,Dc,Oc,Bc,zc,Vc,Lc,Fc,kc,jc,Nc,Uc,Gc,Hc,Wc,qc,Xc,Qc,Yc,Zc,Kc,Jc,$c,tl,el,il,nl,rl,ol,al,sl,hl,cl,ll,ul,dl,fl,gl,pl,_l,vl,yl,ml,bl,xl,wl,El,Tl,Sl,Il,Cl,Ml,Rl,Al,Pl,Dl,Ol,Bl,zl,Vl,Ll,Fl,kl,jl,Nl,Ul,Gl,Hl,Wl,ql,Xl,Ql,Yl,Zl,Kl,Jl,$l,tu,eu,iu,nu,ru,ou,au,su,hu,cu,lu,uu,du,fu,gu,pu,_u,vu,yu,mu,bu,xu,wu,Eu,Tu,Su,Iu,Cu,Mu,Ru,Au,Pu,Du,Ou,Bu,zu,Vu,Lu,Fu,ku,ju,Nu,Uu,Gu,Hu,Wu,qu,Xu,Qu,Yu,Zu,Ku,Ju,$u,td,ed,id,nd,rd,od,ad,sd,hd,cd,ld,ud,dd,fd,gd,pd,_d,vd,yd,md,bd,xd,wd,Ed,Td,Sd,Id,Cd,Md,Rd,Ad,Pd,Dd,Od,Bd,zd,Vd,Ld,Fd,kd,jd,Nd,Ud,Gd,Hd,Wd,qd,Xd,Qd,Yd,Zd,Kd,Jd,$d,tf,ef,nf,rf,of,af,sf,hf,cf,lf,uf,df,ff,gf,pf,_f,vf,yf,mf,bf,xf,wf,Ef,Tf,Sf,If,Cf,Mf,Rf,Af,Pf,Df,Of,Bf,zf,Vf,Lf,Ff,kf,jf,Nf,Uf,Gf,Hf,Wf,qf,Xf,Qf,Yf,Zf,Kf,Jf,$f,tg,eg,ig,ng,rg,og,ag,sg,hg,cg,lg,ug,dg,fg,gg,pg,_g,vg,yg,mg,bg,xg,wg,Eg,Tg,Sg,Ig,Cg,Mg,Rg,Ag,Pg,Dg,Og,Bg,zg,Vg,Lg,Fg,kg,jg,Ng,Ug,Gg,Hg,Wg,qg,Xg,Qg,Yg,Zg,Kg,Jg,$g,tp,ep,ip,np,rp,op,ap,sp,hp,cp,lp,up,dp,fp,gp,pp,_p,vp,yp,mp,bp,xp,wp,Ep,Tp,Sp,Ip,Cp,Mp,Rp,Ap,Pp,Dp,Op,Bp,zp,Vp,Lp,Fp,kp,jp,Np,Up,Gp,Hp,Wp,qp,Xp,Qp,Yp,Zp,Kp,Jp,$p,t_,e_,i_,n_,r_,o_,a_,s_,h_,c_,l_,u_,d_,f_,g_,p_,__,v_,y_,m_,b_,x_,w_,E_,T_,S_,I_,C_,M_,R_,A_,P_,D_,O_,B_,z_,V_,L_,F_,k_,j_,N_,U_,G_,H_,W_,q_,X_,Q_,Y_,Z_,K_,J_,$_,tv,ev,iv,nv,rv,ov,av,sv,hv,cv,lv,uv,dv,fv,gv,pv,_v,vv,yv,mv,bv,xv,wv,Ev,Tv,Sv,Iv,Cv,Mv,Rv,Av,Pv,Dv,Ov,Bv,zv,Vv,Lv,Fv,kv,jv,Nv,Uv,Gv,Hv,Wv,qv,Xv,Qv,Yv,Zv,Kv,Jv,$v,ty,ey,iy,ny,ry,oy,ay,sy,hy,cy,ly,uy,dy,fy,gy,py,_y,vy,yy,my,by,xy,wy,Ey,Ty,Sy,Iy,Cy,My,Ry,Ay,Py,Dy,Oy,By,zy,Vy,Ly,Fy,ky,jy,Ny,Uy,Gy,Hy,Wy,qy,Xy,Qy,Yy,Zy,Ky,Jy,$y,tm,em,im,nm,rm,om,am,sm,hm,cm,lm,um,dm,fm,gm,pm,_m,vm,ym,mm,bm="ht";function xm(t,e,i){t[i]=e[0],t[i+1]=e[1],t[i+2]=e[2]}function wm(){var t=new ha;return t.subVectors(D_,P_),V_.subVectors(A_,P_),t.cross(V_).normalize(),t}function Em(t,e,i){i instanceof Gl.Node&&(W_.fromArray($s(i,e.getMat(i))),i=i.getAnchor3d(),t.push((new ha).set(0-i.x,0-i.y,0-i.z).applyMatrix4(W_)),t.push((new ha).set(0-i.x,0-i.y,1-i.z).applyMatrix4(W_)),t.push((new ha).set(0-i.x,1-i.y,0-i.z).applyMatrix4(W_)),t.push((new ha).set(0-i.x,1-i.y,1-i.z).applyMatrix4(W_)),t.push((new ha).set(1-i.x,0-i.y,0-i.z).applyMatrix4(W_)),t.push((new ha).set(1-i.x,0-i.y,1-i.z).applyMatrix4(W_)),t.push((new ha).set(1-i.x,1-i.y,0-i.z).applyMatrix4(W_)),t.push((new ha).set(1-i.x,1-i.y,1-i.z).applyMatrix4(W_)))}function Tm(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];t.push(i.x,i.y,i.z)}}function Sm(t,e,i,n,r){var o=-n*Q(r),r=n*Z(r);return new Oc(t.x+o*i.x+r*e.x,t.y+o*i.y+r*e.y,t.z+o*i.z+r*e.z)}function Im(t,e,i,n,r,o,a,s,h){h=h||J;var c,l,u=e?t.top_vs:t.bottom_vs;if(u)for(var d=e?t.top_uv:t.bottom_uv,f=h/a,g=0;g<a;g++)e?(c=g*f+s,l=(g+1)*f+s):(l=g*f+s,c=(g+1)*f+s),Tm(u,Sm(i,n,r,o,c),Sm(i,n,r,o,l),i),d&&d.push(.5-.5*Q(c),.5-.5*Z(c),.5-.5*Q(l),.5-.5*Z(l),.5,.5)}function Cm(n,t){t==H&&(t={}),t.version=gv&&(n instanceof WebGL2RenderingContext||"[object WebGL2RenderingContext]"===L.prototype.toString.call(n))?2:1,t.extensions=function(){for(var t={},e=n.getSupportedExtensions(),i=e.length;i--;)t[name]=function(t,e){var i=H;return function(){return i=i||t.getExtension(e)}}(n,e[i]);return t}();for(var e=L.keys(pv),i=0,r=e.length;i<r;++i)t[o=e[i]]=n.getParameter(pv[o]);if(1<t.version)for(var o,i=0,r=(e=L.keys(_v)).length;i<r;++i)t[o=e[i]]=n.getParameter(_v[o]);return t}function Mm(t,e){var i=t.x-e.x,e=t.y-e.y;return i*i+e*e}function Rm(t,n){var r=(new fa).makeRotationFromEuler(this.getEuler()).setPosition((new ha).fromArray(this.p3()));r.getInverse(r),t.forEach(function(t){var e,i;wn(t)&&(e=n,i=t,t=r,Av.fromArray($s(i)),i=i.getAnchor3d(),e.push((new ha).set(0-i.x,0-i.y,0-i.z).applyMatrix4(Av).applyMatrix4(t)),e.push((new ha).set(0-i.x,0-i.y,1-i.z).applyMatrix4(Av).applyMatrix4(t)),e.push((new ha).set(0-i.x,1-i.y,0-i.z).applyMatrix4(Av).applyMatrix4(t)),e.push((new ha).set(0-i.x,1-i.y,1-i.z).applyMatrix4(Av).applyMatrix4(t)),e.push((new ha).set(1-i.x,0-i.y,0-i.z).applyMatrix4(Av).applyMatrix4(t)),e.push((new ha).set(1-i.x,0-i.y,1-i.z).applyMatrix4(Av).applyMatrix4(t)),e.push((new ha).set(1-i.x,1-i.y,0-i.z).applyMatrix4(Av).applyMatrix4(t)),e.push((new ha).set(1-i.x,1-i.y,1-i.z).applyMatrix4(Av).applyMatrix4(t)))})}function Am(t){var e=[];return t.forEach(function(t){e.push({x:t.x,y:t.y}),e.push({x:t.x+t.width,y:t.y+t.height}),e.push({x:t.x+t.width,y:t.y}),e.push({x:t.x,y:t.y+t.height})}),e}function Pm(t,e,i,n){var r=t?t.path.slice(0):[];e&&r.push(e),this.desc=i,this.name=e,this.path=Mh(r),this.getter=Sh(r),this.setter=Ih(r),this.isLeaf=n,this.parent=t,this.children=[],this.childMap={}}function Dm(t,e){return e}function Om(t){return t}function Bm(i,n){i.getValue&&i.getValue.compType===n||(i.getValue=function(t){var e=$v(i,t);return e!==H||!n.properties||(t=n.properties[t])&&(e=t.defaultValue),e},i.getColor=function(t,e){return ty(!0===e?t:i.getValue(t))},i.getValue.compType=n)}function zm(t){if(bn(t)){for(var e=new Lh,i=t.length,n=0;n<i;n+=2)e.add({x:t[n],y:t[n+1]});t=e}return t}function Vm(t){var e=$v(t,"anchorX"),i=$v(t,"anchorY");return e!==H||i!==H?{x:e===H?yh.x:e,y:i===H?yh.y:i}:(i=$v(t,"type"),t=$v(t,"name"),"image"===i&&t&&(t=Qa(t))&&t.anchorX!==H&&t.anchorY!==H?{x:t.anchorX,y:t.anchorY}:yh)}function Lm(t){return bn(t)?new Lh(t):t}function Fm(t,e,i,n,r,o,a){var s=Xv.interactiveInfo;if(u=t.transform)return Xv.save(),Xv.setTransform(u.a,u.b,u.c,u.d,u.tx,u.ty),s&&s.compInfos.push({comp:t,rect:e,matrix:u.clone(),prefix:dh,refRect:s.refRect}),!0;r===H&&(r=1),o===H&&(o=1);var h=$v(t,"clipPercentage");if(Ln(i,e)&&!n&&1===r&&1===o&&!(h<1))return s&&s.compInfos.push({comp:t,rect:e,matrix:s.matrix.clone(),prefix:dh,refRect:s.refRect}),!1;a=a||yh;var c=e.x+e.width*a.x,l=e.y+e.height*a.y,u=i.x+i.width*a.x,a=i.y+i.height*a.y,r=i.width?r*(e.width/i.width):1,o=i.height?o*(e.height/i.height):1;return Xv.save(),s&&(s.matrix.appendTranslate(c,l).appendRotate(n).appendScale(r,o).appendTranslate(-u,-a),s.compInfos.push({comp:t,rect:e,matrix:s.matrix.clone(),prefix:dh,refRect:s.refRect})),pr(Xv,c,l),_r(Xv,n||0),vr(Xv,r,o),pr(Xv,-u,-a),h<1&&(h<0&&(h=0),h=Wn(i,$v(t,"clipDirection"),h),Xv.beginPath(),Xv.rect(h.x,h.y,h.width,h.height),Xv.clip()),!0}function km(){Xv.restore()}function jm(t,e,i,n){var r,o,a,s,h,c,l,u=$v(t,Vt,zm),d=$v(t,$t),f=Vm(t);u&&n.fitSize&&(r=new Lh,M=ms(u),C=ey(t,M,n),o=M.x+f.x*M.width,a=M.y+f.y*M.height,s=C.x+f.x*C.width,h=C.y+f.y*C.height,c=M.width?C.width/M.width:1,l=M.height?C.height/M.height:1,u.each(function(t){r.add({x:s+(t.x-o)*c,y:h+(t.y-a)*l})}),u=r,t.unionRect=null);var g,p,_,v,y,m,b,x,w,E,T,S,I,C,M,R,A,P,D,O,B=$v(t,"scaleX"),z=$v(t,"scaleY"),V=e===Tt,L=U;!i&&V&&((i=t.unionRect)||(i=ms(u),t.points.func||(t.unionRect=i)),L=i),i&&(V?L||((L=t.unionRect)||(L=ms(u),t.points.func||(t.unionRect=L))):L=i,y=Fm(t,i,L,d,B,z,f),m=$v(t,"borderPattern"),D=rh(Xv,m),b=ty(t,"background"),x=Qa($v(t,"repeatImage"),Kv,Jv),w=$v(t,"gradientPack"),E=ty(t,"borderColor"),O=$v(t,"borderWidth"),T=Qa($v(t,"borderRepeatImage"),Kv,Jv),S=$v(t,"segments",Lm),I=$v(t,"gradient"),n=ty(t,"gradientColor"),C=$v(t,"border3d"),M=ty(t,"border3dColor"),i=$v(t,"border3dAccuracy"),d=$v(t,"closePath"),B=$v(t,"fillRule")||"nonzero",z=Xv.lineJoin,f=Xv.lineCap,Xv.lineJoin=$v(t,"borderJoin")||Ca,Xv.lineCap=$v(t,"borderCap")||Ia,V?b||x||w?((A=$v(t,"fillClipPercentage"))<1&&(A<0&&(A=0),R=Wn(L,$v(t,"fillClipDirection"),A),Xv.save(),Xv.beginPath(),Xv.rect(R.x,R.y,R.width,R.height),Xv.clip()),ao(Xv,u,S,d),w?ro(Xv,w,ty):x?go(Xv,x,Kv,Jv,Qv,Yv):fo(Xv,b,I,n,L),Xv.fill(B),w&&Xv.restore(),A<1&&Xv.restore(),D!==Xv&&ao(D,u,S,d)):ao(D,u,S,d):("roundRect"===e?g=$v(t,"cornerRadius"):"polygon"===e?g=$v(t,"polygonSide"):"arc"===e&&(g=$v(t,"arcFrom"),p=$v(t,"arcTo"),_=$v(t,"arcClose"),v=$v(t,"arcOval")),b||x||w?((A=$v(t,"fillClipPercentage"))<1&&(A<0&&(A=0),R=Wn(L,$v(t,"fillClipDirection"),A),Xv.save(),Xv.beginPath(),Xv.rect(R.x,R.y,R.width,R.height),Xv.clip()),uo(Xv,e,L,g,p,_,v),w?ro(Xv,w,ty):x?go(Xv,x,Kv,Jv,Qv,Yv):fo(Xv,b,I,n,L),Xv.fill(B),w&&Xv.restore(),A<1&&Xv.restore(),Xv!==D&&uo(D,e,L,g,p,_,v)):uo(D,e,L,g,p,_,v)),(A=$v(t,"borderWidthAbsolute"))&&(Xv.save(),Xv.setTransform(1,0,0,1,0,0)),O&&(E||T)&&(Xv.lineWidth=O,T?po(Xv,T,Kv,Jv,Qv,Yv):Xv.strokeStyle=E,Xv.stroke(),C&&ho(Xv,E,M,O,Zv,i)),oh(Xv,m),$v(t,"dash")&&0<(P=$v(t,"dashWidth")||O)&&(m=$v(t,"dashPattern")||Sa,D=rh(Xv,m,$v(t,"dashOffset")),O=ty(t,"dashColor")||ty(No),D!==Xv&&(V?ao(D,u,S,d):uo(D,e,L,g,p,_,v)),Xv.strokeStyle=O,Xv.lineWidth=P,Xv.stroke(),$v(t,"dash3d")&&ho(Xv,O,ty(t,"dash3dColor"),P,Zv,$v(t,"dash3dAccuracy")),oh(Xv,m)),A&&Xv.restore(),e===xt&&xo(Xv,b,$v(t,"depth"),L),Xv.lineJoin=z,Xv.lineCap=f,y&&km())}function Nm(t){Xv=t[0],Qv=t[1],Yv=t[2],Zv=t[3],Kv=t[4],Jv=t[5]}function Um(){return ry=oy.charAt(ny),ny+=1,ry}function Gm(){var t="";if(ry===hy)for(;Um();){if(ry===hy)return Um(),t;t+=ry}else Um()}function Hm(){for(;ry&&ry<=" ";)Um()}function Wm(t,e,i){t.x=e.x,t.y=e.e||i,t.z=e.y}function qm(t){t.duration&&(t.startTime=sn()),t.timeId=$a(t.tick,U,U,t.interval)}function Xm(t){t.details=0,t.timeout=null,t.lastPoint=null}function Qm(t,e){return e===t.substring(0,e.length)}function Ym(t){return parseFloat(t)||0}function Zm(t,e){e==H&&(e=new ha);t=(t=t.split(/\s+/)).map(Ym);return e.set(t[0]||0,t[1]||0,t[2]||0),e}function Km(t){qa(t),t.stopPropagation()}function Jm(t){qa(t)}C.ht||(function(){var t;Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),C.performance&&C.performance.now||(t=Date.now(),C.performance||(C.performance={}),C.performance.now=function(){return Date.now()-t});for(var n=Date.now(),e=["ms","moz","webkit","o"],i=0;i<e.length&&!C.requestAnimationFrame;++i)C.requestAnimationFrame=C[e[i]+"RequestAnimationFrame"],C.cancelAnimationFrame=C[e[i]+"CancelAnimationFrame"]||C[e[i]+"CancelRequestAnimationFrame"];C.requestAnimationFrame||(C.requestAnimationFrame=function(t){var e=Date.now(),i=16+n-e;return i<0&&(i=0),n=e,C.setTimeout(function(){n=Date.now(),t(performance.now())},i)}),C.cancelAnimationFrame||(C.cancelAnimationFrame=function(t){return C.clearTimeout(t)}),L.assign===H&&(L.assign=function(t){if(t===H||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=L(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==H&&null!==n)for(var r in n)L.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e})}(),d=C.document,U=null,Gl=C.ht={},Xa=C.htconfig,G=Gl.Default=Xa&&Xa.Default||{},F=Gl.Style=Xa&&Xa.Style||{},a=Gl.Attr=Xa&&Xa.Attr||{},f=function(){return!0},y=function(t){return t},m=function(t){return!t},r=Gl.Color=Xa&&Xa.Color||{},e=Gl.IsGetter=Xa&&Xa.IsGetter||{},function(){var e=!1;try{var t=L.defineProperty({},"passive",{get:function(){return e=!0,H}});C.addEventListener("test",t,t),C.removeEventListener("test",t,t)}catch(t){e=!1}G.passiveSupported=e}(),Vs=G.passiveSupported,o=G.eventListenerOptionsFalse=!!Vs&&{passive:!1,capture:!1},s=G.eventListenerOptionsTrue=!Vs||{passive:!1,capture:!0},g=function(t,e,i,n){t.addEventListener(e,i,n?s:o)},p=function(t,e,i,n){t.removeEventListener(e,i,n?s:o)},xa=Math,S=xa.round,k=xa.floor,j=xa.ceil,W=xa.sqrt,N=xa.max,q=xa.min,X=xa.abs,Q=xa.cos,Y=xa.acos,Z=xa.sin,K=xa.pow,b=xa.asin,mr=xa.exp,P=xa.PI,J=2*P,I=P/2,x=xa.tan,T=xa.atan2,$=xa.random,$f=xa.log,tt=C.parseInt||global.parseInt,Va=!!C.navigator&&-1<C.navigator.platform.indexOf("Win"),n=function(t){return t*t},w=C.setTimeout,E=C.clearTimeout,C.location,M=C.navigator?C.navigator.userAgent.toLowerCase():"",R=(za=function(t){return t.test(M)})(/msie/),A=za(/msie/)||za(/trident/),D=za(/msie 10/),O=za(/edge/),Ag=za(/firefox/),B=za(/mac/),et=G.isTouchable===H?!Va&&(!!d&&"ontouchend"in d):G.isTouchable,it="default",nt="single",rt="multiple",ot="front",at="back",st="left",ht="right",ct="top",lt="bottom",ut="center",dt="eye",ft="east",gt="west",pt="north",_t="none",vt="px",yt="absolute",mt="border",bt="triangle",xt="rect",wt="circle",Et="cylinder",Tt="shape",St="items",It="normal",Ct="remove",Mt="clear",Rt="width",At="height",Pt="ingroup",Dt="check",Ot="uncheck",Bt="radioOn",zt="radioOff",Vt="points",Lt="values",Ft="series",kt="body",jt="label",Nt="label2",Ut="note",Gt="note2",Ht="icons",Wt="labelFont",qt="labelColor",Xt="labelSelectColor",Qt="note.expanded",Yt="note2.expanded",Zt="edge.expanded",Kt="edge.points",Jt="edge.type",$t="rotation",te="hidden",ee="visible",ie="tuv",ne="no",re="draw",oe="select",ae="currentSubGraph",se="selectBackground",he="autoMakeVisible",ce="autoHideScrollBar",le="scrollBarColor",ue="scrollBarSize",de="indent",fe="rowHeight",ge="columnLineColor",pe="rowLineColor",_e="columnLineVisible",ve="rowLineVisible",ye="visibleFunc",me="expandIcon",be="collapseIcon",xe="checkMode",we="sortFunc",Ee="editable",Te="batchEditable",Se="tristate",Ie="asc",Ce="desc",Me="position",Re="elevation",Ae="children",Pe="translateX",De="translateY",Oe="dataModel",Be="state",ze="encode",Ve="shape3d",Le="shape3d.resolution",Fe="shape3d.visible",ke="shape3d.from.visible",je="shape3d.to.visible",Ne="shape3d.top.visible",Ue="shape3d.bottom.visible",Ge="repeat.uv.length",He="serializeValue",We="deserializeValue",qe="centerUniform",Xe="uniform",Qe="rgba(255,255,255,0)",Ye="field",Ze="string",Ke="boolean",Je="color",$e="int",ti="number",ei="ew-resize",ii="ns-resize",ni="pointer",ri="auto",oi="mousedown",ai="mousemove",si="mouseup",ba="mouseout",hi="touchstart",ci="touchmove",li="touchend",ui="keydown",di=["DOMMouseScroll","mousewheel"],fi=Ag?di[0]:di[1],gi="__ht__"+ze,pi=[hi,ci,li],_i=[oi,ai,si,ba,fi,"wheel","mouseenter","mouseleave","mouseover"],vi=[ui,"keyup","keypress","input","contextmenu","compositionstart","compositionupdate","compositionend"],yi=(et?pi:_i).concat(vi),xi=bi=mi=U,wi=si.length,Ei=function(){xi&&(E(xi.timeout),xi=U)},Ti=function(){xi&&Ea(xi.e,xi.info)},C.addEventListener&&(et||(g(C,ba,function(){Ei()}),g(C,fi,function(){Ta()})),g(C,"keyup",function(t){91===t.keyCode?Li={}:delete Li[t.keyCode]},!0),g(C,ui,function(t){Li[t.keyCode]=!0},!0),g(C,"blur",function(){Li={}})),Ai=function(t,e){var i=w(function(){delete Ri[i],zn(Ri)&&(Ri=U),t()},e);return i},Di={},Oi={},Bi={},zi={},Vi={},Li={},Fi={},ki={},ji={},Ni={},Ui=/.json$/,Gi=/\.(json|bin)$/,Hi=/^data:image\/svg\+xml/,Wi={},qi=[],Xi={},Yi=function(){},Zi=function(){throw"Oops!"},Ki=[Mi=0,0,0],Ji={x:0,y:0,width:0,height:0},en=tn=$i=Qi=Pi=du=Ri=U,nn=function(t,e){(Oi[t]=e)&&e.comps&&!e.uuid&&(e.uuid=Gl.Math.generateUUID()),yc[t]&&(e.cacheRule=yc[t],delete yc[t])},rn=function(t){tn&&!t._72O&&((en=en||{})[t._72O=Ja()]=t),Si!=U?jn()<.05&&i&&!Ii&&(gr=Ei):gr=vn},on=function(i,e,n,r){var o,a,t=(tn=tn||{})[i];if(t){if(t.url===e)return;t.image?(t.image.onload=Yi,t.image.onerror=Yi):t.request&&(t.request.onload=Yi,t.request.onerror=Yi)}Ui.test(e)?(o=new Sl,tn[i]={request:o,url:e},(e=G.beforeLoadURL(e,i)).data?(a=G.parse(e.data),an(i,a),G.handleImageLoaded(i,a)):(o.onload=function(){var t;200===this.status||0===this.status?(t=G.parse(o.getResponseText()),an(i,t),G.handleImageLoaded(i,t)):an(i,G.handleUnfoundImage(i,e)||U)},o.onerror=function(){an(i,G.handleUnfoundImage(i,e)||U)},(t={}).url=encodeURI(e),t.sync=!1,o.send(t))):(a=new Image,tn[i]={image:a,url:e},/^data:image/.test(e)||(e=G.beforeLoadURL(e,i),e=G.appendTimeStamp(e),e=encodeURI(e),a.crossOrigin=G.crossOrigin),G.convertImageSrc(e,function(t){A&&(0<e.toLowerCase().indexOf(".svg")||Hi.test(e))?(d.body.appendChild(a),a.style.visibility="hidden",a.onload=function(){w(function(){var t,e;n&&(a.width=n),r&&(a.height=r),a.width&&a.height||(t=a.width||a.clientWidth,e=a.height||a.clientHeight,a.width=t,a.height=e),G.handleImageLoaded(i,a),an(i,a),d.body.removeChild(a),a.style.visibility=""},180)},a.onerror=function(){an(i,G.handleUnfoundImage(i,e)||U),d.body.removeChild(a),a.style.visibility=""}):(a.onload=function(){n&&(a.width=n),r&&(a.height=r),G.handleImageLoaded(i,a),an(i,a)},a.onerror=function(){an(i,G.handleUnfoundImage(i,e)||U)}),a.src=t}))},an=function(t,e){if(nn(t,e),delete tn[t],zn(tn)&&(tn=U,en)){for(var i in en)(n=en[i])._2O&&n._2O[t]&&(n.deleteTexture(t),delete n._2O[t]),n.invalidateAll&&n.invalidateAll(H,"imageLoaded",t),n.redraw&&n.redraw(),n.iv(),delete n._72O;en=U}if(e&&en)for(var i in en){var n;(n=en[i]).invalidateAll&&n.invalidateAll(H,"imageLoading",t),n.redraw&&n.redraw(),n.iv()}},$f=xa&&Date,sn=function(){return(C.performance&&C.performance.now?C.performance:Date).now()},hn=function(t,e,i){return{width:t,height:e,comps:bn(i)?i:[i]}},Gv=function(t,e){return{type:wt,rect:[t,e,1.6,1.6],borderWidth:1,borderColor:Zo,gradient:wa,gradientColor:Ko,background:Zo}},cn=function(t,e){return hn(16,16,{type:bt,rect:[4,4,10,8],background:t,rotation:e?1.57:3.14})},ln=function(t,e){return hn(16,16,{type:bt,rect:[4,4,8,7],background:t,rotation:e?3.14:0})},un=function(t){t=t._orientation;return"horizontal"===t||"h"===t},dn=function(t,e,i,n){return i||(i=et?5:3,i/=n||1),{x:t-i,y:e-i,width:2*i,height:2*i}},fn=function(t){return(/ble$/.test(t)||/ed$/.test(t)||e[t]?"is":"get")+t.charAt(0).toUpperCase()+t.slice(1)},gn=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)},pn=function(t){return typeof t===Ze||t instanceof String},_n=function(t){return typeof t==ti},vn=function(t){return typeof t==Ke},yn=function(t){return t&&"object"==typeof t},mn=function(t){return"function"==typeof t},bn=function(t){return t instanceof Array},xn=function(t){return t instanceof Lh},wn=function(t){return t instanceof cl},En=function(t){return t instanceof gl},Tn=function(t){return t instanceof pl},Sn=function(t,e){if(!(t instanceof Gl.Group))return!1;if(!e)return t.isExpanded();t=e.getDataUI(t);return!(!t||!t._88I)},In=function(t){return t instanceof _l},Cn=function(t){return t&&"IFRAME"===t.tagName},Mn=function(t,e,i){var n,r=e.length;if(i)for(var o=0;o<i;o++)if(3===r)t.push(e[0]),t.push(e[1]),t.push(e[2]);else for(n=0;n<r;n++)t.push(e[n]);else if(3===r)t.push(e[0]),t.push(e[1]),t.push(e[2]);else for(n=0;n<r;n++)t.push(e[n])},Rn=function(t){return!!t&&(yn(t)?t:{})},An=function(t,e,i){var n,r=yn(t)?t:t.prototype;for(n in e)i&&n in r?r[n]===H&&console.warn("class",r,"has own undefined property",n,", keep exist!"):r[n]=e[n];return t},Pn=function(t,e){var i;"wheelDelta"in e||(i=e.deltaMode,e.wheelDelta=i===e.DOM_DELTA_PIXEL?-e.deltaY:i===e.DOM_DELTA_LINE?40*-e.deltaY:120*-e.deltaY),t.handle_mousewheel(e)},Dn=function(t){return String.fromCharCode(t)},On=function(t){for(var e,i=0,n="";i<t.length;i++)"%"===(e=t[t.length-1-i])?e="'":"a"===e?e='"':"]"===e&&(e="\\"),n+=Dn(e.charCodeAt(0)-1);return n},Bn=function(t,e,i){t.superClass.constructor.apply(e,i)},zn=function(t){for(var e in t)return!1;return!0},Vn=function(t){return!t||0===t.length},mm="",[Ot[0],pe[0],jt[0]].forEach(function(t){mm+=gn(t).slice(3)}),Xe=d&&d[mm]||qe,Ln=function(t,e){return t===e||t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height},Fn=function(t,e,i){return t<e?e:i<t?i:t},kn=function(t){return t<0?-1:0<t?1:0},jn=function(){var t=1e4*Z(wi++);return t-k(t)},Nn=function(t,e,i){return Un(t.x,t.y,e.x,e.y,i.x,i.y,i.x+i.width,i.y,!0)||Un(t.x,t.y,e.x,e.y,i.x+i.width,i.y,i.x+i.width,i.y+i.height,!0)||Un(t.x,t.y,e.x,e.y,i.x+i.width,i.y+i.height,i.x,i.y+i.height,!0)||Un(t.x,t.y,e.x,e.y,i.x,i.y+i.height,i.x,i.y,!0)},Un=function(t,e,i,n,r,o,a,s,h){var c=(s-o)*(i-t)-(a-r)*(n-e);if(0==c)return U;var l=((a-r)*(e-o)-(s-o)*(t-r))/c,c=t+l*(i-t),l=e+l*(n-e);return h&&(c+Fs<q(t,i)||c-Fs>N(t,i)||c+Fs<q(r,a)||c-Fs>N(r,a)||l+Fs<q(e,n)||l-Fs>N(e,n)||l+Fs<q(o,s)||l-Fs>N(o,s))?U:[c,l]},Gn=function(t,e,i){if(t&&i)if(e){if("style"===e)return t.getStyle(i);if("attr"===e)return t.getAttr(i);if(e===Ye)return t[i]}else if(t[i=fn(i)])return t[i]();return H},Hn=function(t,e,i,n){t&&i&&(e?"style"===e?t.s(i,n):"attr"===e?t.a(i,n):e===Ye&&(e=t[i],t[i]=n,t.fp("f:"+i,e,n)):t[i=gn(i)]&&t[i](n))},Wn=function(t,e,i){return e&&"top"!==e?"bottom"===e?{x:t.x,y:t.y,width:t.width,height:t.height*i}:"right"===e?{x:t.x,y:t.y,width:t.width*i,height:t.height}:"left"===e?{x:t.x+t.width*(1-i),y:t.y,width:t.width*i,height:t.height}:void 0:{x:t.x,y:t.y+t.height*(1-i),width:t.width,height:t.height*i}},qn=function(t,e,i,n,r){e&&lo(t,i,n,1,r,e)},Xn=function(t,e,i,n){var r=1-t;return r*r*e+2*t*r*i+t*t*n},Qn=function(t,e,i,n,r){var o=1-t;return o*o*o*e+3*o*o*t*i+3*o*t*t*n+t*t*t*r},Yn=function(t){var e,i,n,r,o=0;return t.forEach(function(t){if(0<(e=t.length))for(i=t[0],r=1;r<e;r++)n=t[r],o+=ys(i,n),i=n}),o},Zn=function(e,t,i){function n(t){"mousedown"!==e&&"mouseup"!==e&&"touchstart"!==e&&"touchend"!==e||fs(t),i.disabled||i["handle_"+e](t)}var r="__"+e;i[r]||(i[r]=n,g(t,e,n))},Kn=function(t){return L.create(t)},Jn=function(t){var e,i;t.element||((e=t.textField)?i=Wa(Sp.TextField,e):(e=t.textArea)?i=Wa(Sp.TextArea,e):(e=t.button)?i=Wa(Sp.Button,e):(e=t.comboBox)?i=Wa(Sp.ComboBox,e):(e=t.checkBox)?i=Wa(Sp.CheckBox,e):(e=t.radioButton)?i=Wa(Sp.RadioButton,e):(e=t.slider)?i=Wa(Sp.Slider,e):(e=t.colorPicker)?i=Wa(Sp.ColorPicker,e):(e=t.image)&&(i=Wa(Sp.Image,e)),i&&(t.element=i))},$n=function(t,e){t=tr(t);return t._ht=e,t},Ra=C.top===C?C.top:C||C.document,tr=function(t,e){var i=d.createElement("div"),n=i.style;return i.tabIndex=-1,i.onkeydown=qa,n.msTouchAction=_t,ir(i,U,0),et&&n.setProperty("-webkit-tap-highlight-color","rgba(0, 0, 0, 0)",U),t&&(n.overflow=te),e&&or(e,i),i},er=function(t,e){var i=d.createElement("canvas"),n=i.style;return n.msTouchAction=_t,e||(n.pointerEvents=_t),ir(i,U,0),t&&or(t,i),i},ir=function(t,e,i){var n=t.style;n.border=e?e+" solid 1px":0,n.outline=0,n.padding=i?"0 "+i+vt:0,nr(t)},nr=function(t){t=t.style;t.position=yt,t.margin=0,t.setProperty("box-sizing","border-box",U),t.setProperty("-moz-box-sizing","border-box",U)},rr=function(t,e,i,n){n=n||ma,e!=U&&(t.width=e*n,t.style.width=e+vt),i!=U&&(t.height=i*n,t.style.height=i+vt)},or=function(t,e,i){t.appendChild(e),i&&(e.style.position=yt)},ar=function(t,e){e.split||(e+="");for(var i,n=e.split("\n"),r=0,o=n.length,a=0;a<o;a++){var s=hs(t.font,n[a]);s.width>r&&(r=s.width),i=i||s.height}return t.ss=n,{width:r,height:i*o}},sr=function(t,e,i,n,r,o){var a=e.length;if(1===a)hr(t,e[0],i,n,r);else for(var s=i.height/a,h={x:i.x,y:i.y,width:i.width,height:s},c=0;c<e.length;c++)o?ss(t,e[c],n,r,h.x,h.y,h.width,h.height,o):hr(t,e[c],h,n,r),h.y+=s},hr=function(t,e,i,n,r){var o;t.font=n||Aa,t.fillStyle=r||Ma,t.textAlign=ut,t.textBaseline="middle",i=i?i.width===H?(o=i.x,i.y):(o=i.x+i.width/2,i.y+i.height/2):o=0,t.fillText(e,S(o),S(i))},cr=function(t){t.getView&&(t=t.getView());var e=t.offsetWidth||t.scrollWidth;return!e&&t.style.width&&(e=tt(t.style.width)),e},lr=function(t){t.getView&&(t=t.getView());var e=t.offsetHeight||t.scrollHeight;return!e&&t.style.height&&(e=tt(t.style.height)),e},ur=function(t,e,i){var n=e[0].toUpperCase()+e.substring(1,e.length);t["webkit"+n]=i,t["moz"+n]=i,t["ms"+n]=i,t["o"+n]=i,t[e]=i},dr=function(t,e){var i=tr(),n=i.style;return n.backgroundColor=G.disabledBackground,t&&(n.backgroundImage="url("+t+")",n.backgroundPosition="50% 50%",n.backgroundRepeat="no-repeat no-repeat"),!1===e?ym.forEach(function(t){g(i,t,Jm)}):ym.forEach(function(t){g(i,t,Km)}),i},fr=function(t){t=t.getContext("2d");return t.save(),t.lineCap=Ia,t.lineJoin=Ca,t},gr=function(t,e,i,n){pr(t,e*ma,i*ma),1!==(n*=ma)&&t.scale(n,n)},pr=function(t,e,i){t.translate(e,i)},_r=function(t,e){e&&t.rotate(e)},vr=function(t,e,i){e===H&&(e=1),i===H&&(i=1),1===e&&1===i||t.scale(e,i)},yr=!(ym=[hi,ui,oi]),mr=Ra[Dt[1]+Pe[0]],br=function(t){var e=d.activeElement;if(d.activeElement!==t){e&&e.forceOnblur&&e.forceOnblur();for(var i,n=[],r=t.parentNode;r;)n.push([r,r.scrollLeft,r.scrollTop]),r=r.parentNode;if(!yr){var o=[],a=[];try{for(var s=C.parent,h=C;s!==h;)o.push([s,s.scrollX,s.scrollY]),h=s,s=C.parent;var c=C.frameElement;if(c)for(var l=c.parentNode;l;)a.push([l,l.scrollLeft,l.scrollTop]),l=l.parentNode}catch(t){yr=!0}}et?t.focus():(e=(i=Ss()).target,t.focus(),e.scrollLeft=i.left,e.scrollTop=i.top),n.forEach(function(t){t[0].scrollLeft=t[1],t[0].scrollTop=t[2]}),yr||(o.forEach(function(t){t[0].scrollTo(t[1],t[2])}),a.forEach(function(t){t[0].scrollLeft=t[1],t[0].scrollTop=t[2]}))}},xr=function(t){return t&&t.getView?t.getView():t},wr=function(t,e,i,n,r){var o,a;2===arguments.length&&(i=e.y,n=e.width,r=e.height,e=e.x),t.isSelfViewEvent?(t.setX(e),t.setY(i),t.setWidth(n),t.setHeight(r)):(o=(a=xr(t)).style,(d.fullscreenElement||d.mozFullScreenElement||d.webkitFullscreenElement||d.msFullscreenElement)!==a?(e!==H&&(o.left=e+vt),i!==H&&(o.top=i+vt),n!==H&&(o.width=n+vt),r!==H&&(o.height=r+vt)):(a=G.getWindowInfo(),o.left=(e=a.left)+vt,o.top=(i=a.top)+vt,o.width=(n=a.width)+vt,o.height=(r=a.height)+vt),t.endEditing&&!et&&t.endEditing(),t.redraw&&t.redraw(),t.invalidate&&t.invalidate(),t.onLayouted&&t.onLayouted(e,i,n,r),t.fireViewEvent&&t.fireViewEvent("layout"))},Er=function(t){if(!t.touches)return t;var e=t.touches[0];return e||t.changedTouches[0]},Tr=function(t){return t&&"object"==typeof t&&"touches"in t},Sr=function(t){G.popup&&G.popup.close(),G.popup=t},Ir=U,Cr=function(t){Ir.handleWindowTouchMove(t)},Mr=function(t){Ir.handleWindowTouchEnd(t),p(C,ci,Cr),p(C,li,Mr),Ir=U},Rr=function(t){Ir.handleWindowMouseMove(t)},Ar=function(t){Ir.handleWindowMouseUp(t),p(C,ai,Rr),p(C,si,Ar),Ir=U},Pr=function(t){return 1===ds(t)},Dr=function(t,e){return e?e.keyCode===t:Li[t]},Or=function(t){return ps(t)&&Dr(65,t)},Br=function(t){return Dr(46,t)||Dr(8,t)},zr=573,Vr=(Da=function(e){return function(t){return t?t.keyCode===e:Li[e]}})((ru=[65,83,68,87,37,38,39,40,32,13,27])[0]),Lr=Da(ru[1]),Fr=Da(ru[2]),kr=Da(ru[3]),jr=Da(ru[4]),Nr=Da(ru[5]),Ur=Da(ru[6]),Gr=Da(ru[7]),Hr=Da(ru[8]),Wr=Da(ru[9]),qr=Da(ru[10]),Xr={65:1,83:1,68:1,87:1,37:1,38:1,39:1,40:1},Qr=[2,2,2,2,2,2,2,2,2,2,2,3,3,5,5,5,5,5,7,4027],Zr=Yr=U,Kr=function(t,e){Yr=Yr||er(),rr(Yr,t,e,1);var i=fr(Yr);return i.clearRect(0,0,t,e),i},Jr=function(t,e,i){if(e&&t){if("override"===i)return e;if("override_rgb"===i){var n=to(e);return t=$r(t),"rgba("+S(255*n[0])+","+S(255*n[1])+","+S(255*n[2])+","+t[3]/255+")"}if("override_a"===i){n=to(e);return"rgba("+(t=$r(t))[0]+","+t[1]+","+t[2]+","+n[3]+")"}if("multiply_destinationAtop"===i){var r=(i=is(to(t)))[3],o=is(to(e)),a=o[3],s=is(i),h=s[3],c=i.map(function(t,e){return t*o[e]}),l=1-r,u=1-a,d=u*r+a,i=i.map(function(t,e){return(a*l*o[e]+a*r*c[e]+u*r*t)/d}),l=1-(r=d);return i=i.map(function(t,e){return(h*s[e]*l+r*t*h)/h}),r=h,"rgba("+S(255*i[0])+","+S(255*i[1])+","+S(255*i[2])+","+r+")"}n=to(e);return t=$r(t),"rgba("+S(t[0]*n[0])+","+S(t[1]*n[1])+","+S(t[2]*n[2])+","+t[3]/255*n[3]+")"}return t},$r=function(){var n,t,r={};for(t in C){var e=rt.length;if(t.length==e&&t[0]===rt[2]&&t[1]===_t[1]&&t[4]===rt[3]&&t[5]===rt[4]&&t.substr(e-2)===_t[1]+_t[2]){var i,o=C[t];for(i in o)i.length===e&&i.substr(0,3)===ht[3]+Ct[3]+oe[0]&&i.substr(e-2)===rt[0]+Ut[3]&&(di=o[i])}}return function(t){var e,i=r[t];return i||(n||(n=er(),rr(n,1,1,1)),(e=n.getContext("2d")).clearRect(0,0,1,1),lo(e,0,0,1,1,t),i=e.getImageData(0,0,1,1).data,i=r[t]=[i[0],i[1],i[2],i[3]]),i}}(),to=function(t){if(!pn(t))return t;t=$r(t);return t.CA||(t.CA=[t[0]/255,t[1]/255,t[2]/255,t[3]/255]),t.CA},eo=function(t,e,i){return e&&(e="miter"===i?8*e+20:e+1,t&&Is(t,e)),e},io=function(t,e,i,n,r,o,a,s){n*=Math.PI/180;var h={x:Math.cos(n)*(t.x-a.x)/2+Math.sin(n)*(t.y-a.y)/2,y:-Math.sin(n)*(t.x-a.x)/2+Math.cos(n)*(t.y-a.y)/2},c=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(i,2);1<c&&(e*=Math.sqrt(c),i*=Math.sqrt(c));var l=(r==o?-1:1)*Math.sqrt((Math.pow(e,2)*Math.pow(i,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(i,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(i,2)*Math.pow(h.x,2)));isNaN(l)&&(l=0);function u(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))}var d=l*e*h.y/i,c=l*-i*h.x/e,r={x:(t.x+a.x)/2+Math.cos(n)*d-Math.sin(n)*c,y:(t.y+a.y)/2+Math.sin(n)*d+Math.cos(n)*c},f=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(u(t)*u(e))},l=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(f(t,e))},t=l([1,0],[(h.x-d)/e,(h.y-c)/i]),a=[(h.x-d)/e,(h.y-c)/i],c=[(-h.x-d)/e,(-h.y-c)/i],l=l(a,c);f(a,c)<=-1&&(l=Math.PI),1<=f(a,c)&&(l=0);f=i<e?e:i,a=i<e?1:e/i,c=i<e?i/e:1;if(null==s){i={x:0,y:0,width:0,height:0};Is(i,f),i.x*=a,i.width*=a,i.y*=c,i.height*=c;e=new oa(n);return(i=ms([e.tf(i.x,i.y),e.tf(i.x+i.width,i.y),e.tf(i.x+i.width,i.y+i.height),e.tf(i.x,i.y+i.height)])).x+=r.x,i.y+=r.y,[{x:i.x,y:i.y},{x:i.x+i.width,y:i.y},{x:i.x+i.width,y:i.y+i.height},{x:i.x,y:i.y+i.height}]}s.translate(r.x,r.y),s.rotate(n),s.scale(a,c),s.arc(0,0,f,t,t+l,1-o),s.scale(1/a,1/c),s.rotate(-n),s.translate(-r.x,-r.y)},no=function(t,e){t&&t.beginPath();for(var i,n,r=[],o=function(t){for(var e,i=/(\-{0,1}[\d\.]+)/gi,n=[];e=i.exec(t);)n.push(parseFloat(e[0]));return n},a=/([MmLlHhVvCcSsQqTtAa]{1}[\d\.,\s\-Zz]*)/gi,s={x:0,y:0};h=a.exec(e);){var h=h[0],c=h.substr(0,1);if("M"===c||"m"===c){for(var l=o(h),u=0;u<l.length;u+=2){var d=l[u],f=l[u+1];"m"===c&&(d+=s.x,f+=s.y),t&&t.moveTo(d,f),r.push({x:d,y:f}),s.x=d,s.y=f}i=n=null}else if("H"===c||"h"===c){for(l=o(h),u=0;u<l.length;u+=1){d=l[u];"h"===c&&(d+=s.x),t&&t.lineTo(d,s.y),r.push({x:d,y:s.y}),s.x=d}i=n=null}else if("C"===c||"c"===c){for(l=o(h),u=0;u<l.length;u+=6){var g=l[u],p=l[u+1],_=l[u+2],v=l[u+3],d=l[u+4],f=l[u+5];"c"===c&&(g+=s.x,p+=s.y,_+=s.x,v+=s.y,d+=s.x,f+=s.y),t&&t.bezierCurveTo(g,p,_,v,d,f),r.push({x:g,y:p}),r.push({x:_,y:v}),r.push({x:d,y:f}),s.x=d,s.y=f}i=[g,p,_,v,d,f],n=null}else if("S"===c||"s"===c){for(l=o(h),u=0;u<l.length;u+=4){p=i?(g=2*i[4]-i[2],2*i[5]-i[3]):(g=s.x,s.y);_=l[u],v=l[u+1],d=l[u+2],f=l[u+3];"s"===c&&(_+=s.x,v+=s.y,d+=s.x,f+=s.y),t&&t.bezierCurveTo(g,p,_,v,d,f),r.push({x:g,y:p}),r.push({x:_,y:v}),r.push({x:d,y:f}),s.x=d,s.y=f}i=[g,p,_,v,d,f],n=null}else if("Q"===c||"q"===c){for(l=o(h),u=0;u<l.length;u+=4){g=l[u],p=l[u+1],d=l[u+2],f=l[u+3];"q"===c&&(g+=s.x,p+=s.y,d+=s.x,f+=s.y),t&&t.quadraticCurveTo(g,p,d,f),r.push({x:g,y:p}),r.push({x:d,y:f}),s.x=d,s.y=f}i=null,n=[g,p,d,f]}else if("T"===c||"t"===c){for(l=o(h),u=0;u<l.length;u+=2){p=n?(g=2*n[2]-n[0],2*n[3]-n[1]):(g=s.x,s.y);d=l[u],f=l[u+1];"t"===c&&(d+=s.x,f+=s.y),t&&t.quadraticCurveTo(g,p,d,f),r.push({x:g,y:p}),r.push({x:d,y:f}),s.x=d,s.y=f}i=null,n=[g,p,d,f]}else if("V"===c||"v"===c){for(l=o(h),u=0;u<l.length;u+=1){f=l[u];"v"===c&&(f+=s.y),t&&t.lineTo(s.x,f),r.push({x:s.x,y:f}),s.y=f}i=n=null}else if("L"===c||"l"===c){for(l=o(h),u=0;u<l.length;u+=2){d=l[u],f=l[u+1];"l"===c&&(d+=s.x,f+=s.y),t&&t.lineTo(d,f),r.push({x:d,y:f}),s.x=d,s.y=f}i=n=null}else if("A"===c||"a"===c){for(l=o(h),u=0;u<l.length;u+=7){var y=l[u],m=l[u+1],b=l[u+2],x=l[u+3],w=l[u+4],d=l[u+5],f=l[u+6];"a"===c&&(d+=s.x,f+=s.y);w=io(s,y,m,b,x,w,{x:d,y:f},t);w&&(r=r.concat(w)),s.x=d,s.y=f}i=n=null}h=h.substr(h.length-1);"z"!==h&&"Z"!==h||!t||t.closePath()}return r},ro=function(t,e,i){var n,r,o="L"===e[0],a=e.length;t.save(),r=o?(t.transform(e[5],e[6],e[7],e[8],e[9],e[10]),n=t.createLinearGradient(e[1],e[2],e[3],e[4]),11):(t.transform(e[7],e[8],e[9],e[10],e[11],e[12]),n=t.createRadialGradient(e[1],e[2],e[3],e[4],e[5],e[6]),13);for(var s=t.compGray;r<a;){var h=i(h=e[r+1]);n.addColorStop(e[r],s?G.toGrayColor(h):h),r+=2}t.fillStyle=n},oo=function(t,e){var i=t.s("shape.gradient.pack");if(i){for(var n=i.length,r=new Array(n),o=0;o<n;o++)r[o]=i[o];var a="L"===r[0]?5:7,s=r[a],h=r[1+a],c=r[2+a],l=r[3+a],u=r[4+a],d=r[5+a],f=e[0],g=e[1],p=e[2],_=e[3],v=e[4],e=e[5];r[a]=f*s+p*h,r[1+a]=g*s+_*h,r[2+a]=f*c+p*l,r[3+a]=g*c+_*l,r[4+a]=f*u+p*d+v,r[5+a]=g*u+_*d+e,t.s("shape.gradient.pack",r)}},ao=function(t,e,i,n){var r=!1;if(t.beginPath?t.beginPath():r=!0,xn(e)&&(e=e._as),xn(i)&&(i=i._as),i&&i.length){for(var o,a,s,h,c=0,l=0,u=i.length;l<u;l++)1===(o=i[l])?(a=e[c++],t.moveTo(a.x,r?-a.y:a.y)):2===o?(a=e[c++],t.lineTo(a.x,r?-a.y:a.y)):3===o?(a=e[c++],s=e[c++],t.quadraticCurveTo(a.x,r?-a.y:a.y,s.x,r?-s.y:s.y)):4===o?(a=e[c++],s=e[c++],h=e[c++],t.bezierCurveTo(a.x,r?-a.y:a.y,s.x,r?-s.y:s.y,h.x,r?-h.y:h.y)):5===o&&t.closePath();n&&5!==o&&t.closePath()}else{var d,f,g,p=e.length;if(0<p){for(d=e[0],t.moveTo(d.x,r?-d.y:d.y),f=1;f<p;f++)g=e[f],t.lineTo(g.x,r?-g.y:g.y);n&&t.closePath()}}},so=function(t,e,i,n){if(xn(t)&&(t=t._as),xn(e)&&(e=e._as),e&&e.length){i=i||Ds;for(var r,o,a,s,h,c,l,u,d=[],f=U,g=0,p=0,_=e.length;p<_;p++)if(1===(r=e[p]))d.push(f=[]),f.push(t[g++]);else if(2===r)f.push(t[g++]);else if(3===r){for(o=f[f.length-1],a=t[g++],s=t[g++],c=1;c<i;c++)l=Xn(c/i,o.x,a.x,s.x),u=Xn(c/i,o.y,a.y,s.y),f.push({x:l,y:u,b:!0});f.push(s)}else if(4===r){for(o=f[f.length-1],a=t[g++],s=t[g++],h=t[g++],c=1;c<i;c++)l=Qn(c/i,o.x,a.x,s.x,h.x),u=Qn(c/i,o.y,a.y,s.y,h.y),f.push({x:l,y:u,b:!0});f.push(h)}else 5===r&&f.push(f[0]);return n&&5!==r&&f&&2<f.length&&f.push(f[0]),d}return n&&2<t.length&&(t=t.slice()).push(t[0]),t?[t]:[]},ho=function(t,e,i,n,r,o){var a,s,h,e=$r(e),c=n,l=e[0],u=e[1],d=e[2];for(h=i?(a=(i=$r(i))[0]-l,s=i[1]-u,i[2]-d):(a=255-l,s=255-u,255-d),o||(o=10<n?1:.5,o=r<1?q(o/r,2):o),t.save(),t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor=0;0<(n-=o);){var f=1-n/c,g=u+s*f,p=d+h*f,f=q(j(f=l+a*f),255),g=q(j(g),255),p=q(j(p),255);t.strokeStyle="rgb("+f+","+g+","+p+")",t.lineWidth=n,t.stroke()}t.restore()},vm={},co=function(t,e){var i=t+"-"+e,n=vm[i];if(n)return n;var r,o,t=$r(t),a=e<0?(e=(100+e)/100,r=j(t[0]*e),o=j(t[1]*e),j(t[2]*e)):(e/=100,r=t[0],o=t[1],a=t[2],o+=(255-o)*e,a+=(255-a)*e,r=q(j(r+=(255-r)*e),255),o=q(j(o),255),q(j(a),255));return vm[i]="rgb("+r+","+o+","+a+")"},lo=function(t,e,i,n,r,o){o&&(t.fillStyle=o),t.beginPath(),t.rect(e,i,n,r),t.fill()},uo=function(t,e,i,n,r,o,a){t.beginPath(),Co[e](t,i.x,i.y,i.width,i.height,n,r,o,a)},fo=function(t,e,i,n,r){i=Co[i];t.fillStyle=i?i(t,e,n||Ko,r.x,r.y,r.width,r.height):e},go=function(t,e,i,n,r,o){t.fillStyle=_o(t,e,i,n,r,o)},po=function(t,e,i,n,r,o){t.strokeStyle=_o(t,e,i,n,r,o)},_o=function(t,e,i,n,r,o){var a,s,h;try{!e.tagName&&e.comps&&(e._cacheImage_||(e._cacheImage_={}),s="override"===n?"colors_override":"override_rgb"===n?"colors_override_rgb":"override_a"===n?"colors_override_a":"colors",e._cacheImage_[s]||(e._cacheImage_[s]={__count__:0}),(h=e._cacheImage_[s][i])||(e._cacheImage_[s].__count__>G.imageCacheThreshold&&(e._cacheImage_[s]={__count__:0}),h=Gl.Default.toCanvas(e,mh(e),bh(e),null,r,o,i,null,n),e._cacheImage_[s][i]=h,e._cacheImage_[s].__count__++),e=h),a=t.createPattern(e,"repeat")}catch(t){a="black"}return a},vo=function(t){for(var e,i=[],n=0,r=t.length,o=0;o<65;o++)i[o]=o;for(o=0;o<65;o++)n=(n+i[o]+t.charCodeAt(o%r))%65,e=i[o],i[o]=i[n],i[n]=e;for(o=0;o<65;o++)i[o]=$o[i[o]];return i.join("")},yo=function(t,e,i,n,r,o,a){t.save(),t.translate(e,i),t.scale(1,a/o),t.arc(0,0,o,n,r),t.restore()},mo=function(t,e,i,n,r,o,a,s,h){6===arguments.length&&(h=s=a=o);var c=e+n,l=i+r,n=n<r?2*n:2*r;o=o<n?o:n,a=a<n?a:n,s=s<n?s:n;r=.29*(h=h<n?h:n),n=.58*h;t.moveTo(c,l-h),t.quadraticCurveTo(c,l-n,c-r,l-r),t.quadraticCurveTo(c-n,l,c-h,l),r=.29*s,n=.58*s,t.lineTo(e+s,l),t.quadraticCurveTo(e+n,l,e+r,l-r),t.quadraticCurveTo(e,l-n,e,l-s),r=.29*o,n=.58*o,t.lineTo(e,i+o),t.quadraticCurveTo(e,i+n,e+r,i+r),t.quadraticCurveTo(e+n,i,e+o,i),r=.29*a,n=.58*a,t.lineTo(c-a,i),t.quadraticCurveTo(c-n,i,c-r,i+r),t.quadraticCurveTo(c,i+n,c,i+a),t.lineTo(c,l-h)},bo=function(t,e,i,n,r,o,a){e&&(i=S(i),n=S(n),a=a||1,t.fillStyle=e,t.beginPath(),t.rect(i,n,a,o),t.rect(i,n,r,a),0<o-a&&t.rect(i,n+o-a,r,a),0<r-a&&t.rect(i+r-a,n,a,o),t.fill())},xo=function(t,e,i,n){var r,o,a,s=n.x,h=n.y,c=n.width,l=n.height;!e||!i||c<=0||l<=0||(r=os(e),o=as(e),a=0<i,1===i||-1===i?(t.fillStyle=a?r:o,t.beginPath(),t.rect(s,h,1,l),t.rect(s,h,c,1),t.fill(),t.fillStyle=a?o:r,t.beginPath(),t.rect(s,h+l-1,c,1),t.rect(s+c-1,h,1,l)):(i=q(X(i),q(c/2,l/2)),(n=t.createLinearGradient(s,h,s+i,h)).addColorStop(0,a?r:o),n.addColorStop(1,e),t.fillStyle=n,t.beginPath(),t.moveTo(s,h),t.lineTo(s+i,h+i),t.lineTo(s+i,h+l-i),t.lineTo(s,h+l),t.lineTo(s,h),t.fill(),(n=t.createLinearGradient(s,h,s,h+i)).addColorStop(0,a?r:o),n.addColorStop(1,e),t.fillStyle=n,t.beginPath(),t.moveTo(s,h),t.lineTo(s+i,h+i),t.lineTo(s+c-i,h+i),t.lineTo(s+c,h),t.lineTo(s,h),t.fill(),(n=t.createLinearGradient(s,h+l,s,h+l-i)).addColorStop(0,a?o:r),n.addColorStop(1,e),t.fillStyle=n,t.beginPath(),t.moveTo(s,h+l),t.lineTo(s+i,h+l-i),t.lineTo(s+c-i,h+l-i),t.lineTo(s+c,h+l),t.lineTo(s,h+l),t.fill(),(n=t.createLinearGradient(s+c,h,s+c-i,h)).addColorStop(0,a?o:r),n.addColorStop(1,e),t.fillStyle=n,t.beginPath(),t.moveTo(s+c,h),t.lineTo(s+c-i,h+i),t.lineTo(s+c-i,h+l-i),t.lineTo(s+c,h+l),t.lineTo(s+c,h)),t.fill())},wo=function(t,e,i,n,r,o,a){a=t.createLinearGradient(n,r,o,a);return a.addColorStop(0,i),a.addColorStop(1,e),a},Eo=function(t,e,i,n,r,o,a){a=t.createLinearGradient(n,r,o,a);return a.addColorStop(0,e),a.addColorStop(.5,i),a.addColorStop(1,e),a},To=function(t,e,i,n,r,o,a){a=t.createLinearGradient(n,r,o,a);return a.addColorStop(0,e),a.addColorStop(1/3,i),a.addColorStop(2/3,e),a.addColorStop(1,i),a},So=function(t,e,i,n,r,o,a,s,h){a=t.createRadialGradient(n+o*s,r+a*h,q(o,a)/24,n+o/2,r+a/2,N(o,a)/2);return a.addColorStop(0,i),a.addColorStop(1,e),a},Io=[0,-1,.22451398828979272,-.30901699437494734,.9510565162951535,-.30901699437494745,.3632712640026804,.11803398874989468,.5877852522924731,.8090169943749473,-11102230246251565e-32,.38196601125010515,-.587785252292473,.8090169943749475,-.3632712640026805,.1180339887498949,-.9510565162951536,-.3090169943749473,-.22451398828979285,-.30901699437494734],Co={polygon:function(t,e,i,n,r,o){(o==U||o<3)&&(o=6);for(var a,s,h=q(n,r)/2,c=e+n/2,l=i+r/2,u=0,d=2*P/o,f=0;f<o;f++)a=c+Q(u)*h,s=l+Z(u)*h,0===f?t.moveTo(a,s):t.lineTo(a,s),u+=d;t.closePath()},arc:function(t,e,i,n,r,o,a,s,h){o==U&&(o=P),a==U&&(a=J),s==U&&(s=!0);e+=n/2,i+=r/2;s&&t.moveTo(e,i),h?yo(t,e,i,o,a,n/2,r/2):t.arc(e,i,q(n,r)/2,o,a),s&&t.closePath()},rect:function(t,e,i,n,r){t.rect(e,i,n,r)},circle:function(t,e,i,n,r){t.arc(e+n/2,i+r/2,q(n,r)/2,0,J,!0)},oval:function(t,e,i,n,r){yo(t,e+n/2,i+r/2,0,J,n/2,r/2)},roundRect:function(t,e,i,n,r,o){o==U&&(o=q(q(n,r)/4,8)),mo(t,e,i,n,r,o)},star:function(t,e,i,n,r){var o=2*n,a=2*r,s=e+n/2,h=i+r/2;t.moveTo(s-o/4,h-a/12),t.lineTo(e+.306*n,i+.579*r),t.lineTo(s-o/6,h+a/4),t.lineTo(e+n/2,i+.733*r),t.lineTo(s+o/6,h+a/4),t.lineTo(e+.693*n,i+.579*r),t.lineTo(s+o/4,h-a/12),t.lineTo(e+.611*n,i+.332*r),t.lineTo(s+0,h-a/4),t.lineTo(e+.388*n,i+.332*r),t.closePath()},pentagram:function(t,e,i,n,r){var r=.5*r,o=e+.5*n,a=i+r,s=.5257311121191336*n;r<s&&(s=r);var h=Io,c=0;for(t.moveTo(o+s*h[c++],a+s*h[c++]);c<20;)t.lineTo(o+s*h[c++],a+s*h[c++]);t.closePath()},triangle:function(t,e,i,n,r){t.moveTo(e+n/2,i),t.lineTo(e+n,i+r),t.lineTo(e,i+r),t.closePath()},hexagon:function(t,e,i,n,r){t.moveTo(e,i+r/2),t.lineTo(e+n/4,i+r),t.lineTo(e+3*n/4,+i+r),t.lineTo(e+n,i+r/2),t.lineTo(e+3*n/4,i),t.lineTo(e+n/4,i),t.closePath()},pentagon:function(t,e,i,n,r){var o=2*n,a=2*r,n=e+n/2,r=i+r/2;t.moveTo(n-o/4,r-a/12),t.lineTo(n-o/6,r+a/4),t.lineTo(n+o/6,r+a/4),t.lineTo(n+o/4,r-a/12),t.lineTo(n+0,r-a/4),t.closePath()},diamond:function(t,e,i,n,r){t.moveTo(e+n/2,i),t.lineTo(e,i+r/2),t.lineTo(e+n/2,i+r),t.lineTo(e+n,i+r/2),t.closePath()},rightTriangle:function(t,e,i,n,r){t.moveTo(e,i),t.lineTo(e+n,i+r),t.lineTo(e,i+r),t.closePath()},parallelogram:function(t,e,i,n,r){var o=n/4;t.moveTo(e+o,i),t.lineTo(e+n,i),t.lineTo(e+n-o,i+r),t.lineTo(e,i+r),t.closePath()},trapezoid:function(t,e,i,n,r){var o=n/4;t.moveTo(e+o,i),t.lineTo(e+n-o,i),t.lineTo(e+n,i+r),t.lineTo(e,i+r),t.closePath()},"linear.southwest":function(t,e,i,n,r,o,a){return wo(t,e,i,n,r+a,n+o,r)},"linear.southeast":function(t,e,i,n,r,o,a){return wo(t,e,i,n+o,r+a,n,r)},"linear.northwest":function(t,e,i,n,r,o,a){return wo(t,e,i,n,r,n+o,r+a)},"linear.northeast":function(t,e,i,n,r,o,a){return wo(t,e,i,n+o,r,n,r+a)},"linear.north":function(t,e,i,n,r,o,a){return wo(t,e,i,n,r,n,r+a)},"linear.south":function(t,e,i,n,r,o,a){return wo(t,e,i,n,r+a,n,r)},"linear.west":function(t,e,i,n,r,o){return wo(t,e,i,n,r,n+o,r)},"linear.east":function(t,e,i,n,r,o){return wo(t,e,i,n+o,r,n,r)},"radial.center":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.5,.5)},"radial.southwest":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.25,.75)},"radial.southeast":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.75,.75)},"radial.northwest":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.25,.25)},"radial.northeast":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.75,.25)},"radial.north":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.5,.25)},"radial.south":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.5,.75)},"radial.west":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.25,.5)},"radial.east":function(t,e,i,n,r,o,a){return So(t,e,i,n,r,o,a,.75,.5)},"spread.horizontal":function(t,e,i,n,r,o){return Eo(t,e,i,n,r,n+o,r)},"spread.vertical":function(t,e,i,n,r,o,a){return Eo(t,e,i,n,r,n,r+a)},"spread.diagonal":function(t,e,i,n,r,o,a){return Eo(t,e,i,n+o,r,n,r+a)},"spread.antidiagonal":function(t,e,i,n,r,o,a){return Eo(t,e,i,n,r,n+o,r+a)},"spread.north":function(t,e,i,n,r,o,a){return To(t,e,i,n,r-a/4,n,r+a+a/4)},"spread.south":function(t,e,i,n,r,o,a){return To(t,i,e,n,r-a/4,n,r+a+a/4)},"spread.west":function(t,e,i,n,r,o){return To(t,e,i,n-o/4,r,n+o+o/4,r)},"spread.east":function(t,e,i,n,r,o){return To(t,i,e,n-o/4,r,n+o+o/4,r)}},Mo=function(t,e,i){return new oa(t).tf(e,i)},Ro=function(t){var e=t.touches[0],i=t.touches[1],n=e.clientX,t=e.clientY,e=i.clientX,i=i.clientY;return W((n-e)*(n-e)+(t-i)*(t-i))},function(){for(var t=0,e=Ce.split(""),i=0;i<e.length;i++)t=10*tt(e[i])+t;!function(t,e){var i=U||4,n=U||1,r=U||1;i<0?i=0:.25<i&&(i=.25);for(var o,a,s,h,c,l=[],u=[],d=[],f=J/r,g=J/n,p=.5-i,_=0;_<=n;_++)for(h=Q(a=_*g-P),s=Z(a),m=0;m<=r;m++)o=m*f,c=p+i*h,l.push(Q(o)*c,s*i,-Z(o)*c),u.push(m/r,1-_/n);for(_=0;_<n;_++)for(var v=_*(r+1),y=(_+1)*(r+1),m=0;m<r;m++)d.push(v+m,y+m+1,y+m,v+m,v+m+1,y+m+1),Qn.z=oo.z=[t,e]}(C[zr.toString(8*i)+jt.substr(i)+3],C[zr.toString(8*i)+jt.substr(i)+4])}(),Ao=function(t,e,i){for(var n=0;n<i.size();n++){var r=i.get(n);t.co(r)&&e.add(r)}for(n=0;n<i.size();n++)r=i.get(n),Ao(t,e,r._children)},Po=function(t,e,i){for(var n=0;n<i.size();n++){var r=i.get(i.size()-1-n);t.co(r)&&e.add(r)}for(n=0;n<i.size();n++)r=i.get(n),Po(t,e,r._children)},Do=function(t,e,i){for(var n=!1,r=0;r<i.size();r++){var o=i.get(r);t.co(o)?n&&e.add(o):n=1}for(r=0;r<i.size();r++)o=i.get(r),Do(t,e,o._children)},Oo=function(t,e,i){for(var n=!1,r=0;r<i.size();r++){var o=i.get(i.size()-1-r);t.co(o)?n&&e.add(o):n=!0}for(r=0;r<i.size();r++)o=i.get(r),Oo(t,e,o._children)},Bo=G.moveDatas=function(t,n,r,o){var e,i,a,s,h,c,l,u=o==U;0===n&&0===r&&(u||0===o)||(e=!0,i=[],t.forEach(function(t){e&&(t._69O||Tn(t)||In(t))&&(e=!1)}),e?i=t:(a={},s={},t.forEach(function(t){a[t._id]=!0}),h={},c=function(t){var e=t._id;return a[e]?(i.push(t),h[e]=!0):h[e]=!1},l=function(t){var e=t._id;if(s[e])return c(t);var i=h[e];if(i!==H)return i;var n=t._parent;if(n&&(In(n)||Tn(n))&&l(n))return h[e]=!0;n=t._host;return n&&(s[e]=e,i=l(n),s[e]=H,i)?h[e]=!0:c(t)},t.forEach(function(t){l(t)})),i.forEach(function(t){var e,i;wn(t)?u?t.translate(n,r):t.translate3d(n,r,o):(e=t.s(Kt))&&!e.isEmpty()&&(i=new Lh,e.each(function(t){t=is(t),u?(t.x+=n,t.y+=r):(t.x+=n,t.y+=o,t.e==U?t.e=r:t.e+=r),i.add(t)}),t.s(Kt,i))}))},_m=function(t,e){um||(um=new fa,dm=new ha,fm=new fa,gm=new fa,pm=new fa),e==H&&(e=new fa);var i,n=getComputedStyle(t);n.transform&&"none"!==n.transform&&(i=n.transform,(a=um)==H&&(a=new fa),Qm(i,"matrix3d")?(o=(o=i.substring(9,i.length-1).split(",")).map(Ym),a.fromArray(o)):Qm(i,"matrix")&&(o=(o=i.substring(7,i.length-1).split(",")).map(Ym),a.el[0]=o[0],a.el[1]=o[1],a.el[2]=0,a.el[3]=0,a.el[4]=o[2],a.el[5]=o[3],a.el[6]=0,a.el[7]=0,a.el[8]=0,a.el[9]=0,a.el[10]=1,a.el[11]=0,a.el[12]=o[4],a.el[13]=o[5],a.el[14]=0,a.el[15]=1),Zm(n.transformOrigin,dm),gm.setPosition(dm),dm.negate(),pm.setPosition(dm),!A&&"preserve-3d"===n.transformStyle||(um.el[8]=0,um.el[9]=0,um.el[10]=1,um.el[11]=0),e.multiplyMatrices(pm,e),e.multiplyMatrices(um,e),e.multiplyMatrices(gm,e)),!A&&n.perspective&&"none"!==n.perspective&&(fm.el[11]=-1/Ym(n.perspective),Zm(n.perspectiveOrigin,dm),gm.setPosition(dm),dm.negate(),pm.setPosition(dm),e.multiplyMatrices(pm,e),e.multiplyMatrices(fm,e),e.multiplyMatrices(gm,e));for(var r=t.offsetParent,o=t.offsetLeft,a=t.offsetTop,s=t.parentElement;s&&s!==r;){var h=getComputedStyle(s);if("none"!==h.transform||"none"!==h.perspective)break;s=s.parentElement}return s==H&&t!==t.ownerDocument.documentElement&&"fixed"!==n.position&&(s=t.ownerDocument.documentElement),r!=H&&r!==s&&(o-=s.offsetLeft,a-=s.offsetTop),dm.set(o,a,0),gm.setPosition(dm),e.multiplyMatrices(gm,e),s&&_m(s,e),e},zo=function(t,e){var i,n=t.parentElement;if(n)return n.updateAppendMatrix&&(delete n.updateAppendMatrix,i=new fa,_m(n,i),(t=new fa).getInverse(i),n._matrixAppend=t,n._maxrixPreAppend=i),e?n._matrixAppend:n._maxrixPreAppend},Vo=L.getPrototypeOf?function(t,e,i){e=function(t,e){for(;t&&!t.hasOwnProperty(e);)t=L.getPrototypeOf(t);return t&&L.getOwnPropertyDescriptor(t,e)}(e,i);e&&L.defineProperty(t,i,e)}:function(t,e,i){t[i]=e[i]},Lo={1:29,2:30,3:31,4:32,5:33,6:26,7:27,8:28,9:21,10:22,11:23,12:24,13:25,14:14,15:15,16:16,17:17,18:18,19:19,20:20,21:9,22:10,23:11,24:12,25:13,26:6,27:7,28:8,29:1,30:2,31:3,32:4,33:5,34:36,35:37,36:34,37:35,38:54,39:55,40:52,41:53,42:50,43:51,44:49,50:42,51:43,52:40,53:41,54:38,55:39},lm={1:function(t,e){return{x:t.x-e.width/2,y:t.y-e.height/2}},2:function(t,e){return{x:t.x+e.width/2,y:t.y-e.height/2}},3:function(t,e){return{x:t.x+t.width/2,y:t.y-e.height/2}},4:function(t,e){return{x:t.x+t.width-e.width/2,y:t.y-e.height/2}},5:function(t,e){return{x:t.x+t.width+e.width/2,y:t.y-e.height/2}},6:function(t){return{x:t.x,y:t.y}},7:function(t){return{x:t.x+t.width/2,y:t.y}},8:function(t){return{x:t.x+t.width,y:t.y}},9:function(t,e){return{x:t.x-e.width/2,y:t.y+e.height/2}},10:function(t,e){return{x:t.x+e.width/2,y:t.y+e.height/2}},11:function(t,e){return{x:t.x+t.width/2,y:t.y+e.height/2}},12:function(t,e){return{x:t.x-e.width/2+t.width,y:t.y+e.height/2}},13:function(t,e){return{x:t.x+t.width+e.width/2,y:t.y+e.height/2}},14:function(t,e){return{x:t.x-e.width/2,y:t.y+t.height/2}},15:function(t){return{x:t.x,y:t.y+t.height/2}},16:function(t,e){return{x:t.x+e.width/2,y:t.y+t.height/2}},17:function(t){return{x:t.x+t.width/2,y:t.y+t.height/2}},18:function(t,e){return{x:t.x+t.width-e.width/2,y:t.y+t.height/2}},19:function(t){return{x:t.x+t.width,y:t.y+t.height/2}},20:function(t,e){return{x:t.x+t.width+e.width/2,y:t.y+t.height/2}},21:function(t,e){return{x:t.x-e.width/2,y:t.y+t.height-e.height/2}},22:function(t,e){return{x:t.x+e.width/2,y:t.y+t.height-e.height/2}},23:function(t,e){return{x:t.x+t.width/2,y:t.y+t.height-e.height/2}},24:function(t,e){return{x:t.x+t.width-e.width/2,y:t.y+t.height-e.height/2}},25:function(t,e){return{x:t.x+t.width+e.width/2,y:t.y+t.height-e.height/2}},26:function(t){return{x:t.x,y:t.y+t.height}},27:function(t){return{x:t.x+t.width/2,y:t.y+t.height}},28:function(t){return{x:t.x+t.width,y:t.y+t.height}},29:function(t,e){return{x:t.x-e.width/2,y:t.y+t.height+e.height/2}},30:function(t,e){return{x:t.x+e.width/2,y:t.y+t.height+e.height/2}},31:function(t,e){return{x:t.x+t.width/2,y:t.y+t.height+e.height/2}},32:function(t,e){return{x:t.x+t.width-e.width/2,y:t.y+t.height+e.height/2}},33:function(t,e){return{x:t.x+t.width+e.width/2,y:t.y+t.height+e.height/2}},34:function(t,e){return{x:t.x,y:t.y-e.height/2}},35:function(t,e){return{x:t.x+t.width,y:t.y-e.height/2}},36:function(t,e){return{x:t.x,y:t.y+t.height+e.height/2}},37:function(t,e){return{x:t.x+t.width,y:t.y+t.height+e.height/2}},38:function(t,e){return{x:t.x+t.width/4,y:t.y-e.height/2}},39:function(t,e){return{x:t.x+3*t.width/4,y:t.y-e.height/2}},40:function(t){return{x:t.x+t.width/4,y:t.y}},41:function(t){return{x:t.x+3*t.width/4,y:t.y}},42:function(t,e){return{x:t.x+t.width/4,y:t.y+e.height/2}},43:function(t,e){return{x:t.x+3*t.width/4,y:t.y+e.height/2}},44:function(t,e){return{x:t.x+t.width/2,y:t.y+t.height/2-e.height/2}},45:function(t){return{x:t.x+t.width/4,y:t.y+t.height/2}},46:function(t,e){return{x:t.x+t.width/2-e.width/2,y:t.y+t.height/2}},47:function(t,e){return{x:t.x+t.width/2+e.width/2,y:t.y+t.height/2}},48:function(t){return{x:t.x+3*t.width/4,y:t.y+t.height/2}},49:function(t,e){return{x:t.x+t.width/2,y:t.y+t.height/2+e.height/2}},50:function(t,e){return{x:t.x+t.width/4,y:t.y+t.height-e.height/2}},51:function(t,e){return{x:t.x+3*t.width/4,y:t.y+t.height-e.height/2}},52:function(t){return{x:t.x+t.width/4,y:t.y+t.height}},53:function(t){return{x:t.x+3*t.width/4,y:t.y+t.height}},54:function(t,e){return{x:t.x+t.width/4,y:t.y+t.height+e.height/2}},55:function(t,e){return{x:t.x+3*t.width/4,y:t.y+t.height+e.height/2}}},Fo=function(t){var e,i=0;for(e in t)2===e.length&&tt(e,32)===zr&&(Qi=t[e]),i++;return i}(C)?function(t,e,i){return lm[t](e,i||Ji)}:void 0,An(r,{highlight:"#1ABC9C",label:"#000",labelSelect:"#FFF",transparent:"rgba(0,0,0,0.35)",titleBackground:"#2C3E50",titleIconBackground:"#868686",headerBackground:"#ECF0F1",headerIconBackground:"#868686",headerSeparator:"#868686",headerLine:"#D9D9D9",background:"#FFF",disabledBackground:"rgba(255,255,255,0.65)",toolTipBackground:"#FFFFE0",rectSelectBorder:"#45C4F9",rectSelectBackground:"rgba(0,0,0,0.35)",editPointBorder:"#2C3E50",editPointBackground:"#D9D9D9",dash:"#2C3E50",groupBackground:"#ECF0F1",groupTitleBackground:"#2C3E50",gridBackground:"#D9D9D9",gridCellBorderColor:"#868686",gridBlockColor:"#868686",reverse:"#868686",contentIconBackground:"#868686",contentLine:"#D9D9D9",widgetBackground:"#ECF0F1",widgetBorder:"#D9D9D9",widgetIconBackground:"#868686",widgetIconBorder:"#868686",widgetIconGradient:"#D9D9D9",widgetIconHighlight:"#43AFF1",imageBackground:"#3498DB",imageGradient:"#FFF",chart:["#2f7ed8","#0d233a","#8bbc21","#910000","#1aadce","#492970","#f28f43","#77a1e5","#c42525","#a6c96a"]},!0),ko=r.reverse,jo=r.transparent,zd=r.rectSelectBackground,No=r.dash,Uo=r.titleBackground,Go=r.titleIconBackground,Ho=r.headerBackground,Wo=r.headerIconBackground,Ip=r.headerSeparator,qo=r.headerLine,Xo=r.contentIconBackground,Qo=r.contentLine,Yo=r.widgetIconBorder,Zo=r.imageBackground,Ko=r.imageGradient,Jo=r.highlight,Xa=r.label,Vs=r.labelSelect,Math.sign===H&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),$o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ta={encode:function(t,e){var i,n,r,o,a,s,h="",c=0;for(t=unescape(encodeURIComponent(t));c<t.length;)r=(s=t.charCodeAt(c++))>>2,o=(3&s)<<4|(i=t.charCodeAt(c++))>>4,a=(15&i)<<2|(n=t.charCodeAt(c++))>>6,s=63&n,isNaN(i)?a=s=64:isNaN(n)&&(s=64),h=h+e.charAt(r)+e.charAt(o)+e.charAt(a)+e.charAt(s);return h},decode:function(t,e,i){for(var n,r,o,a,s,h="",c=i||0;c<t.length;)n=e.indexOf(t.charAt(c++))<<2|(o=e.indexOf(t.charAt(c++)))>>4,r=(15&o)<<4|(a=e.indexOf(t.charAt(c++)))>>2,o=(3&a)<<6|(s=e.indexOf(t.charAt(c++))),h+=String.fromCharCode(n),64!=a&&(h+=String.fromCharCode(r)),64!=s&&(h+=String.fromCharCode(o));return decodeURIComponent(escape(h))},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var e="",i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e+=String.fromCharCode(n):(127<n&&n<2048?e+=String.fromCharCode(192|n>>6):(e+=String.fromCharCode(224|n>>12),e+=String.fromCharCode(128|63&n>>6)),e+=String.fromCharCode(128|63&n))}return e},_utf8_decode:function(t){for(var e,i,n="",r=0,o=0;r<t.length;)(e=t.charCodeAt(r))<128?(n+=String.fromCharCode(e),r++):191<e&&e<224?(o=t.charCodeAt(r+1),n+=String.fromCharCode((31&e)<<6|63&o),r+=2):(o=t.charCodeAt(r+1),i=t.charCodeAt(r+2),n+=String.fromCharCode((15&e)<<12|(63&o)<<6|63&i),r+=3);return n}},ea=[],ia=[],na=Gl.Math={generateUUID:function(){for(var r=[],t=0;t<256;t++)r[t]=(t<16?"0":"")+t.toString(16).toUpperCase();return function(){var t=0|4294967295*Math.random(),e=0|4294967295*Math.random(),i=0|4294967295*Math.random(),n=0|4294967295*Math.random();return r[255&t]+r[255&t>>8]+r[255&t>>16]+r[255&t>>24]+"-"+r[255&e]+r[255&e>>8]+"-"+r[64|15&e>>16]+r[255&e>>24]+"-"+r[128|63&i]+r[255&i>>8]+"-"+r[255&i>>16]+r[255&i>>24]+r[255&n]+r[255&n>>8]+r[255&n>>16]+r[255&n>>24]}}(),clamp:function(t,e,i){return Math.max(e,Math.min(i,t))},generateIncreasingID:(cm=0,function(){return++cm}),encodeBase64:function(t,e){return ta.encode(t,e||$o)},decodeBase64:function(t,e){return ta.decode(t,e||$o)},randomArray:function(t,e){for(var i=(e=e||t.length)-1;0<i;i--){var n=Math.floor(Math.random()*(i+1)),r=t[i];t[i]=t[n],t[n]=r}return t},randomInt:function(t,e){return e===H&&(e=t,t=0),t+Math.floor(Math.random()*(e-t))},isPOT:function(t){return 0<t&&0==(t-1&t)},nearestPOT:function(t){if(!t)return 1;var e=t;e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16;var i=++e>>1;return e-t<t-i?e:i},requestMatrix4:function(){return 0<ea.length?ea.pop():new na.Matrix4},releaseMatrix4:function(t){ea.push(t)},requestVector3:function(){return 0<ia.length?ia.pop():new na.Vector3},releaseVector3:function(t){ia.push(t)}},ra=Gl.Matrix=Gl.Math.Matrix2d=function(t,e,i,n,r){this.setFromTransform(t,e,i,n,r)},(oa=ra).prototype={},(ra.prototype.constructor=ra).prototype.set=function(t,e,i,n,r,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=r,this.ty=o,this},ra.prototype.setFromTransform=function(t,e,i,n,r){var o=this;if(t===H)return o.a=1,o.b=0,o.c=0,o.d=1,o.tx=0,void(o.ty=0);var a=Z(t=t||0),t=Q(t);return n=n||1,r=r||1,o.a=t*n,o.b=a*n,o.c=-a*r,o.d=t*r,o.tx=e||0,o.ty=i||0,o},ra.prototype.apply=function(t,e){e=e||new ca;var i=t.x,t=t.y;return e.x=this.a*i+this.c*t+this.tx,e.y=this.b*i+this.d*t+this.ty,e},ra.prototype.applyInverse=function(t,e){e=e||new ca;var i=1/(this.a*this.d+this.c*-this.b),n=t.x,t=t.y;return e.x=this.d*i*n+-this.c*i*t+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*t+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e},ra.prototype.translate=function(t,e){return this.tx+=t,this.ty+=e,this},ra.prototype.scale=function(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this},ra.prototype.rotate=function(t){var e=Math.cos(t),i=Math.sin(t),n=this.a,r=this.c,t=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=r*e-this.d*i,this.d=r*i+this.d*e,this.tx=t*e-this.ty*i,this.ty=t*i+this.ty*e,this},ra.prototype.appendTranslate=function(t,e){return this.tx+=this.a*t+this.c*e,this.ty+=this.b*t+this.d*e,this},ra.prototype.appendScale=function(t,e){return this.a*=t,this.d*=e,this.c*=e,this.b*=t,this},ra.prototype.appendRotate=function(t){if(!t)return this;var e=Math.cos(t),i=Math.sin(t),n=this.a,t=this.b;return this.a=n*e+this.c*i,this.b=t*e+this.d*i,this.c=-n*i+this.c*e,this.d=-t*i+this.d*e,this},ra.prototype.append=function(t){var e=this.a,i=this.b,n=this.c,r=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*r,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*r,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*r+this.ty,this},ra.prototype.setTransform=function(t,e,i,n,r,o,a,s,h){var c=Math.sin(a),l=Math.cos(a),u=Math.cos(h),d=Math.sin(h),a=-Math.sin(s),h=Math.cos(s),s=l*r,r=c*r,c=-c*o,o=l*o;return this.a=u*s+d*c,this.b=u*r+d*o,this.c=a*s+h*c,this.d=a*r+h*o,this.tx=t+(i*s+n*c),this.ty=e+(i*r+n*o),this},ra.prototype.prepend=function(t){var e,i,n=this.tx;return 1===t.a&&0===t.b&&0===t.c&&1===t.d||(e=this.a,i=this.c,this.a=e*t.a+this.b*t.c,this.b=e*t.b+this.b*t.d,this.c=i*t.a+this.d*t.c,this.d=i*t.b+this.d*t.d),this.tx=n*t.a+this.ty*t.c+t.tx,this.ty=n*t.b+this.ty*t.d+t.ty,this},ra.prototype.transform=ra.prototype.prepend,ra.prototype.invert=function(){var t=this.a,e=this.b,i=this.c,n=this.d,r=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*r)/o,this.ty=-(t*this.ty-e*r)/o,this},ra.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},ra.prototype.clone=function(){var t=new ra;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},ra.prototype.copy=function(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t},ra.prototype.tf=function(t,e){1===arguments.length&&(e=t.y,t=t.x);var i=this;return{x:i.a*t+i.c*e+i.tx,y:i.b*t+i.d*e+i.ty}},ra.prototype.tfi=function(t,e){1===arguments.length&&(e=t.y,t=t.x);var i=this,n=1/(i.a*i.d+i.c*-i.b);return{x:i.d*n*t+-i.c*n*e+(i.ty*i.c-i.tx*i.d)*n,y:i.a*n*e+-i.b*n*t+(-i.ty*i.a+i.tx*i.b)*n}},ra.IDENTITY=new ra,ra.TEMP_MATRIX=new ra,aa=Gl.Math.Quaternion=function(t,e,i,n){this.set(t,e,i,n)},L.assign(aa.prototype,{set:function(t,e,i,n){var r=this;return r._x=t||0,r._y=e||0,r._z=i||0,r._w=n!==H?n:1,r},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(t){var e=this;return e._x=t._x,e._y=t._y,e._z=t._z,e._w=t._w,e},inverse:function(){return this.conjugate()},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._x=0,this._y=0,this._z=0,this._w=1):(t=1/t,this._x=this._x*t,this._y=this._y*t,this._z=this._z*t,this._w=this._w*t),this},fromArray:function(t,e){e===H&&(e=0);return this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,n=this._y,r=this._z,o=this._w,a=o*t._w+i*t._x+n*t._y+r*t._z;if(a<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,a=-a):this.copy(t),1<=a)return this._w=o,this._x=i,this._y=n,this._z=r,this;var s=Math.sqrt(1-a*a);if(Math.abs(s)<.001)return this._w=.5*(o+this._w),this._x=.5*(i+this._x),this._y=.5*(n+this._y),this._z=.5*(r+this._z),this;t=Math.atan2(s,a),a=Math.sin((1-e)*t)/s,s=Math.sin(e*t)/s;return this._w=o*a+this._w*s,this._x=i*a+this._x*s,this._y=n*a+this._y*s,this._z=r*a+this._z*s,this},setFromAxisAngle:function(t,e){var i=e/2,e=Math.sin(i);return this._x=t.x*e,this._y=t.y*e,this._z=t.z*e,this._w=Math.cos(i),this},setFromEuler:function(t){var e=t._x,i=t._y,n=t._z,r=t._order,o=Math.cos,a=Math.sin,s=o(e/2),t=o(i/2),o=o(n/2),e=a(e/2),i=a(i/2),n=a(n/2);return"XYZ"===r?(this._x=e*t*o+s*i*n,this._y=s*i*o-e*t*n,this._z=s*t*n+e*i*o,this._w=s*t*o-e*i*n):"YXZ"===r?(this._x=e*t*o+s*i*n,this._y=s*i*o-e*t*n,this._z=s*t*n-e*i*o,this._w=s*t*o+e*i*n):"ZXY"===r?(this._x=e*t*o-s*i*n,this._y=s*i*o+e*t*n,this._z=s*t*n+e*i*o,this._w=s*t*o-e*i*n):"ZYX"===r?(this._x=e*t*o-s*i*n,this._y=s*i*o+e*t*n,this._z=s*t*n-e*i*o,this._w=s*t*o+e*i*n):"YZX"===r?(this._x=e*t*o+s*i*n,this._y=s*i*o+e*t*n,this._z=s*t*n-e*i*o,this._w=s*t*o-e*i*n):"XZY"===r&&(this._x=e*t*o-s*i*n,this._y=s*i*o-e*t*n,this._z=s*t*n+e*i*o,this._w=s*t*o+e*i*n),this},setFromRotationMatrix:function(t){var e,i=t.el,n=i[0],r=i[4],o=i[8],a=i[1],s=i[5],h=i[9],c=i[2],l=i[6],t=i[10],i=n+s+t;return 0<i?(e=.5/Math.sqrt(i+1),this._w=.25/e,this._x=(l-h)*e,this._y=(o-c)*e,this._z=(a-r)*e):s<n&&t<n?(e=2*Math.sqrt(1+n-s-t),this._w=(l-h)/e,this._x=.25*e,this._y=(r+a)/e,this._z=(o+c)/e):t<s?(e=2*Math.sqrt(1+s-n-t),this._w=(o-c)/e,this._x=(r+a)/e,this._y=.25*e,this._z=(h+l)/e):(e=2*Math.sqrt(1+t-n-s),this._w=(a-r)/e,this._x=(o+c)/e,this._y=(h+l)/e,this._z=.25*e),this},setFromToVectors:function(t,e){return sm===H&&(sm=new ha),(hm=t.dot(e)+1)<1e-7?(hm=0,Math.abs(t.x)>Math.abs(t.z)?sm.set(-t.y,t.x,0):sm.set(0,-t.z,t.y)):sm.crossVectors(t,e),this._x=sm.x,this._y=sm.y,this._z=sm.z,this._w=hm,this.normalize()},setFromUnitVectors:function(t,e){return om===H&&(om=new ha),(am=t.dot(e)+1)<1e-6?(am=0,Math.abs(t.x)>Math.abs(t.z)?om.set(-t.y,t.x,0):om.set(0,-t.z,t.y)):om.crossVectors(t,e),this._x=om.x,this._y=om.y,this._z=om.z,this._w=am,this.normalize()},multiply:function(t){return this.multiplyQuaternions(this,t)},premultiply:function(t){return this.multiplyQuaternions(t,this)},multiplyQuaternions:function(t,e){var i=t._x,n=t._y,r=t._z,o=t._w,a=e._x,s=e._y,t=e._z,e=e._w;return this._x=i*e+o*a+n*t-r*s,this._y=n*e+o*s+r*a-i*t,this._z=r*e+o*t+i*s-n*a,this._w=o*e-i*a-n*s-r*t,this}}),sa=Gl.Math.Vector4=function(t,e,i,n){this.x=t||0,this.y=e||0,this.z=i||0,this.w=n!==H?n:1},L.assign(sa.prototype,{isVector4:!0,set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this.w=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw new Error("index is out of range: "+t)}return this},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+t)}},clone:function(){return new this.constructor(this.x,this.y,this.z,this.w)},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w!==H?t.w:1,this},add:function(t,e){return e!==H?this.addVectors(t,e):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this.w+=t.w*e,this},sub:function(t,e){return e!==H?this.subVectors(t,e):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=this.w,t=t.el;return this.x=t[0]*e+t[4]*i+t[8]*n+t[12]*r,this.y=t[1]*e+t[5]*i+t[9]*n+t[13]*r,this.z=t[2]*e+t[6]*i+t[10]*n+t[14]*r,this.w=t[3]*e+t[7]*i+t[11]*n+t[15]*r,this},divideScalar:function(t){return this.multiplyScalar(1/t)},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,n,r=t.el,o=r[0],a=r[4],s=r[8],h=r[1],c=r[5],l=r[9],u=r[2],d=r[6],f=r[10];if(Math.abs(a-h)<.01&&Math.abs(s-u)<.01&&Math.abs(l-d)<.01){if(Math.abs(a+h)<.1&&Math.abs(s+u)<.1&&Math.abs(l+d)<.1&&Math.abs(o+c+f-3)<.1)return this.set(1,0,0,0),this;y=Math.PI;var g=(o+1)/2,p=(c+1)/2,_=(f+1)/2,v=(a+h)/4,t=(s+u)/4,r=(l+d)/4;return p<g&&_<g?n=g<.01?(e=0,i=.707106781):(i=v/(e=Math.sqrt(g)),t/e):_<p?n=p<.01?(i=0,e=.707106781):(e=v/(i=Math.sqrt(p)),r/i):_<.01?(i=e=.707106781,n=0):(e=t/(n=Math.sqrt(_)),i=r/n),this.set(e,i,n,y),this}var y=Math.sqrt((d-l)*(d-l)+(s-u)*(s-u)+(h-a)*(h-a));return Math.abs(y)<.001&&(y=1),this.x=(d-l)/y,this.y=(s-u)/y,this.z=(h-a)/y,this.w=Math.acos((o+c+f-1)/2),this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this.w=Math.min(this.w,t.w),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this.w=Math.max(this.w,t.w),this},clamp:function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this.z=Math.max(t.z,Math.min(e.z,this.z)),this.w=Math.max(t.w,Math.min(e.w,this.w)),this},clampScalar:function(t,e){return nm===H&&(nm=new sa,rm=new sa),nm.set(t,t,t,t),rm.set(e,e,e,e),this.clamp(nm,rm)},clampLength:function(t,e){var i=this.length();return this.divideScalar(i||1).multiplyScalar(Math.max(t,Math.min(e,i)))},floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length()||1)},setLength:function(t){return this.normalize().multiplyScalar(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return e===H&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return t===H&&(t=[]),e===H&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromBufferAttribute:function(t,e){return this.x=t.getX(e),this.y=t.getY(e),this.z=t.getZ(e),this.w=t.getW(e),this}}),ha=Gl.Math.Vector3=function(t,e,i){t===H?(this.x=0,this.y=0,this.z=0):"object"==typeof t?this.copy(t):this.set(t,e==H?t:e,i==H?t:i)},L.assign(ha.prototype,{isNaN:function(){return isNaN(this.x)||isNaN(this.y)||isNaN(this.z)},set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},equals:function(t){return t&&this.x===t.x&&this.y===t.y&&this.z===t.z},setScalar:function(t){return this.x=t,this.y=t,this.z=t,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(t){return t.x===H?(this.x=t[0],this.y=t[1],this.z=t[2]):(this.x=t.x,this.y=t.y,this.z=t.z||0),this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},addScaledVector:function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this.z+=t.z*e,this},sub:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,t=this.z-t.z;return e*e+i*i+t*t},distanceToSquared2:function(t){var e=this.x-t[0],i=this.y-t[1],t=this.z-t[2];return e*e+i*i+t*t},divideVectors:function(t,e){return this.x=t.x/e.x,this.y=t.y/e.y,this.z=t.z/e.z,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},transformDirection:function(t){var e=this.x,i=this.y,n=this.z,t=t.el;return this.x=t[0]*e+t[4]*i+t[8]*n,this.y=t[1]*e+t[5]*i+t[9]*n,this.z=t[2]*e+t[6]*i+t[10]*n,this.normalize()},applyAxisAngle:(im=new aa,function(t,e){return this.applyQuaternion(im.setFromAxisAngle(t,e))}),applyEuler:(em=new aa,function(t){return this.applyQuaternion(em.setFromEuler(t))}),applyQuaternion:function(t){var e=this.x,i=this.y,n=this.z,r=t._x,o=t._y,a=t._z,s=t._w,h=s*e+o*n-a*i,c=s*i+a*e-r*n,t=s*n+r*i-o*e,n=-r*e-o*i-a*n;return this.x=h*s+n*-r+c*-a-t*-o,this.y=c*s+n*-o+t*-r-h*-a,this.z=t*s+n*-a+h*-o-c*-r,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,r=t.el,t=1/(r[3]*e+r[7]*i+r[11]*n+r[15]);return this.x=(r[0]*e+r[4]*i+r[8]*n+r[12])*t,this.y=(r[1]*e+r[5]*i+r[9]*n+r[13])*t,this.z=(r[2]*e+r[6]*i+r[10]*n+r[14])*t,this},applyMatrix3:function(t){var e=this.x,i=this.y,n=this.z,t=t.el;return this.x=t[0]*e+t[3]*i+t[6]*n,this.y=t[1]*e+t[4]*i+t[7]*n,this.z=t[2]*e+t[5]*i+t[8]*n,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},reflect:(tm=new ha,function(t){return this.sub(tm.copy(t).multiplyScalar(2*this.dot(t)))}),dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},manhattanLength:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){var t=this.length();return t?this.multiplyScalar(1/t):this},setLength:function(t){return this.normalize().multiplyScalar(t)},fromArray:function(t,e){return e===H&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return t===H&&(t=[0,0,0]),e===H&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},cross:function(t){return this.crossVectors(this,t)},angleTo:function(t){t=this.dot(t)/Math.sqrt(this.lengthSq()*t.lengthSq());return 1<t||t<-1?0:Math.acos(t)},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,o=e.x,t=e.y,e=e.z;return this.x=n*e-r*t,this.y=r*o-i*e,this.z=i*t-n*o,this},min:function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.z=Math.min(this.z,t.z),this},max:function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this.z=Math.max(this.z,t.z),this},setFromMatrixPosition:function(t){return this.setFromMatrixColumn(t,3)},setFromMatrixScale:function(t){var e=this.setFromMatrixColumn(t,0).length(),i=this.setFromMatrixColumn(t,1).length(),t=this.setFromMatrixColumn(t,2).length();return this.x=e,this.y=i,this.z=t,this},setFromMatrixColumn:function(t,e){return this.fromArray(t.el,4*e)}}),(ca=Gl.Math.Vector2=function(t,e,i){"object"==typeof t&&(t.x!=H?(e=t.y,i=(t=t.x).e):(i=t[2],e=t[1],t=t[0])),this.set(t||0,e||0,i)}).prototype={},ca.prototype.constructor=ca,L.defineProperties(ca.prototype,{width:{get:function(){return this.x},set:function(t){this.x=t}},height:{get:function(){return this.y},set:function(t){this.y=t}}}),ca.prototype.clone=function(){return new ca(this.x,this.y,this.e)},ca.prototype.copy=function(t){return this.set(t.x,t.y,t.e),this},ca.prototype.equals=function(t){return t.x===this.x&&t.y===this.y},ca.prototype.set=function(t,e,i){return this.x=t||0,this.y=e||(0!==e?this.x:0),i!=H&&(this.e=i),this},ca.prototype.setScalar=function(t){return this.x=t,this.y=t,this},ca.prototype.setX=function(t){return this.x=t||0,this},ca.prototype.setY=function(t){return this.y=t||0,this},ca.prototype.add=function(t){return this.x+=t.x,this.y+=t.y,this},ca.prototype.addVectors=function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},ca.prototype.addScalar=function(t){return this.x+=t,this.y+=t,this},ca.prototype.addScaledVector=function(t,e){return this.x+=t.x*e,this.y+=t.y*e,this},ca.prototype.sub=function(t){return this.x-=t.x,this.y-=t.y,this},ca.prototype.subScalar=function(t){return this.x-=t,this.y-=t,this},ca.prototype.subVectors=function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},ca.prototype.multiply=function(t){return this.x*=t.x,this.y*=t.y,this},ca.prototype.multiplyScalar=function(t){return this.x*=t,this.y*=t,this},ca.prototype.divide=function(t){return this.x/=t.x,this.y/=t.y,this},ca.prototype.divideScalar=function(t){return this.multiplyScalar(1/t)},ca.prototype.min=function(t){return this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this},ca.prototype.max=function(t){return this.x=Math.max(this.x,t.x),this.y=Math.max(this.y,t.y),this},ca.prototype.fromArray=function(t,e){return e===H&&(e=0),this.x=t[e],this.y=t[e+1],this},ca.prototype.clamp=function(t,e){return this.x=Math.max(t.x,Math.min(e.x,this.x)),this.y=Math.max(t.y,Math.min(e.y,this.y)),this},ca.prototype.clampScalar=function(t,e){return Jy===H&&(Jy=new ca,$y=new ca),Jy.set(t,t),$y.set(e,e),this.clamp(Jy,$y)},ca.prototype.clampLength=function(t,e){var i=this.length();return this.multiplyScalar(Math.max(t,Math.min(e,i))/i)},ca.prototype.dot=function(t){return this.x*t.x+this.y*t.y},ca.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y},ca.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},ca.prototype.normalize=function(){return this.divideScalar(this.length())},ca.prototype.angle=function(){var t=Math.atan2(this.y,this.x);return t<0&&(t+=2*Math.PI),t},ca.prototype.distanceTo=function(t){return Math.sqrt(this.distanceToSquared(t))},ca.prototype.distanceToSquared=function(t){var e=this.x-t.x,t=this.y-t.y;return e*e+t*t},ca.prototype.isNearEnough=function(t){return this.distanceToSquared(t)<1e-8},ca.prototype.setLength=function(t){var e=this.length();return e?this.multiplyScalar(t/e):this},ca.prototype.lerp=function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},ca.prototype.lerpVectors=function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t)},ca.prototype.rotateAround=function(t,e){var i=t?t.x:0,n=t?t.y:0,r=Math.cos(e),o=Math.sin(e),t=this.x-i,e=this.y-n;return this.x=t*r-e*o+i,this.y=t*o+e*r+n,this},za=Gl.Math.Matrix3=function(){this.el=[1,0,0,0,1,0,0,0,1]},L.assign(za.prototype,{isMatrix3:!0,set:function(t,e,i,n,r,o,a,s,h){var c=this.el;return c[0]=t,c[1]=n,c[2]=a,c[3]=e,c[4]=r,c[5]=s,c[6]=i,c[7]=o,c[8]=h,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},clone:function(){return(new this.constructor).fromArray(this.el)},copy:function(t){var e=this.el,t=t.el;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],this},setFromMatrix4:function(t){t=t.el;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this},applyToBufferAttribute:(Ky=new ha,function(t){for(var e=0,i=t.count;e<i;e++)Ky.x=t.getX(e),Ky.y=t.getY(e),Ky.z=t.getZ(e),Ky.applyMatrix3(this),t.setXYZ(e,Ky.x,Ky.y,Ky.z);return t}),multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.el,n=e.el,r=this.el,o=i[0],a=i[3],s=i[6],h=i[1],c=i[4],l=i[7],u=i[2],d=i[5],f=i[8],g=n[0],p=n[3],_=n[6],v=n[1],y=n[4],t=n[7],e=n[2],i=n[5],n=n[8];return r[0]=o*g+a*v+s*e,r[3]=o*p+a*y+s*i,r[6]=o*_+a*t+s*n,r[1]=h*g+c*v+l*e,r[4]=h*p+c*y+l*i,r[7]=h*_+c*t+l*n,r[2]=u*g+d*v+f*e,r[5]=u*p+d*y+f*i,r[8]=u*_+d*t+f*n,this},multiplyScalar:function(t){var e=this.el;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t=this.el,e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],a=t[5],s=t[6],h=t[7],t=t[8];return e*o*t-e*a*h-i*r*t+i*a*s+n*r*h-n*o*s},getInverse:function(t){var e=t.el,i=this.el,n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=u*s-h*l,f=h*c-u*a,t=l*a-s*c,e=n*d+r*f+o*t;if(0==e)return this.identity();e=1/e;return i[0]=d*e,i[1]=(o*l-u*r)*e,i[2]=(h*r-o*s)*e,i[3]=f*e,i[4]=(u*n-o*c)*e,i[5]=(o*a-h*n)*e,i[6]=t*e,i[7]=(r*c-l*n)*e,i[8]=(s*n-r*a)*e,this},transpose:function(){var t=this.el,e=t[1];return t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this},getNormalMatrix:function(t){return this.setFromMatrix4(t).getInverse(this).transpose()},transposeIntoArray:function(t){var e=this.el;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},setUvTransform:function(t,e,i,n,r,o,a){var s=Math.cos(r),r=Math.sin(r);this.set(i*s,i*r,-i*(s*o+r*a)+o+t,-n*r,n*s,-n*(-r*o+s*a)+a+e,0,0,1)},scale:function(t,e){var i=this.el;return i[0]*=t,i[3]*=t,i[6]*=t,i[1]*=e,i[4]*=e,i[7]*=e,this},rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=this.el,r=n[0],o=n[3],a=n[6],s=n[1],h=n[4],t=n[7];return n[0]=e*r+i*s,n[3]=e*o+i*h,n[6]=e*a+i*t,n[1]=-i*r+e*s,n[4]=-i*o+e*h,n[7]=-i*a+e*t,this},translate:function(t,e){var i=this.el;return i[0]+=t*i[2],i[3]+=t*i[5],i[6]+=t*i[8],i[1]+=e*i[2],i[4]+=e*i[5],i[7]+=e*i[8],this},equals:function(t){for(var e=this.el,i=t.el,n=0;n<9;n++)if(e[n]!==i[n])return!1;return!0},fromArray:function(t,e){e===H&&(e=0);for(var i=0;i<9;i++)this.el[i]=t[i+e];return this},toArray:function(t,e){t===H&&(t=[]),e===H&&(e=0);var i=this.el;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t}}),la=Gl.Math.Plane=function(t,e){this.normal=t!==H?t:new ha(1,0,0),this.constant=e!==H?e:0},L.assign(la.prototype,{set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,n){return this.normal.set(t,e,i),this.constant=n,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:(Yy=new ha,Zy=new ha,function(t,e,i){e=Yy.subVectors(i,e).cross(Zy.subVectors(t,e)).normalize();return this.setFromNormalAndCoplanarPoint(e,t),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return e===H&&(e=new ha),e.copy(this.normal).multiplyScalar(-this.distanceToPoint(t)).add(t)},intersectLine:(Qy=new ha,function(t,e){e===H&&(e=new ha);var i=t.delta(Qy),n=this.normal.dot(i);if(0===n)return 0===this.distanceToPoint(t.start)?e.copy(t.start):H;n=-(t.start.dot(this.normal)+this.constant)/n;return n<0||1<n?H:e.copy(i).multiplyScalar(n).add(t.start)}),intersectsLine:function(t){var e=this.distanceToPoint(t.start),t=this.distanceToPoint(t.end);return e<0&&0<t||t<0&&0<e},intersectsBox:function(t){return t.intersectsPlane(this)},intersectsSphere:function(t){return t.intersectsPlane(this)},coplanarPoint:function(t){return t===H&&(t=new ha),t.copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:(qy=new ha,Xy=new za,function(t,e){e=e||Xy.getNormalMatrix(t),t=this.coplanarPoint(qy).applyMatrix4(t),e=this.normal.applyMatrix3(e).normalize();return this.constant=-t.dot(e),this}),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant===this.constant}}),ua=Gl.Math.Ray=function(t,e){this.origin=t!==H?t.clone():new ha,this.direction=e!==H?e.clone():new ha},L.assign(ua.prototype,{set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this.maxHitLen=t.maxHitLen,this},at:function(t,e){return(e||new ha).copy(this.direction).multiplyScalar(t).add(this.origin)},setMaxHitLength:function(t){this.maxHitLen=t},lookAt:function(t){return this.direction.copy(t).sub(this.origin).normalize(),this},applyMatrix4:function(t){var e,i=this.maxHitLen;return i&&(e=this.direction.clone().multiplyScalar(i).add(this.origin)).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.transformDirection(t),i&&(this.maxHitLen=this.origin.distanceTo(e)),this},intersectSphere:(Wy=new ha,function(t,e){Wy.subVectors(t.center,this.origin);var i=Wy.dot(this.direction),n=Wy.dot(Wy)-i*i,t=t.radius*t.radius;if(t<n)return null;t=Math.sqrt(t-n),n=i-t,t=i+t;return n<0&&t<0?null:n<0?this.at(t,e):this.at(n,e)}),intersectEllipsoid:(Gy=new ha,Hy=new ha,function(t,e){Gy.subVectors(t.center,this.origin),Gy.divide(t.radius),Hy.divideVectors(this.direction,t.radius);var i=Hy.lengthSq(),n=Gy.dot(Hy),r=Gy.dot(Gy)*i-n*n;if(i<r)return null;t=Math.sqrt(i-r),r=(n-t)/i,i=(n+t)/i;return r<0&&i<0?null:r<0?this.at(i,e):this.at(r,e)}),intersectBox:function(t,e){var i,n,r=1/this.direction.x,o=1/this.direction.y,a=1/this.direction.z,s=this.origin,r=0<=r?(h=(t.min.x-s.x)*r,(t.max.x-s.x)*r):(h=(t.max.x-s.x)*r,(t.min.x-s.x)*r),o=0<=o?(i=(t.min.y-s.y)*o,(t.max.y-s.y)*o):(i=(t.max.y-s.y)*o,(t.min.y-s.y)*o);if(o<h||r<i)return null;if((h<i||h!=h)&&(h=i),(o<r||r!=r)&&(r=o),(a=0<=a?(n=(t.min.z-s.z)*a,(t.max.z-s.z)*a):(n=(t.max.z-s.z)*a,(t.min.z-s.z)*a))<h||r<n)return null;if((h<n||h!=h)&&(h=n),(a<r||r!=r)&&(r=a),r<0)return null;var h=0<=h?h:r,r=this.maxHitLen;return r&&r<h?null:this.at(h,e)},intersectTriangle:(ky=new ha,jy=new ha,Ny=new ha,Uy=new ha,function(t,e,i,n,r){jy.subVectors(e,t),Ny.subVectors(i,t),Uy.crossVectors(jy,Ny);i=this.direction.dot(Uy);if(0<i){if(n)return null;o=1}else{if(!(i<0))return null;o=-1,i=-i}ky.subVectors(this.origin,t);n=o*this.direction.dot(Ny.crossVectors(ky,Ny));if(n<0)return null;t=o*this.direction.dot(jy.cross(ky));if(t<0||i<n+t)return null;var o=-o*ky.dot(Uy);if(o<0)return null;o/=i,i=this.maxHitLen;return i&&i<o?null:this.at(o,r)})}),da=Gl.Math.Box3=function(t,e){this.min=t!==H?t:new ha(1/0,1/0,1/0),this.max=e!==H?e:new ha(-1/0,-1/0,-1/0)},L.assign(da.prototype,{set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromArray:function(t){for(var e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,a=-1/0,s=0,h=t.length;s<h;s+=3){var c=t[s],l=t[s+1],u=t[s+2];c<e&&(e=c),l<i&&(i=l),u<n&&(n=u),r<c&&(r=c),o<l&&(o=l),a<u&&(a=u)}return this.min.set(e,i,n),this.max.set(r,o,a),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},clone:function(){return(new this.constructor).copy(this)},intersectsBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},isEmpty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByBox:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:(Fy=[new ha,new ha,new ha,new ha,new ha,new ha,new ha,new ha],function(t){return this.isEmpty()||(Fy[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),Fy[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),Fy[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),Fy[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),Fy[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),Fy[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),Fy[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),Fy[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.setFromPoints(Fy)),this})}),Va=Gl.Math.Sphere=function(t,e){this.center=t!==H?t:new ha,this.radius=e!==H?e:0},L.assign(Va.prototype,{set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:(Ly=new da,function(t,e){var i=this.center;e!==H?i.copy(e):Ly.setFromPoints(t).getCenter(i);for(var n=0,r=0,o=t.length;r<o;r++)n=Math.max(n,i.distanceToSquared(t[r]));return this.radius=Math.sqrt(n),this}),clone:function(){return(new this.constructor).copy(this)},copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},intersectsBox:function(t){return t.intersectsSphere(this)},intersectsPlane:function(t){return Math.abs(t.distanceToPoint(this.center))<=this.radius},clampPoint:function(t,e){var i=this.center.distanceToSquared(t);return e===H&&(e=new ha),e.copy(t),i>this.radius*this.radius&&(e.sub(this.center).normalize(),e.multiplyScalar(this.radius).add(this.center)),e},getBoundingBox:function(t){return t===H&&(t=new da),t.set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius=this.radius*t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius}}),Ag=Gl.Math.Frustum=function(t,e,i,n,r,o){this.planes=[t!==H?t:new la,e!==H?e:new la,i!==H?i:new la,n!==H?n:new la,r!==H?r:new la,o!==H?o:new la]},L.assign(Ag.prototype,{set:function(t,e,i,n,r,o){var a=this.planes;return a[0].copy(t),a[1].copy(e),a[2].copy(i),a[3].copy(n),a[4].copy(r),a[5].copy(o),this},clone:function(){return(new this.constructor).copy(this)},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes,i=t.el,n=i[0],r=i[1],o=i[2],a=i[3],s=i[4],h=i[5],c=i[6],l=i[7],u=i[8],d=i[9],f=i[10],g=i[11],p=i[12],_=i[13],t=i[14],i=i[15];return e[0].setComponents(a-n,l-s,g-u,i-p).normalize(),e[1].setComponents(a+n,l+s,g+u,i+p).normalize(),e[2].setComponents(a+r,l+h,g+d,i+_).normalize(),e[3].setComponents(a-r,l-h,g-d,i-_).normalize(),e[4].setComponents(a-o,l-c,g-f,i-t).normalize(),e[5].setComponents(a+o,l+c,g+f,i+t).normalize(),this},intersectsObject:(Vy=new Va,function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),Vy.copy(e.boundingSphere).applyMatrix4(t.matrixWorld),this.intersectsSphere(Vy)}),intersectsSprite:(zy=new Va,function(t){return zy.center.set(0,0,0),zy.radius=.7071067811865476,zy.applyMatrix4(t.matrixWorld),this.intersectsSphere(zy)}),intersectsSphere:function(t){for(var e=this.planes,i=t.center,n=-t.radius,r=0;r<6;r++)if(e[r].distanceToPoint(i)<n)return!1;return!0},intersectsBox:(By=new ha,function(t){for(var e=this.planes,i=0;i<6;i++){var n=e[i];if(By.x=(0<n.normal.x?t.max:t.min).x,By.y=(0<n.normal.y?t.max:t.min).y,By.z=(0<n.normal.z?t.max:t.min).z,n.distanceToPoint(By)<0)return!1}return!0}),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0}}),fa=Gl.Math.Matrix4=function(){this.el=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},L.assign(fa.prototype,{set:function(t,e,i,n,r,o,a,s,h,c,l,u,d,f,g,p){var _=this.el;return _[0]=t,_[4]=e,_[8]=i,_[12]=n,_[1]=r,_[5]=o,_[9]=a,_[13]=s,_[2]=h,_[6]=c,_[10]=l,_[14]=u,_[3]=d,_[7]=f,_[11]=g,_[15]=p,this},clone:function(){return(new fa).fromArray(this.el)},fromArray:function(t,e){e===H&&(e=0);for(var i=this.el,n=0;n<16;n++)i[n]=t[n+e];return this},getElements:function(){return this.el},scale:function(t){var e=this.el,i=t.x,n=t.y,t=t.z;return e[0]*=i,e[4]*=n,e[8]*=t,e[1]*=i,e[5]*=n,e[9]*=t,e[2]*=i,e[6]*=n,e[10]*=t,e[3]*=i,e[7]*=n,e[11]*=t,this},makeRotationFromEuler:function(t){var e,i,n,r,o,a,s,h,c,l,u,d,f=this.el,g=t._x,p=t._y,_=t._z,v=t._order,y=Math.cos(g),m=Math.sin(g),t=Math.cos(p),g=Math.sin(p),p=Math.cos(_),_=Math.sin(_);return"XYZ"===v?(o=y*p,a=y*_,s=m*p,h=m*_,f[0]=t*p,f[4]=-t*_,f[8]=g,f[1]=a+s*g,f[5]=o-h*g,f[9]=-m*t,f[2]=h-o*g,f[6]=s+a*g,f[10]=y*t):"YXZ"===v?(e=t*p,i=t*_,n=g*p,r=g*_,f[0]=e+r*m,f[4]=n*m-i,f[8]=y*g,f[1]=y*_,f[5]=y*p,f[9]=-m,f[2]=i*m-n,f[6]=r+e*m,f[10]=y*t):"ZXY"===v?(e=t*p,i=t*_,n=g*p,r=g*_,f[0]=e-r*m,f[4]=-y*_,f[8]=n+i*m,f[1]=i+n*m,f[5]=y*p,f[9]=r-e*m,f[2]=-y*g,f[6]=m,f[10]=y*t):"ZYX"===v?(o=y*p,a=y*_,s=m*p,h=m*_,f[0]=t*p,f[4]=s*g-a,f[8]=o*g+h,f[1]=t*_,f[5]=h*g+o,f[9]=a*g-s,f[2]=-g,f[6]=m*t,f[10]=y*t):"YZX"===v?(c=y*t,l=y*g,u=m*t,d=m*g,f[0]=t*p,f[4]=d-c*_,f[8]=u*_+l,f[1]=_,f[5]=y*p,f[9]=-m*p,f[2]=-g*p,f[6]=l*_+u,f[10]=c-d*_):"XZY"===v&&(c=y*t,l=y*g,u=m*t,d=m*g,f[0]=t*p,f[4]=-_,f[8]=g*p,f[1]=c*_+d,f[5]=y*p,f[9]=l*_-u,f[2]=u*_-l,f[6]=m*p,f[10]=d*_+c),f[3]=0,f[7]=0,f[11]=0,f[12]=0,f[13]=0,f[14]=0,f[15]=1,this},makeRotationFromQuaternion:function(t){var e=this.el,i=t._x,n=t._y,r=t._z,o=t._w,a=i+i,s=n+n,h=r+r,c=i*a,l=i*s,t=i*h,i=n*s,n=n*h,r=r*h,a=o*a,s=o*s,h=o*h;return e[0]=1-(i+r),e[4]=l-h,e[8]=t+s,e[1]=l+h,e[5]=1-(c+r),e[9]=n-a,e[2]=t-s,e[6]=n+a,e[10]=1-(c+i),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},getInverse:function(t){var e=this.el,i=t.el,n=i[0],r=i[1],o=i[2],a=i[3],s=i[4],h=i[5],c=i[6],l=i[7],u=i[8],d=i[9],f=i[10],g=i[11],p=i[12],_=i[13],v=i[14],y=i[15],m=d*v*l-_*f*l+_*c*g-h*v*g-d*c*y+h*f*y,b=p*f*l-u*v*l-p*c*g+s*v*g+u*c*y-s*f*y,x=u*_*l-p*d*l+p*h*g-s*_*g-u*h*y+s*d*y,t=p*d*c-u*_*c-p*h*f+s*_*f+u*h*v-s*d*v,i=n*m+r*b+o*x+a*t;if(0==i)return this.identity();i=1/i;return e[0]=m*i,e[1]=(_*f*a-d*v*a-_*o*g+r*v*g+d*o*y-r*f*y)*i,e[2]=(h*v*a-_*c*a+_*o*l-r*v*l-h*o*y+r*c*y)*i,e[3]=(d*c*a-h*f*a-d*o*l+r*f*l+h*o*g-r*c*g)*i,e[4]=b*i,e[5]=(u*v*a-p*f*a+p*o*g-n*v*g-u*o*y+n*f*y)*i,e[6]=(p*c*a-s*v*a-p*o*l+n*v*l+s*o*y-n*c*y)*i,e[7]=(s*f*a-u*c*a+u*o*l-n*f*l-s*o*g+n*c*g)*i,e[8]=x*i,e[9]=(p*d*a-u*_*a-p*r*g+n*_*g+u*r*y-n*d*y)*i,e[10]=(s*_*a-p*h*a+p*r*l-n*_*l-s*r*y+n*h*y)*i,e[11]=(u*h*a-s*d*a-u*r*l+n*d*l+s*r*g-n*h*g)*i,e[12]=t*i,e[13]=(u*_*o-p*d*o+p*r*f-n*_*f-u*r*v+n*d*v)*i,e[14]=(p*h*o-s*_*o-p*r*c+n*_*c+s*r*v-n*h*v)*i,e[15]=(s*d*o-u*h*o+u*r*c-n*d*c-s*r*f+n*h*f)*i,this},makeRotationAxis:function(t,e){var i=Math.cos(e),n=Math.sin(e),r=1-i,o=t.x,a=t.y,s=t.z,e=r*o,t=r*a;return this.set(e*o+i,e*a-n*s,e*s+n*a,0,e*a+n*s,t*a+i,t*s-n*o,0,e*s-n*a,t*s+n*o,r*s*s+i,0,0,0,0,1),this},multiply:function(t){return this.multiplyMatrices(this,t)},premultiply:function(t){return this.multiplyMatrices(t,this)},multiplyMatrices:function(t,e){var i=t.el,n=e.el,r=this.el,o=i[0],a=i[4],s=i[8],h=i[12],c=i[1],l=i[5],u=i[9],d=i[13],f=i[2],g=i[6],p=i[10],_=i[14],v=i[3],y=i[7],m=i[11],b=i[15],x=n[0],w=n[4],E=n[8],T=n[12],S=n[1],I=n[5],C=n[9],M=n[13],R=n[2],A=n[6],P=n[10],D=n[14],t=n[3],e=n[7],i=n[11],n=n[15];return r[0]=o*x+a*S+s*R+h*t,r[4]=o*w+a*I+s*A+h*e,r[8]=o*E+a*C+s*P+h*i,r[12]=o*T+a*M+s*D+h*n,r[1]=c*x+l*S+u*R+d*t,r[5]=c*w+l*I+u*A+d*e,r[9]=c*E+l*C+u*P+d*i,r[13]=c*T+l*M+u*D+d*n,r[2]=f*x+g*S+p*R+_*t,r[6]=f*w+g*I+p*A+_*e,r[10]=f*E+g*C+p*P+_*i,r[14]=f*T+g*M+p*D+_*n,r[3]=v*x+y*S+m*R+b*t,r[7]=v*w+y*I+m*A+b*e,r[11]=v*E+y*C+m*P+b*i,r[15]=v*T+y*M+m*D+b*n,this},lookAt:(Py=new ha,Dy=new ha,Oy=new ha,function(t,e,i){var n=this.el;return Oy.subVectors(t,e),0===Oy.lengthSq()&&(Oy.z=1),Oy.normalize(),Py.crossVectors(i,Oy),0===Py.lengthSq()&&(1===Math.abs(i.z)?Oy.x+=1e-4:Oy.z+=1e-4,Oy.normalize(),Py.crossVectors(i,Oy)),Py.normalize(),Dy.crossVectors(Oy,Py),n[0]=Py.x,n[4]=Dy.x,n[8]=Oy.x,n[1]=Py.y,n[5]=Dy.y,n[9]=Oy.y,n[2]=Py.z,n[6]=Dy.z,n[10]=Oy.z,this}),extractScale:function(t){Ay===H&&(Ay=new ha),t===H&&(t=new ha);var e=Ay.setFromMatrixColumn(this,0).length(),i=Ay.setFromMatrixColumn(this,1).length(),n=Ay.setFromMatrixColumn(this,2).length();return t.set(e,i,n),t},extractRotation:function(t){Ry===H&&(Ry=new ha),t===H&&(t=new fa);var e=this.el,i=t.el,n=1/Ry.setFromMatrixColumn(t,0).length(),r=1/Ry.setFromMatrixColumn(t,1).length(),t=1/Ry.setFromMatrixColumn(t,2).length();return e[0]=i[0]*n,e[1]=i[1]*n,e[2]=i[2]*n,e[4]=i[4]*r,e[5]=i[5]*r,e[6]=i[6]*r,e[8]=i[8]*t,e[9]=i[9]*t,e[10]=i[10]*t,this},multiplyScalar:function(t){var e=this.el;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},getPosition:function(t){return t===H&&(t=new ha),t.setFromMatrixColumn(this,3)},setPosition:function(t){var e=this.el;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},toArray:function(t,e){t===H&&(t=[]),e===H&&(e=0);var i=this.el;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t},determinant:function(){var t=this.el,e=t[0],i=t[4],n=t[8],r=t[12],o=t[1],a=t[5],s=t[9],h=t[13],c=t[2],l=t[6],u=t[10],d=t[14];return t[3]*(+r*s*l-n*h*l-r*a*u+i*h*u+n*a*d-i*s*d)+t[7]*(+e*s*d-e*h*u+r*o*u-n*o*d+n*h*c-r*s*c)+t[11]*(+e*h*l-e*a*d-r*o*l+i*o*d+r*a*c-i*h*c)+t[15]*(-n*a*c-e*s*l+e*a*u+n*o*l-i*o*u+i*s*c)},copy:function(t){var e=this.el,t=t.el;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],this},compose:function(t,e,i){var n=this.el,r=e._x,o=e._y,a=e._z,s=e._w,h=r+r,c=o+o,l=a+a,u=r*h,d=r*c,f=r*l,e=o*c,r=o*l,o=a*l,a=s*h,h=s*c,c=s*l,s=i.x,l=i.y,i=i.z;return n[0]=(1-(e+o))*s,n[1]=(d+c)*s,n[2]=(f-h)*s,n[3]=0,n[4]=(d-c)*l,n[5]=(1-(u+o))*l,n[6]=(r+a)*l,n[7]=0,n[8]=(f+h)*i,n[9]=(r-a)*i,n[10]=(1-(u+e))*i,n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,this},decompose:(Cy=new ha,My=new fa,function(t,e,i){var n=this.el,r=Cy.set(n[0],n[1],n[2]).length(),o=Cy.set(n[4],n[5],n[6]).length(),a=Cy.set(n[8],n[9],n[10]).length();this.determinant()<0&&(r=-r),t.x=n[12],t.y=n[13],t.z=n[14],My.copy(this);var s=1/r,t=1/o,n=1/a;return My.el[0]*=s,My.el[1]*=s,My.el[2]*=s,My.el[4]*=t,My.el[5]*=t,My.el[6]*=t,My.el[8]*=n,My.el[9]*=n,My.el[10]*=n,e.setFromRotationMatrix(My),i.x=r,i.y=o,i.z=a,this})}),ga=Gl.Math.Triangle=function(t,e,i){this.a=t!==H?t:new ha,this.b=e!==H?e:new ha,this.c=i!==H?i:new ha},L.assign(ga,{barycoordFromPoint:(Ty=new ha,Sy=new ha,Iy=new ha,function(t,e,i,n,r){Ty.subVectors(n,e),Sy.subVectors(i,e),Iy.subVectors(t,e);var o=Ty.dot(Ty),a=Ty.dot(Sy),n=Ty.dot(Iy),i=Sy.dot(Sy),t=Sy.dot(Iy),e=o*i-a*a,r=r||new ha;if(0==e)return r.set(-2,-1,-1);e=1/e,i=(i*n-a*t)*e,e*=o*t-a*n;return r.set(1-i-e,e,i)})}),(pa=Gl.Math.Euler=function(t,e,i,n,r){this.set(t,e,i,n,r)}).RotationOrders=["XYZ","YZX","ZXY","XZY","YXZ","ZYX"],pa.DefaultOrder="XYZ",pa.ReverseOrder=function(t){return(t=t[2]+t[1]+t[0]).toUpperCase()},L.defineProperties(pa.prototype,{x:{get:function(){return this._x},set:function(t){this._x=t,this.onChangeCallback()}},y:{get:function(){return this._y},set:function(t){this._y=t,this.onChangeCallback()}},z:{get:function(){return this._z},set:function(t){this._z=t,this.onChangeCallback()}},order:{get:function(){return this._order},set:function(t){this._order=t,this.onChangeCallback()}}}),L.assign(pa.prototype,{set:function(t,e,i,n,r){return bn(t)&&(r=i,n=e,i=t[2],e=t[1],t=t[0]),n?r&&(n=pa.ReverseOrder(n)):n="ZYX",this._x=t||0,this._y=e||0,this._z=i||0,this._order=n||this._order,this.onChangeCallback(),this},clone:function(){return new this.constructor(this._x,this._y,this._z,this._order)},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var n=Gl.Math.clamp,r=t.el||t,o=r[0],a=r[4],s=r[8],h=r[1],c=r[5],l=r[9],u=r[2],t=r[6],r=r[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(n(s,-1,1)),Math.abs(s)<.99999?(this._x=Math.atan2(-l,r),this._z=Math.atan2(-a,o)):(this._x=Math.atan2(t,c),this._z=0)):"YXZ"===e?(this._x=Math.asin(-n(l,-1,1)),Math.abs(l)<.99999?(this._y=Math.atan2(s,r),this._z=Math.atan2(h,c)):(this._y=Math.atan2(-u,o),this._z=0)):"ZXY"===e?(this._x=Math.asin(n(t,-1,1)),Math.abs(t)<.99999?(this._y=Math.atan2(-u,r),this._z=Math.atan2(-a,c)):(this._y=0,this._z=Math.atan2(h,o))):"ZYX"===e?(this._y=Math.asin(-n(u,-1,1)),Math.abs(u)<.99999?(this._x=Math.atan2(t,r),this._z=Math.atan2(h,o)):(this._x=0,this._z=Math.atan2(-a,c))):"YZX"===e?(this._z=Math.asin(n(h,-1,1)),Math.abs(h)<.99999?(this._x=Math.atan2(-l,c),this._y=Math.atan2(-u,o)):(this._x=0,this._y=Math.atan2(s,r))):"XZY"===e?(this._z=Math.asin(-n(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(t,c),this._y=Math.atan2(s,o)):(this._x=Math.atan2(-l,r),this._y=0)):console.warn("unsupported order: "+e),this._order=e,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:(Ey=new fa,function(t,e,i){return Ey.makeRotationFromQuaternion(t),this.setFromRotationMatrix(Ey,e,i)}),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:(wy=new aa,function(t){return wy.setFromEuler(this),this.setFromQuaternion(wy,t)}),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],t[3]!==H&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return t===H&&(t=[]),e===H&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new ha(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){}}),_a={ms_ac:function(t,e){for(var i=e.ms_ac,n=0;n<i.length;n++)!function(t,i){var n="_"+i;t[fn(i)]=function(){return this[n]},t[gn(i)]=function(t){var e=this[n];this[n]=t,this.fp(i,e,t)}}(t,i[n])},ms_listener:function(t){t.addListeners=function(){var e=this,t=yi;G.mockTouch&&(t=pi.concat(_i).concat(vi));for(var i=0,n=(e.__events__=t).length;i<n;i++){var r=t[i];"wheel"===r&&!e.handle_wheel&&e.handle_mousewheel&&(e.handle_wheel=function(t){Pn(e,t)}),e["handle_"+r]&&Zn(r,e.getView(),e)}},t.removeListeners=function(){var t,e,i,n,r,o=this,a=o.__events__;if(a){o.__events__=H;for(var s=0,h=a.length;s<h;s++)o["handle_"+a[s]]&&(t=a[s],e=o.getView(),r=n=void 0,(r=(i=o)[n="__"+t])&&(p(e,t,r),delete i[n]))}}},ms_fire:function(t){t.mp=function(t,e,i){this.addPropertyChangeListener(t,e,i)},t.ump=function(t,e){this.removePropertyChangeListener(t,e)},t.fp=function(t,e,i,n,r){return this.firePropertyChange(t,e,i,n,r)},t.addPropertyChangeListener=function(t,e,i){this._62I||(this._62I=new kh),this._62I.add(t,e,i)},t.removePropertyChangeListener=function(t,e){this._62I&&this._62I.remove(t,e)},t.firePropertyChange=function(t,e,i,n,r){if(n){if(n(e,i))return!1}else if(e===i)return!1;n=this,r=r||{};return r.property=t,r.oldValue=e,r.newValue=i,r.source=n,(r.data=n)._62I&&n._62I.fire(r),n.onPropertyChanged&&n.onPropertyChanged(r),!0}},ms_attr:function(t){t.a=function(t,e){if(2===arguments.length)this.setAttr(t,e);else{if(!yn(t))return this.getAttr(t);for(var i in t)this.setAttr(i,t[i])}return this},t.getAttr=function(t,e){if(e===H&&(e=1),this._attrObject&&t in this._attrObject)return this._attrObject[t];if(this.getImage){var i=this.getImage();if(pn(i)&&(i=Oi[i]),yn(i)&&"dataBindings"in i)for(var n=i.dataBindings,r=n.length-1;0<=r;r--){var o=n[r];if(o.attr===t){if("defaultValue"in o)return o.defaultValue;break}}}return e?a[t]:H},t.setAttr=function(t,e){var i=this;i._attrObject||(i._attrObject={});var n=i._attrObject[t];e===H?delete i._attrObject[t]:i._attrObject[t]=e,i.fp&&i.fp("a:"+t,n,e)&&i.onAttrChanged&&i.onAttrChanged(t,n,e)},t.getSerializableAttrs=function(){var t,e={};for(t in this._attrObject)e[t]=1;return e}},ms_bnb:function(t){t.getBodyColor=function(t){return t.s("body.color")},t.getBorderColor=function(t){return t.s("border.color")}},_51o:function(t){t.mi=function(t,e,i){this.addInteractorListener(t,e,i)},t.umi=function(t,e){this.removeInteractorListener(t,e)},t.fi=function(t){this.fireInteractorEvent(t)},t.addInteractorListener=function(t,e,i){this._63I||(this._63I=new kh),this._63I.add(t,e,i)},t.removeInteractorListener=function(t,e){this._63I&&this._63I.remove(t,e)},t.fireInteractorEvent=function(t){this._63I&&this._63I.fire(t)},t.setInteractors=function(t){var e=this._interactors;e&&e.each(function(t){t.tearDown()}),bn(t)&&(t=new Lh(t)),(this._interactors=t)&&t.each(function(t){t.setUp()}),this.fp("interactors",e,t),this.invalidateSelection()},t.getInteractors=function(){return this._interactors}},_49o:function(t){t._44O=U,t._45O=U,t.getTopPainters=function(){return this._44O},t.getBottomPainters=function(){return this._45O},t.addTopPainter=function(t){var e=this;e._44O||(e._44O=new Lh),e._44O.contains(t)||(e._44O.add(t),e.redraw&&e.redraw())},t.removeTopPainter=function(t){this._44O&&(this._44O.remove(t),this.redraw&&this.redraw())},t.addBottomPainter=function(t){var e=this;e._45O||(e._45O=new Lh),e._45O.contains(t)||(e._45O.add(t),e.redraw&&e.redraw())},t.removeBottomPainter=function(t){this._45O&&(this._45O.remove(t),this.redraw&&this.redraw())},t._93db=function(e,i){var n=this;n._45O&&n._45O.each(function(t){t.draw?t.draw(e,i):t.call(n,e,i)})},t._92db=function(e,i){var n=this;n._44O&&n._44O.each(function(t){t.draw?t.draw(e,i):t.call(n,e,i)})}},ms_sm:function(t){t.sm=function(){return this.getSelectionModel()},t.setSelectableFunc=function(t){this.sm().setFilterFunc(t)},t.getSelectableFunc=function(){return this.sm().getFilterFunc()},t.getSelectionModel=function(){return this._selectionModel||this.dm().sm()},t.isSelectionModelShared=function(){return!this._selectionModel},t.setSelectionModelShared=function(t){var e=this,i=!e._selectionModel,n=e.handleSelectionChange,r=e.dm();i!==t&&(e.invalidateSelection&&e.invalidateSelection(),t?(r.sm().ms(n,e),e._selectionModel.ums(n,e),e._selectionModel.dispose(),e._selectionModel=U):(r.sm().ums(n,e),e._selectionModel=new Uh(r),e._selectionModel.ms(n,e)),e.onSelectionModelSharedChanged(),e.fp("selectionModelShared",i,t))},t.onSelectionModelSharedChanged=function(){this.redraw(),this.invalidateSelection&&this.invalidateSelection()},t.removeSelection=function(){var t=this.dm();t.beginTransaction(),this.sm().toSelection().each(t.remove,t),t.endTransaction()},t.selectAll=function(){var e=this;e.sm().ss(e.dm().toDatas(function(t){return e.isVisible(t)&&e.isSelectable(t)}))},t.isSelected=function(t){return this.sm().co(t)},t.isSelectedById=function(t){t=this.dm().getDataById(t);return!!t&&this.isSelected(t)},t.isSelectable=function(t){return this.sm().isSelectable(t)}},ms_tx:function(t){t._64I=0,t._65O=0,t.isScrollable=function(){return this.getWidth()<this._64I},t._40o=function(){return this.isScrollable()},t.getLogicalPoint=function(t){return Cs(t,this._canvas||this._view,this.tx(),this.ty?this.ty():0)},t.tx=function(t){return t===H?this.getTranslateX():void this.setTranslateX(t)},t.getTranslateX=function(){return this._65O},t.setTranslateX=function(t){var e=this,i=e.getWidth()-e._64I;t<i&&(t=i),0<t&&(t=0),t=S(t);i=e._65O;e._65O=t,e.fp(Pe,i,t)}},ms_ty:function(t){t._23Q=0,t._66O=0,t._41o=function(){return this.getHeight()<this._23Q},t.getLogicalPoint=function(t){return Cs(t,this._canvas||this._view,this.tx?this.tx():0,this.ty())},t.ty=function(t){return t===H?this.getTranslateY():void this.setTranslateY(t)},t.getTranslateY=function(){return this._66O},t.setTranslateY=function(t){var e=this,i=e.getHeight()-e._23Q;t<i&&(t=i),0<t&&(t=0),t=S(t);i=e._66O;e._66O=t,e.fp(De,i,t)}},ms_txy:function(t){t._65O=0,t._66O=0,t.tx=function(t){return t===H?this.getTranslateX():void this.setTranslateX(t)},t.ty=function(t){return t===H?this.getTranslateY():void this.setTranslateY(t)},t.onTranslateEnded=function(){},t.setTranslate=function(e,i,t){var n,r,o=this;(t=Rn(t))?(o._65I&&o._65I.stop(!0),n=o.tx(),r=o.ty(),t.action=function(t){o.setTranslate(n+(e-n)*t,r+(i-r)*t)},t._37o=function(){delete o._66I,delete o._65I,o.onTranslateEnded()},o._66I=1,o._65I=rs(t)):(o.tx(e),o.ty(i))},t.getTranslateX=function(){return this._65O},t.setTranslateX=function(t){t=this.adjustTranslateX(t);var e=this._65O;this._65O=t,this.fp(Pe,e,t)},t.getTranslateY=function(){return this._66O},t.setTranslateY=function(t){t=this.adjustTranslateY(t);var e=this._66O;this._66O=t,this.fp(De,e,t)},t.adjustTranslateX=function(t){return S(t)},t.adjustTranslateY=function(t){return S(t)},t.translate=function(t,e,i){this.setTranslate(this.tx()+t,this.ty()+e,i)},t.getLogicalPoint=function(t){return Cs(t,this._canvas||this._view,this.tx(),this.ty())}},ms_dm:function(t){t.dm=function(t){return t?void this.setDataModel(t):this.getDataModel()},t.getDataModel=function(){return this._dataModel}},ms_lp:function(t){t.lp=function(t){return this.getLogicalPoint(t)}},ms_v:function(t){t._disabled=!1,t.setDisabled=function(t,e){var i=this._disabled;i!==t&&(i&&(As(this._63O),delete this._63O),t&&(or(this._view,this._63O=dr(e)),this.iv()),this._disabled=t,this.fp("disabled",i,t))},t.isDisabled=function(){return this._disabled},t.getDisabledDiv=function(){return this._63O},t.getView=function(){return this._view},t.addToDOM=function(t){var e=this,i=e.getView(),n=i.style;(t=t||d.body).appendChild(i),n.left="0",n.right="0",n.top="0",n.bottom="0",g(C,"resize",function(){e.iv()}),e.iv()},t.getWidth=function(){return this._view.clientWidth},t.getHeight=function(){return this._view.clientHeight},t.setWidth=function(t){this._view.style.width=t+vt,this.iv(),this.fp&&this.fp(Rt,U,t)},t.setHeight=function(t){this._view.style.height=t+vt,this.iv(),this.fp&&this.fp(At,U,t)},t.setFocus=function(t){var e=this._currentEditor;return!(t&&e&&(e.getView&&(e=e.getView()),e.contains(t.target)))&&(br(this._view),this.endEditing&&this.endEditing(),this.fireViewEvent("focus"),!0)},t.iv=function(t){this.invalidate(t)},t.invalidate=function(t){this._68I||(this._68I=1,$a(this.validate,this,U,t),this.onInvalidated&&this.onInvalidated(),this.fireViewEvent("invalidate"))},t.validate=function(){var t,e=this,i=e._view;e._68I&&(delete e._68I,i.parentNode)&&(0===i.offsetWidth&&0===i.offsetHeight&&e._67I!==U?(e._67I===H&&(e._67I=G.reinvalidateCount),0<e._67I?e._67I--:e._67I=U,e.iv()):(e.fireViewEvent("beginValidate"),e.validateImpl(),e.onValidated&&e.onValidated(),e.fireViewEvent("validate"),(t=e._63O)&&(i.lastChild!==t&&(As(t),or(i,t)),wr(t,0,0,e.getWidth(),e.getHeight())),rn(e),hh(e),df(e)))},t.layout=function(t,e,i,n){1===arguments.length?wr(this,t):wr(this,t,e,i,n)},t.addViewListener=function(t,e,i){this._67O||(this._67O=new kh),this._67O.add(t,e,i)},t.removeViewListener=function(t,e){this._67O.remove(t,e)},t.fireViewEvent=function(t){this._67O&&(pn(t)&&(t={kind:t}),this._67O.fire(t)),G.viewListener&&G.viewListener(this,t)}},ms_tip:function(t){t.setToolTipEnabled=function(t){t?et||this._13o||(this.enableToolTip(),this.fp("toolTipEnabled",!1,!0)):this._13o&&(this.disableToolTip(),this.fp("toolTipEnabled",!0,!1))},t.isToolTipEnabled=function(){return!!this._13o},t.enableToolTip=function(){var t,i=this;et||i._13o||(i._13o=function(t){var e=i.getToolTip(t);e!=U?G.toolTipContinual&&G.isToolTipShowing()?Ea(t,e):(Ta(),xi={timeout:w(Ti,ya),e:t,info:e}):Ta()},t=i.getView(),g(t,ai,i._13o),g(t,"mouseleave",G.hideToolTip))},t.disableToolTip=function(){var t;this._13o&&(t=this.getView(),p(t,ai,this._13o),p(t,"mouseleave",G.hideToolTip),delete this._13o)},t.getToolTip=function(t){if(this.getDataAt){t=this.getDataAt(t);return t?t.getToolTip():U}return this.getValue?this.getValue():void 0}},_52o:function(t){t._zoom=1,t._29I=Ji,t.zoomIn=function(t,e){this.setZoom(this._zoom*ja,t,e)},t.zoomOut=function(t,e){this.setZoom(this._zoom/ja,t,e)},t.zoomReset=function(t,e){this.setZoom(1,t,e)},t.scrollZoomIn=function(t){this.setZoom(this._zoom*Na,U,t)},t.scrollZoomOut=function(t){this.setZoom(this._zoom/Na,U,t)},t.pinchZoomIn=function(t){this.setZoom(this._zoom*Ua,U,t)},t.pinchZoomOut=function(t){this.setZoom(this._zoom/Ua,U,t)},t.adjustZoom=function(t){return t<Ha?Ha:Ga<t?Ga:t},t.getZoom=function(){return this._zoom},t.setZoom=function(e,t,i){var n,r=this;(t=Rn(t))?(r._14o&&r._14o.stop(!0),n=r._zoom,t.action=function(t){r._96O(n+(e-n)*t,i)},t._37o=function(){delete r._zooming,delete r._14o,r.onZoomEnded()},r._zooming=1,r._14o=rs(t)):r._96O(e,i)},t._96O=function(t,e){var i,n;(t=this.adjustZoom(t))!==this._zoom&&(this.validate(),i=this._29I,n=this._zoom,0!==i.width&&0!==i.height&&(e=e||{x:i.x+i.width/2,y:i.y+i.height/2},this.tx((e.x-i.x)*n-e.x*t),this.ty((e.y-i.y)*n-e.y*t)),this._zoom=t,this.fp("zoom",n,t))}},ms_edge:function(t){t._2I=function(t){this._44I||(this._44I=new Lh),this._42I||(this._42I=new Lh),this._44I.add(t),this._42I.add(t),this._20I()},t._4I=function(t){this._44I||(this._44I=new Lh),this._43I||(this._43I=new Lh),this._44I.add(t),this._43I.add(t),this._20I()},t._16I=function(t){this._44I.remove(t),this._42I.remove(t),this._44I.isEmpty()&&delete this._44I,this._42I.isEmpty()&&delete this._42I,this._20I()},t._18I=function(t){this._44I.remove(t),this._43I.remove(t),this._44I.isEmpty()&&delete this._44I,this._43I.isEmpty()&&delete this._43I,this._20I()},t._20I=function(){var e,i=this;delete i._45I,i._44I&&!i._44I.isEmpty()?(i._44I.each(function(t){t.isLooped()&&((e=e||{})[t._id]||(i._45I||(i._45I=new Lh),i._45I.add(t),e[t._id]=t))}),e?(i._70O=new Lh,i._44I.each(function(t){e[t._id]?"A"===e[t._id]||(e[t._id]="A",i._70O.add(t)):i._70O.add(t)})):i._70O=i._44I):delete i._70O},t.hasAgentEdges=function(){return!!this._49I&&!this._49I.isEmpty()},t.getSourceAgentEdges=function(){return this._46I},t.getTargetAgentEdges=function(){return this._47I},t._1I=function(t){this._46I||(this._46I=new Lh),this._48I||(this._48I=new Lh),this._46I.add(t),this._48I.add(t),this._19I()},t._3I=function(t){this._47I||(this._47I=new Lh),this._48I||(this._48I=new Lh),this._47I.add(t),this._48I.add(t),this._19I()},t._15I=function(t){this._46I.remove(t),this._48I.remove(t),this._46I.isEmpty()&&delete this._46I,this._48I.isEmpty()&&delete this._48I,this._19I()},t._17I=function(t){this._47I.remove(t),this._48I.remove(t),this._47I.isEmpty()&&delete this._47I,this._48I.isEmpty()&&delete this._48I,this._19I()},t._19I=function(){var e=this;delete e._49I;var i,t=e._48I;t&&!t.isEmpty()&&(i={},t.each(function(t){i[t._id]?e._49I||(e._49I=new Lh):i[t._id]=t}),e._49I?t.each(function(t){i[t._id]&&(e._49I.add(t),delete i[t._id])}):e._49I=t)},t.getLoopedEdges=function(){return this._45I},t.getEdges=function(){return this._70O},t.getAgentEdges=function(){return this._49I},t.getSourceEdges=function(){return this._42I},t.getTargetEdges=function(){return this._43I},t._8I=function(){this._70O&&this._70O.each(function(t){t._7I()})}},ms_shadow:function(i){bg.PARAMS.forEach(function(t){var t=t.replace(/(^|\.)[a-z]/g,function(t){return t[t.length-1].toUpperCase()}),e=t.charAt(0).toLowerCase()+t.substr(1);i["getShadow"+t]=function(){return this._getShadowParam(e)},i["setShadow"+t]=function(t){this._setShadowParam(e,t)}}),i.enableShadow=function(t){this.shadowMap.setShadow(!0,t)},i.disableShadow=function(){this.shadowMap.setShadow(!1)},i._getShadowParam=function(t){return this.shadowMap.getShadow()[t]},i._setShadowParam=function(t,e){var i=this._getShadowParam(t),n={};n[t]=e;var r=this.shadowMap;r.setShadow(r.enable,n),this.firePropertyChange("shadow"+t.charAt(0).toUpperCase()+t.substr(1),i,e)}}},An(G,{getVersion:function(){return"7.2.1"}},!0),An(G,{numberDigits:5,crossOrigin:"",baseZIndex:H,isTouchable:et,mockTouch:!0,devicePixelRatio:C.devicePixelRatio||1,reinvalidateCount:3,hitMaxArea:3e3,imageCacheThreshold:20,autoMakeVisible:!0,autoHideScrollBar:!0,disabledOpacity:.4,disabledBackground:r.disabledBackground,forceHierarchicalSerialization:!0,hoverDelay:600,clickDelay:200,toolTipDelay:800,toolTipContinual:!1,getDragger:function(){return Ir},lineCap:"butt",lineJoin:"round",imageGradient:"linear.northeast",dashPattern:[16,16],blockMinSize:1,encodeStringKey:null,doubleClickSpeed:500,doubleClickRange:1,doubleTouchRange:20,touchMoveThreshold:10,animDuration:200,animEasing:function(t){return t*t},labelColor:Xa,labelSelectColor:Vs,labelFont:"12px arial, sans-serif",widgetIndent:et?30:20,widgetRowHeight:et?30:20,widgetHeaderHeight:et?32:22,widgetTitleHeight:et?34:24,scrollBarColor:jo,scrollBarSize:7,scrollBarTimeout:1e3,scrollBarMinLength:20,scrollBarInteractiveSize:et?32:16,zoomIncrement:1.3,scrollZoomIncrement:1.05,pinchZoomIncrement:1.08,pinchZoomThreshold:1,zoomMax:20,zoomMin:.01,segmentResolution:12,shapeResolution:24,shapeSide:24,intersectionLineRect:Nn,intersectionLineLine:Un,isEnter:Wr,isEsc:qr,isDelete:Br,isSpace:Hr,isLeft:jr,isUp:Nr,isRight:Ur,isDown:Gr,isTouchEvent:Tr,getTarget:function(t){return(Tr(t)?Er(t):t).target},isString:pn,isNumber:_n,isBoolean:vn,isArray:bn,isSelectAll:Or,isFunction:mn,isObject:yn,getPropertyValue:Gn,setPropertyValue:Hn,addMethod:An,isMobile:function(){return xy!==H||(xy=!1,t=navigator.userAgent||navigator.vendor||C.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(t)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(t.substr(0,4)))&&(xy=!0)),xy;var t},createGradient:function(t,e,i,n,r,o,a,s){return(0,Co[e])(t,i,n,r,o,a,s)},appendToScreen:function(t){t=t.getView?t.getView():t,(d.fullscreenElement||d.mozFullScreenElement||d.webkitFullscreenElement||d.msFullscreenElement||d.body).appendChild(t)},encodeString:function(t){return Gl.Math.encodeBase64(t,G.encodeStringKey)},decodeString:function(t){return Gl.Math.decodeBase64(t,G.encodeStringKey)},findView:function(t){var a=function(t,e){var i=e._ht;i&&t.push(i);var n=e.children,r=n.length;if(r)for(var o=0;o<r;o++)a(t,n[o])},o=[];a(o,d.body);function e(t,e){for(var i="2d"===e?vc.GraphView:Bd.Graph3dView,n=0,r=t.length;n<r;n++)if(t[n]instanceof i)return o[n];return null}return"all"===t?o:"2d"===t?e(o,"2d"):"3d"===t?e(o,"3d"):e(o,"3d")||e(o,"2d")},toggleFullscreen:function(e){var i,n,r,o,a,s,h,t,c,l,u=e.getView();d.fullscreenElement||d.mozFullScreenElement||d.webkitFullscreenElement||d.msFullscreenElement?d.exitFullscreen?d.exitFullscreen():d.msExitFullscreen?d.msExitFullscreen():d.mozCancelFullScreen?d.mozCancelFullScreen():d.webkitExitFullscreen&&d.webkitExitFullscreen():(i=!0,l=e.isSelfViewEvent?(n=e.getX(),r=e.getY(),s=e.getWidth(),h=e.getHeight(),t=u.style.background,c=u.style.backgroundColor,t||c||(u.style.backgroundColor="white"),u.requestFullscreen?u.requestFullscreen():u.msRequestFullscreen?u.msRequestFullscreen():u.mozRequestFullScreen?u.mozRequestFullScreen():u.webkitRequestFullscreen&&u.webkitRequestFullscreen(),setInterval(function(){var t;u!==(d.fullscreenElement||d.mozFullScreenElement||d.webkitFullscreenElement||d.msFullscreenElement)?(clearInterval(l),e.setX(n),e.setY(r),e.setWidth(s),e.setHeight(h),e._fullscreen=!1,u.style.oldBackgroundColor=c,e.iv()):(t=Gl.Default.getWindowInfo(),!i&&t.width===e.getWidth()&&t.height===e.getHeight()||(e.setX(t.left),e.setY(t.top),e.setWidth(t.width),e.setHeight(t.height),e._fullscreen=!0,e.iv(),i=!1))},500)):(o=u.style.left,a=u.style.top,s=u.style.width,h=u.style.height,t=u.style.background,c=u.style.backgroundColor,t||c||(u.style.backgroundColor="white"),u.requestFullscreen?u.requestFullscreen():u.msRequestFullscreen?u.msRequestFullscreen():u.mozRequestFullScreen?u.mozRequestFullScreen():u.webkitRequestFullscreen&&u.webkitRequestFullscreen(),setInterval(function(){var t;u!==(d.fullscreenElement||d.mozFullScreenElement||d.webkitFullscreenElement||d.msFullscreenElement)?(clearInterval(l),u.style.left=o,u.style.top=a,u.style.width=s,u.style.height=h,u.style.oldBackgroundColor=c,e.iv()):(t=Gl.Default.getWindowInfo(),!i&&t.width===e.getWidth()&&t.height===e.getHeight()||(wr(e),i=!1))},500)))},appendTimeStamp:function(t){return t},setCompType:function(t,e){mn(e)||yn(e)?Fi[t]=e:ch(t)},getCompType:function(t){var e=Fi[t];return e===H&&Ui.test(t)&&ch(t),e},getCompTypeMap:function(){return Fi},drawCompType:function(t,e,i,n,r,o){t(e,i,n,r,o)},numberListener:(by={46:1,8:1,9:1,27:1,13:1,109:1,110:1,189:1,190:1},function(t){var e=t.keyCode;by[e]||65===e&&G.isCtrlDown(t)||86===e&&G.isCtrlDown(t)||67===e&&G.isCtrlDown(t)||88===e&&G.isCtrlDown(t)||35<=e&&e<=40||(t.shiftKey||e<48||57<e)&&(e<96||105<e)&&t.preventDefault()}),ignoreKeyCodes:[122,123],preventDefault:function(t){var e=t.target.tagName;"DIV"!==e&&"CANVAS"!==e||0<=G.ignoreKeyCodes.indexOf(t.keyCode)||!("keydown"!==t.type||jr(t)||Ur(t)||Nr(t)||Gr(t)||Br(t)||65===t.keyCode&&(t.metaKey||t.ctrlKey))||(t.preventDefault(),t.preventManipulation&&t.preventManipulation())},getWindowInfo:function(){var t=d.documentElement,t=t&&(t.scrollLeft||t.scrollTop)?t:d.body;return{target:t,left:t.scrollLeft,top:t.scrollTop,width:C.innerWidth||t.clientWidth,height:C.innerHeight||t.clientHeight}},isDragging:function(){return!!Ir},isLeftButton:function(t){return!!Tr(t)||0===t.button},isMiddleButton:function(t){return!Tr(t)&&(t&&(1===t.button||4&(t.buttons||0)))},isRightButton:function(t){return!Tr(t)&&(t&&(2===t.button||2&(t.buttons||0)))},isInput:function(t){if(!t)return!1;t=t.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t},getTouchCount:function(t){return Tr(t)?t.touches.length:1},isDoubleClick:(my={},du=new $f,Pi=du.getTime(),function(t){if(1<ds(t))return!1;var e=t.button==U?"":t.button,i=t.type+e,n=i+"_isDoubleClick",e=(e=my[i])||(my[i]={details:0,timeout:null,lastPoint:null});return t[n]===H&&(t[n]=!0,n=_s(t),e.timeout&&(E(e.timeout),e.timeout=null),t=Tr(t)?G.doubleTouchRange:G.doubleClickRange,e.lastPoint&&ys(e.lastPoint,n)>t&&Xm(e),e.lastPoint=n,e.details++,e.timeout=w(function(){Xm(this)}.bind(e),G.doubleClickSpeed)),2===e.details}),isShiftDown:function(t){return t?t.shiftKey:Li[16]},isCtrlDown:function(t){return t?B?t.metaKey:t.ctrlKey:B?Li[91]:Li[17]},getClientPoint:function(t){return Tr(t)&&(t=Er(t)),{x:t.clientX,y:t.clientY}},isMouseEvent:function(t){return t instanceof MouseEvent||0===t.type.indexOf("mouse")},getTargetElement:function(t){if(G.isMouseEvent(t)||!d.elementFromPoint)return t.target;t=vs(t);return d.elementFromPoint(t.x,t.y)},getPagePoint:function(t){return Tr(t)&&(t=Er(t)),{x:t.pageX,y:t.pageY}},createObject:function(t,e){var i,n=new t;for(i in e){var r,o=e[i];mn(o)?n[i]=o:0===i.indexOf("s:")?n.s(i.substr(2),e[i]):0===i.indexOf("a:")?n.a(i.substr(2),e[i]):(r=gn(i),o=e[i],n[r]?(n[r](o),"setToolTip"===r&&n.enableToolTip&&n.enableToolTip()):n[i]=o)}return n},setImage:function(t,e,i,n){var r=arguments.length;4===r?on(t,n,e,i):2===r?(pn(e)?on:nn)(t,e):1===r&&on(t,t)},getImage:function(t,e,i){var n;if(t==U)return U;if(yn(t)?n=t:(n=Oi[t],t&&n===H&&(tn&&tn[t]||on(t,t))),e&&n&&n.tagName){var r="override"===i?"colors_override":"override_rgb"===i?"colors_override_rgb":"override_a"===i?"colors_override_a":"colors";n[r]||(n[r]={__count__:0});t=n[r][e];return t||(n[r].__count__>G.imageCacheThreshold&&(n[r]={__count__:0}),t=function(e,t,i,n,r){var o=er();o.width=i,o.height=n;var a=o.getContext("2d");a.drawImage(e,0,0,i,n);try{for(var s=a.getImageData(0,0,i,n),h=s.data,c=0,l=h.length;c<l;c+=4){var u=h[c+0],d=h[c+1],f=h[c+2],g=h[c+3];"override_a"===r?h[c+3]=255*t[3]:"override_rgb"===r?(h[c+0]=255*t[0],h[c+1]=255*t[1],h[c+2]=255*t[2]):"override"===r?(h[c+0]=255*t[0],h[c+1]=255*t[1],h[c+2]=255*t[2],h[c+3]=255*t[3]):(h[c+0]=t[0]*u,h[c+1]=t[1]*d,h[c+2]=t[2]*f,h[c+3]=t[3]*g)}a.putImageData(s,0,0)}catch(t){return e}return o}(n,to(e),n.width,n.height,i),n[r][e]=t,n[r].__count__++),t}return n},isImageComplete:function(t,e,i){var n=Qa(t);if(!n)return!1;if(n.tagName)return n.complete;for(var r,o,a=n.comps,s=!0,h=0,c=a.length;h<c;h++)if(o=(r=a[h]).type,"image"===r.type){if((t=r.name)&&t.func&&(t=xh(t,e)),!Ya(t,e,i)){s=!1;break}}else if(Ui.test(o)&&G.getCompType(o)===H){s=!1,ch(o);break}return s},getId:(yy=1,function(){return++yy}),callLater:function(t,e,i,n){function r(){t.apply(e,i)}return n?w(r,n):C.requestAnimationFrame(r)},cancelLater:function(t,e){e?E(t):C.cancelAnimationFrame(t)},clone:function(t){if(null==t||"object"!=typeof t)return t;if(t instanceof Date)return(e=new Date).setTime(t.getTime()),e;if(t instanceof Array){for(var e=[],i=0,n=t.length;i<n;i++)e[i]=is(t[i]);return e}if(t instanceof Lh){for(e=new Lh,i=0,n=t.length;i<n;i++)e.set(i,is(t.get(i)));return e}if(t instanceof jh)return t;if(t instanceof L){var r,e={};for(r in t)t.hasOwnProperty(r)&&(e[r]=is(t[r]));return e}return t},callWhenLoaded:function(t,e){var i=Ai(t,e=e||100);(Ri=Ri||{})[i]={tick:i,cb:t,delay:e}},beforeLoadURL:function(t,e){if(Ri){var i={};for(e in Ri){var n=Ri[e];E(n.tick);var r=Ai(n.cb,n.delay);i[r]={tick:r,delay:n.delay,cb:n.cb}}Ri=i}return G.convertURL?G.convertURL(t,e):t},convertURL:function(t){return t},handleRefGraphLoaded:function(){},handleCompTypeLoaded:function(){},handleImageLoaded:function(){},handleUnfoundImage:function(){return G.getImage("default_blank")},resizeImagePOT:function(t,e){if(!t||!t.tagName)return t;var i,n,r=t.width,o=t.height;if(!r||!o)return t;if(na.isPOT(r)&&na.isPOT(o)&&(!e||r===o))return t;n=e?i=na.nearestPOT(Math.min(r,o)):(i=na.nearestPOT(r),na.nearestPOT(o));var a=er(),e=a.getContext("2d");return rr(a,i,n,1),e.drawImage(t,0,0,r,o,0,0,i,n),a},sortFunc:function(t,e){if(t===e)return 0;if(t==U&&e!=U)return 1;if(t!=U&&e==U)return-1;if(t==U&&e==U)return 0;var i,n=typeof t,r=typeof e;return n===Ze&&r===Ze?i=t.localeCompare(e):n==ti&&r==ti&&(i=t-e),i===H&&(i=(""+t).localeCompare(""+e)),0<i?1:i<0?-1:0},getClassMap:function(){return Di},getClass:function(t){if(pn(t)){var e,i=Di[t];if(!i){e=t.split("."),i=C;for(var n=0;n<e.length;n++)i=i[e[n]];Di[t]=i}return i}return t},def:function(t,e,i){function n(){}var r,o,a;if(n.prototype=e.prototype,r=new n,pn(t)){if(Di[t])throw"'"+t+"' already defined";a=ns(t),r.getClassName=function(){return t}}else a=t;if(r.constructor=a,r.getClass=function(){return a},r.getSuperClass=function(){return e},i)for(o in i)_a[o]&&_a.hasOwnProperty(o)?_a[o](r,i):Vo(r,i,o);a.prototype=r,a.superClass=e.prototype},startAnim:function(e){return(e=is(e)).easing=e.easing||G.animEasing,e.duration||e.frames||(e.duration=G.animDuration),e.t=0,e.duration?e.interval=0:(e.frame=0,e.interval=e.interval||10),e.tick=function(){var t;e.duration?(1<(t=(sn()-e.startTime)/e.duration)&&(t=1),e.t=t,e.action(e.easing(t),t),e.isRunning()&&(1===t?e.stop():e._isPaused||(e.timeId=$a(e.tick)))):(e.frame++,t=e.t=e.frame/e.frames,e.action(e.easing(t),t),e.isRunning()&&(e.frame<e.frames?e._isPaused||(e.timeId=$a(e.tick,U,U,e.interval)):e.stop()))},e.resume=function(){e._isPaused&&(delete e._isPaused,e.duration?e.t<1&&(e.startTime=sn()-e.duration*e.t,e.timeId=$a(e.tick)):e.frame<e.frames&&(e.timeId=$a(e.tick,U,U,e.interval)))},e.pause=function(){ts(e.timeId,!e.duration),e._isPaused=!0},e.isPaused=function(){return this._isPaused},e.stop=function(t){e.isRunning()&&(ts(e.timeId,!e.duration),delete e.timeId,e.duration?e.t<1&&t&&(e.t=1,e.action(e.easing(1),1)):e.frame<e.frames&&t&&(e.frame=e.frames,e.action(e.easing(1),1)),e._37o&&e._37o(),e.finishFunc&&e.finishFunc())},e.isRunning=function(){return e.timeId!=U},e.delay?$a(qm,U,[e],e.delay):qm(e),e},getTextSize:(_y={},vy=d?er().getContext("2d"):U,function(t,e){vy.font=t||Aa;t=_y[vy.font];return t||(t=2*vy.measureText("e").width+4,_y[vy.font]=t),{width:vy.measureText(e).width+4,height:t}}),drawText:function(t,e,i,n,r,o,a,s,h,c){var l,u;e!=U&&(l=hs(i,e),(u={}).y=c&&"middle"!==c?c===ct?o+l.height/2:o+s-l.height/2:o+s/2,u.x=h&&h!==st?h===ht?r+a-l.width/2:r+a/2:r+l.width/2,hr(t,e,u,i,n))},getDistance:function(t,e){var i=t.length;return e?3===i?W(n(t[0]-e[0])+n(t[1]-e[1])+n(t[2]-e[2])):2===i?W(n(t[0]-e[0])+n(t[1]-e[1])):t.z===H?W(n(e.x-t.x)+n(e.y-t.y)):W(n(e.x-t.x)+n(e.y-t.y)+n(e.z-t.z)):3===i?W(n(t[0])+n(t[1])+n(t[2])):2===i?W(n(t[0])+n(t[1])):void 0},brighter:function(t,e){return e<0&&(e=-e),co(t,e||40)},darker:function(t,e){return 0<e&&(e=-e),co(t,e||-40)},unionPoint:function(t,e){if(!t)return U;if(2===arguments.length)return t&&e?{x:q(t.x,e.x),y:q(t.y,e.y),width:X(t.x-e.x),height:X(t.y-e.y)}:U;var i=t;if(i._as&&(i=i._as),i.length===H)return U;var n=i.length;if(n<=0)return U;for(var r=1,o=i[0],a={x:o.x,y:o.y,width:0,height:0};r<n;r++){o=i[r];var s=q(a.x,o.x),h=N(a.x+a.width,o.x),c=q(a.y,o.y),l=N(a.y+a.height,o.y);a.x=s,a.y=c,a.width=h-s,a.height=l-c}return a},unionRect:function(t,e){if(t&&!e)return is(t);if(!t&&e)return is(e);if(t&&e){var i={x:q(t.x,e.x),y:q(t.y,e.y)};return i.width=N(t.x+t.width,e.x+e.width)-i.x,i.height=N(t.y+t.height,e.y+e.height)-i.y,i}return U},containsPoint:function(t,e,i,n){if(n!=U&&1!==n&&(a=t.x+t.width/2,s=t.y+t.height/2,t={x:a-t.width/2*n,y:s-t.height/2*n,width:t.width*n,height:t.height*n}),i){var r=t.width/2,o=t.height/2,a=Z(-i),s=Q(-i),n=e.x-t.x-r,i=e.y-t.y-o;return e={x:s*n-a*i,y:a*n+s*i},xs({x:-r,y:-o,width:t.width,height:t.height},e)}return!(!t||e.x<t.x||e.y<t.y||e.x>t.x+t.width||e.y>t.y+t.height)},containsRect:function(t,e){if(!t||!e)return!1;var i=e.x,n=e.y,r=e.width,o=e.height,a=t.width,s=t.height;if((a|s|r|o)<0)return!1;e=t.x,t=t.y;if(i<e||n<t)return!1;if(a+=e,(r+=i)<=i){if(e<=a||a<r)return!1}else if(e<=a&&a<r)return!1;if(s+=t,(o+=n)<=n){if(t<=s||s<o)return!1}else if(t<=s&&s<o)return!1;return!0},intersectsRect:function(t,e){if(!t||!e)return!1;var i=e.width,n=e.height,r=t.width,o=t.height;if(r<=0||o<=0||i<=0||n<=0)return!1;var a=e.x,s=e.y,e=t.x,t=t.y;return o+=t,i+=a,n+=s,a<(r+=e)&&s<o&&e<i&&t<n},intersection:function(t,e){if(!t||!e)return U;var i=e.x,n=e.y,r=t.x,o=t.y,a=i,s=n,h=r,c=o;return a+=e.width,s+=e.height,i<r&&(i=r),n<o&&(n=o),(h+=t.width)<a&&(a=h),(c+=t.height)<s&&(s=c),s-=n,(a-=i)<=0||s<=0?U:{x:i,y:n,width:a,height:s}},grow:function(t,e,i){i===H&&(i=e),t.x-=e,t.y-=i,t.width=t.width+2*e,t.height=t.height+2*i},getScreenPoint:function(t,e,i,n,r,o,a){var s=i.getBoundingClientRect(),n=t*(o||1)-i.scrollLeft+(n||0),a=e*(a||1)-i.scrollTop+(r||0),r=zo(i,!1);if(r){i=new ha(n,a,0);return i.applyMatrix4(r),console.log(i),{x:i.x,y:i.y}}return{x:n+s.left,y:a+s.top}},getLogicalPoint:function(t,e,i,n,r,o){var a,s=e.getBoundingClientRect(),h=t.target?(ps(t)?B?Li[91]=!0:Li[17]=!0:B?Li[91]=!1:Li[17]=!1,Li[16]=!!gs(t),a=(t=Tr(t)?Er(t):t).clientX,t.clientY):(a=t.x,t.y),t=zo(e,!0);if(t){var c=new ha(a,h,0);c.applyMatrix4(t);do{if(Math.abs(c.z)<=1e-6)break;var l=new ha(a,h,1);if(l.applyMatrix4(matrix),Math.abs(l.z)<=1e-6){c=l;break}}while((l.sub(c),!(Math.abs(l.z)<=1e-6))&&(c.addScaledVector(l,-c.z/l.z),0));return{x:(c.x+e.scrollLeft-(i||0))/(r||1),y:(c.y+e.scrollTop-(n||0))/(o||1)}}return{x:(a-s.left+e.scrollLeft-(i||0))/(r||1),y:(h-s.top+e.scrollTop-(n||0))/(o||1)}},removeHTML:function(t){return t&&t.getView&&(t=t.getView()),!(!t||!t.parentNode)&&(py===t||((py=t).parentNode.removeChild(t),py=U),!0)},getToolTipDiv:function(){var t;return mi||(mi=tr(),bi=tr(),t=mi.style,G.baseZIndex!=U&&(t.zIndex=tt(G.baseZIndex)+3+""),t.whiteSpace="nowrap",t.color=G.toolTipLabelColor,t.background=G.toolTipBackground,t.font=G.toolTipLabelFont,t.padding="5px",t.boxShadow="0px 0px 3px "+G.toolTipShadowColor),mi},isToolTipShowing:function(){return!(!mi||!mi.parentNode)||!(!bi||!bi.parentNode)},hideToolTip:function(){As(mi),As(bi),Ei()},showToolTip:function(t,e){var i,n,r,o,a,s;t&&e!=U?(G.getToolTipDiv(),e.html?(e=e.html,i=bi,As(mi)):(i=mi,As(bi)),n=i.style,i.innerHTML=e,i.parentNode||Gl.Default.appendToScreen(i),t.target?(t=vs(t),r=Ss(),o=t.x,a=t.y,e=et?60:12,et?(s=i.getBoundingClientRect(),n.left=o-s.width/2+vt,n.top=a-s.height-e<r.top?a+e+vt:a-s.height-e+vt):(n.left=o+e+vt,n.top=a+e+vt,(s=i.getBoundingClientRect()).left+s.width>r.width&&(n.left=o-e-s.width+vt),s.top+s.height>r.height&&(n.top=a-e-s.height+vt),s.left<0&&(n.left=o+e+vt),s.top<0&&(n.top=a+e+vt))):(n.left=t.x+vt,n.top=t.y+vt),Ei()):Ta()},startDragging:function(t,e,i){i==H&&(i=!0),t!==Ir&&(Ir?i&&(Tr(e)?Ir.handleWindowTouchEnd(e):Ir.handleWindowMouseUp(e)):Tr(e)?(g(C,ci,Cr),g(C,li,Mr)):(g(C,ai,Rr),g(C,si,Ar)),Ir=t)},getImageMap:function(){return Oi},toBoundaries:function(t,e,i,n){var r=[];return so(t,e,i,n).forEach(function(t){var e=[];t.forEach(function(t){e.push(t.x,t.y)}),r.push(e)}),r},getCurrentKeyCodeMap:function(){return Li},drawCenterImage:function(t,e,i,n,r,o,a,s){!r&&o&&o.isSelfViewEvent&&(r=o);var h=mh(e,r,o),c=bh(e,r,o);wh(t,e,S(i-h/2),S(n-c/2),h,c,r,o,a,s)},drawStretchImage:function(t,e,i,n,r,o,a,s,h,c,l,u){!s&&h&&h.isSelfViewEvent&&(s=h);var d=mh(e,s,h,o),f=bh(e,s,h,a);"uniform"===i?(f*=p=q(o/d,a/f),n+=S((o-(d*=p))/2),r+=S((a-f)/2),o=d,a=f):"centerUniform"===i&&((o<d||a<f)&&(d*=p=q(o/d,a/f),f*=p),n+=S((o-d)/2),r+=S((a-f)/2),o=d,a=f);var g,p,_,v=t.interactiveInfo;v&&(_="center"===i?{x:n+o/2-d/2,y:r+a/2-f/2,width:d,height:f}:{x:n,y:r,width:o,height:a},v.rect?(p=(g=v.compInfos).length)&&(g[p-1].rect.image=e):v.rect=_),"center"===i?((l=!1!==l&&(o<d||a<f))&&(t.save(),t.beginPath(),t.rect(n,r,o,a),t.clip()),wh(t,e,n+o/2-d/2,r+a/2-f/2,d,f,s,h,c,u),l&&t.restore()):wh(t,e,n,r,o,a,s,h,c,u)},toCanvas:function(t,e,i,n,r,o,a,s,h){t=Qa(t,a),e=e||mh(t,r),i=i||bh(t,r);var c=er(),l=fr(c);return s?(rr(c,e,i,s),l.scale(s,s)):rr(c,e,i,1),Ka(l,t,n,0,0,e,i,r,o,a,h),t&&t.clampToEdge&&(c.clampToEdge=t.clampToEdge),l.restore(),c},toGrayColor:function(t){if(!t)return t;var e=$r(t),t=S(.299*e[0]+.587*e[1]+.114*e[2]);return"rgba("+t+","+t+","+t+","+e[3]/255+")"},createGradientImage:function(t,e,i,n){for(var r=["L",0,0,t,0,1,0,0,1,0,0],o=0,a=Math.min(e.length,i.length);o<a;o++)r.push(i[o],e[o]);return Gl.Default.toCanvas({width:t,height:t,clampToEdge:!0,comps:[{type:"shape",rotation:n||0,points:[0,0,t,0,t,t,0,t],background:"#ffffff",gradientPack:r}]})},createElement:function(t,e,i,n){t=d.createElement(t);return ir(t,e||r.widgetBorder,2),t.style.font=i||Aa,n!=U&&(t.value=n),G.onElementCreated&&G.onElementCreated(t),t},containedInView:function(t,e){e=xr(e).getBoundingClientRect();return xs({x:e.left,y:e.top,width:e.width,height:e.height},_s(t))},isIsolating:function(){return 0<Mi},setIsolating:function(t){t?Mi++:Mi--},getMSMap:function(){return _a},stringify:function(t,e,i){var n=Date.prototype.toJSON;Date.prototype.toJSON=function(){return"__ht__date"+this.getTime()},e=i?0:e==U?2:e;e=JSON.stringify(t,function(t,e){return"function"==typeof e?"__ht__"+(e.__ht__||e.toString()):_n(e)?(i=e)==U||G.numberDigits==U?i:parseFloat(i.toFixed(G.numberDigits)):e instanceof Gl.List?"__ht__list"+(e.__ht__list||G.stringify(e._as)):e;var i},e);return Date.prototype.toJSON=n,i&&(e=gi+function(t){for(var e=8+na.randomInt(8),i=$o[8*na.randomInt(8)+(e-8)],n="",r=0;r<e;r++)n+=$o[na.randomInt(64)];var o=vo(n+bm+"__"+ze);return i+n+ta.encode(t,o)}(e)),e},parse:function(t){return pn(t)&&(t.substr(0,12)!=gi||(t=function(t){var e=t[0],i=$o.indexOf(e);if(i<0)return"";i=8+(7&i);e=t.slice(1,1+i),e=vo(e+bm+"__"+ze);return ta.decode(t,e,1+i)}(t.substr(12)),pn(t)))?JSON.parse(t,function(t,e){if(pn(e))if("__ht__function"==e.substr(0,14)){var i=e.indexOf("{")+1,n=e.lastIndexOf("}"),r=e.indexOf("(")+1,o=e.indexOf(")");if(i&&n&&r&&o)try{var a=new Function(e.substring(r,o),e.substring(i,n));return a.__ht__=e.substr(6),a}catch(t){throw console.info("=== SyntaxError ===\n",e),t}}else{if("__ht__date"==e.substr(0,10))return new Date(tt(e.substr(10)));if("__ht__list"===e.substr(0,10))return new Lh(G.parse(e.substr(10)))}return e}):t},loadJS:function(t,e){e&&t.push(e);var i=t.shift();bn(i)?(t=i.contact(t),G.loadJS(t)):mn(i)?(i(),G.loadJS(t)):pn(i)?((e=d.createElement("script")).onload=function(){G.loadJS(t)},e.setAttribute("src",i),d.getElementsByTagName("head")[0].appendChild(e)):t.length&&G.loadJS(t)},extendClass:function(t,e){var i,n=t.prototype;for(i in e)_a[i]&&_a.hasOwnProperty(i)?_a[i](n,e):n[i]=e[i]},toRoundedCorner:(uy=new ha,dy=new ha,fy=new ha,gy=new ha,function(t,e){var i,n=0;t.getPoints&&(n=t.getElevation(),t=t.getPoints());var r=(i=t instanceof Lh?t:new Lh(t)).size();if(e<=0)return{points:i};var o=new Lh,a=new Lh,s=i.get(0);Wm(uy,s,n),o.add(s),a.add(1);for(var h,c,l=1;l<r;l++)l+1<r?(h=i.get(l),c=i.get(l+1),Wm(dy,h,n),Wm(fy,c,n),gy.subVectors(uy,dy).setLength(Math.min(.99*gy.length(),e)).add(dy),h.e!==H||s.e!==H?o.add({x:gy.x,y:gy.z,e:gy.y}):o.add({x:gy.x,y:gy.z}),o.add(h),gy.subVectors(fy,dy).setLength(Math.min(.99*gy.length(),e)).add(dy),h.e!==H||c.e!==H?o.add(s={x:gy.x,y:gy.z,e:gy.y}):o.add(s={x:gy.x,y:gy.z}),uy.copy(gy),a.addAll([2,3])):(o.add(i.get(l)),a.add(2));return{points:o,segments:a}}),toColorData:$r,setCanvas:rr,createDiv:tr,createDisabledDiv:dr,createView:$n,createCanvas:er,appendChild:or,initContext:fr,checkLoadingImage:rn,translateAndScale:gr,layout:wr,getPosition:Fo,drawPoints:ao,drawRoundRect:mo,drawBorder:bo,setFocus:br,getter:fn,setter:gn,isEmptyObject:zn,cameraPriority:(ly={skybox:0,main:1e4,top:1e7,infinity:1/0},L.seal(L.defineProperties({},{skybox:{configurable:!1,enumerable:!1,get:function(){return ly.skybox},set:function(t){if(t>=ly.main)throw new RangeError("Skybox camera must have lower priority than the main camera.");ly.skybox=Number(t)}},main:{configurable:!1,enumerable:!1,get:function(){return ly.main},set:function(t){if(t<=ly.skybox)throw new RangeError("Main camera must have higher priority than the skybox camera.");if(t>=ly.top)throw new RangeError("Main camera must have lower priority than the top camera.");ly.main=Number(t)}},top:{configurable:!1,enumerable:!1,get:function(){return ly.top},set:function(t){if(t<=ly.main)throw new RangeError("Top camera must have higher priority than the main camera.");ly.top=Number(t)}}})))},!0),An(e,{autoAdjustIndex:1,hierarchicalRendering:1,adjustChildrenToTop:1,autoHideScrollBar:1,autoUpdate:1,firstPersonMode:1,ortho:1,strict:1,stickToRight:1,instant:1,closePath:1,hierarchical:1,doubleClickToToggle:1,continuousLayout:1,syncSize:1},!0),va=G.disabledOpacity,ya=G.toolTipDelay,ma=G.devicePixelRatio,ba=G.autoMakeVisible,xa=G.autoHideScrollBar,wa=G.imageGradient,Ea=G.showToolTip,Ta=G.hideToolTip,Sa=G.dashPattern,Ia=G.lineCap,Ca=G.lineJoin,Ma=G.labelColor,Ra=G.labelSelectColor,Aa=G.labelFont,Pa=G.widgetIndent,Da=G.widgetRowHeight,Oa=G.widgetHeaderHeight,Ba=G.widgetTitleHeight,za=G.scrollBarColor,Va=G.scrollBarSize,La=G.scrollBarTimeout,Fa=G.scrollBarMinLength,ka=G.scrollBarInteractiveSize,ja=G.zoomIncrement,Na=G.scrollZoomIncrement,Ua=G.pinchZoomIncrement,Ga=G.zoomMax,Ha=G.zoomMin,Wa=G.createObject,qa=G.preventDefault,Xa=G.setImage,Qa=G.getImage,Ya=G.isImageComplete,Za=G.drawCenterImage,Ka=G.drawStretchImage,Ja=G.getId,$a=G.callLater,ts=G.cancelLater,es=G.sortFunc,is=G.clone,ns=G.getClass,rs=G.startAnim,os=G.brighter,as=G.darker,ss=G.drawText,hs=G.getTextSize,cs=G.isLeftButton,ls=G.isMiddleButton,us=G.isRightButton,ds=G.getTouchCount,fs=G.isDoubleClick,gs=G.isShiftDown,ps=G.isCtrlDown,_s=G.getClientPoint,vs=G.getPagePoint,ys=G.getDistance,ms=G.unionPoint,bs=G.unionRect,xs=G.containsPoint,ws=G.containsRect,Es=G.intersectsRect,Ts=G.intersection,Ss=G.getWindowInfo,Is=G.grow,Cs=G.getLogicalPoint,Ms=G.getScreenPoint,Rs=G.startDragging,As=G.removeHTML,Ps=G.createElement,Ds=G.segmentResolution,Os=G.shapeResolution,Bs=G.shapeSide,zs=G.def,Vs=function(t,e,i){zs("ht."+t,e,i)},Ls=function(t,e){t.childNodes.forEach(function(t){e(t),Ls(t,e)})},An(G,{toolTipLabelColor:Ma,toolTipLabelFont:Aa,toolTipBackground:r.toolTipBackground,toolTipShadowColor:jo,debugTipLabelFont:Aa,debugTipLabelColor:Ma,debugTipBackground:r.toolTipBackground,drawBreakableText:sr,setDevicePixelRatio:function(t){ma=G.devicePixelRatio="number"==typeof t?t:C.devicePixelRatio,Ls(d.body,function(t){t=t._ht;t&&t._canvas&&(rr(t._canvas,t.getWidth(),t.getHeight()),t.redraw?t.redraw():t.iv())})}},!0),Fs=1e-6,ks="undefined"!=typeof Uint16Array?Uint16Array:Array,js="undefined"!=typeof Float32Array?Float32Array:Array,Ns=function(t,e,i){e=[t[0]-e[0],t[1]-e[1],t[2]-e[2]];return!i||0<(i=ys(e))&&(e[0]/=i,e[1]/=i,e[2]/=i),e},Us=function(){var t,e="charCodeAt",i=2*(2*yt.length+1);for(t in C)if(t===bm+st[0]+(vt.length+2)){var n=C[t];if(!n)break;for(var r=n.length,o=0;o<r;o++)if(n[o][e](0)===i&&n[o+1]!=U&&n[o+1]===vt[0]&&n[o+2]!=U&&n[o+2][e](0)===i){for(var a=o+3;a<r;a++)if(n[a][e](0)===i){if(0==n[a+1])for(var s,h=a+2;h<r;h++){if(n[h][e](0)===i){0==n[h-1]&&s&&(R=s.substr(0,s.length-1));break}s==U?s=n[h]:s+=n[h]}break}break}break}return function(t){return[-t[0],-t[1],-t[2]]}}(),Gs=function(t,e){return 3===t.length?t[0]*e[0]+t[1]*e[1]+t[2]*e[2]:t[0]*e[0]+t[1]*e[1]},Ws=(Hs=function(){var t=new Array(16);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})(),qs=function(t){var e=new Array(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},Xs=function(t,e){var i=t[0],n=t[1],r=t[2];return t[0]=e[0]*i+e[4]*n+e[8]*r+e[12],t[1]=e[1]*i+e[5]*n+e[9]*r+e[13],t[2]=e[2]*i+e[6]*n+e[10]*r+e[14],t},Qs=function(t,e){var i=t[0],n=t[1],r=t[2],o=t[3];return t[0]=e[0]*i+e[4]*n+e[8]*r+e[12]*o,t[1]=e[1]*i+e[5]*n+e[9]*r+e[13]*o,t[2]=e[2]*i+e[6]*n+e[10]*r+e[14]*o,t[3]=e[3]*i+e[7]*n+e[11]*r+e[15]*o,t},ay=Dn(ru[1]+ru[7]),sy=Dn(ru[0]+ru[3]-ru[10]),hy=Dn(ru[8]+2),cy=function(){return Hm(),(ry!==ay?Gm:function(){var t,e={};if(ry===ay){if(Um(),Hm(),ry===sy)return Um(),e;for(;ry;){if(t=Gm(),Hm(),Um(),e[t]=cy(),Hm(),ry===sy)return Um(),e;Um(),Hm()}}})()},Ys=function(t){if((i={},t)&&(oy=t,ny=0,ry=" ",t=cy(),Hm(),!ry))return t},Zs=function(t,e){var i,n,r,o,a,s,h,c,l;e&&(i=Z(e),n=Q(e),r=t[4],o=t[5],a=t[6],s=t[7],h=t[8],c=t[9],l=t[10],e=t[11],t[4]=r*n+h*i,t[5]=o*n+c*i,t[6]=a*n+l*i,t[7]=s*n+e*i,t[8]=h*n-r*i,t[9]=c*n-o*i,t[10]=l*n-a*i,t[11]=e*n-s*i)},Ks=function(t,e){var i,n,r,o,a,s,h,c,l;e&&(i=Z(e),n=Q(e),r=t[0],o=t[1],a=t[2],s=t[3],h=t[8],c=t[9],l=t[10],e=t[11],t[0]=r*n-h*i,t[1]=o*n-c*i,t[2]=a*n-l*i,t[3]=s*n-e*i,t[8]=r*i+h*n,t[9]=o*i+c*n,t[10]=a*i+l*n,t[11]=s*i+e*n)},Js=function(t,e){var i,n,r,o,a,s,h,c,l;e&&(i=Z(e),n=Q(e),r=t[0],o=t[1],a=t[2],s=t[3],h=t[4],c=t[5],l=t[6],e=t[7],t[0]=r*n+h*i,t[1]=o*n+c*i,t[2]=a*n+l*i,t[3]=s*n+e*i,t[4]=h*n-r*i,t[5]=c*n-o*i,t[6]=l*n-a*i,t[7]=e*n-s*i)},$s=function(t,e,i){return th(U,!1===i?U:t.getFinalScale3d(),t.getFinalRotation3d(),t.getRotationMode(),t.p3(),U,e)},th=function(t,e,i,n,r,o,a){return o=o||Hs(),r&&ju(o,r),fl(o,i,n),a&&Uu(o,o,a),e&&Nu(o,e),t&&Uu(o,o,t),o},ih="lineDashOffset",nh="setLineDash",rh=function(t,e,i){return Vn(e)?t:t[nh]?(t[nh](e),i&&(t.lineDashOffset=i),t):new eh(t,e[0],1<e.length?e[1]:e[0])},oh=function(t,e){!Vn(e)&&t[nh]&&(t[nh](qi),t.lineDashOffset=0)},zs(eh=function(t,e,i){e=tt(e),i=tt(i);this.g=t,this._84O=e,this._85O=i,this._70I=!0,this.F=0,this._83O=e+i,this.pen={x:0,y:0}},L,{_69I:6,moveTo:function(t,e){var i=this.pen;i.x=t,i.y=e,this.g.moveTo(t,e),this.start||(this.start={x:t,y:e})},lineTo:function(t,e){var i=this,n=i.pen,r=t-n.x,o=e-n.y,a=T(o,r),s=Q(a),h=Z(a),c=i._23O(n.x,n.y,t,e),o=i._85O,r=i._84O,a=i._83O;if(i.F){if(i.F>c)return i._70I?i._72I(t,e):i.moveTo(t,e),void(i.F-=c);if(i._70I?i._72I(n.x+s*i.F,n.y+h*i.F):i.moveTo(n.x+s*i.F,n.y+h*i.F),c-=i.F,i.F=0,i._70I=!i._70I,!c)return}var l=k(c/a);if(l){for(var u=s*r,d=h*r,f=s*o,g=h*o,p=0;p<l;p++)i._70I?(i._72I(n.x+u,n.y+d),i.moveTo(n.x+f,n.y+g)):(i.moveTo(n.x+f,n.y+g),i._72I(n.x+u,n.y+d));c-=a*l}i._70I?r<c?(i._72I(n.x+s*r,n.y+h*r),i.moveTo(t,e),i.F=o-(c-r),i._70I=!1):(i._72I(t,e),c===r?(i.F=0,i._70I=!i._70I):(i.F=r-c,i.moveTo(t,e))):o<c?(i.moveTo(n.x+s*o,n.y+h*o),i._72I(t,e),i.F=r-(c-o),i._70I=!0):(i.moveTo(t,e),c===o?(i.F=0,i._70I=!i._70I):i.F=o-c)},quadraticCurveTo:function(t,e,i,n){var r,o=this,a=o.pen,s=a.x,h=a.y,c=o._22O(s,h,t,e,i,n),l=0,u=0,d=o._85O,f=o._84O;if(o.F){if(o.F>c)return o._70I?o._71I(t,e,i,n):o.moveTo(i,n),void(o.F-=c);if(l=o.F/c,r=o._20O(s,h,t,e,i,n,l),o._70I?o._71I(r[2],r[3],r[4],r[5]):o.moveTo(r[4],r[5]),o.F=0,o._70I=!o._70I,!c)return}var a=c-c*l,g=k(a/o._83O),p=f/c,_=d/c;if(g)for(var v=0;v<g;v++)o._70I?(u=l+p,r=o._21O(s,h,t,e,i,n,l,u),o._71I(r[2],r[3],r[4],r[5]),u=(l=u)+_,r=o._21O(s,h,t,e,i,n,l,u),o.moveTo(r[4],r[5])):(u=l+_,r=o._21O(s,h,t,e,i,n,l,u),o.moveTo(r[4],r[5]),u=(l=u)+p,r=o._21O(s,h,t,e,i,n,l,u),o._71I(r[2],r[3],r[4],r[5])),l=u;a=c-c*l,o._70I?f<a?(u=l+p,r=o._21O(s,h,t,e,i,n,l,u),o._71I(r[2],r[3],r[4],r[5]),o.moveTo(i,n),o.F=d-(a-f),o._70I=!1):(r=o._19O(s,h,t,e,i,n,l),o._71I(r[2],r[3],r[4],r[5]),c===f?(o.F=0,o._70I=!o._70I):(o.F=f-a,o.moveTo(i,n))):d<a?(u=l+_,r=o._21O(s,h,t,e,i,n,l,u),o.moveTo(r[4],r[5]),r=o._19O(s,h,t,e,i,n,u),o._71I(r[2],r[3],r[4],r[5]),o.F=f-(a-d),o._70I=!0):(o.moveTo(i,n),a===d?(o.F=0,o._70I=!o._70I):o.F=d-a)},bezierCurveTo:function(){var t=arguments;this.pen={x:t[4],y:t[5]},this.g.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5])},arc:function(t,e,i,n,r,o){o||(n=-n,r=-r),function(t,e,i,n,r,o,a,s){var h,c,l,u,d,f,g;if(X(r)>2*P&&(r=2*P),h=-(r/(l=j(X(r)/(P/4)))),c=-n,0<l){r=e+Q(n)*o,n=i+Z(-n)*a,s?t.lineTo(r,n):t.moveTo(r,n);for(var p=0;p<l;p++)g=(c+=h)-h/2,u=e+Q(c)*o,d=i+Z(c)*a,f=e+Q(g)*(o/Q(h/2)),g=i+Z(g)*(a/Q(h/2)),t.quadraticCurveTo(f,g,u,d)}}(this,t,e,n,r-n,i,i,!1)},rect:function(t,e,i,n){this.pen={x:t,y:e},this.moveTo(t,e),this.lineTo(t,e+n),this.lineTo(t+i,e+n),this.lineTo(t+i,e),this.lineTo(t,e)},beginPath:function(){this.g.beginPath()},closePath:function(){this.lineTo(this.start.x,this.start.y)},_23O:function(t,e,i,n){t=i-t,e=n-e;return W(t*t+e*e)},_22O:function(t,e,i,n,r,o,a){for(var s,h,c,l,u=0,d=t,f=e,g=0<a?a:this._69I,p=1;p<=g;p++)s=(h=(l=1-(s=p/g))*l)*t+(c=2*s*l)*i+(l=s*s)*r,l=h*e+c*n+l*o,u+=this._23O(d,f,s,l),d=s,f=l;return u},_21O:function(t,e,i,n,r,o,a,s){if(0===a)return this._20O(t,e,i,n,r,o,s);if(1===s)return this._19O(t,e,i,n,r,o,a);o=this._20O(t,e,i,n,r,o,s);return o.push(a/s),this._19O.apply(this,o)},_20O:function(t,e,i,n,r,o,a){var s,h;return 1!==a&&(s=i+(r-i)*a,h=n+(o-n)*a,r=(i=t+(i-t)*a)+(s-i)*a,o=(n=e+(n-e)*a)+(h-n)*a),[t,e,i,n,r,o]},_19O:function(t,e,i,n,r,o,a){var s;return 1!==a&&(t=(s=t+(i-t)*a)+((i+=(r-i)*a)-s)*a,e=(s=e+(n-e)*a)+((n+=(o-n)*a)-s)*a),[t,e,i,n,r,o]},_72I:function(t,e){var i=this.pen;t===i.x&&e===i.y||(i.x=t,i.y=e,this.g.lineTo(t,e))},_71I:function(t,e,i,n){var r=this.pen;t===i&&e===n&&i===r.x&&n===r.y||(r.x=i,r.y=n,this.g.quadraticCurveTo(t,e,i,n))}}),sh=ah=U,hh=G.checkLoadingCompType=function(t){ah&&!t._72O&&((sh=sh||{})[t._72O=Ja()]=t)},ch=function(e,t){var i,n;(t=t||e)&&!(ah=ah||{})[e]&&(i=new Sl,ah[t]={request:i,url:t},(t=G.beforeLoadURL(t,e)).data?(n=G.parse(t.data),lh(e,n),G.handleCompTypeLoaded(e,n)):(i.onload=function(){var t;200===this.status||0===this.status?(t=G.parse(i.getResponseText()),lh(e,t),G.handleCompTypeLoaded(e,t)):lh(e,U)},i.onerror=function(){lh(e,U)},(n={}).url=encodeURI(t),n.sync=!1,i.send(n)))},lh=function(t,e){if(Fi[t]=e,delete ah[t],zn(ah)&&(ah=U,sh)){for(var i in sh)(n=sh[i]).invalidateAll&&n.invalidateAll(H,"compTypeLoaded",t),n.redraw&&n.redraw(),n.iv(),delete n._72O;sh=U}if(e&&sh)for(var i in sh){var n;(n=sh[i]).invalidateAll&&n.invalidateAll(H,"compTypeLoading",t),n.redraw&&n.redraw(),n.iv()}},uh=r.chart,fh=!(dh=""),gh=G.compStack=[],ph=/^style@/,_h=/^attr@/,vh=/^field@/,yh={x:.5,y:.5},mh=function(t,e,i,n){if(!t)return 0;if(xh(t.fitSize,e,i)&&n)return n;i=xh(t.width,e,i);return null==i?20:i},bh=function(t,e,i,n){if(!t)return 0;if(xh(t.fitSize,e,i)&&n)return n;i=xh(t.height,e,i);return null==i?20:i},xh=function(t,e,i){if(!t||!t.func)return t;var n=t.func,r=t.value,i=mn(n)?i&&i.vectorDataBindingDisabled&&!t.isSafeFunc?r:n(e,i):e instanceof jh||Gl.ui&&e instanceof Gl.ui.View?_h.test(n)?e.a(dh+n.slice(5)):ph.test(n)?e.s(dh+n.slice(6)):vh.test(n)?e[n.slice(6)]:e[n]?e[n](i):r:r;return r!==H&&i==U?r:i},wh=G.drawImage=($v=function(t,e,i){var n,r,o=!1;return t.prefix&&Qv instanceof jh&&((r=Qv.a(dh+e))!==H&&(o=!0,n=r)),n===H&&(n=t[e]),n&&n.func&&(o=!0,n=xh(n,Qv,Yv)),i&&(n=i(n),o||(t[e]=n)),n},ty=function(t,e){t=e?$v(t,e):t;return Xv&&Xv.compGray&&t?G.toGrayColor(t):Kv&&t?Jr(t,Kv,Jv):t},ey=function(t,e,i){if(e){var n,r,o,a={x:e.x,y:e.y,width:e.width,height:e.height},s=Vm(t),h=$v(t,"layoutH"),c=$v(t,"layoutV"),l=1,u=1,d=0,f=0,g=1,p=1;switch(h){case"left":break;case"right":a.x+=i.width-i.rw;break;case"center":a.x+=.5*(i.width-i.rw);break;case"scale":case"leftright":default:(n=$v(t,$t)||0)&&(d=Math.abs(f=Math.sin(n)),g=Math.abs(p=Math.cos(n))),"leftright"!==h?(l+=g*(i.widthScale-1),u+=d*(i.widthScale-1)):(l+=a.width?g*(i.width-i.rw)/a.width:0,u+=a.height?d*(i.width-i.rw)/a.height:0,r=-Math.min(-s.x*p+s.y*f,-s.x*p-(1-s.y)*f,(1-s.x)*p+s.y*f,(1-s.x)*p-(1-s.y)*f))}switch(c){case"top":break;case"bottom":a.y+=i.height-i.rh;break;case"center":a.y+=.5*(i.height-i.rh);break;case"scale":case"topbottom":default:n==U&&((n=$v(t,$t))&&(d=Math.abs(f=Math.sin(n)),g=Math.abs(p=Math.cos(n)))),"topbottom"!==c?(l+=d*(i.heightScale-1),u+=g*(i.heightScale-1)):(l+=a.width?d*(i.height-i.rh)/a.width:0,u+=a.height?g*(i.height-i.rh)/a.height:0,o=-Math.min(-s.x*f-s.y*p,-s.x*f+(1-s.y)*p,(1-s.x)*f-s.y*p,(1-s.x)*f+(1-s.y)*p))}return 1===l&&1===u||("scale"!==h&&h?"leftright"===h&&(a.x+=a.width*(1-l)*s.x+r*(i.width-i.rw)):a.x+=a.x*(i.widthScale-1)+s.x*a.width*(i.widthScale-l),"scale"!==c&&c?"topbottom"===c&&(a.y+=a.height*(1-u)*s.y+o*(i.height-i.rh)):a.y+=a.y*(i.heightScale-1)+s.y*a.height*(i.heightScale-u),a.width*=l,a.height*=u),a.width<0&&(a.width=0),a.height<0&&(a.height=0),a}},iy={border:function(t,e){bo(Xv,ty(t,Je),e.x,e.y,e.width,e.height,$v(t,"width"))},image:function(t,e){var i=Kv||$v(t,Je),n=Jv||$v(t,"blendMode"),r=$v(t,"name"),r=Qa(r,i,n);r?Ka(Xv,r,$v(t,"stretch"),e.x,e.y,e.width,e.height,Qv,Yv,i,null,n):fh=!1},text:function(t,e){var i=$v(t,"text");i!=U&&ss(Xv,i,$v(t,"font"),ty(t,Je),e.x,e.y,e.width,e.height,$v(t,"align"),$v(t,"vAlign"))},pieChart:function(t,e){var i=$v(t,Lt),n=0;if(i&&(i.forEach(function(t){n+=t}),0<n)){for(var r=$v(t,"colors")||uh,o=$v(t,"startAngle")||0,a=$v(t,"hollow"),s=$v(t,jt),h=$v(t,Wt),c=$v(t,qt),l=s?new Lh:U,u=e.x,d=e.y,t=e.width,e=e.height,f=u+t/2,g=d+e/2,p=q(t,e)/2,_=0,v=0;v<i.length;v++){var y,m,b,x,w=i[v],E=J*w/n,T=o+E;Xv.fillStyle=r[_++],_===r.length&&(_=0),Xv.beginPath(),a?(y=f+Q(o)*p/2,m=g+Z(o)*p/2,b=f+Q(T)*p,x=g+Z(T)*p,Xv.moveTo(y,m),Xv.arc(f,g,p/2,o,T,!1),Xv.lineTo(b,x)):Xv.moveTo(f,g),Xv.arc(f,g,p,T,o,!0),l&&(E=(o+T)/2,l.add({text:mn(s)?s(w,v,n,Qv):w,x:f+.75*Q(E)*p,y:g+.75*Z(E)*p})),Xv.closePath(),Xv.fill(),o=T}l&&l.each(function(t){ss(Xv,t.text,h,c,t.x,t.y,0,0,ut)})}},columnChart:function(t,e){var i=$v(t,Ft);if(i&&0<i.length){var n=i.length,r=$v(t,jt),o=$v(t,Wt),a=$v(t,qt),s=r?new Lh:U,h=$v(t,"minValue")||0,c=$v(t,"maxValue");if(c==U&&(c=0,i.forEach(function(t){$v(t,Lt).forEach(function(t){c=N(c,t)})})),h!==c){for(var l=e.height/(c-h),u=e.y+c*l,d=$v(i[0],Lt).length,f=e.width/(3*d+1),g=2*f/n,p=0,_=0;_<n;_++)for(var v=i[_],y=$v(v,Je),m=$v(v,"colors"),b=$v(v,Lt),x=0;x<d;x++){m?Xv.fillStyle=m[x]:y?Xv.fillStyle=y:(Xv.fillStyle=uh[p++],p===uh.length&&(p=0));var w,E=b[x],T=E*l,S=e.x+(1+3*x)*f+_*g;lo(Xv,S,u-T,g,T),s&&(w=mn(r)?r(E,x,v,Qv):E,E=hs(o,w).height,s.add({x:S,y:u-T-E,width:g,height:E,text:w}))}s&&s.each(function(t){ss(Xv,t.text,o,a,t.x,t.y,t.width,t.height,ut)})}}},stackedColumnChart:function(t,e){var i=$v(t,Ft);if(i&&0<i.length){var n=i.length,r=$v(i[0],Lt).length,o=e.width/(3*r+1),a=0,s=$v(t,"maxValue"),h=$v(t,jt),c=$v(t,Wt),l=$v(t,qt),u=h?new Lh:U;if(s==U)for(var d=s=0;d<r;d++){for(var f=0,g=0;g<n;g++)f+=$v(i[g],Lt)[d];s=N(s,f)}if(0<s){for(d=0;d<r;d++)for(var p=e.y+e.height,g=0;g<n;g++){var _=i[g],v=$v(_,Je),y=$v(_,Lt)[d],m=y/s*e.height;v?Xv.fillStyle=v:(Xv.fillStyle=uh[a++],a===uh.length&&(a=0)),p-=m;m={x:e.x+(1+3*d)*o,y:p,width:2*o,height:m};lo(Xv,m.x,m.y,m.width,m.height),u&&(m.text=mn(h)?h(y,d,_,Qv):y,u.add(m))}u&&u.each(function(t){ss(Xv,t.text,c,l,t.x,t.y,t.width,t.height,ut)})}}},percentageColumnChart:function(t,e){var i=$v(t,Ft);if(i&&0<i.length){for(var n=i.length,r=$v(i[0],Lt).length,o=e.width/(3*r+1),a=0,s=$v(t,jt),h=$v(t,Wt),c=$v(t,qt),l=s?new Lh:U,u=0;u<r;u++){for(var d=0,f=0;f<n;f++)d+=$v(i[f],Lt)[u];if(0<d)for(var g=e.y+e.height,f=0;f<n;f++){var p=i[f],_=$v(p,Je),v=$v(p,Lt)[u],y=v/d*e.height;_?Xv.fillStyle=_:(Xv.fillStyle=uh[a++],a===uh.length&&(a=0)),g-=y;y={x:e.x+(1+3*u)*o,y:g,width:2*o,height:y};lo(Xv,y.x,y.y,y.width,y.height),l&&(y.text=mn(s)?s(v,u,p,Qv):v,l.add(y))}}l&&l.each(function(t){ss(Xv,t.text,h,c,t.x,t.y,t.width,t.height,ut)})}},lineChart:function(t,e){var i=$v(t,Ft);if(i&&0<i.length){var n=i.length,r=$v(t,"minValue")||0,o=$v(t,"maxValue");if(o==U&&(o=0,i.forEach(function(t){$v(t,Lt).forEach(function(t){o=N(o,t)})})),r!==o)for(var a=e.height/(o-r),s=e.y+o*a,h=$v(i[0],Lt).length,c=e.width/(3*h+1),l=0,u=$v(t,"lineWidth")||2,d=$v(t,"line3d"),f=$v(t,"linePoint"),g=$v(t,jt),p=$v(t,Wt),_=$v(t,qt),v=0;v<n;v++){var y=i[v],m=$v(y,Je),b=$v(y,Lt);m?Xv.strokeStyle=m:(m=Xv.strokeStyle=uh[l++],l===uh.length&&(l=0)),Xv.beginPath();for(var x=0;x<h;x++){var w=e.x+(2+3*x)*c,E=s-b[x]*a;0===x?Xv.moveTo(w,E):Xv.lineTo(w,E)}if(Xv.lineWidth=u,Xv.stroke(),d&&ho(Xv,m,U,u,Zv),f||g)for(var T,S=u/2+2,x=0;x<h;x++){var I,C,M,R,A=b[x],w=e.x+(2+3*x)*c,E=s-A*a;mn(f)?f(Xv,w,E,m,x,y,Qv):f&&(Xv.fillStyle=m,Xv.beginPath(),Xv.arc(w,E,S,0,J,!0),Xv.fill()),mn(g)?T=g(A,x,y,Qv):g&&(T=A),T&&(I=hs(p,T).height,(A=Xv.shadowBlur)&&(C=Xv.shadowOffsetX,M=Xv.shadowOffsetY,R=Xv.shadowColor,Xv.shadowOffsetX=0,Xv.shadowOffsetY=0,Xv.shadowBlur=0,Xv.shadowColor=U),ss(Xv,T,p,_,w,E-I-S+2,0,I,ut),A&&(Xv.shadowOffsetX=C,Xv.shadowOffsetY=M,Xv.shadowBlur=A,Xv.shadowColor=R))}}}}},function(t,P,e,i,n,r,o,a,s,h){if(P&&n&&r){var c=[Xv,Qv,Yv,Zv,Kv,Jv];Xv=t,Yv=a,!(Qv=o)&&Yv&&Yv.isSelfViewEvent&&(Qv=Yv),Zv=Yv&&Yv._zoom||1,Kv=s,Jv=h;var D,l,u,a=n,o=r;if(Fc(),0===Xv.maxSize&&!Fc[0]||0,Xv.texureImage2D&&!Fc[1]||0,Xv.texureImage3D&&!Fc[2]||0,Xv.drawDNDState&&!Fc[3]||0,Qi.widget[0]&&!Fc[4]||0,a=e,o=i,P.tagName)return pn(R)&&!C[R]||Xv.drawImage(P,a,o,n,r),void Nm(c);0!=$v(P,"visible")?(Kv=Kv||xh(P.color,Qv,Yv),h||(Jv=xh(P.blendMode,Qv,Yv)),pn(R)&&!C[R]&&(n=a,r=o),s=mh(P,Qv,Yv,n),e=bh(P,Qv,Yv,r),D={x:0,y:0,width:s,height:e,fitSize:$v(P,"fitSize")},i=$v(P,"clip"),h=$v(P,"opacity"),D.fitSize&&(l=D.rw=xh(P.width,Qv,Yv)||20,D.widthScale=s/l,l=D.rh=xh(P.height,Qv,Yv)||20,D.heightScale=e/l),Xv.save(),Xv.interactiveInfo&&(u=(l=Xv.interactiveInfo.matrix).clone(),l.appendTranslate(a,o).appendScale(n/s,r/e),Xv.interactiveInfo.refRect=D),pr(Xv,a,o),s===n&&e===r||Xv.scale(n/s,r/e),i&&(mn(i)?i(Xv,s,e,Qv,Yv,P):(Xv.beginPath(),Xv.rect(0,0,s,e),Xv.clip())),h!=U&&(Xv.globalAlpha*=h),$v(P,"comps").forEach(function(t){var e,i,n,r,o,a,s,h,c,l,u,d,f,g,p,_,v,y,m,b,x,w,E,T,S,I,C,M,R,A;t.prefix&&(e=dh,(p=xh(t.prefix,Qv,Yv))&&(dh=dh+p+".")),0!=function(t,e){var i;Yv&&Yv.getDrawableState?i=Yv.getDrawableState(Qv):Yv&&Yv.getState?i=Yv.getState(Qv):(i=Qv instanceof jh?Qv.s(Be):null)!==H&&null!==i||(i=$v(t,Be));t=$v(e,Be);return(t===H||null===t||t===i)&&$v(e,ee)}(P,t)?(gh.splice(0,0,t),Xv.interactiveInfo&&(i=Xv.interactiveInfo.matrix.clone()),n=$v(t,"opacity"),r=$v(t,"shadow"),o=$v(t,"type"),d=$v(t,"refRect")||D,v=d,w=$v(A=t,xt),I=Vm(A),bn(w)&&(S=w.length,R=$v(A,"relative"),f=v.width,T=v.height,4===S?(w={x:w[0],y:w[1],width:w[2],height:w[3]},R&&(w.x*=f,w.y*=T,w.width*=f,w.height*=T)):3===S&&(S=w[0],w={width:w[1],height:w[2]},R&&(w.width*=f,w.height*=T),"object"==typeof S?S.length&&(S={x:S[0],y:S[1]}):S=Fo(S,v,w),w.x=S.x-w.width*I.x,w.y=S.y-w.height*I.y),w.x+=$v(A,"offsetX")||0,w.y+=$v(A,"offsetY")||0,!R&&v.fitSize&&(w=ey(A,w,v))),a=w,n!=U&&(s=Xv.globalAlpha,Xv.globalAlpha*=n),r&&(h=Xv.shadowOffsetX,c=Xv.shadowOffsetY,l=Xv.shadowBlur,u=Xv.shadowColor,y=$v(t,"shadowOffsetX"),m=$v(t,"shadowOffsetY"),E=$v(t,"shadowBlur"),b=ty(t,"shadowColor"),Xv.shadowOffsetX=(y==U?3:y)*Zv,Xv.shadowOffsetY=(m==U?3:m)*Zv,Xv.shadowBlur=(E==U?6:E)*Zv,Xv.shadowColor=b||ty(Jo)),"save"===o?Xv.save():"endClip"===o||"restore"===o?Xv.restore():"clip"===o?(Xv.save(),ao(Xv,$v(t,"points",zm),$v(t,"segments",Lm),!0),Xv.clip()):Co[o]?(a=a||{x:0,y:0,width:d.width,height:d.height},jm(t,o,a,d)):o===Tt?jm(t,o,a,d):"SVGPath"===o?(g=o,p=a,T=$v(f=t,"path"),S=$v(f,$t),I=$v(f,"scaleX"),C=$v(f,"scaleY"),M=Vm(f),R=U,A=no(null,T),p||((p=f.unionRect)||(p=ms(A),f.path.func||(f.unionRect=p)),R=p),p&&(R||((R=f.unionRect)||(R=ms(A),f.path.func||(f.unionRect=R))),_=Fm(f,p,R,S,I,C,M),v=$v(f,"borderPattern"),w=rh(Xv,v),y=ty(f,"background"),m=ty(f,"borderColor"),E=$v(f,"borderWidth"),b=$v(f,"gradient"),A=ty(f,"gradientColor"),p=$v(f,"border3d"),S=ty(f,"border3dColor"),I=$v(f,"border3dAccuracy"),C=Xv.lineJoin,M=Xv.lineCap,Xv.lineJoin=$v(f,"borderJoin")||Ca,Xv.lineCap=$v(f,"borderCap")||Ia,y?(fo(Xv,y,b,A,R),no(Xv,T),Xv.fill(),w!==Xv&&no(Xv,T)):no(Xv,T),(A=$v(f,"borderWidthAbsolute"))&&(Xv.save(),Xv.setTransform(1,0,0,1,0,0)),E&&m&&(Xv.lineWidth=E,Xv.strokeStyle=m,Xv.stroke(),p&&ho(Xv,m,S,E,Zv,I)),oh(Xv,v),$v(f,"dash")&&0<(x=$v(f,"dashWidth")||E)&&(v=$v(f,"dashPattern")||Sa,w=rh(Xv,v,$v(f,"dashOffset")),E=ty(f,"dashColor")||ty(No),w!==Xv&&no(Xv,T),Xv.strokeStyle=E,Xv.lineWidth=x,Xv.stroke(),$v(f,"dash3d")&&ho(Xv,E,ty(f,"dash3dColor"),x,Zv,$v(f,"dash3dAccuracy")),oh(Xv,v)),A&&Xv.restore(),g===xt&&xo(Xv,y,$v(f,"depth"),R),Xv.lineJoin=C,Xv.lineCap=M,_&&km())):(a=a||{x:0,y:0,width:d.width,height:d.height},C=$v(t,$t),M=$v(t,"scaleX"),_=$v(t,"scaleY"),d=Vm(t),M=Fm(t,a,a,C,M,_,d),mn(o)?(Bm(t,o),G.drawCompType(o,Xv,a,t,Qv,Yv)):G.getCompType(o)?(d=(_=G.getCompType(o)).func||_,Bm(t,_),G.drawCompType(d,Xv,a,t,Qv,Yv)):iy[o]?iy[o](t,a):G.getCompType(o)===H&&Ui.test(o)&&ch(o),M&&km()),r&&(Xv.shadowOffsetX=h,Xv.shadowOffsetY=c,Xv.shadowBlur=l,Xv.shadowColor=u),n!=U&&(Xv.globalAlpha=s),Xv.interactiveInfo&&(Xv.interactiveInfo.matrix=i),t.prefix&&(dh=e),gh.splice(0,1)):t.prefix&&(dh=e)}),Xv.interactiveInfo&&(Xv.interactiveInfo.matrix=u),Xv.restore(),Nm(c)):Nm(c)}}),G.getCurrentComp=function(){return gh[0]},G.getParentComp=function(){return gh[1]},G.getInternal=function(){return{isEnter:Wr,isEsc:qr,isSpace:Hr,isLeft:jr,isUp:Nr,isRight:Ur,isDown:Gr,addMethod:An,superCall:Bn,toPointsArray:so,translateAndScale:gr,appendArray:Mn,createWorldMatrix:th,vec3TransformMat4:Xs,setCanvas:rr,createDiv:tr,createView:$n,createCanvas:er,createImage:hn,initContext:fr,layout:wr,fillRect:lo,Mat:oa,drawBorder:bo,isString:pn,setBorder:ir,getPropertyValue:Gn,setPropertyValue:Hn,drawVerticalLine:qn,draw3DRect:xo,getPinchDist:Ro,isSameRect:Ln,getPosition:Fo,intersectionLineRect:Nn,getNodeRect:Gh,getEdgeAgentPosition:sc,getEdgeHostPosition:ac,getImageWidth:mh,getImageHeight:bh,initItemElement:Jn,drawPoints:ao,createG2:rh,closePopup:Sr,isH:un,createAnim:Rn,createNormalMatrix:bd,toColorArray:to,createNormals:Xu,toFloatArray:Wf,glMV:xd,glPop:md,batchShape:nf,createNodeMatrix:$s,getShapeModel:Gf,getFaceInfo:Rd,transformAppend:Pu,drawFaceInfo:Ad,to3dPointsArray:Qf,setGLDebugMode:function(t){Tu=t},cube:function(){return{vs:mf,is:bf,uv:xf}},ui:function(){return{DataUI:Il,NodeUI:iu,EdgeUI:tu,GroupUI:Ml,ShapeUI:au,GridUI:Pl,Data3dUI:$g,Node3dUI:tp,Shape3dUI:np}},getInternalVersion:function(){return"U2FsdGVkX1/K/qN+9JeXiDIJbdr2TMT5dD+JjFHm0aE="},getDragger:function(){return Ir},addMSMap:function(t){An(_a,t)},k:z,addEventListener:g,removeEventListener:p}},function(t){function y(t,e){t!=U&&(e==U&&Ze!=typeof t?this._54O(t,256):this._54O(t,e))}function m(){return new y(U)}function c(t){return s.charAt(t)}function e(t){var e=m();return e._58O(t),e}function b(t){var e,i=1;return 0!=(e=t>>>16)&&(t=e,i+=16),0!=(e=t>>8)&&(t=e,i+=8),0!=(e=t>>4)&&(t=e,i+=4),0!=(e=t>>2)&&(t=e,i+=2),0!=(e=t>>1)&&(t=e,i+=1),i}function i(t){this.m=t}function n(t){this.m=t,this.mp=t._50O(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function x(t,e){return new y(t,e)}function r(){this.n=U,this.e=0,this.d=U,this.p=U,this.q=U,this.dmp1=U,this.dmq1=U,this._10A=U}function w(t){for(var e,i,n="",r=0,o=0;o<t.length&&t.charAt(o)!=g;++o)(i=f.indexOf(t.charAt(o)))<0||(r=0==r?(n+=c(i>>2),e=3&i,1):1==r?(n+=c(e<<2|i>>4),e=15&i,2):2==r?(n+=c(e),n+=c(i>>2),e=3&i,3):(n+=c(e<<2|i>>4),n+=c(15&i),0));return 1==r&&(n+=c(e<<2)),n}function E(t){var e=t.substring(0,38);return e&&30==e.indexOf("05000420")?["ss",t.substring(38)]:[]}function o(t,e){var i=x(e=(e=e.replace(I,"")).replace(/[ \n]+/g,""),16);if(i._55O()>this.n._55O())return 0;var n=E(this._37O(i)[T](16).replace(/^1f+00/,""));if(0==n.length)return!1;for(var r,o,a=Bs,s=[0,.5,.75,.875,.9375],h=[],c=[],l=[],u=J/a,e=n[1],t=(i=t,n=e,t=C._4O.Util._56O(i,"ss"),(i={}).v=t==n,i.t=1,i.s=0,Ii=i.v,i.t=0,t),d=0,f=0;d<s.length;d++)for(var g=0==d%2?0:.5,p=0;p<=a;p++)r=(p+g)*u,o=1-s[d],h.push(.5*Q(r)*o,2*s[d]*.5-.5,.5*-Z(r)*o),c.push((p+g)/a,o);for(d=0;d<s.length-1;d++){var _=d*(a+1),v=(d+1)*(a+1);for(p=0;p<a;p++)l.push(_+p,v+p+1,v+p,_+p,_+p+1,v+p+1)}return l.forEach(function(t){f+=t}),e==t&&10<f}var T="toString";V=t["D"+11182[T](K(2,5))];var a=y.prototype;ne+=gt.substr(0,1);var t="Microsoft Internet Explorer"==(t=t.navigator?t.navigator.appName:"")?(a.am=function(t,e,i,n,r,o){for(var a=32767&e,s=e>>15;0<=--o;){var h=32767&this[t],c=this[t++]>>15,l=s*h+c*a;r=((h=a*h+((32767&l)<<15)+i[n]+(1073741823&r))>>>30)+(l>>>15)+s*c+(r>>>30),i[n++]=1073741823&h}return r},30):"Netscape"!=t?(a.am=function(t,e,i,n,r,o){for(;0<=--o;){var a=e*this[t++]+i[n]+r;r=k(a/67108864),i[n++]=67108863&a}return r},26):(a.am=function(t,e,i,n,r,o){for(var a=16383&e,s=e>>14;0<=--o;){var h=16383&this[t],c=this[t++]>>14,l=s*h+c*a;r=((h=a*h+((16383&l)<<14)+i[n]+r)>>28)+(l>>14)+s*c,i[n++]=268435455&h}return r},28);a.DB=t,a.DM=(1<<t)-1,a.DV=1<<t,a.FV=K(2,52),a.F1=52-t,a.F2=2*t-52;for(var s="0123456789abcdefghijklmnopqrstuvwxyz",h=[],u=function(t){return String.fromCharCode(t)},l="0".charCodeAt(0),d=0;d<=9;++d)h[l++]=d;for(l="a".charCodeAt(0),d=10;d<36;++d)h[l++]=d;for(l="A".charCodeAt(0),d=10;d<36;++d)h[l++]=d;(t=i.prototype)._73O=function(t){return t.s<0||0<=t._52O(this.m)?t.mod(this.m):t},t.revert=function(t){return t},t._74O=function(t){t._49O(this.m,U,t)},t._75O=function(t,e,i){t._47O(e,i),this._74O(i)},t._76O=function(t,e){t._48O(e),this._74O(e)},(t=n.prototype)._73O=function(t){var e=m();return t.abs()._59O(this.m.t,e),e._49O(this.m,U,e),t.s<0&&0<e._52O(y.ZERO)&&this.m._78O(e,e),e},t.revert=function(t){var e=m();return t._77O(e),this._74O(e),e},t._74O=function(t){for(var e=this;t.t<=e.mt2;)t[t.t++]=0;for(var i=0;i<e.m.t;++i){var n=32767&t[i],r=n*e.mpl+((n*e.mph+(t[i]>>15)*e.mpl&e.um)<<15)&t.DM;for(t[n=i+e.m.t]+=e.m.am(0,r,t,i,0,e.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t._57O(),t._45O(e.m.t,t),0<=t._52O(e.m)&&t._78O(e.m,t)},t._75O=function(t,e,i){t._47O(e,i),this._74O(i)},t._76O=function(t,e){t._48O(e),this._74O(e)},a._77O=function(t){for(var e=this.t-1;0<=e;--e)t[e]=this[e];t.t=this.t,t.s=this.s},a._58O=function(t){this.t=1,this.s=t<0?-1:0,0<t?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},a._54O=function(t,e){var i,n=this;if(16==e)i=4;else if(8==e)i=3;else if(256==e)i=8;else if(2==e)i=1;else if(32==e)i=5;else{if(4!=e)return void n.fromRadix(t,e);i=2}n.t=0,n.s=0;for(var r=t.length,o=!1,a=0;0<=--r;){var s=8==i?255&t[r]:(s=r,(s=h[t.charCodeAt(s)])==U?-1:s);s<0?"-"==t.charAt(r)&&(o=!0):(o=!1,0==a?n[n.t++]=s:a+i>n.DB?(n[n.t-1]|=(s&(1<<n.DB-a)-1)<<a,n[n.t++]=s>>n.DB-a):n[n.t-1]|=s<<a,(a+=i)>=n.DB&&(a-=n.DB))}8==i&&0!=(128&t[0])&&(n.s=-1,0<a&&(n[n.t-1]|=(1<<n.DB-a)-1<<a)),n._57O(),o&&y.ZERO._78O(n,n)},a._57O=function(){for(var t=this.s&this.DM;0<this.t&&this[this.t-1]==t;)--this.t},a._59O=function(t,e){for(var i=this.t-1;0<=i;--i)e[i+t]=this[i];for(i=t-1;0<=i;--i)e[i]=0;e.t=this.t+t,e.s=this.s},a._45O=function(t,e){for(var i=t;i<this.t;++i)e[i-t]=this[i];e.t=N(this.t-t,0),e.s=this.s},a._44O=function(t,e){for(var i=this,n=t%i.DB,r=i.DB-n,o=(1<<r)-1,a=k(t/i.DB),s=i.s<<n&i.DM,h=i.t-1;0<=h;--h)e[h+a+1]=i[h]>>r|s,s=(i[h]&o)<<n;for(h=a-1;0<=h;--h)e[h]=0;e[a]=s,e.t=i.t+a+1,e.s=i.s,e._57O()},a._46O=function(t,e){var i=this;e.s=i.s;var n=k(t/i.DB);if(n>=i.t)e.t=0;else{var r=t%i.DB,o=i.DB-r,a=(1<<r)-1;e[0]=i[n]>>r;for(var s=n+1;s<i.t;++s)e[s-n-1]|=(i[s]&a)<<o,e[s-n]=i[s]>>r;0<r&&(e[i.t-n-1]|=(i.s&a)<<o),e.t=i.t-n,e._57O()}},a._78O=function(t,e){for(var i=this,n=0,r=0,o=q(t.t,i.t);n<o;)r+=i[n]-t[n],e[n++]=r&i.DM,r>>=i.DB;if(t.t<i.t){for(r-=t.s;n<i.t;)r+=i[n],e[n++]=r&i.DM,r>>=i.DB;r+=i.s}else{for(r+=i.s;n<t.t;)r-=t[n],e[n++]=r&i.DM,r>>=i.DB;r-=t.s}e.s=r<0?-1:0,r<-1?e[n++]=i.DV+r:0<r&&(e[n++]=r),e.t=n,e._57O()},a._47O=function(t,e){var i=this.abs(),n=t.abs(),r=i.t;for(e.t=r+n.t;0<=--r;)e[r]=0;for(r=0;r<n.t;++r)e[r+i.t]=i.am(0,n[r],e,r,0,i.t);e.s=0,e._57O(),this.s!=t.s&&y.ZERO._78O(e,e)},a._48O=function(t){for(var e=this.abs(),i=t.t=2*e.t;0<=--i;)t[i]=0;for(i=0;i<e.t-1;++i){var n=e.am(i,e[i],t,2*i,0,1);(t[i+e.t]+=e.am(i+1,2*e[i],t,2*i+1,n,e.t-i-1))>=e.DV&&(t[i+e.t]-=e.DV,t[i+e.t+1]=1)}0<t.t&&(t[t.t-1]+=e.am(i,e[i],t,2*i,0,1)),t.s=0,t._57O()},a._49O=function(t,e,i){var n=t.abs(),r=this;if(!(n.t<=0)){var o=r.abs();if(o.t<n.t)return e!=U&&e._58O(0),void(i!=U&&r._77O(i));i==U&&(i=m());var a=m(),s=r.s,h=t.s,t=r.DB-b(n[n.t-1]);0<t?(n._44O(t,a),o._44O(t,i)):(n._77O(a),o._77O(i));var c=a.t,l=a[c-1];if(0!=l){var o=l*(1<<r.F1)+(1<c?a[c-2]>>r.F2:0),u=r.FV/o,d=(1<<r.F1)/o,f=1<<r.F2,g=i.t,p=g-c,_=e==U?m():e;for(a._59O(p,_),0<=i._52O(_)&&(i[i.t++]=1,i._78O(_,i)),y.ONE._59O(c,_),_._78O(a,a);a.t<c;)a[a.t++]=0;for(;0<=--p;){var v=i[--g]==l?r.DM:k(i[g]*u+(i[g-1]+f)*d);if((i[g]+=a.am(0,v,i,p,0,c))<v)for(a._59O(p,_),i._78O(_,i);i[g]<--v;)i._78O(_,i)}e!=U&&(i._45O(c,e),s!=h&&y.ZERO._78O(e,e)),i.t=c,i._57O(),0<t&&i._46O(t,i),s<0&&y.ZERO._78O(i,i)}}},a._50O=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return 0<(e=(e=65535&(e=255&(e=15&e*(2-(15&t)*e))*(2-(255&t)*e))*(2-(65535&(65535&t)*e)))*(2-t*e%this.DV)%this.DV)?this.DV-e:-e},a._51O=function(){return 0==(0<this.t?1&this[0]:this.s)},a.exp=function(t,e){if(4294967295<t||t<1)return y.ONE;var i,n=m(),r=m(),o=e._73O(this),a=b(t)-1;for(o._77O(n);0<=--a;)e._76O(n,r),0<(t&1<<a)?e._75O(r,o,n):(i=n,n=r,r=i);return e.revert(n)},a.toString=function(t){var e,i=this;if(i.s<0)return"-"+i._85O()[T](t);if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return i.toRadix(t);e=2}var n,r=(1<<e)-1,o=!1,a="",s=i.t,h=i.DB-s*i.DB%e;if(0<s--)for(h<i.DB&&0<(n=i[s]>>h)&&(o=!0,a=c(n));0<=s;)h<e?(n=(i[s]&(1<<h)-1)<<e-h,n|=i[--s]>>(h+=i.DB-e)):(n=i[s]>>(h-=e)&r,h<=0&&(h+=i.DB,--s)),0<n&&(o=!0),o&&(a+=c(n));return o?a:"0"},a._85O=function(){var t=m();return y.ZERO._78O(this,t),t},a.abs=function(){return this.s<0?this._85O():this},a._52O=function(t){var e=this.s-t.s;if(0!=e)return e;var i=this.t;if(0!=(e=i-t.t))return this.s<0?-e:e;for(;0<=--i;)if(0!=(e=this[i]-t[i]))return e;return 0},a._55O=function(){return this.t<=0?0:this.DB*(this.t-1)+b(this[this.t-1]^this.s&this.DM)},a.mod=function(t){var e=m();return this.abs()._49O(t,U,e),this.s<0&&0<e._52O(y.ZERO)&&t._78O(e,e),e},a._53O=function(t,e){return e=new(t<256||e._51O()?i:n)(e),this.exp(t,e)},y.ZERO=e(0),y.ONE=e(1),a._86O=function(){var t=this;if(t.s<0){if(1==t.t)return t[0]-t.DV;if(0==t.t)return-1}else{if(1==t.t)return t[0];if(0==t.t)return 0}return(t[1]&(1<<32-t.DB)-1)<<t.DB|t[0]},Zr=function(){var e,t=(d=(u=S).split(""),e=w(u),d.forEach(function(t){0<t.length&&e&&(Si+=tt(t))}),e),i=t.substr(0,4),n=t.substr(4,2),r=t.substr(6,2),o=!1,a=z,s=[],h=ii.charAt(7);if(V&&(V[T]().indexOf("nat")<0||V[ne][T]().indexOf("nat")<0||!t?g=U:(f=(t=new V(+i,n-1,+r)).setHours(9),V[ne]()>f?g=oo[h]:o=!0)),t&&g&&g[0]&&g[j(.5)]&&a){var c,l=Ys(g[0]),u=Ys(g[1]);for(c in u)s.push(c);var d=0,i=l[s[0]],n=u[s[d++]],r=u[s[d++]],f=u[s[d++]],t=u[s[d++]],g=u[s[d++]],p=u[s[d++]],l=l[s[6]],d=u[s[d++]],a=O._27O(a);if(i===n&&a&&d){t=n+r+f+t+g+p;var _=!p||p===di;if(!_&&p)for(var v,y=0,m=p.length;y<m;y++)p[y]===ye[7]?v===di||v[0]===Xt[5]&&di&&0<=di.indexOf(v.substr(1))?_=!0:v=U:(v==U?v=p[y]:v+=p[y],y===m-1&&(v===di||v[0]===Xt[5]&&di&&0<=di.indexOf(v.substr(1)))&&(_=!0));t&&a._31O(t,d)&&a._31O(i,l)&&_&&(!g||V[ne]()<g)&&(o=!0)}}return o||(uo=Vn),h},(a=r.prototype)._37O=function(t){return t._53O(this.e,this.n)},a._38O=function(t,e){this.isPublic=!0,typeof t!==Ze?(this.n=t,this.e=e):t!=U&&e!=U&&0<t.length&&0<e.length&&(this.n=x(t,16),this.e=tt(e,16))};var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g="=",S="ICFhU===",v=v||function(){var t={},e=t._7A={},i=e._6A={_80O:function(t){h.prototype=this;var e=new h;return t&&e._5A(t),e.hasOwnProperty("_82O")||(e._82O=function(){e.$super._82O.apply(this,arguments)}),(e._82O.prototype=e).$super=this,e},_3A:function(){var t=this._80O();return t._82O.apply(t,arguments),t},_82O:function(){},_5A:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty(T)&&(this.toString=t.toString)},_88O:function(){return this._82O.prototype._80O(this)}},c=e._39O=i._80O({_82O:function(t,e){t=this._84O=t||[],this._65O=null!=e?e:4*t.length},toString:function(t){return(t||r).stringify(this)},_89O:function(t){var e=this._84O,i=t._84O,n=this._65O,r=t._65O;if(this._57O(),n%4)for(var o=0;o<r;o++){var a=255&i[o>>>2]>>>24-o%4*8;e[n+o>>>2]|=a<<24-(n+o)%4*8}else if(65535<i.length)for(o=0;o<r;o+=4)e[n+o>>>2]=i[o>>>2];else e.push.apply(e,i);return this._65O+=r,this},_57O:function(){var t=this._84O,e=this._65O;t[e>>>2]&=4294967295<<32-e%4*8,t.length=j(e/4)},_88O:function(){var t=i._88O.call(this);return t._84O=this._84O.slice(0),t},_87O:function(t){for(var e=[],i=0;i<t;i+=4)e.push(0|4294967296*$);return new c._82O(e,t)}}),n=t._2A={},r=n._69O={stringify:function(t){for(var e=t._84O,i=t._65O,n=[],r=0;r<i;r++){var o=255&e[r>>>2]>>>24-r%4*8;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},_68O:function(t){for(var e=t.length,i=[],n=0;n<e;n+=2)i[n>>>3]|=tt(t.substr(n,2),16)<<24-n%8*4;return new c._82O(i,e/2)}},o=n._8A={stringify:function(t){for(var e=t._84O,i=t._65O,n=[],r=0;r<i;r++){var o=255&e[r>>>2]>>>24-r%4*8;n.push(u(o))}return n.join("")},_68O:function(t){for(var e=t.length,i=[],n=0;n<e;n++)i[n>>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new c._82O(i,e)}},a=n._9A={stringify:function(t){try{return decodeURIComponent(escape(o.stringify(t)))}catch(t){throw new Error("")}},_68O:function(t){return o._68O(unescape(encodeURIComponent(t)))}},s=e._32O=i._80O({_1A:function(){this._83O=new c._82O,this._23O=0},_33O:function(t){typeof t==Ze&&(t=a._68O(t)),this._83O._89O(t),this._23O+=t._65O},_25O:function(t){var e=this._83O,i=e._84O,n=e._65O,r=this._79O,o=n/(4*r),a=(o=t?j(o):N((0|o)-this._22O,0))*r,n=q(4*a,n);if(a){for(var s=0;s<a;s+=r)this._20O(i,s);var h=i.splice(0,a);e._65O-=n}return new c._82O(h,n)},_88O:function(){var t=i._88O.call(this);return t._83O=this._83O._88O(),t},_22O:0});function h(){}e._66O=s._80O({cfg:i._80O(),_82O:function(t){this.cfg=this.cfg._80O(t),this._1A()},_1A:function(){s._1A.call(this),this._34O()},_81O:function(t){return this._33O(t),this._25O(),this},_72O:function(t){return t&&this._33O(t),this._21O()},_79O:16,_26O:function(i){return function(t,e){return new i._82O(e)._72O(t)}},_19O:function(i){return function(t,e){return new l._71O._82O(i,e)._72O(t)}}});var l=t._67O={};return t}();!function(){var t=v,e=(n=t._7A)._39O,i=n._66O,n=t._67O,r=[],p=[];!function(){function t(t){return 0|4294967296*(t-(0|t))}for(var e=2,i=0;i<64;)!function(t){for(var e=W(t),i=2;i<=e;i++)if(!(t%i))return;return 1}(e)||(i<8&&(r[i]=t(K(e,.5))),p[i]=t(K(e,1/3)),i++),e++}();var _=[],n=n._41O=i._80O({_34O:function(){this._64O=new e._82O(r.slice(0))},_20O:function(t,e){for(var i=this._64O._84O,n=i[0],r=i[1],o=i[2],a=i[3],s=i[4],h=i[5],c=i[6],l=i[7],u=0;u<64;u++){u<16?_[u]=0|t[e+u]:(f=((g=_[u-15])<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,g=((d=_[u-2])<<15|d>>>17)^(d<<13|d>>>19)^d>>>10,_[u]=f+_[u-7]+g+_[u-16]);var d=n&r^n&o^r&o,f=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),g=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&h^~s&c)+p[u]+_[u],l=c,c=h,h=s,s=0|a+g,a=o,o=r,r=n,n=0|g+(f+d)}i[0]=0|i[0]+n,i[1]=0|i[1]+r,i[2]=0|i[2]+o,i[3]=0|i[3]+a,i[4]=0|i[4]+s,i[5]=0|i[5]+h,i[6]=0|i[6]+c,i[7]=0|i[7]+l},_21O:function(){var t=this._83O,e=t._84O,i=8*this._23O,n=8*t._65O;return e[n>>>5]|=128<<24-n%32,e[14+(64+n>>>9<<4)]=k(i/4294967296),e[15+(64+n>>>9<<4)]=i,t._65O=4*e.length,this._25O(),this._64O},_88O:function(){var t=i._88O.call(this);return t._64O=this._64O._88O(),t}});t._41O=i._26O(n),t._42O=i._19O(n)}();var I=new RegExp("");I.compile("[^0-9a-f]","gi"),r._28O=-1,r._29O=-2,a._31O=o,a._63O=o,r._43O=-2;var C,p=new function(){var h=this;h._5O=function(t,e){if("8"!=t.substring(e+2,e+3))return 1;e=tt(t.substring(e+3,e+4));return 0==e?-1:0<e&&e<10?e+1:-2},h._13O=function(t,e){var i=h._5O(t,e);return i<1?"":t.substring(e+2,e+2+2*i)},h._12O=function(t,e){e=h._13O(t,e);return""==e?-1:(tt(e.substring(0,1))<8?new y(e,16):new y(e.substring(2),16))._86O()},h._6O=function(t,e){t=h._5O(t,e);return t<0?t:e+2*(t+1)},h._11O=function(t,e){var i=h._6O(t,e),e=h._12O(t,e);return t.substring(i,i+2*e)},h._10O=function(t,e){return h._6O(t,e)+2*h._12O(t,e)},h._7O=function(t,e){var i=[],n=h._6O(t,e);i.push(n);for(var r=h._12O(t,e),o=n,a=0;;){var s=h._10O(t,o);if(s==U||2*r<=s-n)break;if(200<=a)break;i.push(s),o=s,a++}return i}};p._90O=u(34),p._91O=bm+u(108),C!=U&&C||(C={}),C._4O!=U&&C._4O||(C._4O={});var _=C._4O;function M(t){return(t=t.replace(I,"")).replace(/[ \n]+/g,"")}C._4O.Util=new function(){this._56O=function(t){return(new C._4O._3O)._30O(t)},this._4A=function(t){return(new C._4O._3O)._36O(t)},this._11A=function(t){return(new _._3O)._30O(t)}},C._4O._3O=function(){var i=this;i._8O=function(t,e){if("ss"==t&&"cj"==e){try{i.md=v._67O._41O._3A()}catch(t){}i._24O=function(t){i.md._81O(t)},i._35O=function(t){t=v._2A._69O._68O(t);i.md._81O(t)},i._60O=function(){return i.md._72O()[T](v._2A._69O)},i._30O=function(t){return i._24O(t),i._60O()},i._36O=function(t){return i._35O(t),i._60O()}}},i._24O=function(){},i._35O=function(){},i._60O=function(){},i._30O=function(){},i._36O=function(){},i._8O("ss","cj")},Ci=function(t){var e=Qn[He[7]],i=!1;if(Qr.a!=Qn[ti])return Qr.a;var n=!1,r="20t32bt02b28 12c12c11".replace(/b/g,"-").replace(/c/g,":").replace(/t/g,"");if(new Date(r).getTime()<(new Date).getTime()&&(n=!0),Qr.forEach(function(t){0}),n){if(e&&e[1]&&e[0]){var o=e[0],a=(a=e[1]).split(p._90O),o=o.split(p._90O),s=a[3],h=o[3],c=a[7],l=a[11],r=a[15],n=a[19],e=a[23],a=a[27],o=o[7],r=s+c+l+r+n+e,u=!e,s=h===s;if(e){var d=e&&e.split(gn("firefox")[3]);if(d)for(var f=0;f<d.length;f++){var g=d[f];if(g[0]===ce[8]&&(g=g.substring(1)),0<=Xe.indexOf(g)){u=!0;break}}}(i=s&&$i()(h,o)&&$i()(r,a)&&u&&(!n||t<n))&&0<=l.indexOf(pt.length)&&(Ci[pt.length]=pt),i&&0<=l.indexOf(pt.length+1)&&(Ci[pt.length+1]=pt),i&&0<=l.indexOf(pt.length+3)&&(Ci[pt.length+3]=pt)}i||(Il.prototype._42=Ti)}else i=!0,Ci[pt.length]=Ci[pt.length+1]=Ci[pt.length+3]=pt;return Qr.a=i},String.fromCharCode(45);var R,A,P=x,D=/^1f+00/,O=(a={_18O:function(t){return w(t.replace(/\s+/g,""))},_14O:function(t){t=this._18O(t);return this._15O(t)},_15O:function(t){var e=this._17O(t);if("2a864886f70d010101"==e._61O){t=this._16O(e.key),e=new r;return e._38O(t.n,t.e),e}},_16O:function(t){var e={};t.substr(0,2);var i=p._7O(t,0);return i.length,t.substr(i[0],2),e.n=p._11O(t,i[0]),t.substr(i[1],2),e.e=p._11O(t,i[1]),e},_17O:function(t){var e={};e._40O=U;var i=p._7O(t,0);i.length;var n=i[0];t.substr(n,2);n=p._7O(t,n);return n.length,t.substr(n[0],2),e._61O=p._11O(t,n[0]),"06"==t.substr(n[1],2)?e._40O=p._11O(t,n[1]):"30"==t.substr(n[1],2)&&(e._40O={},e._40O.p=p._70O(t,n[1],[0],"02"),e._40O.q=p._70O(t,n[1],[1],"02"),e._40O.g=p._70O(t,n[1],[2],"02")),t.substr(i[1],2),e.key=p._11O(t,i[1]).substr(2),e}})._17O?a:U,B=O._27O=function(t){return O._14O(t)};$i=function(){return function(t,e){if(t&&e){e=M(e);e=P(e,K(2,4));if(!this||!this.n||e._55O()>this.n._55O())return 0;e=E(this._37O(e)[T](K(2,4)).replace(D,""));if(0==e.length)return!1;var i=e[0];return e[1]==(n=t,C._4O.Util._56O(n,i))}var n}.bind(B(z))},function(){var t=be.length-me.length;if(0<t)for(var e=0;e<t;e++)R=_.Util,A=M}(),Wi=function(t,e){e=A(e);var i=B(ih),n=vt.length,r=2*n,o=P(e,K(n,r)),a=i,e=!0;if(!a||(i=a[_t[0]])&&o._55O()<=i._55O()&&(e=!1),e)return 0;n=E(a._37O(o)[T](K(n,r)).replace(D,""));if(0==n.length)return!1;r=n[0];return n[1]==R._11A(t,r)}}(C),An(G,{load:(qv={},function(t,e,i){var n,r,o=qv[t],a=(r=i)?"c_"+(r.sync?"1":"0")+"_"+(r.post?"1":"0")+"_"+(r.responseType||"H")+"_"+(r.mimeType||"H")+"_"+(r.data?JSON.stringify(r.data):"H"):"";return o&&(n=o[a])?void n.push(e):(qv[t]||(o=qv[t]={count:0}),n=o[a]=[e],o.count++,void G.xhrLoad(t,function(e){delete o[a],o.count--,o.count||delete qv[t],n.forEach(function(t){t(e)})},i))}),asyncEach:function(n,e,r){"function"!=typeof r&&(r=Function.prototype);var o=new Array(n.length),a=0,s=!1;n.forEach(function(t,i){e(t,function(t,e){return s?void 0:t?(s=!0,r(null)):(o[i]=e,++a===n.length?r(o):void 0)})})},xhrLoad:function(t,i,n){var r=!1;bn(t)||(r=!0,t=[t]);var o=(n=n||{}).sync,a=null,e=n.method||"GET";return n.post&&(e="POST"),n.method=e,G.asyncEach(t,function(t,e){var i=new Sl;(t=G.beforeLoadURL(t)).data?e(null,t.data):(n.url=encodeURI(t),n.responseType?i.setResponseType(n.responseType):i.setOverrideMimeType(n.mimeType||"text/plain"),i.onload=function(){200===this.status||0===this.status?e(null,i.getResponseText()):e(!0)},i.onerror=function(){e(!0)},i.send(n))},function(t){var e="function"==typeof i;(e||o)&&(a=r&&t?t[0]:t,e&&i(a))}),o?a:void 0}}),Eh=L.setPrototypeOf||function(t,e){return t.__proto__=e,t},Th=L.getPrototypeOf||function(t){return t.__proto__},Mh=L.freeze,L.isFrozen,Sh=function(t){return t&&t.length?new Function("o",["return o['",t.join("']['"),"'];"].join("")):Om},Ih=function(t){return t&&t.length?new Function("o","v",["return o['",t.join("']['"),"'] = v;"].join("")):Dm},Pm.create=function(t,e){return function t(e,i,n,r){var o=r(n),a=new Pm(e,i,n,o);if(!o){for(var s=a.children,h=a.childMap,c=L.keys(n),l=0,u=c.length;l<u;++l){var d=c[l],d=t(a,d,n[d],r);s.push(d),h[d.name]=d}a.children=Mh(s),a.childMap=Mh(h)}return Mh(a),a}(H,H,t,e)},Pm.prototype.forEach=function(t,e){for(var i=this.children,n=0,r=i.length;n<r;++n)t(i[n],e)},Ch=Pm,Mh=L.freeze,Rh={main:{mask:1,priority:G.cameraPriority.main,clearDepth:!1,ignore:!1},top:{mask:2,priority:G.cameraPriority.top,ignore:!1}},Ph=Rh[Ah="main"].mask,Dh=function(t,e,i){if(t=t||0,!(e in Rh)){if(32<=Vh)throw new Error("Only 31 render layer can be defined.");Rh[e]={mask:1<<Vh++,priority:Rh[Ah].priority}}if(i)for(var n in i)Rh[e][n]=i[n];return zh=Bh(L.keys(Rh)),Vh=zh.length,t|Rh[e].mask},Oh=function(t,e){return t&&e&&t&e},zh=(Bh=function(t){return t.sort(function(t,e){return Rh[t].priority-Rh[e].priority})})(L.keys(Rh)),Vh=zh.length,An(G,{setRenderLayerInfo:function(t,e){Dh(0,t,e)},getRenderLayerInfo:function(t){return Rh[t]}},!0),Lh=Gl.List=function(){this._as=[];var t,e,i=arguments.length;if(1===i){var n=arguments[0];if(xn(n)&&(n=n._as),bn(n))for(e=n.length,t=0;t<e;t++)this._as.push(n[t]);else n!=U&&this._as.push(n)}else if(1<i)for(t=0;t<i;t++)this._as.push(arguments[t])},Vs("List",L,{forEach:function(t,e){this.each(t,e)},push:function(){for(var t=0;t<arguments.length;t++)this.add(arguments[t])},pop:function(){return this._as.pop()},shift:function(){return this._as.shift()},unshift:function(){return this._as.unshift.apply(this._as,arguments)},size:function(){return this._as.length},isEmpty:function(){return 0===this._as.length},add:function(t,e){return e===H?this._as.push(t):this._as.splice(e,0,t)},addAll:function(t){xn(t)&&(t=t._as),bn(t)?Mn(this._as,t):this._as.push(t)},get:function(t){return this._as[t]},slice:function(t,e){return new Lh(this._as.slice(t,e))},remove:function(t){t=this._as.indexOf(t);return 0<=t&&t<this._as.length&&this.removeAt(t),t},removeAt:function(t){return this._as.splice(t,1)[0]},set:function(t,e){return this._as[t]=e},clear:function(){return this._as.splice(0,this._as.length)},contains:function(t){return 0<=this._as.indexOf(t)},indexOf:function(t){return this._as.indexOf(t)},each:function(t,e){for(var i=0,n=this._as.length;i<n;i++){var r=this._as[i];e?t.call(e,r,i,this):t(r,i,this)}},reverseEach:function(t,e){for(var i=this._as.length-1;0<=i;i--){var n=this._as[i];e?t.call(e,n):t(n)}},getArray:function(){return this._as},toArray:function(t,e){if(t){for(var i,n=[],r=0,o=this._as.length;r<o;r++)i=this._as[r],e?t.call(e,i)&&n.push(i):t(i)&&n.push(i);return n}return this._as.concat()},toList:function(t,e){if(t){for(var i,n=new Lh,r=0,o=this._as.length;r<o;r++)i=this._as[r],e?t.call(e,i)&&n.add(i):t(i)&&n.add(i);return n}return new Lh(this)},reverse:function(){this._as.reverse()},sort:function(t){return this._as.sort(t||es),this},toString:function(){return this._as.toString()}}),L.defineProperties(Lh.prototype,{length:{get:function(){return this._as.length},set:function(t){this._as.length=t}}}),Fh=new Lh,An(Fh,{size:function(){return 0},indexOf:function(){return-1},contains:function(){return!1},isEmpty:function(){return!0},sort:Yi,each:Yi,reverseEach:Yi,toArray:function(){return[]},toList:function(){return new Lh},add:Zi,addAll:Zi,set:Zi,remove:Zi,removeAt:Zi,clear:Zi}),kh=Gl.Notifier=function(){this._f=0},Vs("Notifier",L,{contains:function(t,e){if(this._ls)for(var i,n=0,r=this._ls.size();n<r;n++)if(t===(i=this._ls.get(n)).l&&e===i.s)return!0;return!1},add:function(t,e,i){i={l:t,s:e,a:i};this._ls||(this._ls=new Lh),this._f?(this._as||(this._as=new Lh),this._as.add(i)):i.a?this._ls.add(i,0):this._ls.add(i)},remove:function(t,e){this._ls&&(this._f?(this._rs||(this._rs=new Lh),this._rs.add({l:t,s:e})):this._remove(t,e))},_remove:function(t,e){for(var i,n=this._ls,r=0,o=n.size();r<o;r++)if((i=n.get(r)).l===t&&i.s===e)return void n.removeAt(r)},fire:function(t){var e=this,i=e._ls;if(e._b=1e4,i){++e._f;try{for(var n,r=0,o=i.size();r<o;r++)(n=i.get(r)).s?n.l.call(n.s,t):n.l(t)}catch(t){w(function(){throw t})}finally{if(--e._f)return;if(e._rs){for(o=e._rs.size(),r=0;r<o;r++)n=e._rs.get(r),e._remove(n.l,n.s);delete e._rs}if(e._as){for(o=e._as.size(),r=0;r<o;r++)(n=e._as.get(r)).a?i.add(n,0):i.add(n);delete e._as}}}}}),jh=Gl.Data=function(){this._id=Ja()},Vs("Data",L,{ms_ac:["tag","name","displayName","icon","toolTip","attrObject","styleMap","layer","adjustChildrenToTop","dataBindings"],ms_dm:1,ms_attr:1,_icon:U,_parent:U,_children:Fh,_childMap:U,_styleMap:U,_layer:"0",_renderLayer:Ah,_renderLayerMask:Ph,_adjustChildrenToTop:!1,getRenderLayerMask:function(){return this._renderLayerMask||Ph},getRenderLayer:function(){return this._renderLayer||Ah},setRenderLayer:function(t){var e=Dh(0,t);this._renderLayerMask=e;e=this._renderLayer;this._renderLayer=t,this.fp("renderLayer",e,this._renderLayer)},testRenderLayer:function(t){return Rh[t]&&Oh(this._renderLayerMask,Rh[t].mask)},getUIClass:function(){return U},_22Q:function(){return U},beginTransaction:function(){this._dataModel&&this._dataModel.beginTransaction()},endTransaction:function(){this._dataModel&&this._dataModel.endTransaction()},s:function(t,e){if(2===arguments.length)this.setStyle(t,e);else{if(!yn(t))return this.getStyle(t);for(var i in t)this.setStyle(i,t[i])}return this},fp:function(t,e,i,n,r){return this.firePropertyChange(t,e,i,n,r)},firePropertyChange:function(t,e,i,n,r){if(n){if(n(e,i))return!1}else if(e===i)return!1;r=r||{};return r.property=t,r.oldValue=e,r.newValue=i,(r.data=this)._dataModel&&this._dataModel.handleDataPropertyChange(r),this.onPropertyChanged(r),!0},onPropertyChanged:function(t){var e,i=this._parent,n=t.property;Tn(i)&&(e="s:ingroup"===n,((t=this.s(Pt))&&Qh[n]||n===e)&&i._81I(),(t||e)&&i.fp("childChange",!0,!1)),In(i)&&(Qh[n]||"elevation"===n||Zh[n]||"scaleTall"===n||"tall"===n)&&i.updateFromChildren()},_21I:function(t){if(t&&this._dataModel)throw"Remove data from dataModel before adding";this._dataModel=t},removeFromDataModel:function(){this._dataModel?this._dataModel.remove(this):this.setParent(null)},clearChildrenFromDataModel:function(){for(var t=0,e=this._children.toArray(),i=e.length;t<i;t++)e[t].removeFromDataModel()},getId:function(){return this._id},setId:function(t){this._id=t},getChildren:function(){return this._children},size:function(){return this._children.size()},toChildren:function(t,e){return this._children.toList(t,e)},eachChild:function(t,e){this._children.each(t,e)},addChild:function(t,e){var i=this;t!==i&&(i._children===Fh&&(i._children=new Lh,i._childMap={}),0<=e||(e=i._children.size()),i._childMap[t._id]||i.isDescendantOf(t)||(t._parent&&t._parent.removeChild(t),(e<0||e>i._children.size())&&(e=i._children.size()),i._children.add(t,e),(i._childMap[t._id]=t).setParent(i),i.onChildAdded(t,e),i.fp(Ae,U,t)))},onChildAdded:function(){},removeChild:function(t){var e;this._childMap&&this._childMap[t._id]&&(e=this._children.remove(t),delete this._childMap[t._id],this.fp(Ae,t,U),t.setParent(U,e),this.onChildRemoved(t,e))},onChildRemoved:function(){},getChildAt:function(t){return this._children.get(t)},clearChildren:function(){if(!this._children.isEmpty())for(var t=0,e=this._children.toArray(),i=e.length;t<i;t++)this.removeChild(e[t])},getParent:function(){return this._parent},setParent:function(t,e){var i,n,r=this;r._73I||r._parent===t||r===t||t&&t.isDescendantOf(r)||(n=r._parent,r._parent=t,r._73I=1,n?(e==U&&(e=n.getChildren().indexOf(r)),n.removeChild(r)):r._dataModel&&e==U&&(e=r._dataModel.getRoots().indexOf(r)),t&&(t.addChild(r),i=t.getChildren().indexOf(r)),delete r._73I,r.fp("parent",n,t,H,{oldIndex:e,newIndex:i}),r.onParentChanged(n,t))},onParentChanged:function(){},hasChildren:function(){return 0<this._children.size()},isEmpty:function(){return this._children.isEmpty()},isRelatedTo:function(t){return!!t&&(this.isDescendantOf(t)||t.isDescendantOf(this))},isParentOf:function(t){return!(!t||!this._childMap)&&!!this._childMap[t._id]},isDescendantOf:function(t){if(!t||t.isEmpty())return!1;for(var e=this._parent;e;){if(t===e)return!0;e=e._parent}return!1},getStyle:function(t,e){e===H&&(e=1);var i=this._styleMap?this._styleMap[t]:H;return i===H&&e?F[t]:i},setStyle:function(t,e){this._styleMap||(this._styleMap={});var i=this._styleMap[t];e===H?delete this._styleMap[t]:this._styleMap[t]=e,this.fp("s:"+t,i,e)&&this.onStyleChanged(t,i,e)},onStyleChanged:function(){},iv:function(t){this.invalidate(t)},invalidate:function(t){this.fp(t||"*",!1,!0)},toString:function(){return this._displayName||this._name||this._tag||this._id},toLabel:function(){return this._displayName||this._name},addStyleIcon:function(t,e){var i=this.s(Ht);this.beginTransaction(),i||this.s(Ht,i={}),e?i[t]=e:delete i[t],this.fp(Ht,U,i),this.endTransaction()},removeStyleIcon:function(t){var e,i=this.s(Ht);return i&&(e=i[t],delete i[t],this.fp(Ht,U,i)),e},_calcAnchorMatrix3d:function(){},appendAnchorMatrix3d:function(t){var e,i,n;(this.hasOwnProperty("_anchor")||this.hasOwnProperty("_anchorElevation"))&&(e=(n=this.getAnchor3d()).x-.5,i=n.y-.5,n=n.z-.5,ju(t,[-e,-i,-n]))},getSerializableProperties:function(){return{name:1,displayName:1,icon:1,toolTip:1,parent:1,layer:1,renderLayer:1,tag:1,adjustChildrenToTop:1,dataBindings:1}},getSerializableStyles:function(){var t,e={};for(t in this._styleMap)e[t]=1;return e},getCurrentPrefix:function(){return this._interactPrefix||dh},ca:function(t,e){return t=this.getCurrentPrefix()+t,2===arguments.length?this.a(t,e):this.a(t)}}),Nh=Gl.DataModel=function(){var n=this;n._isDeserializing=0,n._datas=new Lh,n._dataMap={},n._roots=new Lh,n._rootMap={},n._fsDataMap={},n._78O={},n._reflectorMap={},n._36I=new kh,n._35I=new kh,n._serializeNotifier=new kh,n._selectionModel=new Uh(n);var r=n._29Q=[],o=n._scheduleCallback=function(){for(var t=Date.now(),e=0;e<r.length;e++){var i=r[e];i.enabled&&t-i.lastTime>i.interval&&(i.beforeAction&&i.beforeAction(),i.action&&n.each(function(t){i.action(t)}),i.afterAction&&i.afterAction(),i.lastTime=t)}r.length&&(n._30Q=C.requestAnimationFrame(o))}},Vs("DataModel",L,{ms_fire:1,ms_attr:1,ms_ac:["layers","name","autoAdjustIndex","hierarchicalRendering","background","envmap","postProcessingData","init"],_name:H,_autoAdjustIndex:!0,_hierarchicalRendering:!1,_background:H,_init:H,_envmap:H,_cubicEnvmap:!1,_postProcessingData:H,sm:function(){return this.getSelectionModel()},mm:function(t,e,i){this.addDataModelChangeListener(t,e,i)},umm:function(t,e){this.removeDataModelChangeListener(t,e)},md:function(t,e,i){this.addDataPropertyChangeListener(t,e,i)},umd:function(t,e){this.removeDataPropertyChangeListener(t,e)},mh:function(t,e,i){this.addHierarchyChangeListener(t,e,i)},umh:function(t,e){this.removeHierarchyChangeListener(t,e)},getAttrObject:function(){return this._attrObject},setAttrObject:function(t){return this._attrObject=t},getSelectionModel:function(){return this._selectionModel},size:function(){return this._datas.size()},isEmpty:function(){return this._datas.isEmpty()},getRoots:function(){return this._roots},getDatas:function(){return this._datas},getFullscreenDatas:function(){return this._fsDataMap},getReflectors:function(){return this._reflectorMap},getDataById:function(t){return this._dataMap[t]},removeDataById:function(t){this.remove(this.getDataById(t))},toDatas:function(t,e){return this._datas.toList(t,e)},each:function(t,e){this._datas.each(t,e)},getDataByTag:function(t){return this._78O[t]},getTagMap:function(){return this._78O},removeDataByTag:function(t){this.remove(this.getDataByTag(t))},add:function(t,e,i){var n=this,r=t._id,o=t._tag,a=n._roots;if(n._dataMap[r])throw"'"+r+"' already exists";o!=U&&(n._78O[o]=t),n._dataMap[r]=t,0<=i?n._datas.add(t,i):n._datas.add(t),t._parent||(n._rootMap[r]=t,0<=e?a.add(t,e):a.add(t)),t.s("fullscreen")!==H&&(n._fsDataMap[r]=t),t.s("shape3d.reflector")&&(n._reflectorMap[r]=t),t._21I(n),n.onAdded(t),n._36I.fire({kind:"add",data:t,rootsIndex:e,datasIndex:i})},onAdded:function(){},remove:function(t,e){var i,n,r,o,a,s;t&&(i=this,n=t._id,a=e&&e.keepStructure,r=e&&e.keepChildren,o=t.getTag(),t._dataModel===i&&(this.beginTransaction(),a?i._removingData||(i._removingData=t):i.prepareRemove(t),r||t.toChildren().each(function(t){i.remove(t,e)},i),a?i._removingData===t&&(t._parent&&t._parent.removeChild(t),delete i._removingData):t._parent&&t._parent.removeChild(t),a=i._datas.remove(t),delete i._dataMap[n],o!=U&&delete i._78O[o],i._rootMap[n]&&(delete i._rootMap[n],s=i._roots.remove(t)),i._fsDataMap[n]&&delete i._fsDataMap[n],i._reflectorMap[n]&&delete i._reflectorMap[n],t._21I(U),i.onRemoved(t),i._36I.fire({kind:Ct,data:t,rootsIndex:s,datasIndex:a}),this.endTransaction()))},onRemoved:function(){},prepareRemove:function(){},clear:function(){var t,e=this;e._datas.size()&&(t=e._historyManager?this.toJSON():H,e._datas.toArray().forEach(function(t){t._21I(U)}),e._datas.clear(),e._dataMap={},e._roots.clear(),e._rootMap={},e._fsDataMap={},e._reflectorMap={},e._78O={},e._36I.fire({kind:Mt,json:t}))},contains:function(t){return t&&t._dataModel===this},handleDataPropertyChange:function(t){var e,i,n,r,o=t.data,a=t.property;"parent"===a?(r=o._id,e=this._rootMap,i=this._roots,o._parent?e[r]&&(delete e[r],i.remove(o)):e[r]||(e[r]=o,i.add(o))):"tag"===a?(e=t.oldValue,n=t.newValue,i=this._78O,e!=U&&delete i[e],n!=U&&(i[n]=o)):"s:fullscreen"===a?(r=o._id,n=this._fsDataMap,t.oldValue!=U&&delete n[r],t.newValue!=U&&(n[r]=o)):"s:shape3d.reflector"===a&&(r=o._id,a=this._reflectorMap,t.oldValue&&delete a[r],t.newValue&&(a[r]=o)),this.onDataPropertyChanged(o,t),this._35I.fire(t)},onDataPropertyChanged:function(){},addDataModelChangeListener:function(t,e,i){this._36I.add(t,e,i)},removeDataModelChangeListener:function(t,e){this._36I.remove(t,e)},addSerializeListener:function(t,e,i){this._serializeNotifier.add(t,e,i)},removeSerializeListener:function(t,e){this._serializeNotifier.remove(t,e)},fireSerializeEvent:function(t){this._serializeNotifier.fire(t)},addDataPropertyChangeListener:function(t,e,i){this._35I.add(t,e,i)},removeDataPropertyChangeListener:function(t,e){this._35I.remove(t,e)},_38I:function(t,e,i){this._37I&&this._37I.fire({data:t,oldIndex:e,newIndex:i})},addHierarchyChangeListener:function(t,e,i){this._37I||(this._37I=new kh),this._37I.add(t,e,i)},removeHierarchyChangeListener:function(t,e){this._37I.remove(t,e)},getSiblings:function(t){t=t._parent;return t?t._children:this._roots},eachByHierarchical:function(t,e,i){if(e)return this._eachByHierarchical(t,e,i);for(var n=0,r=this._roots,o=r.size();n<o;n++)if(!1===this._eachByHierarchical(t,r.get(n),i))return!1;return!0},_eachByHierarchical:function(t,e,i){if(i){if(!1===t.call(i,e))return!1}else if(!1===t(e))return!1;for(var n=e.size(),r=0;r<n;r++)if(!1===this._eachByHierarchical(t,e.getChildAt(r),i))return!1;return!0},reverseEachByHierarchical:function(t,e,i){if(e)return this._reverseEachByHierarchical(t,e,i);for(var n=this._roots,r=n.size()-1;0<=r;r--)if(!1===this._reverseEachByHierarchical(t,n.get(r),i))return!1;return!0},_reverseEachByHierarchical:function(t,e,i){for(var n=e.size()-1;0<=n;n--)if(!1===this._reverseEachByHierarchical(t,e.getChildAt(n),i))return!1;if(i){if(!1===t.call(i,e))return!1}else if(!1===t(e))return!1;return!0},eachByDepthFirst:function(t,e,i){if(e)return this._11I(t,e,i);for(var n=0,r=this._roots,o=r.size();n<o;n++)if(!1===this._11I(t,r.get(n),i))return!1;return!0},_11I:function(t,e,i){for(var n=e.size(),r=0;r<n;r++)if(!1===this._11I(t,e.getChildAt(r),i))return!1;if(i){if(!1===t.call(i,e))return!1}else if(!1===t(e))return!1;return!0},eachByBreadthFirst:function(t,e,i){var n=new Lh;for(e?n.add(e):this._roots.each(n.add,n);0<n.size();)if((e=n.removeAt(0)).eachChild(n.add,n),i){if(!1===t.call(i,e))return!1}else if(!1===t(e))return!1;return!0},moveTo:function(t,e){var i=this.getSiblings(t),n=i.indexOf(t);n===e||n<0||0<=e&&e<=i.size()&&(i.remove(t),e>i.size()&&e--,i.add(t,e),this._38I(t,n,e))},moveUp:function(t){this.moveTo(t,this.getSiblings(t).indexOf(t)-1)},moveDown:function(t){this.moveTo(t,this.getSiblings(t).indexOf(t)+1)},moveToTop:function(t){this.moveTo(t,0)},moveToBottom:function(t){this.moveTo(t,this.getSiblings(t).size())},moveSelectionUp:function(t){this.beginTransaction(),t=t||this.sm();var e=new Lh;Do(t,e,this._roots),e.each(this.moveUp,this),this.endTransaction()},moveSelectionDown:function(t){this.beginTransaction(),t=t||this.sm();var e=new Lh;Oo(t,e,this._roots),e.each(this.moveDown,this),this.endTransaction()},moveSelectionToTop:function(t){this.beginTransaction(),t=t||this.sm();var e=new Lh;Po(t,e,this._roots),e.each(this.moveToTop,this),this.endTransaction()},moveSelectionToBottom:function(t){this.beginTransaction(),t=t||this.sm();var e=new Lh;Ao(t,e,this._roots),e.each(this.moveToBottom,this),this.endTransaction()},moveToIndex:function(t,e,i){var n=this.getDatas();null==i&&(i=n.indexOf(t)),i===e||i<0||0<=e&&e<=n.size()&&(n.remove(t),e>n.size()&&e--,n.add(t,e),this._76I(t,i,e))},bringForward:function(t){this.moveToIndex(t,this.getDatas().indexOf(t)+1)},bringToFront:function(t){this.moveToIndex(t,this.size())},sendBackward:function(t){this.moveToIndex(t,this.getDatas().indexOf(t)-1)},sendToBack:function(t){this.moveToIndex(t,0)},bringSelectionForward:function(t){this.beginTransaction(),t=t||this.sm();for(var e=new Lh,i=this.getDatas(),n=!1,r=0;r<i.size();r++){var o=i.get(i.size()-1-r);t.contains(o)?n&&e.add(o):n=!0}e.each(this.bringForward,this),this.endTransaction()},bringSelectionToFront:function(t){this.beginTransaction(),t=t||this.sm();for(var e=new Lh,i=this.getDatas(),n=0;n<i.size();n++){var r=i.get(n);t.contains(r)&&e.add(r)}e.each(this.bringToFront,this),this.endTransaction()},sendSelectionBackward:function(t){this.beginTransaction(),t=t||this.sm();for(var e=new Lh,i=this.getDatas(),n=!1,r=0;r<i.size();r++){var o=i.get(r);t.contains(o)?n&&e.add(o):n=!0}e.each(this.sendBackward,this),this.endTransaction()},sendSelectionToBack:function(t){this.beginTransaction(),t=t||this.sm();for(var e=new Lh,i=this.getDatas(),n=0;n<i.size();n++){var r=i.get(i.size()-1-n);t.contains(r)&&e.add(r)}e.each(this.sendToBack,this),this.endTransaction()},addScheduleTask:function(t){this.removeScheduleTask(t),t.enabled==U&&(t.enabled=!0),t.interval==U&&(t.interval=10),t.lastTime=Date.now(),this._29Q.push(t),this._30Q==U&&(this._30Q=C.requestAnimationFrame(this._scheduleCallback))},removeScheduleTask:function(t){var e=this._29Q,t=e.indexOf(t);0<=t&&e.splice(t,1),e.length||this._30Q==U||(C.cancelAnimationFrame(this._30Q),delete this._30Q)},getHistoryManager:function(){return this._historyManager},enableHistoryManager:function(t){this._historyManager||new Gl.HistoryManager(this),null!=t&&this._historyManager.setMaxHistoryCount(t),this._historyManager.setDisabled(!1)},disableHistoryManager:function(){this._historyManager&&this._historyManager.setDisabled(!0)},clearHistoryManager:function(){this._historyManager&&this._historyManager.clear()},undo:function(t){this._historyManager&&this._historyManager.undo(t)},redo:function(t){this._historyManager&&this._historyManager.redo(t)},beginTransaction:function(){this._historyManager&&this._historyManager.beginTransaction()},endTransaction:function(){this._historyManager&&this._historyManager.endTransaction()},addHistory:function(t){this._historyManager&&this._historyManager.addHistory(t)},onHistoryManagerChanged:function(){},isDeserializing:function(){return 0<this._isDeserializing},setDeserializing:function(t){t?this._isDeserializing++:this._isDeserializing--},isCubicEnvmap:function(){return this._cubicEnvmap},setCubicEnvmap:function(t){var e=this._cubicEnvmap;this._cubicEnvmap=t,this.fp("cubicEnvmap",e,t)}}),Uh=Gl.SelectionModel=function(t){this._68O=rt,this._map={},this._73O=new Lh,this._74I=new kh,this._21I(t)},Vs("SelectionModel",L,{ms_fire:1,ms_dm:1,ms:function(t,e,i){this.addSelectionChangeListener(t,e,i)},ums:function(t,e){this.removeSelectionChangeListener(t,e)},fd:function(){return this.getFirstData()},ld:function(){return this.getLastData()},sg:function(){return this._68O===nt},co:function(t){return this._map[t._id]!=U},ss:function(t){this.setSelection(t)},as:function(t){this.appendSelection(t)},rs:function(t){this.removeSelection(t)},cs:function(){this.clearSelection()},sa:function(){this.selectAll()},getSelectionMode:function(){return this._68O},setSelectionMode:function(t){var e;this._68O===t||t!==_t&&t!==nt&&t!==rt||(this.cs(),e=this._68O,this._68O=t,this.fp("selectionMode",e,t))},_21I:function(t){var e=this._dataModel;e!==t&&(e&&(this.cs(),e.umm(this.handleDataModelChange,this)),(this._dataModel=t).mm(this.handleDataModelChange,this,!0),this.fp(Oe,e,t))},dispose:function(){this.cs(),this._dataModel.umm(this.handleDataModelChange,this)},handleDataModelChange:function(t){var e;t.kind===Ct?(e=t.data,this.co(e)&&(this._73O.remove(e),delete this._map[e._id],this._75I(Ct,new Lh(e)))):t.kind===Mt&&this.cs()},getFilterFunc:function(){return this._filterFunc},setFilterFunc:function(t){var e;this._filterFunc!==t&&(this.cs(),e=this._filterFunc,this._filterFunc=t,this.fp("filterFunc",e,this._filterFunc))},_75I:function(t,e,i,n){i&&(this._73O.each(function(t){n[t._id]?i.remove(t):i.add(t)}),e=i.toList()),this._74I.fire({kind:t,datas:new Lh(e)})},addSelectionChangeListener:function(t,e,i){this._74I.add(t,e,i)},removeSelectionChangeListener:function(t,e){this._74I.remove(t,e)},_97O:function(t,e){for(var i,n=0,r=new Lh(t);n<r.size();n++)i=r.get(n),(this._filterFunc&&!this._filterFunc(i)||e&&this.co(i)||!e&&!this.co(i)||!this._dataModel.contains(i))&&(r.removeAt(n),n--);return r},appendSelection:function(t){var e,i,n,r=this;r._68O!==_t&&(n=r._73O,(t=r._97O(t,!0)).isEmpty()||(r.sg()&&(e=new Lh(n),i=r._map,n.clear(),r._map={},t=new Lh(t.get(t.size()-1))),t.each(function(t){n.add(t),r._map[t._id]=t}),r._75I("append",t,e,i)))},removeSelection:function(t){var e=this._97O(t),i=0,n=e.size();if(0!==n){for(;i<n;i++){var r=e.get(i);this._73O.remove(r),delete this._map[r._id]}this._75I(Ct,e)}},toSelection:function(t,e){return this._73O.toList(t,e)},getSelection:function(){return this._73O},each:function(t,e){this._73O.each(t,e)},setSelection:function(t){var e,i,n=this,r=n._73O;n._68O===_t||r.isEmpty()&&!t||1===r.size()&&n.ld()===t||(e=new Lh(r),i=n._map,r.clear(),n._map={},t=n._97O(t,!0),n.sg()&&1<t.size()&&(t=new Lh(t.get(t.size()-1))),t.each(function(t){r.add(t),n._map[t._id]=t}),n._75I("set",U,e,i))},clearSelection:function(){var t,e=this._73O;0<e.size()&&(t=e.toList(),e.clear(),this._map={},this._75I(Mt,t))},selectAll:function(){var t=this;if(t._68O!==_t){var e,i=t._dataModel.toDatas();if(t._filterFunc)for(s=0;s<i.size();s++)e=i.get(s),t._filterFunc(e)||(i.removeAt(s),s--);var n=t._73O,r=new Lh(n),o=t._map;n.clear(),t._map={},t.sg()&&1<i.size()&&(i=new Lh(i.get(i.size()-1)));for(var a=i.size(),s=0;s<a;s++)e=i.get(s),n.add(e),t._map[e._id]=e;t._75I("all",U,r,o)}},size:function(){return this._73O.size()},isEmpty:function(){return this._73O.isEmpty()},contains:function(t){return this._map[t._id]!=U},getLastData:function(){var t=this._73O;return 0<t.size()?t.get(t.size()-1):U},getFirstData:function(){var t=this._73O;return 0<t.size()?t.get(0):U},isSelectable:function(t){return!(!t||this._68O===_t)&&(!this._filterFunc||this._filterFunc(t))},getTopSelection:function(){var i=this,n=new Lh;return i._73O.each(function(t){for(var e=t.getParent();e;){if(i.contains(e)){t=U;break}e=e.parent}t&&n.add(t)}),n}}),function(t,e,i,n){var r=this;if(e||(e=et?5:3,n=i=20),t={x:t,y:e,width:i,height:n},i)for(var o=0;o<i;o++)if(3===i)n=20;else for(var a=0;a<n;a++)r=C||i;xs(t,{x:P,y:2*P})&&(e=At[0]+ct[0]+Mt[1]+Ie.length,t=te[0]+Se[0]+Mt[1]+kt.length,eo.eye=[r[e],r[t]],r[e]=gn.eye,r[t]=gn[Ve])}(0),An(G,{edgeGroupAgentFunc:U,graphViewAutoScrollZone:16,graphViewZoomable:!0,graphViewResettable:!(Gh=function(t,e){var i;return!Sn(e)||(t=t.getDataUI(e))&&t._88I&&(i=t._88I.rect),i||e.getRect()}),graphViewPannable:!0,graphViewRectSelectable:!0,graphViewScrollBarVisible:!0,graphViewRectSelectBorderColor:r.rectSelectBorder,graphViewRectSelectBackground:zd,graphViewEditPointSize:et?17:7,graphViewEditPointBorderColor:r.editPointBorder,graphViewEditPointBackground:r.editPointBackground,setEdgeType:function(t,e,i){ki[t]=e,Ni[t]=i},getEdgeType:function(t){return ki[t]},getEdgeTypeMap:function(){return ki},getNodeRect:Gh},!0),($f={"layout.h":H,"layout.v":H,"2d.selectable":!0,"2d.visible":!0,"2d.movable":!0,"2d.editable":!0,"2d.move.mode":H,"2d.attachable":!1,"2d.hostable":!1,interactive:!1,preventDefaultWhenInteractive:!0,"image.stretch":"fill",icons:H,ingroup:!0,"body.color":H,"2d.gray":!1,fullscreen:H,"fullscreen.gap":2,"fullscreen.lock":!1,opacity:H,pixelPerfect:!0,keepAspectRatio:!1,"attach.points":null,"attach.style":null,"attach.close.threshold":16,"clip.direction":"top","clip.percentage":1,"select.color":Jo,"select.width":1,"select.padding":2,"select.type":xt,shadow:!1,"shadow.blur":6,"shadow.offset.x":3,"shadow.offset.y":3,shadow2:!1,"shadow2.color":Jo,"shadow2.blur":6,"shadow2.offset.x":3,"shadow2.offset.y":3,"border.color":H,"border.width":2,"border.padding":2,"border.type":xt,label:H,"label.font":H,"label.color":Ma,"label.background":H,"label.position":31,"label.position.fixed":!1,"label.offset.x":0,"label.offset.y":2,"label.rotation":H,"label.max":H,"label.opacity":H,"label.scale":1,"label.align":H,"label.selectable":!0,label2:H,"label2.font":H,"label2.color":Ma,"label2.background":H,"label2.position":34,"label2.position.fixed":!1,"label2.offset.x":0,"label2.offset.y":-2,"label2.rotation":H,"label2.max":H,"label2.opacity":H,"label2.scale":1,"label2.align":H,"label2.selectable":!0,note:H,"note.expanded":!0,"note.font":H,"note.color":Ra,"note.background":Jo,"note.position":8,"note.offset.x":-3,"note.offset.y":3,"note.max":H,"note.toggleable":!0,"note.border.width":1,"note.border.color":H,"note.opacity":H,"note.scale":1,"note.align":H,note2:H,"note2.expanded":!0,"note2.font":H,"note2.color":Ra,"note2.background":Jo,"note2.position":3,"note2.offset.x":3,"note2.offset.y":-3,"note2.max":H,"note2.toggleable":!0,"note2.border.width":1,"note2.border.color":H,"note2.opacity":H,"note2.scale":1,"note2.align":H,"group.type":H,"group.image":H,"group.image.stretch":"fill","group.repeat.image":H,"group.border.repeat.image":H,"group.padding":8,"group.padding.left":0,"group.padding.right":0,"group.padding.top":0,"group.padding.bottom":0,"group.position":17,"group.toggleable":!0,"group.title.font":H,"group.title.color":Ra,"group.title.background":r.groupTitleBackground,"group.title.align":st,"group.title.orientation":ct,"group.background":r.groupBackground,"group.depth":1,"group.border.width":1,"group.border.pattern":H,"group.border.color":Zo,"group.border.radius":H,"group.border.cap":Ia,"group.border.join":Ca,"group.border.width.absolute":!1,"group.splitLine":!1,"group.gradient":U,"group.gradient.color":"#FFF",shape:H,"shape.background":Zo,"shape.repeat.image":H,"shape.border.repeat.image":H,"shape.border.width":0,"shape.border.width.absolute":!1,"shape.border.color":Zo,"shape.border.3d":!1,"shape.border.3d.color":H,"shape.border.3d.accuracy":H,"shape.border.cap":Ia,"shape.border.join":Ca,"shape.border.pattern":H,"shape.gradient":U,"shape.gradient.color":"#FFF","shape.depth":0,"shape.dash":!1,"shape.dash.pattern":Sa,"shape.dash.offset":0,"shape.dash.color":No,"shape.dash.width":H,"shape.dash.3d":!1,"shape.dash.3d.color":H,"shape.dash.3d.accuracy":H,"shape.polygon.side":6,"shape.arc.from":P,"shape.arc.to":J,"shape.arc.close":!0,"shape.arc.oval":!1,"shape.corner.radius":H,"shape.gradient.pack":H,"shape.fill.rule":"nonzero","shape.fill.clip.direction":"top","shape.fill.clip.percentage":1,"shape.foreground":H,"shape.foreground.gradient":U,"shape.foreground.gradient.color":"#FFF","shape.foreground.clip.direction":"top","shape.foreground.clip.percentage":1,"autolayout.gap":H,"autolayout.hgap":H,"autolayout.vgap":H,"edge.type":H,"edge.points":H,"edge.segments":H,"edge.color":Zo,"edge.width":2,"edge.width.absolute":!1,"edge.repeat.image":null,"edge.offset":0,"edge.group":0,"edge.expanded":!0,"edge.gap":12,"edge.toggleable":!0,"edge.center":!1,"edge.3d":!1,"edge.3d.color":H,"edge.3d.accuracy":H,"edge.cap":Ia,"edge.join":Ca,"edge.source.position":17,"edge.source.anchor.x":H,"edge.source.anchor.y":H,"edge.source.offset.x":0,"edge.source.offset.y":0,"edge.source.index":-1,"edge.source.percent":0,"edge.target.position":17,"edge.target.anchor.x":H,"edge.target.anchor.y":H,"edge.target.offset.x":0,"edge.target.offset.y":0,"edge.target.index":-1,"edge.target.percent":0,"edge.pattern":H,"edge.dash":!1,"edge.dash.pattern":Sa,"edge.dash.offset":0,"edge.dash.color":No,"edge.dash.width":H,"edge.dash.3d":!1,"edge.dash.3d.color":H,"edge.dash.3d.accuracy":H,"edge.independent":!1,"attach.row.index":0,"attach.column.index":0,"attach.row.span":1,"attach.column.span":1,"attach.padding":0,"attach.padding.left":0,"attach.padding.right":0,"attach.padding.top":0,"attach.padding.bottom":0,"attach.index":-1,"attach.offset":0,"attach.offset.relative":!1,"attach.offset.opposite":!1,"attach.thickness":H,"attach.gap":0,"attach.gap.relative":!1,"grid.row.count":1,"grid.column.count":1,"grid.row.percents":H,"grid.column.percents":H,"grid.border":1,"grid.border.left":0,"grid.border.right":0,"grid.border.top":0,"grid.border.bottom":0,"grid.gap":1,"grid.background":r.gridBackground,"grid.depth":1,"grid.cell.depth":-1,"grid.cell.border.color":r.gridCellBorderColor,"grid.block":H,"grid.block.padding":3,"grid.block.width":1,"grid.block.color":r.gridBlockColor,text:"","text.align":"left","text.vAlign":"middle","text.color":Ma,"text.font":Aa,"text.shadow":!1,"text.shadow.color":Jo,"text.shadow.blur":6,"text.shadow.offset.x":3,"text.shadow.offset.y":3,"text.scale.x":1,"text.scale.y":1,keepPosition:!0})[Be]=H,An(F,$f,!0),An(Nh,{_76I:function(t,e,i){this._39I&&this._39I.fire({data:t,oldIndex:e,newIndex:i})},addIndexChangeListener:function(t,e,i){this._39I||(this._39I=new kh),this._39I.add(t,e,i)},removeIndexChangeListener:function(t,e){this._39I.remove(t,e)},prepareRemove:function(t){En(t)&&(t.setSource(U),t.setTarget(U)),t._70O&&t._70O.toList().each(this.remove,this),t._69O&&t._69O.toList().each(function(t){t.setHost(U)}),t._host&&t.setHost(U)},onAdded:function(t){this.isAutoAdjustIndex()&&this.adjustIndex(t)},onDataPropertyChanged:function(t,e){Xh[e.property]&&this.isAutoAdjustIndex()&&this.adjustIndex(t)},isAdjustable:function(t){return wn(t)||En(t)},isAdjustedToBottom:function(t){return!!Tn(t)&&(t.isExpanded()&&nc(t))},adjustIndex:function(t){this.isHierarchicalRendering()||(this.isAdjustedToBottom(t)?(this.sendToBottom(t),t.eachChild(this.adjustIndex,this)):this.sendToTop(t))},sendToTop:function(e){var t,i,n=this;n.contains(e)&&n.isAdjustable(e)&&(t=n._datas,e!==t.get(n.size()-1)&&(i=t.indexOf(e),t.removeAt(i),t.add(e),n._76I(e,i,n.size()-1)),En(e)&&((i=e._40I)&&!n.isAdjustedToBottom(i)&&n.sendToTop(i),(i=e._41I)&&!n.isAdjustedToBottom(i)&&n.sendToTop(i)),e._69O&&e._69O.each(function(t){t.isRelatedTo(e)||wn(e)&&t.isLoopedHostOn(e)||n.sendToTop(t)}),e.ISubGraph||Tn(e)&&!e.isExpanded()||!e._adjustChildrenToTop||e.eachChild(function(t){En(t)||n.sendToTop(t)}))},sendToBottom:function(t,e){var i,n;t!==e&&this.contains(t)&&this.isAdjustable(t)&&(!e||this.contains(e))&&(n=(i=this._datas).remove(t),e=e?this._datas.indexOf(e):0,i.add(t,e),n!==e&&(this._76I(t,n,e),!(e=t._parent)||e.ISubGraph||En(e)||this.sendToBottom(t._parent,t)))}}),An(_a,{ms_edit:function(t){t._46O=function(t){var e=this,i=e.gv.dm(),n=e._index,r=e._89I,o=e._node,a=e._shape,s=e._edge,h=e._77I;o&&r?(this.fi({kind:"endEditRect",event:t,data:o,direction:r}),i.endTransaction()):a&&0<=n?(e.fi({kind:"endEditPoint",event:t,data:a,index:n}),i.endTransaction()):s&&0<=n?(e.fi({kind:"endEditPoint",event:t,data:s,index:n}),i.endTransaction()):h&&(e.fi({kind:"endEditRotation",event:t,data:h}),i.endTransaction())},t._78I=function(t){var e=this;e.autoScroll(t);var i=e.gv.lp(t),n=e._index,r=e._89I,o=e._node,a=e._shape,s=e._edge,h=e._77I;o&&r?(e._80O(i),e.fi({kind:"betweenEditRect",event:t,data:o,direction:r})):a&&0<=n?(i.e=a.getPoints().get(n).e,a.setPoint(n,i),e.fi({kind:"betweenEditPoint",event:t,data:a,index:n})):s&&0<=n?(a=s.s(Kt),i.e=a.get(n).e,a.set(n,i),s.fp(Kt,U,a),e.fi({kind:"betweenEditPoint",event:t,data:s,index:n})):h&&(s=h.p(),n=h.getScale(),s=I+T(i.y-s.y,i.x-s.x),n.y<0&&(s+=P),X(s)<.04&&(s=0),h.setRotation(s),e.fi({kind:"betweenEditRotation",event:t,data:h}))},t._80O=function(t){var e=this._node,i=this._rect,n=i.x,r=i.y,o=i.width,a=i.height,s=this._89I,h=this._anchor,c=this._matrix,t=c.tfi(t);"northwest"===s?i=ms(t,{x:n+o,y:r+a}):s===pt?i=ms({x:n,y:t.y},{x:n+o,y:r+a}):"northeast"===s?i=ms({x:n,y:t.y},{x:t.x,y:r+a}):s===gt?i=ms({x:t.x,y:r},{x:n+o,y:r+a}):s===ft?i=ms({x:n,y:r},{x:t.x,y:r+a}):"southwest"===s?i=ms({x:t.x,y:r},{x:n+o,y:t.y}):"south"===s?i=ms({x:n,y:r},{x:n+o,y:t.y}):"southeast"===s&&(i=ms({x:n,y:r},t)),e.setPosition(c.tf(i.x+i.width*h.x,i.y+i.height*h.y)),e.setWidth(i.width),e.setHeight(i.height)},t._80I=function(t,e,i,n){var r=this.gv._zoom,r=(this.gv.getEditPointSize()+2)/r;return!!xs({x:e-r/2,y:i-r/2,width:r,height:r},t)&&(this._89I!==n&&(this._89I=n),!0)},t._79I=function(t,e,i){var n=this,r=n.gv,o=e?r.getDataUI(e):U,a=o?o._55O:U;if(a){var s,h,o=r._zoom,c=(r.getEditPointSize()+2)/o,l=r.lp(t);if(wn(e)){if(a._56O&&wn(e)&&(s=a._98o,xs({x:s.x-c/2,y:s.y-c/2,width:c,height:c},l)))return n._77I=e,i&&n.fi({kind:"beginEditRotation",event:t,data:e}),n.setCursor("crosshair"),!0;if(a._43O&&e instanceof yl)for(f=(h=e.getPoints()).size()-1;0<=f;f--)if(s=h.get(f),xs({x:s.x-c/2,y:s.y-c/2,width:c,height:c},l))return n._index=f,n._shape=e,i&&n.fi({kind:"beginEditPoint",event:t,data:e,index:f}),n.setCursor("crosshair"),!0;if(a._42O)for(var u=e.getEditControlPoints(),d=["northwest",-1,-1,gt,-1,0,"southwest",-1,1,"south",0,1,"southeast",1,1,ft,1,0,"northeast",1,-1,pt,0,-1],f=0,g=u.length;f<g;f++){var p=d[3*f],_=u[f];if(n._80I(l,_.x,_.y,p)){var v=(n._node=e).getWidth(),y=e.getHeight(),_=e.getAnchor();n._rect={x:-v*_.x,y:-y*_.y,width:v,height:y},n._anchor=_,n._matrix=e.getMatrix();p=e.getRotation(),v=Q(p),y=Z(p),_=d[3*f+1]*kn(e.getScale().x),p=d[3*f+2]*kn(e.getScale().y),p=Math.atan2(-y*_-v*p,v*_-y*p),p=(Math.round(p/(Math.PI/4))+8)%8,p=[ei,"nesw-resize",ii,"nwse-resize",ei,"nesw-resize",ii,"nwse-resize"][p];return n.setCursor(p),i&&n.fi({kind:"beginEditRect",event:t,data:e,direction:n._89I}),!0}}}if(a._43O&&En(e)&&e.s(Jt)===Vt&&(h=e.s(Kt)))for(f=h.size()-1;0<=f;f--)if(s=h.get(f),xs({x:s.x-c/2,y:s.y-c/2,width:c,height:c},l))return n._index=f,n._edge=e,i&&n.fi({kind:"beginEditPoint",event:t,data:e,index:f}),n.setCursor("crosshair"),!0}return!1}},ms_gv:function(t){t._currentSubGraph=U,t._initView=function(){this._fpsInfo={time:0,fps:0,frames:0}},t.upSubGraph=function(){this.setCurrentSubGraph(ec(this._currentSubGraph))},t.isVisible=function(t){var e=this;if(ec(t)!==e._currentSubGraph)return!1;if(En(t)){var i=t._40I,n=t._41I;if(!i||!n)return!1;if(!(t.s("edge.independent")||e.isVisible(i)&&e.isVisible(n)))return!1;if(t.isEdgeGroupHidden())return!1}else for(var r=t._parent;r&&!r.ISubGraph;){if(Tn(r)&&(!r.isExpanded()||!e.isVisible(r)))return!1;r=r._parent}if(t._parent instanceof _l&&!e.isVisible(t._parent))return!1;if(t._refGraph instanceof wl&&!e.isVisible(t._refGraph))return!1;if(e instanceof Eg){if(!t.s("3d.visible"))return!1}else{n=e.getLayersInfo();if(n){n=n[t._layer];if(n&&!1===n.visible)return!1}if(!t.s("2d.visible"))return!1}return!e._visibleFunc||e._visibleFunc(t)},t.handleSelectionChange=function(t){var i=this;t.datas.each(function(t){i.invalidateData(t);var e=t._parent;Tn(e)&&wn(t)&&t.s(Pt)&&(i.invalidateData(e),e._49I&&e._49I.each(function(t){i.invalidateData(t)}))}),i.onSelectionChanged(t)},t.onSelectionChanged=function(t){var e=this.sm();1!==e.size()||"set"!==t.kind&&"append"!==t.kind||(e=e.ld(),this.isAutoMakeVisible()&&this.makeVisible(e),this.adjustIndex&&this._dataModel.isAutoAdjustIndex()&&this.adjustIndex(e))},t.makeVisible=function(t){if(t)if(this.getDataUI?this.getDataUI(t):this.getData3dUI(t)){var e=t,i=ec(t);for(i!==this._currentSubGraph&&this.setCurrentSubGraph(i);(e=e._parent)&&e!==i;)Tn(e)&&e.setExpanded(!0);this._23I=t,this.iv()}},t.getLabel=function(t){var e=t.getStyle(jt);return e===H?t.getName():e},t.getLabelBackground=function(t){return t.getStyle("label.background")},t.getLabelColor=function(t){return t.getStyle("label.color")},t.getLabel2=function(t){return t.getStyle("label2")},t.getLabel2Background=function(t){return t.getStyle("label2.background")},t.getLabel2Color=function(t){return t.getStyle("label2.color")},t.getNote=function(t){return t.getStyle(Ut)},t.getNoteBackground=function(t){return t.getStyle("note.background")},t.getNote2=function(t){return t.getStyle(Gt)},t.getNote2Background=function(t){return t.getStyle("note2.background")},t.handleClick=function(t,e,i){e?(this.fi({kind:"clickData",event:t,data:e,part:i}),this.onDataClicked(e,t)):(this.fi({kind:"clickBackground",event:t}),this.onBackgroundClicked(t))},t.handleDoubleClick=function(t,e,i){var n=this;cs(t)&&(e?(n.fi({kind:"doubleClickData",event:t,data:e,part:i}),n.onDataDoubleClicked(e,t,i),n.checkDoubleClickOnNote(t,e,i)||n.checkDoubleClickOnRotation&&n.checkDoubleClickOnRotation(t,e,i)||(En(e)?n.onEdgeDoubleClicked(e,t,i):e.ISubGraph?n.onSubGraphDoubleClicked(e,t,i):Tn(e)?n.onGroupDoubleClicked(e,t,i):e.IDoorWindow?n.onDoorWindowDoubleClicked(e,t,i):e.ICSGBox&&n.onCSGBoxDoubleClicked(e,t,i))):(n.fi({kind:"doubleClickBackground",event:t}),n.onBackgroundDoubleClicked(t)))},t.onSubGraphDoubleClicked=function(t){this.setCurrentSubGraph(t)},t.onEdgeDoubleClicked=function(t,e){this.isEditable(t)||(t.ISubGraph&&!ps(e)?this.setCurrentSubGraph(t):t.s("edge.toggleable")&&t.toggle())},t._39Q=function(t){return!!this.isInteractive(t)&&this.preventDefaultWhenInteractive(t)},t.preventDefaultWhenInteractive=function(t){return t.s("preventDefaultWhenInteractive")},t.onGroupDoubleClicked=function(t){t.s("group.toggleable")&&t.toggle()},t.onDoorWindowDoubleClicked=function(t){t.s("dw.toggleable")&&t.toggle(!0)},t.onCSGBoxDoubleClicked=function(t,e){this instanceof Eg&&((e=this.intersectObject(e,t))&&t.s(e.part+".toggleable")&&t.toggleFace(e.part,!0))},t.onBackgroundClicked=function(){},t.onBackgroundDoubleClicked=function(){this.upSubGraph()},t.onDataClicked=function(){},t.onDataDoubleClicked=function(){},t.onAutoLayoutEnded=function(){},t.onMoveEnded=function(){},t.onPanEnded=function(){},t.onPinchEnded=function(){},t.onRectSelectEnded=function(){},t.onZoomEnded=function(){},t.serialize=function(t){return this.dm().serialize(t)},t.toJSON=function(){return this.dm().toJSON()},t.deserialize=function(t,e){var o=this,a=((e=e instanceof jh?{rootParent:e}:vn(e)?{setId:e}:mn(e)?{finishFunc:e}:e||{}).view=o).dm();return e.__innerHandler__=function(t){var i,n,e,r;vn(a.a("toolTipEnable"))&&(a.a("toolTipEnable")?o.enableToolTip():o.disableToolTip()),o instanceof Gl.graph.GraphView&&(vn(a.a("zoomable"))&&o.setZoomable&&o.setZoomable(a.a("zoomable")),vn(a.a("pannable"))&&o.setPannable&&o.setPannable(a.a("pannable")),vn(a.a("rectSelectable"))&&o.setRectSelectable&&o.setRectSelectable(a.a("rectSelectable")),!0===a.a("fitContent")&&o.fitContent&&o.fitContent(!0,0)),o instanceof Gl.graph3d.Graph3dView&&((e=t.scene)&&e.shadow!=U&&o.shadowMap.setShadow(e.shadow,e.shadowParams),(t=a.a("sceneContext"))?(t.eye&&o.setEye(t.eye),t.center&&o.setCenter(t.center),_n(t.far)&&o.setFar(t.far),_n(t.near)&&o.setNear(t.near)):(_n(a.a("sceneNear"))&&o.setNear(a.a("sceneNear")),_n(a.a("sceneFar"))&&o.setFar(a.a("sceneFar")),e&&(e.eye&&o.setEye(e.eye),e.center&&o.setCenter(e.center))),vn(a.a("sceneShadowEnabled"))&&(a.a("sceneShadowEnabled")?o.enableShadow():o.disableShadow()),a.a("sceneShadowDegreeX")&&o.setShadowDegreeX(a.a("sceneShadowDegreeX")),a.a("sceneShadowDegreeZ")&&o.setShadowDegreeZ(a.a("sceneShadowDegreeZ")),a.a("sceneShadowIntensity")&&o.setShadowIntensity(a.a("sceneShadowIntensity")),a.a("sceneShadowQuality")&&o.setShadowQuality(a.a("sceneShadowQuality")),a.a("sceneShadowType")&&o.setShadowType(a.a("sceneShadowType")),a.a("sceneShadowRadius")&&o.setShadowRadius(a.a("sceneShadowRadius")),a.a("sceneShadowBias")&&o.setShadowBias(a.a("sceneShadowBias")),vn(a.a("sceneDashEnable"))&&o.setDashDisabled(!a.a("sceneDashEnable")),pn(a.a("sceneHighlightMode"))&&o.setHighlightMode(a.a("sceneHighlightMode")),_n(a.a("sceneHighlightWidth"))&&o.setHighlightWidth(a.a("sceneHighlightWidth")),a.a("sceneHighlightColor")&&o.setHighlightColor(a.a("sceneHighlightColor")),vn(a.a("sceneHeadlightEnable"))&&o.setHeadlightDisabled(!a.a("sceneHeadlightEnable")),_n(a.a("sceneHeadlightRange"))&&o.setHeadlightRange(a.a("sceneHeadlightRange")),a.a("sceneHeadlightColor")&&o.setHeadlightColor(a.a("sceneHeadlightColor")),_n(a.a("sceneHeadlightIntensity"))&&o.setHeadlightIntensity(a.a("sceneHeadlightIntensity")),_n(a.a("sceneHeadlightAmbientIntensity"))&&o.setHeadlightAmbientIntensity(a.a("sceneHeadlightAmbientIntensity")),vn(a.a("sceneFogEnable"))&&o.setFogDisabled(!a.a("sceneFogEnable")),a.a("sceneFogMode")&&o.setFogMode(a.a("sceneFogMode")),vn(a.a("sceneFogDensity"))&&o.setFogDensity(!a.a("sceneFogDensity")),a.a("sceneFogColor")&&o.setFogColor(a.a("sceneFogColor")),_n(a.a("sceneFogNear"))&&o.setFogNear(a.a("sceneFogNear")),_n(a.a("sceneFogFar"))&&o.setFogFar(a.a("sceneFogFar")),vn(a.a("sceneBatchBrightnessDisabled"))&&o.setBatchBrightnessDisabled(a.a("sceneBatchBrightnessDisabled")),vn(a.a("sceneBatchBlendDisabled"))&&o.setBatchBlendDisabled(a.a("sceneBatchBlendDisabled")),vn(a.a("sceneBatchColorDisabled"))&&o.setBatchColorDisabled(a.a("sceneBatchColorDisabled")),a.a("sceneBatchInfoMap")&&o.setBatchInfoMap(a.a("sceneBatchInfoMap")),_n(a.a("sceneMoveStep"))&&o.setMoveStep(a.a("sceneMoveStep")),_n(a.a("sceneRotateStep"))&&o.setRotateStep(a.a("sceneRotateStep")),(e=a.a("sceneSkyboxType")||"sphere")!=U&&(n=!(i={}),"sphere"===e?(i.shape3d=e,(e=a.a("sceneSkyboxImage"))&&(i["shape3d.image"]=e,n=!0)):(i.shape3d=H,["front","back","left","right","top","bottom"].forEach(function(t){var e=t+".image",t=t.charAt(0).toUpperCase()+t.slice(1),t=a.a("sceneSkybox"+t+"Image");t&&(i[e]=t,n=!0)})),n&&((r=new cl).s3(20,20,20),i["body.color"]=a.a("sceneSkyboxBodyColor"),i.envmap=a.a("sceneSkyboxEnvmap"),i.light=!1,i["texture.wrap"]="clampToEdge",r.s(i),["X","Y","Z"].forEach(function(t){var e=a.a("sceneSkyboxRotation"+t);_n(e)&&r["setRotation"+t](e)}),o.setSkybox(r))))},a.deserialize(t,e.rootParent,e)},t.isDebugTipShowing=function(){return!!this._debugDiv},t.showDebugTip=function(){var t,i,n=this,r=n._debugDiv;r||((r=n._debugDiv=d.createElement("div")).style.position="absolute",r.style.overflow="hidden",r.style.font=G.debugTipLabelFont,r.style.padding="6px",r.style.backgroundColor=G.debugTipBackground,r.style.color=G.debugTipLabelColor,t=n.getView(),n._79O?t.insertBefore(r,n._79O):t.appendChild(r),i=function(){n.redraw();var t=n._canvas,e="FPS: "+n._fpsInfo.fps+"<br/>Datas: "+n.dm().getDatas().length+(t?"<br/>Size: "+t.width+" * "+t.height:""),t=n.dm()._historyManager;t&&(e+="<br/>Undoes: "+t.getHistories().length+" index: "+t.getHistoryIndex());t=n.getDebugTip();t&&(e+="<hr>"+t),r.innerHTML=e,n._isDebugging&&requestAnimationFrame(i)},requestAnimationFrame(i),n._isDebugging=!0)},t.hideDebugTip=function(){var t=this._debugDiv;t&&(delete this._debugDiv,this.getView().removeChild(t),this._isDebugging=!1)},t.updateDOMAppendMatrix=function(){var t=this.getView();t&&(t.updateAppendMatrix=!0)},t.countFrame=function(){var t,e;this._isDebugging&&(1e3<(t=Date.now())-(e=this._fpsInfo).time?(e.fps=Math.round(1e5*(e.frames+1)/(t-e.time))/100,e.time=t,e.frames=0):e.frames++)}},ms_icons:function(t){t.getRotation=function(t){return t==U?0:t},t._15O=function(){var t=this,e=t.s(Ht);if(e){var i,n=t,r=t.data||t._data,o=t._38o={icons:e,rects:{}};for(i in e){var a=e[i],s=xh(a.shape3d,r,n);if(!(!1===xh(a.visible,r,n)||xh(a.for3d,r,n)&&!t.I3d||s&&!t.I3d)){var h=s?[s]:xh(a.names,r,n),c=h?h.length:0,l=xh(a.position,r,n)||3,u=xh(a.offsetX,r,n)||0,d=xh(a.offsetY,r,n)||0,f=xh(a.direction,r,n)||ft,g=xh(a.gap,r,n),p=g!=U?g:1,_=xh(a.rotation,r,n),g=xh(a.keepOrien,r,n),v=xh(a.rotationFixed,r,n)?_:t.getRotation(_,g,l),y=U,m=o.rects[i]=new Array(c);m.rotation=v;for(var b=0;b<c;b++){var x,w,E,T,S=h[b];s?w=x=0:(S=Qa(S),x=xh(a.width,r,n),w=xh(a.height,r,n),x==U&&(x=mh(S,r)),w==U&&(w=bh(S,r))),y?f===ft?u+=x/2:f===gt?u-=x/2:f===pt?d-=w/2:d+=w/2:y={width:x,height:w},t.I3d?(T=-x/2,E=-w/2,T={width:x,height:w,mat:t._16O(xh(a.autorotate,r,n),l,y,xh(a.face,r,n)||ot,xh(a.t3,r,n),xh(a.r3,r,n),xh(a.rotationMode,r,n),u,d),vs:new js([T,-E,0,T,-E-w,0,T+x,-E-w,0,T+x,-E,0])}):(T={x:(E=t.getPosition(l,u,d,y,xh(a.positionFixed,r,n))).x-x/2,y:E.y-w/2,width:x,height:w},t._68o(T,v)),m[b]=T,f===ft?u+=x/2+p:f===gt?u-=x/2+p:f===pt?d-=w/2+p:d+=w/2+p}}}}}}}),Hh={1:1,2:1,6:1,9:1,10:1,14:1,15:1,16:1,21:1,22:1,26:1,29:1,30:1,34:1,36:1,38:1,40:1,42:1,45:1,50:1,52:1,54:1},Wh={3:1,7:1,11:1,17:1,23:1,27:1,31:1,44:1,46:1,47:1,49:1},qh={translateX:1,translateY:1,zoom:1,scrollBarVisible:1},Xh={sourceAgent:1,targetAgent:1,expanded:1,parent:1,host:1},Qh={position:1,width:1,height:1,expanded:1,rotation:1,anchor:1,scale:1,"s:edge.points":1},Yh={"edge.type":1,"edge.group":1},Zh={rotation:1,rotationX:1,rotationZ:1},Kh={rotation:1,rotationX:1,rotationZ:1,position:1,width:1,height:1,anchor:1,scale:1},Jh={position:1,width:1,height:1,anchor:1,scale:1,"s:grid.row.count":1,"s:grid.column.count":1,"s:grid.row.percents":1,"s:grid.column.percents":1,"s:grid.border":1,"s:grid.border.left":1,"s:grid.border.right":1,"s:grid.border.top":1,"s:grid.border.bottom":1,"s:grid.gap":1},$h={"attach.row.index":1,"attach.column.index":1,"attach.row.span":1,"attach.column.span":1,"attach.padding":1,"attach.padding.left":1,"attach.padding.right":1,"attach.padding.top":1,"attach.padding.bottom":1,"attach.index":1,"attach.offset":1,"attach.offset.relative":1,"attach.offset.opposite":1,"attach.gap":1,"attach.gap.relative":1,"attach.thickness":1},tc={shape:1,thickness:1,position:1,anchor:1,scale:1},ec=function(t){if(!t)return U;if(En(t)){var e=t._40I,i=t._41I;if(!e||!i)return U;e=ec(e);return e===ec(i)?e:U}for(var n=t._parent;En(n)&&!n.ISubGraph;)n=n._parent;return n?n.ISubGraph?n:ec(n):U},ic=function(t,e,i,n){var r=e.getStyle(i)*n;r&&Is(t,r),(r=e.getStyle(i+".left")*n)&&(t.x-=r,t.width+=r),(r=e.getStyle(i+".right")*n)&&(t.width+=r),(r=e.getStyle(i+".top")*n)&&(t.y-=r,t.height+=r),(r=e.getStyle(i+".bottom")*n)&&(t.height+=r),t.width<0&&(t.width=-t.width,t.x-=t.width),t.height<0&&(t.height=-t.height,t.y-=t.height)},nc=function(t){for(var e,i=0,n=t.size();i<n;i++)if(e=t.getChildAt(i),wn(e)&&nc(e))return!0;return t.hasAgentEdges()},rc=function(t){if(!t)return U;for(var e=t._parent;Tn(e);){if(!Tn(e._parent))return e.isExpanded()?t:e;e.isExpanded()||(t=e),e=e._parent}return t},oc=function(t,e){if(!t||!e)return U;var i,n,r,o=ec(t),a=ec(e);if(o===a)return t;for(;a&&o!==a;)a=ec(a);if(o===a)return t;(i=new Lh).add(t,0);for(var s=t._parent;wn(s)&&!e.isDescendantOf(s);)i.add(s,0),s=s._parent;for(r=i.size(),n=0;n<r;n++){var h=i.get(n);if(Tn(h)&&!h.isExpanded())return h;if(h.ISubGraph)return h}return t},ac=function(t,e,i){"target"!==i&&(i="source");var n="target"===i?e.getTargetAgent():e.getSourceAgent(),r="edge."+i+".";if(En(n)){var o=t.getDataUI(n);o._79o();i=e.s(r+"index");if(0<=i){var a=Ic(o);return a[Math.max(0,Math.min(i,a.length-1))]}a=e.s(r+"percent")||0,a=Math.max(0,Math.min(a,1)),o=xc(o);return Sc(o,100*a)}return sc(t,n,e.s(r+"position"),e.s(r+"offset.x"),e.s(r+"offset.y"),e.s(r+"anchor.x"),e.s(r+"anchor.y"))},sc=function(t,e,i,n,r,o,a){if(!e)return U;var s,h,c,l,u,d=e.getRotation?e.getRotation():0;return i=o!==H||a!==H?(o=o===H?.5:o,a=a===H?.5:a,s=e.getScale(),d&&!Sn(e,t)||s.x<0||s.y<0?(h=e.getPosition(),c=e.getWidth(),l=e.getHeight(),u=e.getAnchor(),new oa(d,h.x,h.y,s.x,s.y).tf((o-u.x)*c,(a-u.y)*l)):{x:(l=Gh(t,e)).x+o*l.width,y:l.y+a*l.height}):Fo(i,Gh(t,e)),d&&(d=n*(t=Q(d))-r*(e=Z(d)),r=n*e+r*t,n=d),i.x+=n,i.y+=r,i},hc=function(t,e){var i,n,r=function(t,e){if(!t||!e)return U;var i,n,r,o,a,s;if(t===e){if(!(o=t.getLoopedEdges()))return U;o=new Lh(o)}else{if(a=t.getAgentEdges(),s=e.getAgentEdges(),!a||!s)return U;for(n=a.size(),i=0;i<n;i++)r=a.get(i),s.contains(r)&&(o=o||new Lh).add(r)}if(o)for(i=0;i<o.size();i++)(r=o.get(i)).getStyle(Jt)===Vt&&(r._22I(U),o.removeAt(i),i--);return o}(t,e);r&&!r.isEmpty()&&(1!==r.size()?(i=new Lh,n=new Lh,r.each(function(t){t=t.s("edge.group");i.contains(t)||i.add(t)}),i.sort(),i.each(function(e){n.add(new Gl.EdgeGroup(r.toList(function(t){return e===t.s("edge.group")}),n))}),n.each(function(e){e.each(function(t){t._22I(e)})})):r.get(0)._22I(U))},cc=function(t,e,i){var n=t._canvas;t._zoom;e=Cs(e,n),n=Cs(i,n);return{x:e.x-n.x,y:e.y-n.y}},lc=function(t,e){var i,n,r,o,a,s,h,c,l,u,d,f;e&&(i=e.rect,n=e.color,r=e.rotation,o=e.labelWidth,f=e.background,a=e.opacity,h=(s=e.scale)!=U&&1!==s,a!=U&&(c=t.globalAlpha,t.globalAlpha*=a),(r||h)&&(t.save(),l=i.x+i.width/2,u=i.y+i.height/2,pr(t,l,u),r&&_r(t,r),h&&t.scale(s,s),pr(t,-l,-u)),f&&lo(t,i.x,i.y,i.width,i.height,f),o&&(d=i.width,(f=t.createLinearGradient(i.x,i.y,i.x+d,i.y)).addColorStop(0,n),f.addColorStop(.9,n),f.addColorStop(1,Qe),n=f,i.width=o),sr(t,e.ss,i,e.font,n,e.align),o&&(i.width=d),(r||h)&&t.restore(),a!=U&&(t.globalAlpha=c))},uc=function(t,e){var i,n,r,o,a,s,h,c,l,u,d,f,g,p,_,v,y;e&&(i=(y=e.rect).x,n=y.y,r=y.width,o=y.height,a=e.background,v=e.backgroundImage,s=e.borderWidth,h=e.borderColor,c=e.labelWidth,l=e.opacity,d=(u=e.scale)!=U&&1!==u,l!=U&&(f=t.globalAlpha,t.globalAlpha*=l),d&&(t.save(),g=y.x+y.width/2,p=y.y+y.height/2,pr(t,g,p),t.scale(u,u),pr(t,-g,-p)),e.expanded?(g=q(8,r/4),p=n+o-8,t.fillStyle=a,t.beginPath(),t.moveTo(i,n),t.lineTo(i,p),t.lineTo(i+r/2,p),t.lineTo(i+r/2,n+o),t.lineTo(i+r/2+g,p),t.lineTo(i+r,p),t.lineTo(i+r,n),t.closePath(),t.fill(),s&&(t.lineWidth=s,t.lineJoin="round",t.lineCap="round",h?t.strokeStyle=h:(t.strokeStyle=as(a),t.beginPath(),t.moveTo(i+r,n),t.lineTo(i+r,p),t.lineTo(i+r/2+g,p),t.lineTo(i+r/2,n+o),t.stroke(),t.strokeStyle=os(a),t.beginPath(),t.moveTo(i+r,n),t.lineTo(i,n),t.lineTo(i,p),t.lineTo(i+r/2,p),t.lineTo(i+r/2,n+o)),t.stroke()),v?Ka(t,Qa(v),qe,y.x,y.y,y.width,y.height-8,e.data,e.view):(y.height-=8,a=e.color,c&&(_=r,(v=t.createLinearGradient(i,n,i+_,n)).addColorStop(0,a),v.addColorStop(.9,a),v.addColorStop(1,Qe),a=v,y.width=c),sr(t,e.ss,y,e.font,a,e.align),c&&(y.width=_),y.height+=8)):e.icon?wh(t,Qa(e.icon),i,n,r,o,e.data,e.view):(y=r/2,s&&(t.lineWidth=s,t.lineJoin="round",t.lineCap="round",t.strokeStyle=h||as(a),t.beginPath(),t.arc(i+y,n+y,y,I,1.6*P,!0),t.moveTo(i+y,n+o),t.lineTo(i+r-y/5,n+y),t.stroke(),t.strokeStyle=h||os(a),t.beginPath(),t.arc(i+y,n+y,y,1.6*P,I,!0),t.moveTo(i+y,n+o),t.lineTo(i+y/5,n+y),t.stroke()),t.fillStyle=a,t.beginPath(),t.arc(i+y,n+y,y,0,J,!0),t.moveTo(i+y,n+o),t.lineTo(i+r-y/5,n+y),t.lineTo(i+y/5,n+y),t.closePath(),t.fill(),t.fillStyle=e.color,t.beginPath(),t.arc(i+y,n+y,y/3,0,J,!0),t.fill()),d&&t.restore(),l!=U&&(t.globalAlpha=f))},dc=function(t,e){return 2*t<e?t:e/2},fc=function(t,e,i,n){if(!t||!e)return 0;var r=T(e.y-t.y,e.x-t.x);return i||(r=e.x<t.x?r+P:r),r+n},gc=function(t,e,i,n,r,o,a){a&&(t.x>e.x||t.x===e.x&&t.y>e.y)&&(i=Lo[i],r=-r);o=Fo(i,{x:0,y:0,width:ys(t,e),height:0},o);return o.x+=n,o.y+=r,(o=new oa(T(e.y-t.y,e.x-t.x)).tf(o)).x+=t.x,o.y+=t.y,o},pc=function(t,i,n,e,r){if(t._19Q=!0,!n.getEdgeGroup())return e?n.s("edge.gap"):0;if(En(n.getSourceAgent())||En(n.getTargetAgent()))return 0;var o,a=0,s=0,h=0;if(n.getEdgeGroup().getSiblings().each(function(t){t.each(function(t){var e;i.isVisible(t)&&t.s(Jt)==r&&(e=t.s("edge.gap"),h=(o?s+=h/2+e/2:o=t,e),t===n&&(a=s))})}),e)return s-a+h;e=a-s/2;return o&&n._40I!==o._40I&&(t._19Q=!1),e},_c=function(t,e,i){if("oval"===t){var n=0,r=i.height/i.width,o=r*r,a=i.x+i.width/2,s=i.y+i.height/2;Am(e).forEach(function(t){var e=t.x-a,t=t.y-s,t=e*e+t*t/o;n<t&&(n=t)});r=r*(n=W(n));return{x:a-n,y:s-r,width:2*n,height:2*r}}if("circle"!==t)return"roundRect"===t&&Is(i,q(i.width,i.height)/16),i;var h=0,a=i.x+i.width/2,s=i.y+i.height/2;return Am(e).forEach(function(t){var e=t.x-a,t=t.y-s,t=e*e+t*t;h<t&&(h=t)}),h=W(h),{x:a-h,y:s-h,width:2*h,height:2*h}},vc=Gl.graph={},du=function(t,e,i){zs("ht.graph."+t,e,i)},Gl.layout={},yc={},mc=function(t,e,i,n,r,o,a,s){var h=a._zoom;if(h!==a._cacheZoom&&(a._cacheZoom=h,a._cacheImage={}),h*=ma,n=Math.ceil(n*h),r=Math.ceil(r*h),2048<n||2048<r)return e;var c=[e.uuid,n,r,i].join("_");e.cacheRule&&(c+="_"+xh(e.cacheRule,o,a));h=a._cacheImage[c];return h||(fh=!0,h=Gl.Default.toCanvas(e,n,r,i,o,a,s),fh&&(a._cacheImage[c]=h)),h},An(G,{setImageCacheRule:function(t,e){var i,n;for(n in e||"object"!=typeof t?(i={})[t]=e:i=t,i){var r=i[n];pn(n)?(zs=Qa(n))?zs.cacheRule=r:yc[n]=r:n.cacheRule=r}}}),(ru={comps:[{type:Tt,points:[85,50,70,115,100,71,86,107,88,49,43,117,100,48,57,106,108,57,69,55,101,53,78,114,65,55,97,112,56,70,68,49,67,97,115,122,67,43,113,110,114,54,69,61],borderWidth:1,borderColor:U}]})[Rt]=ru[At]=160,C.Image&&((Iv=new C.Image).src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAALUlEQVRYR+3QQREAAAABQfqXFsNnFTizzXk99+MAAQIECBAgQIAAAQIECBAgMBo/ACHo7lH9AAAAAElFTkSuQmCC",Xa("default_blank",Iv)),Xa("node_image",hn(30,30,[{type:xt,rect:[4,5,22,16],gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[2,3,26,20],borderWidth:1,borderColor:Zo},{type:xt,rect:[11,23,8,4],background:Zo},{type:xt,rect:[6,27,18,2],background:Zo}])),Xa("node_icon",hn(16,16,[{type:xt,rect:[2,2,12,10],gradient:wa,gradientColor:Ko,background:Zo},{type:mt,rect:[2,2,12,10],width:1,color:Zo},{type:xt,rect:[6,12,4,2],background:Zo},{type:xt,rect:[4,14,8,1],background:Zo}])),Xa("block_icon",hn(16,16,[{type:mt,rect:[1,1,14,14],width:1,color:Zo}])),Xa("group_image",hn(66,39,[{type:xt,rect:[44.3,18,18.1,12.8],gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[3.3,17.8,18.1,12.8],gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[15.8,3.2,33.5,26.4],borderWidth:1,borderColor:Zo,gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[26.2,29.4,12.8,4.2],background:Zo},{type:xt,rect:[21.3,33.5,22.5,2.3],background:Zo},{type:xt,rect:[5.3,32.7,14.1,2.1],background:Zo},{type:xt,rect:[9,30.4,6.7,2.4],background:Zo},{type:xt,rect:[50,30.7,6.7,2.4],background:Zo},{type:xt,rect:[46.3,33,14.1,2.1],background:Zo}])),Xa("group_icon",hn(16,16,[{type:xt,rect:[4,12,4,2],background:Zo},{type:xt,rect:[2,13,8,1],background:Zo},{type:xt,rect:[12,12,2,1],background:Zo},{type:xt,rect:[11,13,4,1],background:Zo},{type:xt,rect:[10,7,6,5],gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[1,2,10,10],gradient:wa,gradientColor:Ko,background:Zo},{type:mt,rect:[1,2,10,10],width:1,color:Zo}])),Xa("refGraph_icon",hn(16,16,[{type:"shape",borderWidth:1,borderColor:Zo,borderCap:"round",rotation:.7854,points:[12.5502,6.7981,12.5502,6.7981,12.5502,4.8181,12.5502,3.7981,12.5502,2.7781,11.36687,1.7981,10.0502,1.7981,8.73354,1.7981,7.5502,2.8181,7.5502,3.7981,7.5502,4.55989,7.5502,7.79805,7.5502,7.79805,7.5502,7.79805,7.5502,9.7981,10.0502,9.7981],segments:[1,4,4,4,4,4]},{type:"shape",borderWidth:1,borderColor:Zo,borderCap:"round",rotation:-2.35619,points:[8.4498,11.2019,8.4498,11.2019,8.4498,9.2219,8.4498,8.2019,8.4498,7.1819,7.26646,6.2019,5.9498,6.2019,4.63313,6.2019,3.4498,7.2219,3.4498,8.2019,3.4498,8.9637,3.4498,12.20186,3.4498,12.20186,3.4498,12.20186,3.4498,14.2019,5.9498,14.2019],segments:[1,4,4,4,4,4]}])),Xa("edge_icon",hn(16,16,[{type:xt,rect:[2.1,6.9,11.5,2.6],rotation:-.79,gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[10.8,1,4,4],background:Zo},{type:xt,rect:[1,11,4,4],background:Zo}])),Xa("subGraph_image",hn(72,45,[{type:Tt,points:[9,42,.3,38.4,2.4,28.8,5.7,21.6,11.7,22.5,11.7,15.9,16.8,13.8,21.6,12,24.3,15.9,27.9,3,42.3,2.1,59.4,4.5,57.3,18.3,67.5,18.9,69.6,27.3,69.9,38.4,64.2,41.4],segments:[1,3,3,3,3,3,3,3,3],gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[29.6,30.7,3.6,1.8],background:Zo},{type:xt,rect:[28.4,32.3,6,1.2],background:Zo},{type:xt,rect:[37.3,32,10.8,1.8],background:Zo},{type:xt,rect:[39.1,29.9,7.2,2.3],background:Zo},{type:xt,rect:[26.6,23.7,9.6,7.2],gradient:wa,gradientColor:Ko,background:Zo},{type:xt,rect:[34.3,16.8,16.8,13.2],borderWidth:1,borderColor:Zo,gradient:wa,gradientColor:Ko,background:Zo}])),Xa("subGraph_icon",hn(17,17,[{type:Tt,points:[2.2,14.6,.2,11.9,.8,8.8,1.8,5.9,5.6,7.4,3.8,1.6,10.3,3,14.5,4.2,12.2,7.5,18.9,7.2,14.5,14.5],segments:[1,3,3,3,3,3],gradient:wa,gradientColor:Ko,background:Zo}])),Xa("shape_icon",hn(16,16,[{type:Tt,points:[1.5,1,8.4,1,8.4,7.2,14.6,7.1,14.6,14.9,1.5,14.9,1.5,1],background:Zo}])),Xa("polyline_icon",hn(16,16,[{type:Tt,points:[1.5,1,8.4,1,8.4,7.2,14.6,7.1,14.6,14.9,1.5,14.9,1.5,1],borderWidth:1,borderColor:Zo},Gv(7.5,.4),Gv(7.5,6.3),Gv(13.6,6.3),Gv(13.6,14),Gv(.7,13.9),Gv(.7,.3)])),Xa("grid_icon",hn(16,16,[{type:xt,rect:[1,1,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[6,1,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[11,1,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[11,6,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[6,6,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[1,6,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[11,11,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[6,11,4,4],background:Zo,gradient:wa,gradientColor:Ko},{type:xt,rect:[1,11,4,4],background:Zo,gradient:wa,gradientColor:Ko}])),Xa("light_icon",hn(16,16,[{type:"rect",rect:[6,9,5,5],borderWidth:1,borderColor:Zo},{type:"circle",rect:[1,1,15,10],borderWidth:1,borderColor:Zo,gradient:wa,gradientColor:Ko,background:{func:function(t){t=t?t.s(mu):U;return bn(t)?"rgb("+tt(255*t[0])+","+tt(255*t[1])+","+tt(255*t[2])+")":t||Zo}}}])),Xa("text_icon",hn(16,16,[{type:"shape",points:[3,3,13,3,8,3,8,14],segments:[1,2,1,2],borderWidth:1,borderColor:Zo}])),Xa("border_image",{fitSize:!0,comps:[{type:"border",relative:!0,rect:[0,0,1,1],color:{func:"style@border_color"},width:{func:"style@border_width"}}]}),Xa("columnChart_image",{fitSize:!0,boundExtend:150,comps:[{type:{func:"style@chart.type"},relative:!0,rect:[0,0,1,1],label:{func:"style@chart.label"},labelColor:{func:"style@chart.label.color"},labelFont:{func:"style@chart.label.font"},series:{func:"style@chart.series"},minValue:{func:"style@chart.min.value"},maxValue:{func:"style@chart.max.value"}}]}),Xa("lineChart_image",{fitSize:!0,boundExtend:150,comps:[{type:"lineChart",relative:!0,rect:[0,0,1,1],label:{func:"style@chart.label"},labelColor:{func:"style@chart.label.color"},labelFont:{func:"style@chart.label.font"},series:{func:"style@chart.series"},minValue:{func:"style@chart.min.value"},maxValue:{func:"style@chart.max.value"},linePoint:{func:"style@chart.line.point"},lineWidth:{func:"style@chart.line.width"},line3d:{func:"style@chart.line.3d"}}]}),Xa("pieChart_image",{fitSize:!0,boundExtend:150,comps:[{type:"pieChart",relative:!0,rect:[0,0,1,1],label:{func:"style@chart.label"},labelColor:{func:"style@chart.label.color"},labelFont:{func:"style@chart.label.font"},hollow:{func:"style@chart.hollow"},startAngle:{func:"style@chart.start.angle"},values:{func:"style@chart.values"},colors:{func:"style@chart.colors"}}]}),bc=function(t){if(t){var e,i=t._data;if(i instanceof Gl.Shape)return{points:i.getPoints(),segments:i.getSegments()};if(i instanceof Gl.Edge&&(e=t._78o)){var n,r,o=e.type,a=e.points,s=e.segments,h=e.edgeTypeInfo;if(!o||a){var c=e.sourcePoint,l=c.x,i=c.y,t=e.targetPoint,c=t.x,t=t.y;if(o)s?((n=new Lh({x:l,y:i})).addAll(a),n.add({x:c,y:t}),r=new Lh(s._as)):(n=new Lh({x:l,y:i}),a.each(function(t){n.add(t)}),n.add({x:c,y:t}));else if(e.looped){n=new Lh(function(t,e,i,n,r,o){var a,s,h,c,l,u,d,f=[];if(Math.abs(n)>2*Math.PI&&(n=2*Math.PI),a=-(n/(h=Math.ceil(Math.abs(n)/(Math.PI/4)))),s=-i,0<h){n=t+Math.cos(i)*r,i=e+Math.sin(-i)*o,f.push({x:n,y:i});for(var g=0;g<h;g++)d=(s+=a)-a/2,c=t+Math.cos(s)*r,l=e+Math.sin(s)*o,u=t+Math.cos(d)*(r/Math.cos(a/2)),d=e+Math.sin(d)*(o/Math.cos(a/2)),f.push({x:u,y:d}),f.push({x:c,y:l})}return f}(l,i,0,2*Math.PI,e.radius,e.radius)),r=new Lh([1]);for(var u=0;u<(n.size()-1)/2;u++)r.add(3)}else n=new Lh,e.center?(n.add({x:e.c1.x,y:e.c1.y}),n.add({x:l,y:i}),n.add({x:c,y:t}),n.add({x:e.c2.x,y:e.c2.y})):(n.add({x:l,y:i}),n.add({x:c,y:t}))}else h&&(n=new Lh(h.points._as),h.segments&&(r=new Lh(h.segments._as)));return{points:n,segments:r}}}},An(G,{_edgeProtectMethod:{getStraightLinePoints:xc=function(t,e,i){if(null==e){t=bc(t);if(!t)return;e=t.points,i=t.segments}if(e){if(Array.isArray(e)&&(e=new Lh(e)),"number"==typeof e.get(0)){for(var n=new Gl.List,r=0;r<e.size();r+=2)n.add({x:e.get(r),y:e.get(r+1)});e=n}if(!i){i=[1];for(var o=e.length-1;0<o;o--)i.push(2)}Array.isArray(i)&&(i=new Lh(i));for(var a=so(e._as,i._as,50),s=a.length,h=[],r=0;r<s;r++){var c=a[r];1<c.length&&h.push(c)}return h}},calculateLineLength:wc=function(t){for(var e=0,i=t.length-1,n=0;n<i;n++){var r=t[n],o=t[n+1],a=o.x-r.x,r=o.y-r.y;e+=Math.sqrt(a*a+r*r)}return e},calcSegmentIndexByDistance:Ec=function(t,e){for(var i=0,n=e.length,r=0;r<n;r++)if(t<(i+=e[r]))return r;return Math.min(r,n-1)},calculatePointAlongLine:Tc=function(t,e){for(var i=0,n=0,r=0,o=t.length-1,a=0;a<o;a++){var s=t[a],h=t[a+1],c=h.x-s.x,l=h.y-s.y;if(e<(i+=r=Math.sqrt(c*c+l*l))){i-=r,n=a;break}}var u=t[n],d=t[n+1],f=Math.atan2(d.y-u.y,d.x-u.x),d=e-i,l=Math.sin(f)*d,c=Math.cos(f)*d;return{x:u.x+c,y:u.y+l}},getPercentPosition:Sc=function(t,e){if(t){var i;if(0===e)i=t[0][0];else if(100===e)i=(t=t[t.length-1])[t.length-1];else{for(var n=0,r=[],o=t.length,a=0;a<o;a++){var s=t[a],s=wc(s);n+=s,r.push(s)}for(var e=n*e/100,h=Ec(e,r),c=0,l=0;l<h;l++)c+=r[l];e-=c,i=Tc(t[h],e)}return i}},getRealPointsFromDataUI:Ic=function(t){for(var e,i,t=bc(t),n=[],r=t.points,o=t.segments,a=-1,s=0,h=(o||r).length;s<h;s++){if(3===(e=o?o.get(s):1))i=2;else if(4===e)i=3;else{if(5===e)continue;i=1}a+=i,n.push(r.get(a))}return n}}}),Cc=function(t,e){for(var i=t.vertices,n=0;n<i.length;n++){var r=i[n],o=r.y;r.y=r.z,r.z=-o,e&&(r.y+=e)}},Mc=function(t){for(var e,i,n,r,o,a,s=[],h=[],c=[],l=t.faces,u=0,d=0,f=0,g=l.length;u<g;u++,d+=6,f+=9){var p=l[u];1===p.i?(e||(e=[],i=[],n=[]),Rc(p,u,d,f,t,e,n,i)):2===p.i?(r||(r=[],o=[],a=[]),Rc(p,u,d,f,t,r,a,o)):Rc(p,u,d,f,t,s,c,h)}return{vs:s,uv:h,ns:c,top_vs:e,top_uv:i,top_ns:n,bottom_vs:r,bottom_uv:o,bottom_ns:a}},Rc=function(t,e,i,n,r,o,a,s){var h=r.vertices,c=r.faceVertexUvs,l=h[t.a],r=h[t.b],h=h[t.c];o.push(l.x,l.y,l.z,r.x,r.y,r.z,h.x,h.y,h.z);var u,h=t.vertexNormals;3===h.length?(u=h[0],d=h[1],f=h[2]):u=d=f=t.normal,a.push(u.x,u.y,u.z,d.x,d.y,d.z,f.x,f.y,f.z);var d=c[0][e][0],f=c[0][e][1],e=c[0][e][2];s.push(d.x,d.y,f.x,f.y,e.x,e.y)},Ac=function(){function S(t,e){return 0<t.dot(e)}function x(){this._vertexMap={},this._lineMap={},this._lineList=[]}function d(t,e,i,n,r,o,a){r=[i,r];t[0]===n&&r.reverse();n=[r[0]._key,r[1]._key].join("|"),r=t._triangles[n];r||(t._triangles[n]=r={});n=[o._key,a._key].join("|");r[n]||(r[n]=[o,a])}function f(t,e,i){var n=t._planes[i._key];if(!n)for(var r in t._planes){var o=t._planes[r];if(o._normal.angleTo(i)<.001){n=o;break}}return n?void(n._vertices.indexOf(e)<0&&n._vertices.push(e)):void(t._planes[i._key]={_normal:i,_vertices:[e]})}function g(t,e){return 0===e?"0|0|0":(1/0===Math.abs(e)?[t.x,t.y,t.z]:[Math.round(i.angleTo(t)*e),Math.round(r.angleTo(t)*e),Math.round(o.angleTo(t)*e)]).join("|")}var I=new ha,C=new ha,M=new ha,R=new ha,A=new ha,P=new ha,D=new ha,O=new ha,B=new ha,z=new ha,V=new ha,n=new ha;x.prototype._findVertex=function(t,e){n.fromArray(t,3*e);var i=[n.x,n.y,n.z].join(","),t=this._vertexMap[i];return t||((e=n.clone())._key=i,this._vertexMap[i]=t=e),t},x.prototype._findLine=function(t,e){var i=[t,e];t._key>e._key&&i.reverse(),i._key=[i[0]._key,i[1]._key].join("|");e=this._lineMap[i._key];return e||((this._lineMap[i._key]=e=i)._triangles={},i._planes={},this._lineList.push(i)),e};var i=new ha(1,0,0),r=new ha(0,1,0),o=new ha(0,0,1),p=new ha,_=new ha;return x.prototype._addTriangle=function(t,e,i,n,r,o){var a,s=this._findVertex(t,i),h=this._findVertex(t,n),c=this._findVertex(t,r),l=this._findLine(s,h),u=this._findLine(h,c),t=this._findLine(c,s);e?((a=(new ha).fromArray(e,3*i))._key=g(a,o),(n=(new ha).fromArray(e,3*n))._key=g(n,o),(r=(new ha).fromArray(e,3*r))._key=g(r,o),d(l,0,a,h,n,c,r),d(u,0,n,c,r,s,a),d(t,0,r,s,a,h,n)):(_.subVectors(c,h),p.subVectors(h,s),(a=(new ha).crossVectors(p,_))._key=g(a,o),f(l,c,a),f(u,s,a),f(t,h,a))},x.prototype._toLineVS=function(t){for(var e=this._lineList,i=0,n=e.length;i<n;++i){var r,o=e[i],a=!1;for(r in o._triangles)if(1==L.keys(o._triangles[r]).length){t.push(o[0].x,o[0].y,o[0].z,o[1].x,o[1].y,o[1].z),a=!0;break}if(!a)for(var s in o._planes)if(1==o._planes[s]._vertices.length){t.push(o[0].x,o[0].y,o[0].z,o[1].x,o[1].y,o[1].z),a=!0;break}}},[function(t,e){var i;if((w=t._ctlineModel)||(t._ctlineModel=w=[]),w[0])return w[0];i=bn(t)?t:[t];var n,r,o,a,s,h,c,l,u,d,f,g,p,_,v,y,m,b,x=["","top_","bottom_"],w=[],E=[];for(Pd(i,e,E),n=0,r=E.length;n<r;n++)if(u=E[n])for(Hf(u),o=0,a=x.length;o<a;o++)if(l=u[x[o]+"lvs"])for(y=w.length,m=l.length,w.length=y+m,b=0;b<m;++b,++y)w[y]=l[b];else if(h=u[x[o]+"vs"]){s=(c=u[x[o]+"is"])?c.length:h.length/3;for(var T=0;T<s-1;)v=c?(d=c[T],f=c[T+1],g=c[T+2],p=c[T+3],_=c[T+4],c[T+5]):(f=(d=T)+1,g=T+2,p=T+3,_=T+4,T+5),I.fromArray(h,3*d),C.fromArray(h,3*f),M.fromArray(h,3*g),R.fromArray(h,3*p),A.fromArray(h,3*_),P.fromArray(h,3*v),T+=3*function(t,e,i,n,r,o,a){for(var s,h,c=[e,i,n],l=[r,o,a],u=[],d=c.length,f=!0;d--&&f;){for(var g=c[d],p=l.length,_=!1;p--;)if(g.equals(l[p])){l.splice(p,1),u.push(g),_=!0;break}if(!_){if(s){f=!1;break}s=g}}return f&&2===u.length&&(h=l[0],D.subVectors(s,u[0]),B.subVectors(h,u[0]),O.subVectors(s,u[1]),D.x*O.y*B.z+O.x*B.y*D.z+B.x*D.y*O.z-B.x*O.y*D.z-B.y*O.z*D.x-B.z*O.x*D.y<1e-6&&(z.subVectors(h,u[1]),V.subVectors(u[1],u[0]),S(V,D)&&S(V,B)&&(V.negate(),S(V,O)&&S(V,z))))?(t.push(u[1].x,u[1].y,u[1].z),t.push(s.x,s.y,s.z),t.push(s.x,s.y,s.z),t.push(u[0].x,u[0].y,u[0].z),t.push(u[0].x,u[0].y,u[0].z),t.push(h.x,h.y,h.z),t.push(h.x,h.y,h.z),t.push(u[1].x,u[1].y,u[1].z),2):(t.push(e.x,e.y,e.z),t.push(i.x,i.y,i.z),t.push(i.x,i.y,i.z),t.push(n.x,n.y,n.z),t.push(n.x,n.y,n.z),t.push(e.x,e.y,e.z),1)}(w,I,C,M,R,A,P);T<s&&(g=c?(d=c[T],f=c[T+1],c[T+2]):(f=(d=T)+1,T+2),I.fromArray(h,3*d),C.fromArray(h,3*f),M.fromArray(h,3*g),w.push(I.x,I.y,I.z),w.push(C.x,C.y,C.z),w.push(C.x,C.y,C.z),w.push(M.x,M.y,M.z),w.push(M.x,M.y,M.z),w.push(I.x,I.y,I.z))}return t._ctlineModel[0]=w},function(t,e,i){var n=t._ctlineModel;n||(t._ctlineModel=n=[]);var r=n[1];if(r&&r.epsilon===i)return r;(r=[]).epsilon=i,n=bn(t)?t:[t];var o,a,s,h,c,l,u,d,f,g,p,_=["","top_","bottom_"],v=new x,y=[];for(Pd(n,e,y),o=0,a=y.length;o<a;o++)if(d=y[o])for(Hf(d),s=0,h=_.length;s<h;s++)if(l=d[_[s]+"vs"]){c=(u=d[_[s]+"is"])?u.length:l.length/3;for(var m=0,m=0;m<c;m+=3)p=u?(f=u[m],g=u[m+1],u[m+2]):(g=(f=m)+1,m+2),v._addTriangle(l,H,f,g,p,i)}return v._toLineVS(r),t._ctlineModel[1]=r},function(t,e,i){var n=t._ctlineModel;n||(t._ctlineModel=n=[]);var r=n[1];if(r&&r.epsilon===i)return r;(r=[]).epsilon=i,n=bn(t)?t:[t];var o,a,s,h,c,l,u,d,f,g,p,_,v=["","top_","bottom_"],y=new x,m=[];for(Pd(n,e,m),o=0,a=m.length;o<a;o++)if(f=m[o])for(Hf(f),s=0,h=v.length;s<h;s++)if(l=f[v[s]+"vs"]){u=f[v[s]+"is"],d=f[v[s]+"ns"],c=u?u.length:l.length/3;for(var b=0,b=0;b<c;b+=3)_=u?(g=u[b],p=u[b+1],u[b+2]):(p=(g=b)+1,b+2),y._addTriangle(l,d,g,p,_,i)}return y._toLineVS(r),t._ctlineModel[2]=r}]}(),Pc=function(t,e,i,n,r,o,a,s,h){i==U&&(i=!0),n==U&&(n=!0),a==U&&(a=1),s==U&&(s=0);var c=new qc;return ao(c,t,e,h),c=c.toShapes(),Mc(new ol(c,{top:i,bottom:n,curveSegments:r,amount:a,repeatUVLength:o},-a/2+s))},(Dc=function(t,e){this.x=t||0,this.y=e||0}).prototype={constructor:Dc,add:function(t){return this.x+=t.x,this.y+=t.y,this},sub:function(t){return this.x-=t.x,this.y-=t.y,this},equals:function(t){return t.x===this.x&&t.y===this.y},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},distanceTo:function(t){return W(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,t=this.y-t.y;return e*e+t*t},clone:function(){return new Dc(this.x,this.y)}},(Oc=function(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0}).prototype={constructor:Oc,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setY:function(t){return this.y=t,this},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},sub:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},applyMatrix4:function(t){var e=this.x,i=this.y,n=this.z,t=t.elements;return this.x=t[0]*e+t[4]*i+t[8]*n+t[12],this.y=t[1]*e+t[5]*i+t[9]*n+t[13],this.z=t[2]*e+t[6]*i+t[10]*n+t[14],this},divideScalar:function(t){return 0!==t?(t=1/t,this.x*=t,this.y*=t,this.z*=t):(this.x=0,this.y=0,this.z=0),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},length:function(){return W(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){return this.divideScalar(this.length())},cross:function(t){var e=this.x,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-e*t.z,this.z=e*t.y-i*t.x,this},crossVectors:function(t,e){var i=t.x,n=t.y,r=t.z,o=e.x,t=e.y,e=e.z;return this.x=n*e-r*t,this.y=r*o-i*e,this.z=i*t-n*o,this},distanceTo:function(t){return W(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y,t=this.z-t.z;return e*e+i*i+t*t},clone:function(){return new Oc(this.x,this.y,this.z)}},(Bc=function(){this.elements=new Float32Array(16)}).prototype={constructor:Bc,set:function(t,e,i,n,r,o,a,s,h,c,l,u,d,f,g,p){var _=this.elements;return _[0]=t,_[4]=e,_[8]=i,_[12]=n,_[1]=r,_[5]=o,_[9]=a,_[13]=s,_[2]=h,_[6]=c,_[10]=l,_[14]=u,_[3]=d,_[7]=f,_[11]=g,_[15]=p,this},makeRotationAxis:function(t,e){var i=Q(e),n=Z(e),r=1-i,o=t.x,a=t.y,s=t.z,e=r*o,t=r*a;return this.set(e*o+i,e*a-n*s,e*s+n*a,0,e*a+n*s,t*a+i,t*s-n*o,0,e*s-n*a,t*s+n*o,r*s*s+i,0,0,0,0,1),this}},(zc=function(t){this.repeatUVLength=t}).prototype={generateTopUV:function(t,e,i,n,r,o,a){var s,h,c,l,u=t.vertices,d=u[n].x,f=u[n].y,t=u[r].x,n=u[r].y,r=u[o].x,u=u[o].y,o=this.repeatUVLength;return l=o?(h=s=0,c=o):(this._bb||(this._bb=e.getBoundingBox()),s=(l=this._bb).minX,h=l.minY,c=l.maxX-s,l.maxY-h),a?[new Dc((d-s)/c,(f-h)/l),new Dc((t-s)/c,(n-h)/l),new Dc((r-s)/c,(u-h)/l)]:[new Dc((d-s)/c,1-(f-h)/l),new Dc((t-s)/c,1-(n-h)/l),new Dc((r-s)/c,1-(u-h)/l)]},generateBottomUV:function(t,e,i,n,r,o){return this.generateTopUV(t,e,i,n,r,o,!0)},generateSideWallUV:function(t,e,i,n,r,o,a,s,h,c,l,u){if(!this._cl){for(var d,f=[],g=0,p=i.length,_=0;_<p;_++){d=i[_],y=i[(_+1)%p];var v=d.x-y.x,y=d.y-y.y,y=W(v*v+y*y);f.push(g),g+=y}for(_=0;_<p;_++)f[_]/=g;this._cl=f}var m=1-h/c,c=1-(h+1)/c,l=(f=this._cl)[l],u=f[u];return l<u&&(l+=1),[new Dc(l,m),new Dc(u,m),new Dc(u,c),new Dc(l,c)]}},(Vc=function(t,e,i,n,r,o){this.a=t,this.b=e,this.c=i,this.i=o,this.normal=n instanceof Oc?n:new Oc,this.vertexNormals=n instanceof Array?n:[]}).prototype={constructor:Vc},Lc=[-8,14,-5,9,1,12,3,6,-1],Fc=function(){if(Fc.eye!=U)return Fc.eye;for(var t=eo.eye,e=Lc,i=jh.prototype.getClassName(),n="",r=!1,i=+new C[i.substr(3,3)+ei[0]],o=0;o<e.length;o++){var a=e.length-o;n+=o%2==0?e[o]+a+"":e[o]-a+""}for(o=0;o<4;o++)n+=0;if((n=n*n.length/n.length)<i){if(t&&t[0]&&t[4/xt.length]){for(var s,h,c,l,u,d,f,g,p=t[0],_=t[1],v="",y=0,o=0;o<_.length;o++)'"'===_[o]?g?(g=!1,0!=y%2&&(s==U?s=v:h==U?h=v:c==U?c=v:l==U?l=v:u==U?u=v:d==U?d=v:f==U&&(f=v)),y++,v=""):g=!0:g&&(v+=_[o]);for(var m,b,x,w="",E=0,o=0;o<p.length;o++)'"'===p[o]?m?(m=!1,0!=E%2&&(b==U?b=w:x==U&&(x=w)),E++,w=""):m=!0:m&&(w+=p[o]);var t=s+h+c+l+u+d,T=!d||d===di;if(!T&&d)for(var S,o=0,I=d.length;o<I;o++)d[o]===we[4]?S===di?T=fe:S[0]===ae[7]&&di&&0<=di.indexOf(S.substr(1))?T=pe:S=U:(S==U?S=d[o]:S+=d[o],o===I-1&&(S===di?T=fe:S[0]===ae[7]&&di&&0<=di.indexOf(S.substr(1))&&(T=pe)));(r=Wi(t,f)&&Wi(b,x)&&b===s&&T&&(!u||i<u))&&0<=c.indexOf(Ki[0])&&(Fc[Ki[0]]=1),r&&0<=c.indexOf(1)&&(Fc[1]=1),r&&0<=c.indexOf(3)&&(Fc[2]=1),r&&0<=c.indexOf(4)&&(Fc[3]=1),r&&0<=c.indexOf(7)&&(Fc[4]=1)}}else r=!0,Fc[Ki[0]]=Fc[1]=Fc[2]=Fc[3]=Fc[4]=1;return Fc.eye=r},($f=(kc=function(){}).prototype).getPointAt=function(t){t=this.getUtoTmapping(t);return this.getPoint(t)},$f.getPoints=function(t){t=t||5;for(var e=[],i=0;i<=t;i++)e.push(this.getPoint(i/t));return e},$f.getSpacedPoints=function(t){t=t||5;for(var e=[],i=0;i<=t;i++)e.push(this.getPointAt(i/t));return e},$f.getLength=function(){var t=this.getLengths();return t[t.length-1]},$f.getLengths=function(t){if(t=t||(this.__arcLengthDivisions||200),this.cacheArcLengths&&this.cacheArcLengths.length==t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i,n=[],r=this.getPoint(0),o=0;for(n.push(0),i=1;i<=t;i++)o+=(e=this.getPoint(i/t)).distanceTo(r),n.push(o),r=e;return this.cacheArcLengths=n},$f.getUtoTmapping=function(t,e){for(var i,n=this.getLengths(),r=0,o=n.length,a=e||t*n[o-1],s=0,h=o-1;s<=h;)if((i=n[r=k(s+(h-s)/2)]-a)<0)s=r+1;else{if(!(0<i)){h=r;break}h=r-1}if(r=h,n[r]==a)return r/(o-1);t=n[r];return(r+(a-t)/(n[r+1]-t))/(o-1)},$f.getTangent=function(t){var e=t-1e-4,t=t+1e-4;e<0&&(e=0),1<t&&(t=1);e=this.getPoint(e);return this.getPoint(t).clone().sub(e).normalize()},$f.getTangentAt=function(t){t=this.getUtoTmapping(t);return this.getTangent(t)},kc.create=function(t,e){return t.prototype=Kn(kc.prototype),t.prototype.getPoint=e,t},(Iv=(jc=function(){this.curves=[],this.autoClose=!1}).prototype=Kn($f)).add=function(t){this.curves.push(t)},Iv.closePath=function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new Kc(e,t))},Iv.getPoint=function(t){for(var e,i=t*this.getLength(),n=this.getCurveLengths(),r=0;r<n.length;){if(n[r]>=i){var o=1-(n[r]-i)/(e=this.curves[r]).getLength();return e.getPointAt(o)}r++}return null},Iv.getLength=function(){var t=this.getCurveLengths();return t[t.length-1]},Iv.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;for(var t=[],e=0,i=this.curves.length,n=0;n<i;n++)e+=this.curves[n].getLength(),t.push(e);return this.cacheLengths=t},Iv.getTransformedPoints=function(t){return this.getPoints(t)},Iv.getBoundingBox=function(){for(var t,e,i,n,r,o=this.getPoints(),a=t=Number.NEGATIVE_INFINITY,s=i=Number.POSITIVE_INFINITY,h=o[0]instanceof Oc,c=new(h?Oc:Dc),l=0,u=o.length;l<u;l++)(r=o[l]).x>a&&(a=r.x),r.x<s&&(s=r.x),r.y>t&&(t=r.y),r.y<i&&(i=r.y),h&&(r.z>e&&(e=r.z),r.z<n&&(n=r.z)),c.add(r);var d={minX:s,minY:i,maxX:a,maxY:t};return h&&(d.maxZ=e,d.minZ=n),d},Gv=(Nc=function(t){jc.call(this),this.actions=[],t&&this.fromPoints(t)}).prototype=Kn(jc.prototype),Uc="moveTo",Gc="quadraticCurveTo",Hc="bezierCurveTo",Wc="ellipse",Gv.fromPoints=function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y)},Gv.moveTo=function(){var t=Array.prototype.slice.call(arguments);this.actions.push({action:Uc,args:t})},Gv.lineTo=function(t,e){var i=Array.prototype.slice.call(arguments),n=this.actions[this.actions.length-1].args,r=n[n.length-2],n=n[n.length-1],e=new Kc(new Dc(r,n),new Dc(t,e));this.curves.push(e),this.actions.push({action:"lineTo",args:i})},Gv.quadraticCurveTo=function(t,e,i,n){var r=Array.prototype.slice.call(arguments),o=this.actions[this.actions.length-1].args,a=o[o.length-2],o=o[o.length-1],n=new Jc(new Dc(a,o),new Dc(t,e),new Dc(i,n));this.curves.push(n),this.actions.push({action:Gc,args:r})},Gv.bezierCurveTo=function(t,e,i,n,r,o){var a=Array.prototype.slice.call(arguments),s=this.actions[this.actions.length-1].args,h=s[s.length-2],s=s[s.length-1],o=new $c(new Dc(h,s),new Dc(t,e),new Dc(i,n),new Dc(r,o));this.curves.push(o),this.actions.push({action:Hc,args:a})},Gv.arc=function(t,e,i,n,r,o){var a=this.actions[this.actions.length-1].args,s=a[a.length-2],a=a[a.length-1];this.absarc(t+s,e+a,i,n,r,o)},Gv.absarc=function(t,e,i,n,r,o){this.absellipse(t,e,i,i,n,r,o)},Gv.ellipse=function(t,e,i,n,r,o,a){var s=this.actions[this.actions.length-1].args,h=s[s.length-2],s=s[s.length-1];this.absellipse(t+h,e+s,i,n,r,o,a)},Gv.absellipse=function(t,e,i,n,r,o,a){var s=Array.prototype.slice.call(arguments),a=new Zc(t,e,i,n,r,o,a);this.curves.push(a);a=a.getPoint(1);s.push(a.x),s.push(a.y),this.actions.push({action:Wc,args:s})},Gv.getSpacedPoints=function(t){t=t||40;for(var e=[],i=0;i<t;i++)e.push(this.getPoint(i/t));return e},Gv.getPoints=function(t,e){t=t||12;var i,n,r,o,a,s,h,c,l,u,d,f,g,p,_,v=[];for(V=0,B=this.actions.length;V<B;V++)switch(i=this.actions[V],n=i.action,r=i.args,n){case Uc:case"lineTo":v.push(new Dc(r[0],r[1]));break;case Gc:for(o=r[2],a=r[3],c=r[0],l=r[1],d=0<v.length?(u=(f=v[v.length-1]).x,f.y):(u=(f=this.actions[V-1].args)[f.length-2],f[f.length-1]),I=1;I<=t;I++)g=I/t,p=Xc.b2(g,u,c,o),_=Xc.b2(g,d,l,a),v.push(new Dc(p,_));break;case Hc:for(o=r[4],a=r[5],c=r[0],l=r[1],s=r[2],h=r[3],d=0<v.length?(u=(f=v[v.length-1]).x,f.y):(u=(f=this.actions[V-1].args)[f.length-2],f[f.length-1]),I=1;I<=t;I++)g=I/t,p=Xc.b3(g,u,c,s,o),_=Xc.b3(g,d,l,h,a),v.push(new Dc(p,_));break;case"arc":for(var y=r[0],m=r[1],b=r[2],x=r[3],w=r[4],E=!!r[5],T=w-x,S=2*t,I=1;I<=S;I++)g=I/S,E||(g=1-g),p=y+b*Q(C=x+g*T),_=m+b*Z(C),v.push(new Dc(p,_));break;case Wc:var C,y=r[0],m=r[1],M=r[2],R=r[3],x=r[4],w=r[5],E=!!r[6],T=w-x,S=2*t;for(I=1;I<=S;I++)g=I/S,E||(g=1-g),p=y+M*Q(C=x+g*T),_=m+R*Z(C),v.push(new Dc(p,_))}var A,P,D=F["shape3d.point.epsilon"],O=!1,B=v.length;for(V=0,B=v.length;V<B;V++)A=v[V],P=V===B-1?v[0]:v[V+1],A&&P&&X(A.x-P.x)<D&&X(A.y-P.y)<D&&(O=!0,v[V]=null);if(O){for(var z=[],V=0;V<B;V++)v[V]&&z.push(v[V]);v=z}return e&&v.push(v[0]),v},Gv.toShapes=function(t,e){function i(t){for(var e=[],i=0,n=t.length;i<n;i++){var r=t[i],o=new qc;o.actions=r.actions,o.curves=r.curves,e.push(o)}return e}var n=function(t){for(var e,i,n=[],r=new Nc,o=0,a=t.length;o<a;o++)i=(e=t[o]).args,(e=e.action)==Uc&&0!=r.actions.length&&(n.push(r),r=new Nc),r[e].apply(r,i);return 0!=r.actions.length&&n.push(r),n}(this.actions);if(0==n.length)return[];if(!0===e)return i(n);var r,o,a,s=[];if(1==n.length)return o=n[0],(a=new qc).actions=o.actions,a.curves=o.curves,s.push(a),s;var h,c,l,u,d,f,g=!Xc.isClockWise(n[0].getPoints()),g=t?!g:g,p=[],_=[],v=[],y=0;for(_[y]=H,v[y]=[],c=0,l=n.length;c<l;c++)h=(o=n[c]).getPoints(),r=Xc.isClockWise(h),(r=t?!r:r)?(!g&&_[y]&&y++,_[y]={s:new qc,p:h},_[y].s.actions=o.actions,_[y].s.curves=o.curves,g&&y++,v[y]=[]):v[y].push({h:o,p:h[0]});if(!_[0])return i(n);if(1<_.length){for(var m=!1,b=[],x=0,w=_.length;x<w;x++)p[x]=[];for(x=0,w=_.length;x<w;x++){_[x];for(var E=v[x],T=0;T<E.length;T++){for(var S=E[T],I=!0,C=0;C<_.length;C++)!function(t,e){for(var i=e.length,n=!1,r=i-1,o=0;o<i;r=o++){var a=e[r],s=e[o],h=s.x-a.x,c=s.y-a.y;if(1e-10<X(c)){if(c<0&&(a=e[o],h=-h,s=e[r],c=-c),!(t.y<a.y||t.y>s.y))if(t.y==a.y){if(t.x==a.x)return 1}else{h=c*(t.x-a.x)-h*(t.y-a.y);if(0==h)return 1;h<0||(n=!n)}}else if(t.y==a.y&&(s.x<=t.x&&t.x<=a.x||a.x<=t.x&&t.x<=s.x))return 1}return n}(S.p,_[C].p)||(x!=C&&b.push({froms:x,tos:C,hole:T}),I?(I=!1,p[C].push(S)):m=!0);I&&p[x].push(S)}}0<b.length&&(m||(v=p))}for(c=0,l=_.length;c<l;c++)for(a=_[c].s,s.push(a),d=0,f=(u=v[c]).length;d<f;d++)a.holes.push(u[d].h);return s},(Iv=(qc=function(){Nc.apply(this,arguments),this.holes=[]}).prototype=Kn(Gv)).getPointsHoles=function(t){for(var e=this.holes.length,i=[],n=0;n<e;n++)i[n]=this.holes[n].getTransformedPoints(t);return i},Iv.extractAllPoints=function(t){return{shape:this.getTransformedPoints(t),holes:this.getPointsHoles(t)}},Iv.extractPoints=function(t){return this.extractAllPoints(t)},Xc={triangulateShape:function(t,e){function x(t,e,i){return t.x!=e.x?t.x<e.x?t.x<=i.x&&i.x<=e.x:e.x<=i.x&&i.x<=t.x:t.y<e.y?t.y<=i.y&&i.y<=e.y:e.y<=i.y&&i.y<=t.y}function b(t,e,i,n,r){var o,a=e.x-t.x,s=e.y-t.y,h=n.x-i.x,c=n.y-i.y,l=t.x-i.x,u=t.y-i.y,d=s*h-a*c,f=s*l-a*u;if(1e-10<X(d)){if(0<d){if(f<0||d<f)return[];if((o=c*l-h*u)<0||d<o)return[]}else{if(0<f||f<d)return[];if(0<(o=c*l-h*u)||o<d)return[]}if(0==o)return!r||0!=f&&f!=d?[t]:[];if(o==d)return!r||0!=f&&f!=d?[e]:[];if(0==f)return[i];if(f==d)return[n];d=o/d;return[{x:t.x+d*a,y:t.y+d*s}]}if(0!=f||c*l!=h*u)return[];var g,p,_,v,y,m,b,s=0==a&&0==s,c=0==h&&0==c;return s&&c?t.x!=i.x||t.y!=i.y?[]:[t]:s?x(i,n,t)?[t]:[]:c?x(t,e,i)?[i]:[]:(i=0!=a?(v=t.x<e.x?(_=(g=t).x,(p=e).x):(_=(g=e).x,(p=t).x),i.x<n.x?(b=(y=i).x,(m=n).x):(b=(y=n).x,(m=i).x)):(v=t.y<e.y?(_=(g=t).y,(p=e).y):(_=(g=e).y,(p=t).y),i.y<n.y?(b=(y=i).y,(m=n).y):(b=(y=n).y,(m=i).y)),_<=b?v<b?[]:v==b?r?[]:[y]:v<=i?[y,p]:[y,m]:i<_?[]:_==i?r?[]:[g]:v<=i?[g,p]:[g,m])}function w(t,e,i,n){var r=e.x-t.x,o=e.y-t.y,a=i.x-t.x,e=i.y-t.y,i=n.x-t.x,n=n.y-t.y,t=r*e-o*a,o=r*n-o*i;if(1e-10<X(t)){a=i*e-n*a;return 0<t?0<=o&&0<=a:0<=o||0<=a}return 0<o}for(var i,n,r,o,a={},s=t.concat(),h=0,c=e.length;h<c;h++)Array.prototype.push.apply(s,e[h]);for(u=0,d=s.length;u<d;u++)a[r=s[u].x+":"+s[u].y],a[r]=u;for(var t=function(t,a){for(var s,e,i,n,r,o,h,c,l,u,d=t.concat(),f=[],g=[],p=0,_=a.length;p<_;p++)f.push(p);for(var v=0,y=2*f.length;0<f.length&&!(--y<0);)for(i=v;i<d.length;i++){n=d[i],e=-1;for(p=0;p<f.length;p++)if(r=f[p],g[o=n.x+":"+n.y+":"+r]===H){s=a[r];for(var m=0;m<s.length;m++)if(u=s[m],function(t,e){var i=d.length-1,n=t-1;n<0&&(n=i);var r=t+1;i<r&&(r=0);var o=w(d[t],d[n],d[r],s[e]);if(o){i=s.length-1,n=e-1;n<0&&(n=i);r=e+1;return i<r&&(r=0),!!w(s[e],s[n],s[r],d[t])}}(i,m)&&!function(t,e){for(var i,n=0;n<d.length;n++)if(i=n+1,i%=d.length,0<b(t,e,d[n],d[i],!0).length)return 1}(n,u)&&!function(t,e){for(var i,n,r,o=0;o<f.length;o++)for(i=a[f[o]],n=0;n<i.length;n++)if(r=n+1,r%=i.length,0<b(t,e,i[n],i[r],!0).length)return 1}(n,u)){e=m,f.splice(p,1),h=d.slice(0,i+1),c=d.slice(i),l=s.slice(e),u=s.slice(0,e+1),d=h.concat(l).concat(u).concat(c),v=i;break}if(0<=e)break;g[o]=!0}if(0<=e)break}return d}(t,e),l=Qc.Triangulate(t,!1),u=0,d=l.length;u<d;u++)for(n=l[u],i=0;i<3;i++)(o=a[r=n[i].x+":"+n[i].y])!==H&&(n[i]=o);return l.concat()},isClockWise:function(t){return Qc.Triangulate.area(t)<0},b2p0:function(t,e){t=1-t;return t*t*e},b2p1:function(t,e){return 2*(1-t)*t*e},b2p2:function(t,e){return t*t*e},b2:function(t,e,i,n){return this.b2p0(t,e)+this.b2p1(t,i)+this.b2p2(t,n)},b3p0:function(t,e){t=1-t;return t*t*t*e},b3p1:function(t,e){var i=1-t;return 3*i*i*t*e},b3p2:function(t,e){return 3*(1-t)*t*t*e},b3p3:function(t,e){return t*t*t*e},b3:function(t,e,i,n,r){return this.b3p0(t,e)+this.b3p1(t,i)+this.b3p2(t,n)+this.b3p3(t,r)}},Hv=function(t){for(var e=t.length,i=0,n=e-1,r=0;r<e;n=r++)i+=t[n].x*t[r].y-t[r].x*t[n].y;return.5*i},Wv=function(t,e,i,n,r,o){var a,s,h,c,l,u,d,f,g,p=t[o[e]].x,_=t[o[e]].y,v=t[o[i]].x,y=t[o[i]].y,m=t[o[n]].x,b=t[o[n]].y;if((v-p)*(b-_)-(y-_)*(m-p)<1e-10)return!1;for(c=m-v,l=b-y,u=p-m,d=_-b,f=v-p,g=y-_,a=0;a<r;a++)if(s=t[o[a]].x,h=t[o[a]].y,!(s===p&&h===_||s===v&&h===y||s===m&&h===b)&&(-1e-10<=c*(h-y)-l*(s-v)&&-1e-10<=u*(h-b)-d*(s-m)&&-1e-10<=f*(h-_)-g*(s-p)))return!1;return!0},(Gv=Qc={faces:{},face:"",weight:"normal",style:"normal",size:150,divisions:10,getDefaultFont:function(){var t=L.keys(this.faces);return t.length?t[0]:null},getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(t){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(t){var e=t.familyName.toLowerCase();return this.faces[e]=this.faces[e]||{},this.faces[e][t.cssFontWeight]=this.faces[e][t.cssFontWeight]||{},this.faces[e][t.cssFontWeight][t.cssFontStyle]=t},drawText:function(t){for(var e=this.getFace(),i=this.size/e.resolution,n=0,r=String(t).split(""),o=r.length,a=[],s=0;s<o;s++){var h=new Nc,h=this.extractGlyphPoints(r[s],e,i,n,h);h&&(n+=h.offset*this.spacing,a.push(h.path))}return{paths:a,offset:n/2}},extractGlyphPoints:function(t,e,i,n,r){var o,a,s,h,c,l,u,d,f,g,p,_,v,y,m,b,x,w,E=[],e=e.glyphs[t]||e.glyphs["?"];if(e){if(e.o)for(c=(h=e._cachedOutline||(e._cachedOutline=e.o.split(" "))).length,u=l=i,o=0;o<c;)switch(h[o++]){case"m":d=h[o++]*l+n,f=h[o++]*u,r.moveTo(d,f);break;case"l":d=h[o++]*l+n,f=h[o++]*u,r.lineTo(d,f);break;case"q":if(g=h[o++]*l+n,p=h[o++]*u,y=h[o++]*l+n,m=h[o++]*u,r.quadraticCurveTo(y,m,g,p),w=E[E.length-1])for(_=w.x,v=w.y,a=1,s=this.divisions;a<=s;a++){var T=a/s;Xc.b2(T,_,y,g),Xc.b2(T,v,m,p)}break;case"b":if(g=h[o++]*l+n,p=h[o++]*u,y=h[o++]*l+n,m=h[o++]*u,b=h[o++]*l+n,x=h[o++]*u,r.bezierCurveTo(y,m,b,x,g,p),w=E[E.length-1])for(_=w.x,v=w.y,a=1,s=this.divisions;a<=s;a++){T=a/s;Xc.b3(T,_,y,b,g),Xc.b3(T,v,m,x,p)}}return{offset:e.ha*i,path:r}}},generateShapes:function(t,e){var i=(e=e||{}).font;if(i===H&&!(i=Qc.getDefaultFont()))return console.log("There's no valid font face, use ht.Default.loadFontFace to load font first."),[];var n=e.size!==H?e.size:1,r=e.curveSegments!==H?e.curveSegments:4,o=e.spacing!==H?e.spacing:1,a=e.weight!==H?e.weight:"normal",e=e.style!==H?e.style:"normal";Qc.size=n,Qc.divisions=r,Qc.face=i,Qc.weight=a,Qc.style=e,Qc.spacing=o;for(var s=Qc.drawText(t).paths,h=[],c=0,l=s.length;c<l;c++)Array.prototype.push.apply(h,s[c].toShapes());return h}}).Triangulate=function(t,e){var i=t.length;if(i<3)return null;var n,r,o=[],a=[],s=[];if(0<Hv(t))for(l=0;l<i;l++)a[l]=l;else for(l=0;l<i;l++)a[l]=i-1-l;for(var h=i,c=2*h,l=h-1;2<h;){if(c--<=0)return e?s:o;if(h<=(n=l)&&(n=0),h<=(l=n+1)&&(l=0),h<=(r=l+1)&&(r=0),Wv(t,n,l,r,h,a)){var u,d,f=a[n],g=a[l],p=a[r];for(o.push([t[f],t[g],t[p]]),s.push([a[n],a[l],a[r]]),d=(u=l)+1;d<h;u++,d++)a[u]=a[d];c=2*--h}}return e?s:o},Gv.Triangulate.area=Hv,C._typeface_js={faces:Qc.faces,loadFace:Qc.loadFace},Iv=(Yc=function(){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]]}).prototype={constructor:Yc,computeFaceNormals:function(){for(var t=new Oc,e=new Oc,i=0,n=this.faces.length;i<n;i++){var r=this.faces[i],o=this.vertices[r.a],a=this.vertices[r.b],s=this.vertices[r.c];t.subVectors(s,a),e.subVectors(o,a),t.cross(e),t.normalize(),r.normal.copy(t)}},computeVertexNormals:function(t){for(var e,i=new Array(this.vertices.length),n=0,r=this.vertices.length;n<r;n++)i[n]=new Oc;if(t)for(var o,a,s,h=new Oc,c=new Oc,l=0,u=this.faces.length;l<u;l++)e=this.faces[l],o=this.vertices[e.a],a=this.vertices[e.b],s=this.vertices[e.c],h.subVectors(s,a),c.subVectors(o,a),h.cross(c),i[e.a].add(h),i[e.b].add(h),i[e.c].add(h);else for(l=0,u=this.faces.length;l<u;l++)i[(e=this.faces[l]).a].add(e.normal),i[e.b].add(e.normal),i[e.c].add(e.normal);for(n=0,r=this.vertices.length;n<r;n++)i[n].normalize();for(l=0,u=this.faces.length;l<u;l++)(e=this.faces[l]).vertexNormals[0]=i[e.a].clone(),e.vertexNormals[1]=i[e.b].clone(),e.vertexNormals[2]=i[e.c].clone()},mergeVertices:function(){for(var t,e,i,n,r,o={},a=[],s=[],h=K(10,4),c=0,l=this.vertices.length;c<l;c++)t=this.vertices[c],o[t=S(t.x*h)+"_"+S(t.y*h)+"_"+S(t.z*h)]===H?(o[t]=c,a.push(this.vertices[c]),s[c]=a.length-1):s[c]=s[o[t]];var u=[];for(c=0,l=this.faces.length;c<l;c++){(e=this.faces[c]).a=s[e.a],e.b=s[e.b],e.c=s[e.c],i=[e.a,e.b,e.c];for(var d=0;d<3;d++)if(i[d]==i[(d+1)%3]){u.push(c);break}}for(c=u.length-1;0<=c;c--){var f=u[c];for(this.faces.splice(f,1),n=0,r=this.faceVertexUvs.length;n<r;n++)this.faceVertexUvs[n].splice(f,1)}var g=this.vertices.length-a.length;return this.vertices=a,g}},(Zc=function(t,e,i,n,r,o,a){this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=n,this.aStartAngle=r,this.aEndAngle=o,this.aClockwise=a}).prototype=Kn($f),Zc.prototype.getPoint=function(t){var e=this.aEndAngle-this.aStartAngle;e<0&&(e+=J),J<e&&(e-=J),t=!0===this.aClockwise?this.aEndAngle+(1-t)*(J-e):this.aStartAngle+t*e;e=this.aX+this.xRadius*Q(t),t=this.aY+this.yRadius*Z(t);return new Dc(e,t)},(Gv=(Kc=function(t,e){this.v1=t,this.v2=e}).prototype=Kn($f)).getPoint=function(t){var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},Gv.getPointAt=function(t){return this.getPoint(t)},Gv.getTangent=function(){return this.v2.clone().sub(this.v1).normalize()},(Jc=function(t,e,i){this.v0=t,this.v1=e,this.v2=i}).prototype=Kn($f),Jc.prototype.getPoint=function(t){var e=Xc.b2(t,this.v0.x,this.v1.x,this.v2.x),t=Xc.b2(t,this.v0.y,this.v1.y,this.v2.y);return new Dc(e,t)},($c=function(t,e,i,n){this.v0=t,this.v1=e,this.v2=i,this.v3=n}).prototype=Kn($f),$c.prototype.getPoint=function(t){var e=Xc.b3(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t=Xc.b3(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y);return new Dc(e,t)},kc.create(function(t,e){this.v1=t,this.v2=e},function(t){var e=new Oc;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),tl=kc.create(function(t,e,i){this.v0=t,this.v1=e,this.v2=i},function(t){var e=Xc.b2(t,this.v0.x,this.v1.x,this.v2.x),i=Xc.b2(t,this.v0.y,this.v1.y,this.v2.y),t=Xc.b2(t,this.v0.z,this.v1.z,this.v2.z);return new Oc(e,i,t)}),el=kc.create(function(t,e,i,n){this.v0=t,this.v1=e,this.v2=i,this.v3=n},function(t){var e=Xc.b3(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),i=Xc.b3(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),t=Xc.b3(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z);return new Oc(e,i,t)}),(il=function(t,e,i,n,r,o,a,s){Yc.call(this),n=n!==H?n:.5,r=r!==H?r:.5,t=t||8,o=o||0,a=a||J;for(var h=(s=s!==H?s:1)/2,c=[],l=[],u=this.vertices,d=this.faces,f=this.faceVertexUvs,g=0;g<=1;g++){for(var p=[],_=[],v=+g,y=v*(r-n)+n,m=0;m<=t;m++){var b=m/t,x=new Oc,w=-(b*a+o);x.z=y*Z(w),x.y=-v*s+h,x.x=y*Q(w),u.push(x),p.push(u.length-1),_.push(new Dc(b,v))}c.push(p),l.push(_)}var E,T,S=(r-n)/s;for(m=0;m<t;m++)for(T=0!==n?(E=u[c[0][m]].clone(),u[c[0][m+1]].clone()):(E=u[c[1][m]].clone(),u[c[1][m+1]].clone()),E.setY(W(E.x*E.x+E.z*E.z)*S).normalize(),T.setY(W(T.x*T.x+T.z*T.z)*S).normalize(),g=0;g<1;g++){var I=c[g][m],C=c[g+1][m],M=c[g+1][m+1],R=c[g][m+1],A=E.clone(),P=E.clone(),D=T.clone(),O=T.clone(),B=l[g][m].clone(),z=l[g+1][m].clone(),V=l[g+1][m+1].clone(),L=l[g][m+1].clone();d.push(new Vc(I,C,R,[A,P,O])),f[0].push([B,z,L]),d.push(new Vc(C,M,R,[P.clone(),D,O.clone()])),f[0].push([z.clone(),V,L.clone()])}if(e&&0<n)for(this.vertices.push(new Oc(0,h,0)),m=0;m<t;m++){I=c[0][m],C=c[0][m+1],M=this.vertices.length-1,A=new Oc(0,1,0),P=new Oc(0,1,0),D=new Oc(0,1,0),B=l[0][m].clone(),z=l[0][m+1].clone(),V=new Dc(z.x,0);d.push(new Vc(I,C,M,[A,P,D],0,1));var F=Q(U=m/t*J),k=Z(U),j=Q(G=(m+1)/t*J),N=Z(G);f[0].push([new Dc(.5+.5*F,.5+.5*k),new Dc(.5+.5*j,.5+.5*N),new Dc(.5,.5)])}if(i&&0<r)for(this.vertices.push(new Oc(0,-h,0)),m=0;m<t;m++){I=c[g][m+1],C=c[g][m],M=u.length-1,A=new Oc(0,-1,0),P=new Oc(0,-1,0),D=new Oc(0,-1,0),B=l[g][m+1].clone(),z=l[g][m].clone();d.push(new Vc(I,C,M,[A,P,D],0,2));var U,G,F=Q(U=m/t*J),k=Z(U),j=Q(G=(m+1)/t*J),N=Z(G);f[0].push([new Dc(.5+.5*j,.5-.5*N),new Dc(.5+.5*F,.5-.5*k),new Dc(.5,.5)])}}).prototype=Kn(Iv),(nl=function(t,e,i,n,r,o,a){Yc.call(this),a=a||.5,t=t||16,e=e||16,i=(i!==H?i:0)-P,n=n!==H?n:J,r=r!==H?r:0,o=o!==H?o:P;for(var s=[],h=[],c=this.vertices,l=this.faces,u=this.faceVertexUvs,d=0;d<=e;d++){for(var f=[],g=[],p=0;p<=t;p++){var _=p/t,v=d/e,y=new Oc;y.x=-a*Q(i+_*n)*Z(r+v*o),y.y=a*Q(r+v*o),y.z=a*Z(i+_*n)*Z(r+v*o),c.push(y),f.push(c.length-1),g.push(new Dc(_,v))}s.push(f),h.push(g)}for(d=0;d<e;d++)for(p=0;p<t;p++){var m=s[d][p+1],b=s[d][p],x=s[d+1][p],w=s[d+1][p+1],E=c[m].clone().normalize(),T=c[b].clone().normalize(),S=c[x].clone().normalize(),I=c[w].clone().normalize(),C=h[d][p+1].clone(),M=h[d][p].clone(),R=h[d+1][p].clone(),A=h[d+1][p+1].clone();X(c[m].y)===a?(C.x=(C.x+M.x)/2,l.push(new Vc(m,x,w,[E,S,I])),u[0].push([C,R,A])):X(c[x].y)===a?(R.x=(R.x+A.x)/2,l.push(new Vc(m,b,x,[E,T,S])),u[0].push([C,M,R])):(l.push(new Vc(m,b,w,[E,T,I])),u[0].push([C,M,A]),l.push(new Vc(b,x,w,[T.clone(),S,I.clone()])),u[0].push([M.clone(),R,A.clone()]))}}).prototype=Kn(Iv),(rl=function(t,e,i,n,r,o){Yc.call(this),t=t||.33,e=e||.17,n=n||8,i=i||6,r=r||0,o=o||J;for(var a=new Oc,s=[],h=[],c=0;c<=n;c++)for(var l=c/n*J+P,u=0;u<=i;u++){var d=u/i*o+r;a.x=t*Q(d),a.z=-t*Z(d);var f=new Oc,g=t+e*Q(l);f.x=g*Q(d),f.z=-g*Z(d),f.y=e*Z(l),this.vertices.push(f),s.push(new Dc(u/i,1-c/n)),h.push(f.clone().sub(a).normalize())}for(c=1;c<=n;c++)for(u=1;u<=i;u++){var p=(i+1)*c+u-1,_=(i+1)*(c-1)+u-1,v=(i+1)*(c-1)+u,y=(i+1)*c+u,m=new Vc(p,_,y,[h[p].clone(),h[_].clone(),h[y].clone()]);this.faces.push(m),this.faceVertexUvs[0].push([s[p].clone(),s[_].clone(),s[y].clone()]),m=new Vc(_,v,y,[h[_].clone(),h[v].clone(),h[y].clone()]),this.faces.push(m),this.faceVertexUvs[0].push([s[_].clone(),s[v].clone(),s[y].clone()])}this.computeFaceNormals()}).prototype=Kn(Iv),(Gv=(ol=function(t,e,i){return t?(Yc.call(this),t=t instanceof Array?t:[t],this.addShapeList(t,e),!1!==e.convertYZ&&Cc(this,i),void this.computeFaceNormals()):void(t=[])}).prototype=Kn(Yc.prototype)).addShapeList=function(t,e){for(var i=t.length,n=0;n<i;n++){var r=t[n];this.addShape(r,e)}},Gv.addShape=function(_,v){function e(t,e){for(var i,n,r,o,a,s,h,c,l,u=t.length;0<=--u;){(n=(i=u)-1)<0&&(n=t.length-1);for(var d=0,f=y,d=0;d<f;d++){var g=M*d,p=M*(d+1);r=e+i+g,o=e+n+g,a=e+n+p,s=e+i+p,h=t,c=d,l=f,g=i,p=n,r+=x,o+=x,a+=x,s+=x,b.faces.push(new Vc(r,o,s)),b.faces.push(new Vc(o,a,s)),p=m.generateSideWallUV(b,_,h,v,r,o,a,s,c,l,g,p),b.faceVertexUvs[0].push([p[0],p[1],p[3]]),!void b.faceVertexUvs[0].push([p[1],p[2],p[3]])}}}function t(t,e,i){b.vertices.push(new Oc(t,e,i))}function i(t,e,i,n){t+=x,e+=x,i+=x,b.faces.push(new Vc(t,e,i,null,0,n?2:1));i=n?m.generateBottomUV(b,_,v,t,e,i):m.generateTopUV(b,_,v,t,e,i);b.faceVertexUvs[0].push(i)}var n,r,o,a,s,h=v.amount,c=v.curveSegments||Os,y=v.steps||1,l=v.extrudePath,u=!1,m=new zc(v.repeatUVLength);l&&(n=l.getSpacedPoints(y),u=!0,r=v.frames!==H?v.frames:new al.FrenetFrames(l,y,!1),o=new Oc,a=new Oc,s=new Oc);var d,b=this,x=this.vertices.length,c=_.extractPoints(c),f=c.shape,g=c.holes,c=!Xc.isClockWise(f);if(c)for(f=f.reverse(),E=0,T=g.length;E<T;E++)d=g[E],Xc.isClockWise(d)&&(g[E]=d.reverse());for(var p=Xc.triangulateShape(f,g),w=f,E=0,T=g.length;E<T;E++)d=g[E],f=f.concat(d);for(var S,I,C,M=f.length,R=p.length,A=0;A<M;A++)S=f[A],u?(a.copy(r.normals[0]).multiplyScalar(S.x),o.copy(r.binormals[0]).multiplyScalar(S.y),s.copy(n[0]).add(a).add(o),t(s.x,s.y,s.z)):t(S.x,S.y,0);for(C=1;C<=y;C++)for(A=0;A<M;A++)S=f[A],u?(a.copy(r.normals[C]).multiplyScalar(S.x),o.copy(r.binormals[C]).multiplyScalar(S.y),s.copy(n[C]).add(a).add(o),t(s.x,s.y,s.z)):t(S.x,S.y,h/y*C);(function(){if(v.bottom)for(var t=0;t<R;t++)i((I=p[t])[2],I[1],I[0],!0);if(v.top)for(t=0;t<R;t++)i((I=p[t])[0]+M*y,I[1]+M*y,I[2]+M*y,!1)})(),function(){var t=0;for(e(w,t),t+=w.length,E=0,T=g.length;E<T;E++)e(d=g[E],t),t+=d.length}()},(al=function(t,e,i,n,r){Yc.call(this),i=i||1,n=n||8,r=r||!1;var o,a,s,h,c,l,u,d,f,g,p,_,v,y,m,b,x,w,E,T=[],S=this,I=(e=e||64)+1,C=new Oc,M=new al.FrenetFrames(t,e,r),R=M.tangents,A=M.normals,P=M.binormals;for(this.tangents=R,this.normals=A,this.binormals=P,u=0;u<I;u++)for(T[u]=[],s=u/(I-1),l=t.getPointAt(s),R[u],o=A[u],a=P[u],d=0;d<n;d++)h=-i*Q(c=d/n*J),c=i*Z(c),C.copy(l),C.x+=h*o.x+c*a.x,C.y+=h*o.y+c*a.y,C.z+=h*o.z+c*a.z,T[u][d]=(x=C.x,w=C.y,E=C.z,S.vertices.push(new Oc(x,w,E))-1);for(u=0;u<e;u++)for(d=0;d<n;d++)m=r?(u+1)%e:u+1,b=(d+1)%n,f=T[u][d],g=T[m][d],p=T[m][b],_=T[u][b],v=new Dc(u/e,d/n),y=new Dc((u+1)/e,d/n),m=new Dc((u+1)/e,(d+1)/n),b=new Dc(u/e,(d+1)/n),this.faces.push(new Vc(f,g,_)),this.faceVertexUvs[0].push([v,y,b]),this.faces.push(new Vc(g,p,_)),this.faceVertexUvs[0].push([y.clone(),m,b.clone()]);this.computeFaceNormals(),this.computeVertexNormals()}).prototype=Kn(Iv),al.FrenetFrames=function(t,e,i){var n,r,o,a,s,h,c,l=new Oc,u=[],d=[],f=[],g=new Oc,p=new Bc,_=e+1;for(this.tangents=u,this.normals=d,this.binormals=f,h=0;h<_;h++)c=h/(_-1),u[h]=t.getTangentAt(c),u[h].normalize();for(d[0]=new Oc,f[0]=new Oc,r=Number.MAX_VALUE,o=X(u[0].x),a=X(u[0].y),s=X(u[0].z),o<=r&&(r=o,l.set(1,0,0)),a<=r&&(r=a,l.set(0,1,0)),s<=r&&l.set(0,0,1),g.crossVectors(u[0],l).normalize(),d[0].crossVectors(u[0],g),f[0].crossVectors(u[0],d[0]),h=1;h<_;h++)d[h]=d[h-1].clone(),f[h]=f[h-1].clone(),g.crossVectors(u[h-1],u[h]),1e-4<g.length()&&(g.normalize(),n=Y(Fn(u[h-1].dot(u[h]),-1,1)),d[h].applyMatrix4(p.makeRotationAxis(g,n))),f[h].crossVectors(u[h],d[h]);if(i)for(n=Y(Fn(d[0].dot(d[_-1]),-1,1)),n/=_-1,0<u[0].dot(g.crossVectors(d[0],d[_-1]))&&(n=-n),h=1;h<_;h++)d[h].applyMatrix4(p.makeRotationAxis(u[h],n*h)),f[h].crossVectors(u[h],d[h])},(sl=function(t,e,i,n){Yc.call(this),e=e||18,i=i||0,n=n==U?J:n;for(var r=1/(t.length-1),o=1/e,a=0,s=e;a<=s;a++)for(var h=i+a*o*n,c=Q(h),l=Z(h),u=0,d=t.length;u<d;u++){var f=t[u],g=new Oc;g.x=c*f.x-l*f.y,g.y=l*f.x+c*f.y,g.z=f.z,this.vertices.push(g)}for(var p=t.length,a=0,s=e;a<s;a++)for(u=0,d=t.length-1;u<d;u++){var _=u+p*a,v=_+p,c=_+1+p,y=_+1,m=a*o,b=u*r,x=m+o,w=b+r;this.faces.push(new Vc(_,y,v)),this.faceVertexUvs[0].push([new Dc(m,b),new Dc(m,w),new Dc(x,b)]),this.faces.push(new Vc(v,y,c)),this.faceVertexUvs[0].push([new Dc(x,b),new Dc(m,w),new Dc(x,w)])}this.mergeVertices(),Cc(this),this.computeFaceNormals(),this.computeVertexNormals()}).prototype=Kn(Iv),(hl=function(t,e){e=e||{};t=Qc.generateShapes(t,e);e.amount=e.amount!==H?e.amount:.5,(e.convertYZ=!1)!==e.fill&&(e.bottom=!0,e.top=!0),ol.call(this,t,e)}).prototype=Kn(Gv),cl=Gl.Node=function(){Bn(cl,this)},ll={X:Zs,Y:Ks,Z:Js},ul={X:0,Y:1,Z:2},dl={xyz:"XYZ",xzy:"XZY",yxz:"YXZ",yzx:"YZX",zxy:"ZXY",zyx:"ZYX"},fl=function(t,e,i){var n,r;e&&(n=e[0],r=e[1],e=e[2],"xzy"===i?(Ks(t,r),Js(t,e),Zs(t,n)):"xyz"===i?(Js(t,e),Ks(t,r),Zs(t,n)):"yxz"===i?(Js(t,e),Zs(t,n),Ks(t,r)):"yzx"===i?(Zs(t,n),Js(t,e),Ks(t,r)):"zxy"===i?(Ks(t,r),Zs(t,n),Js(t,e)):"zyx"===i?(Zs(t,n),Ks(t,r),Js(t,e)):(Ks(t,r),Js(t,e),Zs(t,n)))},Vs("Node",jh,{ms_ac:["rotationMode","anchorElevation"],ms_edge:!0,_adjustChildrenToTop:!0,_icon:"node_icon",_image:"node_image",_rotationMode:$f="xzy",_64O:0,_rotationX:0,_53O:0,_host:U,_position:{x:0,y:0},_anchor:{x:.5,y:.5},_anchorElevation:.5,_scale:{x:1,y:1},_scaleTall:1,_54O:0,getUIClass:function(){return iu},_22Q:function(){return tp},getX:function(){return this.p().x},setX:function(t){this.p(t,this.p().y)},getY:function(){return this.p().y},setY:function(t){this.p(this.p().x,t)},getAnchorX:function(){return this.getAnchor().x},setAnchorX:function(t){this.setAnchor(t,this.getAnchor().y)},getAnchorY:function(){return this.getAnchor().y},setAnchorY:function(t){this.setAnchor(this.getAnchor().x,t)},getScaleX:function(){return this.getScale().x},setScaleX:function(t){this.setScale(t,this.getScale().y)},getScaleY:function(){return this.getScale().y},setScaleY:function(t){this.setScale(this.getScale().x,t)},p:function(){return 0===arguments.length?this.getPosition():(this.setPosition.apply(this,arguments),this)},p3:function(){return 0===arguments.length?this.getPosition3d():(this.setPosition3d.apply(this,arguments),this)},s3:function(){return 0===arguments.length?this.getSize3d():(this.setSize3d.apply(this,arguments),this)},r3:function(){return 0===arguments.length?this.getRotation3d():(this.setRotation3d.apply(this,arguments),this)},setQuaternion:function(t){t=(new pa).setFromQuaternion(t,pa.ReverseOrder(this.getRotationMode()));return this.r3(t.x,t.y,t.z)},getQuaternion:function(){return(new aa).setFromEuler(this.getEuler())},getEuler:function(){var t=this.r3();return(new pa).set(t[0],t[1],t[2],pa.ReverseOrder(this.getRotationMode()))},setEuler:function(t){return t=t.clone().reorder(pa.ReverseOrder(this.getRotationMode())),this.r3(t.x,t.y,t.z)},t3:function(){return this.translate3d.apply(this,arguments),this},translate3dBy:function(t,e){Xs(t,th(U,U,this.r3(),this.getRotationMode())),this.translate3d(t[0]*e,t[1]*e,t[2]*e)},translateFront:function(t){this.translate3dBy([0,0,1],t)},translateBack:function(t){this.translate3dBy([0,0,-1],t)},translateLeft:function(t){this.translate3dBy([-1,0,0],t)},translateRight:function(t){this.translate3dBy([1,0,0],t)},translateTop:function(t){this.translate3dBy([0,1,0],t)},translateBottom:function(t){this.translate3dBy([0,-1,0],t)},getPosition3d:function(){return[this._position.x,this._54O,this._position.y]},setPosition3d:function(t,e,i){1===arguments.length&&(e=t[1],i=t[2],t=t[0]),this.p(t,i),this.setElevation(e)},translate3d:function(t,e,i){1===arguments.length&&(e=t[1],i=t[2],t=t[0]),this.translate(t,i),this.setElevation(this._54O+e)},getSize3d:function(){return[this.getWidth(),this.getTall(),this.getHeight()]},setSize3d:function(t,e,i){1===arguments.length&&(e=t[1],i=t[2],t=t[0]),this.setSize(t,i),this.setTall(e)},getRotation3d:function(){return[this._rotationX,-this._64O,this._53O]},setRotation3d:function(t,e,i){1===arguments.length&&(e=t[1],i=t[2],t=t[0]),this.setRotationX(t),this.setRotation(-e),this.setRotationZ(i)},setRotationY:function(t){this.setRotation(-t)},getRotationY:function(){return-this._64O},lookAtDirection:function(t,e){e=e||ot;var i=this,n=ys(t);e===ot?(i.r3([-b(t[1]/n),-T(t[2],t[0])+I,0]),i.setRotationMode("xzy")):e===ht?(i.r3(0,-T(t[2],t[0]),b(t[1]/n)),i.setRotationMode("zyx")):e===st?(i.r3(0,-T(t[2],t[0])+P,-b(t[1]/n)),i.setRotationMode("zyx")):e===ct?(i.r3([-b(t[1]/n)+I,-T(t[2],t[0])+I,0]),i.setRotationMode("xzy")):e===lt&&(i.r3([-b(t[1]/n)-I,-T(t[2],t[0])+I,0]),i.setRotationMode("xzy")),e===at&&(i.r3([-b(t[1]/n)+P,-T(t[2],t[0])+I,P]),i.setRotationMode("zxy"))},lookAt:function(t,e){return this.lookAtDirection(Ns(t,this.p3()),e)},lookAtX:(Lv=new ha,Fv=new ha,kv=new ha,jv=new fa,Nv=new fa,Uv=new pa,function(t,e){var i=$s(this);jv.fromArray(i),kv.copy(this.p3()),Lv.copy(t).sub(kv),Lv.lengthSq()<1e-6||(Lv.normalize(),e===ot?Fv.set(0,0,1):e===at?Fv.set(0,0,-1):e===st?Fv.set(-1,0,0):e===ht?Fv.set(1,0,0):e===ct?Fv.set(0,1,0):e===lt&&Fv.set(0,-1,0),Fv.applyMatrix4(jv).sub(kv).normalize(),(i=Math.acos(Lv.dot(Fv)))&&((t=Lv.clone().cross(Fv)).lengthSq()<1e-6&&(e===ct||e===lt?t.set(0,0,1):t.set(0,1,0)).applyMatrix4(jv).sub(kv),t.normalize(),Uv.set(this.r3(),this.getRotationMode(),!0),jv.makeRotationFromEuler(Uv),Nv.makeRotationAxis(t,-i),Uv.setFromRotationMatrix(Nv.multiply(jv)),this.r3([Uv.x,Uv.y,Uv.z])))}),getHost:function(){return this._host},setHost:function(t){var e,i=this;i!==t&&i._host!==t&&((e=i._host)&&e._removeAttach(i),i._host=t,i._host&&i._host._addAttach(i),i.fp("host",e,t),i.onHostChanged(e,t))},getAttaches:function(){return this._69O},_addAttach:function(t){this._69O||(this._69O=new Lh),this._69O.add(t),this.fp("attaches",U,t)},_removeAttach:function(t){this._69O.remove(t),this._69O.isEmpty()&&delete this._69O,this.fp("attaches",t,U)},getImage:function(){return this._pendingCheckImageJSON&&G.getImage(this._image)&&(this._pendingCheckImageJSON=!1,this.getParent()instanceof wl&&this.getParent().checkPendingUpdateInfo()),this._image},setImage:function(t){var e=this._image,i=this.getWidth(),n=this.getHeight();this._image=t,this.fp("image",e,t)&&(null!=t&&(yn(t)||pn(t)&&/\.json$/i.test(t))&&(this._pendingCheckImageJSON=!0),this.fp(Rt,i,this.getWidth()),this.fp(At,n,this.getHeight()))},getElevation:function(){return this._54O},setElevation:function(t){var e;this._50O||(this._50O=1,e=this._54O,this._54O=t,this.fp(Re,e,t),delete this._50O)},getRotation:function(){return this._64O},setRotation:function(t){var e;this._49O||(this._49O=1,e=this._64O,this._64O=t,this.fp($t,e,t),delete this._49O)},getRotationX:function(){return this._rotationX},setRotationX:function(t){var e;this._51O||(this._51O=1,e=this._rotationX,this._rotationX=t,this.fp("rotationX",e,t),delete this._51O)},getRotationZ:function(){return this._53O},setRotationZ:function(t){var e;this._52O||(this._52O=1,e=this._53O,this._53O=t,this.fp("rotationZ",e,t),delete this._52O)},getPosition:function(){return this._position},setPosition:function(t,e){this._50I||(this._50I=1,(e=2===arguments.length?{x:t,y:e}:t).x===this._position.x&&e.y===this._position.y||(t=this._position,this._position=e,this.fp(Me,t,e)),delete this._50I)},translate:function(t,e){var i=this._position;this.p(i.x+t,i.y+e)},getWidth:function(){if(0<=this._width)return this._width;var t=this.getStyle("shape3d");if(t){var e,i=xu(t);if(i&&i.rawS3)return i.rawS3[0];if("billboard"===t||"plane"===t)return(e=Qa(this.getStyle("shape3d.image")))?mh(e,this):20}return(e=Qa(this._image))?mh(e,this):20},setWidth:function(t){var e=this._width;this._width=t,this.fp(Rt,e,t)},getHeight:function(){if(0<=this._height)return this._height;var t=this.getStyle("shape3d");if(t){var e,i=xu(t);if(i&&i.rawS3)return i.rawS3[2];if("plane"===t)return(e=Qa(this.getStyle("shape3d.image")))?bh(e,this):20;if("billboard"===t)return 2}return(e=Qa(this._image))?bh(e,this):20},setHeight:function(t){var e=this._height;this._height=t,this.fp(At,e,t)},getTall:function(){if(0<=this._tall)return this._tall;var t=this.getStyle("shape3d");if(t){var e=xu(t);if(e&&e.rawS3)return e.rawS3[1];if("billboard"===t){e=Qa(this.getStyle("shape3d.image"));return e?bh(e,this):20}if("plane"===t)return 2}return 20},setTall:function(t){var e=this._tall;this._tall=t,this.fp("tall",e,t)},setSize:function(t,e){2===arguments.length?(this.setWidth(t),this.setHeight(e)):(this.setWidth(t.width),this.setHeight(t.height))},getSize:function(){return{width:this.getWidth(),height:this.getHeight()}},setRect:function(t,e,i,n,r){var o=this.getAnchor(),a=this.getScale();arguments.length<=2&&(r=e,e=t.y,i=t.width,n=t.height,t=t.x);var s=r&&a.x<0?1-o.x:o.x,o=r&&a.y<0?1-o.y:o.y;this.p(t+i*s,e+n*o),r&&(i/=Math.abs(a.x),n/=Math.abs(a.y)),this.setWidth(i),this.setHeight(n)},getMatrix:function(){var t=this._64O,e=this._position,i=this.getScale();return new oa(t,e.x,e.y,i.x,i.y)},getAnchorRect:function(){var t=this.getWidth(),e=this.getHeight(),i=this.getAnchor();return{x:-t*i.x,y:-e*i.y,width:t,height:e}},toLocal:function(t){return this.getMatrix().tfi(t)},toGlobal:function(t){return this.getMatrix().tf(t)},getAttachPosition:(Vv=new oa,function(t,e,i,n){i=i||0,n=n||0;var r=this.getAnchor(),o=this._64O,a=this._position,s=this.getScale();return Vv.setFromTransform(o,a.x,a.y).tf({x:i+s.x*this.getWidth()*(t-r.x),y:n+s.y*this.getHeight()*(e-r.y)})}),isInRect:function(t){t=this.toLocal(t);var e=this.getWidth(),i=this.getHeight();return t.x+=e*this.getAnchorX(),t.y+=i*this.getAnchorY(),!(t.x<0||t.y<0||t.x>e||t.y>i)},getRect:function(){var t=this.getWidth(),e=this.getHeight(),i=this.getAnchor(),t={x:-t*i.x,y:-e*i.y,width:t,height:e},e=this.getMatrix();return ms([e.tf(t.x,t.y),e.tf(t.x+t.width,t.y),e.tf(t.x+t.width,t.y+t.height),e.tf(t.x,t.y+t.height)])},getAnchorElevation:function(){return this._anchorElevation},getAnchor3d:function(){var t=this.getAnchor(),e=this._anchorElevation;return{x:t.x,y:e,z:t.y}},setAnchorElevation:function(t){var e=this._anchorElevation;return e!==t&&(this._anchorElevation=t,this.fp("anchorElevation",e,t),!0)},setAnchor3d:function(t,e,i,n){var r;"number"==typeof t?r={x:t,y:e,z:i}:(r=t.length?{x:t[0],y:t[1],z:t[2]}:t,n=e);i=this.getDataModel();i&&i.beginTransaction();t=this.getAnchor3d(),e=this.setAnchor(r.x,r.z);return this.setAnchorElevation(r.y)&&(e=!0),e&&n&&!Mi&&(this.getAnchor3d(),n=$s(this),n=Xs([r.x-t.x,r.y-t.y,r.z-t.z],n),this.p3(n)),i&&i.endTransaction(),e},getAnchor:function(){if(this.hasOwnProperty("_anchor"))return this._anchor;var t=Qa(this._image);return t&&t.anchorX!==H?{x:t.anchorX,y:t.anchorY}:this._anchor},setAnchor:function(t,e,i){"number"==typeof t?a={x:t,y:e}:(a=t.length?{x:t[0],y:t[1]}:t,i=e);var n=this.getAnchor();if(n.x===a.x&&n.y===a.y)return!1;var r,o,a,s=this.getDataModel();return s&&s.beginTransaction(),this._anchor=a,this.fp("anchor",n,a),i&&!Mi&&(r=this.getPosition(),o=this.getSize(),t=this.getRotation(),e=this.getScale(),i=-o.width*(n.x-a.x)*e.x,a=-o.height*(n.y-a.y)*e.y,e=Z(t),t=Q(t),this.setPosition(r.x+t*i-e*a,r.y+e*i+t*a)),s&&s.endTransaction(),!0},getScale:function(){return this._scale},setScale:function(t,e){e=2===arguments.length?{x:t,y:e}:t,t=this.getScale();t.x===e.x&&t.y===e.y||(this._scale=e,this.fp("scale",t,e))},getScaleTall:function(){return this._scaleTall},getScale3d:function(){var t=this._scaleTall,e=this.getScale();return[e.x,t,e.y]},getFinalScale3d:function(){var t=this.s3(),e=this._dynamicScale3d,i=this.getScale3d();return t&&(i[0]*=t[0],i[1]*=t[1],i[2]*=t[2]),e&&(i[0]*=e[0],i[1]*=e[1],i[2]*=e[2]),i},getFinalRotation3d:function(){return this._dynamicRotation||this.r3()},setScaleTall:function(t){var e=this._scaleTall;e!==t&&(this._scaleTall=t,this.fp("scaleTall",e,t))},setScale3d:function(t,e,i){t="number"==typeof t?{x:t,y:e,z:i}:t.length?{x:t[0],y:t[1],z:t[2]}:t;this.setScaleTall(t.y),this.setScale(t.x,t.z)},getCorners:function(t,e){t==U&&(t=0),e==U&&(e=t);var i=this.getAnchor(),n=this.getWidth(),r=this.getHeight(),o=-n*i.x-t,i=-r*i.y-e,t=n+2*t,r=r+2*e,e=this.getMatrix();return[e.tf(o,i),e.tf(o,i+r),e.tf(o+t,i+r),e.tf(o+t,i)]},getEditControlPoints:function(t,e,i){e==U&&(e=0),i==U&&(i=e);var n=this.getAnchor(),r=this.getWidth(),o=this.getHeight(),a=-r*n.x-e,n=-o*n.y-i,e=r+2*e,i=o+2*i;if(t)return[{x:a,y:n},{x:a,y:0},{x:a,y:n+i},{x:0,y:n+i},{x:a+e,y:n+i},{x:a+e,y:0},{x:a+e,y:n},{x:0,y:n}];t=this.getMatrix();return[t.tf(a,n),t.tf(a,0),t.tf(a,n+i),t.tf(0,n+i),t.tf(a+e,n+i),t.tf(a+e,0),t.tf(a+e,n),t.tf(0,n)]},rotateAt:function(t,e,i){var n=this._position,r=this._64O,o=new oa(r,n.x,n.y).tf(t,e),e=W(t*t+e*e),n=T(n.y-o.y,n.x-o.x)+i;this.setRotation(r+i),this.p(o.x+e*Q(n),o.y+e*Z(n))},onParentChanged:function(){cl.superClass.onParentChanged.apply(this,arguments),this._8I()},onPropertyChanged:(zv={},"width|height|position|anchor|rotation|scale|s:layout.h|s:layout.v".split("|").forEach(function(t){zv[t]=!0}),function(e){cl.superClass.onPropertyChanged.call(this,e),zv[e.property]&&!this._layoutUpdating&&this.updateLayoutParameters(null,e.property),this._69O&&this._69O.each(function(t){t.handleHostPropertyChange(e)}),this._49I&&this._49I.each(function(t){t.fp("agentChange",!0,!1)}),"a:layout"===e.property.substring(0,8)&&this.updateAttach()}),onHostChanged:function(){this.updateAttach(),this.updateLayoutParameters()},handleHostPropertyChange:function(t){this.updateAttach(t)},onStyleChanged:function(t){cl.superClass.onStyleChanged.apply(this,arguments),$h[t]&&this.updateAttach()},updateAttach:function(t){return Mi?void this.updateLayoutParameters():void(this._51I||(this._51I=1,this._71O(t),delete this._51I))},_71O:function(t){var e,i,n,r,o,a,s,h,c=this,l=c._host,u=t?t.property:U,d=t?t.oldValue:U,f=t?t.newValue:U;l instanceof cl&&((e=Qa(l.getImage()))&&e.layoutAttach&&(r=e.layoutAttach)),(t&&!Kh[u]&&"a:layout"!==u.substring(0,8)||!r||r(l,this))&&(l instanceof Gl.Grid?u===Re?c.setElevation(c._54O+f-d):t&&!Jh[u]||(s=c.s("attach.row.index"),h=c.s("attach.column.index"),(n=l.getCellRect(s,h))&&(i=c.s("attach.row.span"),o=c.s("attach.column.span"),1===i&&1===o||(n=bs(n,l.getCellRect(s+i-1,h+o-1))),ic(n,c,"attach.padding",1),c.setRect(n))):l instanceof yl&&0<=(a=c.s("attach.index"))&&(!t||tc[u])?(r=c.s("attach.thickness"),s=l.getScale(),i=Math.max(s.x,s.y),0<r&&c.setHeight(l.getThickness()*r*i),h=c.s("attach.offset"),a<(n=(o=l.getPoints()).size())&&(s=l.getPointsMatrix2d(),r=o.get(a),o=n===a+1?o.get(0):o.get(a+1),r=s.apply(r),a=[(o=s.apply(o)).x-r.x,o.y-r.y],(s=ys(a))&&(c.s("attach.offset.relative")&&(h*=s),c.s("attach.offset.opposite")&&(h=s-h),s={x:r.x+a[0]/s*h,y:r.y+a[1]/s*h},(h=c.s("attach.gap"))&&(c.s("attach.gap.relative")&&(h*=l.getThickness()*i),s=Fu(U,s,o,h)),c.p(s),c.setRotation(T(a[1],a[0]))))):t&&(u===Me?c.translate(f.x-d.x,f.y-d.y):u===Re?c.setElevation(c._54O+f-d):Zh[u]?c._11Q(l,u,f-d):"anchor"!==u&&"width"!==u&&"height"!==u&&"scale"!==u||c.layout(l)))},_11Q:(Pv=new Gl.Math.Euler,Dv=Gl.Math.Euler.ReverseOrder,Ov=new Gl.Math.Vector2,Bv=new Gl.Math.Vector2,function(t,e,i){var n=t.p3(),r=t.r3(),o=this.p3(),a=this.r3();if(e===$t&&(e="rotationY",i=-i),(e===$t||"rotationY"===e)&&0===a[0]&&0===a[2]&&0===r[0]&&0===r[2]&&0===o[1]&&0===n[1])return this.setRotation(-a[1]-i),Ov.set(o[0],o[2]).rotateAround(Bv.set(n[0],n[2]),-i),void this.p(Ov.x,Ov.y);var s=dl[t.getRotationMode()],h=s[0],c=s[1],l=s[2],u=ll[h],a=ll[c],t=ll[l],s=Hs();e===$t+h?(t(s,r[ul[l]]),a(s,r[ul[c]]),u(s,i),a(s,-r[ul[c]]),t(s,-r[ul[l]])):e===$t+c?(t(s,r[ul[l]]),a(s,i),t(s,-r[ul[l]])):e===$t+l&&t(s,i);o=Ns(o,n);Xs(o,s),this.p3(n[0]+o[0],n[1]+o[1],n[2]+o[2]);o=this.getRotationMode();fl(s,this.r3(),o),Pv.setFromRotationMatrix(s,Dv(o)),this.r3([Pv.x,Pv.y,Pv.z])}),isHostOn:function(t){if(this._host&&t&&t._69O)for(var e={},i=this._host;i&&i!==this&&!e[i._id];){if(i===t)return!0;i=(e[i._id]=i)._host}return!1},isLoopedHostOn:function(t){return this.isHostOn(t)&&t.isHostOn(this)},getScaledSize:function(){var t=this.getSize(),e=this.getScale();return t.width*=Math.abs(e.x),t.height*=Math.abs(e.y),t},layout:function(t){if(t=t||this.getHost()){var e=this,i=e.s("layout.h")||"center",n=e.s("layout.v")||"center";if("center"!==i||"center"!==n){var r=new Gl.Math.Vector2,o=t.getPosition(),a=t.getAnchor(),s=t.getScaledSize();e.getPosition();var h,c,l,u,d,f,g=1,p=1;switch(e._layoutUpdating=!0,i){case"left":r.setX(e._layoutHValue-a.x*s.width);break;case"right":r.setX((1-a.x)*s.width-e._layoutHValue);break;case"leftright":h=s.width-e._layoutHValue[2],l=e.getRotation()-t.getRotation(),u=Math.abs(Math.sin(l)),g+=(d=Math.abs(Math.cos(l)))*h/e._layoutHValue[3],p+=u*h/e._layoutHValue[4],r.setX(e._layoutHValue[1]+(e._layoutHValue[5]-a.x)*s.width);break;case"center":r.setX((.5-a.x)*s.width-e._layoutHValue);break;case"scale":l=e.getRotation()-t.getRotation(),u=Math.abs(Math.sin(l)),d=Math.abs(Math.cos(l)),r.setX((.5-a.x)*s.width-e._layoutHValue[1]*s.width/e._layoutHValue[0]),g+=d*(c=s.width/e._layoutHValue[2]-1),p+=u*c}switch(n){case"top":r.setY(e._layoutVValue-a.y*s.height);break;case"bottom":r.setY((1-a.y)*s.height-e._layoutVValue);break;case"topbottom":l||(l=e.getRotation()-t.getRotation(),u=Math.abs(Math.sin(l)),d=Math.abs(Math.cos(l))),g+=u*(h=s.height-e._layoutVValue[2])/e._layoutVValue[3],p+=d*h/e._layoutVValue[4],r.setY(e._layoutVValue[1]+(e._layoutVValue[5]-a.y)*s.height);break;case"center":r.setY((.5-a.y)*s.height-e._layoutVValue);break;case"scale":l||(l=e.getRotation()-t.getRotation(),u=Math.abs(Math.sin(l)),d=Math.abs(Math.cos(l))),r.setY((.5-a.y)*s.height-e._layoutVValue[1]*s.height/e._layoutVValue[0]),g+=u*(c=s.height/e._layoutVValue[2]-1),p+=d*c}"leftright"!==i&&"scale"!==i&&"topbottom"!==n&&"scale"!==n||(f=this.getScale(),n=Math.abs(f.x),f=Math.abs(f.y),"leftright"===i||"scale"===i?e.setSize(e._layoutHValue[3]*g/n,e._layoutHValue[4]*p/f):e.setSize(e._layoutVValue[3]*g/n,e._layoutVValue[4]*p/f)),r.rotateAround(null,t.getRotation()),this.setPosition(r.x+o.x,r.y+o.y),e._layoutUpdating=H}}},updateLayoutParameters:function(t,e){if(t=t||this.getHost()){var i=this,n=i.s("layout.h"),r=i.s("layout.v");if(n||r){var o,a,s,h,c,l,u=new Gl.Math.Vector2,d=t.getPosition(),f=t.getAnchor(),g=t.getScaledSize(),p=i.getPosition(),_=i.getScaledSize();switch(u.set(p.x-d.x,p.y-d.y),u.rotateAround(null,-t.getRotation()),n){case"left":i._layoutHValue=u.x+f.x*g.width;break;case"right":i._layoutHValue=-u.x+(1-f.x)*g.width;break;case"center":i._layoutHValue=-u.x+(.5-f.x)*g.width;break;case"leftright":case"scale":o="scale"===n?-u.x+(.5-f.x)*g.width:(a=i.getAnchor(),s=i.getRotation()-t.getRotation(),h=Math.cos(s),c=Math.sin(s),l=-Math.min(-a.x*h+a.y*c,-a.x*h-(1-a.y)*c,(1-a.x)*h+a.y*c,(1-a.x)*h-(1-a.y)*c),u.x-(l-f.x)*g.width),"position"===e&&"object"==typeof i._layoutHValue?(i._layoutHValue[0]=g.width,i._layoutHValue[1]=o):i._layoutHValue=[g.width,o,g.width,_.width,_.height,l]}switch(r){case"top":i._layoutVValue=u.y+f.y*g.height;break;case"bottom":i._layoutVValue=-u.y+(1-f.y)*g.height;break;case"center":i._layoutVValue=-u.y+(.5-f.y)*g.height;break;case"topbottom":case"scale":o="scale"===r?-u.y+(.5-f.y)*g.height:(s||(a=i.getAnchor(),s=i.getRotation()-t.getRotation(),h=Math.cos(s),c=Math.sin(s)),l=-Math.min(-a.x*c-a.y*h,-a.x*c+(1-a.y)*h,(1-a.x)*c-a.y*h,(1-a.x)*c+(1-a.y)*h),u.y-(l-f.y)*g.height),"position"===e&&"object"==typeof i._layoutVValue?(i._layoutVValue[0]=g.height,i._layoutVValue[1]=o):i._layoutVValue=[g.height,o,g.height,_.width,_.height,l]}}}},getSerializableProperties:function(){var t=cl.superClass.getSerializableProperties.call(this);return An(t,{image:1,host:1,rotation:1,rotationX:1,rotationZ:1,rotationMode:1,position:1,anchor:1,anchorElevation:1,scale:1,scaleTall:1,_width:1,_height:1,_tall:1,elevation:1}),t}}),gl=Gl.Edge=function(t,e){Bn(gl,this),this.setSource(t),this.setTarget(e)},Vs("Edge",jh,{ms_edge:!0,_icon:"edge_icon",getUIClass:function(){return tu},_22Q:function(){return ip},getSource:function(){return this._source},getTarget:function(){return this._target},getSourceAgent:function(){return this._40I},getTargetAgent:function(){return this._41I},canSetSourceTarget:function(t){if(t===this)return!1;if(wn(t))return!0;for(var e,i,n,r,o=[this],a=-1,s=0;a<s;)if(e=o[++a]._44I)for(n=0,r=(e=e.getArray()).length;n<r;n++)if(i=e[n],En(i)&&!(0<=o.indexOf(i))){if(i===t)return!1;o.push(i),s++}return!0},setSource:function(t){var e;this._source!==t&&this.canSetSourceTarget(t)&&(e=this._source,this._source=t,e&&e._16I(this),t&&t._2I(this),this._7I(),this.fp("source",e,t))},setTarget:function(t){var e;this._target!==t&&this.canSetSourceTarget(t)&&(e=this._target,this._target=t,e&&e._18I(this),t&&t._4I(this),this._7I(),this.fp("target",e,t))},isLooped:function(){return this._source===this._target&&wn(this._source)&&wn(this._target)},onPropertyChanged:function(){this._49I&&this._49I.each(function(t){t.fp("agentChange",!0,!1)})},_7I:function(){var t,e=this,i=function(t){if(t.isLooped())return t._source;var e=rc(t._source),i=rc(t._target);return e===i?t._source:oc(e,i)}(e);e._40I!==i&&((t=this._40I)&&t._15I(e),(e._40I=i)&&i._1I(e),e.fp("sourceAgent",t,i),hc(t,e._41I),hc(i,e._41I));i=function(t){if(t.isLooped())return t._target;var e=rc(t._source),i=rc(t._target);return e===i?t._target:oc(i,e)}(e);e._41I!==i&&((t=e._41I)&&t._17I(e),(e._41I=i)&&i._3I(e),e.fp("targetAgent",t,i),hc(t,e._40I),hc(i,e._40I))},_22I:function(t){this._52I=t,this.fp("edgeGroup",!0,!1)},getEdgeGroup:function(){return this._52I},isEdgeGroupHidden:function(){return this._52I&&this._52I.get(0)!==this&&!this.getStyle(Zt)},getEdgeGroupSize:function(){return this._52I?this._52I.size():1},getEdgeGroupIndex:function(){return this._52I?this._52I.indexOf(this):0},isEdgeGroupAgent:function(){var t=this._52I;return t&&!this.getStyle(Zt)&&1<t.size()&&this===t.get(0)},toggle:function(){this.beginTransaction();var t=this._52I,e=!this.s(Zt);t&&1<t.size()&&(t.each(function(t){t.s(Zt,e)}),t.getSiblings().each(function(e){e!==t&&e.each(function(t){t.fp("edgeGroup",U,e)})})),this.endTransaction()},setStyle:function(t,e){var i;t!==Kt&&"edge.segments"!==t||(e=bn(i=e)?new Lh(i):i),gl.superClass.setStyle.call(this,t,e)},onStyleChanged:function(t){gl.superClass.onStyleChanged.apply(this,arguments),Yh[t]&&hc(this._41I,this._40I)},getSerializableProperties:function(){var t=gl.superClass.getSerializableProperties.call(this);return An(t,{source:1,target:1}),t}}),pl=Gl.Group=function(){Bn(pl,this)},Vs("Group",cl,{_image:"group_image",_icon:"group_icon",_57O:!1,getUIClass:function(){return Ml},onChildAdded:function(){pl.superClass.onChildAdded.apply(this,arguments),this._81I()},onChildRemoved:function(){pl.superClass.onChildRemoved.apply(this,arguments),this._81I()},_81I:function(){var t;this._54I||Mi||(t=this.getChildrenRect())&&(this._53I=1,this.p(Fo(this.s("group.position"),t,this.getSize())),delete this._53I)},getChildrenRect:function(){var e,i=this;return i.eachChild(function(t){wn(t)&&(e=bs(e,i.getChildRect(t)))}),e},getChildRect:function(e){var i;return wn(e)&&e.s(Pt)&&(Tn(e)&&e.isExpanded()&&e.eachChild(function(t){i=bs(i,e.getChildRect(t))}),!i&&e.getRect&&(i=e.getRect())),i},setPosition:function(t,e){this._54I||(t=2===arguments.length?{x:t,y:e}:t,Mi||this._53I||(this._54I=1,Bo(this._children,t.x-this._position.x,t.y-this._position.y),delete this._54I),pl.superClass.setPosition.call(this,t))},toggle:function(){this.setExpanded(!this.isExpanded())},isExpanded:function(){return this._57O},setExpanded:function(t){var e;this._57O!==t&&(e=this._57O,this._57O=t,this.fp("expanded",e,this._57O),this._fireInvalidateDeep(),this._8I())},_fireInvalidateDeep:function(){this.eachChild(function(t){Tn(t)?t._fireInvalidateDeep():t.iv()})},_8I:function(){pl.superClass._8I.call(this),this.eachChild(function(t){wn(t)&&t._8I()})},onStyleChanged:function(t){pl.superClass.onStyleChanged.apply(this,arguments),"group.position"===t&&this._81I()},getSerializableProperties:function(){var t=pl.superClass.getSerializableProperties.call(this);return t.expanded=1,t}}),_l=Gl.Block=function(){Bn(_l,this),this.s({"shadow.cast":!1,"shadow.receive":!1})},Vs("Block",cl,{_icon:"block_icon",_clickThroughEnabled:!1,_syncSize:!0,ms_ac:["clickThroughEnabled","syncSize"],getUIClass:function(){return Rl},_22Q:function(){return ep},onChildAdded:function(){_l.superClass.onChildAdded.apply(this,arguments),this.updateFromChildren()},onChildRemoved:function(){_l.superClass.onChildRemoved.apply(this,arguments),this.updateFromChildren()},_getBoundingBox:(Av=new fa,function(t,e){if(t instanceof cl&&(t=[t]),!t||0===t.length)return U;Rm.call(this,t,e=[]);var i=[1/0,1/0,1/0],n=[-1/0,-1/0,-1/0];return e.forEach(function(t){i[0]=Math.min(t.x,i[0]),i[1]=Math.min(t.y,i[1]),i[2]=Math.min(t.z,i[2]),n[0]=Math.max(t.x,n[0]),n[1]=Math.max(t.y,n[1]),n[2]=Math.max(t.z,n[2])}),{min:i,max:n}}),updateFromChildren:function(){var t,e,i,n,r,o,a,s;Mi||this._updatingToChildren||!this._syncSize||0===this.size()||this._freezeSyncFromChildren||(o=this._getBoundingBox(this.toChildren(wn)))&&(this._updatingFromChildren=1,t=(new ha).fromArray(this.getScale3d()),e=(new ha).fromArray(o.min),n=(new ha).fromArray(o.max),i=G.blockMinSize,a=new ha,0===(s=n.clone().sub(e)).x&&a.setX(.5),0===s.y&&a.setY(.5),0===s.z&&a.setZ(.5),o=this._width==U||-1===this._width,n=new ha(this.getAnchor3d()),o||this._anchorChanged||!this.s("keepPosition")?(r=n.clone().multiply(s).add(e).applyEuler(this.getEuler()).add((new ha).fromArray(this.p3())),this.p3([r.x,r.y,r.z])):(o=t.clone().multiply((new ha).fromArray(this.s3())),0===(r=s.clone()).x&&r.setX(i),0===r.y&&r.setY(i),0===r.z&&r.setZ(i),a=(o=n.clone().multiply(o)).clone().multiplyScalar(-1).sub(e).divide(r).add(o.divide(r)).add(a),this.setAnchor3d(a.x,a.y,a.z)),s=new ha(1,1,1).divide(t).multiply(s),this.s3(Math.abs(s.x),Math.abs(s.y),Math.abs(s.z)),delete this._updatingFromChildren)},setPosition:function(t,e){this._updatingToChildren||(t=2===arguments.length?{x:t,y:e}:t,Mi||this._updatingFromChildren||(this._updatingToChildren=1,Bo(this._children,t.x-this._position.x,t.y-this._position.y),delete this._updatingToChildren),_l.superClass.setPosition.call(this,t))},setSize3d:function(){var t=this.getDataModel();t&&t.beginTransaction(),_l.superClass.setSize3d.apply(this,arguments),t&&t.endTransaction()},setTall:function(t){var e,i;this._updatingToChildren||((e=this.getDataModel())&&e.beginTransaction(),(t=N(t,G.blockMinSize))!==(i=this.getTall())&&_l.superClass.setTall.call(this,t),Mi||this._updatingFromChildren||(this._updatingToChildren=1,i=t/i,this._adjustChildTallOrScale(i,"size"),delete this._updatingToChildren,this.updateFromChildren()),e&&e.endTransaction())},setWidth:function(t){return this.setSize(t,this.getHeight())},setHeight:function(t){return this.setSize(this.getWidth(),t)},setSize:function(t,e){var i=G.blockMinSize;t=N(t,i),e=N(e,i);var n,r,o=this;o._updatingToChildren||(2!==arguments.length&&(e=t.height,t=t.width),(n=o.getDataModel())&&n.beginTransaction(),r=o.getWidth(),i=o.getHeight(),t!==r&&_l.superClass.setWidth.call(o,t),e!==i&&_l.superClass.setHeight.call(o,e),Mi||o._updatingFromChildren||(o._updatingToChildren=1,r=t/r,i=e/i,o._adjustChildScaleOrSize(r,i,"size"),delete o._updatingToChildren,o.updateFromChildren()),n&&n.endTransaction())},_adjustChildScaleOrSize:function(c,l,u){var d,f;this._syncSize&&(d=this.getPosition(),f=this.getRotation(),this.getScale(),this.eachChild(function(t){var e,i,n,r,o,a,s,h;wn(t)&&(e=t.getPosition(),r=t.getRotation(),a=t.getWidth(),s=t.getHeight(),h=(i=t.getScale()).x*a,n=i.y*s,(n=new oa(r,e.x,e.y,h,n)).translate(-d.x,-d.y),n.rotate(-f),r=T(n.b*Math.sign(h),n.a*Math.sign(h)),n.scale(c,l),h=Q(r),h=Math.abs(h)<.001?(r=Z(r),o=n.b/r,-n.c/r):(o=n.a/h,n.d/h),"scale"===u?t.setScale(o/a,h/s):"size"===u&&(a=o/i.x,s=h/i.y,t.setScale(kn(o)*Math.abs(i.x),kn(h)*Math.abs(i.y)),t instanceof Gl.Shape?(t.setWidthForce(Math.max(Math.abs(a),1e-5)),t.setHeightForce(Math.max(Math.abs(s),1e-5))):t.setSize(Math.max(.01,Math.abs(a)),Math.max(.01,Math.abs(s)))),n.rotate(f),n.translate(d.x,d.y),t.setPosition(n.tx,n.ty))}))},_calcChangeFactor:function(t,e,i,n){var r=X(t),t=X(i),i=t<r?r/t:t/r;return r=X(e),t=X(n),N(i,t<r?r/t:t/r)},setElevation:function(t){this._updatingToChildren||0!=(t=t-this.getElevation())&&(Mi||this._updatingFromChildren||(this._updatingToChildren=1,Bo(this._children,0,t,0),delete this._updatingToChildren),_l.superClass.setElevation.apply(this,arguments))},setScaleTall:function(t){var e;this._updatingToChildren||(e=this.getScaleTall(),X(t)<.01&&(t=.01*(kn(t)||kn(e))),_l.superClass.setScaleTall.call(this,t),Mi||this._updatingFromChildren||(this._updatingToChildren=1,e=t/e,this._adjustChildTallOrScale(e,"size"),delete this._updatingToChildren,this.updateFromChildren()))},_adjustChildTallOrScale:function(i,n){var r;this._syncSize&&(r=this.getElevation(),this.eachChild(function(t){var e;wn(t)&&("size"===n?(e=t.getTall(),i<0&&t.setScaleTall(-1*t.getScaleTall()),t.setTall(Math.max(.01,Math.abs(e*i))),t.setElevation(r+(t.getElevation()-r)*i)):(e=t.getScaleTall(),t.setScaleTall(e*i)))}))},setAnchor3d:function(){if(!this._updatingToChildren){var t=this.getDataModel();t&&t.beginTransaction();var e=_l.superClass.setAnchor3d.apply(this,arguments);return e&&!Mi&&!this._updatingFromChildren&&this._syncSize&&(this._anchorChanged=1,this.updateFromChildren(),delete this._anchorChanged),t&&t.endTransaction(),e}},setAnchor:function(){var t=this;if(!t._updatingToChildren){var e=t.getAnchor(),i=_l.superClass.setAnchor.apply(t,arguments);if(Mi||t._updatingFromChildren||!t._syncSize)return i;t._updatingToChildren=1;var n=t.getAnchor();t.getPosition();var r=t.getSize(),o=t.getScale(),a=t.getRotation(),s=-r.width*o.x*(e.x-n.x),e=-r.height*o.y*(e.y-n.y),n=Z(a),a=Q(a),h=a*s-n*e,c=n*s+a*e;return t.eachChild(function(t){var e;wn(t)&&(e=t.getPosition(),t.setPosition(e.x-h,e.y-c))}),delete t._updatingToChildren,i}},setAnchorElevation:function(){var t=this;if(!t._updatingToChildren){var e=t.getAnchorElevation(),i=_l.superClass.setAnchorElevation.apply(t,arguments);if(Mi||t._updatingFromChildren||!t._syncSize)return i;t._updatingToChildren=1;var n=t.getAnchorElevation(),r=-t.getTall()*t.getScaleTall()*(e-n);return t.eachChild(function(t){var e;wn(t)&&(e=t.getElevation(),t.setElevation(e-r))}),delete t._updatingToChildren,i}},setRotation:function(t){this._updateChildrenRotation3d("rotation",t)},setRotationX:function(t){this._updateChildrenRotation3d("rotationX",t)},setRotationZ:function(t){this._updateChildrenRotation3d("rotationZ",t)},_updateChildrenRotation3d:function(e,t){var i,n,r=this;r._updatingToChildren||(i=r[fn(e)](),_l.superClass[gn(e)].call(r,t),Mi||r._updatingFromChildren||(r._updatingToChildren=1,n=t-i,r.eachChild(function(t){wn(t)&&t._11Q(r,e,n)}),delete r._updatingToChildren))},setScale:function(t,e){var i;this._updatingToChildren||(null==e&&(e=t.y,t=t.x),i=this.getScale(),X(t)<.01&&(t=.01*(kn(t)||kn(i.x))),X(e)<.01&&(e=.01*(kn(e)||kn(i.y))),_l.superClass.setScale.call(this,t,e),Mi||this._updatingFromChildren||(this._updatingToChildren=1,t=t/i.x,i=e/i.y,this._adjustChildScaleOrSize(t,i,"size"),delete this._updatingToChildren,this.updateFromChildren()))},getSerializableProperties:function(){var t=_l.superClass.getSerializableProperties.call(this);return t.clickThroughEnabled=1,t.syncSize=1,t}}),Iv=Gl.Grid=function(){Bn(Gl.Grid,this)},Vs("Grid",cl,{IRotatable:!1,_icon:"grid_icon",_image:U,getUIClass:function(){return Pl},setRotation:function(){},getCellRect:function(t,e){var i=this.s("grid.row.count"),n=this.s("grid.column.count");if(i<=0||n<=0||t<0||i<=t||e<0||n<=e)return U;var r,o,a,s=this.getRect(),h=this.s("grid.row.percents"),c=this.s("grid.column.percents");if(ic(s,this,"grid.border",-1),h&&h._as&&(h=h._as),c&&c._as&&(c=c._as),h&&h.length===i){for(r=a=0;r<t;r++)a+=s.height*h[r];s.y+=a,s.height=s.height*h[t]}else s.height=s.height/i,s.y+=s.height*t;if(c&&c.length===n){for(r=o=0;r<e;r++)o+=s.width*c[r];s.x+=o,s.width=s.width*c[e]}else s.width=s.width/n,s.x+=s.width*e;return Is(s,-this.s("grid.gap")),s}}),vl=Gl.Text=function(){Bn(vl,this),this.setSize(100,50),this.s("text","TEXT")},Vs("Text",cl,{_icon:"text_icon",_image:"__text__",getUIClass:function(){return Dl},setWidth:function(t){t=t||.001,vl.superClass.setWidth.call(this,t)},setHeight:function(t){t=t||.001,vl.superClass.setHeight.call(this,t)},toLabel:function(){return this._displayName||this._name||this.s("text")}}),Xa("__text__",{width:{value:100,isSafeFunc:!0,func:function(t){return t?t._width:100}},height:{value:50,isSafeFunc:!0,func:function(t){return t?t._height:50}},comps:[{type:"text",relative:!0,rect:[0,0,1,1],text:{func:"style@text"},align:{func:"style@text.align"},vAlign:{func:"style@text.vAlign"},color:{func:"style@text.color"},font:{func:"style@text.font"},shadow:{func:"style@text.shadow"},shadowColor:{func:"style@text.shadow.color"},shadowBlur:{func:"style@text.shadow.blur"},shadowOffsetX:{func:"style@text.shadow.offset.x"},shadowOffsetY:{func:"style@text.shadow.offset.y"},scaleX:{func:"style@text.scale.x"},scaleY:{func:"style@text.scale.y"}}]}),(yl=Gl.Shape=function(){Bn(yl,this),this._59O=new Lh}).__de__=ru,Vs("Shape",cl,{ms_ac:["thickness","closePath"],_icon:"shape_icon",_thickness:10,_closePath:!1,getUIClass:function(){return au},_22Q:function(){return np},getLength:function(t){return Yn(so(this._59O,this._58O,t,this._closePath))},getSegments:function(){return this._58O},toSegments:function(){var t=this._58O;return t&&new Lh(t._as.slice(0))},setSegments:function(t){var e=this._58O;t=t?bn(t)?new Lh(t.slice(0)):new Lh(t._as.slice(0)):null,(e&&t&&e._as.join(",")!==t._as.join(",")||e!==t)&&(this._58O=t,this.fp("segments",e,t))},getPoints:function(){return this._59O},toPoints:function(){var t=this._59O;return new Lh(t._as.slice(0))},getPointsMatrix2d:function(){var t=new na.Matrix2d,e=this.getPosition(),i=this.getScale(),n=this.getRotation();return t.translate(-e.x,-e.y).scale(i.x,i.y).rotate(n).translate(e.x,e.y),t},getPointsMatrix3d:function(){var t=new na.Matrix4,e=t.getElements(),i=this.p3();ju(e,i),fl(e,this.getFinalRotation3d(),this.getRotationMode());var n=this.getScale3d(),r=this._dynamicScale3d;return r&&(n[0]*=r[0],n[1]*=r[1],n[2]*=r[2]),Nu(e,n),ju(e,Us(i)),t},setPoints:function(t,e){var i,n,r=this,o=r._59O;t=t?bn(t)?new Lh(t.slice(0)):new Lh(t._as.slice(0)):new Lh,e&&(i=r.getPosition(),n=new oa(r.getRotation(),0,0,r.getScale().x,r.getScale().y)),(o&&t&&o._as.join(",")!==t._as.join(",")||o!==t)&&(r._59O=t,r.fs(),r.fp("points",o,t)),e&&(e=(t=r.getPosition()).x-i.x,i=t.y-i.y,n=n.tf(e,i),r.setPosition(t.x-e+n.x,t.y-i+n.y))},addPoint:function(t,e,i){var n=this.toPoints();n.add(t,e),this.setPoints(n,i)},setPoint:function(t,e,i){var n=this.toPoints();n.set(t,e),this.setPoints(n,i)},removePointAt:function(t){var e=this.toPoints();e.removeAt(t),this.setPoints(e)},setWidthForce:function(t){var e,i,n,r,o=this;o._55I||Mi||!o.getWidth()||(o._55I=1,e=o._position.x,i=t/o.getWidth(),n=o.toPoints(),r=new Lh,1!=i&&(n.each(function(t){r.add({x:(t.x-e)*i+e,y:t.y,e:t.e})}),o.setPoints(r),oo(o,[i,0,0,1,e*(1-i),0]),o.fs()),delete o._55I),yl.superClass.setWidth.call(o,t)},setWidth:function(t){return this.setWidthForce(t<Fs?Fs:t)},setHeightForce:function(t){var e,i,n,r,o=this;o._55I||Mi||!o.getHeight()||(o._55I=1,e=o._position.y,i=t/o.getHeight(),n=o.toPoints(),r=new Lh,1!=i&&(n.each(function(t){r.add({x:t.x,y:(t.y-e)*i+e,e:t.e})}),o.setPoints(r),oo(o,[1,0,0,i,0,e*(1-i)]),o.fs()),delete o._55I),yl.superClass.setHeight.call(o,t)},setHeight:function(t){return this.setHeightForce(t<Fs?Fs:t)},setAnchorElevation:function(t){this._55I=!0;var e=this._updatingAnchor3d;Mi||e||(i=t,t=this.getAnchorElevation(),0!=(i=this.getTall()*(t-i))&&this.shiftPointsElevation(i));var i=yl.superClass.setAnchorElevation.apply(this,arguments);return e||delete this._55I,i},getShapeElevation:function(){return this._54O-(this.getTall()||0)*(this._anchorElevation-.5)},setAnchor3d:function(t,e,i,n){var r=this;"number"==typeof t?c={x:t,y:e,z:i}:(c=t.length?{x:t[0],y:t[1],z:t[2]}:t,n=e),r._55I=!0,r._updatingAnchor3d=!0;var o,a,s,h,e=r.getDataModel();e&&e.beginTransaction(),Mi||(h=r.getAnchor3d(),a=r.getSize(),s=r.getTall(),o=a.width*(h.x-c.x),a=a.height*(h.z-c.z),s=s*(h.y-c.y),n||r.shiftPoints(o,a,s),h=r.p3());var c=yl.superClass.setAnchor3d.apply(r,arguments);return!Mi&&n&&(n=r.p3(),r.shiftPoints(n[0]-h[0]+o,n[2]-h[2]+a,n[1]-h[1]+s)),e&&e.endTransaction(),delete r._updatingAnchor3d,delete r._55I,c},setAnchor:function(t,e,i){var n=this;n._55I=!0;var r,o,a,s=n._updatingAnchor3d,h=!Mi&&!s;h&&("number"==typeof t?c={x:t,y:e}:(c=t.length?{x:t[0],y:t[1]}:t,i=e),a=n.getAnchor(),r=(o=n.getSize()).width*(a.x-c.x),o=o.height*(a.y-c.y),i||n.shiftPoints(r,o),a=n.getPosition());var c=yl.superClass.setAnchor.apply(n,arguments);return h&&(h=n.getPosition(),i&&n.shiftPoints(h.x-a.x+r,h.y-a.y+o)),s||delete n._55I,c},shiftPoints:function(i,n,r){var o,t,a;(i||n||r)&&(o=this.getElevation()||0,t=this.toPoints(),a=new Lh,t.each(function(t){var e=t.e;r&&(e=(e==U?o:e)+r),a.add({x:t.x+i,y:t.y+n,e:e})}),this.setPoints(a),this.fs())},shiftPointsElevation:function(t){return this.shiftPoints(0,0,t)},setPosition:function(t,e){var i=this;if(!i._28Q){if(i._28Q=1,!i._55I&&!Mi){t=(e=2===arguments.length?{x:t,y:e}:t).x-i._position.x,e=e.y-i._position.y;if(0==t&&0==e)return void delete i._28Q;i._55I=1,i.shiftPoints(t,e),oo(i,[1,0,0,1,t,e]),delete i._55I}yl.superClass.setPosition.apply(i,arguments),delete i._28Q}},fs:function(){this.fireShapeChange()},_70I:function(){if(2!==this._59O.size())return!1;var t=this._58O;return!t||2===t.size()&&1===t.get(0)&&2===t.get(1)},fireShapeChange:function(){var t;this._55I||Mi||(t=ms(this._59O))&&(this._55I=1,this.setRect(t),delete this._55I),this.fp(Tt,!1,!0)},getSerializableProperties:function(){var t=yl.superClass.getSerializableProperties.call(this);return t.segments=1,t.points=1,t.thickness=1,t.closePath=1,t}}),ml=Gl.Points=function(){Bn(ml,this)},Vs("Points",cl,{_22Q:function(){return ap},setPoints:function(t){this.points=t,this._pointsDirty=!0,this.fp("points",U,this.points)},setPoint:function(t,e){this.points||(this.points=[]),this.points[3*t]=e[0],this.points[3*t+1]=e[1],this.points[3*t+2]=e[2],this._pointsDirty=!0,this.fp("points",U,this.points)},setPointsColor:function(t){this.colors=t,this._colorsDirty=!0,this.fp("colors",U,this.colors)},setPointColor:function(t,e){this.colors||(this.colors=[]),e?(e=to(e),this.colors[3*t]=e[0],this.colors[3*t+1]=e[1],this.colors[3*t+2]=e[2]):(this.colors[3*t]=H,this.colors[3*t+1]=H,this.colors[3*t+2]=H),this._colorsDirty=!0,this.fp("colors",U,this.colors)},setPointsSize:function(t){this.sizes=t,this._sizesDirty=!0,this.fp("sizes",U,this.sizes)},setPointSize:function(t,e){this.sizes||(this.sizes=[]),this.sizes[t]=e||H,this._sizesDirty=!0,this.fp("sizes",U,this.sizes)},getPointInfo:function(t){var e=3*t,i=this.points;if(!i||i[e]===H||i[1+e]===H||i[2+e]===H)return null;var n=[i[e],i[1+e],i[2+e]],r=this.mat||$s(this),i=[n[0],n[1],n[2]];Xs(i,r);r=this.colors;return{size:this.sizes&&this.size[t]||this.s("points.size"),color:r&&r[e]?[r[e],r[1+e],r[2+e]]:this.s("points.color"),local:n,world:i}},getSerializableProperties:function(){var t=ml.superClass.getSerializableProperties.call(this);return t.points=1,t.colors=1,t.sizes=1,t}}),bl=Gl.Polyline=function(){Bn(bl,this),this.s({"shape.background":null,"shape.border.width":2})},Vs("Polyline",yl,{_icon:"polyline_icon",_22Q:function(){return sp},getUIClass:function(){return Al},setClosePath:function(){},setTall:function(t){var e,i,n,r,o=this,a=o.getDataModel();a&&a.beginTransaction(),o._55I||o._24Q||Mi||!o.getTall()||(o._24Q=1,e=o._54O,1!=(i=t/o.getTall())&&(n=o.toPoints(),r=new Lh,n.each(function(t){r.add({x:t.x,y:t.y,e:t.e==U?t.e:(t.e-e)*i+e})}),o.setPoints(r),o.fs()),delete o._24Q),bl.superClass.setTall.call(o,t),a&&a.endTransaction()},setElevation:function(t){var e=this.getDataModel();e&&e.beginTransaction(),this._55I||this._24Q||Mi||(this._24Q=1,0!=(t=t-this._54O)&&this.shiftPointsElevation(t),delete this._24Q),bl.superClass.setElevation.apply(this,arguments),e&&e.endTransaction()},fireShapeChange:function(){var t=this,e=t._59O;if(!t._55I&&!t._24Q&&!Mi){var i=e.size();if(i){var n=1,r=e.get(0),o=t._54O;r.e==U&&(r.e=o);for(var a=r.e,s=0;n<i;n++){(r=e.get(n)).e==U&&(r.e=o);var h=q(a,r.e),c=N(a+s,r.e),a=h,s=c-h}t._24Q=1,t.setTall(s),t.setElevation(a+s*t._anchorElevation),delete t._24Q}}bl.superClass.fireShapeChange.apply(t,arguments)}}),xl=Gl.SubGraph=function(){Bn(xl,this)},Vs("SubGraph",cl,{ISubGraph:1,_image:"subGraph_image",_icon:"subGraph_icon",_8I:function(){xl.superClass._8I.call(this),this.eachChild(function(t){wn(t)&&t._8I()})}}),G.loadingRefGraph=0,wl=Gl.RefGraph=function(){Bn(wl,this)},Vs("RefGraph",_l,{_icon:"refGraph_icon",getRef:function(){return this._ref},setRef:function(t){var e=this._ref;this._ref=t,this.fp("ref",e,t),this.updateRef()},_21I:function(){wl.superClass._21I.apply(this,arguments),this.updateRef()},updateRef:function(){var i,e,n=this;G.loadingRefGraph++,n.clearChildrenFromDataModel(),G.loadingRefGraph--,n._ref&&n._dataModel&&(n._xhrLoadHandler&&(n._xhrLoadHandler.cancel=!0),i=Mi,(e=n._xhrLoadHandler=function(t){var e;t&&n._dataModel&&(G.loadingRefGraph++,e=n._pendingUpdateInfo={needToRestore:i},i&&(e.p3=n.p3(),e.s3=n.s3(),e.r3=n.r3(),e.anchor3d=n.getAnchor3d(),e.scale3d=n.getScale3d()),n.r3(0,0,0),n.setScale3d(1,1,1),n.setAnchor3d(.5,.5,.5),n.p3(0,0,0),e=G.parse(t),(t=n._dataModel.deserialize(e,n,{justDatas:!0})).each(function(t){t._refGraph=n}),n.checkPendingUpdateInfo(),G.loadingRefGraph--,G.handleRefGraphLoaded(n,t,e))}).xhrLoadCalled=!1,G.load(n._ref,function(t){e.cancel||(e.xhrLoadCalled?e(t):$a(function(){e(t)}))}),e.xhrLoadCalled=!0)},checkPendingUpdateInfo:function(){var e,t=this,i=t._pendingUpdateInfo;i?(e=!0,this.eachChild(function(t){(t._pendingCheckImageJSON||t._pendingUpdateInfo)&&(e=!1)}),e&&(G.loadingRefGraph++,t._pendingUpdateInfo=null,t.updateFromChildren(),i.needToRestore&&(t.setAnchor3d(i.anchor3d),t.setScale3d(i.scale3d),t.r3(i.r3),t.p3(i.p3)),this.getParent()instanceof wl&&this.getParent().checkPendingUpdateInfo(),t.onPendingUpdated&&t.onPendingUpdated(),G.loadingRefGraph--)):t.onPendingUpdated&&(G.loadingRefGraph++,t.onPendingUpdated(),G.loadingRefGraph--)},getSerializableProperties:function(){var t=wl.superClass.getSerializableProperties.call(this);return t.ref=1,t}}),Gl.EdgeGroup=function(t,e){this._70O=t,this._siblings=e;for(var i,n=0,r=t.size(),o=F[Zt];n<r;n++)if((i=t.get(n).getStyle(Zt,!1))!=U){o=i;break}o==U&&(o=!0);var e=G.edgeGroupAgentFunc;for(e&&((e=e(t))&&e!==t.get(0)&&(t.remove(e),t.add(e,0))),n=0;n<r;n++)t.get(n).s(Zt,o)},Vs("EdgeGroup",L,{getEdges:function(){return this._70O},size:function(){return this._70O.size()},get:function(t){return this._70O.get(t)},indexOf:function(t){return this._70O.indexOf(t)},each:function(t,e){this._70O.each(t,e)},getSiblings:function(){return this._siblings},eachSiblingEdge:function(e,i){this._siblings.each(function(t){t._70O.each(e,i)})}}),An(G,{setConnectAction:function(t,e,i){var n=ji[t]={type:t,action:e};if(i)for(var r in i)n[r]=i[r]},getConnectAction:function(t,e){if(!e){if(!t)return null;e=t.getCurrentConnectActionType()}return ji[e]},doConnectAction:function(e,t,i,n){n=n||e.getCurrentConnectActionType();n=ji[n];if(!n)return!1;var r=n.action;return!!r&&(t instanceof Hl.Group?e.sm().getSelection().each(function(t){r.call(null,e,t,i)}):r.call(null,e,t,i),!0)},doDeleteConnectionAction:function(e,t,i){i=i||e.getCurrentConnectActionType();i=ji[i];if(!i||!i.delete)return!1;var n=i.delete.action;return!!n&&(t instanceof Hl.Group?e.sm().getSelection().each(function(t){n.call(null,e,t)}):n.call(null,e,t),!0)}}),El=Gl.JSONSerializer=function(t,e){this.dm=this._dataModel=t,this._hierarchical=!!G.forceHierarchicalSerialization||(e==U?t.isHierarchicalRendering():e)},Vs("JSONSerializer",L,{ms_ac:["hierarchical"],serialize:function(t){return G.stringify(this.toJSON(),t)},toJSON:function(){var t,e=this,i=e.dm,n=i.getRoots(),r=e.json={v:G.getVersion(),p:{},a:{},d:[]},o=i.getSerializableAttrs();for(t in i.getInit()&&(r.init=i.getInit()),i.getName()&&(r.p.name=i.getName()),i.getBackground()&&(r.p.background=i.getBackground()),i.getLayers()&&(r.p.layers=i.getLayers()),i.getEnvmap()&&(r.p.envmap=i.getEnvmap()),i.isCubicEnvmap()&&(r.p.cubicEnvmap=i.isCubicEnvmap()),r.p.autoAdjustIndex=i.isAutoAdjustIndex(),r.p.hierarchicalRendering=i.isHierarchicalRendering(),o){var a=i.a(t);a!==H&&e[He](t,a,r.a)}return zn(r.a)&&delete r.a,e._hierarchical?n.each(e.serializeData,this):i.each(function(t){e.serializeData(t)}),i.fireSerializeEvent({type:"serialize",json:r}),i.getPostProcessingData()&&(r.p.postProcessingData=i.getPostProcessingData()),r},isSerializable:function(){return!0},getProperties:function(t){return t.getSerializableProperties()},getStyles:function(t){return t.getSerializableStyles()},getAttrs:function(t){return t.getSerializableAttrs()},serializeData:function(t){var e=this;if(e.isSerializable(t)&&!t._refGraph){var i,n,r,o,a=new(ns(t.getClassName())||t.getClass()),s={c:t.getClassName(),i:t.getId(),p:{},s:{},a:{}};for(i in e.json.d.push(s),e.getProperties(t))/^_/.test(i)?(o=t[i],"_width"!==i&&"_height"!==i||o!=U&&-1!==o||((t.s("layout.h")||t.s("layout.v"))&&t.getHost()||t instanceof Gl.Node&&(r=t.getParent())&&r instanceof Gl.Block||t.s("fullscreen"))&&(o=t[i]="_width"===i?t.getWidth():t.getHeight()),o!==a[i]&&e[He](i.substr(1),o,s.p)):!t[n=fn(i)]||(o=t[n]())!==a[n]()&&e[He](i,o,s.p);for(i in e.getStyles(t))o=t.s(i),o!==a.s(i)&&e[He](i,o,s.s);for(i in e.getAttrs(t))o=t.a(i),o!==a.a(i)&&e[He](i,o,s.a);zn(s.p)&&delete s.p,zn(s.s)&&delete s.s,zn(s.a)&&delete s.a}e._hierarchical&&t.getChildren().each(e.serializeData,e)},serializeValue:function(t,e,i){xn(e)?e={__a:e._as}:e instanceof jh&&(e={__i:e.getId()}),i[t]=e},deserialize:function(t,e,i){var n=this;return pn(t)&&/.json$/.test(t)?void G.xhrLoad(t,function(t){n.deserializeImpl(t,e,i)}):n.deserializeImpl(t,e,i)},deserializeImpl:function(t,e,i){var n=this.dm;n.setDeserializing(!0),i=vn(i)?{setId:i}:mn(i)?{finishFunc:i}:i||{},t=this.json=pn(t)?G.parse(t):t,!i.justDatas&&t.a&&t.a.onPreDeserialize&&!i.disableOnPreDeserialize&&t.a.onPreDeserialize(t,n,i.view),n.beginTransaction(),Mi++,this._82I={};var r=new Lh,o=new Lh,a=0,s=t.d.length;if(i.justDatas||(!i.disableInit&&mn(t.init)&&t.init(n),n.setInit(t.init)),!i.justDatas){for(var h in t.a)n.a(h,this[We](t.a[h]));for(var c in t.p)n[gn(c)](t.p[c])}for(;a<s;a++){var l=t.d[a],u=new(ns(l.c)),d=l.i;i.setId&&d!=U&&(u._id=d),this._82I[d]=u,r.add(u),o.add(l)}for(a=0;a<s;a++)this.deserializeData(r.get(a),o.get(a));return r.each(function(t){e&&!t.getParent()&&t.setParent(e),n.add(t)}),i.__innerHandler__&&i.__innerHandler__(t,n,i.view,r),n.fireSerializeEvent({type:"deserialize",json:t}),Mi--,n.endTransaction(),!i.justDatas&&t.a&&t.a.onPostDeserialize&&!i.disableOnPostDeserialize&&t.a.onPostDeserialize(t,n,i.view,r),i.finishFunc&&i.finishFunc(t,n,i.view,r),n.setDeserializing(!1),r},deserializeData:function(t,e){for(var i in e.p)t[gn(i)](this[We](e.p[i]));for(i in e.s)t.s(i,this[We](e.s[i]));for(i in e.a)t.a(i,this[We](e.a[i]))},deserializeValue:function(t){if(yn(t)){var e=t.__i;if(e!=U)return this._82I[e];if(e=t.__a,bn(e))return new Lh(e)}return t}}),An(Nh,{serialize:function(t,e){return new El(this,e).serialize(t)},toJSON:function(t){return new El(this,t).toJSON()},deserialize:function(t,e,i){return new El(this).deserialize(t,e,i)}}),Tl=Gl.OverlappingBox=function(t){this.gv=t,this.boxes={}},Vs("OverlappingBox",L,{clear:function(){var t,e,i=this.boxes;for(t in i)e=i[t],e.length=0},isOverlapping:function(t,e){var i,n,r,o,a=this.boxes,s=a[t];for(s?(i=s.rects,n=s.length):s=a[t]={rects:i=[],length:n=0},r=0;r<n;r++)if((o=i[r]).x<e.x+e.w&&o.x+o.w>e.x&&o.y<e.y+e.h&&o.h+o.y>e.y)return!0;return i.length<=n?(i.push(e),s.length++):i[s.length++]=e,!1}}),An(G,{fetch:function(t,e){var i="GET",n=!1,r=null,o="";e&&(i=e.method||"GET",n=e.sync,o=e.url,r=e.data||null),t.open(i,o,!n),e.responseType?t.responseType=e.responseType:e.overrideMimeType&&t.overrideMimeType&&t.overrideMimeType(e.overrideMimeType),t.send(r)},convertImageSrc:function(t,e){e&&"function"==typeof e||(e=function(){}),e(t)}}),Sl=Gl.Request=function(){this._xhr=new XMLHttpRequest,this._onloadFunc=function(){},this._errorFunc=function(){}},Vs("Request",L,{_responseType:null,_overrideMimeType:"text/plain",send:function(t){var e=this._xhr,i=this.onload,n=this.onerror;this.getResponseType()?t.responseType=this.getResponseType():this.getOverrideMimeType()&&(t.overrideMimeType=this.getOverrideMimeType()),e.onload=i,e.onerror=n,G.fetch(e,t)},onload:function(){},onerror:function(){},getResponseType:function(){return this._responseType},setResponseType:function(t){this._responseType=t},getOverrideMimeType:function(){return this._overrideMimeType},setOverrideMimeType:function(t){this._overrideMimeType=t},getResponseText:function(){var t=this._xhr;return t.response||t.responseText}}),vc.GraphView=function(t){var e=this;e._24I={},e._34I=new Lh,e._25I={},e._56I={},e._view=$n(1,e),e._canvas=er(e._view),e.dm(t||new Nh),this._coreInteractor=new Fl(this),e.setEditable(!1),e.setScrollBarVisible(G.graphViewScrollBarVisible),e._initView()},du("GraphView",L,{ms_v:1,ms_gv:1,ms_bnb:1,ms_tip:1,ms_dm:1,ms_lp:1,ms_fire:1,ms_sm:1,_49o:1,ms_txy:1,_52o:1,_51o:1,ms_ac:[le,ue,he,ce,"resettable","editInteractor",ae,"zoomable","pannable","rectSelectable","autoScrollZone",ye,"movableFunc","editableFunc","pointEditableFunc","rectEditableFunc","rotationEditableFunc","anchorEditableFunc","rectSelectBackground","rectSelectBorderColor","editPointSize","editPointBorderColor","editPointBackground","hoverDelay"],_zoomable:G.graphViewZoomable,_resettable:G.graphViewResettable,_pannable:G.graphViewPannable,_rectSelectable:G.graphViewRectSelectable,_autoScrollZone:G.graphViewAutoScrollZone,_rectSelectBackground:G.graphViewRectSelectBackground,_rectSelectBorderColor:G.graphViewRectSelectBorderColor,_editPointSize:G.graphViewEditPointSize,_editPointBorderColor:G.graphViewEditPointBorderColor,_editPointBackground:G.graphViewEditPointBackground,_scrollBarColor:za,_scrollBarSize:Va,_autoHideScrollBar:xa,_autoMakeVisible:ba,_currentActionType:null,getCoreInteractor:function(){return this._coreInteractor},getLayers:function(){return this._dataModel.getLayers()},setLayers:function(t){this._dataModel.setLayers(t)},setEditable:function(t){var e,i=this,n=i.__interactorMap__;n||(e=vc.XEditInteractor,n=i.__interactorMap__={scrollBar:new Nl(i),select:new kl(i),edit:new(e||Xl)(i),text:new jl(i),move:new lu(i),default:new hu(i),touch:new Ul(i,{editable:!1})}),t?(i._uieditable=!0,i.setInteractors([n.scrollBar,n.select,n.edit,n.text,n.move,n.default,n.touch])):(i._uieditable=!1,i.setInteractors([n.scrollBar,n.select,n.move,n.default,n.touch]))},getCanvas:function(){return this._canvas},_33I:function(t){var e=t.getUIClass();return e?new e(this,t):U},getDataUI:function(t){var e=this._25I[t._id];return e===H&&(e=this._33I(t),this._25I[t._id]=e),e},getNodeRect:function(t){return G.getNodeRect(this,t)},getFullscreenDatas:function(){return this._dataModel.getFullscreenDatas()},getEdgeInfo:function(t){t=this.getDataUI(t);return t?(t._79o(),t._78o):null},getEdgeSourcePosition:function(t){var e=this.getDataUI(t),t=e.s,e=e._data._40I;return sc(this,e,t("edge.source.position"),t("edge.source.offset.x"),t("edge.source.offset.y"),t("edge.source.anchor.x"),t("edge.source.anchor.y"))},getEdgeTargetPosition:function(t){var e=this.getDataUI(t),t=e.s,e=e._data._41I;return sc(this,e,t("edge.target.position"),t("edge.target.offset.x"),t("edge.target.offset.y"),t("edge.target.anchor.x"),t("edge.target.anchor.y"))},invalidateAll:function(t){var e=this;if(t){for(var i in e._25I){var n=e._25I[i];n&&n.dispose()}e._25I={},e._56I={},e._24I={},e._34I.clear(),e.redraw()}else e.dm().each(function(t){e.invalidateData(t)})},invalidateSelection:function(){var e=this;e.sm().each(function(t){e.invalidateData(t)})},invalidateData:function(t){this._24I[t._id]=t,this._21Q(t),this.iv()},_21Q:function(t){var e,i=this._24I;En(t)&&Ni[t.s(Jt)]&&((e=t.getSourceAgent())&&e.getAgentEdges().each(function(t){i[t._id]=t}),(e=t.getTargetAgent())&&e.getAgentEdges().each(function(t){i[t._id]=t}),this.iv())},redraw:function(t){this._32I||(t?this._34I.add(t):(this._32I=1,this._34I.clear()),this.iv())},each:function(e,i){var t,n,r=0,o=this.getLayers(),a=this._dataModel,s=a._datas._as,h=s.length;if(o){for(var c=o.length;r<c;r++)if(n=o[r],yn(n)&&(n=n.name),a.isHierarchicalRendering()){if(!1===this._dataModel.eachByHierarchical(function(t){return t._layer===n?i?e.call(i,t):e(t):void 0}))return}else for(var l=0;l<h;l++)if((t=s[l])._layer===n&&!1===(i?e.call(i,t):e(t)))return}else if(a.isHierarchicalRendering())this._dataModel.eachByHierarchical(e,null,i);else for(;r<h;r++)if(t=s[r],!1===(i?e.call(i,t):e(t)))return},reverseEach:function(e,i){var t,n,r,o=this._dataModel,a=o._layers,s=o._datas._as,h=s.length;if(a){for(t=a.length-1;0<=t;t--)if(r=a[t],yn(r)&&(r=r.name),o.isHierarchicalRendering()){if(!1===o.reverseEachByHierarchical(function(t){return t._layer===r?i?e.call(i,t):e(t):void 0}))return}else for(var c=h-1;0<=c;c--)if((n=s[c])._layer===r&&!1===(i?e.call(i,n):e(n)))return}else if(o.isHierarchicalRendering())o.reverseEachByHierarchical(e,null,i);else for(t=h-1;0<=t;t--)if(n=s[t],!1===(i?e.call(i,n):e(n)))return},getViewRect:function(){return this._29I},getContentRect:function(){var t,e,i=this,n=i._84I;return n||(t=this.dm().a("width"),e=this.dm().a("height"),0<t&&0<e?i._84I={x:0,y:0,width:t,height:e}:(i.each(function(t){i.isVisible(t)&&(n=bs(n,i.getDataUIBounds(t)))}),i._84I=n||Ji)),i._84I},getScrollRect:function(){return bs(this.getContentRect(),this._29I)},makeCenter:function(t,e,i){var n,r,o,a,s=this;s.getWidth()&&s.getHeight()?(s.makeVisible(t),s.validate(),(r=s.getDataUIBounds(t))&&(o=s.getWidth(),a=s.getHeight(),n=r.x+r.width/2,r=r.y+r.height/2,o=-n*s._zoom+o/2,a=-r*s._zoom+a/2,s.setTranslate(o,a,e))):i||$a(s.makeCenter,s,[t,e,!0],500)},fitData:function(e,i,n,r,t){var o,a=this;a.getWidth()&&a.getHeight()?(o=function(){a.makeVisible(e),a.validate();var t=a.getDataUIBounds(e);t&&(t=is(t),Is(t,n==U?20:n),a.fitRect(t,i,r))},i?G.callWhenLoaded(o):o()):t||$a(a.fitData,a,[e,i,n,r,!0],500)},fitContent:function(e,i,n,t){var r,o=this;o.getWidth()&&o.getHeight()?(r=function(){o.validate();var t=is(o.getContentRect());Is(t,i==U?20:i),o.fitRect(t,e,n)},e?G.callWhenLoaded(r):r()):t||$a(o.fitContent,o,[e,i,n,!0],500)},fitRect:function(t,e,i){var n=this,r=n.getWidth(),o=n.getHeight(),a=t.x+t.width/2,s=t.y+t.height/2,h=q(r/t.width,o/t.height),t=n._zoom,r=-a*t+r/2,o=-s*t+o/2;0===h||isNaN(h)||(i&&(h=q(1,h)),e?(n._65I&&(delete n._65I.finishFunc,n._65I.stop(!0)),n._14o&&n._14o.stop(!0),n.setTranslate(r,o,{finishFunc:function(){n.setZoom(h,e)}})):(n.setTranslate(r,o),n.setZoom(h)))},fitSelection:function(t,e,i){var n=this,r=n.sm(),o=null;r.size()&&(r.each(function(t){o=bs(n.getDataUIBounds(t),o)}),t&&Is(o,t),n.fitRect(o,e,i))},toCanvas:function(t,e,i){e=e||this._zoom,this.validateImpl();var n=this.getContentRect();i&&Is(n,i),n.width||(n.width=10),n.height||(n.height=10);var r=er(),o=n.x*e,a=n.y*e,s=Math.ceil(n.width*e),i=Math.ceil(n.height*e);rr(r,s,i,1);n=fr(r);return(t=t||this._dataModel.getBackground())&&lo(n,0,0,s,i,t),pr(n,-o,-a),n.scale(e,e),this._42(n),n.restore(),r},toDataURL:function(t,e,i,n){return this.toCanvas(t,i,n).toDataURL(e||"image/png",1)},getClipBounds:function(){return this._74O},_42:function(a,s){var t,e,h=this,i=h.dm().getBackground();i&&(t=h.dm().a("width"),e=h.dm().a("height"),0<t&&0<e&&lo(a,0,0,t,e,i));var n=h.__htmlOrderList,c=[],l=h._forcedLayoutHTML;if(h._93db(a,s),h.each(function(t){var e,i,n,r,o=h.getDataUI(t);o&&(e=h._56I[t._id],r=o._htmlView,e&&(i=o._79o(),r=o._htmlView,Gl.HtmlNode&&t instanceof Gl.HtmlNode?o._42(a):(n=h.getViewRect(),t=r&&r.layoutHTML,!s||Es(s,i)?(t&&(r.layoutHTML(),o.__outerLayout&&delete o.__outerLayout),o._42(a)):Es(n,i)||!t||o.__outerLayout&&!l||(r.layoutHTML(),o.__outerLayout=!0))),r&&(c.push(r),r.getView&&(r=r.getView()),r.style.display=e?"block":_t))}),n&&0<c.length){var r=!1;if(n.length!==c.length)r=!0;else for(var o=0;o<c.length;o++)if(c[o]!==n[o]){r=!0;break}r&&(c.forEach(function(t){!1!==t.autoAdjustIndex&&h.appendHTML(t,!0)}),this.__htmlOrderList=c)}else this.__htmlOrderList=c;h._92db(a,s)},validateImpl:function(){this.tryUpdateRootData();var i,e,t,n,r,o,a,s=this,h=s.tx(),c=s.ty(),l=s._zoom,u=s._canvas,d=this.getWidth(),f=this.getHeight(),g=s._29I,p={x:-h/l,y:-c/l,width:d/l,height:f/l},_={},v=s._34I,y=s._24I,m=s._32I,b=s._23I;for(i in s._24I={},d===u.clientWidth&&f===u.clientHeight||(rr(u,d,f),m=1,s._forcedLayoutHTML=1),m||Ln(p,g)||(m=1,s._forcedLayoutHTML=1),s._29I=p,s.each(function(t){i=t._id;var e=_[i]=s.isVisible(t);e!==s._56I[i]&&(y[i]=t,(r=s.getDataUI(y[i]))&&r._84o(e),s._84o(t,e))},s),y)r=s.getDataUI(y[i]),r&&(!m&&s._56I[i]&&(o=r._79o(),o&&v.add(o)),r.invalidate()),s._83I=1;if(s._56I=_,!m)for(i in y)_[i]&&(r=s.getDataUI(y[i]),r&&(o=r._79o(),o&&v.add(o)));m?e=p:(v.each(function(t){Es(p,t)&&(e=bs(e,t))}),e&&(Is(e,N(1,1/l)),e.x=k(e.x*l)/l,e.y=k(e.y*l)/l,e.width=j(e.width*l)/l,e.height=j(e.height*l)/l,e=Ts(p,e))),(s._74O=e)&&(a=fr(u),t=e.x,n=e.y,g=e.width,u=e.height,t=Math.floor((t*l+h)*ma),n=Math.floor((n*l+c)*ma),g=Math.ceil(g*l*ma)+1,u=Math.ceil(u*l*ma)+1,m||(e.x=(t/ma-h)/l,e.y=(n/ma-c)/l,e.width=g/ma/l,e.height=u/ma/l),a.beginPath(),a.rect(t,n,g,u),a.clip(),a.clearRect(t,n,g,u),gr(a,h,c,l),s._42(a,e),a.restore(),delete s._74O),v.clear(),delete s._32I,delete s._forcedLayoutHTML,b&&0<d&&0<f&&((r=s.getDataUI(b))&&(o=r._79o(),a=(c=s._29I).x,d=c.y,f=c.width,b=c.height,l=s._zoom,o&&!Es(o,c)&&(o.x+o.width<a&&s.tx(-o.x*l),o.x>a+f&&s.tx(-(o.x+o.width-f)*l),o.y+o.height<d&&s.ty(-o.y*l),o.y>d+b&&s.ty(-(o.y+o.height-b)*l))),delete s._23I),s._83I&&(delete s._83I,delete s._84I),s._98O(),s.countFrame(),zn(s._24I)||$a(s.iv,s)},isValidGuideLineSource:function(){return!0},tryUpdateRootData:function(){if(!this._rootDataUpdating){this._rootDataUpdating=!0;var t,e,i=this.getFullscreenDatas();for(e in i)t=i[e],this.scaleRootData(t);this._rootDataUpdating=!1}},scaleRootData:function(t){var e=t.s("fullscreen");if("uniform"===e||"fill"===e){t.getRotation()&&t.setRotation(0);var i=t.s("fullscreen.gap")||0,n=this.getWidth(),r=this.getHeight();if(n&&r){var o,a,s=n-2*i,h=r-2*i,c=t.getAnchor(),l=t.getScaledSize(),n=l.width,r=l.height,l=t.s("fullscreen.lock");if(l)return"uniform"===e?n/r<s/h?(u=h/r,n=r*s/h):(u=s/n,r=n*h/s):"v"===l?(n=s/(u=h/r),t.getWidth()!==n&&t.setWidth(n)):(r=h/(u=s/n),t.getHeight()!==r&&t.setHeight(r)),this.setZoom(u),o=i-(t.getX()-c.x*n)*u,a=i-(t.getY()-c.y*r)*u,o!==this.tx()&&this.tx(o),void(a!==this.ty()&&this.ty(a));o=this.tx(),a=this.ty();var u={x:(-o+i)/(u=this._zoom),y:(-a+i)/u,width:s/u,height:h/u};"uniform"===e&&(n=n/r,n=(r=Math.min(u.width,u.height*n))/n,u.x+=.5*(u.width-r),u.y+=.5*(u.height-n),u.width=r,u.height=n),s=u.width/t.getScaleX(),h=u.height/t.getScaleY(),t.getWidth()==s&&t.getHeight()===h||t.setSize(s,h);h=u.x+c.x*u.width,c=u.y+c.y*u.height,u=t.getPosition();h===u.x&&c===u.y||t.setPosition(h,c)}}},isScrollBarVisible:function(){return!!this._79O},setScrollBarVisible:function(t){var e=this;t!==e.isScrollBarVisible()&&(t?(or(e._view,e._79O=tr()),or(e._79O,e._27I=tr()),or(e._79O,e._28I=tr())):(As(e._79O),delete e._79O,delete e._27I,delete e._28I),e.fp("scrollBarVisible",!t,t))},getDebugTip:function(){return""},showScrollBar:function(){var t=this;t._79O&&(t._85I||(w(function(){t._86I()},La),t.iv()),t._85I=new Date)},_86I:function(){var t=this;t._85I&&((new Date).getTime()-t._85I.getTime()>=La?(delete t._85I,t.iv()):w(function(){t._86I()},La))},getVScrollBar:function(){return this._27I},getHScrollBar:function(){return this._28I},_98O:function(){var t=this._27I,e=this._28I;if(this._79O){if(this._autoHideScrollBar&&!this._85I)return t.style.visibility=te,void(e.style.visibility=te);var i=this.getScrollBarColor(),n=this._zoom,r=this.getScrollBarSize(),o=this.getViewRect(),a=this.getScrollRect(),s=o.height*n,h=a.height*n,c=o.width*n-r-2,l=s*((o.y-a.y)*n/h),u=s/h*s,d=t.style;s<h-.5?(u<Fa&&((l=l+u/2-Fa/2)<0&&(l=0),s<l+Fa&&(l=s-Fa),u=Fa),wr(t,c,l,r,u),d.visibility=ee,d.background=i,d.borderRadius=r/2+vt):d.visibility=te;t=o.width*n,u=a.width*n,l=o.height*n-r-2,c=t*((o.x-a.x)*n/u),n=t/u*t,d=e.style;t<u-.5?(n<Fa&&((c=c+n/2-Fa/2)<0&&(c=0),t<c+Fa&&(c=t-Fa),n=Fa),wr(e,c,l,n,r),d.visibility=ee,d.background=i,d.borderRadius=r/2+vt):d.visibility=te}},setDataModel:function(t){var e=this,i=e._dataModel,n=e._selectionModel;i!==t&&(i&&(i.ump(e.handleDataModelPropertyChange,e),i.umm(e.handleDataModelChange,e),i.umd(e.handleDataPropertyChange,e),i.removeIndexChangeListener(e._75O,e),i.removeHierarchyChangeListener(e.handleHierarchyChange,e),n||i.sm().ums(e.handleSelectionChange,e)),(e._dataModel=t).mp(e.handleDataModelPropertyChange,e),t.mm(e.handleDataModelChange,e),t.md(e.handleDataPropertyChange,e),t.addIndexChangeListener(e._75O,e),t.addHierarchyChangeListener(e.handleHierarchyChange,e),n?n._21I(t):t.sm().ms(e.handleSelectionChange,e),e.invalidateAll(!0),e.fp(Oe,i,t),e.updateBackground())},getLayersInfo:function(){var t;return this._layersInfo===H&&((t=this.getLayers())?(this._layersInfo={},t.forEach(function(t){var e=yn(t)?t.name:t;this._layersInfo[e]=t},this)):this._layersInfo=null),this._layersInfo},calculateEdgePosition:function(t,e,i){var n=this.getDataUI(t),r=xc(n),o=function(i,n,t,e){function r(t){if(0<=t&&t<=1){s=n(t);var e=(i.x-s.x)*(i.x-s.x)+(i.y-s.y)*(i.y-s.y);return e<o&&(o=e,a=t,1)}}t=t||100,e=e||1e-5;for(var o=1/0,a=0,s=new ca,h=0;h<t;++h)r(h/t);for(var c=1/(2*t);e<c;)r(a-c)||r(a+c)||(c/=2);return a}(e,function(t){return Sc(r,100*t)},100,.001),t=Sc(r,100*o);if(!i)for(var a=Ic(n),s=new ca(t.x,t.y),h=49/(this._zoom*this._zoom),c=0,l=a.length;c<l;c++)if(s.distanceToSquared(a[c])<h)return{index:c,point:a[c],distance:Math.sqrt((a[c].x-e.x)*(a[c].x-e.x)+(a[c].y-e.y)*(a[c].y-e.y))};return{percent:o,point:t,distance:Math.sqrt((t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y))}},calculateAttachPoint:(Cv=new ca,Mv=new ca,Rv=new ca,function(t,e){var i=this.getAttachPoints(t);if(!i||!i.length)return null;Rv.set(e.x,e.y);for(var n,r,o,a,s=1/0,h=0,c=i.length;h<c;h++)r=i[h],Mv.x=r.x,Mv.y=r.y,Cv.x=r.offsetX||0,Cv.y=r.offsetY||0,o=sc(this,t,0,Cv.x,Cv.y,Mv.x,Mv.y),(r=Rv.distanceToSquared(o))<s&&(n=h,s=r,a=o);s=Math.sqrt(s);e=this.getAttachStyle(t);if("close"===e&&t.s("attach.close.threshold")/this._zoom<s)return null;return{index:n,distance:s,info:i[n],point:a}}),getAttachPoints:function(t){var e=t.s("attach.points");if(e)return e;e=Qa(t._image);return e?xh(e.attachPoints,t,this)||null:void 0},getAttachStyle:function(t){var e=t.s("attach.style");if(e)return e;e=Qa(t._image);return e?xh(e.attachStyle,t,this)||"close":void 0},updateLayers:function(){this._layersInfo=H,this.invalidateSelection(),this.redraw()},updateBackground:function(){var t=this.dm().a("width"),e=this.dm().a("height");this._canvas.style.background=!(0<t&&0<e)&&this.dm().getBackground()||""},handleDataModelPropertyChange:function(t){var e,i;"background"===t.property?(e=this._canvas.style.background,i=t.newValue||"",this.updateBackground(),this.fp("canvasBackground",e,i),this.redraw()):"a:width"===t.property||"a:height"===t.property?(this._83I=1,this.updateBackground(),this.redraw()):"layers"===t.property?this.updateLayers():"hierarchicalRendering"===t.property&&this.redraw()},handleDataPropertyChange:function(t){this.dm().isHierarchicalRendering()&&"parent"===t.property&&t.data.hasChildren()&&this.redraw(),this.invalidateData(t.data)},onPropertyChanged:function(t){var e,i=t.property;this.redraw(),"zoom"===i?(e=this.sm().getSelection()).size()&&e.each(function(t){t.invalidate()}):"dataModel"===i&&(this._83I=1),qh[i]?this.showScrollBar():i===ae&&this.onCurrentSubGraphChanged(t)},onCurrentSubGraphChanged:function(){this.sm().cs(),this.reset()},handleDataModelChange:function(t){var e,i,n=this,r=t.kind,o=t.data;n._83I=1,"add"===r?(n.invalidateData(o),En(o)&&o.getEdgeGroup()&&o.getEdgeGroup().eachSiblingEdge(n.invalidateData,n)):r===Ct?(n._21Q(o),e=o._id,(i=n._25I[e])&&(!n._56I[e]||(t=i._79o())&&n.redraw(t),i.dispose(),delete n._25I[e],delete n._24I[e],delete n._56I[e]),o===n._currentSubGraph&&n.setCurrentSubGraph(U)):r===Mt&&(n.invalidateAll(!0),n.setCurrentSubGraph(U))},_75O:function(t){this.invalidateData(t.data)},handleHierarchyChange:function(t){this.dm().isHierarchicalRendering()&&t.data.hasChildren()&&this.redraw(),this.invalidateData(t.data)},adjustIndex:function(t){if(this.isVisible(t)){this.dm().beginTransaction();for(var e=t;e._parent&&this.isVisible(e._parent);)e=e._parent;e&&e!==t&&this._dataModel.adjustIndex(e),this._dataModel.adjustIndex(t),this.dm().endTransaction()}},getImage:function(t){return t.getImage?t.getImage():H},getSelectWidth:function(t){var e=Qa(this.getImage(t));return e&&xh(e.disableSelectedBorder,t,this)?0:t.s("select.width")},getSelectColor:function(t){return t.s("select.color")},isSelectable:function(t,e){if(this.isSelected(t))return!0;if(!e&&t.getParent()instanceof _l&&this.isSelectable(t.getParent(),!0)&&t.getParent().isSyncSize())return!1;e=this.getLayersInfo();if(e){e=e[t._layer];if(e&&!1===e.selectable)return!1}return t.s("2d.selectable")&&this.sm().isSelectable(t)},isMovable:function(t){if(En(t)&&t.getStyle(Jt)!==Vt)return!1;var e=this.getLayersInfo();if(e){e=e[t._layer];if(e&&!1===e.movable)return!1}return!!t.s("2d.movable")&&(!this._movableFunc||this._movableFunc(t))},isEditable:function(t){if(Gl._uiSerializing)return this._uieditable;if(!this._editInteractor||!this.isSelected(t))return!1;if(Tn(t)){var e=this.getDataUI(t);if(!e||e._88I)return!1}if(En(t)&&t.getStyle(Jt)!==Vt)return!1;e=this.getLayersInfo();if(e){e=e[t._layer];if(e&&!1===e.editable)return!1}return!!t.s("2d.editable")&&(!this._editableFunc||this._editableFunc(t))},handleDelete:function(){this._editInteractor&&(this._editInteractor.handleDelete?this._editInteractor.handleDelete():this.removeSelection())},isPointEditable:function(t){return(!wn(t)||0===t.getRotation())&&(!this._pointEditableFunc||this._pointEditableFunc(t))},isRectEditable:function(t){return!this._rectEditableFunc||this._rectEditableFunc(t)},isAnchorEditable:function(t){return!this._anchorEditableFunc||this._anchorEditableFunc(t)},isRotationEditable:function(t){return!(!t.setRotation||!1===t.IRotatable)&&(!this._rotationEditableFunc||this._rotationEditableFunc(t))},isSourceTargetEditable:function(){return!0},getRotationPoint:function(t){var e=t.getAnchor(),i=t.getScale(),n=this._zoom,n=Mo(t.getRotation(),0,-t.getHeight()*i.y*e.y-(i.y<0?-1:1)*(et?32:16)/n),t=t.p();return n.x+=t.x,n.y+=t.y,n},getLogicalPoint:function(t){return Cs(t,this._canvas,this.tx(),this.ty(),this._zoom,this._zoom)},getScreenPoint:function(t,e){var i;return"object"==typeof t?e=t.x!==H?(i=t.x,t.y):(i=t[0],t[1]):i=t,Ms(i,e,this._canvas,this.tx(),this.ty(),this._zoom,this._zoom)},getSelectedDataAt:function(t){var e=this;return this.getDataAt(t,function(t){return e.isSelected(t)})},getDataInfoAt:function(t,e,i){var n=this.lp(t),r=this.getDataAt(n,e,i);if(r){var i=this.getDataUI(r),o={data:r,ui:i,point:n},a=i._38o;if(a){var s,h=a.icons;for(s in h){var c=h[s],l=a.rects[s];if(l)for(var u=xh(c.names,r,this),c=u?u.length:0,d=l.rotation,f=c-1;0<=f;f--){var g=u[f],p=l[f];if(xs(p,n,d))return o.part="icons",o.name=s,o.icon=g,o.rect=p,o.index=f,o.rotation=d,o}}}if(this.isNoteVisible(r)){if(i.note2Info&&xs(i.note2Info.clickRect,n,U,i.note2Info.scale))return o.part="note2",o;if(i.noteInfo&&xs(i.noteInfo.clickRect,n,U,i.noteInfo.scale))return o.part="note",o}if(this.isLabelVisible(r)){if(i.label2Info&&xs(i.label2Info.rect,n,i.label2Info.rotation,i.label2Info.scale))return o.part="label2",o;if(i.labelInfo&&xs(i.labelInfo.rect,n,i.labelInfo.rotation,i.labelInfo.scale))return o.part="label",o}if(r.isInRect&&r.isInRect(n))return o.part="body",o}return o},getDataAt:function(e,i,n){e.target&&(e=this.lp(e));var r,o=this._zoom;return this.reverseEach(function(t){return(i?i(t):this.isSelectable(t))&&this.rectIntersects(t,dn(e.x,e.y,n,o))?(r=t,!1):void 0},this),r},getIconInfoAt:function(t,e){if(t.target&&(t=this.lp(t)),e=e||this.getDataAt(t)){var i=this.getDataUI(e);if(i&&i._38o){var n,r=i._38o,o=new Lh;for(n in r.icons)o.add(n);for(var a=o.size()-1;0<=a;a--){n=o.get(a);for(var s=r.rects[n],h=s.rotation,c=s.length-1;0<=c;c--){var l=s[c],u=l.width,d=l.height,f={x:t.x-l.x-u/2,y:t.y-l.y-d/2};if(h!=U&&(f=Mo(-h,f.x,f.y)),xs(l={x:-u/2,y:-d/2,width:u,height:d},f))return{key:n,index:c,name:r.icons[n].names[c],rect:s[c],point:t,rotation:h,relativeRect:l,relativePoint:f,data:e}}}}}return U},getDatasInRect:function(e,i,n){n===H&&(n=1);var r=this,o=new Lh;return r.reverseEach(function(t){n&&!r.isSelectable(t)||(i?r.rectIntersects(t,e):r.rectContains(t,e))&&o.add(t)}),o},moveSelection:function(t,e){this.dm().beginTransaction(),Bo(this.sm().toSelection(this.isMovable,this),t,e),this.dm().endTransaction()},moveDatas:function(t,e,i){this.dm().beginTransaction(),t instanceof Lh||(t=new Lh(t)),Bo(t,e,i),this.dm().endTransaction()},getDataUIBounds:function(t){t=this.getDataUI(t);return t?t._79o():U},drawData:function(e,t,i){var n,r=this.getDataUI(t);r&&(n=r._79o(),i&&!Es(i,n)||(r._42(e),t instanceof Gl.Block&&t.eachChild(function(t){this.isVisible(t)&&this.drawData(e,t,i)},this)))},getBoundsForGroup:function(t){return t.s(Pt)?this.getDataUIBounds(t):U},isPixelPerfect:function(t){return t.s("pixelPerfect")},rectIntersects:function(t,e){this.validate();var i=U;if(this._56I[t._id]){var n=this._25I[t._id];if(n){var r=n._79o();if(ws(e,r))i=!0;else if((e=Ts(e,r))&&(n.rectIntersects&&(i=n.rectIntersects(e)),i==U)){if(!this.isPixelPerfect(t))return!0;var o=e.x,a=e.y,s=e.width,h=e.height,c=this._zoom,r=G.hitMaxArea,n=s*h*c*c;r<n&&(c*=Math.sqrt(r/n)),(s*=c)<2&&(s=2),(h*=c)<2&&(h=2),o*=c,a*=c;var l=Kr(s,h);pr(l,-o,-a),l.scale(c,c),this._drawForChecking=!0,this.drawData(l,t,e),this._drawForChecking=!1;try{for(var u=0,d=l.getImageData(0,0,s,h).data;u<d.length;u+=4)if(0!==d[u+3]){i=!0;break}l.restore()}catch(t){Yr=U,i=!1}}}}return!!i},rectContains:function(t,e){if(this._56I[t._id]){t=this._25I[t._id];if(t)return ws(e,t._79o())}return!1},reset:function(){this.setZoom(1),this.setTranslate(0,0)},handleKeyDown:function(t){var e,i,n,r,o,a;G.isInput(t.target)||(i=(o=(e=this)._focusData)&&e._25I[o._id],r=0,n=e._dataModel._datas,o&&o._enabled&&o._editable&&i&&i.onKeyDown&&!0===i.onKeyDown(t)||(9===t.keyCode&&(o&&(r=n.indexOf(o),gs(t)?-1==--r&&(r=0):++r===n.size()&&(r=0)),e._focusData=o=n.get(r),e.sm().setSelection(o)),Or(t)?e.selectAll():Hr(t)&&e.isResettable()&&e.reset(),e.sm().isEmpty()?e._editing||(n=e.tx(),a=e.ty(),r=!1,o=gs()?100:10,jr(t)&&(n-=o,r=!0),Nr(t)&&(a-=o,r=!0),Ur(t)&&(n+=o,r=!0),Gr(t)&&(a+=o,r=!0),r&&e.setTranslate(n,a)):(Br(t)&&e.handleDelete(t),a=gs()?10:1,jr(t)&&(e.moveSelection(-a,0),e.fi({kind:"moveLeft"})),Nr(t)&&(e.moveSelection(0,-a),e.fi({kind:"moveUp"})),Ur(t)&&(e.moveSelection(a,0),e.fi({kind:"moveRight"})),Gr(t)&&(e.moveSelection(0,a),e.fi({kind:"moveDown"})))))},handleScroll:function(t,e){if(qa(t),this.isZoomable()){if(!this.getEditInteractor()){var i=this.getDataAt(t);if(i){var n=Qa(this.getImage(i));if(n&&xh(n.scrollable,i,this))return}}t=this.lp(t);0<e?this.scrollZoomIn(t):e<0&&this.scrollZoomOut(t)}},handlePinch:function(t,e,i){this.isZoomable()&&(Math.abs(e-i)<G.pinchZoomThreshold||(i<e?this.pinchZoomIn(t):this.pinchZoomOut(t)))},checkDoubleClickOnNote:function(t,e){var i=this.lp(t),n=this.getDataUI(e),r=n.note2Info;return r&&e.s("note2.toggleable")&&xs(r.clickRect,i)?(e.s(Yt,!e.s(Yt)),this.fi({kind:"toggleNote2",event:t,data:e}),!0):!!((r=n.noteInfo)&&e.s("note.toggleable")&&xs(r.clickRect,i))&&(e.s(Qt,!e.s(Qt)),this.fi({kind:"toggleNote",event:t,data:e}),!0)},_84o:function(){},isNoteVisible:function(){return.15<this._zoom},isLabelVisible:function(){return.15<this._zoom},isEditVisible:function(){return.15<this._zoom},autoScroll:function(t,e){var i=this,n=i.getAutoScrollZone(),r=n/i.getZoom(),o=n/4,a=i._29I,s=i.lp(t),t={x:i.tx(),y:i.ty()};return s&&0<n&&a&&(s.x-a.x<r?i.translate(o,0):a.x+a.width-s.x<r&&i.translate(-o,0),s.y-a.y<r?i.translate(0,o):a.y+a.height-s.y<r&&i.translate(0,-o)),t.x=i.tx()-t.x,t.y=i.ty()-t.y,e&&(e.x+=t.x,e.y+=t.y),t},getMoveMode:function(t,e){e=e.s("2d.move.mode");return e||(Li[88]?"x":Li[89]?"y":"xy")},getSerializableProperties:function(){return{scrollBarColor:1,scrollBarSize:1,autoMakeVisible:1,autoHideScrollBar:1,editable:1,resettable:1,pannable:1,rectSelectable:1,autoScrollZone:1,visibleFunc:1,movableFunc:1,editableFunc:1,pointEditableFunc:1,rectEditableFunc:1,anchorEditableFunc:1,rotationEditableFunc:1,rectSelectBackground:1,rectSelectBorderColor:1,editPointSize:1,editPointBorderColor:1,editPointBackground:1,hoverDelay:1,dataModel:1,selectionModel:1,currentSubGraph:1,zoom:1,translateX:1,translateY:1}},serializeProperty:function(t,e,i){return"currentSubGraph"===e?{__i:t.getId()}:i.serializeProperty(t,e,this)},deserializeProperty:function(t,e,i){return"currentSubGraph"!==e?i.deserializeProperty(t,e,this):this.dm().__idMap[t.__i]},setDefaultCursor:function(t,e){this._defaultCursor=t,!1!==e&&this.setCursor(t)},setCursor:function(t){"default"===t&&(t=this._defaultCursor||t);var e=this.getView().style;e.cursor=t,e.cursor="-webkit-"+t,e.cursor="-moz-"+t},getCurrentConnectActionType:function(){return this._currentActionType},setCurrentConnectActionType:function(t){return!(t!==U&&!G.getConnectAction(null,t))&&(this._currentActionType=t,this.redraw(),!0)},getEditStyle:function(t){var e=this.getEditInteractor();return e?e.getStyle(t):H},setEditStyle:function(t,e,i){var n=this.getEditInteractor();return!!n&&(n.setStyle(t,e,i),!0)},isConnectActionVisible:function(t){var e=G.getConnectAction(this);if(!e)return!1;e=e.visible;return mn(e)&&(e=e(this,t)),e},isInteractive:function(t){if(this._drawForChecking)return!1;var e=Qa(this.getImage(t));return!(!e||!xh(e.interactive,t,this))||t.s("interactive")},appendHTML:function(t,e){var i=this.getView();if(!(e||t&&t.parentNode!==i))return!1;var n=t.getView&&t.getView();if(!e&&n&&n.parentNode===i)return!1;(t.getView||t.isSelfViewEvent)&&(t=t.getView());n=this.getEditInteractor();return n&&n._canvas?i.insertBefore(t,n._canvas):this.isScrollBarVisible()?i.insertBefore(t,this.getView().lastChild):or(i,t),!0},_layoutHTMLImpl:function(t,e,i){var n,r,o,a,s,h;1<arguments.length?(r=this._zoom,e.getView&&(e=(n=e).getView()),e.style.position="absolute",i?(a=t.getRect(),wr(n||e,this.tx()+a.x*r,this.ty()+a.y*r,a.width*r,a.height*r)):(o=new ra,a=t.getAnchorRect(),s=t.getPosition(),h=t.getScale(),i=e.style,wr(n||e,a),o.appendTranslate(this.tx(),this.ty()),o.appendScale(r,r),o.append(new ra(t.getRotation(),s.x,s.y,h.x,h.y)),ur(i,"transform","matrix("+o.a.toFixed(5)+", "+o.b.toFixed(5)+", "+o.c.toFixed(5)+",\n "+o.d.toFixed(5)+", "+o.tx.toFixed(5)+", "+o.ty.toFixed(5)+")"),ur(i,"transformOrigin",(-a.x).toFixed(5)+"px "+(-a.y).toFixed(5)+"px"),e.updateAppendMatrix=!0)):this._layoutHTML&&this._layoutHTML()},getTextEditInfo:function(t){return t instanceof vl?{name:"text",accessType:"s",isMultiline:!1}:void 0},getState:function(t){var e=t.s("state");if(e)return e;e=Qa(t._image);return e?xh(e.state,t,this)||null:void 0},getShape:function(t){return t.getStyle(Tt)}}),L.defineProperties(vc.GraphView.prototype,{layoutHTML:{get:function(){return this._layoutHTMLImplBind||(this._layoutHTMLImplBind=this._layoutHTMLImpl.bind(this)),this._layoutHTMLImplBind},set:function(t){this._layoutHTML=t}}}),zs(Il=function(t,e){this.gv=t,this.s=function(t){return e.getStyle(t)},this._data=e,this._87I=new Lh},L,{_6I:U,ms_icons:1,_84o:function(){},dispose:function(){},isShadowed:function(){return this.s("shadow")||this.gv.isSelected(this._data)&&"shadow"===this.s("select.type")},getSelectWidth:function(){return!this.gv.isSelected(this._data)||this.isShadowed()?0:this.gv.getSelectWidth(this._data)},getSelectColor:function(){return this.gv.getSelectColor(this._data)},getBodyColor:function(t){var e=this._data,i=this.gv.getBodyColor(e);return i||(t?e.getStyle(t):U)},_2Q:function(t){return this.s(t)},_1Q:function(t,e,i,n){var r,o=this.s,a=o("2d.gray"),s=o(e+".dash.color");a&&(s=G.toGrayColor(s)),t.strokeStyle=s,t.lineWidth=i,t.stroke(),o(e+".dash.3d")&&(r=o(e+".dash.3d.color"),ho(t,s,a?G.toGrayColor(r):r,i,this.gv._zoom,o(e+".dash.3d.accuracy"))),oh(t,n)},invalidate:function(){this._6I=U},_79o:function(){var t,e,i=this;return i._6I||(t=i._data,e=i.gv,i.labelInfo=i.label2Info=i.noteInfo=i.note2Info=i._38o=U,i._87I.clear(),i.interactiveInfo=e.isInteractive(t)?{}:U,i._3O(),i._55O=e.isEditable(t)?{_42O:e.isRectEditable(t),_43O:e.isPointEditable(t),_56O:e.isRotationEditable(t)}:U,i._6I=i._81o()),i._6I},_3O:function(){},getPosition:function(){return Ji},_68o:function(t,e){t&&this._87I.add(function(t,e){if(e){var i=new oa(e),n=t.width/2,e=t.height/2,i=ms([i.tf(-n,-e),i.tf(n,-e),i.tf(n,e),i.tf(-n,e)]);return i.x+=t.x+n,i.y+=t.y+e,i}return t}(t,e))},_81o:function(){var e,t,i,n,r=this,o=r.s;return r._24O(jt,"getLabel"),r._24O(Nt,"getLabel2"),r._26O(Ut,"getNote"),r._26O(Gt,"getNote2"),r._15O(),r._55O&&r._48O(),r._87I.each(function(t){e=bs(e,t)}),e&&(t=r.isShadowed(),i=o("shadow2"),n=is(e),i?(n.x+=o("shadow2.offset.x"),n.y+=o("shadow2.offset.y"),Is(n,o("shadow2.blur"))):t&&(n.x+=o("shadow.offset.x"),n.y+=o("shadow.offset.y"),Is(n,o("shadow.blur"))),e=bs(e,n)),r._87I.clear(),e},_42:function(t){var e,i,n,r,o,a,s,h=this,c=h._data,l=h.gv,u=h.s,d=u("opacity"),f=this.isShadowed(),g=u("shadow2");(f||g)&&(e=t.shadowOffsetX,i=t.shadowOffsetY,n=t.shadowBlur,r=t.shadowColor,o=l.getZoom(),a=f?"shadow":"shadow2",t.shadowOffsetX=u(a+".offset.x")*o,t.shadowOffsetY=u(a+".offset.y")*o,t.shadowBlur=u(a+".blur")*o,t.shadowColor=f?h.getSelectColor():u(a+".color")),d!=U&&(s=t.globalAlpha,t.globalAlpha=d),h._80o(t),l.isLabelVisible(c)&&(l._drawForChecking&&!u("label.selectable")||lc(t,h.labelInfo),l._drawForChecking&&!u("label2.selectable")||lc(t,h.label2Info)),l.isNoteVisible(c)&&(uc(t,h.noteInfo),uc(t,h.note2Info)),h._99O(t),d!=U&&(t.globalAlpha=s),(f||g)&&(t.shadowOffsetX=e,t.shadowOffsetY=i,t.shadowBlur=n,t.shadowColor=r)},_80o:function(){},_47O:function(){},_24O:function(t,e){var i,n,r,o=this._data,a=this.gv,s=this.s,h=a[e](o);h!=U&&(r=s(t+".scale"),i=s(t+".max"),n=s(t+".position"),o=this[t+"Info"]={label:h,scale:r,color:a[e+"Color"](o),font:s(t+".font"),opacity:s(t+".opacity"),align:s(t+".align"),rotation:this.getRotation(s(t+".rotation"),!1,n),background:a[e+"Background"](o)},h=ar(o,h),0<i&&i<h.width&&(o.labelWidth=h.width,h.width=i),1!==r&&(h.width*=r,h.height*=r),s=this.getPosition(n,s(t+".offset.x"),s(t+".offset.y"),h,s(t+".position.fixed")),h.x=s.x-h.width/2,h.y=s.y-h.height/2,this._68o(o.rect=h,o.rotation),1!==r&&(t=h.width/r,r=h.height/r,o.rect={x:s.x-t/2,y:s.y-r/2,width:t,height:r}))},_26O:function(t,e){var i,n,r,o,a=this.gv,s=this._data,h=this.s,c=a[e](s);c!=U&&(i=h(t+".scale"),o=this[t+"Info"]={note:c,scale:i,data:s,view:a,expanded:h(t+".expanded"),font:h(t+".font"),color:h(t+".color"),opacity:h(t+".opacity"),align:h(t+".align"),icon:h(t+".icon"),backgroundImage:h(t+".backgroundImage"),borderWidth:h(t+".border.width"),borderColor:h(t+".border.color"),background:a[e+"Background"](s)},e=(a=this.getPosition(h(t+".position"),h(t+".offset.x"),h(t+".offset.y"))).x,a=a.y,o.expanded?(r=h(t+".max"),(c=(n=h(t+".backgroundImage"))?(n=Qa(n),{width:mh(n,s),height:bh(n,s)}):ar(o,c)).width+=6,c.height+=2,0<r&&r<c.width&&(o.labelWidth=c.width,c.width=r),n=c.width,r=c.height+8,o.clickRect={x:e-n*i/2,y:a-r*i,width:n*i,height:r*i*c.height/r}):(r=(t=h(t+".icon"))?(t=Qa(t),n=mh(t,s),bh(t,s)):(n=12,18),o.clickRect={x:e-n*i/2,y:a-r*i,width:n*i,height:r*i}),o.rect={x:e-n/2,y:a-r*i/2-r/2,width:n,height:r},o=j(o.borderWidth/2)*i,this._68o({x:e-n*i/2-o,y:a-r*i-o,width:n*i+2*o,height:r*i+2*o}))},_48O:function(){},_99O:function(t){var e=this._38o;if(e){var i,n=this.gv,r=this._data,o=e.icons,a=this.interactiveInfo;for(i in a&&(a._38o={}),o){var s=o[i],h=e.rects[i];if(h){a&&(a._38o[i]=[]);var c,l=xh(s.opacity,r,n),u=xh(s.names,r,n),d=u?u.length:0,f=h.rotation;l!=U&&(c=t.globalAlpha,t.globalAlpha*=l);for(var g=0;g<d;g++){var p,_,v=u[g],y=Qa(v),v=h[g];f&&(p=v.x+v.width/2,_=v.y+v.height/2,t.save(),pr(t,p,_),_r(t,f),pr(t,-p,-_)),a&&a._38o[i].push(t.interactiveInfo={compInfos:[],matrix:f?new ra(f,p,_).appendTranslate(-p,-_):new ra}),Ka(t,y,xh(s.stretch,r,n),v.x,v.y,v.width,v.height,this._data,this.gv),t.interactiveInfo=U,f&&t.restore()}l!=U&&(t.globalAlpha=c)}}}}}),zs(iu=function(t,e){Bn(iu,this,[t,e])},Il,{_checkEmptyRect:!0,_40O:function(t,e){var i=this.s,n=t.rect;(t.borderColor=this.gv.getBorderColor(this._data))&&(t.borderType=i("border.type"),t.borderWidth=i("border.width"),t.borderPadding=i("border.padding"),e=N(e,t.borderPadding+t.borderWidth/2));var r=this._data.getScale(),o=N(1,N(X(r.x),X(r.y)));(t.selectWidth=this.getSelectWidth())&&(r=this.gv._zoom,t.selectType=i("select.type"),t._97o=this.getSelectColor(),t.selectPadding=i("select.padding"),e=N(e,(t.selectPadding+t.selectWidth/2/r)/o)),0<e&&(e*=o,n=is(n),Is(n,e)),this._68o(n)},_39O:function(t,e){var i,n,r,o,a,s=e.rect;0<e.borderWidth&&(a=e.borderPadding,t.strokeStyle=e.borderColor,t.lineWidth=e.borderWidth,uo(t,e.borderType,{x:s.x-a,y:s.y-a,width:s.width+2*a,height:s.height+2*a}),t.stroke()),0<e.selectWidth&&(r=this.gv._zoom,a=e.selectPadding,t.strokeStyle=e._97o,t.lineWidth=e.selectWidth/r,e.rotation!=U&&(t.save(),t.translate(e.position.x,e.position.y),t.rotate(e.rotation),i=(o=this._data).getWidth(),n=o.getHeight(),r=e.scale,o=e.anchor,s={x:r.x*-i*o.x,y:r.y*-n*o.y,width:r.x*i,height:r.y*n}),uo(t,e.selectType,{x:s.x-a,y:s.y-a,width:s.width+2*a,height:s.height+2*a}),e.rotation!=U&&t.restore(),t.stroke())},dispose:function(){var t=this._htmlView;iu.superClass._3O.call(this),t&&(t.onHTMLRemoved&&t.onHTMLRemoved(),As(t))},_3O:function(){var t=this,e=t.s,i=t._data,n=t.gv,r=n.getShape(i),o=t.getBodyColor(),a=e("shape.border.color"),a=t._83o=r?{shape:r,_53o:t.getBodyColor("shape.background"),_27Q:Qa(e("shape.repeat.image"),o),shapeGradientPack:e("shape.gradient.pack"),_54o:e("shape.border.width"),_55o:a,shapeBorderRepeatImage:Qa(e("shape.border.repeat.image"),a),_56o:e("shape.border.3d"),_57o:e("shape.border.3d.color"),_58o:e("shape.border.3d.accuracy"),shapeGradient:e("shape.gradient"),_59o:e("shape.gradient.color"),_60o:e("shape.border.pattern"),_61o:e("shape.border.cap"),_62o:e("shape.border.join"),shapeForeground:e("shape.foreground"),bodyColor:o,gray:e("2d.gray")}:{img:Qa(n.getImage(i),o),bodyColor:o,gray:e("2d.gray"),stretch:e("image.stretch")},o=a.img;o&&o.renderHTML?(t._htmlInfo&&t._htmlInfo.img!==o&&(t._htmlInfo=U),t._htmlInfo||(t._htmlInfo={img:o,cache:{}}),h=o.renderHTML(i,n,t._htmlInfo.cache)):t._htmlInfo=U,t._htmlView&&t._htmlView!==h&&(t._htmlView.onHTMLRemoved&&t._htmlView.onHTMLRemoved(),As(t._htmlView.getView?t._htmlView.getView():t._htmlView)),(t._htmlView=h)&&n.appendHTML(h)&&(h.onHTMLAddedSync&&h.onHTMLAddedSync(),h.onHTMLAdded&&$a(h.onHTMLAdded)),a.rect=i.getRect(),a.position=i.p(),a.scale=i.getScale(),a.anchor=i.getAnchor(),a.rotation=i.getRotation(),r===xt&&(a._63o=e("shape.depth"));var s,h=0;r?(h=eo(U,a._54o/2,a._62o),t.s("shape.dash")&&(h=N(h,(t.s("shape.dash.width")||a._54o)/2))):o&&o.boundExtend&&(h=xh(o.boundExtend,i,n),o.boundExtendAbsolute?(s=i.getScale(),h/=n._zoom*N(1,N(X(s.x),X(s.y)))):xh(o.fitSize,i,n)||(s=xh(o.width,i,n),n=xh(o.height,i,n),h*=N(i.getWidth()/s,i.getHeight()/n))),t._40O(a,h);h=e("clip.percentage");h<1&&(h<0&&(h=0),a.clipRect=Wn(i.getAnchorRect(),e("clip.direction"),h)),r&&((r=e("shape.fill.clip.percentage"))<1&&(r<0&&(r=0),a.shapeClipRect=Wn(i.getAnchorRect(),e("shape.fill.clip.direction"),r)),(r=e("shape.foreground.clip.percentage"))<1&&(r<0&&(r=0),a.shapeForegroundClipRect=Wn(i.getAnchorRect(),e("shape.foreground.clip.direction"),r)))},getPosition:function(t,e,i,n){n=Fo(t,this._83o.rect,n);return n.x+=e,n.y+=i,n},_80o:function(t){var e,i,n,r,o,a,s,h,c,l,u,d,f,g,p,_=this,v=_.s,y=_.gv,m=_._data,b=_._83o,x=b.rect,w=b.position,E=b.rotation,T=b.anchor,S=b.scale,I=b.shape,C=b.clipRect;(!_._checkEmptyRect||0<x.width&&0<x.height)&&((e=m.getSize()).x=-e.width*T.x,e.y=-e.height*T.y,t.save(),pr(t,w.x,w.y),_r(t,E),vr(t,S.x,S.y),C&&(t.beginPath(),t.rect(C.x,C.y,C.width,C.height),t.clip()),y._drawForChecking&&b.img&&!1===xh(b.img.pixelPerfect,m,y)?lo(t,e.x,e.y,e.width,e.height,"#888888"):_.freeDraw?_.freeDraw(t,e,b):I?(g=b._60o,f=rh(t,g),a=b._27Q,s=b._54o,h=b.shapeGradientPack,c=b.gray,x=t.lineJoin,p=t.lineCap,T=function(t){return c?G.toGrayColor(t):t},"roundRect"===I?i=v("shape.corner.radius"):"polygon"===I?i=v("shape.polygon.side"):"arc"===I&&(i=v("shape.arc.from"),n=v("shape.arc.to"),r=v("shape.arc.close"),o=v("shape.arc.oval")),t.lineJoin=b._62o,t.lineCap=b._61o,(C=T(b._53o))||a||h?((u=b.shapeClipRect)&&(t.save(),t.beginPath(),t.rect(u.x,u.y,u.width,u.height),t.clip()),uo(t,I,e,i,n,r,o),h?ro(t,h,function(t){return Jr(t,b.bodyColor)}):a?go(t,a,T(b.bodyColor),null,m,y):fo(t,C,b.shapeGradient,T(b._59o),e),t.fill(),h&&t.restore(),u&&t.restore(),t!==f&&uo(f,I,e,i,n,r,o)):uo(f,I,e,i,n,r,o),(u=b.shapeForeground)&&(t.save(),(l=b.shapeForegroundClipRect)&&(t.beginPath(),t.rect(l.x,l.y,l.width,l.height),t.clip()),uo(t,I,e,i,n,r,o),fo(t,u,v("shape.foreground.gradient"),T(v("shape.foreground.gradient.color")),e),t.fill(),t.restore()),0<s&&((l=v("shape.border.width.absolute"))&&(t.save(),t.setTransform(1,0,0,1,0,0)),t.lineWidth=s,u=T(b._55o),b.shapeBorderRepeatImage?po(t,b.shapeBorderRepeatImage,u,null,m,y):t.strokeStyle=u,t.stroke(),l&&t.restore(),b._56o&&ho(t,u,T(b._57o),s,y._zoom,b._58o)),oh(t,g),v("shape.dash")&&0<(d=v("shape.dash.width")||s)&&(g=v("shape.dash.pattern"),(f=rh(t,g,_._2Q("shape.dash.offset")))!==t&&uo(f,I,e,i,n,r,o),_._1Q(t,"shape",d,g)),xo(t,C,b._63o,e),t.lineJoin=x,t.lineCap=p):((p=_.interactiveInfo)&&(t.interactiveInfo=p.bodyInfo={compInfos:[],matrix:new ra(E,w.x,w.y,S.x,S.y)}),b.gray&&(t.compGray=!0),(S=b.img)&&S.cacheRule!=U&&(S=mc(0,S,b.stretch,e.width,e.height,m,y,b.bodyColor)),Ka(t,S,b.stretch,e.x,e.y,e.width,e.height,m,y,b.bodyColor),t.compGray=!1,t.interactiveInfo=U),t.restore()),_._39O(t,b)},_48O:function(){},_47O:function(){}}),Cl=function(t,e,i,n){var r=ys(t,e);return i=(n?q:dc)(i,r),r?i/=r:i=0,{x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i}},zs(tu=function(t,e){Bn(tu,this,[t,e])},Il,{_3O:function(){var t,e,i,n,r,o,a,s,h=this,c=h._data,l=h.gv,u=h.s,d=u(Jt),f=c.isLooped(),g=u("edge.width"),p=h.getBodyColor("edge.color"),_=u("edge.center"),v=u("edge.offset"),y=l.getBorderColor(c),m=y?u("border.width"):0,b=h.getSelectWidth(),x=c._40I,w=c._41I,E=h._78o=x&&w?{looped:f,type:d,width:g,center:_,color:p,repeatImage:Qa(u("edge.repeat.image"),p),borderColor:y,borderWidth:m,_97o:b?h.getSelectColor():U,selectWidth:b,pattern:u("edge.pattern"),cap:u("edge.cap"),join:u("edge.join"),is3d:u("edge.3d"),_67o:u("edge.3d.color"),_66o:u("edge.3d.accuracy"),gray:u("2d.gray")}:U;E&&((n=G.getEdgeType(d))?(r=n(c,pc(h,l,c,f,d),l,h._19Q)).points&&1<r.points.size()?(E.edgeTypeInfo=r,t=ms(E.edgeTypeInfo.points)):r[re]&&r.rect&&(t=(E.edgeTypeInfo=r).rect):(e=u("edge.source.anchor.x"),o=u("edge.source.anchor.y"),i=u("edge.target.anchor.x"),p=u("edge.target.anchor.y"),y=ac(l,c,"source"),s=ac(l,c,"target"),d===Vt?(r=(n=E.points=u(Kt)||Fh).size(),E.segments=u("edge.segments"),o=e!==H||o!==H||En(x),p=i!==H||p!==H||En(w),_||(v?(o||(y=Cl(y,r?n.get(0):s,v,r)),p||(s=Cl(s,r?n.get(r-1):y,v,r))):(o||(a=Nn(y,r?n.get(0):s,Gh(l,x)))&&(y={x:a[0],y:a[1]}),p||(a=Nn(r?n.get(r-1):y,s,Gh(l,w)))&&(s={x:a[0],y:a[1]}))),t=bs(ms(E.points),ms(y,s))):(d=pc(h,l,c,f,d),h._19Q||(d=-d),f?((y=is(y)).x=l.getNodeRect(x).x,E.radius=d,t={x:y.x-d,y:y.y-d,width:2*d,height:2*d}):(f=ys(y,s),x={x:l=dc(v,f),y:d},v={x:f-l,y:d},l=T(s.y-y.y,s.x-y.x),d=E.mat=new oa(l),E.orienAngle=l,E.angle=s.x<y.x?l+P:l,E.rect={x:x.x,y:x.y,width:v.x-x.x,height:0},E.origin=y,(x=d.tf(x)).x+=y.x,x.y+=y.y,(v=d.tf(v)).x+=y.x,v.y+=y.y,_?(f={x:f,y:0},(f=d.tf(f)).x+=y.x,f.y+=y.y,t=ms([y,x,v,f]),E.c1=y,E.c2=f):t=ms(x,v),y=x,s=v)),E.sourcePoint=y,E.targetPoint=s,c._lastSourcePoint=y,c._lastTargetPoint=s),s=0,u("edge.dash")&&(s=u("edge.dash.width")||g),u="square"===E.cap?.71:.5,eo(t,N(s*u,g*u+m+b),E.join),h._68o(t))},getRotation:function(t,e,i){t=t||0;var n=this._78o;if(n){var r=n.angle,o=n.points,a=n.edgeTypeInfo;if(r!=U)return e?n.orienAngle+t:r+t;if(a&&a[re])return a.getRotation?a.getRotation(this,t,e,i):0;if(a&&a.points){var a=a.points,s=a.size();return Wh[i]?s&&0==s%2?fc(a.get(s/2-1),a.get(s/2),e,t):t:Hh[i]?fc(a.get(0),a.get(1),e,t):fc(a.get(s-2),a.get(s-1),e,t)}if(o)return s=o.size(),Wh[i]?s&&0==s%2?fc(o.get(s/2-1),o.get(s/2),e,t):t:Hh[i]?fc(n.sourcePoint,s?o.get(0):n.targetPoint,e,t):fc(s?o.get(s-1):n.sourcePoint,n.targetPoint,e,t)}return t},getPosition:function(t,e,i,n,r){var o=this._78o;if(o){var a=o.type,s=o.points,h=o.edgeTypeInfo,c=o.sourcePoint,l=o.targetPoint;if(!a)return o.looped?{x:c.x-o.radius+e,y:c.y+i}:(r&&c&&l&&(c.x>l.x||c.x===l.x&&c.y>l.y)&&(t=Lo[t],i=-i),(u=Fo(t,o.rect,n)).x+=e,u.y+=i,(u=o.mat.tf(u)).x+=o.origin.x,u.y+=o.origin.y,u);if(h&&h[re])return h.getPosition?h.getPosition(this,t,e,i,n,r):{x:(c.x+l.x)/2,y:(c.y+l.y)/2};if(s){var u,d=s.size();if(Wh[t]){if(d){if(0===(f=d%2))return gc(s.get(d/2-1),s.get(d/2),t,e,i,n,r);u=s.get((d-f)/2)}else u={x:(c.x+l.x)/2,y:(c.y+l.y)/2};return(u=Fo(t,{x:u.x,y:u.y,width:0,height:0},n)).x+=e,u.y+=i,u}return Hh[t]?gc(c,d?s.get(0):l,t,e,i,n,r):gc(d?s.get(d-1):c,l,t,e,i,n,r)}if(h){var f,h=h.points,d=h.size();return Wh[t]?0===(f=d%2)?gc(h.get(d/2-1),h.get(d/2),t,e,i,n,r):(u=h.get((d-f)/2),(u=Fo(t,{x:u.x,y:u.y,width:0,height:0},n)).x+=e,u.y+=i,u):Hh[t]?gc(h.get(0),h.get(1),t,e,i,n,r):gc(h.get(d-2),h.get(d-1),t,e,i,n,r)}}return Ji},_42:function(t){this._78o&&tu.superClass._42.call(this,t)},drawPath:function(e,t){e.beginPath();var i,n,r,o,a=t.type,s=t.points,h=t.segments,c=t.edgeTypeInfo;!a||s?(i=(r=t.sourcePoint).x,n=r.y,r=(o=t.targetPoint).x,o=o.y,a?h?((a=new Lh({x:i,y:n})).addAll(s),a.add({x:r,y:o}),ao(e,a,h)):(e.moveTo(i,n),s.each(function(t){e.lineTo(t.x,t.y)}),e.lineTo(r,o)):t.looped?e.arc(i,n,t.radius,0,J,!0):t.center?(e.moveTo(t.c1.x,t.c1.y),e.lineTo(i,n),e.lineTo(r,o),e.lineTo(t.c2.x,t.c2.y)):(e.moveTo(i,n),e.lineTo(r,o))):c&&(c.points?ao(e,c.points,c.segments):c[re]&&c[re](e,c))},_80o:function(t){var e=this.s,i=this._78o,n=i.width,r=i.selectWidth,o=i.borderWidth,a=i.repeatImage,s=t.lineJoin,h=t.lineCap,c=i.gray,l=i.pattern;t.lineJoin=i.join,t.lineCap=i.cap,this.drawPath(rh(t,l),i);var u=e("edge.width.absolute");u&&(t.save(),t.setTransform(1,0,0,1,0,0)),r&&(t.strokeStyle=i._97o,t.lineWidth=n+2*(o+r),t.stroke()),o&&(t.strokeStyle=c?G.toGrayColor(i.borderColor):i.borderColor,t.lineWidth=n+2*o,t.stroke());var d,o=c?G.toGrayColor(i.color):i.color;a?po(t,a,o,null,this._data,this.gv):t.strokeStyle=o,t.lineWidth=n,t.stroke(),i.is3d&&(d=c?G.toGrayColor(i._67o):i._67o,ho(t,o,d,n,this.gv._zoom,i._66o)),oh(t,l),e("edge.dash")&&(l=e("edge.dash.pattern"),(d=rh(t,l,this._2Q("edge.dash.offset")))!==t&&this.drawPath(d,i),this._1Q(t,"edge",e("edge.dash.width")||n,l)),u&&t.restore(),t.lineJoin=s,t.lineCap=h},_48O:function(){},_47O:function(){}}),zs(Ml=function(t,e){Bn(Ml,this,[t,e])},iu,{_3O:function(){var e,i,t,n,r,o,a,s,h,c,l=this.s,u=this._data,d=this.gv;this._88I=U,u.isExpanded()&&u.eachChild(function(t){!wn(t)||(t=d.getBoundsForGroup(t))&&((i=i||[]).push(t),e=bs(e,t))}),e?(s=d.getLabel(u),a=l("group.type"),n=(t=l("group.border.width")||0)/2,l("group.border.width.absolute")&&(t/=d._zoom),e=_c(a,i,e),ic(e,u,"group.padding",1),Is(e,t),r=this._88I={type:a,rect:e,_64o:e},a||s==U||(o=this.labelInfo={label:s,color:l("group.title.color"),font:l("group.title.font"),align:l("group.title.align")},u=(h=ar(o,s)).width+t,a=h.height+t,s=l("group.title.align"),(h=l("group.title.orientation"))===ct||h===lt?(e.height+=t,u>e.width&&(e.width=u)):h!==st&&h!==ht||(e.width+=t,u>e.height&&(e.height=u)),s=s===st?e.x:s===ht?e.x+e.width-u:e.x+e.width/2-u/2,h===lt?(r.titleRect={x:e.x,y:e.y+e.height,width:e.width,height:a},r.rect={x:e.x,y:e.y,width:e.width,height:e.height+a},o.rect={x:s,y:e.y+e.height,width:u,height:a}):h===st?(c=r.titleRect={x:e.x-a,y:e.y,width:a,height:e.height},r.rect={x:e.x-a,y:e.y,width:e.width+a,height:e.height},o.rect={x:c.x+a/2-e.height/2,y:c.y+e.height/2-a/2,width:e.height,height:a},o.rotation=-Math.PI/2):h===ht?(c=r.titleRect={x:e.x+e.width,y:e.y,width:a,height:e.height},r.rect={x:e.x,y:e.y,width:e.width+a,height:e.height},o.rect={x:c.x+a/2-e.height/2,y:c.y+e.height/2-a/2,width:e.height,height:a},o.rotation=Math.PI/2):(r.titleRect={x:e.x,y:e.y-a,width:e.width,height:a},r.rect={x:e.x,y:e.y-a,width:e.width,height:e.height+a},o.rect={x:s,y:e.y-a-n,width:u,height:a+t})),this._40O(r,l("group.border.width")/2)):Ml.superClass._3O.call(this)},getPosition:function(t,e,i,n){var r=this._88I;if(r){n=Fo(t,r.rect,n);return n.x+=e,n.y+=i,n}return Ml.superClass.getPosition.apply(this,arguments)},_24O:function(t,e){var i=this._88I;i&&!i.type&&"label2"!==t||Ml.superClass._24O.call(this,t,e)},_80o:function(t){var e=this._88I;if(e){var i=this._data,n=this.s,r=this.gv,o=e.type,a=e.rect,s=e._64o,h=e.titleRect,c=this.getBodyColor(),l=Qa(n("group.image"),c),u=n("group.image.stretch"),d=this.getBodyColor("group.background"),f=Qa(n("group.repeat.image"),c),g=n("group.gradient.pack"),p=n("group.gradient"),_=n("group.gradient.color"),v=n("group.border.width"),y=n("group.border.color"),m=n("group.border.pattern"),b=n("group.title.orientation"),x=n("group.depth"),w=n("group.border.radius"),E=n("group.border.join"),T=n("group.border.cap");n("group.border.width.absolute")&&(v/=r._zoom);var S=y,I=n("group.border.repeat.image");if((I=I&&Qa(I,y))&&(S=_o(t,I,y,null,i,r)),o){var y=t.lineJoin,C=t.lineCap;t.lineJoin=E,t.lineCap=T,l?(t.save(),uo(t,o,a,w),t.clip(),Ka(t,l,u,a.x,a.y,a.width,a.height,i,r,c),t.restore(),0<v&&(M=rh(t,m),uo(M,o,a,w),t.lineWidth=v,t.strokeStyle=S,t.stroke(),oh(t,m))):(M=rh(t,m),d||f||g?(uo(t,o,a,w),g?ro(t,g,function(t){return Jr(t,c)}):f?go(t,f,c,null,i,r):fo(t,d,p,_,a),t.fill(),g&&t.restore(),t!==M&&uo(M,o,a,w)):uo(M,o,a,w),0<v&&(t.lineWidth=v,t.strokeStyle=S,t.stroke()),oh(t,m),o===xt&&xo(t,d,x,a)),t.lineJoin=y,t.lineCap=C}else{var M,C=n("group.title.background");if((!w||w<0)&&(w=0),l)Ka(t,l,u,s.x,s.y,s.width,s.height,i,r,this.getBodyColor());else if(d||f)if(f?go(t,f,c,null,i,r):fo(t,d,p,_,s),0===v)uo(t,xt,s),t.fill(),xo(t,d,x,s);else{switch(t.beginPath(),b){case lt:mo(t,s.x,s.y,s.width,s.height,w,w,0,0);break;case st:mo(t,s.x,s.y,s.width,s.height,0,w,0,w);break;case ht:mo(t,s.x,s.y,s.width,s.height,w,0,w,0);break;case ct:mo(t,s.x,s.y,s.width,s.height,0,0,w,w)}t.fill()}if(h&&C)if(0===v)lo(t,h.x,h.y,h.width,h.height,C),xo(t,C,x,h);else{switch(t.beginPath(),t.fillStyle=C,b){case lt:mo(t,h.x,h.y,h.width,h.height,0,0,w,w);break;case st:mo(t,h.x,h.y,h.width,h.height,w,0,w,0);break;case ht:mo(t,h.x,h.y,h.width,h.height,0,w,0,w);break;case ct:mo(t,h.x,h.y,h.width,h.height,w,w,0,0)}t.fill()}0<v&&(M=rh(t,m),uo(M,"roundRect",a,w),t.save(),t.lineWidth=v,t.strokeStyle=S,t.lineJoin=E,t.lineCap=T,t.closePath(),t.stroke(),h&&n("group.splitLine")&&(S=h.x,E=h.y,T=h.width,n=h.height,t.beginPath(),b===lt?(t.moveTo(S,E),t.lineTo(S+T,E)):b===st?(t.moveTo(S+T,E),t.lineTo(S+T,E+n)):b===ht?(t.moveTo(S,E),t.lineTo(S,E+n)):(t.moveTo(S,E+n),t.lineTo(S+T,E+n))),t.stroke(),t.restore(),oh(M,m))}this._39O(t,e)}else Ml.superClass._80o.call(this,t)}}),zs(Rl=function(t,e){Bn(Rl,this,[t,e])},iu,{_80o:function(t){this._39O(t,this._83o)}}),zs(au=function(t,e){Bn(au,this,[t,e])},iu,{_3O:function(){var t=this._data,e=this.s,i=this.gv,n=t.getPoints(),r=i.getBorderColor(t),o=r?e("border.width"):0,a=this.getSelectWidth(),s=e("shape.border.width"),h=t.getRect(),c=t.getAnchorRect(),l=i.getBodyColor(t),i=e("shape.border.color"),i=this._99o=n.isEmpty()?U:{rect:h,rotation:t.getRotation(),fillRule:e("shape.fill.rule"),scale:t.getScale(),position:t.p(),points:n,segments:t.getSegments(),bodyColor:l,borderColor:r,borderWidth:o,_94o:e("shape.border.3d"),_95o:e("shape.border.3d.color"),_96o:e("shape.border.3d.accuracy"),_97o:a?this.getSelectColor():U,selectWidth:a,_53o:e("shape.background"),_27Q:Qa(e("shape.repeat.image"),l),shapeGradientPack:e("shape.gradient.pack"),_54o:s,_55o:i,shapeBorderRepeatImage:Qa(e("shape.border.repeat.image"),i),shapeGradient:e("shape.gradient"),_59o:e("shape.gradient.color"),_60o:e("shape.border.pattern"),_61o:e("shape.border.cap"),_62o:e("shape.border.join"),shapeForeground:e("shape.foreground"),gray:e("2d.gray")};i&&(c.x+=i.position.x,c.y+=i.position.y,i.gradientRect=c,c=t.getScale(),c=N(1,N(X(c.x),X(c.y))),e("shape.dash")&&e("shape.dash.width")>s&&(s=e("shape.dash.width")),(a=e("shape.border.width.absolute")?(s+o+a)/this.gv._zoom/c:s*("square"===i._61o?.71:.5)+o+a/this.gv._zoom/c)&&(a*=c,h=is(h),eo(h,a,i._62o)),this._68o(h),(h=e("clip.percentage"))<1&&(h<0&&(h=0),i.clipRect=Wn(t.getAnchorRect(),e("clip.direction"),h)),(h=e("shape.fill.clip.percentage"))<1&&(h<0&&(h=0),i.shapeClipRect=Wn(t.getAnchorRect(),e("shape.fill.clip.direction"),h)),(h=e("shape.foreground.clip.percentage"))<1&&(h<0&&(h=0),i.shapeForegroundClipRect=Wn(t.getAnchorRect(),e("shape.foreground.clip.direction"),h)))},getPosition:function(t,e,i,n){var r=this._99o;if(r){n=Fo(t,r.rect,n);return n.x+=e,n.y+=i,n}return Ji},_42:function(t){this._99o&&au.superClass._42.call(this,t)},_80o:function(t){function e(t){return b?G.toGrayColor(t):t}var i,n=this,r=n.s,o=n._99o,a=o.position,s=o.scale,h=o.rotation,c=o.borderWidth,l=o.selectWidth/n.gv._zoom,u=o._27Q,d=o.shapeGradientPack,f=o._54o,g=o.clipRect,p=o.shapeClipRect,_=o.points,v=o.segments,y=n._data.isClosePath(),m=o.fillRule,b=o.gray,x=e(o._53o),w=x||u||d;t.save(),pr(t,a.x,a.y),_r(t,h),vr(t,s.x,s.y),g&&(t.beginPath(),t.rect(g.x,g.y,g.width,g.height),t.clip()),w&&p&&(t.save(),t.beginPath(),t.rect(p.x,p.y,p.width,p.height),t.clip()),pr(t,-a.x,-a.y);var E=o._60o,T=rh(t,E),h=t.lineJoin,s=t.lineCap;t.lineJoin=o._62o,t.lineCap=o._61o;g=e(o.bodyColor);w?(ao(t,_,v,y),d?ro(t,d,function(t){return Jr(t,o.bodyColor)}):u?go(t,u,g,null,n._data,n.gv):fo(t,i=g||x,o.shapeGradient,e(o._59o),o.gradientRect),t.fill(m),d&&t.restore(),p&&(t.restore(),pr(t,-a.x,-a.y)),T!==t&&ao(T,_,v,y)):ao(T,_,v,y);d=o.shapeForeground;d&&(t.save(),(p=o.shapeForegroundClipRect)&&(pr(t,a.x,a.y),t.beginPath(),t.rect(p.x,p.y,p.width,p.height),t.clip(),pr(t,-a.x,-a.y)),ao(t,_,v,y),fo(t,d,r("shape.foreground.gradient"),e(r("shape.foreground.gradient.color")),o.gradientRect),t.fill(m),t.restore());var S,m=r("shape.border.width.absolute");m&&(t.save(),t.setTransform(1,0,0,1,0,0)),l&&(t.strokeStyle=o._97o,t.lineWidth=f+2*(c+l),t.stroke()),c&&(t.strokeStyle=e(o.borderColor),t.lineWidth=f+2*c,t.stroke()),f&&(i=e(o._55o),o.shapeBorderRepeatImage?po(t,o.shapeBorderRepeatImage,i,null,n._data,n.gv):(!x&&g&&(i=g),t.strokeStyle=i),t.lineWidth=f,t.stroke(),o._94o&&ho(t,i,e(o._95o),f,n.gv._zoom,o._96o)),oh(t,E),r("shape.dash")&&0<(S=r("shape.dash.width")||f)&&(E=r("shape.dash.pattern"),(T=rh(t,E,n._2Q("shape.dash.offset")))!==t&&ao(T,_,v,y),n._1Q(t,"shape",S,E)),m&&t.restore(),t.lineJoin=h,t.lineCap=s,t.restore()},_48O:function(){},_47O:function(){}}),zs(Al=function(t,e){Bn(Al,this,[t,e])},au,{getRotation:function(t,e,i){t=t||0;var n=this._data.getPoints(),r=n.size();return 1<r?Wh[i]?r&&0==r%2?fc(n.get(r/2-1),n.get(r/2),e,t):t:Hh[i]?fc(n.get(0),n.get(1),e,t):fc(n.get(r-2),n.get(r-1),e,t):t},getPosition:function(t,e,i,n,r){var o=this._data.getPoints(),a=o.size();if(1<a){if(Wh[t]){var s=a%2;if(0==s)return gc(o.get(a/2-1),o.get(a/2),t,e,i,n,r);var h=o.get((a-s)/2),s={x:h.x,y:h.y,width:0,height:0};return(h=Fo(t,s,n)).x+=e,h.y+=i,h}return Hh[t]?gc(o.get(0),o.get(1),t,e,i,n,r):gc(o.get(a-2),o.get(a-1),t,e,i,n,r)}return Ji}}),zs(Pl=function(t,e){Bn(Pl,this,[t,e])},iu,{_3O:function(){Pl.superClass._3O.call(this);var t=this.s,e=this._83o;this._82o=e.img||e.shape?U:{background:this.getBodyColor("grid.background"),depth:t("grid.depth"),rect:e.rect,_88o:t("grid.cell.depth"),cellBorderColor:t("grid.cell.border.color"),_89o:t("grid.row.count"),_90o:t("grid.column.count"),block:t("grid.block"),_91o:t("grid.block.color"),_92o:t("grid.block.padding"),_93o:t("grid.block.width")}},_80o:function(t){var e=this._82o;if(e){var i,n,r=this._data,o=e.background,a=e.rect,s=e.block,h=e._91o,c=e._92o,l=e._93o,u=e._88o,d=e.cellBorderColor,f=e._89o,g=e._90o;if(o)if(lo(t,a.x,a.y,a.width,a.height,o),xo(t,o,e.depth,a),u)for(i=0;i<f;i++)for(n=0;n<g;n++)(a=r.getCellRect(i,n))&&xo(t,o,u,a);else if(d){for(t.beginPath(),i=0;i<f;i++)for(n=0;n<g;n++)(a=r.getCellRect(i,n))&&t.rect(a.x,a.y,a.width,a.height);t.strokeStyle=d,t.lineWidth=1,t.stroke()}if("h"===s)for(i=0;i<f;i++)a=bs(r.getCellRect(i,0),r.getCellRect(i,g-1)),Is(a,c),bo(t,h,a.x,a.y,a.width,a.height,l);else if("v"===s)for(n=0;n<g;n++)a=bs(r.getCellRect(0,n),r.getCellRect(f-1,n)),Is(a,c),bo(t,h,a.x,a.y,a.width,a.height,l);this._39O(t,this._83o)}else Pl.superClass._80o.call(this,t)}}),zs(Dl=function(t,e){Bn(Dl,this,[t,e])},iu,{_checkEmptyRect:!1,_81o:function(){var t,e,i,n,r,o,a,s,h,c=this._data,l=Dl.superClass._81o.call(this),u=c.s("text");return u!=U&&(a=c.s("text.font"),i=c.s("text.align"),n=c.s("text.vAlign"),r=(s=hs(a,u)).width,h=s.height,o=c.getAnchor(),a=c.getWidth(),u=c.getHeight(),"left"===i?t=-a*o.x:"center"===i?t=-a*o.x+(a-r)/2:"right"===i&&(t=a*(1-o.x)-s.width),"top"===n?e=-u*o.y:"middle"===n?e=-u*o.y+(u-h)/2:"bottom"===n&&(e=u*(1-o.y)-s.height),s=c.getMatrix(),h=ms([s.tf(t,e),s.tf(t+r,e),s.tf(t+r,e+h),s.tf(t,e+h)]),(l=bs(l,h))&&c.s("text.shadow")&&((h=is(l)).x+=c.s("text.shadow.offset.x"),h.y+=c.s("text.shadow.offset.y"),Is(h,c.s("text.shadow.blur")),l=bs(l,h))),l}}),ql=vc.Interactor=function(t){this.gv=this._graphView=t},du("Interactor",L,{ms_listener:1,getView:function(){return this.gv.getView()},setUp:function(){this.addListeners()},tearDown:function(){this.removeListeners(),this.clear()},clear:function(){},fi:function(t){this.gv.fi(t)},setCursor:function(t){et||this.gv.setCursor(t)},startDragging:function(t){this._lastClientPoint=_s(t),this._lastLogicalPoint=this.gv.lp(t),Rs(this,t)},clearDragging:function(){this._lastClientPoint=this._lastLogicalPoint=this._logicalPoint=U},autoScroll:function(t){return this.gv.autoScroll(t,this._lastClientPoint)}}),Ol=U,Bl=function(t){Ol.handleWindowTouchMove(t)},zl=function(t){Ol.handleWindowTouchEnd(t),p(C,ci,Bl),p(C,li,zl),Ol=U},Vl=function(t){Ol.handleWindowMouseMove(t)},Ll=function(t){Ol.handleWindowMouseUp(t),p(C,ai,Vl),p(C,si,Ll),Ol=U},zs(Fl=function(t){var e=this;e.gv=t,e._is2d=t instanceof vc.GraphView,e._eventListeners={},["mousedown","mousemove","mouseleave","touchstart","touchmove",fi,"wheel"].forEach(function(t){e.addListener(t)}),e.initImageResource()},ql,{enableVR:function(t){var e=this;!!e._vrEnable!==t&&((e._vrEnable=t)?e.gv.vr.mp(e.onVRControllerChange,e):(e.gv.vr.ump(e.onVRControllerChange,e),e._vrRayPolyline&&((t=e.gv.dm()).remove(e._vrRayPolyline),t.remove(e._vrRayHitPoint),e._vrRayPolyline=H,e._vrRayHitPoint=H)))},onVRControllerChange:function(t){var e=t.property,i=t.newValue,t=this.gv.vr.getController(i.id).getRay();t&&("gamepad.button.trigger"===e?"down"===i._62O?this.handle_mousedown(t):this.handleWindowMouseUp(t):"gamepad.pose"===e&&(this.handle_mousemove(t),this.handleWindowMouseMove(t)))},drawVRRay:function(t,e,i){var n,r,o,a,s,h=this.gv,c=this._vrRayPolyline,l=!1;c?n=this._vrRayHitPoint:(o=h.dm(),this._vrRayPolyline=c=new Gl.Polyline,this._vrRayHitPoint=n=new Gl.Node,n.s({shape3d:"billboard","shape3d.transparent":!0,"texture.scale":10,"shape3d.image":"coreInteractorRayHitImage"}),n.setAnchor3d(.5,.5,.499),r=.2/h.vr.measureOflength,n.s3(r,r,r),c.s("intersect",!1),n.s("intersect",!1),o.add(c),o.add(n),l=!0),e?(a=i.world,s=i.worldNormal,r=a.x,o=a.y,a=a.z,c.s("shape.border.color","red"),c.setPoints([{x:t.origin.x,y:t.origin.z,e:t.origin.y},{x:r,y:a,e:o}]),n.s("3d.visible",!0),n.p3(r,o,a),n.lookAtDirection([s.x,s.y,s.z],"front")):(c.s("shape.border.color","blue"),(s=new Gl.Math.Vector3).copy(t.direction).setLength(1e3/this.gv.vr.measureOflength).add(t.origin),c.setPoints([{x:t.origin.x,y:t.origin.z,e:t.origin.y},{x:s.x,y:s.z,e:s.y}]),n.s("3d.visible",!1)),h.fi({kind:"vrRayIntersect",ray:t,data:e,intersect:i,polyline:c,hitNode:n,begin:l})},setPreventEventDefault:function(t,e){var i=this._eventListeners[t];i?i._prevent=e:this._eventListeners[t]=i={_removal:H,_prevent:e}},removeListener:function(t){t=this._eventListeners[t];t&&t._removal&&(t._removal(),t._removal=H)},addListener:function(e){var t,i=this,n=i._eventListeners[e];n||(i._eventListeners[e]=n={_removal:H,_prevent:!0}),n&&n._removal||(t=function(t){n._prevent&&G.preventDefault(t),i.disabled||("wheel"===e?Pn(i,t):i["handle_"+e](t))},g(i.gv.getView(),e,t),n._removal=function(){p(i.gv.getView(),e,t)})},handleWindowTouchMove:function(t){this.handleWindowMouseMove(t)},handleWindowMouseMove:function(t){this.downInfo&&(this.isDragging?this.handleDownInfo("onDrag",t):(this.handleDownInfo("onBeginDrag",t),this.isDragging=!0))},handleWindowTouchEnd:function(t){this.handleWindowMouseUp(t)},handleWindowMouseUp:function(t){if(this.isDragging&&(this.handleDownInfo("onEndDrag",t),this.isDragging=!1),this.downInfo){var e=this.handle("onUp",t);if(e&&e.data===this.downInfo.data){this.handleMissingUp(t);var i=this,n=2===t.button?"onContextMenu":"onClick";if(!i._dbclickTimer)return void(i._dbclickTimer=w(function(){delete i._dbclickTimer,i.handleClick(t,n,e),this.downInfo=U},G.clickDelay));E(i._dbclickTimer),delete i._dbclickTimer,n="onDoubleClick",i.handleClick(t,n,e)}else this.handleDownInfo("onUp",t);this.downInfo=U}},handle_mouseleave:function(t){var e=this.gv,i=this.currentInfo?this.currentInfo.data:U;if(i){i.s("onLeave")&&i.s("onLeave")(t,i,e),this.fire("data","onLeave",t,i);i=this.currentInfo?this.currentInfo.hits:U;if(i)for(var n in i)this.handleLeave(t,n);this.currentInfo=U}},handle_mousewheel:function(t){t.scrollDelta=t.wheelDelta/40,this.handle("onScroll",t)},handle_DOMMouseScroll:function(t){t.scrollDelta=2===t.axis?-t.detail:0,this.handle("onScroll",t)},handle_touchstart:function(t){this.handle_mousedown(t)},handle_touchmove:function(t){this.handle("onMove",t)},handle_mousedown:function(t){var e,i;this.isDragging&&(this.handleDownInfo("onEndDrag",t),this.isDragging=!1),this.downInfo=this.handle("onDown",t),this.downInfo&&(i=t,(e=this)!==Ol&&(t=Tr(i),Ol?t?Ol.handleWindowTouchEnd(i):Ol.handleWindowMouseUp(i):t?(g(C,ci,Bl),g(C,li,zl)):(g(C,ai,Vl),g(C,si,Ll)),Ol=e))},handle_mousemove:function(t){var e=this,i=e.gv;e._hoverTimer&&(E(e._hoverTimer),delete e._hoverTimer);var n,r,o,a=e.handle("onMove",t),s=this.currentInfo?this.currentInfo.data:U,h=this.currentInfo?this.currentInfo.hits:U;if(a&&(r=a.data,o=a.hits,e._hoverTimer=w(function(){E(e._hoverTimer),delete e._hoverTimer,e.handle("onHover",t,a)},i.getHoverDelay()||G.hoverDelay)),r!==s){if(s&&(s.s("onLeave")&&s.s("onLeave")(t,s,i),this.fire("data","onLeave",t,s)),r&&(r.s("onEnter")&&r.s("onEnter")(t,r,i),this.fire("data","onEnter",t,r)),h)for(n in h)this.handleLeave(t,n);if(o)for(n in o){var c,l,u=o[n];(l=(c=r._interactPrefix=u.prefix)&&r.a(c+"onEnter")||u.target.onEnter)&&l.call(u.target,t,r,i,u.point,u.width,u.height),this.fire(u.type,"onEnter",u.event,u.data,u.image,u.comp,u.point,u),r._interactPrefix=null}}else{if(h)for(n in h)o&&o[n]||this.handleLeave(t,n);if(o)for(n in o)h&&h[n]||(u=o[n],(l=(c=r._interactPrefix=u.prefix)&&r.a(c+"onEnter")||u.target.onEnter)&&l.call(u.target,t,r,i,u.point,u.width,u.height),this.fire(u.type,"onEnter",u.event,u.data,u.image,u.comp,u.point,u),r._interactPrefix=null)}this.currentInfo=a},handle:function(t,e,i){var n,r,o,a,s=this.gv;if(this._is2d)return(i=i||s.getDataInfoAt(e))&&s.isInteractive(i.data)?((h=i.ui.interactiveInfo)&&((o=i.data).s(t)&&o.s(t)(e,o,s),this.fire("data",t,e,o),"body"===i.part&&h.bodyInfo?(n="body",i.hits=this.handleImage(n,s.getImage(o),t,e,o,i.point,h.bodyInfo)):"icons"!==i.part||!h._38o||(r=h._38o[i.name])&&r[i.index]&&(n="icons|"+i.name+"|"+i.index,i.hits=this.handleImage(n,i.icon,t,e,o,i.point,r[i.index]))),i):void 0;if(!i)if(e&&e instanceof Gl.Math.Ray){var h,c=s.vr.intersectWorld(e);if(o=c.data,a=c.intersect,this.drawVRRay(e,o,a),!o)return;if(!(h=(c=s.getData3dUI(o)).interactiveInfo))return;i={data:o,part:a.part,ui:c}}else{if(!(i=s.getDataInfoAt(e)))return;i=i&&{data:i.data,part:i.part}}if(s.isInteractive(i.data)){if(!a){o=i.data;c=s.getData3dUI(o);if(!(h=(i.ui=c).interactiveInfo))return i;if(!(a=s.intersectObject(e,o)))return}o.s(t)&&o.s(t)(e,o,s),this.fire("data",t,e,o);var l,s=a.part;return"body"!==s&&(l=o.s(s+".image")||o.s("shape3d."+s+".image")),(l=l||(o.s("all.image")||o.s("shape3d.image")))&&((h="object"==typeof l?h[l.uuid]:h[l])&&h.bodyInfo&&(i.part="body",i.interactiveInfo=h,i.point=this._convertUVToPoint(a.uv,h),i.image=l,i.hits=this.handleImage("body",l,t,e,o,i.point,h.bodyInfo))),i}},_handleLeaveOrMissing:function(t,e,i){var n,r,o,a,s,h="leave"===t?this.currentInfo:this.downInfo;!h||(n=h.interactiveInfo||h.ui.interactiveInfo)&&(o=h.data,this._is2d?(a=this.gv.lp(e),"body"===h.part&&n.bodyInfo?(r="body","leave"===t?this.handleLeaveImage(i,r,this.gv.getImage(o),e,o,a,n.bodyInfo):this.handleMissingUpImage(r,this.gv.getImage(o),e,o,a,n.bodyInfo)):"icons"!==h.part||!n._38o||(s=n._38o[h.name])&&s[h.index]&&(r="icons|"+h.name+"|"+h.index,"leave"===t?this.handleLeaveImage(i,r,h.icon,e,o,a,s[h.index]):this.handleMissingUpImage(r,h.icon,e,o,a,s[h.index]))):n.bodyInfo&&(a=(s=this.gv.intersectObject(e,o))&&s.uv?this._convertUVToPoint(s.uv,n):{x:1/0,y:1/0},"leave"===t?this.handleLeaveImage(i,"body",h.image,e,o,a,n.bodyInfo):this.handleMissingUpImage("body",h.image,e,o,a,n.bodyInfo)))},handleClick:function(t,e,i){var n,r,o,a,s=this.downInfo;s&&i&&(n=i.interactiveInfo||i.ui.interactiveInfo,r=i.data,a=this.gv,r.s(e)&&r.s(e)(t,r,a),this.fire("data",e,t,r),n&&(this._is2d?s.part===i.part&&(o=a.lp(t),"body"===i.part&&n.bodyInfo&&this.handleClickImage("body",a.getImage(r),e,t,r,o,n.bodyInfo,i)):!n.bodyInfo||(a=a.intersectObject(t,r))&&(o=this._convertUVToPoint(a.uv,n),this.handleClickImage("body",s.image,e,t,r,o,n.bodyInfo,i))))},handleDownInfo:function(t,e){var i,n,r,o,a,s,h;this.downInfo&&(i=this.downInfo,h=this.gv,(n=i.interactiveInfo||i.ui.interactiveInfo)&&((o=i.data).s(t)&&o.s(t)(e,o,h),this.fire("data",t,e,o),this._is2d?(a=h.lp(e),"body"===i.part&&n.bodyInfo?(r="body",this.handleDownInfoImage(r,h.getImage(o),t,e,o,a,n.bodyInfo)):"icons"!==i.part||!n._38o||(s=n._38o[i.name])&&s[i.index]&&(r="icons|"+i.name+"|"+i.index,this.handleDownInfoImage(r,i.icon,t,e,o,a,s[i.index]))):!n.bodyInfo||(h=h.intersectObject(e,o))&&(a=this._convertUVToPoint(h.uv,n),this.handleDownInfoImage("body",i.image,t,e,o,a,n.bodyInfo))))},fire:function(t,e,i,n,r,o,a,s){this.gv.fi({kind:e,type:t,event:i,data:n,image:r,comp:o,view:this.gv,point:a,width:s?s.width:H,height:s?s.height:H})},handleImage:function(t,e,i,n,r,o,a){var s={};if(e=e&&Qa(e)){var h=this.gv,c=a.rect;(g=this.convertPoint(o,a)).inRect&&(e[i]&&e[i](n,r,h,g,c.width,c.height),this.fire("image",i,n,r,e,H,g,c),s[t+"|image"]={target:e,type:"image",image:e,data:r,event:n,point:g,width:c.width,height:c.height});for(var l,u=a.compInfos,d=e,f=u.length-1;0<=f;f--){var g,p=u[f],_=p.comp;if((g=this.convertPoint(o,p,d,_,h,r)).inRect){c=p.rect;var v=r._interactPrefix=p.prefix,p=v&&r.a(v+i)||_[i];if(p&&(l=p.call(_,n,r,h,g,c.width,c.height)),this.fire("comp",i,n,r,e,_,g,c),!0!==l&&(e=c.image)&&(e[i]&&(l=e[i](n,r,h,g,c.width,c.height)),this.fire("image",i,n,r,e,H,g,c)),r._interactPrefix=null,s[t+"|"+f]={target:_,type:"comp",comp:_,image:e,data:r,event:n,point:g,width:c.width,height:c.height,prefix:v},e&&(s[t+"|"+f+"|image"]={target:e,type:"image",image:e,data:r,event:n,point:g,width:c.width,height:c.height,prefix:v}),!0===l)break}}}return s},handleLeave:function(t,e){return this._handleLeaveOrMissing("leave",t,e)},handleMissingUp:function(t){return this._handleLeaveOrMissing("missing",t)},handleLeaveImage:function(t,e,i,n,r,o,a){if(i=i&&Qa(i)){var s=this.gv,h=a.rect,c=this.convertPoint(o,a);t===e+"|image"&&(i.onLeave&&i.onLeave(n,r,s,c,h.width,h.height),this.fire("image","onLeave",n,r,i,H,c,h));for(var l,u=a.compInfos,d=i,f=u.length-1;0<=f;f--){var g=u[f],p=g.comp,c=this.convertPoint(o,g,d,p,s,r),h=g.rect,g=r._interactPrefix=g.prefix;if(t===e+"|"+f&&((g=g&&r.a(g+"onLeave")||p.onLeave)&&(l=g.call(p,n,r,s,c,h.width,h.height)),this.fire("comp","onLeave",n,r,i,p,c,h)),!0!==l&&(i=h.image)&&t===e+"|"+f+"|image"&&(i.onLeave&&(l=i.onLeave(n,r,s,c,h.width,h.height)),this.fire("image","onLeave",n,r,i,H,c,h)),!(r._interactPrefix=null)===l)break}}},handleMissingUpImage:function(t,e,i,n,r,o){var a="onUp",s=this.downInfo.hits;if(s&&e&&(e=Qa(e))){var h=this.gv,c=o.rect;!(g=this.convertPoint(r,o)).inRect&&s[t+"|image"]&&(e.onUp&&e.onUp(i,n,h,g,c.width,c.height),this.fire("image",a,i,n,e,H,g,c));for(var l,u=o.compInfos,d=e,f=u.length-1;0<=f;f--){var g,p=u[f],_=p.comp;if(!(g=this.convertPoint(r,p,d,_,h,n)).inRect){c=p.rect;p=n._interactPrefix=p.prefix;if(s[t+"|"+f]&&((p=p&&n.a(p+a)||_.onUp)&&(l=p.call(_,i,n,h,g,c.width,c.height)),this.fire("comp",a,i,n,e,_,g,c)),!0!==l&&(e=c.image)&&s[t+"|"+f+"|image"]&&(e.onUp&&(l=e.onUp(i,n,h,g,c.width,c.height)),this.fire("image",a,i,n,e,H,g,c)),!(n._interactPrefix=null)===l)break}}}},handleDownInfoImage:function(t,e,i,n,r,o,a){var s=this.downInfo.hits;if(s&&e&&(e=Qa(e))){var h=this.gv,c=a.rect,l=this.convertPoint(o,a);s[t+"|image"]&&(e[i]&&e[i](n,r,h,l,c.width,c.height),this.fire("image",i,n,r,e,H,l,c));for(var u,d=a.compInfos,f=e,g=d.length-1;0<=g;g--){var p=d[g],_=p.comp,l=this.convertPoint(o,p,f,_,h,r),c=p.rect,p=r._interactPrefix=p.prefix;if(s[t+"|"+g]&&((p=p&&r.a(p+i)||_[i])&&(u=p.call(_,n,r,h,l,c.width,c.height)),this.fire("comp",i,n,r,e,_,l,c)),!0!==u&&(e=c.image)&&s[t+"|"+g+"|image"]&&(e[i]&&(u=e[i](n,r,h,l,c.width,c.height)),this.fire("image",i,n,r,e,H,l,c)),!(r._interactPrefix=null)===u)break}}},handleClickImage:function(t,e,i,n,r,o,a,s){var h=this.downInfo.hits,c=s.hits;if(h&&e&&(e=Qa(e))){var l=this.gv,u=a.rect,d=this.convertPoint(o,a);h[t+"|image"]&&(e[i]&&e[i](n,r,l,d,u.width,u.height),this.fire("image",i,n,r,e,H,d,u));for(var f,g=a.compInfos,p=e,_=g.length-1;0<=_;_--){var v=g[_],y=v.comp,d=this.convertPoint(o,v,p,y,l,r),u=v.rect,v=r._interactPrefix=v.prefix;if(h[t+"|"+_]&&c[t+"|"+_]&&((v=v&&r.a(v+i)||y[i])&&(f=v.call(y,n,r,l,d,u.width,u.height)),this.fire("comp",i,n,r,e,y,d,u)),!0!==f&&(e=u.image)&&h[t+"|"+_+"|image"]&&(e[i]&&(f=e[i](n,r,l,d,u.width,u.height)),this.fire("image",i,n,r,e,H,d,u)),!(r._interactPrefix=null)===f)break}}},initImageResource:function(){G.setImage("coreInteractorRayHitImage",{width:16,height:16,comps:[{type:"oval",background:"rgb(255,0,0)",borderWidth:1,borderColor:"rgb(250,120,120)",opacity:.3,rotation:-1.593,rect:[.73315,.6933,14.5337,14.61341]},{type:"oval",background:"rgb(255,0,0)",borderWidth:1,borderColor:"rgb(250,120,120)",rotation:-1.593,rect:[3.56695,3.75073,8.8661,8.49856]}]})},_convertUVToPoint:function(t,e){if(!t)return{x:1/0,y:1/0};var i=e.bodyInfo.rect,e=t.clone(),i=t.multiply({x:i.width,y:i.height});return i.local=e,i},convertPoint:function(t,e,i,n,r,o){var a=e.rect,s=e.matrix.applyInverse(t).sub(a);if(!(0<=s.x&&0<=s.y&&s.x<=a.width&&s.y<=a.height))return s;if(n&&xh(n.pixelPerfect,o,r)){var h=1,c=!1,l=(a=this._is2d?(h=r.getZoom(),dn(t.x,t.y,H,h)):dn(t.x,t.y)).x,u=a.y,d=a.width,f=a.height,t=G.hitMaxArea,a=d*f*h*h;t<a&&(h*=Math.sqrt(t/a)),(d*=h)<2&&(d=2),(f*=h)<2&&(f=2),l*=h,u*=h;var g=Kr(d,f),h=new ra(0,-l,-u,h,h);h.append(e.matrix),r._drawForChecking=!0,n.transform=h,e.refRect&&e.refRect.fitSize&&(n.refRect=e.refRect);e=i.comps;i.comps=[n],wh(g,i,0,0,d,f,o,self),i.comps=e,delete n.refRect,delete n.transform,r._drawForChecking=!1;try{for(var p=0,_=g.getImageData(0,0,d,f).data;p<_.length;p+=4)if(0!==_[p+3]){c=!0;break}g.restore()}catch(t){Yr=U,c=!1}s.inRect=c}else s.inRect=!0;return s}}),hu=vc.DefaultInteractor=function(t){Bn(hu,this,[t])},du("DefaultInteractor",ql,{handle_mousedown:function(t){qa(t);var e,i=this.gv,n=i.getDataAt(t);!i.setFocus(t)||i._editing||i._scrolling||(fs(t)?i.handleDoubleClick(t,n):i.handleClick(t,n),e=ls(t),!Hr()&&!e&&n&&(i.isMovable(n)||i._39Q(n))||!i.isPannable()||!cs(t)&&!e||ps(t)||(this._tx=i.tx(),this._ty=i.ty(),this.startDragging(t)))},handleWindowMouseUp:function(t){var e=this.gv;e._panning&&(delete e._panning,e.onPanEnded(),this.fi({kind:"endPan",event:t})),delete this._tx,delete this._ty,this.clearDragging()},handle_mousemove:function(t){var e=this,i=e.gv;e._hoverTimer&&(E(e._hoverTimer),delete e._hoverTimer),e._hoverTimer=w(function(){e.fi({kind:"hover",event:t}),E(e._hoverTimer),delete e._hoverTimer},i.getHoverDelay()||G.hoverDelay)},handle_touchmove:function(t){this.handle_mousemove(t)},handleWindowMouseMove:function(t){var e=this.gv;this.fi({kind:e._panning?"betweenPan":"beginPan",event:t}),e._panning=1;t=cc(e,t,this._lastClientPoint);e.setTranslate(this._tx+t.x,this._ty+t.y)},handle_mousewheel:function(t){this.gv.handleScroll(t,t.wheelDelta)},handle_DOMMouseScroll:function(t){2===t.axis&&this.gv.handleScroll(t,-t.detail)},handle_keydown:function(t){this.gv.handleKeyDown(t)}}),kl=vc.SelectInteractor=function(t){Bn(kl,this,[t])},du("SelectInteractor",ql,{_42:function(){var t=this.gv,e=t.getZoom(),i=this.mark,n=this.div;n||(n=this.div=tr(),or(this.getView(),n));var r={};r.x=i.x*e+t.tx(),r.y=i.y*e+t.ty(),r.width=i.width*e,r.height=i.height*e,wr(n,r),this.intersects()?(n.style.border="",n.style.background=t.getRectSelectBackground()):(n.style.background="",n.style.border="1px solid "+t.getRectSelectBorderColor())},handle_mousedown:function(t){var e,i,n=this.gv;this._57I=U,this.pendingClickThrough=U,n._editing||n._scrolling||Hr()||ls(t)||(e=n.getDataAt(t),i=n.sm(),e?ps(t)?i.co(e)?i.rs(e):i.as(e):i.co(e)?e instanceof _l&&e.isClickThroughEnabled()&&cs(t)&&(this.pendingClickThrough=_s(t)):i.ss(e):ps(t)||!n.isPannable()?cs(t)&&(ps(t)||i.cs(),n.isRectSelectable()&&(this.startDragging(t),n._77O=1)):cs(t)&&(this._57I=_s(t)))},handle_mouseup:function(t){var e,i=this.gv,n=this._57I;n&&(ys(n,_s(t))<=1&&i.sm().cs(),this._57I=U),this.pendingClickThrough&&(ys(this.pendingClickThrough,_s(t))<=1&&((e=i.getDataAt(t))instanceof _l&&e.isClickThroughEnabled()&&((n=i.getDataAt(t,function(t){return t.getParent()===e&&i.isSelectable(t,!0)}))&&(t.clickThrough=!0,i.sm().ss(n)))),this.pendingClickThrough=U)},handleWindowMouseUp:function(t){this.clear(t)},handleWindowMouseMove:function(t){var e=this,i=e.gv;e._logicalPoint=i.lp(t),e.mark?(e.fi({kind:"betweenRectSelect",event:t}),i.isPannable()&&e.autoScroll(t),e.redraw()):e.fi({kind:"beginRectSelect",event:t}),e.mark=ms(e._lastLogicalPoint,e._logicalPoint),e.redraw()},intersects:function(){var t=this._lastLogicalPoint,e=this._logicalPoint;return t.x>e.x||t.y>e.y},clear:function(t){var e,i,n=this,r=n.gv,o=n.mark;n._57I=U,n.pendingClickThrough=U,n._lastLogicalPoint&&(o&&(0!==o.width&&0!==o.height&&((o=r.getDatasInRect(o,n.intersects())).isEmpty()||(e=r.sm(),i=e.toSelection(),o.each(function(t){e.co(t)?i.remove(t):i.add(t)}),e.ss(i))),As(n.div),delete n.div,delete n.mark,n.redraw(),n.fi({kind:"endRectSelect",event:t}),r.onRectSelectEnded()),n.clearDragging(),delete r._77O)},redraw:function(){var t=this;t._draw||(t._draw=1,w(function(){t.mark&&t._42(),delete t._draw},16))}}),lu=vc.MoveInteractor=function(t){Bn(lu,this,[t])},du("MoveInteractor",ql,{handle_mousedown:function(t){var e,i=this.gv;!cs(t)||i._editing||i._scrolling||Hr()||(!(e=i.getSelectedDataAt(t))||i._39Q(e)&&!i.isMovable(e)?i._focusData=U:(this._data=e,i.handleMouseDown&&i.handleMouseDown(t,e),this.startDragging(t),i.isMovable(e)&&(i._moving=1)))},handleWindowMouseUp:function(t){var e=this.gv;e.handleMouseUp&&e.handleMouseUp(t,this._data),this.clear(t)},handleWindowMouseMove:function(t){var e,i,n,r,o=this,a=o._data,s=o.gv;s._93O&&s._93O(t,a)||!s._moving||(o._logicalPoint||o.fi({kind:"prepareMove",event:t}),e={kind:n=o._logicalPoint?"betweenMove":"beginMove",event:t},i=o._logicalPoint=s.lp(t),"beginMove"!=n||o._alreadyBeginTransaction||(o._alreadyBeginTransaction=!0,s.getDataModel().beginTransaction()),n=(r=o._calcShift(n,t)).x,r=r.y,(a=o.gv.getMoveMode(t,a))&&("x"===a?r=0:"y"===a?n=0:"xy"!==a&&(n=r=0)),s.moveSelection(n,r),o._lastLogicalPoint=i,o.autoScroll(t),o.fi(e))},_calcShift:function(){var t=this._logicalPoint,e=this._lastLogicalPoint;return{x:t.x-e.x,y:t.y-e.y}},clear:function(t){var e=this.gv;this._lastLogicalPoint&&(this._lastLogicalPoint=this._data=e._moving=U,this._logicalPoint&&(this.fi({kind:"endMove",event:t}),e.onMoveEnded()),this.clearDragging()),this._alreadyBeginTransaction&&(this._alreadyBeginTransaction=!1,e.getDataModel().endTransaction())}}),jl=vc.TextEditInteractor=function(t){Bn(jl,this,[t]),this.init()},du("TextEditInteractor",ql,{init:function(){var i=this,t=this.input=d.createElement("input"),e=t.style;t.text="text",e.border="1px solid #d8d8d8",e.position="absolute",e.padding="2px 3px",e.outline="none",e.marginLeft="-90px",e.marginTop="-16px",e.backgroundColor="rgba(255,255,255, 0.9)",e.fontSize="14px",e.width="180px",e.height="32px",e.boxShadow="0 0 13px rgba(16,142,233, 0.5)",e.textAlign="center",e.boxSizing="border-box",g(t,"keyup",function(t){Wr(t)&&i.endTextEdit()}),g(t,"focus",function(){t.select()});var n=this.textarea=d.createElement("textarea"),r=this.wrap=d.createElement("div");r.appendChild(n),(e=n.style).margin=0,e.padding="4px",e.overflow="hidden",e.boxSizing="border-box",e.position="absolute",e.outline="none",e.backgroundColor="transparent",e.resize="none",e.textAlign="center",e.fontSize="14px",e.border="none",e.borderWidth=0,e.width="100%",e.top="50%",(e=r.style).boxSizing="border-box",e.margin=0,e.padding=0,e.position="absolute",e.boxShadow="0 0 13px rgba(16,142,233, 0.5)",e.border="1px solid #d8d8d8",e.backgroundColor="rgba(255,255,255, 0.9)",e.width="180px",e.marginLeft="-90px",g(n,"keydown",function(t){return(gs()||ps())&&Wr(t)?void i.endTextEdit():void i.calculateTextareaHeight(String.fromCharCode(t.keyCode))}),g(n,"focus",function(){n.select()});e=function(t){t.stopPropagation()};g(t,"mousedown",e),g(t,"touchstart",e),g(n,"mousedown",e),g(n,"touchstart",e),i.SIZING_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"],i.HIDDEN_TEXTAREA_STYLE="visibility:hidden; min-height:0 !important;max-height:none !important;height:0 !important;visibility:hidden !important;overflow:hidden !important;position:absolute !important;z-index:-1000 !important;top:0 !important;right:0 !important",i.handleWindowClick=function(t){var e=i._editingDOM;e&&(e=e.getBoundingClientRect(),t=_s(t),xs(e,t)||i.endTextEdit())}},handle_mousedown:function(t){var e,i=this.gv;fs(t)&&!i._editing&&(!(e=i.getDataAt(t))||(t=i.getTextEditInfo(e))&&(this._editInfo=t,this._editTarget=e,i._editing=!0,t.isMultiline?this.handleMultilineEdit():this.handleTextEdit()))},handleMultilineEdit:function(){var t=this,e=t.gv,i=t._editTarget,n=t.getTargetValue(),r=t.textarea,o=t.wrap;this.hiddenTextarea||this.createHiddenTextarea(),null!==n&&n!==H||(n=""),r.value=n,t._editingDOM=r,e.getView().appendChild(o),this.layoutHTML(o,i),this.calculateTextareaHeight(),w(function(){r.focus(),g(C,"mousedown",t.handleWindowClick),g(C,"touchstart",t.handleWindowClick)},10)},handleTextEdit:function(){var t=this,e=t.gv,i=t._editTarget,n=t.getTargetValue(),r=t.input;null!==n&&n!==H||(n=""),r.value=n,t._editingDOM=r,e.getView().appendChild(r),this.layoutHTML(r,i),w(function(){r.focus(),g(C,"mousedown",t.handleWindowClick),g(C,"touchstart",t.handleWindowClick)},10)},layoutHTML:function(t,e){var i,n=this.gv,r=n.getZoom();e instanceof Gl.Node?(i=e.getRect(),t.style.left=(i.x+i.width/2)*r+n.tx()+"px",t.style.top=(i.y+i.height/2)*r+n.ty()+"px"):e instanceof Gl.Edge&&(i=n.getDataUI(e)._6I,t.style.left=(i.x+i.width/2)*r+n.tx()+"px",t.style.top=(i.y+i.height/2)*r+n.ty()+"px")},endTextEdit:function(){var t=this,e=t._editInfo.isMultiline?t.wrap:t.input,i=t._editInfo.isMultiline?t.textarea:t.input;t.setTargetValue(i.value),t.gv.getView().removeChild(e),t.gv._editing=!1,delete t._editingDOM,p(C,"mousedown",t.handlelick),p(C,"touchstart",t.handleWindowClick)},setTargetValue:function(t){var e=this._editTarget,i=this._editInfo,n=i.accessType,i=i.name;i&&n||(n="p",i="name"),"p"===n?e[Gl.Default.setter(i)](t):"a"===n?e.a(i,t):e.s(i,t)},getTargetValue:function(){var t=this._editTarget,e=this._editInfo,i=e.accessType,e=e.name;return e&&i||(i="p",e="name"),"p"!==i?"a"===i?t.a(e):t.s(e):t[Gl.Default.getter(e)]()},createHiddenTextarea:function(){this.hiddenTextarea=d.createElement("textarea"),this.hiddenTextarea.setAttribute("style","margin:0; padding:0; position:absolute; overflowY:scroll; resize:none; box-sizing:border-box;"),this.hiddenTextarea.setAttribute("rows","1"),this.gv.getView().appendChild(this.hiddenTextarea)},calculateHTMLStyle:function(t,e){if(e&&this.computedStyleCache)return this.computedStyleCache;var i=C.getComputedStyle(t),n=i.getPropertyValue("box-sizing")||i.getPropertyValue("-moz-box-sizing")||i.getPropertyValue("-webkit-box-sizing"),r=parseFloat(i.getPropertyValue("padding-bottom"))+parseFloat(i.getPropertyValue("padding-top")),t=parseFloat(i.getPropertyValue("border-bottom-width"))+parseFloat(i.getPropertyValue("border-top-width")),n={sizingStyle:this.SIZING_STYLE.map(function(t){return t+":"+i.getPropertyValue(t)}).join(";"),paddingSize:r,borderSize:t,boxSizing:n};return e&&(this.computedStyleCache=n),n},calculateTextareaHeight:function(t){t=t||"";var e=this.textarea,i=this.hiddenTextarea,n=this.wrap,r=this.calculateHTMLStyle(e,!1),o=r.paddingSize,a=r.borderSize,s=r.boxSizing,r=r.sizingStyle;i.setAttribute("style",r+";"+this.HIDDEN_TEXTAREA_STYLE),i.value=e.value+t;i=i.scrollHeight;"border-box"===s?i+=a:"content-box"===s&&(i-=o),e.style.height=i+"px",e.style.marginTop=0-.5*i+"px",n.style.height=Math.max(i,32)+"px",n.style.marginTop=-.5*i+"px"}}),Nl=vc.ScrollBarInteractor=function(t){Bn(Nl,this,[t])},du("ScrollBarInteractor",ql,{_41o:function(){return this.gv.getViewRect().height<this.gv.getScrollRect().height},_40o:function(){return this.gv.getViewRect().width<this.gv.getScrollRect().width},isV:function(t){var e=this.gv.getViewRect();return this._41o()&&(e.x+e.width-this.gv.lp(t).x)*this.gv.getZoom()<ka},isH:function(t){var e=this.gv.getViewRect();return this._40o()&&(e.y+e.height-this.gv.lp(t).y)*this.gv.getZoom()<ka},handle_mousemove:function(t){this.handle_touchmove(t)},handle_touchmove:function(t){var e;!Ir&&cs(t)&&this.gv.isScrollBarVisible()&&(e=this.isV(t),t=this.isH(t),(e||t)&&this.gv.showScrollBar(),this.gv._scrolling=e||t)},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},handleWindowTouchEnd:function(t){this._state=this._cp=this._tx=this._ty=this.gv._scrolling=U,this.fi({kind:"endScroll",event:t})},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(t){var e,i=this;i.gv.setFocus(t),qa(t),i.handle_touchmove(t),1<ds(t)||!i.gv._scrolling||!i.gv.isScrollBarVisible()||(i._cp=_s(t),i._tx=i.gv.tx(),i._ty=i.gv.ty(),e=i.isV(t),i._state=e?"vScroll":"hScroll",Rs(i,t),i.fi({kind:"beginScroll",event:t}))},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){var e=_s(t),i=this.gv.getViewRect(),n=this.gv.getScrollRect();"vScroll"===this._state?this.gv.ty(this._ty+(this._cp.y-e.y)*n.height/i.height):"hScroll"===this._state&&this.gv.tx(this._tx+(this._cp.x-e.x)*n.width/i.width),this.fi({kind:"betweenScroll",event:t})}}),Ul=vc.TouchInteractor=function(t,e){(e=e||{}).selectable===H&&(e.selectable=!0),e.movable===H&&(e.movable=!0),e.pannable===H&&(e.pannable=!0),e.pinchable===H&&(e.pinchable=!0),e.editable===H&&(e.editable=!0),this.params=e,Bn(Ul,this,[t])},du("TouchInteractor",ql,{ms_edit:1,setUp:function(){Ul.superClass.setUp.call(this),et&&this.params.editable&&this.gv.setEditInteractor(this)},tearDown:function(){Ul.superClass.tearDown.call(this),et&&this.params.editable&&this.gv.setEditInteractor(U)},clear:function(t){var e=this,i=e.gv;i._moving&&(e.fi({kind:"endMove",event:t}),delete i._moving,i.onMoveEnded(),i.dm().endTransaction()),i._panning&&(e.fi({kind:"endPan",event:t}),delete i._panning,i.onPanEnded()),i._pinching&&(e.fi({kind:"endPinch",event:t}),delete i._pinching,i.onPinchEnded()),i._editing&&(e._46O(t),e._77I=e._node=e._edge=e._shape=e._rect=e._89I=e._index=i._editing=U),e.pendingClickThrough=e._moving=e._panning=e._pinching=e._editing=e._57I=e._data=e._beginHistory=U,e.clearDragging()},handle_touchstart:function(t){var e,i,n,r,o,a=this;a.gv._editing||(qa(t),a._57I=U,a.pendingClickThrough=U,i=a.params,r=(e=a.gv).sm(),n=e.getDataAt(t),1===(o=ds(t))?fs(t)?e.handleDoubleClick(t,n):(e.handleClick(t,n),n&&(e.handleMouseDown&&e.handleMouseDown(t,n),a._data=n),i.selectable||(n=U),n&&(r.co(n)?n instanceof _l&&n.isClickThroughEnabled()&&(a.pendingClickThrough=_s(t)):r.ss(n),i.editable&&e.isEditable(n)&&a._79I(t,n,!0)?(a._editing=1,a.startDragging(t)):i.movable&&e.isMovable(n)&&(a._moving=1,a.startDragging(t))),n&&e.isMovable(n)||(a._57I=_s(t),i.pannable&&e.isPannable()&&(a._panning=1,a.startDragging(t),a._translate={x:e.tx(),y:e.ty()}))):i.pinchable&&2===o&&(n&&e._39Q(n)||(a._pinching=1,a.startDragging(t),r=e.getView(),i=e.getZoom(),o=r.getBoundingClientRect(),n=t.touches[0],r=t.touches[1],(o={x:(n.clientX+r.clientX)/2-o.left,y:(n.clientY+r.clientY)/2-o.top}).x-=e.tx(),o.y-=e.ty(),o.x/=i,o.y/=i,a._p=o,a._d=Ro(t))))},handle_touchend:function(t){var e=this.gv,i=this._57I,n=this._data;i&&(ys(i,_s(t))<=1&&!e.getDataAt(t)&&e.sm().cs(),this._57I=U),n&&e.handleMouseUp&&e.handleMouseUp(t,n),this.pendingClickThrough&&(ys(this.pendingClickThrough,_s(t))<=1&&(n=e.getDataAt(t))instanceof _l&&n.isClickThroughEnabled()&&((i=e.getDataAt(t,function(t){return t.getParent()===n&&e.isSelectable(t,!0)}))&&(t.clickThrough=!0,e.sm().ss(i))),this.pendingClickThrough=U)},handleWindowTouchEnd:function(t){this.clear(t)},handleWindowTouchMove:function(t){var e,i,n=this,r=n.gv,o=ds(t);1===o?(i=_s(t),e=cc(r,i,n._lastClientPoint),i=ys({x:0,y:0},e),n._editing&&(n._beginHistory||(n._beginHistory=1,r.dm().beginTransaction()),r._editing=1,n._78I(t)),n._moving?!r._moving&&i<G.touchMoveThreshold||(n._beginHistory||(n._beginHistory=1,r.dm().beginTransaction()),n.handleMove(t)):n._panning&&(!r._panning&&i<G.touchMoveThreshold||(r.setTranslate(n._translate.x+e.x,n._translate.y+e.y),n.fi({kind:r._panning?"betweenPan":"beginPan",event:t}),r._panning=1))):2===o&&n._pinching&&(o=Ro(t),r.handlePinch(n._p,o,n._d),n._d=o,n.fi({kind:r._pinching?"betweenPinch":"beginPinch",event:t}),r._pinching=1)},handleMove:function(t){var e=this.gv,i=e.lp(t);e._93O&&e._93O(t,this._data)||(e.moveSelection(i.x-this._lastLogicalPoint.x,i.y-this._lastLogicalPoint.y),this._lastLogicalPoint=i,this.autoScroll(t),this.fi({kind:e._moving?"betweenMove":"beginMove",event:t}),e._moving=1)}}),(Hl=(Gl=C.ht).graph._editor={Math:Gl.Math,Guide:{}}).getStyle=function(t){var e,i=Hl.StyleMap;return i&&(e=i[t])!==H?e:Hl.DefaultStyleMap[t]},Hl.setStyle=function(t,e){(Hl.StyleMap||(Hl.StyleMap={}))[t]=e},Hl.inEdit=function(t){return!0===t._inXEdit},Hl.startEdit=function(t){t._inXEdit=!0,Hl.Inject.doInject(t)},Hl._46O=function(t){t._inXEdit=!1,Hl.Inject.undoInject(t)},Hl.toScreenPosition=function(t,e){var i=t.tx(),n=t.ty(),t=t._zoom;return new Hl.Math.Vector2(e.x*t+i,e.y*t+n)},Hl.checkHit=function(t,e,i){return t.distanceTo(e)<i},Hl.toWorldPosition=function(t,e){var i=t.tx(),n=t.ty(),t=t._zoom;return{x:(e.x-i)/t,y:(e.y-n)/t}},Hl.setAntialias=function(t,e){for(var i,n=["imageSmoothingEnabled","webkitImageSmoothingEnabled","mozImageSmoothingEnabled","oImageSmoothingEnabled","msImageSmoothingEnabled"],r=0,o=n.length;r<o&&!((i=n[r])in t);r++);t[i],t[i]=e},Hl.getTargetCornersOnScreen=function(e,t){if(!t)return null;var i=[];if(Sn(t,e))var n=Gh(e,t),n=[{x:n.x,y:n.y},{x:n.x+n.width,y:n.y},{x:n.x+n.width,y:n.y+n.height},{x:n.x,y:n.y+n.height}];else{if(!t.getCorners)return null;n=t.getCorners()}return n.forEach(function(t){t=Hl.toScreenPosition(e,t);i.push(t.x,t.y)}),i},Hl.log=function(){},(Wl=Hl.Inject={_modules:[]}).registAsModule=function(e,i){var t,n={},r={};for(t in e){var o=i.prototype[t];n[t]=o}e.getBackup=function(t){return n[t]},e.getBackups=function(){return n},r.doInject=function(){for(var t in e)"getBackup"!==t&&(i.prototype[t]=e[t])},r.undoInject=function(){for(var t in e)"getBackup"!==t&&(i.prototype[t]=n[t])},Wl._modules.push(r)},Wl.doInject=function(t){for(var e=Wl._modules,i=0,n=e.length;i<n;i++)e[i].doInject(t)},Wl.undoInject=function(t){for(var e=Wl._modules,i=0,n=e.length;i<n;i++)e[i].undoInject(t)},Xl=ql=Gl.graph.EditInteractor=function(t){var e=this,i=d.createElement("canvas");i.className="editCanvas",i.style.position="absolute",e._styleMap={},e._canvas=i,e._context=i.getContext("2d"),ql.superClass.constructor.call(e,t),this._editDetail=!1,Hl.setAntialias(e._context,!1),e._subModules=[new Hl.Anchor(e),new Hl.RotateX(e),new Hl.MoveDummy(e),new Hl.Rect(e),new Hl.Curve(e),new Hl.MoveHelper(e)],e._gridGuide=new Hl.Guide.Grid(e),e._rectGuide=new Hl.Guide.Rect(e),e._hoverGuide=new Hl.Guide.Hover(e)},Gl.Default.def(ql,Gl.graph.Interactor,{ms_edit:1,ms_fire:1}),L.defineProperties(ql.prototype,{editDetail:{get:function(){return!!this._editDetail},set:function(t){var e=this._editDetail;e!==t&&(this._editDetail=t,this.gv._editing=t,this.fp("editDetail",e,t),this.fp("pointsEditingMode",e,t),this.fi({kind:t?"beginEditPoints":"endEditPoints"}))}},gvEditing:{get:function(){return this.gv._editing},set:function(t){this._editDetail&&!t||((this.gv._editing=t)||(this.editDetail=!1))}},editing:{get:function(){return this._editing},set:function(t){this._editing=t,this.gvEditing=t}},editingModule:{get:function(){return this._editMod}},pointsEditingMode:{get:function(){return this.editDetail},set:function(t){this.editDetail!==t&&(t?this._tryEnterEditDetailMode():this._tryQuitEditDetailMode())}},gridEnabled:{get:function(){if(!this._gridEnabled)return!1;this.gv;return!0},set:function(t){t!==this._gridEnabled&&(this._gridEnabled=t,this._42())}},alignmentGuideEnabled:{get:function(){return this._agEnabled},set:function(t){t!==this._agEnabled&&(this._agEnabled=t,this._42())}},gridGuide:{get:function(){return this._gridGuide}},rectGuide:{get:function(){return this._rectGuide}},hoverGuide:{get:function(){return this._hoverGuide}}}),ql.prototype.getSubModule=function(t){for(var e,i=this._subModules,n=0,r=i.length;n<r;n++)if((e=i[n]).catalog===t)return e},ql.prototype.invokeSubModule=function(t,e){var i=this._subModules;if(i)for(var n,r,o=Array.prototype.slice.call(arguments,2),a=0,s=i.length;a<s;a++)if((r=(n=i[a])[t])&&(r.apply(n,o)!=H&&e))return n},ql.prototype.invokeSubModuleInverse=function(t,e){var i=this._subModules;if(i)for(var n,r,o=Array.prototype.slice.call(arguments,2),a=i.length-1;0<=a;a--)if((r=(n=i[a])[t])&&(r.apply(n,o)!=H&&e))return n},ql.prototype.setUp=function(){Hl.log("setUp");var t=this.gv,e=t.getView(),i=this._canvas;ql.superClass.setUp.call(this),t.setEditInteractor(this),t._79O?e.insertBefore(i,t._79O):e.appendChild(i),Hl.startEdit(t),this.invokeSubModule("setUp"),t.dm().mm(this._onDataModelChanged,this),t.dm().md(this._onDataPropertyChanged,this)},ql.prototype.tearDown=function(){Hl.log("tearDown");var t=this,e=t.gv,i=e.getView();t._resetCustomCursorStyle(),ql.superClass.tearDown.call(t),e.dm().umm(t._onDataModelChanged,t),e.dm().umd(t._onDataPropertyChanged,t),e.setEditInteractor(null),i.removeChild(t._canvas),t._drawTimer&&(E(t._drawTimer),t._drawTimer=null),Hl._46O(e),t.invokeSubModule("tearDown")},ql.prototype._onDataModelChanged=function(t){("clear"===t.kind||"remove"===t.kind&&this.editDetail&&t.data===this.getSubModule("Curve").target)&&(this.editDetail=!1,this._42())},ql.prototype._onDataPropertyChanged=function(t){var e,i;this.editDetail&&(e=this.getSubModule("Curve"),(i=t.data)===e.target&&(i._writing||e._handleDataChanged(t)))},ql.prototype.clear=function(){Hl.log("clear")},ql.prototype.redraw=function(){this._42()},ql.prototype._42=function(){var t=this;t._drawTimer||(t._drawTimer=w(function(){t._drawTimer=null,t.drawImpl()},0))},ql.prototype.drawImpl=function(){for(var s in{_42:!0})break;return function(){var t=this._canvas,e=this.gv,i=e.getWidth(),n=e.getHeight(),r=this._context,o=Gl.Default.getInternal(),a=C.devicePixelRatio;t.width===i&&t.height===n||o.setCanvas(t,i,n,a),r.clearRect(0,0,t.width,t.height);t=this._getValidSelection();r.save(),r.scale(a,a),this._gridGuide._42(),this.invokeSubModuleInverse(s,!1,r,e,t),this._rectGuide._42(),this._hoverGuide._42(),r.restore()}}(),ql.prototype._getValidSelection=function(){var e=this.gv,t=e.sm().getSelection(),i=[];return t.each(function(t){e.isVisible(t)&&e.isEditable(t)&&i.push(t)}),i},ql.prototype.handle_touchmove=function(t){return this.handle_mousemove(t)},ql.prototype.handle_mousemove=function(t){Gl.Default.isDragging()||(!this.editDetail&&(Hr()||ls(t))||this.gv._externalEditing||(this.gvEditing=!1,this._checkEdit(t)?this.gvEditing=!0:this.getStyle("hoverGuideVisible")&&(this.hoverData=this.gv.getDataAt(t),this._42())))},ql.prototype.handle_touchstart=function(t){return this.handle_mousedown(t)},ql.prototype.handle_mousedown=function(t){qa(t);var e=this;if((e.editDetail||!Hr()&&!ls(t))&&!e.gv._externalEditing){if(fs(t)&&!t.clickThrough){if(e.editDetail){if(e._tryQuitEditDetailMode(t))return}else if(e._tryEnterEditDetailMode())return;e.gv.dm().beginTransaction();var i=e.invokeSubModule("handleDoubleClick",!0,t);if(e.gv.dm().endTransaction(),i)return}i=e._checkEdit(t);i&&(e._downPosition=e._getLogicalPoint(t),e.gv.dm().beginTransaction(),i.startEdit(e,t),e.editing=!0)}},ql.prototype._checkEdit=function(t){var e=this.gv,i=this._getLogicalPoint(t),i=this.invokeSubModule("check",!0,e,t,i)||null;return this._editMod=i},ql.prototype.handleWindowTouchMove=function(t){return this.handleWindowMouseMove(t)},ql.prototype.handleWindowMouseMove=function(t){var e=this._downPosition;if(e){if(this._getLogicalPoint(t).distanceTo(e)<this.getStyle("moveSensitivity"))return;delete this._downPosition}e=this._editMod;e&&e.handleEdit(this.gv,t)},ql.prototype._getLogicalPoint=function(t){t=Gl.Default.getLogicalPoint(t,this._canvas);return new Hl.Math.Vector2(t)},ql.prototype.handleWindowTouchEnd=function(t){return this.handleWindowMouseUp(t)},ql.prototype.handleWindowMouseUp=function(){for(var e in{_46O:!0})break;return function(t){this.editing=!1,this.setCursor("default"),this.invokeSubModule(e,!1,t),this._42(),this.gv.dm().endTransaction()}}(),ql.prototype.handle_mousewheel=function(t){qa(t),this.invokeSubModule("preHandleScroll",!0)||this.gv.handleScroll(t,t.wheelDelta)},ql.prototype.handleDelete=function(){if(!this.editDetail){this.gv.dm().beginTransaction();var t=this.invokeSubModule("handleNormalStateDelete",!0);return this.gv.dm().endTransaction(),void(t||this.gv.removeSelection())}this.gv.dm().beginTransaction(),this.invokeSubModule("handleDelete",!0),this.gv.dm().endTransaction(),this._42()},ql.prototype.handle_keydown=function(t){var e=this;if((t.metaKey||t.ctrlKey)&&e._42(),Hr(t)&&!e.editing)return e.gvEditing=!1,e.setCursor("default"),void e._42();var i=Wr(t);return e.editDetail?((i||qr(t))&&(e.editDetail=!1,e._42()),e.gv.dm().beginTransaction(),e.invokeSubModule("handle_keydown",!0,t),void e.gv.dm().endTransaction()):(e.gv.dm().beginTransaction(),e.invokeSubModule("handleNormalStateKeyDown",!0,t),e.gv.dm().endTransaction(),void(i&&e._tryEnterEditDetailMode()))},ql.prototype.handle_keyup=function(t){this.gv.dm().beginTransaction(),this.invokeSubModule("handle_keyup",!0,t),this.gv.dm().endTransaction()},ql.prototype._tryEnterEditDetailMode=function(){return!this.editDetail&&this.invokeSubModule("canEnterEditDetailMode",!0)&&1===this._getValidSelection().length?(this.editDetail=!0,this._42(),!0):void 0},ql.prototype._tryQuitEditDetailMode=function(t){return!!this.editDetail&&(!(t&&!this.invokeSubModule("canQuitEditDetailMode",!0,t))&&(this.editDetail=!1,this._42(),!0))},ql.prototype.setStyle=function(t,e,i){i?Hl.setStyle(t,e):this._styleMap[t]=e,"baseColor"===t&&(Kl=e),this.fp("styleChanged",null,{key:t,value:e,base:i}),this._42()},ql.prototype.getStyle=function(t){var e=this._styleMap[t];return e!==H?e:Hl.getStyle(t)},ql.prototype.setCursor=function(t){this._resetCustomCursorStyle(),Gl.graph.EditInteractor.superClass.setCursor.call(this,t)},ql.prototype._drawHostGuide=function(t){var e=this._context,i=this.gv;Hl.Icons.DrawIcon(this,e,Hl.Icons.NodeHoverGuide,t.corners);var n=t.host;if(n){var r=i.getAttachPoints(n);if(r&&r.length)for(var o=0,a=r.length;o<a;o++){var s=r[o],s=sc(i,n,0,s.offsetX||0,s.offsetY||0,s.x,s.y);(s=Hl.toScreenPosition(i,s)).isAttach=t.attach===o,Hl.Icons.DrawIcon(this,e,Hl.Icons.AttachPoint,s)}}},ql.prototype._resetCustomCursorStyle=function(){var t;this._customStyle&&((t=this.gv.getView()).classList&&t.classList.remove&&t.classList.remove(this._customStyle),this._customStyle=null)},ql.prototype._setRotateCursor=function(t){var e=(this._cursorFactory||(this._cursorFactory=new Hl.CursorFactory(this))).getRotateCursor(t),t=this.gv.getView();this._resetCustomCursorStyle(),this._customStyle=e,t.classList&&t.classList.add&&t.classList.add(e)},(Gv=Hl.Group=function(t){this._entities=t,this._64O=0,this._position={x:0,y:0},this._scale={x:1,y:1},this._anchor={x:.5,y:.5},this._anchor2={x:.5,y:.5}}).prototype={},Gv.prototype.constructor=Gv,Ql=null,Gv.findOrCreateGroup=function(t){if(Ql&&Ql.checkIsMe(t))return Ql;t=new Hl.Group(t);return t.getKeyOb()?Ql=t:void 0},Gv.prototype.checkIsMe=function(t){var e=this._entities;if(e.length!==t.length)return!1;for(var i={},n=t.length,r=0;r<n;r++)i[t[r]._id]=!0;for(r=0;r<n;r++)if(!i[e[r]._id])return!1;return!0},Gv.prototype.getRotation=function(){return this._64O},Gv.prototype.getPosition=function(){return this._position},Gv.prototype.getAnchor=function(){return this._anchor},Gv.prototype.getWidth=function(){return this._width},Gv.prototype.getScale=function(){return this._scale},Gv.prototype.getSize=function(){return{width:this._width,height:this._height}},Gv.prototype.getHeight=function(){return this._height},Gv.prototype.getKeyOb=function(){for(var t=this._entities,e=t.length-1;0<=e;e--){var i=t[e];if(this.isNode(i))return i}},Gv.prototype.getAnchor2=function(){var t=this.rotateCenter;if(t)return t;var e=this.getKeyOb();if(!e)return this._anchor;t=this._anchor2;return e.getMatrix().tf({x:e.getWidth()*(t.x-e.getAnchor().x),y:e.getHeight()*(t.y-e.getAnchor().y)})},Gv.prototype.setAnchor2=function(t,e){var i=this.getKeyOb();i&&(t="number"==typeof t?{x:t,y:e}:t,t=i.getMatrix().tfi(t),this._anchor2={x:i.getAnchor().x+t.x/i.getWidth(),y:i.getAnchor().y+t.y/i.getHeight()})},Gv.prototype.setRotation=function(){},Gv.prototype.beginRotate=function(t){this.rotateCenter=t.pos,this.rotateMode=t.groupRotateMode},Gv.prototype.endRotate=function(){delete this.rotateCenter,delete this.rotateMode},Gv.prototype.addRotation=function(t,e,i){return"batch"===e?this._addRotationInBatchMode(t,i):"block"===e?this._addRotationInBlockMode(t,i):void 0},Gv.prototype._addRotationInBlockMode=function(n,r){var o=this,a=o.rotateCenter||o.getPosition();o._entities.forEach(function(t){var e,i;!o.isNode(t)||r&&!r(t)||((e=t.getMatrix()).translate(-a.x,-a.y),e.rotate(n),e.translate(a.x,a.y),i=Math.sign(t.getScale().x),t.setRotation(T(e.b*i,e.a*i)),t.setPosition(e.tx,e.ty))})},Gv.prototype._addRotationInBatchMode=function(r,o){var a=this,s=a._anchor2;a._entities.forEach(function(t){var e,i,n;!a.isNode(t)||o&&!o(t)||(i=t.getAnchor(),n=(e=t.getMatrix()).tf({x:t.getWidth()*(s.x-i.x),y:t.getHeight()*(s.y-i.y)}),(i=new Hl.Math.Matrix2d).set(e.a,e.b,e.c,e.d,e.tx,e.ty),i.translate(-n.x,-n.y),i.rotate(r),i.translate(n.x,n.y),n=Math.sign(t.getScale().x),t.setRotation(T(i.b*n,i.a*n)),t.setPosition(i.tx,i.ty))})},Gv.prototype.setPosition=function(t){for(var e,i,n=this._position,r=t.x-n.x,o=t.y-n.y,a=this._entities,s=0,h=a.length;s<h;s++)e=a[s],wn(e)&&(i=e.getPosition(),e.setPosition(i.x+r,i.y+o));this._position=t},Gv.prototype.setScale=function(t,e){var i=t/this._scale.x,n=e/this._scale.y;this._adjustChildScaleOrSize(i,n,"size"),this._scale={x:t,y:e}},Gv.prototype.getRect=function(){var t=this._position,e=this._width,i=this._height;return{x:t.x-e/2,y:t.y-i/2,width:e,height:i}},Gv.prototype.setSize=function(t,e){var t=Math.max(1,t),e=Math.max(1,e),i=t/this._width,n=e/this._height;this._adjustChildScaleOrSize(i,n,"size"),this._width=t,this._height=e},Gv.prototype._adjustChildScaleOrSize=function(t,e,i){for(var n,r,o=this._position,a=this._entities,s=new Hl.Math.Matrix2d,h=0,c=a.length;h<c;h++){var l,u,d,f,g,p,_=a[h];this.isNode(_)&&(l=_.getPosition(),u=_.getRotation(),d=_.getWidth(),f=_.getHeight(),g=(n=_.getScale()).x*d,p=n.y*f,s.identity().scale(g,p).rotate(u).translate(l.x,l.y).translate(-o.x,-o.y).rotate(-this._64O),u=T(s.b*Math.sign(g),s.a*Math.sign(g)),s.scale(t,e),g=Math.cos(u),u=Math.sin(u),g=Math.abs(g)<.001?(r=s.b/u,-s.c/u):(r=s.a/g,s.d/g),"scale"===i?_.setScale(r/d,g/f):"size"===i&&(d=r/n.x,f=g/n.y,_.setScale(kn(r)*Math.abs(n.x),kn(g)*Math.abs(n.y)),_.setSize(Math.max(.1,Math.abs(d)),Math.max(.1,Math.abs(f)))),s.rotate(this._64O).translate(o.x,o.y),_.setPosition(s.tx,s.ty))}},Gv.prototype.getMatrix=function(){var t=this._position,e=Gl.Default.getInternal(),i=this._scale;return new e.Mat(this._64O,t.x,t.y,i.x,i.y)},Gv.prototype.toGlobal=function(t){return this.getMatrix().tf(t)},Gv.prototype.getCorners=function(){var t=this._width,e=this._height,i=this._anchor,n=-t*i.x,r=-e*i.y,i=this.getMatrix();return[i.tf(n,r),i.tf(n,r+e),i.tf(n+t,r+e),i.tf(n+t,r)]},Gv.prototype.calcInfo=function(){var t,e,i=[],n=this._entities,r=this._64O;for(u=0,d=n.length;u<d;u++)e=n[u],this.isNode(e)&&e.getCorners&&i.push.apply(i,e.getCorners());if(i.length){for(var o=Math.cos(-r),a=Math.sin(-r),s=1/0,h=-1/0,c=1/0,l=-1/0,u=0,d=i.length;u<d;u++)f=(t=i[u]).x,g=t.y,t.x=o*f-a*g,t.y=a*f+o*g,s=Math.min(s,t.x),h=Math.max(h,t.x),c=Math.min(c,t.y),l=Math.max(l,t.y);this._width=(h-s)/this._scale.x,this._height=(l-c)/this._scale.y,o=Math.cos(r),a=Math.sin(r);var r=this._anchor,f=s+(h-s)*r.x,g=c+(l-c)*r.y;this._position={x:o*f-a*g,y:a*f+o*g}}},Gv.prototype.isNode=function(t){return!!wn(t)&&(!Sn(t)||!t.size())},Gv.prototype._42=function(t,e,i){var n,r,o,a,s,h=this._entities;for("batch"===this.rotateMode&&(s=this.getKeyOb()),n=0,r=h.length;n<r;n++)o=h[n],this.isNode(o)&&(a=o.getRect(),a={min:Hl.toScreenPosition(i,{x:a.x,y:a.y}),max:Hl.toScreenPosition(i,{x:a.x+a.width,y:a.y+a.height})},o===s&&(a.isKeyOb=!0),Hl.Icons.DrawIcon(t,e,Hl.Icons.GroupSubEntityRect,a))},(ru=Hl.CurveActiving=function(t,e){for(var i in this._curve=t,this._interactor=t._interactor,this.silent=!0,e)this[i]=e[i];delete this.silent}).prototype={},ru.prototype.constructor=ru,L.defineProperties(ru.prototype,{point:{get:function(){return this._point},set:function(t){this._point=t,this.editingCtrl||this.silent||this._firePointChange()}},pairs:{get:function(){return this._pairs},set:function(t){this._pairs=t,this.editingCtrl&&!this.silent&&this._firePointChange()}}}),ru.prototype._firePointChange=function(){var t,e,i=this.getCurrentEditingPoint(),n=this._interactor;i?(e=this._curve.target)&&(t=Hl.getDataMatrix(e).invert(),e=i.e,(i=t.apply(Hl.toWorldPosition(n.gv,i))).e=e,(e=this._lastFirePoint)&&Math.abs(i.x-e.x)<1e-5&&Math.abs(i.y-e.y)<1e-5&&(i.e==H&&e.e==H||Math.abs(i.e-e.e)<1e-5)||(this._lastFirePoint=i,n.fi({kind:"selectPoint",x:i.x,y:i.y,e:i.e}))):n.fi({kind:"selectPoint"})},ru.prototype.dispose=function(){this._interactor.fi({kind:"selectPoint"})},ru.prototype.getCurrentEditingPoint=function(){var t=this.editingCtrl;if(t){var e=this.pairs;if(e){e=e[t.pairId];if(e){t=e[t.type];if(t)return t}}}return this._point},(du=Hl.CursorFactory=function(t){this._interactor=t,this._rotateCursorStyles={}}).prototype={},(du.prototype.constructor=du).prototype.getRotateCursor=function(t){t<0&&(t+=2*Math.PI);var e=this._interactor,i=e.getStyle("rotateCursorSize"),n=e.getStyle("rotateCursorRound"),r=Math.round(t/Math.PI*180/n);360<=r*n&&(r=0);e=this._rotateCursorStyles,t="htCustomRotateStyle_"+i+"_"+n+"_"+r;return e[t]||(this._produceRotateCursor(t,i,n,r),e[t]=!0),t},du.prototype._produceRotateCursor=function(t,e,i,n){this._interactor;var r=this._canvas;(r=r||(this._canvas=d.createElement("canvas"))).width=r.height=e*devicePixelRatio,r.style.width=r.style.height=e+" px";var o=r.getContext("2d");Hl.setAntialias(o,!1),o.scale(devicePixelRatio,devicePixelRatio);var a=Math.round(e/2),a=a+" "+a+",auto !important;",i=Math.PI/180*n*i;o.clearRect(0,0,e,e),o.save(),o.scale(e/32,e/32),o.translate(16,15),o.rotate(i+Math.PI/2),o.beginPath(),o.moveTo(-8,0),o.lineTo(-8,4),o.lineTo(-4,4),o.moveTo(8,0),o.lineTo(8,4),o.lineTo(4,4),o.moveTo(-8,4),o.quadraticCurveTo(0,-6,8,4),o.restore(),o.lineCap="round",o.lineJoin="miter",o.strokeStyle="white",o.lineWidth=4,o.stroke(),o.strokeStyle="black",o.lineWidth=2,o.stroke(),r="cursor:url("+(o=JSON.stringify(r.toDataURL()))+")"+a,1!==devicePixelRatio&&(r+="cursor:url(data:image/svg+xml;base64,"+btoa('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+e+'px" height="'+e+'px"><image xlink:href='+o+' width="'+e+'" height="'+e+'"/></svg>')+")"+a,r+="cursor:-webkit-image-set(url("+o+")"+devicePixelRatio+"x,url("+o+")1x)"+a),(a=d.createElement("style")).textContent="body."+t+" *, ."+t+"{"+r+"}",d.head.appendChild(a)},(Iv=Hl.Guide.Grid=function(t){this._interactor=t,this._alignmentGuideId=0,this._xAlignmentGuide=[],this._yAlignmentGuide=[]}).prototype={},Iv.prototype.constructor=Iv,L.defineProperties(Iv.prototype,{gridBlockSize:{get:function(){return this._gridBlockSize||this._interactor.getStyle("gridBlockSize")},set:function(t){this._gridBlockSize=t,this._interactor._42()}},gridThickLinesEvery:{get:function(){return this._gridThickLinesEvery||this._interactor.getStyle("gridThickLinesEvery")},set:function(t){this._gridThickLinesEvery=t,this._interactor._42()}},gridEnabled:{get:function(){return this._interactor.gridEnabled&&this.isValidGrid()}}}),Iv.prototype._42=function(){var t=this._interactor;this.gridEnabled&&this.drawGrid(),t.alignmentGuideEnabled&&this.drawAlignmentGuide()},Iv.prototype.makeMatrix=function(){var t=this._interactor.getStyle("gridAngle"),e=this._interactor.getStyle("gridRotation"),i=new Hl.Math.Matrix2d,n=Math.sin(t),t=Math.cos(t);return i.set(1,0,t,n,0,0),i.rotate(e),i},Iv.prototype.isValidGrid=function(){var t=Math.PI,e=this._interactor;if(e.gv._zoom<e.getStyle("gridZoomThreshold"))return!1;e=e.getStyle("gridAngle"),t=Math.abs(e%t/t*180);return!(t<1-1e-8||179.00000001<t)},Iv.prototype.drawAlignmentGuide=function(){var t=this._interactor,e=t.gv,i=t._canvas,n=t._context,r=i.width,o=i.height,a=e.tx(),s=e.ty(),h=e._zoom;n.beginPath(),n.strokeStyle=t.getStyle("gridAlignmentGuideColor"),n.lineWidth=1,this._xAlignmentGuide.forEach(function(t){t=t.p*h+a;n.moveTo(t,0),n.lineTo(t,o)}),this._yAlignmentGuide.forEach(function(t){t=t.p*h+s;n.moveTo(0,t),n.lineTo(r,t)}),n.stroke()},Iv.prototype.drawGrid=function(){function t(t,e,i,n){e=Hl.toScreenPosition(c,g.apply({x:t,y:e})),n=Hl.toScreenPosition(c,g.apply({x:i,y:n}));u.moveTo(e.x,e.y),u.lineTo(n.x,n.y)}var e,i,n,r=this._interactor,o=this.gridBlockSize,a=this.gridThickLinesEvery,s=r.getStyle("gridThickColor"),h=r.getStyle("gridLightColor"),c=r.gv,l=r._canvas,u=r._context,d=l.width,f=l.height,g=this.makeMatrix(),p=g.applyInverse(Hl.toWorldPosition(c,{x:0,y:0})),_=g.applyInverse(Hl.toWorldPosition(c,{x:d,y:0})),r=g.applyInverse(Hl.toWorldPosition(c,{x:0,y:f})),l=g.applyInverse(Hl.toWorldPosition(c,{x:d,y:f})),v=Math.min(p.x,_.x,r.x,l.x),y=Math.max(p.x,_.x,r.x,l.x),m=Math.min(p.y,_.y,r.y,l.y),b=Math.max(p.y,_.y,r.y,l.y),d=Math.ceil(v/o),x=Math.floor(y/o),f=Math.ceil(m/o),w=Math.floor(b/o);for(c.tx(),c.ty(),c._zoom,u.save(),u.lineWidth=1,u.beginPath(),u.strokeStyle=s,n=Math.ceil(d/a)*a;n<=x;n+=a)t(e=n*o,m,e,b);for(n=Math.ceil(f/a)*a;n<=w;n+=a)t(v,i=n*o,y,i);for(u.stroke(),u.beginPath(),u.strokeStyle=h,n=d;n<=x;n++)0!=n%a&&t(e=n*o,m,e,b);for(n=f;n<=w;n++)0!=n%a&&t(v,i=n*o,y,i);u.stroke(),u.restore()},Iv.prototype.getAlignmentGuides=function(){return{x:this._xAlignmentGuide,y:this._yAlignmentGuide}},Iv.prototype.addAlignmentGuide=function(t,e,i){var n="x"===t?this._xAlignmentGuide:this._yAlignmentGuide,t={p:e,id:i=i||++this._alignmentGuideId};return n.length?(e=this._findClosestAlignmentGuide(t.p,n)).dis<0?n.splice(e.index+1,0,t):n.splice(e.index,0,t):n.push(t),this._interactor._42(),i},Iv.prototype.findClosest=function(t,e,i){var n=this._interactor,r=n.gv;i&&(t=Hl.toWorldPosition(r,t));var o,a,s,h=1/0,c=1/0,l=t.x,u=t.y;if(this.gridEnabled&&(o=this.gridBlockSize,s=(a=this.makeMatrix()).applyInverse(t),h=(s=a.apply({x:Math.round(s.x/o)*o,y:Math.round(s.y/o)*o})).x-l,c=s.y-u,s=!0),n.alignmentGuideEnabled&&(l=this._findClosestAlignmentGuide(l,this._xAlignmentGuide).dis,d=this._findClosestAlignmentGuide(u,this._yAlignmentGuide).dis,Math.abs(l)<Math.abs(h)&&(h=l,s=!0),Math.abs(d)<Math.abs(c)&&(c=d,s=!0)),s){s=!1;var d=r._zoom,r=n.getStyle("smartGuideThreshold")/d,n={};if(Math.abs(h)<r&&"y"!==e&&(n.x=i?h*d:h,s=!0),Math.abs(c)<r&&"x"!==e&&(n.y=i?c*d:c,s=!0),s)return n}},Iv.prototype._findClosestAlignmentGuide=function(t,e){if(!e.length)return{dis:1/0};for(var i,n=0,r=e.length-1;1<r-n;)e[i=Math.floor((n+r)/2)].p<t?n=i:r=i;var o=e[n].p-t,a=e[r].p-t;return Math.abs(o)<=Math.abs(a)?{line:e[n],dis:o,index:n}:{line:e[r],dis:a,index:r}},Iv.prototype.removeAllAlignmentGuide=function(t){"y"!==t&&(this._xAlignmentGuide=[]),"x"!==t&&(this._yAlignmentGuide=[]),this._interactor._42()},Iv.prototype.removeAlignmentGuide=function(t){for(var e,i,n,r=this._xAlignmentGuide,o=0;o<2;o++)for(i=(r=(e=0)===o?this._xAlignmentGuide:this._yAlignmentGuide).length;e<i;e++)if((n=r[e]).id===t)return r.splice(e,1),this._interactor._42(),{axis:0===o?"x":"y",position:n.p};return!1},Iv.prototype.adjustAlignmentGuide=function(t,e){var i=this.removeAlignmentGuide(t);return!!i&&(this.addAlignmentGuide(i.axis,e,t),!0)},(Gv=Hl.Guide.Rect=function(t){this._interactor=t}).prototype={},(Gv.prototype.constructor=Gv).prototype.gatherRects=function(){var n,r,o,a,s=this._interactor.gv,h=[],c=[],t={x:h,y:c},l={},e=s.getDataModel(),i=e.a("width"),u=e.a("height");i&&u&&(r=n=0,o=i,a=u,h.push({node:e,type:0,p:n},{node:e,type:1,p:n+o/2},{node:e,type:2,p:n+o}),c.push({node:e,type:0,p:r},{node:e,type:1,p:r+a/2},{node:e,type:2,p:r+a}),l[e._id||0]={x:n,y:r,width:o,height:a}),e.each(function(e){var i,t;wn(e)&&!s.isSelected(e)&&s.isVisible(e)&&s.isValidGuideLineSource(e)&&(i=!1,s.sm().getSelection().each(function(t){i||(e.isHostOn(t)||e.isDescendantOf(t))&&(i=!0)}),i||(t=e.getRect(),n=t.x,r=t.y,o=t.width,a=t.height,h.push({node:e,type:0,p:n},{node:e,type:1,p:n+o/2},{node:e,type:2,p:n+o}),c.push({node:e,type:0,p:r},{node:e,type:1,p:r+a/2},{node:e,type:2,p:r+a}),l[e._id]=t))}),h.sort(function(t,e){return t.p-e.p}),c.sort(function(t,e){return t.p-e.p}),this._grid=t,this._87I=l},Gv.prototype.gatherLines=function(t,e,i){var n,r,o,a,s,h,c,l,u,d=[this.findClosest({x:t.x,y:t.y},e),this.findClosest({x:t.x+t.w/2,y:t.y+t.h/2},e),this.findClosest({x:t.x+t.w,y:t.y+t.h},e)],f={},g=this._87I;for(i=i||255,this._guideLine=[],n=0;n<2;n++)for(f={},h=0===n?(o="y",(s=t.x)+t.w):(o="x",(s=t.y)+t.h),r=0;r<3;r++)(l=d[r])&&isFinite(l[o])&&(i&1<<3*n+r&&(f[u=(a=l[o+"Line"]).node._id||0]||(f[u]=!0,l=g[u],u="y"===o?(c=l.x,l.x+l.width):(c=l.y,l.y+l.height),l=a.p,this._guideLine.push({type:o,a:s,b:h,c:c,d:u,p:l,center:1===a.type}))))},Gv.prototype._binarySearchClosest=function(t,e){if(!e.length)return{dis:1/0};for(var i,n=0,r=e.length-1;1<r-n;)e[i=Math.floor((n+r)/2)].p<t?n=i:r=i;var o=e[n].p-t,a=e[r].p-t;return Math.abs(o)<=Math.abs(a)?{line:e[n],dis:o}:{line:e[r],dis:a}},Gv.prototype.findClosest=function(t,e,i){var n=this._interactor,r=n.gv,o=this._grid;i&&(t=Hl.toWorldPosition(r,t));var a,s=this._binarySearchClosest(t.x,o.x),h=this._binarySearchClosest(t.y,o.y),c=s.dis,t=h.dis,o=r._zoom,r=n.getStyle("smartGuideThreshold")/o,n={};return Math.abs(c)<r&&"y"!==e&&(n.x=i?c*o:c,n.xLine=s.line,a=!0),Math.abs(t)<r&&"x"!==e&&(n.y=i?t*o:t,n.yLine=h.line,a=!0),a?n:void 0},Gv.prototype._42=function(){var t=this._guideLine;if(t&&!Gl.Default.isCtrlDown()){var e=this._interactor;if(e.getStyle("guideLineVisible"))for(var i,n,r,o,a,s,h,c,l,u,d,f,g,p=e.gv,_=e._context,v=p.tx(),y=p.ty(),m=p._zoom,b=e.getStyle("guideLineTextSpacing"),x=0,w=t.length;x<w;x++)a=(i=t[x]).type,s=i.p,h=i.a,g=i.b,c=i.c,l=i.d,u=Math.min(h,c),d=Math.max(g,l),s="x"===a?(r=u*m+y,o=n=s*m+v,d*m+y):(n=u*m+v,o=d*m+v,r=s*m+y),Hl.Icons.DrawIcon(e,_,Hl.Icons.MoveLineGuide,{rect:[n,r,o,s],center:i.center}),h<=l&&c<=g||(g=(d=l<h?h:c)-(u=l<h?l:g),"x"===a?(i.center2center||(o=n-=b),r=u*m+y,s=d*m+y,f=Hl.Icons.MoveLineGuideDistanceV):"y"===a&&(i.center2center||(s=r-=b),n=u*m+v,o=d*m+v,f=Hl.Icons.MoveLineGuideDistanceH),Hl.Icons.DrawIcon(e,_,f,{x0:n,y0:r,x1:o,y1:s,dis:g}))}},Gv.prototype.clear=function(){this._guideLine=null},(ru=Hl.Guide.Hover=function(t){this._interactor=t}).prototype={},ru.prototype.constructor=ru,L.defineProperties(ru.prototype,{}),ru.prototype._42=function(){var t,e,i,n=this._interactor;n.getStyle("hoverGuideVisible")&&!n.gvEditing&&(e=n.hoverData,t=n.gv,wn(e)&&!t.isSelected(e)?(i=Gh(t,e),e=Hl.toScreenPosition(t,{x:i.x,y:i.y}),i=Hl.toScreenPosition(t,{x:i.x+i.width,y:i.y+i.height}),Hl.Icons.DrawIcon(n,n._context,Hl.Icons.HoverDataRect,{min:e,max:i,color:n.getStyle("hoverGuideColor")||n.getStyle("baseColor")})):n.hoverData=null)},Hl.DefaultStyleMap={baseColor:"rgb(51,153,255)",pointSize:[24,9],checkSize:7,rotateCheckSize:10,moveSensitivity:10,moveDummyThreshold:32,moveDummyPosition:[0,0,-16,-16],moveDummyLineExtraShift:[-32,0],moveDummySensitivity:16,keepAspectRatio:!1,rotateRound:Math.PI/2,shiftRotateRound:Math.PI/12,rotateSensitivity:Math.PI/60,rotateAsClock:!1,shiftLineRotateRound:Math.PI/4,anchorMovable:!0,anchorVisible:!0,anchorHideThreshold:25,anchorOutsideVisibleThreshold:.25,anchorRound:.25,anchorSensitivity:.02,smartGuideThreshold:8,curveIntersectSize:5,curvePointIntersectSize:8,edgeHostDetectPerFrame:!0,edgeHostEdgeMaxDistance:12,edgeHostEdgeHighlighColor:"#5d5d5d",edgeHostPointHighlighColor:"red",edgeHostHighlighPeriod:1500,edgeElevationEditable:!1,attachThreshold:25,guideLineVisible:!0,guideLineTextSpacing:0,hoverGuideVisible:!1,hoverGuideColor:null,gridBlockSize:40,gridThickLinesEvery:10,gridThickColor:"#5d5d5d",gridLightColor:"#d0d0d0",gridZoomThreshold:.25,gridAlignmentGuideColor:"#ff0000",gridAngle:Math.PI/2,gridRotation:0,groupRotateModeDefault:"block",groupRotateModeKey:["ctrlKey","metaKey"],rotateCursorSize:32,rotateCursorRound:45,tipTextColor:"#ffffff",tipBackground:"#333333",curveHighlightColor:"#30599e",rectPointBackground:"white",rectPointBorderColor:"#666666",rectPointShadowColor:"rgba(0,0,0,0.35)",shapeCtrlPointBackground:"white",shapeCtrlPointBorderColor:null,shapeCtrlPointHighlightBorder:null,shapeHighlighPointBackground:"#30599e",curveElevationVisible:!0,curveElevationIntersectSize:8,curveElevationGuideShift:[20,0],curveTipVisible:!0,connectGuideVisible:!0,connectGuideShift:[1,.25,8,0],connectGuideIntersectSize:8,connectGuideGarbageIntersectsize:25,connectGuideGarbageShift:[1,1,-48,-48]},Yl=Hl.Icons={},Zl=null,Kl=Hl.DefaultStyleMap.baseColor,Jl="rgb(255,204,153)",Gl.Default.setImage("Icons.RectPoint",{width:6,height:6,comps:[{type:"rect",background:"rgb(247,247,247)",borderWidth:1,borderColor:{func:function(){return Kl}},rect:[0,0,6,6]}]}),Yl.GroupSubEntityRect={comps:[{type:"shape",points:{func:function(){var t=Yl.GroupSubEntityRect.data;if(!t)return[];var e=t.min,t=t.max;return[e.x,e.y,e.x,t.y,t.x,t.y,t.x,e.y]}},segments:[1,2,2,2,5],background:null,borderWidth:1,borderColor:{func:function(){return Yl.GroupSubEntityRect.data.isKeyOb,Kl}}}]},Yl.HoverDataRect={comps:[{type:"shape",points:{func:function(){var t=Yl.HoverDataRect.data;if(!t)return[];var e=t.min,t=t.max;return e.x-=4,e.y-=4,t.x+=4,t.y+=4,[e.x,e.y,e.x,t.y,t.x,t.y,t.x,e.y]}},segments:[1,2,2,2,5],background:null,borderWidth:1,borderColor:{func:function(){return Yl.HoverDataRect.data.color}},borderCap:"round",borderPattern:[1,4]}]},Yl.Line={comps:[{type:"image",name:"Icons.RectPoint",rect:{func:function(){return[[Yl.Line.data.P1.x,Yl.Line.data.P1.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rect:{func:function(){return[[Yl.Line.data.P2.x,Yl.Line.data.P2.y],6,6]}}}]},Yl.NodeHoverGuide={comps:[{type:"shape",points:{func:function(){return Yl.NodeHoverGuide.data}},segments:[1,2,2,2,5],background:null,borderWidth:1,borderColor:"#3399FF"}]},Yl.Rect={comps:[{type:"shape",points:{func:function(){var t=Yl.Rect.data;if(!t)return[];var e=t.LT,i=t.LB,n=t.RB,t=t.RT;return[e.x,e.y,i.x,i.y,n.x,n.y,t.x,t.y]}},segments:[1,2,2,2,5],background:null,borderWidth:1,borderColor:{func:function(){return Kl}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},rect:{func:function(){return[[Yl.Rect.data.LT.x,Yl.Rect.data.LT.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},rect:{func:function(){return[[Yl.Rect.data.LB.x,Yl.Rect.data.LB.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},rect:{func:function(){return[[Yl.Rect.data.RB.x,Yl.Rect.data.RB.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},rect:{func:function(){return[[Yl.Rect.data.RT.x,Yl.Rect.data.RT.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},visible:{func:function(){return!!Yl.Rect.data.L}},rect:{func:function(){return[[Yl.Rect.data.L.x,Yl.Rect.data.L.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},visible:{func:function(){return!!Yl.Rect.data.R}},rect:{func:function(){return[[Yl.Rect.data.R.x,Yl.Rect.data.R.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},visible:{func:function(){return!!Yl.Rect.data.T}},rect:{func:function(){return[[Yl.Rect.data.T.x,Yl.Rect.data.T.y],6,6]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return Yl.Rect.data.rotation}},visible:{func:function(){return!!Yl.Rect.data.B}},rect:{func:function(){return[[Yl.Rect.data.B.x,Yl.Rect.data.B.y],6,6]}}}]},Gl.Default.setImage("Icons.Anchor",{width:12,height:12,comps:[{type:"shape",borderWidth:1,borderColor:{func:function(){return Kl}},borderCap:"round",shadowColor:"#1ABC9C",points:[.50928,6,11.49072,6,6,6,6,.50928,6,11.49072]},{type:"circle",borderWidth:1,borderColor:{func:function(){return Kl}},shadowColor:"#1ABC9C",rect:[2.84391,2.84391,6.53697,6.53697]}]}),Yl.Anchor={comps:[{type:"image",name:"Icons.Anchor",rect:{func:function(){return[[Yl.Anchor.data.POS.x,Yl.Anchor.data.POS.y],16,16]}}}]},Yl.TipShiftX=12,Yl.TipShiftY=12,$l=[8,28],Yl.TipHelper={comps:[{type:"roundRect",rect:{func:function(){return[Yl.TipHelper.data.helperPos.x,Yl.TipHelper.data.helperPos.y,$l[0]*Yl.TipHelper.data.size,$l[1]]}},background:{func:function(){return Zl.getStyle("tipBackground")}},opacity:.6},{type:"text",text:{func:function(){return Yl.TipHelper.data.text}},rect:{func:function(){return[Yl.TipHelper.data.helperPos.x,Yl.TipHelper.data.helperPos.y,$l[0]*Yl.TipHelper.data.size,$l[1]]}},color:{func:function(){return Zl.getStyle("tipTextColor")}},font:"bold 12px Arial",align:"center"}]},Yl.ShapePoint={comps:[{type:"circle",visible:{func:function(){return!!Yl.ShapePoint.data.dynamicVisible}},rect:{func:function(){var t=Yl.ShapePoint.data.point,e=Yl.ShapePoint.data.size||7;return[t,e+10,e+10]}},background:{func:function(){var t=Date.now(),e=Yl.ShapePoint.data.dynamicPeriod||1500;return"rgba(27,124,22,"+.5*Math.sin(t%e/e*Math.PI)+")"}},borderWidth:0},{type:"circle",rect:{func:function(){var t=Yl.ShapePoint.data.point,e=Yl.ShapePoint.data.size||7;return[t,e,e]}},background:{func:function(){return Yl.ShapePoint.data.isEnd?"rgba(27,124,222,0.7)":"#ffffff"}},borderWidth:1,borderColor:{func:function(){return Yl.ShapePoint.data.color||Kl}}},{type:"rect",visible:{func:function(){return!!Yl.ShapePoint.data.dynamicVisible}},background:"red",borderWidth:0,rotation:Math.PI/4,borderColor:{func:function(){return Kl}},rect:{func:function(){return[Yl.ShapePoint.data.point,5,5]}}}]},Yl.ShapeBgCurve={comps:[{type:"shape",visible:{func:function(){return!!Yl.ShapeBgCurve.data.dynamicVisible}},points:{func:function(){return Yl.ShapeBgCurve.data.P}},segments:{func:function(){return Yl.ShapeBgCurve.data.S}},background:null,borderWidth:6,borderColor:{func:function(){var t=Date.now(),e=Yl.ShapeBgCurve.data.dynamicPeriod||1500;return"rgba(27,124,22,"+.3*Math.sin(t%e/e*Math.PI)+")"}}},{type:"shape",points:{func:function(){return Yl.ShapeBgCurve.data.P}},segments:{func:function(){return Yl.ShapeBgCurve.data.S}},background:null,borderWidth:1,borderColor:{func:function(){return Yl.ShapeBgCurve.data.color||Kl}}}]},Yl.ShapeHighlighPoint={comps:[{type:"circle",rect:{func:function(){var t=Yl.ShapeHighlighPoint.data;return[[t.x,t.y],8,8]}},background:{func:function(){return Zl.getStyle("shapeHighlighPointBackground")}},borderWidth:0}]},Yl.ShapeHighlighRealPoint={comps:[{type:"circle",rect:{func:function(){var t=Yl.ShapeHighlighRealPoint.data;return[[t.x,t.y],10,10]}},background:"#ffffff",borderWidth:2,borderColor:{func:function(){return Kl}}}]},Yl.ShapeHighlighCtrlPoint={comps:[{type:"shape",points:{func:function(){var t=Yl.ShapeHighlighCtrlPoint.data,e=t.x,t=t.y;return[e-4,t-4,e-4,t+4,e+4,t+4,e+4,t-4]}},segments:[1,2,2,2,5],borderWidth:2,background:{func:function(){return Zl.getStyle("shapeCtrlPointBackground")}},borderColor:{func:function(){return Zl.getStyle("shapeCtrlPointBorderColor")||Kl}}}]},Yl.ShapeHighlightCurve={comps:[{type:"shape",points:{func:function(){return Yl.ShapeHighlightCurve.data}},segments:[1,4],background:null,borderWidth:3,borderColor:{func:function(){return Zl.getStyle("curveHighlightColor")}}}]},Yl.ShapeGuideLine={comps:[{type:"shape",points:{func:function(){return Yl.ShapeGuideLine.data}},background:null,borderWidth:1,borderColor:"rgb(255,204,153)"}]},Yl.MoveLineGuide={comps:[{type:"shape",points:{func:function(){return Yl.MoveLineGuide.data.rect}},background:null,borderWidth:1,borderColor:{func:function(){return Yl.MoveLineGuide.data.center?"rgb(183,232,135)":Jl}}}]},Yl.MoveLineGuideDistanceH={comps:[{type:"shape",points:{func:function(){var t=Yl.MoveLineGuideDistanceH.data,e=t.x0,t=t.y0;return[e,t-5,e,t+5]}},rotation:-Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:Jl},{type:"shape",points:{func:function(){var t=Yl.MoveLineGuideDistanceH.data,e=t.x1,t=t.y1;return[e,t-5,e,t+5]}},rotation:-Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:Jl},{type:"text",text:{func:function(){return Math.round(Yl.MoveLineGuideDistanceH.data.dis)}},rect:{func:function(){var t=Yl.MoveLineGuideDistanceH.data;return[[(t.x0+t.x1)/2,t.y0-10],20,20]}},color:Jl,font:"12px Arial",align:"center"}]},Yl.MoveLineGuideDistanceV={comps:[{type:"shape",points:{func:function(){var t=Yl.MoveLineGuideDistanceV.data,e=t.x0,t=t.y0;return[e-5,t,e+5,t]}},rotation:Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:Jl},{type:"shape",points:{func:function(){var t=Yl.MoveLineGuideDistanceV.data,e=t.x1,t=t.y1;return[e-5,t,e+5,t]}},rotation:Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:Jl},{type:"text",text:{func:function(){return Math.round(Yl.MoveLineGuideDistanceV.data.dis)}},rect:{func:function(){var t=Yl.MoveLineGuideDistanceV.data;return[[t.x0-10,(t.y0+t.y1)/2],20,20]}},color:Jl,font:"12px Arial",align:"center"}]},Gl.Default.setImage("Icons.EdgeElevationGuideImage",{width:16,height:16,comps:[{type:"oval",background:"rgb(255,255,255)",borderWidth:1,borderColor:"rgb(138,138,138)",rect:[.5,.5,15,15]},{type:"shape",borderWidth:2,borderColor:"rgb(44,44,44)",borderCap:"round",points:[4,8,8,4,12,8,8,4,8,13],segments:[1,2,2,1,2]}]}),Yl.EdgeElevationGuide={comps:[{type:"image",name:"Icons.EdgeElevationGuideImage",rect:{func:function(){var t=Yl.EdgeElevationGuide.data,e=t.x,i=t.y,n=Zl.getStyle("curveElevationIntersectSize"),t=Zl.getStyle("curveElevationGuideShift");return[(e+=t[0])-n,(i+=t[1])-n,2*n,2*n]}}}]},Gl.Default.setImage("Icons.ConnectGuideBgImage",{width:12,height:12,comps:[{type:"shape",background:"#3399ff",fillRule:"evenodd",shadowColor:"#1ABC9C",rotation:3.14159,points:[6.00001,11.99999,6.00001,11.99999,2.6863,11.99999,1e-5,9.30695,1e-5,5.99999,1e-5,5.99999,1e-5,2.68628,2.69305,-1e-5,6.00001,-1e-5,12.00001,-1e-5,11.99998,12.00001,6.00001,11.99999],segments:[1,2,4,2,4,2,2,2]}]}),Gl.Default.setImage("Icons.ConnectGuideHeaderImage",{width:12,height:12,comps:[{type:"oval",background:"#3399FF",borderColor:"#3399FF",shadowColor:"#1ABC9C",rect:[0,0,12,12]},{type:"shape",borderWidth:1,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[4.76,2.56,8.2,5.98,4.76,9.44]}]}),Yl.ConnectGuide={comps:[{type:"image",name:"Icons.ConnectGuideBgImage",rotation:{func:function(){return Yl.ConnectGuide.data.rotation}},rect:{func:function(){var t=Yl.ConnectGuide.data.connect;t.x,t.y;var e=Zl.getStyle("connectGuideIntersectSize");return[[t.x,t.y],2*e,2*e]}}},{type:"image",name:"Icons.ConnectGuideHeaderImage",rect:{func:function(){var t=Yl.ConnectGuide.data.cursorPos||Yl.ConnectGuide.data.connect,e=Zl.getStyle("connectGuideIntersectSize");return[[t.x,t.y],2*e-2,2*e-2]}}},{type:"shape",background:null,borderColor:"#3399ff",borderWidth:2,segments:[1,4],points:{func:function(){var t=Yl.ConnectGuide.data.connect,e=Yl.ConnectGuide.data.cursorPos||t;return[t.x,t.y,t.x+.5*(e.x-t.x),t.y,e.x+.5*(t.x-e.x),e.y,e.x,e.y]}}}]},Gl.Default.setImage("Icons.ConnectGuideGarbageImage",{width:48,height:48,comps:[{type:"oval",background:"rgba(0,0,0,0.1)",borderColor:"#979797",shadowColor:"#1ABC9C",rect:[0,0,48,48]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[19.84721,19.69091,19.84721,32.25123]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[24.10371,19.69091,24.10371,32.25123]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[28.15279,19.69091,28.15279,32.25123]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[11.23055,15.22377,36.76945,15.189,19.12302,15.17121,20.94722,11.5228,26.41985,11.5228,28.24406,15.17121]},{type:"rect",borderWidth:2,borderColor:"rgb(255,255,255)",shadowColor:"#1ABC9C",rect:[15.48702,15.22377,17.02595,21.25344]}]}),Gl.Default.setImage("Icons.ConnectGuideDeletingImage",{width:56,height:56,comps:[{type:"oval",background:"rgba(232,0,0,0.75)",borderColor:"#979797",shadowColor:"#1ABC9C",rect:[0,0,56,56]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[22.67939,27.69091,22.67939,40.25123]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[26.93588,27.69091,26.93588,40.25123]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",points:[30.98497,27.69091,30.98497,40.25123]},{type:"shape",borderWidth:2,borderColor:"rgb(255,255,255)",borderCap:"round",shadowColor:"#1ABC9C",anchorX:0,anchorY:1,rotation:5.65062,points:[14.06272,23.22377,39.60163,23.189,21.9552,23.17121,23.7794,19.5228,29.25203,19.5228,31.07623,23.17121]},{type:"rect",borderWidth:2,borderColor:"rgb(255,255,255)",shadowColor:"#1ABC9C",rect:[18.3192,23.22377,17.02595,21.25344]}]}),Yl.ConnectGuideGarbage={comps:[{type:"image",name:{func:function(){return Yl.ConnectGuideGarbage.data.hover?"Icons.ConnectGuideDeletingImage":"Icons.ConnectGuideGarbageImage"}},rect:{func:function(){var t=Yl.ConnectGuideGarbage.data,e=Zl.getStyle("connectGuideGarbageIntersectsize");return t.hover&&(e+=5),[[t.x,t.y],2*e,2*e]}}}]},Yl.ShapeActivingCtrl={comps:[{type:"shape",visible:{func:function(){return!!Yl.ShapeActivingCtrl.data.c1}},points:{func:function(){var t=Yl.ShapeActivingCtrl.data;return[t.point.x,t.point.y,t.c1.x,t.c1.y]}},segments:[1,2],background:null,borderWidth:1,borderColor:{func:function(){return Kl}}},{type:"shape",visible:{func:function(){return!!Yl.ShapeActivingCtrl.data.c2}},points:{func:function(){var t=Yl.ShapeActivingCtrl.data;return[t.point.x,t.point.y,t.c2.x,t.c2.y]}},segments:[1,2],background:null,borderWidth:1,borderColor:{func:function(){return Kl}}},{type:"shape",visible:{func:function(){return!!Yl.ShapeActivingCtrl.data.c1}},points:{func:function(){var t=Yl.ShapeActivingCtrl.data.c1,e=t.x,i=t.y,t=3;return"c1"===Yl.ShapeActivingCtrl.data.hl&&(t+=.5),[e-t,i-t,e-t,i+t,e+t,i+t,e+t,i-t]}},segments:[1,2,2,2,5],borderWidth:2,background:{func:function(){return Zl.getStyle("shapeCtrlPointBackground")}},borderColor:{func:function(){return"c1"===Yl.ShapeActivingCtrl.data.hl?Zl.getStyle("shapeCtrlPointHighlightBorder")||Kl:Zl.getStyle("shapeCtrlPointBorderColor")||Kl}}},{type:"shape",visible:{func:function(){return!!Yl.ShapeActivingCtrl.data.c2}},points:{func:function(){var t=Yl.ShapeActivingCtrl.data.c2,e=t.x,i=t.y,t=3;return"c2"===Yl.ShapeActivingCtrl.data.hl&&(t+=.5),[e-t,i-t,e-t,i+t,e+t,i+t,e+t,i-t]}},segments:[1,2,2,2,5],borderWidth:2,background:{func:function(){return Zl.getStyle("shapeCtrlPointBackground")}},borderColor:{func:function(){return"c2"===Yl.ShapeActivingCtrl.data.hl?Zl.getStyle("shapeCtrlPointHighlightBorder")||Kl:Zl.getStyle("shapeCtrlPointBorderColor")||Kl}}}]},Yl.RoundPoint={comps:[{type:"circle",background:"rgb(247,247,247)",borderWidth:1,borderColor:{func:function(){return Kl}},rect:{func:function(){return[[Yl.RoundPoint.data.x,Yl.RoundPoint.data.y],6,6]}}}]},Yl.AttachPoint={comps:[{type:"rect",background:{func:function(){return Yl.AttachPoint.data.isAttach?"rgb(51,153,255)":"rgb(247,247,247)"}},borderWidth:1,rotation:Math.PI/4,borderColor:{func:function(){return Kl}},rect:{func:function(){var t=Yl.AttachPoint.data.isAttach?10:6;return[[Yl.AttachPoint.data.x,Yl.AttachPoint.data.y],t,t]}}}]},Yl.SimpleRect={comps:[{type:"rect",background:null,borderWidth:{func:function(){return Yl.SimpleRect.data.borderWidth||1}},borderColor:{func:function(){return Yl.SimpleRect.data.color||Kl}},rect:{func:function(){var t=Yl.SimpleRect.data;return[t.x,t.y,t.width,t.height]}}}]},Gl.Default.setImage("Icons.MoveDummyImage",{width:32,height:32,boundExtend:12,attachStyle:"close",comps:[{type:"oval",background:"rgb(255,255,255)",borderColor:"#979797",shadow:!0,shadowColor:"rgba(0,0,0,0.25)",shadowOffsetX:0,rect:[0,0,32,32]},{type:"shape",background:"rgb(51,153,255)",pixelPerfect:!0,points:[8.65079,11.90713,9.05502,11.46921,9.70629,11.46921,10.11052,11.90713,10.51476,12.28891,10.51476,12.92895,10.11052,13.34441,8.49359,14.97258,12.2889,14.97258,12.85034,14.97258,13.29949,15.42172,13.29949,15.99439,13.29949,16.57828,12.85034,17.0162,12.2889,17.0162,8.49359,17.0162,10.11052,18.6556,10.51476,19.0486,10.51476,19.7111,10.11052,20.09288,9.70629,20.50834,9.05502,20.50834,8.65079,20.09288,5.32709,16.76917,5.28217,16.71303,4.87794,16.32002,4.87794,15.67998,5.28217,15.26452,8.65079,11.90713,8.65079,11.90713,8.65079,11.90713,13.3444,10.09931,13.3444,10.09931,12.94017,10.50354,12.2889,10.50354,11.88467,10.09931,11.48043,9.69507,11.48043,9.0438,11.88467,8.63957,15.27574,5.25973,15.66874,4.86672,16.32001,4.86672,16.73547,5.25973,16.76917,5.31586,20.10409,8.63957,20.50832,9.0438,20.50832,9.68385,20.10409,10.09931,19.69986,10.49231,19.07105,10.50354,18.64436,10.09931,17.02742,8.45991,17.02742,12.26646,17.02742,12.83912,16.55581,13.31072,15.99438,13.31072,15.43295,13.31072,14.98379,12.83912,14.98379,12.26646,14.96134,8.45991,13.3444,10.09931,13.3444,10.09931,13.3444,10.09931,21.90069,13.33318,21.90069,13.33318,21.49646,12.91771,21.49646,12.27768,21.90069,11.89591,22.31615,11.45798,22.94497,11.45798,23.36043,11.89591,26.72904,15.2533,27.12205,15.66876,27.12205,16.3088,26.72904,16.7018,26.6729,16.75794,23.36043,20.08165,22.94497,20.49711,22.31615,20.49711,21.90069,20.08165,21.49646,19.69987,21.49646,19.03737,21.90069,18.64437,23.51763,17.00498,19.72231,17.00498,19.14965,17.00498,18.71173,16.56705,18.71173,15.98316,18.71173,15.41049,19.14965,14.96135,19.72231,14.96135,23.51763,14.96135,21.90069,13.33318,21.90069,13.33318,21.90069,13.33318,11.88467,23.32675,11.88467,23.32675,11.48043,22.94498,11.48043,22.27125,11.88467,21.88948,12.2889,21.48523,12.94017,21.48523,13.3444,21.88948,14.96134,23.52887,14.98379,19.7111,14.98379,19.14966,15.43295,18.67805,15.99438,18.67805,16.55581,18.67805,17.02742,19.14966,17.02742,19.7111,17.02742,23.52887,18.64436,21.88948,19.07105,21.48523,19.69986,21.48523,20.10409,21.88948,20.50832,22.27125,20.50832,22.94498,20.10409,23.32675,16.76917,26.65045,16.73547,26.72905,16.32001,27.13329,15.66874,27.13329,15.27574,26.72905,11.88467,23.32675,11.88467,23.32675,11.88467,23.32675],segments:[1,4,4,2,2,4,4,2,2,4,4,2,2,4,2,2,2,1,2,4,4,2,4,2,2,4,4,2,2,4,4,2,2,2,2,1,2,4,4,2,4,2,2,4,4,2,2,4,4,2,2,2,2,1,2,4,4,2,2,4,4,2,2,4,4,2,2,4,2,2,2]}]}),Yl.MoveDummy={comps:[{type:"image",name:"Icons.MoveDummyImage",rect:{func:function(){var t=Yl.MoveDummy.data;return[[t.pos.x,t.pos.y],2*t.size,2*t.size]}}}]},Hl.Icons.DrawIcon=function(t,e,i,n){i.width=i.height=1e4,i.data=n,Zl=t,Gl.Default.drawImage(e,i,0,0,1e4,1e4)},Hl.Icons.MapPoints=function(t,e){for(var i=0,n=t.length;i<n;i++)t[i]/=e},Hl.roundTo=function(t,e,i){var n=Math.abs(t%e);return n<i||e-n<i?e*Math.round(t/e):t},Hl.toFixed=function(t){return Math.round(100*t)/100},Hl.getDataMatrix=function(t){if(t instanceof Gl.Shape){var e=new Gl.Math.Matrix2d,i=t.getPosition();return e.translate(-i.x,-i.y).scale(t.getScale().x,t.getScale().y).rotate(t.getRotation()).translate(i.x,i.y),e}return t.getMatrix?t.getMatrix():new Gl.Math.Matrix2d},(du=Hl.Math.Curve=function(){this._curves=[]}).prototype={},(du.prototype.constructor=du).prototype.createFromHtShape=function(e,t,i){t instanceof Gl.List&&(t=t.toArray());for(var n,r,o,a,s=null,h=null,c=0,l=Hl.Math.Vector2,u=Hl.Math.CubicBezier,d=function(t){return new l(e[t],e[t+1],i?i[t/2]:H)},f=0,g=t.length;f<g;f++){switch(r=null,t[f]){case 1:s=h=d(c),c+=2;break;case 2:n=d(c),c+=2,r=new u(h,h.clone(),n.clone(),n),h=n;break;case 3:o=d(c),n=d(c+2),c+=4,r=new u(h,o.clone().sub(h).multiplyScalar(2/3).add(h),o.clone().sub(n).multiplyScalar(2/3).add(n),n),h=n;break;case 4:o=d(c),a=d(c+2),n=d(c+4),c+=6,r=new u(h,o,a,n),h=n;break;case 5:if(!s)break;r=new u(h,h.clone(),s.clone(),s),s=h=null}r&&(r._index=this._curves.length,this._curves.push(r))}},du.prototype.checkPoint=function(t,e){for(var i,n,r,o=this._curves,a=0,s=o.length;a<s;a++)if((r=(n=o[a]).intersectRect(t,e,e)).length)return i=0,r.forEach(function(t){i+=t.t}),i/=r.length,(t=n.getPointAt(i)).t=i,{bezier:n,intersection:t}},du.prototype.insertKnot=function(t,e){e=t.insertKnot(e);this._curves.splice(t._index,1,e[0],e[1])},du.prototype._isCloseEnough=function(t,e){return Math.abs(t.x-e.x)<1e-6&&Math.abs(t.y-e.y)<1e-6},du.prototype._isSamePoint=function(t,e){return t===e},du.prototype.moveRealPoint=function(n,r){var o=this,t=o._curves,a=r.clone().sub(n);t.forEach(function(t){var e=t._p1;t._p2,t._p3;var i=t._p4;o._isSamePoint(e,n)&&(t._p2.add(a),t._p1=r),o._isSamePoint(i,n)&&(t._p3.add(a),t._p4=r)})},du.prototype.moveCtrlDueToRealPointMovement=function(n,e){function r(t){t.add(e),t.e&&e.e&&(t.e+=e.e)}var o=this,t=o._curves;t.forEach(function(t){var e=t._p1;t._p2,t._p3;var i=t._p4;o._isSamePoint(e,n)&&r(t._p2),o._isSamePoint(i,n)&&r(t._p3)})},du.prototype.moveCtrlPoint=function(t,i,n){var r,e,o=t[n];o&&(o.e!==H&&(i.e=o.e),e=(r=this)._curves,i.clone().sub(o),e.forEach(function(t){var e;"c2"===n?e="_p2":"c1"===n&&(e="_p3"),r._isSamePoint(t[e],o)&&(t[e]=i)}),t[n]=i)},du.prototype.deleteRealPoint=function(t,e){for(var i,n,r,o,a=this._curves,s={},h=[],c=Hl.Math.CubicBezier,l=0,u=a.length;l<u;l++)n=(i=a[l])._p1,r=i._p2,i._p3,o=i._p4,!s[l]&&this._isSamePoint(n,t)||(this._isSamePoint(o,t)?l+1<u&&this._isSamePoint(a[l+1]._p1,t)&&(e||h.push(new c(n,r,a[l+1]._p3,a[l+1]._p4))):h.push(i));this._curves=h},du.prototype.findPairs=function(t,e){for(var i,n,r,o,a=this._curves,s={},h=[],c=0,l=a.length;c<l;c++)i=(r=a[c])._p1,n=r._p2,o=r._p3,r=r._p4,!s[c]&&this._isSamePoint(i,t)&&(e?h.push({point:i,r2:r}):h.push({point:i,c2:n})),this._isSamePoint(r,t)&&(o=e?{point:r,r1:i}:{point:r,c1:o},c+1<l&&this._isSamePoint(a[c+1]._p1,t)&&(e?o.r2=a[c+1]._p4:o.c2=a[c+1]._p2,s[c+1]=!0),h.push(o));return h},du.prototype.toHtShape=function(){var r=this,t=r._curves,o=[],a=[],s={x:1/0,y:1/0};return t.forEach(function(t){var e=t._p1,i=t._p2,n=t._p3,t=t._p4;return r._isCloseEnough(e,s)||(o.push(1),a.push(e.clone())),s=t,r._isCloseEnough(e,i)&&r._isCloseEnough(n,t)?(o.push(2),void a.push(t.clone())):(o.push(4),void a.push(i.clone(),n.clone(),t.clone()))}),{segments:o,points:a}},(Iv=Hl.Math.CubicBezier=function(t,e,i,n){this._id=Hl.Math.CubicBezier._globalId++,this._p1=t,this._p2=e,this._p3=i,this._p4=n})._globalId=1,Iv.prototype={},(Iv.prototype.constructor=Iv).prototype.toString=function(){return this._id},Iv.prototype.intersectRect=function(t,e,i){var n=e/2,r=i/2,o=t.x,e=t.y,i=Hl.Math.Vector2,t=new i(-n+o,-r+e),o=new i(n+o,r+e),r=new i(o.x,t.y),e=new i(t.x,o.y),i=this.intersectLine(t,r),r=this.intersectLine(r,o),o=this.intersectLine(o,e),t=this.intersectLine(e,t);return i.concat(r).concat(o).concat(t)},Iv.prototype.intersectLine=function(t,e){var i=t.clone().min(e),n=t.clone().max(e),r=this._p1,o=this._p2,a=this._p3,s=this._p4,h=r.clone().multiplyScalar(-1),c=o.clone().multiplyScalar(3),l=a.clone().multiplyScalar(-3),s=h.add(c).add(l).add(s);h=r.clone().multiplyScalar(3),c=o.clone().multiplyScalar(-6),l=a.clone().multiplyScalar(3),l=h.add(c).add(l),h=r.clone().multiplyScalar(-3),c=o.clone().multiplyScalar(3),o=h.add(c),h=r.clone(),c=new Hl.Math.Vector2(t.y-e.y,e.x-t.x),r=t.x*e.y-e.x*t.y;for(var u=this.getRoots(c.dot(s),c.dot(l),c.dot(o),c.dot(h)+r),d=new Array,f=0,g=u.length;f<g;f++){var p,_=u[f];_<0||1<_||((p=this.getPointAt(_)).t=_,t.x==e.x?i.y<=p.y&&p.y<=n.y&&d.push(p):t.y==e.y?i.x<=p.x&&p.x<=n.x&&d.push(p):p.x>=i.x&&p.y>=i.y&&p.x<=n.x&&p.y<=n.y&&d.push(p))}return d},Iv.prototype.solveTForPoint=function(t){for(var e=this._p1.x-t.x,i=this._p2.x-t.x,n=this._p3.x-t.x,r=this._p4.x-t.x,o=this.getRoots(r-3*n+3*i-e,3*n-6*i+3*e,3*i-3*e,e),a=H,s=1/0,h=0,c=o.length;h<c;h++){var l,u=o[h];u<0||1<u||((l=this.getPointAt(u)).t=u,(u=Math.abs(l.y-t.y))<s&&(s=u,a=l))}return a},Iv.prototype.getPointAt=function(t){var e=this._p1,i=this._p2,n=this._p3,r=this._p4,e=e.clone().lerp(i,t),i=i.clone().lerp(n,t),r=n.clone().lerp(r,t),e=e.lerp(i,t),r=i.lerp(r,t);return e.lerp(r,t)},Iv.prototype.getPointByPercentage=function(t){var e=this.length*t,i=this._cacheLength,n=i.length;if(0==e)return i[0].point;if(1<=t)return i[n-1].point;for(var r=0;r<n;r++){var o=i[r];if(!(o.len<e)){var a=i[r-1];return o.point.clone().sub(a.point).setLength(e-a.len).add(a.point)}}},Iv.prototype.getTByPercentage=function(t){var e=this.length*t,i=this._cacheLength,n=i.length;if(0==e||t<=0)return i[0].t;if(1<=t)return i[n-1].t;for(var r=0;r<n;r++){var o=i[r];if(!(o.len<e)){var a=i[r-1];return(e-a.len)/(o.len-a.len)*(o.t-a.t)+a.t}}},Iv.prototype.getRoots=function(t,e,i,n){var r=new Array;Math.abs(t)<1e-6&&(0<(c=(l=i/(a=e))*l-4*(n/a))?(o=Math.sqrt(c),r.push(.5*(-l+o)),r.push(.5*(-l-o))):0==c&&r.push(.5*-l));var o,a,s,h,c=(e/=t)/3,e=(l=(2*e*e*e-9*(i/=t)*e+27*(n/=t))/27)*l/4+(a=(3*i-e*e)/3)*a*a/27,l=l/2;return Math.abs(e)<=1e-6&&(e=0),0<e?(s=0<=(h=-l+(o=Math.sqrt(e)))?Math.pow(h,1/3):-Math.pow(-h,1/3),0<=(h=-l-o)?s+=Math.pow(h,1/3):s-=Math.pow(-h,1/3),r.push(s-c)):e<0?(o=Math.sqrt(-a/3),s=Math.atan2(Math.sqrt(-e),-l)/3,a=Math.cos(s),e=Math.sin(s),s=Math.sqrt(3),r.push(2*o*a-c),r.push(-o*(a+s*e)-c),r.push(-o*(a-s*e)-c)):(h=0<=l?-Math.pow(l,1/3):Math.pow(-l,1/3),r.push(2*h-c),r.push(-h-c)),r},Iv.prototype._70I=function(){return this._p1.distanceToSquared(this._p2)<1e-10&&this._p3.distanceToSquared(this._p4)<1e-10},Iv.prototype.insertKnot=function(t){var e=this._p1,i=this._p2,n=this._p3,r=this._p4,o=e.clone().lerp(i,t),a=i.clone().lerp(n,t),s=n.clone().lerp(r,t),i=o.clone().lerp(a,t),n=a.clone().lerp(s,t),a=i.clone().lerp(n,t);return this._70I()?(e.clone().lerp(r,t),[new Hl.Math.CubicBezier(e,e.clone(),a.clone(),a),new Hl.Math.CubicBezier(a,a.clone(),r.clone(),r)]):[new Hl.Math.CubicBezier(e,o,i,a),new Hl.Math.CubicBezier(a,n,s,r)]},L.defineProperties(Iv.prototype,{length:{get:function(){var t=this._cacheLength;if(!t){t=this._cacheLength=[];for(var e=this._p1,i=0,n=0;i<=1;){var r=this.getPointAt(i+=.001);n+=r.clone().sub(e).length(),e=r,t.push({len:n,t:i,point:r.clone()})}}return t[t.length-1].len}},p1:{get:function(){return this._p1},set:function(t){this._p1=t,this._cacheLength=H}},p2:{get:function(){return this._p2},set:function(t){this._p2=t,this._cacheLength=H}},p3:{get:function(){return this._p3},set:function(t){this._p3=t,this._cacheLength=H}},p4:{get:function(){return this._p4},set:function(t){this._p4=t,this._cacheLength=H}}}),tu=Gl.Default.getInternal().ui().EdgeUI,eu={_47O:function(t){var e=eu.getBackups()._47O;Hl.inEdit(this.gv)||e.call(this,t)}},Hl.Inject.registAsModule(eu,tu),iu=Gl.Default.getInternal().ui().NodeUI,nu={_47O:function(t){var e=nu.getBackups()._47O;Hl.inEdit(this.gv)||e.call(this,t)},getSelectWidth:function(){var t=this.gv,e=this._data;return t.isEditable(e)&&Hl.inEdit(t)?0:nu.getBackup("getSelectWidth").call(this)}},Hl.Inject.registAsModule(nu,iu),ru=Gl.graph.GraphView,ou={_editPointSize:(Iv=Gl.Default.isTouchable,Hl.getStyle("pointSize")[Iv?0:1]),isPointEditable:function(t){if(Hl.inEdit(this))return!this._pointEditableFunc||this._pointEditableFunc(t);ou.getBackup("isPointEditable").call(this,t)},isEditable:function(t){var e=ou.getBackup("isEditable"),e=t instanceof Hl.Group||e.call(this,t);if(!Hl.inEdit(this))return e;if(!(t instanceof Gl.Edge))return e;if(!t.s("2d.editable"))return!1;e=this.getEditableFunc();return!e||e(t)},_42:function(t,e){ou.getBackups()._42.call(this,t,e),Hl.inEdit(this)&&this.getEditInteractor().drawImpl()}},Hl.Inject.registAsModule(ou,ru),au=Gl.Default.getInternal().ui().ShapeUI,su={_47O:function(t){var e=su.getBackups()._47O;Hl.inEdit(this.gv)||e.call(this,t)}},Hl.Inject.registAsModule(su,au),hu=Gl.graph.DefaultInteractor,cu={handle_mousewheel:function(t){var e=cu.getBackup("handle_mousewheel");Hl.inEdit(this.gv)||e.call(this,t)}},Hl.Inject.registAsModule(cu,hu),lu=Gl.graph.MoveInteractor,uu={_calcShift:function(t,e){var i=uu.getBackup("_calcShift"),n=this.gv;return Hl.inEdit(n)&&n.getEditInteractor().getSubModule("Move").calcShift(t,e,this)||i.call(this,t,e)},clear:function(t){uu.getBackup("clear").call(this,t);var e=this.gv;Hl.inEdit(e)&&e.getEditInteractor().getSubModule("Move").clear(t)}},Hl.Inject.registAsModule(uu,lu),(Gv=Hl.Rect=function(t){this.catalog="Rect",this._interactor=t}).prototype={},(Gv.prototype.constructor=Gv).prototype.gatherInfo=function(t,e){if(1!==e.length)return 1<e.length&&this.gatherMultiTargets(t,e);e=e[0];return e instanceof Gl.Shape&&e._70I()?this.gatherLine(t,e):!Sn(e,t)&&this.gatherSingleTarget(t,e)},Gv.prototype.gatherSingleTarget=function(t,e){if(e.getCorners){var i,n=this.info;this.target=e,i=this.screenInfo={};var r,o=e.getCorners();for(r in n.LT=new Hl.Math.Vector2(o[0]),n.LB=new Hl.Math.Vector2(o[1]),n.RB=new Hl.Math.Vector2(o[2]),n.RT=new Hl.Math.Vector2(o[3]),n.T=n.LT.clone().add(n.RT).divideScalar(2),n.B=n.LB.clone().add(n.RB).divideScalar(2),n.L=n.LT.clone().add(n.LB).divideScalar(2),n.R=n.RT.clone().add(n.RB).divideScalar(2),n)i[r]=Hl.toScreenPosition(t,n[r]);var a=this._interactor.getStyle("checkSize"),o=function(t,e,i){e=e.clone().sub(t).setLength(-a),i=i.clone().sub(t).setLength(-a);return e.add(i).add(t)};return i.rotLT=o(i.LT,i.RT,i.LB),i.rotLB=o(i.LB,i.LT,i.RB),i.rotRB=o(i.RB,i.LB,i.RT),i.rotRT=o(i.RT,i.LT,i.RB),i.rotT=i.rotLT.clone().add(i.rotRT).divideScalar(2),i.rotB=i.rotLB.clone().add(i.rotRB).divideScalar(2),i.rotL=i.rotLT.clone().add(i.rotLB).divideScalar(2),i.rotR=i.rotRT.clone().add(i.rotRB).divideScalar(2),i.rotation=e.getRotation(),this.gatherConnectInfo(),!0}},Gv.prototype.gatherConnectInfo=function(){var t,e,i=this.target,n=this._interactor,r=this.screenInfo,o=n.gv;o.isConnectActionVisible(i)&&n.getStyle("connectGuideVisible")&&(i.s&&(t=i.s("connectGuideShift")),t=t||n.getStyle("connectGuideShift"),e=i.getAnchor(),n=i.getSize(),e=i.toGlobal({x:n.width*(t[0]-e.x),y:n.height*(t[1]-e.y)}),e=Hl.toScreenPosition(o,e),r.P1?e.add(r.P2.clone().sub(r.P1).setLength(t[2])):(e.add(r.RT.clone().sub(r.LT).setLength(t[2])),e.add(r.LB.clone().sub(r.LT).setLength(t[3]))),r.connect=e)},Gv.prototype.gatherMultiTargets=function(t,e){e=Hl.Group.findOrCreateGroup(e);if(!e)return!1;return this.editing&&"rotate"!==this.editing.mode||e.calcInfo(),this.gatherSingleTarget(t,e)},Gv.prototype.gatherLine=function(t,e){this.target=e;var i=this.screenInfo={},n=e.getPoints(),e=Hl.getDataMatrix(e);return i.P1=Hl.toScreenPosition(t,e.apply(n.get(0))),i.P2=Hl.toScreenPosition(t,e.apply(n.get(1))),this.gatherConnectInfo(),!0},Gv.ResizeKeys=["LT","RB","LB","RT","L","R","B","T"],Gv.ResizeDirection=[{x:-1,y:-1},{x:1,y:1},{x:-1,y:1},{x:1,y:-1},{x:-1,y:0},{x:1,y:0},{x:0,y:1},{x:0,y:-1}],Gv.RotateKeys=["rotLT","rotRB","rotLB","rotRT","rotL","rotR","rotB","rotT"],Gv.prototype.check=function(t,e,i){if(Gl.Default.isLeftButton(e)){var n=this;if(n.editing=null,n.tipInfo=null,n.screenInfo){var r=n.target,o=t.isEditable(r),a=n.screenInfo;if(o&&a.connect){var s=n._checkConnect(i);if(s)return s}if(a.P1)return n._checkLine(i);var h,c,l=null,s=n._interactor,u=s.getStyle("checkSize");if(o&&t.isRectEditable(r))for(f=0;f<Hl.Rect.ResizeKeys.length;f++)if(c=Hl.Rect.ResizeKeys[f],Hl.checkHit(i,a[c],u)){l=c,h="resize";break}if(!l&&o&&t.isRotationEditable(r)&&!s.getStyle("rotateAsClock"))for(var d=s.getStyle("rotateCheckSize"),f=0;f<Hl.Rect.RotateKeys.length;f++)if(c=Hl.Rect.RotateKeys[f],Hl.checkHit(i,a[c],d)){l=c,h="rotate";break}if(l){if("rotate"===h){var g=t.lp(e);if(r instanceof Hl.Group){var p=s.getStyle("groupRotateModeKey");"string"==typeof p&&(p=[p]);for(var _=!1,v=0,y=p.length;v<y;v++)if(e[p[v]]){_=!0;break}var m=s.getStyle("groupRotateModeDefault"),b=_?"batch"===m?"block":"batch":m}var x="batch"===b?r.getAnchor2():r.getPosition(),m=Math.atan2(g.y-x.y,g.x-x.x);s._setRotateCursor(m),n.editing={mode:h,key:l,pos:x,flipY:r.getScale().y<0,rotation:r.getRotation(),hitRot:m},b&&(n.editing.groupRotateMode=b)}else{g=Hl.Rect.ResizeKeys.indexOf(l),x=Hl.Rect.ResizeDirection[g],m=Math.cos(r.getRotation()),b=Math.sin(r.getRotation()),g=x.x*Math.sign(r.getScale().x),x=x.y*Math.sign(r.getScale().y),g=Math.atan2(-b*g-m*x,m*g-b*x),b=["ew-resize","nesw-resize","ns-resize","nwse-resize","ew-resize","nesw-resize","ns-resize","nwse-resize"][(Math.round(g/(Math.PI/4))+8)%8];this._interactor.setCursor(b);x=r.getWidth(),g=r.getHeight(),b=r.getAnchor();n.editing={mode:h,key:l,rect:{x:-x*b.x,y:-g*b.y,width:x,height:g},anchor:b,matrix:r.getMatrix()}}return l}s.setCursor("default")}}},Gv.prototype._checkLine=function(t){this.screenInfo;var e,i=this._interactor.getStyle("checkSize");if(Hl.checkHit(t,this.screenInfo.P1,i))e="P1";else{if(!Hl.checkHit(t,this.screenInfo.P2,i))return void this._interactor.setCursor("default");e="P2"}return this.editing={mode:"line",key:e},e},Gv.prototype._checkConnect=function(t){var e=this.screenInfo,i=this._interactor,n=i.getStyle("connectGuideIntersectSize"),r=e.connect,o=t.x,e=r.x;if(o<e&&e-o<n&&Math.abs(r.y-t.y)<n||e<=o&&Hl.checkHit(t,r,n)){var a,s=G.getConnectAction(i.gv);return this.editing={mode:"connect"},s&&s.delete&&(this.target instanceof Hl.Group?(a=!0,i.gv.sm().getSelection().each(function(t){s.delete.visible.call(null,i.gv,t)||(a=!1)}),this.editing.hasDeleteAction=a):s.delete.visible.call(null,i.gv,this.target)&&(this.editing.hasDeleteAction=!0)),i.setCursor("default"),"connect"}},Gv.prototype._fireEditEvent=function(t,e){var i=this._interactor,n=this.editing;n&&(n="rotate"===(n=n.mode)?"Rotation":"connect"===n?"Connection":"resize"===n?"Rect":n[0].toUpperCase()+n.slice(1),i.fi({kind:t+"Edit"+n,event:e}))},Gv.prototype.startEdit=function(t,e){t.startDragging(e);this._interactor.fi({kind:"prepareEdit",event:e});var i,n=this.editing,r=this.target;n&&(this._fireEditEvent("begin",e),"rotate"!==n.mode?"connect"!==n.mode?("line"===n.mode||r&&0===r.getRotation())&&(this._inSmartGuide=!0,this._interactor.rectGuide.gatherRects()):n.hasDeleteAction&&(i=t.gv,e=this._interactor.getStyle("connectGuideGarbageShift"),n.garbageInfo={x:i.getWidth()*e[0]+e[2],y:i.getHeight()*e[1]+e[3],size:this._interactor.getStyle("connectGuideGarbageIntersectsize")},t._42()):n.groupRotateMode&&r.beginRotate(n))},Gv.prototype._46O=function(t){var e,i,n=this,r=n.editing,o=n.target;if(r){if("connect"===r.mode&&!r.canceled&&!r.deleted)try{r.garbageInfo&&r.garbageInfo.hover?G.doDeleteConnectionAction(n._interactor.gv,o):G.doConnectAction(n._interactor.gv,o,r.target)}catch(t){console.error(t)}i=r.freezeFlag,e=n.editing.groupRotateMode,n._fireEditEvent("end",t),n.editing=null}n.tipInfo=null,n._inSmartGuide&&(n._interactor.rectGuide.clear(),n._inSmartGuide=!1),e&&o&&o.endRotate(),o instanceof Gl.Block&&(i===H?delete o._freezeSyncFromChildren:o._freezeSyncFromChildren=i,o.updateFromChildren())},Gv.prototype.handleNormalStateDelete=function(){var t=this.editing;if(t&&"connect"===t.mode&&!t.canceled&&!t.deleted){if(t.garbageInfo){try{G.doDeleteConnectionAction(this._interactor.gv,this.target)}catch(t){console.error(t)}t.garbageInfo=null}return t.cursorPos=null,t.targetCorners=null,t.deleted=!0,this._interactor._42(),!0}},Gv.prototype.handleNormalStateKeyDown=function(t){var e=this.editing;return e&&"connect"===e.mode&&!e.canceled&&!e.deleted&&Gl.Default.isEsc(t)?(e.cursorPos=null,e.targetCorners=null,e.canceled=!0,this._interactor._42(),!0):void 0},Gv.prototype.handleEdit=function(e,t){var i=this,n=i.editing;if(n){var r,o,a=i.target,s=n.key,h=n.mode,c=e.lp(t),l=i._interactor;if("connect"===h){if(n.canceled)return;if(n.deleted)return;n.cursorPos=l._getLogicalPoint(t);var u=n.garbageInfo;return u&&Hl.checkHit(n.cursorPos,u,u.size)?(u.hover=!0,n.target=null,n.targetCorners=null):(u&&(u.hover=!1),n.target=e.getDataAt(c,function(t){return!!e.isSelectable(t)&&!!wn(t)})||null,n.targetCorners=Hl.getTargetCornersOnScreen(e,n.target)),void l._42()}if("rotate"===h){var d=n.pos,f=Math.atan2(c.y-d.y,c.x-d.x);p=n.groupRotateMode?f-n.hitRot:(T=f-n.hitRot,n.rotation+T),(p%=2*Math.PI)<0&&(p+=2*Math.PI),Gl.Default.isCtrlDown(t)||(x=gs(t)?(b=l.getStyle("shiftRotateRound"))/2:(b=l.getStyle("rotateRound"),l.getStyle("rotateSensitivity")),p=Hl.roundTo(p,b,x)),n.groupRotateMode?0!==(T=p-(n.lastRotation||0))&&(a.addRotation(T,n.groupRotateMode,function(t){return e.isRotationEditable(t)}),n.lastRotation=p):a.setRotation(p),l._setRotateCursor(f),p>Math.PI&&(p-=2*Math.PI);var g=(p/Math.PI*180).toFixed(2)+"°"}else if("resize"===h){var p,_=n.rect,v=_.x,y=_.y,m=_.width,u=_.height,d=n.anchor,b=n.matrix,x=a.s&&a.s("keepAspectRatio")||l.getStyle("keepAspectRatio");gs(t)&&(x=!x);var w,E,T=i._unionPointMode1,f=i._unionPointMode2;!i._inSmartGuide||Gl.Default.isCtrlDown(t)||x||("L"===s||"R"===s?w="x":"T"!==s&&"B"!==s||(w="y"),i._adsorbedToClosest(c,w),o=!0),p=b.tfi(c),"LT"===s?(_=T(p,{x:v+m,y:y+u},m,u,x),E=9):"T"===s?(_=f({x:v,y:p.y},{x:v+m,y:y+u},m,u,x,"v"),E=1):"RT"===s?(_=T(p,{x:v,y:y+u},m,u,x),E=33):"L"===s?(_=f({x:p.x,y:y},{x:v+m,y:y+u},m,u,x,"h"),E=8):"R"===s?(_=f({x:v,y:y},{x:p.x,y:y+u},m,u,x,"h"),E=32):"LB"===s?(_=T(p,{x:v+m,y:y},m,u,x),E=12):"B"===s?(_=f({x:v,y:y},{x:v+m,y:p.y},m,u,x,"v"),E=4):"RB"===s&&(_=T(p,{x:v,y:y},m,u,x),E=36);d=b.tf(_.x+_.width*d.x,_.y+_.height*d.y);a instanceof Gl.Block&&(n.hasOwnProperty("freezeFlag")||(n.freezeFlag=a._freezeSyncFromChildren,a._freezeSyncFromChildren=!0)),a.setPosition(d),a.setSize(_.width,_.height),o&&(r=a.getRect(),l.rectGuide.gatherLines({node:a,x:r.x,y:r.y,w:r.width,h:r.height},w,E)),g=Math.round(_.width)+" * "+Math.round(_.height)}else if("line"===h){if(gs(t)){var h=a.getPoints(),h="P1"===s?h.get(1):h.get(0),S=c.x-h.x,I=c.y-h.y,C=l.getStyle("shiftLineRotateRound"),M=i._shiftDirList;if(!M||i._shiftRotateRound!==C){i._shiftRotateRound=C,i._shiftDirList=M=[];for(var R=0;R<Math.PI;R+=C)M.push({x:Z(R),y:Q(R)})}for(var A,P=0,D=0,O=M.length;D<O;D++){var B=M[D],z=B.x*S+B.y*I;Math.abs(z)>Math.abs(P)&&(P=z,A=B)}c={x:h.x+A.x*P,y:h.y+A.y*P},l.rectGuide.clear()}else i._inSmartGuide&&!Gl.Default.isCtrlDown(t)&&(i._adsorbedToClosest(c),o=!0);c=Hl.getDataMatrix(a).applyInverse(c);a.setPoint("P1"===s?0:1,c,!0);s=a.getPoints(),c=s.get(0),s=s.get(1);v=c.x-s.x,y=c.y-s.y,g=" "+Math.round(Math.sqrt(v*v+y*y))+" ",o&&(r=a.getRect(),l.rectGuide.gatherLines({node:a,x:r.x,y:r.y,w:r.width,h:r.height}))}g&&((l=Gl.Default.getLogicalPoint(t,l._canvas)).x+=Hl.Icons.TipShiftX,l.y+=Hl.Icons.TipShiftY,i.tipInfo={helperPos:l,text:g,size:g.length}),i._fireEditEvent("between",t)}},Gv.prototype._unionPointMode1=function(t,e,i,n,r){var o;return r&&i&&n&&(o=t.x-e.x,r=t.y-e.y,Math.abs(o*n)<Math.abs(r*i)?(r=Math.sign(r)*Math.abs(o*n/i),t.y=e.y+r):(o=Math.sign(o)*Math.abs(r*i/n),t.x=e.x+o)),Gl.Default.unionPoint(t,e)},Gv.prototype._unionPointMode2=function(t,e,i,n,r,o){var a,e=Gl.Default.unionPoint(t,e);return r&&i&&n&&("v"===o?(a=e.x+e.width/2,e.width=i*e.height/n,e.x=a-e.width/2):(a=e.y+e.height/2,e.height=n*e.width/i,e.y=a-e.height/2)),e},Gv.prototype._adsorbedToClosest=function(t,e){var i=this._interactor,n=i.rectGuide.findClosest(t,e),r=i.gridGuide.findClosest(t,e),i=1/0,e=1/0;n&&(isFinite(n.x)&&(i=n.x),isFinite(n.y)&&(e=n.y)),r&&(isFinite(r.x)&&Math.abs(r.x)<Math.abs(i)&&(i=r.x),isFinite(r.y)&&Math.abs(r.y)<Math.abs(e)&&(e=r.y)),isFinite(i)&&(t.x+=i),isFinite(e)&&(t.y+=e)},Gv.prototype._42=function(t,e,i){var n=this;n.info={},n.screenInfo=null;var r=n._interactor;if(!r.editDetail&&n.gatherInfo(e,i)){var o=n.editing,a=o?o.groupRotateMode:null,i=n.screenInfo;if("block"!==a){if(i.P1?Hl.Icons.DrawIcon(r,t,Hl.Icons.Line,i):Hl.Icons.DrawIcon(r,t,Hl.Icons.Rect,i),i.connect&&(Hl.Icons.DrawIcon(r,t,Hl.Icons.ConnectGuide,{rotation:i.rotation,connect:i.connect,cursorPos:o?o.cursorPos:null}),o)){if(o.targetCorners){for(var s={x:1/0,y:1/0},h={x:-1/0,y:-1/0},c=0,l=o.targetCorners.length;c<l;c+=2)s.x=Math.min(s.x,o.targetCorners[c]),h.x=Math.max(h.x,o.targetCorners[c]),s.y=Math.min(s.y,o.targetCorners[c+1]),h.y=Math.max(h.y,o.targetCorners[c+1]);Hl.Icons.DrawIcon(r,t,Hl.Icons.HoverDataRect,{min:s,max:h,color:r.getStyle("hoverGuideColor")||r.getStyle("baseColor")})}o.garbageInfo&&Hl.Icons.DrawIcon(r,t,Hl.Icons.ConnectGuideGarbage,o.garbageInfo)}n.tipInfo&&Hl.Icons.DrawIcon(r,t,Hl.Icons.TipHelper,n.tipInfo)}n.target instanceof Hl.Group&&n.target._42(r,t,e)}},(Gv=Hl.Anchor=function(t){this.catalog="Anchor",this._interactor=t}).prototype={},(Gv.prototype.constructor=Gv).prototype.gatherInfo=function(t,e){if(1!==e.length)return 1<e.length&&this.gatherMultiTargets(t,e);var i=e[0];return!i.getAnchor||i instanceof Gl.Shape&&i._70I()||Sn(i,t)?void 0:this.gatherSingleTarget(t,e[0])},Gv.prototype.gatherSingleTarget=function(t,e){return this.info.POS=e.getPosition(),this.screenInfo.POS=Hl.toScreenPosition(t,this.info.POS),this.target=e,!0},Gv.prototype.gatherMultiTargets=function(t,e){e=Hl.Group.findOrCreateGroup(e);return!!e&&(this.screenInfo.POS=Hl.toScreenPosition(t,e.getAnchor2()),this.target=e,!0)},Gv.prototype.isVisible=function(){var t=this._interactor;if(!1===t.getStyle("anchorVisible"))return!1;var e=this.target;if(e){if(this.editing)return!0;var i=e.getAnchor(),n=t.getStyle("anchorOutsideVisibleThreshold");if(i.x<-n||i.x>1+n||i.y<-n||i.y>1+n)return!0;n=e.getSize(),e=e.getScale();if(Math.min(Math.abs(n.width*e.x),Math.abs(n.height*e.y))*t.gv._zoom<t.getStyle("anchorHideThreshold"))return!1}return!0},Gv.prototype.check=function(t,e,i){if(Gl.Default.isLeftButton(e)){var n=this._interactor;if(this.isVisible()&&!1!==n.getStyle("anchorMovable")){this.editing=null,this.tipInfo=null;e=this.target;if(e&&t.isAnchorEditable(e)&&t.isEditable(e))if(this.screenInfo&&(r=this.screenInfo.POS)&&Hl.checkHit(i,new Hl.Math.Vector2(r),n.getStyle("checkSize"))){if(e instanceof Hl.Group)return this.editing={},!0;var i=e.getWidth(),r=e.getHeight(),n=e.getAnchor();return this.editing={rect:{x:-i*n.x,y:-r*n.y,width:i,height:r},anchor:n,matrix:e.getMatrix()},!0}}}},Gv.prototype.startEdit=function(t,e){t.startDragging(e),t.fi({kind:"beginEditAnchor",event:e})},Gv.prototype._46O=function(t){this.editing&&(this.editing=null,this._interactor.fi({kind:"endEditAnchor",event:t})),this.tipInfo=null},Gv.prototype.handleEdit=function(t,e){var i=this.target;if(i){var n=this.editing;if(n){var r=t.lp(e),o=this._interactor;if(i instanceof Hl.Group)return i.setAnchor2(r),void o._42();var a=n.matrix.tfi(r),t=n.rect,r=(a.x-t.x)/t.width,n=(a.y-t.y)/t.height;Gl.Default.isCtrlDown(e)||(a=o.getStyle("anchorRound"),t=o.getStyle("anchorSensitivity"),r=Hl.roundTo(r,a,t),n=Hl.roundTo(n,a,t)),i.setAnchor(r,n,!0);i=Gl.Default.getLogicalPoint(e,o._canvas);i.x+=Hl.Icons.TipShiftX,i.y+=Hl.Icons.TipShiftY;n=r.toFixed(2)+", "+n.toFixed(2);this.tipInfo={helperPos:i,text:n,size:n.length},o.fi({kind:"betweenEditAnchor",event:e})}}},Gv.prototype._42=function(t,e,i){this.info={},this.screenInfo={};var n=this._interactor;n.editDetail||this.gatherInfo(e,i)&&this.isVisible()&&(Hl.Icons.DrawIcon(n,t,Hl.Icons.Anchor,this.screenInfo),this.tipInfo&&Hl.Icons.DrawIcon(n,t,Hl.Icons.TipHelper,this.tipInfo))},(Gv=Hl.MoveDummy=function(t){this.catalog="MoveDummy",this._interactor=t}).prototype={},(Gv.prototype.constructor=Gv).prototype.gatherInfo=function(){var t=this._interactor.getSubModule("Rect");if(t){var e=t.screenInfo;if(e){var i=this._interactor;if(this.getMovableTarget(t.target)){var n=i.getStyle("moveDummyThreshold");if(!1!==n){var r=e.LT||e.P1,o=e.RT||e.P2,a=e.LB||r;if(r){var s=e.P1,t=Math.min(r.distanceTo(a),r.distanceTo(o));if(!(!0!==n&&n<t)){e=i.getStyle("moveDummyPosition"),n=o.clone().sub(r),t=a.clone().sub(r),o=e[2],a=e[3];!s||(s=i.getStyle("moveDummyLineExtraShift"))&&(o+=s[0],a+=s[1]);a=r.clone().add(n.clone().multiplyScalar(e[0])).add(n.setLength(o)).add(t.clone().multiplyScalar(e[1])).add(t.setLength(a));return this.screenInfo.pos=a,this.screenInfo.size=i.getStyle("moveDummySensitivity"),!0}}}}}}},Gv.prototype.getMovableTarget=function(t){var e=this._interactor.gv;if(wn(t)){if(e.isMovable(t))return t}else if(t instanceof Hl.Group)for(var i=t._entities,n=i.length-1;0<=n;n--){var r=i[n];if(wn(r)&&e.isMovable(r))return r}return null},Gv.prototype.getMoveInteractor=function(){for(var t,e=this._interactor.gv.getInteractors(),i=0,n=e.length;i<n;i++)if((t=e.get(i))instanceof lu)return t},Gv.prototype.startEdit=function(t,e){t.startDragging(e);var i,n=this.getMoveInteractor();n&&(i=this.selectedTarget,(t=t.gv)._moving=1,n._data=i,t.handleMouseDown&&t.handleMouseDown(e,i))},Gv.prototype._46O=function(t){var e=this.getMoveInteractor();e&&(e.handleWindowMouseUp(t),this.selectedTarget=null)},Gv.prototype.handleEdit=function(t,e){var i=this.getMoveInteractor();i&&i.handleWindowMouseMove(e)},Gv.prototype.check=function(t,e,i){if(this.selectedTarget=null,Gl.Default.isLeftButton(e)&&!t._scrolling&&!Hr())if(this.screenInfo){t=this.screenInfo.pos;if(t&&!(i.distanceTo(t)>this.screenInfo.size)){t=this._interactor;return this.selectedTarget=this.getMovableTarget(t.getSubModule("Rect").target),t.setCursor("default"),!0}}},Gv.prototype._42=function(t,e,i){this.screenInfo={};var n=this._interactor;n.editDetail||!this.gatherInfo(e,i)||n.editing&&!this.selectedTarget||Hl.Icons.DrawIcon(n,t,Hl.Icons.MoveDummy,this.screenInfo)},(Gv=Hl.RotateX=function(t){this.catalog="RotateX",this._interactor=t}).prototype={},(Gv.prototype.constructor=Gv).prototype.gatherInfo=function(t,e){if(1!==e.length)return 1<e.length&&this.gatherMultiTargets(t,e);e=e[0];return!(e instanceof Gl.Shape&&e._70I()||Sn(e,t))&&this.gatherSingleTarget(t,e)},Gv.prototype.gatherSingleTarget=(wv=new Gl.Math.Vector2,Ev=new Gl.Math.Vector2,Tv=new Gl.Math.Vector2,Sv=new Gl.Math.Vector2,function(t,e){if(e.getCorners){var i=e.getCorners(),n=e.getPosition();wv.copy(i[0]),Tv.copy(i[1]),Sv.copy(i[3]),Ev.copy(wv).add(Sv).divideScalar(2).add(wv.sub(Tv).setLength(15/t.getZoom()));i=Math.max(Mm(n,i[0]),Mm(n,i[1]),Mm(n,i[2]),Mm(n,i[3]));return this.info.POS=Ev.clone(),this.screenInfo.POS=Hl.toScreenPosition(t,this.info.POS),this.screenInfo.LEN=Math.sqrt(i)*t.getZoom()+15,this.screenInfo.CENTER=Hl.toScreenPosition(t,n),this.target=e,!0}}),Gv.prototype.gatherMultiTargets=function(t,e){e=Hl.Group.findOrCreateGroup(e);if(!e)return!1;return this.gatherSingleTarget(t,e)},Gv.prototype.isVisible=function(){var t=this._interactor;if(!t.getStyle("rotateAsClock"))return!1;var e=this.target;if(!e)return!0;t=t.gv;return!(!t.isEditable(e)||!t.isRotationEditable(e))},Gv.prototype.check=function(t,e,i){i=this._checkImpl(t,e,i);return(i||this._clockPainted)&&this._interactor._42(),i},Gv.prototype._checkImpl=function(t,e,i){if(Gl.Default.isLeftButton(e)){var n=this;if(n.editing=null,n.tipInfo=null,n.screenInfo&&(o=n.screenInfo.POS)&&n.isVisible()){var r=n._interactor;if(Hl.checkHit(i,o,r.getStyle("checkSize"))){var o=n.target,t=t.lp(e),e=o.getPosition(),t=Math.atan2(t.y-e.y,t.x-e.x);return r._setRotateCursor(t),n.editing={pos:e,rotation:o.getRotation(),hitRot:t,groupRotateMode:"block",screenInfo:{CENTER:n.screenInfo.CENTER,LEN:n.screenInfo.LEN}},!0}}}},Gv.prototype.startEdit=function(t,e){t.startDragging(e),t.fi({kind:"beginEditRotation",event:e}),this.target instanceof Hl.Group&&this.target.beginRotate(this.editing)},Gv.prototype._46O=function(t){this.editing&&(this.editing=null,this._interactor.fi({kind:"endEditRotation",event:t})),this.target instanceof Hl.Group&&this.target.endRotate(),this.tipInfo=null},Gv.prototype.handleEdit=function(e,t){var i,n,r,o,a,s,h,c,l=this.editing;l&&(n=this.target,c=e.lp(t),r=this._interactor,s=l.pos,h=Math.atan2(c.y-s.y,c.x-s.x),c=(o=n instanceof Hl.Group)?h-l.hitRot:(i=h-l.hitRot,l.rotation+i),(c%=2*Math.PI)<0&&(c+=2*Math.PI),Gl.Default.isCtrlDown(t)||(s=gs(t)?(a=r.getStyle("shiftRotateRound"))/2:(a=r.getStyle("rotateRound"),r.getStyle("rotateSensitivity")),c=Hl.roundTo(c,a,s)),o?0!==(i=c-(l.lastRotation||0))&&(n.addRotation(i,l.groupRotateMode,function(t){return e.isRotationEditable(t)}),l.lastRotation=c):n.setRotation(c),r._setRotateCursor(h),c>Math.PI&&(c-=2*Math.PI),h=(c/Math.PI*180).toFixed(2)+"°",(c=Gl.Default.getLogicalPoint(t,r._canvas)).x+=Hl.Icons.TipShiftX,c.y+=Hl.Icons.TipShiftY,this.tipInfo={helperPos:c,text:h,size:h.length},r.fi({kind:"betweenEditRotation",event:t}))},Gv.prototype._42=function(t,e,i){var n=this;n._clockPainted=!1,n.info={},n.screenInfo={};var r=n._interactor;r.editDetail||n.gatherInfo(e,i)&&n.isVisible()&&(Hl.Icons.DrawIcon(r,t,Hl.Icons.RoundPoint,n.screenInfo.POS),n.tipInfo&&Hl.Icons.DrawIcon(r,t,Hl.Icons.TipHelper,n.tipInfo),n.editing&&n.drawClock(t))},Gv.prototype.drawClock=function(t){t.save();this._clockPainted=!0;var e=this.editing||{},i=e.screenInfo||this.screenInfo,n=i.LEN,r=n+8,o=n+18;t.save(),t.translate(i.CENTER.x,i.CENTER.y),t.beginPath(),t.strokeStyle="rgb(150, 150, 150)";for(var a,s,h,c,l,u=0;u<360;u++)a=u*Math.PI/180,0==u%5&&(s=Q(a)*n,h=Z(a)*n,c=Q(a)*r,l=Z(a)*r,t.moveTo(s,h),t.lineTo(c,l)),0==u%45&&(s=Q(a)*n,h=Z(a)*n,c=Q(a)*o,l=Z(a)*o,t.moveTo(s,h),t.lineTo(c,l));t.stroke(),t.rotate(-I);e=e.lastRotation||this.target.getRotation();t.beginPath(),t.fillStyle="rgba(255, 0, 0, 0.1)",t.strokeStyle="rgb(157, 157, 157)",t.moveTo(0,0),t.arc(0,0,o,0,e,!1),t.fill(),t.beginPath(),t.moveTo(0+o,0),t.arc(0,0,o,0,e,!1),t.stroke(),t.restore()},(du=Hl.Curve=function(t){this.catalog="Curve",this._interactor=t}).prototype={},du.prototype.constructor=du,L.defineProperties(du.prototype,{activing:{get:function(){return this._activing},set:function(t){t?(this._activing=new Hl.CurveActiving(this,t),this._activing._firePointChange()):((t=this._activing)&&t.dispose(),this._activing=null)}}}),du.PointType={Mirrored:0,Straight:1,Disconnected:2,Asymmetric:3},du.prototype.setUp=function(){var t=this._interactor;t&&t.gv.mp(this._onGraphviewPropertyChanged,this)},du.prototype._onGraphviewPropertyChanged=function(t){"zoom"!==t.property&&"translateX"!==t.property&&"translateY"!==t.property||this._handleDataChanged()},du.prototype.tearDown=function(){var t=this._interactor;t&&t.gv.ump(this._onGraphviewPropertyChanged,this)},du.prototype.canEnterEditDetailMode=function(){var t=this._interactor,e=t._getValidSelection();if(1===e.length){var i=e[0],e=i instanceof Gl.Edge;if(i instanceof Gl.Shape||e){if(e){e=i.s("edge.type");if(e&&"points"!==e)return}t=t.gv;if(t.isPointEditable(i)&&t.isEditable(i))return this.target=i,!0}}},du.prototype.canQuitEditDetailMode=function(t){var e=this._interactor._getLogicalPoint(t);return!this._checkEditRealPoint(e)&&this._interactor.gv.getDataAt(t)!==this.target||void 0},du.prototype.preHandleScroll=function(){var t=this.editing;return!(!t||!t.inEdit)||void 0},du.prototype.getCurrentSelectintStatus=function(){var i=this;if(i.activing&&!i.activing.selections){if(i.activing.status!=H)return i.activing.status;var t=function(t){var e=i.activing.status;i.activing.status=t,i._interactor.fp("shapePointStatus",e,t)},e=Hl.Curve.PointType,n=i.activing.point,r=i.activing.pairs;if(!r||1!==r.length)return t(e.Mirrored);var o=r[0],a=o.c1&&o.c1.isNearEnough(n),r=o.c2&&o.c2.isNearEnough(n);if(!o.c1||!o.c2)return t(a||r?e.Straight:e.Disconnected);if(a&&r)return t(e.Straight);if(a||r)return t(e.Asymmetric);r=o.c1.clone().sub(n),n=o.c2.clone().sub(n);return 1e-5<Math.abs(r.x*n.y-r.y*n.x)||0<r.x*n.x?t(e.Disconnected):1e-5<Math.abs(r.length()-n.length())?t(e.Asymmetric):t(e.Mirrored)}},du.prototype.handle_keydown=function(t){var e;this._interactor.editDetail&&(e=Hl.Curve.PointType,"1"===t.key?this._setCurrentSelectionStatus(e.Straight):"2"===t.key?this._setCurrentSelectionStatus(e.Mirrored):"3"===t.key?this._setCurrentSelectionStatus(e.Disconnected):"4"===t.key&&this._setCurrentSelectionStatus(e.Asymmetric))},du.prototype.setCurrentSelectionStatus=function(t){var e=this._interactor;e&&((e=e.gv).dm().beginTransaction(),this._setCurrentSelectionStatus(t),e.dm().endTransaction())},du.prototype._setCurrentSelectionStatus=function(t){var e=this,i=e.activing;if(i){var n=e.getCurrentSelectintStatus();if(null!==n&&n!==t){i.status=t;var r=e.activing.point,o=e.activing.pairs;if(o&&1===o.length){var a=o[0],s=e.screenInfo.curve,h=Hl.Curve.PointType,c=e._interactor,o=function(){e._writeToHt(),c.fp("shapePointStatus",n,t),e.check(c.gv,null,new Hl.Math.Vector2(c._lastLogicalPoint))};if(t===h.Straight)return s.moveCtrlPoint(a,r,"c1"),s.moveCtrlPoint(a,r,"c2"),void o();if(n===h.Straight){var l=s.findPairs(r,!0)[0],u=l.r1||r,d=(l.r2||r).clone().sub(u).multiplyScalar(.25);return s.moveCtrlPoint(a,r.clone().sub(d),"c1"),s.moveCtrlPoint(a,r.clone().add(d),"c2"),void o()}l=a.c1,u=a.c2;if(l&&u){if(t===h.Mirrored)return s.moveCtrlPoint(a,r.clone().multiplyScalar(2).sub(u),"c1"),void o();if(t===h.Asymmetric&&n===h.Disconnected){l=l.clone().sub(r).length(),d=r.clone().sub(u).setLength(l).add(r);return s.moveCtrlPoint(a,d,"c1"),void o()}}i._firePointChange(),c.fp("shapePointStatus",n,t),e.check(c.gv,null,new Hl.Math.Vector2(c._lastLogicalPoint))}}}},du.prototype._handleDataChanged=(xv="s:edge.points,s:edge.segments,points,segments,shape,position,rotation,scale".split(","),function(t){this.screenInfo&&this.target&&(t&&xv.indexOf(t.property)<0||(t=this._interactor,this.gatherSingleTarget(t.gv,this.target,!0),this.check(t.gv,null,new Hl.Math.Vector2(t._lastLogicalPoint)),t._42()))}),du.prototype.gatherSingleTarget=function(e,t,i){var n,r=this;r.screenInfo&&r.screenInfo.curve&&(n=r.screenInfo.curve._curves);var o,a=r.editing,s=a?r.screenInfo:r.screenInfo={},h=t instanceof Gl.Edge,c=h?(o=t.s("edge.segments"),t.s("edge.points")||new Gl.List):(o=t._58O,t._59O);s.S=o;var l,u,d=s.P=[],f=Hl.getDataMatrix(t);if(t instanceof Gl.Polyline||t instanceof Gl.Edge&&r._interactor.getStyle("edgeElevationEditable")?(l=t.getElevation&&t.getElevation()||0,s.E=[]):(u=!1,c.each(function(t){t.e!==H&&(u=!0)}),u&&(s.E=[])),c.each(function(t){s.E&&s.E.push(t.e!=H?t.e:l),t=f.apply(t);t=Hl.toScreenPosition(e,t);d.push(t.x,t.y)}),h&&(c=d.length,h=Hl.toScreenPosition(e,t._lastSourcePoint||(c?{x:d[0],y:d[1]}:{x:0,y:0})),c=Hl.toScreenPosition(e,t._lastTargetPoint||(c?{x:d[c-2],y:d[c-1]}:{x:0,y:0})),d.splice(0,0,h.x,h.y),d.push(c.x,c.y),s.E&&(s.E.splice(0,0,"head"),s.E.push("tail"))),!s.S||!s.S.size()){s.S=new Gl.List,s.S.add(1);for(var g=0;g<d.length/2-1;g++)s.S.add(2)}a&&!i||r.convertToCubicBezier(n),!r.activing||!i&&r.editing&&"realPoint"!==r.editing.type||(i=s.curve.findPairs(r.activing.point),r.activing.pairs=i)},du.prototype._convertToNewPoint=function(t,e,i,n){for(var r,o=0,a=e.length;o<a;o++){if((r=e[o])._p1.isNearEnough(t)&&(!n||n.indexOf(r._p1)<0))return r._p1;if(r._p4.isNearEnough(t)&&(!n||n.indexOf(r._p4)<0))return r._p4}if(i)for(o=0,a=Math.min(i.length,a);o<a;o++){if((r=i[o])._p1===t&&(!n||n.indexOf(e[o]._p1)<0))return e[o]._p1;if(r._p4===t&&(!n||n.indexOf(e[o]._p4)<0))return e[o]._p4}},du.prototype.convertToCubicBezier=function(e){var i,n,r,o,a,s=this,t=new Hl.Math.Curve,h=s.screenInfo;t.createFromHtShape(h.P,h.S,h.E),h.curve=t,s.activing&&(i=t._curves,t=s.activing.point,n=s._convertToNewPoint(t,i,e),r=[],n&&(s.activing.point=n,r.push(n)),s.activing.selections&&(o=-1,(a=s.activing.selections).forEach(function(t){o++,(n=s._convertToNewPoint(t,i,e,r))&&(a[o]=n,r.push(n))})))},du.prototype.check=function(t,e,i){if(!e||cs(e)||ls(e)){var n=this;if(n._interactor.setCursor("default"),n.editing=null,n.highlight=null,n.tipInfo=null,n.edgeEditResult=null,n.screenInfo){if(Hr()||e&&ls(e))return n._interactor._42(),!0;if(n._checkEditCtrlPoint(i))return n._interactor._42(),!0;if(n._checkEditRealPoint(i))return n._interactor._42(),!0;if(n._checkEditElevation(i))return n._interactor._42(),!0;e=n.screenInfo.curve.checkPoint(i,n._interactor.getStyle("curveIntersectSize"));return e&&((i=n.highlight={}).type="insertKnot",i.bezier=e.bezier,i.point=e.intersection),n._interactor._42(),!0}}},du.prototype.getAdjacentBeziers=function(t){var e=this.screenInfo;if(e)for(var i,n=e.curve._curves,r=[],o=H,a=0,s=n.length;a<s;a++)if(i=n[a],o===H){if(i._p4.isNearEnough(t)){r.push(i),o=a;continue}}else{if(i._p1.isNearEnough(t))return r.push(i),r;if(i._p4.isNearEnough(t)){r[0]=i,o=a;continue}}},du.prototype.roundCorner=function(t){var e,i,n,r,o;this.activing&&this.screenInfo&&(e=this.screenInfo.curve._curves,i=(r=(n=this.getAdjacentBeziers(this.activing.point))[1])._index,r=r.insertKnot(r.getTByPercentage(t/r.length))[1],o=(e[i]=r).p1,n=(r=n[0])._index,r=r.insertKnot(r.getTByPercentage(1-t/r.length))[0],n=(e[n]=r).p4,r=this.activing.point,o=new Hl.Math.CubicBezier(n,r.clone().sub(n).multiplyScalar(2/3).add(n),r.clone().sub(o).multiplyScalar(2/3).add(o),o),e.splice(i,0,o),this._writeToHt(),this.activing=null,this._interactor._42())},du.prototype._checkEditRealPoint=function(t){var e,i,n,r,o,a,s=this.screenInfo.curve._curves,h=this._interactor.getStyle("curvePointIntersectSize"),c=1/0;for(h*=h,n=0,r=s.length;n<r;n++)o=(e=s[n])._p1,(a=t.distanceToSquared(o))<c&&(c=a,i=o),o=e._p4,(a=t.distanceToSquared(o))<c&&(c=a,i=o);if(h<c)return!1;h=this.highlight={};return h.type="changeRealPoint",h.point=i,this.editing={type:"realPoint",point:i,shiftGuide:{point:i.clone(),dir:"x",limit:0}},this._interactor.setCursor("crosshair"),!0},du.prototype._checkEditElevation=function(t){if(!this._interactor.getStyle("curveElevationVisible"))return!1;if(this.target instanceof Gl.Edge&&!this._interactor.getStyle("edgeElevationEditable"))return!1;var e=this.activing;if(!e)return!1;var i=e.getCurrentEditingPoint();if(!i)return!1;var n=this._interactor,e=n.getStyle("curveElevationGuideShift"),n=n.getStyle("curveElevationIntersectSize");if(!(n*n<t.distanceToSquared({x:i.x+e[0],y:i.y+e[1]}))){(this.highlight={}).type="elevation";i=new Hl.Math.Vector2(t.x,t.y,i.e);return this.editing={type:"elevation",startPoint:i},this._interactor.setCursor("crosshair"),!0}},du.prototype._checkEditCtrlPoint=function(t){var e=this;if(e.activing&&!e.activing.selections&&e.getCurrentSelectintStatus()!==Hl.Curve.PointType.Straight){var i=e.activing.pairs;if(i){var n=e._interactor.getStyle("curvePointIntersectSize");n*=n;for(var r,o,a,s,h,c,l,u=1/0,d=0,f=i.length;d<f;d++)for(s=i[d],l=0;l<2;l++)s[h=0===l?"c1":"c2"]&&((c=t.distanceToSquared(s[h]))<u&&(u=c,r=s,o=d,a=h));if(n<u)return!1;e.activing.hlpair=r,e.activing.hltype=a;n=e.highlight={};return n.type="changeCtrlPoint",n.point=r[a],e.editing={type:"ctrlPoint",pair:r,pairId:o,ctrlType:a,direction:r[a].clone().sub(e.activing.point).normalize()},e._interactor.setCursor("crosshair"),!0}}},du.prototype.startEdit=function(t,e){t.startDragging(e);var i=this;i.highlight&&"insertKnot"===i.highlight.type&&(i.insertKnot(),i.gatherSingleTarget(i._interactor.gv,i.target),i.activing=null,i._checkEditRealPoint(i._interactor._getLogicalPoint(e)));var n=i._activing;n&&("ctrlPoint"===(s=i.editing?i.editing.type:null)?n.editingCtrl={pairId:i.editing.pairId,type:n.hltype}:"realPoint"===s&&(n.editingCtrl=!1));var r,o,a=i.highlight,s=Gl.Default.isCtrlDown(e);if(!a||Hr()||ls(e)){var h=i._interactor.gv;return!h.setFocus(e)||h._scrolling?void 0:void(s?i._multiSelect={startPoint:h.lp(e)}:h.isPannable()&&(cs(e)||ls(e))&&(i._pan={tx:h.tx(),ty:h.ty()},t.fi({kind:"beginPan",event:e})))}"changeRealPoint"===a.type&&(n=i.activing?i.activing.point:null,h=i.activing?i.activing.selections:null,s&&i.activing?n===a.point?(h?(i.activing={point:h[0]},1<h.length&&(h.splice(0,1),i.activing.selections=h)):i.activing=null,i.editing=null):h&&0<=(r=h.indexOf(a.point))?(1<h.length?h.splice(r,1):delete i.activing.selections,i.editing=null):h?(h.push(n),i.activing={point:a.point,selections:h}):i.activing={point:a.point,selections:[n]}:h?n===a.point||(0<=(r=h.indexOf(a.point))?(h.splice(r,1,n),i.activing={point:a.point,selections:h}):i.activing={point:a.point}):(n===a.point&&(o=i.activing.status),i.activing={point:a.point},o&&(i.activing.status=o)),t.fi({kind:"beginEditPoint",event:e}))},du.prototype.insertKnot=function(){var t=this.highlight;this.screenInfo.curve.insertKnot(t.bezier,t.point.t),this._writeToHt()},du.prototype._writeToHt=function(){var t,e,i=this.screenInfo.curve.toHtShape(),n=i.points,r=[],o=i.segments,a=this._interactor.gv;a.dm().beginTransaction();var s,h=this.target,i=h instanceof Gl.Edge,c=Hl.getDataMatrix(h).invert();(h instanceof Gl.Polyline||h instanceof Gl.Edge&&this._interactor.getStyle("edgeElevationEditable"))&&(s=h.getElevation&&h.getElevation()||0);for(var l=0,u=n.length;l<u;l++)t=n[l],e=Hl.toWorldPosition(a,t),e=c.apply(e),isFinite(t.e)&&t.e!==s&&(e.e=t.e),r.push(e);h._writing=!0,i?(h.s("edge.type","points"),h.setStyle("edge.segments",o),h.setStyle("edge.points",r.slice(1,r.length-1)),h.setStyle("edge.source.offset.x",0),h.setStyle("edge.source.offset.y",0),h.setStyle("edge.target.offset.x",0),h.setStyle("edge.target.offset.y",0),i=this._nextChangeEdgeHost,delete this._nextChangeEdgeHost,i&&("source"===i.type?h.setSource(i.host):h.setTarget(i.host)),this._writeEdgeHostAnchor("source",r[0]),this._writeEdgeHostAnchor("target",r[r.length-1])):r.length?(h.setSegments(o),h.setPoints(r,!0)):h.removeFromDataModel(),a.dm().endTransaction(),delete h._writing},du.prototype._writeEdgeHostAnchor=function(t,e){var i=this.target,e=this._calcHostAnchor(i,t,e);e.index!==H?(i.setStyle("edge."+t+".index",e.index),i.setStyle("edge."+t+".percent",H),i.setStyle("edge."+t+".anchor.x",H),i.setStyle("edge."+t+".anchor.y",H)):e.percent!==H?(i.setStyle("edge."+t+".percent",e.percent),i.setStyle("edge."+t+".index",H),i.setStyle("edge."+t+".anchor.x",H),i.setStyle("edge."+t+".anchor.y",H)):(i.s("edge."+t+".anchor.x",e.x),i.s("edge."+t+".anchor.y",e.y),e.offsetX||e.offsetY?(i.s("edge."+t+".offset.x",e.offsetX),i.s("edge."+t+".offset.y",e.offsetY)):(i.s("edge."+t+".offset.x",0),i.s("edge."+t+".offset.y",0)))},du.prototype._calcHostAnchor=function(t,e,i,n){n=n||("source"===e?t.getSource():t.getTarget());var r=this._interactor.gv,o=r.calculateAttachPoint(n,i);if(o)return o.info;if(En(n))return r.calculateEdgePosition(n,i);e=n.getRotation(),t=n.getAnchor();Sn(n,r)&&(e=0);o=n.getScale();if(e||o.x<0||o.y<0){e=n.getMatrix().tfi(i),o=n.getSize();return{x:e.x/o.width+t.x,y:e.y/o.height+t.y}}n=Gh(r,n);return{x:(i.x-n.x)/n.width,y:(i.y-n.y)/n.height}},du.prototype._handlePanning=function(t){var e,i,n,r,o=this._pan;o&&(o.started=!0,i=(e=this._interactor).gv,r=e._lastClientPoint,n=_s(t),r=cc(i,n,r),i.setTranslate(o.tx+r.x,o.ty+r.y),this.gatherSingleTarget(e.gv,this.target),e._42(),e.fi({kind:"betweenPan",event:t}))},du.prototype.handleEdit=function(t,e){var i,n,r,o,a,s,h,c,l,u,d,f,g,p,_,v,y,m,b,x,w,E=this,T=E.editing;{if(!E._pan)return E._multiSelect?(E._multiSelect.endPoint=t.lp(e),void E._interactor.redraw()):void(T&&(T.inEdit=!0,x=E._interactor._getLogicalPoint(e),c=Gl.Default.isCtrlDown(e),s=Gl.Default.isShiftDown(e),i=T.type,n=E.activing,E._guideInfo=null,"ctrlPoint"===i&&s?(r=E.editing.direction.clone(),m=n.point,y=r.dot(x.clone().sub(m)),x=r.setLength(y).add(m)):"ctrlPoint"!==i&&"realPoint"!==i||("realPoint"===i&&s&&(a=(o=E.editing.shiftGuide).point,s=Math.abs(x.x-a.x),(h=Math.abs(x.y-a.y))<s&&s>o.limit&&"y"===o.dir&&(o.dir="x"),s<h&&h>o.limit&&"x"===o.dir&&(o.dir="y"),"x"===(r=o.dir)?(x.y=a.y,o.limit=Math.max(o.limit,s)):"y"===r&&(x.x=a.x,o.limit=Math.max(o.limit,h))),(h=E._isEditEdgeSourceTarget())?(h=E._editEdgeSourceTarget(h,x,c))&&(w=(E.edgeEditResult=h).tipText):c||(_=E._guidingToEdit(x,r),g=c=1/0,(p="realPoint"===i?E._interactor.gridGuide.findClosest(x,r,!0):null)&&(p.x&&(c=p.x),p.y&&(g=p.y)),p=!1,_&&(_.xList&&(Math.abs(_.x)<=Math.abs(c)?(p=!0,c=_.x):delete _.xList),_.yList&&(Math.abs(_.y)<=Math.abs(g)?(p=!0,g=_.y):delete _.yList),p&&(E._guideInfo=_)),isFinite(c)&&(x.x+=c),isFinite(g)&&(x.y+=g),p&&(_.v=x))),l=E.screenInfo.curve,"realPoint"===T.type?((m=T.point).e!==H&&(x.e=m.e),l.moveRealPoint(m,x),T.point=x,E.highlight.point=x,v=n.status,u=n.selections,E.activing={point:x,status:v},u&&(d=x.clone().sub(m),f=0,u.forEach(function(t){var e=t.clone().add(d);l.moveRealPoint(t,e),u[f++]=e}),E.activing.selections=u)):"ctrlPoint"===T.type?(g=n.pairs[T.pairId],l.moveCtrlPoint(g,x,T.ctrlType),((p=n.status)===(_=Hl.Curve.PointType).Mirrored||p===_.Asymmetric)&&g.c1&&g.c2&&(m=new Hl.Math.Vector2(n.point),v="c1"===T.ctrlType?"c2":"c1",p===Hl.Curve.PointType.Mirrored?l.moveCtrlPoint(g,m.clone().multiplyScalar(2).sub(x),v):p===_.Asymmetric&&(y=g[v].clone().sub(m).length(),m=m.clone().sub(g[T.ctrlType]).setLength(y).add(m),isNaN(m.x)||l.moveCtrlPoint(g,m,v))),n._firePointChange()):"elevation"===T.type&&(b=(a=T.startPoint).e+(a.y-x.y)/t._zoom,E._setCurrentPointImpl("e",b),n._firePointChange(),w="E: "+Hl.toFixed(b)),(b=Gl.Default.getLogicalPoint(e,E._interactor._canvas)).x+=Hl.Icons.TipShiftX,b.y+=Hl.Icons.TipShiftY,w||(x=Hl.toWorldPosition(t,x),w=Hl.toFixed(x.x)+", "+Hl.toFixed(x.y)),E.tipInfo={helperPos:b,text:w,size:w.length},E._writeToHt(),E._interactor.fi({kind:"betweenEditPoint",event:e})));E._handlePanning(e)}},du.prototype._setCurrentPointImpl=function(t,e){var i=this._activing;if(!i)return!1;var n=this.target;if(!n)return!1;var r=i.getCurrentEditingPoint();if(!r)return!1;var o,a,s,h,c,l,u=i.editingCtrl;return u||(o=r.clone()),"e"===t?r.e=e:("x"===t||"y"===t?(a=i._lastFirePoint,a="x"===t?{x:e,y:a?a.y:0}:{x:a?a.x:0,y:e}):"object"==typeof t?(a=t).e!==H&&(r.e=t.e):(a={x:t,y:e},arguments[2]!==H&&(r.e=arguments[2])),e=Hl.getDataMatrix(n),a=Hl.toScreenPosition(this._interactor.gv,e.apply(a)),r.x=a.x,r.y=a.y),u||(s=o.multiplyScalar(-1).add(r),r.e&&o.e&&(s.e=r.e-o.e),(h=this.screenInfo.curve).moveCtrlDueToRealPointMovement(r,s),(c=i.selections)&&(l=0,c.forEach(function(t){var e=t.clone().add(s);isFinite(s.e)&&(e.e=(isFinite(t.e)?t.e:n.getElevation()||0)+s.e),h.moveRealPoint(t,e),c[l++]=e}),i.selections=c)),!0},du.prototype.setCurrentPoint=function(t,e){return!!this._setCurrentPointImpl(t,e)&&(this._writeToHt(),!0)},du.prototype._isEditEdgeSourceTarget=function(){if(!(this.target instanceof Gl.Edge))return!1;var t=this.editing.point,e=this.screenInfo.curve._curves;return t===e[0]._p1?"source":t===e[e.length-1]._p4&&"target"},du.prototype._editEdgeSourceTarget=function(e,t,i){var n=this,r=n.target;if(a="source"===e?r.getSource():r.getTarget()){var o,a,s,h,c,l,u=n._interactor.gv,d=Hl.toWorldPosition(u,t),f=n._calcHostAnchor(r,e,d,a);return!(f.index!==H||f.percent!==H?f.distance*u.getZoom()>n._interactor.getStyle("edgeHostEdgeMaxDistance"):!!n._interactor.getStyle("edgeHostDetectPerFrame")||(f.x<0||1<f.x||f.y<0||1<f.y))||(o=u.getDataAt(d,function(t){return!!u.isSelectable(t)&&(!!u.isSourceTargetEditable(r,t,e)&&!!r.canSetSourceTarget(t,e))}))&&(h=n._calcHostAnchor(r,e,d,o),a=o,n._nextChangeEdgeHost={type:e,host:o},f=h),i||f.x===H?f.percent===H&&f.index===H||(s=f.point):(h=n._interactor.getStyle("anchorRound"),i=n._interactor.getStyle("anchorSensitivity"),(c=u.calculateAttachPoint(a,d))?f=c.info:(f.x=Hl.roundTo(f.x,h,i),f.y=Hl.roundTo(f.y,h,i)),s=sc(u,a,0,f.offsetX||0,f.offsetY||0,f.x,f.y)),s&&(s=Hl.toScreenPosition(u,s),t.x=s.x,t.y=s.y),n._edgeHostGuideInfo={corners:Hl.getTargetCornersOnScreen(u,a),attach:c?c.index:-1,host:a},f.percent!==H?l="percent: "+f.percent.toFixed(2):f.index!==H?l="index: "+f.index:(l=f.x.toFixed(2)+", "+f.y.toFixed(2),(f.offsetX||f.offsetY)&&(l+=" offset: "+f.offsetX.toFixed(2)+", "+f.offsetY.toFixed(2))),{host:a,anchor:f,tipText:l}}},du.prototype._guidingToEdit=function(t,e){var i;if(g=this.screenInfo.curve){i=g._curves;var n,r,o,a,s,h,c,l,u=1/0,d=1/0,f=[];for(this.editing&&"realPoint"===this.editing.type&&(l=this.editing.point),s=0,h=2*i.length;s<h;s++)c=i[Math.floor(s/2)][s%2?"_p4":"_p1"],0<=f.indexOf(c)||(f.push(c),l&&l===c||(o=c.x-t.x,a=c.y-t.y,Math.abs(o)<Math.abs(u)?(u=o,n=[c]):o===u&&n.push(c),Math.abs(a)<Math.abs(d)?(d=a,r=[c]):a===d&&r.push(c)));var g=this._interactor.getStyle("smartGuideThreshold");if((Math.abs(u)>g||"y"===e)&&(n=null),(Math.abs(d)>g||"x"===e)&&(r=null),n||r){g=!1,e={};if(n&&(g=!0,e.xList=n,e.x=u),r&&(g=!0,e.yList=r,e.y=d),g)return e}}},du.prototype._46O=function(t){var e=this;e.editing&&(e.editing=null,e._interactor.fi({kind:"endEditPoint",event:t})),e._guideInfo=null,e._edgeHostGuideInfo=null,e._pan&&(e._pan=null,e._interactor.fi({kind:"endPan",event:t})),e._multiSelect&&(e._handleMultiSelect(e._multiSelect),e._multiSelect=null),e.tipInfo=null,e.edgeEditResult=null},du.prototype._handleMultiSelect=function(t){if(t.startPoint&&t.endPoint){var e,i,n,r=this._interactor,o=r.gv,a=Hl.toScreenPosition(o,t.startPoint),t=Hl.toScreenPosition(o,t.endPoint),s=Gl.Default.unionPoint(a,t),h=this.screenInfo.curve._curves,c=[],l=function(t){t.x>=s.x&&t.y>=s.y&&t.x<=s.x+s.width&&t.y<=s.y+s.height&&c.indexOf(t)<0&&c.push(t)};for(f=0,g=h.length;f<g;f++)l((n=h[f])._p1),l(n._p4);if(c.length){var t=this.activing||{},u=t.selections||[];for(t.point&&u.push(t.point),f=0,g=u.length;f<g;f++)e=u[f],0<=(i=c.indexOf(e))?c[i]=H:c.push(e);for(var d=c,c=[],f=0,g=d.length;f<g;f++)d[f]&&c.push(d[f]);0===(g=c.length)?this.activing=null:1===g?this.activing={point:c[0]}:(e=c[g-1],this.activing={point:e,selections:c.splice(0,g-1)}),r.redraw()}}},du.prototype._canDeletePoint=function(t,e){if(!(this.target instanceof Gl.Edge))return!0;var i=t._curves[0],t=t._curves[t._curves.length-1];return i._p1!==e&&t._p4!==e},du.prototype.handleDelete=function(){var e,i,n=this;n.activing&&n.screenInfo&&(e=Gl.Default.isShiftDown(),i=n.screenInfo.curve,n._canDeletePoint(i,n.activing.point)&&i.deleteRealPoint(n.activing.point,e),n.activing.selections&&n.activing.selections.forEach(function(t){n._canDeletePoint(i,t)&&i.deleteRealPoint(t,e)}),n.activing=null,delete n.editing,delete n.tipInfo,delete n.edgeEditResult,delete n._pan,delete n._multiSelect,n._writeToHt(),n._interactor.fp("deleteShapePoint",!1,!0))},du.prototype.handleDoubleClick=function(t){var e=this._interactor._getLogicalPoint(t);if(this.screenInfo&&this._checkEditRealPoint(e)){t=this.getCurrentSelectintStatus(),e=Hl.Curve.PointType,t=t===e.Mirrored?e.Straight:e.Mirrored;return this._setCurrentSelectionStatus(t),this._interactor._42(),!0}},du.prototype._drawHighlight=function(t){var e,i,n=this.highlight;n&&(i=n.bezier,e=this._interactor,i&&Hl.Icons.DrawIcon(e,t,Hl.Icons.ShapeHighlightCurve,[i._p1.x,i._p1.y,i._p2.x,i._p2.y,i._p3.x,i._p3.y,i._p4.x,i._p4.y]),(i=n.point)&&"insertKnot"===n.type&&Hl.Icons.DrawIcon(e,t,Hl.Icons.ShapeHighlighPoint,i))},du.prototype._drawGuide=function(t){var e=this._guideInfo;if(e)for(var i,n,r,o=e.v,a=0;a<2;a++)if(r=0===a?e.xList:e.yList)for(i=0,n=r.length;i<n;i++)Hl.Icons.DrawIcon(this._interactor,t,Hl.Icons.ShapeGuideLine,[o.x,o.y,r[i].x,r[i].y])},du.prototype._drawCurrentPoint=function(e){if(this.activing){var t=this.activing,i=this.getCurrentSelectintStatus(),n=this._interactor;if(i!==Hl.Curve.PointType.Straight){var r=t.pairs;t.hlpair,t.hltype;var o=t.selections,a=t.editingCtrl;if(r&&!o)for(var s,h=0,c=r.length;h<c;h++)s=r[h],a&&h===a.pairId&&s[a.type]?Hl.Icons.DrawIcon(n,e,Hl.Icons.ShapeActivingCtrl,{point:s.point,c1:s.c1,c2:s.c2,hl:a.type}):Hl.Icons.DrawIcon(n,e,Hl.Icons.ShapeActivingCtrl,s)}Hl.Icons.DrawIcon(n,e,Hl.Icons.ShapeHighlighRealPoint,this.activing.point),o&&o.forEach(function(t){Hl.Icons.DrawIcon(n,e,Hl.Icons.ShapeHighlighRealPoint,t)})}},du.prototype.clear=function(){this.editing=null,this._guideInfo=null,this.activing=null,this.highlight=null},du.prototype._42=function(e){var t=this;t.info={},t.editing||(t.screenInfo=null);var i=t._interactor;if(i.editDetail){var n,r,o=i.gv;if(!t.target||!o.isSelected(t.target)||!o.isVisible(t.target))return i.editDetail=!1,void t.clear();t.gatherSingleTarget(o,t.target),Hl.Icons.DrawIcon(i,e,Hl.Icons.ShapeBgCurve,t.screenInfo),t._interactor.getStyle("curveElevationVisible")&&(t.target instanceof Gl.Polyline||t.target instanceof Gl.Edge&&t._interactor.getStyle("edgeElevationEditable"))&&t.activing&&(r=t.activing.getCurrentEditingPoint())&&"string"!=typeof r.e&&Hl.Icons.DrawIcon(i,e,Hl.Icons.EdgeElevationGuide,r),t._drawHighlight(e),t._drawCurrentPoint(e),t._getRealPoint().forEach(function(t){Hl.Icons.DrawIcon(i,e,Hl.Icons.ShapePoint,t)}),t._drawGuide(e),t.tipInfo&&t._interactor.getStyle("curveTipVisible")&&Hl.Icons.DrawIcon(i,e,Hl.Icons.TipHelper,t.tipInfo),t._edgeHostGuideInfo&&i._drawHostGuide(t._edgeHostGuideInfo),t.edgeEditResult&&t._drawEdgeHostHighlight(e,t.edgeEditResult.host,t.edgeEditResult.anchor),t._multiSelect&&t._multiSelect.endPoint&&((n=Gl.Default.unionPoint(Hl.toScreenPosition(o,t._multiSelect.startPoint),Hl.toScreenPosition(o,t._multiSelect.endPoint))).color=o.getRectSelectBorderColor(),e.save(),e.setTransform(1,0,0,1,0,0),r=C.devicePixelRatio,o=n.borderWidth=Math.round(r),o/=2,n.x=Math.round(n.x*r)+o,n.y=Math.round(n.y*r)+o,n.width=Math.round(n.width*r),n.height=Math.round(n.height*r),Hl.Icons.DrawIcon(i,e,Hl.Icons.SimpleRect,n),e.restore())}else t.clear()},du.prototype._drawEdgeHostHighlight=function(t,e,i){this.drawEdgeHostHighlight(t,e,i),this._interactor.redraw()},du.prototype.drawEdgeHostHighlight=function(t,e,i){if(En(e)){for(var n,r,o=this._interactor,a=o.gv,e=a.getDataUI(e),s=bc(e),h=[],c=0,l=s.points.length;c<l;c++)r=Hl.toScreenPosition(a,s.points.get(c)),h.push(r.x,r.y);s.segments&&(n=s.segments.toArray());var u=o.getStyle("edgeHostHighlighPeriod"),d=o.getStyle("edgeHostEdgeHighlighColor");Hl.Icons.DrawIcon(o,t,Hl.Icons.ShapeBgCurve,{P:h,S:n,color:d,dynamicVisible:i.index===H,dynamicPeriod:u}),d=o.getStyle("edgeHostPointHighlighColor");var f=Ic(e);for(c=0,l=f.length;c<l;c++){var g=f[c],g=Hl.toScreenPosition(a,g);Hl.Icons.DrawIcon(o,t,Hl.Icons.ShapePoint,{point:{x:g.x,y:g.y},color:d,size:12,dynamicVisible:c===i.index,dynamicPeriod:u})}}},du.prototype._getRealPoint=function(){var i,t=this.screenInfo,n=t.P,r=t.S,o=-1,a=[],s=-1,h=r.length;return r.each(function(t){s++;var e=1;if(3===t)e=2;else if(4===t)e=3;else if(5===t)return;o+=e,i=h<=s+1||1===r.get(s+1),a.push({point:{x:n[2*o],y:n[2*o+1]},segmentIndex:s,pointIndex:o,isEnd:i})}),a},du.prototype.getEditingPointsInfo=function(t){var e=this,i=e.activing;if(!i)return!1;var n=i.point;if(!n)return!1;var r=this._getRealPoint(),o=[{screen:n}];i.selections&&i.selections.forEach(function(t){o.push({screen:t})});var a,s,h=r.length;return o.forEach(function(t){for(a=0;a<h;a++)if(s=r[a],t.screen.isNearEnough(s.point)){t.segmentIndex=s.segmentIndex,t.pointIndex=s.pointIndex,t.point=e.target.getPoints().get(s.pointIndex);break}}),t&&o.sort(function(t,e){return t.segmentIndex-e.segmentIndex}),o},(du=Hl.MoveHelper=function(t){this.catalog="Move",this._interactor=t}).prototype={},(du.prototype.constructor=du).prototype.calcShift=function(t,e,i){var n,r=this,o=r._interactor.gv,a=o.lp(e);if("beginMove"===t&&r._gatherGridInfo(i._lastLogicalPoint||a),n=r._target){var s,t=n.downPosition;if(t){var h=r._interactor.getStyle("moveSensitivity")/o._zoom;if(t.distanceTo(a)<h)return{x:0,y:0};delete n.downPosition}Gl.Default.isShiftDown(e)&&(a=r._dealShiftDown(a),s=n.shiftGuide.dir);i=n.rawPos={x:n.pos.x+a.x-n.lp.x,y:n.pos.y+a.y-n.lp.y};if(Gl.Default.isCtrlDown(e)){var c=r._calcShiftByAddon();return r._target.node instanceof Hl.Group&&((m=r._target.node)._position.x+=c.x,m._position.y+=c.y),c}t=r._interactor.rectGuide;if(n.node instanceof Gl.Data&&n.node.s("2d.attachable")){var l=r._calcAttachNodeShift(n.node,i);if(t.clear(),l)return l}for(var u,d=n.x+i.x,f=n.y+i.y,h={x:d,y:f},a={x:d+n.w/2,y:f+n.h/2},e={x:d+n.w,y:f+n.h},l=r._interactor.gridGuide,g=[t.findClosest(h,s),t.findClosest(a,s),t.findClosest(e,s),l.findClosest(h,s),l.findClosest(a,s),l.findClosest(e,s)],p=1/0,_=1/0,v=0,y=g.length;v<y;v++)(u=g[v])&&(d=u.x,f=u.y,isFinite(d)&&Math.abs(d)<Math.abs(p)&&(p=d),isFinite(f)&&Math.abs(f)<Math.abs(_)&&(_=f));isFinite(p)||(p=0),isFinite(_)||(_=0),c=r._calcShiftByAddon(p,_),r._target.node instanceof Hl.Group&&((m=r._target.node)._position.x+=c.x,m._position.y+=c.y);var m=n.node;return Sn(m,o)||(o=i.x+p,i=i.y+_,r._interactor.rectGuide.gatherLines({node:m,x:n.x+o,y:n.y+i,w:n.w,h:n.h},s)),c}},du.prototype._calcShiftByAddon=function(t,e){var i=this._target,n=i.rawPos,i=i.node.getPosition();return t=t||0,e=e||0,{x:n.x-i.x+t,y:n.y-i.y+e}},du.prototype._dealShiftDown=function(t){var e=this._target.shiftGuide,i=this._target.lp,n=Math.abs(t.x-i.x),r=Math.abs(t.y-i.y);r<n&&n>e.limit&&"y"===e.dir&&(e.dir="x"),n<r&&r>e.limit&&"x"===e.dir&&(e.dir="y");var o=e.dir;return"x"===o?(t.y=i.y,e.limit=Math.max(e.limit,n)):"y"===o&&(t.x=i.x,e.limit=Math.max(e.limit,r)),t},du.prototype._isAttachableLineShape=function(t){if(!t.getSegments)return!1;var e=t.getSegments();if(!e)return!0;e instanceof Gl.List&&(e=e.getArray());for(var i=1,n=e.length;i<n;i++)if(2!==e[i])return!1;return!0},du.prototype._calcAttachNodeShift=(vv=new ca,yv=new ca,mv=new ca,bv=new ca,function(t,e){var i=this._interactor.gv,n=t.getHost(),r=i.getDataAt(e,function(t){return!!t.s("2d.hostable")});if(r&&n!==r&&t.setHost(r),!r)return this._edgeHostGuideInfo=null,t.setHost(null);n=this._edgeHostGuideInfo={corners:Hl.getTargetCornersOnScreen(i,r),host:r,attach:-1};if(this._isAttachableLineShape(r)){for(var o,a,s,h,c,l,u=r.getPoints(),d=u.size(),f=r.getPointsMatrix2d(),g=1/0,p=0;p<d&&(p!==d-1||r.isClosePath());p++)0!==p?yv.copy(mv):f.apply(u.get(p),yv),f.apply(p===d-1?u.get(0):u.get(p+1),mv),vv.copy(e).sub(yv),bv.copy(mv).sub(yv),o=bv.length(),bv.divideScalar(o),(a=vv.dot(bv))<0?a=0:o<a&&(a=o),bv.multiplyScalar(a).add(yv),(s=vv.copy(e).sub(bv).lengthSq())<g&&(g=s,l=p,h=a,c=o);return Math.sqrt(g)*i.getZoom()>this._interactor.getStyle("attachThreshold")?(t.s({"attach.index":-1}),void t.setHost(null)):(t.s("attach.offset.opposite")&&(h=c-h),t.s({"attach.index":l,"attach.offset":t.s("attach.offset.relative")?h/c:h}),{x:0,y:0})}t=i.calculateAttachPoint(r,e);if(t){i=t.point;return n.attach=t.index,this._calcShiftByAddon(i.x-e.x,i.y-e.y)}}),du.prototype._gatherGridInfo=function(t){var e,i,n=this._interactor,r=n._getValidSelection();if(r.length){if(1===r.length){if(!(e=r[0]).getRect)return void(this._target=null)}else if(!(e=Hl.Group.findOrCreateGroup(r)))return void(this._target=null)}else if((r=n.gv.sm().getSelection()).length&&!(e=r.get(0)).getRect)return void(this._target=null);e&&(i=e.getPosition(),r=e.getRect(),this._target={node:e,x:r.x-i.x,y:r.y-i.y,w:r.width,h:r.height,lp:{x:t.x,y:t.y},pos:{x:i.x,y:i.y},shiftGuide:{dir:"x",limit:0},downPosition:new Hl.Math.Vector2(t)},n.rectGuide.gatherRects())},du.prototype.clear=function(){this._edgeHostGuideInfo=null,this._interactor.rectGuide.clear(),this._interactor._42()},du.prototype._42=function(){var t=this._edgeHostGuideInfo;t&&this._interactor._drawHostGuide(t)},fu=L.freeze({DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047}),gv="undefined"!=typeof WebGL2RenderingContext,pv={aliasedLineWidthRange:fu.ALIASED_LINE_WIDTH_RANGE,aliasedPointSizeRange:fu.ALIASED_POINT_SIZE_RANGE,maxCombinedTextureImageUnits:fu.MAX_COMBINED_TEXTURE_IMAGE_UNITS,maxCubeMapTextureSize:fu.MAX_CUBE_MAP_TEXTURE_SIZE,maxFragmentUniformVectors:fu.MAX_FRAGMENT_UNIFORM_VECTORS,maxRenderBufferSize:fu.MAX_RENDERBUFFER_SIZE,maxTextureImageUnits:fu.MAX_TEXTURE_IMAGE_UNITS,maxTextureSize:fu.MAX_TEXTURE_SIZE,maxVaryingVectors:fu.MAX_VARYING_VECTORS,maxVertexAttribs:fu.MAX_VERTEX_ATTRIBS,maxVertexTextureImageUnits:fu.MAX_VERTEX_TEXTURE_IMAGE_UNITS,maxVertexUniformVectors:fu.MAX_VERTEX_UNIFORM_VECTORS,maxViewportDIMs:fu.MAX_VIEWPORT_DIMS},_v={max3DTextureSize:fu.MAX_3D_TEXTURE_SIZE,maxArrayTextureLayers:fu.MAX_ARRAY_TEXTURE_LAYERS,maxColorAttachments:fu.MAX_COLOR_ATTACHMENTS,maxCombinedFragmentUniformComponents:fu.MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS,maxCombinedUniformBlocks:fu.MAX_COMBINED_UNIFORM_BLOCKS,maxCombinedVertexUniformComponents:fu.MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS,maxDrawBuffers:fu.MAX_DRAW_BUFFERS,maxElementIndex:fu.MAX_ELEMENT_INDEX,maxElementsIndices:fu.MAX_ELEMENTS_INDICES,maxElementsVertices:fu.MAX_ELEMENTS_VERTICES,maxFragmentInpuComponents:fu.MAX_FRAGMENT_INPUT_COMPONENTS,maxFragmentUniformBlocks:fu.MAX_FRAGMENT_UNIFORM_BLOCKS,maxFragmentUniformComponents:fu.MAX_FRAGMENT_UNIFORM_COMPONENTS,maxProgramTexelOffset:fu.MAX_PROGRAM_TEXEL_OFFSET,maxSamples:fu.MAX_SAMPLES,maxTextureLODBias:fu.MAX_TEXTURE_LOD_BIAS,maxTransformFeedbackInterleavedComponents:fu.MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS,maxTransformFeedbackSeparateAttribs:fu.MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS,maxTransformFeedbackSeparateComponents:fu.MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS,maxUniformBlockSize:fu.MAX_UNIFORM_BLOCK_SIZE,maxUniformBufferBindings:fu.MAX_UNIFORM_BUFFER_BINDINGS,maxVaryingComponents:fu.MAX_VARYING_COMPONENTS,maxVertexOutputComponents:fu.MAX_VERTEX_OUTPUT_COMPONENTS,maxVertexUniformBlocks:fu.MAX_VERTEX_UNIFORM_BLOCKS,maxVertexUniformComponents:fu.MAX_VERTEX_UNIFORM_COMPONENTS,minProgramTexelOffset:fu.MIN_PROGRAM_TEXEL_OFFSET},gu={for:function(t){var e=t._info;return e||(t._info=e=Cm(t,e)),e}},pu=function(){function t(e,i,t){return{def:e,getter:t?function(t){return 1<gu.for(t).version?t.getParameter(i):e}:function(t){return t.getParameter(i)},setter:t?function(t,e){1<gu.for(t).version&&t.pixelStorei(i,e)}:function(t,e){t.pixelStorei(i,e)}}}function e(t){return"string"==typeof t?to(t):t.r!==H?(i[0]=t.r,i[1]=t.g,i[2]=t.b,i[3]=t.a,i):t.red!==H?(i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i):t}function s(t){return c(t)?Array.prototype.slice.call(t,0):t}function o(t,e,i){this.gl=e,this._record=i||{},this._branches={},this._leafSync={};for(var n=(this._struct=t).children,r=n.length;r--;){var o=n[r],a=o.name;o.isLeaf?(this._leafSync[a]=!1,this._record[a]=s(o.desc.def)):this._record[a]={}}}var i="undefined"!=typeof Float32Array&&new Float32Array(4),n={viewport:{def:[0,0,NaN,NaN],getter:function(t){return t.getParameter(t.VIEWPORT)},setter:function(t,e){var i=e[2]!=e[2]?t.drawingBufferWidth-e[0]:e[2],n=e[3]!=e[3]?t.drawingBufferHeight-e[1]:e[3];t.viewport(e[0],e[1],i,n)}},dither:{def:!1,getter:function(t){return t.isEnabled(t.DITHER)},setter:function(t,e){e?t.enable(t.DITHER):t.disable(t.DITHER)}},rasterizerDiscard:{def:!1,getter:function(t){return 1<gu.for(t).version&&t.isEnabled(t.RASTERIZER_DISCARD)},setter:function(t,e){1!==gu.for(t).version&&(e?t.enable(t.RASTERIZER_DISCARD):t.disable(t.RASTERIZER_DISCARD))}},lineWidth:{def:1,getter:function(t){return t.lineWidth?t.getParameter(t.LINE_WIDTH):1},setter:function(t,e){t.lineWidth&&t.lineWidth(e)}},color:{clear:{def:[0,0,0,0],getter:function(t){return t.getParameter(t.COLOR_CLEAR_VALUE)},setter:function(t,e){t.clearColor(e[0],e[1],e[2],e[3])},parse:e},mask:{def:[!0,!0,!0,!0],getter:function(t){return t.getParameter(t.COLOR_WRITEMASK)},setter:function(t,e){t.colorMask(e[0],e[1],e[2],e[3])}}},blend:{enabled:{def:!1,getter:function(t){return t.isEnabled(t.BLEND)},setter:function(t,e){e?t.enable(t.BLEND):t.disable(t.BLEND)}},color:{def:[0,0,0,0],getter:function(t){return t.getParameter(t.BLEND_COLOR)},setter:function(t,e){t.blendColor(e[0],e[1],e[2],e[3])},parse:e},equation:{def:[fu.FUNC_ADD,fu.FUNC_ADD],getter:function(t){return[t.getParameter(t.BLEND_EQUATION_RGB),t.getParameter(t.BLEND_EQUATION_ALPHA)]},setter:function(t,e){t.blendEquationSeparate(e[0],e[1])},parse:function(t){var e=t.length;return 1<e?t:(i[1]=i[0]=1===e?t[0]:t,i)}},func:{def:[fu.ONE,fu.ZERO,fu.ONE,fu.ZERO],getter:function(t){return[t.getParameter(t.BLEND_SRC_RGB),t.getParameter(t.BLEND_DST_RGB),t.getParameter(t.BLEND_SRC_ALPHA),t.getParameter(t.BLEND_DST_ALPHA)]},setter:function(t,e){t.blendFuncSeparate(e[0],e[1],e[2],e[3])},parse:function(t){return 3<t.length?t:(i[2]=i[0]=t[0],i[3]=i[1]=t[1],i)}}},cullFace:{enabled:{def:!1,getter:function(t){return t.isEnabled(t.CULL_FACE)},setter:function(t,e){e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE)}},mode:{def:fu.BACK,getter:function(t){return t.getParameter(t.CULL_FACE_MODE)},setter:function(t,e){t.cullFace(e)}},frontFace:{def:fu.CCW,getter:function(t){return t.getParameter(t.FRONT_FACE)},setter:function(t,e){t.frontFace(e)}}},scissor:{enabled:{def:!1,getter:function(t){return t.isEnabled(t.SCISSOR_TEST)},setter:function(t,e){e?t.enable(t.SCISSOR_TEST):t.disable(t.SCISSOR_TEST)}},box:{def:[0,0,NaN,NaN],getter:function(t){return t.getParameter(t.SCISSOR_BOX)},setter:function(t,e){var i=e[2]!=e[2]?t.drawingBufferWidth-e[0]:e[2],n=e[3]!=e[3]?t.drawingBufferHeight-e[1]:e[3];t.scissor(e[0],e[1],i,n)}}},depth:{enabled:{def:!1,getter:function(t){return t.isEnabled(t.DEPTH_TEST)},setter:function(t,e){e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST)}},clear:{def:1,getter:function(t){return t.getParameter(t.DEPTH_CLEAR_VALUE)},setter:function(t,e){t.clearDepth(e)}},mask:{def:!0,getter:function(t){return t.getParameter(t.DEPTH_WRITEMASK)},setter:function(t,e){t.depthMask(e)}},range:{def:[-1,1],getter:function(t){return t.getParameter(t.DEPTH_RANGE)},setter:function(t,e){t.depthRange(e[0],e[1])}},func:{def:fu.LESS,getter:function(t){return t.getParameter(t.DEPTH_FUNC)},setter:function(t,e){t.depthFunc(e)}}},stencil:{enabled:{def:!1,getter:function(t){return t.isEnabled(t.STENCIL_TEST)},setter:function(t,e){e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST)}},clear:{def:0,getter:function(t){return t.getParameter(t.STENCIL_CLEAR_VALUE)},setter:function(t,e){t.clearStencil(e)}},frontMask:{def:255,getter:function(t){return t.getParameter(t.STENCIL_WRITEMASK)},setter:function(t,e){t.stencilMaskSeparate(t.FRONT,e)}},frontOp:{def:[fu.KEEP,fu.KEEP,fu.KEEP],getter:function(t){return[t.getParameter(t.STENCIL_FAIL),t.getParameter(t.STENCIL_PASS_DEPTH_FAIL),t.getParameter(t.STENCIL_PASS_DEPTH_PASS)]},setter:function(t,e){t.stencilOpSeparate(t.FRONT,e[0],e[1],e[2])}},frontFunc:{def:[fu.ALWAYS,0,255],getter:function(t){return[t.getParameter(t.STENCIL_FUNC),t.getParameter(t.STENCIL_REF),t.getParameter(t.STENCIL_VALUE_MASK)]},setter:function(t,e){t.stencilFuncSeparate(t.FRONT,e[0],e[1],e[2])}},backMask:{def:255,getter:function(t){return t.getParameter(t.STENCIL_BACK_WRITEMASK)},setter:function(t,e){t.stencilMaskSeparate(t.BACK,e)}},backOp:{def:[fu.KEEP,fu.KEEP,fu.KEEP],getter:function(t){return[t.getParameter(t.STENCIL_BACK_FAIL),t.getParameter(t.STENCIL_BACK_PASS_DEPTH_FAIL),t.getParameter(t.STENCIL_BACK_PASS_DEPTH_PASS)]},setter:function(t,e){t.stencilOpSeparate(t.BACK,e[0],e[1],e[2])}},backFunc:{def:[fu.ALWAYS,0,255],getter:function(t){return[t.getParameter(t.STENCIL_BACK_FUNC),t.getParameter(t.STENCIL_BACK_REF),t.getParameter(t.STENCIL_BACK_VALUE_MASK)]},setter:function(t,e){t.stencilFuncSeparate(t.BACK,e[0],e[1],e[2])}}},hint:{generateMipmap:{def:fu.DONT_CARE,getter:function(t){return t.getParameter(t.GENERATE_MIPMAP_HINT)},setter:function(t,e){t.hint(t.GENERATE_MIPMAP_HINT,e)}},fragmentShaderDerivative:{def:fu.DONT_CARE,getter:function(t){var e=gu.for(t);return 1!==e.version||e.extensions.OES_standard_derivatives?t.getParameter(fu.FRAGMENT_SHADER_DERIVATIVE_HINT):fu.DONT_CARE},setter:function(t,e){var i=gu.for(t);return 1<i.version||i.extensions.OES_standard_derivatives?void t.hint(fu.FRAGMENT_SHADER_DERIVATIVE_HINT,e):void 0}}},pixelStore:{packAlignment:t(4,fu.PACK_ALIGNMENT,!1),unpackAlignment:t(4,fu.UNPACK_ALIGNMENT,!1),unpackFlipY:t(!1,fu.UNPACK_FLIP_Y_WEBGL,!1),unpackPremultiplyAlpha:t(!1,fu.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),unpackColorspaceConversion:t(fu.BROWSER_DEFAULT_WEBGL,fu.UNPACK_COLORSPACE_CONVERSION_WEBGL,!1),packRowLength:t(0,fu.PACK_ROW_LENGTH,!0),packSkipPixels:t(0,fu.PACK_SKIP_PIXELS,!0),packSkipRows:t(0,fu.PACK_SKIP_ROWS,!0),unpackRowLength:t(0,fu.UNPACK_ROW_LENGTH,!0),unpackImageHeight:t(0,fu.UNPACK_IMAGE_HEIGHT,!0),unpackSkipPixels:t(0,fu.UNPACK_SKIP_PIXELS,!0),unpackSkipRows:t(0,fu.UNPACK_SKIP_ROWS,!0),unpackSkipImages:t(0,fu.UNPACK_SKIP_IMAGES,!0)},polygonOffset:{enabled:{def:!1,getter:function(t){return t.isEnabled(t.POLYGON_OFFSET_FILL)},setter:function(t,e){e?t.enable(t.POLYGON_OFFSET_FILL):t.disable(t.POLYGON_OFFSET_FILL)}},value:{def:[0,0],getter:function(t){return[t.getParameter(t.POLYGON_OFFSET_FACTOR),t.getParameter(t.POLYGON_OFFSET_UNITS)]},setter:function(t,e){t.polygonOffset(e[0],e[1])}}},sampleCoverage:{enabled:{def:!1,getter:function(t){return t.isEnabled(t.SAMPLE_COVERAGE)},setter:function(t,e){e?t.enable(t.SAMPLE_COVERAGE):t.disable(t.SAMPLE_COVERAGE)}},alpha:{def:!1,getter:function(t){return t.isEnabled(t.SAMPLE_ALPHA_TO_COVERAGE)},setter:function(t,e){e?t.enable(t.SAMPLE_ALPHA_TO_COVERAGE):t.disable(t.SAMPLE_ALPHA_TO_COVERAGE)}},value:{def:[1,!1],getter:function(t){return[t.getParameter(t.SAMPLE_COVERAGE_VALUE),t.getParameter(t.SAMPLE_COVERAGE_INVERT)]},setter:function(t,e){t.sampleCoverage(e[0],e[1])}}}},n=Ch.create(n,function(t){return"def"in t});o.prototype.reset=function(){for(var t=this._struct.children,e=t.length;e--;){var i=t[e],n=i.name;i.isLeaf?this[n]=i.desc.def:this._branches[n].reset()}},o.prototype.save=function(t){t==H&&(t={});for(var e=this._struct.children,i=e.length;i--;){var n=e[i],r=n.name;n.isLeaf?t[r]=s(this._record[r]):((n=t[r])==H&&(t[r]=n={}),this._branches[r].save(n))}return t},o.prototype.sync=function(t,e){for(var i=this._struct.children,n=i.length;n--;){var r=i[n],o=r.name;r.isLeaf?!e&&this._leafSync[o]||(t?this._record[o]=r.desc.getter(this.gl):r.desc.setter(this.gl,this._record[o]),this._leafSync[o]=!0):this._branches[o].sync(t,e)}},o.prototype.syncLoss=function(){for(var t=this._struct.children,e=t.length;e--;){var i=t[e];i.isLeaf?this._leafSync[i.name]=!1:this._branches[i.name].syncLoss()}},o.prototype.apply=function(t){for(var e=this._struct.children,i=e.length;i--;){var n=e[i],r=n.name;r in t&&(n.isLeaf?this[r]=t[r]:this._branches[r].apply(t[r]))}},o.prototype.append=function(t){var e,i=this._struct.childMap;for(e in t){var n=i[e];n&&(n.isLeaf?this[e]=t[e]:this._branches[e].append(t[e]))}};var r=function s(r){function t(t,e){o.call(this,r,t,e);for(var i=h.length;i--;){var n=h[i];this._branches[n._name]=new n._type(t,this._record[n._name])}}var h=[];return _(t,o),r.forEach(function(t,e){var i,n,r=t.name,o=c(t.desc.def),a=o&&t.desc.def.length;t.isLeaf?(i=t.desc.setter,n=t.desc.parse,L.defineProperty(e,r,{configurable:!1,enumerable:!0,get:function(){return this._record[r]},set:o?function(t){n&&(t=n(t)),!function(t,e){for(var i=a,n=!1;i--;)t[i]!==e[i]&&(t[i]=e[i],n=!0);return n}(this._record[r],t)&&this._leafSync[r]||(i(this.gl,this._record[r]),this._leafSync[r]=!0)}:function(t){this._record[r]===t&&this._leafSync[r]||(i(this.gl,t),this._record[r]=t,this._leafSync[r]=!0)}})):(h.push({_name:r,_type:s(t)}),L.defineProperty(e,r,{configurable:!1,enumerable:!0,get:function(){return this._branches[r]},set:function(t){this._branches[r].apply(t)}}))},t.prototype),t}(n);return function(t){var e=t._state;return e||(t._state=e=new r(t)),e}}(),_u=function(){function h(t,e,i,n){if(t)if(t.length!=H)for(var r=0;r<n;++r)e[i+r]=t[r];else t.toArray&&t.toArray(e,i);else for(r=0;r<n;++r)e[i+r]=0}function i(t,e,i){var n=t[0];if(n<=0||0<n)return t;var r=e*i,o=u[r];if(o==H&&(u[r]=new Float32Array(r)),0!==e){h(n,o,0,i);for(var a=1,s=0;a!==e;++a)s+=i,h(t[a],o,s,i)}return o}function t(t,e){t.uniform1iv(this.addr,e)}function e(t,e){t.uniform2iv(this.addr,e)}function n(t,e){t.uniform3iv(this.addr,e)}function r(t,e){t.uniform4iv(this.addr,e)}function o(t,e,i){g[t]=[e,i]}function l(t,e,i,n,r){this.name=t,this.addr=e,this.size=n?i.size:0,this.activeInfo=i,this.setter=g[i.type][n?1:0],this.slots=function(t,e,i){switch(t.type){case 35678:case 35680:if("uSampler"===i)return[0];if("uBlendSampler"===i)return[1];for(var n=t.size,r=new Int32Array(n),o=0;o<n;++o)r[o]=e.usedTextureSlot++;return r}return H}(i,r,t),Mh(this)}function a(t,e,i){this.gl=e,this._program=i,this._leaves={},this._branches={},this._struct=t}function c(r){function t(t,e){a.call(this,r,t,e);for(var i=o.length;i--;){var n=o[i];this._branches[n._name]=new n._type(t,e)}}var o=[];return _(t,a),r.forEach(function(t,e){var i,n=t.name;t.isLeaf?(i=v("d.setter(this.gl, v);",["v"],["d"],[t.desc]),L.defineProperty(e,n,{configurable:!1,enumerable:!0,get:function(){return i},set:i})):(o.push({_name:n,_type:c(t)}),L.defineProperty(e,n,{configurable:!1,enumerable:!0,get:function(){return this._branches[n]},set:function(t){this._branches[n].apply(t)}}))},t.prototype),t}function s(t,e){for(var i=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),n={},r={usedTextureSlot:2};i--;){var o=t.getActiveUniform(e,i),a=o.name;!function(t,e,i,n){var r=t.name,o=r.length;for(p.lastIndex=0;;){var a=p.exec(r),s=p.lastIndex,h=a[1],c="]"===a[2],a=a[3];if(c&&(h|=0),a===H||"["===a&&s+2===o){i[h]=new l(h,e,t,a!==H,n);break}a=i[h];a==H&&(i[h]=a={}),i=a}}(o,t.getUniformLocation(e,a),n,r)}var s=c(Ch.create(n,function(t){return"addr"in t}));return L.defineProperty(s.prototype,"textureCount",{configurable:!1,enumerable:!1,writable:!1,value:r.usedTextureSlot}),new s(t,e)}var u=[];if("function"==typeof Float32Array)for(var d=1;d<17;++d)u[d]=new Float32Array(d);var f=new Int32Array([0,1]),g=[];o(fu.FLOAT,function(t,e){t.uniform1f(this.addr,e)},function(t,e){t.uniform1fv(this.addr,e)}),o(fu.FLOAT_VEC2,function(t,e){var i;e.x!=H?t.uniform2f(this.addr,e.x,e.y):((i=u[2]).set(e,0),t.uniform2fv(this.addr,i))},function(t,e){t.uniform2fv(this.addr,i(e,this.size,2))}),o(fu.FLOAT_VEC3,function(t,e){var i;e.x!=H?t.uniform3f(this.addr,e.x,e.y,e.z):e.r!=H?t.uniform3f(this.addr,e.r,e.g,e.b):e.red!=H?t.uniform3f(this.addr,e.red,e.green,e.blue):((i=u[3]).set(e,0),t.uniform3fv(this.addr,i))},function(t,e){t.uniform3fv(this.addr,i(e,this.size,3))}),o(fu.FLOAT_VEC4,function(t,e){var i;"string"==typeof e&&(e=to(e)),e.x!=H?t.uniform4f(this.addr,e.x,e.y,e.z,e.w):e.r!=H?t.uniform4f(this.addr,e.r,e.g,e.b,e.a):e.red!=H?t.uniform4f(this.addr,e.red,e.green,e.blue,e.alpha):((i=u[4]).set(e,0),t.uniform4fv(this.addr,i))},function(t,e){t.uniform4fv(this.addr,i(e,this.size,4))}),o(fu.INT,function(t,e){t.uniform1i(this.addr,e)},t),o(fu.INT_VEC2,e,e),o(fu.INT_VEC3,n,n),o(fu.INT_VEC4,r,r),o(fu.BOOL,function(t,e){t.uniform1i(this.addr,f[e?1:0])},t),o(fu.BOOL_VEC2,e,e),o(fu.BOOL_VEC3,n,n),o(fu.BOOL_VEC4,r,r),o(fu.FLOAT_MAT2,function(t,e){var i=u[4];i.set(e,0),t.uniformMatrix2fv(this.addr,!1,i)},function(t,e){t.uniformMatrix2fv(this.addr,!1,i(e,this.size,4))}),o(fu.FLOAT_MAT3,function(t,e){var i=u[9];i.set(e,0),t.uniformMatrix3fv(this.addr,!1,i)},function(t,e){t.uniformMatrix3fv(this.addr,!1,i(e,this.size,9))}),o(fu.FLOAT_MAT4,function(t,e){var i=u[16];i.set(e,0),t.uniformMatrix4fv(this.addr,!1,i)},function(t,e){t.uniformMatrix4fv(this.addr,!1,i(e,this.size,16))}),o(fu.SAMPLER_2D,function(t,e){t.uniform1i(this.addr,this.slots[0]),t.activeTexture(t.TEXTURE0+this.slots[0]),t.bindTexture(t.TEXTURE_2D,e||t._emptyTexture)},function(t,e){t.uniform1iv(this.addr,this.slots);for(var i=this.slots.length;i--;)t.activeTexture(t.TEXTURE0+this.slots[i]),t.bindTexture(t.TEXTURE_2D,e[i]||t._emptyTexture)}),o(fu.SAMPLER_CUBE,function(t,e){t.uniform1i(this.addr,this.slots[0]),t.activeTexture(t.TEXTURE0+this.slots[0]),t.bindTexture(t.TEXTURE_CUBE_MAP,e||t._emptyCubeTexture)},function(t,e){t.uniform1iv(this.addr,this.slots);for(var i=this.slots.length;i--;)t.activeTexture(t.TEXTURE0+this.slots[i]),t.bindTexture(t.TEXTURE_CUBE_MAP,e[i]||t._emptyCubeTexture)});var p=/([\w\d_]+)(\])?(\[|\.)?/g;return a.prototype.apply=function(t){for(var e=this._struct.children,i=e.length;i--;){var n=e[i],r=n.name;r in t&&(n.isLeaf?this[r]=t[r]:this._branches[r].apply(t[r]))}},a.prototype.append=function(t){var e,i=this._struct.childMap;for(e in t){var n=i[e];n&&(n.isLeaf?this[e]=t[e]:this._branches[e].append(t[e]))}},function(t,e){var i=e._uniforms;return i||(e._uniforms=i=s(t,e)),i}}(),vu=function(){function t(t,a,s){n[t]=function(t,e,i,n,r,o){this.addr==H||this.addr<0||(e==H||!1===e?t.disableVertexAttribArray(this.addr):Th(e)===c?(t.enableVertexAttribArray(this.addr),s(this,t,e,i,n,r,o)):(t.disableVertexAttribArray(this.addr),a(this,t,e)))}}function s(t,e,i){this.name=t,this.addr=e,this.activeInfo=i,this.setter=n[i.type],Mh(this)}function a(t,e,i){this.gl=e,this.program=i,this._branches={},this._struct=t}function h(r){function t(t,e){a.call(this,r,t,e);for(var i=o.length;i--;){var n=o[i];this._branches[n._name]=new n._type(t,e)}}var o=[];return _(t,a),r.forEach(function(t,e){var i,n=t.name;t.isLeaf?(i=v("d.setter(this.gl, v);",["v"],["d"],[t.desc]),L.defineProperty(e,n,{configurable:!1,enumerable:!0,get:function(){return i},set:i})):(o.push({_name:n,_type:h(t)}),L.defineProperty(e,n,{configurable:!1,enumerable:!0,get:function(){return this._branches[n]},set:function(t){this._branches[n].apply(t)}}))},t.prototype),t}var r=[];if(Float32Array)for(var e=1;e<17;++e)r[e]=new Float32Array(e);var n=[],c="undefined"!=typeof WebGLBuffer&&WebGLBuffer.prototype;return t(fu.FLOAT,function(t,e,i){e.vertexAttrib1f(t.addr,i)},function(t,e,i,n,r,o,a){e.bindBuffer(e.ARRAY_BUFFER,i),e.vertexAttribPointer(t.addr,1,n||e.FLOAT,!!r,o||0,a||0),e.bindBuffer(e.ARRAY_BUFFER,null)}),t(fu.FLOAT_VEC2,function(t,e,i){var n;i.x!=H?e.vertexAttrib2f(t.addr,i.x,i.y):((n=r[2]).set(i,0),e.vertexAttrib2fv(t.addr,n))},function(t,e,i,n,r,o,a){e.bindBuffer(e.ARRAY_BUFFER,i),e.vertexAttribPointer(t.addr,2,n||e.FLOAT,!!r,o||0,a||0),e.bindBuffer(e.ARRAY_BUFFER,null)}),t(fu.FLOAT_VEC3,function(t,e,i){var n;i.x!=H?e.vertexAttrib3f(t.addr,i.x,i.y,i.z):i.r!=H?e.vertexAttrib3f(t.addr,i.r,i.g,i.b):i.red!=H?e.vertexAttrib3f(t.addr,i.red,i.green,i.blue):((n=r[3]).set(i,0),e.vertexAttrib3fv(t.addr,n))},function(t,e,i,n,r,o,a){e.bindBuffer(e.ARRAY_BUFFER,i),e.vertexAttribPointer(t.addr,3,n||e.FLOAT,!!r,o||0,a||0),e.bindBuffer(e.ARRAY_BUFFER,null)}),t(fu.FLOAT_VEC4,function(t,e,i){var n;"string"==typeof i&&(i=to(i)),i.x!=H?e.vertexAttrib4f(t.addr,i.x,i.y,i.z,i.w):i.r!=H?e.vertexAttrib4f(t.addr,i.r,i.g,i.b,i.a):i.red!=H?e.vertexAttrib4f(t.addr,i.red,i.green,i.blue,i.alpha):((n=r[4]).set(i,0),e.vertexAttrib4fv(t.addr,n))},function(t,e,i,n,r,o,a){e.bindBuffer(e.ARRAY_BUFFER,i),e.vertexAttribPointer(t.addr,4,n||e.FLOAT,!!r,o||0,a||0),e.bindBuffer(e.ARRAY_BUFFER,null)}),t(fu.FLOAT_MAT2,function(t,e,i){i=i.el||i;for(var n=0,r=0;n<2;++n)e.vertexAttrib2f(t.addr,i[r++],i[r++])},function(t,e,i,n,r,o,a){o=o||4,a=a||0,e.bindBuffer(e.ARRAY_BUFFER,i),e.vertexAttribPointer(t.addr,2,n||e.FLOAT,!!r,o,a),e.vertexAttribPointer(t.addr+1,2,n||e.FLOAT,!!r,o,a+2),e.bindBuffer(e.ARRAY_BUFFER,null)}),t(fu.FLOAT_MAT3,function(t,e,i){i=i.el||i;for(var n=0,r=0;n<3;++n)e.vertexAttrib3f(t.addr,i[r++],i[r++],i[r++])},function(t,e,i,n,r,o,a){o=o||9,a=a||0,e.bindBuffer(e.ARRAY_BUFFER,i),e.vertexAttribPointer(t.addr,3,n||e.FLOAT,!!r,o,a),e.vertexAttribPointer(t.addr+1,3,n||e.FLOAT,!!r,o,a+3),e.vertexAttribPointer(t.addr+2,3,n||e.FLOAT,!!r,o,a+6),e.bindBuffer(e.ARRAY_BUFFER,null)}),t(fu.FLOAT_MAT4,function(t,e,i){i=i.el||i;for(var n=0,r=0;n<4;++n)e.vertexAttrib4f(t.addr,i[r++],i[r++],i[r++],i[r++])},function(t,e,i,n,r,o,a){o=o||16,a=a||0,e.bindBuffer(e.ARRAY_BUFFER,i),e.vertexAttribPointer(t.addr,4,n||e.FLOAT,!!r,o,a),e.vertexAttribPointer(t.addr+1,4,n||e.FLOAT,!!r,o,a+4),e.vertexAttribPointer(t.addr+2,4,n||e.FLOAT,!!r,o,a+8),e.vertexAttribPointer(t.addr+3,4,n||e.FLOAT,!!r,o,a+12),e.bindBuffer(e.ARRAY_BUFFER,null)}),a.prototype.disable=function(){for(var t=this._struct.children,e=t.length;e--;){var i=t[e],n=i.name;i.isLeaf?this.gl.disableVertexAttribArray(i.desc.addr):this._branches[n].disable()}},a.prototype.apply=function(t){for(var e=this._struct.children,i=e.length;i--;){var n=e[i],r=n.name;r in t&&(n.isLeaf?this[r]=t[r]:this._branches[r].apply(t[r]))}},a.prototype.append=function(t){var e,i=this._struct.childMap;for(e in t){var n=i[e];n&&(n.isLeaf?this[e]=t[e]:this._branches[e].append(t[e]))}},function(t,e){var i=e._attribs;return i||(e._attribs=i=function(t,e){for(var i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),n={};i--;){var r=t.getActiveAttrib(e,i),o=r.name,a=t.getAttribLocation(e,o);n[o]=new s(o,a,r)}return new(h(Ch.create(n,function(t){return"addr"in t})))(t,e)}(t,e)),i}}(),yu=function(t){L.defineProperties(this,{gl:{configurable:!1,enumerable:!1,value:t,writable:!1},glState:{configurable:!1,enumerable:!1,value:pu(t),writable:!1}}),this._currProgram=H,this._currUniforms=H,this._currAttribs=H,this._sync=!0},L.defineProperties(yu.prototype,{program:{configurable:!1,enumerable:!1,get:function(){return this._currProgram},set:function(t){this._sync&&t===this._currProgram||(this.gl.useProgram(t),this._currProgram=t,this._currUniforms=_u(this.gl,t),this._currAttribs=vu(this.gl,t),this._sync=!0)}},uniforms:{configurable:!1,enumerable:!1,get:function(){return this._currProgram&&!this._sync&&(this.gl.useProgram(this._currProgram),this._sync=!0),this._currUniforms},set:function(t){this._currUniforms&&(this._currProgram&&!this._sync&&(this.gl.useProgram(this._currProgram),this._sync=!0),this._currUniforms.apply(t))}},attribs:{configurable:!1,enumerable:!1,get:function(){return this._currProgram&&!this._sync&&(this.gl.useProgram(this._currProgram),this._sync=!0),this._currAttribs},set:function(t){this._currUniforms&&(this._currProgram&&!this._sync&&(this.gl.useProgram(this._currProgram),this._sync=!0),this._currAttribs.apply(t))}}}),yu.prototype.useProgram=function(t){this._sync&&t===this._currProgram||(this.gl.useProgram(t),this._currProgram=t,this._currUniforms=_u(this.gl,t),this._currAttribs=vu(this.gl,t),this._sync=!0)},yu.prototype.directState=function(){return this.glState},yu.prototype.directUniforms=function(){return this._currUniforms},yu.prototype.directAttribs=function(){return this._currAttribs},yu.prototype.syncLoss=function(){this._sync=!1,this.glState.syncLoss()},mu="light.color",bu={},xu=function(t){var e;if(t=G.convertShape3dModelName(t),yn(t)){if(t.modelType){if(t.uuid){if(e=zi[t.uuid])return e}else t.uuid=Gl.Math.generateUUID();return e===H&&(lf&&lf[t.uuid]||gf(t.uuid,t)),H}return t}return e=zi[t],t&&e===H&&Gi.test(t)&&(lf&&lf[t]||ff(t,t)),e},wu=function(t,e){t.frameStack?t.frameStack.push(e):t.frameStack=[e],t.bindFramebuffer(t.FRAMEBUFFER,e)},Eu=function(t){var e=t.frameStack;if(e){if(e.pop(),e.length)return void t.bindFramebuffer(t.FRAMEBUFFER,e[e.length-1]);t.frameStack=null}t.bindFramebuffer(t.FRAMEBUFFER,null)},An(G,{graph3dViewAttributes:U,graph3dViewFirstPersonMode:!(yu.for=function(t){var e=t._renderState;return e||(t._renderState=e=new yu(t)),e}),graph3dViewMouseRoamable:!0,graph3dViewMoveStep:15,graph3dViewRotateStep:P/60,graph3dViewBlockSelectable:!0,graph3dViewEditHelperDisabled:!1,graph3dViewPannable:!0,graph3dViewRotatable:!0,graph3dViewWalkable:!0,graph3dViewResettable:!0,graph3dViewZoomable:!0,graph3dViewRectSelectable:!0,graph3dViewRectSelectBackground:zd,graph3dViewGridVisible:!1,graph3dViewGridSize:50,graph3dViewGridGap:50,graph3dViewGridColor:[.4,.75,.85,1],graph3dViewRotateMaxPhi:P,graph3dViewRotateMinPhi:0,graph3dViewShadowQuality:"high",graph3dViewShadowIntensity:.3,graph3dViewShadowBias:-.005,graph3dViewShadowRadius:.1,graph3dViewShadowType:"hard",graph3dViewShadowDegreeX:30,graph3dViewShadowDegreeZ:-10,graph3dViewOriginAxisVisible:!1,graph3dViewCenterAxisVisible:!1,graph3dViewAxisXColor:[1,0,0,1],graph3dViewAxisYColor:[0,1,0,1],graph3dViewAxisZColor:[0,0,1,1],graph3dViewEditSizeColor:[1,1,0,1],graph3dViewOrtho:!1,graph3dViewOrthoWidth:2e3,graph3dViewFovy:P/4,graph3dViewNear:10,graph3dViewFar:1e4,graph3dViewEye:[0,300,1e3],graph3dViewCenter:[0,0,0],graph3dViewUp:[0,1,-1e-7],graph3dViewHeadlightRange:0,graph3dViewHeadlightColor:[1,1,1,1],graph3dViewHeadlightIntensity:1,graph3dViewHeadlightDisabled:!1,graph3dViewHeadlightAmbientIntensity:.7,graph3dViewFogDisabled:!0,graph3dViewFogMode:"linear",graph3dViewFogDensity:5e-4,graph3dViewFogColor:"white",graph3dViewFogNear:1,graph3dViewFogFar:2e3,graph3dViewPickerResolution:.5,graph3dViewDashDisabled:!0,graph3dViewBatchBlendDisabled:!0,graph3dViewBatchBrightnessDisabled:!0,graph3dViewBatchColorDisabled:!1,graph3dMaxVectorCacheTime:50,graph3dEnvmapCapabilityRequire:8,setShape3dModel:function(t,e){pn(e)&&Gi.test(e)?ff(t,e):yn(e)&&e.modelType?gf(t,e):e===H?delete zi[t]:zi[t]=e},getShape3dModel:xu,convertShape3dModelName:function(t){return t},getShape3dModelMap:function(){return zi},getCachedShape3dModelMap:function(){return Vi},createMatrix:function(t,e){bn(t)||(t=[t]);for(var i=t.length-1;0<=i;i--){var n=t[i];e=th(n.mat,n.s3,n.r3,n.rotationMode,n.t3,e)}return e},transformVec:Xs,glBindFrame:wu,glUnbindFrame:Eu,createBoxModel:function(){return{vs:mf,ns:wf,uv:xf,is:bf}},createRoundRectModel:function(t,e){return Bf.roundRect(t,e)},createStarModel:function(t,e){return Bf.star(t,e)},createRectModel:function(t,e){return Bf.rect(t,e)},createTriangleModel:function(t,e){return Bf.triangle(t,e)},createRightTriangleModel:function(t,e){return Bf.rightTriangle(t,e)},createParallelogramModel:function(t,e){return Bf.parallelogram(t,e)},createTrapezoidModel:function(t,e){return Bf.trapezoid(t,e)},createSmoothSphereModel:function(t,e,i,n,r,o,a){return Mc(new nl(t,e,i,n,r,o,a))},createSphereModel:function(t,e,i,n,r,o,a){return t?If(t,e,i,n,r,o,a):G.createSmoothSphereModel()},createSmoothConeModel:function(t,e,i,n,r){return Pf(t,e,i,n,r)},createConeModel:function(t,e,i,n,r,o){return t?Df(t,e,i,n,r,o):Pf(o)},createSmoothCylinderModel:function(t,e,i,n,r,o,a,s){return Mc(new il(t,e,i,n,r,o,a,s))},createCylinderModel:function(t,e,i,n,r,o,a,s){return t?Af(t,e,i,n,r,o,a,s):Rf(o,a)},createSmoothTorusModel:function(t,e,i,n,r,o){return Mc(new rl(t,e,i,n,r,o))},createTorusModel:function(t,e,i,n,r,o,a,s){return t?Mf(t,e,i,n,r,o,a,s):Cf(o,a)},createExtrusionModel:function(t,e,i,n,r,o,a,s){return Of(t,e,i,n,r,o,a,s)},createSmoothRingModel:function(t,e,i,n,r,o){for(var a=[],s=0;s<t.length-1;s+=2)a.push({x:t[s],y:t[s+1]});for(t=so(a,e,i)[0],a=[],s=0;s<t.length;s++){var h=t[s];a.push(new Oc(h.x,0,h.y))}return Mc(new sl(a,o,n,r))},createTextGeometry:function(t,e){return Mc(new hl(t,e))},loadFontFace:function(t,n){G.xhrLoad(t,function(e){if(!e)return n();var i;try{i=JSON.parse(e)}catch(t){i=JSON.parse(e.substring(65,e.length-2))}Qc.loadFace(i),n&&n(i.familyName.toLowerCase())},n?null:{sync:!0})},createRingModel:function(t,e,i,n,r,o,a,s,h,c){for(var l=[],u=0;u<t.length-1;u+=2)l.push({x:t[u],y:t[u+1]});o=o||G.shapeSide,a=a||0,s=s||o;var d,f,g,p,_,v,y,m,b,x,w,E,T,S,I,C,M,R=[],A=[],P=h?[]:U,D=h?[]:U,O=c?[]:U,B=c?[]:U,z=n?[]:U,V=n?[]:U,L=r?[]:U,F=r?[]:U,t=so(l,e,i),k=Yn(t),j=0,N=2*Math.PI/o;return t.forEach(function(t){if(1<(g=t.length)){if(p=t[0],n)for(v=p.x,m=p.y,u=a;u<s;u++)T=(w=u+1)*N,S=Q(E=u*N),I=Z(E),C=Q(T),M=Z(T),z.push(S*v,m,-I*v,C*v,m,-M*v,0,m,0),V.push(.5-.5*S,.5-.5*I,.5-.5*C,.5-.5*M,.5,.5);for(x=0;x<g;x++){for(_=t[x],v=p.x,y=_.x,m=p.y,b=_.y,d=j/k,j+=ys(p,_),f=j/k,u=a;u<s;u++)T=(w=u+1)*N,S=Q(E=u*N),I=Z(E),C=Q(T),M=Z(T),R.push(S*y,b,-I*y,C*y,b,-M*y,S*v,m,-I*v,C*y,b,-M*y,C*v,m,-M*v,S*v,m,-I*v),A.push(u/o,f,w/o,f,u/o,d,w/o,f,w/o,d,u/o,d),h&&u===a&&(P.push(0,m,0,0,b,0,S*y,b,-I*y,S*y,b,-I*y,S*v,m,-I*v,0,m,0),D.push(0,.5-m,0,.5-b,2*y,.5-b,2*y,.5-b,2*v,.5-m,0,.5-m)),c&&w===s&&(O.push(0,m,0,C*y,b,-M*y,0,b,0,C*y,b,-M*y,0,m,0,C*v,m,-M*v),B.push(1,.5-m,1-2*y,.5-b,1,.5-b,1-2*y,.5-b,1,.5-m,1-2*v,.5-m));p=_}if(r)for(v=p.x,m=p.y,u=a;u<s;u++)T=(w=u+1)*N,S=Q(E=u*N),I=Z(E),C=Q(T),M=Z(T),L.push(C*v,m,-M*v,S*v,m,-I*v,0,m,0),F.push(.5-.5*C,.5+.5*M,.5-.5*S,.5+.5*I,.5,.5)}}),{vs:R,uv:A,bottom_vs:L,bottom_uv:F,top_vs:z,top_uv:V,from_vs:P,from_uv:D,to_vs:O,to_uv:B}}},!0),An(F,{"3d.move.mode":H,"3d.selectable":!0,"3d.visible":!0,"3d.movable":!0,"3d.editable":!0,"3d.clip.direction":null,"3d.clip.percentage":1,"3d.reflectable":!0,"shape.border.gradient.color":H,"edge.gradient.color":H,"edge.source.t3":H,"edge.target.t3":H,"light.type":"point","light.center":[0,0,0],"light.color":[1,1,1,1],"light.disabled":!1,"light.angle":P/4,"light.range":0,"light.exponent":1,"light.intensity":1,"wf.visible":!1,"wf.width":1,"wf.color":Jo,"wf.short":!1,"wf.mat":H,"wf.geometry":!1,"wf.loadQuadWireframe":!1,"wf.combineTriangle":!0,batch:H,"transparent.mask":!1,brightness:H,"select.brightness":.7,"repeat.uv.length":H,"shadow.cast":!0,"shadow.receive":!0,bloom:!1,envmap:0,renderTextureSamples:4,alphaTest:.4,autorotate:!1,fixSizeOnScreen:!1,"texture.cache":!1,"hide.overlapping.group":H,"vector.dynamic":!1,"vector.dynamic.maxsize":2048,"texture.scale":1,"geometry.cache":!1,"highlight.mode":!1,"highlight.visible":!0,"highlight.width":.8,"highlight.color":"rgba(190, 210, 250, 1)","color.empty":[0,0,0,0],"label.face":ot,"label.t3":H,"label.r3":H,"label.texture.scale":2,"label.rotationMode":$f,"label.light":!1,"label.blend":H,"label.reverse.flip":!1,"label.reverse.color":ko,"label.reverse.cull":!1,"label.transparent":!1,"label.autorotate":!1,"label2.face":ot,"label2.t3":H,"label2.r3":H,"label2.texture.scale":2,"label2.rotationMode":$f,"label2.light":!1,"label2.blend":H,"label2.reverse.flip":!1,"label2.reverse.color":ko,"label2.reverse.cull":!1,"label2.transparent":!1,"label2.autorotate":!1,"note.face":ot,"note.t3":H,"note.r3":H,"note.texture.scale":2,"note.rotationMode":$f,"note.light":!1,"note.blend":H,"note.reverse.flip":!1,"note.reverse.color":ko,"note.reverse.cull":!1,"note.transparent":!1,"note.autorotate":!1,"note2.face":ot,"note2.t3":H,"note2.r3":H,"note2.texture.scale":2,"note2.rotationMode":$f,"note2.light":!1,"note2.blend":H,"note2.reverse.flip":!1,"note2.reverse.color":ko,"note2.reverse.cull":!1,"note2.transparent":!1,"note2.autorotate":!1,shape3d:H,"shape3d.color":Zo,"shape3d.top.color":H,"shape3d.bottom.color":H,"shape3d.from.color":H,"shape3d.to.color":H,"shape3d.image":H,"shape3d.top.image":H,"shape3d.bottom.image":H,"shape3d.from.image":H,"shape3d.to.image":H,"shape3d.light":!0,"shape3d.side":0,"shape3d.side.from":H,"shape3d.side.to":H,"shape3d.smooth":H,"shape3d.visible":!0,"shape3d.from.visible":!0,"shape3d.to.visible":!0,"shape3d.top.visible":!0,"shape3d.bottom.visible":!0,"shape3d.torus.radius":.17,"shape3d.resolution":0,"shape3d.blend":H,"shape3d.opacity":H,"shape3d.reverse.flip":!1,"shape3d.reverse.color":ko,"shape3d.reverse.cull":!1,"shape3d.transparent":!1,"shape3d.uv.offset":H,"shape3d.uv.scale":H,"shape3d.top.uv.offset":H,"shape3d.top.uv.scale":H,"shape3d.bottom.uv.offset":H,"shape3d.bottom.uv.scale":H,"shape3d.from.uv.offset":H,"shape3d.from.uv.scale":H,"shape3d.to.uv.offset":H,"shape3d.to.uv.scale":H,"shape3d.top.cap":H,"shape3d.bottom.cap":H,"shape3d.start.angle":0,"shape3d.sweep.angle":J,"shape3d.point.epsilon":1e-6,"shape3d.discard.selectable":!0,"shape3d.top.discard.selectable":!0,"shape3d.bottom.discard.selectable":!0,"shape3d.from.discard.selectable":!0,"shape3d.to.discard.selectable":!0,"shape3d.scaleable":!0,"shape3d.reflector":!1,"shape3d.reflector.color":"rgb(128,128,128)","shape3d.reflector.blur":0,"shape3d.reflector.blur.ratio":1,"shape3d.reflector.background":null,"shape3d.reflector.clip":.003,"texture.mipmap.max":H,"texture.filter":H,"texture.filter.min":H,"texture.filter.mag":H,"texture.wrap":H,"points.image":H,"points.color":"white","points.transparent":!1,"points.size":20,"points.opacity":1,"all.light":!0,"all.visible":!0,"all.color":Zo,"all.image":H,"all.blend":H,"all.opacity":H,"all.reverse.flip":!1,"all.reverse.color":ko,"all.reverse.cull":!1,"all.transparent":!1,"all.uv":H,"all.uv.offset":H,"all.uv.scale":H,"all.discard.selectable":!0,mat:H,"left.mat":H,"right.mat":H,"top.mat":H,"bottom.mat":H,"front.mat":H,"back.mat":H,"edge.source.anchor.elevation":H,"edge.target.anchor.elevation":H},!0),Su=!1,Iu=[0,0,0,0],Cu=function(t){return t instanceof xg},Mu=function(t){return[t.x,t.e||0,t.y]},Ru=function(t,e,i){for(var n=(e=to(e||0))[0],r=e[1],o=e[2];i--;)t.push(n,r,o)},Au=function(t,e,i){for(var n=(e=to(e||0))[0],r=e[1],o=e[2],a=e[3];i--;)t.push(n,r,o,a)},Pu=function(t,e,i){if(e)for(var n,r,o,a=e[0],s=e[1],h=e[2],c=e[4],l=e[5],u=e[6],d=e[8],f=e[9],g=e[10],p=e[12],_=e[13],v=e[14],y=i.length,m=0,m=0;m<y;m+=3)n=i[m],r=i[m+1],o=i[m+2],t.push(a*n+c*r+d*o+p,s*n+l*r+f*o+_,h*n+u*r+g*o+v);else Mn(t,i)},Du=function(t,e){var i=e.s("light.intensity"),n=to(e.s(mu)),r=n[0],o=n[1],n=n[2];1!==i&&(r*=i,o*=i,n*=i),t.push(r,o,n,e.s("light.disabled")?1:0)},Ou=function(t,e){return Math.max(t.getRotateMinPhi()+Fs,Math.min(t.getRotateMaxPhi()-Fs,e))},Bu=function(){return.05+$()/2},zu=function(t,e,i,n){var r,o=t.getEye();return t.isOrtho()?((r=Ns(t.getCenter(),o))[0]+=n[0],r[1]+=n[1],r[2]+=n[2]):r=o,Vu(e,i,n,r)},Vu=function(t,e,i,n){var r=Gs(t,e),t=Ns(n,i,!0),n=Gs(t,e);if(X(n)<Fs)return U;n=(r-Gs(i,e))/n;return[i[0]+t[0]*n,i[1]+t[1]*n,i[2]+t[2]*n]},Lu=function(t,e){return{x:2*t.x-e.x,y:2*t.y-e.y}},Fu=function(t,e,i,n){if(!t)return u=T(e.y-i.y,i.x-e.x),{x:e.x+n*Z(u),y:e.y+n*Q(u)};if(!i)return u=T(t.y-e.y,e.x-t.x),{x:e.x+n*Z(u),y:e.y+n*Q(u)};var r=Ns([t.x,t.y,0],[e.x,e.y,0],!0),o=Ns([i.x,i.y,0],[e.x,e.y,0],!0),a=-(r[0]+o[0])/2,s=-(r[1]+o[1])/2;if((d=W(a*a+s*s))<Fs)return u=T(t.y-e.y,e.x-t.x),{x:e.x+n*Z(u),y:e.y+n*Q(u)};var h=t.x-e.x,c=t.y-e.y,l=i.x-e.x,t=i.y-e.y,c=W(h*h+c*c),t=W(l*l+t*t),u=Y(Gs(r,o))/2,o=0<r[1]*o[0]-r[0]*o[1]?-1:1;a/=d,s/=d;var n=n/Z(u),c=N(c,t)/Q(u),d=Math.min(n,c),s={x:e.x+o*d*a,y:e.y+o*d*s};return i.b&&n>t/Q(u)&&(s.adjust=!0),s},ku=function(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],a=t[5],s=t[6],h=t[7],c=t[8],l=t[9],u=t[10],d=t[11],f=t[12],g=t[13],p=t[14],_=t[15],v=e*a-i*o,y=e*s-n*o,m=e*h-r*o,b=i*s-n*a,x=i*h-r*a,w=n*h-r*s,E=c*g-l*f,T=c*p-u*f,S=c*_-d*f,I=l*p-u*g,C=l*_-d*g,M=u*_-d*p,R=v*M-y*C+m*I+b*S-x*T+w*E;return R?(R=1/R,t[0]=(a*M-s*C+h*I)*R,t[1]=(n*C-i*M-r*I)*R,t[2]=(g*w-p*x+_*b)*R,t[3]=(u*x-l*w-d*b)*R,t[4]=(s*S-o*M-h*T)*R,t[5]=(e*M-n*S+r*T)*R,t[6]=(p*m-f*w-_*y)*R,t[7]=(c*w-u*m+d*y)*R,t[8]=(o*C-a*S+h*E)*R,t[9]=(i*S-e*C-r*E)*R,t[10]=(f*x-g*m+_*v)*R,t[11]=(l*m-c*x-d*v)*R,t[12]=(a*T-o*I-s*E)*R,t[13]=(e*I-i*T+n*E)*R,t[14]=(g*y-f*b-p*v)*R,void(t[15]=(c*b-l*y+u*v)*R)):U},ju=function(t,e){var i,n;e&&(i=e[0],n=e[1],e=e[2],t[12]=t[0]*i+t[4]*n+t[8]*e+t[12],t[13]=t[1]*i+t[5]*n+t[9]*e+t[13],t[14]=t[2]*i+t[6]*n+t[10]*e+t[14],t[15]=t[3]*i+t[7]*n+t[11]*e+t[15])},Nu=function(t,e){var i,n;e&&(i=e[0],n=e[1],e=e[2],t[0]=t[0]*i,t[1]=t[1]*i,t[2]=t[2]*i,t[3]=t[3]*i,t[4]=t[4]*n,t[5]=t[5]*n,t[6]=t[6]*n,t[7]=t[7]*n,t[8]=t[8]*e,t[9]=t[9]*e,t[10]=t[10]*e,t[11]=t[11]*e)},Uu=function(t,e,i){var n=e[0],r=e[1],o=e[2],a=e[3],s=e[4],h=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],g=e[11],p=e[12],_=e[13],v=e[14],y=e[15],m=i[0],b=i[1],x=i[2],e=i[3];return t[0]=m*n+b*s+x*u+e*p,t[1]=m*r+b*h+x*d+e*_,t[2]=m*o+b*c+x*f+e*v,t[3]=m*a+b*l+x*g+e*y,m=i[4],b=i[5],x=i[6],e=i[7],t[4]=m*n+b*s+x*u+e*p,t[5]=m*r+b*h+x*d+e*_,t[6]=m*o+b*c+x*f+e*v,t[7]=m*a+b*l+x*g+e*y,m=i[8],b=i[9],x=i[10],e=i[11],t[8]=m*n+b*s+x*u+e*p,t[9]=m*r+b*h+x*d+e*_,t[10]=m*o+b*c+x*f+e*v,t[11]=m*a+b*l+x*g+e*y,m=i[12],b=i[13],x=i[14],e=i[15],t[12]=m*n+b*s+x*u+e*p,t[13]=m*r+b*h+x*d+e*_,t[14]=m*o+b*c+x*f+e*v,t[15]=m*a+b*l+x*g+e*y,t},Gu=function(t,e,i,n){var r,o=e[0],a=e[1],s=e[2],h=n[0],c=n[1],l=n[2],u=i[0],d=i[1],f=i[2];return X(o-u)<Fs&&X(a-d)<Fs&&X(s-f)<Fs?((r=t)[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r):(r=1/W((e=o-u)*e+(n=a-d)*n+(i=s-f)*i),(r=W((u=c*(i*=r)-l*(n*=r))*u+(d=l*(e*=r)-h*i)*d+(f=h*n-c*e)*f))?(u*=r=1/r,d*=r,f*=r):f=d=u=0,(r=W((l=n*f-i*d)*l+(h=i*u-e*f)*h+(c=e*d-n*u)*c))?(l*=r=1/r,h*=r,c*=r):c=h=l=0,t[0]=u,t[1]=l,t[2]=e,t[3]=0,t[4]=d,t[5]=h,t[6]=n,t[7]=0,t[8]=f,t[9]=c,t[10]=i,t[11]=0,t[12]=-(u*o+d*a+f*s),t[13]=-(l*o+h*a+c*s),t[14]=-(e*o+n*a+i*s),t[15]=1,t)},Hu=function(t,e,i,n,r,o,a){var s=1/(e-i),h=1/(n-r),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*h,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*s,t[13]=(r+n)*h,t[14]=(a+o)*c,t[15]=1,t},Wu=function(t,e){if(t.vr.enable){var i=t.vr.getViewMatrix(e);if(i)return i}return Gu(e||Hs(),t._eye,t._center,t._up)},qu=function(t,e){if(t.vr.enable){var i=t.vr.getProjectMatrix();if(i)return i}if(!e&&t._computedProjectMatrix)return qs(t._computedProjectMatrix);var n,r,o=t.getAspect(),a=t._near,i=t._far,e=Hs();return t._ortho?(n=t._orthoWidth/2,Hu(e,-n,n,-(r=n/o),r,a,i)):(n=e,r=t._fovy,t=o,o=a,a=i,i=1/x(r/2),r=1/(o-a),n[0]=i/t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=i,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=(a+o)*r,n[11]=-1,n[12]=0,n[13]=0,n[14]=2*a*o*r,n[15]=0),e},Xu=function(t,e){if(!t)return U;var i=[],n=0,r=t.length,o=r/3;if(e){for(;n<r;n++)i[n]=0;for(n=0;n<e.length;n+=3){var a=[],s=[];(c=[])[0]=t[3*e[n+1]+0]-t[3*e[n]+0],c[1]=t[3*e[n+1]+1]-t[3*e[n]+1],c[2]=t[3*e[n+1]+2]-t[3*e[n]+2],a[0]=t[3*e[n+2]+0]-t[3*e[n+1]+0],a[1]=t[3*e[n+2]+1]-t[3*e[n+1]+1],a[2]=t[3*e[n+2]+2]-t[3*e[n+1]+2],s[0]=c[1]*a[2]-c[2]*a[1],s[1]=c[2]*a[0]-c[0]*a[2],s[2]=c[0]*a[1]-c[1]*a[0];for(var h=0;h<3;h++)i[3*e[n+h]+0]+=s[0],i[3*e[n+h]+1]+=s[1],i[3*e[n+h]+2]+=s[2]}}else for(n=0;n<o;n+=3){var c,a=[],s=[];(c=[])[0]=t[3*(n+1)+0]-t[3*n+0],c[1]=t[3*(n+1)+1]-t[3*n+1],c[2]=t[3*(n+1)+2]-t[3*n+2],a[0]=t[3*(n+2)+0]-t[3*(n+1)+0],a[1]=t[3*(n+2)+1]-t[3*(n+1)+1],a[2]=t[3*(n+2)+2]-t[3*(n+1)+2],s[0]=c[1]*a[2]-c[2]*a[1],s[1]=c[2]*a[0]-c[0]*a[2],s[2]=c[0]*a[1]-c[1]*a[0];for(h=0;h<3;h++)i[3*(n+h)+0]=s[0],i[3*(n+h)+1]=s[1],i[3*(n+h)+2]=s[2]}for(n=0;n<r;n+=3){var l=[];l[0]=i[n+0],l[1]=i[n+1],l[2]=i[n+2];var u=W(l[0]*l[0]+l[1]*l[1]+l[2]*l[2]);0===u&&(u=Fs),l[0]=l[0]/u,l[1]=l[1]/u,l[2]=l[2]/u,i[n+0]=l[0],i[n+1]=l[1],i[n+2]=l[2]}return new js(i)},Qu=function(t,e,i,n){var r,o,a,s,h,c,l;return i=i||t.createTexture(),e&&(r=t.TEXTURE_2D,o=t.REPEAT,a=t.CLAMP_TO_EDGE,s=t.TEXTURE_MIN_FILTER,h=(n=n||Xi).minFilter||n.filter||t.LINEAR,l=n.magFilter||n.filter||t.LINEAR,t.activeTexture(t.TEXTURE0),$u(t,i),t.texImage2D(r,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),td(t,t.TEXTURE_MAG_FILTER,l),c=e.naturalWidth||e.width,l=e.naturalHeight||e.height,na.isPOT(c)&&na.isPOT(l)&&!n.clampToEdge&&!e.clampToEdge?(td(t,t.TEXTURE_WRAP_S,o),td(t,t.TEXTURE_WRAP_T,o),td(t,s,h===t.NEAREST?t.NEAREST_MIPMAP_NEAREST:t.LINEAR_MIPMAP_LINEAR),n.mipmapMaxLevel!==H&&td(t,t.TEXTURE_MAX_LEVEL,n.mipmapMaxLevel),t.generateMipmap(r)):(td(t,t.TEXTURE_WRAP_S,a),td(t,t.TEXTURE_WRAP_T,a),td(t,s,h)),$u(t,U)),i},Yu=function(t,e){var i=new Uint8Array(4);return e=e||t.createTexture(),t.activeTexture(t.TEXTURE0),$u(t,e),td(t,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i),e},Zu=function(t){t._26I&&t._prg&&(t._26I.deleteProgram(t._prg),t._prg=U)},Ku=function(t,e,i,n){i=t.createShader(i);return t.shaderSource(i,n),t.compileShader(i),t.attachShader(e,i),i},Ju=function(t){return t.createBuffer()},$u=function(t,e){t.bindTexture(t.TEXTURE_2D,e||t._emptyTexture)},td=function(t,e,i){t.texParameteri(t.TEXTURE_2D,e,i)},ed=function(t,e){t=yu.for(t).directState();t.polygonOffset.enabled=!0,t.polygonOffset.value=e},id=function(t){yu.for(t).directState().polygonOffset.enabled=!1},nd=function(t,e){e&&(yu.for(t).directState().color.clear=to(e))},rd=function(t){var e=yu.for(t),t=e.directUniforms(),e=e.directAttribs();t.uFix=!0,e.aNormal=!1},od=function(t){var e=yu.for(t),t=e.directUniforms();e.directAttribs(),t.uFix=!1},ad=function(t,e,i,n,r,o,a,s){var h=yu.for(t),c=h.directState(),h=h.directUniforms();t._picking||(i?(h.uBlend=!0,h.uBlendColor=i):h.uBlend=!1,h.uLight=n==U||n,_n(r)&&1!==r&&(h.uPartOpacity=r),h.uReverseFlip=o!=U&&o,h.uFixPickReverseColor=a||ko),c.cullFace.enabled=!!s},sd=function(t){t._picking||(yu.for(t).directUniforms().uPartOpacity=1)},fv=[0,0,1,1],hd=function(t,e,i,n,r,o,a,s,h){var c=yu.for(t),l=c.directUniforms(),c=c.directAttribs();return i?(l.uTexture=!0,l.uDiscardSelectable=!vn(n)||n,c.aUv=gd(t,r,o,U,2),h?(l.uBlendTexture=!0,l.uBlendSampler=h):(l.uBlendTexture=!1,l.uBlendSampler=t._emptyBlendTexture),l.uSampler=i,a?(fv[0]=a[0],fv[1]=a[1]):(fv[0]=0,fv[1]=0),s?(fv[2]=s[0],fv[3]=s[1]):(fv[2]=1,fv[3]=1),void(l.uOffsetScale=fv)):(l.uSampler=t._emptyTexture,void(l.uBlendSampler=t._emptyBlendTexture))},cd=function(t,e,i){var n=yu.for(t),r=n.directUniforms(),n=n.directAttribs();t.activeTexture(t.TEXTURE0),$u(t,U),t.activeTexture(t.TEXTURE1),$u(t,U),i&&(n.aUv=!1,r.uTexture=!1,r.uSampler=t._emptyTexture,r.uBlendTexture=!1,r.uBlendSampler=t._emptyBlendTexture)},ld=function(t,e,i,n,r,o){var a=yu.for(t),s=a.directUniforms(),a=a.directAttribs();!i||A||O||t.lineWidth(i),n&&!t._picking&&(s.uFixPickReverseColor=n),r&&(a.aPosition=gd(t,r,o,U))},ud=function(t,e,i,n){Tu&&(n=t[Tu]),t.drawArrays(n==U?t.TRIANGLES:n,e,i);e=t._renderInfo;e&&(e.calls++,e.vertices+=i,n!=U&&n!==t.TRIANGLES||(e.faces+=i/3),n===t.LINES&&(e.lines+=i/2),n===t.POINTS&&(e.points+=i))},dd=function(t,e,i,n,r){Tu&&(n=t[Tu]),t.drawElements(n==U?t.TRIANGLES:n,i,r==U?t.UNSIGNED_SHORT:r,e==U?0:2*e);e=t._renderInfo;e&&(e.calls++,e.vertices+=i,n!=U&&n!==t.TRIANGLES||(e.faces+=i/3),n===t.LINES&&(e.lines+=i/2),n===t.POINTS&&(e.points+=i))},fd=function(t,e,i){var n=t.ARRAY_BUFFER;return t.bindBuffer(n,e),i&&t.bufferData(n,i,t.STATIC_DRAW),e},gd=function(t,e,i,n,r){return i?vd(t,t.ARRAY_BUFFER,e,i):fd(t,e,i)},pd=function(t,e,i){var n=t.ELEMENT_ARRAY_BUFFER;t.bindBuffer(n,e),i&&t.bufferData(n,i,t.STATIC_DRAW)},_d=function(t,e,i){vd(t,t.ELEMENT_ARRAY_BUFFER,e,i)},vd=function(t,e,i,n){var r=(r=n._bufId)||(n._bufId=Gl.Math.generateIncreasingID()),o=t._bufPool;return(i=o[r])&&i._buf?t.bindBuffer(e,i._buf):(i=o[r]={_buf:Ju(t)},t.bindBuffer(e,i._buf),t.bufferData(e,n,t.STATIC_DRAW)),i._fid=t._renderInfo.frame,i._buf},yd=function(t,e){e!=U&&0<=e&&t.disableVertexAttribArray(e)},md=function(t,e){var i=t.getGL();t._prg;var n=yu.for(i),i=n.directUniforms();n.directAttribs(),t._7O=t._8O.pop(),e&&(i.uMVMatrix=t._7O,t._6O=e,i.uNMatrix=e)},bd=function(t,e){return e=e||Hs(),s=t,(a=e)[0]=s[0],a[1]=s[1],a[2]=s[2],a[3]=s[3],a[4]=s[4],a[5]=s[5],a[6]=s[6],a[7]=s[7],a[8]=s[8],a[9]=s[9],a[10]=s[10],a[11]=s[11],a[12]=s[12],a[13]=s[13],a[14]=s[14],a[15]=s[15],ku(e),n=(i=e)[1],r=i[2],o=i[3],t=i[6],a=i[7],s=i[11],i[1]=i[4],i[2]=i[8],i[3]=i[12],i[4]=n,i[6]=i[9],i[7]=i[13],i[8]=r,i[9]=t,i[11]=i[14],i[12]=o,i[13]=a,i[14]=s,e;var i,n,r,o,a,s},xd=function(t,e){var i=t.getGL(),n=t._7O,i=yu.for(i).directUniforms();e?(t._8O.push(qs(n)),i.uMMatrix=e,Uu(n,n,e),t._7O=n):i.uMMatrix=Ws,i.uMVMatrix=n,i.uNMatrix=bd(n,t._6O)},wd={body:0,label:1,label2:2,note:3,note2:4,symbol:5},Ed=function(t,e,i,n,r,o){var a,s=i?((a=n._pickId)||(a=n._pickId=e._pickIdUsed,e._pickIdUsed+=10),null!=(i=wd[r])?s=a+i:(s=(i=(i=n._pickExtraPartMap)||(n._pickExtraPartMap={}))[r])||(s=i[r]=e._pickIdUsed++),e[s]||(e[s]={data:n,part:r}),zg(s)):Iu;return o||(yu.for(t).directUniforms().uFixPickReverseColor=s),s},Td=function(t,e,i){"target"!==i&&(i="source");var n="target"===i?e.getTargetAgent():e.getSourceAgent(),r="edge."+i+".";if(wn(n)){var o=e.s(r+"anchor.x"),a=e.s(r+"anchor.elevation"),s=e.s(r+"anchor.y"),h=$s(n,t.getMat(n)),i=n.getAnchor3d();return Xs([(o===H?.5:o)-i.x,(a===H?.5:a)-i.y,(s===H?.5:s)-i.z],h)}var c=e.s(r+"index"),h=t.getData3dUI(n);if(!h.info||!h.info.list)return!1;if(0<=c){var l,u,d,f=(m=h.info._lastPointsSegments).points,g=m.segments,p=-1,_=-1,v=0;for(y=(g||f).length;v<y;v++){if(3===(u=g?g.get(v):1))d=2;else if(4===u)d=3;else{if(5===u)continue;d=1}if(p+=d,++_===c){l=f.get(p);break}}return[(l=l||f.get(f.length-1)).x,l.e||0,l.y]}r=e.s(r+"percent")||.5,r=Math.max(0,Math.min(r,1));if(!h||!h.getCache)return!1;var h=h.getCache(),y=h[h.length-1].length,m=(m=t.getLineOffset(n,r*y)).point;return[m.x,m.y,m.z]},dv={center:function(t,e,i,n,r){var o=-e[1]/2,e={x:-e[0]/2,y:o,width:e[0],height:e[1]},i=Fo(t,e,i);return[i.x+n,-i.y-r,Bu()]},front:function(t,e,i,n,r){var o=-e[1]/2,o={x:-e[0]/2,y:o,width:e[0],height:e[1]},i=Fo(t,o,i);return[i.x+n,-i.y-r,e[2]/2+Bu()]},back:function(t,e,i,n,r){var o={x:-e[0]/2,y:-e[1]/2,width:e[0],height:e[1]},i=Fo(t,o,i);return[-i.x-n,-i.y-r,-e[2]/2-Bu()]},left:function(t,e,i,n,r){var o=-e[1]/2,o={x:-e[2]/2,y:o,width:e[2],height:e[1]},i=Fo(t,o,i);return[-e[0]/2-Bu(),-i.y-r,i.x+n]},right:function(t,e,i,n,r){var o={x:-e[2]/2,y:-e[1]/2,width:e[2],height:e[1]},i=Fo(t,o,i);return[e[0]/2+Bu(),-i.y-r,-i.x-n]},top:function(t,e,i,n,r){var o={x:-e[0]/2,y:-e[2]/2,width:e[0],height:e[2]},i=Fo(t,o,i);return[i.x+n,e[1]/2+Bu(),i.y+r]},bottom:function(t,e,i,n,r){var o=-e[2]/2,o={x:-e[0]/2,y:o,width:e[0],height:e[2]},i=Fo(t,o,i);return[i.x+n,-e[1]/2-Bu(),-i.y-r]}},Sd=function(t,e,i,n,r,o){return dv[n](t,e,i,r||0,o||0)},Id=function(t,e,i,n,r,o,a,s,h,c){return r&&(e[0]+=r[0],e[1]+=r[1],e[2]+=r[2]),ju(t,i),s?(i=Hs(),fl(i,h,c),Xs(e,i),ju(t,e),t.auto=s,t.pos=Xs([0,0,0],t),o&&(s=t.mat2=Hs(),fl(s,o,a))):(fl(t,h,c),ju(t,e),n===st?Ks(t,-I):n===ht?Ks(t,I):n===ct?Zs(t,-I):n===lt?Zs(t,I):n===at&&Ks(t,P),fl(t,o,a)),t},Cd=function(t,e){var i,n,r,o,a,s,h,c,l,u,d,f=e.auto,g=e.mat2,p=t.gv;f?(i=Hs(),r=[0,0,0,0],h="string"==typeof f?[(f.indexOf("x")<0?p._eye:p._center)[0],(f.indexOf("y")<0?p._eye:p._center)[1],(f.indexOf("z")<0?p._eye:p._center)[2]]:p._eye,c=r,l=Gu(Hs(),h,p._center,p._up),u=l[0]+l[5]+l[10],(d=0)<u?(d=2*Math.sqrt(u+1),c[3]=.25*d,c[0]=(l[6]-l[9])/d,c[1]=(l[8]-l[2])/d,c[2]=(l[1]-l[4])/d):l[0]>l[5]&l[0]>l[10]?(d=2*Math.sqrt(1+l[0]-l[5]-l[10]),c[3]=(l[6]-l[9])/d,c[0]=.25*d,c[1]=(l[1]+l[4])/d,c[2]=(l[8]+l[2])/d):l[5]>l[10]?(d=2*Math.sqrt(1+l[5]-l[0]-l[10]),c[3]=(l[8]-l[2])/d,c[0]=(l[1]+l[4])/d,c[1]=.25*d,c[2]=(l[6]+l[9])/d):(d=2*Math.sqrt(1+l[10]-l[0]-l[5]),c[3]=(l[1]-l[4])/d,c[0]=(l[8]+l[2])/d,c[1]=(l[6]+l[9])/d,c[2]=.25*d),n=i,s=(a=o=r)[0],t=a[1],f=a[2],h=a[3],a=(a=s*s+t*t+f*f+h*h)?1/a:0,o[0]=-s*a,o[1]=-t*a,o[2]=-f*a,o[3]=h*a,u=o,l=e.pos,c=u[0],d=u[1],r=u[2],s=u[3],f=c*(t=c+c),a=c*(h=d+d),u=c*(o=r+r),c=d*h,d*=o,r*=o,t*=s,h*=s,o*=s,n[0]=1-(c+r),n[1]=a+o,n[2]=u-h,n[3]=0,n[4]=a-o,n[5]=1-(f+r),n[6]=d+t,n[7]=0,n[8]=u+h,n[9]=d-t,n[10]=1-(f+c),n[11]=0,n[12]=l[0],n[13]=l[1],n[14]=l[2],n[15]=1,g&&Uu(i,i,g),xd(p,i)):xd(p,e)},Md=function(t,e,i,n,r){var o=t.s,a=t.gv,s=a.getGL(),h=a._prg,c=a._buffer,l=a._1O,u=yu.for(s).directAttribs();Qu(s,Yr,l),Cd(t,i),ad(s,0,o(e+".blend"),o(e+".light"),o(e+".opacity"),o(e+".reverse.flip"),o(e+".reverse.color"),o(e+".reverse.cull")),hd(s,h,l,r,c.uv,_f),u.aPosition=gd(s,c.vs,n,U),u.aNormal=gd(s,c.ns,vf,U),_d(s,c.is,yf),dd(s,0,yf.length),cd(s,0,l),sd(s),md(a)},Rd=function(t,e,i){var n=t.gv,r=t.data,t=t[e]={blend:n.getBodyColor(r)||n.getFaceBlend(r,e),light:n.getFaceLight(r,e),color:n.getFaceColor(r,e),opacity:n.getFaceOpacity(r,e),transparent:n.getFaceTransparent(r,e),reverseFlip:n.getFaceReverseFlip(r,e),reverseColor:n.getFaceReverseColor(r,e),reverseCull:n.getFaceReverseCull(r,e),texture:n.getFaceImage(r,e),blendTexture:n.getFaceBlendImage(r,e),discardSelectable:n.getFaceDiscardSelectable(r,e)};return"csg"!==e&&(t.uv=n.getFaceUv(r,e)||i&&i[e+"Uv"],t.uvScale=n.getFaceUvScale(r,e)||i&&i[e+"UvScale"],t.uvOffset=n.getFaceUvOffset(r,e)||i&&i[e+"UvOffset"],(e=n.getFaceMat(r,e))&&(e=$s(r,e),r.appendAnchorMatrix3d(e),t.mat=e)),t},Ad=function(t,e,i,n,r){var o,a,s,h=t[n];h&&r(h.transparent)&&(s=t.data,a=(o=t.gv)._buffer,r=o.getTexture(h.texture,s,n),t=o.getTexture(h.blendTexture,s),s=(n=yu.for(e)).directUniforms(),n=n.directAttribs(),hd(e,i,r,h.discardSelectable,a.uv,h.tuv,h.uvOffset,h.uvScale,t),ad(e,0,h.blend,h.light,h.opacity,h.reverseFlip,h.reverseColor,h.reverseCull),h.cs&&!o._batchColorDisabled?(s.uBatchColor=!0,n.aBatchColor=gd(e,a.batchColor,h.cs,i.aBatchColor,4)):s.uDiffuse=h.color||F["color.empty"],n.aPosition=gd(e,a.vs,h.vs,U),n.aNormal=gd(e,a.ns,h.ns,U),ud(e,0,h.vs.length/3),h.cs&&!o._batchColorDisabled&&(s.uBatchColor=!1,yd(e,i.aBatchColor)),sd(e),cd(e,0,r))},Pd=function(t,e,i){bn(t)?t.forEach(function(t){Pd(t,e,i)}):pn(t)?Pd(Gf(e,t),e,i):yn(t)&&t.shape3d?Pd(t.shape3d,e,i):i.push(t)},Dd=function(t,e,i,n,r,o){for(var a,s,h,c,l,u,d,f,g,p=[n-e,r-i],_=t?t.length:0,v=0;v<_;v++){for(s=2,h=(a=t[v])[0],c=a[1];s+1<a.length;){if(l=a[s],u=a[s+1],Un(e,i,n,r,h,c,l,u,!0)){f=ys(d=[l-h,u-c]),d[0]/=f,d[1]/=f,f=0<Gs(p,d)?o:-o,g=[d[0]*f,d[1]*f];break}h=l,c=u,s+=2}if(g)break}if(g)for(n=e+g[0],r=i+g[1],v=0;v<_;v++)for(s=2,h=(a=t[v])[0],c=a[1];s+1<a.length;){if(l=a[s],u=a[s+1],Un(e,i,n,r,h,c,l,u,!0))return[0,0];h=l,c=u,s+=2}return g||[n-e,r-i]},Od=function(t){return"nearest"===t?fu.NEAREST:"linear"===t?fu.LINEAR:t},Bd=Gl.graph3d={},zd=function(t,e,i){zs("ht.graph3d."+t,e,i)},Vd="~<yfusfw!+!yjsubNQv!>!opjujtpQ`mh\v!gjeof$!\v<*1/2!-opjujtpQb)5dfw!+!yjsubNNv!+!yjsubNxpebit!>!esppDxpebit\v!QBNXPEBIT`FTV!gfegj$!\v\v!gjeof$!\v~<fdobutjEfojMb!>!fdobutjEfojMw|*itbEv)gj\v!ITBE!gfegj$!\v\v!gjeof$!\v~<ttfouihjsCidubCb!>!ttfouihjsCidubCw|*ttfouihjsCidubCv)gj\v!TTFOUIHJSCIDUBC!gfegj$!\v\v!gjeof$!\v~<eofmCidubCb!>!eofmCidubCw|*eofmCidubCv)gj\v!EOFMCIDUBC!gfegj$!\v\v!gjeof$!\v~<spmpDidubCb!>!spmpDidubCw|*spmpDidubCv)gj\v!SPMPDIDUBC!gfegj$!\v~<wVb!>!wVs|*fsvuyfUeofmCv)gj\v~<x{/fmbdTuftggPv!+!wVb!,!zy/fmbdTuftggPv!>!wVw|*fsvuyfUv)gj<*opjujtpQb)4dfw!>!opjujtpQw~<**1/2!-opjujtpQb)5dfw!+!yjsubNNv)4dfw!>!emspXw<*yfusfw)4dfw!>!yfusfWw<**1/2!-mbnspOb)5dfw!+!yjsubNOv)4dfw!>!mbnspOw|*ldjQva!%%!yjGva)gj<*1/2!-opjujtpQb)5dfw!+!yjsubNWNv!>!yfusfw!5dfw|!*ejpw)ojbn!ejpw\v!gjeof$!\v<esppDxpebit!5dfw!hojzsbw<yjsubNxpebit!5ubn!nspgjov\v!QBNXPEBIT`FTV!gfegj$!\v\v!gjeof$!\v<fdobutjEfojMw!ubpmg!hojzsbw<fdobutjEfojMb!ubpmg!fuvcjsuub<itbEv!mppc!nspgjov\v!ITBE!gfegj$!\v\v!gjeof$!\v<^UPQT`YBN]opjudfsjEupqTv!4dfw!nspgjov<^UPQT`YBN]opjujtpQupqTv!4dfw!nspgjov<^UPQT`YBN]spmpDupqTv!5dfw!nspgjov\v!1!?!UPQT`YBN!gj$!\v\v!gjeof$!\v<^UOJPQ`YBN]opjujtpQuojpQv!4dfw!nspgjov<^UOJPQ`YBN]spmpDuojpQv!5dfw!nspgjov\v!1!?!UOJPQ`YBN!gj$!\v\v!gjeof$!\v<^SJE`YBN]opjudfsjEsjEv!4dfw!nspgjov<^SJE`YBN]spmpDsjEv!5dfw!nspgjov\v!1!?!SJE`YBN!gj$!\v\v!gjeof$!\v<eofmCidubCw!4dfw!hojzsbw<eofmCidubCb!4dfw!fuvcjsuub<eofmCidubCv!mppc!nspgjov\v!EOFMCIDUBC!gfegj$!\v\v!gjeof$!\v<ttfouihjsCidubCw!ubpmg!hojzsbw<ttfouihjsCidubCb!ubpmg!fuvcjsuub<ttfouihjsCidubCv!mppc!nspgjov\v!TTFOUIHJSCIDUBC!gfegj$!\v\v!gjeof$!\v<spmpDidubCw!5dfw!hojzsbw<spmpDidubCb!5dfw!fuvcjsuub<spmpDidubCv!mppc!nspgjov\v!SPMPDIDUBC!gfegj$!\v<opjujtpQw!4dfw!hojzsbw<emspXw!4dfw!hojzsbw<yfusfWw!4dfw!hojzsbw<mbnspOw!4dfw!hojzsbw<yjGv!mppc!nspgjov<ldjQv!mppc!nspgjov<yjsubNxfjWv!5ubn!nspgjov<yjsubNOv!5ubn!nspgjov<yjsubNQv!5ubn!nspgjov<yjsubNNv!5ubn!nspgjov<yjsubNWNv!5ubn!nspgjov<opjujtpQb!4dfw!fuvcjsuub<mbnspOb!4dfw!fuvcjsuub<wVs!3dfw!hojzsbw<wVw!3dfw!hojzsbw<wVb!3dfw!fuvcjsuub<fmbdTuftggPv!5dfw!nspgjov<fsvuyfUeofmCv!mppc!nspgjov<fsvuyfUv!mppc!nspgjov!YJGFSQ^#CBRBEJxTT87hJFI,,bX1XrIwcn3UM{ZeZ,M6HEN6nLxe2Z72s2:3johr6foKrpqwxNKYkdbJ2CN[mBbf[wXU,T0oGuSEd190ohLZkEn8IuCe[OHoWeKz:Sf,VS7xdSLw23W1YJLU:jdv2{hiDbhDzNNEh9tp3xsuEp94Sl4c3wRzqwShMDRhCLRjCDEBOH5BBVRBCFRE4cJTHrTDH1BNgHJN",Ld="~~<eJ!>!spmpDhbsG`mh\v~<spmpDsfmqnbTwv!>+!eJ<*wVs!-sfmqnbTeofmCv)E3fsvuyfu!>!spmpDsfmqnbTwv!5dfw|!*fsvuyfUeofmCv)!gj!\v\v!gjeof$!\v~<ttfouihjsCidubCw!>+!chs/eJ!!!|*ttfouihjsCidubCv)gj\v!TTFOUIHJSCIDUBC!gfegj$!\v~<ttfouihjsCv!>+!chs/eJ!!!|*1/2!>a!ttfouihjsCv)gj~~<zujdbqPusbQv!>+!b/eJ!!!|*1/2!>a!zujdbqPusbQv)gj~\v!gjeof$!\v~<zujwjudfmgfSv!+!{zy/spmpDwof!>,!chs/eJ<*!spmpDwof!)sbfojMpUmfyfUqbNwof!>!spmpDwof<*!*!{z/dfWudfmgfs!-y/dfWudfmgfs)4dfw!-qbNwoFv!)fcvDfsvuyfu!>!spmpDwof!5dfw<*!mbnspOemspx!-yfusfWpUbsfnbd!)udfmgfs!>!dfWudfmgfs!4dfw<*!yjsubNxfjWv!-O!)opjudfsjEnspgtobsUftsfwoj!>!mbnspOemspx!4dfw<*!opjujtpQbsfnbDv!.!emspXw!)f{jmbnspo!>!yfusfWpUbsfnbd!4dfw|*qbNwoFftVv)!gj\v!QBNWOF`FTV!gfegj$!\v\v!gjeof$!\v<*spudbGhpg!-*x/eJ!-chs/spmpDhpGv)5dfw!-eJ)yjn!>!eJ\v!gjeof$!\v<*iuqfe!-sbGhpGv!-sbfOhpGv)qfutiuppnt!>!spudbGhpg!ubpmg\v!ftmf$!\v<*iuqfe!+!iuqfe!+!zujtofEhpGv!+!zujtofEhpGv!.)qyf!.!1/2!>!spudbGhpg!ubpmg\v!3QYF`HPG!gfegj$!\v<{/yfusfWw.!>!iuqfe!ubpmg\v!HPG!gfegj$!\v\v!gjeof$!\v~~~~<chs/^j]spmpDupqTv!+!udfggFupqt!+!fhobSm!+!*1/1!-*mbnspOm.!-O)upe)ybn!>,!chs/eJ<*1/1!-*^j]uofopqyFupqTv!-udfggFupqt)xpq)ybn!>!udfggFupqt|*^j]fmhoBupqTv!?!udfggFupqt)gj<*mbnspOm!-^j]opjudfsjEupqTv)upe!>!udfggFupqt!ubpmg<*spudfWm)f{jmbnspo!>!mbnspOm!4dfw|*1/1!?!fhobSm)!gj~<*1/2!-*^j]fhobSupqTv!0!*spudfWm)iuhofm))ojn!.!1/2!>!fhobSm|*1/1!?!^j]fhobSupqTv)!gj<1/2!>!fhobSm!ubpmg<^j]opjujtpQupqTv!.!yfusfWw!>!spudfWm!4dfw|*1/1!>>!x/^j]spmpDupqTv)gj|!*,,j!<UPQT`YBN!=!j!<1>j!uoj)spg\v!1!?!UPQT`YBN!gj$!\v\v!gjeof$!\v~~~<chs/^j]spmpDuojpQv!+!fhobSm!+!*1/1!-**spudfWm)f{jmbnspo.!-O)upe)ybn!>,!chs/eJ|*1/1!?!fhobSm)!gj~<*1/2!-*^j]fhobSuojpQv!0!*spudfWm)iuhofm))ojn!.!1/2!>!fhobSm|*1/1!?!^j]fhobSuojpQv)!gj<1/2!>!fhobSm!ubpmg<^j]opjujtpQuojpQv!.!yfusfWw!>!spudfWm!4dfw|*1/1!>>!x/^j]spmpDuojpQv)gj|!*,,j!<UOJPQ`YBN!=!j!<1>j!uoj)spg\v!1!?!UOJPQ`YBN!gj$!\v\v!gjeof$!\v~~<chs/^j]spmpDsjEv!+!*1/1!-**^j]opjudfsjEsjEv)f{jmbnspo.!-O)upe)ybn!>,!chs/eJ|*1/1!>>!x/^j]spmpDsjEv)gj|!*,,j!<SJE`YBN!=!j!<1>j!uoj)spg\v!1!?!SJE`YBN!gj$!\v~<chs/spmpDuihjmebfIv!+!nsfUusfcnbm!>+!chs/eJ\v!gjeof$!\v~<fvmbWxpebit!+!zujtofuoJxpebit!.!1/2!>+!nsfUusfcnbm!~!!<osvufs!<esbdtje!!|!*1/1!>>!fvmbWxpebit!%%!mmvDxpebit)!gj<*esppDxpebit!-tvjebSxpebit!-tbjCxpebit!-f{jTxpebit!-qbNxpebit!)xpebiTufh!.!1/2!>!fvmbWxpebit!ubpmg|!*fwjfdfSxpebit)!gj\v!QBNXPEBIT`FTV!gfegj$!\v~<*1/2!-fhobSuihjmebfIv0*yfusfWw)iuhofm)ojn!.!1/2!!>+!nsfUusfcnbm|*1/1!?!fhobSuihjmebfIv)gj<*1/1!-zujtofuoJuofjcnBuihjmebfIv!,!*zujtofuoJuofjcnBuihjmebfIv!.!1/2)!+!*M.!-O)upe)ybn!>!nsfUusfcnbm!ubpmg|*1/1!>>!x/spmpDuihjmebfIv)gj|*uihjMv)gj~\v!gjeof$!\v~<spmpDeofmCv!>+!eJ|*eofmCv)gj\v!ftmf$!\v~<spmpDeofmCv!>+!eJ|*eofmCv)gj!ftmf~<eofmCidubCw!>+!chs/eJ|*eofmCidubCv)gj\v!EOFMCIDUBC!gfegj$!\v~\v~<esbdtje|*1/1!>>!x/eJ)gj\v!gjeof$!\v<ftvggjEv!>!eJ\v!ftmf$!\v~<ftvggjEv!>!eJ|ftmf~<spmpDidubCw!>!eJ|*spmpDidubCv)gj\v!SPMPDIDUBC!gfegj$!\v|ftmf~<spmpDwv!>!eJ|*fsvuyfUv)gj|!ftmf~<spmpDftsfwfSldjQyjGv!>!eJ|*qjmGftsfwfSva!%%!ldbCtj)gj~<fvsu!>!ldbCtj<O.!>!O|*1/1!=!*O!-F)upe)gj<ftmbg!>!ldbCtj!mppc<F.!>!M!4dfw\v!gjeof$!\v<*yfusfWw.)f{jmbnspo!>!F!4dfw\v!ftmf$!\v<*2!-1!-1)4dfw!>!F!4dfw\v!DJIQBSHPIUSP!gfegj$!\v<*mbnspOw)f{jmbnspo!>!O!4dfw|!ftmf~\v!gjeof$!\v~~<ftvggjEv!>!eJ|ftmf~<esbdtje|*1/1!>>!x/ftvggjEv)gj|!*!fdobutjEitbEv!?!*!fdobutjEqbHitbEv!-fdobutjEfojMw!)epn!%%!itbEv)!gj\v!ITBE!gfegj$!\v\v!gjeof$!\v<spmpDftsfwfSldjQyjGv!>!eJ\v!ftmf$!\v~<spmpDftsfwfSldjQyjGv!>!eJ|ftmf~<spmpDidubCw!>!eJ|*spmpDidubCv)gj\v!SPMPDIDUBC!gfegj$!\v|*yjGv)gj<eJ!5dfw|ftmf~~!<esbdtje!|!*1/1!>>!b/spmpDhbsG`mh)!gj\v!gjeof$!\v<spmpDftsfwfSldjQyjGv!>!spmpDhbsG`mh\v!ftmf$!\v~<spmpDftsfwfSldjQyjGv!>!spmpDhbsG`mh|ftmf~<spmpDidubCw!>!spmpDhbsG`mh|*spmpDidubCv)gj\v!SPMPDIDUBC!gfegj$!\v|*ldjQv)gj~~!<esbdtje!|!**sje!-*uofdsfQqjmDv)4dfw)upe!?!*opjujtpQw!-sje)upe)!gj~!<1/2.!>!{/sje!|!*8!=!opjudfsjEqjmDv)!gj!ftmf~!<1/2!>!{/sje!|!*7!=!opjudfsjEqjmDv)!gj!ftmf~!<1/2.!>!z/sje!|!*6!=!opjudfsjEqjmDv)!gj!ftmf~!<1/2!>!z/sje!|!*5!=!opjudfsjEqjmDv)!gj!ftmf~!<1/2.!>!y/sje!|!*4!=!opjudfsjEqjmDv)!gj!ftmf~!<1/2!>!y/sje!|!*3!=!opjudfsjEqjmDv)!gj<*1/1!-1/1!-1/1)4dfw!>!sje!4dfw|!*1!?!opjudfsjEqjmDv)!gj~~~!<esbdtje!|!*utfUbiqmBv!>=!b/spmpDwv)!gj!!!!|!ftmf~~!<esbdtje!|!*1/1!>>!b/spmpDwv)!gj!!!!|!*uofsbqtobsUv)!gj<*wVw!-sfmqnbTv)E3fsvuyfu!>!spmpDwv|**fmcbudfmfTesbdtjEv!%%!ldjQv)a!%%!fsvuyfUv)gj<spmpDwv!5dfw~!<osvufs!<*1/2!-1/1!-1/1!-1/1)5dfw!>!spmpDhbsG`mh!|!*uvpldbmc)!gj|!*ejpw)ojbn!ejpw<uvpldbmc!mppc!nspgjov~<*!{zy/*!yjsubn!+!*!1/1!-sje!)5dfw!)!)f{jmbnspo!osvufs|!*!yjsubn!5ubn!oj!-sje!4dfw!oj!)opjudfsjEnspgtobsUftsfwoj!4dfw~!<*!*!SPUDBG`BNNBH!)ubpmg!-fvmbw!)sbfojMpUbnnbH!osvufs!|!*!fvmbw!5dfw!)sbfojMpUmfyfUqbNwof!5dfw~<*!x/fvmbw!-*!*!spudbGbnnbh!)4dfw!-{zy/fvmbw!)xpq!)5dfw!osvufs|!*!spudbGbnnbh!ubpmg!oj!-fvmbw!5dfw!oj!)sbfojMpUbnnbH!5dfw<1/3!>!SPUDBG`BNNBH!ubpmg!utopd\v!gjeof$!\v\v~!!!!!!!!\vgjeof$!!!!!!!!!!!!\v<*!qe!-*!z/f{jTmfyfu!-E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!osvufs!!!!!!!!!!!!!!!!\vftmf$!!!!!!!!!!!!\v<*!1/:!0!1/2!)!+!*!!!!!!!!!!!!!!!!\v*!qe!-*!z/f{jTmfyfu!-yyz/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-yyy/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-zyz/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-zyy/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-yzz/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-yzy/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-zzz/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!qe!-*!z/f{jTmfyfu!-zzy/uftggp!,!E4ec!)WVpUfcvd!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v)!osvufs!!!!!!!!!!!!!!!!\v<z/f{jTmfyfu!+!tvjebSxpebit!+!*!2!-2!.!)3dfw!>!uftggp!3dfw!!!!!!!!!!!!!!!!\v*!UGPT`GDQ`FQZU`QBNXPEBIT!)efojgfe!}}!*!GDQ`FQZU`QBNXPEBIT!)efojgfe!gj$!!!!!!!!!!!!\v<*!opjujtpQpUuihjm!)f{jmbnspo!>!E4ec!4dfw!!!!!!!!!!!!\v<tbjCxpebit!>,!qe!!!!!!!!<*!sbfObsfnbDxpebit!.!sbGbsfnbDxpebit!)!0!*!sbfObsfnbDxpebit!.!*!opjujtpQpUuihjm!)iuhofm!)!>!qe!ubpmg!!!!!!!!!!!!\v<{zy/esppDxpebit!>!opjujtpQpUuihjm!4dfw!!!!!!!!!!!!\v<*!*!1/3!-1/5!)3dfw!+!f{jTqbNxpebit!)!0!*!1/2!)3dfw!>!f{jTmfyfu!3dfw!!!!!!!!!!!!\v|!*!sbGbsfnbDxpebit!ubpmg!-sbfObsfnbDxpebit!ubpmg!-esppDxpebit!5dfw!-tvjebSxpebit!ubpmg!-tbjCxpebit!ubpmg!-f{jTqbNxpebit!3dfw!-qbNxpebit!E3sfmqnbt!)xpebiTuojpQufh!ubpmg!!!!!!!!\v~!!!!!!!!\v<*!68/1!-684/1!)3dfw!,!sbobmq!+!*!63/1!-632/1!)3dfw!osvufs!!!!!!!!!!!!\v~!!!!!!!!!!!!\v<1/3!.!Zohjt!+!{/w!>!z/sbobmq!!!!!!!!!!!!!!!!\v<1/3!,!Zohjt!+!1/3!,!y/w!>!y/sbobmq!!!!!!!!!!!!!!!!\v<*!z/w!)ohjt!>!Zohjt!ubpmg!!!!!!!!!!!!!!!!\v|!*!foPutpnmb!>?!z/Wtcb!)!gj!ftmf!~!!!!!!!!!!!!\v<Yohjt!+!1/3!,!Yohjt!+!{/w!>!y/sbobmq!!!!!!!!!!!!!!!!\v<*!y/w!)ohjt!>!Yohjt!ubpmg!!!!!!!!!!!!!!!!\v|!*!foPutpnmb!>?!y/Wtcb!)!gj!ftmf!~!!!!!!!!!!!!\v<y/w!.!1/5!>!y/sbobmq!!!!!!!!!!!!!!!!!!!!\v*!1/1!?!{/w!)!gj!!!!!!!!!!!!!!!!\v|!*!foPutpnmb!>?!{/Wtcb!)!gj!!!!!!!!!!!!\v<mfyfUButpnmb!.!1/2!>!foPutpnmb!ubpmg!!!!!!!!!!!!\v<Zf{jTmfyfu!+!6/2!>!mfyfUButpnmb!ubpmg!!!!!!!!!!!!\v<zy/w!>!sbobmq!3dfw!!!!!!!!!!!!\v<*!Zf{jTmfyfu!+!1/3!.!1/2!)!+!fcvDpUfmbdt!>+!w!!!!!!!!!!!!\v<fcvDpUfmbdt!>+!Wtcb!!!!!!!!!!!!\v<*!*!{/Wtcb!-z/Wtcb!)ybn!-y/Wtcb!)ybn!0!1/2!>!fcvDpUfmbdt!ubpmg!!!!!!!!!!!!\v<*!w!)tcb!>!Wtcb!4dfw!!!!!!!!!!!!\v|!*!Zf{jTmfyfu!ubpmg!-w!4dfw!)WVpUfcvd!3dfw!!!!!!!!\v~!!!!!!!!\v<xpebit!osvufs!!!!!!!!!!!!\v~!!!!!!!!!!!!\vgjeof$!!!!!!!!!!!!\v<*!{/esppDxpebit!-zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!>!xpebit!!!!!!!!!!!!!!!!\vftmf$!!!!!!!!!!!!\v<*!1/:!0!1/2!)!+!*!!!!!!!!!!!!!!!!\v*!{/esppDxpebit!-*!2ze!-2ye!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!2ze!-1/1!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!2ze!-1ye!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1/1!-2ye!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1/1!-1ye!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1ze!-2ye!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1ze!-1/1!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1ze!-1ye!)3dfw!,!zy/esppDxpebit!-f{jTqbNxpebit!-qbNxpebit!)qsfMxpebiTE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v)!>!xpebit!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!z/f{jTmfyfu!,!>!2ze!ubpmg!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!y/f{jTmfyfu!,!>!2ye!ubpmg!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!z/f{jTmfyfu!.!>!1ze!ubpmg!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!y/f{jTmfyfu!.!>!1ye!ubpmg!!!!!!!!!!!!!!!!\v<f{jTqbNxpebit!0!*!1/2!)3dfw!>!f{jTmfyfu!3dfw!!!!!!!!!!!!!!!!\v*!UGPT`GDQ`FQZU`QBNXPEBIT!)efojgfe!gjmf$!!!!!!!!!!!!\v<*!1/:!0!1/2!)!+!*!!!!!!!!!!!!!!!!\v*!{/esppDxpebit!-*!2ze!-2ye!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!2ze!-1/1!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!2ze!-1ye!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1/1!-2ye!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1/1!-1ye!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1ze!-2ye!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1ze!-1/1!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v,!*!{/esppDxpebit!-*!1ze!-1ye!)3dfw!,!zy/esppDxpebit!-qbNxpebit!)fsbqnpDE3fsvuyfu!!!!!!!!!!!!!!!!!!!!\v)!>!xpebit!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!z/f{jTmfyfu!,!>!2ze!ubpmg!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!y/f{jTmfyfu!,!>!2ye!ubpmg!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!z/f{jTmfyfu!.!>!1ze!ubpmg!!!!!!!!!!!!!!!!\v<tvjebSxpebit!+!y/f{jTmfyfu!.!>!1ye!ubpmg!!!!!!!!!!!!!!!!\v<f{jTqbNxpebit!0!*!1/2!)3dfw!>!f{jTmfyfu!3dfw!!!!!!!!!!!!!!!!\v*!GDQ`FQZU`QBNXPEBIT!)efojgfe!gj$!!!!!!!!!!!!\v|!*!utfUnvutvsg!)!gj!!!!!!!!!!!!\v<*!dfWutfUnvutvsg!)mmb!>!utfUnvutvsg!mppc!!!!!!!!!!!!\v<*!1/2!>=!{/esppDxpebit!-nvutvsGoj!)3dfwc!>!dfWutfUnvutvsg!3dfwc!!!!!!!!!!!!\v<*!dfWnvutvsGoj!)mmb!>!nvutvsGoj!mppc!!!!!!!!!!!!\v<*!1/2!>=!z/esppDxpebit!-1/1!>?!z/esppDxpebit!-1/2!>=!y/esppDxpebit!-1/1!>?!y/esppDxpebit!)!5dfwc!>!dfWnvutvsGoj!5dfwc!!!!!!!!!!!!\v<tbjCxpebit!>,!{/esppDxpebit!!!!!!!!!!!!\v<x/esppDxpebit!>0!{zy/esppDxpebit!!!!!!!!!!!!\v<1/2!>!xpebit!ubpmg!!!!!!!!!!!!\v|!*!esppDxpebit!5dfw!-tvjebSxpebit!ubpmg!-tbjCxpebit!ubpmg!-f{jTqbNxpebit!3dfw!-qbNxpebit!E3sfmqnbt!)xpebiTufh!ubpmg!!!!!!!!\v~!!!!!!!!\v<d!osvufs!!!!!!!!!!!!\v<*!y/g!-c!-b!)yjn!>!d!ubpmg!!!!!!!!!!!!\v<*!z/g!-us!-cs!)yjn!>!c!ubpmg!!!!!!!!!!!!\v<*!z/g!-um!-cm!)yjn!>!b!ubpmg!!!!!!!!!!!!\v<*!6/1!,!f{jt!+!wv!)udbsg!>!g!3dfw!!!!!!!!!!!!\v<*!fsbqnpd!-zz/uftggp!+!f{jTmfyfu!,!WVejpsuofd!-tiuqfe!)fsbqnpDE3fsvuyfu!>!us!ubpmg!!!!!!!!!!!!\v<*!fsbqnpd!-yz/uftggp!+!f{jTmfyfu!,!WVejpsuofd!-tiuqfe!)fsbqnpDE3fsvuyfu!>!cs!ubpmg!!!!!!!!!!!!\v<*!fsbqnpd!-zy/uftggp!+!f{jTmfyfu!,!WVejpsuofd!-tiuqfe!)fsbqnpDE3fsvuyfu!>!um!ubpmg!!!!!!!!!!!!\v<*!fsbqnpd!-yy/uftggp!+!f{jTmfyfu!,!WVejpsuofd!-tiuqfe!)fsbqnpDE3fsvuyfu!>!cm!ubpmg!!!!!!!!!!!!\v<f{jt!0!*!6/1!,!f{jt!+!wv!)sppmg!>!WVejpsuofd!3dfw!!!!!!!!!!!!\v<f{jt!0!*!1/2!)3dfw!>!f{jTmfyfu!3dfw!!!!!!!!!!!!\v<*!1/2!-1/1!)3dfw!>!uftggp!3dfw!utopd!!!!!!!!!!!!\v|!*!fsbqnpd!ubpmg!-wv!3dfw!-f{jt!3dfw!-tiuqfe!E3sfmqnbt!)qsfMxpebiTE3fsvuyfu!ubpmg!!!!!!!!\v~!!!!!!!!\v<*!*!*!wv!-tiuqfe!)E3fsvuyfu!)iuqfEpUBCHSldbqov!-fsbqnpd!)qfut!osvufs!!!!!!!!!!!!\v|!*!fsbqnpd!ubpmg!-wv!3dfw!-tiuqfe!E3sfmqnbt!)fsbqnpDE3fsvuyfu!ubpmg!!!!!!!!\v~!!!!!!!!<*!tspudbGldbqoV!-w!)upe!osvufs|!*!w!5dfw!oj!utopd!)iuqfEpUBCHSldbqov!ubpmg!!!!!!!!\v<*!/2!-tspudbGldbQ!)5dfw!0!fmbdtoxpEldbqoV!>!tspudbGldbqoV!5dfw!utopd!!!!!!!!\v<*!/763!!-/763!+!/763!-/763!+!/763!+!/763!)4dfw!>!tspudbGldbQ!4dfw!utopd!!!!!!!!\v<*2!hojevmdyf)!opjudbsg!?.!2//1!00!</763!0!/663!>!fmbdtoxpEldbqoV!ubpmg!utopd!!!!!!!!\v<*2!hojevmdoj)!2//1!?.!opjudbsg!00!</663!0!/763!>!fmbdtqVldbQ!ubpmg!utopd!!!!!!!!\v<esppDxpebit!5dfw!hojzsbw<fwjfdfSxpebit!mppc!nspgjov<tvjebSxpebit!ubpmg!nspgjov<tbjCxpebit!ubpmg!nspgjov<zujtofuoJxpebit!ubpmg!nspgjov<f{jTxpebit!3dfw!nspgjov<qbNxpebit!E3sfmqnbt!nspgjov<mmvDxpebit!mppc!nspgjov\v!QBNXPEBIT`FTV!gfegj$!\v\v!gjeof$!\v<fdobutjEfojMw!ubpmg!hojzsbw<fdobutjEqbHitbEv!ubpmg!nspgjov<fdobutjEitbEv!ubpmg!nspgjov<itbEv!mppc!nspgjov\v!ITBE!gfegj$!\v\v!gjeof$!\v\v!gjeof$!\v<sbGhpGv!ubpmg!nspgjov<sbfOhpGv!ubpmg!nspgjov\v!ftmf$!\v<zujtofEhpGv!ubpmg!nspgjov\v!3QYF`HPG!gfegj$!\v<spmpDhpGv!5dfw!nspgjov\v!HPG!gfegj$!\v\v!gjeof$!\v<^UPQT`YBN]opjudfsjEupqTv!4dfw!nspgjov<^UPQT`YBN]opjujtpQupqTv!4dfw!nspgjov<^UPQT`YBN]fhobSupqTv!ubpmg!nspgjov<^UPQT`YBN]fmhoBupqTv!ubpmg!nspgjov<^UPQT`YBN]uofopqyFupqTv!ubpmg!nspgjov<^UPQT`YBN]spmpDupqTv!5dfw!nspgjov\v!1!?!UPQT`YBN!gj$!\v\v!gjeof$!\v<^UOJPQ`YBN]opjujtpQuojpQv!4dfw!nspgjov<^UOJPQ`YBN]fhobSuojpQv!ubpmg!nspgjov<^UOJPQ`YBN]spmpDuojpQv!5dfw!nspgjov\v!1!?!UOJPQ`YBN!gj$!\v\v!gjeof$!\v<^SJE`YBN]opjudfsjEsjEv!4dfw!nspgjov<^SJE`YBN]spmpDsjEv!5dfw!nspgjov\v!1!?!SJE`YBN!gj$!\v\v!gjeof$!\v<eofmCidubCw!4dfw!hojzsbw<eofmCidubCv!mppc!nspgjov\v!EOFMCIDUBC!gfegj$!\v\v!gjeof$!\v<ttfouihjsCidubCw!ubpmg!hojzsbw<ttfouihjsCidubCv!mppc!nspgjov\v!TTFOUIHJSCIDUBC!gfegj$!\v\v!gjeof$!\v<spmpDidubCw!5dfw!hojzsbw<spmpDidubCv!mppc!nspgjov\v!SPMPDIDUBC!gfegj$!\v<spmpDuihjmebfIv!5dfw!nspgjov<zujtofuoJuofjcnBuihjmebfIv!ubpmg!nspgjov<fhobSuihjmebfIv!ubpmg!nspgjov<emspXw!4dfw!hojzsbw<opjujtpQbsfnbDv!4dfw!nspgjov<yjsubNxfjWv!5ubn!nspgjov\v!gjeof$!\v<zujwjudfmgfSv!ubpmg!nspgjov<qbNwoFv!fcvDsfmqnbt!nspgjov<qbNwoFftVv!mppc!nspgjov\v!QBNWOF`FTV!gfegj$!\v<opjujtpQw!4dfw!hojzsbw<yfusfWw!4dfw!hojzsbw<mbnspOw!4dfw!hojzsbw<ftvggjEv!5dfw!nspgjov<zujdbqPusbQv!ubpmg!nspgjov<ttfouihjsCv!ubpmg!nspgjov<uihjMv!mppc!nspgjov<spmpDeofmCv!5dfw!nspgjov<eofmCv!mppc!nspgjov<uofdsfQqjmDv!ubpmg!nspgjov<opjudfsjEqjmDv!uoj!nspgjov<wVs!3dfw!hojzsbw<sfmqnbTeofmCv!E3sfmqnbt!nspgjov<sfmqnbTv!E3sfmqnbt!nspgjov<wVw!3dfw!hojzsbw<fsvuyfUeofmCv!mppc!nspgjov<fsvuyfUv!mppc!nspgjov<uofsbqtobsUv!mppc!nspgjov<utfUbiqmBv!ubpmg!nspgjov<spmpDftsfwfSldjQyjGv!5dfw!nspgjov<qjmGftsfwfSv!mppc!nspgjov<ldjQv!mppc!nspgjov<yjGv!mppc!nspgjov<fmcbudfmfTesbdtjEv!mppc!nspgjov!YJGFSQ\v!gjeof$!\v\v!gjeof$!\v\v!<ubpmg!qnvjefn!opjtjdfsq!\v\v!ftmf$!\v\v!<ubpmg!qihji!opjtjdfsq!\v\v!IHJI`OPJTJDFSQ`UOFNHBSG`MH!gfegj$!\v\v!TF`MH!gfegj$!\v",An(G,{setBatchInfo:function(t,e){Bi[t]=e},getBatchInfo:function(t){return Bi[t]},getBatchInfoMap:function(){return Bi},setBatchInfoMap:function(t){Bi=t}},!0),Fd=[1,1,1],kd=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],jd=[1,0,0,0,0,1,0,1,1,1,1,0],Nd=[-.5,.5,.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,.5,.5],Ud=[.5,.5,-.5,.5,.5,.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5],Gd=[.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,.5,.5,.5,.5,-.5],Hd=[.5,-.5,.5,-.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5],Wd=[.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,.5],qd=[-.5,.5,-.5,.5,.5,-.5,.5,-.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5],Xd=function(t,e){t._40Q.each(function(t){t.ivBatch(e)})},Qd=function(t,e,i){var n=i._id,r=e[n];if(r){var o=r.batch,a=t[o],s=a.ds,h=r.index;if(a.invalidate=!0,delete e[n],s.splice(h,1),Vn(s))delete t[o];else{for(var c=r.begin,l=r.size,u=3*c,d=3*l,f=4*c,g=4*l,p=a.vs,_=a.ps,v=a.uv,i=a.cs,n=a.bs,t=a.rs,o=a.ns,a=a.ls;h<s.length;h++)(r=e[s[h]._id]).index--,r.begin-=l;p.splice(u,d),_.splice(f,g),v&&v.splice(2*c,2*l),i&&i.splice(f,g),n&&n.splice(u,d),t&&t.splice(c,l),o&&o.splice(u,d),a&&a.splice(c,l)}}},Yd=function(t,e,i,n,r){if(!n)return U;var o,a=e[n];return a||(r=(o=r.getBatchInfo(n)||Xi).image?[]:U,a=e[n]={vs:[],ns:[],uv:r,cs:r||o.color?U:[],bs:o.blend?[]:U,ps:[],rs:o.brightness?[]:U,ds:[]}),a.invalidate=!0,t[i._id]={index:a.ds.length,begin:a.vs.length/3,batch:n},a.ds.push(i),a},Zd=function(t,e){return e!=U&&1!==e?[t[0]*e,t[1]*e,t[2]*e,t[3]]:t},Kd=function(t,e,i){var n=t.getData3dUI(e),r=n.shapeModel;if((r=r||Gf(n))||!n.shapeName){var o,a=e.s("wf.combineTriangle");if(i.geometry){if(!r&&!(r=e instanceof Gl.Node&&!(e instanceof Gl.Shape)?uv=uv||{vs:mf,is:bf,uv:xf}:[n.left,n.front,n.right,n.back,n.top,n.bottom]))return H;if(!(o=a?(u=e.s("wf.normEpsilon"),isNaN(u)&&(u=2),a=0|Math.min(3,Math.max(1,isNaN(a)?1:a)),Ac[a-1](r,n,180/(Math.PI*u))):function(t,e){if(g=t._lineModel)return g;bn(t);var i,n,r,o,a,s,h,c,l,u,d,f=["","top_","bottom_"],g=[],p=[];for(Pd(t,e,p),i=0,n=p.length;i<n;i++)if(c=p[i])for(r=0,o=f.length;r<o;r++)if(s=c[f[r]+"vs"]){a=(h=c[f[r]+"is"])?h.length:s.length/3;for(var _=0;_<a;_+=3)d=h?(l=h[_],u=h[_+1],h[_+2]):(u=(l=_)+1,_+2),l*=3,u*=3,d*=3,g.push(s[l],s[l+1],s[l+2],s[u],s[u+1],s[u+2],s[u],s[u+1],s[u+2],s[d],s[d+1],s[d+2],s[d],s[d+1],s[d+2],s[l],s[l+1],s[l+2])}return t._lineModel=g}(r,n))||0===o.length)return}else o=i.short?Sf:Tf;var s=t.getBrightness(e),h=to(i.color||"white"),c=h[3]<1,l=Math.ceil(i.width)||1,a=(c?"T":"O")+(e.s("bloom")?"_1_":"_0_")+l,u=e.getRenderLayer(),r=t._40Q.get(u),t=r.wireframeIndexMap,u=r.wireframeModelMap,r=u[a];(r=r||(u[a]={vs:[],cs:[],ps:[],ds:[],T:c,B:e.s("bloom"),W:l})).invalidate=!0;c=r.vs,l=r.cs,r=r.ds,a=t[e._id]={index:r.length,begin:c.length/3,batch:a};r.push(e);n=n.mat;e instanceof Gl.Edge||!(!n||!i.geometry&&e instanceof Gl.Shape)||(n=$s(e,i.mat),e.appendAnchorMatrix3d(n)),Pu(c,n,o);a=a.size=c.length/3-a.begin;Au(l,Zd(h,s),a)}},Jd=function(t,e,i){if(e){var n=4*e.begin,r=i[e.batch].ps;if(r[n]!==t[0]||r[n+1]!==t[1]||r[n+2]!==t[2]||r[n+3]!==t[3]){for(var o=0;o<e.size;o++)r[n++]=t[0],r[n++]=t[1],r[n++]=t[2],r[n++]=t[3];r._invalidateThisFrame=!0}}},$d=function(t,e){var i=e+["32"],n=t[e],e=t[i];n?e&&e.length===n.length?(e.set(n),e._bufId=null):t[i]=new js(n):delete t[i]},tf=function(e,i,t,n,r,o,a,s,h){if(bn(t))t.forEach(function(t){tf(e,i,t,n,r,o,a,s,h)});else if(pn(t))tf(e,i,Gf(n,t),n,r,o,a,s,h);else if(yn(t)){var c,l=xh(t.mat,i,e),u=xh(t.s3,i,e),d=xh(t.t3,i,e),f=xh(t.r3,i,e);if((u||f||d||l)&&(c=th(l,u,f,xh(t.rotationMode,i,e),d),o.push(c)),t.shape3d)tf(e,i,t.shape3d,n,r,o,a,s,t);else{f=n.s;h=h||Xi;var g=o[0],p=o.length,d=f("shape3d.color",t.color,h.color);if(r=r||f("shape3d.blend",t.blend,h.blend),1<p){g=qs(g);for(var _=1;_<p;_++)Uu(g,g,o[_])}t.vs&&f(Fe,t.visible,h.visible)&&ef(g,a,s,t.vs,t.uv,t.is,r,d),t.top_vs&&f(Ne,t.topVisible,h.topVisible)&&ef(g,a,s,t.top_vs,t.top_uv,t.top_is,r,f("shape3d.top.color",t.topColor,h.topColor)||d),t.bottom_vs&&f(Ue,t.bottomVisible,h.bottomVisible)&&ef(g,a,s,t.bottom_vs,t.bottom_uv,t.bottom_is,r,f("shape3d.bottom.color",t.bottomColor,h.bottomColor)||d),t.from_vs&&f(ke,t.fromVisible,h.fromVisible)&&ef(g,a,s,t.from_vs,t.from_uv,t.from_is,r,f("shape3d.from.color",t.fromColor,h.fromColor)||d),t.to_vs&&f(je,t.toVisible,h.toVisible)&&ef(g,a,s,t.to_vs,t.to_uv,t.to_is,r,f("shape3d.to.color",t.toColor,h.toColor)||d)}c&&o.pop()}},ef=function(t,e,i,n,r,o,a,s){var h,c=e.cs,l=e.uv,e=e.bs;if(o){h=o.length;for(var u=0;u<h;u++){var d=o[u];Pu(i,t,[n[3*d],n[3*d+1],n[3*d+2]]),l&&Mn(l,[r[2*d],r[2*d+1]])}}else h=n.length/3,Pu(i,t,n),l&&Mn(l,r);c&&Au(c,s,h),e&&(a?Ru(e,a,h):Mn(e,Fd,h))},nf=function(t,e,i,n){var r=[];n?tf(t.gv,t.data,n,t,t.getBodyColor(),[e],i,r):(rf(t,st,e,i,r),rf(t,ht,e,i,r),rf(t,ot,e,i,r),rf(t,at,e,i,r),rf(t,ct,e,i,r),rf(t,lt,e,i,r),rf(t,"csg",e,i,r)),r.length&&(Mn(i.vs,r),Mn(i.ns,Xu(r)))},rf=function(t,e,i,n,r){var o=t[e];if(o){var a=o.tuv;if(a){var s,h,c,l,t=o.uvScale,e=o.uvOffset;if(t)for(s=a.length,h=t[0],c=t[1],l=0;l<s;l+=2)a[l]*=h,a[l+1]*=c;if(e)for(s=a.length,h=e[0],c=e[1],l=0;l<s;l+=2)a[l]+=h,a[l+1]+=c}ef(i,n,r,o.vs,a,U,o.blend,o.color)}},of=function(t,e,i,n,r,o,a,s){var h,c,l,u,d,f,g,p,_,v,y=i.cs,m=i.uv,b=i.bs;t.getFaceVisible(e,o)&&((g=t.getFaceMat(e,o))&&(r=$s(e,g)),Pu(a,r,s),y&&Au(y,t.getFaceColor(e,o),6),m&&(p=t.getFaceUv(e,o)||n[o+"Uv"],h=t.getFaceUvScale(e,o)||n[o+"UvScale"],v=t.getFaceUvOffset(e,o)||n[o+"UvOffset"],c=(p=p?[p[6],p[7],p[0],p[1],p[2],p[3],p[2],p[3],p[4],p[5],p[6],p[7]]:jd)[0],l=p[1],u=p[2],d=p[3],f=p[4],i=p[5],g=p[6],a=p[7],r=p[8],s=p[9],y=p[10],n=p[11],h&&(c*=p=h[0],l*=_=h[1],u*=p,d*=_,f*=p,i*=_,g*=p,a*=_,r*=p,s*=_,y*=p,n*=_),v&&(c+=_=v[0],l+=v=v[1],u+=_,d+=v,f+=_,i+=v,g+=_,a+=v,r+=_,s+=v,y+=_,n+=v),m.push(c,l,u,d,f,i,g,a,r,s,y,n)),b&&((o=t.getBodyColor(e)||t.getFaceBlend(e,o))?Ru(b,o,6):Mn(b,Fd,6)))},af=function(t,e,i,n){var i=t._picking?t.pickColorMap:null,r=t.getGL(),o=(t._prg,t._buffer);if(!zn(e)){for(var a in xd(t,kd),rd(r),e){var s,h,c,l,u,d,f=e[a];n&&!f.T||!n&&f.T||(f.invalidate?(f.invalidate=!1,$d(f,"vs"),$d(f,"cs"),$d(f,"ls"),$d(f,"ps")):i&&f.ps&&f.ps._invalidateThisFrame&&(f.ps._invalidateThisFrame=!1,$d(f,"ps")),s=f.vs32,h=i?f.ps32:f.cs32,ld(r,0,f.W,U,o.vs,s),c=(u=yu.for(r)).directUniforms(),l=u.directAttribs(),d=f.D,u=!t._dashDisabled&&d,c.uAlphaTest=F.alphaTest,r._blooming&&!f.B&&(c.blackout=!0),u&&(c.uDash=!0,c.uDashDistance=d,c.uDashGapDistance=f.G,c.uDiffuse=f.A||F["color.empty"],l.aLineDistance=gd(r,o.lineDistance,f.ls32,U,1)),(d=!t._batchColorDisabled)&&h.length?(c.uBatchColor=!0,l.aBatchColor=gd(r,o.batchColor,h,U,4)):(c.uBatchColor=!1,l.aBatchColor=!1),hd(r),ud(r,0,s.length/3,r.LINES),cd(r),d&&(c.uBatchColor=!1,l.aBatchColor=!1),u&&(c.uDash=!1,l.aLineDistance=!1),r._blooming&&!f.B&&(c.blackout=!1))}od(r),md(t)}},sf=function(t,e,i,n,r){var o,a,s,h,c,l,u,d,f,g,p,i=t._picking?t.pickColorMap:null,_=t.getGL(),v=t._prg,y=yu.for(_),m=y.directUniforms(),b=y.directAttribs(),x=t._buffer;if(!zn(e)&&!t.drawFilter){for(o in xd(t,kd),e)!1===(p=t.getBatchInfo(o)||Xi).visible||n&&!p.transparent||!n&&p.transparent||t.isReflecting(_)&&!1===p.reflectable||((u=p.renderLayerMask)==U&&(u=Ph),r==U&&(r=Ph),Oh(r,u)&&(a=e[o],i||!p.transparentMask)&&(d=n&&!0===p.autoSort&&(t._33Q||a.invalidate),a.invalidate?(a.invalidate=!1,$d(a,"vs"),$d(a,"ns"),$d(a,"cs"),$d(a,"rs"),$d(a,"ps"),$d(a,"bs"),$d(a,"uv")):i&&a.ps&&a.ps._invalidateThisFrame&&(a.ps._invalidateThisFrame=!1,$d(a,"ps")),s=a.vs32,h=i?a.ps32:a.cs32,l=a.uv32,g=a.bs32,c=a.rs32,u=s.length/3,d&&((f=hf(s,t.getEye(),t))?(a.is=f.is,a.elementTypeUint=f.useUint32):(a.is=null,a.elementTypeUint=null)),u&&(d=t.getTexture(p.image),ad(_,0,U,p.light,p.opacity,p.reverseFlip,p.reverseColor,p.reverseCull),h?t._batchColorDisabled?(m.uBatchColor=!1,b.aBatchColor=!1):(m.uBatchColor=!0,b.aBatchColor=gd(_,x.batchColor,h,U,4)):(m.uBatchColor=!1,m.uDiffuse=p.color||F["color.empty"]),f=p.alphaTest,m.uAlphaTest=f===H?F.alphaTest:f,_._blooming&&!p.bloom&&(m.blackout=!0),p.envmap!==H?(m.uUseEnvMap=!0,m.uReflectivity=p.envmap):(m.uUseEnvMap=!1,m.uReflectivity=0),(f=g&&!t._batchBlendDisabled)&&(m.uBatchBlend=!0,b.aBatchBlend=gd(_,x.batchBlend,g,U)),(g=c&&!t._batchBrightnessDisabled)&&(m.uBatchBrightness=!0,b.aBatchBrightness=gd(_,x.batchBrightness,c,U,1)),l?hd(_,v,d,p.discardSelectable,x.uv,l,p.uvOffset,p.uvScale):hd(_),b.aPosition=gd(_,x.vs,s,U),b.aNormal=gd(_,x.ns,a.ns32,U),a.is?(pd(_,x.is,a.is),dd(_,0,u,null,a.elementTypeUint?_.UNSIGNED_INT:null)):ud(_,0,u),l?cd(_,0,d):cd(_),h&&!t._batchColorDisabled&&(m.uBatchColor=!1,b.aBatchColor=!1),f&&(m.uBatchBlend=!1,b.aBatchBlend=!1),g&&(m.uBatchBrightness=!1,b.aBatchBrightness=!1),_._blooming&&!p.bloom&&(m.blackout=!1),sd(_))));md(t)}},hf=function(n,r,t){var e=n.length/3,i=65535<e,t=t._glCapabilities.elementTypeUint&&i;if(!t&&i)return null;for(var o=new Array(e),a=e/3,s=new Array(a),h=0;h<a;h++)s[h]=h;s.sort(function(t,e){var i=9*t,t=[(n[i]+n[3+i]+2*n[6+i])/4,(n[1+i]+n[4+i]+2*n[7+i])/4,(n[2+i]+n[5+i]+2*n[8+i])/4],i=[(n[i=9*e]+n[3+i]+2*n[6+i])/4,(n[1+i]+n[4+i]+2*n[7+i])/4,(n[2+i]+n[5+i]+2*n[8+i])/4],i=ys(r,t)-ys(r,i);return 0<i?-1:i<0?1:0});for(h=0;h<a;h++){var c=3*h,l=3*s[h];o[c]=l,o[1+c]=1+l,o[2+c]=2+l}return{useUint32:t,is:new(t?Uint32Array:ks)(o)}},cf={obj:function(r,o){var t={mat:r.mat,s3:r.s3,r3:r.r3,rotationMode:r.rotationMode,t3:r.t3,cube:r.cube==U||r.cube,center:r.center==U||r.center,ignoreMtls:r.ignoreMtls,ignoreTransparent:r.ignoreTransparent,ignoreColor:r.ignoreColor,ignoreImage:r.ignoreImage,ignoreNormal:r.ignoreNormal,prefix:r.prefix,flipY:r.flipY,flipFace:r.flipFace,reverseFlipMtls:r.reverseFlipMtls,finishFunc:function(t,e){if(t){var i,e=[];for(i in t){var n=t[i];e.rawS3=n.rawS3,n.center&&(e.center=n.center),e.push(n),r.eachModel&&r.eachModel(i,n)}e.json=r,o(e)}else o()}};G.loadObj(r.obj,r.mtl,t)},bin:function(t,e){var i={finishFunc:function(t){t?e(t):e()}};G.loadBin(t.url,i)}},G.getModelTypeHandlers=function(){return cf},G.setModelTypeHandler=function(t,e){cf[t]=e},G.getModelTypeHandler=function(t){return cf[t]},G.handleModelLoaded=function(){},G.handleUnfoundModel=function(){},uf=lf=U,df=function(t){lf&&!t._loadingModelView_&&((uf=uf||{})[t._loadingModelView_=Ja()]=t)},ff=function(e,i){var n,t,r=(lf=lf||{})[e];if(r){if(r.url===i)return;r.request.onload=Yi,r.request.onerror=Yi}if(i.indexOf(".bin")===i.length-4)return gf(e,{modelType:"bin",url:i},i);(i=G.beforeLoadURL(i)).data?(t=G.parse(i.data),gf(e,t,i)):(n=new Sl,lf[e]={request:n,url:i},n.onload=function(){var t;200===this.status||0===this.status?(delete lf[e],t=G.parse(n.getResponseText()),gf(e,t,i)):pf(e,G.handleUnfoundModel(e,i)||U)},n.onerror=function(){pf(e,G.handleUnfoundModel(e,i)||U)},(t={}).url=encodeURI(i),t.sync=!1,n.send(t))},gf=function(e,i,n){var t=i.modelType;if(!t)return pf(e,i),void G.handleModelLoaded(e,i);t=G.getModelTypeHandler(t);t?(lf=lf||{})[e]||(lf[e]=!0,t(i,function(t){t?(pf(e,t),G.handleModelLoaded(e,t)):pf(e,G.handleUnfoundModel(e,n,i)||U)})):pf(e,G.handleUnfoundModel(e,n,i)||U)},pf=function(t,e){if(delete lf[t],pn(e)&&Gi.test(e))ff(t,e);else{if(zi[t]=e,zn(lf)&&(lf=U,uf)){for(var i in uf)(n=uf[i]).invalidateAll&&n.invalidateAll(H,"modelLoaded",t),n.redraw&&n.redraw(),n.iv(),delete n._loadingModelView_;uf=U}if(e&&uf)for(var i in uf){var n;(n=uf[i]).invalidateAll&&n.invalidateAll(H,"modelLoading",t),n.redraw&&n.redraw(),n.iv()}}},_f=new js([0,0,0,1,1,1,1,0]),vf=new js([0,0,1,0,0,1,0,0,1,0,0,1]),yf=new ks([0,1,2,2,3,0]),mf=new js([-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,.5,.5,.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,.5,.5,.5,.5,.5,-.5,-.5,-.5,.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5]),bf=new ks([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),xf=new js([0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0]),wf=Xu(mf,bf),new js([-.5,.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,.5,.5,-.5,-.5,.5,.5,-.5,-.5,-.5,-.5,-.5,.5,-.5]),new ks([0,1,2,3,0,7,5,4,6,7,5,3,2,4,6,1]),Ef=[st,ot,ht,at,ct,lt],Tf=[-.5,.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,-.5,.5,.5,.5,.5,.5,.5,.5,-.5,.5,.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,-.5,.5,.5,.5,.5,.5,-.5,.5,-.5,.5,.5,-.5,-.5,-.5,.5,.5,-.5,.5,-.5,-.5,-.5,.5,-.5,-.5,-.5],Sf=[-.5,.5,.5,-.4,.5,.5,-.5,.5,.5,-.5,.4,.5,-.5,.5,.5,-.5,.5,.4,.5,.5,.5,.4,.5,.5,.5,.5,.5,.5,.4,.5,.5,.5,.5,.5,.5,.4,-.5,-.5,.5,-.4,-.5,.5,-.5,-.5,.5,-.5,-.4,.5,-.5,-.5,.5,-.5,-.5,.4,.5,-.5,.5,.4,-.5,.5,.5,-.5,.5,.5,-.4,.5,.5,-.5,.5,.5,-.5,.4,-.5,.5,-.5,-.4,.5,-.5,-.5,.5,-.5,-.5,.4,-.5,-.5,.5,-.5,-.5,.5,-.4,.5,.5,-.5,.4,.5,-.5,.5,.5,-.5,.5,.4,-.5,.5,.5,-.5,.5,.5,-.4,-.5,-.5,-.5,-.4,-.5,-.5,-.5,-.5,-.5,-.5,-.4,-.5,-.5,-.5,-.5,-.5,-.5,-.4,.5,-.5,-.5,.4,-.5,-.5,.5,-.5,-.5,.5,-.4,-.5,.5,-.5,-.5,.5,-.5,-.4],If=function(t,e,i,n,r,o,a){t=t||16,e=e||0,i=i||t;var s,h,c,l,u,d,f=[],g=[],p=J/t,_=P/(o=o||16);for(y=0;y<o;y++)for(h=y*_,d=(c=y+1)*_,s=e;s<i;s++)w=s*p,u=(l=s+1)*p,f.push(.5*Z(h)*Q(w),.5*Q(h),-.5*Z(h)*Z(w),.5*Z(d)*Q(u),.5*Q(d),-.5*Z(d)*Z(u),.5*Z(h)*Q(u),.5*Q(h),-.5*Z(h)*Z(u),.5*Z(h)*Q(w),.5*Q(h),-.5*Z(h)*Z(w),.5*Z(d)*Q(w),.5*Q(d),-.5*Z(d)*Z(w),.5*Z(d)*Q(u),.5*Q(d),-.5*Z(d)*Z(u)),g.push(s/t,y/o,l/t,c/o,l/t,y/o,s/t,y/o,s/t,c/o,l/t,c/o);if(a)for(var v=[],y=0,m=f.length;y<m;y+=3)v.push(2*f[y],2*f[y+1],2*f[y+2]);if(n){var b=[],x=[],w=e*p;for(y=0;y<o;y++)h=y*_,d=(c=y+1)*_,b.push(0,0,0,.5*Z(d)*Q(w),.5*Q(d),-.5*Z(d)*Z(w),.5*Z(h)*Q(w),.5*Q(h),-.5*Z(h)*Z(w)),x.push(0,.5,e/t,c/o,e/t,y/o)}if(r){var E=[],T=[];for(w=i*p,y=0;y<o;y++)h=y*_,d=(c=y+1)*_,E.push(0,0,0,.5*Z(h)*Q(w),.5*Q(h),-.5*Z(h)*Z(w),.5*Z(d)*Q(w),.5*Q(d),-.5*Z(d)*Z(w)),T.push(1,.5,i/t,y/o,i/t,c/o)}r={vs:f,uv:g,from_vs:b,from_uv:x,to_vs:E,to_uv:T};return a&&(r.ns=v),r},Cf=function(t,e,i){(t=t||.17)<0?t=0:.25<t&&(t=.25);for(var n,r,o,a,s,h=[],c=[],l=[],u=J/(i=i||18),d=J/(e=e||12),f=.5-t,g=0;g<=e;g++)for(a=Q(r=g*d-P),o=Z(r),v=0;v<=i;v++)n=v*u,s=f+t*a,h.push(Q(n)*s,o*t,-Z(n)*s),c.push(v/i,1-g/e);for(g=0;g<e;g++)for(var p=g*(i+1),_=(g+1)*(i+1),v=0;v<i;v++)l.push(p+v,_+v+1,_+v,p+v,p+v+1,_+v+1);return{vs:h,uv:c,is:l}},Mf=function(t,e,i,n,r,o,a,s){t=t||18,e=e||0,i=i||t,(o=o||.17)<0?o=0:.25<o&&(o=.25);var h,c,l,u,d,f,g,p,_,v=[],y=[],m=J/t,b=J/(a=a||12),x=.5-o,w=s?[]:H;for(S=0;S<a;S++)for(f=S*b-P,g=(l=S+1)*b-P,h=e;h<i;h++)u=h*m,d=(c=h+1)*m,p=x+o*Q(f),_=x+o*Q(g),v.push(Q(u)*p,Z(f)*o,-Z(u)*p,Q(d)*p,Z(f)*o,-Z(d)*p,Q(d)*_,Z(g)*o,-Z(d)*_,Q(u)*p,Z(f)*o,-Z(u)*p,Q(d)*_,Z(g)*o,-Z(d)*_,Q(u)*_,Z(g)*o,-Z(u)*_),y.push(h/t,1-S/a,c/t,1-S/a,c/t,1-l/a,h/t,1-S/a,c/t,1-l/a,h/t,1-l/a),s&&w.push(Q(u)*Q(f),Z(f),-Z(u)*Q(f),Q(d)*Q(f),Z(f),-Z(d)*Q(f),Q(d)*Q(g),Z(g),-Z(d)*Q(g),Q(u)*Q(f),Z(f),-Z(u)*Q(f),Q(d)*Q(g),Z(g),-Z(d)*Q(g),Q(u)*Q(g),Z(g),-Z(u)*Q(g));if(n)for(var E=[],T=[],S=0;S<a;S++)g=(l=S+1)*b-P,u=e*m,p=x+o*Q(f=S*b-P),_=x+o*Q(g),E.push(Q(u)*p,Z(f)*o,-Z(u)*p,Q(u)*_,Z(g)*o,-Z(u)*_,Q(u)*x,0,-Z(u)*x),T.push(.5+.5*Q(f),.5-.5*Z(f),.5+.5*Q(g),.5-.5*Z(g),.5,.5);if(r){var I=[],C=[];for(S=0;S<a;S++)g=(l=S+1)*b-P,u=i*m,p=x+o*Q(f=S*b-P),_=x+o*Q(g),I.push(Q(u)*p,Z(f)*o,-Z(u)*p,Q(u)*x,0,-Z(u)*x,Q(u)*_,Z(g)*o,-Z(u)*_),C.push(.5-.5*Q(f),.5-.5*Z(f),.5,.5,.5-.5*Q(g),.5-.5*Z(g))}r={vs:v,uv:y,from_vs:E,from_uv:T,to_vs:I,to_uv:C};return s&&(r.ns=w),r},Rf=function(t,e){for(var i,n,r,o=[],a=[],s=[],h=J/16,c=0;c<=16;c++)n=.5*Q(i=c*h),r=.5*Z(i),o.push(n,-.5,r,n,.5,r),a.push(1-c/16,1,1-c/16,0);for(c=0;c<16;c++)s.push(2*c,2*c+1,2*c+3,2*c,2*c+3,2*c+2);if(e){var l=[],u=[],d=[];for(l.push(0,-.5,0),u.push(.5,.5),c=0;c<=16;c++)n=Q(i=c*h),r=Z(i),l.push(.5*n,-.5,.5*-r),u.push(.5+.5*n,.5+.5*r);for(c=0;c<16;c++)d.push(0,c+2,c+1)}if(t){var f=[],g=[],p=[];for(f.push(0,.5,0),g.push(.5,.5),c=0;c<=16;c++)n=Q(i=c*h),r=Z(i),f.push(.5*n,.5,.5*-r),g.push(.5+.5*n,.5-.5*r);for(c=0;c<16;c++)p.push(0,c+1,c+2)}return{vs:o,uv:a,is:s,bottom_vs:l,bottom_uv:u,bottom_is:d,top_vs:f,top_uv:g,top_is:p}},Af=function(t,e,i,n,r,o,a,s){t=t||12,i=i||t;for(var h,c,l,u,d,f,g,p,_,v,y,m=[],b=[],x=J/t,w=e=e||0;w<i;w++)c=(h=w+1)*x,p=.5*Q(g=w*x),_=.5*Z(g),l=.5*Q(c),u=.5*Z(c),m.push(p,-.5,-_,l,-.5,-u,p,.5,-_,l,-.5,-u,l,.5,-u,p,.5,-_),b.push(w/t,1,h/t,1,w/t,0,h/t,1,h/t,0,w/t,0);if(s)for(var E=[],w=0,T=m.length;w<T;w+=3)E.push(2*m[w],0,2*m[w+2]);if(a){var S=[],I=[];for(w=e;w<i;w++)c=x*(w+1),p=Q(g=x*w),_=Z(g),l=Q(c),u=Z(c),S.push(.5*p,-.5,.5*-_,0,-.5,0,.5*l,-.5,.5*-u),I.push(.5+.5*p,.5+.5*_,.5,.5,.5+.5*l,.5+.5*u)}if(o){var C=[],M=[];for(w=e;w<i;w++)c=x*(w+1),p=Q(g=x*w),_=Z(g),l=Q(c),u=Z(c),C.push(.5*p,.5,.5*-_,.5*l,.5,.5*-u,0,.5,0),M.push(.5+.5*p,.5-.5*_,.5+.5*l,.5-.5*u,.5,.5)}n&&(d=[],f=[],p=.5*Q(g=x*e),_=.5*Z(g),v=e/t,d.push(0,.5,0,0,-.5,0,p,-.5,-_,p,-.5,-_,p,.5,-_,0,.5,0),f.push(0,0,0,1,v,1,v,1,v,0,0,0)),r&&(y=[],R=[],p=.5*Q(g=x*i),_=.5*Z(g),v=i/t,y.push(0,-.5,0,0,.5,0,p,.5,-_,p,.5,-_,p,-.5,-_,0,-.5,0),R.push(1,1,1,0,v,0,v,0,v,1,1,1));var R={vs:m,uv:b,bottom_vs:S,bottom_uv:I,top_vs:C,top_uv:M,from_vs:d,from_uv:f,to_vs:y,to_uv:R};return s&&(R.ns=E),R},Pf=function(t,e,i,n,r){i=i||0,r=r==U?.5:r;for(var o,a,s,h,c,l=[0,.5,.75,.875,.9375],u=[],d=[],f=[],g=(n=n==U?J:n)/(e=e||18),p=0;p<l.length;p++)for(var _=0==p%2?0:.5,v=0;v<=e;v++)o=(v+_)*g+i,a=1-l[p],u.push(Q(o)*r*a,2*l[p]*r-r,-Z(o)*r*a),d.push((v+_)/e,a);for(p=0;p<l.length-1;p++){var y=p*(e+1),m=(p+1)*(e+1);for(v=0;v<e;v++)f.push(y+v,m+v+1,m+v,y+v,y+v+1,m+v+1)}for(c=u.length/3-(e+1),v=0;v<e;v++)u.push(0,r,0),d.push((v+.5)/e,0);for(v=0;v<e;v++)f.push(c+v,c+v+1,c+(e+1)+v);if(t){var b=[],x=[],w=[];for(b.push(0,-r,0),x.push(.5,.5),v=0;v<=e;v++)s=Q(o=v*g+i),h=Z(o),b.push(s*r,-r,-h*r),x.push(.5+.5*s,.5+.5*h);for(v=0;v<e;v++)w.push(0,v+2,v+1)}return{vs:u,uv:d,is:f,bottom_vs:b,bottom_uv:x,bottom_is:w}},Df=function(t,e,i,n,r,o){t=t||16,i=i||t;for(var a,s,h,c,l=[],u=[],d=J/t,f=e=e||0;f<i;f++){var g=f+1,p=d*f,_=d*g;l.push(.5*Q(p),-.5,.5*-Z(p),.5*Q(_),-.5,.5*-Z(_),0,.5,0),u.push(f/t,1,g/t,1,(f+g)/2/t,0)}if(o)for(var v=[],y=[],f=e;f<i;f++){_=d*(f+1);var m=Q(p=d*f),b=Z(p),x=Q(_),w=Z(_);v.push(.5*m,-.5,.5*-b,0,-.5,0,.5*x,-.5,.5*-w),y.push(.5+.5*m,.5+.5*b,.5,.5,.5+.5*x,.5+.5*w)}return n&&(s=[],(a=[]).push(0,.5,0,0,-.5,0,.5*Q(p=d*e),-.5,.5*-Z(p)),s.push(0,0,0,1,e/t,1)),r&&(c=[],(h=[]).push(0,-.5,0,0,.5,0,.5*Q(p=d*i),-.5,.5*-Z(p)),c.push(1,1,1,0,i/t,1)),{vs:l,uv:u,bottom_vs:v,bottom_uv:y,from_vs:a,from_uv:s,to_vs:h,to_uv:c}},Of=function(t,e,i,n,r,o,a,s){for(var h=[],c=0;c<t.length-1;c+=2)h.push({x:t[c],y:t[c+1]});return Pc(h,e,i,n,r,o,a,s,!1)},zf={sphere:1,cylinder:1,cone:1,torus:1},Vf={torus:1,sphere:1},Lf=An(is(Bf={roundRect:function(t,e){return Of([.5,.4,.5,.442,.471,.471,.442,.5,.4,.5,-.4,.5,-.442,.5,-.471,.471,-.5,.442,-.5,.4,-.5,-.4,-.5,-.442,-.471,-.471,-.442,-.5,-.4,-.5,.4,-.5,.442,-.5,.471,-.471,.5,-.442,.5,-.4,.5,.4],[1,3,3,2,3,3,2,3,3,2,3,3,2],t,e,3)},star:function(t,e){return Of([.193,.079,.333,.5,0,.233,-.333,.5,-.194,.079,-.5,-.167,-.112,-.167,0,-.5,.111,-.167,.5,-.167],[1,2,2,2,2,2,2,2,2,2,5],t,e)},rect:function(t,e){return Of([.5,-.5,.5,.5,-.5,.5,-.5,-.5],[1,2,2,2,5],t,e)},billboard:function(){return{vs:[-.5,.5,0,-.5,-.5,0,.5,.5,0,.5,.5,0,-.5,-.5,0,.5,-.5,0],uv:[0,0,0,1,1,0,1,0,0,1,1,1],ns:[0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]}},plane:function(){return{vs:[-.5,0,-.5,-.5,0,.5,.5,0,-.5,.5,0,-.5,-.5,0,.5,.5,0,.5],uv:[0,0,0,1,1,0,1,0,0,1,1,1],ns:[0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0]}},triangle:function(t,e){return Of([0,-.5,.5,.5,-.5,.5],[1,2,2,5],t,e)},rightTriangle:function(t,e){return Of([.5,.5,-.5,.5,-.5,-.5],[1,2,2,5],t,e)},parallelogram:function(t,e){return Of([.5,-.5,.25,.5,-.5,.5,-.25,-.5],[1,2,2,2,5],t,e)},trapezoid:function(t,e){return Of([.25,-.5,.5,.5,-.5,.5,-.25,-.5],[1,2,2,2,5],t,e)}}),{cylinder:1}),Ff=An(is(Bf),{cylinder:1,cone:1}),kf=function(t,e,i){var n,r=xh(t.anchor3d,i,e),o=xh(t.mat,i,e),a=xh(t.s3,i,e),s=xh(t.t3,i,e),h=xh(t.r3,i,e),c=a||h||s||o;return(r||c)&&(n=qs(e._6O),s=c?th(o,a,h,xh(t.rotationMode,i,e),s):Hs(),r&&ju(s,[.5-r[0],.5-r[1],.5-r[2]]),xd(e,s)),n},jf=function(e,i,t,n,r,o,a){var s;bn(t)?t.forEach(function(t){jf(e,i,t,n,r,o,a)}):pn(t)?jf(e,i,Gf(n,t),n,r,o,a):yn(t)&&(t.shape3d?(s=kf(t,e,i),jf(e,i,t.shape3d,n,r,o,t),s&&md(e,s)):Nf(e,i,t,n.s,r,o,a))},Nf=function(t,e,i,n,r,o,a){var s,h,c,l,u,d;a=a||Xi,o&&!o(n("shape3d.transparent",i.transparent,a.transparent))||(s=kf(i,t,e),Hf(i)&&t.getData3dUI(e).dispatchBoundingBoxChanged(),h=t._26I,c=t._prg,l=t._buffer,u=n("shape3d.color",i.color,a.color),r=r||n("shape3d.blend",i.blend,a.blend),d=(i.opacity==U?a:i).opacity,o=(o=n("shape3d.opacity"))!=U&&d!=U?d*o:d!=U?d:o,ad(h,0,r,n("shape3d.light",i.light,a.light),o,n("shape3d.reverse.flip",i.reverseFlip,a.reverseFlip),n("shape3d.reverse.color",i.reverseColor,a.reverseColor),n("shape3d.reverse.cull",i.reverseCull,a.reverseCull)),o=n("polygonOffset",i.polygonOffset,a.polygonOffset),i.vs&&n(Fe,i.visible,a.visible)&&Uf(h,c,l,u,t.getTexture(n("shape3d.image",i.image,a.image),e),n("shape3d.discard.selectable",i.discardSelectable,a.discardSelectable),i.vs,i.uv,i.ns,i.is,n("shape3d.uv.offset",i.uvOffset,a.uvOffset),n("shape3d.uv.scale",i.uvScale,a.uvScale),o),i.top_vs&&n(Ne,i.topVisible,a.topVisible)&&Uf(h,c,l,n("shape3d.top.color",i.topColor,a.topColor)||u,t.getTexture(n("shape3d.top.image",i.topImage,a.topImage),e,"top"),n("shape3d.top.discard.selectable",i.topDiscardSelectable,a.topDiscardSelectable),i.top_vs,i.top_uv,i.top_ns,i.top_is,n("shape3d.top.uv.offset",i.topUvOffset,a.topUvOffset),n("shape3d.top.uv.scale",i.topUvScale,a.topUvScale),o),i.bottom_vs&&n(Ue,i.bottomVisible,a.bottomVisible)&&Uf(h,c,l,n("shape3d.bottom.color",i.bottomColor,a.bottomColor)||u,t.getTexture(n("shape3d.bottom.image",i.bottomImage,a.bottomImage),e,"bottom"),n("shape3d.bottom.discard.selectable",i.bottomDiscardSelectable,a.bottomDiscardSelectable),i.bottom_vs,i.bottom_uv,i.bottom_ns,i.bottom_is,n("shape3d.bottom.uv.offset",i.bottomUvOffset,a.bottomUvOffset),n("shape3d.bottom.uv.scale",i.bottomUvScale,a.bottomUvScale),o),i.from_vs&&n(ke,i.fromVisible,a.fromVisible)&&Uf(h,c,l,n("shape3d.from.color",i.fromColor,a.fromColor)||u,t.getTexture(n("shape3d.from.image",i.fromImage,a.fromImage),e,"from"),n("shape3d.from.discard.selectable",i.fromDiscardSelectable,a.fromDiscardSelectable),i.from_vs,i.from_uv,i.from_ns,i.from_is,n("shape3d.from.uv.offset",i.fromUvOffset,a.fromUvOffset),n("shape3d.from.uv.scale",i.fromUvScale,a.fromUvScale),o),i.to_vs&&n(je,i.toVisible,a.toVisible)&&Uf(h,c,l,n("shape3d.to.color",i.toColor,a.toColor)||u,t.getTexture(n("shape3d.to.image",i.toImage,a.toImage),e,"to"),n("shape3d.to.discard.selectable",i.toDiscardSelectable,a.toDiscardSelectable),i.to_vs,i.to_uv,i.to_ns,i.to_is,n("shape3d.to.uv.offset",i.toUvOffset,a.toUvOffset),n("shape3d.to.uv.scale",i.toUvScale,a.toUvScale),o),sd(h),s&&md(t,s))},Uf=function(t,e,i,n,r,o,a,s,h,c,l,u,d){var f,g;a&&(d&&ed(t,d),f=(g=yu.for(t)).directUniforms(),g=g.directAttribs(),f.uDiffuse=n||F["color.empty"],s?hd(t,e,r,o,i.uv,s,l,u):hd(t),g.aPosition=gd(t,i.vs,a,U),g.aNormal=gd(t,i.ns,h,U),c?(_d(t,i.is,c),dd(t,0,c.length,null,c instanceof Uint32Array?t.UNSIGNED_INT:null)):ud(t,0,a.length/3),s?cd(t,0,r):cd(t),d&&id(t))},Gf=function(t,e){var i=t.s;if(!(e=e||i(Ve)))return U;var n=xu(e);if(n)return n;if("text"===e){var r={amount:i("shape3d.text.amount"),size:i("shape3d.text.size"),font:i("shape3d.text.font"),style:i("shape3d.text.style"),weight:i("shape3d.text.weight"),fill:i("shape3d.text.fill"),curveSegments:i("shape3d.text.curveSegments"),spacing:i("shape3d.text.spacing")},o=t.gv.getShape3dText(t.data),a=o;for(v in r)a+="_"+(r[v]===H?"U":r[v]);return t._cachedTextKey===a?t._cachedTextGeometry:(t._cachedTextKey=a,t._cachedTextGeometry=G.createTextGeometry(o,r))}var s,h,c,l,u,d,f,g,p,_,v=e;return zf[e]&&(s=i("shape3d.side"),h=i("shape3d.side.from"),c=i("shape3d.side.to"),l=i(ke),u=i(je),s<3?(c=h=s=0,u=l=!1):((h==U||h<0)&&(h=0),(c==U||s<c)&&(c=s),0===h&&c===s&&(u=l=!1)),v+="-"+s+"-"+h+"-"+c+"-"+l+"-"+u+((d="cone"!==e&&i("shape3d.smooth"))?1:0)),Lf[e]&&(v+="-"+(f=i(Ne))),Ff[e]&&(v+="-"+(g=i(Ue))),"torus"===e&&((p=i("shape3d.torus.radius"))<0?p=0:.25<p&&(p=.25),v+="-"+p),Vf[e]&&(v+="-"+(_=i(Le))),(n=Vi[v])||("box"===e?n=G.createBoxModel():Bf[e]?n=Bf[e](f,g):"sphere"===e?n=G.createSphereModel(s,h,c,l,u,_,d):e===Et?n=G.createCylinderModel(s,h,c,l,u,f,g,d):"cone"===e?n=G.createConeModel(s,h,c,l,u,g):"torus"===e&&(n=G.createTorusModel(s,h,c,l,u,p,_,d)),Vi[v]=n),n},cv=["vs","ns","uv","top_vs","top_ns","top_uv","bottom_vs","bottom_ns","bottom_uv","from_vs","from_ns","from_uv","to_vs","to_ns","to_uv","er","al"],lv=["is","top_is","bottom_is","from_is","to_is"],z=On(Vd.substr(Vd.indexOf("^#")+2)),Hf=function(t){for(var e in t)1===e.length&&(ih=t[e]);return e?1:0}(G[fn($e+cv[15]+"n"+cv[16])]())&&Zr()?function(i){return!(!i||i._complete_)&&(i._complete_=!0,i.vs&&Vn(i.ns)&&(i.ns=Xu(i.vs,i.is),i.boundingBox=H),i.top_vs&&Vn(i.top_ns)&&(i.top_ns=Xu(i.top_vs,i.top_is),i.top_boundingBox=H),i.bottom_vs&&Vn(i.bottom_ns)&&(i.bottom_ns=Xu(i.bottom_vs,i.bottom_is),i.bottom_boundingBox=H),i.from_vs&&Vn(i.from_ns)&&(i.from_ns=Xu(i.from_vs,i.from_is),i.from_boundingBox=H),i.to_vs&&Vn(i.to_ns)&&(i.to_ns=Xu(i.to_vs,i.to_is),i.to_boundingBox=H),cv.forEach(function(t){var e=i[t];bn(e)&&(i[t]=new js(e))}),lv.forEach(function(t){var e=i[t];bn(e)&&(i[t]=new ks(e))}),!0)}:void 0,Wf=function(t,e){var i=t[e];bn(i)&&(t[e]=new js(i))},An(_a,{_25Q:function(t){t._16O=function(t,e,i,n,r,o,a,s,h){var c=this.info;if(c){var l,u,d,f,g=Hs(),p=Wh[e]?(f=c.p3,l=c.c1,c.c2):Hh[e]?(l=c.s1||c.c1,c.s2||c.c2):(l=c.t1||c.c1,c.t2||c.c2);return h=f?Sd(e,Ki,i,n,s,h):(d=Ns(p,l),c=ys(l,p),u=[0,-T(d[2],d[0]),b(d[1]/c)],d="zyx",f=[(l[0]+p[0])/2,(l[1]+p[1])/2,(l[2]+p[2])/2],Sd(e,[c,0,0],i,n,s,h)),Id(g,h,f,n,r,o,a,t,u,d)}return Ws},t._80o=function(t,e,i){var n,r=this.shapeModel;r&&(n=this.gv,xd(n),jf(n,this.data,r,this,this.getBodyColor(),i))},t.createLineModel=function(t,e,i,n,r){var o=this.s,a=Qf(t,e,o(Le)),t=o(n+".color");if(t){for(var s=[],h=0;h<a.length;h++){var c=a[h],l=c.length;if(1<l){var u=c[0];s.push(u.x,u.y,u.z);for(var d=1;d<l-1;d++)u=c[d],s.push(u.x,u.y,u.z),s.push(u.x,u.y,u.z);u=c[l-1],s.push(u.x,u.y,u.z)}}var f,g,p,e=0;o(r)&&(g=o(r+".color"),f=o(r+".pattern"),e=o(r+".offset"),p=t),function(t,e,i,n,r,o,a,s,h){var c=t.getBrightness(e);c==U&&(c=1);var l,u=Zd(to(n),c),d=u[3]<1,f=(d?"T":"O")+(o=Math.ceil(o)||1);a&&(f+="-"+(l=a[0])+"-"+(p=(a[1]||l)+l),h&&(f+="-"+$r(h)+"-"+c,h=Zd(to(h),c)));var g=e.getRenderLayer(),t=(n=t._40Q.get(g)).polylineIndexMap,g=n.polylineModelMap;(n=g[f])||(n=g[f]={vs:[],cs:[],ps:[],ds:[],ls:a?[]:U,T:d,W:o},a&&(n.D=l,n.G=p,n.A=h)),n.invalidate=!0;var p=n.vs,_=n.cs,h=n.ds,v=n.ls,f=t[e._id]={index:h.length,begin:p.length/3,batch:f};h.push(e),Mn(p,i);var y,f=f.size=p.length/3-f.begin,m=i.length,b=0,x=[];if(a||r)for(S=0;S<m;S+=6)y=ys([i[S],i[S+1],i[S+2]],[i[S+3],i[S+4],i[S+5]]),x.push(y),b+=y;if(b&&r)for(var w,E=[(c=Zd(to(r),c))[0]-u[0],c[1]-u[1],c[2]-u[2],c[3]-u[3]],T=0,S=0;S<m;S+=6)w=T/b,Au(_,[u[0]+E[0]*w,u[1]+E[1]*w,u[2]+E[2]*w,u[3]+E[3]*w],1),w=(T+=x[S/6])/b,Au(_,[u[0]+E[0]*w,u[1]+E[1]*w,u[2]+E[2]*w,u[3]+E[3]*w],1);else Au(_,u,f);if(a)for(T=s||0,S=0;S<m;S+=6)v.push(T),T+=x[S/6],v.push(T)}(this.gv,this.data,s,g||t,p?U:o(n+".gradient.color"),i,f||o(n+".pattern"),e,p)}return a},t.createTubeModel=function(t,e,i,n){for(var r=this.s,o=r("shape3d.side")||Bs,a=r("shape3d.start.angle"),s=r("shape3d.sweep.angle"),h=r(Ne)?r("shape3d.top.cap"):U,c=r(Ue)?r("shape3d.bottom.cap"):U,l="flat"===h,u="flat"===c,d=l&&(n?n.uv:r("shape3d.top.image")),f=u&&(n?n.uv:r("shape3d.bottom.image")),g=n?n.uv:r("shape3d.image"),p=r("shape3d.smooth"),_={vs:[],uv:g?[]:U,ns:p?[]:U,top_vs:l?[]:U,top_uv:d?[]:U,bottom_vs:u?[]:U,bottom_uv:f?[]:U},v=Qf(t,e,r(Le),i),y=0,m=v.length;y<m;y++)Yf(_,v[y],r(Ge),i,o,a,s,h,c);return n?(e=[],tf(this.gv,this.data,_,this,this.getBodyColor(),this.mat?[this.mat]:[],n,e),e.length&&(Mn(n.vs,e),Mn(n.ns,Xu(e)))):this.shapeModel=_,v},t.getCache=function(){var t=this.info;if(t){var e=t.list;if(e)return t.cache||(t.cache=Xf(e))}return U}}}),Xf=function(t){for(var e,i,n=[],r=0,o=0;o<t.length;o++){for(var a=t[o],s=0;s<a.length;s++){e=a[s],i&&(r+=i.distanceTo(e));var h=new Oc,c=a[s+1];c?h.subVectors(c,e):i?h.subVectors(e,i):h.x=1,h.normalize(),n.push({point:e,length:r,tangent:h}),i=e}i=null}return n},Qf=function(t,e,i,n){i=i||Ds;for(var r=[],o=0,a=t.size();o<a;o++){var s=t.get(o);r.push(new Oc(s.x,s.e||0,s.y))}e&&(xn(e)&&(e=e._as),e.length||(e=null));for(var h,c,l,u,d,f=[],g=0,p=0,_=e?e.length:a;p<_;p++)if(1===(d=e?e[p]:0===p?1:2))f.push(l=[]),l.push(r[g++]);else if(2===d||5===d)if(u=2===d?r[g++]:l[0],n){var v=e?e[p+1]:p+1<_?2:U;if(2===v||5===v){var y=l[l.length-1],m=2===v?r[g]:l[0],b=(new Oc).subVectors(y,u),v=(new Oc).subVectors(m,u),y=b.length(),m=v.length();if(y&&m)if(y/2<n&&m/2<n)l.push(u);else for(b.multiplyScalar(q(n,y/2)/y).add(u),v.multiplyScalar(q(n,m/2)/m).add(u),h=new tl(b,u,v).getPoints(i),c=0;c<=i;c++)l.push(h[c])}else l.push(u)}else l.push(u);else if(3===d)for(h=new tl(l[l.length-1],r[g++],r[g++]).getPoints(i),c=1;c<=i;c++)l.push(h[c]);else if(4===d)for(h=new el(l[l.length-1],r[g++],r[g++],r[g++]).getPoints(i),c=1;c<=i;c++)l.push(h[c]);return f},Yf=function(t,e,i,n,r,o,a,s,h){var c=e.length;if(1<c){var l,u,d,f,g=function(t){for(var e,i,n=new Oc,r=[],o=[],a=[],s=0,h=t.length;s<h;s++)e=t[s],(i=t[s+1])?n.subVectors(i,e):n.subVectors(e,t[s-1]),r.push(n.normalize().clone());var c,l=new Oc,u=new Oc,d=new Bc,f=Number.MAX_VALUE,g=r[0],p=o[0]=new Oc,_=a[0]=new Oc,v=X(g.x),y=X(g.y),m=X(g.z);for(v<=f&&(f=v,l.set(1,0,0)),y<=f&&(f=y,l.set(0,1,0)),m<=f&&l.set(0,0,1),u.crossVectors(g,l).normalize(),p.crossVectors(g,u),_.crossVectors(g,p),s=1;s<h;s++)o[s]=o[s-1].clone(),a[s]=a[s-1].clone(),u.crossVectors(r[s-1],r[s]),1e-4<u.length()&&(u.normalize(),c=Y(Fn(r[s-1].dot(r[s]),-1,1)),o[s].applyMatrix4(d.makeRotationAxis(u,c))),a[s].crossVectors(r[s],o[s]);return{B:a,T:r,N:o}}(e),p=g.T,_=g.N,v=g.B;"flat"===s&&Im(t,!0,e[0],v[0],_[0],n,r,o,a),"flat"===h&&Im(t,!1,e[c-1],v[c-1],_[c-1],n,r,o,a);var y,m,b=[],x=j(r/2),s="round"===s,h="round"===h,w=e[0],E=p[0],T=v[0],S=_[0],I=e[c-1],C=p[c-1],M=v[c-1],R=_[c-1];if(s){for(B=1;B<=x;B++)_.splice(0,0,S),v.splice(0,0,T),p.splice(0,0,E),m=-B/x*n,e.splice(0,0,E.clone().multiplyScalar(m).add(w)),b[x-B]=W(n*n-m*m);c+=x}if(h){for(B=1;B<=x;B++)_.push(R),v.push(M),p.push(C),m=B/x*n,e.push(C.clone().multiplyScalar(m).add(I)),b[e.length-1]=W(n*n-m*m);c+=x}if(t.uv){var A=0,P=0,D=[];for(i&&(A=i),f=e[0],D[0]=0,B=1;B<c;B++)d=e[B],D[B]=f.distanceTo(d),f=d,i||(A+=D[B]);for(y=[],B=0;B<c;B++)P+=D[B],y[B]=A?P/A:0}for(var O=!!t.ns,B=0;B<c;B++){if(l=function(t,e,i,n,r,o,a,s,h){for(var c=[],l=(a=a||J)/r,u=h?new ha:U,d=0;d<=r;d++){var f=Sm(t,e,i,n,d*l+o);c.push(f),s!=U&&(f.uv=[s,1-d/r]),h&&(f.ns=u.subVectors(f,t).normalize().toArray())}return c}(d=e[B],v[B],_[B],b[B]===H?n:b[B],r,o,a,y?y[B]:U,O),u)for(var z=0;z<r;z++){var V=u[z],L=u[z+1]||u[0],F=l[z],k=l[z+1]||l[0];Tm(t.vs,L,V,F,F,k,L),t.uv&&function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e].uv;t.push(i[0],i[1])}}(t.uv,L,V,F,F,k,L),O&&function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e].ns;t.push(i[0],i[1],i[2])}}(t.ns,L,V,F,F,k,L)}u=l}}},An(G,{getLineLength:function(t){return t[t.length-1].length},getLineOffset:qf=function(t,e){for(var i,n=0,r=t.length,o=0,a=r-1;o<=a;)if((i=t[n=k(o+(a-o)/2)].length-e)<0)o=n+1;else{if(!(0<i)){a=n;break}a=n-1}var s=t[n=a],h=s.point;return n===r-1||s.length===e||(h=(new Oc).subVectors(t[n+1].point,h).normalize().multiplyScalar(e-s.length).add(h)),{point:h,tangent:s.tangent}},getLineCacheInfo:function(t,e,i,n){return Xf(Qf(t,e,i,n))}}),Zf=Gl.graph3d.RenderLite={},Kf=new Array(0),(Jf=Zf.Buffer=function(t,e,i,n){this.gl=t,this.buffer=t.createBuffer(),this.type=e||t.ARRAY_BUFFER,this.drawType=n||t.STATIC_DRAW,this.data=Kf,i&&this.upload(i)}).prototype.upload=function(t,e,i){i||this.bind();i=this.gl;t=t||this.data,e=e||0,this.data.byteLength>=t.byteLength?i.bufferSubData(this.type,e,t):i.bufferData(this.type,t,this.drawType),this.data=t},Jf.prototype.bind=function(){this.gl.bindBuffer(this.type,this.buffer)},Jf.createVertexBuffer=function(t,e,i){return new Jf(t,t.ARRAY_BUFFER,e,i)},Jf.createIndexBuffer=function(t,e,i){return new Jf(t,t.ELEMENT_ARRAY_BUFFER,e,i)},Jf.create=function(t,e,i,n){return new Jf(t,e,n)},Jf.prototype.destroy=function(){this.gl.deleteBuffer(this.buffer)},($f=Zf.Shader=function(t,e,i){this.gl=t,this.program=tg(t,e,i),this.attributes=ng(t,this.program);i=ig(t,this.program);this.uniforms=dg(t,i)}).prototype.bind=function(){this.gl.useProgram(this.program)},$f.prototype.destroy=function(){this.gl},tg=function(t,e,i){var n=eg(t,t.VERTEX_SHADER,e),e=eg(t,t.FRAGMENT_SHADER,i);t.getShaderParameter(e,t.COMPILE_STATUS)||console.error(t.getError());i=t.createProgram();return t.attachShader(i,n),t.attachShader(i,e),t.linkProgram(i),t.getProgramParameter(i,t.LINK_STATUS)||(console.error("Error: Could not initialize shader."),console.error("gl.VALIDATE_STATUS",t.getProgramParameter(i,t.VALIDATE_STATUS)),console.error("gl.getError()",t.getError()),""!==t.getProgramInfoLog(i)&&console.warn("Warning: gl.getProgramInfoLog()",t.getProgramInfoLog(i)),t.deleteProgram(i),i=null),t.deleteShader(n),t.deleteShader(e),i},eg=function(t,e,i){e=t.createShader(e);return t.shaderSource(e,i),t.compileShader(e),t.getShaderParameter(e,t.COMPILE_STATUS)?e:(console.log(t.getShaderInfoLog(e)),null)},ig=function(t,e){for(var i={},n=t.getProgramParameter(e,t.ACTIVE_UNIFORMS),r=0;r<n;r++){var o=t.getActiveUniform(e,r),a=o.name.replace(/\[.*?\]/,""),s=sg(t,o.type);i[a]={type:s,size:o.size,location:t.getUniformLocation(e,a),value:lg(s,o.size)}}return i},ng=function(t,e){for(var i={},n=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES),r=0;r<n;r++){var o=t.getActiveAttrib(e,r),a=sg(t,o.type);i[o.name]={type:a,size:og(a),gl:t,location:t.getAttribLocation(e,o.name),pointer:rg}}return i},rg=function(t,e,i,n,r){var o=this.gl;o.enableVertexAttribArray(this.location),t instanceof Zf.Buffer||(t=Zf.Buffer.createVertexBuffer(o,t)),o.bindBuffer(t.type,t.buffer),o.vertexAttribPointer(this.location,this.size,e||o.FLOAT,i||!1,n||0,r||0)},og=function(t){return ag[t]},ag={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1},sg=function(t,e){if(!hg){var i=L.keys(cg);hg={};for(var n=0;n<i.length;++n){var r=i[n];hg[t[r]]=cg[r]}}return hg[e]},hg=null,cg={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D"},lg=function(t,e){switch(t){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"sampler2D":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"bool":return!1;case"bvec2":return ug(2*e);case"bvec3":return ug(3*e);case"bvec4":return ug(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}},ug=function(t){for(var e=new Array(t),i=0;i<e.length;i++)e[i]=!1;return e},dg=function(t,e){var i={data:{}};i.gl=t;for(var n=L.keys(e),r=0;r<n.length;r++){var o=n[r],a=o.split("."),s=a[a.length-1],a=pg(a,i),o=e[o];a.data[s]=o,a.gl=t,L.defineProperty(a,s,{get:fg(s),set:gg(s,o)})}return i},fg=function(t){t=_g.replace("%%",t);return new Function(t)},gg=function(t,e){t=vg.replace(/%%/g,t),e=(1===e.size?yg:mg)[e.type];return e&&(t+="\nthis.gl."+e+";"),new Function("value",t)},pg=function(t,e){for(var i=e,n=0;n<t.length-1;n++){var r=i[t[n]]||{data:{}};i[t[n]]=r,i=r}return i},_g=["return this.data.%%.value;"].join("\n"),vg=["this.data.%%.value = value;","var location = this.data.%%.location;"].join("\n"),yg={float:"uniform1f(location, value)",vec2:"uniform2f(location, value[0], value[1])",vec3:"uniform3f(location, value[0], value[1], value[2])",vec4:"uniform4f(location, value[0], value[1], value[2], value[3])",int:"uniform1i(location, value)",ivec2:"uniform2i(location, value[0], value[1])",ivec3:"uniform3i(location, value[0], value[1], value[2])",ivec4:"uniform4i(location, value[0], value[1], value[2], value[3])",bool:"uniform1i(location, value)",bvec2:"uniform2i(location, value[0], value[1])",bvec3:"uniform3i(location, value[0], value[1], value[2])",bvec4:"uniform4i(location, value[0], value[1], value[2], value[3])",mat2:"uniformMatrix2fv(location, false, value)",mat3:"uniformMatrix3fv(location, false, value)",mat4:"uniformMatrix4fv(location, false, value)",sampler2D:"uniform1i(location, value)"},mg={float:"uniform1fv(location, value)",vec2:"uniform2fv(location, value)",vec3:"uniform3fv(location, value)",vec4:"uniform4fv(location, value)",int:"uniform1iv(location, value)",ivec2:"uniform2iv(location, value)",ivec3:"uniform3iv(location, value)",ivec4:"uniform4iv(location, value)",bool:"uniform1iv(location, value)",bvec2:"uniform2iv(location, value)",bvec3:"uniform3iv(location, value)",bvec4:"uniform4iv(location, value)",sampler2D:"uniform1iv(location, value)"},(bg=function(l){function n(t){if("string"!=typeof t)return 0|t;switch(t){case"low":return 512;case"medium":return 1024;case"ultra":return 4096;default:return 2048}}var u=this;u.enable=!1;var d,r,f,o=G.graph3dViewShadowType,a=G.graph3dViewShadowIntensity,s=G.graph3dViewShadowBias,h=G.graph3dViewShadowQuality,c=G.graph3dViewShadowRadius,g=G.graph3dViewShadowDegreeX,p=G.graph3dViewShadowDegreeZ,_=1,v=n(h),y=!1,m=new Gl.Math.Matrix4,b=new Gl.Math.Matrix4,x=u.pvMatrix=new Gl.Math.Matrix4;u.render=function(){var t,e,i;l._picking||!u.enable||(t=l.getGL())&&(y&&u.setupShadowCamera(),l._glCapabilities&&(v=Math.min(v,l._glCapabilities.maxTextureSize)),u.map?d.setSize(v,v):d=u.map=new Rg(l,l.getGL(),0,0,{samples:1,minFilter:fu.NEAREST,magFilter:fu.NEAREST,width:v,height:v}),t._shadowShader||(t._shadowShader=new Zf.Shader(t,bg.shaderSrc.vs,bg.shaderSrc.fs)),(i=(e=l._frameState).renderState.glState).blend.enabled=!1,i.depth.enabled=!0,i.depth.mask=!0,i=i.color.clear.slice(0),nd(t,[1,1,1,1]),e.renderState.useProgram(t._shadowShader.program),w(),nd(t,i))},u.getShadow=function(){var t={degreeX:g,degreeZ:p,intensity:a,quality:h,type:o,radius:c,bias:s};return 1!==_&&(t.boundExtend=_),t},u.setShadow=function(t,e){t=!!t;var i=u.enable!==t;u.enable=t,"object"==typeof e&&(e.intensity!==H&&(a=e.intensity),e.bias!==H&&(s=e.bias),e.radius!==H&&(c=e.radius),e.degreeX!==H&&(g=e.degreeX),e.degreeZ!==H&&(p=e.degreeZ),e.quality!==H&&(h=e.quality),e.type!==H&&o!==e.type&&(o=e.type,i=!0),v=n(h),e.boundExtend!==H&&(_=e.boundExtend)),t&&u.setupShadowCamera(),i&&Zu(l),l.iv()},u.refresh=function(){this.enable&&(this.setupShadowCamera(),l.iv())},u.tryUpdateBounding=function(t){var e,i,n=this.boundingSphere;n&&(e=(new fa).fromArray($s(t,l.getMat(t))),i=t.getAnchor3d(),t=new ha,n.containsPoint(t.set(0-i.x,0-i.y,0-i.z).applyMatrix4(e))&&n.containsPoint(t.set(0-i.x,0-i.y,1-i.z).applyMatrix4(e))&&n.containsPoint(t.set(0-i.x,1-i.y,0-i.z).applyMatrix4(e))&&n.containsPoint(t.set(0-i.x,1-i.y,1-i.z).applyMatrix4(e))&&n.containsPoint(t.set(1-i.x,0-i.y,0-i.z).applyMatrix4(e))&&n.containsPoint(t.set(1-i.x,0-i.y,1-i.z).applyMatrix4(e))&&n.containsPoint(t.set(1-i.x,1-i.y,0-i.z).applyMatrix4(e))&&n.containsPoint(t.set(1-i.x,1-i.y,1-i.z).applyMatrix4(e))||u.setupShadowCamera())},u.createShadow=function(t){(t=t||l._frameState.renderState.directUniforms()).shadowMatrix=x.toArray(),t.shadowMap=d.texture,t.shadowSize=[d.width,d.height],t.shadowIntensity=a,t.shadowBias=s,t.shadowRadius=c},u.genShaderDefine=function(){var t="#define USE_SHADOWMAP\n";return"hard"===o?t+="#define SHADOWMAP_TYPE_PCF\n":"soft"===o&&(t+="#define SHADOWMAP_TYPE_PCF_SOFT\n"),t},u.setupShadowCamera=function(){r=r||(u.boundingSphere=new Gl.Math.Sphere),y=!1;var t=l.getBoundingBox(l.dm().toDatas(function(t){return t.s("shadow.cast")&&l.isVisible(t)}));t?(n=new ha(t.min),i=new ha(t.max)):(n=new ha(-256,-256,-256),i=new ha(256,256,256),y=!0),r.set(n.clone().add(i).multiplyScalar(.5),.5*n.distanceTo(i)*_);var e=r.radius,t=l.getBoundingBox(l.dm().toDatas(function(t){return(t.s("shadow.cast")||t.s("shadow.receive"))&&l.isVisible(t)}));n=t?(n.copy(t.min),i.copy(t.max),(t=.5*n.distanceTo(i))+Math.min(t,e+r.center.distanceTo(n.add(i).multiplyScalar(.5)))):2*e,f=Hu(Hs(),-e,e,-e,e,n/1e3,n),x.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),x.multiply(m.fromArray(f));var i=Math.tan(-g*Math.PI/180),n=Math.tan(-p*Math.PI/180),e=e/Math.sqrt(i*i+n*n+1),n=new ha(e*i,e,e*n);m.lookAt(n,new ha(0,0,0),new ha(0,1,0)).setPosition(n.add(r.center)),m.getInverse(m),x.multiply(m)};var w=function(){var t=l.getGL(),e=v,i=v;d.setSize(t,e,i),d.bind(t),t.clear(fu.COLOR_BUFFER_BIT|fu.DEPTH_BUFFER_BIT);var n=l._frameState.renderState,r=n.directUniforms(),o=n.directAttribs(),a=n.directState();r.projectionMatrix=f;var s,h,c,n=l._viewport;for(l.setViewport(t,0,0,e,i),s=0,h=zh.length;s<h;s++)c=zh[s],Rh[c].ignore||(c=l._40Q.get(c))&&(u.renderItems(t,r,o,c.opaque,a),u.renderItems(t,r,o,c.transparent,a));d.unbind(t),l.setViewport(t,n[0],n[1],n[2],n[3])};u._renderDirect=function(t,e,i,n){i&&i.length&&(e.position=gd(t,l._buffer.vs,i,U),n?(_d(t,l._buffer.is,n),dd(t,0,n.length,null,n instanceof Uint32Array?t.UNSIGNED_INT:null)):ud(t,0,i.length/3))},u.renderShapeModel=function(t,e,i,n){var r,o,a;if(bn(i))for(o=0,a=i.length;o<a;o++)(r=i[o])&&u.renderShapeModel(t,e,r,n);else pn(i)?u.renderShapeModel(t,e,Gf(n,i),n):yn(i)&&(i.shape3d?u.renderShapeModel(t,e,i.shape3d,n):u.renderShapeModelImpl(t,e,i))},u.renderShapeModelImpl=function(t,e,i){Hf(i),u._renderDirect(t,e,i.vs,i.is),u._renderDirect(t,e,i.top_vs,i.top_is),u._renderDirect(t,e,i.bottom_vs,i.bottom_is),u._renderDirect(t,e,i.from_vs,i.from_is),u._renderDirect(t,e,i.to_vs,i.to_is)},u.renderItems=function(t,e,i,n,r){for(var o,a,s,h=n.length,c=0;c<h;c++)a=(s=n[c]).ui,o=s.data,!Cu(o)&&o.s("shadow.cast")&&l.isVisible(o)&&(s=(s=a.shapeModel||Gf(a))||(o instanceof Gl.Node&&!(o instanceof Gl.Shape)?{vs:mf,is:bf}:[a.left,a.front,a.right,a.back,a.top,a.bottom]),e.modelViewMatrix=(a.mat?b.fromArray(a.mat):b.identity()).premultiply(m).toArray(),r.cullFace.enabled=!!o.s("shape3d.reverse.cull"),u.renderShapeModel(t,i,s,a))}}).shaderSrc={vs:["uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","attribute vec3 position;","void main() {","vec3 transformed = vec3( position );","vec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );","gl_Position = projectionMatrix * mvPosition;","}"].join("\n"),fs:["precision highp float;","const float PackUpscale = 256. / 255.;","const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );","const float ShiftRight8 = 1. / 256.;","vec4 packDepthToRGBA( const in float v ) {","vec4 r = vec4( fract( v * PackFactors ), v );","r.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;","}","void main() {","gl_FragColor = packDepthToRGBA( gl_FragCoord.z );","}"].join("\n")},bg.PARAMS=["quality","intensity","bias","radius","type","degree.x","degree.z"],xg=Gl.Light=function(){Bn(xg,this),this.s(mu,F[mu]),this.s(Ve,"sphere"),this.s("shape3d.reverse.cull",!0),this.s3(20,20,20)},Vs("Light",cl,{_image:"light_icon",_icon:"light_icon",onStyleChanged:function(t,e,i){xg.superClass.onStyleChanged.apply(this,arguments),t===mu&&this.s("shape3d.color",i)}}),(wg=Bd.FrameState=function(t,e){this.renderState=yu.for(e),this.picking=!1,this.envmapReflectivity=.5,this.cameraPosition=H,this.projectMatrix=H,this.viewMatrix=H,this.view=t,this.defaultProgram=H,this.pickColorMap=H,this._pvStack=[],this._renderStateStack=[]}).prototype.savePV=function(){var t=this.view;this._pvStack.push([qs(this.projectMatrix),qs(this.viewMatrix),t._18Q,qs(t._7O)])},wg.prototype.restorePV=function(){var t,e=this._pvStack.pop();e&&(t=this.view,this.projectMatrix=t._projectMatrix=e[0],this.viewMatrix=t._viewMatrix=e[1],t._18Q=e[2],t._7O=e[3])},wg.prototype.setPV=function(t,e){var i,n=this.view,r=!1;t&&(this.projectMatrix=n._projectMatrix=t,r=!0),e&&(this.viewMatrix=n._viewMatrix=e,n._7O=qs(e),r=!0),r&&(i=n.getWidth(),t=n.getHeight(),r=qs(this.projectMatrix),n._18Q=Uu(r,r,e),n._18Q._wh=i/t)},wg.prototype.syncEnv=function(t){var e=this.view;this.envmapReflectivity=e._envmapReflectivity||.5,this.cameraPosition=e.getEye(),this.projectMatrix=e._projectMatrix,this.viewMatrix=e._viewMatrix,this.pickColorMap=t,this.picking=e.getGL()._picking},wg.prototype.setGLState=(rv=[0,0,0,0],ov=[!0,!0,!0,!0],av=[-1,1],sv=[fu.FUNC_ADD,fu.FUNC_ADD],hv=[fu.SRC_ALPHA,fu.ONE_MINUS_SRC_ALPHA,fu.ONE,fu.ONE_MINUS_SRC_ALPHA],function(t,e){var i=this.renderState.gl,n=this.renderState.glState;n.dither=!1,e?n.color.mask=ov:n.color.reset(),n.pixelStore.reset(),n.blend.color=rv,n.blend.equation=sv,n.blend.func=hv,n.cullFace.enabled=!1,n.scissor.enabled=!1,n.depth.enabled=!0,n.depth.clear=1,n.depth.func=i.LEQUAL,n.depth.range=av,n.stencil.enabled=!1,n.polygonOffset.enabled=!1,t?(n.depth.mask=!1,n.blend.enabled=!0):(n.depth.mask=!0,n.blend.enabled=!1)}),wg.prototype.setUniforms=function(t){var e=this.view,i=this.renderState,n=i.gl,i=i.uniforms;i.uBrightness=1,i.uOpacity=1,i.uPartOpacity=1,i.uPick=this.picking,i.uTexture=!1,i.uBlendTexture=!1,i.uAlphaTest=F.alphaTest,i.uTransparent=!!t,i.uFix=!1,i.uBatchColor=!1,i.uBatchBlend=!1,i.uBatchBrightness=!1,i.uReflectivity=this.envmapReflectivity||.5,i.uCameraPosition=this.cameraPosition,i.uPMatrix=this.projectMatrix,i.uViewMatrix=this.viewMatrix,e.bindEnvMap(n),this.picking||(function(e,t){var i=yu.for(t).directUniforms();i.uHeadlightRange=e._headlightRange,i.uHeadlightAmbientIntensity=e._headlightAmbientIntensity;var n=e._headlightIntensity,r=to(e._headlightColor);1!==n&&(r=[r[0]*n,r[1]*n,r[2]*n]),i.uHeadlightColor=[r[0],r[1],r[2],e._headlightDisabled?1:0];var o,a,s,h,c,l,u,d,f,g,p,t=e._59O,n=e._spots,r=e._dirs;t.length&&(o=[],a=[],s=[],t.forEach(function(t){Du(o,t),Mn(a,e._transformPointToViewSpace(t.p3())),s.push(t.s("light.range"))}),i.uPointColor=o,i.uPointRange=s,i.uPointPosition=a),n.length&&(h=[],c=[],l=[],u=[],d=[],f=[],n.forEach(function(t){Du(h,t),Mn(c,e._transformPointToViewSpace(t.p3())),Mn(d,e._transformDirectionToViewSpace(t.p3(),t.s("light.center"))),l.push(t.s("light.range")),u.push(Q(t.s("light.angle")/2)),f.push(t.s("light.exponent"))}),i.uSpotColor=h,i.uSpotRange=l,i.uSpotAngle=u,i.uSpotExponent=f,i.uSpotPosition=c,i.uSpotDirection=d),r.length&&(g=[],p=[],r.forEach(function(t){Du(g,t),Mn(p,e._transformDirectionToViewSpace(t.p3()))}),i.uDirColor=g,i.uDirDirection=p)}(e,n),e._fogDisabled||(i.uFogColor=e._fogColor,i.uFogDensity=e._fogDensity,i.uFogNear=e._fogNear,i.uFogFar=e._fogFar))},wg.prototype.drawLayer=function(t){return this.view.renderLayers(t,!0)},wg.prototype.drawData=function(t,e,i){var n,r,o,a,s,h,c,l=this.view;l.isVisible(t)&&(r=(n=this.renderState).uniforms,(o=l.getData3dUI(t))&&(s=(a=n.gl)._picking,h=l._picking,c=t._pickId,i&&(t._pickId=i),r.uPick=a._picking=l._picking=!!i,r.uTransparent=!!e,o._42(n.gl,n.program,e?y:m),r.uPick=a._picking=s,l._picking=h,t._pickId=c))},Eg=Bd.Graph3dView=function(t,e){var i=this;i._webGLVersion=1,i._attributes=e||G.graph3dViewAttributes,i._25I={},i._view=$n(1,i);e=i._canvas=er(i._view);g(e,"webglcontextlost",function(t){t.preventDefault(),Zu(i),i._26I&&i._doBufferGC(i._26I,!0),i._26I=U,i._1o.onContextLost(),i._35O=!0}),g(e,"webglcontextrestored",function(){i._35O=!1,i.iv()}),i._40Q=new Mg,i._43Q={},i._44Q=-1,i._batchIndexMap={},i._batchModelMap={},i._wireframeIndexMap={},i._wireframeModelMap={},i._wireframeIndexMapSwap={},i._wireframeModelMapSwap={},i._polylineIndexMap={},i._polylineIndexMap={},i._polylineIndexMapSwap={},i._polylineIndexMapSwap={},i._8O=[],i._7O=Hs(),i._6O=Hs(),i._1o=new Vg(i),i._30O=new Ng(i),i._31O=new Lg(i),i._32O=new Fg(i),i._raycaster=new Jg(i),i._highlightHelper=new kg(i),i._postProcessing=new up(i),i._41Q=[],i._42Q=0,i.vr=new hp(i),i.shadowMap=new bg(i),i._33Q=!0,i._eye=is(G.graph3dViewEye),i._center=is(G.graph3dViewCenter),i._up=is(G.graph3dViewUp),i._lightChanged=!1,i._59O=[],i._spots=[],i._dirs=[],i._frameId=0,i._batchInfoMap={},i.overlappingBox=new Tl(i),i.dm(t||new Nh),i._coreInteractor=new Fl(this),i.setInteractors([new Pg(i)]),i._initView()},Sg=0,zd("Graph3dView",L,{ms_v:1,ms_tip:1,ms_gv:1,ms_dm:1,ms_lp:1,ms_fire:1,ms_sm:1,_51o:1,ms_shadow:1,ms_ac:["devicePixelRatio","boundaries","moveStep","rotateStep","editHelperDisabled","blockSelectable","sizeEditableFunc","rotationEditableFunc","editableFunc","rotatable","zoomable","pannable","walkable","resettable","mouseRoamable","zoomToCenter",ae,he,"firstPersonMode",ye,"movableFunc","gridVisible","gridSize","gridGap","gridColor","originAxisVisible","centerAxisVisible","axisXColor","axisYColor","axisZColor","editSizeColor","rectSelectable","rectSelectBackground","headlightRange","headlightColor","headlightIntensity","headlightAmbientIntensity","headlightDisabled","ortho","orthoWidth","fovy","near","far",dt,ut,"up","aspect","fogDisabled","fogMode","fogDensity","fogColor","fogNear","fogFar","pickerResolution","dashDisabled","batchColorDisabled","batchBlendDisabled","batchBrightnessDisabled","hoverDelay","batchInfoMap","rotateMinPhi","rotateMaxPhi"],_editable:!(Tg={fogDisabled:1,fogMode:1,dashDisabled:1,batchColorDisabled:1,batchBlendDisabled:1,batchBrightnessDisabled:1,ortho:1}),_editHelperDisabled:G.graph3dViewEditHelperDisabled,_blockSelectable:G.graph3dViewBlockSelectable,_devicePixelRatio:H,_boundaries:H,_moveStep:G.graph3dViewMoveStep,_rotateStep:G.graph3dViewRotateStep,_rotateMinPhi:G.graph3dViewMinPhi===H?G.graph3dViewRotateMinPhi:G.graph3dViewMinPhi,_rotateMaxPhi:G.graph3dViewMaxPhi===H?G.graph3dViewRotateMaxPhi:G.graph3dViewMaxPhi,_pannable:G.graph3dViewPannable,_rotatable:G.graph3dViewRotatable,_walkable:G.graph3dViewWalkable,_resettable:G.graph3dViewResettable,_zoomable:G.graph3dViewZoomable,_zoomToCenter:!0,_firstPersonMode:G.graph3dViewFirstPersonMode,_mouseRoamable:G.graph3dViewMouseRoamable,_gridVisible:G.graph3dViewGridVisible,_gridSize:G.graph3dViewGridSize,_gridGap:G.graph3dViewGridGap,_gridColor:G.graph3dViewGridColor,_originAxisVisible:G.graph3dViewOriginAxisVisible,_centerAxisVisible:G.graph3dViewCenterAxisVisible,_axisXColor:G.graph3dViewAxisXColor,_axisYColor:G.graph3dViewAxisYColor,_axisZColor:G.graph3dViewAxisZColor,_ortho:G.graph3dViewOrtho,_orthoWidth:G.graph3dViewOrthoWidth,_fovy:G.graph3dViewFovy,_near:G.graph3dViewNear,_far:G.graph3dViewFar,_headlightColor:G.graph3dViewHeadlightColor,_headlightIntensity:G.graph3dViewHeadlightIntensity,_headlightRange:G.graph3dViewHeadlightRange,_headlightAmbientIntensity:G.graph3dViewHeadlightAmbientIntensity,_headlightDisabled:G.graph3dViewHeadlightDisabled,_rectSelectable:G.graph3dViewRectSelectable,_rectSelectBackground:G.graph3dViewRectSelectBackground,_editSizeColor:G.graph3dViewEditSizeColor,_autoMakeVisible:ba,_fogDisabled:G.graph3dViewFogDisabled,_fogMode:G.graph3dViewFogMode,_fogDensity:G.graph3dViewFogDensity,_fogColor:G.graph3dViewFogColor,_fogNear:G.graph3dViewFogNear,_fogFar:G.graph3dViewFogFar,_pickerResolution:G.graph3dViewPickerResolution,_dashDisabled:G.graph3dViewDashDisabled,_batchColorDisabled:G.graph3dViewBatchColorDisabled,_batchBlendDisabled:G.graph3dViewBatchBlendDisabled,_batchBrightnessDisabled:G.graph3dViewBatchBrightnessDisabled,addCamera:function(t){var e=L.freeze({id:this._42Q++,priority:t.priority||0,ignoreInPick:!!t.ignoreInPick,render:t.render});t.switch3DStatus&&(this._43Q[e.id]=!0),this._41Q.push(e),this._41Q.sort(function(t,e){return t.priority!==e.priority?t.priority-e.priority:t.id-e.id})},setEye:function(t,e,i){1===arguments.length&&(e=t[1],i=t[2],t=t[0]);var n=this._eye;n[0]=t,n[1]=e,n[2]=i,this.fp(dt,U,n)},setCenter:function(t,e,i){1===arguments.length&&(e=t[1],i=t[2],t=t[0]);var n=this._center;n[0]=t,n[1]=e,n[2]=i,this.fp(ut,U,n)},setUp:function(t,e,i){1===arguments.length&&(e=t[1],i=t[2],t=t[0]);var n=this._up;n[0]=t,n[1]=e,n[2]=i,this.fp("up",U,n)},getDevicePixelRatio:function(){return this._picking?this._1o._resolution:this._devicePixelRatio||ma},isTransparentMask:function(t){return t.s("transparent.mask")},getCoreInteractor:function(){return this._coreInteractor},getHighlightHelper:function(){return this._highlightHelper},getRaycaster:function(){return this._raycaster},getAspect:function(){var t=this._aspect;return t||((t=this.getWidth()/this.getHeight())||1.2)},getCanvas:function(){return this._canvas},setDataModel:function(t){var e=this,i=e._dataModel,n=e._selectionModel;i!==t&&(i&&(i.ump(e.handleDataModelPropertyChange,e),i.umm(e.handleDataModelChange,e),i.umd(e.handleDataPropertyChange,e),n||i.sm().ums(e.handleSelectionChange,e)),(e._dataModel=t).mp(e.handleDataModelPropertyChange,e),t.mm(e.handleDataModelChange,e),t.md(e.handleDataPropertyChange,e),n?n._21I(t):t.sm().ms(e.handleSelectionChange,e),e._postProcessing.handleDataModleChange(i,t),e.invalidateAll(!0),e.invalidateLight(),e.fp(Oe,i,t),e._canvas.style.background=t.getBackground()||"")},handleDataModelPropertyChange:function(t){var e,i;"background"===t.property?(e=this._canvas.style.background,i=t.newValue||"",this._canvas.style.background=i,this.fp("canvasBackground",e,i)):"envmap"===t.property?this.iv():"cubicEnvmap"===t.property&&(this._lastEnvMap=H,this.iv())},handleDataPropertyChange:function(t){var e=t.data;this.invalidateData(e),Cu(e)&&"s:light.type"===t.property?this.invalidateLight():"s:shadow.cast"===t.property?this.shadowMap.tryUpdateBounding(e):"s:alwaysOnTop"!==t.property&&"s:shape3d.alwaysOnTop"!==t.property||(t.newValue?e.setRenderLayer("top"):e.setRenderLayer(H))},invalidateLight:function(){this._lightChanged||(this._lightChanged=!0,this.iv())},onPropertyChanged:function(t){t=t.property;this.iv(),this._18Q=U,"eye"===t?this._33Q=!0:"devicePixelRatio"===t?this._42(U,this.getDevicePixelRatio()):Tg[t]&&Zu(this)},_5O:function(t){var e=t._22Q();return e?new e(this,t):U},getData3dUI:function(t){var e=this._25I[t._id];return e===H&&(e=this._5O(t),this._25I[t._id]=e),e},invalidateAll:function(t){var e=this;if(t){for(var i in e._25I){var n=e._25I[i];n&&n.dispose()}e._25I={},e.iv(),Xd(e)}else Xd(e),e.dm().each(function(t){e.invalidateData(t)})},invalidateSelection:function(){var e=this;e.sm().each(function(t){e.invalidateData(t)})},invalidateData:function(t){var e=this.getData3dUI(t);e&&(e.iv(),this.iv()),Xd(this,t)},getShape3dText:function(t){return t.getStyle("shape3d.text")||this.getLabel(t)},invalidateBatch:function(e){var i=this;i._40Q.each(function(t){i._invalidateBatch(t.batchModelMap,t.batchIndexMap,t.polylineModelMap,t.polylineIndexMap,t.wireframeModelMap,t.wireframeIndexMap,e),t.markBatchInvalid()})},_invalidateBatch:function(t,i,e,n,r,o,a){var s=this,h=t[a],c=[],l={};if(h){h.ds.forEach(function(t){var e=s.getData3dUI(t);e&&e.iv(),delete i[t._id],c.push(t._id)}),delete t[a];for(var u,d,f=[r,e],g=[o,n],p=0;p<f.length;p++){for(var _=f[p],v=g[p],l={},y=0;y<c.length;y++){var m=v[c[y]];if(m){delete v[c[y]],u=_[d=m.batch];var b=m.begin,x=m.size,w=3*b,E=3*x,T=4*b,S=4*x,I=u.ds,C=u.vs,M=u.cs,R=u.ps,A=u.ls,P=m.index;for(u.invalidate=!0,I[P]=H,P=w;P<w+E;P++)C[P]=H;for(P=T;P<T+S;P++)M[P]=H;for(P=T;P<T+S;P++)R[P]=H;if(A)for(P=w;P<w+E;P++)A[P]=H;l[d]=!0}}for(d in l){I=(u=_[d]).ds,C=u.vs,M=u.cs,R=u.ps,A=u.ls;var D=[];for(P=0;P<I.length;P++)I[P]!==H&&D.push(I[P]);if(0===D.length)delete _[d];else{for(u.ds=D,D=[],P=0;P<C.length;P++)C[P]!==H&&D.push(C[P]);for(u.vs=D,D=[],P=0;P<M.length;P++)M[P]!==H&&D.push(M[P]);for(u.cs=D,D=[],P=0;P<R.length;P++)R[P]!==H&&D.push(R[P]);if(u.ps=D,A){for(D=[],P=0;P<A.length;P++)A[P]!==H&&D.push(A[P]);u.ls=D}}}}s.iv()}},handleDataModelChange:function(t){var e,i=this,n=t.kind,r=t.data;"add"===n?(i.invalidateData(r),En(r)&&r.getEdgeGroup()&&r.getEdgeGroup().eachSiblingEdge(i.invalidateData,i),Cu(r)&&i.invalidateLight()):n===Ct?(e=r._id,(t=i._25I[e])&&(t.dispose(),delete i._25I[e],i.iv()),r===i._currentSubGraph&&i.setCurrentSubGraph(U),Xd(i,r),Cu(r)&&i.invalidateLight()):n===Mt&&(i.invalidateAll(!0),i.setCurrentSubGraph(U),Xd(i),i.invalidateLight())},toCanvas:function(t,e,i){var n=this.getGL();this.validate(),t&&(g=n.getParameter(n.COLOR_CLEAR_VALUE),nd(n,t)),this._42(U,1);var r=this.getWidth()||1,o=this.getHeight()||1,a=new Uint8Array(4*r*o),s=er(),h=s.getContext("2d");n.readPixels(0,0,r,o,n.RGBA,n.UNSIGNED_BYTE,a),rr(s,r,o,1);for(var c=h.getImageData(0,0,r,o),l=c.data,u=0;u<l.length;u+=4){var d=u/4,f=k(d/r);l[d=4*((o-1-f)*r+(d-f*r))]=a[u],l[1+d]=a[u+1],l[2+d]=a[u+2],l[3+d]=a[u+3]}if(h.putImageData(c,0,0),t&&nd(n,g),this._42(U,this.getDevicePixelRatio()),e&&i){var n=er(),g=n.getContext("2d");return rr(n,e,i,1),G.drawImage(g,s,0,0,e,i),n}return s},toDataURL:function(t,e){var i,n=this.getGL();this.validate(),t&&(i=n.getParameter(n.COLOR_CLEAR_VALUE),nd(n,t)),this._42(U,1);e=this._canvas.toDataURL(e||"image/png",1);return t&&nd(n,i),this._42(U,this.getDevicePixelRatio()),e},getGL:function(){var t,e,i,n=this._26I;if(n)return this.acquireProgram(),n;if(!this._35O){var r=this,o=r._canvas,a=r._attributes;if(!a||!1!==a.requestWebGL2)try{(n=o.getContext("webgl2",a)||o.getContext("experimental-webgl2",a))&&(r._webGLVersion=2,r._26I=n)}catch(t){}if(!n)try{n=o.getContext("webgl",a)||o.getContext("experimental-webgl",a)}catch(t){throw new Error("WebGL not supported")}if(!n)throw new Error("WebGL not supported");r._26I=n;var s=r._frameState=new wg(this,n);r._glExtensions=new h(n),r._glCapabilities=new l(n,r._glExtensions),r._2O={},n._emptyCubeTexture=(t=n,i=new Uint8Array(4),e=e||t.createTexture(),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_CUBE_MAP,e),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+0,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+1,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+2,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+3,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+4,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+5,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,i),e),n._compiledShader={},n._emptyTexture=Yu(n),n._emptyBlendTexture=Yu(n),n._bufPool={},n._id=++Sg,s.setGLState(),r._buffer={vs:Ju(n),ns:Ju(n),is:Ju(n),uv:Ju(n),batchColor:Ju(n),batchBlend:Ju(n),batchBrightness:Ju(n),lineDistance:Ju(n)},r._1O=Qu(n);s=r._cube={vs:Ju(n),ns:Ju(n),is:Ju(n),uv:Ju(n)};return fd(n,s.vs,mf),fd(n,s.ns,wf),fd(n,s.uv,xf),pd(n,s.is,bf),r.acquireProgram(),n._renderInfo={calls:0,vertices:0,faces:0,lines:0,points:0,frame:0,cacheTimeCost:0},n}},getEnvmap:function(){return this._glCapabilities&&this._glCapabilities.maxVertexTextures<G.graph3dEnvmapCapabilityRequire?null:this.dm().getEnvmap()},acquireProgram:function(){var t=this,e=t._26I;if(e){var i=G.getImage(t.getEnvmap()),n=!(!i||!i.tagName),r=!(!t._prg||!t._prg.envMapFlag);if(!t._prg||n!=r){var o=t._prg=e.createProgram();if(!o)return U;o.envMapFlag=n;var a=t._dirs.length,s=t._spots.length,i=t._59O.length,r=["uPMatrix","uMVMatrix","uMMatrix","uReflectivity","uViewMatrix","uUseEnvMap","uEnvMap","uCameraPosition","uNMatrix","uViewMatrix","aNormal","aUv","uOffsetScale","uDiffuse","uBlend","uBlendColor","uBrightness","uPartOpacity","uAlphaTest","uTransparent","uClipDirection","uClipPercent","uTexture","uBlendTexture","uSampler","uBlendSampler","uDiscardSelectable","uFix","uPick","uReverseFlip","uFixPickReverseColor","uBatchBrightness","aBatchBrightness","uBatchColor","aBatchColor","uBatchBlend","aBatchBlend","uDash","aLineDistance","uDashDistance","uDashGapDistance","uLight","uHeadlightRange","uHeadlightAmbientIntensity","uHeadlightColor","uFogColor","uFogDensity","uFogNear","uFogFar"];a&&r.push("uDirColor","uDirDirection"),s&&r.push("uSpotColor","uSpotRange","uSpotAngle","uSpotExponent","uSpotPosition","uSpotDirection"),i&&r.push("uPointColor","uPointRange","uPointPosition"),Su||(Vd=On(Vd.substring(0,Vd.indexOf("^#"))),Ld=On(Ld),Su=!0);n=["#define MAX_DIR "+a,"#define MAX_SPOT "+s,"#define MAX_POINT "+i,t._fogDisabled?"":"#define FOG","exp2"===t.getFogMode()?"#define FOG_EXP2":"",t._dashDisabled?"":"#define DASH",n?"#define USE_ENVMAP":"",t.isOrtho()?"#define ORTHOGRAPHIC":"",t._batchColorDisabled?"":"#define BATCHCOLOR",t._batchBlendDisabled?"":"#define BATCHBLEND",t._batchBrightnessDisabled?"":"#define BATCHBRIGHTNESS",t.shadowMap.enable?t.shadowMap.genShaderDefine():"",""].join("\n"),t=Ku(e,o,e.VERTEX_SHADER,Vd.replace("PREFIX",n));e.getShaderParameter(t,e.COMPILE_STATUS)||console.error("compile vs shader faild, error info : ",e.getShaderInfoLog(t));n=Ku(e,o,e.FRAGMENT_SHADER,Ld.replace("PREFIX",n));e.getShaderParameter(n,e.COMPILE_STATUS)||console.error("compile fs shader faild, error info : ",e.getShaderInfoLog(n)),A?r.push("aPosition"):(o.aPosition=0,e.bindAttribLocation(o,0,"aPosition")),e.linkProgram(o),r.forEach(function(t){o[t]=/^u/.test(t)?e.getUniformLocation(o,t):e.getAttribLocation(o,t)});r=this._frameState;r.renderState.program=r.defaultProgram=o,e.deleteShader(t),e.deleteShader(n)}}},getBrightness:function(t){var e=t.s("brightness"),t=this.isSelected(t)?t.s("select.brightness"):U;return e==U?t:t==U?e:e*t},setHighlightMode:function(t){var e="selection"===t||"selected"===t?kg.Mode.Selection:"mouseover"===t||"hover"===t?kg.Mode.MouseOver:"style"===t?kg.Mode.Style:kg.Mode.Disable,t=this._highlightHelper.mode;this._highlightHelper.mode=e,this.firePropertyChange("highlightMode",t,e)},getHighlightMode:function(){var t=this._highlightHelper.mode;return t===kg.Mode.Selection?"selected":t===kg.Mode.MouseOver?"hover":t===kg.Mode.Style?"style":"disabled"},getDataHighlightMode:function(t){return t.s("highlight.mode")},getHighlightColor:function(){return this._highlightHelper.color||F["highlight.color"]},setHighlightColor:function(t){var e=this._highlightHelper.color;this._highlightHelper.color=t,this.firePropertyChange("highlightColor",e,t)},getHighlightWidth:function(){return this._highlightHelper.width||F["highlight.width"]},setHighlightWidth:function(t){var e=this._highlightHelper.width;this._highlightHelper.width=t,this.firePropertyChange("highlightWidth",e,t)},bindEnvMap:function(t){var e=yu.for(t).directUniforms(),i=this.getEnvmap(),r=G.getImage(i);if(r&&r.tagName){if(i!==this._lastEnvMap){var o={};if(this.dm().isCubicEnvmap()){var n=mh(r),a=bh(r);if(0===n||0===a)return;var s=n/4,h=a/3,c={top:{x:s,y:0},left:{x:0,y:h},front:{x:s,y:h},right:{x:2*s,y:h},back:{x:3*s,y:h},bottom:{x:s,y:2*h}};["top","left","front","right","back","bottom"].forEach(function(t){var e=c[t],i=o[t]=er();rr(i,s,h,1);var n=fr(i);n.drawImage(r,e.x,e.y,s,h,0,0,s,h),n.restore(),o[t]=G.resizeImagePOT(i,!0)})}else r=G.resizeImagePOT(r,!0);this._envMapTexture&&t.deleteTexture(this._envMapTexture);a=this._envMapTexture=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_CUBE_MAP,a),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_CUBE_MAP,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+0,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o.right||r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+1,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o.left||r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+2,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o.top||r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+3,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o.bottom||r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+4,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o.front||r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+5,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,o.back||r),t.bindTexture(t.TEXTURE_CUBE_MAP,t._emptyCubeTexture),this._lastEnvMap=i}e.uEnvMap=this._envMapTexture}},getWireframe:function(t){var e=t.s("wf.visible"),i=t.s("wf.width");return!0===e||0<i&&"selected"===e&&this.isSelected(t)?{color:t.s("wf.color"),width:i,short:t.s("wf.short"),mat:t.s("wf.mat")}:void 0},_transformPointToViewSpace:function(t){t=[t[0],t[1],t[2]];return Xs(t,this._viewMatrix),t},_transformDirectionToViewSpace:function(t,e){var i=[t[0],t[1],t[2]];Xs(i,this._viewMatrix);var n=e?[e[0],e[1],e[2]]:[0,0,0];Xs(n,this._viewMatrix);t=n[0]-i[0],e=n[1]-i[1],n=n[2]-i[2],i=Math.sqrt(t*t+e*e+n*n);return i?[t/i,e/i,n/i]:[t,e,n]},getWireframeGeometry:function(t){return t.s("wf.geometry")?{color:t.s("wf.color"),width:t.s("wf.width"),mat:t.s("wf.mat"),geometry:!0}:void 0},getBodyColor:function(t){return t.s("body.color")},getMat:function(t){return t.getMat?t.getMat():t.s("mat")},getFaceMat:function(t,e){return t.getFaceMat?t.getFaceMat(e):t.s(e+".mat")},getFaceBlend:function(t,e){return t.s(e+".blend")||t.s("all.blend")},getFaceColor:function(t,e){return t.s(e+".color")||t.s("all.color")},getFaceImage:function(t,e){return t.s(e+".image")||t.s("all.image")},getFaceBlendImage:function(t,e){return t.s(e+".blend.image")||t.s("all.blend.image")},getFaceDiscardSelectable:function(t,e){e=t.s(e+".discard.selectable");return e==U?t.s("all.discard.selectable"):e},getFaceUv:function(t,e){return t.s(e+".uv")||t.s("all.uv")},getFaceUvOffset:function(t,e){return t.s(e+".uv.offset")||t.s("all.uv.offset")},getFaceUvScale:function(t,e){return t.s(e+".uv.scale")||t.s("all.uv.scale")},getFaceLight:function(t,e){e=t.s(e+".light");return e==U?t.s("all.light"):e},getFaceVisible:function(t,e){e=t.s(e+".visible");return e==U?t.s("all.visible"):e},getFaceOpacity:function(t,e){e=t.s(e+".opacity");return e==U?t.s("all.opacity"):e},getFaceTransparent:function(t,e){e=t.s(e+".transparent");return e==U?t.s("all.transparent"):e},getFaceReverseColor:function(t,e){return t.s(e+".reverse.color")||t.s("all.reverse.color")},getFaceReverseFlip:function(t,e){e=t.s(e+".reverse.flip");return e==U?t.s("all.reverse.flip"):e},getFaceReverseCull:function(t,e){e=t.s(e+".reverse.cull");return e==U?t.s("all.reverse.cull"):e},getTextureMap:function(){return this._2O},deleteTexture:function(t){var e=this._2O[t];e&&(delete this._2O[t],this.getGL().deleteTexture(e))},renderPickScene:function(){var t=this.getGL();this._picking=t._picking=!0,this.renderScene(),this._picking=t._picking=!1},invalidateCachedTexture:function(t){this.getData3dUI(t).invalidateCachedTexture(this.getGL()),this.invalidateData(t)},invalidateShape3dCachedImage:function(t){this.invalidateCachedTexture(t)},invalidateCachedGeometry:function(t){this.getData3dUI(t).invalidateCachedGeometry(),this.invalidateData(t)},isInteractive:function(t){return t.s("interactive")},getTexture:function(t,e,i){if(!t)return U;var n=this,r=n.getGL(),o=n._2O[t];if(!o){var a=Qa(t),s={};if(!a)return r._emptyTexture;if(e&&(s.mipmapMaxLevel=e.s("texture.mipmap.max"),b=e.s("texture.wrap"),s.clampToEdge="clampToEdge"===b||"repeat"!==b&&H),a.uuid||(a.uuid=Gl.Math.generateUUID()),a.tagName){if(a.dynamic)return Qu(r,a,n._1O,s);o=n._2O[t]=Qu(r,a,H,s)}else{var h,c=e&&(e.s("texture.cache")||e.s("shape3d.image.cache")||a.textureCache),l=n.vr.isPresenting();if(l&&(e._textureUpdateFrame===r._renderInfo.frame?c=!0:e._textureUpdateFrame=r._renderInfo.frame),c&&((o=(h=n.getData3dUI(e)).getCachedTexture(i))&&h.interactiveInfo&&o.interactiveInfo&&(h.interactiveInfo[o.interactiveInfo.key]=o.interactiveInfo.info)),!o){var u=r._renderInfo.textureCache;if(c){if(u.time>G.graph3dMaxVectorCacheTime)return n.redraw(),r._emptyTexture;if(!Ya(a,e))return r._emptyTexture}e&&(1!==e.s("texture.scale")?_=e.s("texture.scale"):1!==e.s("shape3d.texture.scale")&&(_=e.s("shape3d.texture.scale"))),_=_||1;var d=e&&(e.s("fixSizeOnScreen")||e.s("shape3d.fixSizeOnScreen")),f=d?r.NEAREST:r.LINEAR;d?"number"==typeof d&&(_*=d<0?1:d):e&&(e.s("vector.dynamic")||e.s("shape3d.vector.dynamic"))&&(d=(h=h||n.getData3dUI(e)).getVectorDynamicSize());var g=e&&e.s("shape3d");"billboard"===g?v=e.getTall()/e.getWidth():"plane"===g&&(v=e.getHeight()/e.getWidth());var p,_,v,y,m,b=mh(a,e);_=d?(g=c?n._devicePixelRatio||ma:n.getDevicePixelRatio(),p=0<d[0]?d[0]*g:_*b*g,0<d[1]?d[1]*g:_*(v?bh(a,e,n,Math.min(4096,b*v)):bh(a,e))*g):(p=_*b,_*(v?bh(a,e,n,Math.min(4096,b*v)):bh(a,e))),1<=p&&1<=_&&(b=0,(c||l)&&(b=Date.now()),v=n._glCapabilities.maxTextureSize,p=Math.min(p,v),_=Math.min(_,v),v=Kr(p,_),!h&&e&&(h=n.getData3dUI(e)),h&&h.interactiveInfo&&("object"==typeof(y=t)&&(y=y.uuid||(y.uuid=Gl.Math.generateUUID())),m=h.interactiveInfo[y]={},v.interactiveInfo=m.bodyInfo={compInfos:[],matrix:new ra,rect:{x:0,y:0,width:p,height:_}}),wh(v,a,0,0,p,_,e,n),v.interactiveInfo&&(v.interactiveInfo=null),v.restore(),u.count++,u.pixels+=p*_,e?(s.minFilter=Od(e.s("texture.filter.min")||e.s("texture.filter"))||f,s.magFilter=Od(e.s("texture.filter.mag")||e.s("texture.filter"))||f):s.minFilter=s.magFilter=f,c||l?(o=Qu(r,Yr,null,s),h.setCachedTexture(o,i),u.time+=Date.now()-b,m&&(o.interactiveInfo={key:y,info:m}),Yr=null):o=Qu(r,Yr,n._1O,s))}}}return o},redraw:function(){this.iv()},validateImpl:function(){var i,n,r,t=this;t._lightChanged&&(t._lightChanged=!1,i=[],n=[],r=[],t.dm().each(function(t){var e;Cu(t)&&("point"===(e=t.s("light.type"))?i.push(t):"spot"===e?n.push(t):"directional"===e&&r.push(t))}),i.length===t._59O.length&&n.length===t._spots.length&&r.length===t._dirs.length||Zu(t),t._59O=i,t._spots=n,t._dirs=r),t._42(),t._1o.iv()},getRenderInfo:function(){var t=this.getGL();return t?t._renderInfo:void 0},getDebugTip:function(){var t=this.getRenderInfo();if(t){var e=this.getGL()._validBufCount||0,i="Draw Calls: "+t.calls+"<br/>Vertices: "+t.vertices+"<br/>Faces: "+t.faces+"<br/>Lines: "+t.lines+"<br/>"+(t.points?"Points: "+t.points+"<br/>":"")+"Buffers: "+e+"<br/>Cache Models: "+L.keys(Vi).length+"<br/>Shape3d Models: "+L.keys(zi).length;return this.vr.isPresenting()&&(i+="<br/>VR fps: "+this.vr.getFps()),t.textureCache&&(e=t.textureCache.count,i+="<br/>2D Dynamic Textures: "+t.textureCache.count,0<e&&(i+="<br/>2D Dynamic pixels: "+(1e6<(t=t.textureCache.pixels)?Math.round(t/1e6)+"M":1e3<t?Math.round(t/1e3)+"K":Math.round(t)))),i}},getFrameState:function(){return this._frameState},isBoundingBoxInView:(iv=new Gl.Math.Box3,nv=new Gl.Math.Matrix4,function(t){var e=t;if(e instanceof Gl.Data&&(e=this.getData3dUI(e)),!e.mat)return!0;t=e.getBoundingBox();return iv.copy(t).applyMatrix4(nv.fromArray(e.mat)),this.getFrustum().intersectsBox(iv)}),updateScene:function(){this._81O=U,this.overlappingBox.clear(),this._40Q.init();for(var t,e=this.dm().getDatas().getArray(),i=e.length,n=this.getGL(),r=this._40Q,o=0;o<i;o++)t=e[o],(t=this.getData3dUI(t))&&t.update(this,n,r);this._40Q.onUpdated()},renderScene:function(){function i(t,e){r.setGLState(t,e),r.setUniforms(t),r.renderState.attribs.disable(),a=o.directUniforms(),o.directAttribs().disable()}function t(t){for(;d<f;d++){var e=u[d];if(!l||!e.ignoreInPick){if(e.priority>=t)break;n._43Q[n._44Q=e.id]&&!Ci[Ht.length]||(e.render(s,n,r),i())}}}var n=this;n.shadowMap.render(),n._44Q=-1;var r=n._frameState,o=r.renderState,e=o.glState,a=o.directUniforms(),s=n.getGL(),h=n._prg;o.syncLoss(),n._projectMatrix=qu(n),Wu(n,n._7O),n._viewMatrix=qs(n._7O),r.syncEnv(this._picking?this.pickColorMap:H),o.useProgram(h),i(!1,!0),s.clear(s.DEPTH_BUFFER_BIT);var c,l=n._picking,u=this._41Q,d=0,f=u.length;if(t(G.cameraPriority.skybox),l?(c=e.color.clear.slice(0),nd(s,[0,0,0,0])):(nd(s,[0,0,0,0]),e.blend.enabled=!1,e.depth.enabled=!1,e.depth.mask=!1,n.drawSky(s,h),n.drawReflectors(s)&&(n._projectMatrix=qu(n),Wu(n,n._7O),n._viewMatrix=qs(n._7O),r.syncEnv(),i()),e.blend.enabled=!1,e.depth.enabled=!0,e.depth.mask=!0,a.uTransparent=!1,n._31O._42(s,h)),!s.textureBatch||Ci[(ONE_FRAME_TIME-6)/2]){!l&&n.shadowMap.enable&&n.shadowMap.createShadow(a);for(var g=0,p=zh.length;g<p;g++){var _=zh[g],v=Rh[_];v.ignore||(t(v.priority),this.renderLayer(_))}e.depth.enabled=!1,a.uTransparent=!1,a.shadowReceive=!1,l?n.drawFilter||n._30O._42(s,h):(e.blend.enabled=!1,e.depth.mask=!0,n._32O._42(s,h),n._30O._42(s,h),n._highlightHelper._42(s,h)),e.depth.enabled=!0,t(G.cameraPriority.infinity),l&&nd(s,c),fd(s,U),pd(s,U),n._44Q=-1}},renderLayers:function(t,e){e&&(t=Bh(t));for(var i=0,n=t.length;i<n;i++)this.renderLayer(t[i])},renderLayer:function(t){var e=this,i=e._picking,n=e._40Q.get(t);if(n){var r,o,a,s=e.getGL(),h=e._frameState.renderState,c=h.glState,l=h.directUniforms(),u=n.opaque,d=n.transparent,f=n.batchModelMap,h=n.polylineModelMap,n=n.wireframeModelMap,s=e.getGL(),g=e._prg;i||(c.blend.enabled=!1,c.depth.enabled=!0,c.depth.mask=!0),(l.uTransparent=!1)!==Rh[t].clearDepth&&s.clear(s.DEPTH_BUFFER_BIT);var p=this.drawFilter;if(p)for(r=0,o=(a=u).length;r<o;r++)!0!==p(a[r].data)&&a[r].ui._42(s,g,m);else{for(r=0,o=(a=u).length;r<o;r++)a[r].ui._42(s,g,m);if(i)for(r=0,o=(a=d).length;r<o;r++)a[r].ui._46Q(s);sf(e,f),af(e,h),af(e,n)}if(i||(c.blend.enabled=!0,c.depth.mask=!1),e._45Q=l.uTransparent=!0,p)for(r=0,o=(a=d).length;r<o;r++)!0!==p(a[r].data)&&a[r].ui._42(s,g,y);else{for(r=0,o=(a=d).length;r<o;r++)a[r].ui._42(s,g,y);sf(e,f,0,!0),af(e,h,0,!0),af(e,n,0,!0)}e._45Q=null}},drawV2:function(t){var e=this;if(!e._35O&&(!Pi||Ci(Pi))){var i=e.getWidth(),n=e.getHeight();if(i&&n){var r=e.getGL();if(r){var o,a=e._canvas;t=t||e.getDevicePixelRatio(),i===a.clientWidth&&n===a.clientHeight||(rr(a,i,n,t),o=t,i&&1<Math.abs(r.drawingBufferWidth-i*t)&&(o=Math.min(o,r.drawingBufferWidth/i)),n&&1<Math.abs(r.drawingBufferHeight-n*t)&&(o=Math.min(o,r.drawingBufferHeight/n)),o!==t&&(e.setDevicePixelRatio(t=o),rr(a,i,n,t)),e._18Q=null),r.clear(r.COLOR_BUFFER_BIT);a=r._renderInfo;for(a.calls=0,a.vertices=0,a.faces=0,a.lines=0,a.points=0,a.textureCache={time:0,count:0,pixels:0},a.frame=++e._frameId,a.cacheTimeCost=0,a.reflectDepth=0,i*=t,n*=t;(!e.vr.enable||!e.vr.render(r,i,n))&&(e.updateScene(),!e._postProcessing.render(r,i,n)&&(e.setViewport(r,0,0,i,n),e.renderScene(),0)););e._33Q=!1,e.countFrame(),e._doBufferGC(r)}}}},_42:function(t,e){return this.drawV2(e)},drawReflectors:function(t){t._renderInfo.reflectDepth++;var e,i,n=this._dataModel.getReflectors(),r=!1;for(e in n)i=n[e],this.isVisible(i)&&(i=this.getData3dUI(i),i&&i.drawReflector(t)&&(r=!0));return t._renderInfo.reflectDepth--,r},isReflecting:function(t){return t._renderInfo.reflectDepth},getPostProcessing:function(){return this._postProcessing},enablePostProcessing:function(t,e){return this._postProcessing.enableModule(t,e)},getPostProcessingModule:function(t){return this._postProcessing.getModule(t)},getPostProcessingValue:function(t,e){t=this._postProcessing.getModule(t);return t?t[e]:H},setPostProcessingValue:function(t,e,i){var n=this.getPostProcessingValue(t,e),r=this._postProcessing.getModule(t);r&&n!==i&&("enable"===e?this.enablePostProcessing(t,i):r[e]=i,this.firePropertyChange("postProcessing."+t+"."+e,n,i))},setViewport:function(t,e,i,n,r){this._viewport=[e,i,n,r],yu.for(t).directState().viewport=this._viewport},getViewport:function(){return this._viewport},setBufferGCInterval:function(t){this._bufferGCInterval=t},_doBufferGC:function(t,e){var i,n,r=t._bufPool,o=0,a=0,s=t._renderInfo.frame,h=this._bufferGCInterval||10;for(i in r)o++,n=r[i],n&&(e||s-n._fid>h?(t.deleteBuffer(n._buf),n._buf=null,r[i]=null):a++);if(a<o/2&&128<o){var c={};for(i in r)r[i]&&(c[i]=r[i]);t._bufPool=c}t._validBufCount=a},_swapLineMap:function(){var t=this;M=t._polylineModelMap,t._polylineModelMap=t._polylineModelMapSwap,t._polylineModelMapSwap=M,M=t._wireframeModelMap,t._wireframeModelMap=t._wireframeModelMapSwap,t._wireframeModelMapSwap=M,M=t._polylineIndexMap,t._polylineIndexMap=t._polylineIndexMapSwap,t._polylineIndexMapSwap=M,M=t._wireframeIndexMap,t._wireframeIndexMap=t._wireframeIndexMapSwap,t._wireframeIndexMapSwap=M},_updateSkybox:function(t){var e,i,n,r;this._skybox&&t&&(r=t.property,e=!1,i=this._skybox,"eye"!==r&&"forceUpdate"!==r||(n=this._eye,i.p3(n[0],n[1],n[2]),e=!0),"near"!==r&&"far"!==r&&"forceUpdate"!==r||(t=this._near,n=this._far,(r=i.getFinalScale3d())[0]/=2,r[1]/=2,r[2]/=2,(r[0]<=t||r[0]>=n||r[1]<=t||r[1]>=n||r[2]<=t||r[2]>=n)&&(n=2*t*n/(t+n)/Math.min(r[0],r[1],r[2]),r=i.getScale3d(),i.setScale3d(r[0]*n,r[1]*n,r[2]*n),e=!0)),e&&this.invalidateData(i))},getSkyBox:function(){return this.getSkybox()},setSkyBox:function(t){return this.setSkybox(t)},getSkybox:function(){return this._skybox},setSkybox:function(t){var e=this._skybox;return e===t?void(t&&this._updateSkybox({property:"forceUpdate"})):(e&&(this._skyboxStyleMap&&e.setStyleMap(this._skyboxStyleMap),this._skyboxStyleMap=null,this._skyboxAnchor3d&&e.setAnchor3d(this._skyboxAnchor3d),this._skyboxAnchor3d=null,this._skyboxP3&&e.p3(this._skyboxP3),this._skyboxP3=null),this._skybox=t,this.ump(this._updateSkybox,this),t&&(t.dm()&&t.dm().remove(t),this._skyboxStyleMap=Gl.Default.clone(t.getStyleMap()),this._skyboxAnchor3d=t.getAnchor3d(),t.setAnchor3d(.5,.5,.5),this._skyboxP3=t.p3().slice(0),t.s({"shape3d.reverse.flip":!0,"shape3d.reverse.cull":!1,"all.reverse.flip":!0,"all.reverse.cull":!1,"front.reverse.flip":!0,"front.reverse.cull":!1,"back.reverse.flip":!0,"back.reverse.cull":!1,"left.reverse.flip":!0,"left.reverse.cull":!1,"right.reverse.flip":!0,"right.reverse.cull":!1,"top.reverse.flip":!0,"top.reverse.cull":!1,"bottom.reverse.flip":!0,"bottom.reverse.cull":!1}),this.mp(this._updateSkybox,this),this._updateSkybox({property:"forceUpdate"})),void this.fp("skybox",e,t))},drawSky:function(t,e){var i,n,r,o,a,s,h,c,l=this,u=l._skybox;u&&(i=yu.for(t).directUniforms(),c=l._headlightIntensity,n=to(l._headlightColor),e=l._prg,1!==c&&(n=[n[0]*c,n[1]*c,n[2]*c]),i.uHeadlightColor=[n[0],n[1],n[2],1],(r=l.getData3dUI(u))&&((a=(o=l.isOrtho())||this._computedProjectMatrix)&&(s=l._projectMatrix,o&&(l._ortho=!1),i.uPMatrix=l._projectMatrix=qu(l,!0)),h=u.p3(),c=this._eye,h[0]===c[0]&&h[1]===c[1]&&h[2]===c[2]||(u._position.x=c[0],u._54O=c[1],u._position.y=c[2]),r.validate(),r._42(t,e,f),a&&(o&&(l._ortho=!0),i.uPMatrix=l._projectMatrix=s)),t.clear(t.DEPTH_BUFFER_BIT),i.uHeadlightColor=[n[0],n[1],n[2],l._headlightDisabled?1:0])},getLogicalPoint:function(t){return Cs(t,this._canvas)},isRectOverlapping:function(t){return this.getData3dUI(t)._rectOverlapping},getHitFaceInfo:function(t){t.target&&(t=this.lp(t));var e=this.getDataInfoAt(t);if(e){t=this.intersectObject(t,e.data);if(t)return{data:e.data,face:t.part}}return U},unproject:function(t,e){var i=this.getWidth(),n=this.getHeight(),r=t.target?this.lp(t):t,o=(r.x-i/2)/i*2,t=-1*(r.y-n/2)/n*2;e=e||0;i=Hs(),r=qu(this),n=Wu(this);Uu(i,r,n),ku(i);i=Qs([o,t,e,1],i);return[i[0]/i[3],i[1]/i[3],i[2]/i[3]]},getDataAt:function(t){t=this.getDataInfoAt(t);return t?t.data:U},getDataInfoAt:function(t,e){return t.target&&(t=this.lp(t)),this._1o.get(dn(t.x,t.y,e),!0)},getDatasInRect:function(t){return this._1o.get(t)},setEditable:function(t){var e=this._editable;this._editable=t,this.fp(Ee,e,t)},isEditable:function(t){return t?!!this._editable&&(!!wn(t)&&(!!t.s("3d.editable")&&(!this._editableFunc||this._editableFunc(t)))):this._editable},isSelectable:function(t){return t.s("3d.selectable")&&this.sm().isSelectable(t)},isMovable:function(t){return(!En(t)||t.getStyle(Jt)===Vt)&&(!!t.s("3d.movable")&&(!this._movableFunc||this._movableFunc(t)))},isSizeEditable:function(t){return!!wn(t)&&(!this._sizeEditableFunc||this._sizeEditableFunc(t))},isRotationEditable:function(t){return!(!wn(t)||!1===t.IRotatable)&&(!this._rotationEditableFunc||this._rotationEditableFunc(t))},handleDelete:function(){this._editable&&this.removeSelection()},zoomIn:function(t){this.setZoom(ja,t)},zoomOut:function(t){this.setZoom(1/ja,t)},setZoom:(J_=new ha,$_=new ha,tv=new ha,ev=new ha,function(t,e){if(1!==t){var i=this;i._14o&&i._14o.stop(!0);var n,r=1/t;J_.copy(i.getCenter()),$_.copy(i.getEye());var o=i._ortho;if(o){if((n=i._orthoWidth)<i._moveStep&&1<t)return}else if(J_.distanceTo($_)<i._moveStep&&r<1)return;var a=!1;return!1===i._zoomToCenter&&i._lastZoomLP&&(tv.copy($_).sub(J_).normalize(),i._81O=null,ev.copy(i.getHitPosition(i._lastZoomLP,J_.toArray(),tv.toArray())),a=!0,i._lastZoomHit=ev),(e=Rn(e))?(e.action=function(t){i.fi({kind:i._zooming?"betweenZoom":"beginZoom"}),i._zooming=1;t=(r-1)*t+1;o&&i.setOrthoWidth(n*t),a?(i.setEye(tv.lerpVectors(ev,$_,t).toArray()),i.setCenter(tv.lerpVectors(ev,J_,t).toArray())):o||i.setEye(tv.lerpVectors(J_,$_,t).toArray())},e._37o=function(){delete i._14o,delete i._zooming,i.fi({kind:"endZoom"}),i.onZoomEnded()},i._14o=rs(e)):(o&&i.setOrthoWidth(n*r),void(a?(i.setEye(tv.lerpVectors(ev,$_,r).toArray()),i.setCenter(tv.lerpVectors(ev,J_,r).toArray())):o||i.setEye(tv.lerpVectors(J_,$_,r).toArray())))}}),setOrthoZoom:function(t,e){return this.setZoom(t,e)},getPositionInfo:function(t){var e=this._eye,i=this._center,n=this.getAspect(),i=t?Gs(Ns(i,e,!0),Ns(t,e)):ys(e,i);if(this._ortho){var r=this._orthoWidth;return{length:i,height:r/n,width:r}}r=2*x(this._fovy/2)*i;return{length:i,height:r,width:r*n}},getCenterInfo:function(){return this._81O||(this._81O=this.getPositionInfo()),is(this._81O)},rotate:function(i,n,t,r){var o=this;if(i||n){r==U&&(r=o._firstPersonMode),o._88O&&o._88O.stop(!0);var e=o._center,a=o._eye,s=o.getCenterInfo().length,h=r?e:a,c=r?a:e,l=Ns(h,c),u=T(l[0],l[2]),d=T(W(l[0]*l[0]+l[2]*l[2]),l[1]),f=r?ut:dt;return r&&(n=-n),(t=Rn(t))?(t.action=function(t){o.fi({kind:o._rotating?"betweenRotate":"beginRotate"}),o._rotating=1;var e=u+i*t,t=d+n*t,t=r?P-Ou(o,P-t):Ou(o,t);l[0]=s*Z(t)*Z(e),l[1]=s*Q(t),l[2]=s*Z(t)*Q(e),h[0]=c[0]+l[0],h[1]=c[1]+l[1],h[2]=c[2]+l[2],o.fp(f,U,h)},t._37o=function(){delete o._88O,delete o._rotating,o.fi({kind:"endRotate"}),o.onRotateEnded()},o._88O=rs(t)):(u+=i,d+=n,d=r?P-Ou(o,P-d):Ou(o,d),l[0]=s*Z(d)*Z(u),l[1]=s*Q(d),l[2]=s*Z(d)*Q(u),h[0]=c[0]+l[0],h[1]=c[1]+l[1],h[2]=c[2]+l[2],void o.fp(f,U,h))}},pan:function(t,e,i,n){if(t||e){var r=this;n==U&&(n=r._firstPersonMode),r._89O&&r._89O.stop(!0);var o=Wu(r),t=[o[0]*t,o[4]*t,o[8]*t],e=[o[1]*e,o[5]*e,o[9]*e],a=t[0]+e[0],s=t[1]+e[1],h=t[2]+e[2],c=r._center,l=r._eye;if(n&&(n=Dd(r.getBoundaries(),l[0],l[2],l[0]+a,l[2]+h,W(a*a+h*h)),a=n[0],h=n[1]),i=Rn(i)){var u=is(l),d=is(c);return i.action=function(t){r.fi({kind:r._panning?"betweenPan":"beginPan"}),r._panning=1,c[0]=d[0]+a*t,c[1]=d[1]+s*t,c[2]=d[2]+h*t,l[0]=u[0]+a*t,l[1]=u[1]+s*t,l[2]=u[2]+h*t,r.fp(dt,U,l),r.fp(ut,U,c)},i._37o=function(){delete r._89O,delete r._panning,r.fi({kind:"endPan"}),r.onPanEnded()},r._89O=rs(i)}c[0]+=a,c[1]+=s,c[2]+=h,l[0]+=a,l[1]+=s,l[2]+=h,r.fp(dt,U,l),r.fp(ut,U,c)}},walk:function(e,t,i){if(e){var n=this;i==U&&(i=n._firstPersonMode),n._90O&&n._90O.stop(!0);var r=n._center,o=n._eye,a=Ns(r,o,!0);if(i){i=Dd(n.getBoundaries(),o[0],o[2],o[0]+a[0]*e,o[2]+a[2]*e,X(e));if(!(e=ys(i)))return;a=[i[0]/e,0,i[1]/e]}if(t=Rn(t)){var s=is(o),h=is(r);return t.action=function(t){n.fi({kind:n._walking?"betweenWalk":"beginWalk"}),n._walking=1;t*=e;o[0]=s[0]+a[0]*t,o[1]=s[1]+a[1]*t,o[2]=s[2]+a[2]*t,r[0]=h[0]+a[0]*t,r[1]=h[1]+a[1]*t,r[2]=h[2]+a[2]*t,n.fp(dt,U,o),n.fp(ut,U,r)},t._37o=function(){delete n._90O,delete n._walking,n.fi({kind:"endWalk"}),n.onWalkEnded()},n._90O=rs(t)}o[0]+=a[0]*e,o[1]+=a[1]*e,o[2]+=a[2]*e,r[0]+=a[0]*e,r[1]+=a[1]*e,r[2]+=a[2]*e,n.fp(dt,U,o),n.fp(ut,U,r)}},handleScroll:function(t,e){t.preventDefault();var i=this,n=i._moveStep,r=i.getDataInfoAt(t);if(r){var o=r.data;if(o&&i.isInteractive(o)){r=i.intersectObject(t,o);if(r){r=r.part,r=Qa(o.s(r+".image")||o.s("shape3d."+r+".image")||o.s("all.image")||o.s("shape3d.image"));if(r&&xh(r.scrollable,o,i))return}}}return i.isFirstPersonMode()?void(i.isPannable()&&i.pan(0,0<e?n:-n)):void(i.isZoomable()&&(i._lastZoomLP=i.lp(t),i.setZoom(e<0?1/Na:Na),i._lastZoomLP=i._lastZoomHit=null))},handlePinch:function(t,e){this.isZoomable()&&(Math.abs(t-e)<G.pinchZoomThreshold||this.setZoom(t<e?1/Ua:Ua))},reset:function(){this.setCenter(G.graph3dViewCenter),this.setEye(G.graph3dViewEye),this.setUp(G.graph3dViewUp)},moveSelection:function(t,e,i){this.dm().beginTransaction(),Bo(this.sm().toSelection(this.isMovable,this),t,e,i),this.dm().endTransaction()},getMoveMode:function(t,e){e=e.s("3d.move.mode");if(e)return e;return gs(t)||Li[88]&&Li[89]&&Li[90]?"xyz":Li[88]&&Li[89]?"xy":Li[88]&&Li[90]?"xz":Li[89]&&Li[90]?"yz":Li[88]?"x":Li[89]?"y":Li[90]?"z":"xz"},handleTick:function(){var t,e=this,i=!1,n=e._moveStep,r=n,o=-1*e._rotateStep;e.isWalkable()||(r=0),e.isPannable()||(n=0),e.isRotatable()||(o=0),e._32Q&&(r*=t=(sn()-e._32Q)/50,n*=t,o*=t),e._31Q&&(ts(e._31Q),delete e._31Q,delete e._32Q),Vr()&&(i=!0,e.pan(-n,0,!1,!0)),Fr()&&(i=!0,e.pan(n,0,!1,!0)),kr()&&(i=!0,gs()?e.pan(0,n,!1,!0):e.walk(r,!1,!0)),Lr()&&(i=!0,gs()?e.pan(0,-n,!1,!0):e.walk(-r,!1,!0)),jr()&&(i=!0,e.rotate(-o,0,!1,!0)),Ur()&&(i=!0,e.rotate(o,0,!1,!0)),Nr()&&(i=!0,e.rotate(0,-o/2,!1,!0)),Gr()&&(i=!0,e.rotate(0,o/2,!1,!0)),i&&(e._32Q=sn(),e._31Q=$a(e.handleTick,e))},handleKeyDown:function(t){!ps(t)&&Xr[t.keyCode]?this.handleTick():Or(t)?this.selectAll():Br(t)?this.handleDelete(t):Hr(t)&&this.isResettable()&&this.reset()},checkDoubleClickOnNote:function(t,e,i){if(i===Ut){if(e.s("note.toggleable"))return e.s(Qt,!e.s(Qt)),this.fi({kind:"toggleNote",event:t,data:e,part:i}),!0}else if(i===Gt&&e.s("note2.toggleable"))return e.s(Yt,!e.s(Yt)),this.fi({kind:"toggleNote2",event:t,data:e,part:i}),!0;return!1},checkDoubleClickOnRotation:function(t,e,i){return i===Wg?(e.setRotationX(0),!0):i===qg?(e.setRotationY(0),!0):i===Xg&&(e.setRotationZ(0),!0)},onRotateEnded:function(){},onWalkEnded:function(){},getViewRatio:function(t){if(this.isOrtho())return this.getWidth()/this.getOrthoWidth();var e=this.getCenter(),i=this.getHeight(),n=this.getEye(),e=[e[0]-n[0],e[1]-n[1],e[2]-n[2]],n=[t[0]-n[0],t[1]-n[1],t[2]-n[2]];return i*Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2])*(1/Math.tan(this.getFovy()/2))/(n[0]*e[0]+n[1]*e[1]+n[2]*e[2])},inViewSpace:function(t){var e,i=this._transformPointToViewSpace(t),n=this.getAspect(),r=this.getNear(),t=this.getFar();return!(-i[2]<r||-i[2]>t)&&(this.isOrtho()?(e=this.getOrthoWidth()/2,Math.abs(i[0])<=e&&Math.abs(i[1]*n)<=e):(e=Math.sqrt(i[0]*i[0]+i[1]*i[1]+i[2]*i[2])*Math.tan(this.getFovy()/2),Math.abs(i[1]<=e)&&Math.abs(i[0])<=e*n))},getPVMatrix:function(){var t;return(t=this._18Q)||(t=qu(this),this._18Q=Uu(t,t,Wu(this)),this._18Q._wh=this.getWidth()/2/this.getHeight()),t},getFrustum:(Y_=new fa,Z_=new Ag,K_=new Array(16),function(){for(var t=this.getPVMatrix(),e=!1,i=0;i<16;i++)t[i]!==K_[i]&&(e=!0,K_[i]=t[i]);return e&&Z_.setFromMatrix(Y_.fromArray(t)),Z_}),toViewPosition:function(t){var e=this.getWidth()/2,i=this.getHeight()/2,n=this.getPVMatrix();return{x:e+e*(t=Qs([t[0],t[1],t[2],1],n))[0]/t[3],y:i-i*t[1]/t[3],z:t[2]/t[3]}},getHitPosition:function(t,e,i){var n=this.getWidth(),r=this.getHeight(),o=t.target?this.lp(t):t,a=o.x-n/2,s=o.y-r/2,t=this.getCenterInfo(),o=Wu(this);e=e||[0,0,0],i=i||[0,1,0],a=a/n*t.width,s=-1*s/r*t.height;a=[o[0]*a,o[4]*a,o[8]*a],s=[o[1]*s,o[5]*s,o[9]*s],a=[a[0]+s[0],a[1]+s[1],a[2]+s[2]],s=this.getCenter(),s=zu(this,e,i,[a[0]+s[0],a[1]+s[1],a[2]+s[2]]);return s||[0,0,0]},intersectObject:function(t,e){return this._raycaster.intersectObject(t,e)},intersectObjects:function(t,e,i){return this._raycaster.intersectObjects(t,e,i)},getLineLength:function(t){this.validate();t=this.getData3dUI(t);if(t&&t.getCache){t=t.getCache();if(t)return t[t.length-1].length}return 0},getLineOffset:function(t,e){var i=this.getData3dUI(t);if(i&&i.getCache){var n=i.getCache();if(n){var r=qf(n,e);if(!t.r3)return r;i=t.r3();if(0===i[0]&&0===i[1]&&0===i[2])return r;n=new ha(t.p3()),e=new ha(r.point).sub(n),r=new ha(r.tangent).add(e),t=(new aa).setFromEuler(new pa(i,t.getRotationMode(),!0));return e.applyQuaternion(t),r.applyQuaternion(t),{point:e.add(n),tangent:r.sub(e).normalize()}}}return U},isLabelVisible:function(){return!0},isNoteVisible:function(){return!0},moveCamera:function(t,e,i){var n=this,r=[(r=n.getEye())[0],r[1],r[2]],o=[(o=n.getCenter())[0],o[1],o[2]];if(t=t||r,e=e||o,n._flyAnim&&n._flyAnim.stop(!0),!(i=Rn(i)))return n.setEye(t[0],t[1],t[2]),n.setCenter(e[0],e[1],e[2]),delete n._flyAnim,!0;var a=[t[0]-r[0],t[1]-r[1],t[2]-r[2]],s=[e[0]-o[0],e[1]-o[1],e[2]-o[2]];return i.action=function(t){n.setCenter(o[0]+s[0]*t,o[1]+s[1]*t,o[2]+s[2]*t),n.setEye(r[0]+a[0]*t,r[1]+a[1]*t,r[2]+a[2]*t)},i._37o=function(){delete n._flyAnim},n._flyAnim=rs(i)},flyTo:(N_=new ha,U_=new ha,G_=new ha,H_=new ha,W_=new fa,q_=new Gl.Math.Quaternion,X_=new pa,Q_=new da,function(t,e,i){var n=this;i!==H?e={animation:e,ratio:i}:("boolean"==(h=typeof e)||"object"==h&&e.duration)&&(e={animation:e}),e=e||{},N_.fromArray(n.getEye()),U_.fromArray(n.getCenter());var r,o,a=[],s=e.center,h=e.distance===H;if(s&&G_.fromArray(s),t instanceof Gl.Node)s||G_.fromArray(t.p3()),h&&(Em(a,n,t),r=a.length);else{if(!(t=t||n.dm().getDatas()).length)return;if((h||!s)&&(a=[],t.forEach(function(t){Em(a,n,t)}),!(r=a.length)))return;s||(Q_.setFromPoints(a),G_.copy(Q_.min).add(Q_.max).multiplyScalar(.5))}n.setCenter(G_.x,G_.y,G_.z),H_.subVectors(N_,U_),(e.direction||e.worldDirection)&&(!e.worldDirection&&t instanceof Gl.Node?q_.setFromEuler(X_.set(t.r3(),t.getRotationMode(),!0)):q_.set(0,0,0,1),t=H_.length(),H_.fromArray(e.worldDirection||e.direction).applyQuaternion(q_).setLength(t));var c=0;if(h){var l,u,d,i=e.ratio||.8,f=e.xRatio||i,g=e.yRatio||i;if(n.isOrtho()){var p=-1/0;for(n._eye[0]=H_.x+G_.x,n._eye[1]=H_.y+G_.y,n._eye[2]=H_.z+G_.z,l=qu(n),Uu(l,l,Wu(n)),o=0;o<r;o++)d=a[o],u=Qs([d.x,d.y,d.z,1],l),p=Math.max(p,Math.max(Math.abs(u[0])/f,Math.abs(u[1])/g));c=n.getOrthoWidth()*p,H_.add(G_)}else{for(var _,v,y=n.getNear(),m=10;m--;){for(n._eye[0]=H_.x+G_.x,n._eye[1]=H_.y+G_.y,n._eye[2]=H_.z+G_.z,l=qu(n),Uu(l,l,Wu(n)),_=!0,v=-1/0,o=0;o<r;o++){if(d=a[o],(u=Qs([d.x,d.y,d.z,1],l))[3]<y&&m){H_.multiplyScalar(2),_=!1;break}v=Math.max(v,Math.max(Math.abs(u[0])/f,Math.abs(u[1])/g)-u[3])}if(_)break}H_.setLength(v+H_.length()).add(G_)}}else H_.setLength(e.distance).add(G_);n._flyAnim&&n._flyAnim.stop(!0);e=Rn(e.animation);if(e){n.setEye(N_.x,N_.y,N_.z),n.setCenter(U_.x,U_.y,U_.z);var b,x=(new ha).subVectors(H_,N_),w=(new ha).subVectors(G_,U_);c&&(b=n.getOrthoWidth());var E=new ha,T=new ha,S=e.action,I=e._37o,C=N_.clone(),M=U_.clone();return e.action=function(t,e){E.copy(C).addScaledVector(x,t),T.copy(M).addScaledVector(w,t),n.setCenter(T.x,T.y,T.z),n.setEye(E.x,E.y,E.z),c&&n.setOrthoWidth((c-b)*t+b),S&&S(t,e)},e._37o=function(){delete n._flyAnim,I&&I()},{lastEye:N_,lastCenter:U_,eye:H_,center:G_,orthoWidth:c,animation:n._flyAnim=rs(e)}}return n.setEye(H_.x,H_.y,H_.z),c&&n.setOrthoWidth(c),delete n._flyAnim,{lastEye:N_,lastCenter:U_,eye:H_,center:G_,orthoWidth:c}}),getBoundingBox:(j_=new fa,function(t){if((t=t||this.sm().getSelection())instanceof Gl.Node&&(t=[t]),0===t.length)return U;var n=[];t.forEach(function(t){var e,i;wn(t)&&(e=n,i=this,t=t,j_.fromArray($s(t,i.getMat(t))),t=t.getAnchor3d(),e.push((new ha).set(0-t.x,0-t.y,0-t.z).applyMatrix4(j_)),e.push((new ha).set(0-t.x,0-t.y,1-t.z).applyMatrix4(j_)),e.push((new ha).set(0-t.x,1-t.y,0-t.z).applyMatrix4(j_)),e.push((new ha).set(0-t.x,1-t.y,1-t.z).applyMatrix4(j_)),e.push((new ha).set(1-t.x,0-t.y,0-t.z).applyMatrix4(j_)),e.push((new ha).set(1-t.x,0-t.y,1-t.z).applyMatrix4(j_)),e.push((new ha).set(1-t.x,1-t.y,0-t.z).applyMatrix4(j_)),e.push((new ha).set(1-t.x,1-t.y,1-t.z).applyMatrix4(j_)))},this);var e=[1/0,1/0,1/0],i=[-1/0,-1/0,-1/0];return n.forEach(function(t){e[0]=Math.min(t.x,e[0]),e[1]=Math.min(t.y,e[1]),e[2]=Math.min(t.z,e[2]),i[0]=Math.max(t.x,i[0]),i[1]=Math.max(t.y,i[1]),i[2]=Math.max(t.z,i[2])}),{min:e,max:i}}),setBatchInfo:function(t,e){var i=this._batchInfoMap[t];this._batchInfoMap[t]=e,this.fp("batchInfo",i,e)},getBatchInfo:function(t){return this._batchInfoMap[t]||Bi[t]}}),Bd.RenderEnv=function(t){this.gv=t,this.enable=!1},L.defineProperties(Bd.RenderEnv.prototype,{debugOn:{get:function(){return this._debugOn},set:function(t){this._debugOn=t,this.capture&&this.capture()}}}),L.assign(Bd.RenderEnv.prototype,{renderEnvToCube:function(t,e,d,i){var f=this,g=f.gv;if(!t||!e||!d)return f.enable=!1,void(f._42=null);f.enable=!0;var n=Math.floor(i/t*e),r=g.getGL(),p=f._renderTargets;p?p.length<d&&(p=f._renderTargets=p.concat(new Array(d-p.length))):p=f._renderTargets=new Array(d);for(var o=0;o<d;o++)p[o]?p[o].setSize(r,i,n):p[o]=new Bd.RenderTarget(g,r,i,n);var _=!1;f.capture=function(){_=!0,g._42(),_=!1};var v=new ha,y=new ha,m=new ha,b=new ha,x=(new ha).setY(0),w=2*Math.PI/d,E=t/2/Math.tan(Math.PI/d),T=2*Math.atan2(e/2,E),S=t/e;f._42=function(t,e,i,n){var r=f._debugOn;if(!_&&!r)return!1;v.copy(g.getEye()),b.copy(g.getCenter()).sub(v);var o=Math.atan2(b.z,b.x),a=g.getNear(),s=g.getFovy(),h=g.getAspect();y.copy(g.getCenter());for(var c,l,u=0;u<d;u++)c=p[u],x.setZ(Math.cos(o)).setX(Math.sin(o)).multiplyScalar(E),o-=w,m.addVectors(v,x),g.setNear(E),g.setCenter([m.x,m.y,m.z]),g.setFovy(T),g.setAspect(S),r?(l=Math.round(e/d),yu.for(t).glState.viewport=[l*u,0,l,i],n()):(wu(t,c.frame),yu.for(t).glState.viewport=[0,0,c.width,c.height],t.clear(t.COLOR_BUFFER_BIT),n(),Eu(t),c.assureTexture());return g.setNear(a),g.setCenter([y.x,y.y,y.z]),g.setFovy(s),g.setAspect(h),!0},f.capture()},getTextureInfo:function(t){if(!this._renderTargets)return null;var e=this._renderTargets[t];return e?{index:t,texture:e.texture,textureName:e.uuid}:null}}),L.assign(Bd.Graph3dView.prototype,{renderEnvToCube:function(t,e,i,n){this.envRenderer||(this.envRenderer=new Bd.RenderEnv(this)),this.envRenderer.renderEnvToCube(t,e,i,n)}}),Ig=["left","front","right","back","top","bottom"],Cg=Bd._RenderList=function(){var r=[],o=[],e={},i={},n={},a={},s={},h={},c={};return{opaque:r,transparent:o,init:function(){r.length=0,o.length=0,c={}},push:function(t,e){e&&function(t){var e,i,n,r,o=t.gv,a=t.data,s=t.shapeModel;if(s){var h,c,l=a.s("shape3d.transparent")||a.s("points.transparent");for(bn(s)||(h=xh(s.transparent,a,o),s=[s]),n=0,r=s.length;n<r;n++)c=s[n],(c=xh(c.transparent,a,o))===H&&(c=h),c===H&&(c=l),c?i=!0:e=!0}for(n=0,r=Ig.length;n<r;n++){var u=t[Ig[n]];u&&(u.transparent?i=!0:e=!0)}o.isLabelVisible(a)&&(t.labelInfo&&(a.s(jt+".transparent")?i=!0:e=!0),t.label2Info&&(a.s(Nt+".transparent")?i=!0:e=!0)),o.isNoteVisible(a)&&(t.noteInfo&&(a.s(Ut+".transparent")?i=!0:e=!0),t.note2Info&&(a.s(Gt+".transparent")?i=!0:e=!0)),t._38o&&(i=e=!0),i||(e=!0),t._renderParams={opaque:e,transparent:i}}(t);var i=t.data,n=i._id;c[n]||(c[n]=!0,(e=t._renderParams)&&!1!==e.visible&&(t={ui:t,data:i,z:i._z,id:n},e.opaque&&r.push(t),e.transparent&&o.push(t)))},batchModelMap:e,batchIndexMap:i,polylineModelMap:n,polylineIndexMap:a,wireframeModelMap:s,wireframeIndexMap:h,ivBatch:function(t){t?(Qd(e,i,t),Qd(n,a,t),Qd(s,h,t)):(e=this.batchModelMap={},i=this.batchIndexMap={},n=this.polylineModelMap={},a=this.polylineIndexMap={},s=this.wireframeModelMap={},h=this.wireframeIndexMap={}),this.markBatchInvalid()},ivModelBatch:function(t){t?Qd(e,i,t):(e=this.batchModelMap={},i=this.batchIndexMap={}),this.markBatchInvalid()},ivPolylineBatch:function(t){t?Qd(n,a,t):(n=this.polylineModelMap={},a=this.polylineIndexMap={}),this.markBatchInvalid()},ivWireframeBatch:function(t){t?Qd(s,h,t):(s=this.wireframeModelMap={},h=this.wireframeIndexMap={}),this.markBatchInvalid()},markBatchInvalid:function(){this._batchInvalid=!0},isBatchInvalid:function(){return this._batchInvalid},onUpdated:function(){this._batchInvalid=null},sort:function(){1<r.length&&r.sort(t),1<o.length&&o.sort(u)}}},Mg=Bd._RenderLists=function(){function i(t,e){var i=n[t=t||"main"];return!i&&e&&(i=n[t]=new Cg),i}var n={};return{init:function(){for(var t in n)n[t].init()},onUpdated:function(){for(var t in n)n[t].onUpdated()},get:i,push:function(t,e){i(t.data.getRenderLayer(),!0).push(t,e)},each:function(t){for(var e in n)t(n[e])},lists:n}},Rg=Bd.RenderTarget=function(t,e,i,n,r){(r=r||{}).samples=Math.min(t._glCapabilities.maxSamples,r.samples&&1<r.samples&&2===t._webGLVersion?r.samples:0),this.options=r,this.uuid=Gl.Math.generateUUID(),this.gv=t,this.init(t,e,r),r.samples&&!t._glCapabilities._maxSamplesChecked?this.setSize(e,i||1,n||1):this.setSize(e,i,n)},L.assign(Bd.RenderTarget.prototype,{bind:function(t){wu(t,this.options.samples?this._MSAAFbo:this.frame)},unbind:function(t){Eu(t),this.options.samples&&(t.bindFramebuffer(t.READ_FRAMEBUFFER,this._MSAAFbo),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.frame),t.blitFramebuffer(0,0,this.width,this.height,0,0,this.width,this.height,t.COLOR_BUFFER_BIT,t.NEAREST),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null))},init:function(t,e,i){var n=this.texture=e.createTexture();e.activeTexture(e.TEXTURE0),$u(e,n);var r=i.samples?e.NEAREST:e.LINEAR;e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,i.minFilter||r),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,i.magFilter||r),$u(e,null),this.render=e.createRenderbuffer(),this.frame=e.createFramebuffer(),t._2O[this.uuid]=n},assureTexture:function(){var t=this.uuid,e=this.gv._2O;e[t]||(e[t]=this.texture)},setSize:function(t,e,i){var n=this;if(e&&i&&(n.width!==e||n.height!==i)){var r=t.RGBA,o=t.TEXTURE_2D,a=t.RENDERBUFFER,s=t.FRAMEBUFFER,h=n.options.samples;if(t.activeTexture(t.TEXTURE0),$u(t,n.texture),t.texImage2D(o,0,r,e,i,0,r,t.UNSIGNED_BYTE,U),na.isPOT(e)&&na.isPOT(i)&&!n.options.clampToEdge?(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT)):(t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)),t.bindRenderbuffer(a,n.render),h){r=n.gv._glCapabilities;if(r._maxSamplesChecked)t.renderbufferStorageMultisample(a,h,t.DEPTH_COMPONENT16,e,i);else{for(t.getError();1<h&&(t.renderbufferStorageMultisample(a,h,t.DEPTH_COMPONENT16,e,i),t.getError());)h=Math.floor(h>>1);h<=1&&(h=0,t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n.options.minFilter||t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n.options.magFilter||t.LINEAR),t.renderbufferStorage(a,t.DEPTH_COMPONENT16,e,i)),r._maxSamplesChecked=!0,r.maxSamples=n.options.samples=h}}else t.renderbufferStorage(a,t.DEPTH_COMPONENT16,e,i);h&&!n._MSAAFbo&&(n._MSAAFbo=t.createFramebuffer(),n._MSAARbO=t.createRenderbuffer()),wu(t,n.frame),t.framebufferTexture2D(s,t.COLOR_ATTACHMENT0,o,n.texture,0),h||t.framebufferRenderbuffer(s,t.DEPTH_ATTACHMENT,a,n.render),Eu(t),h&&(t.bindRenderbuffer(t.RENDERBUFFER,n._MSAARbO),t.renderbufferStorageMultisample(t.RENDERBUFFER,h,t.RGBA8,e,i),wu(t,n._MSAAFbo),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,n._MSAARbO),t.framebufferRenderbuffer(s,t.DEPTH_ATTACHMENT,a,n.render),Eu(t)),$u(t,U),t.bindRenderbuffer(a,U),n.width=e,n.height=i}},toCanvas:function(){var t=this.gv.getGL();wu(t,this.frame);var e=this.width,i=this.height,n=new Uint8Array(4*e*i);t.readPixels(0,0,e,i,t.RGBA,t.UNSIGNED_BYTE,n),Eu(t);var r=d.createElement("canvas");r.width=e,r.height=i;t=r.getContext("2d"),i=t.createImageData(e,i);return i.data.set(n),t.putImageData(i,0,0),r}}),Ag=Bd.Interactor=function(t){this.gv=this.g3d=t},zd("Interactor",L,{ms_listener:1,getView:function(){return this.gv.getView()},setUp:function(){this.addListeners()},tearDown:function(){this.removeListeners()}}),Pg=Bd.DefaultInteractor=function(t){Bn(Pg,this,[t])},zd("DefaultInteractor",Ag,{getDataInfoAt:function(t,e){var i=this.gv,n=i.getDataInfoAt(t);if(!i.isBlockSelectable()||!n||!n.data)return n;if(!e&&i.isSelected(n.data))return n;for(var r=n.data;(r=r.getParent())&&r instanceof Gl.Block&&i.isSelectable(r);){var o=i.isSelected(r);if(o&&e)break;if(n={data:r,part:n},o&&!e)break}return n},handle_contextmenu:function(t){qa(t)},handle_mousewheel:function(t){this.gv.handleScroll(t,t.wheelDelta/40)},handle_DOMMouseScroll:function(t){2===t.axis&&this.gv.handleScroll(t,-t.detail)},handle_keydown:function(t){this.gv.handleKeyDown(t)},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(t){qa(t);var e=this,i=e.gv,n=cs(t),r=e.getDataInfoAt(t),o=r?r.data:U,a=r?r.part:U,s=i.sm(),h=Pr(t),r=ds(t);i.setFocus(t)&&(e._62O=U,e._57I=U,e.pendingClickThrough=U,e.__lastClientPoint__=_s(t),o?ps(t)?s.co(o)?s.rs(o):s.as(o):s.co(o)?o instanceof _l&&o.isClickThroughEnabled()&&cs(t)&&(e.pendingClickThrough=_s(t)):s.ss(o):n&&(ps(t)?i.isRectSelectable()&&(e._62O=oe):e._57I=_s(t)),e._31Q&&(ts(e._31Q),delete e._31Q,delete e._32Q),e._62O||(i.isFirstPersonMode()&&(gs(t)||ls(t)||2<r?e._62O="pan":i.isMouseRoamable()||Tr(t)?(e._62O="roaming",e.foward=h&&cs(t),e._32Q=sn(),e._31Q=$a(e.tick,e)):n||(e._62O="roaming")),e._62O||(n&&h&&Kg[a]?(e._62O=a,e.p3=o.p3()):n&&h&&wn(o)&&i.isSelected(o)?i.isMovable(o)?(e._62O="move",e.p3=o.p3(),e.movedata=o):i._39Q(o)&&(e._62O="none"):Tr(t)&&(2<r?e._62O="pan":2===r&&(e.dist=Ro(t),e._62O="pinch")))),e.point=i.lp(t),Rs(e,t),fs(t)?i.handleDoubleClick(t,o,a):i.handleClick(t,o,a))},tick:function(){var t=this.gv,e=t._moveStep;this.point&&t.isWalkable()&&(this._32Q&&(e*=(sn()-this._32Q)/50),t.walk(this.foward?e:-e),this._32Q=sn(),this._31Q=$a(this.tick,this))},handle_mouseup:function(t){this.handle_touchend(t)},handle_touchend:function(t){var e=this._57I;e&&(ys(e,_s(t))<=1&&this.gv.sm().cs(),this._57I=U),(e=this.pendingClickThrough)&&(ys(e,_s(t))<=1&&((e=this.getDataInfoAt(t))&&e.data instanceof _l&&e.data.isClickThroughEnabled()&&((e=this.getDataInfoAt(t,!0))&&(t.clickThrough=!0,this.gv.sm().ss(e.data)))),this.pendingClickThrough=null)},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(e){var i,n,t=this,r=t.gv,o=t._62O,a=t.point,s=r.dm(),h=r.lp(e),c=h.x-a.x,l=h.y-a.y,u=r.getWidth(),d=r.getHeight();if(u&&d){var f,g=_s(e),p=cc(r,g,t.__lastClientPoint__),_=ys({x:0,y:0},p),v=-J*c/u,y=-J*l/d;if("roaming"===o)t.rotate(e,v/2,y/2);else if(o===Wg||o===qg||o===Xg)r._86O||s.beginTransaction(),r.fi({kind:r._86O?"betweenEditRotation":"beginEditRotation",event:e}),r._86O=1,r.sm().each(function(t){var e;wn(t)&&r.isRotationEditable(t)&&(e=X(v)>X(y)?v:y,o===Wg?t.setRotationX(t.getRotationX()+e):o===qg?t.setRotationY(t.getRotationY()+e):o===Xg&&t.setRotationZ(t.getRotationZ()+e))});else if("move"===o||Kg[o]){if(o===Qg||o===Yg||o===Zg)r._87O||s.beginTransaction(),r.fi({kind:r._87O?"betweenEditScale":"beginEditScale",event:e}),r._87O=1;else{if(!r._moving){if(_<G.touchMoveThreshold)return;s.beginTransaction()}r.fi({kind:r._moving?"betweenMove":"beginMove",event:e}),r._moving=1}var m,b,x=t.p3,g=r.getPositionInfo(x),p=Wu(r),_=o===Ug?"x":o===Gg?"y":o===Hg?"z":o===Qg?"sx":o===Yg?"sy":o===Zg?"sz":r.getMoveMode(e,t.movedata),c=c/u*g.width,l=-1*l/d*g.height,s=[p[0]*c,p[4]*c,p[8]*c],u=[p[1]*l,p[5]*l,p[9]*l],d=s[0]+u[0],g=s[1]+u[1],p=s[2]+u[2],s=[x[0]+d,x[1]+g,x[2]+p],u=Ns(r.getEye(),s,!0);if("xyz"===_?(m=s,r.moveSelection(d,g,p)):"xz"===_?(m=zu(r,x,[0,1,0],s))&&r.moveSelection(m[0]-x[0],0,m[2]-x[2]):"xy"===_?(m=zu(r,x,[0,0,1],s))&&r.moveSelection(m[0]-x[0],m[1]-x[1],0):"yz"===_?(m=zu(r,x,[1,0,0],s))&&r.moveSelection(0,m[1]-x[1],m[2]-x[2]):"x"===_||"sx"===_?(u[0]=0,(m=zu(r,x,u,s))&&(b=m[0]-x[0],"x"===_?r.moveSelection(b,0,0):r.sm().each(function(t){wn(t)&&r.isSizeEditable(t)&&(i=t.getScaleX()+b/100,n=i/t.getScaleX(),t.setScaleX(i),gs(e)&&(t.setScaleY(t.getScaleY()*n),t.setScaleTall(t.getScaleTall()*n)))}))):"y"===_||"sy"===_?(u[1]=0,(m=zu(r,x,u,s))&&(b=m[1]-x[1],"y"===_?r.moveSelection(0,b,0):r.sm().each(function(t){wn(t)&&r.isSizeEditable(t)&&(i=t.getScaleTall()+b/100,n=i/t.getScaleTall(),t.setScaleTall(i),gs(e)&&(t.setScaleY(t.getScaleY()*n),t.setScaleX(t.getScaleX()*n)))}))):"z"!==_&&"sz"!==_||(u[2]=0,(m=zu(r,x,u,s))&&(b=m[2]-x[2],"z"===_?r.moveSelection(0,0,b):r.sm().each(function(t){wn(t)&&r.isSizeEditable(t)&&(i=t.getScaleY()+b/100,n=i/t.getScaleY(),t.setScaleY(i),gs(e)&&(t.setScaleX(t.getScaleX()*n),t.setScaleTall(t.getScaleTall()*n)))}))),!m)return;t.p3=m}else o===oe?((f=t.div)||(f=t.div=tr(),or(t.getView(),f),f.op=a,f.style.background=r.getRectSelectBackground()),r.fi({kind:r._rectSelecting?"betweenRectSelect":"beginRectSelect",event:e}),r._rectSelecting=1,f.rect=ms(f.op,h),wr(f,f.rect)):"pinch"===o&&2===ds(e)?(r.fi({kind:r._pinching?"betweenPinch":"beginPinch",event:e}),r._pinching=1,b=Ro(e),r._lastZoomLP||(r._lastZoomLP=(a=(m=e).touches[0],f=m.touches[1],m=a.clientX,a=a.clientY,{x:(m+f.clientX)/2,y:(a+f.clientY)/2})),r.handlePinch(b,t.dist),t.dist=b):"pan"===o||gs(e)||ls(e)?t.pan(e,c,l):"none"===o||r.isFirstPersonMode()||t.rotate(e,v,y);t.point=h}},pan:function(t,e,i){var n,r,o=this.gv;o.isPannable()&&(r=o.getWidth(),n=o.getHeight(),r&&n&&(r=e/r*(e=o.getCenterInfo()).width,e=-1*i/n*e.height,o.fi({kind:o._panning?"betweenPan":"beginPan",event:t}),o._panning=1,o.pan(-r,-e)))},rotate:function(t,e,i){var n=this.gv;n.isRotatable()&&(n.fi({kind:n._rotating?"betweenRotate":"beginRotate",event:t}),n._rotating=1,n.rotate(e,i))},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},handleWindowTouchEnd:function(t){var e,i,n,r=this,o=r.gv,a=o.dm(),s=r.div;s&&((e=o.getDatasInRect(s.rect)).isEmpty()||(i=o.sm(),n=i.toSelection(),e.each(function(t){i.co(t)?n.remove(t):n.add(t)}),i.ss(n)),As(s)),o._moving&&(delete o._moving,o.fi({kind:"endMove",event:t}),o.onMoveEnded(),a.endTransaction()),o._panning&&(delete o._panning,o.fi({kind:"endPan",event:t}),o.onPanEnded()),o._rotating&&(delete o._rotating,o.fi({kind:"endRotate",event:t}),o.onRotateEnded()),o._86O&&(delete o._86O,o.fi({kind:"endEditRotation",event:t}),a.endTransaction()),o._87O&&(delete o._87O,o.fi({kind:"endEditScale",event:t}),a.endTransaction()),o._pinching&&(delete o._pinching,o.fi({kind:"endPinch",event:t}),o.onPinchEnded()),o._rectSelecting&&(delete o._rectSelecting,o.fi({kind:"endRectSelect",event:t}),o.onRectSelectEnded()),o._walking&&(delete o._walking,o.fi({kind:"endWalk",event:t}),o.onWalkEnded()),o._lastZoomLP=o._lastZoomHit=null,r.dist=r.point=r._62O=r.p3=r.movedata=r.div=r._57I=r.pendingClickThrough=r._32Q=r._31Q=r.foward=U,r.__lastClientPoint__=U}}),Dg=Bd.MapInteractor=function(t){Bn(Dg,this,[t]),this._keepHorizon=!0,this._threshold=2,this._touchScaleThreshold=.05,this._touchRotateThreshold=.03,this._touchScaleCheckAccuracy=.01,this._panButton="right",this.maxPhi=5*Math.PI/12},zd("MapInteractor",Ag,{handle_contextmenu:function(t){qa(t)},handle_mousewheel:function(t){this.gv.handleScroll(t,t.wheelDelta/40)},handle_DOMMouseScroll:function(t){2===t.axis&&this.gv.handleScroll(t,-t.detail)},handle_keydown:function(t){this.gv.handleKeyDown(t)},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(t){qa(t);var e,i,n,r=this.gv;r.setFocus(t)&&(e=(n=r.getDataInfoAt(t))?n.data:U,i=n?n.part:U,n=this.editing={point:r.lp(t)},Tr(t)?n.touch=!0:(n.touch=!1,n.clickLeft=cs(t),n.pan=!!ls(t)||"left"===this.panButton===n.clickLeft),e&&r._39Q(e)&&(n.preventDefault=!0),Rs(this,t),fs(t)?r.handleDoubleClick(t,e,i):r.handleClick(t,e,i))},handle_mouseup:function(t){this.handle_touchend(t)},handle_touchend:function(){},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){var e=this,i=e.gv,n=e.editing;if(n){var r,o,a,s,h,c,l,u,d,f,g,p=i.lp(t),_=n.point,v=p.x-_.x,y=p.y-_.y;if(!n.moved){if(Math.abs(v)<e.threshold&&Math.abs(y)<e.threshold&&!(t.touches&&1<t.touches.length))return;n.moved=!0}n.preventDefault||(n.point=p,n.touch?2!==(c=t.touches.length)?e.pan(t,v,y):c<=1||(r=(d=t.touches)[0].clientX,o=d[0].clientY,f={x:(a=d[1].clientX)-r,y:(s=d[1].clientY)-o},g=n.lastCenter,u=Math.atan2(f.y,f.x),h=0,(_=n.theta)==U?_=n.theta=u:(h=u-_,n.thetaStarted||Math.abs(h)>e.touchRotateThreshold?(n.thetaStarted=!0,n.theta=u):h=0),p=P*(o+s)/2/i.getHeight(),c=0,(d=n.phi)==U?d=n.phi=p:(c=p-d,n.phiStarted||Math.abs(c)>e.touchRotateThreshold?(n.phiStarted=!0,n.phi=p):c=0),_=Math.sqrt(f.x*f.x+f.y*f.y),(u=n.vlen)?(d=r-g.x,p=o-g.y,f=a-g.x,g=s-g.y,p=Math.sqrt(d*d+p*p),f=Math.sqrt(f*f+g*g),g=u/2,(p=e._sign2(p-g))*(g=e._sign2(f-g))<0||0===p&&0===g?(l=1,n.vlen=_):(l=l||_/u,n.scaleStarted||Math.abs(l-1)>e.touchScaleThreshold?(n.vlen=_,n.scaleStarted=!0):l=1)):(u=n.vlen=_,l=1),1!==l&&i.setZoom(l),(c||h)&&e.rotate(t,h,-c),n.lastCenter={x:(a+r)/2,y:(s+o)/2}):n.pan?e.pan(t,v,y):(n=i.getWidth(),i=i.getHeight(),n&&i&&(n=-J*v/n,i=-J*y/i,e.rotate(t,n,i))))}},_sign2:function(t){return Math.abs(t)<this._touchScaleCheckAccuracy?0:0<t?1:-1},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},handleWindowTouchEnd:function(t){var e,i=this.editing;this.editing=null,i&&(e=this.gv,i.moved||!i.clickLeft&&!i.touch?(e._panning=null,e._rotating=null,e.fi({kind:i.pan?"endPan":"endRotate",event:t})):(t=e.getDataAt(t))?e.sm().setSelection([t]):e.sm().clearSelection())},pan:function(t,e,i){var n=this.gv;if(n.isPannable()){var r=n.getWidth(),o=n.getHeight();if(r&&o){var a=n.getCenterInfo(),r=-e/r*a.width,i=+i/o*a.height;n.fi({kind:n._panning?"betweenPan":"beginPan",event:t}),n._panning=1;o=this.keepHorizon,a=this.editing.touch;if((a&&t.touches&&1<t.touches.length||!a&&gs(t))&&(o=!o),!o)return n.pan(r,i);(r||i)&&(t=[(a=Wu(n))[0]*r,a[4]*r,a[8]*r],o=[a[1],0,a[9]],(r=Math.sqrt(o[0]*o[0]+o[2]*o[2]))&&(o=[o[0]/r*i,0,o[2]/r*i]),a=t[0]+o[0],r=t[1]+o[1],i=t[2]+o[2],t=n._center,o=n._eye,t[0]+=a,t[1]+=r,t[2]+=i,o[0]+=a,o[1]+=r,o[2]+=i,n.fp(dt,U,o),n.fp(ut,U,t))}}},rotate:function(t,e,i){var n,r,o=this.gv;o.isRotatable()&&(r=o._center,n=o._eye,r=Ns(n,r),r=T(W(r[0]*r[0]+r[2]*r[2]),r[1]),i=Ou(o,r+i)-r,o.fi({kind:o._rotating?"betweenRotate":"beginRotate",event:t}),o._rotating=1,o.rotate(e,i))}}),L.defineProperties(Dg.prototype,{panButton:{get:function(){return this._panButton},set:function(t){this._panButton=t}},minPhi:{get:function(){return this.gv.getRotateMinPhi()},set:function(t){this.gv.setRotateMinPhi(t)}},maxPhi:{get:function(){return this.gv.getRotateMaxPhi()},set:function(t){this.gv.setRotateMaxPhi(t)}},keepHorizon:{get:function(){return this._keepHorizon},set:function(t){this._keepHorizon=t}},threshold:{get:function(){return this._threshold},set:function(t){this._threshold=t}},touchScaleThreshold:{get:function(){return this._touchScaleThreshold},set:function(t){this._touchScaleThreshold=t}},touchRotateThreshold:{get:function(){return this._touchRotateThreshold},set:function(t){this._touchRotateThreshold=t}}}),Bg=Bd.GlobeInteractor=function(f,t){Bn(Bg,this,[f]);var o,g=t.radius||6378137,s=this,p=null;Og||((Og=tr()).style.border="",Og.style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEyUlEQVRYR62XW0xcVRSG/58cmIG2HmstE9N4SX2xtVqBCISoFS/RmDSpKQSvTWNixUStQSqVyBQYJUGttrQVtYkPatuQPmhivMUHqbUBZ2itl1qjTzZpImNUZhDLsUeWWXgOOd2cgcGyk3mYs/de69trr70uxP8YIlJKMi0i9wIgyf0iEiM5PFdxzGeDiBQAuB7AjQBuALCN5NcGQDmANgBfeL8UyYnZ5M8KICJ3AXgAwAlfOMl/VHAQwPtveYAKuQLA2yQ/ngliRgAR2QogA2AvSdcUZAIE50VEYR4BsIDkC7kgQgFE5GIAuwDsJnkk1+aZAPw9IqLX1gjgcZK/m7KmAXjK4wBaSf4ZplxEIgCuA3Cz3gSAfgDHSf6dY/0FAJ4D0G5ChAEcAPBwmHIRqXNd90nLsiocx/k+k8n8oK/Atu2rIpHIStd1v7QsawfJd0Ouywawh6T609Q4B8C788NhZnddt29sbGxBd3f39q6urtNhJ43H48uam5u3lJSUjFiWdV8IxE0Aqki+6M9NAXjefjnJXsOZogBGBgYGttbU1Hw427PS+cHBwbVVVVUJAItJOoa8xwD8RPIT/T4J4L3zfQAeNL1dRMZra2ur+/v7/8pHub+mvr7+wr6+vs8KCgoWGABFAN4EsEHjhA9QBeA2ks8HF6vZk8nkQL4nNwGTyeTa8vLycsuy7jcg1Mk/IpnyAZoBaOQ6FHg+ddlsdqNt201zObm5NpvN7ly0aNHrJN8LyL4FwGqSr/gAOrnej3C60HXdw/F4PJ7L4fKFSiQSl7W0tLQVFRWtCQDoNRwguZ6aWABcorE9sEDf+QjJ1fkqmmmdiHwHoCToXyKiceR0rkhY5TjOq9FoVLPdeY/x8fG+SCSySe/cFKYWCFOyPJ1Or4zFYh3nrR3A8PBwe2lp6TcAfg4DmBYwAFyRTqdXxWKx9nkE+DYUIEyBiFQ6jvNaNBq9Zz4AZruCGIBlJI8ZXpolee18AORwwgoAp/xnqMmjPuilZ8+ePZRIJNo7OztD436+YB0dHZe2trY+W1hYWGsccD/JOh/gKQBHSWpanRwicnc2m91k2/bmfJWFrRsdHd29cOHCXSTfD8i+FcA1JHcEQ/HtJDVnTw3XdfcPDQ0dra6unto8F5hUKrWurKxslWVZG4L7RGQbgA9IDgWT0VsANprJaGJi4kxDQ8OagwcPjsxFeWNj49Le3l6N91qMTA2vmNnr6fovGXkmvxPAlST3hGz4LZVKbausrMzLEnryioqKNpJLzCpJRJ4AcJLkp6rHLEieBjBA8rB5Wtd1942NjS3p6el5qa2t7VSYNdThmpqaWoqLi38xze4dUku4CpLb/f1hJZnWBY+SzJpKRGSdV5LVOI5zIpPJnNQ1tm2viEQiV7uue8SyrJeDDhew8GIAO0me4w9hABdp8ahNBkktyacNr+Qu84pSndfX81VY6e6dXJV3AoiT/CMoMFcyUogeAG+Q/DyX8+VZlqvZHwKw2VQ+zQdCTL4FwBkPZFrJPUtjoildG5PC4J2bOvJpze7QWhHAj4HWbBImpDXTQsPvH5cDeMf39lxWnBXAU6TNqcZu7fn0lyB53GhOdf6ZQHN6bF6a0xxOuJTkrwbA5LdcJ831/V8SOUYQxYGhRwAAAABJRU5ErkJggg==)");function n(t){return f._81O=null,t=f.getHitPosition(t,f.getCenter(),u.copy(f.getEye()).sub(v.copy(f.getCenter())).toArray()),d.origin.copy(f.getEye()),d.direction.copy(t).sub(d.origin).normalize(),d.intersectEllipsoid(y)}function _(t,e){var i;p&&(i=Date.now(),p.deltaTime=p.lastTime?i-p.lastTime:1e3,p.lastTime=i,p.lastAxis=t,p.lastAngle=e),e&&(r.setFromAxisAngle(t,e),f.setEye(u.copy(f.getEye()).applyQuaternion(r).toArray()),f.setCenter(u.copy(f.getCenter()).applyQuaternion(r).toArray()),f.setUp(u.copy(f.getUp()).applyQuaternion(r).toArray()))}var r=new aa,u=new ha,v=new ha,h=new ha,d=new ua,a="number"==typeof g?{x:g,y:g,z:g}:g,y={center:new ha(0,0,0),radius:a};s._showCrossIcon=function(t){or(s.getView(),Og),wr(Og,{x:t.clientX-16,y:t.clientY-16,width:32,height:32})},s._hideCrossIcon=function(){As(Og)},s._scrollImpl=function(t,e){(p={point:f.lp(t),screen:_s(t),hit:n(t),type:"right"}).hitNormalize=p.hit?p.hit.clone().normalize():new ha;e={clientX:p.screen.x,clientY:p.screen.y+10*e};s._handleMoveImpl(e),s._endMoveImpl(e)},s._startMoveImpl=function(t){o&&(o.stop(!0),o=null),(p={point:f.lp(t),screen:_s(t),hit:n(t)}).hitNormalize=p.hit?p.hit.clone().normalize():new ha,Tr(t)?1===t.touches.length?p.hit&&(p.type="left"):2===t.touches.length&&(p.type="touch2"):(cs(t)?p.hit&&(p.type="left"):us(t)?p.type="right":ls(t)&&p.hit&&(p.type="middle"),!p.hit||"right"!==p.type&&"middle"!==p.type||s._showCrossIcon(t)),p.type&&Rs(s,t)},s._handleMoveImpl=function(t){if(p)switch(p.type){case"left":return s._handleLeft(t);case"right":return s._handleRight(t);case"middle":return s._handleMiddle(t);case"touch2":return s._handleTouch2(t)}},s._endMoveImpl=function(){var i,n,r;p&&(this._hideCrossIcon(),"left"!==p.type&&"middle"!==p.type||(i=p.lastAngle/(p.deltaTime||30)*1e3,n=p.lastAxis,r=p.lastTime,o=rs({action:function(){var t,e;t=Date.now(),e=(t-r)/1e3,r=t,i*=Math.pow(Math.abs(s.decelerationRate),3*e),Math.abs(i)<.01?(i=0,o&&o.stop()):_(n,i*e)},duration:5e3})),p=null)},s._handleLeft=function(t){if(!p.finished){var e=_s(t),i=function(t,e){f._81O=null,d.origin.copy(f.getEye());for(var i,n,r=f.getCenter(),o=u.copy(f.getEye()).sub(v.copy(f.getCenter())).toArray(),a=1,s=16,h=0,c=1,l={x:0,y:0};s--;){if(l.x=e.x+(t.x-e.x)*a,l.y=e.y+(t.y-e.y)*a,i=f.getHitPosition(l,r,o),d.direction.copy(i).sub(d.origin).normalize(),(n=d.intersectEllipsoid(y))&&1===a)return{hit:n};n?h=a:c=a,a=(h+c)/2}return{hit:n,out:a<1}}(e,p.lastScreen||p.screen);if(p.lastScreen=e,!i.hit)return p.finished=!0,void s._endMoveImpl(t);var n=i.hit;n.normalize();var r=p.hitNormalize,e=Math.acos(n.dot(r)),r=n.cross(r).normalize();_(r,e),i.out&&(p.finished=!0,s._endMoveImpl(t))}},s._handleRight=function(t){var e=(p.lastScreen||p.screen).y,i=(p.lastScreen=_s(t)).y-e;i&&(t=Math.min(.5,i*s.scaleSpeed),u.copy(f.getEye()),e=(e=p.hit)||u.clone().divide(a).normalize().multiply(a),v.copy(u).lerp(e,t),f.setEye(v.toArray()),u.copy(f.getUp()),v.normalize(),i=u.clone().cross(v).normalize(),h.copy(f.getCenter()),h.sub(i.multiplyScalar(h.dot(i))),f.setCenter(h.toArray()),p.hit&&(e=n(p.screen),t=p.hitNormalize,e&&(e.normalize(),i=Math.acos(e.dot(t)),t=e.cross(t).normalize(),i&&_(t,i))))};function m(t){return Math.abs(t)<.01?0:0<t?1:-1}s._handleTouch2=function(t){var e,i,n,r,o,a,s,h,c,l,u,d;2===t.touches.length&&(e=(h=t.touches)[0].clientX,i=h[0].clientY,d={x:(n=h[1].clientX)-e,y:(r=h[1].clientY)-i},u=p.lastCenter,c=Math.atan2(d.y,d.x),o=0,(l=p.theta)==U?l=p.theta=c:(o=c-l,p.thetaStarted||.03<Math.abs(o)?(p.thetaStarted=!0,p.theta=c):o=0),s=Math.sqrt(d.x*d.x+d.y*d.y),(t=p.vlen)?(h=e-u.x,l=i-u.y,c=n-u.x,u=r-u.y,l=Math.sqrt(h*h+l*l),c=Math.sqrt(c*c+u*u),(l=m(l-(u=t/2)))*(u=m(c-u))<0||0===l&&0===u?(a=1,p.vlen=s):(a=a||s/t,p.scaleStarted||.05<Math.abs(a-1)?(p.vlen=s,p.scaleStarted=!0):a=1)):(t=p.vlen=s,a=1),d=v.copy(f.getEye()).clone(),1!==a&&f.setEye(d.setLength((d.length()-g)/a+g).toArray()),o&&_(d.normalize(),o),p.lastCenter={x:(n+e)/2,y:(r+i)/2})},s._handleMiddle=function(t){var e=_s(t),i=p.screen,n=((p.screen=e).y-i.y)/180*Math.PI*s.rollSpeed;v.copy(f.getCenter()).sub(u.copy(f.getEye())).normalize(),u.copy(f.getUp()).cross(v).normalize(),v.copy(f.getEye()).sub(p.hit).applyAxisAngle(u,n).add(p.hit);var r=v.clone();v.copy(f.getCenter()).sub(p.hit).applyAxisAngle(u,n).add(p.hit);var o=v.clone(),a=v.copy(f.getUp()).applyAxisAngle(u,n).clone(),t=!1;0<n&&(h.copy(a),v.copy(o).sub(r).normalize(),u.copy(r).multiplyScalar(-1).normalize(),0<u.dot(h)-v.dot(h)&&(t=!0)),t||0<=h.copy(p.hit).sub(r).dot(p.hitNormalize)&&(t=!0),t||(f.setEye(r.toArray()),f.setCenter(o.toArray()),f.setUp(a.toArray()));i=-(e.x-i.x)/180*Math.PI*s.rotateSpeed;_(p.hitNormalize,i)}},zd("GlobeInteractor",Ag,{handle_contextmenu:function(t){qa(t)},handle_mousewheel:function(t){this._scrollImpl(t,t.wheelDelta/40)},handle_DOMMouseScroll:function(t){2===t.axis&&this._scrollImpl(t,-t.detail)},handle_keydown:function(t){this.gv.handleKeyDown(t)},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(t){qa(t);var e,i,n=this.gv;n.setFocus(t)&&((e=(i=n.getDataInfoAt(t))?i.data:U)&&n.isInteractive(e)||this._startMoveImpl(t),i=i?i.part:U,fs(t)?n.handleDoubleClick(t,e,i):n.handleClick(t,e,i))},handle_mouseup:function(t){this.handle_touchend(t)},handle_touchend:function(){},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){this._handleMoveImpl(t)},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},handleWindowTouchEnd:function(t){this._endMoveImpl(t)}}),L.defineProperties(Bg.prototype,{rotateSpeed:{get:function(){return this._rotateSpeed||.3},set:function(t){this._rotateSpeed=t}},rollSpeed:{get:function(){return this._rollSpeed||.1},set:function(t){this._rollSpeed=t}},scaleSpeed:{get:function(){return this._scaleSpeed||.002},set:function(t){this._scaleSpeed=t}},decelerationRate:{get:function(){return this._decelerationRate||.04},set:function(t){this._decelerationRate=t}}}),zg=function(t){t|=2147483648;return[(255&t>>16)/255,(255&t>>8)/255,(255&t)/255,(255&t>>24)/255]},zs(Vg=function(t){this.gv=t,this.gv.pickColorMap={_pickIdUsed:1e3}},L,{_iv:!0,iv:function(){this._iv=!0},get:function(t,e){this.validate();var i=this.gv.getGL();if(!i)return U;var n,r,o=this._resolution,a=Math.round(t.x*o),s=Math.ceil(t.width*o),h=Math.ceil(t.height*o),o=this.height-Math.round(t.y*o)-h,c=k(s/2),l=new Uint8Array(4*s*h),u=0,d=l.length,f=e?U:new Lh,g=e?U:{};if(wu(i,this.frame),i.readPixels(a,o,s,h,i.RGBA,i.UNSIGNED_BYTE,l),Eu(i),e){for(;u<=c;u++)for(var p=c-u,_=c+u,v=p;v<=_;v++)for(var y=p;y<=_;y++)if((v===p||v===_||y===p||y===_)&&(n=this.info(l,4*(v*s+y))))return n}else for(;u<d;u+=4)(n=this.info(l,u))&&(g[(r=n.data)._id]||(f.add(r),g[r._id]=r));return f},info:function(t,e){return this.gv.pickColorMap[(t[e]<<16)+(t[e+1]<<8)+t[e+2]+((127&t[e+3])<<24)]},getResolution:function(){return this._resolution},onContextLost:function(){this.texture=null,this.width=this.height=-1},validate:function(){var t,e,i,n,r,o,a,s=this,h=s.gv,c=h.getGL();c&&(o=s._resolution=h._pickerResolution*h.getDevicePixelRatio(),t=Math.round(o*h.getWidth()),e=Math.round(o*h.getHeight()),i=c.RGBA,n=c.TEXTURE_2D,r=c.RENDERBUFFER,o=c.FRAMEBUFFER,s.texture||(s.texture=Qu(c),s.render=c.createRenderbuffer(),s.frame=c.createFramebuffer()),s.width===t&&s.height===e||(c.activeTexture(c.TEXTURE0),$u(c,s.texture),c.texImage2D(n,0,i,t,e,0,i,c.UNSIGNED_BYTE,U),td(c,c.TEXTURE_MIN_FILTER,c.LINEAR),c.bindRenderbuffer(r,s.render),c.renderbufferStorage(r,c.DEPTH_COMPONENT16,t,e),wu(c,s.frame),c.framebufferTexture2D(o,c.COLOR_ATTACHMENT0,n,s.texture,0),c.framebufferRenderbuffer(o,c.DEPTH_ATTACHMENT,r,s.render),$u(c,U),c.bindRenderbuffer(r,U),Eu(c),s.width=t,s.height=e),s._iv&&(a=s._iv=!1,h._40Q.each(function(t){!a&&t.isBatchInvalid()&&(a=!0)}),a&&h.updateScene(),wu(c,s.frame),c.clear(c.COLOR_BUFFER_BIT),h.overlappingBox.clear(),h.setViewport(c,0,0,t,e),h.renderPickScene(),Eu(c)))}}),zs(Lg=function(t){this.gv=t},L,{gap:0,size:0,_42:function(t,e){var i=this,n=i.gv,r=n._gridGap,o=n._gridSize;if(n._gridVisible){if(i.gap!==r||i.size!==o){for(var a=[],s=n._gridSize/2,h=r*s,c=0;c<2*s+1;c++){var l=6*c,u=6*(2*s+1)+l;a[l]=-h,a[1+l]=0,a[2+l]=c*r-h,a[3+l]=h,a[4+l]=0,a[5+l]=c*r-h,a[u]=c*r-h,a[1+u]=0,a[2+u]=-h,a[3+u]=c*r-h,a[4+u]=0,a[5+u]=h}i.vs=new js(a),i.gap=r,i.size=o}xd(n),rd(t),hd(t),ld(t,0,1,n._gridColor,n._buffer.vs,i.vs),ud(t,0,i.vs.length/3,t.LINES),cd(t),od(t)}else i.vs=i.gap=i.size=U}}),zs(Fg=function(t){this.gv=t},L,{_42:function(t,e){var i,n,r,o,a,s,h=this.gv,c=h._buffer.vs,l=h._axisXColor,u=h._axisYColor,d=h._axisZColor,f=h._originAxisVisible,g=h._centerAxisVisible;(f||g)&&(o=A?t.TRIANGLES:t.TRIANGLE_FAN,i=t.LINES,xd(h),rd(t),hd(t),f&&(a=h.getCenterInfo(),s=q(a.width,a.height)/5,ld(t,0,1.5,l,c,new js([0,0,0,s,0,0,r=.8*s,n=.05*s,0,r,0,n,r,-n,0,r,0,-n,r,n,0,0,0,0,0,s,0,n,r,0,0,r,n,-n,r,0,0,r,-n,n,r,0,0,0,0,0,0,s,n,0,r,0,n,r,-n,0,r,0,-n,r,n,0,r])),ud(t,0,2,i),ud(t,1,6,o),ld(t,0,U,u),ud(t,7,2,i),ud(t,8,6,o),ld(t,0,U,d),ud(t,14,2,i),ud(t,15,6,o)),g&&(r=(n=h._center)[0],o=n[1],g=n[2],a=h.getPositionInfo(n),s=q(a.width,a.height)/20,ld(t,0,1.5,l,c,new js([r,o,g,r+s,o,g,r,o,g,r,o+s,g,r,o,g,r,o,g+s])),ud(t,0,2,i),ld(t,0,U,u),ud(t,2,2,i),ld(t,0,U,d),ud(t,4,2,i)),cd(t),od(t))}}),(kg=function(t){this.gv=t,this.onMouseOver=this.onMouseOver.bind(this),this.mode=kg.Mode.Style,this.color=H,this.width=H}).Mode={Disable:0,Selection:1,MouseOver:2,Style:3},zs(kg,L,{onMouseOver:function(t){G.preventDefault(t);t=this.gv.getDataAt(t);t!==this.mouseOverData&&(this.mouseOverData=t,this.gv.iv())},setFetchTargetFunc:function(t){this.fetchTargetFunc=t},_42:function(t,e){var i,n,r=this,o=r._mode,a=r.gv;if(!t._renderInfo.reflectDepth&&o!==kg.Mode.Disable){if(o===kg.Mode.Selection?i=a.sm().getSelection().toArray(function(t){return t.s("highlight.visible")}):o===kg.Mode.MouseOver&&r.mouseOverData&&r.mouseOverData.s("highlight.visible")&&(i=[r.mouseOverData]),r.fetchTargetFunc&&(i=r.fetchTargetFunc(i)),o===kg.Mode.Style)i=i||[],n=function(t){if(0<=i.indexOf(t))return!1;var e=a.getDataHighlightMode(t);return!1===e||!0!==e&&("selected"===e?!a.isSelected(t):"hover"!==e||t!==r.mouseOverData)};else{if(!i||!i.length)return;n=function(t){return i.indexOf(t)<0||void 0}}var s=(a=r.gv).vr.isPresenting(),h=a.getWidth();s&&(d=a.getWidth,h/=2,a.getWidth=function(){return h},f=a.getViewport());var c=a.getDevicePixelRatio(),l=h*c,o=a.getHeight()*c;(c=r._renderTarget)?c.setSize(t,l,o):r._renderTarget=c=new Bd.RenderTarget(a,t,l,o),wu(t,c.frame),t.clear(t.COLOR_BUFFER_BIT),a.setViewport(t,0,0,l,o);var u=[];i.forEach(function(t){t=t.getRenderLayer();u.indexOf(t)<0&&u.push(t)}),a.drawFilter=n,a.renderPickScene(),a.drawFilter=null,Eu(t),A&&yd(t,e.aPosition),yd(t,e.aNormal),s&&(a.getWidth=d,a.setViewport(t,f[0],f[1],f[2],f[3]));var d=t._compiledShader.highlight;(d=d||(t._compiledShader.highlight=new Zf.Shader(t,jg.vs,jg.fs))).bind();var f=yu.for(t).directState();f.blend.enabled=!0,t.activeTexture(t.TEXTURE0+0),$u(t,c.texture),d.uniforms.image=0,d.uniforms.textureSize=[l,o],d.uniforms.edgeWidth=a.getHighlightWidth();o=a.getHighlightColor();r._lastHighlightColor!==o&&(o=$r(r._lastHighlightColor=o),r._highlightColorData=[o[0]/255,o[1]/255,o[2]/255,o[3]/255]),d.uniforms.edgeColor=r._highlightColorData,r.ibuffer?(r.ibuffer.upload(),r.vbuffer.upload()):(r.ibuffer=Zf.Buffer.createIndexBuffer(t,new Uint16Array([0,2,1,1,2,3])),r.vbuffer=Zf.Buffer.createVertexBuffer(t,new Float32Array([0,0,1,0,0,1,1,1]))),d.attributes.pos.pointer(r.vbuffer),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),f.blend.enabled=!1,$u(t,null),t.useProgram(e),A&&(t=t,(e=e.aPosition)!=U&&0<=e&&t.enableVertexAttribArray(e))}}}),L.defineProperties(kg.prototype,{mode:{get:function(){return this._mode},set:function(t){var e=this._mode;t!==e&&((this._mode=t)===kg.Mode.MouseOver||t===kg.Mode.Style?g(this.gv.getView(),"mousemove",this.onMouseOver):e!==kg.Mode.MouseOver&&e!==kg.Mode.Style||p(this.gv.getView(),"mousemove",this.onMouseOver))}}}),jg={vs:["attribute vec2 pos;","varying vec2 vUv;","void main(void) {","gl_Position = vec4(pos.x * 2.0 - 1.0, -pos.y * 2.0 + 1.0, 0.0, 1.0);","vUv = vec2(pos.x, 1.0 - pos.y);","}"].join("\n"),fs:["precision highp float;","uniform sampler2D image;","uniform vec2 textureSize;","uniform float edgeWidth;","uniform vec4 edgeColor;","varying vec2 vUv;","float getCol(vec2 coord) {","return texture2D(image, coord).a;","}","void main() {","vec2 cc = vUv;","float center = getCol(cc);","float dx = edgeWidth / textureSize.x;","float dy = edgeWidth / textureSize.y;","vec2 coord;","float topLeft = getCol(cc+vec2(-dx, -dy));","float top = getCol(cc+vec2(0.0, -dy));","float topRight = getCol(cc+vec2(dx, -dy));","float left = getCol(cc+vec2(-dx, 0.0));","float right = getCol(cc+vec2(dx, 0.0));","float bottomLeft = getCol(cc+vec2(-dx, dy));","float bottom = getCol(cc+vec2(0.0, dy));","float bottomRight = getCol(cc+vec2(dx, dy));","float v = -topLeft-2.0*top-topRight+bottomLeft+2.0*bottom+bottomRight;","float h = -bottomLeft-2.0*left-topLeft+bottomRight+2.0*right+topRight;","float edge = sqrt(h * h + v * v);","edge = smoothstep(0.9, 1.0, edge);","if (edge < 0.5) {","discard;","}","gl_FragColor = edgeColor;","}"].join("\n")},Ng=function(t){this.gv=t},Gg="edit_ty",Hg="edit_tz",Wg="edit_rx",qg="edit_ry",Xg="edit_rz",Qg="edit_sx",Yg="edit_sy",Zg="edit_sz",(Kg={})[Ug="edit_tx"]=101,Kg[Gg]=102,Kg[Hg]=103,Kg[Wg]=104,Kg[qg]=105,Kg[Xg]=106,Kg[Qg]=107,Kg[Yg]=108,Kg[Zg]=109,zs(Ng,L,{_42:function(t,e,i){var n,r,o,a,s,h,c,l,u,d,f,g,p,_,v=this,y=v.gv,m=y.sm().ld();!m||!y.isEditable(m)||y.isEditHelperDisabled()||!wn(m)||y.isFirstPersonMode()&&(y.isMouseRoamable()||et)||(xd(y),n=y.isMovable(m),r=y.isRotationEditable(m),o=y.isSizeEditable(m),a=y._axisXColor,s=y._axisYColor,h=y._axisZColor,c=y._editSizeColor,l=m.p3(),u=(_=ys(y.getEye(),l)/10)/(i?5:10),f=.4*(d=.7*_),g=l[0],p=l[1],y=l[2],_=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0],n&&v._17O(t,e,m,i,Ug,a,_,[g,p-u,y,g+d,p-u,y,g+d,p,y,g+d,p,y,g,p,y,g,p-u,y,g,p-u,y+u,g+d,p-u,y+u,g+d,p-u,y,g+d,p-u,y,g,p-u,y,g,p-u,y+u]),l=g+d,o&&v._17O(t,e,m,i,Qg,c,_,[l,p-u,y,l+f,p-u,y,l+f,p,y,l+f,p,y,l,p,y,l,p-u,y,l,p-u,y+u,l+f,p-u,y+u,l+f,p-u,y,l+f,p-u,y,l,p-u,y,l,p-u,y+u]),l+=f,r&&v._17O(t,e,m,i,Wg,a,_,[l,p-u,y,l+f,p-u,y,l+f,p,y,l+f,p,y,l,p,y,l,p-u,y,l,p-u,y+u,l+f,p-u,y+u,l+f,p-u,y,l+f,p-u,y,l,p-u,y,l,p-u,y+u]),_=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0],n&&v._17O(t,e,m,i,Gg,s,_,[g,p,y,g,p+d,y,g-u,p+d,y,g-u,p+d,y,g-u,p,y,g,p,y,g,p,y,g,p,y-u,g,p+d,y-u,g,p+d,y-u,g,p+d,y,g,p,y]),l=p+d,o&&v._17O(t,e,m,i,Yg,c,_,[g,l,y,g,l+f,y,g-u,l+f,y,g-u,l+f,y,g-u,l,y,g,l,y,g,l,y,g,l,y-u,g,l+f,y-u,g,l+f,y-u,g,l+f,y,g,l,y]),l+=f,r&&v._17O(t,e,m,i,qg,s,_,[g,l,y,g,l+f,y,g-u,l+f,y,g-u,l+f,y,g-u,l,y,g,l,y,g,l,y,g,l,y-u,g,l+f,y-u,g,l+f,y-u,g,l+f,y,g,l,y]),_=[1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0],n&&v._17O(t,e,m,i,Hg,h,_,[g,p,y,g,p,y+d,g,p-u,y+d,g,p-u,y+d,g,p-u,y,g,p,y,g,p-u,y,g-u,p-u,y,g-u,p-u,y+d,g-u,p-u,y+d,g,p-u,y+d,g,p-u,y]),l=y+d,o&&v._17O(t,e,m,i,Zg,c,_,[g,p,l,g,p,l+f,g,p-u,l+f,g,p-u,l+f,g,p-u,l,g,p,l,g,p-u,l,g-u,p-u,l,g-u,p-u,l+f,g-u,p-u,l+f,g,p-u,l+f,g,p-u,l]),l+=f,r&&v._17O(t,e,m,i,Xg,h,_,[g,p,l,g,p,l+f,g,p-u,l+f,g,p-u,l+f,g,p-u,l,g,p,l,g,p-u,l,g-u,p-u,l,g-u,p-u,l+f,g-u,p-u,l+f,g,p-u,l+f,g,p-u,l]))},_17O:function(t,e,i,n,r,o,a,s){var h=this.gv,c=h._buffer,l=yu.for(t),u=l.directUniforms(),l=l.directAttribs();h._picking&&(h.pickColorMap[h=Kg[r]]={data:i,part:r},u.uFixPickReverseColor=zg(h)),ad(t,0,U,!0,U,!0,U,!1),u.uDiffuse=o,l.aPosition=fd(t,c.vs,new js(s)),l.aNormal=fd(t,c.ns,new js(a)),hd(t),ud(t,0,12),cd(t),sd(t)}}),Jg=Gl.Raycaster=function(t){this.gv=t,this.maxTriangleTest=1/0,this.backfaceCulling=!0},Vs("Raycaster",L,{intersect:function(t){var e=this.gv.getDataAt(t);return e?this.intersectObject(t,e):null},intersectObjects:function(e,t,i){var n,r,o,a,s=this,h=1/0,c=e.origin||(new ha).fromArray(s.gv.getEye()),l=s.maxTriangleTest,u=[];return t.forEach(function(t){i&&!1===i(t)||!1!==t.s("intersect")&&u.push(t)}),u.sort(function(t,e){return c.distanceToSquared2(t.p3())-c.distanceToSquared2(e.p3())}),s.countTriangles=0,u.forEach(function(t){s.countTriangles>l||(n=s.intersectObject(e,t))&&((r=c.distanceToSquared(n.world))<h&&(o=t,a=n,h=r))}),s.countTriangles=0,{data:o,intersect:a}},intersectObject:function(t,e){if(t instanceof ua)return this._intersectObjectImpl(t,e);var i=this.gv,n=i.unproject(t),r=new ha,o=i.getEye(),a=new ha;i.isOrtho()?(t=new ha(o),a.copy(i.getCenter()).sub(t).normalize(),i=r.copy(n).sub(t).dot(a),r.copy(a).setLength(-i).add(t.copy(n))):(r.copy(o),a.copy(n).sub(r).normalize());a=new Gl.Math.Ray(r,a);return this._intersectObjectImpl(a,e)},_intersectObjectImpl:(w_=new fa,E_=new fa,T_=new ua,S_=new ha,I_=new ha,C_=new ha,M_=new ha,R_=new ha,A_=new ha,P_=new ha,D_=new ha,O_=new ca,B_=new ca,z_=new ca,V_=new ha,L_={vs:mf,is:bf,uv:xf},F_=new ha,(k_=Ef.slice(0)).push("csg"),function(t,e){var i=this.gv.getData3dUI(e),n=e.mat||i.mat;n?w_.fromArray(n):w_.identity(),E_.getInverse(w_),T_.copy(t).applyMatrix4(E_);var r,o,a,s="body",h=i.shapeModel;if(!(h=(h=h||Gf(i))||(Gl.CSGNode&&e instanceof Gl.CSGNode||Gl.CSGShape&&e instanceof Gl.CSGShape?(a=!0,[i.left,i.front,i.right,i.back,i.top,i.bottom,i.csg]):e instanceof Gl.Node&&!(e instanceof Gl.Shape)?(r=!0,L_):(o=!0,[i.left,i.front,i.right,i.back,i.top,i.bottom]))))return console.log("Can not find shape model."),null;bn(h)||(h=[h]);var c,l,u,d,f,g,p,_,v,y,m,b,x,w,E,T,S=1/0,I=["","top_","bottom_"],C=!1,M=this.backfaceCulling,R=[];for(Pd(h,i,R),c=0,l=R.length;c<l;c++)if(b=R[c])for(u=0,d=I.length;u<d;u++)if(p=b[(x=I[u])+"vs"],_=b[x+"is"],v=b[x+"uv"]||b[x+"tuv"],p){if(w=b[x+"boundingBox"]){if(!(T=T_.intersectBox(w)))continue;if(T_.origin.distanceTo(T)>S)continue;E=!1}else b[x+"boundingBox"]=w=new Gl.Math.Box3,E=!0;for(f=0,g=_?_.length:p.length/3;f<g;f+=3)this.countTriangles++,_?(I_.fromArray(p,3*_[f]),C_.fromArray(p,3*_[f+1]),M_.fromArray(p,3*_[f+2])):(I_.fromArray(p,3*f),C_.fromArray(p,3*(f+1)),M_.fromArray(p,3*(f+2))),E&&(w.expandByPoint(I_),w.expandByPoint(C_),w.expandByPoint(M_)),(y=T_.intersectTriangle(I_,C_,M_,M,S_))&&((m=T_.origin.distanceTo(y))<S&&(S=m,R_.copy(y),A_.copy(I_),P_.copy(C_),D_.copy(M_),""!==x?s=x.slice(0,-1):r?s=Ef[Math.floor(f/6)]:o?s=Ef[c]:a&&(s=k_[c]),v&&(C=!0,_?(O_.fromArray(v,2*_[f]),B_.fromArray(v,2*_[f+1]),z_.fromArray(v,2*_[f+2])):(O_.fromArray(v,2*f),B_.fromArray(v,2*(f+1)),z_.fromArray(v,2*(f+2))))))}if(!isFinite(S))return null;var A,n=R_.clone().applyMatrix4(w_);C&&(t=R_,e=A_,h=P_,i=D_,D=O_,A=B_,P=z_,ga.barycoordFromPoint(t,e,h,i,F_),D.multiplyScalar(F_.x),A.multiplyScalar(F_.y),P.multiplyScalar(F_.z),D.add(A).add(P),A=D.clone());var P=wm(),D=wm(A_.applyMatrix4(w_),P_.applyMatrix4(w_),D_.applyMatrix4(w_));return 0<T_.direction.dot(P)&&(P.multiplyScalar(-1),D.multiplyScalar(-1)),{world:n,local:R_.clone(),worldNormal:D,normal:P,uv:A,part:s}})}),zs($g=function(n,r){this.gv=n,this.s=function(t,e,i){return e==U&&(e=i),e==U?r.getStyle(t):xh(e,r,n)},this.data=r},L,{I3d:!0,ms_icons:1,_iv:!0,_cacheBoundingBox:H,iv:function(){this._iv=!0},update:function(t,e,i){var n=this,r=n.data;if(t||(i=(e=(t=n.gv).getGL())._40Q),n.needValidate(e)&&t.isVisible(r)){var o,a,s,h=r._id,c=n.s("autorotate")||n.s("shape3d.autorotate")||n.s("fixSizeOnScreen")||n.s("shape3d.fixSizeOnScreen")?null:n.s("batch"),l=r.getRenderLayer(),u=i.get(l,!0),d=u.batchIndexMap,e=u.batchModelMap,f=t.getBrightness(r),l=f!=U&&1!==f,e=Yd(d,e,r,c,t),c=n.validate(e,c?t.getBatchInfo(c)||Xi:U);if(e&&(o=(h=d[h]).size=e.vs.length/3-h.begin,s=e.rs))for(f=l?f:1,a=0;a<o;a++)s.push(f);l=t.getWireframeGeometry(r);l?Kd(t,r,l):!wn(r)||(l=t.getWireframe(r))&&Kd(t,r,l),n.labelInfo=n.label2Info=n.noteInfo=n.note2Info=n._38o=U,n._24O(jt,"getLabel"),n._24O(Nt,"getLabel2"),n._26O(Ut,"getNote"),n._26O(Gt,"getNote2"),n._15O(),n.interactiveInfo=t.isInteractive(r)?{}:U,u.push(this,!0),!1!==c&&(n._iv=!1)}else i.push(this,!1)},clearWireframeGeometryCache:function(){var t,e;(e=(e=(t=this).shapeModel)||Gf(t))&&(e._ctlineModel=[],e._lineModel=H),this.data.iv()},_46Q:function(t){var e,i,n,r,o=this.data,a=this.gv;a.isVisible(o)&&(r=o._id,i=(e=a._40Q.get(o._renderLayer,!0)).batchIndexMap[r],n=e.polylineIndexMap[r],r=e.wireframeIndexMap[r],!(i||n||r)||(o=Ed(t,a.pickColorMap,a.isSelectable(o),o,kt,!0))&&(Jd(o,i,e.batchModelMap),Jd(o,n,e.polylineModelMap),Jd(o,r,e.wireframeModelMap)))},_42:function(t,e,i){function n(t,e,i){var n=e.getBrightness(i),r=i.s("alphaTest"),o=i.s("envmap"),a=yu.for(t).directUniforms();n!=U&&1!==n&&(a.uBrightness=n),a.uAlphaTest=r,a.uUseEnvMap=!!o,a.uReflectivity=o||.01,a.shadowReceive=!v&&i.s("shadow.receive"),a.shadowCull=!v&&!!i.s("shadow.cull");var s=h.s("3d.clip.direction");if(s){e=h.s("3d.clip.percentage");switch(0===e&&(g=!1),s){case"left":s=2;break;case"top":s=3;break;case"bottom":s=4;break;case"front":s=5;break;case"back":s=6;break;case"right":default:s=1}0==s%2&&(e=1-e),i instanceof Gl.Shape?(n=i.s3(),r=i.p3(),o=i.getAnchor3d(),e=s<3?(e-o.x)*n[0]+r[0]:s<5?(e-o.y)*n[1]+r[1]:(e-o.z)*n[2]+r[2]):e-=.5,a.uClipPercent=e}a.uClipDirection=s||0,t._blooming&&!i.s("bloom")&&(a.blackout=!0)}var h=this,r=h.data,o=h.gv;if(o.isVisible(r)){var a,s,c,l,u,d,f,g,p,_,v=o._picking;if(v)a=o.pickColorMap;else{if(o.isTransparentMask(r)||o.isReflecting(t)&&!1===r.s("3d.reflectable"))return;a=H}if($g.getTitle===H)for(var y in $g.getTitle=0,G)if(y.length===Nt.length+1&&y[Nt.length]===ge[4].toUpperCase()&&y[Nt.length-1]===ge[Nt.length+1].toUpperCase()){$g.getTitle=Gn;break}if(!$g.getTitle||Ci[Nt.length+2]){if($g.getHead===H)for(var y in $g.getHead=0,mr){var m="box-sizing";6===y.length&&y[0]===ge[4]&&y[3]===m[0]&&y[4]===m[1]&&y[5]===m[2]&&($g.getHead=Gn)}$g.getHead&&!Ci[Nt.length]||(c=r._id,u=(l=o._40Q.get(r._renderLayer,!0)).batchIndexMap,d=l.batchModelMap,f=o.isSelectable(r),g=!(_=!1),p=u[c],!v||(u=Ed(t,a,f,r,kt,p))&&!o._45Q&&(Jd(u,p,d),Jd(u,l.polylineIndexMap[c],l.polylineModelMap),Jd(u,l.wireframeIndexMap[c],l.wireframeModelMap)),p||(_||(_=!0,n(t,o,r)),g&&h._80o(t,e,i)),o.isLabelVisible(r)&&((s=h.labelInfo)&&(v&&Ed(t,a,f,r,jt),_||(_=!0,n(t,o,r)),h._28O(s,jt,i)),(s=h.label2Info)&&(v&&Ed(t,a,f,r,Nt),_||(_=!0,n(t,o,r)),h._28O(s,Nt,i))),o.isNoteVisible(r)&&((s=h.noteInfo)&&(v&&Ed(t,a,f,r,Ut),_||(_=!0,n(t,o,r)),h._29O(s,Ut,i)),(s=h.note2Info)&&(v&&Ed(t,a,f,r,Gt),_||(_=!0,n(t,o,r)),h._29O(s,Gt,i))),(s=h._38o)&&(_||(_=!0,n(t,o,r)),h._99O(t,e,s,a,f,i)),_&&((_=yu.for(t).directUniforms()).uBrightness=1,_.uClipDirection=0,t._blooming&&(_.blackout=!1)))}}},prepare:function(){var t=this,e=t.data;if(!(e instanceof _l)){var i,n,r,o=t.gv,a=o.getGL(),s=e._id,h=t.s("batch"),c=o._batchIndexMap,l=o._batchModelMap,u=o.getBrightness(e),d=u!=U&&1!==u;if(t.needValidate(a)){if(l=Yd(c,l,e,h,o),t.validate(l,h?o.getBatchInfo(h)||Xi:U),l&&(i=(s=c[s]).size=l.vs.length/3-s.begin,r=l.rs))for(u=d?u:1,n=0;n<i;n++)r.push(u);wn(e)&&((d=o.getWireframeGeometry(e))?Kd(o,e,d):(d=o.getWireframe(e))&&Kd(o,e,d)),t.labelInfo=t.label2Info=t.noteInfo=t.note2Info=t._38o=U,t._24O(jt,"getLabel"),t._24O(Nt,"getLabel2"),t._26O(Ut,"getNote"),t._26O(Gt,"getNote2"),t._15O(),t.interactiveInfo=o.isInteractive(e)?{}:U,t._iv=!1}}},dispatchBoundingBoxChanged:function(){this._cacheBoundingBox=H},getBoundingBox:function(){if(this._cacheBoundingBox)return this._cacheBoundingBox;__||(__={vs:mf,is:bf,uv:xf},v_=new ha,y_=new ha,m_=new ha,b_=new ha,x_=new ha);var t=this,e=t.data,i=t.shapeModel;if(i||e instanceof Gl.Shape||(i=Gf(t)),!i&&e instanceof Gl.Shape&&(t.prepare(),i=t.shapeModel),i||(e instanceof Gl.Node&&!(e instanceof Gl.Shape)?i=__:(t.left||t.front||t.right||t.back||t.top||t.bottom)&&(i=[t.left,t.front,t.right,t.back,t.top,t.bottom])),!i)return H;bn(i)||(i=[i]);var n,r,o,a,s,h,c,l,u,d,f,g,p=["","top_","bottom_"],_=new Gl.Math.Box3,v=!1;for(t._needRecoverPosition?(b_.set.apply(b_,e.p3()),g=e.s3(),x_.set(1/(g[0]||1),1/(g[1]||1),1/(g[2]||1))):(b_.set(0,0,0),x_.set(1,1,1)),n=0,r=i.length;n<r;n++)if(u=i[n])for(o=0,a=p.length;o<a;o++)if(c=u[(f=p[o])+"vs"],l=u[f+"is"],c){if(!(d=u[f=f+"boundingBox"]))for(u[f]=d=new Gl.Math.Box3,s=0,h=l?l.length:c.length/3;s<h;s+=3)l?(v_.fromArray(c,3*l[s]).sub(b_).multiply(x_),y_.fromArray(c,3*l[s+1]).sub(b_).multiply(x_),m_.fromArray(c,3*l[s+2]).sub(b_).multiply(x_)):(v_.fromArray(c,3*s).sub(b_).multiply(x_),y_.fromArray(c,3*(s+1)).sub(b_).multiply(x_),m_.fromArray(c,3*(s+2)).sub(b_).multiply(x_)),v_.isNaN()||d.expandByPoint(v_),y_.isNaN()||d.expandByPoint(y_),m_.isNaN()||d.expandByPoint(m_);_.expandByBox(d),v=!0}return v?(this._cacheBoundingBox=_,L.freeze(_),L.freeze(_.min),L.freeze(_.max),Xd(t.gv,e),_):H},needValidate:function(){return this._iv},validate:function(){},_16O:function(){return Ws},_80o:function(){},dispose:function(){},getBodyColor:function(t){var e=this.data,i=this.gv.getBodyColor(e);return i||(t?e.getStyle(t):U)},getCachedTexture:function(t){var e=this._cachedTextures;return e?e[t||"main"]:null},setCachedTexture:function(t,e){return(this._cachedTextures||(this._cachedTextures={}))[e||"main"]=t},invalidateCachedTexture:function(t){var e=this._cachedTextures;if(e){for(var i in e)t.deleteTexture(e[i]);this._cachedTextures={}}},invalidateCachedGeometry:function(){},_24O:function(t,e){var i,n,r=this.data,o=this.gv,a=this.s,s=o[e](r);s!=U&&(i=a(t+".scale"),n=a(t+".max"),s=(r=this[t+"Info"]={label:s,textureScale:a(t+".texture.scale"),color:o[e+"Color"](r),font:a(t+".font"),align:a(t+".align"),background:o[e+"Background"](r)}).rect=ar(r,s),0<n&&n<s.width&&(r.labelWidth=s.width,s.width=n),s.x=s.y=0,s.width*=i,s.height*=i,r.mat=this._16O(a(t+".autorotate"),a(t+".position"),s,a(t+".face"),a(t+".t3"),a(t+".r3"),a(t+".rotationMode")),a=s.width/2,t=s.height/2,r.vs=new js([-a,t,0,-a,-t,0,a,-t,0,a,t,0]),s.width/=i,s.height/=i)},_26O:function(t,e){var i,n,r=this.data,o=this.gv,a=this.s,s=o[e](r);s!=U&&(i=a(t+".scale"),n=(e=this[t+"Info"]={note:s,textureScale:a(t+".texture.scale"),expanded:a(t+".expanded"),font:a(t+".font"),color:a(t+".color"),align:a(t+".align"),borderWidth:a(t+".border.width"),borderColor:a(t+".border.color"),background:o[e+"Background"](r)}).expanded?(r=a(t+".max"),(n=ar(e,s)).width+=6,n.height+=2,0<r&&r<n.width&&(e.labelWidth=n.width,n.width=r),{x:-n.width/2,y:-8-n.height,width:n.width,height:n.height+8}):{x:-6,y:-18,width:12,height:18},e.mat=this._16O(a(t+".autorotate"),a(t+".position"),U,a(t+".face"),a(t+".t3"),a(t+".r3"),a(t+".rotationMode")),e.rect=n,1!==i&&((n=is(n)).x*=i,n.height*=i,n.y=-n.height,n.width*=i),a=n.x,t=n.y,i=n.width,n=n.height,e.vs=new js([a,-t,0,a,-t-n,0,a+i,-t-n,0,a+i,-t,0]))},eachShapeModel:function(a,t){var s=this,e=s.data;(function t(e){var i,n,r,o;if(bn(e))for(n=0,r=e.length;n<r;n++)(i=e[n])&&t(i);else pn(e)?t(Gf(s,e)):yn(e)&&(e.shape3d?t(e.shape3d):(Hf(o=e),o.vs&&a(o.vs,o.is,o.ns,o.uv),o.top_vs&&a(o.top_vs,o.top_is,o.top_ns,o.top_uv),o.bottom_vs&&a(o.bottom_vs,o.bottom_is,o.bottom_ns,o.bottom_uv),o.from_vs&&a(o.from_vs,o.from_is,o.from_ns,o.from_uv),o.to_vs&&a(o.to_vs,o.to_is,o.to_ns,o.to_uv)))})(t=(t=t||s.shapeModel||Gf(s))||(e instanceof Gl.Node&&!(e instanceof Gl.Shape)?{vs:mf,is:bf}:[s.left,s.front,s.right,s.back,s.top,s.bottom]))},_28O:function(t,e,i){var n,r,o;i(this.s(e+".transparent"))&&(n=t.rect,r=t.textureScale,o=n.width*r,i=n.height*r,1<=o&&1<=i&&(i=Kr(o,i),1!==r&&(i.translate(i,n.x,n.y),i.scale(r,r),i.translate(i,-n.x,-n.y)),lc(i,t),i.restore(),Md(this,e,t.mat,t.vs,!0)))},_29O:function(t,e,i){var n,r,o,a,s;i(this.s(e+".transparent"))&&(n=t.rect,r=t.textureScale,o=n.x,a=n.y,s=n.width*r,i=n.height*r,1<=s&&1<=i&&(n.x=n.y=0,i=Kr(s,i),1!==r&&i.scale(r,r),uc(i,t),i.restore(),n.x=o,n.y=a,Md(this,e,t.mat,t.vs,!1)))},_99O:function(t,e,i,n,r,o){if(i){var a,s=this.gv,h=this.data,c=s._buffer,l=s._1O,u=i.icons,d=yu.for(t).directAttribs();for(a in u){var f=u[a],g=i.rects[a];if(g&&o(xh(f.transparent,h,s))){s._picking&&Ed(t,n,r,h,a);var p=xh(f.shape3d,h,s),_=p?[p]:xh(f.names,h,s),v=_?_.length:0,y=xh(f.textureScale,h,s)||1,m=xh(f.light,h,s);m==U&&(m=!!p),ad(t,0,xh(f.blend,h,s),m,xh(f.opacity,h,s),xh(f.reverseFlip,h,s),xh(f.reverseColor,h,s),xh(f.reverseCull,h,s));for(var b=0;b<v;b++){var x,w,E,T=_[b],S=g[b];Cd(this,S.mat),p?jf(s,h,Gf(this,p),this):(x=Qa(T))&&(w=S.width*y,E=S.height*y,1<=w&&1<=E&&(T=Kr(w,E),Ka(T,x,xh(f.stretch,h,s),0,0,w,E,h,s),T.restore(),Qu(t,Yr,l),hd(t,e,l,xh(f.discardSelectable,h,s),c.uv,_f),d.aPosition=fd(t,c.vs,S.vs),d.aNormal=gd(t,c.ns,vf,U),_d(t,c.is,yf),dd(t,0,yf.length),cd(t,0,l))),md(s)}sd(t)}}}}}),zs(tp=function(t,e){Bn(tp,this,[t,e])},$g,{_16O:function(t,e,i,n,r,o,a,s,h){var c=this.data,l=c.getFinalScale3d(),s=Sd(e,l,i,n,s,h);return(c.hasOwnProperty("_anchor")||c.hasOwnProperty("_anchorElevation"))&&(h=c.getAnchor3d(),s[0]-=(h.x-.5)*l[0],s[1]-=(h.y-.5)*l[1],s[2]-=(h.z-.5)*l[2]),Id(Hs(),s,c.p3(),n,r,o,a,t,c.getFinalRotation3d(),c.getRotationMode())},clear:function(){var t=this;t.faceMat=t.mat=t.shapeModel=t.left=t.right=t.front=t.back=t.top=t.bottom=t.csg=U},needValidate:function(t){if(this._iv)return this._validateFrameId=t._renderInfo.frame,!0;if(this.s("autorotate")||this.s("shape3d.autorotate")||this.s("fixSizeOnScreen")||this.s("shape3d.fixSizeOnScreen")||this.s("hide.overlapping.group")){t=t._renderInfo.frame;if(this._validateFrameId!==t)return this._validateFrameId=t,!0}return!1},validate:function(t,e){var i=this,n=i.gv,r=i.data,o=i.shapeName=i.s(Ve),a=Gf(i,o);i._updateAutoRotation(),i._updateFixSize2d(),i._updateOverlapping(),i.dispatchBoundingBoxChanged(),(this.s("autorotate")||this.s("shape3d.autorotate")||this.s("fixSizeOnScreen")||this.s("shape3d.fixSizeOnScreen"))&&(s=r.getRenderLayer(),(s=n._40Q.get(s))&&s.ivWireframeBatch(r));var s=$s(r,n.getMat(r),!a||i.s("shape3d.scaleable"));r.appendAnchorMatrix3d(s),i.clear(),i.mat=r.mat=s,!a&&o||(i.shapeModel=a,t?(o=[],a?tf(n,r,a,i,i.getBodyColor(),[s],t,o):(of(n,r,t,e,s,st,o,Nd),of(n,r,t,e,s,ht,o,Ud),of(n,r,t,e,s,ct,o,Gd),of(n,r,t,e,s,lt,o,Hd),of(n,r,t,e,s,ot,o,Wd),of(n,r,t,e,s,at,o,qd)),o.length&&(Mn(t.vs,o),Mn(t.ns,Xu(o)))):a||(i._cubeUvs=null,i.vf(st,0),i.vf(ht,16),i.vf(ot,8),i.vf(at,24),i.vf(ct,32),i.vf(lt,40)))},_updateAutoRotation:(u_=new pa,d_=new fa,f_=new ha,g_=new ha,p_=new ha,function(){var t,e,i=this.data,n=this.s("autorotate")||this.s("shape3d.autorotate");n?(e=this.gv,p_.copy(this.s("shape3d.autorotate.up")||e._up),t="string"==typeof n?[(n.indexOf("x")<0?e._eye:e._center)[0],(n.indexOf("y")<0?e._eye:e._center)[1],(n.indexOf("z")<0?e._eye:e._center)[2]]:e._eye,n=e._center,e=i.p3(),f_.copy(e),g_.set(t[0]-n[0],t[1]-n[1],t[2]-n[2]).add(f_),d_.lookAt(g_,f_,p_),u_.set(0,0,0,i.getRotationMode(),!0).setFromRotationMatrix(d_),(n=i._dynamicRotation)&&Math.abs(n[0]-u_.x)<1e-5&&Math.abs(n[1]-u_.y)<1e-5&&Math.abs(n[2]-u_.z)<1e-5||(i._dynamicRotation=[u_.x,u_.y,u_.z])):i._dynamicRotation&&delete i._dynamicRotation}),_updateFixSize2d:function(){var t,e,i,n,r,o,a=this.data,s=this.s("fixSizeOnScreen")||this.s("shape3d.fixSizeOnScreen");s?(i=this.gv,t=$s(a,i.getMat(a)),e=Xs([0,0,0],t),n=i.toViewPosition(e),isNaN(n.x)||isNaN(n.y)||(e=Xs([1,0,0],t),e=i.toViewPosition(e),t=Xs([0,1,0],t),i=i.toViewPosition(t),t=e.x-n.x,e=i.y-n.y,t&&e&&(i=a._dynamicScale3d||[1,1,1],n=Qa(a.s("shape3d.image")),0<s[0]&&(r=s[0]),0<s[1]&&(o=s[1]),r&&o||(s=0<s?s:1,r=r||(mh(n,a)||a.getWidth())*s,o=o||(bh(n,a)||a.getTall())*s),r=Math.abs(t/r),o=Math.abs(e/o),Math.abs(r-1)<.001&&Math.abs(o-1)<.001||(a._dynamicScale3d=[i[0]/r,i[1]/o,i[2]])))):a._dynamicScale3d&&delete a._dynamicScale3d},_updateOverlapping:function(){var t=this.s("hide.overlapping.group");if(t){for(var e,i=this.gv,n=this.data,r=$s(n,i.getMat(n)),o=1/0,a=1/0,s=-1/0,h=-1/0,n=n.getAnchor3d(),c=n.x,l=n.y,u=n.z,d=0;d<8;d++){if(e=Xs([(d>>2)-c,(1&d>>1)-l,(1&d)-u],r),e=i.toViewPosition(e),isNaN(e.x)||isNaN(e.y))return;o=Math.min(o,e.x),s=Math.max(s,e.x),a=Math.min(a,e.y),h=Math.max(h,e.y)}n={x:o,y:a,w:s-o,h:h-a};this._rectOverlapping=i.overlappingBox.isOverlapping(t,n)}else this._rectOverlapping&&(this._rectOverlapping=H)},getVectorDynamicSize:function(){var t=this.s("shape3d"),e=this.data;if("billboard"===t||"plane"===t||(i=e._currentCubeElementId)!=U){var i,n,r,o=this.gv,a=$s(e,o.getMat(e)),s=e.getAnchor3d(),h=.5-s.x,c=.5-s.y,l=.5-s.z,u=Math.min(this.s("vector.dynamic.maxsize"),o._glCapabilities.maxTextureSize)/o.getDevicePixelRatio(),s=function(t,e){t[0]+=h,t[1]+=c,t[2]+=l,e[0]+=h,e[1]+=c,e[2]+=l;var i=o.toViewPosition(Xs(t,a)),t=o.toViewPosition(Xs(e,a)),e=i.x-t.x,t=i.y-t.y;return Math.min(u,Math.sqrt(e*e+t*t))};return"billboard"===t?(n=s([-.5,0,0],[.5,0,0]),r=s([0,-.5,0],[0,.5,0])):"plane"===t?(n=s([-.5,0,0],[.5,0,0]),r=s([0,0,-.5],[0,0,.5])):e._currentCubeElementId!=U&&(t=3*bf[i+1],e=3*bf[i],i=3*bf[i+2],n=s([mf[t],mf[1+t],mf[2+t]],[mf[i],mf[1+i],mf[2+i]]),r=s([mf[t],mf[1+t],mf[2+t]],[mf[e],mf[1+e],mf[2+e]])),[n,r]}},vf:function(t,e){if(this.gv.getFaceVisible(this.data,t)){t=Rd(this,t);t.mat&&(this.faceMat=!0);var i=t.uv;if(i)for(var n=(n=this._cubeUvs)||(this._cubeUvs=new js([0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0])),r=0;r<8;r++)n[e+r]=i[r];return t}},_billboardInView:(a_=[-.5,-.5,0,-.5,.5,0,.5,-.5,0,.5,.5,0],s_=[-.5,0,-.5,-.5,0,.5,.5,0,-.5,.5,0,.5],h_=new da,c_=new ha,l_=new fa,function(t){if(!this.mat)return!0;var e=this.gv.getFrustum(),i="billboard"===t?a_:s_;h_.makeEmpty(),l_.fromArray(this.mat);for(var n=0,r=i.length;n<r;n+=3)h_.expandByPoint(c_.fromArray(i,n).applyMatrix4(l_));return e.intersectsBox(h_)}),_80o:function(t,e,i){var n=this;if(n._rectOverlapping)return!0;var r=n.shapeModel;if(r||!n.shapeName){var o=n.s("shape3d");if(("billboard"===o||"plane"===o)&&!n._billboardInView(o))return!0;var a=n.gv,s=n.data,h=a._cube,o=yu.for(t).directAttribs();xd(a,n.mat),n.s("shape3d.reflector")&&!t._picking||(r?jf(a,s,r,n,n.getBodyColor(),i):(o.aPosition=fd(t,h.vs,U),o.aNormal=fd(t,h.ns,U),pd(t,h.is),n._18O(t,e,"left",0,i),n._18O(t,e,"front",6,i),n._18O(t,e,"right",12,i),n._18O(t,e,"back",18,i),n._18O(t,e,"top",24,i),n._18O(t,e,"bottom",30,i))),md(a),n.faceMat&&(n._18O(t,e,"left",0,i,!0),n._18O(t,e,"front",6,i,!0),n._18O(t,e,"right",12,i,!0),n._18O(t,e,"back",18,i,!0),n._18O(t,e,"top",24,i,!0),n._18O(t,e,"bottom",30,i,!0))}},_18O:function(t,e,i,n,r,o){var a,s,h,c,l,u,d,f=this[i];f&&r(f.transparent)&&(o&&!f.mat||!o&&f.mat||((a=this.data.s("polygonOffset"))&&ed(t,a),o&&xd(this.gv,f.mat),s=this.data,h=yu.for(t).directUniforms(),s._currentCubeElementId=n,l=(c=this.gv).getTexture(f.texture,s,i),u=f.uv,d=f.uvScale,r=f.uvOffset,i=f.discardSelectable,l?u?hd(t,e,l,i,c._buffer.uv,this._cubeUvs,r,d):hd(t,e,l,i,c._cube.uv,U,r,d):hd(t),ad(t,0,f.blend,f.light,f.opacity,f.reverseFlip,f.reverseColor,f.reverseCull),h.uDiffuse=f.color||F["color.empty"],dd(t,n,6),sd(t),cd(t,0,l),o&&md(c),a&&id(t),s._currentCubeElementId=null))},drawReflector:(Xp=new ha,Qp=new ha,Yp=new pa,Zp=new fa,Kp=new ha,Jp=new ha,$p=new ha,t_=new ha,e_=new fa,i_=new fa,n_=new la,r_=new sa,o_=new sa,function(t){var e=this;e._reflectorInfo=null;var i=e.data;if(i._reflecting)return!1;var n=e.gv;if(n._picking)return!1;var r=e._reflectorRenderTarget,o=n.getDevicePixelRatio(),a=n.getWidth()*o,s=n.getHeight()*o;if(r?r.setSize(t,a,s):r=e._reflectorRenderTarget=new Bd.RenderTarget(n,t,a,s),Xp.copy(i.p3()),Qp.copy(n.getEye()),Zp.makeRotationFromEuler(Yp.set(i.r3(),i.getRotationMode(),!0)),!e._reflectNormal){if(!(h=Gf(e,e.s("shape3d"))))return!1;if(!h.ns&&h.length&&(h=h[0]),!h.ns||!h.vs)return!1;e._reflectNormal=[h.ns[0],h.ns[1],h.ns[2]],e._reflectorVbuffer=Zf.Buffer.createVertexBuffer(t,new Float32Array(h.vs))}if(Kp.copy(e._reflectNormal),Kp.applyMatrix4(Zp),Jp.subVectors(Xp,Qp),0<Jp.dot(Kp))return!1;Jp.reflect(Kp).negate(),Jp.add(Xp),$p.copy(n.getCenter()).negate().add(Xp),$p.reflect(Kp).negate(),$p.add(Xp),t_.copy(n.getUp()),t_.reflect(Kp);o=[0,0,0,0,0,0,0,0,0];xm(a=o,(s=n).getEye(),0),xm(a,s.getCenter(),3),xm(a,s.getUp(),6),n._eye=Jp.toArray(),n._center=$p.toArray(),n._up=t_.toArray(),n._18Q=U;var h=n._skybox;h&&(h.p3(n._eye),n.getData3dUI(h).iv()),wu(t,r.frame),t.viewport(0,0,r.width,r.height);a=i.s("shape3d.reflector.background");a?(c=t.getParameter(t.COLOR_CLEAR_VALUE),nd(t,a)):t.clearColor(0,0,0,1),yu.for(t).glState.depth.mask=!0,t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT);s=qu(n),h=Wu(n);n_.setFromNormalAndCoplanarPoint(Kp,Xp),n_.applyMatrix4(i_.fromArray(h)),r_.set(n_.normal.x,n_.normal.y,n_.normal.z,n_.constant),o_.x=(Math.sign(r_.x)+s[8])/s[0],o_.y=(Math.sign(r_.y)+s[9])/s[5],o_.z=-1,o_.w=(1+s[10])/s[14],r_.multiplyScalar(2/r_.dot(o_));h=i.s("shape3d.reflector.clip"),h=h===H?.003:h;s[2]=r_.x,s[6]=r_.y,s[10]=r_.z+1-h,s[14]=r_.w;h=n._computedProjectMatrix;n._computedProjectMatrix=s,i._reflecting=!0,n.renderScene(),n._computedProjectMatrix=h,e_.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),e_.multiply(i_.fromArray(n._projectMatrix)),e_.multiply(i_.fromArray(n._viewMatrix)),a&&nd(t,c),Eu(t),function(t,e){e._eye=[t[0],t[1],t[2]],e._center=[t[3],t[4],t[5]],e._up=[t[6],t[7],t[8]],e._18Q=U;var i=e._skybox;i&&(i.p3([t[0],t[1],t[2]]),e.getData3dUI(i).iv())}(o,n);var c=i.s("shape3d.reflector.blur");!c||(o=n.getPostProcessingModule("Blur"))&&o.drawImpl(t,r,c,i.s("shape3d.reflector.blur.ratio"));c=t._compiledShader.reflector;(c=c||(t._compiledShader.reflector=new Zf.Shader(t,bu.Reflector.vs,bu.Reflector.fs))).bind(),t.activeTexture(t.TEXTURE0),$u(t,r.texture),c.uniforms.tDiffuse=0,c.uniforms.color=to(i.s("shape3d.reflector.color")||"rgb(128,128,128)"),c.uniforms.textureMatrix=e_.toArray(),c.uniforms.modelMatrix=$s(i),c.uniforms.viewMatrix=Wu(n),c.uniforms.projectionMatrix=qu(n),e._reflectorVbuffer.upload(),c.attributes.pos.pointer(e._reflectorVbuffer);var l,u,e=this.s("shape3d.transparent");return e&&(u=(l=yu.for(t).glState).depth.mask,l.depth.mask=!1),t.drawArrays(t.TRIANGLES,0,6),e&&(l.depth.mask=u),i._reflecting=!1,t.useProgram(n._prg),$u(t,U),!0})}),bu.Reflector={vs:["attribute vec3 pos;","uniform mat4 textureMatrix;","uniform mat4 modelMatrix;","uniform mat4 viewMatrix;","uniform mat4 projectionMatrix;","varying vec4 vUv;","void main() {","\tvUv = textureMatrix * modelMatrix * vec4( pos, 1.0 );","\tgl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4( pos, 1.0 );","}"].join("\n"),fs:["precision highp float;","uniform vec3 color;","uniform sampler2D tDiffuse;","varying vec4 vUv;","float blendOverlay( float base, float blend ) {","\treturn( base < 0.5 ? ( 2.0 * base * blend ) : ( 1.0 - 2.0 * ( 1.0 - base ) * ( 1.0 - blend ) ) );","}","vec3 blendOverlay( vec3 base, vec3 blend ) {","\treturn vec3( blendOverlay( base.r, blend.r ), blendOverlay( base.g, blend.g ), blendOverlay( base.b, blend.b ) );","}","void main() {","\tvec4 base = texture2DProj( tDiffuse, vUv );"," vec2 tUv = vUv.xy / vUv.w;"," if (tUv.x < .0 || tUv.y < .0 || tUv.x > 1. || tUv.y > 1.) discard;","\tgl_FragColor = vec4( blendOverlay( base.rgb, color ), base.a );","}"].join("\n")},zs(ep=function(t,e){Bn(ep,this,[t,e])},tp,{_80o:function(){}}),zs(ip=function(t,e){Bn(ip,this,[t,e])},$g,{_25Q:1,validate:function(t){var e=this;if(!e.s("geometry.cache")||!e.info){var i=e.gv,n=e.data,r=e.s,o=r("edge.width"),a=n._40I,s=n._41I;if(e.shapeModel=e.info=U,a&&s){var h,c,l,u,d,f,g=n.isLooped(),p=r(Jt),_=G.getEdgeType(p);if(_){var v=_(n,pc(e,i,n,g,p),i,e._19Q);if(!v.points||v.points.isEmpty())return;u=e.info={},d=v.segments,f=(l=v.points).size();for(var y=a.getElevation(),m=s.getElevation(),b=0;b<f;b++){var x=l.get(b);x.e==U&&(x.e=y+(m-y)*b/(f-1))}E=Mu(l.get(0)),T=Mu(l.get(f-1)),0===(w=f%2)?(u.c1=Mu(l.get(f/2-1)),u.c2=Mu(l.get(f/2))):u.p3=Mu(l.get((f-w)/2)),u.s1=E,u.s2=Mu(l.get(1)),u.t1=Mu(l.get(f-2)),u.t2=T}else{l=new Lh,u=e.info={};var w,E,T,S,I,C,M,R=r("edge.offset"),A=r("edge.center"),P=r("edge.source.t3"),_=r("edge.target.t3"),v=Td(i,n,"source"),s=Td(i,n,"target");if(!v||!s)return i.invalidateData(n),delete e.info,!1;P&&(v[0]+=P[0],v[1]+=P[1],v[2]+=P[2]),_&&(s[0]+=_[0],s[1]+=_[1],s[2]+=_[2]),p===Vt?(d=r("edge.segments"),(f=(_=u.points=r(Kt)||Fh).size())?(E=Mu(_.get(0)),T=Mu(_.get(f-1)),!A&&R&&(h=Ns(E,v,!0),R=q(R,ys(v,E)),v=[v[0]+h[0]*R,v[1]+h[1]*R,v[2]+h[2]*R],h=Ns(s,T,!0),R=q(R,ys(T,s)),s=[s[0]-h[0]*R,s[1]-h[1]*R,s[2]-h[2]*R]),0===(w=f%2)?(S=Mu(_.get(f/2-1)),I=Mu(_.get(f/2))):u.p3=Mu(_.get((f-w)/2)),u.s1=v,u.s2=E,u.t1=T,u.t2=s):(!A&&R&&(h=Ns(s,v,!0),c=ys(v,s),R=dc(R,c),v=[v[0]+h[0]*R,v[1]+h[1]*R,v[2]+h[2]*R],s=[s[0]-h[0]*R,s[1]-h[1]*R,s[2]-h[2]*R]),S=v,I=s),l.add({x:v[0],y:v[2],e:v[1]}),l.addAll(_),l.add({x:s[0],y:s[2],e:s[1]})):(p=pc(e,i,n,g,p),e._19Q||(p=-p),g?(g=v[0],C=v[1],M=v[2],S=[g-p,C+(a=a.getTall()/2+p),M],I=[g+p,C+a,M],l.add({x:g-p,y:M,e:C}),l.add({x:g-p,y:M,e:C+a}),l.add({x:g+p,y:M,e:C+a}),l.add({x:g+p,y:M,e:C})):(h=Ns(s,v,!0),c=ys(v,s),M={x:v[0],y:v[2]},C={x:s[0],y:s[2]},p=(C=Fu(U,M,C,p)).x-M.x,M=C.y-M.y,R=dc(R,c),h[0]*=R,h[1]*=R,h[2]*=R,S=[v[0]+h[0]+p,v[1]+h[1],v[2]+h[2]+M],I=[s[0]-h[0]+p,s[1]-h[1],s[2]-h[2]+M],A?(l.add({x:v[0],y:v[2],e:v[1]}),l.add({x:S[0],y:S[2],e:S[1]}),l.add({x:I[0],y:I[2],e:I[1]}),l.add({x:s[0],y:s[2],e:s[1]})):(l.add({x:S[0],y:S[2],e:S[1]}),l.add({x:I[0],y:I[2],e:I[1]})))),u.c1=S,u.c2=I}u._lastPointsSegments={points:l,segments:d},u.list=r(Ve)===Et?e.createTubeModel(l,d,o/2,t):e.createLineModel(l,d,o,"edge","edge.dash")}}},invalidateCachedGeometry:function(){this.info=U}}),zs(np=function(t,e){Bn(np,this,[t,e]),this._needRecoverPosition=!0},tp,{_80o:function(t,e,i){var n=this,r=n.gv,o=n.shapeModel;xd(r,n.mat),o?jf(r,n.data,o,n,n.getBodyColor(),i):(Ad(n,t,e,"left",i),Ad(n,t,e,"front",i),Ad(n,t,e,"right",i),Ad(n,t,e,"back",i),Ad(n,t,e,"top",i),Ad(n,t,e,"bottom",i)),md(r)},validate:function(t,e){var i,n=this,r=n.s,o=n.data,a=(o.p3(),o._thickness/2),s=o.isClosePath(),h=o.getPoints(),c=o.getSegments(),l=r(Le),u=t&&t.uv;if(n.clear(),n.dispatchBoundingBoxChanged(),a<0){try{i=n.shapeModel=Pc(h,c,r(Ne),r(Ue),l,r(Ge),o.getTall(),o.getShapeElevation(),s)}catch(t){i=n.shapeModel={}}r(Fe)?r("shape3d.image")||delete i.uv:(delete i.vs,delete i.ns,delete i.uv),r("shape3d.top.image")||delete i.top_uv,r("shape3d.bottom.image")||delete i.bottom_uv}else if(r(Ve)===Et)b=so(h,c,l,s),i=n.shapeModel={vs:[]},r("shape3d.image")&&(i.uv=[],i.sum=r(Ge)||Yn(b)||1,i.len=0),r(Ne)&&!s&&(i.top_vs=[],r("shape3d.top.image")&&(i.top_uv=[])),r(Ue)&&!s&&(i.bottom_vs=[],r("shape3d.bottom.image")&&(i.bottom_uv=[])),n._12O(b,a);else{var d,f,g,p,_,v,y,m,b=so(h,c,l,s),x=n.vf(ot,u,!1,e);if(a&&(_=n.vf(at,u,!1,e),v=s?U:n.vf(st,u,!1,e),y=s?U:n.vf(ht,u,!1,e),m=n.vf(ct,u,!1,e),T=n.vf(lt,u,!1,e)),a){for(var w=0,E=b.length;w<E;w++)b[w]=n._tryRemoveBezierPoints(b[w],a);n._12O(b,a)}else x&&b.forEach(function(t){if(0<(p=t.length))for(d=t[0],g=1;g<p;g++)f=t[g],n.addV(x.vs,d,f),d=f});n._20Q(b),t||(x&&(x.ns=Xu(x.vs),Wf(x,"vs"),Wf(x,ie)),a&&(_&&(_.ns=Xu(_.vs),Wf(_,"vs"),Wf(_,ie)),v&&(v.ns=Xu(v.vs),Wf(v,"vs"),Wf(v,ie)),y&&(y.ns=Xu(y.vs),Wf(y,"vs"),Wf(y,ie)),m&&(m.ns=Xu(m.vs),Wf(m,"vs"),Wf(m,ie)),T&&(T.ns=Xu(T.vs),Wf(T,"vs"),Wf(T,ie))))}var T=n.mat=o.getPointsMatrix3d().getElements();t&&(nf(n,T,t,i),n.clear())},_20Q:function(t){var e,i,n,r,o,a,s,h=this,c=h.front,l=h.back,u=h.top,d=h.bottom,f=c?c.tuv:U,g=l?l.tuv:U,p=u?u.tuv:U,_=d?d.tuv:U,v=0;(f||g||p||_)&&(e=h.s(Ge)||Yn(t)||1,t.forEach(function(t){if(0<(i=t.length))for(a=t[0],n=1;n<i;n++)s=t[n],r=v/e,v+=ys(a,s),o=v/e,h._14O(c,r,o),h._14O(l,1-o,1-r),h._14O(u,r,o),h._14O(d,r,o),a=s}))},_14O:function(t,e,i){var n,r,o,a,s,h,c,l;t&&(n=t.uv,(t=t.tuv)&&(i=n?(r=n[0]+(n[6]-n[0])*e,o=n[1]+(n[7]-n[1])*e,a=n[2]+(n[4]-n[2])*e,s=n[3]+(n[5]-n[3])*e,h=n[2]+(n[4]-n[2])*i,c=n[3]+(n[5]-n[3])*i,l=n[0]+(n[6]-n[0])*i,n[1]+(n[7]-n[1])*i):(a=r=e,c=s=1,l=h=i,o=0),t.push(a,s,h,c,l,i,l,i,r,o,a,s)))},_13O:function(t){var e=t.uv,t=t.tuv;t&&(e?t.push(e[2],e[3],e[4],e[5],e[6],e[7],e[6],e[7],e[0],e[1],e[2],e[3]):t.push(0,1,1,1,1,0,1,0,0,0,0,1))},_tryRemoveBezierPoints:function(e,t){var i=e.length;if(i<4)return e;for(var n,r,o,a,s=!1,h=function(t){return e[t]},c=function(t){return e[i-1-t]},l=0;l<=1;l++)for(n=(o=l?c:h)(0),r=o(1),d=2;d<i-1;d++)(a=o(d)).remove||(a.b&&Fu(n,r,a,t).adjust?s=a.remove=!0:(n=r,r=a));if(!s)return e;for(var u=[],d=0;d<i;d++)e[d].remove||u.push(e[d]);return u},_12O:function(t,e){var i,n,r,o,a,s=this.s("shape3d.point.epsilon"),h=this;t.forEach(function(t){if(0<(a=t.length))for(i={p:t[0],n:!0},o=1;o<a;o++)n=t[o],(r=o<a-1?t[o+1]:U)&&Math.abs(n.x-r.x)<s&&Math.abs(n.y-r.y)<s||h.addPoint(i,n,r,e,t)})},addPoint:function(t,e,i,n,r){var o,a,s,h,c,l,u=this,d=t.p,f=t.f,g=t.b,p=u.s("shape3d.side")||Bs,_=u.s("shape3d.start.angle"),v=u.s("shape3d.sweep.angle"),y=u.shapeModel,m=u.data.isClosePath();if(t.n&&(t.n=!1,f=m&&2<r.length?Fu(r[r.length-2],d,e,n):Fu(U,d,e,n),g=Lu(d,f),y?y.top_vs&&u._10O(g,f,p,_,v,y.top_vs,y.top_uv):(o=u.left)&&(u.addV(o.vs,g,f),u._13O(o))),m=i?Fu(d,e,i,n):m&&2<r.length?Fu(d,e,r[1],n):Fu(d,e,U,n),r=Lu(e,m),y){var b,x,w=y.vs,E=y.uv,n=y.sum;for(E&&(b=y.len/n,y.len+=ys(d,e),x=y.len/n),s=u._9O(g,f,p,_,v),h=u._9O(r,m,p,_,v),c=0;c<p;c++)Mn(w,s[l=c+1]),Mn(w,h[c]),Mn(w,s[c]),Mn(w,h[c]),Mn(w,s[l]),Mn(w,h[l]),E&&(a=c/p,l=l/p,E.push(b,l,x,a,b,a,x,a,b,l,x,l));!i&&y.bottom_vs&&u._10O(r,m,p,_,v,y.bottom_vs,y.bottom_uv,!0)}else!i&&(o=u.right)&&(u.addV(o.vs,m,r),u._13O(o)),(o=u.front)&&u.addV(o.vs,f,m),(o=u.back)&&u.addV(o.vs,r,g),(o=u.top)&&u.addH(o.vs,f,m,r,g,!0),(o=u.bottom)&&u.addH(o.vs,g,r,m,f);t.p=e,t.f=m,t.b=r},_10O:function(t,e,i,n,r,o,a,s){for(var h,c,l=this.data,u=this._9O(t,e,i,n,r),d=(t.x+e.x)/2,f=(t.y+e.y)/2,g=l.getShapeElevation(),p=0,p=0;p<i;p++)s?(Mn(o,u[p]),Mn(o,u[p+1])):(Mn(o,u[p+1]),Mn(o,u[p])),Mn(o,[d,g,f]),a&&(c=s?(h=J*(p+1)/i+n,J*p/i+n):(h=J*p/i+n,J*(p+1)/i+n),a.push(.5-.5*Q(c),.5-.5*Z(c),.5-.5*Q(h),.5-.5*Z(h),.5,.5))},_9O:function(t,e,i,n,r){var o,a,s=this.data,h=[],c=(t.x+e.x)/2,l=(t.y+e.y)/2,u=s.getTall()/2,d=s.getShapeElevation(),f=0;for(r==U&&(r=J);f<=i;f++)a=Q(o=r*f/i+n),h.push([c+(t.x-c)*a,d+u*Z(o),l+(t.y-l)*a]);return h},addV:function(t,e,i){var n=e.x,r=e.y,o=i.x,a=i.y,e=this.data,i=e.getShapeElevation(),e=e.getTall()/2;t.push(n,i-e,r,o,i-e,a,o,i+e,a,o,i+e,a,n,i+e,r,n,i-e,r)},addH:function(t,e,i,n,r,o){var a=this.data,s=a.getTall()/2,s=a.getShapeElevation()+(o?s:-s);t.push(e.x,s,e.y,i.x,s,i.y,n.x,s,n.y,n.x,s,n.y,r.x,s,r.y,e.x,s,e.y)},vf:function(t,e,i,n){var r,o=this.gv.getFaceVisible(this.data,t);return(i||o)&&((r=Rd(this,t,n)).vs=[],r.tuv=o&&(r.texture||e)?[]:U,r.visible=o),r}}),zs(ap=function(t,e){Bn(ap,this,[t,e])},tp,{validate:function(){var t=this,e=t.gv,i=t.data,n=t.s,r=[(r=to(n("points.color")))[0],r[1],r[2]],o=n("points.size"),a=n("points.image")||"rect";"rect"!==a&&"circle"!==a||(a="rect"===a?rp=rp||t._createCachedImage(a):op=op||t._createCachedImage(a));var s=n("points.model");if(s){if(t._lastShapeModel!==s||!t.shapeModel){var h=Gf(t,s);if(!h)return;var c=[],l={};t.eachShapeModel(function(t){for(var e=0,i=t.length;e<i;e+=3){var n=t[e],r=t[e+1],o=t[e+2],a=n+"_"+r+"_"+o;l[a]||(l[a]=!0,c.push(n,r,o))}},h),t.shapeModel={vs:new js(c)},i._pointsDirty=!0,t._lastShapeModel=s}}else{var s=i.points,u=s.length,d=u/3;!i._pointsDirty&&t.shapeModel||(s=new js(s),t.shapeModel={vs:s},i._pointsDirty=!1,t._lastShapeModel=null)}if(t.info={mat:$s(i),size:o,diffuse:r,opacity:n("points.opacity"),texture:a,alphaTest:n("points.transparent")?0:n("alphaTest")},i._colorsDirty){for(var f,g,p,_=[],v=!1,y=i.colors,m=0;m<u;m+=3)f=y[m],g=y[m+1],p=y[m+2],f===H||g===H||p===H?_.push(r[0],r[1],r[2]):(v=!0,_.push(f,g,p));t.shapeModel.cs=v?new js(_):null,i._colorsDirty=!1}if(i._sizesDirty){for(var b=[],x=!1,w=i.sizes,m=0;m<d;m++)w[m]?(b.push(w[m]),x=!0):b.push(o);t.shapeModel.ss=x?new js(b):null,i._sizesDirty=!1}if(t._lastPointNumber!==d){var E=e.pickColorMap,T=E._pickIdUsed;E._pickIdUsed=T+d;for(var S=[],m=0;m<d;m++){var I=T+m,C=zg(I);S.push(C[0],C[1],C[2],C[3]),E[I]||(E[I]={data:i,part:m})}t.shapeModel.ps=new js(S),t._lastPointNumber=d}this.dispatchBoundingBoxChanged()},_createCachedImage:function(t){var e=er(),i=e.getContext("2d");rr(e,128,128,1),wh(i,{width:128,height:128,comps:[{type:t,background:"white",borderWidth:0,rect:[0,0,128,128]}]},0,0,128,128);t=Gl.Math.generateUUID();return Oi[t]=e,t},_80o:function(t,e){var i,n,r,o=this.gv,a=this.shapeModel,s=this.info;a&&a.vs&&a.vs.length&&((i=yu.for(t)).useProgram(this._asureProgram(t)),i.directState(),n=i.directUniforms(),r=i.directAttribs(),n.modelMatrix=s.mat,n.modelViewMatrix=Uu([],o._viewMatrix,s.mat),n.projectionMatrix=o._projectMatrix,n.viewMatrix=o._viewMatrix,n.scale=o.getHeight()/2,n.size=s.size,n.diffuse=s.diffuse,n.opacity=s.opacity,n.map=o.getTexture(s.texture,this.data),n.alphaTest=s.alphaTest,n.resolution=o.getDevicePixelRatio(),r.position=gd(t,o._buffer.vs,a.vs,U),o._picking?(n.picking=!0,r.pickColor=gd(t,o._buffer.ps,a.ps,U),n.useColor=!1,r.color=null):(n.picking=!1,r.pickColor=null,a.cs?(n.useColor=!0,r.color=gd(t,o._buffer.cs,a.cs,U)):(n.useColor=!1,r.color=null)),a.ss?(n.useSizeArray=!0,r.sizeArray=gd(t,o._buffer.ss,a.ss,U)):(n.useSizeArray=!1,r.sizeArray=null),ud(t,0,a.vs.length/3,t.POINTS),i.useProgram(e))},_asureProgram:function(t){return t._pointsShader||(t._pointsShader=this.gv._postProcessing.createShader(t,ap.shaderSrc)),t._pointsShader.program}}),ap.shaderSrc="!\v\v!~v!o\vj<g*p!s{n/!onpbjuu5j!tnppQewfnm!N.b!u0s!jfym<b\vd!tv!o)j!g>p+s!nf!{njbTuu5o!jnppQe`fmmhW!j*f!xfNwbjuusdjfyq<t\vs!fvQotjjg!p)s!ng!jn!b\vu<5*!!q1s/p2k!f.d!u>j>p!o^N!b4u!s]j^y!<3\v!!]vyojjsgupbsNno!pnjbuud5f!kwpjsfqx!N)b!u>s!jfyw<j\vu!dvfoqjtgspfsQnt!jg!mmppbpuc!!t\vd\vb\vm~f!<\v\v<\vo!pbjuuuvsmjpctvfusf!!+w!ffd{4j!tq!p>t!jfu{jjpTou<o\vj\vp!Qv`omjhg!p\vs|n!!fctpmpfm!!~v!t\vf<Doppmjpusv<m\vp!tbfusu!s+j!czvbusfs!Bwff{dj4t!!d>p!mfp{sj<T\vu!owjbpsQz`jmohh!!\vw|f!d*5z!bwsDspBmfp{sj<T\vf\vt!vv)o!jggjp!s\vn<!ocppjpumj!tqpjQdwlnj!o+h!<y\vj!sbuubuNsojpcjvuudff!kwpfsdq5!!>q!jodpljDupjmtppsQ<`\vm\vh!!v\vo<jogppjsunj!tgpmQpwbnu!!+t!jy{jfs<u\vb!NvxofjjgWpmsfne!pgnm!p>b!uo!psjfutjptmpvQuwjnp!o\v<<\v*!!v1o/j2g!p-senf!ncspppgmt!ovbtsfuT!j){5fdBfsws!b>z!<o\vp!jbuujutspjQcwvnu!f5!dgfmwp!b\vu<!*t!jo{pfjBusjstbpzq<!\v)\v4!dcfpwp!m>!!jetfQnfssptgqtfodbusjuw!f4Ndbfuws!j\vy~)!!\vn<b*u15/!2n!!-*s!p|m\vp!ds)f5udvfswo!!>n!]s!p3m!p^D]w!!4\v!|^!!*>s>p!m.p!D2f/t1v<)\v!!g~j\v!\vf!twmpfj!e\v!~n!b\vj<os)p*m!p|D\vl!djjgq!!)>q!jsdplmjpoDhw*!!\v|^#!\v\v!~q\vs~f!d\vj<tsjppmop!Difjthvigqg!jgem!p>b!us<p\vm!p$DehfbgsjGo`fm!hV!T\vF|`!NfBtQm\vf\v!!\vv~o!j\vg<psspnm!pwDfwd!4>!!esjpgmgpvDthfb<s\vG!`vmohj!g\vp<sens!bgdmtpjbeu!!*p1q/b1d!j>u>z!<b\v/!svpomjpgDpfstnv!gggmjpeb)u!!gbjm!q\vi|b!U*fhtouj<l\vd\vj!qv)o!jggjp!s\vn<!ecspbpdmt!jvet!f*DuptmfpUsb<i\vq!mwbb!s=z!jbo/hs!pwmfpdD5f!twvDgpgmjpes)<!\vg\vj!!v\vogjjgeposfn$!!c\vp~p!m\v!<q*j!delsjpophD<u\vo!jvpoQj`gmphs!n-!qcbpnp!m)!Ee3jftsdvbusyefTuf!m>f+d!usbpcmmpfD<f\vt\vv\vg$gjjge!!e\vf|g!j*offmec)b!uVdTfFm`fNTBeQs!b*d\vt!jveoaj!g}p}s!nh!otjblndqjmqfas)3!Eg!jn!b\vq*<!\vQ$BfNo`eFjTgV\v!\v)wepfjoej!gnfbej!og)j*$!!|\v\v~!!w\vf<d*5!!zeujjgdgbvqtpf!D-pfmtpvsg<g\vj!ej!g)!5)dafqwj!d>l!jsophm!p%D%f!tvvtgfgDjpem!p\vs|*!!f|t\vm!fe!j~g!g\vv<t*f!Dzpumjpdsb!q>p!!w-f{dz5y)/!swpDmp",zs(sp=function(t,e){Bn(sp,this,[t,e]),this._needRecoverPosition=!0},$g,{_25Q:1,validate:function(t){var e=this,i=e.data,n=e.s,r=i.getPoints(),o=r.size();e.dispatchBoundingBoxChanged();var a=i.p3(),s=e.mat=Hs();ju(s,a),fl(s,i.getFinalRotation3d(),i.getRotationMode());var h,c=i.getScale3d(),l=i._dynamicScale3d;l&&(c[0]*=l[0],c[1]*=l[1],c[2]*=l[2]),Nu(s,c),ju(s,Us(a)),e.s("geometry.cache")&&e.shapeModel||(e.shapeModel=e.info=U,!(1<o))||(h=e.info={},l=i.getSegments(),c=i.getThickness(),s=Mu(r.get(0)),a=Mu(r.get(o-1)),0==(i=o%2)?(h.c1=Mu(r.get(o/2-1)),h.c2=Mu(r.get(o/2))):h.p3=Mu(r.get((o-i)/2)),h.s1=s,h.s2=Mu(r.get(1)),h.t1=Mu(r.get(o-2)),h.t2=a,h.list=n(Ve)===Et?e.createTubeModel(r,l,c/2,t):e.createLineModel(r,l,c,"shape.border","shape.dash"))},invalidateCachedGeometry:function(){this.shapeModel=this.info=U},_80o:function(t,e,i){var n,r=this.shapeModel;r&&(n=this.gv,xd(n,this.mat),jf(n,this.data,r,this,this.getBodyColor(),i),md(n))}}),hp=Gl.graph3d.VR=function(t){var e=this;e.gv=t,e._controllers=[],e.switch=new lp(e),e._enable=!1,e._defaultCallLater=Gl.Default.callLater,e._defaultCancelLater=ts,void 0!==C&&"VRFrameData"in C&&(e._frameData=new C.VRFrameData),e.measureOflength=1,e.eyesOffset=[0,0,0],e._orientation=new na.Quaternion,e._lastHeadPose=[0,0,0],e._offsetToBeAdd=[0,0,0],e._originalOrientation=null,e._fpsInfo={time:0,fps:0,frames:0}},zs(hp,L,{ms_fire:!0,setOriginalYRotation:function(t){if(null!=t){var e=new na.Vector3(0,1,0),i=(new na.Quaternion).setFromAxisAngle(e,-t),n=(new na.Matrix4).makeRotationFromQuaternion(i);return i.setFromAxisAngle(e,t),this._originalOrientation={quaternion:i,matrixInverse:n},!0}this._originalOrientation=null},render:function(t,e,i){var n=this,r=n.gv;if(n._deviceInAction){var o=n._device;if(o){var a=n._measureOflength;o.depthNear=r.getNear()*a,o.depthFar=r.getFar()*a;var s=n._offsetToBeAdd;if(n.eyesOffset[0]+=s[0],n.eyesOffset[1]+=s[1],n.eyesOffset[2]+=s[2],s[0]=0,s[1]=0,s[2]=0,!1===o.isPresenting)return n._controllers.forEach(function(t){t&&t.update()}),r.iv(),!1;a=n._frameData;o.getFrameData(a);s=a.pose.position;s&&(o=n.toViewPosition(s),r.setEye(o),n._orientation.fromArray(a.pose.orientation),n._originalOrientation&&n._orientation.premultiply(n._originalOrientation.quaternion),(s=new na.Vector3(0,0,-10*n._scaleFactor)).applyQuaternion(n._orientation),r.setCenter([o[0]+s.x,o[1]+s.y,o[2]+s.z])),n._controllers.forEach(function(t){t&&t.update()}),r.setViewport(t,0,0,e/2,i),n._viewMatrix=n._copyViewMatrix(a.leftViewMatrix),n._projectMatrix=n._copyProjectMatrix(a.leftProjectionMatrix),r.updateScene(),r.renderScene(),r.setViewport(t,e/2,0,e/2,i),n._viewMatrix=n._copyViewMatrix(a.rightViewMatrix),n._projectMatrix=n._copyProjectMatrix(a.rightProjectionMatrix),r.updateScene(),r.renderScene(),n._lastViewMatrix=n._viewMatrix,n._lastProjectMatrix=n._projectMatrix,n._viewMatrix=null,n._projectMatrix=null,n.submitFrame();r=Date.now(),n=n._fpsInfo;return 1e3<r-n.time?(n.fps=Math.round(1e3*(n.frames+1)/(r-n.time)),n.time=r,n.frames=0):n.frames++,!0}}},onVRDisplayPresentChange:function(){var t=this.isPresenting();this._injectGraphView(t),this.fp("present",!t,t)},getOrientation:function(){return this._orientation},addController:function(t){t=t||0;var e=this.getController(t);return e||(e=new cp(this,t),this._controllers.push(e),e)},getController:function(t){t=t||0;for(var e=this._controllers,i=0,n=e.length;i<n;i++)if(e[i]&&e[i].id===t)return e[i];return null},removeController:function(t){t=t||0;for(var e=this._controllers,i=0,n=e.length;i<n;i++)if(e[i]&&e[i].id===t)return e.splice(i,1),!0;return!1},getLastHeadPose:function(){return this._lastHeadPose},toViewPosition:function(t,e){var i,n=this._scaleFactor,r=this._eyesOffset,o=this._lastHeadPose;return this._originalOrientation?(i=this._originalOrientation.quaternion,new na.Vector3(t).applyQuaternion(i).multiplyScalar(n).toArray(o)):(o[0]=t[0]*n,o[1]=t[1]*n,o[2]=t[2]*n),e?(e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e):[o[0]+r[0],o[1]+r[1],o[2]+r[2]]},addEyesOffset:function(t,e,i){var n=this._offsetToBeAdd;n[0]+=t,n[1]+=e,n[2]+=i},_copyViewMatrix:function(t){var e=this.dup(t);this._originalOrientation&&(new na.Matrix4).fromArray(e).multiply(this._originalOrientation.matrixInverse).toArray(e);var i=this._scaleFactor;e[12]*=i,e[13]*=i,e[14]*=i;var n=this._eyesOffset;return n&&(n[0]||n[1]||n[2])&&(t=n[0],i=n[1],n=n[2],e[12]-=e[0]*t+e[4]*i+e[8]*n,e[13]-=e[1]*t+e[5]*i+e[9]*n,e[14]-=e[2]*t+e[6]*i+e[10]*n),e},shutdown:function(){var t=this._device;t&&t.isPresenting&&t.exitPresent()},isPresenting:function(){var t=this._device;return t&&t.isPresenting},_copyProjectMatrix:function(t){var e=this.dup(t),t=this._scaleFactor;return e[14]*=t,e},dup:function(t,e){for(var i=t.length,n=e||new Array(i);i--;)n[i]=t[i];return n},getViewMatrix:function(t){var e=this._viewMatrix;return e?this.dup(e,t):void 0},getProjectMatrix:function(){var t=this._projectMatrix;return t?this.dup(t):void 0},submitFrame:function(){var t;this._enable&&this._deviceInAction&&((t=this._device)&&t.isPresenting&&(t.submitFrame(),this.gv.iv()))},getFps:function(){return this._fpsInfo.fps},intersectWorld:function(t){var e=this.gv;return e.intersectObjects(t,e.dm().getDatas())},setDevice:function(t){this._device=t},_injectGraphView:function(t){var e,i,n=this.gv;t?(t=this._device.getEyeParameters("left"),e=t.renderWidth,i=t.renderHeight,Hp=n.getWidth,Wp=n.getHeight,qp=n.getDevicePixelRatio,n.getWidth=function(){return 2*e},n.getHeight=function(){return i},n.getDevicePixelRatio=function(){return 1}):Hp&&(n.getWidth=Hp,n.getHeight=Wp,n.getDevicePixelRatio=qp)},_injectCallLaterFunc:function(t){var o=this;if(!t)return $a=Gl.Default.callLater=o._defaultCallLater,void(ts=Gl.Default.cancelLater=o._defaultCancelLater);o=this;$a=Gl.Default.callLater=function(t,e,i,n){var r=o._device;return r&&r.isPresenting?n?w(function(){$a(t,e,i)},n):r.requestAnimationFrame(function(){o._deviceInAction=!0,t.apply(e,i),o._deviceInAction=!1}):o._defaultCallLater(t,e,i,n)},ts=Gl.Default.cancelLater=function(t,e){var i=o._device;return i&&i.isPresenting?e?E(t):i.cancelAnimationFrame(t):o._defaultCancelLater(t,e)}}}),L.defineProperties(hp.prototype,{enable:{get:function(){return this._enable},set:function(t){this._enable!==t&&((this._enable=t)?(this.switch.showButton(),this._injectCallLaterFunc(!0)):(this.shutdown(),this.switch.hideButton(),this._injectCallLaterFunc(!1)),this.fp("enable",!t,t))}},measureOflength:{get:function(){return this._measureOflength},set:function(t){this._measureOflength=t;var e=this._scaleFactor=1/t;this._controllers.forEach(function(t){t&&t._setScaleFactor(e)})}},eyesOffset:{get:function(){return this._eyesOffset},set:function(t){this._eyesOffset=t}},controllerModel:{get:function(){return this._controllerModel},set:function(t){var e;"object"==typeof t?(e=t.mtl,t=t.obj):(e=t+".mtl",t+=".obj");var i=this,n=i._controllerModel;n&&n.obj===t&&n.mtl===e||(n=i._controllerModel={obj:t,mtl:e},G.loadObj(t,e,{finishFunc:function(t,e){i._controllerModel===n&&G.setShape3dModel("vrControllerModel",e)}}))}},interactive:{get:function(){return!!this._interactive},set:function(t){!!t!=!!this._interactive&&((this._interactive=t)&&this.addController(0),this.gv.getCoreInteractor().enableVR(t))}}}),cp=function(s,h){function c(t,e,i){return Math.abs(t[0]-e[0])<i&&Math.abs(t[1]-e[1])<i&&Math.abs(t[2]-e[2])<i}var l=this;l.vr=s,l.id=h;var u,d=[0,0],f=[{id:"thumbpad",pressed:!1},{id:"trigger",pressed:!1},{id:"grips",pressed:!1},{id:"menu",pressed:!1}],g=new cl;g.s("shape3d","vrControllerModel"),g.isController=!0,g.s("intersect",!1),l.getGamepad=function(){return u},l.isButtonPressed=function(t){for(var e,i=0,n=f.length;i<n;i++)if((e=f[i]).id===t)return e.pressed;return!1},l.getNode=function(){return g};var p=.003;l.setRotationEpsilon=function(t){p=t};var e=5e-4,_=e;l.setPositionEpsilon=function(t){_=(e=t)*l.vr._scaleFactor},l._setScaleFactor=function(t){g.s3(t,t,t),_=e*t},l._setScaleFactor(l.vr._scaleFactor);var v,y=new aa,m=new fa,b=[0,0,0],x=[0,0,0],w=new pa,E=new ha,t=new ua;l.getRay=function(){return v&&(t.origin.fromArray(b),t.direction.copy(E),v=!1),t},l.update=function(){if(!(u=function(t){var e=navigator.getGamepads&&navigator.getGamepads();if(e)for(var i=0,n=0,r=e.length;i<r;i++){var o=e[i];if(o){var a=o.id;if("OpenVR Gamepad"===a||0===a.indexOf("Oculus Touch")||0<=a.indexOf("Controller")){if(n===t)return o;n++}}}}(h))||u.pose===H)return u=null,void g.s("3d.visible",!1);if(G.getShape3dModel("vrControllerModel")){g.dm()||s.gv.dm().add(g),g.s("3d.visible",!0);var t=u.pose;if(null!==t){t.position&&(l.vr.toViewPosition(t.position,b),c(g.p3(),b,_)||(v=!0,g.p3(b))),t.orientation&&(y.fromArray(t.orientation),(e=l.vr._originalOrientation)&&y.premultiply(e.quaternion),E.set(0,0,-1).applyQuaternion(y).normalize(),m.makeRotationFromQuaternion(y),w.set(0,0,0,g.getRotationMode(),!0).setFromRotationMatrix(m),x[0]=w.x,x[1]=w.y,x[2]=w.z,c(g.r3(),x,p)||(v=!0,g.r3(x))),v&&s.fp("gamepad.pose",null,{position:b,rotation:x,id:h});var e=u.axes;d[0]===e[0]&&d[1]===e[1]||(d=[e[0],e[1]],s.fp("gamepad.axes",null,{id:h,axes:d}));for(var i,n,r=u.buttons,o=0,a=r.length;o<a;o++)(n=r[o])&&(i=n.pressed,f[o]||(f[o]={id:"button"+o,pressed:!1}),i!==f[o].pressed)&&(f[o].pressed=i,(n={id:h}).state=n._62O=i?"down":"up",s.fp("gamepad.button."+f[o].id,null,n))}}}},zs(lp=function(t){this.vr=t,this._button=null},L,{showButton:function(){var t,e,i=this.assureButton();i.parentNode||(e=(t=this.vr.gv).getView(),t._79O?e.insertBefore(i,t._79O):e.appendChild(i))},hideButton:function(){var t=this._button;t&&t.parentNode&&t.parentNode.removeChild(t)},assureButton:function(){var t=this._button;return t||(this._button=this.createButton(this.vr.gv))},createButton:function(e){function i(t,e){t.textContent=e&&e.isPresenting?"关闭 VR 显示":"开启 VR 显示"}function n(t){o.style.display="",o.style.cursor="pointer",o.style.left="calc(50% - 50px)",o.style.width="100px",i(o,t),o.onmouseenter=function(){o.style.opacity="1.0"},o.onmouseleave=function(){o.style.opacity="0.5"},o.onclick=function(){t.isPresenting?t.exitPresent():t.requestPresent([{source:e.getCanvas()}])},e.vr.setDevice(t)}function r(){o.style.display="",o.style.cursor="auto",o.style.left="calc(50% - 75px)",o.style.width="150px",i(o,null),o.onmouseenter=null,o.onmouseleave=null,o.onclick=null,e.vr.setDevice(null)}function t(t){t.style.position="absolute",t.style.bottom="20px",t.style.padding="12px 6px",t.style.border="1px solid #fff",t.style.borderRadius="4px",t.style.color="#000",t.style.font="normal 13px sans-serif",t.style.textAlign="center",t.style.opacity="0.5",t.style.outline="none",t.style.zIndex="999"}if("getVRDisplays"in navigator){var o=this._button=d.createElement("button");return o.style.display="none",t(o),g(C,"vrdisplayconnect",function(t){n(t.display)}),g(C,"vrdisplaydisconnect",function(){r()}),g(C,"vrdisplaypresentchange",function(t){i(o,t.display),e.vr.onVRDisplayPresentChange()}),navigator.getVRDisplays().then(function(t){0<t.length?n(t[0]):r()}),o}var a=d.createElement("a");return a.href="https://webvr.info",a.innerHTML="当前不支持 webvr",a.style.left="calc(50% - 90px)",a.style.width="180px",a.style.textDecoration="none",t(a),a}}),L.defineProperties(lp.prototype,{}),up=Gl.graph3d.PostProcessing=function(h){var c,l,u,d,f=this,g={},p=!1;L.keys(up).forEach(function(t){g[t]=new up[t](h)}),f.getModule=function(t){return t?g[t]:f},f.getModuleList=function(){return L.keys(g)},f._serializable=!0,f.handleDataModleChange=function(t,e){t&&(f._serializable&&t.setPostProcessingData(f.serialize()),t.removeSerializeListener(f.onDataModelSerialize,f)),e&&(e.addSerializeListener(f.onDataModelSerialize,f),f.deserialize(e))},f.onDataModelSerialize=function(t){"serialize"===t.type?f._serializable&&(h.dm()._postProcessingData=f.serialize()):"deserialize"===t.type&&f.deserialize(h.dm())},f.isDeserializeDisabled=function(t){return!f._serializable||t.a("sceneBloom")!==H},f.isSerializable=function(){return f._serializable},f.setSerializable=function(t){(f._serializable=t)||h.dm().setPostProcessingData(H)},f.serialize=function(){var t,e,i,n,r={};for(e in g)if(i=g[e],n=i.serializeProperties){for(var o in t={},i.enable&&(t.enable=!0),n){var a=i[o];a!=n[o]&&(t[o]=a)}L.keys(t).length&&(r[e.toLowerCase()]=t)}return r},f.deserialize=function(t){var e,i,n,r,o={},a={};for(e in g){r=(n=g[e]).serializeProperties;var s,h={},c="scene"+e;for(s in(l=t.a(c))!==H&&(h.enable=l),r)l=t.a(c+s[0].toUpperCase()+s.slice(1)),l!==H&&l!==r[s]&&(h[s]=l);zn(h)||(a[e[0].toLowerCase()+e.slice(1)]=h)}if(zn(a)&&(a=t.getPostProcessingData()),a)for(i in a)if(i&&(e=i[0].toUpperCase()+i.slice(1),n=g[e])){o[e]=!0;var l,u=!!(r=a[i]).enable;for(s in f.enableModule(e,u),e="scene"+e,t.a(e,u),n.resetProperties&&n.resetProperties(),r)"enable"!==s&&(l=r[s],n[s]=l,t.a(e+s[0].toUpperCase()+s.slice(1),l))}for(e in g)o[e]||(n=g[e],n.enable=!1,n.resetProperties&&n.resetProperties())},f.decodeShader=function(t){for(var e,i="",n="",r=0;r<t.length;r++)"%"===(e=t[r])?e="'":"a"===e?e='"':"]"===e&&(e="\\"),e=String.fromCharCode(e.charCodeAt(0)-1),r%2?n+=e:i=e+i;return n+i},f.createShader=function(t,e,i){var n=e.indexOf("^#"),r=f.decodeShader(e.substr(0,n)),n=f.decodeShader(e.substr(n+2));return i&&((i=i(r,n))&&i.vs&&(r=i.vs),i&&i.fs&&(n=i.fs)),new Zf.Shader(t,r,n)},f.enableModule=function(t,e){for(var i,n=t.split(","),r=0,o=n.length;r<o;r++)i=n[r].trim(),g[i]&&(g[i].enable=e);for(i in p=!1,g)if(g[i].enable){p=!0;break}p&&(c||(t=h.getGL(),c=new Bd.RenderTarget(h,t,null,null,{samples:F.renderTextureSamples||1}),l=new Zf.Shader(t,a.vs,a.fs),u=Zf.Buffer.createIndexBuffer(t,new Uint16Array([0,2,1,1,2,3])),d=Zf.Buffer.createVertexBuffer(t,new Float32Array([0,0,1,0,0,1,1,1]))))};var a={vs:["attribute vec2 pos;","varying vec2 vUv;","void main(void) {","gl_Position = vec4(pos.x * 2.0 - 1.0, -pos.y * 2.0 + 1.0, 0.0, 1.0);","vUv = vec2(pos.x, 1.0 - pos.y);","}"].join("\n"),fs:["precision highp float;","uniform sampler2D image;","varying vec2 vUv;","void main() {","gl_FragColor = texture2D(image, vUv);","}"].join("\n")};f.render=function(t,e,i){if(p){c.setSize(t,e,i),c.bind(t);var n=t.getParameter(t.COLOR_CLEAR_VALUE);n&&0===n[0]&&0===n[1]&&0===n[2]&&0===n[3]?n=null:nd(t,[0,0,0,0]),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),h.setViewport(t,0,0,e,i),h.renderScene(),c.unbind(t);for(var r=0,o=h._glCapabilities.maxAttributes;r<o;r++)t.disableVertexAttribArray(r);var a,s=c;for(a in g)s=g[a]._42(t,s)||s;return h.setViewport(t,0,0,e,i),n&&nd(t,n),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),l.bind(),t.activeTexture(t.TEXTURE0+0),$u(t,s.texture),l.uniforms.image=0,u.upload(),d.upload(),l.attributes.pos.pointer(d),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),$u(t,null),t.useProgram(h._prg),!0}}},(dp=Gl.graph3d.PostProcessing.Bloom=function(c){function a(){var t=c.getGL();if(t)for(var e=c._postProcessing,i=0;i<C;i++)M[i]=e.createShader(t,dp._35Q,function(t,e){return{fs:e.replace(/DEFINE_VALUE/g,r[i]).replace("%OVERRIDE_ALPHA_DEFINE%",n?"#define OVERRIDE_ALPHA":"")}})}function l(){var t=c.getWidth(),e=c.getHeight();if(t&&e){T=[t,e],m=!0;var i,n=c.getGL(),r=Math.round(T[0]/2),o=Math.round(T[1]/2);for(b=new Bd.RenderTarget(c,n,r,o),i=0;i<C;i++)S.push(new Bd.RenderTarget(c,n,r,o)),I.push(new Bd.RenderTarget(c,n,r,o)),r=Math.round(r/2),o=Math.round(o/2);e=c._postProcessing;x=e.createShader(n,dp._34Q),a(),w=e.createShader(n,dp._36Q,function(t,e){return{fs:e.replace(/NUM_MIPS/g,C)}}),E=e.createShader(n,dp.finalShader),p=Zf.Buffer.createIndexBuffer(n,new Uint16Array([0,2,1,1,2,3])),_=Zf.Buffer.createVertexBuffer(n,new Float32Array([0,0,1,0,0,1,1,1]))}}var u,d,f,n,g,p,_,v,y=!1,m=!1;this.serializeProperties={strength:1.5,threshold:.55,radius:.4,overrideAlpha:!0,selective:!1},this.resetProperties=function(){var t,e=this.serializeProperties;for(t in e)this[t]=e[t]},L.defineProperties(this,{enable:{get:function(){return y},set:function(t){!!y!=!!t&&((y=t)&&!m&&l(),c.iv())}},strength:{get:function(){return u},set:function(t){u!==t&&(u=t,c.iv())}},threshold:{get:function(){return d},set:function(t){d!==t&&(d=t,c.iv())}},radius:{get:function(){return f},set:function(t){f!==t&&(f=t,c.iv())}},overrideAlpha:{get:function(){return n},set:function(t){!!n!=!!t&&(n=t,m&&a(),c.iv())}},selective:{get:function(){return g},set:function(t){!!g!=!!t&&(g=!!t,c.iv())}}}),this.resetProperties();var b,x,w,E,T=[256,256],S=[],I=[],C=5,r=[3,5,7,9,11],M=[];this._42=function(s,t){function e(t,e,i,n){wu(s,e.frame),c.setViewport(s,0,0,e.width,e.height),n?n(s):s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),h!==t&&t.bind();var r,o=0;for(r in i){var a=i[r];a instanceof WebGLTexture&&(s.activeTexture(s.TEXTURE0+o),$u(s,a),a=o,o++),t.uniforms[r]=a}for(h!==t&&(p.upload(),_.upload(),t.attributes.pos.pointer(_),h=t),s.drawElements(s.TRIANGLES,6,s.UNSIGNED_SHORT,0);o--;)s.activeTexture(s.TEXTURE0+o),$u(s,null);Eu(s)}if(y&&(m||(l(),m))){var h,i;g&&((v=v||new Bd.RenderTarget(c,s)).setSize(s,t.width,t.height),v.bind(s),(i=s.getParameter(s.COLOR_CLEAR_VALUE))&&0===i[0]&&0===i[1]&&0===i[2]&&1===i[3]?i=null:nd(s,[0,0,0,1]),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),c.setViewport(s,0,0,t.width,t.height),s._blooming=!0,c.renderScene(),s._blooming=!1,i&&nd(s,i),v.unbind(s)),e(x,b,{smoothWidth:.01,luminosityThreshold:d,tDiffuse:(g?v:t).texture});for(var n=b,r=Math.round(T[0]/2),o=Math.round(T[1]/2),a=0;a<C;a++)e(M[a],S[a],{colorTexture:n.texture,direction:[1,0],texSize:[r,o]}),e(M[a],I[a],{colorTexture:S[a].texture,direction:[0,1],texSize:[r,o]}),r=Math.round(r/2),o=Math.round(o/2),n=I[a];return e(w,S[0],{blurTexture1:I[0].texture,blurTexture2:I[1].texture,blurTexture3:I[2].texture,blurTexture4:I[3].texture,blurTexture5:I[4].texture,bloomStrength:u,bloomRadius:f,bloomTintColor:[1,1,1]}),e(E,t,{image:S[0].texture},function(t){yu.for(t).glState.blend.apply({enabled:!0,equation:t.FUNC_ADD,func:[t.SRC_ALPHA,t.ONE]})}),yu.for(s).glState.blend.apply({equation:s.FUNC_ADD,func:[s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA]}),t}}})._34Q="~b\vu<u*szj/ctvpuqf!!.w!f1d/32!!q-pyt/<t\vpwqb)s3zdjfowh!!>w!fwdV3w!\vw<V*w1</\v2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+h!mz`/Qtpptqj.u!j-p1o/!2>!!.w!f1d/53)!q+p!ty/^#~q\vs<f*d!jbtijqpmob!!i-jmhfiyqf!ug!m-psbpum<p\vDvuovjqgupvspn!!)tybjnnq!m>f!ss3pEm!puDEhjbgsgGv`tmfh<\v\v<v*o!jwg!p-sinu!egjmXpibuup!pmnvtn!j,o!petmjpuiztUfissifUtziupjmtep<o\vjvnovjmg!p-senm!pgimtpfbsui!UtznupjptupioXjjnevumi!<)\vqwfbustzijuophp!nwtf!d>3!!bwiVqwm<b\v!wupbjpem!gn\vb<j*o1)/*1!!|-\v1w/f1d!5-!1u/f1y!f-m1!/>1!)u5fdyfuwv!s>f!3sEp)m!puDEujvgqguvvtpf!-5!dwfVww\v!<**<!\vbwnfvdm4!!-m{vznyb/!m>f!ywffud!4))u!p1e/!3>:!:w-!!u1b/p6m9g8\v-<!*1!/522",dp._35Q="~b\vu<u*szj/ctvpuqf!!.w!f1d/32!!q-pyt/<t\vpwqb)s3zdjfowh!!>w!fwdV3w!\vw<V*w1</\v2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+h!mz`/Qtpptqj.u!j-p1o/!2>!!.w!f1d/53)!q+p!ty/^#~q\vsgfjdejotfj$p\vo<!*ibj/hyijqQ!fgsmvpubyuf<u\v!w-bnsvzTjuoihh!jwffxd03n!vwTVfwt<v\vgvgojjeg)p5sdnf!wt!b>n!qsmpfmsp3DEh!bdspGm`pmshU\vffytumvfs$f\v<<\v*v1o/j2g!p-snnv!Twufidh3j!fuxf0ynTvjT{fft<v\vgvgojjeg)p5sdnf!ww!f>d!3s!pemjpsDfhdbusjGp`om<h\v\v$BeIfQgMjBo`fF!ELJFSSSOFFWMP`!SgBfEeJgVjT$!\vE~F\vG<JxO!F+`!W1B/M3V!F>\v,$!enfvgTjuoifh!jTfJxH\vN<Bx!!E+F!G*J3OfFm`qWnBbMtV!F,\v!&2PfWmFqSnSbJtE)F!`>B,M!QnIvBT`fEtFvGgJgOjFe&\v\v<gcmhpsb/u*!uhfbtvgtgtPjwbvo!Q.e!gw)Vjwo!!-gfmspvbuuy!fyU-s!pjmop!dg!m)pEb3uf!stvjuhynfbu*!!>|!\v3sffmuqvnsbot!!14/d4f:w9\v:<5c!h+s!/f*yuqf)t!g.g1P/w6v!!+,!!yw!V+w!!y-0f)s!vtujyhfnUbs!p+m!ptdj!h)nEb3*f*s0vtujyhfnub!<>\v!~2\vfwmpqjneb!tn!b4jdof)w*\v!<|y\v!w+f!df3{!jjTowwoTjj!{+f!!o>p!j2u/d1f!s0j!eu!f>y!Tujf{tfg<g\vPgwmvp!b3ud!fgwT\vj<h*nbbn!h>j!Tggm!p-byu))gTeJQHoNbBj*t<t\vvgbmhp!b>u!!xx!fujbhpimugT\vv<n*!j>)!uhbbpvmtgt!j>b!oyQ!eugb)p1m/g1\v-|!!g*T!j,h,n!bj*!<<\vTwVfJdE5B!Su`fMyFuOvSsFfLQ!j=y!!j>!!<u2f!y>u!vjs!fu3oEj)!!)dsppmgp\vs<UnfvyTuuvishfj-f!xw!V+w!*c<h\vsw/fydj4Q!fesjvgugyvftuf!T>v!n",dp._36Q="~b\vu<u*szj/ctvpuqf!!.w!f1d/32!!q-pyt/<t\vpwqb)s3zdjfowh!!>w!fwdV3w!\vw<V*w1</\v2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+h!mz`/Qtpptqj.u!j-p1o/!2>!!.w!f1d/53)!q+p!ty/^#~q\vs<f*d!j*twjVpwo!!-i6jfhsivqu!ygfmUpsbvum<c\v)wEb3sfzsjvouhy!fwuf!d+3!!*w1V/w2<!\v-vsopjmgppDsuno!jtUbnnpqpmmfcs)35Ed!fcwm!v+s!U*f3y/u1v)ssfp2u<d\vbvGonjpgppmsCnq!stfbmn\vq!m,f!s*3wEV!wc!m-v5sfUsfvyuuyvfsUfs3v<m\vcv)oEj3gfpssvnu!ytfbun!q+m!f*s13/E2!!c-msvpsmUpfDyuuovjsUfn4p<p\vmvco)j5gdpfswn!!+t!b*n5q/m1f)ss3pEu!dcbmGvnspUpfmyCuqvssffm5\v<!\v,v!o*jwgVpws!n-!4tfbsnvqumyffsU3sEv!mccm)vEs3Uffsyvuuvysffu6!<+\v!v*o1j/g2p!s-ns!ptmbpnDqumofjsU3nEp!pemjcs)u5Udffywu!v+s!f*<7\v/v1o)jsgppusdnb!GgnmpppbmuC!qcsmfpmp\vn!T,u!s*fwoVhwu!i-<3\vfvsovjugypfsUns!vgmmcp)bEu3!fcsmvpupynfSub!e+j!v*t1</\v2v!o-jsgppmspnD!uwofjdU4n!pcpmmpcp)n5Udjfowu!D+p!m*p9s/<1\v)gsmppubdub!GmnfpspqmCCmqpspfnmG\vb!d,u!p*sw)Vdwp!o-t2uf!sjvou!ygfmUpsbvum!cg)bEd3ufpssv*u!y|f\vug!m+p!b*u1!/n2j!s-ssppsmGpbDduuopjsU!n>p!p2m/c3)!5.d!fgwb!d+u!p*s1</\v2s)fsupvusdob!Gnnjpyp)mgCbqdsufpms!-)!!n+j!sisuphsoGfbsduuTpnsp-p!mccm!p>p!nsSpbmepjDvhtb*s<G\v`~m\vhw\vp|j!e*!)nobj",dp.finalShader="~b\vu<u*szj/ctvpuqf!!.w!f1d/32!!q-pyt/<t\vpwqb)s3zdjfowh!!>w!fwdV3w!\vw<V*w1</\v2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+h!mz`/Qtpptqj.u!j-p1o/!2>!!.w!f1d/53)!q+p!ty/^#~q\vs<f*dwjVtwj!p-of!hibjnhji)qE!3gfmspvbuuy<f\vuv!o>j!gsppsmnp!DthbbnsqGm`fmsh3\vE|!!j*n)bohjfb<n\v!webjspzwj\vo<hw!Vwwf!d3",(fp=Gl.graph3d.PostProcessing.Dof=function(c){function n(){f=!0;var t=c.getGL();r=new Bd.RenderTarget(c,t),o=c._postProcessing.createShader(t,fp._38Q),l=Zf.Buffer.createIndexBuffer(t,new Uint16Array([0,2,1,1,2,3])),u=Zf.Buffer.createVertexBuffer(t,new Float32Array([0,0,1,0,0,1,1,1]))}var r,o,l,u,a,e,i,s,d=!1,f=!1;this.serializeProperties={aperture:.025,maxblur:1,image:null},this.resetProperties=function(){var t,e=this.serializeProperties;for(t in e)this[t]=e[t]},L.defineProperties(this,{enable:{get:function(){return d},set:function(t){!!d!=!!t&&((d=t)&&!f&&n(),c.iv())}},image:{get:function(){return e},set:function(t){e!==t&&(e=t,a&&(c.getGL().deleteTexture(a),a=null),c.iv())}},maxblur:{get:function(){return i},set:function(t){i!==t&&(i=t,c.iv())}},aperture:{get:function(){return s},set:function(t){s!==t&&(s=t,c.iv())}}}),this.resetProperties(),this._42=function(s,t){if(d){var h;if(f||n(),!a){var e=Qa(this.image);if(!e||!e.tagName)return t;a=Qu(s,e)}var i=t.width,e=t.height;if(i&&e)return r.setSize(s,i,e),function(t,e,i,n){wu(s,e.frame),c.setViewport(s,0,0,e.width,e.height),n?n(s):s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),h!==t&&t.bind();var r,o=0;for(r in i){var a=i[r];a instanceof WebGLTexture&&(s.activeTexture(s.TEXTURE0+o),$u(s,a),a=o,o++),t.uniforms[r]=a}for(h!==t&&(l.upload(),u.upload(),t.attributes.pos.pointer(u),h=t),s.drawElements(s.TRIANGLES,6,s.UNSIGNED_SHORT,0);o--;)s.activeTexture(s.TEXTURE0+o),$u(s,null);Eu(s)}(o,r,{tColor:t.texture,tDepth:a,aspect:i/e,aperture:this.aperture,maxblur:this.maxblur}),r}}})._38Q="~b\vu<u*szj/ctvpuqf!!.w!f1d/32!!q-pyt/<t\vpwqb)s3zdjfowh!!>w!fwdV3w!\vw<V*w1</\v2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+h!mz`/Qtpptqj.u!j-p1o/!2>!!.w!f1d/53)!q+p!ty/^#~q\vs<f1d/j2t!j>p!ob!/isjphmipqD!hgbmspGb`um<h\v\vw<b1s/z2j5o!h0!!wmfpdd3!!>w!Vswp<m\vpvDohjbgspGs`nm!hc\vp<p*m!!5vstvfmEcfgqpuei!<+\v!v*o!jugdpfssns!ptdbundqfmqftsb3!E+!!u*D!p5m/p1s!<-\v1v/o1j!g)p3sdnf!wt!b)n!q,m!fzsy3/Ew!VuwE!f-qsupim<p\vDvuo!j)gEp3sfns!vgumypfbuu!!>n,b!ymcpmdv\vs<<*\v!v5osjvgmpcsgnp!eg!m+p!b*u!!ubdqffsssupvdsufd<f\vqvtobj!g+p!s*n!!:g3m/p1b.u!!-o:f3b/s1D.m!j)q3<d\vfvwo!j)g!p,s!nz!yg/mwpVbwu!!-gsbpsmDpmDjuq!<)\vEv3ofjsgvpusynf!ug!m>p,b!um!pgdp\vd<v*t!<5\vsvvomjcggppsen!!+g!m*p!buud!fbstsqpfdduud<f\vqdtpbo!t+u!!*g!m1p/b1u!!-V5o/q1b.d!l)E3pdxfowt!d)b!m,f!!z>y!/3w6V6w/!!-0s!p3m6p7D/u<!!)0E03!f1s/v/u2y!f.u?!!>g,s!bmdpudj\vp<o*!!)5fsyvdmmcvgepjeo!h+!!2**!\vuddpfostsup!dwufddf4q!tQbb!d+l!G*b!d:u3p/s1t!!->:!3w/f1d.4!))!33d6f7w/!!)+!!,3!6z7y//!w+V!w3!6-7s/p-m!p3D6u7!/)!E+3!f3s6v7u/y-f!u3!6>7,/!!m*p<d\v\vd<p*o!t5us!vwmfcdg5p!eV!o+q!b*d!luGdbfdsusppsdtu!d>f!qVtobq!b+d!l*E!p5x/o1t.d!b-m1f/!10!!)w3fddf5w)!!)Q!b,d!lzGyb/dwuVpws!t--s!p2m/p!D*u<!\v)gEm3pfbsuv!uvyofqub!d>l,S!HmCpBdU\vp<E*f!q5usiv)m!cdgppoet!u+!!j*o!!uwdffds5s!pwd!u*d!f|q\vt!bs!f+u!v*s!o:!3e/p1u.)!!-w:-3!/V1o!q)b3ddlfGwb!d)u!p,s!tz!y*/<w\vV~w\v!g-msppbmup!Dhuf!u)EEf3qfusiv)u!ydfpuo!t>u,!!jmop!dw\vf<d*3!!5tsdvsmfcfgopQep!t+j!u*j!puod!f*s!s|p\vd\nusdffuqvtsbo!!+v!o*q!b1d/l1S!H-C5B/U1p!E)f3qdufiw)!!)u!f,y!uzvys/fw3VEw)!!-usEpfmqpuDiu-!!)tEd3sffsfvouQypftuj!u>j,p!om!p*d!\v*<<*\v!~5\vsgvmmpcbgup!eq!f+s!t*q!fuddufjswsfpEdfuqdufiqUtpbW!j+f!x*[!):!3d/p1o!t-u:!3j/o1!!g)m3pdbfuw!!j)o!w,D!mzjyq/[w-V!wd!p-ostpum!pjDou!!g)mEp3bfus!voufybfsu-!!>d,p!omtpud!\vj<o*!!g8mspvbmuc!ggpbes!!+*!!*|!\vu!dsffsusvpsdou!d)f!qotfbb!s+!!+*!!g5b/s1!!*-!10/!1)!!))3!dgfbws!!).!!,o!fzbys/!w*V!w+!!-jsopwmDpmDjuq![)!E.3!fgsbvsu!y*f<u\v!~>\v,g!mmppbdu\v!<h*f!u8Wsjvfmxc[g)p!ed!p+o!t*u!!ujdof!sgsmppdbuud!feqftqbu!i+!!**!!|:\v3\n/s1f.u!v-s:o3!/q1f.s!t)q3fddfuwj!w)f!E,f!qzuyi/UwpVWwj!f-xs[p)m!peDfuq!u)iE-3!fosfvbusyDfmuj!q>-,!!gmbpsdD\vm<j*q!!8*s<v\vm~c\vgwppej!e+!!n*b!juod)f*s!s|p\vdwufddf3q!tebp!g+c!m*v!s1</\v1w!f-d53/!1b.t!q)f3ddufdwp!s)s!f,d!uz!y>/!wwVfwd!3-)s!p2m/p1D-u!!b)tEq3ffdsuv!u*y<f\vuj!g>!,)!vmtpfdE\vf<q*u!i8*s!v|m\vc!ggpmep!b+u!!*w!jufdxf[s!s>p!dhufdufWqjtfbx![+)!!*h!f:u3E/f1q!u-i:)3!/w1V.w!!)*3!d*f<w\v!!)g!m,p!bzuy!/gwbVdwu!p-ss!p>m!p)D!ug!p)dEv3tf!s,v!uwyjffux![>!,*!<m\vp!de\vp<g*c!m8vssv!m>c!gwpfed!3+!!)*!!dumdbfnsqs)p!dgubddfuqptsb!!++!!b*q!f5s/u1v.s!f--1!/.1n!b)y3cdmfvws!-)!!n,b!yzcym/vwsV!w*!!-*s<p\vm~p\vDfum!t)fE!3|f\vs!veupygfcum!v>s,!!>m!pwdf\vd<3*!!)8!sdvmmbcngqp)e!!u+f!y*u!vusdff3sEs)p!duuEdffqqutib-!!+w!f*d!3:)3w/V1w./!y--:!32//11!!).3!dwfVww!/)z!*,!!*z/yb/!w+V!wb!q-fsspumvpsDfu-!!).En3bfyscvmuvysf-u!!n>b,y!cmmpvds\v!<**!!*8<s\vv~m\vcwgfpde3!!+e!p*g!cumdvfss:s!p>d!uedpfgqctmbv!s+!!+*!!11//:1<!\v-w1f5d/31!!e)p3gdcfmwv!s)8!!,>!!zeyp/gwcVmwv!s-!s+p!m1p/D8u<!\v)wEf3df3s!veupygfcum!v>s,5!!m>p!de\vp<g*c!m8vssv!m+c!g1p/e5!<+\v!w*f!du5d!fdspsmp!d>u!dwffqdt5b)!!+1!/*1!!:*3</\v1d!p-m:!3,/>1!!u)f3ydufvws!f)3!E,)!!zuyD/pwmVpws!--!swpVmwp/Dyuz!!)*E<3\vfdspvmu!y,f>u!!u>f,y!umvpsdf\v3<E*)!!:usDvpmmcpgsp-e!!w+V!w*/!yuzd!f,s!s)p!dwufddf3q)t!b1!/+1!-*!!18/45/!1*.!!+-!6b2t/q1f!d)u3ddpfsws!f)d!u,!!*z!y+/!weVpwg!c-msvpsm!p*D<u\v!d)pEm3!f,s>v!uuyffyuu!v>s,f!3mEp)d!\vu<D*p!m:pssv-m!cwgVpwe/!y+z!!*,!!u)d!fwsfsdp3d)u!d1f/q2t6b-!!+1!/*4!86!2*/!1+.!!b-t8q4f/d1u.d!p)s3sdffdwu!!)*!!,+!!zeyp/gwcVmwv!s-!s*p<m\vpdDpum!!),E>3!fusfvyuuyvfsuf!3>E,)!!mupDdp\vm<p*s!-:!swvVmwc/gypze!!,+!!)*!!wufddf3s)s!p1d/u3d:f-q!t1b/!3+:!!**!!6+2!/b1t!q-f8d4u/d1p!s)s3fddfuw!!*)!!+,!!ezpyg/cwmVvws!!-*s<p\vmdppDmu!!,)>E!3uffsyvuuvysffu3!E>),!!umDppdm\vp<s*-!!:wsVvwm/cygzp!e,!!+)!!*w!fudd3f)s!s.p1d/u4d8f-q!t1b/!2+6!!**!!8+4!/b1t!q-f6d2u/d1p.s!s)f3dduf!w*!!)+!!,e!pzgyc/mwvVsw!!*-<s\vpdmppmD!u,!>)!Eu3ffysuvvusyff3uE!)>!,u!Dmppmdp\vs<-*!!w:Vswv/myczg!p,e!!)+!!w*f!du3d)f!s1s/p5d1u-d!f1q/t1b!!*+!!+*!!b8t4q/f1d.u!d-p6s2s/f1d.u!!)*3!d+f!we!p)g!c,m!vzsy!/*w<V\vwd!p-ms!p,m>p!Duuf!y)uEv3sffs3vEu)y!fuuD!p>m,p!sm-p!dw\vV<w*/!y:zs!v,m!c)g!pwef!d+3!)*!!1u/d4f8s-s!p.d1u/d2f6q!t*b!!++!!b*t!q6f2d/u1d.p!s-s8f4d/u1!!*)!3+d!fewp!g)c!m,v!sz!y*/<w\vVdwp!m-!s,p>m!puDfuy!u)vEs3ff3sEv)u!yufDup!m>p,s!-m!pwdV\vw</*y!z:!s,v!m)c!gwpfed!3+)!!*1!/u3d:f-s!s.p1d/u3d:f!q*t!b+!!+b!t*q!f6d2u/d1p!s-s8f4d/u1!.*!!)+3!defpwg!c)m!v,s!!z*y</\vwdVpwm!!-,s>p!mupfDyuu!v)sEf33fEs)v!uuyDfpum!p>s,-!!mwpVdw\v/<y*z!!:,s!v)m!cwgfpde3!)+!!.*1!/u2d6f-s!s.p1d/u4d8f!q*t!b+!!+b!t*q!f8d4u/d1p!s-s6f2d/u1!!*)!3+d!fewp!g)c!m,v!sz!y*/<w\vVdwp!m-!s,p>m!puDfuy!u)vEs3ff3sEv)u!yufDup!m>p,s!-m!pwdV\vw</*y!zs!v,m!c)g!pwef!d+3!)*!!1u/d1f-s!s.p1d/u5d!f*q!t+b!!b+t!q*f!d8u4d/p1s.s!f-d6u2!/*1!!+)!3edpfgwc!m)v!s,!!*z<y\v/dwpVmw!!,->s!pumfpyDuuv!s)fE33Ef)s!vuuDypfmup!s>-,!!wmVpwd/\vy<z*!!,s!v)m!cwgfpde3!)+!!.*1!/u2d6f-s!s1p/d4u8d!f*q!t+b!!b+t!q*f!d:u3d/p1s.s!f-d:u3!/*1!.+!!)e3pdgfcwm!v)s!!,*!<z\vyd/pwmV!w,!>-!supfmypuDvus!f)3EE3)f!suvDupymfpus!->!,w!Vmwp/dy\vz<!*,!!s)v!mwcfgdp3e)!!+.!1*/!3u:d-f!s1s/p3d:u!d*f!q+t!bb!t+q!f*d!u6d2p/s1s.f!d-u8!4*/!1+.!!e)p3gdcfmwv!s)!!*,<!\vzdyp/mw!V,w>!!-usfpymupvDsuf!3)EE)3!fusDvpumypfsu-!!>w,V!wm/pydz\v!<,*!!)s!vwmfcdg3p)e!!1+/!4*8!-u!d1f/s2s6p!d*u!d+f!qbttbq!f+d!u*d!p1s/s1f!d-u5!/*1!.+!!)e3pdgfcwm!v)s!!,*!<z\vyd/pwmV!w,!>-!supfmypuDvus!f)3E",(gp=Gl.graph3d.PostProcessing.HueSaturation=function(r){function o(){u=!0;var t=r.getGL();c=new Bd.RenderTarget(r,t),h=r._postProcessing.createShader(t,gp.hueSaturationShader),a=Zf.Buffer.createIndexBuffer(t,new Uint16Array([0,2,1,1,2,3])),s=Zf.Buffer.createVertexBuffer(t,new Float32Array([0,0,1,0,0,1,1,1]))}var a,s,h,c,l=!1,u=!1,d=[],f=[],g=[];this.serializeProperties={hue:[0,0,0,0,0,0,0],saturation:[0,0,0,0,0,0,0],lightness:[0,0,0,0,0,0,0]},this.resetProperties=function(){var t,e=this.serializeProperties;for(t in e)this[t]=e[t]},this.resetProperties(),L.defineProperties(this,{enable:{get:function(){return l},set:function(t){!!l!=!!t&&((l=t)&&!u&&o(),r.iv())}},hue:{get:function(){return d},set:function(t){if(d!==t&&7===t.length){for(var e=0;e<7;e++)d[e]=t[e]/180;r.iv()}}},saturation:{get:function(){return f},set:function(t){if(f!==t&&7===t.length){for(var e=0;e<7;e++)f[e]=t[e]/100;r.iv()}}},lightness:{get:function(){return g},set:function(t){if(g!==t&&7===t.length){for(var e=0;e<7;e++)g[e]=t[e]/100;r.iv()}}}}),this._42=function(t,e){if(l){u||o();var i=e.width,n=e.height;if(i&&n){c.setSize(t,i,n),wu(t,c.frame),r.setViewport(t,0,0,c.width,c.height),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),h.bind(),t.activeTexture(t.TEXTURE0+0),$u(t,e.texture);e=h.uniforms;return e.image=0,e.hue=d,e.saturation=f,e.lightness=g,a.upload(),s.upload(),h.attributes.pos.pointer(s),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),$u(t,null),Eu(t),c}}}}).hueSaturationShader="!!\vb~u!u\vs<j*czv/utfp!qw!f.d!31!/q2p!t-<y\v/!twpbqs)z3jdofhw!!w>f!dw3V!ww!V\vw<<*\v1\v/!2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+!!hzm/`tQppqt.j!u-j1p/o2!!>.!!w1f/d35!)+q!pyt/^#!!\vq~s!f\vd<j*txj/psop!mipjdh!i-q*!mgtmip)bcuh<s\v3!mvtoij)g5pdsfnw!!t>b!nsqpmmfpsD3hEb!sjGn`bmhhf!<\v\v<!*w!b\vs*zfjhoohb!Swtftdf3o!uwiVhwj<m\v!\v-!^$1e]ftgtjfoofu!iNhBjYm`!S-B{O/HmFt!i8)\vt!t$feofugijhojfm!`SqBbOnH!F\v`-B*MfMh!o1b\vS\vo!pvjoujbgspvsunb!tg!m-p^b1u]!oipvjfu]bNsBvYu`bStB!O-HzF/^m<t\vi!)voopjjgupbssnv!ugbmtp`bqub!nt!b\vu-v*sfbhuojbpSof]vNiB!Y-`^S1B]OfHvFi^!<-\vy!/vmotjig)pfsvni!`gqmbpnb!u\v!)m4jdhfiwu!o>f!tmtt]iN!B\vY\v`~S!B\vO~H!F\v^<<l\vb\vf!sgcm!p\vb<u^!snfbuqo`vipvdf`)fgvmip]btut!fjoouWibhmjvmf!->!!gfmhpobbuS!titvffoBumimh-j!mg!m\vp<b^us!fiuvofvSpbdo`hffv*i!]|o\vp!jgumbpsbvuu!bwtb!m>v!ff!h>o!bjSooWpbjmuvbfs!v,u!b)ti!v\vf<B^msmf!u,o!vipvdf`Sfbvoih]ff*v!i0!!>3!/f1h<o\vb\vS!fjvgi!!)\vw|b!m*vffh!o=b!s1!/>1>*!!ssffuuovvspod!`wfbvmiv)f!!g,j!!2\v/|1!<*\v,!,fsmftufo!vjpgd!`)fwvbim!v<fF!H?O!B2S/`1Y*B!Ns!f=u!vssfou!owvbpmdv`ff!v.i!!2</11!<>\v!!sffmutofv!psdf`ufvvsio!!uwobjm)v!fs<p\vg!!~\v\v<!2g!m,p!bfuh!onbbsq!`>t!bfuhvosbbsu!j\vp<o1)!g>m!pfbhuo!bjso!W*b7m!v>f?-!!fghmopbbsu)!!tgbju!v\vs~b!u\vj~p!o\vB<mlmb-f!sgcm!p\vb<us!ftubouvvpsdb`ufjvpio!S>b!ofhhfo*b!s|!\v\v!|g!m*p6b/u1!!w,b!m*vsff!u>o!vjpodW`bfmvvif)!u+b!p)m2g/!1=!!,i!)t!bgujv!s\vb|u!j*p,o,Bsmfmu!o,v!ptdb`ufvvsib!u<jFpHoOSBbSo`hYfB*N<!\v=!!ssffuuvosvop!dd`mfbvniq!)<w1b!m>v!fs-f!u1o/v1p-d!`2f/v1i*!<u\vo!j~)\v!!sgpmgp!b\vu\v!<nfbhqo`bmSjthtifuooufithtj)mg!m-pfbhuo!bjSooWpbjmuvbfs-v!ugbmtp!b-uf!hmojbhSifuvoif!tutbBpmmmg-!!\vg<m1p!b>u!!fmhjohbisu!oufotjt!S\vb<oehmfp*i!t|f\vs!igum`pfbvui!!wu!b>p!mmgj!h\vi<u1o/f7t!t+B!mym/!m,t!im!j>h!iiu!oufbtptmSgb!o\vh<f*<{\vz!yj/gs!p)mwp!d=)!m1t/i13*c\vh!ss!f>u!vmstoi!!j4odWfbwm!v\vf<!*+w!V)ww!!-,f!h2b/n1j*)<E\v3!ffsmvtufy\vf!us!f>u!vsspom!pjdo!W5bdmfvwf!!\v,|!!)*w)!o+j!b)n2!/e1j!p.w!!j\vo\vW~b!m\vv<f**m*!<-\vt!!~-\vi!)g4mdpfbwu!!oisvvfu3fssh!c\v)~g!m\vp<b1u/!7g!20-!!ig!m>p!biu!!\vg~3!-\v!<g1m/p7b!u>!,i!vif!*\v!||!\v*!1j/g1!!)=i!vif)!!=g!j1!/\v1\v*~\v!!\vi<vbfu!m,f>E!d2!/01!<*\vh!!f.m!tsf)!!j,g!!1)/i5v!f>!!?i!!2\v/|1!*f\vt!mifv!f~!!.\v><!b2u/m1f<E\vd!!g0m!p*bsu!!.s!fct)<!\v,!!j1g/!3)!)>7!/i1!!\v+|!!i*vyfb*N!d=!!>2>/!1h*)\v!!gsjf!tf!t>m!fg!2~!!,\v!<)bgu3m!f.E!dg!20*!!*+c!!7./!1h!)+!!>i!vif!<\v\v|!!f*mytbfN!dj!g>!>)!)s3)/!1g!j+!!\vi\vv<f***!o=j!N2d/!1,*!\vy!bsNfdt)!!>.!!g13/<3\v)!!f0m!tbfu!mjfgE!d)!);4!/*1o!j+N!di!v,f!*y!b=N!d3)/!10*!\vb!usmfftE!d>!!@g!26!/,1!!)=g!3m!!.>!!gt2!*\v!\v+<!o)j)N3d/!1.!!0y!b4N/d1!*>!!.b!uimvffE*d!!+u!b7p/m1g<!\v\v!|f!m*tofj\vN!ds!f?t!!y>b!Ngd2)<!\vg!js!f\vu\vv<s1o/!3s!f0t!<*\vo!j~N\vd\v!!,w!fydb4N!di)t!m>3!smh!c\v)\vw<f*d*4c!!i-thm)*y!b|n\v!!-wsf)dy4b!ns!h>c!<y\vb\vN!dj!gu!b)pimtgm!/\vz<!*>*>c!!1-/h1)*o!j|n\v!!-ssh)co!j>n!!w>f!do4j)Nidt!mu/b{p*m<g\v!!\v~<!cf/mdt!f>!!|c\v!!ugbmppmbgu!!\vg<3h</\vd\v!!>j!gh!!)uibtpmm/g{!!\v=<!s1//d6!*>\v!!sg!3u!b>p!migt!m\v/<{1!/+1!!)>2!/m1!!u,b!pimtgm!/\vz<*1</\v1!!f>m!ttf!\vu!bgp3m!g>!!\vi<t1m//2{.!!,>!!iit!mu/bzp!m.g!!i\vt|m!/*zd!!+4!diftwm)/m{t<i\v3\vc!hgsm!p4bduf!wg!2\v!\v>~!!3\v/<1c!h+s!!iotsmv/u{f!s.!!\vg~3!<\v\v<\v*!*s1h/c4/0s1!/>2!)i!v.f!3ys/hmct)ig!2--3!gg!3--2!gi)tcmh/sy3!f,v!i)!2>/!1c0/4c/h1s*!*\v<<\v*!ys/hmct/ih!!->3!gi!v-f23gs)hc",(pp=Gl.graph3d.PostProcessing.Blur=function(a){function s(){f=!0;var t=a.getGL();d=new Bd.RenderTarget(a,t),l=a._postProcessing.createShader(t,pp.hBlurShader),u=a._postProcessing.createShader(t,pp.vBlurShader),h=Zf.Buffer.createIndexBuffer(t,new Uint16Array([0,2,1,1,2,3])),c=Zf.Buffer.createVertexBuffer(t,new Float32Array([0,0,1,0,0,1,1,1]))}var h,c,l,u,d,i,n=this,r=!1,f=!1;this.serializeProperties={value:0},this.resetProperties=function(){this.value=0},L.defineProperties(n,{enable:{get:function(){return r},set:function(t){!!r!=!!t&&((r=t)&&!f&&s(),a.iv())}},value:{get:function(){return i},set:function(t){i!==t&&(i=t,a.iv())}}}),this.resetProperties(),n._42=function(t,e){return r?n.drawImpl(t,e,i):void 0},n.drawImpl=function(t,e,i,n){f||s();var r=e.width,o=e.height;if(r&&o){n&&(r*=n,o*=n),d.setSize(t,r,o),wu(t,d.frame),a.setViewport(t,0,0,d.width,d.height),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),l.bind(),t.activeTexture(t.TEXTURE0+0),$u(t,e.texture);n=l.uniforms;return n.image=0,n.value=i/r,h.upload(),c.upload(),l.attributes.pos.pointer(c),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),Eu(t),wu(t,e.frame),a.setViewport(t,0,0,e.width,e.height),t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT),u.bind(),t.activeTexture(t.TEXTURE0+0),$u(t,d.texture),(n=u.uniforms).image=0,n.value=i/o,h.upload(),c.upload(),u.attributes.pos.pointer(c),t.drawElements(t.TRIANGLES,6,t.UNSIGNED_SHORT,0),Eu(t),$u(t,null),d}}}).hBlurShader="!!\vb~u!u\vs<j*czv/utfp!qw!f.d!31!/q2p!t-<y\v/!twpbqs)z3jdofhw!!w>f!dw3V!ww!V\vw<<*\v1\v/!2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+!!hzm/`tQppqt.j!u-j1p/o2!!>.!!w1f/d35!)+q!pyt/^#!!\vq~s!f\vd<jntvjtp!o>!!isjphmipqD!hgbmspGb`um<h\v!!\vv\vo<j2g6p1s/n1!!t+b!n*q!m*f!sz3/Ew!Vjwn!b-hffv<m\vb!ww!b+s!z1j/o5h!!,w!fyd/3w!VwwV!w)<3\vd!fvwo!j-gfphsbnn!jg!m)pEb3uf!swvbumyvffu<!\v>\v,!!wnpvjte!!\vn<b9j2o:)1*/!1|!\v+!!w*f!d*5!!zt/vwnV!w>!!-wffvdm5b)w!!1+/!11!/*4<!\v,\v!!yt/vwnV!w,!>)!3udffywu!v-sffh3bEn)j!!j)nEb3hffs-v!uwyffdu3!)>!,w!Vnwv/ty!!\v.<!655/313!2+/!1w!b+m!v*f!-*!!wzV/ww/Vzw!!*-!f*v!m+b!w1!/+1!612/<3\v!!,t!vyn/!w,V>w!!u)f3ydufvws!f-3fEh)b!njjn!b)hEf3-f!swvfudy3f)u!!w>V,w!/nyv!t.!!\v4</214!6+2!/w1b!m+v!f*-!!*w!Vzw//wzV!w*!!-*f!v+m!b1w/!1+:!219/<2\v!!,t!vyn/!w,V>w!!u)f3ydufvws!f-3fEh)b!njjn!b)hEf3-f!swvfudy3f)u!!w>V,w!/nyv!t.!!\v3</414!7+2!/w1b!m+v!f*-!!*w!Vzw//wzV!w*!!-*y!/+w!V1w/!2)333d5f6w<!\v-!fthvbnn!j,!>)!Eu3ffysuvvusyff3uE!)>!,j!nnbvhtf!-\v!<w2f4d632)/!1w!V+w!/*y!!*.!!z2//w1V!w+!!-wfbvm",pp.vBlurShader="!!\vb~u!u\vs<j*czv/utfp!qw!f.d!31!/q2p!t-<y\v/!twpbqs)z3jdofhw!!w>f!dw3V!ww!V\vw<<*\v1\v/!2w!p-j1e/!1n!b-j1o/)2w!p,j!e1*/!3|!\v+!!hzm/`tQppqt.j!u-j1p/o2!!>.!!w1f/d35!)+q!pyt/^#!!\vq~s!f\vd<jntvjtp!o>!!isjphmipqD!hgbmspGb`um<h\v!!\vv\vo<j2g6p1s/n1!!t+b!n*q!m*f!sf3vEm!bjwn!b+h!f1</\v5!!w,b!szz/jwoVhw!!w-fyd/3w!VwwV!w)<3\vd!fvwo!j-gfphsbnn!jg!m)pEb3uf!swvbumyvffu<!\v>\v,!!wnpvjte!!\vn<b9j2o:)1*/!1|!\v+!!w*f!d*5!!ftvvmnb!w>!!+w!f1d/54)!!,1!/z1/!w*V<w\v!\v-!yt/vwnV!w,!>)!3udffywu!v-sffh3bEn)j!!j)nEb3hffs-v!uwyffdu3!)>!,w!Vnwv/ty!-\v!<w6V5w3/3z2!/.1!!5+/!1*!!+*!!wfbvmmvbfw!!*+!!*1!/+3!!1,/!1z6/2w<V\vw!!t-vyn/!w,V>w!!u)f3ydufvws!f-3fEh)b!njjn!b)hEf3-f!swvfudy3f)u!!w>V,w!/nyv-t!!w\vV<w2/4z6!2./!14!/+1!!*+!!*w!bfmvvmfb!w*!!+*!!1+/!21!/,1!:z2/9w<V\vw!!t-vyn/!w,V>w!!u)f3ydufvws!f-3fEh)b!njjn!b)hEf3-f!swvfudy3f)u!!w>V,w!/nyv-t!!w\vV<w4/4z7!2./!13!/+1!!*+!!*w!bzm/vwfV!w*!!-*y!/+w!V1w/!2)333d5f6w<!\v-!fthvbnn!j,!>)!Eu3ffysuvvusyff3uE!)>!,j!nnbvhtf!-\v!<w2f4d632)/!1w!V+w!/*y!-*!!wfVvwm/bzw!!.+!!21/",An(G,{accordionViewExpandIcon:cn(Go),accordionViewCollapseIcon:cn(Go,!0),accordionViewLabelColor:Ra,accordionViewLabelFont:Aa,accordionViewTitleBackground:Uo,accordionViewSelectBackground:Jo,accordionViewSelectWidth:3,accordionViewSeparatorColor:H,splitViewDividerSize:1,splitViewDividerBackground:Uo,splitViewDragOpacity:.5,splitViewToggleIcon:{width:16,height:16,comps:[{type:bt,rect:[2,2,12,12],background:Go}]},propertyViewLabelColor:Ma,propertyViewLabelSelectColor:Ra,propertyViewLabelFont:Aa,propertyViewExpandIcon:cn(Wo),propertyViewCollapseIcon:cn(Wo,!0),propertyViewBackground:Ho,propertyViewRowLineVisible:!0,propertyViewColumnLineVisible:!0,propertyViewRowLineColor:Qo,propertyViewColumnLineColor:Qo,propertyViewSelectBackground:Jo,listViewLabelColor:Ma,listViewLabelSelectColor:Ra,listViewLabelFont:Aa,listViewRowLineVisible:!1,listViewRowLineColor:Qo,listViewSelectBackground:Jo,treeViewLabelColor:Ma,treeViewLabelSelectColor:Ra,treeViewLabelFont:Aa,treeViewExpandIcon:cn(Xo),treeViewCollapseIcon:cn(Xo,!0),treeViewRowLineVisible:!1,treeViewRowLineColor:Qo,treeViewSelectBackground:Jo,treeViewDoubleClickToToggle:!0,tableViewLabelColor:Ma,tableViewLabelSelectColor:Ra,tableViewLabelFont:Aa,tableViewRowLineVisible:!0,tableViewColumnLineVisible:!0,tableViewRowLineColor:Qo,tableViewColumnLineColor:Qo,tableViewSelectBackground:Jo,treeTableViewLabelColor:Ma,treeTableViewLabelSelectColor:Ra,treeTableViewLabelFont:Aa,treeTableViewExpandIcon:cn(Xo),treeTableViewCollapseIcon:cn(Xo,!0),treeTableViewRowLineVisible:!0,treeTableViewColumnLineVisible:!0,treeTableViewRowLineColor:Qo,treeTableViewColumnLineColor:Qo,treeTableViewSelectBackground:Jo,tableHeaderLabelColor:Ma,tableHeaderLabelFont:Aa,tableHeaderColumnLineVisible:!0,tableHeaderColumnLineColor:qo,tableHeaderBackground:Ho,tableHeaderMoveBackground:jo,tableHeaderInsertColor:Jo,tableHeaderSortDescIcon:ln(Wo,!0),tableHeaderSortAscIcon:ln(Wo),tabViewTabGap:1,tabViewLabelColor:Ra,tabViewLabelFont:Aa,tabViewTabBackground:Uo,tabViewSelectWidth:3,tabViewSelectBackground:Jo,tabViewMoveBackground:jo,tabViewInsertColor:Jo,toolbarLabelColor:Ma,toolbarLabelSelectColor:Ra,toolbarLabelFont:Aa,toolbarBackground:Ho,toolbarSelectBackground:Jo,toolbarItemGap:8,toolbarSeparatorColor:Ip},!0),_p={translateX:1,sortColumn:1},vp={sortable:1,sortOrder:1,sortFunc:1},yp={focusData:1},mp={dataModel:1,sortColumn:1,sortFunc:1,visibleFunc:1,rootData:1,rootVisible:1},bp={dataModel:1,sortFunc:1,visibleFunc:1,categorizable:1},xp=function(t,e){e.add(t),t.hasChildren()&&t.eachChild(function(t){xp(t,e)})},wp=function(t,e,i,n,r,o,a,s,h,c,l){var u=i.getValueType(c),d=i.getAlign(c);if(i.getEnumValues(c)){var f,g=i.toEnumLabel(e,c),p=Pa||0,_=0,v=o,y=G.getTextSize(n,g).width;return(f=Qa(i.toEnumIcon(e,c)))&&(_=o+Pa/2,"center"===d?_+=(s-(p+y))/2:"right"===d&&(_=_+s-(p+y)),Za(t,f,_,a+h/2,c,l),v=_+Pa/2),void(g!=U&&(f?ss(t,g,n,r,v,a,s-(v-o),h):ss(t,g,n,r,o,a,s,h,d)))}return(e=i.formatValue(e))!=U?u===Je?void lo(t,o,a,s,h,e):u===Ke||!u&&vn(e)?(f=Qa(e?Dt:Ot),void Za(t,f,o+s/2,a+h/2,c,l)):void ss(t,e,n,r,o,a,s,h,d):void 0},Ep=function(i,n){var r=n.view,o=xr(i),a=n.column||n.property;r.getDataModel().beginTransaction(),(n.editor=i).info=n,r.setCurrentEditor(i),r.getView().insertBefore(o,r._79O),wr(i,n.editorRect),i.setFocus?i.setFocus():br(i),i.commitValue=function(t,e){i._17Q&&(i=i._17Q),e||r.setValue(n.data,a,i.getValue?i.getValue():i.value),i.close&&i.close(),As(o)},a.onEditorCreated&&a.onEditorCreated(n)},Tp=function(t,e,i,n,r){var o=Ps(t,i),a=e.value,s=e.view,i=r.getValueType(e.data);return o.onblur=o.onchange=function(){s.endEditing()},"input"===t?((a=r.formatValue(a))!=U&&(o.value=a),o.onkeydown=function(t){Wr(t)?s.endEditing():qr(t)&&s.endEditing(!0)},i!==$e&&i!==ti||g(o,ui,G.numberListener)):t===oe&&n.forEach(function(t){var e=d.createElement("option");e.innerHTML=r.toEnumLabel(t),e.value=t,r.isEnumEqual(a,t)&&(e.selected=!0),or(o,e)}),Ep(o,e),o},Sp=Gl.widget={},Ip=function(t,e,i){zs("ht.widget."+t,e,i)},An(_a,{ms_value:function(t){t.getValue=function(t){var e=this.getItemById(t),t=e.element;return pn(t)?t:t?t.getValue?t.getValue():t.value:e.selected},t.setValue=function(t,e){var i=this.getItemById(t);i&&((t=i.element)&&!pn(t)?t.setValue?t.setValue(e):t.value=e:(vn(e)?i.selected=e:i.element=e,this.iv()))},t.v=function(t,e){if(2===arguments.length)this.setValue(t,e);else{if(!yn(t))return this.getValue(t);for(var i in t)this.setValue(i,t[i])}return this}},_46o:function(t){t._icon=U,t._accessType=U,t._valueType=U,t._editable=!1,t._batchEditable=!0,t._align=st,t._nullable=!0,t._emptiable=!1,t.setParent=Zi,t.formatValue=function(t){var e=this._valueType;return this.getEnumValues()?this.toEnumLabel(t):e===Ke?!!t:t!=U&&e===$e?S(t):t},t.setEnum=function(t,e,i,n,r,o,a){t&&!bn(t)&&t.values&&(n=t.editable,i=t.icons,e=t.labels,r=t.strict,o=t.maxHeight,a=t.dropDownWidth,t=t.values),xn(t)&&(t=t._as),xn(e)&&(e=e._as),xn(i)&&(i=i._as),this._enumValues=t,this._enumLabels=e,this._enumIcons=i,this._enumEditable=n,this._enumStrict=r==U||r,this._enumMaxHeight=o,this._enumDropDownWidth=a,t&&t.length&&_n(t[0])&&(this._valueType=ti),this.fp("enum",!1,!0)},t.getEnumDropDownWidth=function(){return this._enumDropDownWidth},t.getEnumMaxHeight=function(){return this._enumMaxHeight},t.isEnumEditable=function(){return this._enumEditable},t.getEnumValues=function(){return this._enumValues},t.getEnumLabels=function(){return this._enumLabels},t.getEnumIcons=function(){return this._enumIcons},t.isEnumStrict=function(){return this._enumStrict},t.isEnumEqual=function(t,e){return this._enumStrict?t===e:t==e},t.toEnumLabel=function(t,e){var i=this.getEnumValues(e),n=this.getEnumLabels(e);if(i&&n)for(var r=0;r<i.length;r++)if(this.isEnumEqual(t,i[r]))return n[r];return t},t.toEnumIcon=function(t,e){var i=this.getEnumValues(e),n=this.getEnumIcons(e);if(i&&n)for(var r=0;r<i.length;r++)if(this.isEnumEqual(t,i[r]))return n[r];return H}},_45o:function(t){t._87o=function(t,e,i,n,r,o){var a,s;t&&(a=this._90I,s=tr(1),this._columnLineVisible&&--r,this._rowLineVisible&&--o,r<=0||o<=0||(this._90I||(a=this._90I={}),a[e]||(a[e]=new Lh),wr(s,this.tx()+i,this.ty()+n,r,o),or(s,t),this._view.insertBefore(s,this._79O),t.onParentAdded&&t.onParentAdded(s),a[e].add(s)))},t._76o=function(){var t=this._90I;if(t){for(var e in t)t[e].each(function(t){As(t)});delete this._90I}},t._77o=function(t){var e;!this._90I||(e=this._90I[t])&&(e.each(function(t){As(t)}),delete this._90I[t])}},_47o:function(t){t.getValue=function(t,e){return e.getValue?e.getValue(t,e,this):Gn(t,e.getAccessType(),e.getName())},t.setValue=function(t,e,i){var n,r,o,a;e.isEmptiable(t)||""!==i||(i=H),!e.isNullable(t)&&i==U||(n=this,r=e.getName(t),o=e.getAccessType(t),(a=e.getValueType(t))===$e&&pn(i)?i=tt(i):a===ti&&pn(i)?i=parseFloat(i):a===Ke&&pn(i)&&(i="true"===i),n._batchEditable&&e._batchEditable&&n.isSelected(t)?n.sm().each(function(t){e.setValue?e.setValue(t,e,i,n):Hn(t,o,r,i)}):e.setValue?e.setValue(t,e,i,n):Hn(t,o,r,i))},t.setCurrentEditor=function(t){this.endEditing(),this._currentEditor=t,this.redraw()},t.isEditing=function(t,e){var i=this._currentEditor;if(!i)return!1;if(e){i=i.info;return!!i&&((i.column||i.property)===e&&i.data===t)}return!0},t.endEditing=function(t){var e=this._currentEditor;e&&(delete this._currentEditor,e.commitValue&&e.commitValue(e.info,t),this.redraw(),this.getDataModel().endTransaction())},t.beginEditing=function(t){this.endEditing();var i=this,n=t.column||t.property;if(n.beginEditing)n.beginEditing(t);else{var r=t.data,e=t.value,o=i.getSelectBackground(r),a=n.getEnumValues(r),s=n.getSlider(r),h=n.getColorPicker(r);if(s){var c=Wa(Sp.Slider,s);return c.setValue(e),c.getView().onblur=function(){i.endEditing()},c.isInstant()&&(c.onValueChanged=function(){i.setValue(r,n,c.getValue())}),void Ep(c,t)}if(h||n.getValueType(r)===Je){h=Wa(Sp.ColorPicker,h);return h.setValue(e),h.onClosed=function(){i.endEditing()},h.isInstant()&&(h.onValueChanged=function(t,e){i.setValue(r,n,e)}),Ep(h,t),void h.open()}if(a)Sp.ComboBox?((l=new Sp.ComboBox).setValue(e),l.setValues(a),l.setLabels(n.getEnumLabels(r)),l.setIcons(n.getEnumIcons(r)),l.setEditable(n.isEnumEditable(r)),l.setStrict(n.isEnumStrict(r)),l.setMaxHeight(n.getEnumMaxHeight(r)),l.setDropDownWidth(n.getEnumDropDownWidth(r)),l.onClosed=function(){i.endEditing()},Ep(l,t),l.open()):Tp(oe,t,o,a,n);else if(n.getValueType(r)===Ke||vn(e))i.setValue(r,n,!e);else{if(n.getItemEditor(r)){var l=new(ns(n.getItemEditor(r)))(r,n,i,t),a=l.getView();return(a._17Q=l).setValue(e),nr(a),Ep(a,t),void(l.editBeginning&&l.editBeginning())}Tp("input",t,o,U,n)}}}},_44o:function(t){t.init=function(t){var e=this,i=e.th=new Np(t),n=e._view=$n(1,e);e.tv=e._tableView=t,or(n,i.getView()),or(n,t.getView()),i.mp(function(t){t.property===At&&e.iv()}),e.iv()},t.getTableView=function(){return this.tv},t.getTableHeader=function(){return this.th},t.getDataModel=function(){return this.tv.dm()},t.getColumnModel=function(){return this.tv.getColumnModel()},t.setColumns=function(t){this.tv.setColumns(t)},t.addColumns=function(t){this.tv.addColumns(t)},t.endEditing=function(){this.tv.endEditing()},t.validateImpl=function(){var t=this.th,e=lr(t),i={x:0,y:0,width:this.getWidth(),height:e};wr(t,i),i.y=e,i.height=N(0,this.getHeight()-e),wr(this.tv,i)}},ms_vs:function(t){t._41o=function(){return this._29I.height<this._59I},t._43o=function(){var t=this;t._41o()&&(t._58I||(w(function(){t._94O()},La),t.iv()),t._58I=new Date)},t._94O=function(){var t=this;t._58I&&((new Date).getTime()-t._58I.getTime()>=La?(delete t._58I,t.iv()):w(function(){t._94O()},La))},t._93I=function(){var t,e,i,n,r,o,a,s=this,h=s._27I;s._58I||!s._autoHideScrollBar?(h||or(s._79O,h=s._27I=tr()),t=(a=s._29I).height,e=s._59I,i=s.getScrollBarSize(),n=a.width-i-2,r=t*(-s.ty()/e),o=t*(t/e),a=h.style,t<e?(o<Fa&&((r=r+o/2-Fa/2)<0&&(r=0),t<r+Fa&&(r=t-Fa),o=Fa),a.visibility=ee,a.background=s.getScrollBarColor(),a.borderRadius=i/2+vt,wr(h,n,r,i,o)):a.visibility=te):h&&(h.style.visibility=te)}},ms_hs:function(t){t._40o=function(){return this._29I.width<this._91I},t._42o=function(){var t=this;t._40o()&&(t._95O||(w(function(){t._94I()},La),t.iv()),t._95O=new Date)},t._94I=function(){var t=this;t._95O&&((new Date).getTime()-t._95O.getTime()>=La?(delete t._95O,t.iv()):w(function(){t._94I()},La))},t._92I=function(){var t,e,i,n,r,o,a,s=this,h=s._28I;s._95O||!s._autoHideScrollBar?(h||or(s._79O,h=s._28I=tr()),t=(a=s._29I).width,e=s._91I,i=s.getScrollBarSize(),n=a.height-i-2,r=t*(-s.tx()/e),o=t*(t/e),a=h.style,t<e?(o<Fa&&((r=r+o/2-Fa/2)<0&&(r=0),t<r+Fa&&(r=t-Fa),o=Fa),a.visibility=ee,a.background=s.getScrollBarColor(),a.borderRadius=i/2+vt,wr(h,r,n,o,i)):a.visibility=te):h&&(h.style.visibility=te)}}}),Xa(Dt,hn(16,16,[{type:xt,rect:[1,1,14,14],background:Jo},{type:mt,rect:[1,1,14,14],width:1,color:Yo},{type:Tt,points:[13,3,7,12,4,8],borderWidth:2,borderColor:"#FFF"}])),Xa(Ot,hn(16,16,{type:mt,rect:[1,1,14,14],width:1,color:Yo})),Xa(Bt,hn(16,16,[{type:wt,rect:[2,2,12,12],borderWidth:1,borderColor:Yo,background:"#FFF"},{type:wt,rect:[4,4,8,8],background:Jo}])),Xa(zt,hn(16,16,{type:wt,rect:[2,2,12,12],borderWidth:1,borderColor:Yo})),_a._15Q=function(t){t._29I=Ji,t._59I=0,t._91I=0,t._5o=function(t){var e=this;e._30I=new Lh,e._rows=new Lh,e._rowMap={},e._31I=0,e._14I=0,e._view=$n(1,e),e._canvas=er(e._view),or(e._view,e._79O=tr()),e.dm(t||new Nh)},t.getCheckIcon=function(t){var e=this.sm(),t=e.co(t);return e.sg()?Qa(t?Bt:zt):Qa(t?Dt:Ot)},t.checkData=function(t){var e=this.sm(),i=e.co(t);e.sg()&&i||(this._32o=1,i?e.rs(t):e.as(t),delete this._32o)},t.getDataAt=function(t){t.target&&(t=this.lp(t));var e=k(t.y/this._rowHeight),t=this._rows;return e<0||e>=t.size()?U:t.get(e)},t.onDataDoubleClicked=function(){},t.onDataClicked=function(){},t.adjustTranslateX=function(){return 0},t.adjustTranslateY=function(t){var e=this.getHeight()-this._59I;return t<e&&(t=e),0<t?0:S(t)},t.onPropertyChanged=function(t){t=t.property;mp[t]?this.ivm():yp[t]||this.redraw(),t===Pe?this._42o():t===De&&this._43o()},t.getLabel=function(t){return t.toLabel()},t.getLabelFont=function(){return this._labelFont},t.getLabelColor=function(t){if(this.isCheckMode()){if(this._focusData===t)return this._labelSelectColor}else if(this.isSelected(t))return this._labelSelectColor;return this._labelColor},t.getStartRowIndex=function(){return this._31I},t.getEndRowIndex=function(){return this._14I},t.getRowDatas=function(){return this._rows},t.getRowIndex=function(t){return this._rowMap[t._id]},t.getRowSize=function(){return this._rows.size()},t.getViewRect=function(){return is(this._29I)},t.isVisible=function(t){return!this._visibleFunc||this._visibleFunc(t)},t.getCurrentSortFunc=function(){return this._sortFunc},t.setDataModel=function(t){var e=this,i=e._dataModel,n=e._selectionModel;i!==t&&(i&&(i.umm(e.handleDataModelChange,e),i.umd(e.handleDataPropertyChange,e),i.umh(e.handleHierarchyChange,e),n||i.sm().ums(e.handleSelectionChange,e)),(e._dataModel=t).mm(e.handleDataModelChange,e),t.md(e.handleDataPropertyChange,e),t.mh(e.handleHierarchyChange,e),n?n._21I(t):t.sm().ms(e.handleSelectionChange,e),e.fp("dataModel",i,t))},t.validateModel=function(){var t=this;t._rows.clear(),t._rowMap={},t.buildChildren(t._dataModel._roots);var e=t._rows=t._rows.toList(t.isVisible,t),i=0,n=t.getCurrentSortFunc(),r=e.size();for(n&&e.sort(n);i<r;i++)t._rowMap[e.get(i)._id]=i},t.buildChildren=function(t){var e=this;t.each(function(t){e._rows.add(t),e.buildChildren(t._children)})},t.handleDataModelChange=function(){this.ivm()},t.handleDataPropertyChange=function(t){"parent"===t.property?this.ivm():this.invalidateData(t.data)},t.handleHierarchyChange=function(){this.ivm()},t.handleSelectionChange=function(t){t.datas.each(this.invalidateData,this),this.onSelectionChanged(t)},t.onSelectionChanged=function(t){var e=this.sm();!this.isAutoMakeVisible()||1!==e.size()||"set"!==t.kind&&"append"!==t.kind||this._32o||this.makeVisible(e.ld())},t.handleBackgroundClick=function(t){cs(t)&&!this.isCheckMode()&&this.sm().cs()},t.makeVisible=function(t){t&&(this._23I=t,this.iv())},t.scrollToIndex=function(t){var e=this._29I,i=e.height,n=this._rowHeight,r=n*t;0<=t&&t<this._rows.size()&&0<i&&(r+n>e.y+i?this.ty(-r+i-n):r<e.y&&this.ty(-r))},t.autoScroll=function(t,e){var i=this,n=i._rowHeight,r=n,o=n/4,a=i._29I,s=i.lp(t),t={x:i.tx(),y:i.ty()};return 0<n&&a&&(s.x-a.x<r?i.translate(o,0):a.x+a.width-s.x<r&&i.translate(-o,0),s.y-a.y<r?i.translate(0,o):a.y+a.height-s.y<r&&i.translate(0,-o)),t.x=i.tx()-t.x,t.y=i.ty()-t.y,e&&(e.x+=t.x,e.y+=t.y),t},t.getTopRowOrderSelection=function(){var t=this.sm().getTopSelection(),e={},i=new Lh;return t.each(function(t){e[t._id]=t}),this._rows.each(function(t){e[t._id]&&i.add(t)}),i},t.getRowOrderSelection=function(){var e=new Lh;return this._rows.each(function(t){this.isSelected(t)&&e.add(t)},this),e},t.ivm=function(){this.invalidateModel()},t.invalidateModel=function(){this._96I||(this._96I=1,this._32I=1,delete this._24I),this.iv()},t.redraw=function(){this._32I||(this._32I=1,delete this._24I,this.iv())},t.invalidateData=function(t){D?this.redraw():this._32I||(this._24I||(this._24I={}),this._24I[t._id]=t,this.iv())},t.getFocusData=function(){return this._focusData},t.setFocusDataById=function(t){this.setFocusData(this.dm().getDataById(t))},t.setFocusData=function(t){var e=this._focusData;e!==t&&(this._focusData=t,this.fp("focusData",e,t),e&&this.invalidateData(e),t&&(this.invalidateData(t),this.isAutoMakeVisible()&&this.makeVisible(t)))},t.drawRowBackground=function(t,e,i,n,r,o,a){var s=this.isCheckMode();(e===this._focusData&&s||i&&!s)&&lo(t,n,r,o,a,this.getSelectBackground(e))},t.drawData=function(t,e,i){var n=this._rowHeight,r=n*i,o=this._29I,a=o.x,o=o.width;t.save(),t.beginPath(),t.rect(a,r,o,n),t.clip(),this._87o(this.drawRow(t,e,this.isSelected(e),a,r,o,n),i,a,r,o,n),t.restore(),this._rowLineVisible&&lo(t,a,r+n-1,o,1,this._rowLineColor)},t._12I=function(t){var e=this._31I,i=this._29I,n=i.x,r=i.y,o=i.width,i=i.height;for(t.beginPath(),t.rect(n,r,o,i),t.clip(),t.clearRect(n,r,o,i),this._76o(),this._93db(t);e<this._14I;e++)this.drawData(t,this._rows.get(e),e);this._92db(t)},t._13I=function(e){for(var t,i=this,n=i._rowHeight,r=i._29I,o=r.x,a=r.width,s=i._31I,h=i._30I;s<i._14I;s++)t=i._rows.get(s),i._24I[t._id]&&h.add({data:t,index:s});h.isEmpty()||(e.beginPath(),h.each(function(t){e.rect(o,t.index*n,a,n)}),e.clip(),h.each(function(t){e.clearRect(o,t.index*n,a,n)}),h.each(function(t){i._77o(t.index)}),i._93db(e),h.each(function(t){i.drawData(e,t.data,t.index)}),i._92db(e),h.clear())},t.preValidateModel=function(){this.endEditing&&this.endEditing()},t.validateImpl=function(){var t=this,e=t._canvas,i=t.getWidth(),n=t.getHeight(),r=t._rowHeight,o=t._32I;i===e.clientWidth&&n===e.clientHeight||(rr(e,i,n),o=1);t._96I&&(t.preValidateModel(),t.validateModel());var a=t._29I,s={x:-t.tx(),y:-t.ty(),width:i,height:n},i=t._rows.size(),n=fr(e),e=t._23I;o||Ln(s,a)||(o=1),t._29I=s,t._59I=i*r,t._31I=k(s.y/r),t._14I=j((s.y+s.height)/r),t._31I<0&&(t._31I=0),t._14I>i&&(t._14I=i),t._99I&&o&&t._99I(),(t._40o()||t._41o())&&(t._59I+=t.getScrollBarSize(),t._99I&&o&&(t._91I+=t.getScrollBarSize())),gr(n,t.tx(),t.ty(),1),o?t._12I(n):t._24I&&t._13I(n),t._93I(),t._92I(),n.restore(),t._32I=t._24I=t._96I=U,e&&(t.scrollToIndex(t.getRowIndex(e)),delete t._23I),t.tx(t.tx()),t.ty(t.ty())},t.canHandleSelectMode=function(){return!0}},_a._48o=function(t){t._rootVisible=!0,t._rootData=U,t._35o=function(){this._expandMap={},this._levelMap={}},t.validateModel=function(){var t=this,e=t._rootData;t._rows.clear(),t._levelMap={},t._rowMap={},t._currentLevel=0,e?t._rootVisible?t.isVisible(e)&&t.buildData(e):t.buildChildren(e):t.buildChildren(),delete t._currentLevel},t.buildData=function(t){var e=t._id,i=this._rows;this._rowMap[e]=i.size(),i.add(t),this._levelMap[e]=this._currentLevel,this.isExpanded(t)&&(this._currentLevel++,this.buildChildren(t),this._currentLevel--)},t.buildChildren=function(t){var e=this,i=t?t._children:e._dataModel._roots,n=e.getCurrentSortFunc();n&&e.isChildrenSortable(t)?i.toList(e.isVisible,e).sort(n).each(e.buildData,e):i.each(function(t){e.isVisible(t)&&e.buildData(t)})},t.getLevel=function(t){return this._levelMap[t._id]},t.getToggleIcon=function(t){var e=this._loader,i=this._collapseIcon;return e&&!e.isLoaded(t)?i:t.hasChildren()?this.isExpanded(t)?this._expandIcon:i:U},t.isCheckMode=function(){return this._checkMode!=U},t.isChildrenSortable=function(){return!0},t.handleDataModelChange=function(t){t.kind===Ct?delete this._expandMap[t.data._id]:t.kind===Mt&&(this._expandMap={}),this.ivm()},t.toggle=function(t){this.isExpanded(t)?this.collapse(t):this.expand(t)},t.isExpanded=function(t){return 1===this._expandMap[t._id]},t.expand=function(t){var e=this._loader;this.isExpanded(t)||(e&&!e.isLoaded(t)&&e.load(t),this._expandMap[t._id]=1,this.ivm(),this.onExpanded(t))},t.onExpanded=function(){},t.collapse=function(t){this.isExpanded(t)&&(delete this._expandMap[t._id],this.ivm(),this.onCollapsed(t))},t.onCollapsed=function(){},t.expandAll=function(t){var e;t?(this.expand(t),t.eachChild(function(t){this.expandAll(t)},this)):((e=this)._dataModel.each(function(t){t.hasChildren()&&(e._expandMap[t._id]=1)}),e.ivm())},t.collapseAll=function(){this._expandMap={},this.ivm()},t.makeVisible=function(t){if(t)if(!this._rootData||t.isDescendantOf(this._rootData)){for(var e=t._parent;e;)this.expand(e),e=e._parent;this._23I=t,this.iv()}},t.checkData=function(t){var e,i=this._checkMode,n=this.sm(),r=n.co(t);if(!n.sg()||!r){if(this._32o=1,i===it)r?n.rs(t):n.as(t);else if(i===Ae)(e=new Lh(t)).addAll(t._children);else if("descendant"===i)e=new Lh,xp(t,e);else if("all"===i&&(e=new Lh,xp(t,e),!r))for(var o=t._parent;o;)e.add(o),o=o._parent;e&&(r?n.rs(e):n.as(e)),delete this._32o}},t.drawTree=function(t,e,i,n,r,o,a){var s=this,h=s._indent,c=s._levelMap[e._id],l=s.getIconWidth(e),u=Qa(s.getToggleIcon(e));u?(Za(t,u,(n+=h*c)+h/2,r+a/2,e,s),n+=h):n+=h*(c+1),s._checkMode&&(Za(t,s.getCheckIcon(e),n+h/2,r+a/2,e,s),n+=h),s.drawIcon(t,e,n,r,l,a),s.drawLabel(t,e,n+l,r,a)}},_a._14Q=function(t){t.getIcon=function(t){return t.getIcon()},t.getIconWidth=function(t){return this.getIcon(t)?this._indent:0},t.drawIcon=function(t,e,i,n,r,o){var a,s;r&&(a=this.getBodyColor(e),(s=Qa(this.getIcon(e),a))&&(o-=this.isRowLineVisible()?1:0,Ka(t,s,qe,i,n,r,o,e,this,a),bo(t,this.getBorderColor(e),i,n,r,o)))},t.drawLabel=function(t,e,i,n,r){ss(t,this.getLabel(e),this.getLabelFont(e),this.getLabelColor(e),i,n,0,r)}},_a._50o=function(t){t._98I=function(){var t=this._39o=new Nh;this._60I=new Lh,t.mm(this._17o,this),t.md(this._18o,this),t.mh(this._19o,this)},t.setColumns=function(t){this._39o.clear(),this.addColumns(t)},t.addColumns=function(t){var i=this._39o;t.forEach(function(t){var e;t instanceof Mp||(e=ns(t.className),t=Wa(e||Mp,t)),i.add(t)})},t.onColumnClicked=function(){},t.onCheckColumnClicked=function(){},t._3Q=function(t){for(var e,i=0,n=this._60I,r=n.size();i<r;i++)if((e=n.get(i)).column===t)return e;return U},t.getColumnAt=function(t){t=this._4Q(t);return t?t.column:U},t._4Q=function(t){for(var e=(t.target?this.lp(t):t).x,i=this._60I,n=0;n<i.size();n++){var r=i.get(n),o=r.startX;if(o<=e&&e<o+r.column.getWidth())return r}return U},t.getToolTip=function(t){var e=this.getDataAt(t),t=this.getColumnAt(t);return e&&t?t.getToolTip(e,this):U},t.adjustTranslateX=function(t){var e=this.getWidth()-this._91I;return t<e&&(t=e),0<t?0:S(t)},t._99I=function(){var i=this,n=i._29I,r=i._60I;r.clear(),i._91I=0,i._39o._roots.each(function(t){var e;t.isVisible()&&(e=i._91I+t.getWidth(),i._91I<=n.x+n.width&&e>=n.x&&r.add({column:t,startX:i._91I}),i._91I=e)})},t.drawData=function(n,r,o){var a=this,s=a._rowHeight,h=s*o,c=a.isSelected(r),t=a._29I,e=t.x,t=t.width;a.drawRowBackground(n,r,c,e,h,t,s),a._60I.each(function(t){var e=t.column,i=t.startX,t=e.getWidth();0<t&&!a.isEditing(r,e)&&(n.save(),n.beginPath(),n.rect(i,h,t,s),n.clip(),a._87o(a.drawCell(n,r,c,e,i,h,t,s),o,i,h,t,s),a._columnLineVisible&&lo(n,i+t-1,h,1,s,a._columnLineColor),n.restore())}),a._rowLineVisible&&lo(n,e,h+s-1,t,1,a._rowLineColor)},t.drawCell=function(t,e,i,n,r,o,a,s){if(n.drawCell)return n.drawCell(t,e,i,n,r,o,a,s,this);i=this.getValue(e,n);wp(t,i,n,this.getLabelFont(e,n,i),this.getLabelColor(e,n,i),r,o,a,s,e,this)},t.getColumnModel=function(){return this._39o},t._17o=function(){this.redraw()},t._18o=function(t){t.data===this._sortColumn&&vp[t.property]?this.ivm():(this._42o(),this.redraw())},t._19o=function(){this.redraw()},t.getCurrentSortFunc=function(){var i=this,n=i._sortColumn;if(n&&n.isSortable()){var r=n.getSortFunc(),o=Ie===n.getSortOrder()?1:-1,r=r||es;return function(t,e){return r.call(i,i.getValue(t,n),i.getValue(e,n),t,e)*o}}return i._sortFunc},t.isCellEditable=function(t,e,i){return!(!e.isEditable()||!this.isEditable())&&(!e.isCellEditable||e.isCellEditable(t,e,i,this))},t._37O=function(t,e){if(cs(e))for(var i=this,n=i.lp(e),r=i._60I,o=i._rowHeight,a=i._29I,s=a.x,h=a.y,c=a.width,l=a.height,u=0;u<r.size();u++){var d=r.get(u),f=d.startX,g=d.column,p=g.getWidth();if(g!==i._31o&&g!==i._4o&&n.x>=f&&n.x<f+p&&i.isCellEditable(t,g,e)){var _={x:f,y:i.getRowIndex(t)*o,width:p,height:o},d={x:_.x+i.tx(),y:_.y+i.ty(),width:_.width,height:_.height},f=0,p=0;return _.x<s?f=_.x-s:s+c<_.x+_.width&&(f=_.x+_.width-s-c),f&&(i.tx(i.tx()-f),d.x-=f),_.y<h?p=_.y-h:h+l<_.y+o&&(p=_.y+o-h-l),p&&(i.ty(i.ty()-p),d.y-=p),void i.beginEditing({data:t,column:g,value:i.getValue(t,g),event:e,rect:_,editorRect:d,view:i})}}}},Sp.BaseItemEditor=function(t,e,i,n){this._data=t,this._column=e,this._master=i,this._editInfo=n},Ip("BaseItemEditor",L,{ms_ac:["data","column","master","editInfo"],editBeginning:function(){},getView:function(){},getValue:function(){},setValue:function(){}}),Cp=Gl.Tab=function(){Bn(Cp,this)},Vs("Tab",jh,{ms_ac:["view","closable","disabled","visible"],_icon:U,_closable:!1,_disabled:!1,_visible:!0,setParent:Zi}),Mp=Gl.Column=function(){Bn(Mp,this)},Vs("Column",jh,{_46o:1,ms_ac:["accessType","valueType",ee,Ee,Te,Rt,"align",Je,"sortOrder",we,"sortable","clickable","nullable","emptiable","slider","colorPicker","itemEditor"],_visible:!0,_width:80,_sortOrder:Ie,_sortFunc:U,_sortable:!0,_clickable:!0,setWidth:function(t){t<16&&(t=16);var e=this._width;this._width=t,this.fp(Rt,e,t)},getToolTip:function(t,e){return this.formatValue(e.getValue(t,this))}}),Rp=Gl.Property=function(){Bn(Rp,this)},Vs("Property",jh,{_46o:1,ms_ac:["accessType","valueType",Ee,Te,"categoryName",Je,"align","nullable","emptiable","slider","itemEditor","colorPicker"],_categoryName:U,getToolTip:function(t,e,i){return e?this.formatValue(i.getValue(t,this)):i.getPropertyName(this)}}),Sp.AccordionView=function(){this._20o={},this._21o=new Lh,this._10o=U,this._9o=U,this._11o=U,this._view=$n(0,this),this.iv()},Ip("AccordionView",L,{ms_v:1,ms_fire:1,ms_ac:[me,be,"titleHeight",qt,Wt,"titleBackground","selectWidth",se,"orientation","separatorColor"],_expandIcon:G.accordionViewExpandIcon,_collapseIcon:G.accordionViewCollapseIcon,_titleHeight:Ba,_labelColor:G.accordionViewLabelColor,_labelFont:G.accordionViewLabelFont,_titleBackground:G.accordionViewTitleBackground,_selectBackground:G.accordionViewSelectBackground,_selectWidth:G.accordionViewSelectWidth,_orientation:"v",_separatorColor:G.accordionViewSeparatorColor,onPropertyChanged:function(){this.iv()},getView:function(){return this._view},getTitles:function(){return this._21o},getCurrentTitle:function(){return this._10o},add:function(e,t,i,n){var r=this,o=tr(),n={content:t,div:o,canvas:er(o),icon:n};if(r._20o[e])throw e+" already exists";var a=n.downEventFunc=function(t){qa(t)},s=n.upEventFunc=function(t){qa(t),cs(t)&&(r._10o===e?r.collapse():r.expand(e))};[hi,oi].forEach(function(t){g(o,t,a)}),[li,si].forEach(function(t){g(o,t,s)}),o.style.cursor=ni,or(r._view,o),r._20o[e]=n,r._21o.add(e),i&&r.expand(e),r.iv()},remove:function(t){var e,i=this._20o[t];i&&(e=i.div,As(e),[hi,oi].forEach(function(t){p(e,t,i.downEventFunc)}),[li,si].forEach(function(t){p(e,t,i.upEventFunc)}),delete this._20o[t],this._21o.remove(t),this.iv())},clear:function(){this._21o.toArray().forEach(this.remove,this),this._20o={},this._21o.clear(),this.iv()},isExpanded:function(t){return this._10o===t},expand:function(t){this._20o[t]&&this._10o!==t&&(this._10o=t,this.onExpanded(t),this.iv())},onExpanded:function(){},collapse:function(){this._10o&&(this.onCollapsed(this._10o),delete this._10o,this.iv())},onCollapsed:function(){},initCanvas:function(t,e,i){rr(t,e,i);t=fr(t);return gr(t,0,0,1),t.clearRect(0,0,e,i),t},drawTitle:function(t,e,i,n,r){var o=this,a=Qa(r.icon),s=o.isExpanded(e),h=o._titleHeight,c=o._titleBackground,l=o._selectWidth,u=o._separatorColor,d=Qa(s?o._expandIcon:o._collapseIcon),r=l+4;lo(t,0,0,i,n,c),s&&l&&lo(t,0,0,l,n,o._selectBackground),!s&&o._21o.get(o._21o.size()-1)===e||lo(t,0,n-1,i,1,u||os(c)),a&&(Za(t,a,r+mh(a)/2,h/2),r+=mh(a)+2),ss(t,e,o.getLabelFont(e),o.getLabelColor(e),r,0,0,h),d&&Za(t,d,i-mh(d)/2-4,h/2)},validateImpl:function(){var a=this,t=a._view,s=0,h=0,c=a.getWidth(),l=a.getHeight(),u=a._titleHeight,d=a._21o.size()*u,e=a._11o,i=a._9o;delete a._11o,delete a._9o,a._21o.each(function(t){var e,i,n=a._20o[t],r=n.content,o=a._10o===t;un(a)?(wr(n.div,s,0,u,l),e=a.initCanvas(n.canvas,u,l),pr(e,0,l),_r(e,-I),a.drawTitle(e,t,l,u,n),e.restore(),o?(i=N(0,c-d),r&&(a._11o=r,a._9o=xr(r),wr(r,s+u,0,i,l)),s+=u+i):s+=u):(wr(n.div,0,h,c,u),e=a.initCanvas(n.canvas,c,u),a.drawTitle(e,t,c,u,n),e.restore(),o?(i=N(0,l-d),r&&(a._11o=r,a._9o=xr(r),wr(r,0,h+u,c,i)),h+=u+i):h+=u)});var n=a._9o;e&&e!==a._11o&&e.endEditing&&e.endEditing(),n&&n!==i&&or(t,n),i&&i!==n&&As(i)}}),Sp.SplitView=function(t,e,i,n){var r=this,o=r._dividerDiv=tr(),a=r._60O=er(),s=r._61O=er(),a=a.style,s=s.style;r._view=$n(1,r),or(r._view,o),a.msTouchAction=ri,a.pointerEvents=ri,a.cursor=ni,s.msTouchAction=ri,s.pointerEvents=ri,s.cursor=ni,t&&r.setLeftView(t),e&&r.setRightView(e),i&&r.setOrientation(i),n!=U&&r.setPosition(n),r.setStatus(It),new Ap(r)},Ip("SplitView",L,{ms_v:1,ms_fire:1,ms_ac:["continuousLayout","dividerSize","dividerBackground","toggleIcon","togglable","dragOpacity","orientation","draggable","status"],_continuousLayout:!1,_position:.5,_togglable:!0,_orientation:"h",_draggable:!0,_dividerSize:G.splitViewDividerSize,_dividerBackground:G.splitViewDividerBackground,_dragOpacity:G.splitViewDragOpacity,_toggleIcon:G.splitViewToggleIcon,onPropertyChanged:function(){this.iv()},getDividerDiv:function(){return this._dividerDiv},getPosition:function(){return this._position},setPosition:function(t,e){var i=this._position;isNaN(t)||(e||(this._82O=t<0?-1:1<t?1:0),this._position=t,this.fp(Me,i,t))},getLeftView:function(){return this._leftView},setLeftView:function(t){var e,i,n=this._leftView,r=this._view;this._leftView!==t&&(!n||n===this._rightView||(e=xr(n)).parentNode===r&&As(e),(this._leftView=t)&&(i=xr(t)).parentNode!==r&&r.insertBefore(i,this._dividerDiv),this.fp("leftView",n,t))},getRightView:function(){return this._rightView},setRightView:function(t){var e,i,n=this._rightView,r=this._view;this._rightView!==t&&(!n||n===this._leftView||(e=xr(n)).parentNode===r&&As(e),(this._rightView=t)&&(i=xr(t)).parentNode!==r&&r.insertBefore(i,this._dividerDiv),this.fp("rightView",n,t))},validateImpl:function(){var t=this,e=t._draggable,i=t._position,n=t.getWidth(),r=t.getHeight(),o=t._dividerSize,a=t._dividerBackground,s=et?18:8,h=t._dividerDiv,c=t._82O,l=t._60O,u=t._61O,d=t._toggleIcon,f=t._status,g=h.style,p=null,_=et?20:4,v=d.comps[0];s<=o||0===o?t._coverDiv&&(As(t._coverDiv),delete t._coverDiv):t._coverDiv||(t._coverDiv=tr(),A&&(t._coverDiv.style.background=Qe),or(h,t._coverDiv)),t._togglable?l.parentNode||(or(h,l),or(h,u)):(As(l),As(u));var y,m,b,x,w=t._coverDiv,E=t._leftView,T=t._rightView;un(t)?(n<o&&(o=n),f===It?1===c?(x=q(i,n),y=N(0,n-o-x)):-1===c?(y=q(-i,n),x=N(0,n-o-y)):(x=S((n-o)*i),y=N(0,n-o-x)):"cl"===f?y=N(x=0,n-o):"cr"===f&&(x=N(y=0,n-o)),E&&wr(E,0,0,x,r),T&&wr(T,x+o,0,y,r),wr(h,x,0,o,r),t._22o=x,w&&(wr(w,o/2-s/2,0,s,r),w.style.cursor=e?ei:""),h.style.cursor=e?ei:"",y=h.clientHeight/2,x=h.clientWidth,rr(l,x,x),wr(l,0,y-x-_,x,x),p=fr(l),gr(p,0,0,1),v.rotation=-I,wh(p,d,0,0,x,x),p.restore(),rr(u,x,x),wr(u,0,y+_,x,x),p=fr(u),gr(p,0,0,1),v.rotation=I):(r<o&&(o=r),f===It?1===c?(m=q(i,r),b=N(0,r-o-m)):-1===c?(b=q(-i,r),m=N(0,r-o-b)):(m=S((r-o)*i),b=N(0,r-o-m)):"cl"===f?b=N(m=0,r-o):"cr"===f&&(m=N(b=0,r-o)),E&&wr(E,0,0,n,m),T&&wr(T,0,m+o,n,b),wr(h,0,m,n,o),t._22o=m,w&&(wr(w,0,o/2-s/2,n,s),w.style.cursor=e?ii:""),g.cursor=e?ii:"",e=h.clientWidth/2,x=h.clientHeight,rr(l,x,x),wr(l,e-x-_,0,x,x),p=fr(l),gr(p,0,0,1),v.rotation=0,wh(p,d,0,0,x,x),p.restore(),rr(u,x,x),wr(u,e+_,0,x,x),p=fr(u),gr(p,0,0,1),v.rotation=P),wh(p,d,0,0,x,x),p.restore(),g.background=a}}),zs(Ap=function(t){this.sv=t,this.addListeners()},L,{ms_listener:1,getView:function(){return this.sv.getView()},handle_touchstart:function(t){var e=this.sv,i=e._dividerDiv,n=e._60O,r=e._61O,o=e._status,a=t.target;a===n?o===It?e.setStatus("cl"):"cr"===o&&e.setStatus(It):a===r?o===It?e.setStatus("cr"):"cl"===o&&e.setStatus(It):Pr(t)&&(a===i||a===e._coverDiv)&&(qa(t),e.isDraggable())&&(e.getLeftView(),e.getRightView(),(a=this.maskDiv=tr()).style.left=0,a.style.top=0,a.style.width=e.getWidth()+"px",a.style.height=e.getHeight()+"px",e.getView().appendChild(a),e.isContinuousLayout()||((a=this.resizeDiv=tr()).style.left=i.style.left,a.style.top=i.style.top,a.style.width=i.style.width,a.style.height=i.style.height,a.style.opacity=e.getDragOpacity(),a.style.background=e.getDividerBackground(),or(this.getView(),a)),this._lastAbsPosition=e._22o,this._86o=un(e)?_s(t).x:_s(t).y,Rs(this,t))},handleWindowTouchMove:function(t){Pr(t)&&this.update(t,this.sv.isContinuousLayout())},handleWindowTouchEnd:function(t){this.update(t,!0),this.sv.setStatus(It),this.maskDiv&&As(this.maskDiv),this.resizeDiv&&As(this.resizeDiv),this.maskDiv=this.resizeDiv=U},handle_mousedown:function(t){cs(t)&&this.handle_touchstart(t)},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},update:function(t,e){var i=this.sv,n=un(i)?i.getWidth():i.getHeight(),r=i._dividerSize,o=this._lastAbsPosition-this._86o;un(i)?(n-r<(o+=_s(t).x)&&(o=n-r),o<0&&(o=0),this.resizeDiv&&(this.resizeDiv.style.left=o+vt)):(n-r<(o+=_s(t).y)&&(o=n-r),o<0&&(o=0),this.resizeDiv&&(this.resizeDiv.style.top=o+vt)),e&&n!==r&&(1===i._82O?i.setPosition(o,1):-1===i._82O?i.setPosition(o-n+r,1):i.setPosition(o/(n-r),1))}}),Sp.TabView=function(){var t=this,e=t._view=$n(1,t),i=t._91O=tr(1),n=t._tabModel=new Nh,r=n.sm(),o=t.invalidate;t._7o=new Lh,t._canvas=er(i),or(e,i),or(e,t._92O=tr(1)),r.setSelectionMode(nt),r.ms(t.handleSelectionChange,t),n.mm(o,t),n.mh(o,t),n.md(o,t),t._interactor=new Pp(t),t.iv()},Ip("TabView",L,{ms_v:1,ms_fire:1,ms_tx:1,ms_ty:1,ms_lp:1,ms_ac:["movable","tabGap","tabHeight","tabPosition",qt,Wt,"tabHPadding","tabBackground","selectWidth",se,"moveBackground","insertColor"],_tabHPadding:0,_tabPosition:ct,_tabHeight:Ba,_tabGap:G.tabViewTabGap,_labelColor:G.tabViewLabelColor,_labelFont:G.tabViewLabelFont,_tabBackground:G.tabViewTabBackground,_selectWidth:G.tabViewSelectWidth,_selectBackground:G.tabViewSelectBackground,_moveBackground:G.tabViewMoveBackground,_insertColor:G.tabViewInsertColor,_movable:!0,handleSelectionChange:function(){this._selectionChanged=!0,this.invalidate()},getContentDiv:function(){return this._92O},getTitleDiv:function(){return this._91O},getTabModel:function(){return this._tabModel},add:function(t,e,i){var n,r=this._tabModel;return t instanceof Cp?(n=t,e&&n.setView(e)):((n=new Cp).setName(t),n.setView(e)),r.add(n),i&&r.sm().ss(n),n},getLabel:function(t){return t.toLabel()},onPropertyChanged:function(){this.iv()},_7Q:function(t){this._23o=t,this.iv()},get:function(e){var i,n=this,t=n._tabModel;return _n(e)?t._roots.get(e):pn(e)?(t.each(function(t){e===n.getLabel(t)&&(i=t)}),i):e instanceof Cp?e:U},select:function(t){this._tabModel.sm().ss(this.get(t))},remove:function(t){var e;(t=this.get(t))&&(e=this._tabModel._roots.indexOf(t),this._tabModel.remove(t),this.selectByIndex(--e))},getCurrentTab:function(){return this._8o},hideTabView:function(t,e){e.parentNode===this._92O&&(Cn(e)?(e.style.display=_t,e._tab_=t):As(e),Ta())},showTabView:function(t,e){Cn(e)&&(e.style.display="block",e._tab_=t),e.parentNode!==this._92O&&(or(this._92O,e),Ta())},_24o:function(){var t,e=this._8o,i=this._9o,n=this._tabModel.sm().ld();n&&(t=xr(n.getView())),t!==i&&(i&&(e.getView()&&e.getView().endEditing&&e.getView().endEditing(),this.hideTabView(e,i)),t&&this.showTabView(n,t)),this._8o=n,this._9o=t,e!==n&&this.onTabChanged(e,n)},onTabClosing:function(){return!0},onTabChanged:function(){},onTabClosed:function(t,e){this.selectByIndex(--e)},selectByIndex:function(t){var e=this._tabModel,i=e.size();if(i&&!e.sm().ld()){t==U&&(t=0),i<=t&&(t=i-1),t<0&&(t=0);for(var n=t;0<=n;n--){var r=this.get(n);if(!r.isDisabled())return this.select(r),r}for(n=t+1;n<i;n++)if(!(r=this.get(n)).isDisabled())return this.select(r),r}},getTabWidth:function(t){var e=4+2*this.getTabHPadding(),i=Qa(t.getIcon());i&&(e+=mh(i,t)+4);i=this.getLabel(t);return i&&(e+=hs(this.getLabelFont(t),i).width+4),t.isClosable()&&(e+=10),e},drawTab:function(t,e,i,n,r,o,a){var s,h=this._tabPosition,c=this.getTabHPadding(),l=i+4+c,u=this._selectWidth,d=Qa(e.getIcon()),f=e.isDisabled(),g=this.getLabelColor(e),p=this.getLabelFont(e),_=this.getLabel(e),v=this._selectBackground,y=h===st+"-vertical",m=h===ht+"-vertical";(y||m)&&(l=n+4+c),f&&(t.globalAlpha=va),lo(t,i,n,r,o,a),e===this._8o&&u&&(h===ct?lo(t,i,n+o-u,r,u,v):h===st?lo(t,i+r-u,n,u,o,v):h===ht?lo(t,i,n,u,o,v):y?lo(t,i+r-u,n,u,o,v):m?lo(t,i,n,u,o,v):lo(t,i,n,r,u,v));c=r/2;return y&&(pr(t,c,n+o/2),_r(t,P),pr(t,-c,-n-o/2)),d&&(a=bh(d,e),h=mh(d,e),y||m?(pr(t,u=i+r/2,v=l+a/2),_r(t,I),pr(t,-u,-v),Za(t,d,i+r/2,l+a/2,e,this),pr(t,u,v),_r(t,-I),pr(t,-u,-v),l+=a+4):(Za(t,d,l+h/2,n+o/2,e,this),l+=h+4)),y||m?(pr(t,r/2,l+r/2),_r(t,I),pr(t,-r/2,-l-r/2),ss(t,_,p,g,i,l,o,r),pr(t,r/2,l+r/2),_r(t,-I),pr(t,-r/2,-l-r/2)):ss(t,_,p,g,l,n,r,o),y&&(pr(t,c,n+o/2),_r(t,-P),pr(t,-c,-n-o/2)),e.isClosable()&&(s=m?{x:i+r-12,y:n+o-12,width:12,height:12}:{x:i+r-12,y:n+2,width:12,height:12},this.drawCloseIcon(e,t,g,s)),f&&(t.globalAlpha=1),s},drawCloseIcon:function(t,e,i,n){var r=n.x,n=n.y;e.strokeStyle=i,e.lineWidth=1,e.beginPath(),e.moveTo(r+2,n+8),e.lineTo(r+8,n+2),e.moveTo(r+8,n+8),e.lineTo(r+2,n+2),e.stroke()},getTabAt:function(t){t=this._interactor._8Q(t);return t?t.tab:null},validateImpl:function(){var n=this;n._24o();var t=n._canvas,e=n._tabPosition,i=n._91O,r=n._92O,o=n._tabModel,a=n.getWidth(),s=n.getHeight(),h=n._tabHeight,c=n._7o,l=n._tabGap,u=e===ct,d=e===st,f=e===ht,g=e===st+"-vertical",e=e===ht+"-vertical",p=n._23o,_=0;if((d||f)&&o._roots.each(function(t){_=N(n.getTabWidth(t),_)}),i=u?(wr(i,0,0,a,h),{x:0,y:h,width:a,height:N(0,s-h)}):d?(wr(i,0,0,_,s),{x:_,y:0,width:N(0,a-_),height:s}):f?(wr(i,a-_,0,_,s),{x:0,y:0,width:N(0,a-_),height:s}):g?(wr(i,0,0,h,s),{x:h,y:0,width:N(0,a-h),height:s}):e?(wr(i,a-h,0,h,s),{x:0,y:0,width:N(0,a-h),height:s}):(wr(i,0,s-h,a,h),{x:0,y:0,width:a,height:N(0,s-h)}),wr(r,i),g||e){n._9o&&(i.x=0,wr(n._8o.getView(),i)),rr(t,h,s);var v=fr(t),y=0;if(gr(v,0,n.ty(),1),v.clearRect(0,0,h,s),c.clear(),o._roots.each(function(t){var e,i;t.isVisible()&&(i=n.getTabWidth(t),p&&p.tab===t||(e=n.drawTab(v,t,0,y,h,i,n._tabBackground)),c.add({_75o:e,tab:t,startY:y,endY:y+i,height:i}),y+=i+l)}),n._23Q=N(0,y-l),p&&(x=p.position,n.drawTab(v,p.tab,0,p.startY,h,p.height,n._moveBackground),lo(v,0,x,h,1,n._insertColor)),v.restore(),n._selectionChanged){n._selectionChanged=!1;for(var m=n.ty(),b=0;b<c.size();b++)if((E=c.get(b)).tab===n._8o){if(E.endY+m<0){n.ty(-E.startY);break}if(E.startY+m>s){n.ty(s-E.endY);break}}}n.ty(n.ty())}else if(d||f){n._9o&&(i.x=0,wr(n._8o.getView(),i)),rr(t,_,s);v=fr(t),y=0;if(gr(v,0,n.ty(),1),v.clearRect(0,0,_,s),c.clear(),o._roots.each(function(t){var e;t.isVisible()&&(p&&p.tab===t||(e=n.drawTab(v,t,0,y,_,h,n._tabBackground)),c.add({_75o:e,tab:t,startY:y,endY:y+h,height:h}),y+=h+l)}),n._23Q=N(0,y-l),p&&(x=p.position,n.drawTab(v,p.tab,0,p.startY,_,p.height,n._moveBackground),lo(v,0,x,_,1,n._insertColor)),v.restore(),n._selectionChanged){n._selectionChanged=!1;for(m=n.ty(),b=0;b<c.size();b++)if((E=c.get(b)).tab===n._8o){if(E.endY+m<0){n.ty(-E.startY);break}if(E.startY+m>s){n.ty(s-E.endY);break}}}n.ty(n.ty())}else{n._9o&&(i.y=0,wr(n._8o.getView(),i)),rr(t,a,h);var x,v=fr(t),w=0;if(gr(v,n.tx(),0,1),v.clearRect(0,0,a,h),c.clear(),o._roots.each(function(t){var e,i;t.isVisible()&&(i=n.getTabWidth(t),p&&p.tab===t||(e=n.drawTab(v,t,w,0,i,h,n._tabBackground)),c.add({_75o:e,tab:t,startX:w,endX:w+i,width:i}),w+=i+l)}),n._64I=N(0,w-l),p&&(x=p.position,n.drawTab(v,p.tab,p.startX,0,p.width,h,n._moveBackground),qn(v,n._insertColor,x,0,h)),v.restore(),n._selectionChanged){n._selectionChanged=!1;for(var E,T=n.tx(),b=0;b<c.size();b++)if((E=c.get(b)).tab===n._8o){if(E.endX+T<0){n.tx(-E.startX);break}if(E.startX+T>a){n.tx(a-E.endX);break}}}n.tx(n.tx())}for(var S=[],I=r.children,b=0;b<I.length;b++){var C=I[b],M=C._tab_;M&&!o.contains(M)&&S.push(C)}S.forEach(function(t){r.removeChild(t)})}}),zs(Pp=function(t){this.tv=t,this.addListeners()},L,{ms_listener:1,getView:function(){return this.tv._91O},handle_mousewheel:function(t){this.handleScroll(t,t.wheelDelta/40*10)},handle_DOMMouseScroll:function(t){this.handleScroll(t,10*-t.detail)},handleScroll:function(t,e){qa(t);var i=this.tv,t=i._tabPosition;!i._40o()||t!==ct&&t!==lt||i.tx(this.tv.tx()+e),!i._41o()||t!==st&&t!==ht&&t!==st+"-vertical"&&t!==ht+"-vertical"||i.ty(this.tv.ty()+e)},_8Q:function(t){var e,i=this.tv,n=i._tabPosition,r=i._7o;if(n===ct||n===lt){for(var o=i.lp(t).x,a=0;a<r.size();a++)if((e=r.get(a)).startX<=o&&o<=e.endX)return e}else if(n===st||n===ht||n===st+"-vertical"||n===ht+"-vertical"){var s=i.lp(t).y;for(a=0;a<r.size();a++)if((e=r.get(a)).startY<=s&&s<=e.endY)return e}return U},isClickable:function(t){var e=this.tv,i=e._tabPosition,t=this._73o=this._8Q(t);return!(!e._40o()||i!==ct&&i!==lt)||(!(!e._41o()||i!==st&&i!==ht&&i!==st+"-vertical"&&i!==ht+"-vertical")||t&&(!t.tab.isDisabled()||e.isMovable()))},handle_mousemove:function(t){Ir?this._74o=this._8Q(t):this.getView().style.cursor=this.isClickable(t)?ni:""},handle_mousedown:function(t){this.handle_mousemove(t),this.handle_touchstart(t)},handle_touchstart:function(t){var e=this.tv,i=e._tabPosition;qa(t),cs(t)&&this.isClickable(t)&&(i===ct||i===lt?(this.x=_s(t).x,this.lp=e.lp(t),this.tx=e.tx()):(this.y=_s(t).y,this.lp=e.lp(t),this.ty=e.ty()),Rs(this,t))},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){var n,r,o,a,e=this,s=e.tv,i=s._tabPosition,h=e._73o;i===ct||i===lt?(r=_s(t).x-e.x,!e._25o&&!e.moving&&2<X(r)&&(s._40o()&&!ps(t)?e._25o=1:h&&s.isMovable()&&(e.moving=1)),e._25o?s.tx(e.tx+r):e.moving&&(n=e.lp.x+r,a=s._tabGap/2,s._7o.each(function(t){var e=t.endX,i=n-t.startX<e-n;n>=t.startX&&n<=e&&s._7Q({tab:h.tab,startX:h.startX+r,width:h.width,front:i,insertTab:t.tab,position:i?N(0,t.startX-a):q(s._64I,e+a)})}))):(r=_s(t).y-e.y,!e._25o&&!e.moving&&2<X(r)&&(s._41o()&&!ps(t)?e._25o=1:h&&s.isMovable()&&(e.moving=1)),e._25o?s.ty(e.ty+r):e.moving&&(o=e.lp.y+r,a=s._tabGap/2,s._7o.each(function(t){var e=t.endY,i=o-t.startY<e-o;o>=t.startY&&o<=e&&s._7Q({tab:h.tab,startY:h.startY+r,height:h.height,front:i,insertTab:t.tab,position:i?N(0,t.startY-a):q(s._23Q,e+a)})})))},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},handleWindowTouchEnd:function(){var t,e,i,n,r=this,o=r.tv,a=o._tabPosition,s=o.getTabModel(),h=s._roots,c=r._73o;r.moving?((t=o._23o)&&t.insertTab!==t.tab&&(e=t.tab,i=h.remove(e),0<=(n=h.indexOf(t.insertTab))&&(t.front||n++,n<=h.size()&&(h.add(e,n),s._38I(e,i,n)))),o._7Q(U),delete r.moving):!r._25o&&c&&(e=c.tab,(n=r._74o)&&n.tab!==e||(!e.isDisabled()&&xs(c._75o,r.lp)?(c=function(){var t=h.indexOf(e);s.remove(e),o.onTabClosed(e,t)},o.onTabClosing(e,c)&&c()):e.isDisabled()||o._8o===e||s.sm().ss(e))),r._25o=r._73o=r._74o=a===ct||a===lt?r.x=r.lp=r.tx=U:r.y=r.lp=r.ty=U}}),Sp.PropertyView=function(t){var e=this;e._view=$n(1,e),e._canvas=er(e._view),or(e._view,e._79O=tr()),e._rows=new Lh,e._28o=new Lh,e._26o={},e._26Q={};var i=e._propertyModel=new Nh,n=e.ivm;i.mm(n,e),i.md(n,e),i.mh(n,e),e.dm(t||new Nh),new Dp(e)},Ip("PropertyView",L,{ms_ac:[qt,Xt,Wt,Ee,Te,"categorizable",de,we,ye,me,be,le,ue,ce,"selectRowIndex",se,"background",fe,ve,pe,_e,ge],ms_v:1,ms_dm:1,ms_fire:1,ms_sm:1,_49o:1,ms_txy:1,ms_lp:1,ms_vs:1,_45o:1,_47o:1,ms_tip:1,_29I:Ji,_59I:0,_9I:0,_selectRowIndex:-1,_editable:!0,_batchEditable:!0,_categorizable:!0,_indent:Pa,_background:G.propertyViewBackground,_expandIcon:G.propertyViewExpandIcon,_collapseIcon:G.propertyViewCollapseIcon,_scrollBarColor:za,_scrollBarSize:Va,_autoHideScrollBar:xa,_selectBackground:G.propertyViewSelectBackground,_rowHeight:Da,_rowLineVisible:G.propertyViewRowLineVisible,_rowLineColor:G.propertyViewRowLineColor,_10I:.5,_columnLineVisible:G.propertyViewColumnLineVisible,_columnLineColor:G.propertyViewColumnLineColor,_labelColor:G.propertyViewLabelColor,_labelSelectColor:G.propertyViewLabelSelectColor,_labelFont:G.propertyViewLabelFont,getRows:function(){return this._rows},getColumnPosition:function(){return this._10I},setColumnPosition:function(t){t<0&&(t=0),1<t&&(t=1);var e=this._10I;this._10I=t,this.fp("columnPosition",e,t)},getPropertyName:function(t){return t.toLabel()},getLabelFont:function(){return this._labelFont},getLabelColor:function(t,e,i){return i===this._selectRowIndex?this._labelSelectColor:this._labelColor},getPropertyFont:function(){return this._labelFont},getPropertyColor:function(t,e){return e===this._selectRowIndex?this._labelSelectColor:t.getColor()||this._labelColor},getCategoryFont:function(){return this._labelFont},getCategoryColor:function(){return this._labelColor},adjustTranslateX:function(){return 0},adjustTranslateY:function(t){var e=this.getHeight()-this._59I;return t<e&&(t=e),0<t?0:S(t)},isExpanded:function(t){if(!t)return!0;var e=this._26o[t];return e?e.isExpanded:!(!1===this._26Q[t])},toggle:function(t){this.isExpanded(t)?this.collapse(t):this.expand(t)},expandAll:function(){for(var t in this.validate(),this._26o)this.expand(t)},expand:function(t){var e;!t||t===_t||(e=this._26o[t])&&!e.isExpanded&&(e.isExpanded=!0,this.onExpanded(t),this.ivm())},onExpanded:function(){},collapseAll:function(){for(var t in this.validate(),this._26o)this.collapse(t)},collapse:function(t){var e;!t||t===_t||(e=this._26o[t])&&e.isExpanded&&(e.isExpanded=!1,this.onCollapsed(t),this.ivm())},onCollapsed:function(){},getCategoryName:function(t){if(!this.isCategorizable())return _t;t=t.getCategoryName();return t||_t},getPropertyModel:function(){return this._propertyModel},handleSelectionChange:function(){this.ivm()},setDataModel:function(t){var e=this,i=e._dataModel;i!==t&&(i&&(i.umd(e.handlePropertyChange,e),e._selectionModel||i.sm().ums(e.handleSelectionChange,e)),(e._dataModel=t).md(e.handlePropertyChange,e),e._selectionModel?e._selectionModel._21I(t):t.sm().ms(e.handleSelectionChange,e),e.fp(Oe,i,t))},isVisible:function(t){return!this._visibleFunc||this._visibleFunc(t)},onPropertyChanged:function(t){t=t.property;bp[t]?this.ivm():this.iv(),t===De&&this._43o()},getCurrentData:function(){return this._27o},updateCurrentData:function(){this._27o=this.sm().ld()},getRawProperties:function(){return this._27o?this._propertyModel._roots:Fh},handlePropertyChange:function(t){this._27o===t.data&&this.iv()},ivm:function(){this.invalidateModel()},invalidateModel:function(){this._96I||(this.setSelectRowIndex(-1),this._96I=1,this.iv())},redraw:function(){this.iv()},validateModel:function(){var t,n=this,r=n._rows,e=n._28o,o={},a=new Lh,i=n._27o;for(t in n.updateCurrentData(),i!==n._27o&&n.endEditing(),r.clear(),e.clear(),n.getRawProperties().each(function(t){n.isVisible(t)&&(a.add(t),t=n.getCategoryName(t),o[t]||(e.add(t,t===_t?0:H),o[t]={isExpanded:n.isExpanded(t),properties:new Lh}))}),n._sortFunc&&a.sort(n._sortFunc),n._26o)n._26Q[t]=n.isExpanded(t);n._26o=o,e.each(function(e){e!==_t&&r.add(e);var i=o[e];i.isExpanded&&a.each(function(t){n.getCategoryName(t)===e&&(i.properties.add(t),r.add({property:t,data:n._27o}))},n)})},validateImpl:function(){var t=this;t._76o(),t._96I&&(t.validateModel(),delete t._96I);var e=t._canvas,i=t.getWidth(),n=t.getHeight(),r=-t.ty(),o=t._rowHeight,a=t._indent,s=i-a,h=t._rows,c=h.size(),l=t._9I=a+s*t._10I,u=t._59I=c*o;rr(e,i,n),t._29I={x:0,y:r,width:i,height:n},t._31I=k(r/o),t._14I=j((r+n)/o),t._31I<0&&(t._31I=0),t._14I>c&&(t._14I=c);var d=fr(e),f=t._background;gr(d,0,-r,1),d.beginPath(),d.rect(0,r,i,n),d.clip(),d.clearRect(0,r,i,n),t._93db(d),f&&lo(d,0,0,a,u,f);for(var g=t._31I;g<t._14I;g++){var p,_,v,y,m=h.get(g),r=o*g;pn(m)?(f&&lo(d,a,r,s,o,f),(v=Qa(t.isExpanded(m)?t._expandIcon:t._collapseIcon))&&Ka(d,v,qe,0,r,a,o),d.save(),d.beginPath(),d.rect(a,r,s,o),d.clip(),t.drawCategoryName(d,m,g,a,r,s,o),d.restore()):(p=m.property,_=m.data,v=Qa(p.getIcon()),y=t._selectRowIndex===g?t.getSelectBackground():U,v&&Ka(d,v,qe,0,r,a,o),y&&lo(d,a,r,s,o,y),d.save(),d.beginPath(),d.rect(a,r,l-a,o),d.clip(),t.drawPropertyName(d,p,g,a,r,l-a,o),d.restore(),t.isEditing(_,p)||(m=l+1,y=i-l-1,d.save(),d.beginPath(),d.rect(m,r,y,o),d.clip(),t._87o(t.drawPropertyValue(d,p,t.getValue(_,p),g,m,r,y,o,_),g,m,r,y,o),d.restore())),t._rowLineVisible&&lo(d,a,r+o-1,s,1,t._rowLineColor)}t._columnLineVisible&&(lo(d,l,0,1,u,t._columnLineColor),lo(d,i-1,0,1,u)),t._92db(d),t._93I(),d.restore(),t.ty(t.ty())},drawCategoryName:function(t,e,i,n,r,o,a){ss(t,e,this.getCategoryFont(e),this.getCategoryColor(e),n,r,o,a)},drawPropertyName:function(t,e,i,n,r,o,a){return e.drawPropertyName?void e.drawPropertyName(t,e,i,n,r,o,a,this):void ss(t,this.getPropertyName(e),this.getPropertyFont(e,i),this.getPropertyColor(e,i),n,r,o,a)},drawPropertyValue:function(t,e,i,n,r,o,a,s,h){return e.drawPropertyValue?e.drawPropertyValue(t,e,i,n,r,o,a,s,h,this):void wp(t,i,e,this.getLabelFont(e,i,n),this.getLabelColor(e,i,n),r,o,a,s,h,this)},isPropertyEditable:function(t){return t.isEditable()&&this.isEditable()},setProperties:function(t){this._propertyModel.clear(),this.addProperties(t)},addProperties:function(t){var i;t&&(i=this._propertyModel,t.forEach(function(t){var e;t instanceof Rp||(e=ns(t.className),t=Wa(e||Rp,t)),i.add(t)}))},getRowIndexAt:function(t){t=k(this.lp(t).y/this._rowHeight);return 0<=t&&t<this._rows.size()?t:-1},getPropertyAt:function(t){t=this.getRowIndexAt(t);return 0<=t?this._rows.get(t).property:U},getToolTip:function(t){var e=this.getPropertyAt(t),i=this._27o;return e&&i?e.getToolTip(i,this._9I<this.lp(t).x,this):U}}),zs(Dp=function(t){this.pv=t,this.addListeners()},L,{ms_listener:1,getView:function(){return this.pv._view},setCursor:function(t){this.getView().style.cursor=t},clear:function(){this._62O=this.cp=this.ty=this.p=U,this.setCursor(it)},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(t){var e=this.pv;qa(t),e.setFocus(t)&&(cs(t)?(this.cp=_s(t),this.ty=e.ty(),this.p=e.getColumnPosition(),this.handle_touchmove(t)):e.setSelectRowIndex(e.getRowIndexAt(t)))},handleWindowMouseUp:function(){this.clear()},handleWindowTouchEnd:function(){this.clear()},handle_mouseup:function(t){this.handle_touchend(t)},handle_touchend:function(t){var e,i,n,r,o,a,s,h,c,l;this.cp&&!this._62O&&(h=(a=(e=this.pv).lp(t)).x,s=a.y,i=e._indent,n=e.getRowIndexAt(t),l=e._9I,0<=n&&(c=(r=e._rowHeight)*n,a=(o=e._rows.get(n)).property,pn(o)?(Qa(e.isExpanded(o)?e._expandIcon:e._collapseIcon)&&0<=h&&h<=i&&c<=s&&s<=c+r||fs(t))&&e.toggle(o):l<h&&e.isPropertyEditable(a,t)&&(h={x:(s={x:l+1,y:c,width:e.getWidth()-l-1,height:r}).x+e.tx(),y:s.y+e.ty(),width:s.width,height:s.height},c=0,l=e._29I,s.y<l.y?c=s.y-l.y:s.y+r>l.y+l.height&&(c=s.y+r-l.y-l.height),c&&(e.ty(e.ty()-c),h.y-=c),e.beginEditing({data:o.data,property:a,value:e.getValue(o.data,a),event:t,rect:s,editorRect:h,view:e}))),e.setSelectRowIndex(n)),this.clear()},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){var e,i=this.pv,n=this.ty,r=this.cp,o=_s(t),a=this._62O;"p"===a?i.setTranslateY(n+o.y-r.y):"c"===a?16<(e=i.getWidth()-i._indent)&&((t=this.p-(r.x-o.x)/e)<(e=16/e)&&(t=e),1-e<t&&(t=1-e),i.setColumnPosition(t)):"s"===a&&i.setTranslateY(n+(r.y-o.y)*i._59I/i._29I.height)},handle_mousemove:function(t){this.handle_touchmove(t)},handle_touchmove:function(t){var e,i,n;!Ir&&cs(t)&&(i=(e=this).pv,n=X(i.lp(t).x-i._9I)<=(et?8:3),e.cp?e._62O||(n?(e._62O="c",Rs(e,t)):2<=X(_s(t).y-e.cp.y)&&(e._62O=e.isV(t)?"s":"p",Rs(e,t))):(n?e.setCursor(ei):e.setCursor(it),e.isV(t)&&i._43o()))},isV:function(t){var e=this.pv,i=e._29I;return e._41o()&&i.x+i.width-e.lp(t).x<ka},handle_mousewheel:function(t){this.handleScroll(t,t.wheelDelta/40)},handle_DOMMouseScroll:function(t){2===t.axis&&this.handleScroll(t,-t.detail)},handleScroll:function(t,e){var i=this.pv;qa(t),i.endEditing(),i.translate(0,e*i.getRowHeight())},handle_keydown:function(t){var e=this.pv,i=e._rows.size(),n=e._selectRowIndex+(Nr(t)?-1:1);(Nr(t)||Gr(t))&&(n<0&&(n=0),i<=n&&(n=i-1),e.setSelectRowIndex(n))}}),Sp.ListView=function(t){this._5o(t),new Op(this)},Ip("ListView",L,{ms_ac:[qt,Xt,Wt,fe,de,ve,pe,we,ye,le,ue,ce,he,se],ms_v:1,ms_bnb:1,ms_tip:1,ms_fire:1,ms_sm:1,_49o:1,ms_txy:1,ms_lp:1,ms_vs:1,ms_hs:1,_15Q:1,_14Q:1,ms_dm:1,_45o:1,_checkMode:!1,_indent:Pa,_rowHeight:Da,_rowLineVisible:G.listViewRowLineVisible,_rowLineColor:G.listViewRowLineColor,_scrollBarColor:za,_scrollBarSize:Va,_autoMakeVisible:ba,_autoHideScrollBar:xa,_selectBackground:G.listViewSelectBackground,_labelColor:G.listViewLabelColor,_labelSelectColor:G.listViewLabelSelectColor,_labelFont:G.listViewLabelFont,isCheckMode:function(){return this._checkMode},setCheckMode:function(t){var e=this._checkMode;this._checkMode=t,this.fp(xe,e,t)},drawRow:function(t,e,i,n,r,o,a){var s=0,h=this._indent,c=this.getIconWidth(e);this.drawRowBackground(t,e,i,n,r,o,a),this._checkMode&&(Za(t,Qa(this.getCheckIcon(e)),s+h/2,r+a/2,e,this),s+=h),this.drawIcon(t,e,s,r,c,a),this.drawLabel(t,e,s+c,r,a)}}),zs(Op=function(t){this.list=t,this.addListeners()},L,{ms_listener:1,getView:function(){return this.list._view},clear:function(t){var e=this,i=e.list;t&&"d"===e._62O&&!e.dragCancel&&i.handleDragAndDrop(t,"end"),i.draggingData&&(i.draggingData=null,i.redraw()),e.dragCancel=e._62O=e._isV=e._isH=e.cp=e.tx=e.ty=U},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(t){var e,i=this.list;qa(t),i.setFocus(t)&&(e=i.getDataAt(t),this.cp=_s(t),this.tx=i.tx(),this.ty=i.ty(),cs(t)?e&&i.handleDragAndDrop&&!this.isV(t)&&!this.isH(t)&&(i.draggingData=e,i.redraw(),i.handleDragAndDrop(t,"prepare")):(e?this._33o(t,e):this._cancelDataDoubleSelect(),this.clear(t)))},handleWindowMouseUp:function(t){this.clear(t)},handleWindowTouchEnd:function(t){this.clear(t)},handle_mouseup:function(t){this.handle_touchend(t)},handle_touchend:function(t){var e,i=this.list;this._isV||this._isH||!this.cp||this._62O||((e=i.getDataAt(t))?(i.isCheckMode()?this._34o(t,e):this._33o(t,e),fs(t)?i.onDataDoubleClicked(e,t):i.onDataClicked(e,t)):(this._cancelDataDoubleSelect(),i.handleBackgroundClick(t))),this.clear(t)},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){var e=this.list,i=this._62O,n=this.tx,r=this.ty,o=this.cp,a=_s(t),s=e._29I;"p"===i?e.setTranslate(n+a.x-o.x,r+a.y-o.y):"v"===i?e.ty(r+(o.y-a.y)*e._59I/s.height):"h"===i?e.tx(n+(o.x-a.x)*e._91I/s.width):"d"===i&&(this.dragCancel||e.handleDragAndDrop(t,"between"))},handle_mousemove:function(t){this.handle_touchmove(t)},handle_touchmove:function(t){var e,i;!Ir&&cs(t)&&(i=(e=this).list,e._isV=e.isV(t),e._isH=e.isH(t),e.cp?e._62O||ys(_s(t),e.cp)<2||(e._isV?e._62O="v":e._isH?e._62O="h":i.draggingData&&!this.dragCancel?(e._62O="d",i.handleDragAndDrop(t,"begin")):e._62O="p",e._62O&&"d"!==e._62O&&i.draggingData&&(i.draggingData=null,i.redraw()),Rs(e,t)):(e._isV&&i._43o(),e._isH&&i._42o()))},isV:function(t){var e=this.list,i=e._29I;return e._41o()&&i.x+i.width-e.lp(t).x<ka},isH:function(t){var e=this.list,i=e._29I;return e._40o()&&i.y+i.height-e.lp(t).y<ka},handle_mousewheel:function(t){this.handleScroll(t,t.wheelDelta/40,t.wheelDelta!==t.wheelDeltaX)},handle_DOMMouseScroll:function(t){this.handleScroll(t,-t.detail,1)},handleScroll:function(t,e,i){var n=this.list;qa(t),n.endEditing&&n.endEditing(),i&&n._41o()?n.translate(0,e*n.getRowHeight()):n._40o()&&n.translate(10*e,0)},handle_keydown:function(t){var e,i,n,r,o,a,s;G.isInput(t.target)||(n=(i=this.list).sm(),o=(r=i._rows).size(),Or(t)?i.selectAll():Br(t)?i.handleDelete&&i.handleDelete(t):qr(t)?"d"!==this._62O||this.dragCancel||(i.handleDragAndDrop(t,"cancel"),this.dragCancel=!0):Hr(t)?!i.isCheckMode()||(e=i.getFocusData())&&i.checkData(e):(Nr(t)||Gr(t))&&((e=(a=i.isCheckMode())?i.getFocusData():n.ld())?0<=(s=i.getRowIndex(e))&&(Nr(t)?0!==s&&(e=r.get(s-1),a?i.setFocusData(e):n.ss(e)):s!==o-1&&(e=r.get(s+1),a?i.setFocusData(e):n.ss(e))):0<o&&(e=r.get(0),a?i.setFocusData(e):n.ss(e))))},_34o:function(t,e){var i=this.list,t=i.lp(t).x;return 0<=t&&t<=i._indent?void i.checkData(e):void i.setFocusData(e)},_33o:function(t,e){var i=this.list,n=i.sm(),r=n.ld();if(i.canHandleSelectMode(t,e))if(ps(t))i.isSelected(e)?n.rs(e):n.as(e);else if(gs(t))if(r)for(var o=i.getRowIndex(r),a=i.getRowIndex(e);o!==a;)o+=o<a?1:-1,n.as(i._rows.get(o));else n.ss(e);else cs(t)?(n.contains(e)?i.handleDataDoubleSelect&&(this._handleDataDoubleSelect(t,e),fs(t)&&this._cancelDataDoubleSelect()):this._cancelDataDoubleSelect(),n.ss(e)):n.contains(e)||n.ss(e);else this._cancelDataDoubleSelect()},_handleDataDoubleSelect:function(t,e){this._cancelDataDoubleSelect(),this._doubleSelectTimer=w(function(){this.list.handleDataDoubleSelect(t,e),this._doubleSelectTimer=H}.bind(this),G.doubleClickSpeed)},_cancelDataDoubleSelect:function(){this._doubleSelectTimer&&(E(this._doubleSelectTimer),this._doubleSelectTimer=H)}}),Sp.TreeView=function(t){this._35o(),this._5o(t),new Bp(this)},Ip("TreeView",L,{ms_ac:[qt,Xt,Wt,"rootVisible",xe,"rootData",we,ye,le,ue,ce,de,fe,ve,pe,me,be,he,se,"loader","doubleClickToToggle"],ms_v:1,ms_bnb:1,ms_tip:1,ms_fire:1,ms_sm:1,_49o:1,ms_txy:1,ms_lp:1,ms_vs:1,ms_hs:1,_15Q:1,ms_dm:1,_48o:1,_14Q:1,_45o:1,_checkMode:U,_indent:Pa,_rowHeight:Da,_rowLineVisible:G.treeViewRowLineVisible,_rowLineColor:G.treeViewRowLineColor,_scrollBarColor:za,_scrollBarSize:Va,_autoHideScrollBar:xa,_expandIcon:G.treeViewExpandIcon,_collapseIcon:G.treeViewCollapseIcon,_autoMakeVisible:ba,_selectBackground:G.treeViewSelectBackground,_labelColor:G.treeViewLabelColor,_labelSelectColor:G.treeViewLabelSelectColor,_labelFont:G.treeViewLabelFont,_doubleClickToToggle:G.treeViewDoubleClickToToggle,drawRow:function(t,e,i,n,r,o,a){this.drawRowBackground(t,e,i,n,r,o,a),this.drawTree(t,e,i,0,r,o,a)},isOnToggleIcon:function(t){var e=this.getDataAt(t);if(e){var i=this.getIndent(),t=this.lp(t).x;if(Qa(this.getToggleIcon(e))){e=i*this.getLevel(e);if(e<=t&&t<=e+i)return!0}}return!1}}),zs(Bp=function(t){Bn(Bp,this,[t])},Op,{toggle:function(t,e,i,n){var r=this.list,o=r.lp(t).x;if(Qa(r.getToggleIcon(e))){n=i*n;if(n<=o&&o<=n+i)return r.toggle(e),!0}return!(!r.isDoubleClickToToggle()||!fs(t))&&(r.toggle(e),!0)},_34o:function(t,e){var i=this.list,n=i.lp(t).x,r=i._levelMap[e._id],o=i._indent,a=o*(r+1);return a<=n&&n<=a+o?void i.checkData(e):void(this.toggle(t,e,o,r)||i.setFocusData(e))},_33o:function(t,e){var i=this.list;if(!this.toggle(t,e,i._indent,i.getLevel(e)))if(gs(t)){var n=i.sm();if(0<n.size()){for(var r=i._rows,o=null,a=0,s=r.size();a<s;a++)if(i.isSelected(r.get(a))){o=a;break}for(var h=null,a=r.size()-1;0<=a;a--)if(i.isSelected(r.get(a))){h=a;break}for(var c,l=i.getRowIndex(e),u=l<o?(c=l-1,o):h<l?(c=h,l):(c=o,h);c!==u;)c++,n.as(i._rows.get(c))}else n.ss(e)}else Bp.superClass._33o.call(this,t,e)},handle_keydown:function(t){var e,i,n,r,o;jr(t)||Ur(t)?(i=(e=this.list)._rows,n=e.isCheckMode(),r=e.sm(),(o=n?e.getFocusData():r.ld())?o.hasChildren()&&(jr(t)?e.collapse(o):e.expand(o)):0<i.size()&&(o=i.get(0),n?e.setFocusData(o):r.ss(o))):Bp.superClass.handle_keydown.call(this,t)}}),zp=Sp.TableView=function(t){this._98I(),this._5o(t),new Vp(this)},Ip("TableView",L,{ms_ac:[qt,Xt,Wt,"sortMode",Ee,Te,fe,ve,pe,_e,ge,"sortColumn",we,ye,le,ue,ce,he,se],ms_v:1,ms_fire:1,ms_sm:1,_49o:1,ms_txy:1,ms_lp:1,ms_vs:1,ms_hs:1,_15Q:1,ms_dm:1,ms_tip:1,_50o:1,_45o:1,_47o:1,_sortMode:Se,_editable:!0,_batchEditable:!1,_rowHeight:Da,_rowLineVisible:G.tableViewRowLineVisible,_rowLineColor:G.tableViewRowLineColor,_columnLineVisible:G.tableViewColumnLineVisible,_columnLineColor:G.tableViewColumnLineColor,_scrollBarColor:za,_scrollBarSize:Va,_autoHideScrollBar:xa,_autoMakeVisible:ba,_selectBackground:G.tableViewSelectBackground,_labelColor:G.tableViewLabelColor,_labelSelectColor:G.tableViewLabelSelectColor,_labelFont:G.tableViewLabelFont,getCheckColumn:function(){var t;return this._31o||((t=this._31o=new Mp).setEditable(!0),t.setWidth(40),t.getValue=this.getCheckColumValue,t.drawCell=this.drawCheckColumnCell),this._31o},isCheckMode:function(){return this._39o.contains(this._31o)},setCheckMode:function(t){var e=this._39o,i=this.getCheckColumn();t!==this.isCheckMode()&&(t?e.add(i,0):e.remove(i),this.fp(xe,!t,t))},getCheckColumValue:function(t,e,i){return i.isSelected(t)},drawCheckColumnCell:function(t,e,i,n,r,o,a,s,h){Za(t,h.getCheckIcon(e),r+a/2,o+s/2,e,h)}}),zs(Vp=function(t){Bn(Vp,this,[t])},Op,{_34o:function(t,e){var i=this.list,n=i._31o;if(i.isCellEditable(e,n,t)){var r=i._3Q(n),o=i.lp(t).x;if(r&&o>=r.startX&&o<r.startX+n.getWidth())return void i.checkData(e)}i._37O(e,t),i.setFocusData(e)},_33o:function(t,e){this.list._37O(e,t),Vp.superClass._33o.apply(this,arguments)}}),Lp=Sp.TreeTableView=function(t){var e=this._4o=new Mp;this._35o(),this._98I(),this._5o(t),e.setDisplayName("Name"),e.setEditable(!0),e.setWidth(180),e.drawCell=Fp,e.getValue=kp,this._39o.add(e),new jp(this)},Fp=function(t,e,i,n,r,o,a,s,h){h.drawTree(t,e,i,r,o,a,s)},Ip("TreeTableView",L,{ms_ac:[qt,Xt,Wt,"sortMode",Ee,Te,de,xe,"rootData","rootVisible",we,ye,"sortColumn",me,be,le,ue,ce,he,pe,fe,ve,_e,ge,se,"loader"],ms_v:1,ms_bnb:1,ms_fire:1,ms_sm:1,_49o:1,ms_txy:1,ms_lp:1,ms_vs:1,ms_hs:1,_15Q:1,ms_dm:1,ms_tip:1,_50o:1,_48o:1,_14Q:1,_45o:1,_47o:1,_sortMode:Se,_checkMode:U,_editable:!0,_batchEditable:!(kp=function(t,e,i){return i.getLabel(t)}),_indent:Pa,_rowHeight:Da,_rowLineVisible:G.treeTableViewRowLineVisible,_rowLineColor:G.treeTableViewRowLineColor,_columnLineVisible:G.treeTableViewColumnLineVisible,_columnLineColor:G.treeTableViewColumnLineColor,_expandIcon:G.treeTableViewExpandIcon,_collapseIcon:G.treeTableViewCollapseIcon,_scrollBarColor:za,_scrollBarSize:Va,_autoHideScrollBar:xa,_autoMakeVisible:ba,_selectBackground:G.treeTableViewSelectBackground,_labelColor:G.treeTableViewLabelColor,_labelSelectColor:G.treeTableViewLabelSelectColor,_labelFont:G.treeTableViewLabelFont,getTreeColumn:function(){return this._4o}}),zs(jp=function(t){Bn(jp,this,[t])},Op,{_34o:function(t,e){var i=this.list,n=i._4o,r=i._3Q(n),o=i.lp(t).x;if(r){var a=i._indent,r=r.startX+a*i.getLevel(e);if(Qa(i.getToggleIcon(e))&&r<=o&&o<=r+a)return void i.toggle(e);if(i.isCellEditable(e,n)&&((r+=a)<=o&&o<=r+a))return void i.checkData(e)}i._37O(e,t),i.setFocusData(e)},_33o:function(t,e){var i=this.list,n=i.lp(t).x;if(Qa(i.getToggleIcon(e))){var r=i._3Q(i._4o);if(r){var o=i._indent,r=r.startX+o*i.getLevel(e);if(r<=n&&n<=r+o)return void i.toggle(e)}}i._37O(e,t),jp.superClass._33o.apply(this,arguments)}}),Np=Sp.TableHeader=function(t){var e=this,i=e._view=$n(1,e),n=e._39o=t.getColumnModel(),r=e.iv;e.tv=e._tableView=t,e._60I=new Lh,e._canvas=er(i),i.style.background=G.tableHeaderBackground||"",i.style.height=Oa+vt,n.mm(r,e),n.md(r,e),n.mh(r,e),t.mp(function(t){_p[t.property]&&e.iv()},e),new Up(e),e.iv()},Ip("TableHeader",L,{ms_v:1,ms_lp:1,ms_fire:1,ms_ac:["checkIcon","sortDescIcon","sortAscIcon",qt,Wt,de,"moveBackground","insertColor",_e,ge,"resizable","movable"],_checkIcon:Ot,_movable:!0,_resizable:!0,_labelColor:G.tableHeaderLabelColor,_labelFont:G.tableHeaderLabelFont,_columnLineColor:G.tableHeaderColumnLineColor,_columnLineVisible:G.tableHeaderColumnLineVisible,_sortDescIcon:G.tableHeaderSortDescIcon,_sortAscIcon:G.tableHeaderSortAscIcon,_moveBackground:G.tableHeaderMoveBackground,_insertColor:G.tableHeaderInsertColor,_indent:Pa,getCheckIcon:function(){return this._checkIcon},getTableView:function(){return this.tv},getLabel:function(t){return t.toLabel()},getLabelFont:function(){return this._labelFont},getLabelColor:function(t){return t.getColor()||this._labelColor},getLabelAlign:function(t){return t._align},onPropertyChanged:function(){this.iv()},_5Q:function(t){this._61I=t,this.iv()},getLogicalPoint:function(t){return Cs(t,this._canvas,this.tv.tx())},validateImpl:function(){var n=this,t=n._canvas,i=n.getWidth(),r=n.getHeight(),e=n.tv,o=n._60I,a=n._61I,s=-e.tx(),h=0;i===t.clientWidth&&r===t.clientHeight||rr(t,i,r),o.clear(),n._39o._roots.each(function(t){var e;t.isVisible()&&(e=h+t.getWidth(),h<=s+i&&s<=e&&o.add({column:t,startX:h}),h=e)});var c,l=fr(t);gr(l,-s,0,1),l.beginPath(),l.rect(s,0,i,r),l.clip(),l.clearRect(s,0,i,r),o.each(function(t){var e=t.column,i=t.startX,t=e.getWidth();0<t&&(l.save(),l.beginPath(),l.rect(i,0,t,r),l.clip(),a&&a.column===e||n.drawColumn(l,e,i,0,t,r),n._columnLineVisible&&lo(l,i+t-1,0,1,r,n._columnLineColor),l.restore())}),a&&(c=a.column,h=a.startX,e=a.position,t=c.getWidth(),l.save(),l.beginPath(),l.rect(h,0,t,r),l.clip(),l.fillStyle=n._moveBackground,l.fill(),n.drawColumn(l,c,h,0,t,r),l.restore(),qn(l,n._insertColor,e,0,r)),l.restore()},_6Q:function(t){var e=this.tv;return e._31o===t&&e.sm().getSelectionMode()===rt},drawColumn:function(t,e,i,n,r,o){var a,s,h,c,l,u=this,d=u.tv,f=Qa(e.getIcon()),g=u.getLabelAlign(e);u._6Q(e)?(l=Qa(u._checkIcon),Za(t,l,i+r/2,n+o/2,e,u)):(a=u.getLabel(e),s=u.getLabelFont(e),h=u.getLabelColor(e),c=hs(s,a).width,l=f?u._indent:0,g===st?(f&&Ka(t,f,qe,i,n,l,o),ss(t,a,s,h,i+l,n,r,o,st)):g===ht?(f&&Ka(t,f,qe,i+r-c-l,n,l,o),ss(t,a,s,h,i,n,r,o,ht)):(f&&Ka(t,f,qe,i+(r-c-l)/2,n,l,o),ss(t,a,s,h,i+(r-c+l)/2,n,0,o,st))),e.isSortable()&&d.getSortColumn()===e&&(f=Qa(e.getSortOrder()===Ie?u._sortAscIcon:u._sortDescIcon))&&(u=mh(f,e)/2+2,Za(t,f,g===ht?i+u:i+r-u,n+o/2,e,d))}}),zs(Up=function(t){this.th=t,this.tv=t._tableView,this.addListeners()},L,{ms_listener:1,getView:function(){return this.th.getView()},setCursor:function(t){this.getView().style.cursor=t},handle_mousemove:function(t){if(!Ir){delete this._29o,this.setCursor(it);for(var e=this.th,i=e._60I,n=e.lp(t).x,r=i.size()-1;0<=r;r--){var o=i.get(r),a=o.column,s=o.startX+a.getWidth();if(e.isResizable()&&X(s-n)<=(et?10:3))return this._29o=o,void this.setCursor(ei);n>o.startX&&n<s&&(this._29o=o),(a.isClickable()||a.isSortable()||e.isMovable()||this.tv.getCheckColumn&&a===this.tv.getCheckColumn())&&n>o.startX&&n<s&&this.setCursor(ni)}}},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(t){qa(t),this.tv.endEditing(),this.handle_mousemove(t),this._29o&&(this.x=_s(t).x,this.lx=this.th.lp(t).x,this.w=this._29o.column.getWidth(),Rs(this,t))},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){var n,e=this,r=e.th,i=e.getView().style.cursor,o=e._29o,a=_s(t).x-e.x;e.resizing||e.moving||(i===ei?e.resizing=1:r.isMovable()&&i===ni&&2<X(a)&&(e.moving=1)),e.resizing?o.column.setWidth(e.w+a):e.moving&&(n=e.lx+a,r._60I.each(function(t){var e=t.startX,i=e+t.column.getWidth();e<=n&&n<=i&&((t={column:o.column,startX:o.startX+a,front:n-e<i-n,insertColumn:t.column}).position=t.front?e:i,r._5Q(t))}))},_16Q:function(t,e){var i=this.tv,n=this.th,r=n._checkIcon;if(n._6Q(t)){var o=Qa(r),a=this.lx,s=t.getWidth(),o=mh(o,t);if(e+s/2-o<=a&&a<=e+s/2+o){n.setCheckIcon(r===Dt?Ot:Dt);o=i.sm(),n=i._rows;return r===Dt?o.rs(n):o.ss(n),i.onCheckColumnClicked(t),!0}}return!1},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},handleWindowTouchEnd:function(t){var e,i,n,r,o,a=this,s=a.tv,h=a.th,c=a._29o;a.moving?((e=h._61I)&&e.insertColumn!==e.column&&(i=e.column,o=(n=s.getColumnModel()._roots).remove(i),0<=(r=n.indexOf(e.insertColumn))&&(e.front||r++,r<=n.size()&&(n.add(i,r),s.getColumnModel()._38I(i,o,r)))),h._5Q(U),delete a.moving):!a.resizing&&c&&(i=c.column,o=h.lp(t).x,r=c.startX,c=!0,h.onColumnClicked&&!1===h.onColumnClicked(i,t,r)&&(c=!1),c&&r<=o&&o<=r+i.getWidth()&&!a._16Q(i,r)&&(i.isSortable()&&(c=s.getSortMode(),o=i.getSortOrder(),c===Se?s.getSortColumn()===i?(o===Ce&&s.setSortColumn(U),i.setSortOrder(o===Ie?Ce:Ie)):s.setSortColumn(i):"bistate"===c&&(s.getSortColumn()===i?i.setSortOrder(o===Ie?Ce:Ie):s.setSortColumn(i))),s.onColumnClicked(i,t,r))),a._29o=a.resizing=a.x=a.lx=a.w=U}}),Sp.TablePane=function(t){this.init(new zp(t))},Ip("TablePane",L,{ms_v:1,_44o:1}),Sp.TreeTablePane=function(t){this.init(new Lp(t))},Ip("TreeTablePane",L,{ms_v:1,_44o:1}),Sp.Toolbar=function(t){var n=this,e=n._view=$n(1,n),i=e.style;i.background=G.toolbarBackground||"",i.height=Ba+vt,n._canvas=er(e),n._30o=new Lh,n._90I=new Lh,n.setItems(t||[]),e.handleGroupSelectedChanged=function(e){var i;!e.isSelected()||null!=(i=e.getGroupId())&&n._items.forEach(function(t){t=t.element;t&&t!==e&&t.setSelected&&t.getGroupId&&t.getGroupId()===i&&t.setSelected(!1)})},new Gp(n)},Ip("Toolbar",L,{ms_v:1,ms_fire:1,ms_tx:1,ms_lp:1,ms_tip:1,ms_value:1,ms_ac:[St,qt,Wt,Xt,se,"itemGap","separatorColor","currentItem","stickToRight"],_labelColor:G.toolbarLabelColor,_labelSelectColor:G.toolbarLabelSelectColor,_labelFont:G.toolbarLabelFont,_selectBackground:G.toolbarSelectBackground,_itemGap:G.toolbarItemGap,_separatorColor:G.toolbarSeparatorColor,_stickToRight:!1,getSumWidth:function(){return this._64I},getToolTip:function(t){t=this.getItemInfoAt(t);return t?t.item.toolTip:U},getLabelColor:function(t){return t&&t.selected&&t.type!==Dt&&"radio"!==t.type?this._labelSelectColor:this._labelColor},onPropertyChanged:function(t){this.iv(),t.property===St&&this._items.forEach(function(t){Jn(t)})},redraw:function(){this.iv()},addItem:function(t,e){var i=this._items;e==U?i.push(t):i.splice(e,0,t),this.fp(St,U,i)},removeItem:function(t){if(t)for(var e=this._items,i=0;i<e.length;i++)t===e[i]&&(e.splice(i,1),this.fp(St,U,e))},removeItemById:function(t){if(t!=U)for(var e=this._items,i=0;i<e.length;i++)if(t===e[i].id){var n=e.splice(i,1)[0];return this.fp(St,U,e),n}},getItemById:function(t){if(t!=U)for(var e=this._items,i=0;i<e.length;i++){var n=e[i];if(t===n.id)return n}},setItemVisible:function(t,e){t=this.getItemById(t);t&&(t.visible=e)},getItemInfos:function(){return this._30o},getItemInfoAt:function(t){var e=0,i=this._30o,t=this.lp(t),n=t.x,t=t.y;if(0<=t&&t<=this.getHeight())for(;e<i.size();e++){var r=i.get(e);if(r.startX<=n&&n<=r.endX)return r}return U},drawItem:function(t,e,i,n,r){if(!1===e.visible)return 0;if(mn(e.visible)&&!e.visible())return 0;var o=e.disabled;o&&(t.globalAlpha=va);var a=this.drawItemImpl(t,e,i,n,r),r=this._itemGap;return o&&(t.globalAlpha=1),this._currentItem!==e||"separator"===e||!0===e.separator||e.unfocusable||bo(t,this._separatorColor,i-r/2,0,a+r,n),a},drawItemImpl:function(t,e,i,n,r){var o=this,a=o._view,s=o._itemGap,h=n/2,c=e.type,l=e.element,u=e.label;pn(l)&&(u=l,l=U);var d,f,g=o.getLabelFont(e),p=o.getLabelColor(e),_=e.selected,v=Qa(e.icon),y=mh(v,e),m=y+(u?hs(g,u).width:0);if("separator"===e||!0===e.separator)return qn(t,o._separatorColor,i,n/4,h),1;if(l){v&&Za(t,v,i+y/2,h,e,o),ss(t,u,g,p,i+y,0,0,n);var b=xr(l);r||o._90I.add(b),b.parentNode!==a&&or(a,b),l.iv&&l.iv(),l.validate&&l.validate();r=b.getBoundingClientRect(),a=r.width,l=b.style;return nr(b),l.left=o.tx()+i+m+vt,l.top=(n-r.height)/2+vt,m+a}return"radio"===c?d=Qa(_?Bt:zt):c===Dt&&(d=Qa(_?Dt:Ot)),d?(f=mh(d,e),Za(t,d,i+f/2,h,e,o),i+=f,m+=f):_&&lo(t,i-s/2,0,m+s,n,o.getSelectBackground(e)),v&&Za(t,v,i+y/2,h,e,o),ss(t,u,g,p,i+y,0,0,n),m},validateImpl:function(){var i=this,t=i._canvas,e=i.getWidth(),n=i.getHeight(),r=i._30o,o=i._items;rr(t,e,n);var a=fr(t),s=i._itemGap,h=s/2;gr(a,i.tx(),0,1),a.clearRect(0,0,e,n);var c=i._90I;i._90I=new Lh,r.clear(),o.forEach(function(t){var e=i.drawItem(a,t,h,n);r.add({item:t,startX:h,endX:h+e,width:e}),e&&(h+=e+s)}),c.each(function(t){i._90I.contains(t)||As(t)});c=i._64I;i._64I=N(0,h),a.restore(),i._stickToRight?(i._65O=0,a=fr(t),h=e-i._64I+s,gr(a,0,0,1),a.clearRect(0,0,e,n),r.clear(),o.forEach(function(t){var e=i.drawItem(a,t,h,n,!0);r.add({item:t,startX:h,endX:h+e,width:e}),e&&(h+=e+s)}),a.restore()):i.tx(i.tx()),c!==i._64I&&i.onSumWidthChanged(c,i._64I)},onSumWidthChanged:function(){},handleClick:function(e,t){var i=e.type,n=e.action,r=e.groupId,o=e.selected;e.disabled||(r!=U?o||(e.selected=!0,this._items.forEach(function(t){t.groupId===r&&e!==t&&(t.selected=!1)}),n&&e.action(e,this,t)):(i!==Dt&&"toggle"!==i||(e.selected=!o),n&&e.action(e,this,t))),Ta(),this.iv()}}),zs(Gp=function(t){this.tb=t,this.addListeners()},L,{ms_listener:1,getView:function(){return this.tb._view},handle_mousewheel:function(t){this.handleScroll(t,t.wheelDelta/40*10)},handle_DOMMouseScroll:function(t){this.handleScroll(t,10*-t.detail)},handleScroll:function(t,e){qa(t);t=this.tb;t.isScrollable()&&!t._stickToRight&&(t.tx(t.tx()+e),Sr())},handle_mousemove:function(t){Ir||this.setItem(t)},handle_mouseout:function(t){t.target===this.getView()?this.tb.setCurrentItem(U):this.handle_mousemove(t)},handle_mousedown:function(t){this.handle_mousemove(t),this.handle_touchstart(t)},handle_touchstart:function(t){var e=this.tb,i=t.target;!cs(t)||i!==this.getView()&&i!==e._canvas||(qa(t),e.setFocus(t)&&(this.setItem(t,!0),(e.isScrollable()||this.info&&!this.info.item.disabled)&&(this.x=_s(t).x,this.tx=e.tx(),Rs(this,t))))},handleWindowMouseMove:function(t){this.handleWindowTouchMove(t)},handleWindowTouchMove:function(t){var e=this.tb;e._stickToRight||(t=_s(t).x-this.x,!this._25o&&2<X(t)&&e.isScrollable()&&(this._25o=1),this._25o&&e.tx(this.tx+t))},handleWindowMouseUp:function(t){this.handleWindowTouchEnd(t)},handleWindowTouchEnd:function(t){var e=this.tb,i=this.info,n=this.tb.getItemInfoAt(t);!this._25o&&i&&(i=i.item,n&&n.item===i&&e.handleClick(i,t)),this._25o=this.x=this.tx=U,this.setItem()},setItem:function(t,e){var i=this.tb,n=this.info=t?i.getItemInfoAt(t):U,n=n?n.item:U;i.setCurrentItem(n),e&&n&&mn(n.onDown)&&n.onDown(t)}}),Sp.BorderPane=function(){this._view=$n(1,this),this.iv()},Ip("BorderPane",L,{ms_v:1,ms_ac:["topHeight","bottomHeight","leftWidth","rightWidth"],ms_fire:1,getLeftView:function(){return this._leftView},setLeftView:function(t,e){this._12o("leftView",t),e!=U&&this.setLeftWidth(e)},getRightView:function(){return this._rightView},setRightView:function(t,e){this._12o("rightView",t),e!=U&&this.setRightWidth(e)},getTopView:function(){return this._topView},setTopView:function(t,e){this._12o("topView",t),e!=U&&this.setTopHeight(e)},getBottomView:function(){return this._bottomView},setBottomView:function(t,e){this._12o("bottomView",t),e!=U&&this.setBottomHeight(e)},getCenterView:function(){return this._centerView},setCenterView:function(t){this._12o("centerView",t)},_12o:function(t,e){var i="_"+t,n=this._view,r=this[i];r!==e&&(r&&(r.getView?As(r.getView()):As(r)),(this[i]=e)&&(e.getView?or(n,e.getView(),1):or(n,e,1)),this.fp(t,r,e))},onPropertyChanged:function(){this.iv()},validateImpl:function(){var t=this,e=t._topView,i=t._bottomView,n=t._leftView,r=t._rightView,o=t._centerView,a=t.getWidth(),s=t.getHeight(),h=0,c=0,l=a,u=s,d=0,f=0,g=0,p=0;e&&(c=d=t._topHeight==U?lr(e):t._topHeight),i&&(u=s-(f=t._bottomHeight==U?lr(i):t._bottomHeight)),n&&(h=g=t._leftWidth==U?cr(n):t._leftWidth),r&&(l=a-(p=t._rightWidth==U?cr(r):t._rightWidth));s=N(0,l-h),t=N(0,u-c);e&&wr(e,0,0,a,d),i&&wr(i,0,u,a,f),n&&wr(n,0,c,g,t),r&&wr(r,l,c,p,t),o&&wr(o,h,c,s,t)}}))}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:(0,eval)("this"),Object);