12345678910111213141516171819 |
- !function(n,R,N){"use strict";var e="ht";if(!n[e]){!function(){Date.now&&Date.prototype.getTime||(Date.now=function(){return(new Date).getTime()}),n.performance&&n.performance.now||function(){var U=Date.now();n.performance||(n.performance={}),n.performance.now=function(){return Date.now()-U}}();for(var t=Date.now(),f=16,Y=["ms","moz","webkit","o"],U=0;U<Y.length&&!n.requestAnimationFrame;++U)n.requestAnimationFrame=n[Y[U]+"RequestAnimationFrame"],n.cancelAnimationFrame=n[Y[U]+"CancelAnimationFrame"]||n[Y[U]+"CancelRequestAnimationFrame"];n.requestAnimationFrame||(n.requestAnimationFrame=function(I){var G=Date.now(),Z=f+t-G;return 0>Z&&(Z=0),t=G,n.setTimeout(function(){t=Date.now(),I(performance.now())},Z)}),n.cancelAnimationFrame||(n.cancelAnimationFrame=function(i){return n.clearTimeout(i)}),R.assign===N&&(R.assign=function(J){if(J===N||null===J)throw new TypeError("Cannot convert undefined or null to object");for(var e=R(J),L=1;L<arguments.length;L++){var E=arguments[L];if(E!==N&&null!==E)for(var m in E)R.prototype.hasOwnProperty.call(E,m)&&(e[m]=E[m])}return e})}();var z,j,L,$,m=n.document,W=null,c=n[e]={},U=n[e+"config"],M=c.Default=U&&U.Default||{},F=c.Style=U&&U.Style||{},E=c.Attr=U&&U.Attr||{},T=c.Color=U&&U.Color||{},g=c.IsGetter=U&&U.IsGetter||{},H=Math,S=H.round,i=H.floor,J=H.ceil,v=H.sqrt,s=H.max,D=H.min,t=H.abs,o=H.cos,f=H.acos,b=H.sin,x=H.pow,r=H.asin,l=H.PI,C=2*l,q=l/2,I=H.tan,B=H.atan2,h=H.random,Z=H.log,X=function(O,W,S){return Math.max(W,Math.min(S,O))},Q=!1,u=!1,V=n.parseInt||global.parseInt,A="2018-07-01",d=n.navigator?n.navigator.platform.indexOf("Win")>-1:!1,y=function(B){return B*B},G=n.setTimeout,K=n.clearTimeout,P=n.location,a=n.navigator?n.navigator.userAgent.toLowerCase():"",Y=function(K){return K.test(a)},_=Y(/msie/),O=Y(/msie/)||Y(/trident/),w=Y(/msie 10/),k=Y(/edge/),p=Y(/firefox/),cd=Y(/mac/),Bs=M.isTouchable===N?d?!1:m?"ontouchend"in m:!1:M.isTouchable,Mj="default",mm="single",tm="multiple",_k="front",Xl="back",Ep="left",bc="right",Im="top",Cr="bottom",uf="center",fs="eye",ah="middle",ci="east",lg="west",vg="north",bf="none",is="px",Sq="absolute",Rr="border",gm="triangle",Rl="rect",Ml="circle",fj="cylinder",fr="shape",sr="items",um="normal",As="remove",Ln="clear",sq="width",yi="height",Tl="ingroup",tn="check",rm="uncheck",cl="radio",ac="radioOn",lj="radioOff",oc="points",Vi="values",Kb="series",Ip="body",yg="label",gp="label2",Wl="note",ik="note2",gb="icons",fn="labelFont",ug="labelColor",xs="labelSelectColor",fo="note.expanded",Am="note2.expanded",zb="edge.expanded",tc="edge.points",Pb="edge.type",Zq="rotation",Kn="getRotation",gg="setRotation",Wr="hidden",xm="visible",le="tuv",Po="no",hd="draw",Fk="select",Jj="currentSubGraph",Uo="selectBackground",ls="autoMakeVisible",zk="autoHideScrollBar",Vq="scrollBarColor",Fm="scrollBarSize",Zk="indent",Rf="rowHeight",ke="columnLineColor",wr="rowLineColor",Rm="columnLineVisible",hc="rowLineVisible",id="visibleFunc",Fn="expandIcon",Gf="collapseIcon",ts="checkMode",kc="sortFunc",xn="editable",xf="batchEditable",Gi="tristate",Tb="asc",Cd="desc",Rp="position",nf="elevation",rg="children",cr="translateX",ne="translateY",ol="dataModel",Zf="maxSize",Mk="shape3d",fq="shape3d.resolution",ub="shape3d.visible",Ze="shape3d.from.visible",Fo="shape3d.to.visible",sb="shape3d.top.visible",Um="shape3d.bottom.visible",Rj="repeat.uv.length",Vf="serializeValue",Pm="deserializeValue",Pk="centerUniform",zi="uniform",nr="rgba(255,255,255,0)",Ii="style",$l="attr",pl="field",Yh="string",ms="boolean",Hb="color",Bn="int",eg="number",Oj="ew-resize",Rn="ns-resize",ig="pointer",me="auto",Lk="mousedown",Pp="mousemove",wi="mouseup",wg="mouseout",jl="touchstart",nq="touchmove",Rc="touchend",Zj="keydown",Qb="keyup",Vg=["DOMMouseScroll","mousewheel"],dh=p?Vg[0]:Vg[1],rk=Bs?[jl,nq,Rc,Zj,Qb,"keypress","input","contextmenu"]:[Zj,Qb,"keypress","input",Lk,Pp,wi,wg,dh,"wheel","contextmenu","mouseenter","mouseleave","mouseover"],Sl=W,vb=W,qh=W,se=wi.length,cm=function(){qh&&(K(qh.timeout),qh=W)},Ro=function(){qh&&rq(qh.e,qh.info)};n.addEventListener&&(Bs||(n.addEventListener(wg,function(){cm()},!1),n.addEventListener(dh,function(){Kr()},!1)),n.addEventListener(Qb,function(Z){91===Z.keyCode?uq={}:delete uq[Z.keyCode]},!0),n.addEventListener(Zj,function(y){uq[y.keyCode]=!0},!0));var An,Qf,wq,fk=0,Ri=W,Uj=function(O,K){var U=G(function(){delete Ri[U],Jl(Ri)&&(Ri=W),O()},K);return U},$i=W,De=W,Wj={},_q={},vn={},Yk={},Jh={},uq={},Zn={},cj={},$d={},ae={},zm=/.json$/,vs=/^data:image\/svg\+xml/,Bo={},Td=[],Vp={},pm=W,fl=W,Gk=function(){},op=function(){throw"Oops!"},po=[0,0,0],be=[0,0,0,0],hp={x:0,y:0,width:0,height:0},zs=W,_g=W,uj=W,Og=function(l){_g&&!l._72O&&(uj||(uj={}),uj[l._72O=kg()]=l),An!=W?hr()<.05&&$&&!Qf&&(Ce=cm):Ce=Rg},Xj=function(V,Y,d,T){_g||(_g={});var L=_g[V];if(L){if(L.url===Y)return;L.image?(L.image.onload=Gk,L.image.onerror=Gk):L.request&&(L.request.onload=Gk,L.request.onerror=Gk)}if(zm.test(Y)){var g=new XMLHttpRequest;if(_g[V]={request:g,url:Y},g.overrideMimeType&&g.overrideMimeType("text/plain"),Y=M.beforeLoadURL(Y),Y.data){var S=M.parse(Y.data);Hr(V,S),M.handleImageLoaded(V,S)}else g.open("GET",encodeURI(Y),!0),g.onload=function(D){if(200===this.status||0===this.status){var J=M.parse(D.target.response||D.target.responseText);Hr(V,J),M.handleImageLoaded(V,J)}else Hr(V,M.handleUnfoundImage(V,Y)||W)},g.onerror=function(){Hr(V,M.handleUnfoundImage(V,Y)||W)},g.send(null)}else{var S=new Image;_g[V]={image:S,url:Y},O&&(Y.toLowerCase().indexOf(".svg")>0||vs.test(Y))?(m.body.appendChild(S),S.style.visibility="hidden",S.onload=function(){G(function(){if(d&&(S.width=d),T&&(S.height=T),!S.width||!S.height){var o=S.width||S.clientWidth,E=S.height||S.clientHeight;S.width=o,S.height=E}M.handleImageLoaded(V,S),Hr(V,S),m.body.removeChild(S),S.style.visibility=""},180)},S.onerror=function(){Hr(V,M.handleUnfoundImage(V,Y)||W),m.body.removeChild(S),S.style.visibility=""}):(S.onload=function(){d&&(S.width=d),T&&(S.height=T),M.handleImageLoaded(V,S),Hr(V,S)},S.onerror=function(){Hr(V,M.handleUnfoundImage(V,Y)||W)}),/^data:image/.test(Y)||(Y=M.beforeLoadURL(Y),/^data:image/.test(Y)||(Y=M.appendTimeStamp(Y),Y=encodeURI(Y))),S.src=Y}},Hr=function(J,x){if(_q[J]=x,delete _g[J],Jl(_g)&&(_g=W,uj)){for(var T in uj){var j=uj[T];j._2O&&(j._2O={}),j.invalidateAll&&j.invalidateAll(N,"imageLoaded",J),j.redraw&&j.redraw(),j.iv(),delete j._72O}uj=W}if(x&&uj)for(var T in uj){var j=uj[T];j.invalidateAll&&j.invalidateAll(N,"imageLoading",J),j.redraw&&j.redraw(),j.iv()}},Nh=function(){return Z=H&&Date,function(){return n.performance&&n.performance.now?n.performance.now():Date.now()}}(),of=function(s,w){w?K(s):n.cancelAnimationFrame(s)},Yf=function(H,g,c){return{width:H,height:g,comps:zn(c)?c:[c]}},sh=function(x,c){return{type:Ml,rect:[x,c,1.6,1.6],borderWidth:1,borderColor:zg,gradient:$p,gradientColor:qk,background:zg}},Xd=function(b,N){return Yf(16,16,{type:gm,rect:[4,4,10,8],background:b,rotation:N?1.57:3.14})},Jm=function(z,a){return Yf(16,16,{type:gm,rect:[4,4,8,7],background:z,rotation:a?3.14:0})},sf=function(r){var $=r._orientation;return"horizontal"===$||"h"===$},al=function(e){var t=W||4,K=W||1,A=W||1;0>t?t=0:t>.25&&(t=.25);var k,H,V,_,n,z,Y,u=.5,$=[],q=[],P=[],L=C/A,v=C/K,m=u-t;for(H=0;K>=H;H++)for(_=-l+H*v,z=o(_),n=b(_),k=0;A>=k;k++)V=k*L,Y=m+t*z,$.push(o(V)*Y,n*t,-b(V)*Y),(j=e)&&q.push(k/A,1-H/K);for(H=0;K>H;H++){var d=H*(A+1),h=(H+1)*(A+1);for(k=0;A>k;k++)P.push(d+k,h+k+1,h+k,d+k,d+k+1,h+k+1),cs.z=ej.z=e}},Ng=function(U){var z=2,p=0;for(var f in U)f.length===z&&V(f,32)===gd&&(pm=fl=U[f]),p++;return p},Te=function(B,t,F,K){return F||(F=Bs?5:3,F/=K||1),{x:B-F,y:t-F,width:2*F,height:2*F}},pb=function(v,y,t,L){var x=this;y||(y=Bs?5:3,t=20,L=20);var B={x:v,y:y,width:t,height:L};if(t)for(var Q=0;t>Q;Q++)if(3===t)L=20;else for(var d=0;L>d;d++)x=n?n:t;var r={x:l,y:2*l};if(Vb(B,r)){var O=yi[0]+Im[0]+Ln[1]+(Tb.length-1);yh[fs]=x[O],x[O]=Zh[fs]}},_m=function(h){return(/ble$/.test(h)||/ed$/.test(h)||g[h]?"is":"get")+h.charAt(0).toUpperCase()+h.slice(1)},Zh=function(D){return"set"+D.charAt(0).toUpperCase()+D.slice(1)},Qc=function(Z){return typeof Z===Yh||Z instanceof String},lk=function(R){return typeof R===eg},Rg=function(P){return typeof P===ms},ko=function(H){return H&&"object"==typeof H},zl=function(u){return"function"==typeof u},zn=function(p){return p instanceof Array},Tc=function(l){return l instanceof If},Nm=function(N){return zn(N)?new If(N):N},Cj=function(b){return b instanceof ur},Fe=function(H){return H instanceof Vr},tl=function(C){return C instanceof Zb},Ge=function(W,R){if(!(W instanceof c.Group))return!1;if(!R)return W.isExpanded();var j=R.getDataUI(W);return j&&j._88I?!0:!1},Ph=function(S){return S instanceof Fh},Tp=function(r){return r&&"IFRAME"===r.tagName},_i=function(r){return r==W||M.numberDigits==W?r:parseFloat(r.toFixed(M.numberDigits))},em=function(C,P,N){var V,U=P.length;if(N)for(var y=0;N>y;y++)if(3===U)C.push(P[0]),C.push(P[1]),C.push(P[2]);else for(V=0;U>V;V++)C.push(P[V]);else if(3===U)C.push(P[0]),C.push(P[1]),C.push(P[2]);else for(V=0;U>V;V++)C.push(P[V])},Wm=function(B){return B?ko(B)?B:{}:!1},dr=function(C,Z,U){var O,i=ko(C)?C:C.prototype;for(O in Z)U&&i[O]!==N||(i[O]=Z[O]);return C},Bd=function(L){return String.fromCharCode(L)},rs=function(N){for(var V,P=0,H="";P<N.length;P++)V=N[N.length-1-P],"%"===V?V="'":"a"===V?V='"':"]"===V&&(V="\\"),H+=Bd(V.charCodeAt(0)-1);return H},Ne=function(I,o,p){I.superClass.constructor.apply(o,p)},Jl=function(W){for(var C in W)return!1;return!0},gh=function(E){return E?0===E.length:!0},Om=function(){var u="";return[rm[0],wr[0],yg[0]].forEach(function(S){u+=Zh(S).slice(3)}),zi=m&&m[u]||Pk,function(S,v){return S===v?!0:S.x===v.x&&S.y===v.y&&S.width===v.width&&S.height===v.height}}(),qo=function(M,z,e){return z>M?z:M>e?e:M},nm=function(M){return 0>M?-1:M>0?1:0},hr=function(){var O=1e4*b(se++);return O-i(O)},os=function(t,$,q){return Jc(t.x,t.y,$.x,$.y,q.x,q.y,q.x+q.width,q.y,!0)||Jc(t.x,t.y,$.x,$.y,q.x+q.width,q.y,q.x+q.width,q.y+q.height,!0)||Jc(t.x,t.y,$.x,$.y,q.x+q.width,q.y+q.height,q.x,q.y+q.height,!0)||Jc(t.x,t.y,$.x,$.y,q.x,q.y+q.height,q.x,q.y,!0)},Jc=function(T,i,E,L,Q,Z,x,o,d){var O=(x-Q)*(i-Z)-(o-Z)*(T-Q),B=(o-Z)*(E-T)-(x-Q)*(L-i);if(0!==B){var X=O/B,m=T+X*(E-T),M=i+X*(L-i);return d&&(m+ep<D(T,E)||m-ep>s(T,E)||m+ep<D(Q,x)||m-ep>s(Q,x)||M+ep<D(i,L)||M-ep>s(i,L)||M+ep<D(Z,o)||M-ep>s(Z,o))?W:[m,M]}return W},nk=function(D,w,r){if(D&&r)if(w){if(w===Ii)return D.getStyle(r);if(w===$l)return D.getAttr(r);if(w===pl)return D[r]}else if(r=_m(r),D[r])return D[r]();return N},$b=function(l,g,Y,i){if(l&&Y)if(g){if(g===Ii)l.s(Y,i);else if(g===$l)l.a(Y,i);else if(g===pl){var U=l[Y];l[Y]=i,l.fp("f:"+Y,U,i)}}else Y=Zh(Y),l[Y]&&l[Y](i)},Jk=function(e,G,o){return G&&"top"!==G?"bottom"===G?{x:e.x,y:e.y,width:e.width,height:e.height*o}:"right"===G?{x:e.x,y:e.y,width:e.width*o,height:e.height}:"left"===G?{x:e.x+e.width*(1-o),y:e.y,width:e.width*o,height:e.height}:void 0:{x:e.x,y:e.y+e.height*(1-o),width:e.width,height:e.height*o}},bh=function(y,H,m,o,q){H&&ic(y,m,o,1,q,H)},lr=function(W,O,X,x){var c=1-W;return c*c*O+2*W*c*X+W*W*x},cs=function(S,q,r,N,c){var G=1-S;return G*G*G*q+3*G*G*S*r+3*G*S*S*N+S*S*S*c},pg=function(U){var o,F,P,L,b=0;return U.forEach(function(c){if(o=c.length,o>0)for(F=c[0],L=1;o>L;L++)P=c[L],b+=Nc(F,P),F=P}),b},Se=function(B,G,J){var h="__"+B,I=function(S){J.disabled||J["handle_"+B](S)};J[h]||(J[h]=I,G.addEventListener(B,I,!1))},Ck=function(X,J,B){var k="__"+X,e=B[k];e&&(J.removeEventListener(X,e,!1),delete B[k])},ld=function(M,g){var m="_"+g;M[_m(g)]=function(){return this[m]},M[Zh(g)]=function(A){var w=this[m];this[m]=A,this.fp(g,w,A)}},ib=function(H){return R.create(H)},Oc=function(o){if(!o.element){var A,W;(A=o.textField)?W=Yc(en.TextField,A):(A=o.textArea)?W=Yc(en.TextArea,A):(A=o.button)?W=Yc(en.Button,A):(A=o.comboBox)?W=Yc(en.ComboBox,A):(A=o.checkBox)?W=Yc(en.CheckBox,A):(A=o.radioButton)?W=Yc(en.RadioButton,A):(A=o.slider)?W=Yc(en.Slider,A):(A=o.colorPicker)?W=Yc(en.ColorPicker,A):(A=o.image)&&(W=Yc(en.Image,A)),W&&(o.element=W)}},Ko=function(g,I){var z=ps(g);return z._ht=I,z},ps=function(i,H){var Z=m.createElement("div"),g=Z.style;return Z.tabIndex=-1,Z.onkeydown=Zp,g.msTouchAction=bf,ni(Z,W,0),Bs&&g.setProperty("-webkit-tap-highlight-color","rgba(0, 0, 0, 0)",W),i&&(g.overflow=Wr),H&&Vd(H,Z),Z},Nr=function(D,M){var G=m.createElement("canvas"),i=G.style;return i.msTouchAction=bf,M||(i.pointerEvents=bf),ni(G,W,0),D&&Vd(D,G),G},ni=function(j,C,B){var U=j.style;U.border=C?C+" solid 1px":0,U.outline=0,U.padding=B?"0 "+B+is:0,cf(j)},cf=function(D){var h=D.style;h.position=Sq,h.margin=0,h.setProperty("box-sizing","border-box",W),h.setProperty("-moz-box-sizing","border-box",W)},Bi=function(C,Z,T,g){g||(g=Qd),Z!=W&&(C.width=Z*g,C.style.width=Z+is),T!=W&&(C.height=T*g,C.style.height=T+is)},Vd=function(q,X,c){q.appendChild(X),c&&(X.style.position=Sq)},vj=function(u,D){D.split||(D+="");for(var n,g=D.split("\n"),Y=0,L=g.length,I=0;L>I;I++){var M=$n(u.font,g[I]);M.width>Y&&(Y=M.width),n||(n=M.height)}return u.ss=g,{width:Y,height:n*L}},ir=function(c,f,R,C,b,U){var T=f.length;if(1===T)oj(c,f[0],R,C,b);else for(var r=R.height/T,w={x:R.x,y:R.y,width:R.width,height:r},j=0;j<f.length;j++)U?qb(c,f[j],C,b,w.x,w.y,w.width,w.height,U):oj(c,f[j],w,C,b),w.y+=r},oj=function(Y,c,$,h,u){Y.font=h?h:Eh,Y.fillStyle=u?u:yd,Y.textAlign=uf,Y.textBaseline=ah;var M,U;$?$.width===N?(M=$.x,U=$.y):(M=$.x+$.width/2,U=$.y+$.height/2):(M=0,U=0),Y.fillText(c,S(M),S(U))},vq=function(w){w.getView&&(w=w.getView());var U=w.offsetWidth||w.scrollWidth;return!U&&w.style.width&&(U=V(w.style.width)),U},mf=function(A){A.getView&&(A=A.getView());var W=A.offsetHeight||A.scrollHeight;return!W&&A.style.height&&(W=V(A.style.height)),W},$f=function(M,Q,L){var C=Q[0].toUpperCase()+Q.substring(1,Q.length);M["webkit"+C]=L,M["moz"+C]=L,M["ms"+C]=L,M["o"+C]=L,M[Q]=L},dc=function(){var T=function(j){Zp(j),j.stopPropagation()},d=Bs?[jl]:[Zj,Lk];return function(s){var _=ps(),o=_.style;return o.backgroundColor=M.disabledBackground,s&&(o.backgroundImage="url("+s+")",o.backgroundPosition="50% 50%",o.backgroundRepeat="no-repeat no-repeat"),d.forEach(function(B){_.addEventListener(B,T)}),_}}(),ch=function($){var Z=$.getContext("2d");return Z.save(),Z.lineCap=jb,Z.lineJoin=Ui,Z},Ce=function(v,q,S,Y){vc(v,q*Qd,S*Qd),Y*=Qd,1!==Y&&v.scale(Y,Y)},vc=function(J,c,M){J.translate(c,M)},We=function(L,V){V&&L.rotate(V)},li=function(Q,k,h){k===N&&(k=1),h===N&&(h=1),(1!==k||1!==h)&&Q.scale(k,h)},Nn=!1,ds=function(E){var r=m.activeElement;if(m.activeElement!==E){r&&r.forceOnblur&&r.forceOnblur();for(var Y=[],T=E.parentNode;T;)Y.push([T,T.scrollLeft,T.scrollTop]),T=T.parentNode;if(!Nn){var d=[];try{for(var h=n.parent,k=n;h!==k;)d.push([h,h.scrollX,h.scrollY]),k=h,h=n.parent}catch(A){Nn=!0}}if(Bs)E.focus();else{var L=Vj(),V=L.target;E.focus(),V.scrollLeft=L.left,V.scrollTop=L.top}Y.forEach(function(X){X[0].scrollLeft=X[1],X[0].scrollTop=X[2]}),Nn||d.forEach(function(Q){Q[0].scrollTo(Q[1],Q[2])})}},Gg=function(o){return o&&o.getView?o.getView():o},vr=function(h,Z,p,C,T){if(2===arguments.length&&(p=Z.y,C=Z.width,T=Z.height,Z=Z.x),h.isSelfViewEvent)h.setX(Z),h.setY(p),h.setWidth(C),h.setHeight(T);else{var J=Gg(h),g=J.style;if((m.fullscreenElement||m.mozFullScreenElement||m.webkitFullscreenElement||m.msFullscreenElement)!==J)Z!==N&&(g.left=Z+is),p!==N&&(g.top=p+is),C!==N&&(g.width=C+is),T!==N&&(g.height=T+is);else{var R=M.getWindowInfo();g.left=(Z=R.left)+is,g.top=(p=R.top)+is,g.width=(C=R.width)+is,g.height=(T=R.height)+is}h.endEditing&&!Bs&&h.endEditing(),h.redraw&&h.redraw(),h.invalidate&&h.invalidate(),h.onLayouted&&h.onLayouted(Z,p,C,T),h.fireViewEvent&&h.fireViewEvent("layout")}},xo=function(n){if(!n.touches)return n;var _=n.touches[0];return _?_:n.changedTouches[0]},Ji=function(c){return Bs?xo(c).target:c.target},Jo=function(q){M.popup&&M.popup.close(),M.popup=q},Ug=W,qg=function(N){Ug.handleWindowTouchMove(N)},sp=function(t){Ug.handleWindowTouchEnd(t),n.removeEventListener(nq,qg,!1),n.removeEventListener(Rc,sp,!1),Ug=W},pk=function(Z){Ug.handleWindowMouseMove(Z)},Th=function(S){Ug.handleWindowMouseUp(S),n.removeEventListener(Pp,pk,!1),n.removeEventListener(wi,Th,!1),Ug=W},pr=function(F){return 1===cg(F)},cp=function(T,m){return m?m.keyCode===T:uq[T]},Vc=function(H){return ji(H)&&cp(65,H)},Qh=function(f){return cp(46,f)||cp(8,f)},_o=function(z){return function(y){return y?y.keyCode===z:uq[z]}},gd=573,Kk=[65,83,68,87,37,38,39,40,32,13,27],bg=_o(Kk[0]),Ll=_o(Kk[1]),fh=_o(Kk[2]),sc=_o(Kk[3]),Ae=_o(Kk[4]),Gr=_o(Kk[5]),Fr=_o(Kk[6]),ob=_o(Kk[7]),Nd=_o(Kk[8]),uc=_o(Kk[9]),Zr=_o(Kk[10]),Pg={65:1,83:1,68:1,87:1,37:1,38:1,39:1,40:1},Wb=[2,2,2,2,2,2,2,2,2,2,3,3,3,5,5,5,5,5,17713],Yp=W,On=W,ap=function(x,a){Yp||(Yp=Nr()),Bi(Yp,x,a,1);var D=ch(Yp);return D.clearRect(0,0,x,a),D},Pl=function(){var f,i={};for(var G in n){var z=tm.length;if(G.length==z&&G[0]===tm[2]&&G[1]===bf[1]&&G[4]===tm[3]&&G[5]===tm[4]&&G.substr(z-2)===bf[1]+bf[2]){var V=n[G];for(var s in V)s.length===z&&s.substr(0,3)===bc[3]+As[3]+Fk[0]&&s.substr(z-2)===tm[0]+Wl[3]&&(Vg=V[s])}}return function(y){var H,B=i[y];return B||(f||(f=Nr(),Bi(f,1,1,1)),H=f.getContext("2d"),H.clearRect(0,0,1,1),ic(H,0,0,1,1,y),B=H.getImageData(0,0,1,1).data,B=i[y]=[B[0],B[1],B[2],B[3]]),B}}(),ho=function(G){if(!Qc(G))return G;var i=Pl(G);return i.CA||(i.CA=[i[0]/255,i[1]/255,i[2]/255,i[3]/255]),i.CA},_e=function(f,y,g,U,u){var z=Nr();z.width=g,z.height=U;var i=z.getContext("2d");i.drawImage(f,0,0,g,U);try{for(var E=i.getImageData(0,0,g,U),M=E.data,v=0,o=M.length;o>v;v+=4){var V=M[v+0],l=M[v+1],d=M[v+2],$=M[v+3];"override_a"===u?M[v+3]=255*y[3]:"override_rgb"===u?(M[v+0]=255*y[0],M[v+1]=255*y[1],M[v+2]=255*y[2]):"override"===u?(M[v+0]=255*y[0],M[v+1]=255*y[1],M[v+2]=255*y[2],M[v+3]=255*y[3]):(M[v+0]=y[0]*V,M[v+1]=y[1]*l,M[v+2]=y[2]*d,M[v+3]=y[3]*$)}i.putImageData(E,0,0)}catch(k){return f}return z},yh=function(O,k,H){return k&&(k="miter"===H?8*k+20:k+1,O&&lo(O,k)),k},Ah=function(g,q){if(q){var z=new ng(q),C=g.width/2,R=g.height/2,n=rd([z.tf(-C,-R),z.tf(C,-R),z.tf(C,R),z.tf(-C,R)]);return n.x+=g.x+C,n.y+=g.y+R,n}return g},Kq=function(b,K,N,l,d,c,X,U){l*=Math.PI/180;var y={x:Math.cos(l)*(b.x-X.x)/2+Math.sin(l)*(b.y-X.y)/2,y:-Math.sin(l)*(b.x-X.x)/2+Math.cos(l)*(b.y-X.y)/2},f=Math.pow(y.x,2)/Math.pow(K,2)+Math.pow(y.y,2)/Math.pow(N,2);f>1&&(K*=Math.sqrt(f),N*=Math.sqrt(f));var C=(d==c?-1:1)*Math.sqrt((Math.pow(K,2)*Math.pow(N,2)-Math.pow(K,2)*Math.pow(y.y,2)-Math.pow(N,2)*Math.pow(y.x,2))/(Math.pow(K,2)*Math.pow(y.y,2)+Math.pow(N,2)*Math.pow(y.x,2)));isNaN(C)&&(C=0);var n={x:C*K*y.y/N,y:C*-N*y.x/K},W={x:(b.x+X.x)/2+Math.cos(l)*n.x-Math.sin(l)*n.y,y:(b.y+X.y)/2+Math.sin(l)*n.x+Math.cos(l)*n.y},z=function(N){return Math.sqrt(Math.pow(N[0],2)+Math.pow(N[1],2))},V=function(d,J){return(d[0]*J[0]+d[1]*J[1])/(z(d)*z(J))},j=function(v,j){return(v[0]*j[1]<v[1]*j[0]?-1:1)*Math.acos(V(v,j))},D=j([1,0],[(y.x-n.x)/K,(y.y-n.y)/N]),q=[(y.x-n.x)/K,(y.y-n.y)/N],s=[(-y.x-n.x)/K,(-y.y-n.y)/N],E=j(q,s);V(q,s)<=-1&&(E=Math.PI),V(q,s)>=1&&(E=0);var V=K>N?K:N,p=K>N?1:K/N,T=K>N?N/K:1;if(null==U){var k={x:0,y:0,width:0,height:0};lo(k,V),k.x*=p,k.width*=p,k.y*=T,k.height*=T;var i=new ng(l);return k=rd([i.tf(k.x,k.y),i.tf(k.x+k.width,k.y),i.tf(k.x+k.width,k.y+k.height),i.tf(k.x,k.y+k.height)]),k.x+=W.x,k.y+=W.y,[{x:k.x,y:k.y},{x:k.x+k.width,y:k.y},{x:k.x+k.width,y:k.y+k.height},{x:k.x,y:k.y+k.height}]}U.translate(W.x,W.y),U.rotate(l),U.scale(p,T),U.arc(0,0,V,D,D+E,1-c),U.scale(1/p,1/T),U.rotate(-l),U.translate(-W.x,-W.y)},Il=function(R,S){R&&R.beginPath();for(var b,s,e,Z=[],w=function(d){for(var z,j=/(\-{0,1}[\d\.]+)/gi,$=[];z=j.exec(d);)$.push(parseFloat(z[0]));return $},C=/([MmLlHhVvCcSsQqTtAa]{1}[\d\.,\s\-Zz]*)/gi,$={x:0,y:0};b=C.exec(S);){var y=b[0],Q=y.substr(0,1);if("M"===Q||"m"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=2){var M=K[Y],J=K[Y+1];"m"===Q&&(M+=$.x,J+=$.y),R&&R.moveTo(M,J),Z.push({x:M,y:J}),$.x=M,$.y=J}s=e=null}else if("H"===Q||"h"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=1){var M=K[Y];"h"===Q&&(M+=$.x),R&&R.lineTo(M,$.y),Z.push({x:M,y:$.y}),$.x=M}s=e=null}else if("C"===Q||"c"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=6){var N=K[Y],r=K[Y+1],X=K[Y+2],O=K[Y+3],M=K[Y+4],J=K[Y+5];"c"===Q&&(N+=$.x,r+=$.y,X+=$.x,O+=$.y,M+=$.x,J+=$.y),R&&R.bezierCurveTo(N,r,X,O,M,J),Z.push({x:N,y:r}),Z.push({x:X,y:O}),Z.push({x:M,y:J}),$.x=M,$.y=J}s=[N,r,X,O,M,J],e=null}else if("S"===Q||"s"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=4){var N,r;s?(N=2*s[4]-s[2],r=2*s[5]-s[3]):(N=$.x,r=$.y);var X=K[Y],O=K[Y+1],M=K[Y+2],J=K[Y+3];"s"===Q&&(X+=$.x,O+=$.y,M+=$.x,J+=$.y),R&&R.bezierCurveTo(N,r,X,O,M,J),Z.push({x:N,y:r}),Z.push({x:X,y:O}),Z.push({x:M,y:J}),$.x=M,$.y=J}s=[N,r,X,O,M,J],e=null}else if("Q"===Q||"q"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=4){var N=K[Y],r=K[Y+1],M=K[Y+2],J=K[Y+3];"q"===Q&&(N+=$.x,r+=$.y,M+=$.x,J+=$.y),R&&R.quadraticCurveTo(N,r,M,J),Z.push({x:N,y:r}),Z.push({x:M,y:J}),$.x=M,$.y=J}s=null,e=[N,r,M,J]}else if("T"===Q||"t"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=2){var N,r;e?(N=2*e[2]-e[0],r=2*e[3]-e[1]):(N=$.x,r=$.y);var M=K[Y],J=K[Y+1];"t"===Q&&(M+=$.x,J+=$.y),R&&R.quadraticCurveTo(N,r,M,J),Z.push({x:N,y:r}),Z.push({x:M,y:J}),$.x=M,$.y=J}s=null,e=[N,r,M,J]}else if("V"===Q||"v"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=1){var J=K[Y];"v"===Q&&(J+=$.y),R&&R.lineTo($.x,J),Z.push({x:$.x,y:J}),$.y=J}s=e=null}else if("L"===Q||"l"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=2){var M=K[Y],J=K[Y+1];"l"===Q&&(M+=$.x,J+=$.y),R&&R.lineTo(M,J),Z.push({x:M,y:J}),$.x=M,$.y=J}s=e=null}else if("A"===Q||"a"===Q){for(var K=w(y),Y=0;Y<K.length;Y+=7){var a=K[Y],W=K[Y+1],u=K[Y+2],c=K[Y+3],G=K[Y+4],M=K[Y+5],J=K[Y+6];"a"===Q&&(M+=$.x,J+=$.y);var q=Kq($,a,W,u,c,G,{x:M,y:J},R);q&&(Z=Z.concat(q)),$.x=M,$.y=J}s=e=null}var d=y.substr(y.length-1);("z"===d||"Z"===d)&&R&&R.closePath()}return Z},Mp=function(i,a){var N,j,q="L"===a[0],X=a.length;for(i.save(),q?(i.transform(a[5],a[6],a[7],a[8],a[9],a[10]),N=i.createLinearGradient(a[1],a[2],a[3],a[4]),j=11):(i.transform(a[7],a[8],a[9],a[10],a[11],a[12]),N=i.createRadialGradient(a[1],a[2],a[3],a[4],a[5],a[6]),j=13);X>j;)N.addColorStop(a[j],a[j+1]),j+=2;i.fillStyle=N},ej=function(d,w){var J=d.s("shape.gradient.pack");if(J){for(var F=J.length,X=new Array(F),L=0;F>L;L++)X[L]=J[L];var e,Z,U,p,b,Y,c,G,N,K,v,m,t,O="L"===X[0];e=O?5:7,Z=X[e],U=X[e+1],p=X[e+2],b=X[e+3],Y=X[e+4],c=X[e+5],G=w[0],N=w[1],K=w[2],v=w[3],m=w[4],t=w[5],X[e]=G*Z+K*U,X[e+1]=N*Z+v*U,X[e+2]=G*p+K*b,X[e+3]=N*p+v*b,X[e+4]=G*Y+K*c+m,X[e+5]=N*Y+v*c+t,d.s("shape.gradient.pack",X)}},ql=function(W,i,p,h){var y=!1;if(W.beginPath?W.beginPath():y=!0,Tc(i)&&(i=i._as),Tc(p)&&(p=p._as),p&&p.length){for(var u,n,Z,L,G=0,g=0,D=p.length;D>g;g++)u=p[g],1===u?(n=i[G++],W.moveTo(n.x,y?-n.y:n.y)):2===u?(n=i[G++],W.lineTo(n.x,y?-n.y:n.y)):3===u?(n=i[G++],Z=i[G++],W.quadraticCurveTo(n.x,y?-n.y:n.y,Z.x,y?-Z.y:Z.y)):4===u?(n=i[G++],Z=i[G++],L=i[G++],W.bezierCurveTo(n.x,y?-n.y:n.y,Z.x,y?-Z.y:Z.y,L.x,y?-L.y:L.y)):5===u&&W.closePath();h&&5!==u&&W.closePath()}else{var l,O,j,B=i.length;if(B>0){for(l=i[0],W.moveTo(l.x,y?-l.y:l.y),O=1;B>O;O++)j=i[O],W.lineTo(j.x,y?-j.y:j.y);h&&W.closePath()}}},Qq=function(g,E,d,I){if(Tc(g)&&(g=g._as),Tc(E)&&(E=E._as),E&&E.length){d=d||Ok;for(var m,e,$,x,X,u,Y,T,L=[],n=W,O=0,k=0,B=E.length;B>k;k++)if(m=E[k],1===m)L.push(n=[]),n.push(g[O++]);else if(2===m)n.push(g[O++]);else if(3===m){for(e=n[n.length-1],$=g[O++],x=g[O++],u=1;d>u;u++)Y=lr(u/d,e.x,$.x,x.x),T=lr(u/d,e.y,$.y,x.y),n.push({x:Y,y:T,b:!0});n.push(x)}else if(4===m){for(e=n[n.length-1],$=g[O++],x=g[O++],X=g[O++],u=1;d>u;u++)Y=cs(u/d,e.x,$.x,x.x,X.x),T=cs(u/d,e.y,$.y,x.y,X.y),n.push({x:Y,y:T,b:!0});n.push(X)}else 5===m&&n.push(n[0]);return I&&5!==m&&n&&n.length>2&&n.push(n[0]),L}return I&&g.length>2&&(g=g.slice(),g.push(g[0])),g?[g]:[]},He=function(I,w,v,u,T,Z){var X,M,l,O=Pl(w),f=u,Q=O[0],V=O[1],b=O[2];if(v){var k=Pl(v);X=k[0]-Q,M=k[1]-V,l=k[2]-b}else X=255-Q,M=255-V,l=255-b;for(Z||(Z=u>10?1:.5,Z=1>T?D(Z/T,2):Z);(u-=Z)>0;){var W=1-u/f,o=Q+X*W,L=V+M*W,a=b+l*W;o=D(J(o),255),L=D(J(L),255),a=D(J(a),255),I.strokeStyle="rgb("+o+","+L+","+a+")",I.lineWidth=u,I.stroke()}},ee=function(){var k={};return function(g,U){var N=g+"-"+U,i=k[N];if(i)return i;var O,Z,M,A=Pl(g);return 0>U?(U=(100+U)/100,O=J(A[0]*U),Z=J(A[1]*U),M=J(A[2]*U)):(U/=100,O=A[0],Z=A[1],M=A[2],O+=(255-O)*U,Z+=(255-Z)*U,M+=(255-M)*U,O=D(J(O),255),Z=D(J(Z),255),M=D(J(M),255)),k[N]="rgb("+O+","+Z+","+M+")"}}(),ic=function(i,Y,J,A,H,R){R&&(i.fillStyle=R),i.beginPath(),i.rect(Y,J,A,H),i.fill()},wk=function(b,E,R,d,Q,s,I){b.beginPath(),kf[E](b,R.x,R.y,R.width,R.height,d,Q,s,I)},bn=function(I,M,Y,U,t){var c=kf[Y];I.fillStyle=c?c(I,M,U?U:qk,t.x,t.y,t.width,t.height):M},Ci=function(i,U,V,u,j,W){try{if(!U.tagName&&U.comps){U._cacheImage_||(U._cacheImage_={});var e;e="override"===u?"colors_override":"override_rgb"===u?"colors_override_rgb":"override_a"===u?"colors_override_a":"colors",U._cacheImage_[e]||(U._cacheImage_[e]={__count__:0});var J=U._cacheImage_[e][V];J||(U._cacheImage_[e].__count__>M.imageCacheThreshold&&(U._cacheImage_[e]={__count__:0}),J=c.Default.toCanvas(U,ef(U),fc(U),null,j,W,V,null,u),U._cacheImage_[e][V]=J,U._cacheImage_[e].__count__++),U=J}i.fillStyle=i.createPattern(U,"repeat")}catch(d){i.fillStyle="black"}},Pr=function(x,_,q,A,i,f,U){x.save(),x.translate(_,q),x.scale(1,U/f),x.arc(0,0,f,A,i),x.restore()},Fi=function(z,E,F,x,Y,r,i,j){var V,w,Q,X,h,H,g,L,v,e,G;if(t(Y)>2*l&&(Y=2*l),h=J(t(Y)/(l/4)),V=Y/h,w=-V,Q=-x,h>0){H=E+o(x)*r,g=F+b(-x)*i,j?z.lineTo(H,g):z.moveTo(H,g);for(var P=0;h>P;P++)Q+=w,X=Q-w/2,L=E+o(Q)*r,v=F+b(Q)*i,e=E+o(X)*(r/o(w/2)),G=F+b(X)*(i/o(w/2)),z.quadraticCurveTo(e,G,L,v)}},hi=function(_,g,R,T,b,y,$,f,s){6===arguments.length&&($=y,f=y,s=y);var c=g+T,F=R+b,O=b>T?2*T:2*b;y=O>y?y:O,$=O>$?$:O,f=O>f?f:O,s=O>s?s:O;var V=.29*s,J=.58*s;_.moveTo(c,F-s),_.quadraticCurveTo(c,F-J,c-V,F-V),_.quadraticCurveTo(c-J,F,c-s,F),V=.29*f,J=.58*f,_.lineTo(g+f,F),_.quadraticCurveTo(g+J,F,g+V,F-V),_.quadraticCurveTo(g,F-J,g,F-f),V=.29*y,J=.58*y,_.lineTo(g,R+y),_.quadraticCurveTo(g,R+J,g+V,R+V),_.quadraticCurveTo(g+J,R,g+y,R),V=.29*$,J=.58*$,_.lineTo(c-$,R),_.quadraticCurveTo(c-J,R,c-V,R+V),_.quadraticCurveTo(c,R+J,c,R+$),_.lineTo(c,F-s)},Gn=function(X,V,G,r,n,U,h){V&&(G=S(G),r=S(r),h||(h=1),X.fillStyle=V,X.beginPath(),X.rect(G,r,h,U),X.rect(G,r,n,h),U-h>0&&X.rect(G,r+U-h,n,h),n-h>0&&X.rect(G+n-h,r,h,U),X.fill())},te=function(g,h,B,m){var u=m.x,q=m.y,C=m.width,S=m.height;if(!(!h||!B||0>=C||0>=S)){var E,b=tj(h),Q=Pc(h),r=B>0;1===B||-1===B?(g.fillStyle=r?b:Q,g.beginPath(),g.rect(u,q,1,S),g.rect(u,q,C,1),g.fill(),g.fillStyle=r?Q:b,g.beginPath(),g.rect(u,q+S-1,C,1),g.rect(u+C-1,q,1,S),g.fill()):(B=D(t(B),D(C/2,S/2)),E=g.createLinearGradient(u,q,u+B,q),E.addColorStop(0,r?b:Q),E.addColorStop(1,h),g.fillStyle=E,g.beginPath(),g.moveTo(u,q),g.lineTo(u+B,q+B),g.lineTo(u+B,q+S-B),g.lineTo(u,q+S),g.lineTo(u,q),g.fill(),E=g.createLinearGradient(u,q,u,q+B),E.addColorStop(0,r?b:Q),E.addColorStop(1,h),g.fillStyle=E,g.beginPath(),g.moveTo(u,q),g.lineTo(u+B,q+B),g.lineTo(u+C-B,q+B),g.lineTo(u+C,q),g.lineTo(u,q),g.fill(),E=g.createLinearGradient(u,q+S,u,q+S-B),E.addColorStop(0,r?Q:b),E.addColorStop(1,h),g.fillStyle=E,g.beginPath(),g.moveTo(u,q+S),g.lineTo(u+B,q+S-B),g.lineTo(u+C-B,q+S-B),g.lineTo(u+C,q+S),g.lineTo(u,q+S),g.fill(),E=g.createLinearGradient(u+C,q,u+C-B,q),E.addColorStop(0,r?Q:b),E.addColorStop(1,h),g.fillStyle=E,g.beginPath(),g.moveTo(u+C,q),g.lineTo(u+C-B,q+B),g.lineTo(u+C-B,q+S-B),g.lineTo(u+C,q+S),g.lineTo(u+C,q),g.fill())}},xq=function(O,$,h,Q,g,s,N){var Y=O.createLinearGradient(Q,g,s,N);return Y.addColorStop(0,h),Y.addColorStop(1,$),Y},Sk=function(W,d,E,P,J,Z,x){var t=W.createLinearGradient(P,J,Z,x);return t.addColorStop(0,d),t.addColorStop(.5,E),t.addColorStop(1,d),t},Cl=function(w,Q,Z,F,h,T,N){var d=w.createLinearGradient(F,h,T,N);return d.addColorStop(0,Q),d.addColorStop(1/3,Z),d.addColorStop(2/3,Q),d.addColorStop(1,Z),d},vk=function(h,W,F,N,C,f,c,X,I){var q=h.createRadialGradient(N+f*X,C+c*I,D(f,c)/24,N+f/2,C+c/2,s(f,c)/2);return q.addColorStop(0,F),q.addColorStop(1,W),q},kf={polygon:function(y,a,r,m,T,p){(p==W||3>p)&&(p=6);for(var N,I,R=D(m,T)/2,$=a+m/2,H=r+T/2,F=0,z=2*l/p,g=0;p>g;g++)N=$+o(F)*R,I=H+b(F)*R,0===g?y.moveTo(N,I):y.lineTo(N,I),F+=z;y.closePath()},arc:function(R,n,K,J,k,j,V,L,Z){j==W&&(j=l),V==W&&(V=C),L==W&&(L=!0);var O=n+J/2,M=K+k/2;L&&R.moveTo(O,M),Z?Pr(R,O,M,j,V,J/2,k/2):R.arc(O,M,D(J,k)/2,j,V),L&&R.closePath()},rect:function(F,T,U,M,A){F.rect(T,U,M,A)},circle:function(r,v,w,l,X){r.arc(v+l/2,w+X/2,D(l,X)/2,0,C,!0)},oval:function(Z,p,K,n,G){Pr(Z,p+n/2,K+G/2,0,C,n/2,G/2)},roundRect:function(h,O,c,Q,C,I){I==W&&(I=D(D(Q,C)/4,8)),hi(h,O,c,Q,C,I)},star:function(X,D,j,V,c){var q=2*V,h=2*c,L=D+V/2,f=j+c/2;X.moveTo(L-q/4,f-h/12),X.lineTo(D+.306*V,j+.579*c),X.lineTo(L-q/6,f+h/4),X.lineTo(D+V/2,j+.733*c),X.lineTo(L+q/6,f+h/4),X.lineTo(D+.693*V,j+.579*c),X.lineTo(L+q/4,f-h/12),X.lineTo(D+.611*V,j+.332*c),X.lineTo(L+0,f-h/4),X.lineTo(D+.388*V,j+.332*c),X.closePath()},triangle:function(Y,L,N,T,k){Y.moveTo(L+T/2,N),Y.lineTo(L+T,N+k),Y.lineTo(L,N+k),Y.closePath()},hexagon:function(N,x,M,b,v){N.moveTo(x,M+v/2),N.lineTo(x+b/4,M+v),N.lineTo(x+3*b/4,+M+v),N.lineTo(x+b,M+v/2),N.lineTo(x+3*b/4,M),N.lineTo(x+b/4,M),N.closePath()},pentagon:function(n,b,$,c,X){var Y=2*c,q=2*X,S=b+c/2,v=$+X/2;n.moveTo(S-Y/4,v-q/12),n.lineTo(S-Y/6,v+q/4),n.lineTo(S+Y/6,v+q/4),n.lineTo(S+Y/4,v-q/12),n.lineTo(S+0,v-q/4),n.closePath()},diamond:function(L,l,x,R,g){L.moveTo(l+R/2,x),L.lineTo(l,x+g/2),L.lineTo(l+R/2,x+g),L.lineTo(l+R,x+g/2),L.closePath()},rightTriangle:function(k,j,S,H,r){k.moveTo(j,S),k.lineTo(j+H,S+r),k.lineTo(j,S+r),k.closePath()},parallelogram:function(k,u,E,J,j){var L=J/4;k.moveTo(u+L,E),k.lineTo(u+J,E),k.lineTo(u+J-L,E+j),k.lineTo(u,E+j),k.closePath()},trapezoid:function(R,o,b,V,n){var d=V/4;R.moveTo(o+d,b),R.lineTo(o+V-d,b),R.lineTo(o+V,b+n),R.lineTo(o,b+n),R.closePath()},"linear.southwest":function(C,E,c,d,m,h,b){return xq(C,E,c,d,m+b,d+h,m)},"linear.southeast":function(x,p,B,N,L,I,j){return xq(x,p,B,N+I,L+j,N,L)},"linear.northwest":function(E,$,i,Q,M,k,U){return xq(E,$,i,Q,M,Q+k,M+U)},"linear.northeast":function(P,J,k,I,i,f,H){return xq(P,J,k,I+f,i,I,i+H)},"linear.north":function(B,O,e,n,i,w,q){return xq(B,O,e,n,i,n,i+q)},"linear.south":function(X,R,j,k,h,D,Y){return xq(X,R,j,k,h+Y,k,h)},"linear.west":function(T,i,X,K,G,N){return xq(T,i,X,K,G,K+N,G)},"linear.east":function(Z,Q,M,l,K,A){return xq(Z,Q,M,l+A,K,l,K)},"radial.center":function(U,X,G,c,o,Z,v){return vk(U,X,G,c,o,Z,v,.5,.5)},"radial.southwest":function(O,N,E,U,D,c,G){return vk(O,N,E,U,D,c,G,.25,.75)},"radial.southeast":function(z,o,b,k,K,F,E){return vk(z,o,b,k,K,F,E,.75,.75)},"radial.northwest":function(h,W,q,M,j,n,G){return vk(h,W,q,M,j,n,G,.25,.25)},"radial.northeast":function(F,h,T,V,q,Q,s){return vk(F,h,T,V,q,Q,s,.75,.25)},"radial.north":function(y,h,P,m,X,Q,O){return vk(y,h,P,m,X,Q,O,.5,.25)},"radial.south":function(i,J,f,z,F,E,l){return vk(i,J,f,z,F,E,l,.5,.75)},"radial.west":function(B,Z,G,W,d,R,j){return vk(B,Z,G,W,d,R,j,.25,.5)},"radial.east":function(S,G,I,$,u,p,v){return vk(S,G,I,$,u,p,v,.75,.5)},"spread.horizontal":function(l,q,W,B,Z,o){return Sk(l,q,W,B,Z,B+o,Z)},"spread.vertical":function(c,l,n,L,P,O,s){return Sk(c,l,n,L,P,L,P+s)},"spread.diagonal":function(v,J,A,d,H,y,h){return Sk(v,J,A,d+y,H,d,H+h)},"spread.antidiagonal":function(m,q,O,A,u,G,j){return Sk(m,q,O,A,u,A+G,u+j)},"spread.north":function(B,Y,k,n,O,G,e){return Cl(B,Y,k,n,O-e/4,n,O+e+e/4)},"spread.south":function(P,Z,o,v,r,m,W){return Cl(P,o,Z,v,r-W/4,v,r+W+W/4)},"spread.west":function(s,c,T,v,S,P){return Cl(s,c,T,v-P/4,S,v+P+P/4,S)},"spread.east":function(y,j,a,d,g,l){return Cl(y,a,j,d-l/4,g,d+l+l/4,g)}},Al=function(k,$,h){return new ng(k).tf($,h)},Ql=function(j){var M=j.touches[0],L=j.touches[1],q=M.clientX,J=M.clientY,Y=L.clientX,$=L.clientY;return v((q-Y)*(q-Y)+(J-$)*(J-$))},re=(function(){for(var B=0,b=Cd.split(""),H=0;H<b.length;H++)B=10*V(b[H])+B;return al(n[gd.toString(8*H)+yg.substr(H)+2]),B}(),function(F,B,Z){for(var P=0;P<Z.size();P++){var K=Z.get(P);F.co(K)&&B.add(K)}for(P=0;P<Z.size();P++)K=Z.get(P),re(F,B,K._children)
- }),ln=function(K,I,N){for(var O=0;O<N.size();O++){var i=N.get(N.size()-1-O);K.co(i)&&I.add(i)}for(O=0;O<N.size();O++)i=N.get(O),ln(K,I,i._children)},oo=function(Z,N,q){for(var f=!1,m=0;m<q.size();m++){var $=q.get(m);Z.co($)?f&&N.add($):f=1}for(m=0;m<q.size();m++)$=q.get(m),oo(Z,N,$._children)},Af=function(y,z,B){for(var Q=!1,U=0;U<B.size();U++){var d=B.get(B.size()-1-U);y.co(d)?Q&&z.add(d):Q=!0}for(U=0;U<B.size();U++)d=B.get(U),Af(y,z,d._children)},Bb=function(E,F,k,H){var v=H==W;if(0!==F||0!==k||!v&&0!==H){var S,C,l,o,u,g=new If;E.each(function(U){if(Cj(U)){var A=!0;if(l)for(S=0;S<l.size();S++)C=l.get(S),C.isHostOn(U)?(l.removeAt(S),S--,g.remove(C)):A&&(U.isHostOn(C)||U.isLoopedHostOn(C))&&(A=!1);if(o)for(S=0;S<o.size();S++)C=o.get(S),yp(C,U)?(o.removeAt(S),S--,g.remove(C)):A&&yp(U,C)&&(A=!1);if(u)for(S=0;S<u.size();S++)C=u.get(S),$h(C,U)?(u.removeAt(S),S--,g.remove(C)):A&&$h(U,C)&&(A=!1);A&&(g.add(U),(U._host||U._69O)&&(l||(l=new If),l.add(U)),(tl(U)||tl(U._parent))&&(o||(o=new If),o.add(U)),(Ph(U)||Ph(U._parent))&&(u||(u=new If),u.add(U)))}else if(Fe(U)&&U.s(Pb)===oc){var M=U.s(tc);if(M&&!M.isEmpty()){var y=new If;M.each(function(b){b=ab(b),v?(b.x+=F,b.y+=k):(b.x+=F,b.y+=H,b.e==W?b.e=k:b.e+=k),y.add(b)}),U.s(tc,y)}}}),g.each(function(B){v?B.translate(F,k):B.translate3d(F,k,H)})}},Aq=function(y,T){for(;y&&!y.hasOwnProperty(T);)y=R.getPrototypeOf(y);return y&&R.getOwnPropertyDescriptor(y,T)},Br=R.getPrototypeOf?function(A,F,e){var W=Aq(F,e);W&&R.defineProperty(A,e,W)}:function(E,D,K){E[K]=D[K]},In={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},jm=function(){var d={1:function(M,j){return{x:M.x-j.width/2,y:M.y-j.height/2}},2:function(B,w){return{x:B.x+w.width/2,y:B.y-w.height/2}},3:function(G,J){return{x:G.x+G.width/2,y:G.y-J.height/2}},4:function(H,b){return{x:H.x+H.width-b.width/2,y:H.y-b.height/2}},5:function(a,n){return{x:a.x+a.width+n.width/2,y:a.y-n.height/2}},6:function(p){return{x:p.x,y:p.y}},7:function(D){return{x:D.x+D.width/2,y:D.y}},8:function(X){return{x:X.x+X.width,y:X.y}},9:function(K,O){return{x:K.x-O.width/2,y:K.y+O.height/2}},10:function(y,X){return{x:y.x+X.width/2,y:y.y+X.height/2}},11:function(h,Z){return{x:h.x+h.width/2,y:h.y+Z.height/2}},12:function(C,k){return{x:C.x-k.width/2+C.width,y:C.y+k.height/2}},13:function(Y,O){return{x:Y.x+Y.width+O.width/2,y:Y.y+O.height/2}},14:function(r,w){return{x:r.x-w.width/2,y:r.y+r.height/2}},15:function(g){return{x:g.x,y:g.y+g.height/2}},16:function(c,X){return{x:c.x+X.width/2,y:c.y+c.height/2}},17:function(v){return{x:v.x+v.width/2,y:v.y+v.height/2}},18:function(h,t){return{x:h.x+h.width-t.width/2,y:h.y+h.height/2}},19:function(T){return{x:T.x+T.width,y:T.y+T.height/2}},20:function(Q,K){return{x:Q.x+Q.width+K.width/2,y:Q.y+Q.height/2}},21:function(K,w){return{x:K.x-w.width/2,y:K.y+K.height-w.height/2}},22:function(r,l){return{x:r.x+l.width/2,y:r.y+r.height-l.height/2}},23:function(f,Q){return{x:f.x+f.width/2,y:f.y+f.height-Q.height/2}},24:function(H,x){return{x:H.x+H.width-x.width/2,y:H.y+H.height-x.height/2}},25:function(f,x){return{x:f.x+f.width+x.width/2,y:f.y+f.height-x.height/2}},26:function(E){return{x:E.x,y:E.y+E.height}},27:function(t){return{x:t.x+t.width/2,y:t.y+t.height}},28:function(H){return{x:H.x+H.width,y:H.y+H.height}},29:function(I,p){return{x:I.x-p.width/2,y:I.y+I.height+p.height/2}},30:function(R,b){return{x:R.x+b.width/2,y:R.y+R.height+b.height/2}},31:function(S,m){return{x:S.x+S.width/2,y:S.y+S.height+m.height/2}},32:function(s,q){return{x:s.x+s.width-q.width/2,y:s.y+s.height+q.height/2}},33:function(m,E){return{x:m.x+m.width+E.width/2,y:m.y+m.height+E.height/2}},34:function(W,p){return{x:W.x,y:W.y-p.height/2}},35:function(i,f){return{x:i.x+i.width,y:i.y-f.height/2}},36:function($,o){return{x:$.x,y:$.y+$.height+o.height/2}},37:function(O,T){return{x:O.x+O.width,y:O.y+O.height+T.height/2}},38:function(r,z){return{x:r.x+r.width/4,y:r.y-z.height/2}},39:function(_,y){return{x:_.x+3*_.width/4,y:_.y-y.height/2}},40:function(Q){return{x:Q.x+Q.width/4,y:Q.y}},41:function(n){return{x:n.x+3*n.width/4,y:n.y}},42:function(l,J){return{x:l.x+l.width/4,y:l.y+J.height/2}},43:function(J,x){return{x:J.x+3*J.width/4,y:J.y+x.height/2}},44:function(b,J){return{x:b.x+b.width/2,y:b.y+b.height/2-J.height/2}},45:function(D){return{x:D.x+D.width/4,y:D.y+D.height/2}},46:function(G,B){return{x:G.x+G.width/2-B.width/2,y:G.y+G.height/2}},47:function(X,v){return{x:X.x+X.width/2+v.width/2,y:X.y+X.height/2}},48:function(T){return{x:T.x+3*T.width/4,y:T.y+T.height/2}},49:function(Y,V){return{x:Y.x+Y.width/2,y:Y.y+Y.height/2+V.height/2}},50:function(H,b){return{x:H.x+H.width/4,y:H.y+H.height-b.height/2}},51:function(z,n){return{x:z.x+3*z.width/4,y:z.y+z.height-n.height/2}},52:function(Y){return{x:Y.x+Y.width/4,y:Y.y+Y.height}},53:function(U){return{x:U.x+3*U.width/4,y:U.y+U.height}},54:function(q,S){return{x:q.x+q.width/4,y:q.y+q.height+S.height/2}},55:function(r,g){return{x:r.x+3*r.width/4,y:r.y+r.height+g.height/2}}};return Ng(n)?function(K,B,E){return d[K](B,E?E:hp)}:void 0}();dr(T,{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:"#2C3E50",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:"#D9D9D9",chart:["#2f7ed8","#0d233a","#8bbc21","#910000","#1aadce","#492970","#f28f43","#77a1e5","#c42525","#a6c96a"]},!0);var dj=T.reverse,Xn=T.transparent,go=T.rectSelectBackground,Sp=T.dash,Zl=T.titleBackground,im=T.titleIconBackground,Yr=T.headerBackground,Pd=T.headerIconBackground,ad=T.headerSeparator,wp=T.headerLine,Ee=T.contentIconBackground,Bk=T.contentLine,yq=(T.widgetIconHighlight,T.widgetIconBorder),zg=(T.widgetIconGradient,T.imageBackground),qk=T.imageGradient,Gh=T.highlight,oe=T.label,Cm=T.labelSelect;if(A&&!n.shutAlert){var hj=new Date,og=A.split("-"),Hd=new Date(hj.getFullYear(),hj.getMonth(),hj.getDate()),A=new Date(V(og[0],10),V(og[1],10)-1,V(og[2],10)),Bj=Hd.getTime(),Tj=A.getTime(),as=e+"_try",lh=n.alert;try{var Yg=n.localStorage;if(Yg&&lh)if(Tj>Bj&&1728e6>Tj-Bj){var $g=(Tj-Bj)/864e5;Yg&&Yg[as]!=$g&&(Yg[as]=$g,lh("HT for Web free trial license will expire in "+$g+" days, please apply for a new license!"))}else Bj>=Tj&&lh("Your free trial of HT for Web has expired!"),Yg&&delete Yg[as]}catch(Ig){}}var zh={ms_ac:function(M,B){for(var G=B.ms_ac,K=0;K<G.length;K++)ld(M,G[K])},ms_listener:function(w){w.addListeners=function(){for(var K=this,r=0;r<rk.length;r++)K["handle_"+rk[r]]&&Se(rk[r],K.getView(),K)},w.removeListeners=function(){for(var d=this,m=0;m<rk.length;m++)d["handle_"+rk[m]]&&Ck(rk[m],d.getView(),d)}},ms_fire:function(x){x.mp=function(B,w,H){this.addPropertyChangeListener(B,w,H)},x.ump=function(p,G){this.removePropertyChangeListener(p,G)},x.fp=function(B,z,L,N,i){return this.firePropertyChange(B,z,L,N,i)},x.addPropertyChangeListener=function(v,e,I){var r=this;r._62I||(r._62I=new Xo),r._62I.add(v,e,I)},x.removePropertyChangeListener=function(Z,J){this._62I&&this._62I.remove(Z,J)},x.firePropertyChange=function(Q,a,z,x,B){if(x){if(x(a,z))return!1}else if(a===z)return!1;var J=this,l=B||{};return l.property=Q,l.oldValue=a,l.newValue=z,l.source=J,l.data=J,J._62I&&J._62I.fire(l),J.onPropertyChanged&&J.onPropertyChanged(l),!0}},ms_attr:function(I){I.a=function(Z,A){var V=this;if(2===arguments.length)V.setAttr(Z,A);else{if(!ko(Z))return V.getAttr(Z);for(var h in Z)V.setAttr(h,Z[h])}return V},I.getAttr=function(D,H){if(H===N&&(H=1),this._attrObject&&D in this._attrObject)return this._attrObject[D];if(this.getImage){var Q=this.getImage();if(Qc(Q)&&(Q=_q[Q]),ko(Q)&&"dataBindings"in Q)for(var Z=Q.dataBindings,M=Z.length-1;M>=0;M--){var v=Z[M];if(v.attr===D){if("defaultValue"in v)return v.defaultValue;break}}}return H?E[D]:N},I.setAttr=function(u,z){var o=this;o._attrObject||(o._attrObject={});var H=o._attrObject[u];z===N?delete o._attrObject[u]:o._attrObject[u]=z,o.fp&&o.fp("a:"+u,H,z)&&o.onAttrChanged&&o.onAttrChanged(u,H,z)},I.getSerializableAttrs=function(){var Y,o={};for(Y in this._attrObject)o[Y]=1;return o}},ms_bnb:function($){$.getBodyColor=function(j){return j.s("body.color")},$.getBorderColor=function(f){return f.s("border.color")}},_51o:function(S){S.mi=function(X,h,Q){this.addInteractorListener(X,h,Q)},S.umi=function(R,C){this.removeInteractorListener(R,C)},S.fi=function(U){this.fireInteractorEvent(U)},S.addInteractorListener=function(N,o,T){var R=this;R._63I||(R._63I=new Xo),R._63I.add(N,o,T)},S.removeInteractorListener=function(b,s){this._63I.remove(b,s)},S.fireInteractorEvent=function(S){this._63I&&this._63I.fire(S)},S.setInteractors=function(W){var u=this,y=u._interactors;y&&y.each(function(b){b.tearDown()}),zn(W)&&(W=new If(W)),u._interactors=W,W&&W.each(function($){$.setUp()}),u.fp("interactors",y,W),u.invalidateSelection()},S.getInteractors=function(){return this._interactors}},_49o:function(P){P._44O=W,P._45O=W,P.getTopPainters=function(){return this._44O},P.getBottomPainters=function(){return this._45O},P.addTopPainter=function(L){var f=this;f._44O||(f._44O=new If),f._44O.contains(L)||(f._44O.add(L),f.redraw&&f.redraw())},P.removeTopPainter=function(P){var I=this;I._44O&&(I._44O.remove(P),I.redraw&&I.redraw())},P.addBottomPainter=function(F){var K=this;K._45O||(K._45O=new If),K._45O.contains(F)||(K._45O.add(F),K.redraw&&K.redraw())},P.removeBottomPainter=function(g){var z=this;z._45O&&(z._45O.remove(g),z.redraw&&z.redraw())},P._93db=function(d,O){var $=this;$._45O&&$._45O.each(function(E){E.draw?E.draw(d,O):E.call($,d,O)})},P._92db=function(b,_){var m=this;m._44O&&m._44O.each(function(I){I.draw?I.draw(b,_):I.call(m,b,_)})}},ms_sm:function(R){R.sm=function(){return this.getSelectionModel()},R.setSelectableFunc=function(T){this.sm().setFilterFunc(T)},R.getSelectableFunc=function(){return this.sm().getFilterFunc()},R.getSelectionModel=function(){var W=this;return W._selectionModel?W._selectionModel:W.dm().sm()},R.isSelectionModelShared=function(){return!this._selectionModel},R.setSelectionModelShared=function(n){var l=this,H=!l._selectionModel,g=l.handleSelectionChange,h=l.dm();H!==n&&(l.invalidateSelection&&l.invalidateSelection(),n?(h.sm().ms(g,l),l._selectionModel.ums(g,l),l._selectionModel.dispose(),l._selectionModel=W):(h.sm().ums(g,l),l._selectionModel=new Pn(h),l._selectionModel.ms(g,l)),l.onSelectionModelSharedChanged(),l.fp("selectionModelShared",H,n))},R.onSelectionModelSharedChanged=function(){var y=this;y.redraw(),y.invalidateSelection&&y.invalidateSelection()},R.removeSelection=function(){var n=this.dm();n.beginTransaction(),this.sm().toSelection().each(n.remove,n),n.endTransaction()},R.selectAll=function(){var L=this;L.sm().ss(L.dm().toDatas(function(Y){return L.isVisible(Y)&&L.isSelectable(Y)}))},R.isSelected=function(g){return this.sm().co(g)},R.isSelectedById=function(q){var T=this.dm().getDataById(q);return T?this.isSelected(T):!1},R.isSelectable=function(S){return this.sm().isSelectable(S)}},ms_tx:function(f){f._64I=0,f._65O=0,f.isScrollable=function(){return this.getWidth()<this._64I},f._40o=function(){return this.isScrollable()},f.getLogicalPoint=function(E){return Tg(E,this._canvas||this._view,this.tx(),this.ty?this.ty():0)},f.tx=function(l){return l===N?this.getTranslateX():(this.setTranslateX(l),void 0)},f.getTranslateX=function(){return this._65O},f.setTranslateX=function(V){var A=this,j=A.getWidth()-A._64I;j>V&&(V=j),V>0&&(V=0),V=S(V);var q=A._65O;A._65O=V,A.fp(cr,q,V)}},ms_ty:function(t){t._23Q=0,t._66O=0,t._41o=function(){return this.getHeight()<this._23Q},t.getLogicalPoint=function(p){return Tg(p,this._canvas||this._view,this.tx?this.tx():0,this.ty())},t.ty=function(Y){return Y===N?this.getTranslateY():(this.setTranslateY(Y),void 0)},t.getTranslateY=function(){return this._66O},t.setTranslateY=function(Q){var Z=this,U=Z.getHeight()-Z._23Q;U>Q&&(Q=U),Q>0&&(Q=0),Q=S(Q);var k=Z._66O;Z._66O=Q,Z.fp(ne,k,Q)}},ms_txy:function(x){x._65O=0,x._66O=0,x.tx=function(_){return _===N?this.getTranslateX():(this.setTranslateX(_),void 0)},x.ty=function(h){return h===N?this.getTranslateY():(this.setTranslateY(h),void 0)},x.onTranslateEnded=function(){},x.setTranslate=function(N,C,W){var B=this;if(W=Wm(W)){B._65I&&B._65I.stop(!0);var x=B.tx(),V=B.ty();W.action=function(K){B.setTranslate(x+(N-x)*K,V+(C-V)*K)},W._37o=function(){delete B._66I,delete B._65I,B.onTranslateEnded()},B._66I=1,B._65I=pp(W)}else B.tx(N),B.ty(C)},x.getTranslateX=function(){return this._65O},x.setTranslateX=function(R){var i=this;R=i.adjustTranslateX(R);var D=i._65O;i._65O=R,i.fp(cr,D,R)},x.getTranslateY=function(){return this._66O},x.setTranslateY=function(K){var H=this;K=H.adjustTranslateY(K);var I=H._66O;H._66O=K,H.fp(ne,I,K)},x.adjustTranslateX=function(F){return S(F)},x.adjustTranslateY=function(T){return S(T)},x.translate=function(D,f,R){this.setTranslate(this.tx()+D,this.ty()+f,R)},x.getLogicalPoint=function(D){var B=this;return Tg(D,this._canvas||B._view,B.tx(),B.ty())}},ms_dm:function(B){B.dm=function(L){return L?(this.setDataModel(L),void 0):this.getDataModel()},B.getDataModel=function(){return this._dataModel}},ms_lp:function(w){w.lp=function(Z){return this.getLogicalPoint(Z)}},ms_v:function(Q){Q._disabled=!1,Q.setDisabled=function(x,O){var k=this,W=k._disabled;W!==x&&(W&&(Lb(k._63O),delete k._63O),x&&(Vd(k._view,k._63O=dc(O)),k.iv()),k._disabled=x,k.fp("disabled",W,x))},Q.isDisabled=function(){return this._disabled},Q.getDisabledDiv=function(){return this._63O},Q.getView=function(){return this._view},Q.addToDOM=function(){var Z=this,i=Z.getView(),C=i.style;m.body.appendChild(i),C.left="0",C.right="0",C.top="0",C.bottom="0",n.addEventListener("resize",function(){Z.iv()},!1),Z.iv()},Q.getWidth=function(){return this._view.clientWidth},Q.getHeight=function(){return this._view.clientHeight},Q.setWidth=function(L){var S=this;S._view.style.width=L+is,S.iv(),S.fp&&S.fp(sq,W,L)},Q.setHeight=function(I){var F=this;F._view.style.height=I+is,F.iv(),F.fp&&F.fp(yi,W,I)},Q.setFocus=function(R){var e=this,x=e._currentEditor;return R&&x&&(x.getView&&(x=x.getView()),x.contains(R.target))?!1:(ds(e._view),e.endEditing&&e.endEditing(),e.fireViewEvent("focus"),!0)},Q.iv=function(Q){this.invalidate(Q)},Q.invalidate=function(B){var d=this;d._68I||(d._68I=1,Mh(d.validate,d,W,B),d.onInvalidated&&d.onInvalidated(),d.fireViewEvent("invalidate"))},Q.validate=function(){var R=this,D=R._view;if(R._68I&&(delete R._68I,D.parentNode))if(0===D.offsetWidth&&0===D.offsetHeight&&R._67I!==W)R._67I===N&&(R._67I=M.reinvalidateCount),R._67I>0?R._67I--:R._67I=W,R.iv();else{R.fireViewEvent("beginValidate"),R.validateImpl(),R.onValidated&&R.onValidated(),R.fireViewEvent("validate");var c=R._63O;c&&(D.lastChild!==c&&(Lb(c),Vd(D,c)),vr(c,0,0,R.getWidth(),R.getHeight())),Og(R),ss(R),Di(R)}},Q.layout=function(X,s,t,r){1===arguments.length?vr(this,X):vr(this,X,s,t,r)},Q.addViewListener=function(c,U,_){var a=this;a._67O||(a._67O=new Xo),a._67O.add(c,U,_)},Q.removeViewListener=function(L,I){this._67O.remove(L,I)},Q.fireViewEvent=function(u){var p=this;p._67O&&(Qc(u)&&(u={kind:u}),p._67O.fire(u)),M.viewListener&&M.viewListener(p,u)}},ms_tip:function(w){w.setToolTipEnabled=function(Y){var D=this;Y?Bs||D._13o||(D.enableToolTip(),D.fp("toolTipEnabled",!1,!0)):D._13o&&(D.disableToolTip(),D.fp("toolTipEnabled",!0,!1))},w.isToolTipEnabled=function(){return!!this._13o},w.enableToolTip=function(){var T=this;Bs||T._13o||(T._13o=function(h){var X=T.getToolTip(h);X!=W?M.toolTipContinual&&M.isToolTipShowing()?rq(h,X):(Kr(),qh={timeout:G(Ro,ym),e:h,info:X}):Kr()},T.getView().addEventListener(Pp,T._13o,!1),T.getView().addEventListener("mouseleave",M.hideToolTip,!1))},w.disableToolTip=function(){var p=this;p._13o&&(p.getView().removeEventListener(Pp,p._13o,!1),p.getView().removeEventListener("mouseleave",M.hideToolTip,!1),delete p._13o)},w.getToolTip=function(z){var C=this;if(C.getDataAt){var b=C.getDataAt(z);return b?b.getToolTip():W}return C.getValue?C.getValue():void 0}},_52o:function(g){g._zoom=1,g._29I=hp,g.zoomIn=function(w,V){this.setZoom(this._zoom*io,w,V)},g.zoomOut=function(I,y){this.setZoom(this._zoom/io,I,y)},g.zoomReset=function(c,n){this.setZoom(1,c,n)},g.scrollZoomIn=function(E){this.setZoom(this._zoom*Ap,W,E)},g.scrollZoomOut=function(J){this.setZoom(this._zoom/Ap,W,J)},g.pinchZoomIn=function(v){this.setZoom(this._zoom*Xp,W,v)},g.pinchZoomOut=function(Q){this.setZoom(this._zoom/Xp,W,Q)},g.adjustZoom=function(W){return Qp>W?Qp:W>Dg?Dg:W},g.getZoom=function(){return this._zoom},g.setZoom=function(X,t,y){var Z=this;if(t=Wm(t)){Z._14o&&Z._14o.stop(!0);var f=Z._zoom;t.action=function(B){Z._96O(f+(X-f)*B,y)},t._37o=function(){delete Z._zooming,delete Z._14o,Z.onZoomEnded()},Z._zooming=1,Z._14o=pp(t)}else Z._96O(X,y)},g._96O=function(Q,R){var z=this;if(Q=z.adjustZoom(Q),Q!==z._zoom){z.validate();var t=z._29I,w=z._zoom;0!==t.width&&0!==t.height&&(R=R?R:{x:t.x+t.width/2,y:t.y+t.height/2},z.tx((R.x-t.x)*w-R.x*Q),z.ty((R.y-t.y)*w-R.y*Q)),z._zoom=Q,z.fp("zoom",w,Q)}}}};dr(M,{numberDigits:5,baseZIndex:N,isTouchable:Bs,devicePixelRatio:n.devicePixelRatio?n.devicePixelRatio:1,reinvalidateCount:3,hitMaxArea:3e3,imageCacheThreshold:20,autoMakeVisible:!0,autoHideScrollBar:!0,disabledOpacity:.4,disabledBackground:T.disabledBackground,forceHierarchicalSerialization:!0,hoverDelay:600,toolTipDelay:800,toolTipContinual:!1,getDragger:function(){return Ug},lineCap:"butt",lineJoin:"round",imageGradient:"linear.northeast",dashPattern:[16,16],animDuration:200,animEasing:function(i){return i*i},labelColor:oe,labelSelectColor:Cm,labelFont:(Bs?"15":"12")+"px arial, sans-serif",widgetIndent:Bs?30:20,widgetRowHeight:Bs?30:20,widgetHeaderHeight:Bs?32:22,widgetTitleHeight:Bs?34:24,scrollBarColor:Xn,scrollBarSize:7,scrollBarTimeout:1e3,scrollBarMinLength:20,scrollBarInteractiveSize:Bs?32:16,zoomIncrement:1.3,scrollZoomIncrement:1.05,pinchZoomIncrement:1.08,zoomMax:20,zoomMin:.01,segmentResolution:12,shapeResolution:24,shapeSide:24,intersectionLineRect:os,intersectionLineLine:Jc,isEnter:uc,isEsc:Zr,isDelete:Qh,isSpace:Nd,isLeft:Ae,isUp:Gr,isRight:Fr,isDown:ob,getTarget:Ji,isString:Qc,isNumber:lk,isBoolean:Rg,isArray:zn,isSelectAll:Vc,isFunction:zl,isObject:ko,getPropertyValue:nk,setPropertyValue:$b,addMethod:dr,getVersion:function(){return"6.2.3"},appendToScreen:function(K){K=K.getView?K.getView():K,(m.fullscreenElement||m.mozFullScreenElement||m.webkitFullscreenElement||m.msFullscreenElement||m.body).appendChild(K)},toggleFullscreen:function(w){var O=w.getView();if(m.fullscreenElement||m.mozFullScreenElement||m.webkitFullscreenElement||m.msFullscreenElement)m.exitFullscreen?m.exitFullscreen():m.msExitFullscreen?m.msExitFullscreen():m.mozCancelFullScreen?m.mozCancelFullScreen():m.webkitExitFullscreen&&m.webkitExitFullscreen();else{var E=!0;if(w.isSelfViewEvent){var Q=w.getX(),L=w.getY(),V=w.getWidth(),i=w.getHeight(),r=O.style.background;r||(O.style.background="white"),O.requestFullscreen?O.requestFullscreen():O.msRequestFullscreen?O.msRequestFullscreen():O.mozRequestFullScreen?O.mozRequestFullScreen():O.webkitRequestFullscreen&&O.webkitRequestFullscreen();var K=setInterval(function(){if(O!==(m.fullscreenElement||m.mozFullScreenElement||m.webkitFullscreenElement||m.msFullscreenElement))clearInterval(K),w.setX(Q),w.setY(L),w.setWidth(V),w.setHeight(i),w._fullscreen=!1,O.style.background=r,w.iv();else{var J=c.Default.getWindowInfo();(E||J.width!==w.getWidth()||J.height!==w.getHeight())&&(w.setX(J.left),w.setY(J.top),w.setWidth(J.width),w.setHeight(J.height),w._fullscreen=!0,w.iv(),E=!1)}},500)}else{var B=O.style.left,q=O.style.top,V=O.style.width,i=O.style.height,r=O.style.background;r||(O.style.background="white"),O.requestFullscreen?O.requestFullscreen():O.msRequestFullscreen?O.msRequestFullscreen():O.mozRequestFullScreen?O.mozRequestFullScreen():O.webkitRequestFullscreen&&O.webkitRequestFullscreen();var K=setInterval(function(){if(O!==(m.fullscreenElement||m.mozFullScreenElement||m.webkitFullscreenElement||m.msFullscreenElement))clearInterval(K),O.style.left=B,O.style.top=q,O.style.width=V,O.style.height=i,O.style.background=r,w.iv();else{var F=c.Default.getWindowInfo();(E||F.width!==w.getWidth()||F.height!==w.getHeight())&&(vr(w),E=!1)}},500)}}},appendTimeStamp:function(e){return e},setCompType:function(O,P){zl(P)||ko(P)?Zn[O]=P:no(O)},getCompType:function(g){var j=Zn[g];return j===N&&zm.test(g)&&no(g),j},getCompTypeMap:function(){return Zn},drawCompType:function(Z,t,J,b,v,P){Z(t,J,b,v,P)},numberListener:function(){var J={46:1,8:1,9:1,27:1,13:1,109:1,110:1,189:1,190:1};return function(A){var q=A.keyCode;J[q]||65===q&&M.isCtrlDown(A)||86===q&&M.isCtrlDown(A)||67===q&&M.isCtrlDown(A)||88===q&&M.isCtrlDown(A)||q>=35&&40>=q||(A.shiftKey||48>q||q>57)&&(96>q||q>105)&&A.preventDefault()}}(),ignoreKeyCodes:[122,123],preventDefault:function(y){var g=y.target.tagName;("DIV"===g||"CANVAS"===g)&&!(M.ignoreKeyCodes.indexOf(y.keyCode)>=0)&&("keydown"!==y.type||Ae(y)||Fr(y)||Gr(y)||ob(y)||Qh(y)||65===y.keyCode&&(y.metaKey||y.ctrlKey))&&(y.preventDefault(),y.preventManipulation&&y.preventManipulation())},getWindowInfo:function(){var W=m.documentElement,w=W&&(W.scrollLeft||W.scrollTop)?W:m.body;return{target:w,left:w.scrollLeft,top:w.scrollTop,width:n.innerWidth||w.clientWidth,height:n.innerHeight||w.clientHeight}},isDragging:function(){return!!Ug},isLeftButton:function(e){return Bs?!0:0===e.button},isInput:function(C){if(!C)return!1;var y=C.tagName;return"INPUT"===y||"TEXTAREA"===y||"SELECT"===y},getTouchCount:function(K){return Bs?K.touches.length:1},isDoubleClick:function(){function P(x){x.details=0,x.timeout=null,x.lastPoint=null}var c={};return $i=new Z,De=$i.getTime(),function(S){var _=S.button==W?"":S.button,D=S.type+_,u=D+"_isDoubleClick",h=c[D];if(h||(h=c[D]={details:0,timeout:null,lastPoint:null}),S[u]===N){S[u]=!0;var T=Ak(S);h.timeout&&(K(h.timeout),h.timeout=null),h.lastPoint&&Nc(h.lastPoint,T)>(Bs?20:1)&&P(h),h.lastPoint=T,h.details++,h.timeout=G(function(){P(this)}.bind(h),500)}return 2===h.details}}(),isShiftDown:function(n){return n?n.shiftKey:uq["16"]},isCtrlDown:function(P){return P?cd?P.metaKey:P.ctrlKey:cd?uq["91"]:uq["17"]},getClientPoint:function(k){return Bs&&(k=xo(k)),{x:k.clientX,y:k.clientY}},isMouseEvent:function(A){return A instanceof MouseEvent||0===A.type.indexOf("mouse")},getTargetElement:function(_){if(M.isMouseEvent(_)||!m.elementFromPoint)return _.target;var D=Eg(_);return m.elementFromPoint(D.x,D.y)},getPagePoint:function(a){return Bs&&(a=xo(a)),{x:a.pageX,y:a.pageY}},createObject:function(y,c){var J=new y;for(var X in c){var B=c[X];if(zl(B))J[X]=B;else if(0===X.indexOf("s:"))J.s(X.substr(2),c[X]);else if(0===X.indexOf("a:"))J.a(X.substr(2),c[X]);else{var Z=Zh(X),B=c[X];J[Z]?(J[Z](B),"setToolTip"===Z&&J.enableToolTip&&J.enableToolTip()):J[X]=B}}return J},setImage:function(M,S,t,W){var X=arguments.length;4===X?Xj(M,W,S,t):2===X?Qc(S)?Xj(M,S):_q[M]=S:1===X&&Xj(M,M)},getImage:function(u,$,a){var l;if(u==W)return W;if(ko(u)?l=u:(l=_q[u],u&&l===N&&(_g&&_g[u]||Xj(u,u))),$&&l&&l.tagName){var g;g="override"===a?"colors_override":"override_rgb"===a?"colors_override_rgb":"override_a"===a?"colors_override_a":"colors",l[g]||(l[g]={__count__:0});var v=l[g][$];return v||(l[g].__count__>M.imageCacheThreshold&&(l[g]={__count__:0}),v=_e(l,ho($),l.width,l.height,a),l[g][$]=v,l[g].__count__++),v}return l},isImageComplete:function(X,k,O){var d=ko(X)?X:_q[X];if(!d)return!1;if(d.tagName)return d.complete;for(var z,X,l,L=d.comps,W=!0,s=0,T=L.length;T>s;s++)if(z=L[s],l=z.type,"image"===z.type){X=z.name,X&&X.func&&(X=ag(X,k));var c=bj(X,k,O);if(!c){W=!1;break}}else if(zm.test(l)&&M.getCompType(l)===N){W=!1;break}return W},getId:function(){var l=1;return function(){return++l}}(),callLater:function(e,Z,m,T){var E=function(){e.apply(Z,m)};return T?G(E,T):n.requestAnimationFrame(E)},clone:function(e){if(null==e||"object"!=typeof e)return e;if(e instanceof Date){var f=new Date;return f.setTime(e.getTime()),f}if(e instanceof Array){for(var f=[],q=0,k=e.length;k>q;q++)f[q]=ab(e[q]);return f}if(e instanceof If){for(var f=new If,q=0,k=e.length;k>q;q++)f.set(q,ab(e.get(q)));return f}if(e instanceof tf)return e;if(e instanceof R){var f={};for(var S in e)e.hasOwnProperty(S)&&(f[S]=ab(e[S]));return f}return e},callWhenLoaded:function(l,I){I=I||100;var u=Uj(l,I);Ri||(Ri={}),Ri[u]={tick:u,cb:l,delay:I}},beforeLoadURL:function(H){if(Ri){var s={};for(var l in Ri){var y=Ri[l];K(y.tick);var f=Uj(y.cb,y.delay);s[f]={tick:f,delay:y.delay,cb:y.cb}}Ri=s}return M.convertURL?M.convertURL(H):H},convertURL:function(V){return V},handleRefGraphLoaded:function(){},handleCompTypeLoaded:function(){},handleImageLoaded:function(){},handleUnfoundImage:function(){},sortFunc:function(k,b){if(k===b)return 0;if(k==W&&b!=W)return 1;if(k!=W&&b==W)return-1;if(k==W&&b==W)return 0;var B,Y=typeof k,e=typeof b;return Y===Yh&&e===Yh?B=k.localeCompare(b):Y===eg&&e===eg&&(B=k-b),B===N&&(B=(""+k).localeCompare(""+b)),B>0?1:0>B?-1:0},getClassMap:function(){return Wj},getClass:function(V){if(Qc(V)){var K,X=Wj[V];if(!X){K=V.split("."),X=n;for(var S=0;S<K.length;S++)X=X[K[S]];Wj[V]=X}return X}return V},def:function(c,b,z){var M,I,T,j=function(){};if(j.prototype=b.prototype,M=new j,Qc(c)){if(Wj[c])throw"'"+c+"' already defined";T=Hh(c),M.getClassName=function(){return c}}else T=c;if(M.constructor=T,M.getClass=function(){return T},M.getSuperClass=function(){return b},z)for(I in z)zh[I]&&zh.hasOwnProperty(I)?zh[I](M,z):Br(M,z,I);T.prototype=M,T.superClass=b.prototype},startAnim:function(){var w=function(Y){Y.duration&&(Y.startTime=Nh()),Y.timeId=Mh(Y.tick,W,W,Y.interval)};return function(f){return f=ab(f),f.easing=f.easing||M.animEasing,f.duration||f.frames||(f.duration=M.animDuration),f.t=0,f.duration?f.interval=0:(f.frame=0,f.interval=f.interval||10),f.tick=function(){if(f.duration){var A=(Nh()-f.startTime)/f.duration;A>1&&(A=1),f.t=A,f.action(f.easing(A),A),1===A?f.stop():f._isPaused||(f.timeId=Mh(f.tick))}else f.frame++,A=f.t=f.frame/f.frames,f.action(f.easing(A),A),f.frame<f.frames?f._isPaused||(f.timeId=Mh(f.tick,W,W,f.interval)):f.stop()},f.resume=function(){f._isPaused&&(delete f._isPaused,f.duration?f.t<1&&(f.startTime=Nh()-f.duration*f.t,f.timeId=Mh(f.tick)):f.frame<f.frames&&(f.timeId=Mh(f.tick,W,W,f.interval)))},f.pause=function(){f._isPaused=!0},f.stop=function(b){f.isRunning()&&(f.duration?f.t<1&&b&&(f.t=1,f.action(f.easing(1),1)):f.frame<f.frames&&b&&(f.frame=f.frames,f.action(f.easing(1),1)),f._37o&&f._37o(),f.finishFunc&&f.finishFunc(),of(f.timeId,!f.duration),delete f.timeId)},f.isRunning=function(){return f.timeId!=W},f.delay?Mh(w,W,[f],f.delay):w(f),f}}(),getTextSize:function(){var P={},k=m?Nr().getContext("2d"):W;return function(Z,p){k.font=Z?Z:Eh;var l=P[k.font];return l||(l=2*k.measureText("e").width+4,P[k.font]=l),{width:k.measureText(p).width+4,height:l}}}(),drawText:function(n,c,m,I,k,P,l,h,T,G){if(c!=W){var H=$n(m,c),X={};X.y=G&&G!==ah?G===Im?P+H.height/2:P+h-H.height/2:P+h/2,X.x=T&&T!==Ep?T===bc?k+l-H.width/2:k+l/2:k+H.width/2,oj(n,c,X,m,I)}},getDistance:function(t,m){var x=t.length;return m?3===x?v(y(t[0]-m[0])+y(t[1]-m[1])+y(t[2]-m[2])):2===x?v(y(t[0]-m[0])+y(t[1]-m[1])):t.z===N?v(y(m.x-t.x)+y(m.y-t.y)):v(y(m.x-t.x)+y(m.y-t.y)+y(m.z-t.z)):3===x?v(y(t[0])+y(t[1])+y(t[2])):2===x?v(y(t[0])+y(t[1])):void 0},brighter:function(x,q){return 0>q&&(q=-q),ee(x,q?q:40)},darker:function(R,i){return i>0&&(i=-i),ee(R,i?i:-40)},unionPoint:function(L,x){if(!L)return W;if(2===arguments.length)return L&&x?{x:D(L.x,x.x),y:D(L.y,x.y),width:t(L.x-x.x),height:t(L.y-x.y)}:W;var n=L;if(n._as&&(n=n._as),n.length===N)return W;var K=n.length;if(0>=K)return W;for(var o=1,b=n[0],u={x:b.x,y:b.y,width:0,height:0};K>o;o++){b=n[o];var h=D(u.x,b.x),y=s(u.x+u.width,b.x),$=D(u.y,b.y),Y=s(u.y+u.height,b.y);u.x=h,u.y=$,u.width=y-h,u.height=Y-$}return u},unionRect:function(Z,Y){if(Z&&!Y)return ab(Z);if(!Z&&Y)return ab(Y);if(Z&&Y){var c={x:D(Z.x,Y.x),y:D(Z.y,Y.y)};return c.width=s(Z.x+Z.width,Y.x+Y.width)-c.x,c.height=s(Z.y+Z.height,Y.y+Y.height)-c.y,c}return W},containsPoint:function(a,P,G,p){if(p!=W&&1!==p){var s=a.x+a.width/2,w=a.y+a.height/2;a={x:s-a.width/2*p,y:w-a.height/2*p,width:a.width*p,height:a.height*p}}if(G){var j=a.width/2,T=a.height/2,R=b(-G),K=o(-G),M=P.x-a.x-j,n=P.y-a.y-T;return P={x:K*M-R*n,y:R*M+K*n},Vb({x:-j,y:-T,width:a.width,height:a.height},P)}return!(!a||P.x<a.x||P.y<a.y||P.x>a.x+a.width||P.y>a.y+a.height)},containsRect:function(J,T){if(!J||!T)return!1;var F=T.x,l=T.y,L=T.width,p=T.height,X=J.width,x=J.height;if(0>(X|x|L|p))return!1;var v=J.x,P=J.y;if(v>F||P>l)return!1;if(X+=v,L+=F,F>=L){if(X>=v||L>X)return!1}else if(X>=v&&L>X)return!1;if(x+=P,p+=l,l>=p){if(x>=P||p>x)return!1}else if(x>=P&&p>x)return!1;return!0},intersectsRect:function(b,P){if(!b||!P)return!1;var B=P.width,a=P.height,v=b.width,X=b.height;if(0>=v||0>=X||0>=B||0>=a)return!1;var r=P.x,z=P.y,G=b.x,j=b.y;return v+=G,X+=j,B+=r,a+=z,v>r&&X>z&&B>G&&a>j},intersection:function(P,Y){if(!P||!Y)return W;var u=Y.x,U=Y.y,G=P.x,R=P.y,V=u,f=U,M=G,r=R;return V+=Y.width,f+=Y.height,M+=P.width,r+=P.height,G>u&&(u=G),R>U&&(U=R),V>M&&(V=M),f>r&&(f=r),V-=u,f-=U,0>=V||0>=f?W:{x:u,y:U,width:V,height:f}},grow:function(P,r,x){x===N&&(x=r),P.x-=r,P.y-=x,P.width=P.width+2*r,P.height=P.height+2*x},getLogicalPoint:function(r,b,e,x,A,K){var t,g,J=b.getBoundingClientRect();return r.target?(ji(r)?cd?uq["91"]=!0:uq["17"]=!0:cd?uq["91"]=!1:uq["17"]=!1,uq["16"]=Mc(r)?!0:!1,r=Bs?xo(r):r,t=r.clientX,g=r.clientY):(t=r.x,g=r.y),{x:(t-J.left+b.scrollLeft-(e||0))/(A||1),y:(g-J.top+b.scrollTop-(x||0))/(K||1)}},removeHTML:function(){var B;return function(I){return I&&I.parentNode?B===I?!0:(B=I,I.parentNode.removeChild(I),B=W,!0):!1}}(),getToolTipDiv:function(){if(!Sl){Sl=ps(),vb=ps();var L=Sl.style;M.baseZIndex!=W&&(L.zIndex=V(M.baseZIndex)+3+""),L.whiteSpace="nowrap",L.color=M.toolTipLabelColor,L.background=M.toolTipBackground,L.font=M.toolTipLabelFont,L.padding="5px",L.boxShadow="0px 0px 3px "+M.toolTipShadowColor}return Sl},isToolTipShowing:function(){return Sl&&Sl.parentNode?!0:vb&&vb.parentNode?!0:!1},hideToolTip:function(){Lb(Sl),Lb(vb),cm()},showToolTip:function(g,G){if(!g||G==W)return Kr(),void 0;M.getToolTipDiv();var q,e;if(G.html?(G=G.html,q=vb,Lb(Sl)):(q=Sl,Lb(vb)),e=q.style,q.innerHTML=G,q.parentNode||c.Default.appendToScreen(q),g.target){g=Eg(g);var k=Vj(),P=g.x,X=g.y,i=Bs?60:12;if(Bs){var K=q.getBoundingClientRect();e.left=P-K.width/2+is,e.top=X-K.height-i<k.top?X+i+is:X-K.height-i+is}else{e.left=P+i+is,e.top=X+i+is;var K=q.getBoundingClientRect();K.left+K.width>k.width&&(e.left=P-i-K.width+is),K.top+K.height>k.height&&(e.top=X-i-K.height+is),K.left<0&&(e.left=P+i+is),K.top<0&&(e.top=X+i+is)}}else e.left=g.x+is,e.top=g.y+is;cm()},startDragging:function(g,k){g!==Ug&&(Ug?Bs?Ug.handleWindowTouchEnd(k):Ug.handleWindowMouseUp(k):Bs?(n.addEventListener(nq,qg,!1),n.addEventListener(Rc,sp,!1)):(n.addEventListener(Pp,pk,!1),n.addEventListener(wi,Th,!1)),Ug=g)},getImageMap:function(){return _q},toBoundaries:function(v,G,H,P){var m=[];return Qq(v,G,H,P).forEach(function(b){var J=[];b.forEach(function(i){J.push(i.x,i.y)}),m.push(J)}),m},getCurrentKeyCodeMap:function(){return uq},drawCenterImage:function(Z,q,V,e,$,f,W,Q){var i=ef(q,$,f),N=fc(q,$,f);
- gc(Z,q,S(V-i/2),S(e-N/2),i,N,$,f,W,Q)},drawStretchImage:function(x,W,J,v,f,I,E,Z,H,g,h,d){var R,V=ef(W,Z,H,I),r=fc(W,Z,H,E);"uniform"===J?(R=D(I/V,E/r),V*=R,r*=R,v+=S((I-V)/2),f+=S((E-r)/2),I=V,E=r):"centerUniform"===J&&((V>I||r>E)&&(R=D(I/V,E/r),V*=R,r*=R),v+=S((I-V)/2),f+=S((E-r)/2),I=V,E=r);var m=x.interactiveInfo;if(m){var o;if(o="center"===J?{x:v+I/2-V/2,y:f+E/2-r/2,width:V,height:r}:{x:v,y:f,width:I,height:E},m.rect){var t=m.compInfos,j=t.length;j&&(t[j-1].rect.image=W)}else m.rect=o}if("center"===J){var b=h!==!1&&(V>I||r>E);b&&(x.save(),x.beginPath(),x.rect(v,f,I,E),x.clip()),gc(x,W,v+I/2-V/2,f+E/2-r/2,V,r,Z,H,g,d),b&&x.restore()}else gc(x,W,v,f,I,E,Z,H,g,d)},toCanvas:function(M,I,i,m,Q,r,y,B,K){M=eo(M,y),I=I||ef(M,Q),i=i||fc(M,Q);var k=Nr(),E=ch(k);return B?(Bi(k,I,i,B),E.scale(B,B)):Bi(k,I,i,1),Ym(E,M,m,0,0,I,i,Q,r,y,K),M&&M.clampToEdge&&(k.clampToEdge=M.clampToEdge),E.restore(),k},createGradientImage:function(E,h,p,l){for(var I=["L",0,0,E,0,1,0,0,1,0,0],$=0,d=Math.min(h.length,p.length);d>$;$++)I.push(p[$],h[$]);var K=c.Default.toCanvas({width:E,height:E,clampToEdge:!0,comps:[{type:"shape",rotation:l||0,points:[0,0,E,0,E,E,0,E],background:"#ffffff",gradientPack:I}]});return K},createElement:function(v,c,N,Q){var x=m.createElement(v);return ni(x,c||T.widgetBorder,2),x.style.font=N?N:Eh,Q!=W&&(x.value=Q),M.onElementCreated&&M.onElementCreated(x),x},containedInView:function($,X){var F=Gg(X).getBoundingClientRect();return Vb({x:F.left,y:F.top,width:F.width,height:F.height},Ak($))},isIsolating:function(){return fk>0},setIsolating:function(j){j?fk++:fk--},getMSMap:function(){return zh},stringify:function(i,A){var T=Date.prototype.toJSON;Date.prototype.toJSON=function(){return"__ht__date"+this.getTime()};var k=JSON.stringify(i,function(m,J){return"function"==typeof J?"__ht__"+(J.__ht__||J.toString()):lk(J)?_i(J):J},A==W?2:A);return Date.prototype.toJSON=T,k},parse:function(P){return Qc(P)?JSON.parse(P,function(P,K){if(Qc(K)){if("__ht__function"==K.substr(0,14)){var y=K.indexOf("{")+1,t=K.lastIndexOf("}"),l=K.indexOf("(")+1,$=K.indexOf(")");if(y&&t&&l&&$){var Y=new Function(K.substring(l,$),K.substring(y,t));return Y.__ht__=K.substr(6),Y}}if("__ht__date"==K.substr(0,10))return new Date(V(K.substr(10)))}return K}):P},loadJS:function(Z,D){D&&Z.push(D);var A=Z.shift();if(zn(A))Z=A.contact(Z),M.loadJS(Z);else if(zl(A))A(),M.loadJS(Z);else if(Qc(A)){var n=m.createElement("script");n.onload=function(){M.loadJS(Z)},n.setAttribute("src",A),m.getElementsByTagName("head")[0].appendChild(n)}else Z.length&&M.loadJS(Z)},toRoundedCorner:function(c,R){var e=c.size();if(0>=R)return{points:c};var E,A=new If,F=new If,w=c.get(0);A.add(w),F.add(1);for(var J=1;e>J;J++)if(e>J+1){var Y=c.get(J),x=c.get(J+1),$=w.x,h=w.y,T=Y.x,X=Y.y,U=X-h,r=T-$,j=B(U,r);E=D(.99*Nc(w,Y),R),A.add({x:T-E*o(j),y:X-E*b(j)}),A.add(Y),$=Y.x,h=Y.y,T=x.x,X=x.y,U=X-h,r=T-$,j=B(U,r),E=D(.99*Nc(Y,x),R),w={x:$+E*o(j),y:h+E*b(j)},A.add(w),F.addAll([2,3])}else A.add(c.get(J)),F.add(2);return{points:A,segments:F}},toColorData:Pl,setCanvas:Bi,createDiv:ps,createDisabledDiv:dc,createView:Ko,createCanvas:Nr,appendChild:Vd,initContext:ch,checkLoadingImage:Og,translateAndScale:Ce,layout:vr,getPosition:jm,drawPoints:ql,drawRoundRect:hi,drawBorder:Gn,setFocus:ds,getter:_m,setter:Zh,isEmptyObject:Jl},!0),dr(g,{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);var jr=M.disabledOpacity,ym=M.toolTipDelay,Qd=M.devicePixelRatio,Zd=M.autoMakeVisible,Yn=M.autoHideScrollBar,$p=M.imageGradient,rq=M.showToolTip,Kr=M.hideToolTip,Dj=M.dashPattern,jb=M.lineCap,Ui=M.lineJoin,yd=M.labelColor,kl=M.labelSelectColor,Eh=M.labelFont,Kl=M.widgetIndent,Ol=M.widgetRowHeight,Ab=M.widgetHeaderHeight,Sm=M.widgetTitleHeight,sj=M.scrollBarColor,Od=M.scrollBarSize,qn=M.scrollBarTimeout,wh=M.scrollBarMinLength,ai=M.scrollBarInteractiveSize,io=M.zoomIncrement,Ap=M.scrollZoomIncrement,Xp=M.pinchZoomIncrement,Dg=M.zoomMax,Qp=M.zoomMin,Yc=M.createObject,Zp=M.preventDefault,hg=M.setImage,eo=M.getImage,bj=M.isImageComplete,es=M.drawCenterImage,Ym=M.drawStretchImage,kg=M.getId,Mh=M.callLater,Jp=M.sortFunc,ab=M.clone,Hh=M.getClass,pp=M.startAnim,tj=M.brighter,Pc=M.darker,qb=M.drawText,$n=M.getTextSize,ki=M.isLeftButton,cg=M.getTouchCount,jp=M.isDoubleClick,Mc=M.isShiftDown,ji=M.isCtrlDown,Ak=M.getClientPoint,Eg=M.getPagePoint,Nc=M.getDistance,rd=M.unionPoint,Uh=M.unionRect,Vb=M.containsPoint,us=M.containsRect,js=M.intersectsRect,wj=M.intersection,Vj=M.getWindowInfo,lo=M.grow,Tg=M.getLogicalPoint,Qe=M.startDragging,Lb=M.removeHTML,Hp=M.createElement,Ok=M.segmentResolution,Dk=M.shapeResolution,Er=M.shapeSide,Xr=M.def,Sj=function(c,H,L){Xr(e+"."+c,H,L)},Bf=function(g,q){g.childNodes.forEach(function(e){q(e),Bf(e,q)})};dr(M,{toolTipLabelColor:yd,toolTipLabelFont:Eh,toolTipBackground:T.toolTipBackground,toolTipShadowColor:Xn,drawBreakableText:ir,setDevicePixelRatio:function(P){Qd=M.devicePixelRatio="number"==typeof P?P:n.devicePixelRatio,Bf(m.body,function(Q){var R=Q._ht;R&&R._canvas&&(Bi(R._canvas,R.getWidth(),R.getHeight()),R.redraw?R.redraw():R.iv())})}},!0);var ep=1e-6,br="undefined"!=typeof Uint16Array?Uint16Array:Array,or="undefined"!=typeof Float32Array?Float32Array:Array,Ie=function(p,I,E){var M=[p[0]-I[0],p[1]-I[1],p[2]-I[2]];if(E){var T=Nc(M);T>0&&(M[0]/=T,M[1]/=T,M[2]/=T)}return M},kq=function(){var S="charCodeAt",$=2*(2*Sq.length+1);for(var Y in n)if(Y===e+Ep[0]+is.length){var E=n[Y];if(!E)break;for(var H=E.length,v=0;H>v;v++)if(E[v][S](0)===$&&E[v+1]!=W&&E[v+1]===is[0]&&E[v+2]!=W&&E[v+2][S](0)===$){for(var T=v+3;H>T;T++)if(E[T][S](0)===$){if(0==E[T+1])for(var s,P=T+2;H>P;P++){if(E[P][S](0)===$){0==E[P-1]&&s&&(_=s.substr(0,s.length-1));break}s==W?s=E[P]:s+=E[P]}break}break}break}return function(F){return[-F[0],-F[1],-F[2]]}}(),xr=function(G,N){return 3===G.length?G[0]*N[0]+G[1]*N[1]+G[2]*N[2]:G[0]*N[0]+G[1]*N[1]},Tq=function(){var a=new or(16);return a[0]=1,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=1,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=1,a[11]=0,a[12]=0,a[13]=0,a[14]=0,a[15]=1,a},$m=Tq(),Pf=function(H){var $=new or(16);return $[0]=H[0],$[1]=H[1],$[2]=H[2],$[3]=H[3],$[4]=H[4],$[5]=H[5],$[6]=H[6],$[7]=H[7],$[8]=H[8],$[9]=H[9],$[10]=H[10],$[11]=H[11],$[12]=H[12],$[13]=H[13],$[14]=H[14],$[15]=H[15],$},Bc=function(i,z){return i[0]=z[0],i[1]=z[1],i[2]=z[2],i[3]=z[3],i[4]=z[4],i[5]=z[5],i[6]=z[6],i[7]=z[7],i[8]=z[8],i[9]=z[9],i[10]=z[10],i[11]=z[11],i[12]=z[12],i[13]=z[13],i[14]=z[14],i[15]=z[15],i},Wk=function(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i},ge=function(m,l){var z=m[0],t=m[1],s=m[2];return m[0]=l[0]*z+l[4]*t+l[8]*s+l[12],m[1]=l[1]*z+l[5]*t+l[9]*s+l[13],m[2]=l[2]*z+l[6]*t+l[10]*s+l[14],m},kj=function(n,m){var b=n[0],o=n[1],M=n[2],i=n[3];return n[0]=m[0]*b+m[4]*o+m[8]*M+m[12]*i,n[1]=m[1]*b+m[5]*o+m[9]*M+m[13]*i,n[2]=m[2]*b+m[6]*o+m[10]*M+m[14]*i,n[3]=m[3]*b+m[7]*o+m[11]*M+m[15]*i,n},Qk=function(){var L,d,B,z,o=Bd(Kk[1]+Kk[7]),h=Bd(Kk[0]+Kk[3]-Kk[10]),q=Bd(Kk[8]+2),V=function(){return d=B.charAt(L),L+=1,d},t=function(){var Z="";if(d===q)for(;V();){if(d===q)return V(),Z;Z+=d}else V()},R=function(){for(;d&&" ">=d;)V()},v=function(){var A,F={};if(d===o){if(V(),R(),d===h)return V(),F;for(;d;){if(A=t(),R(),V(),F[A]=z(),R(),d===h)return V(),F;V(),R()}}};return z=function(){switch(R(),d){case o:return v();default:return t()}},function(N){if($={},N){var F;if(B=N,L=0,d=" ",F=z(),R(),!d)return F}}}(),kd=function(a,D){if(D){var I=b(D),g=o(D),x=a[4],i=a[5],L=a[6],V=a[7],d=a[8],$=a[9],z=a[10],N=a[11];a[4]=x*g+d*I,a[5]=i*g+$*I,a[6]=L*g+z*I,a[7]=V*g+N*I,a[8]=d*g-x*I,a[9]=$*g-i*I,a[10]=z*g-L*I,a[11]=N*g-V*I}},Tr=function(l,B){if(B){var $=b(B),k=o(B),g=l[0],p=l[1],_=l[2],d=l[3],Z=l[8],n=l[9],L=l[10],c=l[11];l[0]=g*k-Z*$,l[1]=p*k-n*$,l[2]=_*k-L*$,l[3]=d*k-c*$,l[8]=g*$+Z*k,l[9]=p*$+n*k,l[10]=_*$+L*k,l[11]=d*$+c*k}},pi=function(B,C){if(C){var N=b(C),d=o(C),m=B[0],k=B[1],S=B[2],G=B[3],u=B[4],P=B[5],p=B[6],M=B[7];B[0]=m*d+u*N,B[1]=k*d+P*N,B[2]=S*d+p*N,B[3]=G*d+M*N,B[4]=u*d-m*N,B[5]=P*d-k*N,B[6]=p*d-S*N,B[7]=M*d-G*N}},Xg=function(S,X,C){return qi(W,C===!1?W:S.getFinalScale3d(),S.getFinalRotation3d(),S.getRotationMode(),S.p3(),W,X)},qi=function(v,G,W,n,Z,N,S){return N||(N=Tq()),Z&&Li(N,Z),mp(N,W,n),S&&Mi(N,N,S),G&&ml(N,G),v&&Mi(N,N,v),N},tp=function(e,F,D){F=V(F),D=V(D);var r=this;r.g=e,r._84O=F,r._85O=D,r._70I=!0,r.F=0,r._83O=F+D,r.pen={x:0,y:0}},ro="lineDashOffset",yb="setLineDash",ul=function(O){for(var q in O)1===q.length&&(ro=O[q]);return q?1:0},qc=function(U,r,S){return gh(r)?U:U[yb]?(U[yb](r),S&&(U.lineDashOffset=S),U):new tp(U,r[0],r.length>1?r[1]:r[0])},sd=function(a,y){!gh(y)&&a[yb]&&(a[yb](Td),a.lineDashOffset=0)};if(Xr(tp,R,{_69I:6,moveTo:function(f,b){var w=this,p=w.pen;p.x=f,p.y=b,w.g.moveTo(f,b),w.start||(w.start={x:f,y:b})},lineTo:function(X,V){var e=this,H=e.pen,L=X-H.x,W=V-H.y,y=B(W,L),P=o(y),j=b(y),_=e._23O(H.x,H.y,X,V),f=e._85O,I=e._84O,O=e._83O;if(e.F){if(e.F>_)return e._70I?e._72I(X,V):e.moveTo(X,V),e.F-=_,void 0;if(e._70I?e._72I(H.x+P*e.F,H.y+j*e.F):e.moveTo(H.x+P*e.F,H.y+j*e.F),_-=e.F,e.F=0,e._70I=!e._70I,!_)return}var s=i(_/O);if(s){for(var G=P*I,p=j*I,c=P*f,A=j*f,m=0;s>m;m++)e._70I?(e._72I(H.x+G,H.y+p),e.moveTo(H.x+c,H.y+A)):(e.moveTo(H.x+c,H.y+A),e._72I(H.x+G,H.y+p));_-=O*s}e._70I?_>I?(e._72I(H.x+P*I,H.y+j*I),e.moveTo(X,V),e.F=f-(_-I),e._70I=!1):(e._72I(X,V),_===I?(e.F=0,e._70I=!e._70I):(e.F=I-_,e.moveTo(X,V))):_>f?(e.moveTo(H.x+P*f,H.y+j*f),e._72I(X,V),e.F=I-(_-f),e._70I=!0):(e.moveTo(X,V),_===f?(e.F=0,e._70I=!e._70I):e.F=f-_)},quadraticCurveTo:function(p,U,Y,J){var L,M=this,S=M.pen,u=S.x,X=S.y,x=M._22O(u,X,p,U,Y,J),K=0,P=0,A=M._85O,n=M._84O;if(M.F){if(M.F>x)return M._70I?M._71I(p,U,Y,J):M.moveTo(Y,J),M.F-=x,void 0;if(K=M.F/x,L=M._20O(u,X,p,U,Y,J,K),M._70I?M._71I(L[2],L[3],L[4],L[5]):M.moveTo(L[4],L[5]),M.F=0,M._70I=!M._70I,!x)return}var z=x-x*K,T=i(z/M._83O),f=n/x,W=A/x;if(T)for(var N=0;T>N;N++)M._70I?(P=K+f,L=M._21O(u,X,p,U,Y,J,K,P),M._71I(L[2],L[3],L[4],L[5]),K=P,P=K+W,L=M._21O(u,X,p,U,Y,J,K,P),M.moveTo(L[4],L[5])):(P=K+W,L=M._21O(u,X,p,U,Y,J,K,P),M.moveTo(L[4],L[5]),K=P,P=K+f,L=M._21O(u,X,p,U,Y,J,K,P),M._71I(L[2],L[3],L[4],L[5])),K=P;z=x-x*K,M._70I?z>n?(P=K+f,L=M._21O(u,X,p,U,Y,J,K,P),M._71I(L[2],L[3],L[4],L[5]),M.moveTo(Y,J),M.F=A-(z-n),M._70I=!1):(L=M._19O(u,X,p,U,Y,J,K),M._71I(L[2],L[3],L[4],L[5]),x===n?(M.F=0,M._70I=!M._70I):(M.F=n-z,M.moveTo(Y,J))):z>A?(P=K+W,L=M._21O(u,X,p,U,Y,J,K,P),M.moveTo(L[4],L[5]),L=M._19O(u,X,p,U,Y,J,P),M._71I(L[2],L[3],L[4],L[5]),M.F=n-(z-A),M._70I=!0):(M.moveTo(Y,J),z===A?(M.F=0,M._70I=!M._70I):M.F=A-z)},bezierCurveTo:function(){var c=arguments;this.pen={x:c[4],y:c[5]},this.g.bezierCurveTo(c[0],c[1],c[2],c[3],c[4],c[5])},arc:function(k,J,y,Q,K,w){w||(Q=-Q,K=-K),Fi(this,k,J,Q,K-Q,y,y,!1)},rect:function(v,K,m,r){var o=this;o.pen={x:v,y:K},o.moveTo(v,K),o.lineTo(v,K+r),o.lineTo(v+m,K+r),o.lineTo(v+m,K),o.lineTo(v,K)},beginPath:function(){this.g.beginPath()},closePath:function(){this.lineTo(this.start.x,this.start.y)},_23O:function(M,z,F,s){var T=F-M,D=s-z;return v(T*T+D*D)},_22O:function(i,D,y,e,g,B,q){for(var V,l,k,$,Z,Q,E,s=0,w=i,R=D,f=q>0?q:this._69I,G=1;f>=G;G++)k=G/f,$=1-k,Z=$*$,Q=2*k*$,E=k*k,V=Z*i+Q*y+E*g,l=Z*D+Q*e+E*B,s+=this._23O(w,R,V,l),w=V,R=l;return s},_21O:function(O,M,y,b,r,v,x,c){var p=this;if(0===x)return p._20O(O,M,y,b,r,v,c);if(1===c)return p._19O(O,M,y,b,r,v,x);var t=p._20O(O,M,y,b,r,v,c);return t.push(x/c),p._19O.apply(p,t)},_20O:function(K,p,O,n,C,S,H){if(1!==H){var m=O+(C-O)*H,A=n+(S-n)*H;O=K+(O-K)*H,n=p+(n-p)*H,C=O+(m-O)*H,S=n+(A-n)*H}return[K,p,O,n,C,S]},_19O:function(b,A,Y,j,f,u,L){if(1!==L){var F=b+(Y-b)*L,Q=A+(j-A)*L;Y+=(f-Y)*L,j+=(u-j)*L,b=F+(Y-F)*L,A=Q+(j-Q)*L}return[b,A,Y,j,f,u]},_72I:function(i,M){var U=this.pen;(i!==U.x||M!==U.y)&&(U.x=i,U.y=M,this.g.lineTo(i,M))},_71I:function(j,E,M,T){var C=this.pen;(j!==M||E!==T||M!==C.x||T!==C.y)&&(C.x=M,C.y=T,this.g.quadraticCurveTo(j,E,M,T))}}),Q&&P){var ll=P.toString();u=ll.indexOf(Wr.substr(0,2))>0&&ll.indexOf(Im+Im.substr(1,1))>1||ll.indexOf(Fk[0]+pl.substr(0,2)+Wr.substr(2,2)+Ep[0]+Wr[4])>1?!0:!1}var Ir=W,Bl=W,ss=function(H){Ir&&!H._72O&&(Bl||(Bl={}),Bl[H._72O=kg()]=H)},no=function(z,c){if(c||(c=z),c&&(Ir||(Ir={}),!Ir[z])){var h=new XMLHttpRequest;if(Ir[c]={request:h,url:c},h.overrideMimeType&&h.overrideMimeType("text/plain"),c=M.beforeLoadURL(c),c.data){var J=M.parse(c.data);tk(z,J),M.handleCompTypeLoaded(z,J)}else h.open("GET",encodeURI(c),!0),h.onload=function(I){if(200===this.status||0===this.status){var N=M.parse(I.target.response||I.target.responseText);tk(z,N),M.handleCompTypeLoaded(z,N)}else tk(z,W)},h.onerror=function(){tk(z,W)},h.send(null)}},tk=function(z,H){if(Zn[z]=H,delete Ir[z],Jl(Ir)&&(Ir=W,Bl)){for(var O in Bl){var u=Bl[O];u.invalidateAll&&u.invalidateAll(N,"compTypeLoaded",z),u.redraw&&u.redraw(),u.iv(),delete u._72O}Bl=W}if(H&&Bl)for(var O in Bl){var u=Bl[O];u.invalidateAll&&u.invalidateAll(N,"compTypeLoading",z),u.redraw&&u.redraw(),u.iv()}},Jg=T.chart,hq=M.compStack=[],nn=/^style@/,Bp=/^attr@/,Dl=/^field@/,Ih={x:.5,y:.5},ef=function(l,e,A,h){if(!l)return 0;if(ag(l.fitSize,e,A)&&h)return h;var z=ag(l.width,e,A);return null==z?20:z},fc=function(o,T,A,e){if(!o)return 0;if(ag(o.fitSize,T,A)&&e)return e;var W=ag(o.height,T,A);return null==W?20:W},ag=function(T,M,F){if(!T||!T.func)return T;var b,y=T.func,f=T.value;return b=zl(y)?F&&F.vectorDataBindingDisabled&&!T.isSafeFunc?f:y(M,F):M instanceof tf?Bp.test(y)?M.a(y.slice(5)):nn.test(y)?M.s(y.slice(6)):Dl.test(y)?M[y.slice(6)]:M[y]?M[y](F):f:f,f!==N&&b==W?f:b},gc=M.drawImage=function(){var t,H,z,B,p,c,d=function(W,T){W.getValue&&W.getValue.compType===T||(W.getValue=function(m){var t=S(W,m);if(t===N&&T.properties){var k=T.properties[m];k&&(t=k.defaultValue)}return t},W.getValue.compType=T)},S=function(u,L,J){var X=u[L];return X&&X.func?(X=ag(X,H,z),J&&(X=J(X))):J&&(X=u[L]=J(X)),X},r=function(G,s){var a;if(a=s?S(G,s):G,p&&a){if("override"===c)return p;if("override_rgb"===c){var y=ho(p);return a=Pl(a),"rgba("+i(255*y[0])+","+i(255*y[1])+","+i(255*y[2])+","+a[3]/255+")"}if("override_a"===c){var y=ho(p);return a=Pl(a),"rgba("+a[0]+","+a[1]+","+a[2]+","+y[3]+")"}var y=ho(p);return a=Pl(a),"rgba("+i(a[0]*y[0])+","+i(a[1]*y[1])+","+i(a[2]*y[2])+","+a[3]/255*y[3]+")"}return a},k=function(V){if(zn(V)){for(var m=new If,l=V.length,b=0;l>b;b+=2)m.add({x:V[b],y:V[b+1]});V=m}return V},a=function(p){var a=S(p,"anchorX"),q=S(p,"anchorY");if(a!==N||q!==N)return{x:a===N?Ih.x:a,y:q===N?Ih.y:q};var C=S(p,"type"),D=S(p,"name");if("image"!==C||!D)return Ih;var G=eo(D);return G&&G.anchorX!==N&&G.anchorY!==N?{x:G.anchorX,y:G.anchorY}:Ih},V=function(s,L){var H=S(s,Rl),u=a(s);if(zn(H)){var y=H.length,o=S(s,"relative"),d=L.width,A=L.height;if(4===y)H={x:H[0],y:H[1],width:H[2],height:H[3]},o?(H.x*=d,H.y*=A,H.width*=d,H.height*=A):L.fitSize&&(H.x*=L.widthScale,H.width*=L.widthScale,H.y*=L.heightScale,H.height*=L.heightScale);else if(3===y){var W=H[0];H={width:H[1],height:H[2]},o?(H.width*=d,H.height*=A):L.fitSize&&(H.width*=L.widthScale,H.height*=L.heightScale),"object"==typeof W?W.length&&(W={x:W[0],y:W[1]}):W=jm(W,L,H),H.x=W.x-H.width*u.x,H.y=W.y-H.height*u.y}var k=S(s,"offsetX");k&&(L.fitSize&&(k*=L.widthScale),H.x+=k),k=S(s,"offsetY"),k&&(L.fitSize&&(k*=L.heightScale),H.y+=k)}return H},O=function(N){return zn(N)?new If(N):N},G=function(g,Y,C,R,b,y,u){var l=t.interactiveInfo,F=g.transform;if(F)return t.save(),t.setTransform(F.a,F.b,F.c,F.d,F.tx,F.ty),l&&l.compInfos.push({comp:g,rect:Y,matrix:F.clone()}),!0;b===N&&(b=1),y===N&&(y=1);var D=S(g,"clipPercentage"),O=Om(C,Y);if(O&&!R&&1===b&&1===y&&!(1>D))return l&&l.compInfos.push({comp:g,rect:Y,matrix:l.matrix.clone()}),!1;u=u||Ih;var e=Y.x+Y.width*u.x,B=Y.y+Y.height*u.y,E=C.x+C.width*u.x,P=C.y+C.height*u.y,d=C.width?b*(Y.width/C.width):1,n=C.height?y*(Y.height/C.height):1;if(t.save(),l&&(l.matrix.appendTranslate(e,B).appendRotate(R).appendScale(d,n).appendTranslate(-E,-P),l.compInfos.push({comp:g,rect:Y,matrix:l.matrix.clone()})),vc(t,e,B),We(t,R||0),li(t,d,n),vc(t,-E,-P),1>D){0>D&&(D=0);var A=Jk(C,S(g,"clipDirection"),D);t.beginPath(),t.rect(A.x,A.y,A.width,A.height),t.clip()}return!0},u=function(){t.restore()},K=function(e,s,P){var Q=S(e,"path"),z=S(e,Zq),I=S(e,"scaleX"),O=S(e,"scaleY"),J=a(e),F=W,L=Il(null,Q);if(P||(P=e.unionRect,P||(P=rd(L),e.path.func||(e.unionRect=P)),F=P),P){F||(F=e.unionRect,F||(F=rd(L),e.path.func||(e.unionRect=F)));var M=G(e,P,F,z,I,O,J),X=S(e,"borderPattern"),k=qc(t,X),p=r(e,"background"),b=r(e,"borderColor"),j=S(e,"borderWidth"),U=S(e,"gradient"),o=r(e,"gradientColor"),n=S(e,"border3d"),f=S(e,"border3dColor"),m=S(e,"border3dAccuracy"),N=t.lineJoin,l=t.lineCap;if(t.lineJoin=S(e,"borderJoin")||Ui,t.lineCap=S(e,"borderCap")||jb,p?(bn(t,p,U,o,F),Il(t,Q),t.fill(),k!==t&&Il(t,Q)):Il(t,Q),j&&b){var x=S(e,"borderWidthAbsolute");x&&(t.save(),t.setTransform(1,0,0,1,0,0)),t.lineWidth=j,t.strokeStyle=b,t.stroke(),x&&t.restore(),n&&He(t,b,f,j,B,m)}if(sd(t,X),S(e,"dash")){var C=S(e,"dashWidth")||j;if(C>0){X=S(e,"dashPattern")||Dj;var k=qc(t,X,S(e,"dashOffset")),h=r(e,"dashColor")||r(Sp);k!==t&&Il(t,Q),t.strokeStyle=h,t.lineWidth=C,t.stroke(),S(e,"dash3d")&&He(t,h,r(e,"dash3dColor"),C,B,S(e,"dash3dAccuracy")),sd(t,X)}}s===Rl&&te(t,p,S(e,"depth"),F),t.lineJoin=N,t.lineCap=l,M&&u()}},y=function(v,e,x,Y){var N=S(v,oc,k),m=S(v,Zq),Z=a(v);if(N&&Y.fitSize){var P=Math.abs(Math.cos(m))<.001,n=new If,q=rd(N),w=Y.widthScale,M=Y.heightScale,y=q.x+Z.x*q.width,o=q.y+Z.y*q.height,K=y*w,j=o*M;N.each(function(p){var g=p.x-y,H=p.y-o;n.add({x:K+g*(P?M:w),y:j+H*(P?w:M)})}),N=n,v.unionRect=null}var C=S(v,"scaleX"),$=S(v,"scaleY"),s=e===fr,g=W;if(!x&&s&&(x=v.unionRect,x||(x=rd(N),v.points.func||(v.unionRect=x)),g=x),x){s?g||(g=v.unionRect,g||(g=rd(N),v.points.func||(v.unionRect=g))):g=x;var A,d,l,F,f=G(v,x,g,m,C,$,Z),L=S(v,"borderPattern"),b=qc(t,L),R=r(v,"background"),T=eo(S(v,"repeatImage"),p,c),V=S(v,"gradientPack"),X=r(v,"borderColor"),Q=S(v,"borderWidth"),D=S(v,"segments",O),I=S(v,"gradient"),h=r(v,"gradientColor"),i=S(v,"border3d"),_=S(v,"border3dColor"),U=S(v,"border3dAccuracy"),E=S(v,"closePath"),J=S(v,"fillRule")||"nonzero",kf=t.lineJoin,Iq=t.lineCap;if(t.lineJoin=S(v,"borderJoin")||Ui,t.lineCap=S(v,"borderCap")||jb,s)if(R||T||V){var Dd=S(v,"fillClipPercentage");if(1>Dd){0>Dd&&(Dd=0);var hp=Jk(g,S(v,"fillClipDirection"),Dd);t.save(),t.beginPath(),t.rect(hp.x,hp.y,hp.width,hp.height),t.clip()}if(ql(t,N,D,E),V)Mp(t,V);else if(T){var Lj=t,Md=p,Ak=c;Ci(t,T,p,c,H,z),t=Lj,p=Md,c=Ak}else{var Lj=t;bn(t,R,I,h,g),t=Lj}t.fill(J),1>Dd&&t.restore(),V&&t.restore(),b!==t&&ql(b,N,D,E)}else ql(b,N,D,E);else if("roundRect"===e?A=S(v,"cornerRadius"):"polygon"===e?A=S(v,"polygonSide"):"arc"===e&&(A=S(v,"arcFrom"),d=S(v,"arcTo"),l=S(v,"arcClose"),F=S(v,"arcOval")),R||T||V){var Dd=S(v,"fillClipPercentage");if(1>Dd){0>Dd&&(Dd=0);var hp=Jk(g,S(v,"fillClipDirection"),Dd);t.save(),t.beginPath(),t.rect(hp.x,hp.y,hp.width,hp.height),t.clip()}if(wk(t,e,g,A,d,l,F),V)Mp(t,V);else if(T){var Lj=t,Md=p,Ak=c;Ci(t,T,p,c,H,z),t=Lj,p=Md,c=Ak}else bn(t,R,I,h,g);t.fill(J),1>Dd&&t.restore(),V&&t.restore(),t!==b&&wk(b,e,g,A,d,l,F)}else wk(b,e,g,A,d,l,F);if(Q&&X){var kk=S(v,"borderWidthAbsolute");kk&&(t.save(),t.setTransform(1,0,0,1,0,0)),t.lineWidth=Q,t.strokeStyle=X,t.stroke(),kk&&t.restore(),i&&He(t,X,_,Q,B,U)}if(sd(t,L),S(v,"dash")){var Qp=S(v,"dashWidth")||Q;if(Qp>0){L=S(v,"dashPattern")||Dj;var b=qc(t,L,S(v,"dashOffset")),vg=r(v,"dashColor")||r(Sp);b!==t&&(s?ql(b,N,D,E):wk(b,e,g,A,d,l,F)),t.strokeStyle=vg,t.lineWidth=Qp,t.stroke(),S(v,"dash3d")&&He(t,vg,r(v,"dash3dColor"),Qp,B,S(v,"dash3dAccuracy")),sd(t,L)}}e===Rl&&te(t,R,S(v,"depth"),g),t.lineJoin=kf,t.lineCap=Iq,f&&u()}},Y=function(V,y){var j=p,o=c,D=p||S(V,Hb),u=c||S(V,"blendMode"),w=eo(S(V,"name"),D,u);w&&(Ym(t,w,S(V,"stretch"),y.x,y.y,y.width,y.height,H,z,D,null,u),p=j,c=o)},l=function(i,a){var v=S(i,"text");v!=W&&qb(t,v,S(i,"font"),r(i,Hb),a.x,a.y,a.width,a.height,S(i,"align"),S(i,"vAlign"))},R=function(G,f){Gn(t,r(G,Hb),f.x,f.y,f.width,f.height,S(G,"width"))},T=function(X,E){var V=S(X,Vi),Z=0;if(V&&(V.forEach(function(E){Z+=E}),Z>0)){for(var f=S(X,"colors")||Jg,e=S(X,"startAngle")||0,j=S(X,"hollow"),Q=S(X,yg),i=S(X,fn),A=S(X,ug),u=Q?new If:W,r=E.x,s=E.y,B=E.width,N=E.height,K=r+B/2,d=s+N/2,T=D(B,N)/2,c=0,v=0;v<V.length;v++){var M=V[v],n=C*M/Z,m=e+n;if(t.fillStyle=f[c++],c===f.length&&(c=0),t.beginPath(),j){var U=K+o(e)*T/2,J=d+b(e)*T/2,z=K+o(m)*T,k=d+b(m)*T;t.moveTo(U,J),t.arc(K,d,T/2,e,m,!1),t.lineTo(z,k),t.arc(K,d,T,m,e,!0)}else t.moveTo(K,d),t.arc(K,d,T,m,e,!0);u&&(n=(e+m)/2,u.add({text:zl(Q)?Q(M,v,Z,H):M,x:K+.75*o(n)*T,y:d+.75*b(n)*T})),t.closePath(),t.fill(),e=m}u&&u.each(function(R){qb(t,R.text,i,A,R.x,R.y,0,0,uf)})}},g=function(b,a){var $=S(b,Kb);if($&&$.length>0){var T=$.length,f=S(b,yg),D=S(b,fn),z=S(b,ug),M=f?new If:W,Q=S(b,"minValue")||0,q=S(b,"maxValue");if(q==W&&(q=0,$.forEach(function(g){S(g,Vi).forEach(function(J){q=s(q,J)})})),Q===q)return;for(var g=a.height/(q-Q),P=a.y+q*g,e=S($[0],Vi).length,E=a.width/(3*e+1),O=2*E/T,u=0,C=0;T>C;C++)for(var L=$[C],R=S(L,Hb),v=S(L,"colors"),y=S(L,Vi),m=0;e>m;m++){v?t.fillStyle=v[m]:R?t.fillStyle=R:(t.fillStyle=Jg[u++],u===Jg.length&&(u=0));var j=y[m],J=j*g,F=a.x+(1+3*m)*E+C*O;if(ic(t,F,P-J,O,J),M){var X=zl(f)?f(j,m,L,H):j,w=$n(D,X).height;M.add({x:F,y:P-J-w,width:O,height:w,text:X})}}M&&M.each(function(H){qb(t,H.text,D,z,H.x,H.y,H.width,H.height,uf)})}},m=function(I,j){var v=S(I,Kb);if(v&&v.length>0){var L=v.length,R=S(v[0],Vi).length,o=j.width/(3*R+1),d=0,z=S(I,"maxValue"),l=S(I,yg),e=S(I,fn),w=S(I,ug),F=l?new If:W;if(z==W){z=0;for(var m=0;R>m;m++){for(var x=0,r=0;L>r;r++)x+=S(v[r],Vi)[m];z=s(z,x)}}if(z>0){for(var m=0;R>m;m++)for(var N=j.y+j.height,r=0;L>r;r++){var K=v[r],T=S(K,Hb),O=S(K,Vi)[m],M=O/z*j.height;T?t.fillStyle=T:(t.fillStyle=Jg[d++],d===Jg.length&&(d=0)),N-=M;var h={x:j.x+(1+3*m)*o,y:N,width:2*o,height:M};ic(t,h.x,h.y,h.width,h.height),F&&(h.text=zl(l)?l(O,m,K,H):O,F.add(h))}F&&F.each(function(s){qb(t,s.text,e,w,s.x,s.y,s.width,s.height,uf)})}}},j=function(Y,q){var U=S(Y,Kb);if(U&&U.length>0){for(var _=U.length,c=S(U[0],Vi).length,B=q.width/(3*c+1),O=0,a=S(Y,yg),r=S(Y,fn),n=S(Y,ug),T=a?new If:W,w=0;c>w;w++){for(var l=0,C=0;_>C;C++)l+=S(U[C],Vi)[w];if(l>0){var g=q.y+q.height;for(C=0;_>C;C++){var v=U[C],z=S(v,Hb),m=S(v,Vi)[w],L=m/l*q.height;z?t.fillStyle=z:(t.fillStyle=Jg[O++],O===Jg.length&&(O=0)),g-=L;var X={x:q.x+(1+3*w)*B,y:g,width:2*B,height:L};ic(t,X.x,X.y,X.width,X.height),T&&(X.text=zl(a)?a(m,w,v,H):m,T.add(X))}}}T&&T.each(function(s){qb(t,s.text,r,n,s.x,s.y,s.width,s.height,uf)})}},h=function(w,Y){var f=S(w,Kb);if(f&&f.length>0){var o=f.length,e=S(w,"minValue")||0,M=S(w,"maxValue");if(M==W&&(M=0,f.forEach(function(L){S(L,Vi).forEach(function(H){M=s(M,H)})})),e===M)return;for(var k=Y.height/(M-e),x=Y.y+M*k,n=S(f[0],Vi).length,Z=Y.width/(3*n+1),q=0,y=S(w,"lineWidth")||2,K=S(w,"line3d"),T=S(w,"linePoint"),g=S(w,yg),b=S(w,fn),F=S(w,ug),N=0;o>N;N++){var X=f[N],U=S(X,Hb),O=S(X,Vi);U?t.strokeStyle=U:(U=t.strokeStyle=Jg[q++],q===Jg.length&&(q=0)),t.beginPath();for(var $=0;n>$;$++){var d=Y.x+(2+3*$)*Z,j=x-O[$]*k;0===$?t.moveTo(d,j):t.lineTo(d,j)}if(t.lineWidth=y,t.stroke(),K&&He(t,U,W,y,B),T||g){var v,l=y/2+2;for($=0;n>$;$++){var z=O[$];if(d=Y.x+(2+3*$)*Z,j=x-z*k,zl(T)?T(t,d,j,U,$,X,H):T&&(t.fillStyle=U,t.beginPath(),t.arc(d,j,l,0,C,!0),t.fill()),zl(g)?v=g(z,$,X,H):g&&(v=z),v){var h=$n(b,v).height,D=t.shadowBlur;if(D){var u=t.shadowOffsetX,i=t.shadowOffsetY,r=t.shadowColor;t.shadowOffsetX=0,t.shadowOffsetY=0,t.shadowBlur=0,t.shadowColor=W}qb(t,v,b,F,d,j-h-l+2,0,h,uf),D&&(t.shadowOffsetX=u,t.shadowOffsetY=i,t.shadowBlur=D,t.shadowColor=r)}}}}}},v={border:R,image:Y,text:l,pieChart:T,columnChart:g,stackedColumnChart:m,percentageColumnChart:j,lineChart:h};return function(I,b,F,A,l,Z,f,i,g,s){if(b&&l&&Z){t=I,H=f,z=i,B=z?z._zoom?z._zoom:1:1,p=g,c=s;var e=l,m=Z;if(cn()){var Q,h,D;0===t[Zf]?cn[0]&&(Q=!0):Q=!0,t.texureImage2D?cn[1]&&(h=!0):h=!0,t.texureImage3D?cn[2]&&(D=!0):D=!0,Q&&h&&D&&(e=F,m=A)}if(b.tagName)return Qc(_)&&!n[_]||t.drawImage(b,e,m,l,Z),void 0;if(S(b,"visible")!==!1){p||(p=ag(b.color,H,z)),s||(c=ag(b.blendMode,H,z)),Qc(_)&&!n[_]&&(l=e,Z=m);var w=ef(b,H,z,l),L=fc(b,H,z,Z),X={x:0,y:0,width:w,height:L,fitSize:S(b,"fitSize")},U=S(b,"clip"),o=S(b,"opacity");if(X.fitSize&&(X.widthScale=w/ag(b.width,H,z),X.heightScale=L/ag(b.height,H,z)),t.save(),t.interactiveInfo){var P=t.interactiveInfo.matrix,E=P.clone();P.appendTranslate(e,m).appendScale(l/w,Z/L)}vc(t,e,m),(w!==l||L!==Z)&&t.scale(l/w,Z/L),U&&(zl(U)?U(t,w,L,H,z,b):(t.beginPath(),t.rect(0,0,w,L),t.clip())),o!=W&&(t.globalAlpha*=o),S(b,"comps").forEach(function(e){if(S(e,xm)!==!1){if(hq.splice(0,0,e),t.interactiveInfo)var c=t.interactiveInfo.matrix.clone();var n=S(e,"opacity"),E=S(e,"shadow"),p=S(e,"type"),D=V(e,X);if(n!=W){var Y=t.globalAlpha;t.globalAlpha*=n}if(E){var m=t.shadowOffsetX,T=t.shadowOffsetY,g=t.shadowBlur,L=t.shadowColor,$=S(e,"shadowOffsetX"),Z=S(e,"shadowOffsetY"),b=S(e,"shadowBlur"),U=r(e,"shadowColor");t.shadowOffsetX=($==W?3:$)*B,t.shadowOffsetY=(Z==W?3:Z)*B,t.shadowBlur=(b==W?6:b)*B,t.shadowColor=U||r(Gh)}if("save"===p)t.save();else if("endClip"===p||"restore"===p)t.restore();else if("clip"===p)t.save(),ql(t,S(e,"points",k),S(e,"segments",O),!0),t.clip();else if(kf[p])D=D||{x:0,y:0,width:X.width,height:X.height},y(e,p,D,X);else if(p===fr)y(e,p,D,X);else if("SVGPath"===p)K(e,p,D);else{D=D||{x:0,y:0,width:X.width,height:X.height};var w=S(e,Zq),I=S(e,"scaleX"),P=S(e,"scaleY"),j=a(e),A=G(e,D,D,w,I,P,j);if(zl(p))d(e,p),M.drawCompType(p,t,D,e,H,z);else if(M.getCompType(p)){var i=M.getCompType(p),l=i.func||i;d(e,i),M.drawCompType(l,t,D,e,H,z)}else v[p]?v[p](e,D):M.getCompType(p)===N&&zm.test(p)&&no(p);A&&u()}E&&(t.shadowOffsetX=m,t.shadowOffsetY=T,t.shadowBlur=g,t.shadowColor=L),n!=W&&(t.globalAlpha=Y),t.interactiveInfo&&(t.interactiveInfo.matrix=c),hq.splice(0,1)}}),t.interactiveInfo&&(t.interactiveInfo.matrix=E),t.restore()}}}}();M.getCurrentComp=function(){return hq[0]},M.getParentComp=function(){return hq[1]},M.getInternal=function(){return{isEnter:uc,isEsc:Zr,isSpace:Nd,isLeft:Ae,isUp:Gr,isRight:Fr,isDown:ob,addMethod:dr,superCall:Ne,toPointsArray:Qq,translateAndScale:Ce,appendArray:em,createWorldMatrix:qi,vec3TransformMat4:ge,setCanvas:Bi,createDiv:ps,createView:Ko,createCanvas:Nr,createImage:Yf,initContext:ch,layout:vr,fillRect:ic,Mat:ng,drawBorder:Gn,isString:Qc,setBorder:ni,getPropertyValue:nk,setPropertyValue:$b,drawVerticalLine:bh,draw3DRect:te,getPinchDist:Ql,isSameRect:Om,getPosition:jm,intersectionLineRect:os,getNodeRect:Lg,getEdgeAgentPosition:kr,getImageWidth:ef,getImageHeight:fc,initItemElement:Oc,drawPoints:ql,createG2:qc,closePopup:Jo,isH:sf,createAnim:Wm,createNormalMatrix:_n,createNormals:$q,toFloatArray:Zc,glMV:Qr,batchShape:Ob,createNodeMatrix:Xg,getFaceInfo:Ke,transformAppend:Rq,drawFaceInfo:we,to3dPointsArray:rp,setGLDebugMode:function(R){ph=R},cube:function(){return{vs:Sb,is:Ec,uv:hm}},ui:function(){return{DataUI:Jf,NodeUI:xk,EdgeUI:Yj,GroupUI:rf,ShapeUI:Xk,GridUI:df,Data3dUI:Tk,Node3dUI:Dc,Shape3dUI:hs}},getInternalVersion:function(){return"U2FsdGVkX190kDT/aFpJKHPpLJKBvRsdzGg0yo8x+Qo="},getDragger:function(){return Ug},addMSMap:function(D){dr(zh,D)},k:z}},function(U){function H(y,z){y!=W&&(z==W&&Yh!=typeof y?this._54O(y,256):this._54O(y,z))}function l(){return new H(W)}function G(k,f,o,t,O,H){for(;--H>=0;){var P=f*this[k++]+o[t]+O;O=i(P/67108864),o[t++]=67108863&P}return O}function j(F,O,e,C,j,z){for(var Z=32767&O,k=O>>15;--z>=0;){var n=32767&this[F],I=this[F++]>>15,Q=k*n+I*Z;n=Z*n+((32767&Q)<<15)+e[C]+(1073741823&j),j=(n>>>30)+(Q>>>15)+k*I+(j>>>30),e[C++]=1073741823&n}return j}function u(b,Z,G,C,F,z){for(var R=16383&Z,n=Z>>14;--z>=0;){var N=16383&this[b],B=this[b++]>>14,w=n*N+B*R;N=R*N+((16383&w)<<14)+G[C]+F,F=(N>>28)+(w>>14)+n*B,G[C++]=268435455&N}return F}function M(I){return ie.charAt(I)}function I(T,s){var w=xm[T.charCodeAt(s)];return w==W?-1:w}function $(x){for(var L=this.t-1;L>=0;--L)x[L]=this[L];x.t=this.t,x.s=this.s}function N(R){this.t=1,this.s=0>R?-1:0,R>0?this[0]=R:-1>R?this[0]=R+this.DV:this.t=0}function Z(J){var r=l();return r._58O(J),r}function P(S,i){var _,A=this;if(16==i)_=4;else if(8==i)_=3;else if(256==i)_=8;else if(2==i)_=1;else if(32==i)_=5;else{if(4!=i)return A.fromRadix(S,i),void 0;_=2}A.t=0,A.s=0;for(var h=S.length,N=!1,y=0;--h>=0;){var u=8==_?255&S[h]:I(S,h);0>u?"-"==S.charAt(h)&&(N=!0):(N=!1,0==y?A[A.t++]=u:y+_>A.DB?(A[A.t-1]|=(u&(1<<A.DB-y)-1)<<y,A[A.t++]=u>>A.DB-y):A[A.t-1]|=u<<y,y+=_,y>=A.DB&&(y-=A.DB))}8==_&&0!=(128&S[0])&&(A.s=-1,y>0&&(A[A.t-1]|=(1<<A.DB-y)-1<<y)),A._57O(),N&&H.ZERO._78O(A,A)}function O(){for(var b=this,V=b.s&b.DM;b.t>0&&b[b.t-1]==V;)--b.t}function X(A){var G=this;if(G.s<0)return"-"+G._85O()[fm](A);var p;if(16==A)p=4;else if(8==A)p=3;else if(2==A)p=1;else if(32==A)p=5;else{if(4!=A)return G.toRadix(A);p=2}var I,d=(1<<p)-1,E=!1,z="",v=G.t,V=G.DB-v*G.DB%p;if(v-->0)for(V<G.DB&&(I=G[v]>>V)>0&&(E=!0,z=M(I));v>=0;)p>V?(I=(G[v]&(1<<V)-1)<<p-V,I|=G[--v]>>(V+=G.DB-p)):(I=G[v]>>(V-=p)&d,0>=V&&(V+=G.DB,--v)),I>0&&(E=!0),E&&(z+=M(I));return E?z:"0"}function d(){var t=l();return H.ZERO._78O(this,t),t}function A(){return this.s<0?this._85O():this}function m(j){var P=this,v=P.s-j.s;if(0!=v)return v;var b=P.t;if(v=b-j.t,0!=v)return P.s<0?-v:v;for(;--b>=0;)if(0!=(v=P[b]-j[b]))return v;return 0}function n(T){var Q,z=1;return 0!=(Q=T>>>16)&&(T=Q,z+=16),0!=(Q=T>>8)&&(T=Q,z+=8),0!=(Q=T>>4)&&(T=Q,z+=4),0!=(Q=T>>2)&&(T=Q,z+=2),0!=(Q=T>>1)&&(T=Q,z+=1),z}function B(){var O=this;return O.t<=0?0:O.DB*(O.t-1)+n(O[O.t-1]^O.s&O.DM)}function k(n,Z){var L;for(L=this.t-1;L>=0;--L)Z[L+n]=this[L];for(L=n-1;L>=0;--L)Z[L]=0;Z.t=this.t+n,Z.s=this.s}function T(X,L){for(var p=X;p<this.t;++p)L[p-X]=this[p];L.t=s(this.t-X,0),L.s=this.s}function w(_,N){var h,t=this,e=_%t.DB,r=t.DB-e,G=(1<<r)-1,R=i(_/t.DB),Y=t.s<<e&t.DM;for(h=t.t-1;h>=0;--h)N[h+R+1]=t[h]>>r|Y,Y=(t[h]&G)<<e;for(h=R-1;h>=0;--h)N[h]=0;N[R]=Y,N.t=t.t+R+1,N.s=t.s,N._57O()}function Y(A,Z){var W=this;Z.s=W.s;var h=i(A/W.DB);if(h>=W.t)return Z.t=0,void 0;var U=A%W.DB,f=W.DB-U,u=(1<<U)-1;Z[0]=W[h]>>U;for(var $=h+1;$<W.t;++$)Z[$-h-1]|=(W[$]&u)<<f,Z[$-h]=W[$]>>U;U>0&&(Z[W.t-h-1]|=(W.s&u)<<f),Z.t=W.t-h,Z._57O()}function p(f,$){for(var F=this,q=0,z=0,G=D(f.t,F.t);G>q;)z+=F[q]-f[q],$[q++]=z&F.DM,z>>=F.DB;if(f.t<F.t){for(z-=f.s;q<F.t;)z+=F[q],$[q++]=z&F.DM,z>>=F.DB;z+=F.s}else{for(z+=F.s;q<f.t;)z-=f[q],$[q++]=z&F.DM,z>>=F.DB;z-=f.s}$.s=0>z?-1:0,-1>z?$[q++]=F.DV+z:z>0&&($[q++]=z),$.t=q,$._57O()}function Q(Y,M){var l=this.abs(),t=Y.abs(),D=l.t;for(M.t=D+t.t;--D>=0;)M[D]=0;for(D=0;D<t.t;++D)M[D+l.t]=l.am(0,t[D],M,D,0,l.t);M.s=0,M._57O(),this.s!=Y.s&&H.ZERO._78O(M,M)}function F(P){for(var C=this.abs(),D=P.t=2*C.t;--D>=0;)P[D]=0;for(D=0;D<C.t-1;++D){var w=C.am(D,C[D],P,2*D,0,1);(P[D+C.t]+=C.am(D+1,2*C[D],P,2*D+1,w,C.t-D-1))>=C.DV&&(P[D+C.t]-=C.DV,P[D+C.t+1]=1)}P.t>0&&(P[P.t-1]+=C.am(D,C[D],P,2*D,0,1)),P.s=0,P._57O()}function t(q,N,O){var t=q.abs(),u=this;if(!(t.t<=0)){var Z=u.abs();if(Z.t<t.t)return N!=W&&N._58O(0),O!=W&&u._77O(O),void 0;O==W&&(O=l());var F=l(),C=u.s,y=q.s,d=u.DB-n(t[t.t-1]);d>0?(t._44O(d,F),Z._44O(d,O)):(t._77O(F),Z._77O(O));var v=F.t,k=F[v-1];if(0!=k){var s=k*(1<<u.F1)+(v>1?F[v-2]>>u.F2:0),o=u.FV/s,B=(1<<u.F1)/s,x=1<<u.F2,X=O.t,R=X-v,K=N==W?l():N;for(F._59O(R,K),O._52O(K)>=0&&(O[O.t++]=1,O._78O(K,O)),H.ONE._59O(v,K),K._78O(F,F);F.t<v;)F[F.t++]=0;for(;--R>=0;){var c=O[--X]==k?u.DM:i(O[X]*o+(O[X-1]+x)*B);if((O[X]+=F.am(0,c,O,R,0,v))<c)for(F._59O(R,K),O._78O(K,O);O[X]<--c;)O._78O(K,O)}N!=W&&(O._45O(v,N),C!=y&&H.ZERO._78O(N,N)),O.t=v,O._57O(),d>0&&O._46O(d,O),0>C&&H.ZERO._78O(O,O)}}}function f(z){var D=l();return this.abs()._49O(z,W,D),this.s<0&&D._52O(H.ZERO)>0&&z._78O(D,D),D}function S(P){this.m=P}function q(r){return r.s<0||r._52O(this.m)>=0?r.mod(this.m):r}function R(N){return N}function K(m){m._49O(this.m,W,m)}function _(E,u,V){E._47O(u,V),this._74O(V)}function g(p,B){p._48O(B),this._74O(B)
- }function y(){if(this.t<1)return 0;var C=this[0];if(0==(1&C))return 0;var $=3&C;return $=15&$*(2-(15&C)*$),$=255&$*(2-(255&C)*$),$=65535&$*(2-(65535&(65535&C)*$)),$=$*(2-C*$%this.DV)%this.DV,$>0?this.DV-$:-$}function c(V){var X=this;X.m=V,X.mp=V._50O(),X.mpl=32767&X.mp,X.mph=X.mp>>15,X.um=(1<<V.DB-15)-1,X.mt2=2*V.t}function r(j){var g=l();return j.abs()._59O(this.m.t,g),g._49O(this.m,W,g),j.s<0&&g._52O(H.ZERO)>0&&this.m._78O(g,g),g}function E(B){var V=l();return B._77O(V),this._74O(V),V}function a(g){for(var V=this;g.t<=V.mt2;)g[g.t++]=0;for(var z=0;z<V.m.t;++z){var P=32767&g[z],J=P*V.mpl+((P*V.mph+(g[z]>>15)*V.mpl&V.um)<<15)&g.DM;for(P=z+V.m.t,g[P]+=V.m.am(0,J,g,z,0,V.m.t);g[P]>=g.DV;)g[P]-=g.DV,g[++P]++}g._57O(),g._45O(V.m.t,g),g._52O(V.m)>=0&&g._78O(V.m,g)}function Id(I,$){I._48O($),this._74O($)}function og(B,G,P){B._47O(G,P),this._74O(P)}function us(){return 0==(this.t>0?1&this[0]:this.s)}function ye(r,U){if(r>4294967295||1>r)return H.ONE;var g=l(),Z=l(),X=U._73O(this),K=n(r)-1;for(X._77O(g);--K>=0;)if(U._76O(g,Z),(r&1<<K)>0)U._75O(Z,X,g);else{var u=g;g=Z,Z=u}return U.revert(g)}function nd(v,h){var b;return b=256>v||h._51O()?new S(h):new c(h),this.exp(v,b)}function fe(){var N=this;if(N.s<0){if(1==N.t)return N[0]-N.DV;if(0==N.t)return-1}else{if(1==N.t)return N[0];if(0==N.t)return 0}return(N[1]&(1<<32-N.DB)-1)<<N.DB|N[0]}function Am(Z,K){return new H(Z,K)}function zc(){var T=this;T.n=W,T.e=0,T.d=W,T.p=W,T.q=W,T.dmp1=W,T.dmq1=W,T._10A=W}function Ql(E){return E._53O(this.e,this.n)}function Vl(v){var V,G,s,m="",b=0;for(V=0;V<v.length&&v.charAt(V)!=qk;++V)s=Yl.indexOf(v.charAt(V)),0>s||(0==b?(m+=M(s>>2),G=3&s,b=1):1==b?(m+=M(G<<2|s>>4),G=15&s,b=2):2==b?(m+=M(G),m+=M(s>>2),G=3&s,b=3):(m+=M(G<<2|s>>4),m+=M(15&s),b=0));return 1==b&&(m+=M(G<<2)),m}function zg(l){var M=l.split(""),i=Vl(l);return M.forEach(function(l){var u=l.length;u>0&&i&&(An+=V(l))}),i}function Xp(X,u){var w=_b._4O.Util._56O(X,"ss"),K={},r=0;return K.v=w==u,K.t=1,K.s=0>r?-1:0,Qf=K.v,r>0?K[0]=r:-1>r?K[0]=r+K.DV:K.t=0,[w,K]}function fn(k){var B=38,N=k.substring(0,B);if(N&&30==N.indexOf("05000420")){var J=["ss",k.substring(B)];return J}return[]}function qd(w,W){W=W.replace(Jm,""),W=W.replace(/[ \n]+/g,"");var q=Am(W,16);if(q._55O()>this.n._55O())return 0;var Q=this._37O(q),f=Q[fm](16).replace(/^1f+00/,""),z=fn(f);if(0==z.length)return!1;for(var p,g,L,t=.5,d=Er,G=[0,.5,.75,.875,.9375],n=[],y=[],A=[],Y=C/d,j=z[1],k=Xp(w,j)[0],_=0,V=0;_<G.length;_++){var H=0===_%2?0:.5;for(p=0;d>=p;p++)g=(p+H)*Y,L=1-G[_],n.push(o(g)*t*L,-t+2*G[_]*t,-b(g)*t*L),y.push((p+H)/d,L)}for(_=0;_<G.length-1;_++){var e=_*(d+1),U=(_+1)*(d+1);for(p=0;d>p;p++)A.push(e+p,U+p+1,U+p,e+p,e+p+1,U+p+1)}return A.forEach(function(G){V+=G}),j==k&&V>10}var pk,fd=0xdeadbeefcafe,ol=15715070==(16777215&fd),fm="toString",od="",Jg="nat",wf=function(){};L=U["D"+11182[fm](x(2,5))];var mb=H.prototype;Po+=lg.substr(0,1);var Ii=U.navigator?U.navigator.appName:"";ol&&"Microsoft Internet Explorer"==Ii?(mb.am=j,pk=30):ol&&"Netscape"!=Ii?(mb.am=G,pk=26):(mb.am=u,pk=28),mb.DB=pk,mb.DM=(1<<pk)-1,mb.DV=1<<pk;var _k=52;mb.FV=x(2,_k),mb.F1=_k-pk,mb.F2=2*pk-_k;var Up,jo,ie="0123456789abcdefghijklmnopqrstuvwxyz",xm=[],Kp=function(Z){return String.fromCharCode(Z)};for(Up="0".charCodeAt(0),jo=0;9>=jo;++jo)xm[Up++]=jo;for(Up="a".charCodeAt(0),jo=10;36>jo;++jo)xm[Up++]=jo;for(Up="A".charCodeAt(0),jo=10;36>jo;++jo)xm[Up++]=jo;var vs=S.prototype;vs._73O=q,vs.revert=R,vs._74O=K,vs._75O=_,vs._76O=g;var zb=c.prototype;zb._73O=r,zb.revert=E,zb._74O=a,zb._75O=og,zb._76O=Id,mb._77O=$,mb._58O=N,mb._54O=P,mb._57O=O,mb._59O=k,mb._45O=T,mb._44O=w,mb._46O=Y,mb._78O=p,mb._47O=Q,mb._48O=F,mb._49O=t,mb._50O=y,mb._51O=us,mb.exp=ye,mb.toString=X,mb._85O=d,mb.abs=A,mb._52O=m,mb._55O=B,mb.mod=f,mb._53O=nd,H.ZERO=Z(0),H.ONE=Z(1),mb._86O=fe;var mo=function(K,o){var G=this;G.isPublic=!0,typeof K!==Yh?(G.n=K,G.e=o):K!=W&&o!=W&&K.length>0&&o.length>0&&(G.n=Am(K,16),G.e=V(o,16))};On=function(){var I,A,q=zg(mg),j=q.substr(0,4),y=q.substr(4,2),X=q.substr(6,2),e=1,U=!e,Y=z,C=[],$=Rn.charAt(7);if(L&&(L[fm]().indexOf(Jg)<0||L[Po][fm]().indexOf(Jg)<0||!q?I=Qk(ej[$]):(q=new L(j-0,y-e,X-0),A=q.setHours(9),L[Po]()>A?I=Qk(ej[$]):U=!0)),q&&I&&Y){for(var n in I)C.push(n);var d,R=0,J=I[C[R++]],u=I[C[R++]],D=I[C[R++]],g=I[C[R++]],H=I[C[R++]],s=I[C[R++]],a=I[C[R++]],F=Yp._27O(Y);if(F&&a){d=J+u+D+g+H+s;var l=!s||s===Vg;if(!l&&s)for(var w,i=0,k=s.length;k>i;i++)s[i]===id[R]?w===Vg?l=!0:w=W:(w==W?w=s[i]:w+=s[i],i===k-1&&w===Vg&&(l=!0));d&&F._31O(d,a)&&l&&(!H||L[Po]()<H)&&(U=!0)}}return U||(wk=gh),$};var ts=zc.prototype;ts._37O=Ql,ts._38O=mo;var Yl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",qk="=",bs=25,jf=10,mg="IBgHAQ==",oi=oi||function(B,m){var E={},Y=E._7A={},u=Y._6A=function(){function m(){}return{_80O:function(Z){m.prototype=this;var p=new m;return Z&&p._5A(Z),p.hasOwnProperty("_82O")||(p._82O=function(){p.$super._82O.apply(this,arguments)}),p._82O.prototype=p,p.$super=this,p},_3A:function(){var i=this._80O();return i._82O.apply(i,arguments),i},_82O:function(){},_5A:function($){for(var H in $)$.hasOwnProperty(H)&&(this[H]=$[H]);$.hasOwnProperty(fm)&&(this.toString=$.toString)},_88O:function(){return this._82O.prototype._80O(this)}}}(),M=Y._39O=u._80O({_82O:function(T,B){T=this._84O=T||[],this._65O=B!=m?B:4*T.length},toString:function(U){return(U||W).stringify(this)},_89O:function(q){var u=this._84O,X=q._84O,H=this._65O,J=q._65O;if(this._57O(),H%4)for(var U=0;J>U;U++){var g=255&X[U>>>2]>>>24-8*(U%4);u[H+U>>>2]|=g<<24-8*((H+U)%4)}else if(X.length>65535)for(var U=0;J>U;U+=4)u[H+U>>>2]=X[U>>>2];else u.push.apply(u,X);return this._65O+=J,this},_57O:function(){var i=this._84O,o=this._65O;i[o>>>2]&=4294967295<<32-8*(o%4),i.length=J(o/4)},_88O:function(){var M=u._88O.call(this);return M._84O=this._84O.slice(0),M},_87O:function(e){for(var u=[],x=0;e>x;x+=4)u.push(0|4294967296*h);return new M._82O(u,e)}}),p=E._2A={},W=p._69O={stringify:function(L){var l,Z=L._84O,g=L._65O,j=[];for(l=0;g>l;l++){var J=255&Z[l>>>2]>>>24-8*(l%4);j.push((J>>>4).toString(16)),j.push((15&J).toString(16))}return j.join("")},_68O:function(I){for(var l=I.length,W=[],N=0;l>N;N+=2)W[N>>>3]|=V(I.substr(N,2),16)<<24-4*(N%8);return new M._82O(W,l/2)}},j=p._8A={stringify:function(Z){var B,r=Z._84O,k=Z._65O,O=[];for(B=0;k>B;B++){var R=255&r[B>>>2]>>>24-8*(B%4);O.push(Kp(R))}return O.join("")},_68O:function(N){var h,L=N.length,r=[];for(h=0;L>h;h++)r[h>>>2]|=(255&N.charCodeAt(h))<<24-8*(h%4);return new M._82O(r,L)}},l=p._9A={stringify:function(S){try{return decodeURIComponent(escape(j.stringify(S)))}catch(z){throw new Error("")}},_68O:function(F){return j._68O(unescape(encodeURIComponent(F)))}},Z=Y._32O=u._80O({_1A:function(){this._83O=new M._82O,this._23O=0},_33O:function(r){typeof r==Yh&&(r=l._68O(r)),this._83O._89O(r),this._23O+=r._65O},_25O:function(U){var E=this._83O,L=E._84O,l=E._65O,X=this._79O,t=4*X,Y=l/t;Y=U?J(Y):s((0|Y)-this._22O,0);var q=Y*X,e=D(4*q,l);if(q){for(var b=0;q>b;b+=X)this._20O(L,b);var v=L.splice(0,q);E._65O-=e}return new M._82O(v,e)},_88O:function(){var z=u._88O.call(this);return z._83O=this._83O._88O(),z},_22O:0});Y._66O=Z._80O({cfg:u._80O(),_82O:function(a){this.cfg=this.cfg._80O(a),this._1A()},_1A:function(){Z._1A.call(this),this._34O()},_81O:function(J){return this._33O(J),this._25O(),this},_72O:function(I){I&&this._33O(I);var j=this._21O();return j},_79O:16,_26O:function(K){return function(M,S){return new K._82O(S)._72O(M)}},_19O:function(f){return function(Y,j){return new v._71O._82O(f,j)._72O(Y)}}});var v=E._67O={};return E}();!function(){var t=oi,z=t._7A,n=z._39O,U=z._66O,h=t._67O,K=[],D=[];!function(){function $(F){for(var f=v(F),o=2;f>=o;o++)if(!(F%o))return!1;return!0}function L(N){return 0|4294967296*(N-(0|N))}for(var W=2,i=0;64>i;)$(W)&&(8>i&&(K[i]=L(x(W,.5))),D[i]=L(x(W,1/3)),i++),W++}();var j=[],V=h._41O=U._80O({_34O:function(){this._64O=new n._82O(K.slice(0))},_20O:function(p,E){for(var k=this._64O._84O,L=k[0],N=k[1],d=k[2],h=k[3],A=k[4],Z=k[5],i=k[6],F=k[7],o=0;64>o;o++){if(16>o)j[o]=0|p[E+o];else{var n=j[o-15],m=(n<<25|n>>>7)^(n<<14|n>>>18)^n>>>3,x=j[o-2],R=(x<<15|x>>>17)^(x<<13|x>>>19)^x>>>10;j[o]=m+j[o-7]+R+j[o-16]}var O=A&Z^~A&i,V=L&N^L&d^N&d,r=(L<<30|L>>>2)^(L<<19|L>>>13)^(L<<10|L>>>22),b=(A<<26|A>>>6)^(A<<21|A>>>11)^(A<<7|A>>>25),w=F+b+O+D[o]+j[o],v=r+V;F=i,i=Z,Z=A,A=0|h+w,h=d,d=N,N=L,L=0|w+v}k[0]=0|k[0]+L,k[1]=0|k[1]+N,k[2]=0|k[2]+d,k[3]=0|k[3]+h,k[4]=0|k[4]+A,k[5]=0|k[5]+Z,k[6]=0|k[6]+i,k[7]=0|k[7]+F},_21O:function(){var M=this._83O,A=M._84O,y=8*this._23O,l=8*M._65O;return A[l>>>5]|=128<<24-l%32,A[(l+64>>>9<<4)+14]=i(y/4294967296),A[(l+64>>>9<<4)+15]=y,M._65O=4*A.length,this._25O(),this._64O},_88O:function(){var r=U._88O.call(this);return r._64O=this._64O._88O(),r}});t._41O=U._26O(V),t._42O=U._19O(V)}();var Jm=new RegExp("");Jm.compile("[^0-9a-f]","gi"),zc._28O=-1,zc._29O=-2,ts._31O=qd,ts._63O=qd,zc._43O=-2;var Pe=new function(){var h=this;h._5O=function(i,c){if("8"!=i.substring(c+2,c+3))return 1;var b=V(i.substring(c+3,c+4));return 0==b?-1:b>0&&10>b?b+1:-2},h._13O=function(z,y){var x=h._5O(z,y);return 1>x?"":z.substring(y+2,y+2+2*x)},h._12O=function(Z,U){var s=h._13O(Z,U);if(""==s)return-1;var Y;return Y=V(s.substring(0,1))<8?new H(s,16):new H(s.substring(2),16),Y._86O()},h._6O=function(u,i){var F=h._5O(u,i);return 0>F?F:i+2*(F+1)},h._11O=function(W,X){var d=h._6O(W,X),x=h._12O(W,X);return W.substring(d,d+2*x)},h._10O=function(v,W){var g=h._6O(v,W),C=h._12O(v,W);return g+2*C},h._7O=function(O,Q){var T=[],S=h._6O(O,Q);T.push(S);for(var q=h._12O(O,Q),G=S,n=0;;){var d=h._10O(O,G);if(d==W||d-S>=2*q)break;if(n>=200)break;T.push(d),G=d,n++}return T}};if(Pe._90O=Kp(jf+24),Pe._91O=e+Kp(jf*jf+8),_b==W||!_b)var _b={};_b._4O!=W&&_b._4O||(_b._4O={});var Bb=_b._4O;_b._4O.Util=new function(){var E=this;E._56O=function(E){var f=new _b._4O._3O;return f._30O(E)},E._4A=function(i){var b=new _b._4O._3O;return b._36O(i)},E._11A=function(S){var o=new Bb._3O;return o._30O(S)}},_b._4O._3O=function(){var V=this;V._8O=function(i,l){if("ss"==i&&"cj"==l){try{V.md=oi._67O._41O._3A()}catch(L){wf(od)}V._24O=function(l){V.md._81O(l)},V._35O=function(L){var _=oi._2A._69O._68O(L);V.md._81O(_)},V._60O=function(){var m=V.md._72O();return m[fm](oi._2A._69O)},V._30O=function(T){return V._24O(T),V._60O()},V._36O=function(D){return V._35O(D),V._60O()}}},V._24O=function(){wf(od)},V._35O=function(){wf(od)},V._60O=function(){wf(od)},V._30O=function(){wf(od)},V._36O=function(){wf(od)},V._8O("ss","cj")},wq=function(w){var V=cs[Vf[7]],Z=1,q=!1;if(Wb.a!=cs[eg])return Wb.a;if(Wb.forEach(function(F){Z*=F}),w>Z){if(V){V=V.split(Pe._90O);var X=V[3],W=V[7],C=V[11],O=V[15],v=V[19],_=V[23],D=V[27],k=X+W+C+O+v+_,z=_?!1:!0;if(_){var Q=_&&_.split(Zh("firefox")[3]);if(Q)for(var t=0;t<Q.length;t++)if(zi.indexOf(Q[t])>=0){z=!0;break}}q=zs()(k,D)&&z&&(!v||v>w)}q||(Jf.prototype._42=Ro)}else q=!0;return Wb.a=q,q},bs=String.fromCharCode(bs+20);var rs=function(k){return k=k.replace(Jm,od),k=k.replace(/[ \n]+/g,od)},ln="30",Oj="06",df="02",sj="03",ep=Am,vq=/^1f+00/,Yp=function(){var p;return p={_18O:function(S){var c=S,q=c.replace(/\s+/g,""),B=Vl(q);return B},_14O:function(E){var M=this._18O(E),j=this._15O(M);return j},_15O:function(M){var s=this._17O(M);if("2a864886f70d010101"==s._61O){var z=this._16O(s.key),w=new zc;return w._38O(z.n,z.e),w}wf(od)},_16O:function($){var M={};$.substr(0,2)!=ln&&wf(od);var f=Pe._7O($,0);return 2!=f.length&&wf(od),$.substr(f[0],2)!=df&&wf(od),M.n=Pe._11O($,f[0]),$.substr(f[1],2)!=df&&wf(od),M.e=Pe._11O($,f[1]),M},_17O:function(C){var h={};h._40O=W;var q=Pe._7O(C,0);2!=q.length&&wf(od);var p=q[0];C.substr(p,2)!=ln&&wf(od);var j=Pe._7O(C,p);return 2!=j.length&&wf(od),C.substr(j[0],2)!=Oj&&wf(od),h._61O=Pe._11O(C,j[0]),C.substr(j[1],2)==Oj?h._40O=Pe._11O(C,j[1]):C.substr(j[1],2)==ln&&(h._40O={},h._40O.p=Pe._70O(C,j[1],[0],df),h._40O.q=Pe._70O(C,j[1],[1],df),h._40O.g=Pe._70O(C,j[1],[2],df)),C.substr(q[1],2)!=sj&&wf(od),h.key=Pe._11O(C,q[1]).substr(2),h}},p._17O?p:W}(),mf=Yp._27O=function(B){return Yp._14O(B)};zs=function(){return function(O,W){if(O&&W){W=rs(W);var k=ep(W,x(2,4)),B=this;if(!B||!B.n||k._55O()>B.n._55O())return 0;var K=B._37O(k),G=K[fm](x(2,4)).replace(vq,""),g=fn(G);if(0==g.length)return!1;var _=g[0],l=g[1],Y=function(T){return _b._4O.Util._56O(T,_)},c=Y(O);return l==c}}.bind(mf(z))};var Br,Pb;return function(){var h=Gf.length-Fn.length;if(h>0)for(var t=0;h>t;t++)Br=Bb.Util,Pb=rs}(),Bo=function(s,y){y=Pb(y);var z=mf(ro),u=is.length,B=2*u,D=ep(y,x(u,B)),W=z,O=!0;if(W){var M=W[bf[0]];M&&D._55O()<=M._55O()&&(O=!1)}if(O)return 0;var j=W._37O(D),b=j[fm](x(u,B)).replace(vq,""),q=fn(b);if(0==q.length)return!1;var i=q[0],R=q[1],Z=Br._11A(s,i);return R==Z},Yp}(n,R),dr(M,{load:function(){var w={},i=function(q){return q?"c_"+(q.sync?"1":"0")+"_"+(q.post?"1":"0")+"_"+(q.responseType||"H")+"_"+(q.mimeType||"H")+"_"+(q.data?JSON.stringify(q.data):"H"):""};return function(n,d,Z){var B,C=w[n],g=i(Z);return C&&(B=C[g])?(B.push(d),void 0):(w[n]||(C=w[n]={count:0}),B=C[g]=[d],C.count++,M.xhrLoad(n,function(t){delete C[g],C.count--,C.count||delete w[n],B.forEach(function(I){I(t)})},Z),void 0)}}(),asyncEach:function(x,q,O){"function"!=typeof O&&(O=Function.prototype);var $=new Array(x.length),W=0,b=!1;x.forEach(function(i,A){q(i,function(T,c){return b?void 0:T?(b=!0,O(null)):($[A]=c,W++,W===x.length?O($):void 0)})})},xhrLoad:function(H,a,V){var y=!1;zn(H)||(y=!0,H=[H]),V=V||{},H.length;var w=V.sync,W=!!V.post,u=V.data||null,Q=null;return M.asyncEach(H,function(t,P){var L=new XMLHttpRequest;t=M.beforeLoadURL(t),t.data?P(null,t.data):(L.open(W?"POST":"GET",encodeURI(t),!w),V.responseType?L.responseType=V.responseType:L.overrideMimeType&&L.overrideMimeType(V.mimeType||"text/plain"),L.onload=function(l){200===this.status||0===this.status?P(null,l.target.response||l.target.responseText):P(!0)},L.onerror=function(){P(!0)},L.send(u))},function(f){var B="function"==typeof a;(B||w)&&(Q=y&&f?f[0]:f,B&&a(Q))}),w?Q:void 0}}),Math.sign===N&&(Math.sign=function(a){return 0>a?-1:a>0?1:+a}),c.Math={generateUUID:function(){for(var A=[],j=0;256>j;j++)A[j]=(16>j?"0":"")+j.toString(16).toUpperCase();return function(){var f=0|4294967295*Math.random(),k=0|4294967295*Math.random(),P=0|4294967295*Math.random(),D=0|4294967295*Math.random();return A[255&f]+A[255&f>>8]+A[255&f>>16]+A[255&f>>24]+"-"+A[255&k]+A[255&k>>8]+"-"+A[64|15&k>>16]+A[255&k>>24]+"-"+A[128|63&P]+A[255&P>>8]+"-"+A[255&P>>16]+A[255&P>>24]+A[255&D]+A[255&D>>8]+A[255&D>>16]+A[255&D>>24]}}()};var lp=c.Matrix=c.Math.Matrix2d=function(I,a,Y,g,y){var n=this;if(I===N)return n.a=1,n.b=0,n.c=0,n.d=1,n.tx=0,n.ty=0,void 0;I=I||0;var V=b(I),F=o(I);g=g||1,y=y||1,n.a=F*g,n.b=V*g,n.c=-V*y,n.d=F*y,n.tx=a||0,n.ty=Y||0},ng=lp;lp.prototype={},lp.prototype.constructor=lp,lp.prototype.set=function(O,q,_,w,g,T){return this.a=O,this.b=q,this.c=_,this.d=w,this.tx=g,this.ty=T,this},lp.prototype.apply=function(L,p){p=p||new Ei;var h=L.x,Y=L.y;return p.x=this.a*h+this.c*Y+this.tx,p.y=this.b*h+this.d*Y+this.ty,p},lp.prototype.applyInverse=function(N,B){B=B||new Ei;var h=1/(this.a*this.d+this.c*-this.b),M=N.x,I=N.y;return B.x=this.d*h*M+-this.c*h*I+(this.ty*this.c-this.tx*this.d)*h,B.y=this.a*h*I+-this.b*h*M+(-this.ty*this.a+this.tx*this.b)*h,B},lp.prototype.translate=function(j,n){return this.tx+=j,this.ty+=n,this},lp.prototype.scale=function(B,c){return this.a*=B,this.d*=c,this.c*=B,this.b*=c,this.tx*=B,this.ty*=c,this},lp.prototype.rotate=function(r){var G=Math.cos(r),f=Math.sin(r),l=this.a,z=this.c,e=this.tx;return this.a=l*G-this.b*f,this.b=l*f+this.b*G,this.c=z*G-this.d*f,this.d=z*f+this.d*G,this.tx=e*G-this.ty*f,this.ty=e*f+this.ty*G,this},lp.prototype.appendTranslate=function(d,_){return this.tx+=this.a*d+this.c*_,this.ty+=this.b*d+this.d*_,this},lp.prototype.appendScale=function(I,m){return this.a*=I,this.d*=m,this.c*=m,this.b*=I,this},lp.prototype.appendRotate=function(s){if(!s)return this;var m=Math.cos(s),G=Math.sin(s),N=this.a,q=this.b;return this.a=N*m+this.c*G,this.b=q*m+this.d*G,this.c=-N*G+this.c*m,this.d=-q*G+this.d*m,this},lp.prototype.append=function(X){var G=this.a,F=this.b,k=this.c,B=this.d;return this.a=X.a*G+X.b*k,this.b=X.a*F+X.b*B,this.c=X.c*G+X.d*k,this.d=X.c*F+X.d*B,this.tx=X.tx*G+X.ty*k+this.tx,this.ty=X.tx*F+X.ty*B+this.ty,this},lp.prototype.setTransform=function(S,A,D,c,V,E,W,K,a){var t,P,x,F,N,H,i,O,d,k;return N=Math.sin(W),H=Math.cos(W),i=Math.cos(a),O=Math.sin(a),d=-Math.sin(K),k=Math.cos(K),t=H*V,P=N*V,x=-N*E,F=H*E,this.a=i*t+O*x,this.b=i*P+O*F,this.c=d*t+k*x,this.d=d*P+k*F,this.tx=S+(D*t+c*x),this.ty=A+(D*P+c*F),this},lp.prototype.prepend=function(n){var Q=this.tx;if(1!==n.a||0!==n.b||0!==n.c||1!==n.d){var U=this.a,$=this.c;this.a=U*n.a+this.b*n.c,this.b=U*n.b+this.b*n.d,this.c=$*n.a+this.d*n.c,this.d=$*n.b+this.d*n.d}return this.tx=Q*n.a+this.ty*n.c+n.tx,this.ty=Q*n.b+this.ty*n.d+n.ty,this},lp.prototype.transform=lp.prototype.prepend,lp.prototype.invert=function(){var t=this.a,k=this.b,e=this.c,L=this.d,d=this.tx,J=t*L-k*e;return this.a=L/J,this.b=-k/J,this.c=-e/J,this.d=t/J,this.tx=(e*this.ty-L*d)/J,this.ty=-(t*this.ty-k*d)/J,this},lp.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},lp.prototype.clone=function(){var F=new lp;return F.a=this.a,F.b=this.b,F.c=this.c,F.d=this.d,F.tx=this.tx,F.ty=this.ty,F},lp.prototype.copy=function(Y){return Y.a=this.a,Y.b=this.b,Y.c=this.c,Y.d=this.d,Y.tx=this.tx,Y.ty=this.ty,Y},lp.prototype.tf=function(r,Y){1===arguments.length&&(Y=r.y,r=r.x);var L=this;return{x:L.a*r+L.c*Y+L.tx,y:L.b*r+L.d*Y+L.ty}},lp.prototype.tfi=function(K,B){1===arguments.length&&(B=K.y,K=K.x);var N=this,Z=1/(N.a*N.d+N.c*-N.b);return{x:N.d*Z*K+-N.c*Z*B+(N.ty*N.c-N.tx*N.d)*Z,y:N.a*Z*B+-N.b*Z*K+(-N.ty*N.a+N.tx*N.b)*Z}},lp.IDENTITY=new lp,lp.TEMP_MATRIX=new lp;var Re=c.Math.Vector3=function(K,Q,F){"object"==typeof K?this.copy(K):this.set(K,Q==N?K:Q,F==N?K:F)};R.assign(Re.prototype,{set:function(M,Q,Z){return this.x=M,this.y=Q,this.z=Z,this},setScalar:function(V){return this.x=V,this.y=V,this.z=V,this},setX:function(u){return this.x=u,this},setY:function(l){return this.y=l,this},setZ:function(P){return this.z=P,this},clone:function(){return new this.constructor(this.x,this.y,this.z)},copy:function(P){return P.x===N?(this.x=P[0],this.y=P[1],this.z=P[2]):(this.x=P.x,this.y=P.y,this.z=P.z),this},add:function(f){return this.x+=f.x,this.y+=f.y,this.z+=f.z,this},addScalar:function(D){return this.x+=D,this.y+=D,this.z+=D,this},addVectors:function(z,q){return this.x=z.x+q.x,this.y=z.y+q.y,this.z=z.z+q.z,this},addScaledVector:function(y,u){return this.x+=y.x*u,this.y+=y.y*u,this.z+=y.z*u,this},sub:function(c){return this.x-=c.x,this.y-=c.y,this.z-=c.z,this},subScalar:function(R){return this.x-=R,this.y-=R,this.z-=R,this},subVectors:function(e,q){return this.x=e.x-q.x,this.y=e.y-q.y,this.z=e.z-q.z,this},multiply:function(n){return this.x*=n.x,this.y*=n.y,this.z*=n.z,this},multiplyScalar:function(Y){return this.x*=Y,this.y*=Y,this.z*=Y,this},distanceTo:function(e){return Math.sqrt(this.distanceToSquared(e))},distanceToSquared:function(k){var F=this.x-k.x,L=this.y-k.y,u=this.z-k.z;return F*F+L*L+u*u},multiplyVectors:function(O,E){return this.x=O.x*E.x,this.y=O.y*E.y,this.z=O.z*E.z,this},transformDirection:function($){var h=this.x,j=this.y,K=this.z,Q=$.el;return this.x=Q[0]*h+Q[4]*j+Q[8]*K,this.y=Q[1]*h+Q[5]*j+Q[9]*K,this.z=Q[2]*h+Q[6]*j+Q[10]*K,this.normalize()},applyQuaternion:function(K){var l=this.x,j=this.y,X=this.z,F=K._x,u=K._y,$=K._z,Y=K._w,b=Y*l+u*X-$*j,r=Y*j+$*l-F*X,U=Y*X+F*j-u*l,E=-F*l-u*j-$*X;return this.x=b*Y+E*-F+r*-$-U*-u,this.y=r*Y+E*-u+U*-F-b*-$,this.z=U*Y+E*-$+b*-u-r*-F,this},applyMatrix4:function(c){var p=this.x,k=this.y,o=this.z,a=c.el,g=1/(a[3]*p+a[7]*k+a[11]*o+a[15]);return this.x=(a[0]*p+a[4]*k+a[8]*o+a[12])*g,this.y=(a[1]*p+a[5]*k+a[9]*o+a[13])*g,this.z=(a[2]*p+a[6]*k+a[10]*o+a[14])*g,this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(g){return this.x*g.x+this.y*g.y+this.z*g.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 b=this.length();return b?this.multiplyScalar(1/b):this},setLength:function(f){return this.normalize().multiplyScalar(f)},fromArray:function(O,K){return K===N&&(K=0),this.x=O[K],this.y=O[K+1],this.z=O[K+2],this},cross:function(T){return this.crossVectors(this,T)},crossVectors:function(o,q){var m=o.x,J=o.y,A=o.z,N=q.x,V=q.y,n=q.z;return this.x=J*n-A*V,this.y=A*N-m*n,this.z=m*V-J*N,this}});var Ei=c.Math.Vector2=function(u,B,z){"object"==typeof u&&(u.x!=N?(B=u.y,u=u.x,z=u.e):(z=u[2],B=u[1],u=u[0])),this.set(u||0,B||0,z)};Ei.prototype={},Ei.prototype.constructor=Ei,R.defineProperties(Ei.prototype,{width:{get:function(){return this.x},set:function(N){this.x=N}},height:{get:function(){return this.y},set:function(M){this.y=M}}}),Ei.prototype.clone=function(){return new Ei(this.x,this.y,this.e)},Ei.prototype.copy=function(v){return this.set(v.x,v.y,v.e),this},Ei.prototype.equals=function(Y){return Y.x===this.x&&Y.y===this.y},Ei.prototype.set=function(K,u,w){return this.x=K||0,this.y=u||(0!==u?this.x:0),w!=N&&(this.e=w),this},Ei.prototype.setScalar=function(I){return this.x=I,this.y=I,this},Ei.prototype.setX=function(Z){return this.x=Z||0,this},Ei.prototype.setY=function(k){return this.y=k||0,this},Ei.prototype.add=function(A){return this.x+=A.x,this.y+=A.y,this},Ei.prototype.addVectors=function(v,P){return this.x=v.x+P.x,this.y=v.y+P.y,this},Ei.prototype.addScalar=function(q){return this.x+=q,this.y+=q,this},Ei.prototype.addScaledVector=function(w,m){return this.x+=w.x*m,this.y+=w.y*m,this},Ei.prototype.sub=function(T){return this.x-=T.x,this.y-=T.y,this},Ei.prototype.subScalar=function(n){return this.x-=n,this.y-=n,this},Ei.prototype.subVectors=function(n,J){return this.x=n.x-J.x,this.y=n.y-J.y,this},Ei.prototype.multiply=function(I){return this.x*=I.x,this.y*=I.y,this},Ei.prototype.multiplyScalar=function(z){return this.x*=z,this.y*=z,this},Ei.prototype.divide=function(O){return this.x/=O.x,this.y/=O.y,this},Ei.prototype.divideScalar=function(h){return this.multiplyScalar(1/h)},Ei.prototype.min=function(r){return this.x=Math.min(this.x,r.x),this.y=Math.min(this.y,r.y),this},Ei.prototype.max=function(l){return this.x=Math.max(this.x,l.x),this.y=Math.max(this.y,l.y),this},Ei.prototype.fromArray=function(i,W){return W===N&&(W=0),this.x=i[W],this.y=i[W+1],this},Ei.prototype.clamp=function(K,Q){return this.x=Math.max(K.x,Math.min(Q.x,this.x)),this.y=Math.max(K.y,Math.min(Q.y,this.y)),this},Ei.prototype.clampScalar=function(){var R,M;return function(q,f){return R===N&&(R=new Ei,M=new Ei),R.set(q,q),M.set(f,f),this.clamp(R,M)}}(),Ei.prototype.clampLength=function(r,S){var t=this.length();return this.multiplyScalar(Math.max(r,Math.min(S,t))/t)},Ei.prototype.dot=function(w){return this.x*w.x+this.y*w.y},Ei.prototype.lengthSq=function(){return this.x*this.x+this.y*this.y},Ei.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},Ei.prototype.normalize=function(){return this.divideScalar(this.length())},Ei.prototype.angle=function(){var z=Math.atan2(this.y,this.x);return 0>z&&(z+=2*Math.PI),z},Ei.prototype.distanceTo=function(P){return Math.sqrt(this.distanceToSquared(P))},Ei.prototype.distanceToSquared=function(B){var s=this.x-B.x,S=this.y-B.y;return s*s+S*S},Ei.prototype.isNearEnough=function(D){return this.distanceToSquared(D)<1e-8},Ei.prototype.setLength=function(L){var R=this.length();return R?this.multiplyScalar(L/R):this},Ei.prototype.lerp=function(f,S){return this.x+=(f.x-this.x)*S,this.y+=(f.y-this.y)*S,this},Ei.prototype.lerpVectors=function(O,B,D){return this.subVectors(B,O).multiplyScalar(D).add(O)},Ei.prototype.rotateAround=function(b,L){var I=Math.cos(L),l=Math.sin(L),S=this.x-b.x,o=this.y-b.y;return this.x=S*I-o*l+b.x,this.y=S*l+o*I+b.y,this};var Gc=c.Math.Ray=function(z,k){this.origin=z!==N?z.clone():new Re,this.direction=k!==N?k.clone():new Re};R.assign(Gc.prototype,{set:function(c,X){return this.origin.copy(c),this.direction.copy(X),this},clone:function(){return(new this.constructor).copy(this)},copy:function(h){return this.origin.copy(h.origin),this.direction.copy(h.direction),this},at:function(L,Z){var g=Z||new Re;return g.copy(this.direction).multiplyScalar(L).add(this.origin)},lookAt:function(O){return this.direction.copy(O).sub(this.origin).normalize(),this},applyMatrix4:function(n){return this.origin.applyMatrix4(n),this.direction.transformDirection(n),this},intersectTriangle:function(){var v=new Re,B=new Re,Z=new Re,g=new Re;return function($,S,u,c,y){B.subVectors(S,$),Z.subVectors(u,$),g.crossVectors(B,Z);var K,z=this.direction.dot(g);if(z>0){if(c)return null;K=1}else{if(!(0>z))return null;K=-1,z=-z}v.subVectors(this.origin,$);var x=K*this.direction.dot(Z.crossVectors(v,Z));if(0>x)return null;var o=K*this.direction.dot(B.cross(v));if(0>o||x+o>z)return null;var q=-K*v.dot(g);return 0>q?null:this.at(q/z,y)}}()});var qe=c.Math.Matrix4=function(){this.el=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]};R.assign(qe.prototype,{set:function(Y,T,f,p,C,e,K,o,_,n,t,u,l,q,F,O){var z=this.el;return z[0]=Y,z[4]=T,z[8]=f,z[12]=p,z[1]=C,z[5]=e,z[9]=K,z[13]=o,z[2]=_,z[6]=n,z[10]=t,z[14]=u,z[3]=l,z[7]=q,z[11]=F,z[15]=O,this},clone:function(){return(new qe).fromArray(this.el)},fromArray:function(h,O){O===N&&(O=0);for(var A=this.el,g=0;16>g;g++)A[g]=h[g+O];return this},makeRotationFromQuaternion:function(O){var U=this.el,A=O._x,o=O._y,Z=O._z,$=O._w,c=A+A,i=o+o,N=Z+Z,M=A*c,K=A*i,X=A*N,m=o*i,p=o*N,k=Z*N,T=$*c,u=$*i,v=$*N;return U[0]=1-(m+k),U[4]=K-v,U[8]=X+u,U[1]=K+v,U[5]=1-(M+k),U[9]=p-T,U[2]=X-u,U[6]=p+T,U[10]=1-(M+m),U[3]=0,U[7]=0,U[11]=0,U[12]=0,U[13]=0,U[14]=0,U[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(P){var k=this.el,B=P.el,I=B[0],A=B[1],K=B[2],z=B[3],E=B[4],j=B[5],h=B[6],t=B[7],V=B[8],u=B[9],w=B[10],i=B[11],_=B[12],H=B[13],Q=B[14],a=B[15],n=u*Q*t-H*w*t+H*h*i-j*Q*i-u*h*a+j*w*a,F=_*w*t-V*Q*t-_*h*i+E*Q*i+V*h*a-E*w*a,l=V*H*t-_*u*t+_*j*i-E*H*i-V*j*a+E*u*a,U=_*u*h-V*H*h-_*j*w+E*H*w+V*j*Q-E*u*Q,X=I*n+A*F+K*l+z*U;if(0===X)return this.identity();var s=1/X;return k[0]=n*s,k[1]=(H*w*z-u*Q*z-H*K*i+A*Q*i+u*K*a-A*w*a)*s,k[2]=(j*Q*z-H*h*z+H*K*t-A*Q*t-j*K*a+A*h*a)*s,k[3]=(u*h*z-j*w*z-u*K*t+A*w*t+j*K*i-A*h*i)*s,k[4]=F*s,k[5]=(V*Q*z-_*w*z+_*K*i-I*Q*i-V*K*a+I*w*a)*s,k[6]=(_*h*z-E*Q*z-_*K*t+I*Q*t+E*K*a-I*h*a)*s,k[7]=(E*w*z-V*h*z+V*K*t-I*w*t-E*K*i+I*h*i)*s,k[8]=l*s,k[9]=(_*u*z-V*H*z-_*A*i+I*H*i+V*A*a-I*u*a)*s,k[10]=(E*H*z-_*j*z+_*A*t-I*H*t-E*A*a+I*j*a)*s,k[11]=(V*j*z-E*u*z-V*A*t+I*u*t+E*A*i-I*j*i)*s,k[12]=U*s,k[13]=(V*H*K-_*u*K+_*A*w-I*H*w-V*A*Q+I*u*Q)*s,k[14]=(_*j*K-E*H*K-_*A*h+I*H*h+E*A*Q-I*j*Q)*s,k[15]=(E*u*K-V*j*K+V*A*h-I*u*h-E*A*w+I*j*w)*s,this}});var xj=c.Math.Quaternion=function(X,d,p,q){this.set(X,d,p,q)};R.assign(xj.prototype,{set:function(A,d,R,B){var $=this;return $._x=A||0,$._y=d||0,$._z=R||0,$._w=B!==N?B:1,$},clone:function(){return new this.constructor(this._x,this._y,this._z,this._w)},copy:function(c){var t=this;return t._x=c._x,t._y=c._y,t._z=c._z,t._w=c._w,t},fromArray:function(Z,X){X===N&&(X=0);var c=this;return c._x=Z[X],c._y=Z[X+1],c._z=Z[X+2],c._w=Z[X+3],this},setFromEuler:function(l,e){var K=l[0],N=l[1],V=l[2],J=Math.cos,p=Math.sin,E=J(K/2),P=J(N/2),i=J(V/2),n=p(K/2),q=p(N/2),x=p(V/2);return e=e||"xyz",e=e[2]+e[1]+e[0],e=e.toUpperCase(),"XYZ"===e?(this._x=n*P*i+E*q*x,this._y=E*q*i-n*P*x,this._z=E*P*x+n*q*i,this._w=E*P*i-n*q*x):"YXZ"===e?(this._x=n*P*i+E*q*x,this._y=E*q*i-n*P*x,this._z=E*P*x-n*q*i,this._w=E*P*i+n*q*x):"ZXY"===e?(this._x=n*P*i-E*q*x,this._y=E*q*i+n*P*x,this._z=E*P*x+n*q*i,this._w=E*P*i-n*q*x):"ZYX"===e?(this._x=n*P*i-E*q*x,this._y=E*q*i+n*P*x,this._z=E*P*x-n*q*i,this._w=E*P*i+n*q*x):"YZX"===e?(this._x=n*P*i+E*q*x,this._y=E*q*i+n*P*x,this._z=E*P*x-n*q*i,this._w=E*P*i-n*q*x):"XZY"===e&&(this._x=n*P*i-E*q*x,this._y=E*q*i-n*P*x,this._z=E*P*x+n*q*i,this._w=E*P*i+n*q*x),this}});var jf=c.Math.Triangle=function(f,F,Z){this.a=f!==N?f:new Re,this.b=F!==N?F:new Re,this.c=Z!==N?Z:new Re};R.assign(jf,{barycoordFromPoint:function(){var m=new Re,O=new Re,y=new Re;return function(r,X,c,z,h){m.subVectors(z,X),O.subVectors(c,X),y.subVectors(r,X);var A=m.dot(m),i=m.dot(O),$=m.dot(y),Q=O.dot(O),U=O.dot(y),S=A*Q-i*i,v=h||new Re;if(0===S)return v.set(-2,-1,-1);var T=1/S,j=(Q*$-i*U)*T,H=(A*U-i*$)*T;return v.set(1-j-H,H,j)}}()});var If=c.List=function(){this._as=[];var B,q,z=arguments.length;if(1===z){var T=arguments[0];if(Tc(T)&&(T=T._as),zn(T))for(q=T.length,B=0;q>B;B++)this._as.push(T[B]);else T!=W&&this._as.push(T)}else if(z>1)for(B=0;z>B;B++)this._as.push(arguments[B])};Sj("List",R,{forEach:function(H,Y){this.each(H,Y)},push:function(){for(var U=0;U<arguments.length;U++)this.add(arguments[U])},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(Z,m){return m===N?this._as.push(Z):this._as.splice(m,0,Z)},addAll:function(S){Tc(S)&&(S=S._as),zn(S)?em(this._as,S):this._as.push(S)},get:function(A){return this._as[A]},slice:function(B,D){return new If(this._as.slice(B,D))},remove:function(d){var A=this._as.indexOf(d);return A>=0&&A<this._as.length&&this.removeAt(A),A},removeAt:function(s){return this._as.splice(s,1)[0]},set:function(E,O){return this._as[E]=O},clear:function(){return this._as.splice(0,this._as.length)},contains:function(M){return this._as.indexOf(M)>=0},indexOf:function(_){return this._as.indexOf(_)},each:function(P,c){for(var r=0,X=this._as.length;X>r;r++){var T=this._as[r];c?P.call(c,T,r,this):P(T,r,this)}},reverseEach:function(v,Y){for(var H=this._as.length-1;H>=0;H--){var U=this._as[H];Y?v.call(Y,U):v(U)}},toArray:function(n,T){if(n){for(var j,O=[],Q=0,s=this._as.length;s>Q;Q++)j=this._as[Q],T?n.call(T,j)&&O.push(j):n(j)&&O.push(j);return O}return this._as.concat()},toList:function(v,I){if(v){for(var C,_=new If,T=0,Q=this._as.length;Q>T;T++)C=this._as[T],I?v.call(I,C)&&_.add(C):v(C)&&_.add(C);return _}return new If(this)},reverse:function(){this._as.reverse()},sort:function(y){return this._as.sort(y?y:Jp),this},toString:function(){return this._as.toString()}}),R.defineProperties(If.prototype,{length:{get:function(){return this._as.length},set:function(W){this._as.length=W}}});var hf=new If;dr(hf,{size:function(){return 0},indexOf:function(){return-1},contains:function(){return!1},isEmpty:function(){return!0},sort:Gk,each:Gk,reverseEach:Gk,toArray:function(){return[]},toList:function(){return new If},add:op,addAll:op,set:op,remove:op,removeAt:op,clear:op});var Xo=c.Notifier=function(){this._f=0};Sj("Notifier",R,{contains:function(k,P){if(this._ls)for(var i,j=0,f=this._ls.size();f>j;j++)if(i=this._ls.get(j),k===i.l&&P===i.s)return!0;return!1},add:function(X,E,t){var u=this,V={l:X,s:E,a:t};u._ls||(u._ls=new If),u._f?(u._as||(u._as=new If),u._as.add(V)):V.a?u._ls.add(V,0):u._ls.add(V)},remove:function(g,$){var b=this;b._ls&&(b._f?(b._rs||(b._rs=new If),b._rs.add({l:g,s:$})):b._remove(g,$))},_remove:function(g,z){for(var I,q=this._ls,T=0,Q=q.size();Q>T;T++)if(I=q.get(T),I.l===g&&I.s===z)return q.removeAt(T),void 0},fire:function(p){var g=this,Y=g._ls;if(g._b=1e4,Y){++g._f;try{for(var F,A=0,R=Y.size();R>A;A++)F=Y.get(A),F.s?F.l.call(F.s,p):F.l(p)}finally{if(--g._f)return;if(g._rs){for(R=g._rs.size(),A=0;R>A;A++)F=g._rs.get(A),g._remove(F.l,F.s);delete g._rs}if(g._as){for(R=g._as.size(),A=0;R>A;A++)F=g._as.get(A),F.a?Y.add(F,0):Y.add(F);delete g._as}}}}});var tf=c.Data=function(){this._id=kg()};Sj("Data",R,{ms_ac:["tag","name","displayName","icon","toolTip","attrObject","layer","adjustChildrenToTop","dataBindings"],ms_dm:1,ms_attr:1,_icon:W,_parent:W,_children:hf,_childMap:W,_styleMap:W,_layer:"0",_adjustChildrenToTop:!1,getUIClass:function(){return W},_22Q:function(){return W},s:function(H,X){var e=this;
- if(2===arguments.length)e.setStyle(H,X);else{if(!ko(H))return e.getStyle(H);for(var N in H)e.setStyle(N,H[N])}return e},fp:function(p,W,x,d,N){return this.firePropertyChange(p,W,x,d,N)},firePropertyChange:function(F,q,c,w,H){if(w){if(w(q,c))return!1}else if(q===c)return!1;var N=this,z=H||{};return z.property=F,z.oldValue=q,z.newValue=c,z.data=N,N._dataModel&&N._dataModel.handleDataPropertyChange(z),N.onPropertyChanged(z),!0},onPropertyChanged:function(e){var M=this,D=M._parent,Q=e.property;if(tl(D)){var m=M.s(Tl),K="s:ingroup"===Q;(m&&Pj[Q]||Q===K)&&D._81I(),(m||K)&&D.fp("childChange",!0,!1)}Ph(D)&&Pj[Q]&&D.updateFromChildren()},_21I:function(o){var E=this;if(o&&E._dataModel)throw"Remove data from dataModel before adding";E._dataModel=o},removeFromDataModel:function(){this._dataModel?this._dataModel.remove(this):this.setParent(null)},clearChildrenFromDataModel:function(){for(var G=0,t=this._children.toArray(),y=t.length;y>G;G++)t[G].removeFromDataModel()},getId:function(){return this._id},setId:function(A){this._id=A},getChildren:function(){return this._children},size:function(){return this._children.size()},toChildren:function(C,y){return this._children.toList(C,y)},eachChild:function(e,l){this._children.each(e,l)},addChild:function(q,V){var X=this;q!==X&&(X._children===hf&&(X._children=new If,X._childMap={}),V>=0||(V=X._children.size()),X._childMap[q._id]||X.isDescendantOf(q)||(q._parent&&q._parent.removeChild(q),(0>V||V>X._children.size())&&(V=X._children.size()),X._children.add(q,V),X._childMap[q._id]=q,q.setParent(X),X.onChildAdded(q,V),X.fp(rg,W,q)))},onChildAdded:function(){},removeChild:function(c){var _=this;if(_._childMap&&_._childMap[c._id]){var d=_._children.remove(c);delete _._childMap[c._id],_.fp(rg,c,W),c.setParent(W,d),_.onChildRemoved(c,d)}},onChildRemoved:function(){},getChildAt:function(V){return this._children.get(V)},clearChildren:function(){var w=this;if(!w._children.isEmpty())for(var H=0,V=w._children.toArray(),q=V.length;q>H;H++)w.removeChild(V[H])},getParent:function(){return this._parent},setParent:function(H,y){var o=this;if(!(o._73I||o._parent===H||o===H||H&&H.isDescendantOf(o))){var T,$=o._parent;o._parent=H,o._73I=1,$?(y==W&&(y=$.getChildren().indexOf(o)),$.removeChild(o)):o._dataModel&&y==W&&(y=o._dataModel.getRoots().indexOf(o)),H&&(H.addChild(o),T=H.getChildren().indexOf(o)),delete o._73I,o.fp("parent",$,H,N,{oldIndex:y,newIndex:T}),o.onParentChanged($,H)}},onParentChanged:function(){},hasChildren:function(){return this._children.size()>0},isEmpty:function(){return this._children.isEmpty()},isRelatedTo:function(O){return O?this.isDescendantOf(O)||O.isDescendantOf(this):!1},isParentOf:function(H){return H&&this._childMap?!!this._childMap[H._id]:!1},isDescendantOf:function(j){if(!j||j.isEmpty())return!1;for(var Z=this._parent;Z;){if(j===Z)return!0;Z=Z._parent}return!1},getStyleMap:function(){return this._styleMap},getStyle:function($,A){A===N&&(A=1);var W=this._styleMap?this._styleMap[$]:N;return W===N&&A?F[$]:W},setStyle:function(I,M){var R=this;R._styleMap||(R._styleMap={});var F=R._styleMap[I];M===N?delete R._styleMap[I]:R._styleMap[I]=M,R.fp("s:"+I,F,M)&&R.onStyleChanged(I,F,M)},onStyleChanged:function(){},iv:function(m){this.invalidate(m)},invalidate:function(E){this.fp(E||"*",!1,!0)},toString:function(){var D=this;return D._displayName||D._name||D._tag||D._id},toLabel:function(){return this._displayName||this._name},addStyleIcon:function(T,g){var F=this,e=F.s(gb);e||F.s(gb,e={}),g?e[T]=g:delete e[T],F.fp(gb,W,e)},removeStyleIcon:function(h){var v=this.s(gb);if(v){var d=v[h];delete v[h],this.fp(gb,W,v)}return d},getSerializableProperties:function(){return{name:1,displayName:1,icon:1,toolTip:1,parent:1,layer:1,tag:1,adjustChildrenToTop:1,dataBindings:1}},getSerializableStyles:function(){var y,i={};for(y in this._styleMap)i[y]=1;return i}});var Hk=c.DataModel=function(){var x=this;x._datas=new If,x._dataMap={},x._roots=new If,x._rootMap={},x._78O={},x._36I=new Xo,x._35I=new Xo,x._selectionModel=new Pn(x);var M=x._29Q=[],E=x._scheduleCallback=function(){for(var Q=Date.now(),u=0;u<M.length;u++){var t=M[u];t.enabled&&Q-t.lastTime>t.interval&&(t.beforeAction&&t.beforeAction(),x.each(function(l){t.action(l)}),t.afterAction&&t.afterAction(),t.lastTime=Q)}M.length&&(x._30Q=n.requestAnimationFrame(E))}};Sj("DataModel",R,{ms_fire:1,ms_attr:1,ms_ac:["layers","name","autoAdjustIndex","hierarchicalRendering","background","init"],_name:N,_autoAdjustIndex:!0,_hierarchicalRendering:!1,_background:N,_init:N,sm:function(){return this.getSelectionModel()},mm:function(X,W,A){this.addDataModelChangeListener(X,W,A)},umm:function(N,L){this.removeDataModelChangeListener(N,L)},md:function($,O,Y){this.addDataPropertyChangeListener($,O,Y)},umd:function(j,n){this.removeDataPropertyChangeListener(j,n)},mh:function(H,G,x){this.addHierarchyChangeListener(H,G,x)},umh:function(T,s){this.removeHierarchyChangeListener(T,s)},getAttrObject:function(){return this._attrObject},setAttrObject:function(g){return this._attrObject=g},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},getDataById:function(h){return this._dataMap[h]},removeDataById:function(P){this.remove(this.getDataById(P))},toDatas:function(s,Q){return this._datas.toList(s,Q)},each:function(r,q){this._datas.each(r,q)},getDataByTag:function(i){return this._78O[i]},getTagMap:function(){return this._78O},removeDataByTag:function(w){this.remove(this.getDataByTag(w))},add:function(L,p,O){var n=this,c=L._id,i=L._tag,b=n._roots;if(n._dataMap[c])throw"'"+c+"' already exists";i!=W&&(n._78O[i]=L),n._dataMap[c]=L,O>=0?n._datas.add(L,O):n._datas.add(L),L._parent||(n._rootMap[c]=L,p>=0?b.add(L,p):b.add(L)),L._21I(n),n.onAdded(L),n._36I.fire({kind:"add",data:L,rootsIndex:p,datasIndex:O})},onAdded:function(){},remove:function(l,J){if(l){var B=this,u=l._id,H=J&&J.keepStructure,F=J&&J.keepChildren,D=l.getTag();if(l._dataModel===B){this.beginTransaction(),H?B._removingData||(B._removingData=l):B.prepareRemove(l),F||l.toChildren().each(function(g){B.remove(g,J)},B),H?B._removingData===l&&(l._parent&&l._parent.removeChild(l),delete B._removingData):l._parent&&l._parent.removeChild(l);var r=B._datas.remove(l);delete B._dataMap[u],D!=W&&delete B._78O[D];var V;B._rootMap[u]&&(delete B._rootMap[u],V=B._roots.remove(l)),l._21I(W),B.onRemoved(l),B._36I.fire({kind:As,data:l,rootsIndex:V,datasIndex:r}),this.endTransaction()}}},onRemoved:function(){},prepareRemove:function(){},clear:function(){var y=this;if(y._datas.size()){var O=y._historyManager?this.toJSON():N;y._datas.toArray().forEach(function(_){_._21I(W)}),y._datas.clear(),y._dataMap={},y._roots.clear(),y._rootMap={},y._78O={},y._36I.fire({kind:Ln,json:O})}},contains:function(F){return F&&F._dataModel===this},handleDataPropertyChange:function(o){var A=this,a=o.data,p=o.property;if("parent"===p){var Q=a._id,V=A._rootMap,q=A._roots;a._parent?V[Q]&&(delete V[Q],q.remove(a)):V[Q]||(V[Q]=a,q.add(a))}else if("tag"===p){var F=o.oldValue,n=o.newValue,E=A._78O;F!=W&&delete E[F],n!=W&&(E[n]=a)}this.onDataPropertyChanged(a,o),this._35I.fire(o)},onDataPropertyChanged:function(){},addDataModelChangeListener:function(m,R,J){this._36I.add(m,R,J)},removeDataModelChangeListener:function(d,M){this._36I.remove(d,M)},addDataPropertyChangeListener:function(Q,B,z){this._35I.add(Q,B,z)},removeDataPropertyChangeListener:function(k,A){this._35I.remove(k,A)},_38I:function(F,n,Z){this._37I&&this._37I.fire({data:F,oldIndex:n,newIndex:Z})},addHierarchyChangeListener:function(x,_,P){this._37I||(this._37I=new Xo),this._37I.add(x,_,P)},removeHierarchyChangeListener:function(G,u){this._37I.remove(G,u)},getSiblings:function(F){var Q=F._parent;return Q?Q._children:this._roots},eachByHierarchical:function(j,B,u){if(B)return this._eachByHierarchical(j,B,u);for(var o=0,v=this._roots,_=v.size();_>o;o++)if(this._eachByHierarchical(j,v.get(o),u)===!1)return!1;return!0},_eachByHierarchical:function(D,W,N){if(N){if(D.call(N,W)===!1)return!1}else if(D(W)===!1)return!1;for(var t=W.size(),s=0;t>s;s++)if(this._eachByHierarchical(D,W.getChildAt(s),N)===!1)return!1;return!0},reverseEachByHierarchical:function(S,u,o){if(u)return this._reverseEachByHierarchical(S,u,o);for(var X=this._roots,P=X.size(),Q=P-1;Q>=0;Q--)if(this._reverseEachByHierarchical(S,X.get(Q),o)===!1)return!1;return!0},_reverseEachByHierarchical:function(u,A,o){for(var D=A.size(),l=D-1;l>=0;l--)if(this._reverseEachByHierarchical(u,A.getChildAt(l),o)===!1)return!1;if(o){if(u.call(o,A)===!1)return!1}else if(u(A)===!1)return!1;return!0},eachByDepthFirst:function(e,D,r){if(D)return this._11I(e,D,r);for(var G=0,j=this._roots,Q=j.size();Q>G;G++)if(this._11I(e,j.get(G),r)===!1)return!1;return!0},_11I:function(u,h,S){for(var G=h.size(),Z=0;G>Z;Z++)if(this._11I(u,h.getChildAt(Z),S)===!1)return!1;if(S){if(u.call(S,h)===!1)return!1}else if(u(h)===!1)return!1;return!0},eachByBreadthFirst:function(Q,g,c){var o=new If;for(g?o.add(g):this._roots.each(o.add,o);o.size()>0;)if(g=o.removeAt(0),g.eachChild(o.add,o),c){if(Q.call(c,g)===!1)return!1}else if(Q(g)===!1)return!1;return!0},moveTo:function(W,T){var $=this.getSiblings(W),X=$.indexOf(W);X===T||0>X||T>=0&&T<=$.size()&&($.remove(W),T>$.size()&&T--,$.add(W,T),this._38I(W,X,T))},moveUp:function(G){this.moveTo(G,this.getSiblings(G).indexOf(G)-1)},moveDown:function(I){this.moveTo(I,this.getSiblings(I).indexOf(I)+1)},moveToTop:function(Y){this.moveTo(Y,0)},moveToBottom:function(z){this.moveTo(z,this.getSiblings(z).size())},moveSelectionUp:function(a){this.beginTransaction(),a||(a=this.sm());var f=new If;oo(a,f,this._roots),f.each(this.moveUp,this),this.endTransaction()},moveSelectionDown:function(m){this.beginTransaction(),m||(m=this.sm());var n=new If;Af(m,n,this._roots),n.each(this.moveDown,this),this.endTransaction()},moveSelectionToTop:function(t){this.beginTransaction(),t||(t=this.sm());var p=new If;ln(t,p,this._roots),p.each(this.moveToTop,this),this.endTransaction()},moveSelectionToBottom:function(z){this.beginTransaction(),z||(z=this.sm());var u=new If;re(z,u,this._roots),u.each(this.moveToBottom,this),this.endTransaction()},moveToIndex:function(w,L,q){var W=this.getDatas();null==q&&(q=W.indexOf(w)),q===L||0>q||L>=0&&L<=W.size()&&(W.remove(w),L>W.size()&&L--,W.add(w,L),this._76I(w,q,L))},bringForward:function(y){this.moveToIndex(y,this.getDatas().indexOf(y)+1)},bringToFront:function(v){this.moveToIndex(v,this.size())},sendBackward:function(y){this.moveToIndex(y,this.getDatas().indexOf(y)-1)},sendToBack:function(P){this.moveToIndex(P,0)},bringSelectionForward:function(v){this.beginTransaction(),v||(v=this.sm());for(var w=new If,D=this.getDatas(),h=!1,M=0;M<D.size();M++){var P=D.get(D.size()-1-M);v.contains(P)?h&&w.add(P):h=!0}w.each(this.bringForward,this),this.endTransaction()},bringSelectionToFront:function(A){this.beginTransaction(),A||(A=this.sm());for(var a=new If,f=this.getDatas(),j=0;j<f.size();j++){var c=f.get(j);A.contains(c)&&a.add(c)}a.each(this.bringToFront,this),this.endTransaction()},sendSelectionBackward:function(x){this.beginTransaction(),x||(x=this.sm());for(var c=new If,F=this.getDatas(),n=!1,g=0;g<F.size();g++){var y=F.get(g);x.contains(y)?n&&c.add(y):n=!0}c.each(this.sendBackward,this),this.endTransaction()},sendSelectionToBack:function(p){this.beginTransaction(),p||(p=this.sm());for(var A=new If,E=this.getDatas(),S=0;S<E.size();S++){var Y=E.get(E.size()-1-S);p.contains(Y)&&A.add(Y)}A.each(this.sendToBack,this),this.endTransaction()},addScheduleTask:function(t){var N=this;N.removeScheduleTask(t),t.enabled==W&&(t.enabled=!0),t.interval==W&&(t.interval=10),t.action==W&&(t.action=Gk),t.lastTime=Date.now(),N._29Q.push(t),N._30Q==W&&(N._30Q=n.requestAnimationFrame(N._scheduleCallback))},removeScheduleTask:function(b){var i=this,p=i._29Q,E=p.indexOf(b);E>=0&&p.splice(E,1),p.length||i._30Q==W||(n.cancelAnimationFrame(i._30Q),delete i._30Q)},getHistoryManager:function(){return this._historyManager},enableHistoryManager:function(O){this._historyManager||new c.HistoryManager(this),null!=O&&this._historyManager.setMaxHistoryCount(O),this._historyManager.setDisabled(!1)},disableHistoryManager:function(){this._historyManager&&this._historyManager.setDisabled(!0)},clearHistoryManager:function(){this._historyManager&&this._historyManager.clear()},undo:function(C){this._historyManager&&this._historyManager.undo(C)},redo:function(o){this._historyManager&&this._historyManager.redo(o)},beginTransaction:function(){this._historyManager&&this._historyManager.beginTransaction()},endTransaction:function(){this._historyManager&&this._historyManager.endTransaction()},addHistory:function(b){this._historyManager&&this._historyManager.addHistory(b)},onHistoryManagerChanged:function(){}});var Pn=c.SelectionModel=function(h){var v=this;v._68O=tm,v._map={},v._73O=new If,v._74I=new Xo,v._21I(h)};Sj("SelectionModel",R,{ms_fire:1,ms_dm:1,ms:function(X,Y,V){this.addSelectionChangeListener(X,Y,V)},ums:function(C,f){this.removeSelectionChangeListener(C,f)},fd:function(){return this.getFirstData()},ld:function(){return this.getLastData()},sg:function(){return this._68O===mm},co:function(E){return this._map[E._id]!=W},ss:function(v){this.setSelection(v)},as:function(n){this.appendSelection(n)},rs:function(Z){this.removeSelection(Z)},cs:function(){this.clearSelection()},sa:function(){this.selectAll()},getSelectionMode:function(){return this._68O},setSelectionMode:function(j){var q=this;if(q._68O!==j&&(j===bf||j===mm||j===tm)){q.cs();var F=q._68O;q._68O=j,q.fp("selectionMode",F,j)}},_21I:function(o){var K=this,s=K._dataModel;s!==o&&(s&&(K.cs(),s.umm(K.handleDataModelChange,K)),K._dataModel=o,o.mm(K.handleDataModelChange,K,!0),K.fp(ol,s,o))},dispose:function(){var b=this;b.cs(),b._dataModel.umm(b.handleDataModelChange,b)},handleDataModelChange:function(a){var e=this;if(a.kind===As){var F=a.data;e.co(F)&&(e._73O.remove(F),delete e._map[F._id],e._75I(As,new If(F)))}else a.kind===Ln&&e.cs()},getFilterFunc:function(){return this._filterFunc},setFilterFunc:function(J){var N=this;if(N._filterFunc!==J){N.cs();var R=N._filterFunc;N._filterFunc=J,N.fp("filterFunc",R,N._filterFunc)}},_75I:function(_,y,f,w){f&&(this._73O.each(function(K){w[K._id]?f.remove(K):f.add(K)}),y=f.toList()),this._74I.fire({kind:_,datas:new If(y)})},addSelectionChangeListener:function(J,N,W){this._74I.add(J,N,W)},removeSelectionChangeListener:function(J,d){this._74I.remove(J,d)},_97O:function(M,_){for(var g,c=this,K=0,h=new If(M);K<h.size();K++)g=h.get(K),(c._filterFunc&&!c._filterFunc(g)||_&&c.co(g)||!_&&!c.co(g)||!c._dataModel.contains(g))&&(h.removeAt(K),K--);return h},appendSelection:function(H){var a=this;if(a._68O!==bf){var f,K,L=a._73O,T=a._97O(H,!0);T.isEmpty()||(a.sg()&&(f=new If(L),K=a._map,L.clear(),a._map={},T=new If(T.get(T.size()-1))),T.each(function(W){L.add(W),a._map[W._id]=W}),a._75I("append",T,f,K))}},removeSelection:function(M){var T=this,m=T._97O(M),d=0,x=m.size();if(0!==x){for(;x>d;d++){var E=m.get(d);T._73O.remove(E),delete T._map[E._id]}T._75I(As,m)}},toSelection:function(q,F){return this._73O.toList(q,F)},getSelection:function(){return this._73O},each:function(q,w){this._73O.each(q,w)},setSelection:function(K){var _=this,m=_._73O;if(_._68O!==bf&&!(m.isEmpty()&&!K||1===m.size()&&_.ld()===K)){var g=new If(m),z=_._map;m.clear(),_._map={};var s=_._97O(K,!0);_.sg()&&s.size()>1&&(s=new If(s.get(s.size()-1))),s.each(function(j){m.add(j),_._map[j._id]=j}),_._75I("set",W,g,z)}},clearSelection:function(){var F=this,b=F._73O;if(b.size()>0){var I=b.toList();b.clear(),F._map={},F._75I(Ln,I)}},selectAll:function(){var C=this;if(C._68O!==bf){var a,z,M=C._dataModel.toDatas();if(C._filterFunc)for(a=0;a<M.size();a++)z=M.get(a),C._filterFunc(z)||(M.removeAt(a),a--);var L=C._73O,A=new If(L),k=C._map;L.clear(),C._map={},C.sg()&&M.size()>1&&(M=new If(M.get(M.size()-1)));var H=M.size();for(a=0;H>a;a++)z=M.get(a),L.add(z),C._map[z._id]=z;C._75I("all",W,A,k)}},size:function(){return this._73O.size()},isEmpty:function(){return this._73O.isEmpty()},contains:function(Q){return this._map[Q._id]!=W},getLastData:function(){var j=this._73O;return j.size()>0?j.get(j.size()-1):W},getFirstData:function(){var f=this._73O;return f.size()>0?f.get(0):W},isSelectable:function(D){var X=this;return D&&X._68O!==bf?X._filterFunc?X._filterFunc(D):!0:!1},getTopSelection:function(){var z=this,K=new If;return z._73O.each(function(Y){for(var k=Y.getParent();k;){if(z.contains(k)){Y=W;break}k=k.parent}Y&&K.add(Y)}),K}});var Lg=function(){return pb(0),function(f,A){var g;if(Ge(A)){var N=f.getDataUI(A);N&&N._88I&&(g=N._88I.rect)}return g?g:A.getRect()}}();dr(M,{edgeGroupAgentFunc:W,graphViewAutoScrollZone:16,graphViewResettable:!1,graphViewPannable:!0,graphViewRectSelectable:!0,graphViewScrollBarVisible:!0,graphViewRectSelectBorderColor:T.rectSelectBorder,graphViewRectSelectBackground:go,graphViewEditPointSize:Bs?17:7,graphViewEditPointBorderColor:T.editPointBorder,graphViewEditPointBackground:T.editPointBackground,setEdgeType:function(C,l,P){cj[C]=l,ae[C]=P},getEdgeType:function(G){return cj[G]},getEdgeTypeMap:function(){return cj},getNodeRect:Lg},!0),dr(F,{"2d.selectable":!0,"2d.visible":!0,"2d.movable":!0,"2d.editable":!0,"2d.move.mode":N,interactive:!1,"image.stretch":"fill",icons:N,ingroup:!0,"body.color":N,opacity:N,pixelPerfect:!0,"clip.direction":"top","clip.percentage":1,"select.color":Gh,"select.width":1,"select.padding":2,"select.type":Rl,shadow:!1,"shadow.blur":6,"shadow.offset.x":3,"shadow.offset.y":3,"border.color":N,"border.width":2,"border.padding":2,"border.type":Rl,label:N,"label.font":N,"label.color":yd,"label.background":N,"label.position":31,"label.position.fixed":!1,"label.offset.x":0,"label.offset.y":2,"label.rotation":N,"label.max":N,"label.opacity":N,"label.scale":1,"label.align":N,"label.selectable":!0,label2:N,"label2.font":N,"label2.color":yd,"label2.background":N,"label2.position":34,"label2.position.fixed":!1,"label2.offset.x":0,"label2.offset.y":-2,"label2.rotation":N,"label2.max":N,"label2.opacity":N,"label2.scale":1,"label2.align":N,"label2.selectable":!0,note:N,"note.expanded":!0,"note.font":N,"note.color":kl,"note.background":Gh,"note.position":8,"note.offset.x":-3,"note.offset.y":3,"note.max":N,"note.toggleable":!0,"note.border.width":1,"note.border.color":N,"note.opacity":N,"note.scale":1,"note.align":N,note2:N,"note2.expanded":!0,"note2.font":N,"note2.color":kl,"note2.background":Gh,"note2.position":3,"note2.offset.x":3,"note2.offset.y":-3,"note2.max":N,"note2.toggleable":!0,"note2.border.width":1,"note2.border.color":N,"note2.opacity":N,"note2.scale":1,"note2.align":N,"group.type":N,"group.image":N,"group.image.stretch":"fill","group.repeat.image":N,"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":N,"group.title.color":kl,"group.title.background":T.groupTitleBackground,"group.title.align":Ep,"group.background":T.groupBackground,"group.depth":1,"group.border.width":1,"group.border.pattern":N,"group.border.color":zg,"group.border.cap":jb,"group.border.join":Ui,"group.gradient":W,"group.gradient.color":"#FFF",shape:N,"shape.background":zg,"shape.repeat.image":N,"shape.border.width":0,"shape.border.width.absolute":!1,"shape.border.color":zg,"shape.border.3d":!1,"shape.border.3d.color":N,"shape.border.3d.accuracy":N,"shape.border.cap":jb,"shape.border.join":Ui,"shape.border.pattern":N,"shape.gradient":W,"shape.gradient.color":"#FFF","shape.depth":0,"shape.dash":!1,"shape.dash.pattern":Dj,"shape.dash.offset":0,"shape.dash.color":Sp,"shape.dash.width":N,"shape.dash.3d":!1,"shape.dash.3d.color":N,"shape.dash.3d.accuracy":N,"shape.polygon.side":6,"shape.arc.from":l,"shape.arc.to":C,"shape.arc.close":!0,"shape.arc.oval":!1,"shape.corner.radius":N,"shape.gradient.pack":N,"shape.fill.rule":"nonzero","shape.fill.clip.direction":"top","shape.fill.clip.percentage":1,"shape.background2":N,"shape.gradient2":W,"shape.gradient2.color":"#FFF","autolayout.gap":N,"autolayout.hgap":N,"autolayout.vgap":N,"edge.type":N,"edge.points":N,"edge.segments":N,"edge.color":zg,"edge.width":2,"edge.width.absolute":!1,"edge.offset":20,"edge.group":0,"edge.expanded":!0,"edge.gap":12,"edge.toggleable":!0,"edge.center":!1,"edge.3d":!1,"edge.3d.color":N,"edge.3d.accuracy":N,"edge.cap":jb,"edge.join":Ui,"edge.source.position":17,"edge.source.anchor.x":N,"edge.source.anchor.y":N,"edge.source.offset.x":0,"edge.source.offset.y":0,"edge.target.position":17,"edge.target.anchor.x":N,"edge.target.anchor.y":N,"edge.target.offset.x":0,"edge.target.offset.y":0,"edge.pattern":N,"edge.dash":!1,"edge.dash.pattern":Dj,"edge.dash.offset":0,"edge.dash.color":Sp,"edge.dash.width":N,"edge.dash.3d":!1,"edge.dash.3d.color":N,"edge.dash.3d.accuracy":N,"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":N,"attach.gap":0,"attach.gap.relative":!1,"grid.row.count":1,"grid.column.count":1,"grid.row.percents":N,"grid.column.percents":N,"grid.border":1,"grid.border.left":0,"grid.border.right":0,"grid.border.top":0,"grid.border.bottom":0,"grid.gap":1,"grid.background":T.gridBackground,"grid.depth":1,"grid.cell.depth":-1,"grid.cell.border.color":T.gridCellBorderColor,"grid.block":N,"grid.block.padding":3,"grid.block.width":1,"grid.block.color":T.gridBlockColor,text:"","text.align":"left","text.vAlign":"middle","text.color":yd,"text.font":Eh,"text.shadow":!1,"text.shadow.color":Gh,"text.shadow.blur":6,"text.shadow.offset.x":3,"text.shadow.offset.y":3},!0),dr(Hk,{_76I:function(V,Q,F){this._39I&&this._39I.fire({data:V,oldIndex:Q,newIndex:F})},addIndexChangeListener:function(T,L,W){var U=this;U._39I||(U._39I=new Xo),U._39I.add(T,L,W)},removeIndexChangeListener:function(q,J){this._39I.remove(q,J)},prepareRemove:function(V){Fe(V)&&(V.setSource(W),V.setTarget(W)),V._70O&&V._70O.toList().each(this.remove,this),V._69O&&V._69O.toList().each(function(j){j.setHost(W)}),V._host&&V.setHost(W)},onAdded:function(W){this.isAutoAdjustIndex()&&this.adjustIndex(W)},onDataPropertyChanged:function(R,z){jc[z.property]&&this.isAutoAdjustIndex()&&this.adjustIndex(R)},isAdjustable:function(h){return Cj(h)||Fe(h)},isAdjustedToBottom:function(g){return tl(g)?g.isExpanded()&&Ve(g):!1},adjustIndex:function(p){var e=this;this.isHierarchicalRendering()||(e.isAdjustedToBottom(p)?(e.sendToBottom(p),p.eachChild(e.adjustIndex,e)):e.sendToTop(p))},sendToTop:function(Z){var c=this;if(c.contains(Z)&&c.isAdjustable(Z)){var x=c._datas;if(Z!==x.get(c.size()-1)){var e=x.indexOf(Z);x.removeAt(e),x.add(Z),c._76I(Z,e,c.size()-1)}if(Fe(Z)){var $=Z._40I;$&&!c.isAdjustedToBottom($)&&c.sendToTop($),$=Z._41I,$&&!c.isAdjustedToBottom($)&&c.sendToTop($)}Z._69O&&Z._69O.each(function(F){F.isRelatedTo(Z)||Cj(Z)&&F.isLoopedHostOn(Z)||c.sendToTop(F)}),Z.ISubGraph||(!tl(Z)||Z.isExpanded())&&Z._adjustChildrenToTop&&Z.eachChild(function(v){Fe(v)||c.sendToTop(v)})}},sendToBottom:function(a,z){var F=this;if(a!==z&&F.contains(a)&&F.isAdjustable(a)&&(!z||F.contains(z))){var d=F._datas,h=d.remove(a),s=z?F._datas.indexOf(z):0;if(d.add(a,s),h!==s){F._76I(a,h,s);var c=a._parent;!c||c.ISubGraph||Fe(c)||F.sendToBottom(a._parent,a)}}}}),dr(zh,{ms_edit:function(j){j._46O=function(G){var h=this,Y=h.gv.dm(),P=h._index,b=h._89I,i=h._node,j=h._shape,a=h._edge,s=h._77I;i&&b?(this.fi({kind:"endEditRect",event:G,data:i,direction:b}),Y.endTransaction()):j&&P>=0?(h.fi({kind:"endEditPoint",event:G,data:j,index:P}),Y.endTransaction()):a&&P>=0?(h.fi({kind:"endEditPoint",event:G,data:a,index:P}),Y.endTransaction()):s&&(h.fi({kind:"endEditRotation",event:G,data:s}),Y.endTransaction())},j._78I=function(N){var R=this;R.autoScroll(N);var X=R.gv.lp(N),a=R._index,e=R._89I,F=R._node,v=R._shape,K=R._edge,U=R._77I;if(F&&e)R._80O(X),R.fi({kind:"betweenEditRect",event:N,data:F,direction:e});else if(v&&a>=0)X.e=v.getPoints().get(a).e,v.setPoint(a,X),R.fi({kind:"betweenEditPoint",event:N,data:v,index:a});else if(K&&a>=0){var w=K.s(tc);X.e=w.get(a).e,w.set(a,X),K.fp(tc,W,w),R.fi({kind:"betweenEditPoint",event:N,data:K,index:a})}else if(U){var I=U.p(),x=U.getScale(),m=q+B(X.y-I.y,X.x-I.x);x.y<0&&(m+=l),t(m)<.04&&(m=0),U.setRotation(m),R.fi({kind:"betweenEditRotation",event:N,data:U})}},j._80O=function(M){var b=this,k=b._node,v=b._rect,R=v.x,I=v.y,C=v.width,o=v.height,z=b._89I,P=b._anchor,p=b._matrix,M=p.tfi(M);"northwest"===z?v=rd(M,{x:R+C,y:I+o}):z===vg?v=rd({x:R,y:M.y},{x:R+C,y:I+o}):"northeast"===z?v=rd({x:R,y:M.y},{x:M.x,y:I+o}):z===lg?v=rd({x:M.x,y:I},{x:R+C,y:I+o}):z===ci?v=rd({x:R,y:I},{x:M.x,y:I+o}):"southwest"===z?v=rd({x:M.x,y:I},{x:R+C,y:M.y}):"south"===z?v=rd({x:R,y:I},{x:R+C,y:M.y}):"southeast"===z&&(v=rd({x:R,y:I},M)),k.setPosition(p.tf(v.x+v.width*P.x,v.y+v.height*P.y)),k.setWidth(v.width),k.setHeight(v.height)},j._80I=function(R,D,s,d){var w=this,$=w.gv._zoom,h=(w.gv.getEditPointSize()+2)/$;return Vb({x:D-h/2,y:s-h/2,width:h,height:h},R)?(w._89I!==d&&(w._89I=d),!0):!1},j._79I=function(U,m,l){var L=this,t=L.gv,G=m?t.getDataUI(m):W,j=G?G._55O:W;if(j){var n,A,T,X,O=t._zoom,z=(t.getEditPointSize()+2)/O,g=t.lp(U);if(Cj(m)){if(j._56O&&Cj(m)&&(A=j._98o,Vb({x:A.x-z/2,y:A.y-z/2,width:z,height:z},g)))return L._77I=m,l&&L.fi({kind:"beginEditRotation",event:U,data:m}),L.setCursor("crosshair"),!0;if(j._43O&&m instanceof Ed)for(T=m.getPoints(),n=T.size()-1;n>=0;n--)if(A=T.get(n),Vb({x:A.x-z/2,y:A.y-z/2,width:z,height:z},g))return L._index=n,L._shape=m,l&&L.fi({kind:"beginEditPoint",event:U,data:m,index:n}),L.setCursor("crosshair"),!0;if(j._42O)for(var P=m.getEditControlPoints(),J=["northwest",-1,-1,lg,-1,0,"southwest",-1,1,"south",0,1,"southeast",1,1,ci,1,0,"northeast",1,-1,vg,0,-1],n=0,X=P.length;X>n;n++){var D=J[3*n],f=P[n];if(L._80I(g,f.x,f.y,D)){L._node=m;var a=m.getWidth(),E=m.getHeight(),Z=m.getAnchor();L._rect={x:-a*Z.x,y:-E*Z.y,width:a,height:E},L._anchor=Z,L._matrix=m.getMatrix();var $=m.getRotation(),s=o($),M=b($),Q=J[3*n+1]*nm(m.getScale().x),S=J[3*n+2]*nm(m.getScale().y),r=Math.atan2(-M*Q-s*S,s*Q-M*S),w=(Math.round(r/(Math.PI/4))+8)%8,H=[Oj,"nesw-resize",Rn,"nwse-resize",Oj,"nesw-resize",Rn,"nwse-resize"][w];return L.setCursor(H),l&&L.fi({kind:"beginEditRect",event:U,data:m,direction:L._89I}),!0}}}if(j._43O&&Fe(m)&&m.s(Pb)===oc&&(T=m.s(tc)))for(n=T.size()-1;n>=0;n--)if(A=T.get(n),Vb({x:A.x-z/2,y:A.y-z/2,width:z,height:z},g))return L._index=n,L._edge=m,l&&L.fi({kind:"beginEditPoint",event:U,data:m,index:n}),L.setCursor("crosshair"),!0}return!1}},ms_gv:function(V){V._currentSubGraph=W,V.upSubGraph=function(){this.setCurrentSubGraph(bm(this._currentSubGraph))},V.isVisible=function(k){var v=this;if(bm(k)!==v._currentSubGraph)return!1;if(Fe(k)){var t=k._40I,s=k._41I;if(!t||!s)return!1;if(!(k.s("edge.independent")||v.isVisible(t)&&v.isVisible(s)))return!1;if(k.isEdgeGroupHidden())return!1}else for(var d=k._parent;d&&!d.ISubGraph;){if(tl(d)&&(!d.isExpanded()||!v.isVisible(d)))return!1;d=d._parent}if(k._parent instanceof Fh&&!v.isVisible(k._parent))return!1;if(k._refGraph instanceof Fp&&!v.isVisible(k._refGraph))return!1;if(v instanceof Wi){if(!k.s("3d.visible"))return!1}else{var S=v.getLayersInfo();if(S){var Z=S[k._layer];if(Z&&Z.visible===!1)return!1}if(!k.s("2d.visible"))return!1}return v._visibleFunc?v._visibleFunc(k):!0},V.handleSelectionChange=function(O){var J=this;O.datas.each(function(y){J.invalidateData(y);var H=y._parent;tl(H)&&Cj(y)&&y.s(Tl)&&(J.invalidateData(H),H._49I&&H._49I.each(function(w){J.invalidateData(w)}))}),J.onSelectionChanged(O)},V.onSelectionChanged=function(S){var u=this,_=u.sm();if(1===_.size()&&("set"===S.kind||"append"===S.kind)){var m=_.ld();u.isAutoMakeVisible()&&u.makeVisible(m),u.adjustIndex&&u._dataModel.isAutoAdjustIndex()&&u.adjustIndex(m)}},V.makeVisible=function(k){if(k){var S=this,N=S.getDataUI?S.getDataUI(k):S.getData3dUI(k);if(N){var d=k,R=bm(k);for(R!==S._currentSubGraph&&S.setCurrentSubGraph(R);(d=d._parent)&&d!==R;)tl(d)&&d.setExpanded(!0);S._23I=k,S.iv()}}},V.getLabel=function(F){var i=F.getStyle(yg);return i===N?F.getName():i},V.getLabelBackground=function(S){return S.getStyle("label.background")},V.getLabelColor=function(e){return e.getStyle("label.color")},V.getLabel2=function(Q){return Q.getStyle("label2")},V.getLabel2Background=function(f){return f.getStyle("label2.background")},V.getLabel2Color=function(N){return N.getStyle("label2.color")},V.getNote=function(v){return v.getStyle(Wl)},V.getNoteBackground=function(I){return I.getStyle("note.background")},V.getNote2=function(S){return S.getStyle(ik)},V.getNote2Background=function(Z){return Z.getStyle("note2.background")},V.handleClick=function(t,r,d){var N=this;r?(N.fi({kind:"clickData",event:t,data:r,part:d}),N.onDataClicked(r,t)):(N.fi({kind:"clickBackground",event:t}),N.onBackgroundClicked(t))},V.handleDoubleClick=function(n,i,E){var e=this;ki(n)&&(i?(e.fi({kind:"doubleClickData",event:n,data:i,part:E}),e.onDataDoubleClicked(i,n,E),e.checkDoubleClickOnNote(n,i,E)||e.checkDoubleClickOnRotation&&e.checkDoubleClickOnRotation(n,i,E)||(Fe(i)?e.onEdgeDoubleClicked(i,n,E):i.ISubGraph?e.onSubGraphDoubleClicked(i,n,E):tl(i)?e.onGroupDoubleClicked(i,n,E):i.IDoorWindow?e.onDoorWindowDoubleClicked(i,n,E):i.ICSGBox&&e.onCSGBoxDoubleClicked(i,n,E))):(e.fi({kind:"doubleClickBackground",event:n}),e.onBackgroundDoubleClicked(n)))},V.onSubGraphDoubleClicked=function(u){this.setCurrentSubGraph(u)},V.onEdgeDoubleClicked=function(Q,T){Q.ISubGraph&&!ji(T)?this.setCurrentSubGraph(Q):Q.s("edge.toggleable")&&Q.toggle()},V.onGroupDoubleClicked=function($){$.s("group.toggleable")&&$.toggle()},V.onDoorWindowDoubleClicked=function(N){N.s("dw.toggleable")&&N.toggle(!0)},V.onCSGBoxDoubleClicked=function(x,o){var t=this;if(t instanceof Wi){var P=t.getHitFaceInfo(o);P&&P.face&&x.s(P.face+".toggleable")&&x.toggleFace(P.face,!0)}},V.onBackgroundClicked=function(){},V.onBackgroundDoubleClicked=function(){this.upSubGraph()},V.onDataClicked=function(){},V.onDataDoubleClicked=function(){},V.onAutoLayoutEnded=function(){},V.onMoveEnded=function(){},V.onPanEnded=function(){},V.onPinchEnded=function(){},V.onRectSelectEnded=function(){},V.onZoomEnded=function(){}},ms_icons:function(z){z.getRotation=function($){return $==W?0:$},z._15O=function(){var K=this,E=K.s(gb);if(E){var B=K,R=K.data||K._data,d=K._38o={icons:E,rects:{}};for(var w in E){var k=E[w],A=ag(k.shape3d,R,B);if(!(ag(k.visible,R,B)===!1||ag(k.for3d,R,B)&&!K.I3d||A&&!K.I3d)){var p=A?[A]:ag(k.names,R,B),Z=p?p.length:0,e=ag(k.position,R,B)||3,H=ag(k.offsetX,R,B)||0,g=ag(k.offsetY,R,B)||0,m=ag(k.direction,R,B)||ci,b=ag(k.gap,R,B),M=b!=W?b:1,q=ag(k.rotation,R,B),x=ag(k.keepOrien,R,B),O=ag(k.rotationFixed,R,B)?q:K.getRotation(q,x,e),n=W,y=d.rects[w]=new Array(Z);y.rotation=O;for(var $=0;Z>$;$++){var s,i,l,G,v=p[$];if(A)l=0,G=0;else{var j=eo(v);l=ag(k.width,R,B),G=ag(k.height,R,B),l==W&&(l=ef(j,R)),G==W&&(G=fc(j,R))}if(n?m===ci?H+=l/2:m===lg?H-=l/2:m===vg?g-=G/2:g+=G/2:n={width:l,height:G},K.I3d){var C=-l/2,V=-G/2;i={width:l,height:G,mat:K._16O(ag(k.autorotate,R,B),e,n,ag(k.face,R,B)||_k,ag(k.t3,R,B),ag(k.r3,R,B),ag(k.rotationMode,R,B),H,g),vs:new or([C,-V,0,C,-V-G,0,C+l,-V-G,0,C+l,-V,0])}}else s=K.getPosition(e,H,g,n,ag(k.positionFixed,R,B)),i={x:s.x-l/2,y:s.y-G/2,width:l,height:G},K._68o(i,O);y[$]=i,m===ci?H+=l/2+M:m===lg?H-=l/2+M:m===vg?g-=G/2+M:g+=G/2+M}}}}}}});var Zm={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},Lq={3:1,7:1,11:1,17:1,23:1,27:1,31:1,44:1,46:1,47:1,49:1},gn={translateX:1,translateY:1,zoom:1,scrollBarVisible:1},jc={sourceAgent:1,targetAgent:1,expanded:1,parent:1,host:1},Pj={position:1,width:1,height:1,expanded:1,rotation:1,anchor:1,scale:1,"s:edge.points":1},Lc={"edge.type":1,"edge.group":1},Kj={rotation:1,rotationX:1,rotationZ:1},kh={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},vo={"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},Vo={shape:1,thickness:1,position:1,anchor:1,scale:1},yp=function(z,p){if(!z||!tl(p)||p.isEmpty())return!1;
- for(z=z._parent;tl(z);){if(z===p)return!0;z=z._parent}return!1},$h=function(s,B){if(!s||!Ph(B)||B.isEmpty())return!1;for(s=s._parent;Ph(s);){if(s===B)return!0;s=s._parent}return!1},bm=function(I){if(!I)return W;if(Fe(I)){var A=I._40I,U=I._41I;if(!A||!U)return W;var R=bm(A),B=bm(U);return R===B?R:W}for(var z=I._parent;Fe(z)&&!z.ISubGraph;)z=z._parent;return z?z.ISubGraph?z:bm(z):W},kp=function(m,E,c,q){var v=E.getStyle(c)*q;v&&lo(m,v),v=E.getStyle(c+".left")*q,v&&(m.x-=v,m.width+=v),v=E.getStyle(c+".right")*q,v&&(m.width+=v),v=E.getStyle(c+".top")*q,v&&(m.y-=v,m.height+=v),v=E.getStyle(c+".bottom")*q,v&&(m.height+=v),m.width<0&&(m.width=-m.width,m.x-=m.width),m.height<0&&(m.height=-m.height,m.y-=m.height)},Ve=function(I){for(var f,q=0,p=I.size();p>q;q++)if(f=I.getChildAt(q),Cj(f)&&Ve(f))return!0;return I.hasAgentEdges()},Nf=function(k){if(!k)return W;for(var e=k._parent;tl(e);){if(!tl(e._parent))return e.isExpanded()?k:e;e.isExpanded()||(k=e),e=e._parent}return k},co=function(j,p){if(!j||!p)return W;var t,f,S,I=bm(j),r=bm(p);if(I!==r){for(;r&&I!==r;)r=bm(r);if(I===r)return j;t=new If,t.add(j,0);for(var O=j._parent;Cj(O)&&!p.isDescendantOf(O);)t.add(O,0),O=O._parent;for(S=t.size(),f=0;S>f;f++){var N=t.get(f);if(tl(N)&&!N.isExpanded())return N;if(N.ISubGraph)return N}return j}return j},Gb=function(T){if(T.isLooped())return T._source;var l=Nf(T._source),U=Nf(T._target);return l===U?T._source:co(l,U)},Qo=function(P){if(P.isLooped())return P._target;var O=Nf(P._source),h=Nf(P._target);return O===h?P._target:co(h,O)},kr=function(d,i,G,H,I,V,y){if(!i)return W;var u,_=i.getRotation?i.getRotation():0;if(V!==N||y!==N)if(V=V===N?.5:V,y=y===N?.5:y,_&&!Ge(i,d)){var O=i.getPosition(),K=i.getWidth(),j=i.getHeight(),e=i.getAnchor(),F=i.getScale(),c=new ng(_,O.x,O.y,F.x,F.y);G=c.tf((V-e.x)*K,(y-e.y)*j)}else u=Lg(d,i),G={x:u.x+V*u.width,y:u.y+y*u.height};else G=jm(G,Lg(d,i));if(_){var h=o(_),n=b(_),l=H*h-I*n;I=H*n+I*h,H=l}return G.x+=H,G.y+=I,G},Oo=function(z,o){if(!z||!o)return W;var V,t,S,I,R,p;if(z===o){if(I=z.getLoopedEdges(),!I)return W;I=new If(I)}else{if(R=z.getAgentEdges(),p=o.getAgentEdges(),!R||!p)return W;for(t=R.size(),V=0;t>V;V++)S=R.get(V),p.contains(S)&&(I||(I=new If),I.add(S))}if(I)for(V=0;V<I.size();V++)S=I.get(V),S.getStyle(Pb)===oc&&(S._22I(W),I.removeAt(V),V--);return I},xd=function($,t){var Q=Oo($,t);if(Q&&!Q.isEmpty()){if(1===Q.size())return Q.get(0)._22I(W),void 0;var S=new If,v=new If;Q.each(function(q){var N=q.s("edge.group");S.contains(N)||S.add(N)}),S.sort(),S.each(function(S){v.add(new c.EdgeGroup(Q.toList(function(I){return S===I.s("edge.group")}),v))}),v.each(function(j){j.each(function(g){g._22I(j)})})}},mq=function(z,E){if(E){var B=E.rect,q=E.color,Q=E.rotation,g=E.labelWidth,M=E.background,R=E.opacity,j=E.scale,J=j!=W&&1!==j;if(R!=W){var V=z.globalAlpha;z.globalAlpha*=R}if(Q||J){z.save();var G=B.x+B.width/2,I=B.y+B.height/2;vc(z,G,I),Q&&We(z,Q),J&&z.scale(j,j),vc(z,-G,-I)}if(M&&ic(z,B.x,B.y,B.width,B.height,M),g){var S=B.width,m=z.createLinearGradient(B.x,B.y,B.x+S,B.y);m.addColorStop(0,q),m.addColorStop(.9,q),m.addColorStop(1,nr),q=m,B.width=g}ir(z,E.ss,B,E.font,q,E.align),g&&(B.width=S),(Q||J)&&z.restore(),R!=W&&(z.globalAlpha=V)}},wb=function(N,x){if(x){var s=x.rect,v=s.x,P=s.y,O=s.width,t=s.height,$=x.background,B=x.backgroundImage,g=x.borderWidth,H=x.borderColor,i=x.labelWidth,E=x.opacity,d=x.scale,R=d!=W&&1!==d;if(E!=W){var f=N.globalAlpha;N.globalAlpha*=E}if(R){N.save();var r=s.x+s.width/2,_=s.y+s.height/2;vc(N,r,_),N.scale(d,d),vc(N,-r,-_)}if(x.expanded){var U=D(8,O/4),S=P+t-8;if(N.fillStyle=$,N.beginPath(),N.moveTo(v,P),N.lineTo(v,S),N.lineTo(v+O/2,S),N.lineTo(v+O/2,P+t),N.lineTo(v+O/2+U,S),N.lineTo(v+O,S),N.lineTo(v+O,P),N.closePath(),N.fill(),g&&(N.lineWidth=g,N.lineJoin="round",N.lineCap="round",H?(N.strokeStyle=H,N.stroke()):(N.strokeStyle=Pc($),N.beginPath(),N.moveTo(v+O,P),N.lineTo(v+O,S),N.lineTo(v+O/2+U,S),N.lineTo(v+O/2,P+t),N.stroke(),N.strokeStyle=tj($),N.beginPath(),N.moveTo(v+O,P),N.lineTo(v,P),N.lineTo(v,S),N.lineTo(v+O/2,S),N.lineTo(v+O/2,P+t),N.stroke())),B)Ym(N,eo(B),Pk,s.x,s.y,s.width,s.height-8,x.data,x.view);else{if(s.height-=8,$=x.color,i){var F=O,u=N.createLinearGradient(v,P,v+F,P);u.addColorStop(0,$),u.addColorStop(.9,$),u.addColorStop(1,nr),$=u,s.width=i}ir(N,x.ss,s,x.font,$,x.align),i&&(s.width=F),s.height+=8}}else if(x.icon)gc(N,eo(x.icon),v,P,O,t,x.data,x.view);else{var z=O/2;g&&(N.lineWidth=g,N.lineJoin="round",N.lineCap="round",N.strokeStyle=H?H:Pc($),N.beginPath(),N.arc(v+z,P+z,z,q,1.6*l,!0),N.moveTo(v+z,P+t),N.lineTo(v+O-z/5,P+z),N.stroke(),N.strokeStyle=H?H:tj($),N.beginPath(),N.arc(v+z,P+z,z,1.6*l,q,!0),N.moveTo(v+z,P+t),N.lineTo(v+z/5,P+z),N.stroke()),N.fillStyle=$,N.beginPath(),N.arc(v+z,P+z,z,0,C,!0),N.moveTo(v+z,P+t),N.lineTo(v+O-z/5,P+z),N.lineTo(v+z/5,P+z),N.closePath(),N.fill(),N.fillStyle=x.color,N.beginPath(),N.arc(v+z,P+z,z/3,0,C,!0),N.fill()}R&&N.restore(),E!=W&&(N.globalAlpha=f)}},Np=function(h,g){return g>2*h?h:g/2},Ad=function(Y,P,F,t){if(!Y||!P)return 0;var E=B(P.y-Y.y,P.x-Y.x);return F||(E=P.x<Y.x?E+l:E),E+t},qs=function(k,g,e,S,V,R,v){v&&(k.x>g.x||k.x===g.x&&k.y>g.y)&&(e=In[e],V=-V);var O=jm(e,{x:0,y:0,width:Nc(k,g),height:0},R);return O.x+=S,O.y+=V,O=new ng(B(g.y-k.y,g.x-k.x)).tf(O),O.x+=k.x,O.y+=k.y,O},km=function(P,e,v,f,E){if(P._19Q=!0,!v.getEdgeGroup())return f?v.s("edge.gap"):0;var D,p=0,V=0,j=0;if(v.getEdgeGroup().getSiblings().each(function(t){t.each(function(S){if(e.isVisible(S)&&S.s(Pb)==E){var w=S.s("edge.gap");D?(V+=j/2+w/2,j=w):(D=S,j=w),S===v&&(p=V)}})}),f)return V-p+j;var Z=p-V/2;return D&&v._40I!==D._40I&&(P._19Q=!1),Z},Hm=function(){var K=function($){var o=[];return $.forEach(function(B){o.push({x:B.x,y:B.y}),o.push({x:B.x+B.width,y:B.y+B.height}),o.push({x:B.x+B.width,y:B.y}),o.push({x:B.x,y:B.y+B.height})}),o};return function(c,W,G){if("oval"===c){var o=0,V=G.height/G.width,N=V*V,P=G.x+G.width/2,s=G.y+G.height/2,t=K(W);t.forEach(function(p){var l=p.x-P,g=p.y-s,v=l*l+g*g/N;v>o&&(o=v)}),o=v(o);var M=V*o;return{x:P-o,y:s-M,width:2*o,height:2*M}}if("circle"===c){var m=0,P=G.x+G.width/2,s=G.y+G.height/2,t=K(W);return t.forEach(function(b){var r=b.x-P,J=b.y-s,q=r*r+J*J;q>m&&(m=q)}),m=v(m),{x:P-m,y:s-m,width:2*m,height:2*m}}return"roundRect"===c?(lo(G,D(G.width,G.height)/16),G):G}}(),Df=c.graph={},Ud=function(h,N,y){Xr(e+".graph."+h,N,y)};c.layout={};var bi={comps:[{type:fr,points:[85,50,70,115,100,71,86,107,88,49,56,90,114,48,101,122,99,97,86,69,119,85,72,68,78,110,111,122,119,120,67,65,43,89,48,87,48,103,69,87,73,51,52,61],borderWidth:1,borderColor:W}]};bi[sq]=bi[yi]=160,hg("node_image",Yf(30,30,[{type:Rl,rect:[4,5,22,16],gradient:$p,gradientColor:qk,background:zg},{type:Rl,rect:[2,3,26,20],borderWidth:1,borderColor:zg},{type:Rl,rect:[11,23,8,4],background:zg},{type:Rl,rect:[6,27,18,2],background:zg}])),hg("node_icon",Yf(16,16,[{type:Rl,rect:[2,2,12,10],gradient:$p,gradientColor:qk,background:zg},{type:Rr,rect:[2,2,12,10],width:1,color:zg},{type:Rl,rect:[6,12,4,2],background:zg},{type:Rl,rect:[4,14,8,1],background:zg}])),hg("block_icon",Yf(16,16,[{type:Rr,rect:[1,1,14,14],width:1,color:zg}])),hg("group_image",Yf(66,39,[{type:Rl,rect:[44.3,18,18.1,12.8],gradient:$p,gradientColor:qk,background:zg},{type:Rl,rect:[3.3,17.8,18.1,12.8],gradient:$p,gradientColor:qk,background:zg},{type:Rl,rect:[15.8,3.2,33.5,26.4],borderWidth:1,borderColor:zg,gradient:$p,gradientColor:qk,background:zg},{type:Rl,rect:[26.2,29.4,12.8,4.2],background:zg},{type:Rl,rect:[21.3,33.5,22.5,2.3],background:zg},{type:Rl,rect:[5.3,32.7,14.1,2.1],background:zg},{type:Rl,rect:[9,30.4,6.7,2.4],background:zg},{type:Rl,rect:[50,30.7,6.7,2.4],background:zg},{type:Rl,rect:[46.3,33,14.1,2.1],background:zg}])),hg("group_icon",Yf(16,16,[{type:Rl,rect:[4,12,4,2],background:zg},{type:Rl,rect:[2,13,8,1],background:zg},{type:Rl,rect:[12,12,2,1],background:zg},{type:Rl,rect:[11,13,4,1],background:zg},{type:Rl,rect:[10,7,6,5],gradient:$p,gradientColor:qk,background:zg},{type:Rl,rect:[1,2,10,10],gradient:$p,gradientColor:qk,background:zg},{type:Rr,rect:[1,2,10,10],width:1,color:zg}])),hg("refGraph_icon",Yf(16,16,[{type:"shape",borderWidth:1,borderColor:zg,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:zg,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]}])),hg("edge_icon",Yf(16,16,[{type:Rl,rect:[2.1,6.9,11.5,2.6],rotation:-.79,gradient:$p,gradientColor:qk,background:zg},{type:Rl,rect:[10.8,1,4,4],background:zg},{type:Rl,rect:[1,11,4,4],background:zg}])),hg("subGraph_image",Yf(72,45,[{type:fr,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:$p,gradientColor:qk,background:zg},{type:Rl,rect:[29.6,30.7,3.6,1.8],background:zg},{type:Rl,rect:[28.4,32.3,6,1.2],background:zg},{type:Rl,rect:[37.3,32,10.8,1.8],background:zg},{type:Rl,rect:[39.1,29.9,7.2,2.3],background:zg},{type:Rl,rect:[26.6,23.7,9.6,7.2],gradient:$p,gradientColor:qk,background:zg},{type:Rl,rect:[34.3,16.8,16.8,13.2],borderWidth:1,borderColor:zg,gradient:$p,gradientColor:qk,background:zg}])),hg("subGraph_icon",Yf(17,17,[{type:fr,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:$p,gradientColor:qk,background:zg}])),hg("shape_icon",Yf(16,16,[{type:fr,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:zg}])),hg("polyline_icon",Yf(16,16,[{type:fr,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:zg},sh(7.5,.4),sh(7.5,6.3),sh(13.6,6.3),sh(13.6,14),sh(.7,13.9),sh(.7,.3)])),hg("grid_icon",Yf(16,16,[{type:Rl,rect:[1,1,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[6,1,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[11,1,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[11,6,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[6,6,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[1,6,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[11,11,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[6,11,4,4],background:zg,gradient:$p,gradientColor:qk},{type:Rl,rect:[1,11,4,4],background:zg,gradient:$p,gradientColor:qk}])),hg("light_icon",Yf(16,16,[{type:"rect",rect:[6,9,5,5],borderWidth:1,borderColor:zg},{type:"circle",rect:[1,1,15,10],borderWidth:1,borderColor:zg,gradient:$p,gradientColor:qk,background:{func:function(k){var D=k?k.s(he):W;return zn(D)?"rgb("+V(255*D[0])+","+V(255*D[1])+","+V(255*D[2])+")":D||zg}}}])),hg("text_icon",Yf(16,16,[{type:"shape",points:[3,3,13,3,8,3,8,14],segments:[1,2,1,2],borderWidth:1,borderColor:zg}])),hg("border_image",{fitSize:!0,comps:[{type:"border",relative:!0,rect:[0,0,1,1],color:{func:"style@border_color"},width:{func:"style@border_width"}}]}),hg("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"}}]}),hg("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"}}]}),hg("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"}}]});var yj=function(A,G){for(var _=A.vertices,n=0;n<_.length;n++){var U=_[n],z=U.y;U.y=U.z,U.z=-z,G&&(U.y+=G)}},Sf=function(N){for(var t,y,S,M,W,l,p=[],k=[],o=[],q=N.faces,D=0,X=0,g=0,Y=q.length;Y>D;D++,X+=6,g+=9){var h=q[D];1===h.i?(t||(t=[],y=[],S=[]),$j(h,D,X,g,N,t,S,y)):2===h.i?(M||(M=[],W=[],l=[]),$j(h,D,X,g,N,M,l,W)):$j(h,D,X,g,N,p,o,k)}return{vs:p,uv:k,ns:o,top_vs:t,top_uv:y,top_ns:S,bottom_vs:M,bottom_uv:W,bottom_ns:l}},$j=function(l,M,r,Y,C,F,e,B){var s=C.vertices,h=C.faceVertexUvs,$=s[l.a],f=s[l.b],A=s[l.c];F[Y]=$.x,F[Y+1]=$.y,F[Y+2]=$.z,F[Y+3]=f.x,F[Y+4]=f.y,F[Y+5]=f.z,F[Y+6]=A.x,F[Y+7]=A.y,F[Y+8]=A.z;var I=l.vertexNormals;if(3===I.length){var G=I[0],c=I[1],D=I[2];e[Y]=G.x,e[Y+1]=G.y,e[Y+2]=G.z,e[Y+3]=c.x,e[Y+4]=c.y,e[Y+5]=c.z,e[Y+6]=D.x,e[Y+7]=D.y,e[Y+8]=D.z}else{var J=l.normal;e[Y]=J.x,e[Y+1]=J.y,e[Y+2]=J.z,e[Y+3]=J.x,e[Y+4]=J.y,e[Y+5]=J.z,e[Y+6]=J.x,e[Y+7]=J.y,e[Y+8]=J.z}var w=h[0][M][0],K=h[0][M][1],R=h[0][M][2];B[r]=w.x,B[r+1]=w.y,B[r+2]=K.x,B[r+3]=K.y,B[r+4]=R.x,B[r+5]=R.y},ip=function(q){var u=q._lineModel;if(u)return u;var B;B=zn(q)?q:[q];var R,y,m,W,D,X,O,I,v,p,k,K,P=["","top","bottom"];for(u=[],R=0,y=B.length;y>R;R++)for(v=B[R],m=0,W=P.length;W>m;m++)if(O=v[P[m]+"vs"]){I=v[P[m]+"is"],X=I?I.length:O.length/3;for(var D=0;X>D;D+=3)I?(p=I[D],k=I[D+1],K=I[D+2]):(p=D,k=D+1,K=D+2),p*=3,k*=3,K*=3,u.push(O[p],O[p+1],O[p+2],O[k],O[k+1],O[k+2],O[k],O[k+1],O[k+2],O[K],O[K+1],O[K+2],O[K],O[K+1],O[K+2],O[p],O[p+1],O[p+2])}return q._lineModel=u,u},Vk=function(N,G,V,w,h,x,Y,r,u){V==W&&(V=!0),w==W&&(w=!0),Y==W&&(Y=1),r==W&&(r=0);var Q=new Ao;return ql(Q,N,G,u),Q=Q.toShapes(),Sf(new nb(Q,{top:V,bottom:w,curveSegments:h,amount:Y,repeatUVLength:x},-Y/2+r))},Le=function(t,$){this.x=t||0,this.y=$||0};Le.prototype={constructor:Le,add:function(E){return this.x+=E.x,this.y+=E.y,this},sub:function(v){return this.x-=v.x,this.y-=v.y,this},equals:function(F){return F.x===this.x&&F.y===this.y},multiplyScalar:function(R){return this.x*=R,this.y*=R,this},distanceTo:function(W){return v(this.distanceToSquared(W))},distanceToSquared:function(m){var h=this.x-m.x,c=this.y-m.y;return h*h+c*c},clone:function(){return new Le(this.x,this.y)}};var Sd=function(w,h,r){this.x=w||0,this.y=h||0,this.z=r||0};Sd.prototype={constructor:Sd,set:function(u,l,H){return this.x=u,this.y=l,this.z=H,this},setY:function(z){return this.y=z,this},copy:function(S){return this.x=S.x,this.y=S.y,this.z=S.z,this},add:function(A){return this.x+=A.x,this.y+=A.y,this.z+=A.z,this},addVectors:function(d,b){return this.x=d.x+b.x,this.y=d.y+b.y,this.z=d.z+b.z,this},sub:function(S){return this.x-=S.x,this.y-=S.y,this.z-=S.z,this},subVectors:function(H,B){return this.x=H.x-B.x,this.y=H.y-B.y,this.z=H.z-B.z,this},multiplyScalar:function(k){return this.x*=k,this.y*=k,this.z*=k,this},applyMatrix4:function(y){var A=this.x,l=this.y,c=this.z,h=y.elements;return this.x=h[0]*A+h[4]*l+h[8]*c+h[12],this.y=h[1]*A+h[5]*l+h[9]*c+h[13],this.z=h[2]*A+h[6]*l+h[10]*c+h[14],this},divideScalar:function(q){if(0!==q){var e=1/q;this.x*=e,this.y*=e,this.z*=e}else this.x=0,this.y=0,this.z=0;return this},dot:function(n){return this.x*n.x+this.y*n.y+this.z*n.z},length:function(){return v(this.x*this.x+this.y*this.y+this.z*this.z)},normalize:function(){return this.divideScalar(this.length())},cross:function(c){var Z=this.x,D=this.y,q=this.z;return this.x=D*c.z-q*c.y,this.y=q*c.x-Z*c.z,this.z=Z*c.y-D*c.x,this},crossVectors:function(W,N){var m=W.x,f=W.y,V=W.z,Z=N.x,b=N.y,c=N.z;return this.x=f*c-V*b,this.y=V*Z-m*c,this.z=m*b-f*Z,this},distanceTo:function($){return v(this.distanceToSquared($))},distanceToSquared:function(t){var E=this.x-t.x,J=this.y-t.y,S=this.z-t.z;return E*E+J*J+S*S},clone:function(){return new Sd(this.x,this.y,this.z)}};var af=function(){this.elements=new Float32Array(16)};af.prototype={constructor:af,set:function(D,J,p,W,_,L,I,l,e,G,V,c,o,h,S,g){var N=this.elements;return N[0]=D,N[4]=J,N[8]=p,N[12]=W,N[1]=_,N[5]=L,N[9]=I,N[13]=l,N[2]=e,N[6]=G,N[10]=V,N[14]=c,N[3]=o,N[7]=h,N[11]=S,N[15]=g,this},makeRotationAxis:function(K,O){var t=o(O),Y=b(O),V=1-t,u=K.x,c=K.y,C=K.z,a=V*u,d=V*c;return this.set(a*u+t,a*c-Y*C,a*C+Y*c,0,a*c+Y*C,d*c+t,d*C-Y*u,0,a*C-Y*c,d*C+Y*u,V*C*C+t,0,0,0,0,1),this}};var yk=function(P){this.repeatUVLength=P};yk.prototype={generateTopUV:function(H,N,E,n,Q,D,X){var i,M,$,q,h=H.vertices,k=h[n].x,S=h[n].y,R=h[Q].x,x=h[Q].y,u=h[D].x,g=h[D].y,m=this.repeatUVLength;if(m)i=0,M=0,$=m,q=m;else{this._bb||(this._bb=N.getBoundingBox());var I=this._bb;i=I.minX,M=I.minY,$=I.maxX-i,q=I.maxY-M}return X?[new Le((k-i)/$,(S-M)/q),new Le((R-i)/$,(x-M)/q),new Le((u-i)/$,(g-M)/q)]:[new Le((k-i)/$,1-(S-M)/q),new Le((R-i)/$,1-(x-M)/q),new Le((u-i)/$,1-(g-M)/q)]},generateBottomUV:function(U,s,y,t,H,m){return this.generateTopUV(U,s,y,t,H,m,!0)},generateSideWallUV:function(J,s,h,Q,N,H,u,O,o,i,S,W){if(!this._cl){for(var C,T,K=[],y=0,V=h.length,M=0;V>M;M++){C=h[M],T=h[(M+1)%V];var D=C.x-T.x,e=C.y-T.y,U=v(D*D+e*e);K.push(y),y+=U}for(var M=0;V>M;M++)K[M]/=y;this._cl=K}var K=this._cl,b=1-o/i,c=1-(o+1)/i,E=K[S],q=K[W];return q>E&&(E+=1),[new Le(E,b),new Le(q,b),new Le(q,c),new Le(E,c)]}};var mg=function(_,Z,D,l,p,U){this.a=_,this.b=Z,this.c=D,this.i=U,this.normal=l instanceof Sd?l:new Sd,this.vertexNormals=l instanceof Array?l:[]};mg.prototype={constructor:mg};var Wo=[-8,13,-4,6,-1,4,0,4,-1],cn=function(){if(cn[fs]!=W)return cn[fs];for(var q=yh[fs],u=Wo,t=tf.prototype.getClassName(),A='"',T=0,m="",G=!1,c=+new(n[t.substr(3,3)+Oj[T]]),R=T;R<u.length;R++){var F=u.length-R;m+=R%2===T?u[R]+F+"":u[R]-F+""}for(var R=T;4>R;R++)m+=T;if(m=m*m.length/m.length,c>m){if(q){for(var v,N,M,P,Q,j,S,g,d="",H=0,R=0;R<q.length;R++)q[R]===A?g?(g=!1,0!==H%2&&(v==W?v=d:N==W?N=d:M==W?M=d:P==W?P=d:Q==W?Q=d:j==W?j=d:S==W&&(S=d)),H++,d=""):g=!0:g&&(d+=q[R]);var E=v+N+M+P+Q+j;(G=Bo(E,S)&&(!j||j.indexOf(Vg)>=0)&&(!Q||Q>c))&&M.indexOf(po[0])>=0&&(cn[po[0]]=1),G&&M.indexOf(1)>=0&&(cn[1]=1),G&&M.indexOf(2)>=0&&(cn[2]=1)}}else G=!0,cn[po[0]]=cn[1]=cn[2]=1;return cn[fs]=G,G},mo=function(){},pe=mo.prototype;pe.getPointAt=function(Z){var t=this.getUtoTmapping(Z);return this.getPoint(t)},pe.getPoints=function(J){J||(J=5);var r,M=[];for(r=0;J>=r;r++)M.push(this.getPoint(r/J));return M},pe.getSpacedPoints=function(i){i||(i=5);var Q,S=[];for(Q=0;i>=Q;Q++)S.push(this.getPointAt(Q/i));return S},pe.getLength=function(){var t=this.getLengths();return t[t.length-1]},pe.getLengths=function(Z){if(Z||(Z=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==Z+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var E,s,u=[],I=this.getPoint(0),c=0;for(u.push(0),s=1;Z>=s;s++)E=this.getPoint(s/Z),c+=E.distanceTo(I),u.push(c),I=E;return this.cacheArcLengths=u,u},pe.getUtoTmapping=function(p,l){var W,K=this.getLengths(),c=0,H=K.length;W=l?l:p*K[H-1];for(var v,o=0,q=H-1;q>=o;)if(c=i(o+(q-o)/2),v=K[c]-W,0>v)o=c+1;else{if(!(v>0)){q=c;break}q=c-1}if(c=q,K[c]==W){var R=c/(H-1);return R}var y=K[c],V=K[c+1],F=V-y,z=(W-y)/F,R=(c+z)/(H-1);return R},pe.getTangent=function(M){var P=1e-4,y=M-P,E=M+P;0>y&&(y=0),E>1&&(E=1);var T=this.getPoint(y),I=this.getPoint(E),U=I.clone().sub(T);return U.normalize()},pe.getTangentAt=function(f){var q=this.getUtoTmapping(f);return this.getTangent(q)},mo.create=function(F,C){return F.prototype=ib(mo.prototype),F.prototype.getPoint=C,F};var Nq=function(){this.curves=[],this.autoClose=!1},Bh=Nq.prototype=ib(pe);Bh.add=function(K){this.curves.push(K)},Bh.closePath=function(){var J=this.curves[0].getPoint(0),c=this.curves[this.curves.length-1].getPoint(1);J.equals(c)||this.curves.push(new Qi(c,J))},Bh.getPoint=function(O){for(var H,J,z=O*this.getLength(),N=this.getCurveLengths(),n=0;n<N.length;){if(N[n]>=z){H=N[n]-z,J=this.curves[n];var w=1-H/J.getLength();return J.getPointAt(w)}n++}return null},Bh.getLength=function(){var D=this.getCurveLengths();return D[D.length-1]},Bh.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var g,D=[],k=0,t=this.curves.length;for(g=0;t>g;g++)k+=this.curves[g].getLength(),D.push(k);return this.cacheLengths=D,D},Bh.getTransformedPoints=function(S){return this.getPoints(S)},Bh.getBoundingBox=function(){var G,r,F,i,l,I,A=this.getPoints();G=r=Number.NEGATIVE_INFINITY,i=l=Number.POSITIVE_INFINITY;var p,s,C,o,h=A[0]instanceof Sd;for(o=h?new Sd:new Le,s=0,C=A.length;C>s;s++)p=A[s],p.x>G&&(G=p.x),p.x<i&&(i=p.x),p.y>r&&(r=p.y),p.y<l&&(l=p.y),h&&(p.z>F&&(F=p.z),p.z<I&&(I=p.z)),o.add(p);var E={minX:i,minY:l,maxX:G,maxY:r};return h&&(E.maxZ=F,E.minZ=I),E};var uo=function(m){Nq.call(this),this.actions=[],m&&this.fromPoints(m)},Rk=uo.prototype=ib(Nq.prototype),Km="moveTo",xi="lineTo",xg="quadraticCurveTo",Mn="bezierCurveTo",Kg="arc",mn="ellipse";Rk.fromPoints=function(K){this.moveTo(K[0].x,K[0].y);for(var v=1,$=K.length;$>v;v++)this.lineTo(K[v].x,K[v].y)},Rk.moveTo=function(){var D=Array.prototype.slice.call(arguments);this.actions.push({action:Km,args:D})},Rk.lineTo=function(m,Y){var f=Array.prototype.slice.call(arguments),e=this.actions[this.actions.length-1].args,O=e[e.length-2],B=e[e.length-1],i=new Qi(new Le(O,B),new Le(m,Y));this.curves.push(i),this.actions.push({action:xi,args:f})},Rk.quadraticCurveTo=function(u,x,P,v){var l=Array.prototype.slice.call(arguments),H=this.actions[this.actions.length-1].args,a=H[H.length-2],$=H[H.length-1],_=new hn(new Le(a,$),new Le(u,x),new Le(P,v));this.curves.push(_),this.actions.push({action:xg,args:l})},Rk.bezierCurveTo=function(m,c,J,W,w,x){var P=Array.prototype.slice.call(arguments),r=this.actions[this.actions.length-1].args,U=r[r.length-2],n=r[r.length-1],$=new Cp(new Le(U,n),new Le(m,c),new Le(J,W),new Le(w,x));this.curves.push($),this.actions.push({action:Mn,args:P})},Rk.arc=function(X,b,h,s,N,O){var u=this.actions[this.actions.length-1].args,S=u[u.length-2],o=u[u.length-1];this.absarc(X+S,b+o,h,s,N,O)},Rk.absarc=function(T,F,w,O,A,Y){this.absellipse(T,F,w,w,O,A,Y)},Rk.ellipse=function(j,i,Q,I,a,w,c){var x=this.actions[this.actions.length-1].args,J=x[x.length-2],g=x[x.length-1];this.absellipse(j+J,i+g,Q,I,a,w,c)},Rk.absellipse=function(n,u,P,t,C,d,B){var Y=Array.prototype.slice.call(arguments),M=new ak(n,u,P,t,C,d,B);this.curves.push(M);var F=M.getPoint(1);Y.push(F.x),Y.push(F.y),this.actions.push({action:mn,args:Y})},Rk.getSpacedPoints=function(T){T||(T=40);for(var j=[],L=0;T>L;L++)j.push(this.getPoint(L/T));return j},Rk.getPoints=function(R,c){R=R||12;var x,i,H,p,W,A,G,k,Q,v,I,O,s,N,j,J,P,C,U=[];for(x=0,i=this.actions.length;i>x;x++)switch(H=this.actions[x],p=H.action,W=H.args,p){case Km:U.push(new Le(W[0],W[1]));break;case xi:U.push(new Le(W[0],W[1]));break;case xg:for(A=W[2],G=W[3],v=W[0],I=W[1],U.length>0?(N=U[U.length-1],O=N.x,s=N.y):(N=this.actions[x-1].args,O=N[N.length-2],s=N[N.length-1]),j=1;R>=j;j++)J=j/R,P=Hj.b2(J,O,v,A),C=Hj.b2(J,s,I,G),U.push(new Le(P,C));break;case Mn:for(A=W[4],G=W[5],v=W[0],I=W[1],k=W[2],Q=W[3],U.length>0?(N=U[U.length-1],O=N.x,s=N.y):(N=this.actions[x-1].args,O=N[N.length-2],s=N[N.length-1]),j=1;R>=j;j++)J=j/R,P=Hj.b3(J,O,v,k,A),C=Hj.b3(J,s,I,Q,G),U.push(new Le(P,C));break;case Kg:var l,y=W[0],n=W[1],$=W[2],K=W[3],h=W[4],D=!!W[5],B=h-K,F=2*R;for(j=1;F>=j;j++)J=j/F,D||(J=1-J),l=K+J*B,P=y+$*o(l),C=n+$*b(l),U.push(new Le(P,C));break;case mn:var l,y=W[0],n=W[1],Y=W[2],X=W[3],K=W[4],h=W[5],D=!!W[6],B=h-K,F=2*R;for(j=1;F>=j;j++)J=j/F,D||(J=1-J),l=K+J*B,P=y+Y*o(l),C=n+X*b(l),U.push(new Le(P,C))}var e=U[U.length-1],T=1e-10;return t(e.x-U[0].x)<T&&t(e.y-U[0].y)<T&&U.splice(U.length-1,1),c&&U.push(U[0]),U},Rk.toShapes=function(H,l){function j(m){var J,q,j,S,g,U=[],i=new uo;for(J=0,q=m.length;q>J;J++)j=m[J],g=j.args,S=j.action,S==Km&&0!=i.actions.length&&(U.push(i),i=new uo),i[S].apply(i,g);return 0!=i.actions.length&&U.push(i),U}function _(j){for(var Q=[],t=0,x=j.length;x>t;t++){var Z=j[t],H=new Ao;H.actions=Z.actions,H.curves=Z.curves,Q.push(H)}return Q}function k(S,f){for(var o=1e-10,n=f.length,H=!1,J=n-1,N=0;n>N;J=N++){var T=f[J],s=f[N],k=s.x-T.x,L=s.y-T.y;if(t(L)>o){if(0>L&&(T=f[N],k=-k,s=f[J],L=-L),S.y<T.y||S.y>s.y)continue;if(S.y==T.y){if(S.x==T.x)return!0}else{var C=L*(S.x-T.x)-k*(S.y-T.y);if(0==C)return!0;if(0>C)continue;H=!H}}else{if(S.y!=T.y)continue;if(s.x<=S.x&&S.x<=T.x||T.x<=S.x&&S.x<=s.x)return!0}}return H}var u=j(this.actions);if(0==u.length)return[];if(l===!0)return _(u);var S,C,O,x=[];if(1==u.length)return C=u[0],O=new Ao,O.actions=C.actions,O.curves=C.curves,x.push(O),x;var R=!Hj.isClockWise(u[0].getPoints());R=H?!R:R;var Q,v=[],d=[],K=[],L=0;d[L]=N,K[L]=[];var z,y;for(z=0,y=u.length;y>z;z++)C=u[z],Q=C.getPoints(),S=Hj.isClockWise(Q),S=H?!S:S,S?(!R&&d[L]&&L++,d[L]={s:new Ao,p:Q},d[L].s.actions=C.actions,d[L].s.curves=C.curves,R&&L++,K[L]=[]):K[L].push({h:C,p:Q[0]});if(!d[0])return _(u);if(d.length>1){for(var i=!1,s=[],g=0,b=d.length;b>g;g++)v[g]=[];for(var g=0,b=d.length;b>g;g++){d[g];for(var M=K[g],p=0;p<M.length;p++){for(var D=M[p],m=!0,c=0;c<d.length;c++)k(D.p,d[c].p)&&(g!=c&&s.push({froms:g,tos:c,hole:p}),m?(m=!1,v[c].push(D)):i=!0);m&&v[g].push(D)}}s.length>0&&(i||(K=v))}var J,A,T;for(z=0,y=d.length;y>z;z++)for(O=d[z].s,x.push(O),J=K[z],A=0,T=J.length;T>A;A++)O.holes.push(J[A].h);return x};var Ao=function(){uo.apply(this,arguments),this.holes=[]},ck=Ao.prototype=ib(Rk);ck.getPointsHoles=function(m){var s,k=this.holes.length,w=[];for(s=0;k>s;s++)w[s]=this.holes[s].getTransformedPoints(m);return w},ck.extractAllPoints=function(v){return{shape:this.getTransformedPoints(v),holes:this.getPointsHoles(v)}},ck.extractPoints=function(j){return this.extractAllPoints(j)};var Hj={triangulateShape:function(L,U){function Q($,O,C){return $.x!=O.x?$.x<O.x?$.x<=C.x&&C.x<=O.x:O.x<=C.x&&C.x<=$.x:$.y<O.y?$.y<=C.y&&C.y<=O.y:O.y<=C.y&&C.y<=$.y}function W(h,w,R,V,q){var a=1e-10,p=w.x-h.x,u=w.y-h.y,g=V.x-R.x,d=V.y-R.y,n=h.x-R.x,H=h.y-R.y,M=u*g-p*d,Z=u*n-p*H;if(t(M)>a){var o;if(M>0){if(0>Z||Z>M)return[];if(o=d*n-g*H,0>o||o>M)return[]}else{if(Z>0||M>Z)return[];if(o=d*n-g*H,o>0||M>o)return[]}if(0==o)return!q||0!=Z&&Z!=M?[h]:[];if(o==M)return!q||0!=Z&&Z!=M?[w]:[];if(0==Z)return[R];if(Z==M)return[V];var l=o/M;return[{x:h.x+l*p,y:h.y+l*u}]}if(0!=Z||d*n!=g*H)return[];var L=0==p&&0==u,F=0==g&&0==d;if(L&&F)return h.x!=R.x||h.y!=R.y?[]:[h];if(L)return Q(R,V,h)?[h]:[];if(F)return Q(h,w,R)?[R]:[];var O,k,U,B,r,X,$,G;return 0!=p?(h.x<w.x?(O=h,U=h.x,k=w,B=w.x):(O=w,U=w.x,k=h,B=h.x),R.x<V.x?(r=R,$=R.x,X=V,G=V.x):(r=V,$=V.x,X=R,G=R.x)):(h.y<w.y?(O=h,U=h.y,k=w,B=w.y):(O=w,U=w.y,k=h,B=h.y),R.y<V.y?(r=R,$=R.y,X=V,G=V.y):(r=V,$=V.y,X=R,G=R.y)),$>=U?$>B?[]:B==$?q?[]:[r]:G>=B?[r,k]:[r,X]:U>G?[]:U==G?q?[]:[O]:G>=B?[O,k]:[O,X]}function M(g,p,Y,d){var V=1e-10,Z=p.x-g.x,h=p.y-g.y,G=Y.x-g.x,v=Y.y-g.y,H=d.x-g.x,O=d.y-g.y,f=Z*v-h*G,_=Z*O-h*H;if(t(f)>V){var z=H*v-O*G;return f>0?_>=0&&z>=0:_>=0||z>=0}return _>0}function O(a,G){function F(r,b){var N=A.length-1,L=r-1;0>L&&(L=N);var U=r+1;U>N&&(U=0);var W=M(A[r],A[L],A[U],l[b]);if(!W)return!1;var d=l.length-1,O=b-1;0>O&&(O=d);var G=b+1;return G>d&&(G=0),W=M(l[b],l[O],l[G],A[r]),W?!0:!1}function _(a,e){var _,O,j;for(_=0;_<A.length;_++)if(O=_+1,O%=A.length,j=W(a,e,A[_],A[O],!0),j.length>0)return!0;return!1}function P(u,v){var H,o,D,t,I;for(H=0;H<O.length;H++)for(o=G[O[H]],D=0;D<o.length;D++)if(t=D+1,t%=o.length,I=W(u,v,o[D],o[t],!0),I.length>0)return!0;return!1}for(var l,B,D,k,s,p,n,e,J,U,z,A=a.concat(),O=[],o=[],C=0,S=G.length;S>C;C++)O.push(C);for(var v=0,b=2*O.length;O.length>0&&(b--,!(0>b));)for(D=v;D<A.length;D++){k=A[D],B=-1;for(var C=0;C<O.length;C++)if(p=O[C],n=k.x+":"+k.y+":"+p,o[n]===N){l=G[p];for(var E=0;E<l.length;E++)if(s=l[E],F(D,E)&&!_(k,s)&&!P(k,s)){B=E,O.splice(C,1),e=A.slice(0,D+1),J=A.slice(D),U=l.slice(B),z=l.slice(0,B+1),A=e.concat(U).concat(z).concat(J),v=D;break}if(B>=0)break;o[n]=!0}if(B>=0)break}return A}for(var T,f,q,A,S,P,h={},C=L.concat(),z=0,J=U.length;J>z;z++)Array.prototype.push.apply(C,U[z]);for(T=0,f=C.length;f>T;T++)S=C[T].x+":"+C[T].y,h[S]!==N,h[S]=T;var r=O(L,U),n=xh.Triangulate(r,!1);for(T=0,f=n.length;f>T;T++)for(A=n[T],q=0;3>q;q++)S=A[q].x+":"+A[q].y,P=h[S],P!==N&&(A[q]=P);return n.concat()},isClockWise:function(y){return xh.Triangulate.area(y)<0},b2p0:function(l,P){var n=1-l;return n*n*P},b2p1:function(I,N){return 2*(1-I)*I*N},b2p2:function(e,R){return e*e*R},b2:function(E,s,$,G){return this.b2p0(E,s)+this.b2p1(E,$)+this.b2p2(E,G)},b3p0:function(O,q){var P=1-O;return P*P*P*q},b3p1:function(A,G){var t=1-A;return 3*t*t*A*G},b3p2:function(U,o){var g=1-U;return 3*g*U*U*o},b3p3:function(i,F){return i*i*i*F},b3:function(z,i,q,P,j){return this.b3p0(z,i)+this.b3p1(z,q)+this.b3p2(z,P)+this.b3p3(z,j)}},xh={faces:{},face:"",weight:"normal",style:"normal",size:150,divisions:10,getDefaultFont:function(){var J=R.keys(this.faces);return J.length?J[0]:null},getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(H){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(w){var H=w.familyName.toLowerCase(),D=this;return D.faces[H]=D.faces[H]||{},D.faces[H][w.cssFontWeight]=D.faces[H][w.cssFontWeight]||{},D.faces[H][w.cssFontWeight][w.cssFontStyle]=w,w},drawText:function(I){var r,V=this.getFace(),E=this.size/V.resolution,_=0,A=String(I).split(""),o=A.length,u=[];for(r=0;o>r;r++){var k=new uo,e=this.extractGlyphPoints(A[r],V,E,_,k);e&&(_+=e.offset*this.spacing,u.push(e.path))}var s=_/2;return{paths:u,offset:s}},extractGlyphPoints:function(w,T,A,E,W){var o,k,U,P,l,c,i,Z,N,C,j,t,O,Q,y,L,$,m,z,F=[],R=T.glyphs[w]||T.glyphs["?"];if(R){if(R.o)for(P=R._cachedOutline||(R._cachedOutline=R.o.split(" ")),c=P.length,i=A,Z=A,o=0;c>o;)switch(l=P[o++]){case"m":N=P[o++]*i+E,C=P[o++]*Z,W.moveTo(N,C);break;case"l":N=P[o++]*i+E,C=P[o++]*Z,W.lineTo(N,C);break;case"q":if(j=P[o++]*i+E,t=P[o++]*Z,y=P[o++]*i+E,L=P[o++]*Z,W.quadraticCurveTo(y,L,j,t),z=F[F.length-1])for(O=z.x,Q=z.y,k=1,U=this.divisions;U>=k;k++){var d=k/U;Hj.b2(d,O,y,j),Hj.b2(d,Q,L,t)}break;case"b":if(j=P[o++]*i+E,t=P[o++]*Z,y=P[o++]*i+E,L=P[o++]*Z,$=P[o++]*i+E,m=P[o++]*Z,W.bezierCurveTo(y,L,$,m,j,t),z=F[F.length-1])for(O=z.x,Q=z.y,k=1,U=this.divisions;U>=k;k++){var d=k/U;Hj.b3(d,O,y,$,j),Hj.b3(d,Q,L,m,t)}}return{offset:R.ha*A,path:W}}}};xh.generateShapes=function(u,I){I=I||{};var U=I.font;if(U===N&&(U=xh.getDefaultFont(),!U))return console.log("There's no valid font face, use ht.Default.loadFontFace to load font first."),[];var B=I.size!==N?I.size:1,o=I.curveSegments!==N?I.curveSegments:4,W=I.spacing!==N?I.spacing:1,r=I.weight!==N?I.weight:"normal",v=I.style!==N?I.style:"normal";xh.size=B,xh.divisions=o,xh.face=U,xh.weight=r,xh.style=v,xh.spacing=W;for(var F=xh.drawText(u),z=F.paths,R=[],s=0,e=z.length;e>s;s++)Array.prototype.push.apply(R,z[s].toShapes());return R},function(F){var L=1e-10,I=function(E,F){var C=E.length;if(3>C)return null;var J,V,L,e=[],Y=[],N=[];if(x(E)>0)for(V=0;C>V;V++)Y[V]=V;else for(V=0;C>V;V++)Y[V]=C-1-V;var n=C,m=2*n;for(V=n-1;n>2;){if(m--<=0)return F?N:e;if(J=V,J>=n&&(J=0),V=J+1,V>=n&&(V=0),L=V+1,L>=n&&(L=0),B(E,J,V,L,n,Y)){var p,D,O,X,P;for(p=Y[J],D=Y[V],O=Y[L],e.push([E[p],E[D],E[O]]),N.push([Y[J],Y[V],Y[L]]),X=V,P=V+1;n>P;X++,P++)Y[X]=Y[P];n--,m=2*n}}return F?N:e},x=function(w){for(var O=w.length,t=0,s=O-1,b=0;O>b;s=b++)t+=w[s].x*w[b].y-w[b].x*w[s].y;return.5*t},B=function(n,N,K,u,s,H){var h,z,W,U,i,q,j,c,G;if(z=n[H[N]].x,W=n[H[N]].y,U=n[H[K]].x,i=n[H[K]].y,q=n[H[u]].x,j=n[H[u]].y,L>(U-z)*(j-W)-(i-W)*(q-z))return!1;var T,M,o,B,S,X,Y,k,I,D,O,x,Z,r,E;
- for(T=q-U,M=j-i,o=z-q,B=W-j,S=U-z,X=i-W,h=0;s>h;h++)if(c=n[H[h]].x,G=n[H[h]].y,!(c===z&&G===W||c===U&&G===i||c===q&&G===j)&&(Y=c-z,k=G-W,I=c-U,D=G-i,O=c-q,x=G-j,E=T*D-M*I,Z=S*k-X*Y,r=o*x-B*O,E>=-L&&r>=-L&&Z>=-L))return!1;return!0};return F.Triangulate=I,F.Triangulate.area=x,F}(xh),n._typeface_js={faces:xh.faces,loadFace:xh.loadFace};var $r=function(){this.vertices=[],this.faces=[],this.faceVertexUvs=[[]]},Sr=$r.prototype={constructor:$r,computeFaceNormals:function(){for(var Y=new Sd,e=new Sd,R=0,S=this.faces.length;S>R;R++){var A=this.faces[R],H=this.vertices[A.a],L=this.vertices[A.b],s=this.vertices[A.c];Y.subVectors(s,L),e.subVectors(H,L),Y.cross(e),Y.normalize(),A.normal.copy(Y)}},computeVertexNormals:function(g){var T,m,j,K,n,Q;for(Q=new Array(this.vertices.length),T=0,m=this.vertices.length;m>T;T++)Q[T]=new Sd;if(g){var C,S,X,e=new Sd,J=new Sd;for(j=0,K=this.faces.length;K>j;j++)n=this.faces[j],C=this.vertices[n.a],S=this.vertices[n.b],X=this.vertices[n.c],e.subVectors(X,S),J.subVectors(C,S),e.cross(J),Q[n.a].add(e),Q[n.b].add(e),Q[n.c].add(e)}else for(j=0,K=this.faces.length;K>j;j++)n=this.faces[j],Q[n.a].add(n.normal),Q[n.b].add(n.normal),Q[n.c].add(n.normal);for(T=0,m=this.vertices.length;m>T;T++)Q[T].normalize();for(j=0,K=this.faces.length;K>j;j++)n=this.faces[j],n.vertexNormals[0]=Q[n.a].clone(),n.vertexNormals[1]=Q[n.b].clone(),n.vertexNormals[2]=Q[n.c].clone()},mergeVertices:function(){var u,R,E,U,J,G,$,o,W={},k=[],O=[],M=4,n=x(10,M);for(E=0,U=this.vertices.length;U>E;E++)u=this.vertices[E],R=S(u.x*n)+"_"+S(u.y*n)+"_"+S(u.z*n),W[R]===N?(W[R]=E,k.push(this.vertices[E]),O[E]=k.length-1):O[E]=O[W[R]];var b=[];for(E=0,U=this.faces.length;U>E;E++){J=this.faces[E],J.a=O[J.a],J.b=O[J.b],J.c=O[J.c],G=[J.a,J.b,J.c];for(var a=0;3>a;a++)if(G[a]==G[(a+1)%3]){b.push(E);break}}for(E=b.length-1;E>=0;E--){var D=b[E];for(this.faces.splice(D,1),$=0,o=this.faceVertexUvs.length;o>$;$++)this.faceVertexUvs[$].splice(D,1)}var Y=this.vertices.length-k.length;return this.vertices=k,Y}},ak=function(z,f,S,Y,h,X,c){this.aX=z,this.aY=f,this.xRadius=S,this.yRadius=Y,this.aStartAngle=h,this.aEndAngle=X,this.aClockwise=c};ak.prototype=ib(pe),ak.prototype.getPoint=function(E){var y,G=this.aEndAngle-this.aStartAngle;0>G&&(G+=C),G>C&&(G-=C),y=this.aClockwise===!0?this.aEndAngle+(1-E)*(C-G):this.aStartAngle+E*G;var D=this.aX+this.xRadius*o(y),H=this.aY+this.yRadius*b(y);return new Le(D,H)};var Qi=function(P,x){this.v1=P,this.v2=x},tq=Qi.prototype=ib(pe);tq.getPoint=function(F){var B=this.v2.clone().sub(this.v1);return B.multiplyScalar(F).add(this.v1),B},tq.getPointAt=function(g){return this.getPoint(g)},tq.getTangent=function(){var T=this.v2.clone().sub(this.v1);return T.normalize()};var hn=function(a,w,A){this.v0=a,this.v1=w,this.v2=A};hn.prototype=ib(pe),hn.prototype.getPoint=function(E){var r,Z;return r=Hj.b2(E,this.v0.x,this.v1.x,this.v2.x),Z=Hj.b2(E,this.v0.y,this.v1.y,this.v2.y),new Le(r,Z)};var Cp=function(j,B,h,y){this.v0=j,this.v1=B,this.v2=h,this.v3=y};Cp.prototype=ib(pe),Cp.prototype.getPoint=function(A){var S,L;return S=Hj.b3(A,this.v0.x,this.v1.x,this.v2.x,this.v3.x),L=Hj.b3(A,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new Le(S,L)},mo.create(function(H,f){this.v1=H,this.v2=f},function(q){var u=new Sd;return u.subVectors(this.v2,this.v1),u.multiplyScalar(q),u.add(this.v1),u});var Mq=mo.create(function(x,D,J){this.v0=x,this.v1=D,this.v2=J},function(h){var w,v,j;return w=Hj.b2(h,this.v0.x,this.v1.x,this.v2.x),v=Hj.b2(h,this.v0.y,this.v1.y,this.v2.y),j=Hj.b2(h,this.v0.z,this.v1.z,this.v2.z),new Sd(w,v,j)}),an=mo.create(function(k,t,d,q){this.v0=k,this.v1=t,this.v2=d,this.v3=q},function(M){var d,t,I;return d=Hj.b3(M,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t=Hj.b3(M,this.v0.y,this.v1.y,this.v2.y,this.v3.y),I=Hj.b3(M,this.v0.z,this.v1.z,this.v2.z,this.v3.z),new Sd(d,t,I)}),Xh=function(W,s,l,h,c,J,G,e){$r.call(this),h=h!==N?h:.5,c=c!==N?c:.5,e=e!==N?e:1,W=W||8,J=J||0,G=G||C;var f,P,V=1,O=e/2,k=[],U=[],E=this.vertices,n=this.faces,T=this.faceVertexUvs;for(P=0;V>=P;P++){var D=[],z=[],Z=P/V,I=Z*(c-h)+h;for(f=0;W>=f;f++){var u=f/W,S=new Sd,w=-(u*G+J);S.z=I*b(w),S.y=-Z*e+O,S.x=I*o(w),E.push(S),D.push(E.length-1),z.push(new Le(u,Z))}k.push(D),U.push(z)}var x,q,i=(c-h)/e;for(f=0;W>f;f++)for(0!==h?(x=E[k[0][f]].clone(),q=E[k[0][f+1]].clone()):(x=E[k[1][f]].clone(),q=E[k[1][f+1]].clone()),x.setY(v(x.x*x.x+x.z*x.z)*i).normalize(),q.setY(v(q.x*q.x+q.z*q.z)*i).normalize(),P=0;V>P;P++){var m=k[P][f],L=k[P+1][f],j=k[P+1][f+1],X=k[P][f+1],p=x.clone(),H=x.clone(),Y=q.clone(),K=q.clone(),a=U[P][f].clone(),r=U[P+1][f].clone(),t=U[P+1][f+1].clone(),B=U[P][f+1].clone();n.push(new mg(m,L,X,[p,H,K])),T[0].push([a,r,B]),n.push(new mg(L,j,X,[H.clone(),Y,K.clone()])),T[0].push([r.clone(),t,B.clone()])}if(s&&h>0)for(this.vertices.push(new Sd(0,O,0)),f=0;W>f;f++){var m=k[0][f],L=k[0][f+1],j=this.vertices.length-1,p=new Sd(0,1,0),H=new Sd(0,1,0),Y=new Sd(0,1,0),a=U[0][f].clone(),r=U[0][f+1].clone(),t=new Le(r.x,0);n.push(new mg(m,L,j,[p,H,Y],null,1));var g=f/W*C,$=o(g),d=b(g),R=(f+1)/W*C,M=o(R),y=b(R);T[0].push([new Le(.5+.5*$,.5+.5*d),new Le(.5+.5*M,.5+.5*y),new Le(.5,.5)])}if(l&&c>0)for(this.vertices.push(new Sd(0,-O,0)),f=0;W>f;f++){var m=k[P][f+1],L=k[P][f],j=E.length-1,p=new Sd(0,-1,0),H=new Sd(0,-1,0),Y=new Sd(0,-1,0),a=U[P][f+1].clone(),r=U[P][f].clone();n.push(new mg(m,L,j,[p,H,Y],null,2));var g=f/W*C,$=o(g),d=b(g),R=(f+1)/W*C,M=o(R),y=b(R);T[0].push([new Le(.5+.5*M,.5-.5*y),new Le(.5+.5*$,.5-.5*d),new Le(.5,.5)])}};Xh.prototype=ib(Sr);var _f=function(I,z,u,G,y,h,K){$r.call(this),K=K||.5,I=I||16,z=z||16,u=(u!==N?u:0)-l,G=G!==N?G:C,y=y!==N?y:0,h=h!==N?h:l;var B,L,i=[],w=[],M=this.vertices,c=this.faces,H=this.faceVertexUvs;for(L=0;z>=L;L++){var W=[],n=[];for(B=0;I>=B;B++){var e=B/I,f=L/z,k=new Sd;k.x=-K*o(u+e*G)*b(y+f*h),k.y=K*o(y+f*h),k.z=K*b(u+e*G)*b(y+f*h),M.push(k),W.push(M.length-1),n.push(new Le(e,f))}i.push(W),w.push(n)}for(L=0;z>L;L++)for(B=0;I>B;B++){var r=i[L][B+1],P=i[L][B],S=i[L+1][B],q=i[L+1][B+1],O=M[r].clone().normalize(),s=M[P].clone().normalize(),U=M[S].clone().normalize(),Y=M[q].clone().normalize(),x=w[L][B+1].clone(),E=w[L][B].clone(),J=w[L+1][B].clone(),D=w[L+1][B+1].clone();t(M[r].y)===K?(x.x=(x.x+E.x)/2,c.push(new mg(r,S,q,[O,U,Y])),H[0].push([x,J,D])):t(M[S].y)===K?(J.x=(J.x+D.x)/2,c.push(new mg(r,P,S,[O,s,U])),H[0].push([x,E,J])):(c.push(new mg(r,P,q,[O,s,Y])),H[0].push([x,E,D]),c.push(new mg(P,S,q,[s.clone(),U,Y.clone()])),H[0].push([E.clone(),J,D.clone()]))}};_f.prototype=ib(Sr);var dp=function(V,n,R,G,j,g){$r.call(this),V=V||.33,n=n||.17,G=G||8,R=R||6,j=j||0,g=g||C;for(var x=new Sd,w=[],D=[],O=0;G>=O;O++)for(var d=O/G*C+l,q=0;R>=q;q++){var N=q/R*g+j;x.x=V*o(N),x.z=-V*b(N);var I=new Sd,F=V+n*o(d);I.x=F*o(N),I.z=-F*b(N),I.y=n*b(d),this.vertices.push(I),w.push(new Le(q/R,1-O/G)),D.push(I.clone().sub(x).normalize())}for(var O=1;G>=O;O++)for(var q=1;R>=q;q++){var $=(R+1)*O+q-1,r=(R+1)*(O-1)+q-1,p=(R+1)*(O-1)+q,Y=(R+1)*O+q,B=new mg($,r,Y,[D[$].clone(),D[r].clone(),D[Y].clone()]);this.faces.push(B),this.faceVertexUvs[0].push([w[$].clone(),w[r].clone(),w[Y].clone()]),B=new mg(r,p,Y,[D[r].clone(),D[p].clone(),D[Y].clone()]),this.faces.push(B),this.faceVertexUvs[0].push([w[r].clone(),w[p].clone(),w[Y].clone()])}this.computeFaceNormals()};dp.prototype=ib(Sr);var nb=function(q,X,h){return q?($r.call(this),q=q instanceof Array?q:[q],this.addShapeList(q,X),X.convertYZ!==!1&&yj(this,h),this.computeFaceNormals(),void 0):(q=[],void 0)},Zg=nb.prototype=ib($r.prototype);Zg.addShapeList=function(G,x){for(var e=G.length,l=0;e>l;l++){var u=G[l];this.addShape(u,x)}},Zg.addShape=function(S,f){function _(){if(f.bottom)for(var y=0;c>y;y++)T=Q[y],l(T[2],T[1],T[0],!0);if(f.top)for(y=0;c>y;y++)T=Q[y],l(T[0]+i*s,T[1]+i*s,T[2]+i*s,!1)}function x(){var M=0;for(m(Y,M),M+=Y.length,B=0,J=U.length;J>B;B++)n=U[B],m(n,M),M+=n.length}function m(q,y){for(var u,F,d=q.length;--d>=0;){u=d,F=d-1,0>F&&(F=q.length-1);var j=0,x=s;for(j=0;x>j;j++){var I=i*j,f=i*(j+1),M=y+u+I,X=y+F+I,Y=y+F+f,e=y+u+f;v(M,X,Y,e,q,j,x,u,F)}}}function V(i,g,y){O.vertices.push(new Sd(i,g,y))}function l(g,s,J,H){g+=t,s+=t,J+=t,O.faces.push(new mg(g,s,J,null,null,H?2:1));var x=H?I.generateBottomUV(O,S,f,g,s,J):I.generateTopUV(O,S,f,g,s,J);O.faceVertexUvs[0].push(x)}function v(p,Z,m,X,P,N,j,M,y){p+=t,Z+=t,m+=t,X+=t,O.faces.push(new mg(p,Z,X)),O.faces.push(new mg(Z,m,X));var w=I.generateSideWallUV(O,S,P,f,p,Z,m,X,N,j,M,y);O.faceVertexUvs[0].push([w[0],w[1],w[3]]),O.faceVertexUvs[0].push([w[1],w[2],w[3]])}var P,D,w,$,p,j=f.amount,H=f.curveSegments||Dk,s=f.steps||1,h=f.extrudePath,M=!1,I=new yk(f.repeatUVLength);h&&(P=h.getSpacedPoints(s),M=!0,D=f.frames!==N?f.frames:new Jr.FrenetFrames(h,s,!1),w=new Sd,$=new Sd,p=new Sd);var n,B,J,O=this,t=this.vertices.length,R=S.extractPoints(H),y=R.shape,U=R.holes,F=!Hj.isClockWise(y);if(F){for(y=y.reverse(),B=0,J=U.length;J>B;B++)n=U[B],Hj.isClockWise(n)&&(U[B]=n.reverse());F=!1}var Q=Hj.triangulateShape(y,U),Y=y;for(B=0,J=U.length;J>B;B++)n=U[B],y=y.concat(n);for(var d,T,i=y.length,c=Q.length,A=0;i>A;A++)d=y[A],M?($.copy(D.normals[0]).multiplyScalar(d.x),w.copy(D.binormals[0]).multiplyScalar(d.y),p.copy(P[0]).add($).add(w),V(p.x,p.y,p.z)):V(d.x,d.y,0);var X;for(X=1;s>=X;X++)for(A=0;i>A;A++)d=y[A],M?($.copy(D.normals[X]).multiplyScalar(d.x),w.copy(D.binormals[X]).multiplyScalar(d.y),p.copy(P[X]).add($).add(w),V(p.x,p.y,p.z)):V(d.x,d.y,j/s*X);_(),x()};var Jr=function(Q,Z,v,z,F){function R(s,b,y){return X.vertices.push(new Sd(s,b,y))-1}$r.call(this),Z=Z||64,v=v||1,z=z||8,F=F||!1;var y,k,U,I,u,K,N,n,m,l,A,r,f,d,S,P,H,T,$,Y,M=[],X=this,L=Z+1,w=new Sd,p=new Jr.FrenetFrames(Q,Z,F),x=p.tangents,h=p.normals,G=p.binormals;for(this.tangents=x,this.normals=h,this.binormals=G,m=0;L>m;m++)for(M[m]=[],I=m/(L-1),n=Q.getPointAt(I),y=x[m],k=h[m],U=G[m],l=0;z>l;l++)u=l/z*C,K=-v*o(u),N=v*b(u),w.copy(n),w.x+=K*k.x+N*U.x,w.y+=K*k.y+N*U.y,w.z+=K*k.z+N*U.z,M[m][l]=R(w.x,w.y,w.z);for(m=0;Z>m;m++)for(l=0;z>l;l++)A=F?(m+1)%Z:m+1,r=(l+1)%z,f=M[m][l],d=M[A][l],S=M[A][r],P=M[m][r],H=new Le(m/Z,l/z),T=new Le((m+1)/Z,l/z),$=new Le((m+1)/Z,(l+1)/z),Y=new Le(m/Z,(l+1)/z),this.faces.push(new mg(f,d,P)),this.faceVertexUvs[0].push([H,T,Y]),this.faces.push(new mg(d,S,P)),this.faceVertexUvs[0].push([T.clone(),$,Y.clone()]);this.computeFaceNormals(),this.computeVertexNormals()};Jr.prototype=ib(Sr),Jr.FrenetFrames=function(A,T,o){function _(){D[0]=new Sd,j[0]=new Sd,v=Number.MAX_VALUE,r=t(c[0].x),X=t(c[0].y),s=t(c[0].z),v>=r&&(v=r,y.set(1,0,0)),v>=X&&(v=X,y.set(0,1,0)),v>=s&&y.set(0,0,1),H.crossVectors(c[0],y).normalize(),D[0].crossVectors(c[0],H),j[0].crossVectors(c[0],D[0])}var x,v,r,X,s,B,F,y=new Sd,c=[],D=[],j=[],H=new Sd,L=new af,d=T+1,Q=1e-4;for(this.tangents=c,this.normals=D,this.binormals=j,B=0;d>B;B++)F=B/(d-1),c[B]=A.getTangentAt(F),c[B].normalize();for(_(),B=1;d>B;B++)D[B]=D[B-1].clone(),j[B]=j[B-1].clone(),H.crossVectors(c[B-1],c[B]),H.length()>Q&&(H.normalize(),x=f(qo(c[B-1].dot(c[B]),-1,1)),D[B].applyMatrix4(L.makeRotationAxis(H,x))),j[B].crossVectors(c[B],D[B]);if(o)for(x=f(qo(D[0].dot(D[d-1]),-1,1)),x/=d-1,c[0].dot(H.crossVectors(D[0],D[d-1]))>0&&(x=-x),B=1;d>B;B++)D[B].applyMatrix4(L.makeRotationAxis(c[B],x*B)),j[B].crossVectors(c[B],D[B])};var dd=function(m,I,N,l){$r.call(this),I=I||18,N=N||0,l=l==W?C:l;for(var X=1/(m.length-1),n=1/I,V=0,$=I;$>=V;V++)for(var v=N+V*n*l,c=o(v),f=b(v),y=0,G=m.length;G>y;y++){var x=m[y],d=new Sd;d.x=c*x.x-f*x.y,d.y=f*x.x+c*x.y,d.z=x.z,this.vertices.push(d)}for(var L=m.length,V=0,$=I;$>V;V++)for(var y=0,G=m.length-1;G>y;y++){var k=y+L*V,e=k,w=k+L,c=k+1+L,B=k+1,O=V*n,_=y*X,M=O+n,J=_+X;this.faces.push(new mg(e,B,w)),this.faceVertexUvs[0].push([new Le(O,_),new Le(O,J),new Le(M,_)]),this.faces.push(new mg(w,B,c)),this.faceVertexUvs[0].push([new Le(M,_),new Le(O,J),new Le(M,J)])}this.mergeVertices(),yj(this),this.computeFaceNormals(),this.computeVertexNormals()};dd.prototype=ib(Sr);var ri=function(k,E){E=E||{};var e=xh.generateShapes(k,E);E.amount=E.amount!==N?E.amount:.5,E.convertYZ=!1,E.fill!==!1&&(E.bottom=!0,E.top=!0),nb.call(this,e,E)};ri.prototype=ib(Zg);var ur=c.Node=function(){Ne(ur,this)},Ye={X:kd,Y:Tr,Z:pi},Ub={xyz:"XYZ",xzy:"XZY",yxz:"YXZ",yzx:"YZX",zxy:"ZXY",zyx:"ZYX"},To="xzy",mp=function(y,g,F){if(g){var e=g[0],E=g[1],f=g[2];"xzy"===F?(Tr(y,E),pi(y,f),kd(y,e)):"xyz"===F?(pi(y,f),Tr(y,E),kd(y,e)):"yxz"===F?(pi(y,f),kd(y,e),Tr(y,E)):"yzx"===F?(kd(y,e),pi(y,f),Tr(y,E)):"zxy"===F?(Tr(y,E),kd(y,e),pi(y,f)):"zyx"===F?(kd(y,e),Tr(y,E),pi(y,f)):(Tr(y,E),pi(y,f),kd(y,e))}};Sj("Node",tf,{ms_ac:["rotationMode","anchorElevation"],_adjustChildrenToTop:!0,_icon:"node_icon",_image:"node_image",_rotationMode:To,_64O:0,_rotationX:0,_53O:0,_host:W,_position:{x:0,y:0},_anchor:{x:.5,y:.5},_anchorElevation:.5,_scale:{x:1,y:1},_scaleTall:1,_54O:0,getUIClass:function(){return xk},_22Q:function(){return Dc},getX:function(){return this.p().x},setX:function(N){this.p(N,this.p().y)},getY:function(){return this.p().y},setY:function(F){this.p(this.p().x,F)},getAnchorX:function(){return this.getAnchor().x},setAnchorX:function($){this.setAnchor($,this.getAnchor().y)},getAnchorY:function(){return this.getAnchor().y},setAnchorY:function(I){this.setAnchor(this.getAnchor().x,I)},getScaleX:function(){return this.getScale().x},setScaleX:function(I){this.setScale(I,this.getScale().y)},getScaleY:function(){return this.getScale().y},setScaleY:function(s){this.setScale(this.getScale().x,s)},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)},t3:function(){return this.translate3d.apply(this,arguments),this},translate3dBy:function(w,i){ge(w,qi(W,W,this.r3(),this.getRotationMode())),this.translate3d(w[0]*i,w[1]*i,w[2]*i)},translateFront:function(b){this.translate3dBy([0,0,1],b)},translateBack:function(s){this.translate3dBy([0,0,-1],s)},translateLeft:function(T){this.translate3dBy([-1,0,0],T)},translateRight:function(y){this.translate3dBy([1,0,0],y)},translateTop:function(L){this.translate3dBy([0,1,0],L)},translateBottom:function(Q){this.translate3dBy([0,-1,0],Q)},getPosition3d:function(){return[this._position.x,this._54O,this._position.y]},setPosition3d:function(M,C,s){1===arguments.length&&(C=M[1],s=M[2],M=M[0]),this.p(M,s),this.setElevation(C)},translate3d:function(V,E,S){1===arguments.length&&(E=V[1],S=V[2],V=V[0]),this.translate(V,S),this.setElevation(this._54O+E)},getSize3d:function(){return[this.getWidth(),this.getTall(),this.getHeight()]},setSize3d:function(H,T,O){1===arguments.length&&(T=H[1],O=H[2],H=H[0]),this.setSize(H,O),this.setTall(T)},getRotation3d:function(){return[this._rotationX,-this._64O,this._53O]},setRotation3d:function(Z,y,$){1===arguments.length&&(y=Z[1],$=Z[2],Z=Z[0]),this.setRotationX(Z),this.setRotation(-y),this.setRotationZ($)},setRotationY:function(C){this.setRotation(-C)},getRotationY:function(){return-this._64O},lookAtDirection:function(G,a){a=a||_k;var U=this,V=Nc(G);a===_k?(U.r3([-r(G[1]/V),-B(G[2],G[0])+q,0]),U.setRotationMode("xzy")):a===bc?(U.r3(0,-B(G[2],G[0]),r(G[1]/V)),U.setRotationMode("zyx")):a===Ep?(U.r3(0,-B(G[2],G[0])+l,-r(G[1]/V)),U.setRotationMode("zyx")):a===Im?(U.r3([-r(G[1]/V)+q,-B(G[2],G[0])+q,0]),U.setRotationMode("xzy")):a===Cr&&(U.r3([-r(G[1]/V)-q,-B(G[2],G[0])+q,0]),U.setRotationMode("xzy")),a===Xl&&(U.r3([-r(G[1]/V)+l,-B(G[2],G[0])+q,l]),U.setRotationMode("zxy"))},lookAt:function(p,B){return this.lookAtDirection(Ie(p,this.p3()),B)},getLoopedEdges:function(){return this._45I},getEdges:function(){return this._70O},getAgentEdges:function(){return this._49I},getHost:function(){return this._host},setHost:function(J){var C=this;if(C!==J&&C._host!==J){var p=C._host;p&&p._removeAttach(C),C._host=J,C._host&&C._host._addAttach(C),C.fp("host",p,J),C.onHostChanged(p,J)}},getAttaches:function(){return this._69O},_addAttach:function(h){var N=this;N._69O||(N._69O=new If),N._69O.add(h),N.fp("attaches",W,h)},_removeAttach:function(S){var y=this;y._69O.remove(S),y._69O.isEmpty()&&delete y._69O,y.fp("attaches",S,W)},getSourceEdges:function(){return this._42I},getTargetEdges:function(){return this._43I},_2I:function(b){var m=this;m._44I||(m._44I=new If),m._42I||(m._42I=new If),m._44I.add(b),m._42I.add(b),m._20I()},_4I:function(V){var $=this;$._44I||($._44I=new If),$._43I||($._43I=new If),$._44I.add(V),$._43I.add(V),$._20I()},_16I:function(O){var Q=this;Q._44I.remove(O),Q._42I.remove(O),Q._44I.isEmpty()&&delete Q._44I,Q._42I.isEmpty()&&delete Q._42I,Q._20I()},_18I:function(l){var Y=this;Y._44I.remove(l),Y._43I.remove(l),Y._44I.isEmpty()&&delete Y._44I,Y._43I.isEmpty()&&delete Y._43I,Y._20I()},_20I:function(){var v=this;if(delete v._45I,!v._44I||v._44I.isEmpty())return delete v._70O,void 0;var V;v._44I.each(function(A){A.isLooped()&&(V||(V={}),V[A._id]||(v._45I||(v._45I=new If),v._45I.add(A),V[A._id]=A))}),V?(v._70O=new If,v._44I.each(function(W){V[W._id]?"A"===V[W._id]||(V[W._id]="A",v._70O.add(W)):v._70O.add(W)})):v._70O=v._44I},hasAgentEdges:function(){return!!this._49I&&!this._49I.isEmpty()},getSourceAgentEdges:function(){return this._46I},getTargetAgentEdges:function(){return this._47I},_1I:function(N){var T=this;T._46I||(T._46I=new If),T._48I||(T._48I=new If),T._46I.add(N),T._48I.add(N),T._19I()},_3I:function(F){var q=this;q._47I||(q._47I=new If),q._48I||(q._48I=new If),q._47I.add(F),q._48I.add(F),q._19I()},_15I:function(Q){var q=this;q._46I.remove(Q),q._48I.remove(Q),q._46I.isEmpty()&&delete q._46I,q._48I.isEmpty()&&delete q._48I,q._19I()},_17I:function(X){var T=this;T._47I.remove(X),T._48I.remove(X),T._47I.isEmpty()&&delete T._47I,T._48I.isEmpty()&&delete T._48I,T._19I()},_19I:function(){var F=this;delete F._49I;var L=F._48I;if(L&&!L.isEmpty()){var a={};L.each(function(j){a[j._id]?F._49I||(F._49I=new If):a[j._id]=j}),F._49I?L.each(function(i){a[i._id]&&(F._49I.add(i),delete a[i._id])}):F._49I=L}},getImage:function(){if(this._pendingCheckImageJSON){var U=M.getImage(this._image);U&&(this._pendingCheckImageJSON=!1,this.getParent()instanceof Fp&&this.getParent().checkPendingUpdateInfo())}return this._image},setImage:function(H){var Z=this,x=Z._image,S=Z.getWidth(),s=Z.getHeight();Z._image=H,Z.fp("image",x,H)&&(null!=H&&(ko(H)||Qc(H)&&/\.json$/i.test(H))&&(this._pendingCheckImageJSON=!0),Z.fp(sq,S,Z.getWidth()),Z.fp(yi,s,Z.getHeight()))},getElevation:function(){return this._54O},setElevation:function(r){var Y=this;if(!Y._50O){Y._50O=1;var P=Y._54O;Y._54O=r,Y.fp(nf,P,r),delete this._50O}},getRotation:function(){return this._64O},setRotation:function(r){var s=this;if(!s._49O){s._49O=1;var z=s._64O;s._64O=r,s.fp(Zq,z,r),delete s._49O}},getRotationX:function(){return this._rotationX},setRotationX:function(o){var n=this;if(!n._51O){n._51O=1;var D=n._rotationX;n._rotationX=o,n.fp("rotationX",D,o),delete n._51O}},getRotationZ:function(){return this._53O},setRotationZ:function(t){var g=this;if(!g._52O){g._52O=1;var s=g._53O;g._53O=t,g.fp("rotationZ",s,t),delete g._52O}},getPosition:function(){return this._position},setPosition:function(q,G){var z=this;if(!z._50I){z._50I=1;var U;if(U=2===arguments.length?{x:q,y:G}:q,U.x!==z._position.x||U.y!==z._position.y){var a=z._position;z._position=U,z.fp(Rp,a,U)}delete z._50I}},translate:function(_,T){var M=this._position;this.p(M.x+_,M.y+T)},getWidth:function(){var o=this;if(o._width>=0)return o._width;var N=o.getStyle("shape3d");if(N){var i=Eo(N);if(i&&i.rawS3)return i.rawS3[0];if("billboard"===N||"plane"===N){var g=eo(o.getStyle("shape3d.image"));return g?ef(g,o):20}}var g=eo(o._image);return g?ef(g,o):20},setWidth:function(R){var K=this,Z=K._width;K._width=R,K.fp(sq,Z,R)},getHeight:function(){var D=this;if(D._height>=0)return D._height;var h=D.getStyle("shape3d");if(h){var E=Eo(h);if(E&&E.rawS3)return E.rawS3[2];if("plane"===h){var _=eo(D.getStyle("shape3d.image"));return _?fc(_,D):20}if("billboard"===h)return 2}var _=eo(D._image);return _?fc(_,D):20},setHeight:function(k){var o=this,g=o._height;o._height=k,o.fp(yi,g,k)},getTall:function(){var d=this;if(d._tall>=0)return d._tall;var q=d.getStyle("shape3d");if(q){var N=Eo(q);if(N&&N.rawS3)return N.rawS3[1];if("billboard"===q){var f=eo(d.getStyle("shape3d.image"));return f?fc(f,d):20}if("plane"===q)return 2}return 20},setTall:function(d){var W=this,O=W._tall;W._tall=d,W.fp("tall",O,d)},setSize:function(S,u){var $=this;2===arguments.length?($.setWidth(S),$.setHeight(u)):($.setWidth(S.width),$.setHeight(S.height))},getSize:function(){return{width:this.getWidth(),height:this.getHeight()}},setRect:function(e,M,A,w,t){var N=this,X=N.getAnchor(),S=N.getScale();arguments.length<=2&&(t=M,M=e.y,A=e.width,w=e.height,e=e.x);var p=t&&S.x<0?1-X.x:X.x,f=t&&S.y<0?1-X.y:X.y;N.p(e+A*p,M+w*f),t&&(A/=Math.abs(S.x),w/=Math.abs(S.y)),N.setWidth(A),N.setHeight(w)},getMatrix:function(){var D=this,H=D._64O,w=D._position,J=D.getScale();return new ng(H,w.x,w.y,J.x,J.y)},getAnchorRect:function(){var k=this,d=k.getWidth(),I=k.getHeight(),y=k.getAnchor();return{x:-d*y.x,y:-I*y.y,width:d,height:I}},toLocal:function(X){return this.getMatrix().tfi(X)},toGlobal:function(r){return this.getMatrix().tf(r)},isInRect:function(m){m=this.toLocal(m);var U=this.getWidth(),C=this.getHeight();return m.x+=U*this.getAnchorX(),m.y+=C*this.getAnchorY(),!(m.x<0||m.y<0||m.x>U||m.y>C)},getRect:function(){var Y=this,w=Y.getWidth(),n=Y.getHeight(),s=Y.getAnchor(),S={x:-w*s.x,y:-n*s.y,width:w,height:n},M=Y.getMatrix();return S=rd([M.tf(S.x,S.y),M.tf(S.x+S.width,S.y),M.tf(S.x+S.width,S.y+S.height),M.tf(S.x,S.y+S.height)])},getAnchorElevation:function(){return this._anchorElevation},getAnchor3d:function(){var N=this,I=N.getAnchor(),d=N._anchorElevation;return{x:I.x,y:d,z:I.y}},setAnchorElevation:function(V){var P=this,i=P._anchorElevation;return i!==V?(P._anchorElevation=V,P.fp("anchorElevation",i,V),!0):!1},setAnchor3d:function(M,S,H,x){var O,D=this;"number"==typeof M?O={x:M,y:S,z:H}:(O=M.length?{x:M[0],y:M[1],z:M[2]}:M,x=S);var s=D.getDataModel();s&&s.beginTransaction();var F=D.getAnchor3d(),Q=D.setAnchor(O.x,O.z);if(D.setAnchorElevation(O.y)&&(Q=!0),Q&&x&&!fk){D.getAnchor3d();var b=Xg(D),q=ge([O.x-F.x,O.y-F.y,O.z-F.z],b);D.p3(q)}return s&&s.endTransaction(),Q},getAnchor:function(){var R=this;if(R.hasOwnProperty("_anchor"))return R._anchor;var t=eo(R._image);return t&&t.anchorX!==N?{x:t.anchorX,y:t.anchorY}:R._anchor},setAnchor:function(l,Q,h){var X,u=this;"number"==typeof l?X={x:l,y:Q}:(X=l.length?{x:l[0],y:l[1]}:l,h=Q);var O=u.getAnchor();if(O.x!==X.x||O.y!==X.y){var c=u.getDataModel();if(c&&c.beginTransaction(),u._anchor=X,u.fp("anchor",O,X),h&&!fk){var s=u.getPosition(),d=u.getSize(),I=u.getRotation(),p=u.getScale(),k=-d.width*(O.x-X.x)*p.x,W=-d.height*(O.y-X.y)*p.y,z=b(I),J=o(I);u.setPosition(s.x+J*k-z*W,s.y+z*k+J*W)}return c&&c.endTransaction(),!0}return!1},getScale:function(){return this._scale},setScale:function(C,E){var J,G=this;J=2===arguments.length?{x:C,y:E}:C;var q=G.getScale();(q.x!==J.x||q.y!==J.y)&&(G._scale=J,G.fp("scale",q,J))},getScaleTall:function(){return this._scaleTall},getScale3d:function(){var x=this,Z=x._scaleTall,L=x.getScale();return[L.x,Z,L.y]},getFinalScale3d:function(){var q=this,u=q.s3(),g=q._dynamicScale3d,G=q.getScale3d();return u&&(G[0]*=u[0],G[1]*=u[1],G[2]*=u[2]),g&&(G[0]*=g[0],G[1]*=g[1],G[2]*=g[2]),G},getFinalRotation3d:function(){var z=this;return z._dynamicRotation||z.r3()},setScaleTall:function(O){var x=this,Y=x._scaleTall;Y!==O&&(x._scaleTall=O,x.fp("scaleTall",Y,O))},setScale3d:function(y,g,T){var v,Q=this;v="number"==typeof y?{x:y,y:g,z:T}:y.length?{x:y[0],y:y[1],z:y[2]}:y,Q.setScaleTall(v.y),Q.setScale(v.x,v.z)},getCorners:function(V,A){V==W&&(V=0),A==W&&(A=V);var $=this,E=$.getAnchor(),Q=$.getWidth(),s=$.getHeight(),r=-Q*E.x-V,v=-s*E.y-A,Z=Q+2*V,L=s+2*A,T=$.getMatrix();return[T.tf(r,v),T.tf(r,v+L),T.tf(r+Z,v+L),T.tf(r+Z,v)]},getEditControlPoints:function(C,d,c){d==W&&(d=0),c==W&&(c=d);var X=this,v=X.getAnchor(),r=X.getWidth(),y=X.getHeight(),e=-r*v.x-d,T=-y*v.y-c,x=r+2*d,R=y+2*c;if(C)return[{x:e,y:T},{x:e,y:0},{x:e,y:T+R},{x:0,y:T+R},{x:e+x,y:T+R},{x:e+x,y:0},{x:e+x,y:T},{x:0,y:T}];var A=X.getMatrix();return[A.tf(e,T),A.tf(e,0),A.tf(e,T+R),A.tf(0,T+R),A.tf(e+x,T+R),A.tf(e+x,0),A.tf(e+x,T),A.tf(0,T)]},rotateAt:function(z,x,J){var e=this,K=e._position,p=e._64O,N=new ng(p,K.x,K.y).tf(z,x),t=v(z*z+x*x),C=B(K.y-N.y,K.x-N.x)+J;e.setRotation(p+J),e.p(N.x+t*o(C),N.y+t*b(C))},onParentChanged:function(){ur.superClass.onParentChanged.apply(this,arguments),this._8I()},_8I:function(){this._70O&&this._70O.each(function(g){g._7I()})},onPropertyChanged:function(S){var u=this;ur.superClass.onPropertyChanged.call(u,S),u._69O&&u._69O.each(function(X){X.handleHostPropertyChange(S)}),u._49I&&u._49I.each(function(u){u.fp("agentChange",!0,!1)})},onHostChanged:function(){this.updateAttach()},handleHostPropertyChange:function(t){this.updateAttach(t)},onStyleChanged:function(L){ur.superClass.onStyleChanged.apply(this,arguments),vo[L]&&this.updateAttach()},updateAttach:function(l){var C=this;C._51I||fk||(C._51I=1,C._71O(l),delete C._51I)},_71O:function(U){var h,G,v,y,V,$,z=this,o=z._host,l=U?U.property:W,Z=U?U.oldValue:W,L=U?U.newValue:W;if(o instanceof c.Grid){if(l===nf)z.setElevation(z._54O+L-Z);else if(!U||kh[l]){if(h=z.s("attach.row.index"),G=z.s("attach.column.index"),v=o.getCellRect(h,G),!v)return;y=z.s("attach.row.span"),V=z.s("attach.column.span"),(1!==y||1!==V)&&(v=Uh(v,o.getCellRect(h+y-1,G+V-1))),kp(v,z,"attach.padding",1),z.setRect(v)}}else if(o instanceof Ed&&($=z.s("attach.index"))>=0&&(!U||Vo[l])){var s=z.s("attach.thickness");s!=W&&z.setHeight(o.getThickness()*s);var D=z.s("attach.offset"),p=o.getPoints(),I=p.size();if(I>$){var u=p.get($),T=I===$+1?p.get(0):p.get($+1),J=[T.x-u.x,T.y-u.y],R=Nc(J);if(R){z.s("attach.offset.relative")&&(D*=R),z.s("attach.offset.opposite")&&(D=R-D);var P={x:u.x+J[0]/R*D,y:u.y+J[1]/R*D},Q=z.s("attach.gap");Q&&(z.s("attach.gap.relative")&&(Q*=o.getThickness()),P=Dd(W,P,T,Q)),z.p(P),z.setRotation(B(J[1],J[0]))}}}else U&&(l===Rp?z.translate(L.x-Z.x,L.y-Z.y):l===nf?z.setElevation(z._54O+L-Z):Kj[l]&&z._11Q(o,l,L-Z))},_11Q:function(R,Z,V){var n=this,e=R.p3(),Y=Ie(n.p3(),e),k=Tq(),b=Ub[n.getRotationMode()],f=b[0],H=b[1],w=b[2],v=Ye[f],C=Ye[H],T=Ye[w];Z===Zq&&(Z="rotationY",V=-V),Z===Zq+f?(T(k,R[Kn+w]()),C(k,R[Kn+H]()),v(k,V),C(k,-R[Kn+H]()),T(k,-R[Kn+w]()),n[gg+f](n[Kn+f]()+V)):Z===Zq+H?(T(k,R[Kn+w]()),C(k,V),T(k,-R[Kn+w]()),n[gg+H](n[Kn+H]()+V)):Z===Zq+w&&(T(k,V),n[gg+w](n[Kn+w]()+V)),ge(Y,k),n.p3(e[0]+Y[0],e[1]+Y[1],e[2]+Y[2])},isHostOn:function(m){var y=this;if(y._host&&m&&m._69O)for(var k={},b=y._host;b&&b!==y&&!k[b._id];){if(b===m)return!0;k[b._id]=b,b=b._host}return!1},isLoopedHostOn:function(O){return this.isHostOn(O)&&O.isHostOn(this)},getSerializableProperties:function(){var A=ur.superClass.getSerializableProperties.call(this);return dr(A,{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}),A}});var Vr=c.Edge=function(Q,_){var q=this;Ne(Vr,q),q.setSource(Q),q.setTarget(_)};Sj("Edge",tf,{_icon:"edge_icon",getUIClass:function(){return Yj},_22Q:function(){return dq},getSource:function(){return this._source},getTarget:function(){return this._target},getSourceAgent:function(){return this._40I},getTargetAgent:function(){return this._41I},setSource:function(a){var c=this;if(c._source!==a){var u=c._source;c._source=a,u&&u._16I(c),a&&a._2I(c),c._7I(),c.fp("source",u,a)}},setTarget:function(i){var I=this;if(I._target!==i){var O=I._target;I._target=i,O&&O._18I(I),i&&i._4I(I),I._7I(),I.fp("target",O,i)}},isLooped:function(){var k=this;return k._source===k._target&&!!k._source&&!!k._target},_7I:function(){var B,o=this,k=Gb(o);o._40I!==k&&(B=this._40I,B&&B._15I(o),o._40I=k,k&&k._1I(o),o.fp("sourceAgent",B,k),xd(B,o._41I),xd(k,o._41I));var L=Qo(o);o._41I!==L&&(B=o._41I,B&&B._17I(o),o._41I=L,L&&L._3I(o),o.fp("targetAgent",B,L),xd(B,o._40I),xd(L,o._40I))},_22I:function(M){this._52I=M,this.fp("edgeGroup",!0,!1)},getEdgeGroup:function(){return this._52I},isEdgeGroupHidden:function(){var q=this;return q._52I&&q._52I.get(0)!==q&&!q.getStyle(zb)},getEdgeGroupSize:function(){return this._52I?this._52I.size():1},getEdgeGroupIndex:function(){return this._52I?this._52I.indexOf(this):0},isEdgeGroupAgent:function(){var p=this,$=p._52I;return $&&!p.getStyle(zb)&&$.size()>1&&p===$.get(0)},toggle:function(){var r=this._52I,c=!this.s(zb);r&&r.size()>1&&(r.each(function(t){t.s(zb,c)}),r.getSiblings().each(function(T){T!==r&&T.each(function(z){z.fp("edgeGroup",W,T)})}))},setStyle:function(u,O){(u===tc||"edge.segments"===u)&&(O=Nm(O)),Vr.superClass.setStyle.call(this,u,O)},onStyleChanged:function(k){Vr.superClass.onStyleChanged.apply(this,arguments),Lc[k]&&xd(this._41I,this._40I)},getSerializableProperties:function(){var T=Vr.superClass.getSerializableProperties.call(this);return dr(T,{source:1,target:1}),T}});var Zb=c.Group=function(){Ne(Zb,this)};Sj("Group",ur,{_image:"group_image",_icon:"group_icon",_57O:!1,getUIClass:function(){return rf},onChildAdded:function(){Zb.superClass.onChildAdded.apply(this,arguments),this._81I()},onChildRemoved:function(){Zb.superClass.onChildRemoved.apply(this,arguments),this._81I()},_81I:function(){var J=this;if(!J._54I&&!fk){var g=J.getChildrenRect();g&&(J._53I=1,J.p(jm(J.s("group.position"),g,J.getSize())),delete J._53I)}},getChildrenRect:function(){var u,o=this;return o.eachChild(function(A){u=Uh(u,o.getChildRect(A))}),u},getChildRect:function(l){var o;return Cj(l)&&l.s(Tl)&&(tl(l)&&l.isExpanded()&&l.eachChild(function(b){o=Uh(o,l.getChildRect(b))}),!o&&l.getRect&&(o=l.getRect())),o},setPosition:function(D,C){var Y=this;if(!Y._54I){var E;E=2===arguments.length?{x:D,y:C}:D,fk||Y._53I||(Y._54I=1,Bb(Y._children,E.x-Y._position.x,E.y-Y._position.y),delete Y._54I),Zb.superClass.setPosition.call(this,E)}},toggle:function(){this.setExpanded(!this.isExpanded())},isExpanded:function(){return this._57O},setExpanded:function(B){var m=this;if(m._57O!==B){var y=m._57O;m._57O=B,m.fp("expanded",y,m._57O),m._8I()}},_8I:function(){Zb.superClass._8I.call(this),this.eachChild(function(z){Cj(z)&&z._8I()})},onStyleChanged:function(Y){Zb.superClass.onStyleChanged.apply(this,arguments),"group.position"===Y&&this._81I()},getSerializableProperties:function(){var y=Zb.superClass.getSerializableProperties.call(this);return y.expanded=1,y}});var Fh=c.Block=function(){Ne(Fh,this)};Sj("Block",ur,{_icon:"block_icon",_clickThroughEnabled:!1,_syncSize:!0,ms_ac:["clickThroughEnabled","syncSize"],getUIClass:function(){return iq},onChildAdded:function(){Fh.superClass.onChildAdded.apply(this,arguments),this.updateFromChildren()},onChildRemoved:function(){Fh.superClass.onChildRemoved.apply(this,arguments),this.updateFromChildren()},updateFromChildren:function(){var C=this;if(!fk&&!C._updatingToChildren&&C._syncSize){var X,n,p,E,q,f=[],T=C.getRotation();if(C.eachChild(function(J){Cj(J)&&f.push.apply(f,J.getCorners())}),f.length){C._updatingFromChildren=1;var Y=o(-T),W=b(-T),A=1/0,Z=-1/0,u=1/0,Q=-1/0;for(E=0,q=f.length;q>E;E++)p=f[E],X=p.x,n=p.y,p.x=Y*X-W*n,p.y=W*X+Y*n,A=D(A,p.x),Z=s(Z,p.x),u=D(u,p.y),Q=s(Q,p.y);var j=C.getScale();C.setSize(t((Z-A)/j.x),t((Q-u)/j.y));var N;j.x<0&&(N=A,A=Z,Z=N),j.y<0&&(N=u,u=Q,Q=N),Y=o(T),W=b(T);var z=C.getAnchor();X=A+(Z-A)*z.x,n=u+(Q-u)*z.y,C.setPosition(Y*X-W*n,W*X+Y*n),delete C._updatingFromChildren}}},setPosition:function(A,w){var n=this;if(!n._updatingToChildren){var V;V=2===arguments.length?{x:A,y:w}:A,fk||n._updatingFromChildren||(n._updatingToChildren=1,Bb(n._children,V.x-n._position.x,V.y-n._position.y),delete n._updatingToChildren),Fh.superClass.setPosition.call(this,V)}},setWidth:function(i){return this.setSize(i,this.getHeight())},setHeight:function(E){return this.setSize(this.getWidth(),E)},setSize:function(_,K){1>_&&(_=1),1>K&&(K=1);var Q=this;
- if(!Q._updatingToChildren){2!==arguments.length&&(K=_.height,_=_.width);var A=Q.getWidth(),U=Q.getHeight();if(_!==A&&Fh.superClass.setWidth.call(Q,_),K!==U&&Fh.superClass.setHeight.call(Q,K),!fk&&!Q._updatingFromChildren){Q._updatingToChildren=1;var j=_/A,t=K/U;Q._adjustChildScaleOrSize(j,t,"size"),delete Q._updatingToChildren,Q.updateFromChildren()}}},_adjustChildScaleOrSize:function(L,k,a){var x=this;if(x._syncSize){var D=x.getPosition(),i=x.getRotation();x.getScale(),x.eachChild(function(Y){if(Cj(Y)){var w=Y.getPosition(),v=Y.getRotation(),p=Y.getWidth(),U=Y.getHeight(),j=Y.getScale(),h=j.x*p,W=j.y*U,X=new ng(v,w.x,w.y,h,W);X.translate(-D.x,-D.y),X.rotate(-i),v=B(X.b*Math.sign(h),X.a*Math.sign(h)),X.scale(L,k);var e,g,H,G=o(v);if(Math.abs(G)<.001?(e=b(v),g=X.b/e,H=-X.c/e):(g=X.a/G,H=X.d/G),"scale"===a)Y.setScale(g/p,H/U);else if("size"===a){var P=g/j.x,$=H/j.y;Y.setScale(nm(g)*Math.abs(j.x),nm(H)*Math.abs(j.y)),Y.setSize(Math.max(.1,Math.abs(P)),Math.max(.1,Math.abs($)))}X.rotate(i),X.translate(D.x,D.y),Y.setPosition(X.tx,X.ty)}})}},_calcChangeFactor:function(k,i,Y,O){var D,z,d,r;return D=t(k),z=t(Y),d=D>z?D/z:z/D,D=t(i),z=t(O),r=D>z?D/z:z/D,s(d,r)},setAnchor:function(){var J=this;if(!J._updatingToChildren){var I=J.getAnchor();if(Fh.superClass.setAnchor.apply(J,arguments),!fk&&!J._updatingFromChildren&&J._syncSize){J._updatingToChildren=1;var G=J.getAnchor();J.getPosition();var s=J.getSize(),V=J.getScale(),g=J.getRotation(),N=-s.width*V.x*(I.x-G.x),F=-s.height*V.y*(I.y-G.y),C=b(g),x=o(g),$=x*N-C*F,L=C*N+x*F;J.eachChild(function(v){if(Cj(v)){var X=v.getPosition();v.setPosition(X.x-$,X.y-L)}}),delete J._updatingToChildren}}},setRotation:function(h){var O=this;if(!O._updatingToChildren){var o=O.getRotation();if(Fh.superClass.setRotation.apply(O,arguments),!fk&&!O._updatingFromChildren){O._updatingToChildren=1;var I=O.getPosition(),N=h-o;O.eachChild(function(J){if(Cj(J)){var E=J.getMatrix();E.translate(-I.x,-I.y),E.rotate(N),E.translate(I.x,I.y);var L=Math.sign(J.getScale().x);J.setRotation(B(E.b*L,E.a*L)),J.setPosition(E.tx,E.ty)}}),delete O._updatingToChildren}}},setScale:function(L,d){var s=this;if(!s._updatingToChildren){null==d&&(d=L.y,L=L.x);var X=s.getScale();if(t(L)<.01&&(L=.01*(nm(L)||nm(X.x))),t(d)<.01&&(d=.01*(nm(d)||nm(X.y))),Fh.superClass.setScale.call(s,L,d),!fk&&!s._updatingFromChildren){s._updatingToChildren=1;var q=L/X.x,v=d/X.y;s._adjustChildScaleOrSize(q,v,"size"),delete s._updatingToChildren,s.updateFromChildren()}}},getSerializableProperties:function(){var P=Fh.superClass.getSerializableProperties.call(this);return P.clickThroughEnabled=1,P.syncSize=1,P}});var $c=c.Grid=function(){Ne(c.Grid,this)};Sj("Grid",ur,{IRotatable:!1,_icon:"grid_icon",_image:W,getUIClass:function(){return df},setRotation:function(){},getCellRect:function(h,j){var M=this,m=M.s("grid.row.count"),x=M.s("grid.column.count");if(0>=m||0>=x||0>h||h>=m||0>j||j>=x)return W;var i,l,f,u=M.getRect(),I=M.s("grid.row.percents"),q=M.s("grid.column.percents");if(kp(u,M,"grid.border",-1),I&&I._as&&(I=I._as),q&&q._as&&(q=q._as),I&&I.length===m){for(f=0,i=0;h>i;i++)f+=u.height*I[i];u.y+=f,u.height=u.height*I[h]}else u.height=u.height/m,u.y+=u.height*h;if(q&&q.length===x){for(l=0,i=0;j>i;i++)l+=u.width*q[i];u.x+=l,u.width=u.width*q[j]}else u.width=u.width/x,u.x+=u.width*j;return lo(u,-M.s("grid.gap")),u}});var mc=c.Text=function(){Ne(mc,this),this.setSize(100,50),this.s("text","TEXT")};Sj("Text",ur,{_icon:"text_icon",_image:"__text__",getUIClass:function(){return hk},setWidth:function(P){P||(P=.001),mc.superClass.setWidth.call(this,P)},setHeight:function(M){M||(M=.001),mc.superClass.setHeight.call(this,M)},toLabel:function(){return this._displayName||this._name||this.s("text")}}),hg("__text__",{width:{value:100,isSafeFunc:!0,func:function(P){return P._width}},height:{value:50,isSafeFunc:!0,func:function(y){return y._height}},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"}}]});var Ed=c.Shape=function(){Ne(Ed,this),this._59O=new If};Ed.__de__=bi,Sj("Shape",ur,{ms_ac:["thickness","closePath"],_icon:"shape_icon",_thickness:10,_closePath:!1,getUIClass:function(){return Xk},_22Q:function(){return hs},getLength:function(G){return pg(Qq(this._59O,this._58O,G,this._closePath))},getSegments:function(){return this._58O},toSegments:function(){var m=this._58O;return m?new If(m._as.slice(0)):m},setSegments:function(t){var Q=this._58O;t=t?zn(t)?new If(t.slice(0)):new If(t._as.slice(0)):null,(Q&&t&&Q._as.join(",")!==t._as.join(",")||Q!==t)&&(this._58O=t,this.fp("segments",Q,t))},getPoints:function(){return this._59O},toPoints:function(){var d=this._59O;return new If(d._as.slice(0))},setPoints:function(x,h){var G=this,_=G._59O;x=x?zn(x)?new If(x.slice(0)):new If(x._as.slice(0)):new If;var w,P,r,J,R,b;h&&(w=G.getPosition(),b=new ng(G.getRotation(),0,0,G.getScale().x,G.getScale().y)),(_&&x&&_._as.join(",")!==x._as.join(",")||_!==x)&&(G._59O=x,G.fs(),G.fp("points",_,x)),h&&(P=G.getPosition(),r=P.x-w.x,J=P.y-w.y,R=b.tf(r,J),G.setPosition(P.x-r+R.x,P.y-J+R.y))},addPoint:function(M,q,N){var y=this.toPoints();y.add(M,q),this.setPoints(y,N)},setPoint:function(C,x,p){var d=this.toPoints();d.set(C,x),this.setPoints(d,p)},removePointAt:function(I){var X=this.toPoints();X.removeAt(I),this.setPoints(X)},setWidth:function(M){var d=this;if(1>M&&(M=1),!d._55I&&!fk&&d.getWidth()){d._55I=1;var E=d._position.x,e=M/d.getWidth(),R=d.toPoints(),G=new If;R.each(function(r){G.add({x:(r.x-E)*e+E,y:r.y,e:r.e})}),d.setPoints(G),ej(d,[e,0,0,1,E*(1-e),0]),d.fs(),delete d._55I}Ed.superClass.setWidth.call(d,M)},setHeight:function(A){var v=this;if(1>A&&(A=1),!v._55I&&!fk&&v.getHeight()){v._55I=1;var B=v._position.y,E=A/v.getHeight(),$=v.toPoints(),k=new If;$.each(function(v){k.add({x:v.x,y:(v.y-B)*E+B,e:v.e})}),v.setPoints(k),ej(v,[1,0,0,E,0,B*(1-E)]),v.fs(),delete v._55I}Ed.superClass.setHeight.call(v,A)},setAnchorElevation:function(U){var W=this;W._55I=!0;var w=W._updatingAnchor3d,T=!fk&&!w;if(T){var r,K=U,a=W.getAnchorElevation(),v=W.getTall();r=v*(a-K),W.shiftPointsElevation(r)}var u=Ed.superClass.setAnchorElevation.apply(W,arguments);return w||delete W._55I,u},getShapeElevation:function(){var Y=this,g=Y._54O;return g-(Y.getTall()||0)*(Y._anchorElevation-.5)},setAnchor3d:function(s,e,y,H){var f,W=this;"number"==typeof s?f={x:s,y:e,z:y}:(f=s.length?{x:s[0],y:s[1],z:s[2]}:s,H=e),W._55I=!0,W._updatingAnchor3d=!0;var O=W.getDataModel();if(O&&O.beginTransaction(),!fk){var w=W.getAnchor3d(),Z=W.getSize(),D=W.getTall(),Y=Z.width*(w.x-f.x),j=Z.height*(w.z-f.z),c=D*(w.y-f.y);H||W.shiftPoints(Y,j,c);var h=W.p3()}var n=Ed.superClass.setAnchor3d.apply(W,arguments);if(!fk&&H){var A=W.p3();W.shiftPoints(A[0]-h[0]+Y,A[2]-h[2]+j,A[1]-h[1]+c)}return O&&O.endTransaction(),delete W._updatingAnchor3d,delete W._55I,n},setAnchor:function(K,f,r){var H=this;H._55I=!0;var F=H._updatingAnchor3d,t=!fk&&!F;if(t){var O,M,y;"number"==typeof K?y={x:K,y:f}:(y=K.length?{x:K[0],y:K[1]}:K,r=f);var C=H.getAnchor(),e=H.getSize();O=e.width*(C.x-y.x),M=e.height*(C.y-y.y),r||H.shiftPoints(O,M);var P=H.getPosition()}var V=Ed.superClass.setAnchor.apply(H,arguments);if(t){var n=H.getPosition();r&&H.shiftPoints(n.x-P.x+O,n.y-P.y+M)}return F||delete H._55I,V},shiftPoints:function(B,l,v){var f=this,$=f.getElevation()||0,S=f.toPoints(),N=new If;S.each(function(i){var A=i.e;v&&(A=(A==W?$:A)+v),N.add({x:i.x+B,y:i.y+l,e:A})}),f.setPoints(N),f.fs()},shiftPointsElevation:function(Y){return this.shiftPoints(0,0,Y)},setPosition:function(K,q){var O,t=this;if(!t._28Q){if(t._28Q=1,!t._55I&&!fk){O=2===arguments.length?{x:K,y:q}:K;var G=O.x-t._position.x,H=O.y-t._position.y;if(0===G&&0===H)return delete t._28Q,void 0;t._55I=1,t.shiftPoints(G,H),ej(t,[1,0,0,1,G,H]),delete t._55I}Ed.superClass.setPosition.apply(t,arguments),delete t._28Q}},fs:function(){this.fireShapeChange()},_70I:function(){var F=this;if(2!==F._59O.size())return!1;var _=F._58O;return _?2===_.size()&&1===_.get(0)&&2===_.get(1)?!0:!1:!0},fireShapeChange:function(){var y=this;if(!y._55I&&!fk){var h=rd(y._59O);h&&(y._55I=1,y.setRect(h),delete y._55I)}y.fp(fr,!1,!0)},getSerializableProperties:function(){var V=Ed.superClass.getSerializableProperties.call(this);return V.segments=1,V.points=1,V.thickness=1,V.closePath=1,V}});var bo=c.Polyline=function(){Ne(bo,this),this.s({"shape.background":null,"shape.border.width":2})};Sj("Polyline",Ed,{_icon:"polyline_icon",_22Q:function(){return rr},getUIClass:function(){return xl},setClosePath:function(){},setTall:function(r){var l=this;if(!l._55I&&!l._24Q&&!fk&&l.getTall()){l._24Q=1;var V=l._54O,C=r/l.getTall();l._59O.each(function(L){L.e=L.e==W?V:(L.e-V)*C+V}),l.fs(),delete l._24Q}bo.superClass.setTall.call(l,r)},setElevation:function(I){var j=this;if(!j._55I&&!j._24Q&&!fk){j._24Q=1;var S=I-j._54O;j._59O.each(function(w){w.e==W?w.e=I:w.e+=S}),j.fs(),delete j._24Q}bo.superClass.setElevation.apply(j,arguments)},fireShapeChange:function(){var q=this,h=q._59O;if(!q._55I&&!q._24Q&&!fk){var Z=h.size();if(Z){var p=1,m=h.get(0),S=q._54O;m.e==W&&(m.e=S);for(var w=m.e,E=0;Z>p;p++){m=h.get(p),m.e==W&&(m.e=S);var z=D(w,m.e),x=s(w+E,m.e);w=z,E=x-z}q._24Q=1,q.setTall(E),q.setElevation(w+E*q._anchorElevation),delete q._24Q}}bo.superClass.fireShapeChange.apply(q,arguments)}});var jh=c.SubGraph=function(){Ne(jh,this)};Sj("SubGraph",ur,{ISubGraph:1,_image:"subGraph_image",_icon:"subGraph_icon",_8I:function(){jh.superClass._8I.call(this),this.eachChild(function(R){Cj(R)&&R._8I()})}}),M.loadingRefGraph=0;var Fp=c.RefGraph=function(){Ne(Fp,this)};Sj("RefGraph",Fh,{_icon:"refGraph_icon",getRef:function(){return this._ref},setRef:function(W){var S=this._ref;this._ref=W,this.fp("ref",S,W),this.updateRef()},_21I:function(){Fp.superClass._21I.apply(this,arguments),this.updateRef()},updateRef:function(){var e=this;if(M.loadingRefGraph++,e.clearChildrenFromDataModel(),M.loadingRefGraph--,e._ref&&e._dataModel){e._xhrLoadHandler&&(e._xhrLoadHandler.cancel=!0);var R=fk,x=e._xhrLoadHandler=function(p){if(p&&e._dataModel){M.loadingRefGraph++;var j=e._pendingUpdateInfo={needToRestore:R};R&&(j.position=e.p(),j.width=e.getWidth(),j.height=e.getHeight(),j.rotation=e.getRotation(),j.anchor=e.getAnchor(),j.scale=e.getScale()),e.p(0,0),e.setAnchor(.5,.5),e.setRotation(0),e.setScale(1,1);var T=M.parse(p),W=e._dataModel.deserialize(T,e,{justDatas:!0});W.each(function(b){b._refGraph=e}),e.checkPendingUpdateInfo(),M.loadingRefGraph--,M.handleRefGraphLoaded(e,W,T)}};x.xhrLoadCalled=!1,M.load(e._ref,function(X){x.cancel||(x.xhrLoadCalled?x(X):Mh(function(){x(X)}))}),x.xhrLoadCalled=!0}},checkPendingUpdateInfo:function(){var j=this,m=j._pendingUpdateInfo;if(!m)return j.onPendingUpdated&&(M.loadingRefGraph++,j.onPendingUpdated(),M.loadingRefGraph--),void 0;var C=!0;this.eachChild(function(A){(A._pendingCheckImageJSON||A._pendingUpdateInfo)&&(C=!1)}),C&&(M.loadingRefGraph++,j._pendingUpdateInfo=null,j.updateFromChildren(),m.needToRestore&&(j.setSize(m.width,m.height),j.setAnchor(m.anchor),j.setRotation(m.rotation),j.setScale(m.scale),j.p(m.position)),this.getParent()instanceof Fp&&this.getParent().checkPendingUpdateInfo(),j.onPendingUpdated&&j.onPendingUpdated(),M.loadingRefGraph--)},getSerializableProperties:function(){var c=Fp.superClass.getSerializableProperties.call(this);return c.ref=1,c}}),c.EdgeGroup=function(B,o){this._70O=B,this._siblings=o;for(var I,k,w=0,h=B.size(),d=F[zb];h>w;w++)if(I=B.get(w).getStyle(zb,!1),I!=W){d=I;break}d==W&&(d=!0);var L=M.edgeGroupAgentFunc;for(L&&(k=L(B),k&&k!==B.get(0)&&(B.remove(k),B.add(k,0))),w=0;h>w;w++)B.get(w).s(zb,d)},Sj("EdgeGroup",R,{getEdges:function(){return this._70O},size:function(){return this._70O.size()},get:function(M){return this._70O.get(M)},indexOf:function(g){return this._70O.indexOf(g)},each:function(R,F){this._70O.each(R,F)},getSiblings:function(){return this._siblings},eachSiblingEdge:function(J,M){this._siblings.each(function(b){b._70O.each(J,M)})}});var Cb=function(n,$,T){var P=$d[n]={type:n,action:$};if(T)for(var N in T)P[N]=T[N]};Cb("host",function(Y,X,S){S&&X.setHost(S)},{"delete":{visible:function(V,$){return $.getHost()},action:function(F,m){m.setHost(null)}}}),Cb("parent",function(g,T,M){M&&T.setParent(M)},{"delete":{visible:function(d,L){return L.getParent()},action:function(e,q){q.setParent(null)}}}),Cb("copySize",function(t,I,z){if(z){var T=z.getSize();I.setSize(T)}}),Cb("copyRotation",function(E,B,I){if(I){var F=I.getRotation();B.setRotation(F)}}),Cb("edge",function(k,z,S){if(S){var Z=new c.Edge(z,S);z.dm().add(Z)}}),dr(M,{setConnectAction:Cb,getConnectAction:function(B,y){return y=y||B.getCurrentConnectActionType(),$d[y]},doConnectAction:function(D,R,Q,f){f=f||D.getCurrentConnectActionType();var z=$d[f];if(!z)return!1;var r=z.action;return r?(r.call(null,D,R,Q),!0):!1},doDeleteConnectionAction:function(Z,i,P){P=P||Z.getCurrentConnectActionType();var J=$d[P];if(!J||!J.delete)return!1;var p=J.delete.action;return p?(p.call(null,Z,i),!0):!1}});var zf=c.JSONSerializer=function(E,m){this.dm=this._dataModel=E,this._hierarchical=M.forceHierarchicalSerialization?!0:m==W?E.isHierarchicalRendering():m};Sj("JSONSerializer",R,{ms_ac:["hierarchical"],serialize:function(v){return M.stringify(this.toJSON(),v)},toJSON:function(){var q=this,l=q.dm,w=l.getRoots(),T=q.json={v:M.getVersion(),p:{},a:{},d:[]},L=l.getSerializableAttrs();l.getInit()&&(T.init=l.getInit()),l.getName()&&(T.p.name=l.getName()),l.getBackground()&&(T.p.background=l.getBackground()),l.getLayers()&&(T.p.layers=l.getLayers()),T.p.autoAdjustIndex=l.isAutoAdjustIndex(),T.p.hierarchicalRendering=l.isHierarchicalRendering();for(var B in L){var R=l.a(B);R!==N&&q[Vf](B,R,T.a)}return Jl(T.a)&&delete T.a,q._hierarchical?w.each(q.serializeData,this):l.each(function(b){q.serializeData(b)}),T},isSerializable:function(){return!0},getProperties:function(D){return D.getSerializableProperties()},getStyles:function(X){return X.getSerializableStyles()},getAttrs:function(m){return m.getSerializableAttrs()},serializeData:function(q){var P=this;if(P.isSerializable(q)&&!q._refGraph){var Y,D,t,h,n=Hh(q.getClassName())||q.getClass(),x=new n,T={c:q.getClassName(),i:q.getId(),p:{},s:{},a:{}};P.json.d.push(T),Y=P.getProperties(q);for(D in Y)/^_/.test(D)?(t=q[D],t!==x[D]&&P[Vf](D.substr(1),t,T.p)):(h=_m(D),q[h]&&(t=q[h](),t!==x[h]()&&P[Vf](D,t,T.p)));Y=P.getStyles(q);for(D in Y)t=q.s(D),t!==x.s(D)&&P[Vf](D,t,T.s);Y=P.getAttrs(q);for(D in Y)t=q.a(D),t!==x.a(D)&&P[Vf](D,t,T.a);Jl(T.p)&&delete T.p,Jl(T.s)&&delete T.s,Jl(T.a)&&delete T.a}P._hierarchical&&q.getChildren().each(P.serializeData,P)},serializeValue:function(W,h,X){Tc(h)?h={__a:h._as}:h instanceof tf&&(h={__i:h.getId()}),X[W]=h},deserialize:function(s,m,B){var q=this,v=q.dm;v.beginTransaction(),fk++,B=Rg(B)?{setId:B}:B||{},s=q.json=Qc(s)?M.parse(s):s,q._82I={};var Q=new If,D=new If,E=0,i=s.d.length;if(B.justDatas||(zl(s.init)&&s.init(v),v.setInit(s.init)),!B.justDatas){for(var H in s.a)v.a(H,q[Pm](s.a[H]));for(var d in s.p)v[Zh(d)](s.p[d])}for(;i>E;E++){var O=s.d[E],e=Hh(O.c),U=new e,$=O.i;B.setId&&$!=W&&(U._id=$),q._82I[$]=U,Q.add(U),D.add(O)}for(E=0;i>E;E++)q.deserializeData(Q.get(E),D.get(E));return Q.each(function(P){m&&!P.getParent()&&P.setParent(m),v.add(P)}),fk--,v.endTransaction(),Q},deserializeData:function(w,M){for(var l in M.p)w[Zh(l)](this[Pm](M.p[l]));for(l in M.s)w.s(l,this[Pm](M.s[l]));for(l in M.a)w.a(l,this[Pm](M.a[l]))},deserializeValue:function(l){if(ko(l)){var J=l.__i;if(J!=W)return this._82I[J];if(J=l.__a,zn(J))return new If(J)}return l}}),dr(Hk,{serialize:function(N,B){return new zf(this,B).serialize(N)},toJSON:function(E){return new zf(this,E).toJSON()},deserialize:function(F,q,T){return new zf(this).deserialize(F,q,T)}});var ue=c.OverlappingBox=function(f){this.gv=f,this.boxes={}};Sj("OverlappingBox",R,{clear:function(){var o,d,s=this.boxes;for(o in s)d=s[o],d.length=0},isOverlapping:function(P,E){var i,Z,W=this,C=W.boxes,h=C[P];h?(i=h.rects,Z=h.length):h=C[P]={rects:i=[],length:Z=0};var k,o,E;for(k=0;Z>k;k++)if(o=i[k],o.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<=Z?(i.push(E),h.length++):i[h.length++]=E,!1}}),Df.GraphView=function(S){var h=this;h._24I={},h._34I=new If,h._25I={},h._56I={},h._view=Ko(1,h),h._canvas=Nr(h._view),h.dm(S?S:new Hk),this._coreInteractor=new aq(this),h.setEditable(!1),h.setScrollBarVisible(M.graphViewScrollBarVisible)},Ud("GraphView",R,{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:[Vq,Fm,ls,zk,"resettable","editInteractor",Jj,"pannable","rectSelectable","autoScrollZone",id,"movableFunc","editableFunc","pointEditableFunc","rectEditableFunc","rotationEditableFunc","anchorEditableFunc","rectSelectBackground","rectSelectBorderColor","editPointSize","editPointBorderColor","editPointBackground","hoverDelay"],_resettable:M.graphViewResettable,_pannable:M.graphViewPannable,_rectSelectable:M.graphViewRectSelectable,_autoScrollZone:M.graphViewAutoScrollZone,_rectSelectBackground:M.graphViewRectSelectBackground,_rectSelectBorderColor:M.graphViewRectSelectBorderColor,_editPointSize:M.graphViewEditPointSize,_editPointBorderColor:M.graphViewEditPointBorderColor,_editPointBackground:M.graphViewEditPointBackground,_scrollBarColor:sj,_scrollBarSize:Od,_autoHideScrollBar:Yn,_autoMakeVisible:Zd,_currentActionType:"host",getCoreInteractor:function(){return this._coreInteractor},getLayers:function(){return this._dataModel.getLayers()},setLayers:function($){this._dataModel.setLayers($)},setEditable:function(x){var L=this,k=L.__interactorMap__;if(!k){var T=Df.XEditInteractor;k=L.__interactorMap__={scrollBar:new rb(L),select:new Ar(L),edit:T?new T(L):new sm(L),move:new Jn(L),"default":new Fc(L),touch:new gj(L,{editable:!1})}}x?(L._uieditable=!0,L.setInteractors([k.scrollBar,k.select,k.edit,k.move,k.default,k.touch])):(L._uieditable=!1,L.setInteractors([k.scrollBar,k.select,k.move,k.default,k.touch]))},getCanvas:function(){return this._canvas},_33I:function(A){var N=A.getUIClass();return N?new N(this,A):W},getDataUI:function(B){var j=this,X=j._25I[B._id];return X===N&&(X=j._33I(B),j._25I[B._id]=X),X},getNodeRect:function(Q){return M.getNodeRect(this,Q)},getEdgeInfo:function(q){var Z=this.getDataUI(q);return Z?(Z._79o(),Z._78o):null},getEdgeSourcePosition:function(f){var e=this,H=e.getDataUI(f),I=H.s,E=H._data._40I;return kr(e,E,I("edge.source.position"),I("edge.source.offset.x"),I("edge.source.offset.y"),I("edge.source.anchor.x"),I("edge.source.anchor.y"))},getEdgeTargetPosition:function(P){var q=this,M=q.getDataUI(P),c=M.s,F=M._data._41I;return kr(q,F,c("edge.target.position"),c("edge.target.offset.x"),c("edge.target.offset.y"),c("edge.target.anchor.x"),c("edge.target.anchor.y"))},invalidateAll:function(o){var s=this;if(o){for(var M in s._25I){var J=s._25I[M];J&&J.dispose()}s._25I={},s._56I={},s._24I={},s._34I.clear(),s.redraw()}else s.dm().each(function(z){s.invalidateData(z)})},invalidateSelection:function(){var j=this;j.sm().each(function(k){j.invalidateData(k)})},invalidateData:function(c){var T=this;T._24I[c._id]=c,T._21Q(c),T.iv()},_21Q:function(X){var q=this,I=q._24I;if(Fe(X)&&ae[X.s(Pb)]){var B=X.getSourceAgent();B&&B.getAgentEdges().each(function(s){I[s._id]=s}),B=X.getTargetAgent(),B&&B.getAgentEdges().each(function(w){I[w._id]=w}),q.iv()}},redraw:function(w){var o=this;o._32I||(w?o._34I.add(w):(o._32I=1,o._34I.clear()),o.iv())},each:function(M,g){var i,C,t,v=0,D=this.getLayers(),E=this._dataModel,j=E._datas._as,d=j.length;if(D){for(var $=D.length;$>v;v++)if(t=D[v],ko(t)&&(t=t.name),E.isHierarchicalRendering()){var P=function(F){return F._layer===t?g?M.call(g,F):M(F):void 0};if(this._dataModel.eachByHierarchical(P)===!1)return}else for(var Z=0;d>Z;Z++)if(i=j[Z],i._layer===t&&(C=g?M.call(g,i):M(i),C===!1))return}else if(E.isHierarchicalRendering())this._dataModel.eachByHierarchical(M,null,g);else for(;d>v;v++)if(i=j[v],C=g?M.call(g,i):M(i),C===!1)return},reverseEach:function(t,p){var K,N,n,w,X=this._dataModel,z=X._layers,T=X._datas._as,V=T.length;if(z){for(K=z.length-1;K>=0;K--)if(w=z[K],ko(w)&&(w=w.name),X.isHierarchicalRendering()){var y=function(W){return W._layer===w?p?t.call(p,W):t(W):void 0};if(X.reverseEachByHierarchical(y)===!1)return}else for(var A=V-1;A>=0;A--)if(N=T[A],N._layer===w&&(n=p?t.call(p,N):t(N),n===!1))return}else if(X.isHierarchicalRendering())X.reverseEachByHierarchical(t,null,p);else for(K=V-1;K>=0;K--)if(N=T[K],n=p?t.call(p,N):t(N),n===!1)return},getViewRect:function(){return this._29I},getContentRect:function(){var P=this,z=P._84I;if(!z){var b=this.dm().a("width"),q=this.dm().a("height");b>0&&q>0?P._84I={x:0,y:0,width:b,height:q}:(P.each(function($){P.isVisible($)&&(z=Uh(z,P.getDataUIBounds($)))}),P._84I=z?z:hp)}return P._84I},getScrollRect:function(){return Uh(this.getContentRect(),this._29I)},makeCenter:function(z,G,j){var P=this;if(!P.getWidth()||!P.getHeight())return j||Mh(P.centerData,P,[z,G,!0],500),void 0;P.makeVisible(z),P.validate();var a=P.getDataUIBounds(z);if(a){var O=P.getWidth(),r=P.getHeight(),y=a.x+a.width/2,u=a.y+a.height/2,Q=-y*P._zoom+O/2,$=-u*P._zoom+r/2;P.setTranslate(Q,$,G)}},fitData:function(t,j,G,S,X){var a=this;if(!a.getWidth()||!a.getHeight())return X||Mh(a.fitData,a,[t,j,G,S,!0],500),void 0;var Q=function(){a.makeVisible(t),a.validate();var E=a.getDataUIBounds(t);E&&(E=ab(E),lo(E,G==W?20:G),a.fitRect(E,j,S))};j?M.callWhenLoaded(Q):Q()},fitContent:function(r,D,L,S){var V=this;if(!V.getWidth()||!V.getHeight())return S||Mh(V.fitContent,V,[r,D,L,!0],500),void 0;var E=function(){V.validate();var R=ab(V.getContentRect());lo(R,D==W?20:D),V.fitRect(R,r,L)};r?M.callWhenLoaded(E):E()},fitRect:function(Y,h,F){var i=this,A=i.getWidth(),J=i.getHeight(),B=Y.x+Y.width/2,d=Y.y+Y.height/2,g=D(A/Y.width,J/Y.height),S=i._zoom,c=-B*S+A/2,u=-d*S+J/2;0===g||isNaN(g)||(F&&(g=D(1,g)),h?i.setTranslate(c,u,{finishFunc:function(){i.setZoom(g,h)}}):(i.setTranslate(c,u),i.setZoom(g)))},toCanvas:function(d,g){g=g||this._zoom,this.validateImpl();var A=this,S=A.getContentRect();S.width||(S.width=10),S.height||(S.height=10);var u=Nr(),l=S.x*g,F=S.y*g,h=S.width*g,H=S.height*g;Bi(u,h,H,1);var w=ch(u);return d=d||this._dataModel.getBackground(),d&&ic(w,0,0,h,H,d),vc(w,-l,-F),w.scale(g,g),A._42(w),w.restore(),u},toDataURL:function(M,E,h){return this.toCanvas(M,h).toDataURL(E||"image/png",1)},getClipBounds:function(){return this._74O},_42:function($,A){var F=this;F._93db($,A),F.each(function(n){var V=F.getDataUI(n);if(V){var B=F._56I[n._id];if(B){var e=V._79o();c.HtmlNode&&n instanceof c.HtmlNode?V._42($):(!A||js(A,e))&&V._42($)}var f=V._htmlView;f&&(B&&f.layoutHTML&&f.layoutHTML(),f.style.display=B?"block":bf)}}),F._92db($,A)},validateImpl:function(){var x,h,a,y,F,D=this,z=D.tx(),T=D.ty(),v=D._zoom,j=D._canvas,g=this.getWidth(),O=this.getHeight(),c=D._29I,_={x:-z/v,y:-T/v,width:g/v,height:O/v},U={},Q=D._34I,l=D._24I,k=D._32I,I=D._23I;D._24I={},(g!==j.clientWidth||O!==j.clientHeight)&&(Bi(j,g,O),k=1),k||Om(_,c)||(k=1),D._29I=_,D.each(function(y){h=y._id;var A=U[h]=D.isVisible(y);A!==D._56I[h]&&(l[h]=y,a=D.getDataUI(l[h]),a&&a._84o(A),D._84o(y,A))},D);for(h in l)a=D.getDataUI(l[h]),a&&(!k&&D._56I[h]&&(F=a._79o(),F&&Q.add(F)),a.invalidate()),D._83I=1;if(D._56I=U,!k)for(h in l)U[h]&&(a=D.getDataUI(l[h]),a&&(F=a._79o(),F&&Q.add(F)));if(k?y=_:(Q.each(function(O){js(_,O)&&(y=Uh(y,O))}),y&&(lo(y,s(1,1/v)),y.x=i(y.x*v)/v,y.y=i(y.y*v)/v,y.width=J(y.width*v)/v,y.height=J(y.height*v)/v,y=wj(_,y))),D._74O=y,y){x=ch(j);var d=y.x,u=y.y,H=y.width,p=y.height;d=Math.floor((d*v+z)*Qd),u=Math.floor((u*v+T)*Qd),H=Math.ceil(H*v*Qd)+1,p=Math.ceil(p*v*Qd)+1,x.beginPath(),x.rect(d,u,H,p),x.clip(),x.clearRect(d,u,H,p),Ce(x,z,T,v),D._42(x,y),x.restore(),delete D._74O}if(Q.clear(),delete D._32I,I&&g>0&&O>0){var a=D.getDataUI(I);if(a){var F=a._79o(),V=D._29I,t=V.x,n=V.y,o=V.width,A=V.height,v=D._zoom;F&&!js(F,V)&&(F.x+F.width<t&&D.tx(-F.x*v),F.x>t+o&&D.tx(-(F.x+F.width-o)*v),F.y+F.height<n&&D.ty(-F.y*v),F.y>n+A&&D.ty(-(F.y+F.height-A)*v))}delete D._23I}D._83I&&(delete D._83I,delete D._84I),D._98O(),Jl(D._24I)||Mh(D.iv,D)},isScrollBarVisible:function(){return!!this._79O},setScrollBarVisible:function(f){var K=this;f!==K.isScrollBarVisible()&&(f?(Vd(K._view,K._79O=ps()),Vd(K._79O,K._27I=ps()),Vd(K._79O,K._28I=ps())):(Lb(K._79O),delete K._79O,delete K._27I,delete K._28I),K.fp("scrollBarVisible",!f,f))},showScrollBar:function(){var n=this;n._79O&&(n._85I||(G(function(){n._86I()},qn),n.iv()),n._85I=new Date)},_86I:function(){var U=this;if(U._85I){var c=new Date,V=c.getTime();V-U._85I.getTime()>=qn?(delete U._85I,U.iv()):G(function(){U._86I()},qn)}},getVScrollBar:function(){return this._27I},getHScrollBar:function(){return this._28I},_98O:function(){var D=this,o=this._27I,R=this._28I;if(D._79O){if(D._autoHideScrollBar&&!D._85I)return o.style.visibility=Wr,R.style.visibility=Wr,void 0;var u=D.getScrollBarColor(),J=D._zoom,f=D.getScrollBarSize(),i=D.getViewRect(),E=D.getScrollRect(),b=i.height*J,Y=E.height*J,g=i.width*J-f-2,K=b*((i.y-E.y)*J/Y),A=b*(b/Y),H=o.style;Y-.5>b?(wh>A&&(K=K+A/2-wh/2,0>K&&(K=0),K+wh>b&&(K=b-wh),A=wh),vr(o,g,K,f,A),H.visibility=xm,H.background=u,H.borderRadius=f/2+is):H.visibility=Wr;var x=i.width*J,j=E.width*J,K=i.height*J-f-2,g=x*((i.x-E.x)*J/j),Q=x*(x/j),H=R.style;j-.5>x?(wh>Q&&(g=g+Q/2-wh/2,0>g&&(g=0),g+wh>x&&(g=x-wh),Q=wh),vr(R,g,K,Q,f),H.visibility=xm,H.background=u,H.borderRadius=f/2+is):H.visibility=Wr}},setDataModel:function(O){var A=this,x=A._dataModel,P=A._selectionModel;x!==O&&(x&&(x.ump(A.handleDataModelPropertyChange,A),x.umm(A.handleDataModelChange,A),x.umd(A.handleDataPropertyChange,A),x.removeIndexChangeListener(A._75O,A),x.removeHierarchyChangeListener(A.handleHierarchyChange,A),P||x.sm().ums(A.handleSelectionChange,A)),A._dataModel=O,O.mp(A.handleDataModelPropertyChange,A),O.mm(A.handleDataModelChange,A),O.md(A.handleDataPropertyChange,A),O.addIndexChangeListener(A._75O,A),O.addHierarchyChangeListener(A.handleHierarchyChange,A),P?P._21I(O):O.sm().ms(A.handleSelectionChange,A),A.invalidateAll(!0),A.fp(ol,x,O),A._canvas.style.background=O.getBackground()||"")},getLayersInfo:function(){if(this._layersInfo===N){var R=this.getLayers();R?(this._layersInfo={},R.forEach(function(i){var I=ko(i)?i.name:i;this._layersInfo[I]=i},this)):this._layersInfo=null}return this._layersInfo},updateLayers:function(){this._layersInfo=N,this.invalidateSelection(),this.redraw()},handleDataModelPropertyChange:function(N){if("background"===N.property){var Z=this._canvas.style.background,P=N.newValue||"";this._canvas.style.background=P,this.fp("canvasBackground",Z,P)}else"a:width"===N.property||"a:height"===N.property?(this._83I=1,this.redraw()):"layers"===N.property?this.updateLayers():"hierarchicalRendering"===N.property&&this.redraw()},handleDataPropertyChange:function(g){this.dm().isHierarchicalRendering()&&"parent"===g.property&&g.data.hasChildren()&&this.redraw(),this.invalidateData(g.data)},onPropertyChanged:function(I){var Z=this,q=I.property;if(Z.redraw(),"zoom"===q){var L=Z.sm().getSelection();L.size()&&L.each(function(I){I.invalidate()})}gn[q]?Z.showScrollBar():q===Jj&&Z.onCurrentSubGraphChanged(I)},onCurrentSubGraphChanged:function(){this.sm().cs(),this.reset()},handleDataModelChange:function(o){var H=this,I=o.kind,h=o.data;if(H._83I=1,"add"===I)H.invalidateData(h),Fe(h)&&h.getEdgeGroup()&&h.getEdgeGroup().eachSiblingEdge(H.invalidateData,H);else if(I===As){H._21Q(h);var j=h._id,R=H._25I[j];if(R){if(H._56I[j]){var m=R._79o();m&&H.redraw(m)}R.dispose(),delete H._25I[j],delete H._24I[j],delete H._56I[j]}h===H._currentSubGraph&&H.setCurrentSubGraph(W)}else I===Ln&&(H.invalidateAll(!0),H.setCurrentSubGraph(W))},_75O:function(L){this.invalidateData(L.data)},handleHierarchyChange:function(K){this.dm().isHierarchicalRendering()&&K.data.hasChildren()&&this.redraw(),this.invalidateData(K.data)},adjustIndex:function(C){var X=this;if(X.isVisible(C)){X.dm().beginTransaction();for(var P=C;P._parent&&X.isVisible(P._parent);)P=P._parent;P&&P!==C&&X._dataModel.adjustIndex(P),X._dataModel.adjustIndex(C),X.dm().endTransaction()}},getImage:function(G){return G.getImage?G.getImage():N},getSelectWidth:function(u){var y=eo(this.getImage(u));return y&&ag(y.disableSelectedBorder,u,this)?0:u.s("select.width")},getSelectColor:function(X){return X.s("select.color")},isSelectable:function(O){if(!this._clickThroughChecking&&O.getParent()instanceof Fh&&O.getParent().isSyncSize())return!1;var J=this.getLayersInfo();if(J){var n=J[O._layer];if(n&&n.selectable===!1)return!1}return O.s("2d.selectable")&&this.sm().isSelectable(O)},isMovable:function(F){var C=this;if(Fe(F)&&F.getStyle(Pb)!==oc)return!1;var g=this.getLayersInfo();if(g){var Q=g[F._layer];if(Q&&Q.movable===!1)return!1}return F.s("2d.movable")?C._movableFunc?C._movableFunc(F):!0:!1},isEditable:function(b){var r=this;if(c._uiSerializing)return r._uieditable;if(!r._editInteractor||!r.isSelected(b))return!1;if(tl(b)){var p=r.getDataUI(b);if(!p||p._88I)return!1}if(Fe(b)&&b.getStyle(Pb)!==oc)return!1;var l=this.getLayersInfo();if(l){var f=l[b._layer];if(f&&f.editable===!1)return!1}return b.s("2d.editable")?r._editableFunc?r._editableFunc(b):!0:!1},handleDelete:function(){this._editInteractor&&(this._editInteractor.handleDelete?this._editInteractor.handleDelete():this.removeSelection())},isPointEditable:function(M){return Cj(M)&&0!==M.getRotation()?!1:this._pointEditableFunc?this._pointEditableFunc(M):!0},isRectEditable:function(M){return this._rectEditableFunc?this._rectEditableFunc(M):!0},isAnchorEditable:function(U){return this._anchorEditableFunc?this._anchorEditableFunc(U):!0},isRotationEditable:function(u){return u.setRotation&&u.IRotatable!==!1?this._rotationEditableFunc?this._rotationEditableFunc(u):!0:!1},getRotationPoint:function(H){var b=H.getAnchor(),c=H.getScale(),O=this._zoom,P=Al(H.getRotation(),0,-H.getHeight()*c.y*b.y-(c.y<0?-1:1)*(Bs?32:16)/O),Q=H.p();return P.x+=Q.x,P.y+=Q.y,P},getLogicalPoint:function(z){var b=this;return Tg(z,b._canvas,b.tx(),b.ty(),b._zoom,b._zoom)},getSelectedDataAt:function(n){var O=this;return this.getDataAt(n,function(D){return O.isSelected(D)})},getDataInfoAt:function(T,m,R){var k,S=this.lp(T),a=this.getDataAt(S,m,R);if(a){var v=this.getDataUI(a);k={data:a,ui:v,point:S};var N=v._38o;if(N){var X=N.icons;for(var B in X){var w=X[B],I=N.rects[B];if(I)for(var K=ag(w.names,a,this),H=K?K.length:0,b=I.rotation,d=H-1;d>=0;d--){var U=K[d],c=I[d];if(Vb(c,S,b))return k.part="icons",k.name=B,k.icon=U,k.rect=c,k.index=d,k.rotation=b,k}}}if(this.isNoteVisible(a)){if(v.note2Info&&Vb(v.note2Info.clickRect,S,W,v.note2Info.scale))return k.part="note2",k;if(v.noteInfo&&Vb(v.noteInfo.clickRect,S,W,v.noteInfo.scale))return k.part="note",k}if(this.isLabelVisible(a)){if(v.label2Info&&Vb(v.label2Info.rect,S,v.label2Info.rotation,v.label2Info.scale))return k.part="label2",k;if(v.labelInfo&&Vb(v.labelInfo.rect,S,v.labelInfo.rotation,v.labelInfo.scale))return k.part="label",k}if(a.isInRect&&a.isInRect(S))return k.part="body",k}return k},getDataAt:function(u,R,i){u.target&&(u=this.lp(u));var I,b=this._zoom;return this.reverseEach(function(l){return(R?R(l):this.isSelectable(l))&&this.rectIntersects(l,Te(u.x,u.y,i,b))?(I=l,!1):void 0},this),I},getIconInfoAt:function(w,c){var T=this;if(w.target&&(w=T.lp(w)),c||(c=T.getDataAt(w)),c){var d=T.getDataUI(c);if(d&&d._38o){var f,J=d._38o,y=new If;for(f in J.icons)y.add(f);for(var S=y.size()-1;S>=0;S--){f=y.get(S);for(var _=J.rects[f],D=_.rotation,j=_.length-1;j>=0;j--){var R=_[j],G=R.width,L=R.height,u={x:w.x-R.x-G/2,y:w.y-R.y-L/2};D!=W&&(u=Al(-D,u.x,u.y));var R={x:-G/2,y:-L/2,width:G,height:L};if(Vb(R,u))return{key:f,index:j,name:J.icons[f].names[j],rect:_[j],point:w,rotation:D,relativeRect:R,relativePoint:u,data:c}}}}}return W},getDatasInRect:function(J,H,Q){Q===N&&(Q=1);
- var m=this,S=new If;return m.reverseEach(function(b){Q&&!m.isSelectable(b)||(H?m.rectIntersects(b,J):m.rectContains(b,J))&&S.add(b)}),S},moveSelection:function(l,s){var B=this;B.dm().beginTransaction(),Bb(B.sm().toSelection(B.isMovable,B),l,s),B.dm().endTransaction()},moveDatas:function(w,F,C){var l=this;l.dm().beginTransaction(),w instanceof If||(w=new If(w)),Bb(w,F,C),l.dm().endTransaction()},getDataUIBounds:function(V){var g=this.getDataUI(V);return g?g._79o():W},drawData:function(B,r){var H=this.getDataUI(r);H&&(H._79o(),H._42(B)),r instanceof c.Block&&r.eachChild(function(K){this.drawData(B,K)},this)},getBoundsForGroup:function(Y){return Y.s(Tl)?this.getDataUIBounds(Y):W},isPixelPerfect:function(s){return s.s("pixelPerfect")},rectIntersects:function(u,X){this.validate();var y=W;if(this._56I[u._id]){var f=this._25I[u._id];if(f){var H=f._79o();if(us(X,H))y=!0;else if((X=wj(X,H))&&(f.rectIntersects&&(y=f.rectIntersects(X)),y==W)){if(!this.isPixelPerfect(u))return!0;var Y=X.x,C=X.y,Z=X.width,v=X.height,w=this._zoom,k=M.hitMaxArea,G=Z*v*w*w;if(G>k){var t=Math.sqrt(k/G);w*=t}Z*=w,v*=w,2>Z&&(Z=2),2>v&&(v=2),Y*=w,C*=w;var r=ap(Z,v);vc(r,-Y,-C),r.scale(w,w),this._drawForChecking=!0,this.drawData(r,u),this._drawForChecking=!1;try{for(var o=0,D=r.getImageData(0,0,Z,v).data;o<D.length;o+=4)if(0!==D[o+3]){y=!0;break}r.restore()}catch(P){Yp=W,y=!1}}}}return y?!0:!1},rectContains:function($,p){if(this._56I[$._id]){var A=this._25I[$._id];if(A)return us(p,A._79o())}return!1},reset:function(){this.setZoom(1),this.setTranslate(0,0)},handleKeyDown:function(l){if(!M.isInput(l.target)){var G=this,i=G._focusData,Z=i&&G._25I[i._id],B=0,P=G._dataModel._datas;if(!(i&&i._enabled&&i._editable&&Z&&Z.onKeyDown&&Z.onKeyDown(l)===!0))if(9===l.keyCode&&(i&&(B=P.indexOf(i),Mc(l)?-1===--B&&(B=0):++B===P.size()&&(B=0)),G._focusData=i=P.get(B),G.sm().setSelection(i)),Vc(l)?G.selectAll():Nd(l)&&G.isResettable()&&G.reset(),G.sm().isEmpty()){if(G._editing)return;var W=G.tx(),q=G.ty(),E=!1,Q=Mc()?100:10;Ae(l)&&(W-=Q,E=!0),Gr(l)&&(q-=Q,E=!0),Fr(l)&&(W+=Q,E=!0),ob(l)&&(q+=Q,E=!0),E&&G.setTranslate(W,q)}else{Qh(l)&&G.handleDelete(l);var O=Mc()?10:1;Ae(l)&&(G.moveSelection(-O,0),G.fi({kind:"moveLeft"})),Gr(l)&&(G.moveSelection(0,-O),G.fi({kind:"moveUp"})),Fr(l)&&(G.moveSelection(O,0),G.fi({kind:"moveRight"})),ob(l)&&(G.moveSelection(0,O),G.fi({kind:"moveDown"}))}}},handleScroll:function(B,S){if(Zp(B),!this.getEditInteractor()){var s=this.getDataAt(B);if(s){var x=eo(this.getImage(s));if(x&&ag(x.scrollable,s,this))return}}var t=this.lp(B);S>0?this.scrollZoomIn(t):0>S&&this.scrollZoomOut(t)},handlePinch:function(s,n,P){this._68I||(n>P?this.pinchZoomIn(s):this.pinchZoomOut(s))},checkDoubleClickOnNote:function(X,Z){var G=this,y=G.lp(X),K=G.getDataUI(Z),r=K.note2Info;return r&&Z.s("note2.toggleable")&&Vb(r.clickRect,y)?(Z.s(Am,!Z.s(Am)),G.fi({kind:"toggleNote2",event:X,data:Z}),!0):(r=K.noteInfo,r&&Z.s("note.toggleable")&&Vb(r.clickRect,y)?(Z.s(fo,!Z.s(fo)),G.fi({kind:"toggleNote",event:X,data:Z}),!0):!1)},_84o:function(){},isNoteVisible:function(){return this._zoom>.15},isLabelVisible:function(){return this._zoom>.15},isEditVisible:function(){return this._zoom>.15},autoScroll:function(N,F){var s=this,Y=s.getAutoScrollZone(),S=Y/s.getZoom(),t=Y/4,l=s._29I,G=s.lp(N),X={x:s.tx(),y:s.ty()};return G&&Y>0&&l&&(G.x-l.x<S?s.translate(t,0):l.x+l.width-G.x<S&&s.translate(-t,0),G.y-l.y<S?s.translate(0,t):l.y+l.height-G.y<S&&s.translate(0,-t)),X.x=s.tx()-X.x,X.y=s.ty()-X.y,F&&(F.x+=X.x,F.y+=X.y),X},getMoveMode:function($,b){var v=b.s("2d.move.mode");return v?v:uq["88"]?"x":uq["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(J,M,N){var n=this;return"currentSubGraph"===M?{__i:J.getId()}:N.serializeProperty(J,M,n)},deserializeProperty:function($,b,f){var d=this;if("currentSubGraph"===b){var K=d.dm(),g=K.__idMap;return g[$.__i]}return f.deserializeProperty($,b,d)},setDefaultCursor:function(I,X){this._defaultCursor=I,X!==!1&&this.setCursor(I)},setCursor:function(p){"default"===p&&(p=this._defaultCursor||p);var m=this.getView().style;m.cursor=p,m.cursor="-webkit-"+p,m.cursor="-moz-"+p},getCurrentConnectActionType:function(){return this._currentActionType},setCurrentConnectActionType:function(b){return M.getConnectAction(null,b)?(this._currentActionType=b,!0):!1},isInteractive:function(c){var R=eo(this.getImage(c));return R&&ag(R.interactive,c,this)?!0:c.s("interactive")},appendHTML:function(P){var A=this.getView();if(P&&P.parentNode!==A){var F=this.getCanvas().nextSibling;F?A.insertBefore(P,F):Vd(A,P)}},layoutHTML:function(h,F,z){var V=this,R=V._zoom;if(F.style.position="absolute",z){var d=h.getRect();vr(F,V.tx()+d.x*R,V.ty()+d.y*R,d.width*R,d.height*R)}else{var W=new lp,d=h.getAnchorRect(),G=h.getPosition(),l=h.getScale(),C=F.style;vr(F,d),W.appendTranslate(V.tx(),V.ty()),W.appendScale(R,R),W.append(new lp(h.getRotation(),G.x,G.y,l.x,l.y)),$f(C,"transform","matrix("+W.a.toFixed(5)+", "+W.b.toFixed(5)+", "+W.c.toFixed(5)+",\n "+W.d.toFixed(5)+", "+W.tx.toFixed(5)+", "+W.ty.toFixed(5)+")"),$f(C,"transformOrigin",(-d.x).toFixed(5)+"px "+(-d.y).toFixed(5)+"px")}}});var Jf=function(E,t){var V=this;V.gv=E,V.s=function(Z){return t.getStyle(Z)},V._data=t,V._87I=new If};Xr(Jf,R,{_6I:W,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(){var U=this,l=U.gv.isSelected(U._data);return!l||U.isShadowed()?0:U.gv.getSelectWidth(U._data)},getSelectColor:function(){return this.gv.getSelectColor(this._data)},getBodyColor:function(T){var q=this._data,r=this.gv.getBodyColor(q);return r?r:T?q.getStyle(T):W},_2Q:function(m){return this.s(m)},_1Q:function(o,n,k,Q){var f=this.s,Y=f(n+".dash.color");o.strokeStyle=Y,o.lineWidth=k,o.stroke(),f(n+".dash.3d")&&He(o,Y,f(n+".dash.3d.color"),k,this.gv._zoom,f(n+".dash.3d.accuracy")),sd(o,Q)},invalidate:function(){this._6I=W},_79o:function(){var y=this;if(!y._6I){var w=y._data,n=y.gv;y.labelInfo=y.label2Info=y.noteInfo=y.note2Info=y._38o=W,y._87I.clear(),y.interactiveInfo=n.isInteractive(w)?{}:W,y._3O(),y._55O=n.isEditable(w)?{_42O:n.isRectEditable(w),_43O:n.isPointEditable(w),_56O:n.isRotationEditable(w)}:W,y._6I=y._81o()}return y._6I},_3O:function(){},getPosition:function(){return hp},_68o:function(_,R){_&&this._87I.add(Ah(_,R))},_81o:function(){var L=this,I=L.s;L._24O(yg,"getLabel"),L._24O(gp,"getLabel2"),L._26O(Wl,"getNote"),L._26O(ik,"getNote2"),L._15O(),L._55O&&L._48O();var V;if(L._87I.each(function(X){V=Uh(V,X)}),V&&L.isShadowed()){var d=ab(V);d.x+=I("shadow.offset.x"),d.y+=I("shadow.offset.y"),lo(d,I("shadow.blur")),V=Uh(V,d)}return L._87I.clear(),V},_42:function(p){var J=this,X=J._data,r=J.gv,g=J.s,e=g("opacity"),R=this.isShadowed();if(R){var o=p.shadowOffsetX,i=p.shadowOffsetY,t=p.shadowBlur,C=p.shadowColor,G=r.getZoom();p.shadowOffsetX=g("shadow.offset.x")*G,p.shadowOffsetY=g("shadow.offset.y")*G,p.shadowBlur=g("shadow.blur")*G,p.shadowColor=J.getSelectColor()}if(e!=W){var x=p.globalAlpha;p.globalAlpha=e}J._80o(p),r.isLabelVisible(X)&&((!r._drawForChecking||g("label.selectable"))&&mq(p,J.labelInfo),(!r._drawForChecking||g("label2.selectable"))&&mq(p,J.label2Info)),r.isNoteVisible(X)&&(wb(p,J.noteInfo),wb(p,J.note2Info)),J._99O(p),e!=W&&(p.globalAlpha=x),R&&(p.shadowOffsetX=o,p.shadowOffsetY=i,p.shadowBlur=t,p.shadowColor=C)},_80o:function(){},_47O:function(){},_24O:function(S,d){var X=this,m=X._data,P=X.gv,G=X.s,h=P[d](m);if(h!=W){var H=G(S+".scale"),k=G(S+".max"),E=G(S+".position"),Y=X[S+"Info"]={label:h,scale:H,color:P[d+"Color"](m),font:G(S+".font"),opacity:G(S+".opacity"),align:G(S+".align"),rotation:X.getRotation(G(S+".rotation"),!1,E),background:P[d+"Background"](m)},p=vj(Y,h);k>0&&k<p.width&&(Y.labelWidth=p.width,p.width=k),1!==H&&(p.width*=H,p.height*=H);var T=X.getPosition(E,G(S+".offset.x"),G(S+".offset.y"),p,G(S+".position.fixed"));if(p.x=T.x-p.width/2,p.y=T.y-p.height/2,X._68o(Y.rect=p,Y.rotation),1!==H){var M=p.width/H,Z=p.height/H;Y.rect={x:T.x-M/2,y:T.y-Z/2,width:M,height:Z}}}},_26O:function(L,f){var P=this,i=P.gv,G=P._data,_=P.s,s=i[f](G);if(s!=W){var k,K,m=_(L+".scale"),l=P[L+"Info"]={note:s,scale:m,data:G,view:i,expanded:_(L+".expanded"),font:_(L+".font"),color:_(L+".color"),opacity:_(L+".opacity"),align:_(L+".align"),icon:_(L+".icon"),backgroundImage:_(L+".backgroundImage"),borderWidth:_(L+".border.width"),borderColor:_(L+".border.color"),background:i[f+"Background"](G)},u=P.getPosition(_(L+".position"),_(L+".offset.x"),_(L+".offset.y")),R=u.x,n=u.y;if(l.expanded){var r,p=_(L+".max"),F=_(L+".backgroundImage");F?(F=eo(F),r={width:ef(F,G),height:fc(F,G)}):r=vj(l,s),r.width+=6,r.height+=2,p>0&&p<r.width&&(l.labelWidth=r.width,r.width=p),k=r.width,K=r.height+8,l.clickRect={x:R-k*m/2,y:n-K*m,width:k*m,height:K*m*r.height/K}}else{var D=_(L+".icon");D?(D=eo(D),k=ef(D,G),K=fc(D,G)):(k=12,K=18),l.clickRect={x:R-k*m/2,y:n-K*m,width:k*m,height:K*m}}l.rect={x:R-k/2,y:n-K*m/2-K/2,width:k,height:K};var V=J(l.borderWidth/2)*m;P._68o({x:R-k*m/2-V,y:n-K*m-V,width:k*m+2*V,height:K*m+2*V})}},_48O:function(){},_99O:function(N){var l=this,S=l._38o;if(S){var f=l.gv,t=l._data,y=S.icons,T=l.interactiveInfo;T&&(T._38o={});for(var P in y){var d=y[P],j=S.rects[P];if(j){T&&(T._38o[P]=[]);var i=ag(d.opacity,t,f),g=ag(d.names,t,f),J=g?g.length:0,m=j.rotation;if(i!=W){var h=N.globalAlpha;N.globalAlpha*=i}for(var U=0;J>U;U++){var R=g[U],s=eo(R),A=j[U];if(m){var u=A.x+A.width/2,D=A.y+A.height/2;N.save(),vc(N,u,D),We(N,m),vc(N,-u,-D)}T&&T._38o[P].push(N.interactiveInfo={compInfos:[],matrix:m?new lp(m,u,D).appendTranslate(-u,-D):new lp}),Ym(N,s,ag(d.stretch,t,f),A.x,A.y,A.width,A.height,l._data,l.gv),N.interactiveInfo=W,m&&N.restore()}i!=W&&(N.globalAlpha=h)}}}}});var xk=function(M,z){Ne(xk,this,[M,z])};Xr(xk,Jf,{_checkEmptyRect:!0,_40O:function(A,h){var c=this,V=c.s,B=A.rect;(A.borderColor=c.gv.getBorderColor(c._data))&&(A.borderType=V("border.type"),A.borderWidth=V("border.width"),A.borderPadding=V("border.padding"),h=s(h,A.borderPadding+A.borderWidth/2));var X=c._data.getScale(),Q=s(1,s(t(X.x),t(X.y)));if(A.selectWidth=c.getSelectWidth()){var q=c.gv._zoom;A.selectType=V("select.type"),A._97o=c.getSelectColor(),A.selectPadding=V("select.padding"),h=s(h,(A.selectPadding+A.selectWidth/2/q)/Q)}h>0&&(h*=Q,B=ab(B),lo(B,h)),c._68o(B)},_39O:function(P,y){var L,$=this,w=y.rect;if(y.borderWidth>0&&(L=y.borderPadding,P.strokeStyle=y.borderColor,P.lineWidth=y.borderWidth,wk(P,y.borderType,{x:w.x-L,y:w.y-L,width:w.width+2*L,height:w.height+2*L}),P.stroke()),y.selectWidth>0){var D=$.gv._zoom;if(L=y.selectPadding,P.strokeStyle=y._97o,P.lineWidth=y.selectWidth/D,y.rotation!=W){P.save(),P.translate(y.position.x,y.position.y),P.rotate(y.rotation);var m=$._data,V=m.getWidth(),t=m.getHeight(),H=y.scale,Z=y.anchor;w={x:H.x*-V*Z.x,y:H.y*-t*Z.y,width:H.x*V,height:H.y*t}}wk(P,y.selectType,{x:w.x-L,y:w.y-L,width:w.width+2*L,height:w.height+2*L}),y.rotation!=W&&P.restore(),P.stroke()}},dispose:function(){var f=this,D=f._htmlView;xk.superClass._3O.call(f),D&&(Lb(D),D.disposeHTML&&D.disposeHTML())},_3O:function(){var g=this,G=g.s,X=g._data,S=g.gv,R=X.getStyle(fr),Z=g.getBodyColor(),k=g._83o=R?{shape:R,_53o:g.getBodyColor("shape.background"),_27Q:eo(G("shape.repeat.image"),Z),shapeGradientPack:G("shape.gradient.pack"),_54o:G("shape.border.width"),_55o:G("shape.border.color"),_56o:G("shape.border.3d"),_57o:G("shape.border.3d.color"),_58o:G("shape.border.3d.accuracy"),shapeGradient:G("shape.gradient"),_59o:G("shape.gradient.color"),_60o:G("shape.border.pattern"),_61o:G("shape.border.cap"),_62o:G("shape.border.join"),bodyColor:Z}:{img:eo(S.getImage(X),Z),bodyColor:Z,stretch:G("image.stretch")};if(Q&&!u);else{var o,P=k.img;P&&P.renderHTML?(g._htmlInfo&&g._htmlInfo.img!==P&&(g._htmlInfo=W),g._htmlInfo||(g._htmlInfo={img:P,cache:{}}),o=P.renderHTML(X,S,g._htmlInfo.cache)):g._htmlInfo=W,g._htmlView&&g._htmlView!==o&&Lb(g._htmlView),(g._htmlView=o)&&S.appendHTML(o),k.rect=X.getRect(),k.position=X.p(),k.scale=X.getScale(),k.anchor=X.getAnchor(),k.rotation=X.getRotation(),R===Rl&&(k._63o=G("shape.depth"));var B=0;if(R)B=yh(W,k._54o/2,k._62o),g.s("shape.dash")&&(B=s(B,(g.s("shape.dash.width")||k._54o)/2));else if(P&&P.boundExtend)if(B=ag(P.boundExtend,X,S),P.boundExtendAbsolute){var F=X.getScale();B/=S._zoom*s(1,s(t(F.x),t(F.y)))}else if(!ag(P.fitSize,X,S)){var E=ag(P.width,X,S),f=ag(P.height,X,S);B*=s(X.getWidth()/E,X.getHeight()/f)}g._40O(k,B);var a=G("clip.percentage");if(1>a&&(0>a&&(a=0),k.clipRect=Jk(X.getAnchorRect(),G("clip.direction"),a)),R){var c=G("shape.fill.clip.percentage");1>c&&(0>c&&(c=0),k.shapeClipRect=Jk(X.getAnchorRect(),G("shape.fill.clip.direction"),c))}}},getPosition:function(Y,o,K,P){var B=jm(Y,this._83o.rect,P);return B.x+=o,B.y+=K,B},_80o:function(f){var v=this,j=v.s,S=v.gv,y=v._data,C=v._83o,e=C.rect,M=C.position,k=C.rotation,R=C.anchor,t=C.scale,O=C.shape,G=C.clipRect;if(!v._checkEmptyRect||e.width>0&&e.height>0){var a=y.getSize();if(a.x=-a.width*R.x,a.y=-a.height*R.y,f.save(),vc(f,M.x,M.y),We(f,k),li(f,t.x,t.y),G&&(f.beginPath(),f.rect(G.x,G.y,G.width,G.height),f.clip()),S._drawForChecking&&C.img&&ag(C.img.pixelPerfect,y,S)===!1)ic(f,a.x,a.y,a.width,a.height,"#888888");else if(v.freeDraw)v.freeDraw(f,a,C);else if(O){var _,i,L,m,B=C._60o,r=qc(f,B),c=C._53o,X=C._27Q,J=C._54o,Y=C._55o,F=C.shapeGradientPack,x=f.lineJoin,l=f.lineCap;if("roundRect"===O?_=j("shape.corner.radius"):"polygon"===O?_=j("shape.polygon.side"):"arc"===O&&(_=j("shape.arc.from"),i=j("shape.arc.to"),L=j("shape.arc.close"),m=j("shape.arc.oval")),f.lineJoin=C._62o,f.lineCap=C._61o,j("shape.background2")&&(wk(f,O,a,_,i,L,m),bn(f,j("shape.background2"),j("shape.gradient2"),j("shape.gradient2.color"),a),f.fill()),c||X||F){var K=C.shapeClipRect;K&&(f.save(),f.beginPath(),f.rect(K.x,K.y,K.width,K.height),f.clip()),wk(f,O,a,_,i,L,m),F?Mp(f,F):X?Ci(f,X,C.bodyColor,null,y,S):bn(f,c,C.shapeGradient,C._59o,a),f.fill(),K&&f.restore(),F&&f.restore(),f!==r&&wk(r,O,a,_,i,L,m)}else wk(r,O,a,_,i,L,m);if(J>0){var g=j("shape.border.width.absolute");g&&(f.save(),f.setTransform(1,0,0,1,0,0)),f.lineWidth=J,f.strokeStyle=Y,f.stroke(),g&&f.restore(),C._56o&&He(f,Y,C._57o,J,S._zoom,C._58o)}if(sd(f,B),j("shape.dash")){var p=j("shape.dash.width")||J;if(p>0){B=j("shape.dash.pattern");var r=qc(f,B,v._2Q("shape.dash.offset"));r!==f&&wk(r,O,a,_,i,L,m),v._1Q(f,"shape",p,B)}}te(f,c,C._63o,a),f.lineJoin=x,f.lineCap=l}else{var D=v.interactiveInfo;D&&(f.interactiveInfo=D.bodyInfo={compInfos:[],matrix:new lp(k,M.x,M.y,t.x,t.y)}),Ym(f,C.img,C.stretch,a.x,a.y,a.width,a.height,y,S,C.bodyColor),f.interactiveInfo=W}f.restore()}v._39O(f,C)},_48O:function(){},_47O:function(){}});var Yj=function(v,o){Ne(Yj,this,[v,o])},Em=function(v,M,S,w){var y=Nc(v,M);return S=w?D(S,y):Np(S,y),y?S/=y:S=0,{x:v.x+(M.x-v.x)*S,y:v.y+(M.y-v.y)*S}};Xr(Yj,Jf,{_3O:function(){var u,P=this,r=P._data,Z=P.gv,t=P.s,h=t(Pb),K=r.isLooped(),S=t("edge.width"),C=t("edge.center"),D=t("edge.offset"),H=Z.getBorderColor(r),e=H?t("border.width"):0,E=P.getSelectWidth(),y=r._40I,v=r._41I,U=P._78o=y&&v?{looped:K,type:h,width:S,center:C,color:P.getBodyColor("edge.color"),borderColor:H,borderWidth:e,_97o:E?P.getSelectColor():W,selectWidth:E,pattern:t("edge.pattern"),cap:t("edge.cap"),join:t("edge.join"),is3d:t("edge.3d"),_67o:t("edge.3d.color"),_66o:t("edge.3d.accuracy")}:W;if(U){var f=M.getEdgeType(h);if(f){var z=f(r,km(P,Z,r,K,h),Z,P._19Q);z.points&&z.points.size()>1?(U.edgeTypeInfo=z,u=rd(U.edgeTypeInfo.points)):z[hd]&&z.rect&&(U.edgeTypeInfo=z,u=z.rect)}else{var k=t("edge.source.anchor.x"),n=t("edge.source.anchor.y"),q=t("edge.target.anchor.x"),Y=t("edge.target.anchor.y"),G=kr(Z,y,t("edge.source.position"),t("edge.source.offset.x"),t("edge.source.offset.y"),k,n),d=kr(Z,v,t("edge.target.position"),t("edge.target.offset.x"),t("edge.target.offset.y"),q,Y);if(h===oc){var m=U.points=t(tc)||hf,w=m.size();U.segments=t("edge.segments");var a=k!==N||n!==N,I=q!==N||Y!==N;if(!C)if(D)a||(G=Em(G,w?m.get(0):d,D,w)),I||(d=Em(d,w?m.get(w-1):G,D,w));else{var L;a||(L=os(G,w?m.get(0):d,Lg(Z,y)),L&&(G={x:L[0],y:L[1]})),I||(L=os(w?m.get(w-1):G,d,Lg(Z,v)),L&&(d={x:L[0],y:L[1]}))}u=Uh(rd(U.points),rd(G,d))}else{var o=km(P,Z,r,K,h);if(P._19Q||(o=-o),K)G=ab(G),G.x=Z.getNodeRect(y).x,U.radius=o,u={x:G.x-o,y:G.y-o,width:2*o,height:2*o};else{var $=Nc(G,d),p=Np(D,$),J={x:p,y:o},g={x:$-p,y:o},j=B(d.y-G.y,d.x-G.x),A=U.mat=new ng(j);if(U.orienAngle=j,U.angle=d.x<G.x?j+l:j,U.rect={x:J.x,y:J.y,width:g.x-J.x,height:0},U.origin=G,J=A.tf(J),J.x+=G.x,J.y+=G.y,g=A.tf(g),g.x+=G.x,g.y+=G.y,C){var F={x:$,y:0};F=A.tf(F),F.x+=G.x,F.y+=G.y,u=rd([G,J,g,F]),U.c1=G,U.c2=F}else u=rd(J,g);G=J,d=g}}U.sourcePoint=G,U.targetPoint=d,r._lastSourcePoint=G,r._lastTargetPoint=d}var b=0;t("edge.dash")&&(b=t("edge.dash.width")||S);var T="square"===U.cap?.71:.5;yh(u,s(b*T,S*T+e+E),U.join),P._68o(u)}},getRotation:function(g,T,Q){g=g||0;var p=this._78o;if(p){var v,w=p.angle,D=p.points,_=p.edgeTypeInfo;if(w!=W)return T?p.orienAngle+g:w+g;if(_&&_[hd])return _.getRotation?_.getRotation(this,g,T,Q):0;if(_&&_.points){var j=_.points;return v=j.size(),Lq[Q]?v&&0===v%2?Ad(j.get(v/2-1),j.get(v/2),T,g):g:Zm[Q]?Ad(j.get(0),j.get(1),T,g):Ad(j.get(v-2),j.get(v-1),T,g)}if(D)return v=D.size(),Lq[Q]?v&&0===v%2?Ad(D.get(v/2-1),D.get(v/2),T,g):g:Zm[Q]?Ad(p.sourcePoint,v?D.get(0):p.targetPoint,T,g):Ad(v?D.get(v-1):p.sourcePoint,p.targetPoint,T,g)}return g},getPosition:function(H,s,G,O,V){var B=this._78o;if(B){var U,F=B.type,D=B.points,y=B.edgeTypeInfo,L=B.sourcePoint,Y=B.targetPoint;if(!F)return B.looped?{x:L.x-B.radius+s,y:L.y+G}:(V&&L&&Y&&(L.x>Y.x||L.x===Y.x&&L.y>Y.y)&&(H=In[H],G=-G),U=jm(H,B.rect,O),U.x+=s,U.y+=G,U=B.mat.tf(U),U.x+=B.origin.x,U.y+=B.origin.y,U);if(y&&y[hd])return y.getPosition?y.getPosition(this,H,s,G,O,V):{x:(L.x+Y.x)/2,y:(L.y+Y.y)/2};if(D){var U,d=D.size();if(Lq[H]){if(d){var N=d%2;if(0===N)return qs(D.get(d/2-1),D.get(d/2),H,s,G,O,V);U=D.get((d-N)/2)}else U={x:(L.x+Y.x)/2,y:(L.y+Y.y)/2};return U=jm(H,{x:U.x,y:U.y,width:0,height:0},O),U.x+=s,U.y+=G,U}return Zm[H]?qs(L,d?D.get(0):Y,H,s,G,O,V):qs(d?D.get(d-1):L,Y,H,s,G,O,V)}if(y){var t=y.points,d=t.size();if(Lq[H]){var N=d%2;return 0===N?qs(t.get(d/2-1),t.get(d/2),H,s,G,O,V):(U=t.get((d-N)/2),U=jm(H,{x:U.x,y:U.y,width:0,height:0},O),U.x+=s,U.y+=G,U)}return Zm[H]?qs(t.get(0),t.get(1),H,s,G,O,V):qs(t.get(d-2),t.get(d-1),H,s,G,O,V)}}return hp},_42:function(z){this._78o&&Yj.superClass._42.call(this,z)},drawPath:function(E,O){E.beginPath();var W=O.type,V=O.points,R=O.segments,b=O.edgeTypeInfo;if(!W||V){var P=O.sourcePoint,s=P.x,n=P.y,p=O.targetPoint,$=p.x,u=p.y;if(W)if(R){var q=new If({x:s,y:n});q.addAll(V),q.add({x:$,y:u}),ql(E,q,R)}else E.moveTo(s,n),V.each(function(l){E.lineTo(l.x,l.y)}),E.lineTo($,u);else O.looped?E.arc(s,n,O.radius,0,C,!0):O.center?(E.moveTo(O.c1.x,O.c1.y),E.lineTo(s,n),E.lineTo($,u),E.lineTo(O.c2.x,O.c2.y)):(E.moveTo(s,n),E.lineTo($,u))}else b&&(b.points?ql(E,b.points,b.segments):b[hd]&&b[hd](E,b))},_80o:function(S){var u=this,Y=u.s,f=u._78o,V=f.width,o=f.selectWidth,E=f.borderWidth,j=f.color,w=S.lineJoin,P=S.lineCap,k=f.pattern;S.lineJoin=f.join,S.lineCap=f.cap,u.drawPath(qc(S,k),f);var h=Y("edge.width.absolute");if(h&&(S.save(),S.setTransform(1,0,0,1,0,0)),o&&(S.strokeStyle=f._97o,S.lineWidth=V+2*(E+o),S.stroke()),E&&(S.strokeStyle=f.borderColor,S.lineWidth=V+2*E,S.stroke()),S.strokeStyle=j,S.lineWidth=V,S.stroke(),f.is3d&&He(S,j,f._67o,V,u.gv._zoom,f._66o),h&&S.restore(),sd(S,k),Y("edge.dash")){k=Y("edge.dash.pattern");var N=qc(S,k,u._2Q("edge.dash.offset"));N!==S&&u.drawPath(N,f),u._1Q(S,"edge",Y("edge.dash.width")||V,k)}S.lineJoin=w,S.lineCap=P},_48O:function(){},_47O:function(){},_71o:function(x,j){var c=this,R=c._data;if(c._19Q=!0,!R.getEdgeGroup())return x?R.s("edge.gap"):0;var p,L=0,r=0,Q=0;if(R.getEdgeGroup().getSiblings().each(function(O){O.each(function(y){if(c.gv.isVisible(y)&&y.s(Pb)==j){var m=y.s("edge.gap");p?(r+=Q/2+m/2,Q=m):(p=y,Q=m),y===R&&(L=r)}})}),x)return r-L+Q;var $=L-r/2;return p&&R._40I!==p._40I&&(c._19Q=!1),$}});var rf=function(C,p){Ne(rf,this,[C,p])};Xr(rf,xk,{_3O:function(){var k,y,o=this,m=o.s,R=o._data,G=o.gv;if(o._88I=W,R.isExpanded()&&R.eachChild(function(q){var x=G.getBoundsForGroup(q);x&&(y||(y=[]),y.push(x),k=Uh(k,x))}),k){var E=G.getLabel(R),i=m("group.type");k=Hm(i,y,k),kp(k,R,"group.padding",1);var f=o._88I={type:i,rect:k,_64o:k};if(!i&&E!=W){var Y,N=o.labelInfo={label:E,color:m("group.title.color"),font:m("group.title.font"),align:m("group.title.align")},q=vj(N,E),n=q.width,s=q.height,X=m("group.title.align");n>k.width&&(k.width=n),N.rect={y:k.y-s,width:q.width,height:s},Y=X===Ep?k.x:X===bc?k.x+k.width-n:k.x+k.width/2-n/2,N.rect.x=Y,f.titleRect={x:k.x,y:k.y-s,width:k.width,height:s+1},f.rect={x:k.x,y:k.y-s,width:k.width,height:k.height+s}}o._40O(f,m("group.border.width")/2)}else rf.superClass._3O.call(o)},getPosition:function(G,l,L,H){var D=this._88I;if(D){var d=jm(G,D.rect,H);return d.x+=l,d.y+=L,d}return rf.superClass.getPosition.apply(this,arguments)},_24O:function(a,m){var H=this._88I;(!H||H.type||"label2"===a)&&rf.superClass._24O.call(this,a,m)},_80o:function(f){var x=this,h=x._88I;if(h){var t=x._data,y=x.s,c=x.gv,Z=h.type,l=h.rect,r=h._64o,n=h.titleRect,U=x.getBodyColor(),s=eo(y("group.image"),U),E=y("group.image.stretch"),D=x.getBodyColor("group.background"),H=eo(y("group.repeat.image"),U),K=y("group.gradient.pack"),Q=y("group.gradient"),v=y("group.gradient.color"),S=y("group.depth");if(Z){var z=y("group.border.pattern"),R=y("group.border.width"),k=f.lineJoin,I=f.lineCap;if(f.lineJoin=y("group.border.join"),f.lineCap=y("group.border.cap"),s){if(f.save(),wk(f,Z,l),f.clip(),Ym(f,s,E,l.x,l.y,l.width,l.height,t,c,U),f.restore(),R>0){var X=qc(f,z);wk(X,Z,l),f.lineWidth=R,f.strokeStyle=y("group.border.color"),f.stroke(),sd(f,z)}}else{var X=qc(f,z);D||H||K?(wk(f,Z,l),K?Mp(f,K):H?Ci(f,H,U,null,t,c):bn(f,D,Q,v,l),f.fill(),K&&f.restore(),f!==X&&wk(X,Z,l)):wk(X,Z,l),R>0&&(f.lineWidth=R,f.strokeStyle=y("group.border.color"),f.stroke()),sd(f,z),Z===Rl&&te(f,D,S,l)}f.lineJoin=k,f.lineCap=I}else if(s?Ym(f,s,E,r.x,r.y,r.width,r.height,t,c,x.getBodyColor()):(D||H)&&(H?Ci(f,H,U,null,t,c):bn(f,D,Q,v,r),wk(f,Rl,r),f.fill(),te(f,D,S,r)),n){var T=y("group.title.background");ic(f,n.x,n.y,n.width,n.height,T),te(f,T,S,n)}x._39O(f,h)}else rf.superClass._80o.call(x,f)}});var iq=function(s,f){Ne(iq,this,[s,f])};Xr(iq,xk,{_80o:function(M){this._39O(M,this._83o)}});var Xk=function($,W){Ne(Xk,this,[$,W])};Xr(Xk,xk,{_3O:function(){var k=this,M=k._data,T=k.s,Y=k.gv,f=M.getPoints(),$=Y.getBorderColor(M),u=$?T("border.width"):0,w=k.getSelectWidth(),g=T("shape.border.width"),h=M.getRect(),U=Y.getBodyColor(M),i=k._99o=f.isEmpty()?W:{rect:h,rotation:M.getRotation(),fillRule:T("shape.fill.rule"),scale:M.getScale(),position:M.p(),points:f,segments:M.getSegments(),bodyColor:U,borderColor:$,borderWidth:u,_94o:T("shape.border.3d"),_95o:T("shape.border.3d.color"),_96o:T("shape.border.3d.accuracy"),_97o:w?k.getSelectColor():W,selectWidth:w,_53o:T("shape.background"),_27Q:eo(T("shape.repeat.image"),U),shapeGradientPack:T("shape.gradient.pack"),_54o:g,_55o:T("shape.border.color"),shapeGradient:T("shape.gradient"),_59o:T("shape.gradient.color"),_60o:T("shape.border.pattern"),_61o:T("shape.border.cap"),_62o:T("shape.border.join")};if(i){var A=M.getScale(),o=s(1,s(t(A.x),t(A.y)));T("shape.dash")&&T("shape.dash.width")>g&&(g=T("shape.dash.width"));var z=g*("square"===i._61o?.71:.5)+u+w/k.gv._zoom/o;z&&(z*=o,h=ab(h),yh(h,z,i._62o)),k._68o(h);var P=T("clip.percentage");1>P&&(0>P&&(P=0),i.clipRect=Jk(M.getAnchorRect(),T("clip.direction"),P));var l=T("shape.fill.clip.percentage");1>l&&(0>l&&(l=0),i.shapeClipRect=Jk(M.getAnchorRect(),T("shape.fill.clip.direction"),l))}},getPosition:function(L,o,q,j){var u=this._99o;if(u){var e=jm(L,u.rect,j);return e.x+=o,e.y+=q,e}return hp},_42:function(u){this._99o&&Xk.superClass._42.call(this,u)},_80o:function(N){var a,C=this,W=C.s,s=C._99o,c=s.position,V=s.scale,J=s.rotation,$=s.bodyColor,F=s.borderWidth,R=s.selectWidth,t=s._53o,w=s._27Q,n=s.shapeGradientPack,S=s._54o,v=s.clipRect,x=s.shapeClipRect,Q=s.points,k=s.segments,B=C._data.isClosePath(),A=s.fillRule,L=t||w||n;N.save(),vc(N,c.x,c.y),We(N,J),li(N,V.x,V.y),W("shape.background2")&&(vc(N,-c.x,-c.y),ql(N,Q,k,B),bn(N,W("shape.background2"),W("shape.gradient2"),W("shape.gradient2.color"),s.rect),N.fill(),vc(N,c.x,c.y)),v&&(N.beginPath(),N.rect(v.x,v.y,v.width,v.height),N.clip()),L&&x&&(N.save(),N.beginPath(),N.rect(x.x,x.y,x.width,x.height),N.clip()),vc(N,-c.x,-c.y);var X=s._60o,G=qc(N,X),I=N.lineJoin,m=N.lineCap;N.lineJoin=s._62o,N.lineCap=s._61o,L?(ql(N,Q,k,B),n?Mp(N,n):w?Ci(N,w,$,null,C._data,C.gv):(a=$?$:t,bn(N,a,s.shapeGradient,s._59o,s.rect)),N.fill(A),x&&(N.restore(),vc(N,-c.x,-c.y)),n&&N.restore(),G!==N&&ql(G,Q,k,B)):ql(G,Q,k,B);var Y=W("shape.border.width.absolute");if(Y&&(N.save(),N.setTransform(1,0,0,1,0,0)),R&&(N.strokeStyle=s._97o,N.lineWidth=S+2*(F+R),N.stroke()),F&&(N.strokeStyle=s.borderColor,N.lineWidth=S+2*F,N.stroke()),S&&(a=s._55o,!t&&$&&(a=$),N.strokeStyle=a,N.lineWidth=S,N.stroke(),s._94o&&He(N,a,s._95o,S,C.gv._zoom,s._96o)),Y&&N.restore(),sd(N,X),W("shape.dash")){var Z=W("shape.dash.width")||S;if(Z>0){X=W("shape.dash.pattern");var G=qc(N,X,C._2Q("shape.dash.offset"));G!==N&&ql(G,Q,k,B),C._1Q(N,"shape",Z,X)}}N.lineJoin=I,N.lineCap=m,N.restore()},_48O:function(){},_47O:function(){}});var xl=function(D,B){Ne(xl,this,[D,B])};Xr(xl,Xk,{getRotation:function(x,K,b){x=x||0;var E=this._data.getPoints(),y=E.size();return y>1?Lq[b]?y&&0===y%2?Ad(E.get(y/2-1),E.get(y/2),K,x):x:Zm[b]?Ad(E.get(0),E.get(1),K,x):Ad(E.get(y-2),E.get(y-1),K,x):x},getPosition:function(r,Y,j,N,U){var M=this._data.getPoints(),V=M.size();if(V>1){if(Lq[r]){var k=V%2;if(0===k)return qs(M.get(V/2-1),M.get(V/2),r,Y,j,N,U);var l=M.get((V-k)/2),_={x:l.x,y:l.y,width:0,height:0};return l=jm(r,_,N),l.x+=Y,l.y+=j,l}return Zm[r]?qs(M.get(0),M.get(1),r,Y,j,N,U):qs(M.get(V-2),M.get(V-1),r,Y,j,N,U)}return hp}});var df=function($,J){Ne(df,this,[$,J])};Xr(df,xk,{_3O:function(){var E=this;df.superClass._3O.call(E);var U=E.s,B=E._83o;E._82o=B.img||B.shape?W:{background:E.getBodyColor("grid.background"),depth:U("grid.depth"),rect:B.rect,_88o:U("grid.cell.depth"),cellBorderColor:U("grid.cell.border.color"),_89o:U("grid.row.count"),_90o:U("grid.column.count"),block:U("grid.block"),_91o:U("grid.block.color"),_92o:U("grid.block.padding"),_93o:U("grid.block.width")}},_80o:function(F){var X=this,E=X._82o;if(!E)return df.superClass._80o.call(X,F),void 0;var H,B,p=X._data,n=E.background,u=E.rect,l=E.block,m=E._91o,a=E._92o,g=E._93o,j=E._88o,S=E.cellBorderColor,K=E._89o,Q=E._90o;if(n)if(ic(F,u.x,u.y,u.width,u.height,n),te(F,n,E.depth,u),j)for(H=0;K>H;H++)for(B=0;Q>B;B++)u=p.getCellRect(H,B),u&&te(F,n,j,u);else if(S){for(F.beginPath(),H=0;K>H;H++)for(B=0;Q>B;B++)u=p.getCellRect(H,B),u&&F.rect(u.x,u.y,u.width,u.height);F.strokeStyle=S,F.lineWidth=1,F.stroke()}if("h"===l)for(H=0;K>H;H++)u=Uh(p.getCellRect(H,0),p.getCellRect(H,Q-1)),lo(u,a),Gn(F,m,u.x,u.y,u.width,u.height,g);else if("v"===l)for(B=0;Q>B;B++)u=Uh(p.getCellRect(0,B),p.getCellRect(K-1,B)),lo(u,a),Gn(F,m,u.x,u.y,u.width,u.height,g);X._39O(F,X._83o)}});var hk=function(V,j){Ne(hk,this,[V,j])};Xr(hk,xk,{_checkEmptyRect:!1,_81o:function(){var b=this._data,y=hk.superClass._81o.call(this),Z=b.s("text");if(Z!=W){var n,J,N=b.s("text.font"),d=b.s("text.align"),C=b.s("text.vAlign"),S=$n(N,Z),h=S.width,Y=S.height,F=b.getAnchor(),v=b.getWidth(),$=b.getHeight();"left"===d?n=-v*F.x:"center"===d?n=-v*F.x+(v-h)/2:"right"===d&&(n=v*(1-F.x)-S.width),"top"===C?J=-$*F.y:"middle"===C?J=-$*F.y+($-Y)/2:"bottom"===C&&(J=$*(1-F.y)-S.height);var V,X=b.getMatrix();if(V=rd([X.tf(n,J),X.tf(n+h,J),X.tf(n+h,J+Y),X.tf(n,J+Y)]),y=Uh(y,V),y&&b.s("text.shadow")){var g=ab(y);g.x+=b.s("text.shadow.offset.x"),g.y+=b.s("text.shadow.offset.y"),lo(g,b.s("text.shadow.blur")),y=Uh(y,g)}}return y}});var eq=Df.Interactor=function(T){this.gv=this._graphView=T};Ud("Interactor",R,{ms_listener:1,getView:function(){return this.gv.getView()},setUp:function(){this.addListeners()},tearDown:function(){this.removeListeners(),this.clear()},clear:function(){},fi:function(L){this.gv.fi(L)},setCursor:function(H){Bs||this.gv.setCursor(H)},startDragging:function(e){var h=this;h._lastClientPoint=Ak(e),h._lastLogicalPoint=h.gv.lp(e),Qe(h,e)},clearDragging:function(){var a=this;a._lastClientPoint=a._lastLogicalPoint=a._logicalPoint=W},autoScroll:function(l){return this.gv.autoScroll(l,this._lastClientPoint)}});var aq=function(c){var q=this;q.gv=c,q._is2d=c instanceof Df.GraphView,q._is2d&&(q.filter=function(b){return c.isSelectable(b)&&c.isInteractive(b)}),c.getView(),["mousedown","mousemove","touchstart","touchmove"].forEach(function(A){q.addListener(A)}),n.addEventListener(nq,function(U){ki(U)&&q.handleWindowMove(U)},!1),n.addEventListener(Rc,function(s){ki(s)&&q.handleWindowUp(s)},!1),n.addEventListener(Pp,function(A){ki(A)&&q.handleWindowMove(A)},!1),n.addEventListener(wi,function(C){ki(C)&&q.handleWindowUp(C)},!1),q.initImageResource()};Xr(aq,eq,{enableVR:function(W){var L=this;if(!!L._vrEnable!==W)if(L._vrEnable=W,W)L.gv.vr.mp(L.onVRControllerChange,L);else if(L.gv.vr.ump(L.onVRControllerChange,L),L._vrRayPolyline){var $=L.gv.dm();$.remove(L._vrRayPolyline),$.remove(L._vrRayHitPoint),L._vrRayPolyline=N,L._vrRayHitPoint=N}},onVRControllerChange:function(A){var j=this,X=A.property,n=A.newValue,$=j.gv.vr.getController(n.id),G=$.getRay();G&&("gamepad.button.trigger"===X?"down"===n._62O?j.handle_mousedown(G):j.handleWindowUp(G):"gamepad.pose"===X&&(j.handle_mousemove(G),j.handleWindowMove(G)))},drawVRRay:function(_,F,V){var C,L=this,U=L.gv,S=L._vrRayPolyline,i=!1;if(S)C=L._vrRayHitPoint;else{var b=U.dm();L._vrRayPolyline=S=new c.Polyline,L._vrRayHitPoint=C=new c.Node,C.s({shape3d:"billboard","shape3d.transparent":!0,"shape3d.texture.scale":10,"shape3d.image":"coreInteractorRayHitImage"}),C.setAnchor3d(.5,.5,.499);var P=.08/U.vr.measureOflength;C.s3(P,P,P),b.add(S),b.add(C),i=!0}if(F){var K=V.world,j=V.worldNormal,u=K.x,N=K.y,d=K.z;S.s("shape.border.color","red"),S.setPoints([{x:_.origin.x,y:_.origin.z,e:_.origin.y},{x:u,y:d,e:N}]),C.s("3d.visible",!0),C.p3(u,N,d),C.lookAtDirection([j.x,j.y,j.z],"front")}else{S.s("shape.border.color","blue");var a=new c.Math.Vector3;a.copy(_.direction).setLength(1e3/L.gv.vr.measureOflength).add(_.origin),S.setPoints([{x:_.origin.x,y:_.origin.z,e:_.origin.y},{x:a.x,y:a.z,e:a.y}]),C.s("3d.visible",!1)}U.fi({kind:"vrRayIntersect",ray:_,data:F,intersect:V,polyline:S,hitNode:C,begin:i})},addListener:function(E){var y=this;y.gv.getView().addEventListener(E,function(S){M.preventDefault(S),ki(S)&&!y.disabled&&y["handle_"+E](S)},!1)},handle_touchstart:function(V){this.handle_mousedown(V)},handle_touchmove:function(q){this.handle("onMove",q)},handleWindowMove:function(Y){this.downInfo&&(this.isDragging?this.handleDownInfo("onDrag",Y):(this.handleDownInfo("onBeginDrag",Y),this.isDragging=!0))},handleWindowUp:function(Z){if(this.isDragging&&(this.handleDownInfo("onEndDrag",Z),this.isDragging=!1),this.downInfo){var A=this.handle("onUp",Z);A&&A.data===this.downInfo.data?this.handleMissingUp(Z):this.handleDownInfo("onUp",Z),this.downInfo=W}},handle_mousedown:function($){this.isDragging&&(this.handleDownInfo("onEndDrag",$),this.isDragging=!1),this.downInfo=this.handle("onDown",$)},handle_mousemove:function(k){var Q=this,S=Q.gv;Q._hoverTimer&&(K(Q._hoverTimer),delete Q._hoverTimer);var U,j,s,$=Q.handle("onMove",k),Z=this.currentInfo?this.currentInfo.data:W,B=this.currentInfo?this.currentInfo.hits:W;
- if($&&(j=$.data,s=$.hits,Q._hoverTimer=G(function(){K(Q._hoverTimer),delete Q._hoverTimer,Q.handle("onHover",k,$)},S.getHoverDelay()||M.hoverDelay)),j!==Z){if(j&&j.s("onEnter")&&j.s("onEnter")(k,j,S),Z&&Z.s("onLeave")&&Z.s("onLeave")(k,Z,S),B)for(U in B)B[U].target.onLeave&&this.handleLeave(k,U);if(s)for(U in s)s[U].target.onEnter&&s[U].target.onEnter(k,j,S,s[U].point,s[U].width,s[U].height)}else{if(B)for(U in B)s&&s[U]||B[U].target.onLeave&&this.handleLeave(k,U);if(s)for(U in s)B&&B[U]||s[U].target.onEnter&&s[U].target.onEnter(k,j,S,s[U].point,s[U].width,s[U].height)}this.currentInfo=$},handle:function(V,d,M){var A,y=this,k=y.gv;if(y._is2d){if(M=M||k.getDataInfoAt(d,this.filter),!M)return;if(A=M.ui.interactiveInfo){var p,s=M.data;if(s.s(V)&&s.s(V)(d,s,k),"body"===M.part&&A.bodyInfo)p="body",M.hits=this.handleImage(p,k.getImage(s),V,d,s,M.point,A.bodyInfo);else if("icons"===M.part&&A._38o){var z=A._38o[M.name];z&&z[M.index]&&(p="icons|"+M.name+"|"+M.index,M.hits=this.handleImage(p,M.icon,V,d,s,M.point,z[M.index]))}}return M}var s,j,L,P,F=1/0;if(!M)if(d&&d instanceof c.Math.Ray){if(k.dm().each(function(W){if(!W.isController&&W!==y._vrRayPolyline&&W!==y._vrRayHitPoint){var q=k.getData3dUI(W);A=q.interactiveInfo,A&&(L=k.intersectObject(d,W),L&&(P=d.origin.distanceToSquared(L.world),F>P&&(s=W,j=L,F=P)))}}),y.drawVRRay(d,s,j),!s)return;M={data:s,part:j.part,ui:l}}else{if(M=k.getDataInfoAt(d),!M)return;M&&(M={data:M.data,part:M.part})}if(!j){s=M.data;var l=k.getData3dUI(s);if(M.ui=l,A=l.interactiveInfo,!A)return M;if(j=k.intersectObject(d,s),!j)return}s.s(V)&&s.s(V)(d,s,k);var x,R=j.part;return"body"!==R&&(x=s.s(R+".image")||s.s("shape3d."+R+".image")),x||(x=s.s("all.image")||s.s("shape3d.image")),(A=A[x])?(M.part="body",M.interactiveInfo=A,M.point=j.uv.multiply({x:A.bodyInfo.rect.width,y:A.bodyInfo.rect.height}),M.image=x,M.hits=this.handleImage("body",x,V,d,s,M.point,A.bodyInfo),M):void 0},_handleLeaveOrMissing:function(P,S,h){var X="leave"===P?this.currentInfo:this.downInfo;if(X){var E=X.interactiveInfo||X.ui.interactiveInfo;if(E){var y,D,e=X.data;if(this._is2d){if(D=this.gv.lp(S),"body"===X.part&&E.bodyInfo)y="body","leave"===P?this.handleLeaveImage(h,y,this.gv.getImage(e),S,e,D,E.bodyInfo):this.handleMissingUpImage(y,this.gv.getImage(e),S,e,D,E.bodyInfo);else if("icons"===X.part&&E._38o){var J=E._38o[X.name];J&&J[X.index]&&(y="icons|"+X.name+"|"+X.index,"leave"===P?this.handleLeaveImage(h,y,X.icon,S,e,D,J[X.index]):this.handleMissingUpImage(y,X.icon,S,e,D,J[X.index]))}}else{var M=this.gv.intersectObject(S,e);D=M?M.uv.multiply({x:E.bodyInfo.rect.width,y:E.bodyInfo.rect.height}):{x:1/0,y:1/0},"leave"===P?this.handleLeaveImage(h,"body",X.image,S,e,D,E.bodyInfo):this.handleMissingUpImage("body",X.image,S,e,D,E.bodyInfo)}}}},handleDownInfo:function(e,K){if(this.downInfo){var C=this.downInfo,D=C.interactiveInfo||C.ui.interactiveInfo;if(D){var J,G=C.data;if(G.s(e)&&G.s(e)(K,G,this.gv),this._is2d){var d=this.gv.lp(K);if("body"===C.part&&D.bodyInfo)J="body",this.handleDownInfoImage(J,this.gv.getImage(G),e,K,G,d,D.bodyInfo);else if("icons"===C.part&&D._38o){var c=D._38o[C.name];c&&c[C.index]&&(J="icons|"+C.name+"|"+C.index,this.handleDownInfoImage(J,C.icon,e,K,G,d,c[C.index]))}}else{var o=this.gv.intersectObject(K,G);if(!o)return;d=o.uv.multiply({x:D.bodyInfo.rect.width,y:D.bodyInfo.rect.height}),this.handleDownInfoImage("body",C.image,e,K,G,d,D.bodyInfo)}}}},handleImage:function(j,X,o,U,l,W,K){var M={};if(X&&(X=eo(X))){var E=this.gv,d=K.rect,I=this.convertPoint(W,K);I.inRect&&(X[o]&&X[o](U,l,E,I,d.width,d.height),M[j+"|image"]={target:X,point:I,width:d.width,height:d.height});for(var m=K.compInfos,J=X,f=m.length-1;f>=0;f--){var u=m[f],v=u.comp;I=this.convertPoint(W,u,J,v,E,l),I.inRect&&(d=u.rect,v[o]&&v[o](U,l,E,I,d.width,d.height),(X=d.image)&&X[o]&&X[o](U,l,E,I,d.width,d.height),M[j+"|"+f]={target:v,point:I,width:d.width,height:d.height},X&&(M[j+"|"+f+"|image"]={target:X,point:I,width:d.width,height:d.height}))}}return M},handleLeave:function(C,_){return this._handleLeaveOrMissing("leave",C,_)},handleMissingUp:function(P){return this._handleLeaveOrMissing("missing",P)},handleLeaveImage:function(u,F,K,a,D,l,S){if(K&&(K=eo(K))){var o=this.gv,N=S.rect,t=this.convertPoint(l,S);u===F+"|image"&&K.onLeave&&K.onLeave(a,D,o,t,N.width,N.height);for(var _=S.compInfos,i=K,O=_.length-1;O>=0;O--){var $=_[O],m=$.comp;t=this.convertPoint(l,$,i,m,o,D),N=$.rect,m.onLeave&&u===F+"|"+O&&m.onLeave(a,D,o,t,N.width,N.height),(K=N.image)&&K.onLeave&&u===F+"|"+O+"|image"&&K.onLeave(a,D,o,t,N.width,N.height)}}},handleMissingUpImage:function(n,T,X,q,R,G){var e="onUp",b=this.downInfo.hits;if(b&&T&&(T=eo(T))){var U=G.rect,f=this.convertPoint(R,G);!f.inRect&&b[n+"|image"]&&T[e]&&T[e](X,q,this.gv,f,U.width,U.height);for(var L=G.compInfos,k=T,p=L.length-1;p>=0;p--){var B=L[p],F=B.comp;f=this.convertPoint(R,B,k,F,this.gv,q),f.inRect||(U=B.rect,F[e]&&b[n+"|"+p]&&F[e](X,q,this.gv,f,U.width,U.height),(T=U.image)&&T[e]&&b[n+"|"+p+"|image"]&&T[e](X,q,this.gv,f,U.width,U.height))}}},handleDownInfoImage:function(X,a,o,d,J,R,W){var B=this.downInfo.hits;if(B&&a&&(a=eo(a))){var y=this.gv,S=W.rect,T=this.convertPoint(R,W);B[X+"|image"]&&a[o]&&a[o](d,J,y,T,S.width,S.height);for(var k=W.compInfos,c=a,l=k.length-1;l>=0;l--){var $=k[l],j=$.comp;T=this.convertPoint(R,$,c,j,y,J),S=$.rect,j[o]&&B[X+"|"+l]&&j[o](d,J,y,T,S.width,S.height),(a=S.image)&&a[o]&&B[X+"|"+l+"|image"]&&a[o](d,J,y,T,S.width,S.height)}}},initImageResource:function(){M.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]}]})},convertPoint:function(Z,b,g,C,$,h){var J=b.rect,B=b.matrix.applyInverse(Z).sub(J),j=B.x>=0&&B.y>=0&&B.x<=J.width&&B.y<=J.height;if(!j)return B;if(C&&ag(C.pixelPerfect,h,$)){var J,L=1;this._is2d?(L=$.getZoom(),J=Te(Z.x,Z.y,N,L)):J=Te(Z.x,Z.y);var n=!1,i=J.x,x=J.y,V=J.width,s=J.height,R=M.hitMaxArea,z=V*s*L*L;if(z>R){var u=Math.sqrt(R/z);L*=u}V*=L,s*=L,2>V&&(V=2),2>s&&(s=2),i*=L,x*=L;var T=ap(V,s),P=new lp(0,-i,-x,L,L);P.append(b.matrix),$._drawForChecking=!0,C.transform=P;var X=g.comps;g.comps=[C],gc(T,g,0,0,V,s,h,self),g.comps=X,delete C.transform,$._drawForChecking=!1;try{for(var o=0,w=T.getImageData(0,0,V,s).data;o<w.length;o+=4)if(0!==w[o+3]){n=!0;break}T.restore()}catch(l){Yp=W,n=!1}B.inRect=n}else B.inRect=!0;return B}});var Fc=Df.DefaultInteractor=function(y){Ne(Fc,this,[y])};Ud("DefaultInteractor",eq,{handle_mousedown:function(E){Zp(E);var J=this,Q=J.gv,y=Q.getDataAt(E);!Q.setFocus(E)||Q._editing||Q._scrolling||(jp(E)?Q.handleDoubleClick(E,y):Q.handleClick(E,y),!Nd()&&y&&(Q.isMovable(y)||Q.isInteractive(y))||!Q.isPannable()||!ki(E)||ji(E)||(J._tx=Q.tx(),J._ty=Q.ty(),J.startDragging(E)))},handleWindowMouseUp:function(n){var M=this,I=M.gv;I._panning&&(delete I._panning,I.onPanEnded(),M.fi({kind:"endPan",event:n})),delete M._tx,delete M._ty,M.clearDragging()},handle_mousemove:function(k){var t=this,U=t.gv;t._hoverTimer&&(K(t._hoverTimer),delete t._hoverTimer),t._hoverTimer=G(function(){t.fi({kind:"hover",event:k}),K(t._hoverTimer),delete t._hoverTimer},U.getHoverDelay()||M.hoverDelay)},handle_touchmove:function(T){this.handle_mousemove(T)},handleWindowMouseMove:function(U){var n=this,N=n.gv,W=n._lastClientPoint;n.fi({kind:N._panning?"betweenPan":"beginPan",event:U}),N._panning=1,N.setTranslate(n._tx+U.clientX-W.x,n._ty+U.clientY-W.y)},handle_mousewheel:function(u){this.gv.handleScroll(u,u.wheelDelta)},handle_DOMMouseScroll:function(O){2===O.axis&&this.gv.handleScroll(O,-O.detail)},handle_keydown:function(p){this.gv.handleKeyDown(p)}});var Ar=Df.SelectInteractor=function(H){Ne(Ar,this,[H])};Ud("SelectInteractor",eq,{_42:function(){var C=this,y=C.gv,d=y.getZoom(),e=C.mark,X=C.div;X||(X=C.div=ps(),Vd(C.getView(),X));var f={};f.x=e.x*d+y.tx(),f.y=e.y*d+y.ty(),f.width=e.width*d,f.height=e.height*d,vr(X,f),this.intersects()?(X.style.border="",X.style.background=y.getRectSelectBackground()):(X.style.background="",X.style.border="1px solid "+y.getRectSelectBorderColor())},handle_mousedown:function(h){var L=this,w=L.gv;if(L._57I=W,!(w._editing||w._scrolling||Nd())){var z=w.getDataAt(h),A=w.sm();if(z)if(ji(h))A.co(z)?A.rs(z):A.as(z);else if(A.co(z)){if(jp(h)&&z instanceof Fh&&z.isClickThroughEnabled()){var g=w.getDataAt(h,function(Q){w._clickThroughChecking=!0;var Z=Q.getParent()===z&&w.isSelectable(Q);return delete w._clickThroughChecking,Z});g&&(h.clickThrough=!0,A.ss(g))}}else A.ss(z);else ji(h)||!w.isPannable()?ki(h)&&(ji(h)||A.cs(),w.isRectSelectable()&&(L.startDragging(h),w._77O=1)):ki(h)&&(L._57I=Ak(h))}},handle_mouseup:function(P){var L=this,c=L._57I;c&&(Nc(c,Ak(P))<=1&&L.gv.sm().cs(),L._57I=W)},handleWindowMouseUp:function(G){this.clear(G)},handleWindowMouseMove:function(h){var e=this,L=e.gv;e._logicalPoint=L.lp(h),e.mark?(e.fi({kind:"betweenRectSelect",event:h}),L.isPannable()&&e.autoScroll(h),e.redraw()):e.fi({kind:"beginRectSelect",event:h}),e.mark=rd(e._lastLogicalPoint,e._logicalPoint),e.redraw()},intersects:function(){var I=this,M=I._lastLogicalPoint,r=I._logicalPoint;return M.x>r.x||M.y>r.y},clear:function(I){var t=this,$=t.gv,P=t.mark;if(t._57I=W,t._lastLogicalPoint){if(P){if(0!==P.width&&0!==P.height){var H=$.getDatasInRect(P,t.intersects());if(!H.isEmpty()){var l=$.sm(),N=l.toSelection();H.each(function(_){l.co(_)?N.remove(_):N.add(_)}),l.ss(N)}}Lb(t.div),delete t.div,delete t.mark,t.redraw(),t.fi({kind:"endRectSelect",event:I}),$.onRectSelectEnded()}t.clearDragging(),delete $._77O}},redraw:function(){var n=this;n._draw||(n._draw=1,G(function(){n.mark&&n._42(),delete n._draw},16))}});var Jn=Df.MoveInteractor=function(Q){Ne(Jn,this,[Q])};Ud("MoveInteractor",eq,{handle_mousedown:function(v){var c=this,T=c.gv;if(ki(v)&&!T._editing&&!T._scrolling&&!Nd()){var H=T.getSelectedDataAt(v);!H||T.isInteractive(H)&&!T.isMovable(H)?T._focusData=W:(c._data=H,T.handleMouseDown&&T.handleMouseDown(v,H),c.startDragging(v),T.isMovable(H)&&(T._moving=1))}},handleWindowMouseUp:function(v){var T=this,z=T.gv;z.handleMouseUp&&z.handleMouseUp(v,T._data),T.clear(v)},handleWindowMouseMove:function(a){var n=this,t=n._data,_=n.gv;if((!_._93O||!_._93O(a,t))&&_._moving){n._logicalPoint||n.fi({kind:"prepareMove",event:a});var m=n._logicalPoint?"betweenMove":"beginMove",w={kind:m,event:a},L=n._logicalPoint=_.lp(a);"beginMove"!==m||n._alreadyBeginTransaction||(n._alreadyBeginTransaction=!0,_.getDataModel().beginTransaction());var K=n._calcShift(m,a),D=K.x,W=K.y,o=n.gv.getMoveMode(a,t);o&&("x"===o?W=0:"y"===o?D=0:"xy"!==o&&(D=W=0)),_.moveSelection(D,W),n._lastLogicalPoint=L,n.autoScroll(a),n.fi(w)}},_calcShift:function(){var l=this,f=l._logicalPoint,O=l._lastLogicalPoint,U=f.x-O.x,y=f.y-O.y;return{x:U,y:y}},clear:function(p){var J=this,$=J.gv;J._lastLogicalPoint&&(J._lastLogicalPoint=J._data=$._moving=W,J._logicalPoint&&(J.fi({kind:"endMove",event:p}),$.onMoveEnded()),J.clearDragging()),J._alreadyBeginTransaction&&(J._alreadyBeginTransaction=!1,$.getDataModel().endTransaction())}});var rb=Df.ScrollBarInteractor=function(B){Ne(rb,this,[B])};Ud("ScrollBarInteractor",eq,{_41o:function(){return this.gv.getViewRect().height<this.gv.getScrollRect().height},_40o:function(){return this.gv.getViewRect().width<this.gv.getScrollRect().width},isV:function(j){var E=this.gv.getViewRect();return this._41o()&&(E.x+E.width-this.gv.lp(j).x)*this.gv.getZoom()<ai},isH:function(o){var f=this.gv.getViewRect();return this._40o()&&(f.y+f.height-this.gv.lp(o).y)*this.gv.getZoom()<ai},handle_mousemove:function(C){this.handle_touchmove(C)},handle_touchmove:function(X){if(!Ug&&ki(X)&&this.gv.isScrollBarVisible()){var N=this,K=N.isV(X),$=N.isH(X);(K||$)&&N.gv.showScrollBar(),N.gv._scrolling=K||$}},handleWindowMouseUp:function(N){this.handleWindowTouchEnd(N)},handleWindowTouchEnd:function(n){this._state=this._cp=this._tx=this._ty=this.gv._scrolling=W,this.fi({kind:"endScroll",event:n})},handle_mousedown:function(r){this.handle_touchstart(r)},handle_touchstart:function(j){var _=this;if(_.gv.setFocus(j),Zp(j),_.handle_touchmove(j),!(cg(j)>1)&&_.gv._scrolling&&_.gv.isScrollBarVisible()){_._cp=Ak(j),_._tx=_.gv.tx(),_._ty=_.gv.ty();var B=_.isV(j);_._state=B?"vScroll":"hScroll",Qe(_,j),_.fi({kind:"beginScroll",event:j})}},handleWindowMouseMove:function(z){this.handleWindowTouchMove(z)},handleWindowTouchMove:function(U){var A=Ak(U),y=this.gv.getViewRect(),H=this.gv.getScrollRect();"vScroll"===this._state?this.gv.ty(this._ty+(this._cp.y-A.y)*H.height/y.height):"hScroll"===this._state&&this.gv.tx(this._tx+(this._cp.x-A.x)*H.width/y.width),this.fi({kind:"betweenScroll",event:U})}});var gj=Df.TouchInteractor=function(t,M){M=M||{},M.selectable===N&&(M.selectable=!0),M.movable===N&&(M.movable=!0),M.pannable===N&&(M.pannable=!0),M.pinchable===N&&(M.pinchable=!0),M.editable===N&&(M.editable=!0),this.params=M,Ne(gj,this,[t])};Ud("TouchInteractor",eq,{ms_edit:1,setUp:function(){var X=this;gj.superClass.setUp.call(X),Bs&&X.params.editable&&X.gv.setEditInteractor(X)},tearDown:function(){var v=this;gj.superClass.tearDown.call(v),Bs&&v.params.editable&&v.gv.setEditInteractor(W)},clear:function(m){var M=this,T=M.gv;T._moving&&(M.fi({kind:"endMove",event:m}),delete T._moving,T.onMoveEnded(),T.dm().endTransaction()),T._panning&&(M.fi({kind:"endPan",event:m}),delete T._panning,T.onPanEnded()),T._pinching&&(M.fi({kind:"endPinch",event:m}),delete T._pinching,T.onPinchEnded()),T._editing&&(M._46O(m),M._77I=M._node=M._edge=M._shape=M._rect=M._89I=M._index=T._editing=W),M._moving=M._panning=M._pinching=M._editing=M._57I=M._data=M._beginHistory=W,M.clearDragging()},handle_touchstart:function(r){var t=this;if(!t.gv._editing){Zp(r),t._57I=W;var _=t.params,B=t.gv,A=B.sm(),x=B.getDataAt(r),j=cg(r);if(1===j){if(jp(r))return B.handleDoubleClick(r,x),void 0;B.handleClick(r,x),x&&(B.handleMouseDown&&B.handleMouseDown(r,x),t._data=x),_.selectable||(x=W),x?(A.co(x)||A.ss(x),_.editable&&B.isEditable(x)&&t._79I(r,x,!0)?(t._editing=1,t.startDragging(r)):_.movable&&B.isMovable(x)&&(t._moving=1,t.startDragging(r))):(t._57I=Ak(r),_.pannable&&B.isPannable()&&(t._panning=1,t.startDragging(r),t._translate={x:B.tx(),y:B.ty()}))}else if(_.pinchable&&2===j){t._pinching=1,t.startDragging(r);var Z=B.getView(),p=B.getZoom(),Y=Z.getBoundingClientRect(),i=r.touches[0],X=r.touches[1],$={x:(i.clientX+X.clientX)/2-Y.left,y:(i.clientY+X.clientY)/2-Y.top};$.x-=B.tx(),$.y-=B.ty(),$.x/=p,$.y/=p,t._p=$,t._d=Ql(r)}}},handle_touchend:function(v){var C=this,w=C.gv,S=C._57I,x=C._data;S&&(Nc(S,Ak(v))<=1&&w.sm().cs(),C._57I=W),x&&w.handleMouseUp&&w.handleMouseUp(v,x)},handleWindowTouchEnd:function(T){this.clear(T)},handleWindowTouchMove:function(V){var h=this,e=h.gv,o=cg(V);if(1===o){if(h._editing&&(h._beginHistory||(h._beginHistory=1,e.dm().beginTransaction()),e._editing=1,h._78I(V)),h._moving)h._beginHistory||(h._beginHistory=1,e.dm().beginTransaction()),h.handleMove(V);else if(h._panning){var c=Ak(V);e.setTranslate(h._translate.x+c.x-h._lastClientPoint.x,h._translate.y+c.y-h._lastClientPoint.y),h.fi({kind:e._panning?"betweenPan":"beginPan",event:V}),e._panning=1}}else if(2===o&&h._pinching){var g=Ql(V);e.handlePinch(h._p,g,h._d),h._d=g,h.fi({kind:e._pinching?"betweenPinch":"beginPinch",event:V}),e._pinching=1}},handleMove:function(W){var c=this,Q=c.gv,X=Q.lp(W);Q._93O&&Q._93O(W,c._data)||(Q.moveSelection(X.x-c._lastLogicalPoint.x,X.y-c._lastLogicalPoint.y),c._lastLogicalPoint=X,c.autoScroll(W),c.fi({kind:Q._moving?"betweenMove":"beginMove",event:W}),Q._moving=1)}});var c=n.ht,Fj=c.graph._editor={Math:c.Math,Guide:{}};Fj.getStyle=function(F){var w,O=Fj.StyleMap;return O&&(w=O[F],w!==N)?w:Fj.DefaultStyleMap[F]},Fj.setStyle=function(M,x){var _=Fj.StyleMap;_||(_=Fj.StyleMap={}),_[M]=x},Fj.inEdit=function(c){return c._inXEdit===!0},Fj.startEdit=function(u){u._inXEdit=!0,Fj.Inject.doInject(u)},Fj._46O=function(L){L._inXEdit=!1,Fj.Inject.undoInject(L)},Fj.toScreenPosition=function(B,H){var p=B.tx(),$=B.ty(),Z=B._zoom;return new Fj.Math.Vector2(H.x*Z+p,H.y*Z+$)},Fj.checkHit=function(l,r,y){return l.distanceTo(r)<y?!0:!1},Fj.toWorldPosition=function(J,Q){var T=J.tx(),q=J.ty(),n=J._zoom;return{x:(Q.x-T)/n,y:(Q.y-q)/n}},Fj.setAntialias=function(h,T){for(var U,L=["imageSmoothingEnabled","webkitImageSmoothingEnabled","mozImageSmoothingEnabled","oImageSmoothingEnabled","msImageSmoothingEnabled"],l=0,e=L.length;e>l&&(U=L[l],!(U in h));l++);h[U],h[U]=T},Fj.getTargetCornersOnScreen=function(J,F){if(!F)return null;var Y,M=[];if(Ge(F,J)){var R=Lg(J,F);Y=[{x:R.x,y:R.y},{x:R.x+R.width,y:R.y},{x:R.x+R.width,y:R.y+R.height},{x:R.x,y:R.y+R.height}]}else{if(!F.getCorners)return null;Y=F.getCorners()}return Y.forEach(function(I){var K=Fj.toScreenPosition(J,I);M.push(K.x,K.y)}),M},Fj.log=function(){};var pf=Fj.Inject={_modules:[]};pf.registAsModule=function(c,M){var B={},K={};for(var s in c){var P=M.prototype[s];B[s]=P}c.getBackup=function($){return B[$]},c.getBackups=function(){return B},K.doInject=function(){for(var T in c)"getBackup"!==T&&(M.prototype[T]=c[T])},K.undoInject=function(){for(var A in c)"getBackup"!==A&&(M.prototype[A]=B[A])},pf._modules.push(K)},pf.doInject=function(a){for(var q,S=pf._modules,A=0,v=S.length;v>A;A++)q=S[A],q.doInject(a)},pf.undoInject=function(S){for(var x,i=pf._modules,P=0,w=i.length;w>P;P++)x=i[P],x.undoInject(S)};var eq=c.graph.EditInteractor=function(z){var H=this,g=m.createElement("canvas");g.className="editCanvas",g.style.position="absolute",H._styleMap={},H._canvas=g,H._context=g.getContext("2d"),eq.superClass.constructor.call(H,z),Fj.setAntialias(H._context,!1),H._subModules=[new Fj.Anchor(H),new Fj.Rect(H),new Fj.Curve(H),new Fj.MoveHelper(H)],H._gridGuide=new Fj.Guide.Grid(H),H._rectGuide=new Fj.Guide.Rect(H)},sm=eq;c.Default.def(eq,c.graph.Interactor,{ms_edit:1,ms_fire:1}),R.defineProperties(eq.prototype,{editDetail:{get:function(){var T=!!this._editDetail;return T},set:function(U){var D=this,g=D._editDetail;g!==U&&(D._editDetail=U,D.gv._editing=U,D.fp("editDetail",g,U),D.fp("pointsEditingMode",g,U),D.fi({kind:U?"beginEditPoints":"endEditPoints"}))}},gvEditing:{get:function(){return this.gv._editing},set:function(T){(!this._editDetail||T)&&(this.gv._editing=T,T||(this.editDetail=!1))}},editing:{get:function(){return this._editing},set:function(c){this._editing=c,this.gvEditing=c}},pointsEditingMode:{get:function(){return this.editDetail},set:function(F){var y=this;y.editDetail!==F&&(F?y._tryEnterEditDetailMode():y._tryQuitEditDetailMode())}},gridEnabled:{get:function(){var L=this._gridEnabled;if(!L)return!1;var I=this.gv;return I?!0:!0},set:function(M){M!==this._gridEnabled&&(this._gridEnabled=M,this._42())}},alignmentGuideEnabled:{get:function(){return this._agEnabled},set:function(v){v!==this._agEnabled&&(this._agEnabled=v,this._42())}},gridGuide:{get:function(){return this._gridGuide}},rectGuide:{get:function(){return this._rectGuide}}}),eq.prototype.getSubModule=function(R){var c,D,x,k=this._subModules;for(D=0,x=k.length;x>D;D++)if(c=k[D],c.catalog===R)return c},eq.prototype.invokeSubModule=function(f,g){var o=this,Y=o._subModules;if(Y)for(var H,X,m,A=Array.prototype.slice.call(arguments,2),L=0,p=Y.length;p>L;L++)if(H=Y[L],X=H[f],X&&(m=X.apply(H,A),m!=N&&g))return H},eq.prototype.invokeSubModuleInverse=function(O,E){var L=this,l=L._subModules;if(l)for(var b,s,e,S=Array.prototype.slice.call(arguments,2),X=l.length-1;X>=0;X--)if(b=l[X],s=b[O],s&&(e=s.apply(b,S),e!=N&&E))return b},eq.prototype.setUp=function(){Fj.log("setUp");var R=this,U=R.gv,g=U.getView(),K=R._canvas;eq.superClass.setUp.call(R),U.setEditInteractor(R),U._79O?g.insertBefore(K,U._79O):g.appendChild(K),Fj.startEdit(U),R.invokeSubModule("setUp"),U.dm().mm(R._onDataModelChanged,R),U.dm().md(R._onDataPropertyChanged,R)},eq.prototype.tearDown=function(){Fj.log("tearDown");var M=this,i=M.gv,L=i.getView();M._resetCustomCursorStyle(),eq.superClass.tearDown.call(M),i.dm().umm(M._onDataModelChanged,M),i.dm().umd(M._onDataPropertyChanged,M),i.setEditInteractor(null),L.removeChild(M._canvas),M._drawTimer&&(K(M._drawTimer),M._drawTimer=null),Fj._46O(i),M.invokeSubModule("tearDown")},eq.prototype._onDataModelChanged=function(g){var K=this;("clear"===g.kind||"remove"===g.kind&&K.editDetail&&g.data===K.getSubModule("Curve").target)&&(K.editDetail=!1,K._42())},eq.prototype._onDataPropertyChanged=function(Z){var H=this;if(H.editDetail){var r=H.getSubModule("Curve"),b=Z.data;b===r.target&&(b._writing||r._handleDataChanged())}},eq.prototype.clear=function(){Fj.log("clear")},eq.prototype.redraw=function(){this._42()},eq.prototype._42=function(){var Q=this;Q._drawTimer||(Q._drawTimer=G(function(){Q._drawTimer=null,Q.drawImpl()},0))},eq.prototype.drawImpl=function(){var H;for(H in{_42:!0})break;return function(){var d=this,j=d._canvas,u=d.gv,y=u.getWidth(),N=u.getHeight(),b=d._context,O=c.Default.getInternal();(j.width!==y||j.height!==N)&&O.setCanvas(j,y,N),b.clearRect(0,0,j.width,j.height);var G=d._getValidSelection();b.save();var B=c.Default.devicePixelRatio;b.scale(B,B),d._gridGuide._42(),d.invokeSubModuleInverse(H,!1,b,u,G),d._rectGuide._42(),b.restore()}}(),eq.prototype._getValidSelection=function(){var L=this,c=L.gv,$=c.sm().getSelection(),P=[];return $.each(function(I){c.isVisible(I)&&c.isEditable(I)&&P.push(I)}),P},eq.prototype.handle_touchmove=function(c){return this.handle_mousemove(c)},eq.prototype.handle_mousemove=function(g){if(!c.Default.isDragging()){var T=this;(T.editDetail||!Nd())&&(T.gvEditing=!1,T._checkEdit(g)&&(T.gvEditing=!0))}},eq.prototype.handle_touchstart=function(K){return this.handle_mousedown(K)},eq.prototype.handle_mousedown=function(X){Zp(X);var a=this;if(a.editDetail||!Nd()){if(jp(X)&&!X.clickThrough){if(a.editDetail){if(a._tryQuitEditDetailMode(X))return}else if(a._tryEnterEditDetailMode())return;a.gv.dm().beginTransaction();var T=a.invokeSubModule("handleDoubleClick",!0,X);if(a.gv.dm().endTransaction(),T)return}var c=a._checkEdit(X);c&&(a._downPosition=a._getLogicalPoint(X),a.gv.dm().beginTransaction(),c.startEdit(a,X),a.editing=!0)}},eq.prototype._checkEdit=function(l){var W=this,A=W.gv,J=W._getLogicalPoint(l),H=W.invokeSubModule("check",!0,A,l,J)||null;return W._editMod=H,H},eq.prototype.handleWindowTouchMove=function(P){return this.handleWindowMouseMove(P)},eq.prototype.handleWindowMouseMove=function(W){var d=this,m=d._downPosition;if(m){var $=d._getLogicalPoint(W);if($.distanceTo(m)<d.getStyle("moveSensitivity"))return;delete d._downPosition}var A=d._editMod;A&&A.handleEdit(d.gv,W)},eq.prototype._getLogicalPoint=function(I){var q=this,U=c.Default.getLogicalPoint(I,q._canvas);return new Fj.Math.Vector2(U)},eq.prototype.handleWindowTouchEnd=function(E){return this.handleWindowMouseUp(E)},eq.prototype.handleWindowMouseUp=function(){var g;for(g in{_46O:!0})break;return function(v){var t=this;t.editing=!1,t.setCursor("default"),t.invokeSubModule(g,!1,v),t._42(),t.gv.dm().endTransaction()}}(),eq.prototype.handle_mousewheel=function(_){var U=this;Zp(_),U.invokeSubModule("preHandleScroll",!0)||U.gv.handleScroll(_,_.wheelDelta)},eq.prototype.handleDelete=function(){var x=this;if(!x.editDetail){x.gv.dm().beginTransaction();var $=x.invokeSubModule("handleNormalStateDelete",!0);return x.gv.dm().endTransaction(),$||x.gv.removeSelection(),void 0}x.gv.dm().beginTransaction(),x.invokeSubModule("handleDelete",!0),x.gv.dm().endTransaction(),x._42()},eq.prototype.handle_keydown=function(T){var e=this;if((T.metaKey||T.ctrlKey)&&e._42(),Nd(T)&&!e.editing)return e.gvEditing=!1,e.setCursor("default"),e._42(),void 0;var X=uc(T);return e.editDetail?((X||Zr(T))&&(e.editDetail=!1,e._42()),e.gv.dm().beginTransaction(),e.invokeSubModule("handle_keydown",!0,T),e.gv.dm().endTransaction(),void 0):(e.gv.dm().beginTransaction(),e.invokeSubModule("handleNormalStateKeyDown",!0,T),e.gv.dm().endTransaction(),X&&e._tryEnterEditDetailMode(),void 0)},eq.prototype.handle_keyup=function(d){this.gv.dm().beginTransaction(),this.invokeSubModule("handle_keyup",!0,d),this.gv.dm().endTransaction()},eq.prototype._tryEnterEditDetailMode=function(){var m=this;return!m.editDetail&&m.invokeSubModule("canEnterEditDetailMode",!0)&&1===m._getValidSelection().length?(m.editDetail=!0,m._42(),!0):void 0},eq.prototype._tryQuitEditDetailMode=function(B){var J=this;if(J.editDetail){var f=J.gv,T=J.getSubModule("Curve").target;return B&&f.getDataAt(B)===T?void 0:(J.editDetail=!1,J._42(),!0)}},eq.prototype.setStyle=function(m,o,A){var p=this;A?Fj.setStyle(m,o):p._styleMap[m]=o,p.fp("styleChanged",null,{key:m,value:o,base:A}),p._42()},eq.prototype.getStyle=function($){var J=this,e=J._styleMap[$];return e!==N?e:Fj.getStyle($)},eq.prototype.setCursor=function(O){this._resetCustomCursorStyle(),c.graph.EditInteractor.superClass.setCursor.call(this,O)},eq.prototype._resetCustomCursorStyle=function(){var F=this;if(F._customStyle){var M=this.gv.getView();M.classList&&M.classList.remove&&M.classList.remove(F._customStyle),F._customStyle=null}},eq.prototype._setRotateCursor=function(j){var w=this,k=w._cursorFactory;k||(k=w._cursorFactory=new Fj.CursorFactory(w));var v=k.getRotateCursor(j),N=w.gv.getView();w._resetCustomCursorStyle(),w._customStyle=v,N.classList&&N.classList.add&&N.classList.add(v)};var gr=Fj.Group=function(L){var A=this;A._entities=L,A._64O=0,A._position={x:0,y:0},A._scale={x:1,y:1},A._anchor={x:.5,y:.5},A._anchor2={x:.5,y:.5}};gr.prototype={},gr.prototype.constructor=gr;var _p=null;gr.findOrCreateGroup=function(h){if(_p&&_p.checkIsMe(h))return _p;var R=new Fj.Group(h);return R.getKeyOb()?(_p=R,R):void 0},gr.prototype.checkIsMe=function(N){var Y=this._entities;if(Y.length!==N.length)return!1;var i,L={},Z=N.length;for(i=0;Z>i;i++)L[N[i]._id]=!0;for(i=0;Z>i;i++)if(!L[Y[i]._id])return!1;return!0},gr.prototype.getRotation=function(){return this._64O},gr.prototype.getPosition=function(){return this._position},gr.prototype.getAnchor=function(){return this._anchor},gr.prototype.getWidth=function(){return this._width},gr.prototype.getScale=function(){return this._scale},gr.prototype.getSize=function(){return{width:this._width,height:this._height}},gr.prototype.getHeight=function(){return this._height},gr.prototype.getKeyOb=function(){for(var n=this._entities,O=n.length-1;O>=0;O--){var u=n[O];if(this.isNode(u))return u}},gr.prototype.getAnchor2=function(){var k=this,o=k.rotateCenter;if(o)return o;var u=k.getKeyOb();if(!u)return k._anchor;var g=k._anchor2,t=u.getMatrix();return t.tf({x:u.getWidth()*(g.x-u.getAnchor().x),y:u.getHeight()*(g.y-u.getAnchor().y)})},gr.prototype.setAnchor2=function(n,D){var I=this,W=I.getKeyOb();if(W){var J,p=W.getMatrix();J="number"==typeof n?{x:n,y:D}:n;var f=p.tfi(J);I._anchor2={x:W.getAnchor().x+f.x/W.getWidth(),y:W.getAnchor().y+f.y/W.getHeight()}}},gr.prototype.setRotation=function(){},gr.prototype.beginRotate=function(z){this.rotateCenter=z.pos,this.rotateMode=z.groupRotateMode},gr.prototype.endRotate=function(){delete this.rotateCenter,delete this.rotateMode},gr.prototype.addRotation=function(F,s){return"batch"===s?this._addRotationInBatchMode(F):"block"===s?this._addRotationInBlockMode(F):void 0},gr.prototype._addRotationInBlockMode=function(z){var e=this,F=e.rotateCenter||e.getPosition();e._entities.forEach(function(P){if(e.isNode(P)){var J=P.getMatrix();J.translate(-F.x,-F.y),J.rotate(z),J.translate(F.x,F.y);var K=Math.sign(P.getScale().x);P.setRotation(B(J.b*K,J.a*K)),P.setPosition(J.tx,J.ty)}})},gr.prototype._addRotationInBatchMode=function(C){var e=this,$=e._anchor2;e._entities.forEach(function(H){if(e.isNode(H)){var l=H.getAnchor(),u=H.getMatrix(),P=u.tf({x:H.getWidth()*($.x-l.x),y:H.getHeight()*($.y-l.y)}),m=new Fj.Math.Matrix2d;m.set(u.a,u.b,u.c,u.d,u.tx,u.ty),m.translate(-P.x,-P.y),m.rotate(C),m.translate(P.x,P.y);var I=Math.sign(H.getScale().x);H.setRotation(B(m.b*I,m.a*I)),H.setPosition(m.tx,m.ty)}})},gr.prototype.setPosition=function(d){var w,T,$,V,u=this,N=u._position,C=d.x-N.x,v=d.y-N.y,K=u._entities;for(T=0,$=K.length;$>T;T++)w=K[T],Cj(w)&&(V=w.getPosition(),w.setPosition(V.x+C,V.y+v));u._position=d},gr.prototype.setScale=function(L,G){var O=this,g=L/O._scale.x,c=G/O._scale.y;O._adjustChildScaleOrSize(g,c,"size"),O._scale={x:L,y:G}},gr.prototype.getRect=function(){var Z=this,o=Z._position,T=Z._width,y=Z._height;return{x:o.x-T/2,y:o.y-y/2,width:T,height:y}},gr.prototype.setSize=function(y,A){var c=this,y=Math.max(1,y),A=Math.max(1,A),D=y/c._width,m=A/c._height;c._adjustChildScaleOrSize(D,m,"size"),c._width=y,c._height=A},gr.prototype._adjustChildScaleOrSize=function(Z,g,L){var s,X,F,l,T,r,d,R,u,k,Q,n,H,v,p=this,x=p._position,S=p._entities,U=new Fj.Math.Matrix2d;for(X=0,F=S.length;F>X;X++)if(s=S[X],p.isNode(s)){if(l=s.getPosition(),T=s.getRotation(),r=s.getWidth(),d=s.getHeight(),R=s.getScale(),Q=R.x*r,n=R.y*d,U.identity().scale(Q,n).rotate(T).translate(l.x,l.y).translate(-x.x,-x.y).rotate(-p._64O),T=B(U.b*Math.sign(Q),U.a*Math.sign(Q)),U.scale(Z,g),u=Math.cos(T),k=Math.sin(T),Math.abs(u)<.001?(H=U.b/k,v=-U.c/k):(H=U.a/u,v=U.d/u),"scale"===L)s.setScale(H/r,v/d);else if("size"===L){var e=H/R.x,_=v/R.y;s.setScale(nm(H)*Math.abs(R.x),nm(v)*Math.abs(R.y)),s.setSize(Math.max(.1,Math.abs(e)),Math.max(.1,Math.abs(_)))}U.rotate(p._64O).translate(x.x,x.y),s.setPosition(U.tx,U.ty)}},gr.prototype.getMatrix=function(){var M=this,I=M._position,R=c.Default.getInternal(),A=M._scale;return new R.Mat(M._64O,I.x,I.y,A.x,A.y)},gr.prototype.getCorners=function(){var U=this,S=U._width,u=U._height,t=U._anchor,k=-S*t.x,e=-u*t.y,j=U.getMatrix();return[j.tf(k,e),j.tf(k,e+u),j.tf(k+S,e+u),j.tf(k+S,e)]},gr.prototype.calcInfo=function(){var e,Z,n,q,U,V,X=this,N=[],A=X._entities,B=X._64O;for(q=0,U=A.length;U>q;q++)V=A[q],X.isNode(V)&&V.getCorners&&N.push.apply(N,V.getCorners());if(N.length){var Q=Math.cos(-B),k=Math.sin(-B),x=1/0,W=-1/0,H=1/0,P=-1/0;for(q=0,U=N.length;U>q;q++)n=N[q],e=n.x,Z=n.y,n.x=Q*e-k*Z,n.y=k*e+Q*Z,x=Math.min(x,n.x),W=Math.max(W,n.x),H=Math.min(H,n.y),P=Math.max(P,n.y);X._width=(W-x)/X._scale.x,X._height=(P-H)/X._scale.y,Q=Math.cos(B),k=Math.sin(B);var y=X._anchor;e=x+(W-x)*y.x,Z=H+(P-H)*y.y,X._position={x:Q*e-k*Z,y:k*e+Q*Z}}},gr.prototype.isNode=function(T){return Cj(T)?Ge(T)?!1:!0:!1},gr.prototype._42=function(z,F,i){var m,R,k,E,$,K,H,G,x=this,t=x._entities,l=x.rotateMode;for("batch"===l&&(G=x.getKeyOb()),m=0,R=t.length;R>m;m++)k=t[m],x.isNode(k)&&(K=k.getRect(),E=Fj.toScreenPosition(i,{x:K.x,y:K.y}),$=Fj.toScreenPosition(i,{x:K.x+K.width,y:K.y+K.height}),H={min:E,max:$},k===G&&(H.isKeyOb=!0),Fj.Icons.DrawIcon(z,F,Fj.Icons.GroupSubEntityRect,H))};var Ue=Fj.CurveActiving=function(D,F){this._curve=D,this._interactor=D._interactor;for(var m in F)this[m]=F[m]};Ue.prototype={},Ue.prototype.constructor=Ue,R.defineProperties(Ue.prototype,{point:{get:function(){return this._point},set:function(p){var E=this;E._point=p,E.editingCtrl||E._firePointChange()}},pairs:{get:function(){return this._pairs},set:function(Z){var T=this;T._pairs=Z,T.editingCtrl&&T._firePointChange()}}}),Ue.prototype._firePointChange=function(){var i=this,Y=i.getCurrentEditingPoint();if(!Y)return U.fi({kind:"selectPoint"}),void 0;var U=i._interactor,K=this._curve.target;if(K){var f=Fj.getDataMatrix(K).invert(),m=Y.e;Y=f.apply(Fj.toWorldPosition(U.gv,Y)),Y.e=m;var P=i._lastFirePoint;P&&Math.abs(Y.x-P.x)<1e-5&&Math.abs(Y.y-P.y)<1e-5&&(Y.e==N&&P.e==N||Math.abs(Y.e-P.e)<1e-5)||(i._lastFirePoint=Y,U.fi({kind:"selectPoint",x:Y.x,y:Y.y,e:Y.e}))}},Ue.prototype.dispose=function(){this._interactor.fi({kind:"selectPoint"})},Ue.prototype.getCurrentEditingPoint=function(){var S=this,P=S.editingCtrl;if(P){var D=S.pairs;if(D){var Q=D[P.pairId],q=Q[P.type];if(q)return q}}return S._point};var Ul=Fj.CursorFactory=function(W){var h=this;h._interactor=W,h._rotateCursorStyles={}};Ul.prototype={},Ul.prototype.constructor=Ul,Ul.prototype.getRotateCursor=function(R){var U=this;0>R&&(R+=2*Math.PI);var G=U._interactor,O=G.getStyle("rotateCursorSize"),S=G.getStyle("rotateCursorRound"),m=Math.round(180*(R/Math.PI)/S);
- m*S>=360&&(m=0);var Y=U._rotateCursorStyles,v="htCustomRotateStyle_"+O+"_"+S+"_"+m;return Y[v]||(U._produceRotateCursor(v,O,S,m),Y[v]=!0),v},Ul.prototype._produceRotateCursor=function(T,n,M,p){var U=this;U._interactor;var b=U._canvas;b||(b=U._canvas=m.createElement("canvas")),b.width=b.height=n*devicePixelRatio,b.style.width=b.style.height=n+" px";var A=b.getContext("2d");Fj.setAntialias(A,!1),A.scale(devicePixelRatio,devicePixelRatio);var Q,g,G,$,i,W=Math.round(n/2),v=""+W+" "+W+",auto !important;";Q=Math.PI/180*p*M,A.clearRect(0,0,n,n),A.save(),A.scale(n/32,n/32),A.translate(16,16),A.rotate(Q+Math.PI/2),A.beginPath(),A.moveTo(-8,0),A.lineTo(-8,3),A.lineTo(-5,3),A.moveTo(8,0),A.lineTo(8,3),A.lineTo(5,3),A.moveTo(-8,3),A.quadraticCurveTo(0,-6,8,3),A.restore(),A.strokeStyle="white",A.lineWidth=4,A.stroke(),A.strokeStyle="black",A.lineWidth=2,A.stroke(),g=JSON.stringify(b.toDataURL()),$="cursor:url("+g+")"+v,1!==devicePixelRatio&&(G='<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+n+'px" height="'+n+'px"><image xlink:href='+g+' width="'+n+'" height="'+n+'"/></svg>',$+="cursor:url(data:image/svg+xml;base64,"+btoa(G)+")"+v,$+="cursor:-webkit-image-set(url("+g+")"+devicePixelRatio+"x,url("+g+")1x)"+v),i=m.createElement("style"),i.textContent="body."+T+" *, ."+T+"{"+$+"}",m.head.appendChild(i)};var $c=Fj.Guide.Grid=function(d){var S=this;S._interactor=d,S._alignmentGuideId=0,S._xAlignmentGuide=[],S._yAlignmentGuide=[]};$c.prototype={},$c.prototype.constructor=$c,R.defineProperties($c.prototype,{gridBlockSize:{get:function(){var R=this;return R._gridBlockSize||R._interactor.getStyle("gridBlockSize")},set:function(W){this._gridBlockSize=W,this._interactor._42()}},gridThickLinesEvery:{get:function(){var e=this;return e._gridThickLinesEvery||e._interactor.getStyle("gridThickLinesEvery")},set:function(C){this._gridThickLinesEvery=C,this._interactor._42()}},gridEnabled:{get:function(){var h=this,E=h._interactor;return E.gridEnabled&&h.isValidGrid()}}}),$c.prototype._42=function(){var $=this,k=$._interactor;$.gridEnabled&&$.drawGrid(),k.alignmentGuideEnabled&&$.drawAlignmentGuide()},$c.prototype.makeMatrix=function(){var X=this,C=X._interactor.getStyle("gridAngle"),Y=X._interactor.getStyle("gridRotation"),t=new Fj.Math.Matrix2d,o=Math.sin(C),A=Math.cos(C);return t.set(1,0,A,o,0,0),t.rotate(Y),t},$c.prototype.isValidGrid=function(){var I=this,l=Math.PI,Y=I._interactor,F=Y.gv;if(F._zoom<Y.getStyle("gridZoomThreshold"))return!1;var V=Y.getStyle("gridAngle"),g=Math.abs(180*(V%l/l)),M=1-1e-8;return M>g||g>180-M?!1:!0},$c.prototype.drawAlignmentGuide=function(){var F=this,R=F._interactor,y=R.gv,A=R._canvas,Q=R._context,O=A.width,d=A.height,P=y.tx(),K=y.ty(),L=y._zoom;Q.beginPath(),Q.strokeStyle=R.getStyle("gridAlignmentGuideColor"),Q.lineWidth=1,F._xAlignmentGuide.forEach(function(w){var y=w.p*L+P;Q.moveTo(y,0),Q.lineTo(y,d)}),F._yAlignmentGuide.forEach(function(f){var C=f.p*L+K;Q.moveTo(0,C),Q.lineTo(O,C)}),Q.stroke()},$c.prototype.drawGrid=function(){function t(Q,W,Y,g){var c=Fj.toScreenPosition(R,b.apply({x:Q,y:W})),D=Fj.toScreenPosition(R,b.apply({x:Y,y:g}));Z.moveTo(c.x,c.y),Z.lineTo(D.x,D.y)}var F=this,O=F._interactor,W=F.gridBlockSize,z=F.gridThickLinesEvery,N=O.getStyle("gridThickColor"),e=O.getStyle("gridLightColor"),R=O.gv,E=O._canvas,Z=O._context,S=E.width,h=E.height,b=F.makeMatrix(),P=b.applyInverse(Fj.toWorldPosition(R,{x:0,y:0})),p=b.applyInverse(Fj.toWorldPosition(R,{x:S,y:0})),D=b.applyInverse(Fj.toWorldPosition(R,{x:0,y:h})),w=b.applyInverse(Fj.toWorldPosition(R,{x:S,y:h})),o=Math.min(P.x,p.x,D.x,w.x),T=Math.max(P.x,p.x,D.x,w.x),i=Math.min(P.y,p.y,D.y,w.y),g=Math.max(P.y,p.y,D.y,w.y);S=T-o,h=g-i;var x=Math.ceil(o/W),C=Math.floor(T/W),k=Math.ceil(i/W),X=Math.floor(g/W);R.tx(),R.ty(),R._zoom;var L,s,J;for(Z.save(),Z.lineWidth=1,Z.beginPath(),Z.strokeStyle=N,J=Math.ceil(x/z)*z;C>=J;J+=z)L=J*W,t(L,i,L,g);for(J=Math.ceil(k/z)*z;X>=J;J+=z)s=J*W,t(o,s,T,s);for(Z.stroke(),Z.beginPath(),Z.strokeStyle=e,J=x;C>=J;J++)0!==J%z&&(L=J*W,t(L,i,L,g));for(J=k;X>=J;J++)0!==J%z&&(s=J*W,t(o,s,T,s));Z.stroke(),Z.restore()},$c.prototype.getAlignmentGuides=function(){var B=this;return{x:B._xAlignmentGuide,y:B._yAlignmentGuide}},$c.prototype.addAlignmentGuide=function(G,b,E){var Z=this,K="x"===G?Z._xAlignmentGuide:Z._yAlignmentGuide,E=E?E:++Z._alignmentGuideId,j={p:b,id:E};if(K.length){var y=Z._findClosestAlignmentGuide(j.p,K);y.dis<0?K.splice(y.index+1,0,j):K.splice(y.index,0,j)}else K.push(j);return Z._interactor._42(),E},$c.prototype.findClosest=function(t,R,D){var w=this,U=w._interactor,_=U.gv;D&&(t=Fj.toWorldPosition(_,t));var k,B,j,E=1/0,Z=1/0,P=t.x,Q=t.y;if(w.gridEnabled){var l=w.gridBlockSize,T=w.makeMatrix(),e=T.applyInverse(t);e=T.apply({x:Math.round(e.x/l)*l,y:Math.round(e.y/l)*l}),E=e.x-P,Z=e.y-Q,j=!0}if(U.alignmentGuideEnabled&&(k=w._findClosestAlignmentGuide(P,w._xAlignmentGuide).dis,B=w._findClosestAlignmentGuide(Q,w._yAlignmentGuide).dis,Math.abs(k)<Math.abs(E)&&(E=k,j=!0),Math.abs(B)<Math.abs(Z)&&(Z=B,j=!0)),j){j=!1;var n=_._zoom,H=U.getStyle("smartGuideSensitivity")/n,y={};if(Math.abs(E)<H&&"y"!==R&&(y.x=D?E*n:E,j=!0),Math.abs(Z)<H&&"x"!==R&&(y.y=D?Z*n:Z,j=!0),j)return y}},$c.prototype._findClosestAlignmentGuide=function(K,M){if(!M.length)return{dis:1/0};for(var t,T=0,F=M.length-1;F-T>1;)t=Math.floor((T+F)/2),M[t].p<K?T=t:F=t;var x=M[T].p-K,E=M[F].p-K;return Math.abs(x)<=Math.abs(E)?{line:M[T],dis:x,index:T}:{line:M[F],dis:E,index:F}},$c.prototype.removeAllAlignmentGuide=function(t){var T=this;"y"!==t&&(T._xAlignmentGuide=[]),"x"!==t&&(T._yAlignmentGuide=[]),T._interactor._42()},$c.prototype.removeAlignmentGuide=function(r){for(var L,O,E,y=this,X=y._xAlignmentGuide,f=0;2>f;f++)for(X=0===f?y._xAlignmentGuide:y._yAlignmentGuide,L=0,O=X.length;O>L;L++)if(E=X[L],E.id===r)return X.splice(L,1),y._interactor._42(),{axis:0===f?"x":"y",position:E.p};return!1},$c.prototype.adjustAlignmentGuide=function(C,E){var q=this,b=q.removeAlignmentGuide(C);return b?(q.addAlignmentGuide(b.axis,E,C),!0):!1};var Zi=Fj.Guide.Rect=function(m){var O=this;O._interactor=m};Zi.prototype={},Zi.prototype.constructor=Zi,Zi.prototype.gatherRects=function(){var V,d,w,y,t=this,J=t._interactor.gv,H=[],N=[],Y={x:H,y:N},k={},m=J.getDataModel(),s=m.a("width"),D=m.a("height");s&&D&&(V=0,d=0,w=s,y=D,H.push({node:m,type:0,p:V},{node:m,type:1,p:V+w/2},{node:m,type:2,p:V+w}),N.push({node:m,type:0,p:d},{node:m,type:1,p:d+y/2},{node:m,type:2,p:d+y}),k[m._id||0]={x:V,y:d,width:w,height:y}),m.each(function(p){if(Cj(p)&&!J.isSelected(p)&&J.isVisible(p)){var U=!1;if(J.sm().getSelection().each(function(T){U||(p.isHostOn(T)?U=!0:p.isDescendantOf(T)&&(U=!0))}),!U){var _=p.getRect();V=_.x,d=_.y,w=_.width,y=_.height,H.push({node:p,type:0,p:V},{node:p,type:1,p:V+w/2},{node:p,type:2,p:V+w}),N.push({node:p,type:0,p:d},{node:p,type:1,p:d+y/2},{node:p,type:2,p:d+y}),k[p._id]=_}}}),H.sort(function(B,R){return B.p-R.p}),N.sort(function(m,Q){return m.p-Q.p}),t._grid=Y,t._87I=k},Zi.prototype.gatherLines=function(a,u,Z){var Q,V,k,W,e,C,d,l,p,s,o,F,x=this,A=[x.findClosest({x:a.x,y:a.y},u),x.findClosest({x:a.x+a.w/2,y:a.y+a.h/2},u),x.findClosest({x:a.x+a.w,y:a.y+a.h},u)],i={},j=x._87I;Z=Z||255;var H,O;for(x._guideLine=[],Q=0;2>Q;Q++)for(i={},0===Q?(W="y",l=a.x,p=l+a.w):(W="x",l=a.y,p=l+a.h),V=0;3>V;V++)e=A[V],e&&isFinite(e[W])&&(H=1<<3*Q+V,Z&H&&(C=e[W+"Line"],d=C.node,O=d._id||0,i[O]||(i[O]=!0,F=j[O],"y"===W?(s=F.x,o=F.x+F.width):(s=F.y,o=F.y+F.height),k=C.p,x._guideLine.push({type:W,a:l,b:p,c:s,d:o,p:k,center:1===C.type}))))},Zi.prototype._binarySearchClosest=function(C,w){if(!w.length)return{dis:1/0};for(var I,X=0,d=w.length-1;d-X>1;)I=Math.floor((X+d)/2),w[I].p<C?X=I:d=I;var T=w[X].p-C,S=w[d].p-C;return Math.abs(T)<=Math.abs(S)?{line:w[X],dis:T}:{line:w[d],dis:S}},Zi.prototype.findClosest=function(x,W,f){var n=this,v=n._interactor,p=v.gv,V=n._grid;f&&(x=Fj.toWorldPosition(p,x));var N,K=n._binarySearchClosest(x.x,V.x),S=n._binarySearchClosest(x.y,V.y),_=K.dis,c=S.dis,t=p._zoom,U=v.getStyle("smartGuideSensitivity")/t,z={};return Math.abs(_)<U&&"y"!==W&&(z.x=f?_*t:_,z.xLine=K.line,N=!0),Math.abs(c)<U&&"x"!==W&&(z.y=f?c*t:c,z.yLine=S.line,N=!0),N?z:void 0},Zi.prototype._42=function(){var x=this,w=x._guideLine;if(w&&!c.Default.isCtrlDown()){var N,U,J,F,G,u,B,Z,H,O,R,b,p,z,V,y,e,T=x._interactor,s=T.gv,a=T._context,A=s.tx(),d=s.ty(),h=s._zoom,Q=T.getStyle("guideLineTextSpacing");for(N=0,U=w.length;U>N;N++)J=w[N],Z=J.type,H=J.p,O=J.a,R=J.b,b=J.c,p=J.d,z=Math.min(O,b),V=Math.max(R,p),"x"===Z?(F=H*h+A,G=z*h+d,u=F,B=V*h+d):(F=z*h+A,G=H*h+d,u=V*h+A,B=G),Fj.Icons.DrawIcon(T,a,Fj.Icons.MoveLineGuide,{rect:[F,G,u,B],center:J.center}),p>=O&&R>=b||(z=O>p?p:R,V=O>p?O:b,e=V-z,"x"===Z?(J.center2center||(F-=Q,u=F),G=z*h+d,B=V*h+d,y=Fj.Icons.MoveLineGuideDistanceV):"y"===Z&&(J.center2center||(G-=Q,B=G),F=z*h+A,u=V*h+A,y=Fj.Icons.MoveLineGuideDistanceH),Fj.Icons.DrawIcon(T,a,y,{x0:F,y0:G,x1:u,y1:B,dis:e}))}},Zi.prototype.clear=function(){this._guideLine=null},Fj.DefaultStyleMap={pointSize:[24,9],checkSize:7,rotateCheckSize:10,moveSensitivity:10,rotateRound:Math.PI/2,rotateSensitivity:Math.PI/60,shiftRotateRound:Math.PI/12,shiftLineRotateRound:Math.PI/4,anchorMovable:!0,anchorVisible:!0,anchorHideThreshold:25,anchorOutsideVisibleThreshold:.25,anchorRound:.25,anchorSensitivity:.02,smartGuideSensitivity:8,curveIntersectSize:5,curvePointIntersectSize:8,edgeHostDetectPerFrame:!0,guideLineTextSpacing:0,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],connectGuideVisible:!0,connectGuideShift:[1,.25,8,0],connectGuideIntersectSize:8,connectGuideGarbageIntersectsize:25,connectGuideGarbageShift:[1,1,-48,-48]};var pc=Fj.Icons={},Jq=1e4,xb=null,Oq="rgb(51,153,255)",mb="rgb(183,232,135)",wd="rgb(255,204,153)",Pe=6;c.Default.setImage("Icons.RectPoint",{width:Pe,height:Pe,comps:[{type:"rect",background:"rgb(247,247,247)",borderWidth:1,borderColor:Oq,rect:[0,0,Pe,Pe]}]});var Dp="#e000e0";pc.GroupSubEntityRect={comps:[{type:"shape",points:{func:function(){var U=pc.GroupSubEntityRect.data;if(!U)return[];var P=U.min,h=U.max;return[P.x,P.y,P.x,h.y,h.x,h.y,h.x,P.y]}},segments:[1,2,2,2,5],background:null,borderWidth:1,borderColor:{func:function(){return pc.GroupSubEntityRect.data.isKeyOb?Dp:"#666666"}}}]},pc.Line={comps:[{type:"image",name:"Icons.RectPoint",rect:{func:function(){return[[pc.Line.data.P1.x,pc.Line.data.P1.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rect:{func:function(){return[[pc.Line.data.P2.x,pc.Line.data.P2.y],Pe,Pe]}}}]},pc.NodeHoverGuide={comps:[{type:"shape",points:{func:function(){return pc.NodeHoverGuide.data}},segments:[1,2,2,2,5],background:null,borderWidth:1,borderColor:"#3399FF"}]},pc.Rect={comps:[{type:"shape",points:{func:function(){var y=pc.Rect.data;if(!y)return[];var c=y.LT,N=y.LB,I=y.RB,p=y.RT;return[c.x,c.y,N.x,N.y,I.x,I.y,p.x,p.y]}},segments:[1,2,2,2,5],background:null,borderWidth:1,borderColor:Oq},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},rect:{func:function(){return[[pc.Rect.data.LT.x,pc.Rect.data.LT.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},rect:{func:function(){return[[pc.Rect.data.LB.x,pc.Rect.data.LB.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},rect:{func:function(){return[[pc.Rect.data.RB.x,pc.Rect.data.RB.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},rect:{func:function(){return[[pc.Rect.data.RT.x,pc.Rect.data.RT.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},visible:{func:function(){return pc.Rect.data.L?!0:!1}},rect:{func:function(){return[[pc.Rect.data.L.x,pc.Rect.data.L.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},visible:{func:function(){return pc.Rect.data.R?!0:!1}},rect:{func:function(){return[[pc.Rect.data.R.x,pc.Rect.data.R.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},visible:{func:function(){return pc.Rect.data.T?!0:!1}},rect:{func:function(){return[[pc.Rect.data.T.x,pc.Rect.data.T.y],Pe,Pe]}}},{type:"image",name:"Icons.RectPoint",rotation:{func:function(){return pc.Rect.data.rotation}},visible:{func:function(){return pc.Rect.data.B?!0:!1}},rect:{func:function(){return[[pc.Rect.data.B.x,pc.Rect.data.B.y],Pe,Pe]}}}]};var Ff=16;c.Default.setImage("Icons.Anchor",{width:12,height:12,comps:[{type:"shape",borderWidth:1,borderColor:Oq,borderCap:"round",shadowColor:"#1ABC9C",points:[.50928,6,11.49072,6,6,6,6,.50928,6,11.49072]},{type:"circle",borderWidth:1,borderColor:Oq,shadowColor:"#1ABC9C",rect:[2.84391,2.84391,6.53697,6.53697]}]}),pc.Anchor={comps:[{type:"image",name:"Icons.Anchor",rect:{func:function(){return[[pc.Anchor.data.POS.x,pc.Anchor.data.POS.y],Ff,Ff]}}}]},pc.TipShiftX=12,pc.TipShiftY=12;var Ti=[8,28];pc.TipHelper={comps:[{type:"roundRect",rect:{func:function(){return[pc.TipHelper.data.helperPos.x,pc.TipHelper.data.helperPos.y,Ti[0]*pc.TipHelper.data.size,Ti[1]]}},background:{func:function(){return xb.getStyle("tipBackground")}},opacity:.6},{type:"text",text:{func:function(){return pc.TipHelper.data.text}},rect:{func:function(){return[pc.TipHelper.data.helperPos.x,pc.TipHelper.data.helperPos.y,Ti[0]*pc.TipHelper.data.size,Ti[1]]}},color:{func:function(){return xb.getStyle("tipTextColor")}},font:"bold 12px Arial",align:"center"}]};var eh=7;pc.ShapePoint={comps:[{type:"circle",rect:{func:function(){var y=pc.ShapePoint.data;return[y,eh,eh]}},background:"#ffffff",borderWidth:1,borderColor:Oq}]},pc.ShapeBgCurve={comps:[{type:"shape",points:{func:function(){return pc.ShapeBgCurve.data.P}},segments:{func:function(){return pc.ShapeBgCurve.data.S}},background:null,borderWidth:1,borderColor:Oq}]};var jq=8;pc.ShapeHighlighPoint={comps:[{type:"circle",rect:{func:function(){var b=pc.ShapeHighlighPoint.data;return[[b.x,b.y],jq,jq]}},background:{func:function(){return xb.getStyle("shapeHighlighPointBackground")}},borderWidth:0}]};var bp=10;pc.ShapeHighlighRealPoint={comps:[{type:"circle",rect:{func:function(){var B=pc.ShapeHighlighRealPoint.data;return[[B.x,B.y],bp,bp]}},background:"#ffffff",borderWidth:2,borderColor:Oq}]};var ie=8;pc.ShapeHighlighCtrlPoint={comps:[{type:"shape",points:{func:function(){var k=pc.ShapeHighlighCtrlPoint.data,O=k.x,Y=k.y,s=ie/2;return[O-s,Y-s,O-s,Y+s,O+s,Y+s,O+s,Y-s]}},segments:[1,2,2,2,5],borderWidth:2,background:{func:function(){return xb.getStyle("shapeCtrlPointBackground")}},borderColor:{func:function(){return xb.getStyle("shapeCtrlPointBorderColor")||Oq}}}]};var Lp=3;pc.ShapeHighlightCurve={comps:[{type:"shape",points:{func:function(){return pc.ShapeHighlightCurve.data}},segments:[1,4],background:null,borderWidth:Lp,borderColor:{func:function(){return xb.getStyle("curveHighlightColor")}}}]},pc.ShapeGuideLine={comps:[{type:"shape",points:{func:function(){return pc.ShapeGuideLine.data}},background:null,borderWidth:1,borderColor:"rgb(255,204,153)"}]},pc.MoveLineGuide={comps:[{type:"shape",points:{func:function(){return pc.MoveLineGuide.data.rect}},background:null,borderWidth:1,borderColor:{func:function(){return pc.MoveLineGuide.data.center?mb:wd}}}]};var mk=5;pc.MoveLineGuideDistanceH={comps:[{type:"shape",points:{func:function(){var s=pc.MoveLineGuideDistanceH.data,P=s.x0,q=s.y0;return[P,q-mk,P,q+mk]}},rotation:-Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:wd},{type:"shape",points:{func:function(){var $=pc.MoveLineGuideDistanceH.data,b=$.x1,H=$.y1;return[b,H-mk,b,H+mk]}},rotation:-Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:wd},{type:"text",text:{func:function(){return Math.round(pc.MoveLineGuideDistanceH.data.dis)}},rect:{func:function(){var H=pc.MoveLineGuideDistanceH.data;return[[(H.x0+H.x1)/2,H.y0-10],20,20]}},color:wd,font:"12px Arial",align:"center"}]},pc.MoveLineGuideDistanceV={comps:[{type:"shape",points:{func:function(){var n=pc.MoveLineGuideDistanceV.data,J=n.x0,j=n.y0;return[J-mk,j,J+mk,j]}},rotation:Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:wd},{type:"shape",points:{func:function(){var N=pc.MoveLineGuideDistanceV.data,n=N.x1,Y=N.y1;return[n-mk,Y,n+mk,Y]}},rotation:Math.PI/4,segments:[1,2],background:null,borderWidth:1,borderColor:wd},{type:"text",text:{func:function(){return Math.round(pc.MoveLineGuideDistanceV.data.dis)}},rect:{func:function(){var x=pc.MoveLineGuideDistanceV.data;return[[x.x0-10,(x.y0+x.y1)/2],20,20]}},color:wd,font:"12px Arial",align:"center"}]},c.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]}]}),pc.EdgeElevationGuide={comps:[{type:"image",name:"Icons.EdgeElevationGuideImage",rect:{func:function(){var n=pc.EdgeElevationGuide.data,P=n.x,R=n.y,h=xb.getStyle("curveElevationIntersectSize"),T=xb.getStyle("curveElevationGuideShift");return P+=T[0],R+=T[1],[P-h,R-h,2*h,2*h]}}}]},c.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]}]}),c.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]}]}),pc.ConnectGuide={comps:[{type:"image",name:"Icons.ConnectGuideBgImage",rotation:{func:function(){return pc.ConnectGuide.data.rotation}},rect:{func:function(){var T=pc.ConnectGuide.data.connect;T.x,T.y;var w=xb.getStyle("connectGuideIntersectSize");return[[T.x,T.y],2*w,2*w]}}},{type:"image",name:"Icons.ConnectGuideHeaderImage",rect:{func:function(){var a=pc.ConnectGuide.data.cursorPos||pc.ConnectGuide.data.connect,A=xb.getStyle("connectGuideIntersectSize");return[[a.x,a.y],2*A-2,2*A-2]}}},{type:"shape",background:null,borderColor:"#3399ff",borderWidth:2,segments:[1,4],points:{func:function(){var $=pc.ConnectGuide.data.connect,A=pc.ConnectGuide.data.cursorPos||$;return[$.x,$.y,$.x+.5*(A.x-$.x),$.y,A.x+.5*($.x-A.x),A.y,A.x,A.y]}}}]},c.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]}]}),c.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]}]}),pc.ConnectGuideGarbage={comps:[{type:"image",name:{func:function(){var K=pc.ConnectGuideGarbage.data.hover;return K?"Icons.ConnectGuideDeletingImage":"Icons.ConnectGuideGarbageImage"}},rect:{func:function(){var n=pc.ConnectGuideGarbage.data,f=xb.getStyle("connectGuideGarbageIntersectsize");return n.hover&&(f+=5),[[n.x,n.y],2*f,2*f]}}}]};var Hn=6;pc.ShapeActivingCtrl={comps:[{type:"shape",visible:{func:function(){return pc.ShapeActivingCtrl.data.c1?!0:!1}},points:{func:function(){var X=pc.ShapeActivingCtrl.data;return[X.point.x,X.point.y,X.c1.x,X.c1.y]}},segments:[1,2],background:null,borderWidth:1,borderColor:Oq},{type:"shape",visible:{func:function(){return pc.ShapeActivingCtrl.data.c2?!0:!1}},points:{func:function(){var Y=pc.ShapeActivingCtrl.data;return[Y.point.x,Y.point.y,Y.c2.x,Y.c2.y]}},segments:[1,2],background:null,borderWidth:1,borderColor:Oq},{type:"shape",visible:{func:function(){return pc.ShapeActivingCtrl.data.c1?!0:!1}},points:{func:function(){var p=pc.ShapeActivingCtrl.data.c1,c=p.x,X=p.y,F=Hn/2;return"c1"===pc.ShapeActivingCtrl.data.hl&&(F+=.5),[c-F,X-F,c-F,X+F,c+F,X+F,c+F,X-F]}},segments:[1,2,2,2,5],borderWidth:2,background:{func:function(){return xb.getStyle("shapeCtrlPointBackground")}},borderColor:{func:function(){return"c1"===pc.ShapeActivingCtrl.data.hl?xb.getStyle("shapeCtrlPointHighlightBorder")||Oq:xb.getStyle("shapeCtrlPointBorderColor")||Oq}}},{type:"shape",visible:{func:function(){return pc.ShapeActivingCtrl.data.c2?!0:!1}},points:{func:function(){var z=pc.ShapeActivingCtrl.data.c2,T=z.x,u=z.y,p=Hn/2;return"c2"===pc.ShapeActivingCtrl.data.hl&&(p+=.5),[T-p,u-p,T-p,u+p,T+p,u+p,T+p,u-p]}},segments:[1,2,2,2,5],borderWidth:2,background:{func:function(){return xb.getStyle("shapeCtrlPointBackground")}},borderColor:{func:function(){return"c2"===pc.ShapeActivingCtrl.data.hl?xb.getStyle("shapeCtrlPointHighlightBorder")||Oq:xb.getStyle("shapeCtrlPointBorderColor")||Oq}}}]},Fj.Icons.DrawIcon=function(e,k,n,N){n.width=n.height=Jq,n.data=N,xb=e,c.Default.drawImage(k,n,0,0,Jq,Jq)},Fj.Icons.MapPoints=function(Q,N){for(var p=0,U=Q.length;U>p;p++)Q[p]/=N},Fj.roundTo=function(x,$,i){var Z=Math.abs(x%$);return i>Z||i>$-Z?$*Math.round(x/$):x},Fj.toFixed=function(B){return Math.round(100*B)/100},Fj.getDataMatrix=function(U){if(U instanceof c.Shape){var M=new c.Math.Matrix2d,d=U.getPosition();return M.translate(-d.x,-d.y).scale(U.getScale().x,U.getScale().y).rotate(U.getRotation()).translate(d.x,d.y),M}return U.getMatrix?U.getMatrix():new c.Math.Matrix2d};var Hc=Fj.Math.Curve=function(){this._curves=[]};Hc.prototype={},Hc.prototype.constructor=Hc,Hc.prototype.createFromHtShape=function(U,A,n){A instanceof c.List&&(A=A.toArray());var S,o,i,K,d,m,_,u=this,q=null,O=null,s=0,G=Fj.Math.Vector2,L=Fj.Math.CubicBezier,v=function(b){return new G(U[b],U[b+1],n?n[b/2]:N)};for(o=0,i=A.length;i>o;o++){switch(K=A[o],d=null,K){case 1:O=v(s),q=O,s+=2;break;case 2:S=v(s),s+=2,d=new L(O,O.clone(),S.clone(),S),O=S;break;case 3:m=v(s),S=v(s+2),s+=4,d=new L(O,m.clone().sub(O).multiplyScalar(2/3).add(O),m.clone().sub(S).multiplyScalar(2/3).add(S),S),O=S;break;case 4:m=v(s),_=v(s+2),S=v(s+4),s+=6,d=new L(O,m,_,S),O=S;break;case 5:if(!q)break;d=new L(O,O.clone(),q.clone(),q),O=null,q=null}d&&(d._index=u._curves.length,u._curves.push(d))}},Hc.prototype.checkPoint=function(E,F){var D,v,G,P,w,N=this,m=N._curves;for(D=0,v=m.length;v>D;D++)if(P=m[D],w=P.intersectRect(E,F,F),w.length)return G=0,w.forEach(function(Y){G+=Y.t}),G/=w.length,E=P.getPointAt(G),E.t=G,{bezier:P,intersection:E}},Hc.prototype.insertKnot=function(z,E){var n=z.insertKnot(E),l=this,O=l._curves;O.splice(z._index,1,n[0],n[1])},Hc.prototype._isCloseEnough=function(N,J){return Math.abs(N.x-J.x)<1e-6&&Math.abs(N.y-J.y)<1e-6},Hc.prototype._isSamePoint=function(B,M){return B===M},Hc.prototype.moveRealPoint=function(W,O){var X=this,g=X._curves,w=O.clone().sub(W);g.forEach(function(n){var d=n._p1;n._p2,n._p3;var R=n._p4;X._isSamePoint(d,W)&&(n._p2.add(w),n._p1=O),X._isSamePoint(R,W)&&(n._p3.add(w),n._p4=O)})},Hc.prototype.moveCtrlDueToRealPointMovement=function(Y,H){var K=this,V=K._curves,M=function(L){L.add(H),L.e&&H.e&&(L.e+=H.e)};V.forEach(function(d){var A=d._p1;d._p2,d._p3;var y=d._p4;K._isSamePoint(A,Y)&&M(d._p2),K._isSamePoint(y,Y)&&M(d._p3)})},Hc.prototype.moveCtrlPoint=function(j,V,I){var C=j[I];if(C){C.e!==N&&(V.e=C.e);var t=this,m=t._curves;V.clone().sub(C),m.forEach(function(R){var P;"c2"===I?P="_p2":"c1"===I&&(P="_p3"),t._isSamePoint(R[P],C)&&(R[P]=V)}),j[I]=V}},Hc.prototype.deleteRealPoint=function(Z,b){var L,l,d,R,A,c,v,D=this,m=D._curves,n={},t=[],i=Fj.Math.CubicBezier;for(l=0,d=m.length;d>l;l++)L=m[l],R=L._p1,A=L._p2,c=L._p3,v=L._p4,(n[l]||!D._isSamePoint(R,Z))&&(D._isSamePoint(v,Z)?d>l+1&&D._isSamePoint(m[l+1]._p1,Z)&&(b||t.push(new i(R,A,m[l+1]._p3,m[l+1]._p4))):t.push(L));D._curves=t},Hc.prototype.findPairs=function(A,m){var M,I,Q,Y,t,D,V,H,e=this,z=e._curves,r={},g=[];for(I=0,Q=z.length;Q>I;I++)M=z[I],Y=M._p1,t=M._p2,D=M._p3,V=M._p4,!r[I]&&e._isSamePoint(Y,A)&&(m?g.push({point:Y,r2:V}):g.push({point:Y,c2:t})),e._isSamePoint(V,A)&&(H=m?{point:V,r1:Y}:{point:V,c1:D},Q>I+1&&e._isSamePoint(z[I+1]._p1,A)&&(m?H.r2=z[I+1]._p4:H.c2=z[I+1]._p2,r[I+1]=!0),g.push(H));return g},Hc.prototype.toHtShape=function(){var X=this,W=X._curves,f=[],v=[],H={x:1/0,y:1/0};return W.forEach(function(w){var Z=w._p1,u=w._p2,t=w._p3,m=w._p4;return X._isCloseEnough(Z,H)||(f.push(1),v.push(Z.clone())),H=m,X._isCloseEnough(Z,u)&&X._isCloseEnough(t,m)?(f.push(2),v.push(m.clone()),void 0):(f.push(4),v.push(u.clone(),t.clone(),m.clone()),void 0)}),{segments:f,points:v}};var bq=Fj.Math.CubicBezier=function($,q,v,S){var N=this;N._id=Fj.Math.CubicBezier._globalId++,N._p1=$,N._p2=q,N._p3=v,N._p4=S};bq._globalId=1,bq.prototype={},bq.prototype.constructor=bq,bq.prototype.toString=function(){return this._id},bq.prototype.intersectRect=function(E,c,n){var t=c/2,s=n/2,l=E.x,B=E.y,w=Fj.Math.Vector2,Q=new w(-t+l,-s+B),A=new w(t+l,s+B),K=new w(A.x,Q.y),r=new w(Q.x,A.y),H=this,S=H.intersectLine(Q,K),C=H.intersectLine(K,A),G=H.intersectLine(A,r),L=H.intersectLine(r,Q),y=S.concat(C).concat(G).concat(L);return y},bq.prototype.intersectLine=function(D,w){var m,f,Q,E,G,k,W,y,_,s,X,a,L,r=this,p=D.clone().min(w),c=D.clone().max(w);E=r._p1,G=r._p2,k=r._p3,W=r._p4,m=E.clone().multiplyScalar(-1),f=G.clone().multiplyScalar(3),Q=k.clone().multiplyScalar(-3),X=m.add(f).add(Q).add(W),m=E.clone().multiplyScalar(3),f=G.clone().multiplyScalar(-6),Q=k.clone().multiplyScalar(3),s=m.add(f).add(Q),m=E.clone().multiplyScalar(-3),f=G.clone().multiplyScalar(3),_=m.add(f),y=E.clone(),L=new Fj.Math.Vector2(D.y-w.y,w.x-D.x),a=D.x*w.y-w.x*D.y;for(var S=r.getRoots(L.dot(X),L.dot(s),L.dot(_),L.dot(y)+a),V=new Array,u=0,B=S.length;B>u;u++){var $=S[u];if(!(0>$||$>1)){var P=E.clone().lerp(G,$),O=G.clone().lerp(k,$),C=k.clone().lerp(W,$),A=P.lerp(O,$),M=O.lerp(C,$),Y=A.lerp(M,$);Y.t=$,D.x==w.x?p.y<=Y.y&&Y.y<=c.y&&V.push(Y):D.y==w.y?p.x<=Y.x&&Y.x<=c.x&&V.push(Y):Y.x>=p.x&&Y.y>=p.y&&Y.x<=c.x&&Y.y<=c.y&&V.push(Y)}}return V},bq.prototype.solveTForPoint=function(x){var C,v,T,X,c=this;C=c._p1.x-x.x,v=c._p2.x-x.x,T=c._p3.x-x.x,X=c._p4.x-x.x;for(var t=c.getRoots(X-3*T+3*v-C,3*T-6*v+3*C,3*v-3*C,C),R=N,Q=1/0,O=0,E=t.length;E>O;O++){var F=t[O];if(!(0>F||F>1)){var s=c._p1.clone().lerp(c._p2,F),d=c._p2.clone().lerp(c._p3,F),Y=c._p3.clone().lerp(c._p4,F),y=s.lerp(d,F),K=d.lerp(Y,F),w=y.lerp(K,F);w.t=F;var q=Math.abs(w.y-x.y);Q>q&&(Q=q,R=w)}}return R},bq.prototype.getPointAt=function(U){var E=this,N=E._p1,G=E._p2,J=E._p3,b=E._p4,v=N.clone().lerp(G,U),y=G.clone().lerp(J,U),K=J.clone().lerp(b,U),Q=v.lerp(y,U),X=y.lerp(K,U);return Q.lerp(X,U)},bq.prototype.getRoots=function(U,h,B,q){var F,k,j,f,p,Z=new Array;if(Math.abs(U)<1e-6){var F=h,k=B/F,j=q/F,f=k*k-4*j;if(f>0){var p=Math.sqrt(f);Z.push(.5*(-k+p)),Z.push(.5*(-k-p))}else 0==f&&Z.push(.5*-k)}h/=U,B/=U,q/=U,F=(3*B-h*h)/3,k=(2*h*h*h-9*B*h+27*q)/27;var r=h/3,J=k*k/4+F*F*F/27,K=k/2;if(Math.abs(J)<=1e-6&&(J=0),J>0){var m,x,p=Math.sqrt(J);m=-K+p,x=m>=0?Math.pow(m,1/3):-Math.pow(-m,1/3),m=-K-p,m>=0?x+=Math.pow(m,1/3):x-=Math.pow(-m,1/3),Z.push(x-r)}else if(0>J){var c=Math.sqrt(-F/3),n=Math.atan2(Math.sqrt(-J),-K)/3,g=Math.cos(n),O=Math.sin(n),A=Math.sqrt(3);Z.push(2*c*g-r),Z.push(-c*(g+A*O)-r),Z.push(-c*(g-A*O)-r)}else{var m;m=K>=0?-Math.pow(K,1/3):Math.pow(-K,1/3),Z.push(2*m-r),Z.push(-m-r)}return Z},bq.prototype._70I=function(){var L=this;return L._p1.distanceToSquared(L._p2)<1e-10&&L._p3.distanceToSquared(L._p4)<1e-10},bq.prototype.insertKnot=function(A){var U=this,n=U._p1,j=U._p2,g=U._p3,V=U._p4,J=n.clone().lerp(j,A),e=j.clone().lerp(g,A),N=g.clone().lerp(V,A),H=J.clone().lerp(e,A),Z=e.clone().lerp(N,A),Y=H.clone().lerp(Z,A);return U._70I()?(n.clone().lerp(V,A),[new Fj.Math.CubicBezier(n,n.clone(),Y.clone(),Y),new Fj.Math.CubicBezier(Y,Y.clone(),V.clone(),V)]):[new Fj.Math.CubicBezier(n,J,H,Y),new Fj.Math.CubicBezier(Y,Z,N,V)]};var Yj=c.Default.getInternal().ui().EdgeUI,on={_47O:function(K){var H=this,u=on.getBackups()._47O;Fj.inEdit(H.gv)||u.call(H,K)}};Fj.Inject.registAsModule(on,Yj);var xk=c.Default.getInternal().ui().NodeUI,jn={_47O:function(m){var T=this,I=jn.getBackups()._47O;Fj.inEdit(T.gv)||I.call(T,m)},getSelectWidth:function(){var $=this,d=$.gv,J=$._data;if(d.isEditable(J)&&Fj.inEdit(d))return 0;var I=jn.getBackup("getSelectWidth");return I.call($)}};Fj.Inject.registAsModule(jn,xk);var yc=c.graph.GraphView,Rh={_editPointSize:function(){var k=c.Default.isTouchable,i=Fj.getStyle("pointSize");return i[k?0:1]}(),isPointEditable:function(N){var c=this;if(Fj.inEdit(c))return c._pointEditableFunc?c._pointEditableFunc(N):!0;var r=Rh.getBackup("isPointEditable");r.call(c,N)},isEditable:function($){var J,u=this,Y=Rh.getBackup("isEditable");if(J=$ instanceof Fj.Group?!0:Y.call(u,$),!Fj.inEdit(u))return J;if(!($ instanceof c.Edge))return J;if(!$.s("2d.editable"))return!1;var k=u.getEditableFunc();return k?k($):!0},_42:function(F,m){var c=this,A=Rh.getBackups()._42;if(A.call(c,F,m),Fj.inEdit(c)){var p=c.getEditInteractor();p.drawImpl()}}};Fj.Inject.registAsModule(Rh,yc);var Xk=c.Default.getInternal().ui().ShapeUI,dm={_47O:function(g){var I=this,j=dm.getBackups()._47O;Fj.inEdit(I.gv)||j.call(I,g)}};Fj.Inject.registAsModule(dm,Xk);var Fc=c.graph.DefaultInteractor,Gm={handle_mousewheel:function(U){var E=this,a=Gm.getBackup("handle_mousewheel");Fj.inEdit(E.gv)||a.call(E,U)}};Fj.Inject.registAsModule(Gm,Fc);var Jn=c.graph.MoveInteractor,wo={_calcShift:function(b,o){var $=this,Q=wo.getBackup("_calcShift"),V=$.gv;if(!Fj.inEdit(V))return Q.call($,b,o);var H=V.getEditInteractor(),J=H.getSubModule("Move").calcShift(b,o,$);return J||Q.call($,b,o)},clear:function(B){var o=this,N=wo.getBackup("clear");N.call(o,B);var T=o.gv;if(Fj.inEdit(T)){var R=T.getEditInteractor();R.getSubModule("Move").clear(B)
- }}};Fj.Inject.registAsModule(wo,Jn);var Zi=Fj.Rect=function(R){this.catalog="Rect",this._interactor=R};Zi.prototype={},Zi.prototype.constructor=Zi,Zi.prototype.gatherInfo=function(I,E){var z=this;if(1===E.length){var C=E[0];return C instanceof c.Shape&&C._70I()?z.gatherLine(I,C):Ge(C,I)?!1:z.gatherSingleTarget(I,C)}return E.length>1?z.gatherMultiTargets(I,E):!1},Zi.prototype.gatherSingleTarget=function(Z,c){if(c.getCorners){var w,A=this,l=A.info;A.target=c,w=A.screenInfo={};var Y=c.getCorners();l.LT=new Fj.Math.Vector2(Y[0]),l.LB=new Fj.Math.Vector2(Y[1]),l.RB=new Fj.Math.Vector2(Y[2]),l.RT=new Fj.Math.Vector2(Y[3]),l.T=l.LT.clone().add(l.RT).divideScalar(2),l.B=l.LB.clone().add(l.RB).divideScalar(2),l.L=l.LT.clone().add(l.LB).divideScalar(2),l.R=l.RT.clone().add(l.RB).divideScalar(2);for(var K in l)w[K]=Fj.toScreenPosition(Z,l[K]);var I=A._interactor,e=I.getStyle("checkSize"),X=function(h,m,d){var t=m.clone().sub(h).setLength(-e),Z=d.clone().sub(h).setLength(-e),Q=t.add(Z).add(h);return Q};return w.rotLT=X(w.LT,w.RT,w.LB),w.rotLB=X(w.LB,w.LT,w.RB),w.rotRB=X(w.RB,w.LB,w.RT),w.rotRT=X(w.RT,w.LT,w.RB),w.rotT=w.rotLT.clone().add(w.rotRT).divideScalar(2),w.rotB=w.rotLB.clone().add(w.rotRB).divideScalar(2),w.rotL=w.rotLT.clone().add(w.rotLB).divideScalar(2),w.rotR=w.rotRT.clone().add(w.rotRB).divideScalar(2),w.rotation=c.getRotation(),A.gatherConnectInfo(),!0}},Zi.prototype.gatherConnectInfo=function(){var v=this,F=v.target,N=v._interactor,$=v.screenInfo,x=N.gv;if(F instanceof c.Node&&N.getStyle("connectGuideVisible")){var o=F.s("connectGuideShift")||N.getStyle("connectGuideShift"),m=F.getAnchor(),k=F.getSize(),I=F.toGlobal({x:k.width*(o[0]-m.x),y:k.height*(o[1]-m.y)});I=Fj.toScreenPosition(x,I),$.P1?I.add($.P2.clone().sub($.P1).setLength(o[2])):(I.add($.RT.clone().sub($.LT).setLength(o[2])),I.add($.LB.clone().sub($.LT).setLength(o[3]))),$.connect=I}},Zi.prototype.gatherMultiTargets=function(W,B){var c=Fj.Group.findOrCreateGroup(B);if(!c)return!1;var D=this;return D.editing&&"rotate"!==D.editing.mode||c.calcInfo(),D.gatherSingleTarget(W,c)},Zi.prototype.gatherLine=function(B,y){this.target=y;var U=this.screenInfo={},T=y.getPoints(),H=Fj.getDataMatrix(y);return U.P1=Fj.toScreenPosition(B,H.apply(T.get(0))),U.P2=Fj.toScreenPosition(B,H.apply(T.get(1))),this.gatherConnectInfo(),!0},Zi.ResizeKeys=["LT","RB","LB","RT","L","R","B","T"],Zi.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}],Zi.RotateKeys=["rotLT","rotRB","rotLB","rotRT","rotL","rotR","rotB","rotT"],Zi.prototype.check=function(q,P,C){if(c.Default.isLeftButton(P)){var t=this;if(t.editing=null,t.tipInfo=null,t.screenInfo){var S=t.target,l=q.isEditable(S),a=t.screenInfo;if(l&&a.connect){var L=t._checkConnect(C);if(L)return L}if(a.P1)return t._checkLine(C);var n,O,r,f=null,E=t._interactor,w=E.getStyle("checkSize");if(l&&q.isRectEditable(S))for(O=0;O<Fj.Rect.ResizeKeys.length;O++)if(r=Fj.Rect.ResizeKeys[O],Fj.checkHit(C,a[r],w)){f=r,n="resize";break}if(!f&&l&&q.isRotationEditable(S)){var x=E.getStyle("rotateCheckSize");for(O=0;O<Fj.Rect.RotateKeys.length;O++)if(r=Fj.Rect.RotateKeys[O],Fj.checkHit(C,a[r],x)){f=r,n="rotate";break}}if(!f)return E.setCursor("default"),void 0;if("rotate"===n){var J,H=q.lp(P);if(S instanceof Fj.Group){var B=E.getStyle("groupRotateModeKey");"string"==typeof B&&(B=[B]);for(var v=!1,K=0,Y=B.length;Y>K;K++)if(P[B[K]]){v=!0;break}var W=E.getStyle("groupRotateModeDefault");J=v?"batch"===W?"block":"batch":W}var $="batch"===J?S.getAnchor2():S.getPosition(),U=Math.atan2(H.y-$.y,H.x-$.x);E._setRotateCursor(U),t.editing={mode:n,key:f,pos:$,flipY:S.getScale().y<0,rotation:S.getRotation(),hitRot:U},J&&(t.editing.groupRotateMode=J)}else{var G=Fj.Rect.ResizeKeys.indexOf(f),_=Fj.Rect.ResizeDirection[G],e=Math.cos(S.getRotation()),i=Math.sin(S.getRotation()),V=_.x*Math.sign(S.getScale().x),X=_.y*Math.sign(S.getScale().y),A=Math.atan2(-i*V-e*X,e*V-i*X),N=(Math.round(A/(Math.PI/4))+8)%8,M=["ew-resize","nesw-resize","ns-resize","nwse-resize","ew-resize","nesw-resize","ns-resize","nwse-resize"][N];this._interactor.setCursor(M);var p=S.getWidth(),I=S.getHeight(),R=S.getAnchor();t.editing={mode:n,key:f,rect:{x:-p*R.x,y:-I*R.y,width:p,height:I},anchor:R,matrix:S.getMatrix()}}return f}}},Zi.prototype._checkLine=function(U){var g=this;g.screenInfo;var Q,p=g._interactor.getStyle("checkSize");if(Fj.checkHit(U,g.screenInfo.P1,p))Q="P1";else{if(!Fj.checkHit(U,g.screenInfo.P2,p))return this._interactor.setCursor("default"),void 0;Q="P2"}return g.editing={mode:"line",key:Q},Q},Zi.prototype._checkConnect=function(U){var s=this,z=s.screenInfo,p=s._interactor,h=p.getStyle("connectGuideIntersectSize"),c=z.connect,D=U.x,S=c.x;if(S>D&&h>S-D&&Math.abs(c.y-U.y)<h||D>=S&&Fj.checkHit(U,c,h)){var K="connect",V=M.getConnectAction(p.gv);return s.editing={mode:K},V&&V.delete&&V.delete.visible.call(null,p.gv,s.target)&&(s.editing.hasDeleteAction=!0),p.setCursor("default"),K}},Zi.prototype._fireEditEvent=function(C,q){var U=this._interactor,o=this.editing;if(o){var $=o.mode;$="rotate"===$?"Rotation":"connect"===$?"Connection":$[0].toUpperCase()+$.slice(1),U.fi({kind:C+"Edit"+$,event:q})}},Zi.prototype.startEdit=function(o,q){o.startDragging(q);var M=this;M._interactor.fi({kind:"prepareEdit",event:q});var w=M.editing,m=M.target;if(w){if(M._fireEditEvent("begin",q),"rotate"===w.mode)return w.groupRotateMode&&m.beginRotate(w),void 0;if("connect"!==w.mode)("line"===w.mode||m&&0===m.getRotation())&&(M._inSmartGuide=!0,M._interactor.rectGuide.gatherRects());else if(w.hasDeleteAction){var T=o.gv,h=M._interactor.getStyle("connectGuideGarbageShift");w.garbageInfo={x:T.getWidth()*h[0]+h[2],y:T.getHeight()*h[1]+h[3],size:M._interactor.getStyle("connectGuideGarbageIntersectsize")},o._42()}}},Zi.prototype._46O=function(A){var T,F=this,S=F.editing;if(S){if("connect"===S.mode&&!S.canceled&&!S.deleted)try{S.garbageInfo&&S.garbageInfo.hover?M.doDeleteConnectionAction(F._interactor.gv,F.target):M.doConnectAction(F._interactor.gv,F.target,S.target)}catch(H){console.error(H)}T=F.editing.groupRotateMode,F._fireEditEvent("end",A),F.editing=null}F.tipInfo=null,F._inSmartGuide&&(F._interactor.rectGuide.clear(),F._inSmartGuide=!1),T&&F.target&&F.target.endRotate()},Zi.prototype.handleNormalStateDelete=function(){var $=this,s=$.editing;if(s&&"connect"===s.mode&&!s.canceled&&!s.deleted){if(s.garbageInfo){try{M.doDeleteConnectionAction($._interactor.gv,$.target)}catch(z){console.error(z)}s.garbageInfo=null}return s.cursorPos=null,s.targetCorners=null,s.deleted=!0,$._interactor._42(),!0}},Zi.prototype.handleNormalStateKeyDown=function(f){var K=this,o=K.editing;return!o||"connect"!==o.mode||o.canceled||o.deleted?void 0:c.Default.isEsc(f)?(o.cursorPos=null,o.targetCorners=null,o.canceled=!0,K._interactor._42(),!0):void 0},Zi.prototype.handleEdit=function(z,I){var v=this,$=v.editing;if($){var u,B,p,X,r,J=v.target,H=$.key,s=$.mode,S=z.lp(I),T=v._interactor;if("connect"===s){if($.canceled)return;if($.deleted)return;$.cursorPos=T._getLogicalPoint(I);var V=$.garbageInfo;return V&&Fj.checkHit($.cursorPos,V,V.size)?(V.hover=!0,$.target=null,$.targetCorners=null):(V&&(V.hover=!1),$.target=z.getDataAt(S,function(F){return z.isSelectable(F)?Cj(F)?!0:!1:!1})||null,$.targetCorners=Fj.getTargetCornersOnScreen(z,$.target)),T._42(),void 0}if("rotate"===s){var _,C,W=$.pos,l=Math.atan2(S.y-W.y,S.x-W.x);if($.groupRotateMode?C=l-$.hitRot:(_=l-$.hitRot,C=$.rotation+_),C%=2*Math.PI,0>C&&(C+=2*Math.PI),!c.Default.isCtrlDown(I)){var Y,e;Mc(I)?(Y=T.getStyle("shiftRotateRound"),e=Y/2):(Y=T.getStyle("rotateRound"),e=T.getStyle("rotateSensitivity")),C=Fj.roundTo(C,Y,e)}$.groupRotateMode?(_=C-($.lastRotation||0),0!==_&&(J.addRotation(_,$.groupRotateMode),$.lastRotation=C)):J.setRotation(C),T._setRotateCursor(l),C>Math.PI&&(C-=2*Math.PI);var N=180*(C/Math.PI);N=N.toFixed(2),u=""+N+"°"}else if("resize"===s){var t=$.rect;p=t.x,X=t.y;var U,P=t.width,Q=t.height,x=$.anchor,h=$.matrix,g=Mc(I),K=v._unionPointMode1,w=v._unionPointMode2;if(v._inSmartGuide&&!c.Default.isCtrlDown(I)&&!g){var A;"L"===H||"R"===H?A="x":("T"===H||"B"===H)&&(A="y"),v._adsorbedToClosest(S,A),r=!0}U=h.tfi(S);var R;"LT"===H?(t=K(U,{x:p+P,y:X+Q},P,Q,g),R=9):"T"===H?(t=w({x:p,y:U.y},{x:p+P,y:X+Q},P,Q,g,"v"),R=1):"RT"===H?(t=K(U,{x:p,y:X+Q},P,Q,g),R=33):"L"===H?(t=w({x:U.x,y:X},{x:p+P,y:X+Q},P,Q,g,"h"),R=8):"R"===H?(t=w({x:p,y:X},{x:U.x,y:X+Q},P,Q,g,"h"),R=32):"LB"===H?(t=K(U,{x:p+P,y:X},P,Q,g),R=12):"B"===H?(t=w({x:p,y:X},{x:p+P,y:U.y},P,Q,g,"v"),R=4):"RB"===H&&(t=K(U,{x:p,y:X},P,Q,g),R=36);var F=h.tf(t.x+t.width*x.x,t.y+t.height*x.y);J.setPosition(F),J.setSize(t.width,t.height),r&&(B=J.getRect(),T.rectGuide.gatherLines({node:J,x:B.x,y:B.y,w:B.width,h:B.height},A,R)),u=""+Math.round(t.width)+" * "+Math.round(t.height)}else if("line"===s){if(Mc(I)){var a=J.getPoints(),Z="P1"===H?a.get(1):a.get(0),O={x:S.x-Z.x,y:S.y-Z.y},d=T.getStyle("shiftLineRotateRound"),m=v._shiftDirList;if(!m||v._shiftRotateRound!==d){v._shiftRotateRound=d,v._shiftDirList=m=[];for(var f=0;f<Math.PI;f+=d)m.push({x:b(f),y:o(f)})}for(var j,q=0,n=0,k=m.length;k>n;n++){var E=m[n],D=E.x*O.x+E.y*O.y;Math.abs(D)>Math.abs(q)&&(q=D,j=E)}S={x:Z.x+j.x*q,y:Z.y+j.y*q},T.rectGuide.clear()}else v._inSmartGuide&&!c.Default.isCtrlDown(I)&&(v._adsorbedToClosest(S),r=!0);var G=Fj.getDataMatrix(J).applyInverse(S);J.setPoint("P1"===H?0:1,G,!0);var L=J.getPoints(),y=L.get(0),M=L.get(1);p=y.x-M.x,X=y.y-M.y,u=" "+Math.round(Math.sqrt(p*p+X*X))+" ",r&&(B=J.getRect(),T.rectGuide.gatherLines({node:J,x:B.x,y:B.y,w:B.width,h:B.height}))}if(u){var i=c.Default.getLogicalPoint(I,T._canvas);i.x+=Fj.Icons.TipShiftX,i.y+=Fj.Icons.TipShiftY,v.tipInfo={helperPos:i,text:u,size:u.length}}v._fireEditEvent("between",I)}},Zi.prototype._unionPointMode1=function(M,n,P,v,H){if(H&&P&&v){var E=M.x-n.x,X=M.y-n.y;Math.abs(E*v)<Math.abs(X*P)?(X=Math.sign(X)*Math.abs(E*v/P),M.y=n.y+X):(E=Math.sign(E)*Math.abs(X*P/v),M.x=n.x+E)}return c.Default.unionPoint(M,n)},Zi.prototype._unionPointMode2=function(X,p,D,m,E,l){var Y=c.Default.unionPoint(X,p);if(E&&D&&m){var u;"v"===l?(u=Y.x+Y.width/2,Y.width=D*Y.height/m,Y.x=u-Y.width/2):(u=Y.y+Y.height/2,Y.height=m*Y.width/D,Y.y=u-Y.height/2)}return Y},Zi.prototype._adsorbedToClosest=function(v,l){var T=this,G=T._interactor,I=G.rectGuide.findClosest(v,l),j=G.gridGuide.findClosest(v,l),w=1/0,P=1/0;I&&(isFinite(I.x)&&(w=I.x),isFinite(I.y)&&(P=I.y)),j&&(isFinite(j.x)&&Math.abs(j.x)<Math.abs(w)&&(w=j.x),isFinite(j.y)&&Math.abs(j.y)<Math.abs(P)&&(P=j.y)),isFinite(w)&&(v.x+=w),isFinite(P)&&(v.y+=P)},Zi.prototype._42=function(_,G,K){var Z=this;Z.info={},Z.screenInfo=null;var s=Z._interactor;if(!s.editDetail&&Z.gatherInfo(G,K)){var S=Z.editing,a=S?S.groupRotateMode:null,H=Z.screenInfo;"block"!==a&&(H.P1?Fj.Icons.DrawIcon(s,_,Fj.Icons.Line,H):Fj.Icons.DrawIcon(s,_,Fj.Icons.Rect,H),H.connect&&(Fj.Icons.DrawIcon(s,_,Fj.Icons.ConnectGuide,{rotation:H.rotation,connect:H.connect,cursorPos:S?S.cursorPos:null}),S&&(S.targetCorners&&Fj.Icons.DrawIcon(s,_,Fj.Icons.NodeHoverGuide,S.targetCorners),S.garbageInfo&&Fj.Icons.DrawIcon(s,_,Fj.Icons.ConnectGuideGarbage,S.garbageInfo))),Z.tipInfo&&Fj.Icons.DrawIcon(s,_,Fj.Icons.TipHelper,Z.tipInfo)),Z.target instanceof Fj.Group&&Z.target._42(s,_,G)}};var qf=Fj.Anchor=function(p){this.catalog="Anchor",this._interactor=p};qf.prototype={},qf.prototype.constructor=qf,qf.prototype.gatherInfo=function(P,T){var v=this;if(1===T.length){var K=T[0];if(!K.getAnchor)return;if(K instanceof c.Shape&&K._70I())return;if(Ge(K,P))return;return v.gatherSingleTarget(P,T[0])}return T.length>1?v.gatherMultiTargets(P,T):!1},qf.prototype.gatherSingleTarget=function(O,o){var h=this;return h.info.POS=o.getPosition(),h.screenInfo.POS=Fj.toScreenPosition(O,h.info.POS),h.target=o,!0},qf.prototype.gatherMultiTargets=function(B,e){var I=this,g=Fj.Group.findOrCreateGroup(e);return g?(I.screenInfo.POS=Fj.toScreenPosition(B,g.getAnchor2()),I.target=g,!0):!1},qf.prototype.isVisible=function(){var G=this,i=G._interactor;if(i.getStyle("anchorVisible")===!1)return!1;var T=G.target;if(T){if(this.editing)return!0;var h=T.getAnchor(),d=i.getStyle("anchorOutsideVisibleThreshold");if(h.x<-d||h.x>1+d||h.y<-d||h.y>1+d)return!0;var A=T.getSize(),f=T.getScale(),v=Math.min(Math.abs(A.width*f.x),Math.abs(A.height*f.y));if(v*i.gv._zoom<i.getStyle("anchorHideThreshold"))return!1}return!0},qf.prototype.check=function(n,h,y){if(c.Default.isLeftButton(h)){var D=this,R=D._interactor;if(D.isVisible()&&R.getStyle("anchorMovable")!==!1){D.editing=null,D.tipInfo=null;var A=D.target;if(A&&n.isAnchorEditable(A)&&n.isEditable(A)){var S;if(D.screenInfo&&(S=D.screenInfo.POS)&&Fj.checkHit(y,new Fj.Math.Vector2(S),R.getStyle("checkSize"))){if(A instanceof Fj.Group)return D.editing={},!0;var s=A.getWidth(),P=A.getHeight(),W=A.getAnchor();return D.editing={rect:{x:-s*W.x,y:-P*W.y,width:s,height:P},anchor:W,matrix:A.getMatrix()},!0}}}}},qf.prototype.startEdit=function(H,h){H.startDragging(h),H.fi({kind:"beginEditAnchor",event:h})},qf.prototype._46O=function(Q){var s=this;s.editing&&(s.editing=null,s._interactor.fi({kind:"endEditAnchor",event:Q})),s.tipInfo=null},qf.prototype.handleEdit=function(t,v){var U=this,s=U.target;if(s){var S=U.editing;if(S){var g=t.lp(v),k=U._interactor;if(s instanceof Fj.Group)return s.setAnchor2(g),k._42(),void 0;var o=S.matrix,B=o.tfi(g),h=S.rect,Z=(B.x-h.x)/h.width,e=(B.y-h.y)/h.height;if(!c.Default.isCtrlDown(v)){var y=k.getStyle("anchorRound"),K=k.getStyle("anchorSensitivity");Z=Fj.roundTo(Z,y,K),e=Fj.roundTo(e,y,K)}s.setAnchor(Z,e,!0);var A=c.Default.getLogicalPoint(v,k._canvas);A.x+=Fj.Icons.TipShiftX,A.y+=Fj.Icons.TipShiftY;var i=""+Z.toFixed(2)+", "+e.toFixed(2);U.tipInfo={helperPos:A,text:i,size:i.length},k.fi({kind:"betweenEditAnchor",event:v})}}},qf.prototype._42=function(v,a,U){var f=this;f.info={},f.screenInfo={};var X=f._interactor;X.editDetail||f.gatherInfo(a,U)&&f.isVisible()&&(Fj.Icons.DrawIcon(X,v,Fj.Icons.Anchor,f.screenInfo),f.tipInfo&&Fj.Icons.DrawIcon(X,v,Fj.Icons.TipHelper,f.tipInfo))};var Hc=Fj.Curve=function(z){this.catalog="Curve",this._interactor=z};Hc.prototype={},Hc.prototype.constructor=Hc,R.defineProperties(Hc.prototype,{activing:{get:function(){return this._activing},set:function(J){var E=this;if(J)E._activing=new Fj.CurveActiving(this,J);else{var _=E._activing;_&&_.dispose(),E._activing=null}}}}),Hc.PointType={Mirrored:0,Straight:1,Disconnected:2,Asymmetric:3},Hc.prototype.setUp=function(){var m=this,E=m._interactor;E&&E.gv.mp(m._onGraphviewPropertyChanged,m)},Hc.prototype._onGraphviewPropertyChanged=function(w){("zoom"===w.property||"translateX"===w.property||"translateY"===w.property)&&this._handleDataChanged()},Hc.prototype.tearDown=function(){var O=this,K=O._interactor;K&&K.gv.ump(O._onGraphviewPropertyChanged,O)},Hc.prototype.canEnterEditDetailMode=function(){var P=this,S=P._interactor,C=S._getValidSelection();if(1===C.length){var k=C[0],q=k instanceof c.Edge;if(k instanceof c.Shape||q){if(q){var Z=k.s("edge.type");if(Z&&"points"!==Z)return}var G=S.gv;if(G.isPointEditable(k)&&G.isEditable(k))return P.target=k,!0}}},Hc.prototype.preHandleScroll=function(){var h=this.editing;return h&&h.inEdit?!0:void 0},Hc.prototype.getCurrentSelectintStatus=function(){var C=this;if(C.activing&&!C.activing.selections){if(C.activing.status!=N)return C.activing.status;var Q=function(P){var T=C.activing.status;C.activing.status=P,C._interactor.fp("shapePointStatus",T,P)},T=Fj.Curve.PointType,U=C.activing.point,d=C.activing.pairs;if(!d||1!==d.length)return Q(T.Mirrored);var n=d[0],c=n.c1&&n.c1.isNearEnough(U),h=n.c2&&n.c2.isNearEnough(U);if(!n.c1||!n.c2)return c||h?Q(T.Straight):Q(T.Disconnected);if(c&&h)return Q(T.Straight);if(c||h)return Q(T.Asymmetric);var R=n.c1.clone().sub(U),k=n.c2.clone().sub(U);return Math.abs(R.x*k.y-R.y*k.x)>1e-5||R.x*k.x>0?Q(T.Disconnected):Math.abs(R.length()-k.length())>1e-5?Q(T.Asymmetric):Q(T.Mirrored)}},Hc.prototype.handle_keydown=function($){var M=this;if(M._interactor.editDetail){var q=Fj.Curve.PointType;"1"===$.key?M._setCurrentSelectionStatus(q.Straight):"2"===$.key?M._setCurrentSelectionStatus(q.Mirrored):"3"===$.key?M._setCurrentSelectionStatus(q.Disconnected):"4"===$.key&&M._setCurrentSelectionStatus(q.Asymmetric)}},Hc.prototype.setCurrentSelectionStatus=function(F){var K=this,I=K._interactor;if(I){var C=I.gv;C.dm().beginTransaction(),this._setCurrentSelectionStatus(F),C.dm().endTransaction()}},Hc.prototype._setCurrentSelectionStatus=function(G){var q=this,X=q.activing;if(X){var y=q.getCurrentSelectintStatus();if(null!==y&&y!==G){X.status=G;var Q=q.activing.point,P=q.activing.pairs;if(P&&1===P.length){var O=P[0],u=q.screenInfo.curve,x=Fj.Curve.PointType,h=function(){q._writeToHt(),q._interactor.fp("shapePointStatus",y,G)};if(G===x.Straight)return u.moveCtrlPoint(O,Q,"c1"),u.moveCtrlPoint(O,Q,"c2"),h(),void 0;if(y===x.Straight){var o=u.findPairs(Q,!0),b=o[0],e=b.r1||Q,B=b.r2||Q,T=B.clone().sub(e).multiplyScalar(.25);return u.moveCtrlPoint(O,Q.clone().sub(T),"c1"),u.moveCtrlPoint(O,Q.clone().add(T),"c2"),h(),void 0}var j=O.c1,k=O.c2;if(j&&k){if(G===x.Mirrored)return u.moveCtrlPoint(O,Q.clone().multiplyScalar(2).sub(k),"c1"),h(),void 0;if(G===x.Asymmetric&&y===x.Disconnected){var F=j.clone().sub(Q).length(),T=Q.clone().sub(k).setLength(F).add(Q);return u.moveCtrlPoint(O,T,"c1"),h(),void 0}}X._firePointChange(),q._interactor.fp("shapePointStatus",y,G)}}}},Hc.prototype._handleDataChanged=function(v){var j=this;if(j.screenInfo&&j.target){var J=j._interactor;j.gatherSingleTarget(J.gv,j.target,!0),j.check(J.gv,null,v?J._getLogicalPoint(v):new Fj.Math.Vector2(J._lastClientPoint)),J._42()}},Hc.prototype.gatherSingleTarget=function($,E,q){var h,L,S=this;S.screenInfo&&S.screenInfo.curve&&(L=S.screenInfo.curve._curves);var w=S.editing;h=w?S.screenInfo:S.screenInfo={};var D,r,i=E instanceof c.Edge;i?(D=E.s("edge.segments"),r=E.s("edge.points")||new c.List):(D=E._58O,r=E._59O),h.S=D;var F,z=h.P=[],o=Fj.getDataMatrix(E);if(E instanceof c.Polyline&&(F=E.getElevation()||0,h.E=[]),r.each(function(t){h.E&&h.E.push(t.e||F),t=o.apply(t);var b=Fj.toScreenPosition($,t);z.push(b.x,b.y)}),i){var u=Fj.toScreenPosition($,E._lastSourcePoint),y=Fj.toScreenPosition($,E._lastTargetPoint);z.splice(0,0,u.x,u.y),z.push(y.x,y.y)}if(!h.S||!h.S.size()){h.S=new c.List,h.S.add(1);for(var R=0;R<z.length/2-1;R++)h.S.add(2)}if((!w||q)&&S.convertToCubicBezier(L),S.activing&&(q||!S.editing||"realPoint"===S.editing.type)){var v=h.curve.findPairs(S.activing.point);S.activing.pairs=v}i&&"points"!==E.s("edge.type")&&S._writeToHt()},Hc.prototype._convertToNewPoint=function(w,v,B){var D,$,Z;for(D=0,$=v.length;$>D;D++){if(Z=v[D],Z._p1.isNearEnough(w))return Z._p1;if(Z._p4.isNearEnough(w))return Z._p4}if(B)for(D=0,$=Math.min(B.length,$);$>D;D++){if(Z=B[D],Z._p1===w)return v[D]._p1;if(Z._p4===w)return v[D]._p4}},Hc.prototype.convertToCubicBezier=function(o){var S,q,w=this,c=new Fj.Math.Curve,B=w.screenInfo;if(c.createFromHtShape(B.P,B.S,B.E),B.curve=c,w.activing){var O=c._curves;if(S=w.activing.point,q=w._convertToNewPoint(S,O,o),q&&(w.activing.point=q),w.activing.selections){var u=-1,H=w.activing.selections;H.forEach(function(Q){u++,q=w._convertToNewPoint(Q,O,o),q&&(H[u]=q)})}}},Hc.prototype.check=function(m,l,p){if(!l||c.Default.isLeftButton(l)){var e=this;if(e._interactor.setCursor("default"),e.editing=null,e.highlight=null,e.tipInfo=null,e.screenInfo){if(Nd())return e._interactor._42(),!0;if(e._checkEditCtrlPoint(p))return e._interactor._42(),!0;if(e._checkEditRealPoint(p))return e._interactor._42(),!0;if(e._checkEditElevation(p))return e._interactor._42(),!0;var n=e.screenInfo.curve,A=n.checkPoint(p,e._interactor.getStyle("curveIntersectSize"));if(A){var i=e.highlight={};i.type="insertKnot",i.bezier=A.bezier,i.point=A.intersection}return e._interactor._42(),!0}}},Hc.prototype._checkEditRealPoint=function(H){var b,t,y,R,n,w,U=this,D=U.screenInfo.curve._curves,V=U._interactor.getStyle("curvePointIntersectSize"),I=1/0;for(V*=V,y=0,R=D.length;R>y;y++)b=D[y],n=b._p1,w=H.distanceToSquared(n),I>w&&(I=w,t=n),n=b._p4,w=H.distanceToSquared(n),I>w&&(I=w,t=n);if(I>V)return!1;var Z=U.highlight={};return Z.type="changeRealPoint",Z.point=t,U.editing={type:"realPoint",point:t,shiftGuide:{point:t.clone(),dir:"x",limit:0}},U._interactor.setCursor("crosshair"),!0},Hc.prototype._checkEditElevation=function(j){var K=this;if(!K._interactor.getStyle("curveElevationVisible"))return!1;var t=K.activing;if(!t)return!1;var n=t.getCurrentEditingPoint();if(!n)return!1;var $=K._interactor,b=$.getStyle("curveElevationGuideShift"),U=$.getStyle("curveElevationIntersectSize"),O=j.distanceToSquared({x:n.x+b[0],y:n.y+b[1]});if(!(O>U*U)){var o=K.highlight={};o.type="elevation";var I=new Fj.Math.Vector2(j.x,j.y,n.e);return K.editing={type:"elevation",startPoint:I},K._interactor.setCursor("crosshair"),!0}},Hc.prototype._checkEditCtrlPoint=function(B){var p=this;if(p.activing&&!p.activing.selections){var c=p.getCurrentSelectintStatus();if(c!==Fj.Curve.PointType.Straight){var Y=p.activing.pairs;if(Y){var Q=p._interactor.getStyle("curvePointIntersectSize");Q*=Q;var L,y,r,n,z,P,e,S,U,O=1/0;for(e=0,U=Y.length;U>e;e++)for(n=Y[e],S=0;2>S;S++)z=0===S?"c1":"c2",n[z]&&(P=B.distanceToSquared(n[z]),O>P&&(O=P,L=n,y=e,r=z));if(O>Q)return!1;p.activing.hlpair=L,p.activing.hltype=r;var X=p.highlight={};return X.type="changeCtrlPoint",X.point=L[r],p.editing={type:"ctrlPoint",pair:L,pairId:y,ctrlType:r,direction:L[r].clone().sub(p.activing.point).normalize()},p._interactor.setCursor("crosshair"),!0}}}},Hc.prototype.startEdit=function(V,S){V.startDragging(S);var o=this;o.highlight&&"insertKnot"===o.highlight.type&&(o.insertKnot(),o.gatherSingleTarget(o._interactor.gv,o.target),o.activing=null,o._checkEditRealPoint(o._interactor._getLogicalPoint(S)));var J=o._activing;if(J){var h=o.editing?o.editing.type:null;"ctrlPoint"===h?J.editingCtrl={pairId:o.editing.pairId,type:J.hltype}:"realPoint"===h&&(J.editingCtrl=!1)}var M=o.highlight,$=c.Default.isCtrlDown(S);if(!M||Nd()){var H=o._interactor.gv;if(!H.setFocus(S)||H._scrolling)return;return H.isPannable()&&ki(S)&&!$&&(o._pan={tx:H.tx(),ty:H.ty()},V.fi({kind:"beginPan",event:S})),void 0}if("changeRealPoint"===M.type){var T,R=o.activing?o.activing.point:null,G=o.activing?o.activing.selections:null;if($&&o.activing)R===M.point?(G?(o.activing={point:G[0]},G.length>1&&(G.splice(0,1),o.activing.selections=G)):o.activing=null,o.editing=null):G&&(T=G.indexOf(M.point))>=0?(G.length>1?G.splice(T,1):delete o.activing.selections,o.editing=null):G?(G.push(R),o.activing={point:M.point,selections:G}):o.activing={point:M.point,selections:[R]};else if(G)R===M.point||((T=G.indexOf(M.point))>=0?(G.splice(T,1,R),o.activing={point:M.point,selections:G}):o.activing={point:M.point});else{var L;R===M.point&&(L=o.activing.status),o.activing={point:M.point},L&&(o.activing.status=L)}V.fi({kind:"beginEditPoint",event:S})}},Hc.prototype.insertKnot=function(){var C=this,G=C.highlight,w=C.screenInfo.curve;w.insertKnot(G.bezier,G.point.t),C._writeToHt()},Hc.prototype._writeToHt=function(){var U,j,A,V,q=this,B=q.screenInfo.curve,s=B.toHtShape(),J=s.points,d=[],Z=s.segments,l=q._interactor.gv,I=q.target,$=I instanceof c.Edge,E=Fj.getDataMatrix(I).invert();V=I instanceof c.Polyline,V&&(A=I.getElevation());for(var Q=0,M=J.length;M>Q;Q++)U=J[Q],j=Fj.toWorldPosition(l,U),j=E.apply(j),U.e!=N&&U.e!==A&&(j.e=U.e),d.push(j);if(I._writing=!0,$){I.s("edge.type","points"),I.setStyle("edge.segments",Z),I.setStyle("edge.points",d.slice(1,d.length-1)),I.setStyle("edge.source.offset.x",0),I.setStyle("edge.source.offset.y",0),I.setStyle("edge.target.offset.x",0),I.setStyle("edge.target.offset.y",0);var O=q._nextChangeEdgeHost;delete q._nextChangeEdgeHost,O&&("source"===O.type?I.setSource(O.host):I.setTarget(O.host)),q._writeEdgeHostAnchor("source",d[0]),q._writeEdgeHostAnchor("target",d[d.length-1])}else d.length?(I.setSegments(Z),I.setPoints(d,!0)):I.removeFromDataModel();delete I._writing},Hc.prototype._writeEdgeHostAnchor=function(X,U){var x=this,T=x.target,b=x._calcHostAnchor(T,X,U);T.s("edge."+X+".anchor.x",b.x),T.s("edge."+X+".anchor.y",b.y)},Hc.prototype._calcHostAnchor=function(t,w,g,T){T||(T="source"===w?t.getSource():t.getTarget());var L=T.getRotation(),$=T.getAnchor(),V=this._interactor.gv;if(Ge(T,V)&&(L=0),L){var H=T.getMatrix(),D=H.tfi(g),M=T.getSize();return{x:D.x/M.width+$.x,y:D.y/M.height+$.y}}var p=Lg(V,T),o={x:(g.x-p.x)/p.width,y:(g.y-p.y)/p.height};return o},Hc.prototype._handlePanning=function(B){var U=this,S=U._pan;if(S){S.started=!0;var k=U._interactor,u=k.gv,L=k._lastClientPoint,I=Ak(B);u.setTranslate(S.tx+I.x-L.x,S.ty+I.y-L.y),U.gatherSingleTarget(k.gv,U.target),k._42(),k.fi({kind:"betweenPan",event:B})}},Hc.prototype.handleEdit=function(J,e){var b=this,a=b.editing;if(b._pan)return b._handlePanning(e),void 0;if(a){a.inEdit=!0;var F,t,Q,d=b._interactor._getLogicalPoint(e),w=c.Default.isCtrlDown(e),g=c.Default.isShiftDown(e),Z=a.type,I=b.activing;if(b._guideInfo=null,"ctrlPoint"===Z&&g){var i=b.editing.direction.clone();F=I.point;var h=i.dot(d.clone().sub(F));d=i.setLength(h).add(F)}else if("ctrlPoint"===Z||"realPoint"===Z){var i;if("realPoint"===Z&&g){var k=b.editing.shiftGuide;t=k.point;var M=Math.abs(d.x-t.x),j=Math.abs(d.y-t.y);M>j&&M>k.limit&&"y"===k.dir&&(k.dir="x"),j>M&&j>k.limit&&"x"===k.dir&&(k.dir="y"),i=k.dir,"x"===i?(d.y=t.y,k.limit=Math.max(k.limit,M)):"y"===i&&(d.x=t.x,k.limit=Math.max(k.limit,j))}var B=b._isEditEdgeSourceTarget();if(B){var s=b._editEdgeSourceTarget(B,d,w);s&&(Q=s.tipText)}else if(!w){var W=b._guidingToEdit(d,i),T="realPoint"===Z?b._interactor.gridGuide.findClosest(d,i,!0):null,C=1/0,n=1/0;T&&(T.x&&(C=T.x),T.y&&(n=T.y));var R=!1;W&&(W.xList&&(Math.abs(W.x)<=Math.abs(C)?(R=!0,C=W.x):delete W.xList),W.yList&&(Math.abs(W.y)<=Math.abs(n)?(R=!0,n=W.y):delete W.yList),R&&(b._guideInfo=W)),isFinite(C)&&(d.x+=C),isFinite(n)&&(d.y+=n),R&&(W.v=d)}}var S=b.screenInfo.curve;if("realPoint"===a.type){F=a.point,F.e!==N&&(d.e=F.e),S.moveRealPoint(F,d),a.point=d,b.highlight.point=d;var $=I.status,q=I.selections;if(b.activing={point:d,status:$},q){var m=d.clone().sub(F),U=0;q.forEach(function(y){var B=y.clone().add(m);S.moveRealPoint(y,B),q[U++]=B}),b.activing.selections=q}}else if("ctrlPoint"===a.type){var K=I.pairs,Y=K[a.pairId];S.moveCtrlPoint(Y,d,a.ctrlType);var O=I.status,V=Fj.Curve.PointType;if((O===V.Mirrored||O===V.Asymmetric)&&Y.c1&&Y.c2){var F=new Fj.Math.Vector2(I.point),o="c1"===a.ctrlType?"c2":"c1";if(O===Fj.Curve.PointType.Mirrored)S.moveCtrlPoint(Y,F.clone().multiplyScalar(2).sub(d),o);else if(O===V.Asymmetric){var h=Y[o].clone().sub(F).length(),X=F.clone().sub(Y[a.ctrlType]).setLength(h).add(F);isNaN(X.x)||S.moveCtrlPoint(Y,X,o)}}I._firePointChange()}else if("elevation"===a.type){t=a.startPoint;var x=t.e+(t.y-d.y)/J._zoom;b._setCurrentPointImpl("e",x),I._firePointChange(),Q="E: "+Fj.toFixed(x)}var f=c.Default.getLogicalPoint(e,b._interactor._canvas);if(f.x+=Fj.Icons.TipShiftX,f.y+=Fj.Icons.TipShiftY,!Q){var r=Fj.toWorldPosition(J,d);Q=""+Fj.toFixed(r.x)+", "+Fj.toFixed(r.y)}b.tipInfo={helperPos:f,text:Q,size:Q.length},b._writeToHt(),b._interactor.fi({kind:"betweenEditPoint",event:e})}},Hc.prototype._setCurrentPointImpl=function(A,v){var X=this,z=X._activing;if(!z)return!1;var D=X.target;if(!D)return!1;var B=z.getCurrentEditingPoint();if(!B)return!1;var m=z.editingCtrl;if(!m)var P=B.clone();if("e"===A)B.e=v;else{var a;if("x"===A||"y"===A){var R=z._lastFirePoint;a="x"===A?{x:v,y:R?R.y:0}:{x:R?R.x:0,y:v}}else"object"==typeof A?(a=A,A.e!==N&&(B.e=A.e)):(a={x:arguments[0],y:arguments[1]},arguments[2]!==N&&(B.e=arguments[2]));var M=Fj.getDataMatrix(D);a=Fj.toScreenPosition(X._interactor.gv,M.apply(a)),B.x=a.x,B.y=a.y}if(!m){var Q=P.multiplyScalar(-1).add(B);B.e&&P.e&&(Q.e=B.e-P.e),X.screenInfo.curve.moveCtrlDueToRealPointMovement(B,Q)}return!0},Hc.prototype.setCurrentPoint=function(f,x){return this._setCurrentPointImpl(f,x)?(this._writeToHt(),!0):!1},Hc.prototype._isEditEdgeSourceTarget=function(){var X=this,E=X.target;if(!(E instanceof c.Edge))return!1;var f=X.editing.point,s=X.screenInfo.curve._curves;return f===s[0]._p1?"source":f===s[s.length-1]._p4?"target":!1},Hc.prototype._editEdgeSourceTarget=function(Y,H,T){var u,R=this,B=R.target;if(u="source"===Y?B.getSource():B.getTarget()){var m=R._interactor.gv,z=Fj.toWorldPosition(m,H),e=R._calcHostAnchor(B,Y,z,u);if(!T){var l=R._interactor.getStyle("anchorRound"),a=R._interactor.getStyle("anchorSensitivity");e.x=Fj.roundTo(e.x,l,a),e.y=Fj.roundTo(e.y,l,a)}if(R._interactor.getStyle("edgeHostDetectPerFrame")||e.x<0||e.x>1||e.y<0||e.y>1){var F=m.getDataAt(z,function(V){return m.isSelectable(V)?Cj(V)?!0:!1:!1});if(F){var V=R._calcHostAnchor(B,Y,z,F);u=F,R._nextChangeEdgeHost={type:Y,host:F},e=V,T||(e.x=Fj.roundTo(e.x,l,a),e.y=Fj.roundTo(e.y,l,a))}}if(!T){var y=kr(m,u,0,0,0,e.x,e.y),h=Fj.toScreenPosition(m,y);H.x=h.x,H.y=h.y}return R._edgeHostGuideInfo=Fj.getTargetCornersOnScreen(m,u),{host:u,anchor:e,tipText:""+e.x.toFixed(2)+", "+e.y.toFixed(2)}}},Hc.prototype._guidingToEdit=function(B,t){var p,W,m=this;if(p=m.screenInfo.curve){W=p._curves;var l,P,u,N,D,X,d,k,e=1/0,x=1/0,s=[];for(m.editing&&"realPoint"===m.editing.type&&(k=m.editing.point),D=0,X=2*W.length;X>D;D++)d=W[Math.floor(D/2)][D%2?"_p4":"_p1"],s.indexOf(d)>=0||(s.push(d),k&&k===d||(u=d.x-B.x,N=d.y-B.y,Math.abs(u)<Math.abs(e)?(e=u,l=[d]):u===e&&l.push(d),Math.abs(N)<Math.abs(x)?(x=N,P=[d]):N===x&&P.push(d)));var j=m._interactor.getStyle("smartGuideSensitivity");if((Math.abs(e)>j||"y"===t)&&(l=null),(Math.abs(x)>j||"x"===t)&&(P=null),l||P){var f=!1,I={};if(l&&(f=!0,I.xList=l,I.x=e),P&&(f=!0,I.yList=P,I.y=x),f)return I}}},Hc.prototype._46O=function(O){var $=this;$.editing&&($.editing=null,$._interactor.fi({kind:"endEditPoint",event:O})),$._guideInfo=null,$._edgeHostGuideInfo=null,$._pan&&($._pan=null,$._interactor.fi({kind:"endPan",event:O})),$.tipInfo=null},Hc.prototype._canDeletePoint=function(v,E){var O=this.target;if(!(O instanceof c.Edge))return!0;var Q=v._curves[0],L=v._curves[v._curves.length-1];return Q._p1===E||L._p4===E?!1:!0},Hc.prototype.handleDelete=function(){var D=this;if(D.activing&&D.screenInfo){var t=c.Default.isShiftDown(),j=D.screenInfo.curve;D._canDeletePoint(j,D.activing.point)&&j.deleteRealPoint(D.activing.point,t),D.activing.selections&&D.activing.selections.forEach(function(h){D._canDeletePoint(j,h)&&j.deleteRealPoint(h,t)}),D.activing=null,delete D.editing,delete D.tipInfo,delete D._pan,D._writeToHt(),D._interactor.fp("deleteShapePoint",!1,!0)}},Hc.prototype.handleDoubleClick=function(P){var B=this,f=B._interactor._getLogicalPoint(P);if(B.screenInfo&&B._checkEditRealPoint(f)){var C=B.getCurrentSelectintStatus(),J=Fj.Curve.PointType;return C=C===J.Mirrored?J.Straight:J.Mirrored,B._setCurrentSelectionStatus(C),B._interactor._42(),!0}},Hc.prototype._drawHighlight=function(n){var J=this,w=J.highlight;if(w){var W=w.bezier,M=J._interactor;W&&Fj.Icons.DrawIcon(M,n,Fj.Icons.ShapeHighlightCurve,[W._p1.x,W._p1.y,W._p2.x,W._p2.y,W._p3.x,W._p3.y,W._p4.x,W._p4.y]);var F=w.point;F&&"insertKnot"===w.type&&Fj.Icons.DrawIcon(M,n,Fj.Icons.ShapeHighlighPoint,F)}},Hc.prototype._drawGuide=function(m){var l=this,e=l._guideInfo;if(e){var S,R,D,j,p=e.v;for(S=0;2>S;S++)if(j=0===S?e.xList:e.yList)for(R=0,D=j.length;D>R;R++)Fj.Icons.DrawIcon(l._interactor,m,Fj.Icons.ShapeGuideLine,[p.x,p.y,j[R].x,j[R].y])}},Hc.prototype._drawCurrentPoint=function(D){var E=this;if(E.activing){var A=E.activing,v=E.getCurrentSelectintStatus(),p=E._interactor;if(v!==Fj.Curve.PointType.Straight){var I=A.pairs;A.hlpair,A.hltype;var f=A.selections,o=A.editingCtrl;if(I&&!f){var J,N,Z;for(N=0,Z=I.length;Z>N;N++)J=I[N],o&&N===o.pairId&&J[o.type]?Fj.Icons.DrawIcon(p,D,Fj.Icons.ShapeActivingCtrl,{point:J.point,c1:J.c1,c2:J.c2,hl:o.type}):Fj.Icons.DrawIcon(p,D,Fj.Icons.ShapeActivingCtrl,J)}}Fj.Icons.DrawIcon(p,D,Fj.Icons.ShapeHighlighRealPoint,E.activing.point),f&&f.forEach(function(J){Fj.Icons.DrawIcon(p,D,Fj.Icons.ShapeHighlighRealPoint,J)})}},Hc.prototype.clear=function(){var T=this;T.editing=null,T._guideInfo=null,T.activing=null,T.highlight=null
- },Hc.prototype._42=function(s){var $=this;$.info={},$.editing||($.screenInfo=null);var i=$._interactor;if(!i.editDetail)return $.clear(),void 0;if(!$.target||!$._interactor.gv.isSelected($.target)||!$._interactor.gv.isVisible($.target))return i.editDetail=!1,$.clear(),void 0;if($.gatherSingleTarget(i.gv,$.target),Fj.Icons.DrawIcon(i,s,Fj.Icons.ShapeBgCurve,$.screenInfo),$._drawHighlight(s),$._drawCurrentPoint(s),$._getRealPoint().forEach(function(K){Fj.Icons.DrawIcon(i,s,Fj.Icons.ShapePoint,K)}),$._drawGuide(s),$.tipInfo&&Fj.Icons.DrawIcon(i,s,Fj.Icons.TipHelper,$.tipInfo),$._edgeHostGuideInfo&&Fj.Icons.DrawIcon(i,s,Fj.Icons.NodeHoverGuide,$._edgeHostGuideInfo),$._interactor.getStyle("curveElevationVisible")&&$.target instanceof c.Polyline&&$.activing){var J=$.activing.getCurrentEditingPoint();J&&Fj.Icons.DrawIcon(i,s,Fj.Icons.EdgeElevationGuide,J)}},Hc.prototype._getRealPoint=function(){var q=this.screenInfo,s=q.P,d=q.S,D=-1,J=[];return d.each(function(u){var f=1;if(3===u)f=2;else if(4===u)f=3;else if(5===u)return;D+=f,J.push({x:s[2*D],y:s[2*D+1]})}),J};var so=Fj.MoveHelper=function(m){var j=this;j.catalog="Move",j._interactor=m};so.prototype={},so.prototype.constructor=so,so.prototype.calcShift=function(X,x,O){var L,P,J=this,t=J._interactor.gv,H=t.lp(x);if("beginMove"===X&&J._gatherGridInfo(O._lastLogicalPoint||H),L=J._target){var v=L.downPosition;if(v){var T=J._interactor.getStyle("moveSensitivity")/t._zoom;if(v.distanceTo(H)<T)return{x:0,y:0};delete L.downPosition}var f;P=c.Default.isShiftDown(x),P&&(H=J._dealShiftDown(H),f=L.shiftGuide.dir);var y,C=L.rawPos={x:L.pos.x+H.x-L.lp.x,y:L.pos.y+H.y-L.lp.y};if(c.Default.isCtrlDown(x)){if(y=J._calcShiftByAddon(),J._target.node instanceof Fj.Group){var R=J._target.node;R._position.x+=y.x,R._position.y+=y.y}return y}for(var G,N=L.x+C.x,n=L.y+C.y,U={x:N,y:n},V={x:N+L.w/2,y:n+L.h/2},r={x:N+L.w,y:n+L.h},u=J._interactor.rectGuide,p=J._interactor.gridGuide,I=[u.findClosest(U,f),u.findClosest(V,f),u.findClosest(r,f),p.findClosest(U,f),p.findClosest(V,f),p.findClosest(r,f)],z=1/0,W=1/0,e=0,Y=I.length;Y>e;e++)G=I[e],G&&(N=G.x,n=G.y,isFinite(N)&&Math.abs(N)<Math.abs(z)&&(z=N),isFinite(n)&&Math.abs(n)<Math.abs(W)&&(W=n));if(isFinite(z)||(z=0),isFinite(W)||(W=0),y=J._calcShiftByAddon(z,W),J._target.node instanceof Fj.Group){var R=J._target.node;R._position.x+=y.x,R._position.y+=y.y}var j=L.node;if(!Ge(j,t)){var E=C.x+z,F=C.y+W;J._interactor.rectGuide.gatherLines({node:j,x:L.x+E,y:L.y+F,w:L.w,h:L.h},f)}return y}},so.prototype._calcShiftByAddon=function(F,m){var W=this._target,I=W.rawPos,T=W.node.getPosition();return F=F||0,m=m||0,{x:I.x-T.x+F,y:I.y-T.y+m}},so.prototype._dealShiftDown=function(W){var g=this,R=g._target.shiftGuide,k=g._target.lp,e=Math.abs(W.x-k.x),T=Math.abs(W.y-k.y);e>T&&e>R.limit&&"y"===R.dir&&(R.dir="x"),T>e&&T>R.limit&&"x"===R.dir&&(R.dir="y");var M=R.dir;return"x"===M?(W.y=k.y,R.limit=Math.max(R.limit,e)):"y"===M&&(W.x=k.x,R.limit=Math.max(R.limit,T)),W},so.prototype._gatherGridInfo=function(t){var L,$=this,k=$._interactor,E=k._getValidSelection();if(1===E.length){if(L=E[0],!L.getRect)return $._target=null,void 0}else if(L=Fj.Group.findOrCreateGroup(E),!L)return $._target=null,void 0;var x=L.getPosition(),_=L.getRect();$._target={node:L,x:_.x-x.x,y:_.y-x.y,w:_.width,h:_.height,lp:{x:t.x,y:t.y},pos:{x:x.x,y:x.y},shiftGuide:{dir:"x",limit:0},downPosition:new Fj.Math.Vector2(t)},k.rectGuide.gatherRects()},so.prototype.clear=function(){var b=this;b._interactor.rectGuide.clear(),b._interactor._42()};var Lj="directional",nc="point",zq="spot",he="light.color",Lh=function(r,N){Qc(N)&&zm.test(N)?Tn(r,N):ko(N)&&N.modelType?od(r,N):Yk[r]=N},Eo=function(u){if(ko(u))return u;var a=Yk[u];return u&&a===N&&zm.test(u)&&(Fq&&Fq[u]||Tn(u,u)),a};dr(M,{graph3dViewAttributes:W,graph3dViewFirstPersonMode:!1,graph3dViewMouseRoamable:!0,graph3dViewMoveStep:15,graph3dViewRotateStep:l/60,graph3dViewEditHelperDisabled:!1,graph3dViewPannable:!0,graph3dViewRotatable:!0,graph3dViewWalkable:!0,graph3dViewResettable:!0,graph3dViewZoomable:!0,graph3dViewRectSelectable:!0,graph3dViewRectSelectBackground:go,graph3dViewGridVisible:!1,graph3dViewGridSize:50,graph3dViewGridGap:50,graph3dViewGridColor:[.4,.75,.85,1],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:l/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,graph3dViewFogDisabled:!0,graph3dViewFogColor:"white",graph3dViewFogNear:1,graph3dViewFogFar:2e3,graph3dViewDashDisabled:!0,graph3dViewBatchBlendDisabled:!0,graph3dViewBatchBrightnessDisabled:!0,graph3dViewBatchColorDisabled:!1,setShape3dModel:Lh,getShape3dModel:Eo,createMatrix:function(U,A){zn(U)||(U=[U]);for(var n=U.length-1;n>=0;n--){var f=U[n];A=qi(f.mat,f.s3,f.r3,f.rotationMode,f.t3,A)}return A},transformVec:function(h,d){return ge(h,d)},createBoxModel:function(){return{vs:Sb,ns:mr,uv:hm,is:Ec}},createRoundRectModel:function(B,X){return Rd.roundRect(B,X)},createStarModel:function(p,f){return Rd.star(p,f)},createRectModel:function(J,p){return Rd.rect(J,p)},createTriangleModel:function(B,q){return Rd.triangle(B,q)},createRightTriangleModel:function(S,V){return Rd.rightTriangle(S,V)},createParallelogramModel:function(X,F){return Rd.parallelogram(X,F)},createTrapezoidModel:function(M,h){return Rd.trapezoid(M,h)},createSmoothSphereModel:function(G,$,h,Y,T,B,F){return Sf(new _f(G,$,h,Y,T,B,F))},createSphereModel:function(t,K,s,d,P,E){return t?lf(t,K,s,d,P,E):M.createSmoothSphereModel()},createSmoothConeModel:function(d,q,I,i,E){return wf(d,q,I,i,E)},createConeModel:function(X,p,b,D,u,r){return X?So(X,p,b,D,u,r):wf(r)},createSmoothCylinderModel:function(g,l,X,e,P,D,c,I){return Sf(new Xh(g,l,X,e,P,D,c,I))},createCylinderModel:function(E,M,o,n,Y,G,C){return E?Nl(E,M,o,n,Y,G,C):wc(G,C)},createSmoothTorusModel:function(T,t,F,_,i,l){return Sf(new dp(T,t,F,_,i,l))},createTorusModel:function(n,u,j,p,G,K,Z){return n?Hl(n,u,j,p,G,K,Z):ek(K,Z)},createExtrusionModel:function(y,c,w,S,Q,Z,b,Y){return zo(y,c,w,S,Q,Z,b,Y)},createSmoothRingModel:function(U,C,O,k,Y,T){for(var P=[],K=0;K<U.length-1;K+=2)P.push({x:U[K],y:U[K+1]});for(U=Qq(P,C,O)[0],P=[],K=0;K<U.length;K++){var t=U[K];P.push(new Sd(t.x,0,t.y))}return Sf(new dd(P,T,k,Y))},createTextGeometry:function(v,B){return Sf(new ri(v,B))},loadFontFace:function(B,K){M.xhrLoad(B,function(o){if(!o)return K();var I;try{I=JSON.parse(o)}catch(V){I=JSON.parse(o.substring(65,o.length-2))}xh.loadFace(I),K&&K(I.familyName.toLowerCase())},K?null:{sync:!0})},getRotationFromMatrix4:function(){var K={};return function(o,h,j){var M=X,S=o[0],v=o[4],i=o[8],G=o[1],p=o[5],n=o[9],c=o[2],a=o[6],C=o[10];if(h=h||"xyz",h=h[2]+h[1]+h[0],h=h.toUpperCase(),"XYZ"===h)K._y=Math.asin(M(i,-1,1)),Math.abs(i)<.99999?(K._x=Math.atan2(-n,C),K._z=Math.atan2(-v,S)):(K._x=Math.atan2(a,p),K._z=0);else if("YXZ"===h)K._x=Math.asin(-M(n,-1,1)),Math.abs(n)<.99999?(K._y=Math.atan2(i,C),K._z=Math.atan2(G,p)):(K._y=Math.atan2(-c,S),K._z=0);else if("ZXY"===h)K._x=Math.asin(M(a,-1,1)),Math.abs(a)<.99999?(K._y=Math.atan2(-c,C),K._z=Math.atan2(-v,p)):(K._y=0,K._z=Math.atan2(G,S));else if("ZYX"===h)K._y=Math.asin(-M(c,-1,1)),Math.abs(c)<.99999?(K._x=Math.atan2(a,C),K._z=Math.atan2(G,S)):(K._x=0,K._z=Math.atan2(-v,p));else if("YZX"===h)K._z=Math.asin(M(G,-1,1)),Math.abs(G)<.99999?(K._x=Math.atan2(-n,p),K._y=Math.atan2(-c,S)):(K._x=0,K._y=Math.atan2(i,C));else{if("XZY"!==h)return null;K._z=Math.asin(-M(v,-1,1)),Math.abs(v)<.99999?(K._x=Math.atan2(a,p),K._y=Math.atan2(i,S)):(K._x=Math.atan2(-n,C),K._y=0)}return j?(j[0]=K._x,j[1]=K._y,j[2]=K._z,j):[K._x,K._y,K._z]}}(),createRingModel:function(z,m,C,n,N,K,Q,A,Z,F){for(var d=[],X=0;X<z.length-1;X+=2)d.push({x:z[X],y:z[X+1]});K=K||M.shapeSide,Q=Q||0,A=A||K;var v,R,Y,e,P,V,B,c,t,y,X,h,s,k,I,O,p,J,w=[],G=[],$=Z?[]:W,r=Z?[]:W,D=F?[]:W,_=F?[]:W,T=n?[]:W,L=n?[]:W,f=N?[]:W,x=N?[]:W,z=Qq(d,m,C),j=pg(z),q=0,H=2*Math.PI/K;return z.forEach(function(u){if(Y=u.length,Y>1){if(e=u[0],n)for(V=e.x,c=e.y,X=Q;A>X;X++)h=X+1,s=X*H,k=h*H,I=o(s),O=b(s),p=o(k),J=b(k),T.push(I*V,c,-O*V,p*V,c,-J*V,0,c,0),L.push(.5-.5*I,.5-.5*O,.5-.5*p,.5-.5*J,.5,.5);for(y=0;Y>y;y++){for(P=u[y],V=e.x,B=P.x,c=e.y,t=P.y,v=q/j,q+=Nc(e,P),R=q/j,X=Q;A>X;X++)h=X+1,s=X*H,k=h*H,I=o(s),O=b(s),p=o(k),J=b(k),w.push(I*B,t,-O*B,p*B,t,-J*B,I*V,c,-O*V,p*B,t,-J*B,p*V,c,-J*V,I*V,c,-O*V),G.push(X/K,R,h/K,R,X/K,v,h/K,R,h/K,v,X/K,v),Z&&X===Q&&($.push(0,c,0,0,t,0,I*B,t,-O*B,I*B,t,-O*B,I*V,c,-O*V,0,c,0),r.push(0,.5-c,0,.5-t,2*B,.5-t,2*B,.5-t,2*V,.5-c,0,.5-c)),F&&h===A&&(D.push(0,c,0,p*B,t,-J*B,0,t,0,p*B,t,-J*B,0,c,0,p*V,c,-J*V),_.push(1,.5-c,1-2*B,.5-t,1,.5-t,1-2*B,.5-t,1,.5-c,1-2*V,.5-c));e=P}if(N)for(V=e.x,c=e.y,X=Q;A>X;X++)h=X+1,s=X*H,k=h*H,I=o(s),O=b(s),p=o(k),J=b(k),f.push(p*V,c,-J*V,I*V,c,-O*V,0,c,0),x.push(.5-.5*p,.5+.5*J,.5-.5*I,.5+.5*O,.5,.5)}}),{vs:w,uv:G,bottom_vs:f,bottom_uv:x,top_vs:T,top_uv:L,from_vs:$,from_uv:r,to_vs:D,to_uv:_}}},!0),dr(F,{"3d.move.mode":N,"3d.selectable":!0,"3d.visible":!0,"3d.movable":!0,"3d.editable":!0,"shape.border.gradient.color":N,"edge.gradient.color":N,"edge.source.t3":N,"edge.target.t3":N,"light.type":nc,"light.center":[0,0,0],"light.color":[1,1,1,1],"light.disabled":!1,"light.angle":l/4,"light.range":0,"light.exponent":1,"light.intensity":1,"wf.visible":!1,"wf.width":1,"wf.color":Gh,"wf.short":!1,"wf.mat":N,"wf.geometry":!1,batch:N,"transparent.mask":!1,brightness:N,"select.brightness":.7,"repeat.uv.length":N,alphaTest:.4,"label.face":_k,"label.t3":N,"label.r3":N,"label.texture.scale":2,"label.rotationMode":To,"label.light":!1,"label.blend":N,"label.reverse.flip":!1,"label.reverse.color":dj,"label.reverse.cull":!1,"label.transparent":!1,"label.autorotate":!1,"label2.face":_k,"label2.t3":N,"label2.r3":N,"label2.texture.scale":2,"label2.rotationMode":To,"label2.light":!1,"label2.blend":N,"label2.reverse.flip":!1,"label2.reverse.color":dj,"label2.reverse.cull":!1,"label2.transparent":!1,"label2.autorotate":!1,"note.face":_k,"note.t3":N,"note.r3":N,"note.texture.scale":2,"note.rotationMode":To,"note.light":!1,"note.blend":N,"note.reverse.flip":!1,"note.reverse.color":dj,"note.reverse.cull":!1,"note.transparent":!1,"note.autorotate":!1,"note2.face":_k,"note2.t3":N,"note2.r3":N,"note2.texture.scale":2,"note2.rotationMode":To,"note2.light":!1,"note2.blend":N,"note2.reverse.flip":!1,"note2.reverse.color":dj,"note2.reverse.cull":!1,"note2.transparent":!1,"note2.autorotate":!1,shape3d:N,"shape3d.color":zg,"shape3d.top.color":N,"shape3d.bottom.color":N,"shape3d.from.color":N,"shape3d.to.color":N,"shape3d.image":N,"shape3d.top.image":N,"shape3d.bottom.image":N,"shape3d.from.image":N,"shape3d.to.image":N,"shape3d.light":!0,"shape3d.side":0,"shape3d.side.from":N,"shape3d.side.to":N,"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":N,"shape3d.opacity":N,"shape3d.reverse.flip":!1,"shape3d.reverse.color":dj,"shape3d.reverse.cull":!1,"shape3d.transparent":!1,"shape3d.uv.offset":N,"shape3d.uv.scale":N,"shape3d.top.uv.offset":N,"shape3d.top.uv.scale":N,"shape3d.bottom.uv.offset":N,"shape3d.bottom.uv.scale":N,"shape3d.from.uv.offset":N,"shape3d.from.uv.scale":N,"shape3d.to.uv.offset":N,"shape3d.to.uv.scale":N,"shape3d.top.cap":N,"shape3d.bottom.cap":N,"shape3d.start.angle":0,"shape3d.sweep.angle":C,"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.autorotate":!1,"shape3d.fixSizeOnScreen":N,"shape3d.image.cache":!1,"shape3d.alwaysOnTop":!1,"all.light":!0,"all.visible":!0,"all.color":zg,"all.image":N,"all.blend":N,"all.opacity":N,"all.reverse.flip":!1,"all.reverse.color":dj,"all.reverse.cull":!1,"all.transparent":!1,"all.uv":N,"all.uv.offset":N,"all.uv.scale":N,"all.discard.selectable":!0,mat:N,"left.mat":N,"right.mat":N,"top.mat":N,"bottom.mat":N,"front.mat":N,"back.mat":N},!0);var ph,Qg=!1,db=[0,0,0,0],qd={left:[1/255,0,0,1],right:[2/255,0,0,1],top:[3/255,0,0,1],bottom:[4/255,0,0,1],front:[5/255,0,0,1],back:[6/255,0,0,1],m:{1:Ep,2:bc,3:Im,4:Cr,5:_k,6:Xl}},qr=function(T,q,L,n){if(q.getFaceVisible(T,L)){Qr(q,Xg(T,q.getFaceMat(T,L)||q.getMat(T)));var N=q._26I;q.getFaceReverseCull(T,L)?N.enable(N.CULL_FACE):N.disable(N.CULL_FACE),zr(N,q._prg.uFixPickReverseColor,qd[L]),Me(N),Oi(N,n,6),_c(N),ze(q)}},uh=function(c){return c instanceof dn},lm=function(V){return[V.x,V.e||0,V.y]},Cq=function(y,r,D){for(var r=ho(r),R=r[0],h=r[1],N=r[2];D--;)y.push(R,h,N)},er=function(G,$,I){for(var $=ho($),x=$[0],A=$[1],p=$[2],C=$[3];I--;)G.push(x,A,p,C)},Rq=function(t,C,X){if(C)for(var l,J,F,p=C[0],K=C[1],g=C[2],E=C[4],B=C[5],U=C[6],h=C[8],O=C[9],Y=C[10],z=C[12],D=C[13],N=C[14],k=X.length,m=0,m=0;k>m;m+=3)l=X[m],J=X[m+1],F=X[m+2],t.push(p*l+E*J+h*F+z,K*l+B*J+O*F+D,g*l+U*J+Y*F+N);else em(t,X)},vh=function(J,e){var d=e.s("light.intensity"),P=ho(e.s(he)),q=P[0],H=P[1],Q=P[2];1!==d&&(q*=d,H*=d,Q*=d),J.push(q,H,Q,e.s("light.disabled")?1:0)},Yq=function(I,W,f){zr(W,f.uHeadlightRange,I._headlightRange);var t=I._headlightIntensity,a=ho(I._headlightColor);1!==t&&(a=[a[0]*t,a[1]*t,a[2]*t]),zr(W,f.uHeadlightColor,[a[0],a[1],a[2],I._headlightDisabled?1:0]);var q=I._59O,m=I._spots,V=I._dirs;if(q.length){var k=[],d=[],P=[];q.forEach(function(H){vh(k,H),em(d,I._transformPointToViewSpace(H.p3())),P.push(H.s("light.range"))}),W.uniform4fv(f.uPointColor,k),W.uniform1fv(f.uPointRange,P),W.uniform3fv(f.uPointPosition,d)}if(m.length){var z=[],O=[],l=[],F=[],D=[],x=[];m.forEach(function(B){vh(z,B),em(O,I._transformPointToViewSpace(B.p3())),em(D,I._transformDirectionToViewSpace(B.p3(),B.s("light.center"))),l.push(B.s("light.range")),F.push(o(B.s("light.angle")/2)),x.push(B.s("light.exponent"))}),W.uniform4fv(f.uSpotColor,z),W.uniform1fv(f.uSpotRange,l),W.uniform1fv(f.uSpotAngle,F),W.uniform1fv(f.uSpotExponent,x),W.uniform3fv(f.uSpotPosition,O),W.uniform3fv(f.uSpotDirection,D)}if(V.length){var n=[],A=[];V.forEach(function(D){vh(n,D),em(A,I._transformDirectionToViewSpace(D.p3()))}),W.uniform4fv(f.uDirColor,n),W.uniform3fv(f.uDirDirection,A)}},vp=function(g){return g>0&&0===(g-1&g)},kn=function(V){return V=s(0,D(l,V)),V=s(ep,D(l-ep,V))},Dm=function(){return.05+h()/2},_b=function(C,q,t,o){var G,m=C.getEye();return C.isOrtho()?(G=Ie(C.getCenter(),m),G[0]+=o[0],G[1]+=o[1],G[2]+=o[2]):G=m,Dr(q,t,o,G)},Dr=function(w,j,d,M){var g=xr(w,j),h=Ie(M,d,!0),J=xr(h,j);if(t(J)<ep)return W;var X=(g-xr(d,j))/J;return[d[0]+h[0]*X,d[1]+h[1]*X,d[2]+h[2]*X]},Gd=function(G,l){return{x:2*G.x-l.x,y:2*G.y-l.y}},Dd=function(G,U,$,l){var g,C;if(!G)return g=B(U.y-$.y,$.x-U.x),{x:U.x+l*b(g),y:U.y+l*o(g)};if(!$)return g=B(G.y-U.y,U.x-G.x),{x:U.x+l*b(g),y:U.y+l*o(g)};var N=Ie([G.x,G.y,0],[U.x,U.y,0],!0),i=Ie([$.x,$.y,0],[U.x,U.y,0],!0),W=-(N[0]+i[0])/2,r=-(N[1]+i[1])/2,d=v(W*W+r*r);if(ep>d)return g=B(G.y-U.y,U.x-G.x),{x:U.x+l*b(g),y:U.y+l*o(g)};var m=G.x-U.x,j=G.y-U.y,D=$.x-U.x,J=$.y-U.y,H=v(m*m+j*j),c=v(D*D+J*J);g=f(xr(N,i))/2,C=N[1]*i[0]-N[0]*i[1]>0?-1:1,W/=d,r/=d;var a=l/b(g),K=s(H,c)/o(g);d=Math.min(a,K);var O={x:U.x+C*d*W,y:U.y+C*d*r};return $.b&&a>c/o(g)&&(O.adjust=!0),O},Sn=function(f){var R=f[1],P=f[2],U=f[3],y=f[6],$=f[7],q=f[11];f[1]=f[4],f[2]=f[8],f[3]=f[12],f[4]=R,f[6]=f[9],f[7]=f[13],f[8]=P,f[9]=y,f[11]=f[14],f[12]=U,f[13]=$,f[14]=q},Id=function(r){var R=r[0],C=r[1],V=r[2],I=r[3],m=r[4],p=r[5],f=r[6],o=r[7],M=r[8],F=r[9],d=r[10],k=r[11],E=r[12],H=r[13],t=r[14],b=r[15],n=R*p-C*m,L=R*f-V*m,g=R*o-I*m,O=C*f-V*p,q=C*o-I*p,i=V*o-I*f,s=M*H-F*E,J=M*t-d*E,x=M*b-k*E,D=F*t-d*H,Q=F*b-k*H,T=d*b-k*t,_=n*T-L*Q+g*D+O*x-q*J+i*s;return _?(_=1/_,r[0]=(p*T-f*Q+o*D)*_,r[1]=(V*Q-C*T-I*D)*_,r[2]=(H*i-t*q+b*O)*_,r[3]=(d*q-F*i-k*O)*_,r[4]=(f*x-m*T-o*J)*_,r[5]=(R*T-V*x+I*J)*_,r[6]=(t*g-E*i-b*L)*_,r[7]=(M*i-d*g+k*L)*_,r[8]=(m*Q-p*x+o*s)*_,r[9]=(C*x-R*Q-I*s)*_,r[10]=(E*q-H*g+b*n)*_,r[11]=(F*g-M*q-k*n)*_,r[12]=(p*J-m*D-f*s)*_,r[13]=(R*D-C*J+V*s)*_,r[14]=(H*L-E*O-t*n)*_,r[15]=(M*O-F*L+d*n)*_,void 0):W},Li=function(z,t){if(t){var H=t[0],$=t[1],v=t[2];z[12]=z[0]*H+z[4]*$+z[8]*v+z[12],z[13]=z[1]*H+z[5]*$+z[9]*v+z[13],z[14]=z[2]*H+z[6]*$+z[10]*v+z[14],z[15]=z[3]*H+z[7]*$+z[11]*v+z[15]}},ml=function(N,d){if(d){var P=d[0],z=d[1],n=d[2];N[0]=N[0]*P,N[1]=N[1]*P,N[2]=N[2]*P,N[3]=N[3]*P,N[4]=N[4]*z,N[5]=N[5]*z,N[6]=N[6]*z,N[7]=N[7]*z,N[8]=N[8]*n,N[9]=N[9]*n,N[10]=N[10]*n,N[11]=N[11]*n}},Mi=function(f,v,S){var L=v[0],g=v[1],Y=v[2],d=v[3],U=v[4],C=v[5],Z=v[6],a=v[7],q=v[8],i=v[9],u=v[10],B=v[11],$=v[12],h=v[13],e=v[14],A=v[15],Q=S[0],l=S[1],z=S[2],j=S[3];return f[0]=Q*L+l*U+z*q+j*$,f[1]=Q*g+l*C+z*i+j*h,f[2]=Q*Y+l*Z+z*u+j*e,f[3]=Q*d+l*a+z*B+j*A,Q=S[4],l=S[5],z=S[6],j=S[7],f[4]=Q*L+l*U+z*q+j*$,f[5]=Q*g+l*C+z*i+j*h,f[6]=Q*Y+l*Z+z*u+j*e,f[7]=Q*d+l*a+z*B+j*A,Q=S[8],l=S[9],z=S[10],j=S[11],f[8]=Q*L+l*U+z*q+j*$,f[9]=Q*g+l*C+z*i+j*h,f[10]=Q*Y+l*Z+z*u+j*e,f[11]=Q*d+l*a+z*B+j*A,Q=S[12],l=S[13],z=S[14],j=S[15],f[12]=Q*L+l*U+z*q+j*$,f[13]=Q*g+l*C+z*i+j*h,f[14]=Q*Y+l*Z+z*u+j*e,f[15]=Q*d+l*a+z*B+j*A,f},Xi=function(q,h,w,G){var S,g,j,O,k,X,Y,B,Q,y,W=h[0],x=h[1],Z=h[2],D=G[0],I=G[1],z=G[2],M=w[0],N=w[1],U=w[2];return t(W-M)<ep&&t(x-N)<ep&&t(Z-U)<ep?Wk(q):(Y=W-M,B=x-N,Q=Z-U,y=1/v(Y*Y+B*B+Q*Q),Y*=y,B*=y,Q*=y,S=I*Q-z*B,g=z*Y-D*Q,j=D*B-I*Y,y=v(S*S+g*g+j*j),y?(y=1/y,S*=y,g*=y,j*=y):(S=0,g=0,j=0),O=B*j-Q*g,k=Q*S-Y*j,X=Y*g-B*S,y=v(O*O+k*k+X*X),y?(y=1/y,O*=y,k*=y,X*=y):(O=0,k=0,X=0),q[0]=S,q[1]=O,q[2]=Y,q[3]=0,q[4]=g,q[5]=k,q[6]=B,q[7]=0,q[8]=j,q[9]=X,q[10]=Q,q[11]=0,q[12]=-(S*W+g*x+j*Z),q[13]=-(O*W+k*x+X*Z),q[14]=-(Y*W+B*x+Q*Z),q[15]=1,q)},qq=function(j,b,c,q,r){var y=1/I(b/2),C=1/(q-r);return j[0]=y/c,j[1]=0,j[2]=0,j[3]=0,j[4]=0,j[5]=y,j[6]=0,j[7]=0,j[8]=0,j[9]=0,j[10]=(r+q)*C,j[11]=-1,j[12]=0,j[13]=0,j[14]=2*r*q*C,j[15]=0,j},zd=function(G,V,i,T,e,s,m){var U=1/(V-i),E=1/(T-e),Z=1/(s-m);return G[0]=-2*U,G[1]=0,G[2]=0,G[3]=0,G[4]=0,G[5]=-2*E,G[6]=0,G[7]=0,G[8]=0,G[9]=0,G[10]=2*Z,G[11]=0,G[12]=(V+i)*U,G[13]=(e+T)*E,G[14]=(m+s)*Z,G[15]=1,G},Dh=function(x,r){var l=r[0],L=r[1],w=r[2],z=r[3],c=l*l+L*L+w*w+z*z,X=c?1/c:0;return x[0]=-l*X,x[1]=-L*X,x[2]=-w*X,x[3]=z*X,x},Mg=function(L,Z){var t=Z[0]+Z[5]+Z[10],q=0;return t>0?(q=2*Math.sqrt(t+1),L[3]=.25*q,L[0]=(Z[6]-Z[9])/q,L[1]=(Z[8]-Z[2])/q,L[2]=(Z[1]-Z[4])/q):Z[0]>Z[5]&Z[0]>Z[10]?(q=2*Math.sqrt(1+Z[0]-Z[5]-Z[10]),L[3]=(Z[6]-Z[9])/q,L[0]=.25*q,L[1]=(Z[1]+Z[4])/q,L[2]=(Z[8]+Z[2])/q):Z[5]>Z[10]?(q=2*Math.sqrt(1+Z[5]-Z[0]-Z[10]),L[3]=(Z[8]-Z[2])/q,L[0]=(Z[1]+Z[4])/q,L[1]=.25*q,L[2]=(Z[6]+Z[9])/q):(q=2*Math.sqrt(1+Z[10]-Z[0]-Z[5]),L[3]=(Z[1]-Z[4])/q,L[0]=(Z[8]+Z[2])/q,L[1]=(Z[6]+Z[9])/q,L[2]=.25*q),L},dl=function(h,S,t){var j=S[0],z=S[1],p=S[2],D=S[3],y=j+j,k=z+z,w=p+p,n=j*y,X=j*k,M=j*w,i=z*k,Q=z*w,b=p*w,T=D*y,c=D*k,d=D*w;return h[0]=1-(i+b),h[1]=X+d,h[2]=M-c,h[3]=0,h[4]=X-d,h[5]=1-(n+b),h[6]=Q+T,h[7]=0,h[8]=M+c,h[9]=Q-T,h[10]=1-(n+i),h[11]=0,h[12]=t[0],h[13]=t[1],h[14]=t[2],h[15]=1,h},vl=M.getRotationFromMatrix4,di=function(){var u=[0,0,0],A=[0,0,0],n=[0,0,0],I=function(b,j,T){b[0]=j[1]*T[2]-j[2]*T[1],b[1]=j[2]*T[0]-j[0]*T[2],b[2]=j[0]*T[1]-j[1]*T[0]},g=function(T){return T[0]*T[0]+T[1]*T[1]+T[2]*T[2]},T=function(u){var N=Math.sqrt(g(u));u[0]/=N,u[1]/=N,u[2]/=N},Y=function(Z,y,u){Z[0]=y[0]-u[0],Z[1]=y[1]-u[1],Z[2]=y[2]-u[2]};return function(S,M,j){var G=Tq();return Y(n,S,M),0===g(n)&&(n[2]=1),T(n),I(u,j,n),0===g(u)&&(1===Math.abs(j[2])?n[0]+=1e-4:n[2]+=1e-4,T(n),I(u,j,n)),T(u),I(A,n,u),G[0]=u[0],G[4]=A[0],G[8]=n[0],G[1]=u[1],G[5]=A[1],G[9]=n[1],G[2]=u[2],G[6]=A[2],G[10]=n[2],G}}(),Uk=function(k,H){if(k.vr.enable){var Y=k.vr.getViewMatrix(H);if(Y)return Y}return Xi(H?H:Tq(),k._eye,k._center,k._up)},Lf=function(A){if(A.vr.enable){var V=A.vr.getProjectMatrix();if(V)return V}var N=A.getAspect(),C=A._near,q=A._far,h=Tq();if(A._ortho){var y=A._orthoWidth/2,l=y/N;zd(h,-y,y,-l,l,C,q)}else qq(h,A._fovy,N,C,q);return h},$q=function(j,x){if(!j)return W;var l=0,r=1,i=2,o=[],I=0,w=j.length,K=w/3;if(x){for(;w>I;I++)o[I]=0;for(I=0;I<x.length;I+=3){var R=[],g=[],P=[];R[l]=j[3*x[I+1]+l]-j[3*x[I]+l],R[r]=j[3*x[I+1]+r]-j[3*x[I]+r],R[i]=j[3*x[I+1]+i]-j[3*x[I]+i],g[l]=j[3*x[I+2]+l]-j[3*x[I+1]+l],g[r]=j[3*x[I+2]+r]-j[3*x[I+1]+r],g[i]=j[3*x[I+2]+i]-j[3*x[I+1]+i],P[l]=R[r]*g[i]-R[i]*g[r],P[r]=R[i]*g[l]-R[l]*g[i],P[i]=R[l]*g[r]-R[r]*g[l];for(var p=0;3>p;p++)o[3*x[I+p]+l]+=P[l],o[3*x[I+p]+r]+=P[r],o[3*x[I+p]+i]+=P[i]}}else for(I=0;K>I;I+=3){var R=[],g=[],P=[];R[l]=j[3*(I+1)+l]-j[3*I+l],R[r]=j[3*(I+1)+r]-j[3*I+r],R[i]=j[3*(I+1)+i]-j[3*I+i],g[l]=j[3*(I+2)+l]-j[3*(I+1)+l],g[r]=j[3*(I+2)+r]-j[3*(I+1)+r],g[i]=j[3*(I+2)+i]-j[3*(I+1)+i],P[l]=R[r]*g[i]-R[i]*g[r],P[r]=R[i]*g[l]-R[l]*g[i],P[i]=R[l]*g[r]-R[r]*g[l];for(var p=0;3>p;p++)o[3*(I+p)+l]=P[l],o[3*(I+p)+r]=P[r],o[3*(I+p)+i]=P[i]}for(I=0;w>I;I+=3){var X=[];X[l]=o[I+l],X[r]=o[I+r],X[i]=o[I+i];var N=v(X[l]*X[l]+X[r]*X[r]+X[i]*X[i]);0===N&&(N=ep),X[l]=X[l]/N,X[r]=X[r]/N,X[i]=X[i]/N,o[I+l]=X[l],o[I+r]=X[r],o[I+i]=X[i]}return new or(o)},zp=function(f,t,s,A){if(s||(s=f.createTexture()),t){var Y=f.TEXTURE_2D,U=f.REPEAT,m=f.CLAMP_TO_EDGE,O=f.TEXTURE_MIN_FILTER;A!==f.NEAREST&&(A=f.LINEAR),pn(f,s),f.texImage2D(Y,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,t),Un(f,f.TEXTURE_MAG_FILTER,A),vp(t.width)&&vp(t.height)&&!t.clampToEdge?(Un(f,f.TEXTURE_WRAP_S,U),Un(f,f.TEXTURE_WRAP_T,U),Un(f,O,f.LINEAR_MIPMAP_LINEAR),f.generateMipmap(Y)):(Un(f,f.TEXTURE_WRAP_S,m),Un(f,f.TEXTURE_WRAP_T,m),Un(f,O,A)),pn(f,W)}return s},Co=function(w,U){var N=new Uint8Array(3);return U=U||w.createTexture(),pn(w,U),Un(w,w.TEXTURE_MIN_FILTER,w.LINEAR),w.texImage2D(w.TEXTURE_2D,0,w.RGB,1,1,0,w.RGB,w.UNSIGNED_BYTE,N),U},ih=function(O){O._26I&&O._prg&&(O._26I.deleteProgram(O._prg),O._prg=W)},lq=function(M,x,i,R){var u=M.createShader(i);return M.shaderSource(u,R),M.compileShader(u),M.attachShader(x,u),u},Oe=function(S){return S.createBuffer()},pn=function(M,n){M.bindTexture(M.TEXTURE_2D,n)},fb=function(v,J){v.bindFramebuffer(v.FRAMEBUFFER,J)},Un=function(z,B,j){z.texParameteri(z.TEXTURE_2D,B,j)},yn=function(e,T){if(T){var T=ho(T);e.clearColor(T[0],T[1],T[2],T[3])}},eb=function(S,$){zr(S,$.uFix,!0),Xc(S,$.aNormal)},bd=function(A,F){zr(A,F.uFix,!1),Op(A,F.aNormal)},yo=function(O,K,C,f,X,E,p,$){O._picking||(C?(zr(O,K.uBlend,!0),zr(O,K.uBlendColor,C)):zr(O,K.uBlend,!1),zr(O,K.uLight,f==W?!0:f),lk(X)&&1!==X&&zr(O,K.uPartOpacity,X),zr(O,K.uReverseFlip,E==W?!1:E),zr(O,K.uFixPickReverseColor,p||dj)),$?O.enable(O.CULL_FACE):O.disable(O.CULL_FACE)},Si=function(q,F){q._picking||zr(q,F.uPartOpacity,1)},Me=function(o,H,I,U,$,M,n,Y,q){if(!I)return o.activeTexture(o.TEXTURE0),pn(o,o._emptyTexture),o.activeTexture(o.TEXTURE1),pn(o,o._emptyBlendTexture),void 0;zr(o,H.uTexture,!0),zr(o,H.uDiscardSelectable,Rg(U)?U:!0),Op(o,H.aUv),Jb(o,$,M,H.aUv,2),q?(zr(o,H.uBlendTexture,!0),o.activeTexture(o.TEXTURE1),pn(o,q),o.uniform1i(H.uBlendSampler,1)):(zr(o,H.uBlendTexture,!1),o.activeTexture(o.TEXTURE1),pn(o,o._emptyBlendTexture)),o.activeTexture(o.TEXTURE0),pn(o,I),o.uniform1i(H.uSampler,0);var N=[0,0,1,1];n&&(N[0]=n[0],N[1]=n[1]),Y&&(N[2]=Y[0],N[3]=Y[1]),zr(o,H.uOffsetScale,N)},_c=function(U,E,J){U.activeTexture(U.TEXTURE0),pn(U,W),U.activeTexture(U.TEXTURE1),pn(U,W),J&&(Xc(U,E.aUv),zr(U,E.uTexture,!1),zr(U,E.uBlendTexture,!1))},ve=function(C,p,S,A,g,m){!S||O||k||C.lineWidth(S),A&&!C._picking&&zr(C,p.uFixPickReverseColor,A),g&&Jb(C,g,m,p.aPosition)},Ki=function(x,E,j,v){ph&&(v=x[ph]),x.drawArrays(v==W?x.TRIANGLES:v,E,j);var q=x._renderInfo;q&&(q.calls++,q.vertices+=j,(v==W||v===x.TRIANGLES)&&(q.faces+=j/3),v===x.LINES&&(q.lines+=j/2))},Oi=function(I,o,R,U){ph&&(U=I[ph]),I.drawElements(U==W?I.TRIANGLES:U,R,I.UNSIGNED_SHORT,o==W?0:2*o);var t=I._renderInfo;t&&(t.calls++,t.vertices+=R,(U==W||U===I.TRIANGLES)&&(t.faces+=R/3),U===I.LINES&&(t.lines+=R/2))},dk=function(n,m,g,V,R){var L=n.ARRAY_BUFFER;n.bindBuffer(L,m),g&&n.bufferData(L,g,n.STATIC_DRAW),V!=W&&n.vertexAttribPointer(V,R?R:3,n.FLOAT,!1,0,0)},Jb=function(Q,U,G,t,Z){return G?(lb(Q,Q.ARRAY_BUFFER,U,G),t!=W&&Q.vertexAttribPointer(t,Z?Z:3,Q.FLOAT,!1,0,0),void 0):dk(Q,U,G,t,Z)},wl=function(R,U,Q){var m=R.ELEMENT_ARRAY_BUFFER;R.bindBuffer(m,U),Q&&R.bufferData(m,Q,R.STATIC_DRAW)},Wn=function(O,W,U){lb(O,O.ELEMENT_ARRAY_BUFFER,W,U)},lb=function(Q,O,o,I){var o,N=I.glBuf,S=Q._id;N&&(o=N[S])&&o._buf?Q.bindBuffer(O,o._buf):(o={_buf:Oe(Q)},Q._bufPool.push(o),Q.bindBuffer(O,o._buf),Q.bufferData(O,I,Q.STATIC_DRAW),N||(N=I.glBuf={}),N[S]=o),o._fid=Q._renderInfo.frame},zr=function(H,q,A){if(A!=W&&q!=W){A=ho(A);var e=A.length;3===e?H.uniform3fv(q,A):4===e?H.uniform4fv(q,A):16===e?H.uniformMatrix4fv(q,!1,A):Rg(A)?H.uniform1i(q,A?1:0):2===e?H.uniform2fv(q,A):H.uniform1f(q,A)}},Op=function(D,e){e!=W&&e>=0&&D.enableVertexAttribArray(e)},Xc=function(Q,p){p!=W&&p>=0&&Q.disableVertexAttribArray(p)},ze=function(f,l){var I=f.getGL(),c=f._prg;f._7O=f._8O.pop(),l&&(zr(I,c.uMVMatrix,f._7O),f._6O=l,zr(I,c.uNMatrix,l))},_n=function(Q,w){return w||(w=Tq()),Bc(w,Q),Id(w),Sn(w),w},Qr=function(S,H){var d=S.getGL(),I=S._prg,u=S._7O;H&&(S._8O.push(Pf(u)),Mi(u,u,H)),zr(d,I.uMVMatrix,u),zr(d,I.uNMatrix,_n(u,S._6O))},gs=function(e,O,u,M,Y,Q){if(u){if(M){var F=u.value++,j=2147483648|F,x=[(255&j>>16)/255,(255&j>>8)/255,(255&j)/255,(255&j>>24)/255];u[F]={data:Y,part:Q}}else x=db;return zr(e,O.uFixPickReverseColor,x),x}},cb=function(){var F={center:function(Y,L,Z,N,X){var I=-L[1]/2,s={x:-L[0]/2,y:I,width:L[0],height:L[1]},S=jm(Y,s,Z);return[S.x+N,-S.y-X,Dm()]},front:function(y,K,$,F,X){var Y=-K[1]/2,U={x:-K[0]/2,y:Y,width:K[0],height:K[1]},J=jm(y,U,$);return[J.x+F,-J.y-X,K[2]/2+Dm()]},back:function(d,M,m,P,n){var G=-M[0]/2,R=-M[1]/2,Q={x:G,y:R,width:M[0],height:M[1]},q=jm(d,Q,m);return[-q.x-P,-q.y-n,-M[2]/2-Dm()]},left:function(h,M,N,m,x){var k=-M[1]/2,i={x:-M[2]/2,y:k,width:M[2],height:M[1]},V=jm(h,i,N);return[-M[0]/2-Dm(),-V.y-x,V.x+m]},right:function(k,d,N,O,J){var H=-d[2]/2,o=-d[1]/2,m={x:H,y:o,width:d[2],height:d[1]},s=jm(k,m,N);return[d[0]/2+Dm(),-s.y-J,-s.x-O]},top:function(T,$,N,D,e){var b={x:-$[0]/2,y:-$[2]/2,width:$[0],height:$[2]},F=jm(T,b,N);return[F.x+D,$[1]/2+Dm(),F.y+e]},bottom:function(k,h,a,t,p){var E=-h[2]/2,i={x:-h[0]/2,y:E,width:h[0],height:h[2]},z=jm(k,i,a);return[z.x+t,-h[1]/2-Dm(),-z.y-p]}};return function(u,m,n,G,O,M){return F[G](u,m,n,O||0,M||0)}}(),Ic=function(a,c,Q,N,t,G,v,m,D,A){if(t&&(c[0]+=t[0],c[1]+=t[1],c[2]+=t[2]),Li(a,Q),m){var n=Tq();if(mp(n,D,A),ge(c,n),Li(a,c),a.auto=m,a.pos=ge([0,0,0],a),G){var F=a.mat2=Tq();mp(F,G,v)}}else mp(a,D,A),Li(a,c),N===Ep?Tr(a,-q):N===bc?Tr(a,q):N===Im?kd(a,-q):N===Cr?kd(a,q):N===Xl&&Tr(a,l),mp(a,G,v);return a},tg=function(Q,I){var b=I.auto,K=I.mat2,u=Q.gv;if(b){var X,k=Tq(),o=[0,0,0,0];X="string"==typeof b?[b.indexOf("x")<0?u._eye[0]:u._center[0],b.indexOf("y")<0?u._eye[1]:u._center[1],b.indexOf("z")<0?u._eye[2]:u._center[2]]:u._eye,Mg(o,Xi(Tq(),X,u._center,u._up)),dl(k,Dh(o,o),I.pos),K&&Mi(k,k,K),Qr(u,k)}else Qr(u,I)},fd=function(P,D,w,o,g){var N=P.s,Z=P.gv,_=Z.getGL(),S=Z._prg,K=Z._buffer,x=Z._1O;zp(_,Yp,x),tg(P,w),yo(_,S,N(D+".blend"),N(D+".light"),N(D+".opacity"),N(D+".reverse.flip"),N(D+".reverse.color"),N(D+".reverse.cull")),Me(_,S,x,g,K.uv,Wc),Jb(_,K.vs,o,S.aPosition),Jb(_,K.ns,Ld,S.aNormal),Wn(_,K.is,np),Oi(_,0,np.length),_c(_,S,x),Si(_,S),ze(Z)},Ke=function(D,K,h){var z=D.gv,U=D.data,r=D[K]={blend:z.getBodyColor(U)||z.getFaceBlend(U,K),light:z.getFaceLight(U,K),color:z.getFaceColor(U,K),opacity:z.getFaceOpacity(U,K),transparent:z.getFaceTransparent(U,K),reverseFlip:z.getFaceReverseFlip(U,K),reverseColor:z.getFaceReverseColor(U,K),reverseCull:z.getFaceReverseCull(U,K),texture:z.getFaceImage(U,K),blendTexture:z.getFaceBlendImage(U,K),discardSelectable:z.getFaceDiscardSelectable(U,K)};if("csg"!==K){r.uv=z.getFaceUv(U,K)||h&&h[K+"Uv"],r.uvScale=z.getFaceUvScale(U,K)||h&&h[K+"UvScale"],r.uvOffset=z.getFaceUvOffset(U,K)||h&&h[K+"UvOffset"];var R=z.getFaceMat(U,K);R&&(r.mat=Xg(U,R))}return r},we=function(F,u,w,X,p){if(X){if(!p(X.transparent))return;var h=F.data,Z=F.gv,l=Z._buffer,I=Z.getTexture(X.texture,h),C=Z.getTexture(X.blendTexture,h);Me(u,w,I,X.discardSelectable,l.uv,X.tuv,X.uvOffset,X.uvScale,C),yo(u,w,X.blend,X.light,X.opacity,X.reverseFlip,X.reverseColor,X.reverseCull),zr(u,w.uDiffuse,X.color),Jb(u,l.vs,X.vs,w.aPosition),Jb(u,l.ns,X.ns,w.aNormal),Ki(u,0,X.vs.length/3),Si(u,w),_c(u,w,I)}},mh=function(X,q,C,P,L,s){var V,j,d,v,n,i,O,A,c,F,Z,u=[P-q,L-C],K=X?X.length:0;for(d=0;K>d;d++){for(v=2,V=X[d],n=V[0],i=V[1];v+1<V.length;){if(O=V[v],A=V[v+1],j=Jc(q,C,P,L,n,i,O,A,!0)){c=[O-n,A-i],F=Nc(c),c[0]/=F,c[1]/=F,F=xr(u,c),F=F>0?s:-s,Z=[c[0]*F,c[1]*F];break}n=O,i=A,v+=2}if(Z)break}if(Z)for(P=q+Z[0],L=C+Z[1],d=0;K>d;d++)for(v=2,V=X[d],n=V[0],i=V[1];v+1<V.length;){if(O=V[v],A=V[v+1],j=Jc(q,C,P,L,n,i,O,A,!0))return[0,0];n=O,i=A,v+=2}return Z?Z:[P-q,L-C]},Of=c.graph3d={},Ej=function(Z,B,Y){Xr(e+".graph3d."+Z,B,Y)},Wp="~<yfusfw!+!yjsubNQv!>!opjujtpQ`mh!gjeof$!~<fdobutjEfojMb!>!fdobutjEfojMw|*itbEv)gj!ITBE!gfegj$!!gjeof$!~<ttfouihjsCidubCb!>!ttfouihjsCidubCw|*ttfouihjsCidubCv)gj!TTFOUIHJSCIDUBC!gfegj$!!gjeof$!~<eofmCidubCb!>!eofmCidubCw|*eofmCidubCv)gj!EOFMCIDUBC!gfegj$!!gjeof$!~<spmpDidubCb!>!spmpDidubCw|*spmpDidubCv)gj!SPMPDIDUBC!gfegj$!~<wVb!>!wVs|*fsvuyfUeofmCv)gj~<x{/fmbdTuftggPv!+!wVb!,!zy/fmbdTuftggPv!>!wVw|*fsvuyfUv)gj~<*yfusfw)4dfw!>!yfusfWw<**1/2!-mbnspOb)5dfw!+!yjsubNOv)4dfw!>!mbnspOw|*ldjQva!%%!yjGva)gj<*1/2!-opjujtpQb)5dfw!+!yjsubNWNv!>!yfusfw!5dfw|!*ejpw)ojbn!ejpw!gjeof$!<fdobutjEfojMw!ubpmg!hojzsbw<fdobutjEfojMb!ubpmg!fuvcjsuub<itbEv!mppc!nspgjov!ITBE!gfegj$!!gjeof$!<^UPQT`YBN]opjudfsjEupqTv!4dfw!nspgjov<^UPQT`YBN]opjujtpQupqTv!4dfw!nspgjov<^UPQT`YBN]spmpDupqTv!5dfw!nspgjov!1!?!UPQT`YBN!gj$!!gjeof$!<^UOJPQ`YBN]opjujtpQuojpQv!4dfw!nspgjov<^UOJPQ`YBN]spmpDuojpQv!5dfw!nspgjov!1!?!UOJPQ`YBN!gj$!!gjeof$!<^SJE`YBN]opjudfsjEsjEv!4dfw!nspgjov<^SJE`YBN]spmpDsjEv!5dfw!nspgjov!1!?!SJE`YBN!gj$!!gjeof$!<eofmCidubCw!4dfw!hojzsbw<eofmCidubCb!4dfw!fuvcjsuub<eofmCidubCv!mppc!nspgjov!EOFMCIDUBC!gfegj$!!gjeof$!<ttfouihjsCidubCw!ubpmg!hojzsbw<ttfouihjsCidubCb!ubpmg!fuvcjsuub<ttfouihjsCidubCv!mppc!nspgjov!TTFOUIHJSCIDUBC!gfegj$!!gjeof$!<spmpDidubCw!5dfw!hojzsbw<spmpDidubCb!5dfw!fuvcjsuub<spmpDidubCv!mppc!nspgjov!SPMPDIDUBC!gfegj$!<yfusfWw!4dfw!hojzsbw<mbnspOw!4dfw!hojzsbw<yjGv!mppc!nspgjov<ldjQv!mppc!nspgjov<yjsubNxfjWv!5ubn!nspgjov<yjsubNOv!5ubn!nspgjov<yjsubNQv!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",Rb="~~<eJ!>!spmpDhbsG`mh~<spmpDsfmqnbTwv!>+!eJ<*wVs!-sfmqnbTeofmCv)E3fsvuyfu!>!spmpDsfmqnbTwv!5dfw|!*fsvuyfUeofmCv)!gj!!gjeof$!~<ttfouihjsCidubCw!>+!chs/eJ!!!|*ttfouihjsCidubCv)gj!TTFOUIHJSCIDUBC!gfegj$!~<ttfouihjsCv!>+!chs/eJ!!!|*1/2!>a!ttfouihjsCv)gj~~<zujdbqPusbQv!>+!b/eJ!!!|*1/2!>a!zujdbqPusbQv)gj~!gjeof$!<*spudbGhpg!-*x/eJ!-chs/spmpDhpGv)5dfw!-eJ)yjn!>!eJ<*iuqfe!-sbGhpGv!-sbfOhpGv)qfutiuppnt!>!spudbGhpg!ubpmg<x/esppDhbsG`mh0{/esppDhbsG`mh!>!iuqfe!ubpmg!HPG!gfegj$!!gjeof$!~~~~<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!1!?!UPQT`YBN!gj$!!gjeof$!~~~<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!1!?!UOJPQ`YBN!gj$!!gjeof$!~~<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!1!?!SJE`YBN!gj$!~<chs/spmpDuihjmebfIv!+!nsfUusfcnbm!>+!chs/eJ~<*1/2!-fhobSuihjmebfIv0*yfusfWw)iuhofm)ojn!.!1/2!!>+!nsfUusfcnbm|*1/1!?!fhobSuihjmebfIv)gj<*1/1!-6/1!,!6/1!+!*M.!-O)upe)ybn!>!nsfUusfcnbm!ubpmg|*1/1!>>!x/spmpDuihjmebfIv)gj|*uihjMv)gj~!gjeof$!~<spmpDeofmCv!>+!eJ|*eofmCv)gj!ftmf$!~<spmpDeofmCv!>+!eJ|*eofmCv)gj!ftmf~<eofmCidubCw!>+!chs/eJ|*eofmCidubCv)gj!EOFMCIDUBC!gfegj$!~<spmpd!>!eJ|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<*yfusfWw.)f{jmbnspo!>!F!4dfw<*mbnspOw)f{jmbnspo!>!O!4dfw!gjeof$!<ftvggjEv!>!spmpd!ftmf$!~<ftvggjEv!>!spmpd|ftmf~<spmpDidubCw!>!spmpd|*spmpDidubCv)gj!SPMPDIDUBC!gfegj$!<spmpd!5dfw|!ftmf~!gjeof$!~~<ftvggjEv!>!eJ|ftmf~<esbdtje|*1/1!>>!x/ftvggjEv)gj|!*!fdobutjEitbEv!?!*!fdobutjEqbHitbEv!-fdobutjEfojMw!)epn!%%!itbEv)!gj!ITBE!gfegj$!!gjeof$!<spmpDftsfwfSldjQyjGv!>!eJ!ftmf$!~<spmpDftsfwfSldjQyjGv!>!eJ|ftmf~<spmpDidubCw!>!eJ|*spmpDidubCv)gj!SPMPDIDUBC!gfegj$!|*yjGv)gj<eJ!5dfw|ftmf~~!<esbdtje!|!*1/1!>>!b/spmpDhbsG`mh)!gj!gjeof$!<spmpDftsfwfSldjQyjGv!>!spmpDhbsG`mh!ftmf$!~<spmpDftsfwfSldjQyjGv!>!spmpDhbsG`mh|ftmf~<spmpDidubCw!>!spmpDhbsG`mh|*spmpDidubCv)gj!SPMPDIDUBC!gfegj$!|*ldjQv)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|!*ejpw)ojbn!ejpw!gjeof$!<fdobutjEfojMw!ubpmg!hojzsbw<fdobutjEqbHitbEv!ubpmg!nspgjov<fdobutjEitbEv!ubpmg!nspgjov<itbEv!mppc!nspgjov!ITBE!gfegj$!!gjeof$!<sbGhpGv!ubpmg!nspgjov<sbfOhpGv!ubpmg!nspgjov<spmpDhpGv!5dfw!nspgjov!HPG!gfegj$!!gjeof$!<^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!1!?!UPQT`YBN!gj$!!gjeof$!<^UOJPQ`YBN]opjujtpQuojpQv!4dfw!nspgjov<^UOJPQ`YBN]fhobSuojpQv!ubpmg!nspgjov<^UOJPQ`YBN]spmpDuojpQv!5dfw!nspgjov!1!?!UOJPQ`YBN!gj$!!gjeof$!<^SJE`YBN]opjudfsjEsjEv!4dfw!nspgjov<^SJE`YBN]spmpDsjEv!5dfw!nspgjov!1!?!SJE`YBN!gj$!!gjeof$!<eofmCidubCw!4dfw!hojzsbw<eofmCidubCv!mppc!nspgjov!EOFMCIDUBC!gfegj$!!gjeof$!<ttfouihjsCidubCw!ubpmg!hojzsbw<ttfouihjsCidubCv!mppc!nspgjov!TTFOUIHJSCIDUBC!gfegj$!!gjeof$!<spmpDidubCw!5dfw!hojzsbw<spmpDidubCv!mppc!nspgjov!SPMPDIDUBC!gfegj$!<spmpDuihjmebfIv!5dfw!nspgjov<fhobSuihjmebfIv!ubpmg!nspgjov<yfusfWw!4dfw!hojzsbw<mbnspOw!4dfw!hojzsbw<ftvggjEv!5dfw!nspgjov<zujdbqPusbQv!ubpmg!nspgjov<ttfouihjsCv!ubpmg!nspgjov<uihjMv!mppc!nspgjov<spmpDeofmCv!5dfw!nspgjov<eofmCv!mppc!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!gjeof$!!gjeof$!!<ubpmg!qnvjefn!opjtjdfsq!!ftmf$!!<ubpmg!qihji!opjtjdfsq!!IHJI`OPJTJDFSQ`UOFNHBSG`MH!gfegj$!!TF`MH!gfegj$!";
- dr(M,{setBatchInfo:function(U,f){vn[U]=f},getBatchInfo:function(V){return vn[V]}},!0);var Ho=[1,1,1],uk=[1,0,0,0,0,1,0,1,1,1,1,0],Ur=[-.5,.5,.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,.5,.5],Sh=[.5,.5,-.5,.5,.5,.5,.5,-.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,.5,-.5],Vl=[.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,.5,.5,.5,.5,-.5],Cc=[.5,-.5,.5,-.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5,-.5,.5,-.5,.5],_d=[.5,.5,.5,-.5,.5,.5,-.5,-.5,.5,-.5,-.5,.5,.5,-.5,.5,.5,.5,.5],yl=[-.5,.5,-.5,.5,.5,-.5,.5,-.5,-.5,.5,-.5,-.5,-.5,-.5,-.5,-.5,.5,-.5],th=function(G,q){Mf(G,q,"_batchModelMap","_batchIndexMap"),gl(G,q,"_wireframeModelMap","_wireframeIndexMap"),gl(G,q,"_polylineModelMap","_polylineIndexMap"),gl(G,q,"_wireframeModelMapSwap","_wireframeIndexMapSwap"),gl(G,q,"_polylineModelMapSwap","_polylineIndexMapSwap")},Mf=function(p,u,O,W){if(!u)return p[O]={},p[W]={},void 0;var Y=u._id,M=p[W],I=M[Y];if(I){var H=p[O],T=I.batch,b=H[T],r=b.ds,S=I.index;if(b.invalidate=!0,delete M[Y],r.splice(S,1),gh(r))return delete H[T],void 0;for(var E=I.begin,q=I.size,Z=3*E,w=3*q,i=4*E,v=4*q,k=b.vs,x=b.ps,D=b.uv,h=b.cs,Q=b.bs,K=b.rs,j=b.ns,$=b.ls;S<r.length;S++)I=M[r[S]._id],I.index--,I.begin-=q;k.splice(Z,w),x.splice(i,v),D&&D.splice(2*E,2*q),h&&h.splice(i,v),Q&&Q.splice(Z,w),K&&K.splice(E,q),j&&j.splice(Z,w),$&&$.splice(E,q)}},gl=Mf,je=function(q,V,U,T){if(!T)return W;var y=V[T];if(!y){var r=vn[T]||Vp,Q=r.image?[]:W;y=V[T]={vs:[],ns:[],uv:Q,cs:Q?W:r.color?W:[],bs:r.blend?[]:W,ps:[],rs:r.brightness?[]:W,ds:[]}}return y.invalidate=!0,q[U._id]={index:y.ds.length,begin:y.vs.length/3,batch:T},y.ds.push(U),y},Fg=function(E,Y){return Y!=W&&1!==Y?[E[0]*Y,E[1]*Y,E[2]*Y,E[3]]:E},ii=function(i,K,s){var W=i.getBrightness(K),b=ho(s.color||"white"),X=b[3]<1,h=Math.ceil(s.width)||1,D=(X?"T":"O")+h,J=i._wireframeIndexMap,Q=i._wireframeModelMap,E=Q[D];E||(E=Q[D]={vs:[],cs:[],ps:[],ds:[],T:X,W:h});var L,r=i.getData3dUI(K),e=Gq(r);if(s.geometry){if(!e)return;if(L=ip(e),!L)return}else L=s.short?Kh:kk;E.invalidate=!0;var n=E.vs,t=E.cs,o=E.ds,x=J[K._id]={index:o.length,begin:n.length/3,batch:D};o.push(K);var u=Xg(K,s.mat),v=r._calcAnchorMat(K);v&&Mi(u,u,v),Rq(n,u,L);var w=x.size=n.length/3-x.begin;er(t,Fg(b,W),w)},gk=function(q,T,R,G,D,m,E,f,A){var c=q.getBrightness(T);c==W&&(c=1);var u=Fg(ho(G),c),M=u[3]<1;m=Math.ceil(m)||1;var b=(M?"T":"O")+m;if(E){var I=E[0],p=(E[1]||I)+I;b+="-"+I+"-"+p,A&&(b+="-"+Pl(A)+"-"+c,A=Fg(ho(A),c))}var B=q._polylineIndexMap,U=q._polylineModelMap,N=U[b];N||(N=U[b]={vs:[],cs:[],ps:[],ds:[],ls:E?[]:W,T:M,W:m},E&&(N.D=I,N.G=p,N.A=A)),N.invalidate=!0;var x,y=N.vs,j=N.cs,P=N.ds,e=N.ls,_=B[T._id]={index:P.length,begin:y.length/3,batch:b};P.push(T),em(y,R);var r,s=_.size=y.length/3-_.begin,Y=R.length,k=0,C=[];if(E||D)for(x=0;Y>x;x+=6)r=Nc([R[x],R[x+1],R[x+2]],[R[x+3],R[x+4],R[x+5]]),C.push(r),k+=r;if(k&&D){var z,F=Fg(ho(D),c),J=[F[0]-u[0],F[1]-u[1],F[2]-u[2],F[3]-u[3]],S=0;for(x=0;Y>x;x+=6)z=S/k,er(j,[u[0]+J[0]*z,u[1]+J[1]*z,u[2]+J[2]*z,u[3]+J[3]*z],1),S+=C[x/6],z=S/k,er(j,[u[0]+J[0]*z,u[1]+J[1]*z,u[2]+J[2]*z,u[3]+J[3]*z],1)}else er(j,u,s);if(E)for(S=f||0,x=0;Y>x;x+=6)e.push(S),S+=C[x/6],e.push(S)},gi=function(w,M,m){if(M)for(var R=4*M.begin,I=m[M.batch].ps,g=0;g<M.size;g++)I[R++]=w[0],I[R++]=w[1],I[R++]=w[2],I[R++]=w[3]},_j=function(p,x){var V=x+["32"],J=p[x],R=p[V];J?R&&R.length===J.length?(R.set(J),R.glBuf=null):p[V]=new or(J):delete p[V]},wm=function(J,A,x,s,E,R,X,t,P){if(zn(x))x.forEach(function(h){wm(J,A,h,s,E,R,X,t,P)});else if(Qc(x))wm(J,A,Gq(s,x),s,E,R,X,t,P);else if(ko(x)){var F,Y=ag(x.mat,A,J),Q=ag(x.s3,A,J),r=ag(x.t3,A,J),K=ag(x.r3,A,J);if((Q||K||r||Y)&&(F=qi(Y,Q,K,ag(x.rotationMode,A,J),r),R.push(F)),x.shape3d)wm(J,A,x.shape3d,s,E,R,X,t,x);else{var O=s.s;P=P||Vp;var N=R[0],H=R.length,l=O("shape3d.color",x.color,P.color);if(E||(E=O("shape3d.blend",x.blend,P.blend)),H>1){N=Pf(N);for(var u=1;H>u;u++)Mi(N,N,R[u])}x.vs&&O(ub,x.visible,P.visible)&&Yb(N,X,t,x.vs,x.uv,x.is,E,l),x.top_vs&&O(sb,x.topVisible,P.topVisible)&&Yb(N,X,t,x.top_vs,x.top_uv,x.top_is,E,O("shape3d.top.color",x.topColor,P.topColor)||l),x.bottom_vs&&O(Um,x.bottomVisible,P.bottomVisible)&&Yb(N,X,t,x.bottom_vs,x.bottom_uv,x.bottom_is,E,O("shape3d.bottom.color",x.bottomColor,P.bottomColor)||l),x.from_vs&&O(Ze,x.fromVisible,P.fromVisible)&&Yb(N,X,t,x.from_vs,x.from_uv,x.from_is,E,O("shape3d.from.color",x.fromColor,P.fromColor)||l),x.to_vs&&O(Fo,x.toVisible,P.toVisible)&&Yb(N,X,t,x.to_vs,x.to_uv,x.to_is,E,O("shape3d.to.color",x.toColor,P.toColor)||l)}F&&R.pop()}},Yb=function(r,L,c,x,G,F,J,k){var Y,l=L.cs,E=L.uv,Q=L.bs;if(F){Y=F.length;for(var w=0;Y>w;w++){var j=F[w];Rq(c,r,[x[3*j],x[3*j+1],x[3*j+2]]),E&&em(E,[G[2*j],G[2*j+1]])}}else Y=x.length/3,Rq(c,r,x),E&&em(E,G);l&&er(l,k,Y),Q&&(J?Cq(Q,J,Y):em(Q,Ho,Y))},Ob=function(p,f,d,n){var Q=[];n?wm(p.gv,p.data,n,p,p.getBodyColor(),[f],d,Q):(Zo(p,Ep,f,d,Q),Zo(p,bc,f,d,Q),Zo(p,_k,f,d,Q),Zo(p,Xl,f,d,Q),Zo(p,Im,f,d,Q),Zo(p,Cr,f,d,Q),Zo(p,"csg",f,d,Q)),Q.length&&(em(d.vs,Q),em(d.ns,$q(Q)))},Zo=function(g,m,M,Q,v){var N=g[m];if(N){var y=N.tuv;if(y){var x,G,p,P,T=N.uvScale,s=N.uvOffset;if(T)for(x=y.length,G=T[0],p=T[1],P=0;x>P;P+=2)y[P]*=G,y[P+1]*=p;if(s)for(x=y.length,G=s[0],p=s[1],P=0;x>P;P+=2)y[P]+=G,y[P+1]+=p}Yb(M,Q,v,N.vs,y,W,N.blend,N.color)}},ed=function(x,s,u,W,o,c,l,U){var z,w=u.cs,O=u.uv,I=u.bs;if(x.getFaceVisible(s,c)){var $=x.getFaceMat(s,c);if($&&(o=Xg(s,$)),Rq(l,o,U),w&&er(w,x.getFaceColor(s,c),6),O){var b=x.getFaceUv(s,c)||W[c+"Uv"],d=x.getFaceUvScale(s,c)||W[c+"UvScale"],Q=x.getFaceUvOffset(s,c)||W[c+"UvOffset"];b=b?[b[6],b[7],b[0],b[1],b[2],b[3],b[2],b[3],b[4],b[5],b[6],b[7]]:uk;var q=b[0],h=b[1],R=b[2],L=b[3],v=b[4],g=b[5],F=b[6],V=b[7],K=b[8],A=b[9],E=b[10],B=b[11];if(d){var f=d[0],H=d[1];q*=f,h*=H,R*=f,L*=H,v*=f,g*=H,F*=f,V*=H,K*=f,A*=H,E*=f,B*=H}if(Q){var t=Q[0],r=Q[1];q+=t,h+=r,R+=t,L+=r,v+=t,g+=r,F+=t,V+=r,K+=t,A+=r,E+=t,B+=r}O.push(q,h,R,L,v,g,F,V,K,A,E,B)}I&&(z=x.getBodyColor(s)||x.getFaceBlend(s,c),z?Cq(I,z,6):em(I,Ho,6))}},Vm=function(x,L,M,C){var k=x.getGL(),m=x._prg,j=x._buffer;if(!Jl(L)){Qr(x),eb(k,m);for(var N in L){var f=L[N];if(!(C&&!f.T||!C&&f.T)){f.invalidate?(f.invalidate=!1,_j(f,"vs"),_j(f,"cs"),_j(f,"ls"),_j(f,"ps")):M&&_j(f,"ps");var q=f.vs32,O=M?f.ps32:f.cs32;ve(k,m,f.W,W,j.vs,q);var X=f.D,A=!x._dashDisabled&&X;zr(k,m.uAlphaTest,F.alphaTest),A&&(zr(k,m.uDash,!0),zr(k,m.uDashDistance,X),zr(k,m.uDashGapDistance,f.G),Op(k,m.aLineDistance),Jb(k,j.lineDistance,f.ls32,m.aLineDistance,1),zr(k,m.uDiffuse,f.A||be));var a=!x._batchColorDisabled;a&&(zr(k,m.uBatchColor,!0),Op(k,m.aBatchColor),Jb(k,j.batchColor,O,m.aBatchColor,4)),Me(k),Ki(k,0,q.length/3,k.LINES),_c(k),a&&(zr(k,m.uBatchColor,!1),Xc(k,m.aBatchColor)),A&&(zr(k,m.uDash,!1),Xc(k,m.aLineDistance))}}bd(k,m)}},Qm=function(g,P,y){var x,$,b,Z,c,L,v,O,i,Q,h,m=g.getGL(),k=g._prg,d=g._buffer,p=g._batchModelMap;if(!Jl(p)){Qr(g);for(x in p)if($=vn[x]||Vp,!(y&&!$.transparent||!y&&$.transparent)&&(b=p[x],P||!$.transparentMask)){var T=y&&$.autoSort!==!1&&(g._33Q||b.invalidate);if(b.invalidate?(b.invalidate=!1,_j(b,"vs"),_j(b,"ns"),_j(b,"cs"),_j(b,"rs"),_j(b,"ps"),_j(b,"bs"),_j(b,"uv")):P&&_j(b,"ps"),c=b.vs32,L=P?b.ps32:b.cs32,i=b.uv32,v=b.bs32,O=b.rs32,h=c.length/3,T&&(b.is=Kf(c,g.getEye())),h){Z=$.light,Q=g.getTexture($.image),yo(m,k,W,$.light,$.opacity,$.reverseFlip,$.reverseColor,$.reverseCull),L?g._batchColorDisabled||(zr(m,k.uBatchColor,!0),Op(m,k.aBatchColor),Jb(m,d.batchColor,L,k.aBatchColor,4)):zr(m,k.uDiffuse,$.color||be);var s=$.alphaTest;zr(m,k.uAlphaTest,s===N?F.alphaTest:s);var o=v&&!g._batchBlendDisabled;o&&(zr(m,k.uBatchBlend,!0),Op(m,k.aBatchBlend),Jb(m,d.batchBlend,v,k.aBatchBlend));var E=O&&!g._batchBrightnessDisabled;E&&(zr(m,k.uBatchBrightness,!0),Op(m,k.aBatchBrightness),Jb(m,d.batchBrightness,O,k.aBatchBrightness,1)),i?Me(m,k,Q,$.discardSelectable,d.uv,i,$.uvOffset,$.uvScale):Me(m),Jb(m,d.vs,c,k.aPosition),Jb(m,d.ns,b.ns32,k.aNormal),b.is?(wl(m,d.is,b.is),Oi(m,0,h)):Ki(m,0,h),i?_c(m,k,Q):_c(m),L&&!g._batchColorDisabled&&(zr(m,k.uBatchColor,!1),Xc(m,k.aBatchColor)),o&&(zr(m,k.uBatchBlend,!1),Xc(m,k.aBatchBlend)),E&&(zr(m,k.uBatchBrightness,!1),Xc(m,k.aBatchBrightness)),Si(m,k)}}}},Kf=function(J,j){for(var S=J.length/3,f=new Array(S),i=S/3,e=new Array(i),C=0;i>C;C++)e[C]=C;e.sort(function(t,$){var V=9*t,N=[(J[V]+J[V+3]+2*J[V+6])/4,(J[V+1]+J[V+4]+2*J[V+7])/4,(J[V+2]+J[V+5]+2*J[V+8])/4];V=9*$;var Y=[(J[V]+J[V+3]+2*J[V+6])/4,(J[V+1]+J[V+4]+2*J[V+7])/4,(J[V+2]+J[V+5]+2*J[V+8])/4],u=Nc(j,N)-Nc(j,Y);return u>0?-1:0>u?1:0});for(var C=0;i>C;C++){var q=3*C,R=3*e[C];f[q]=R,f[q+1]=R+1,f[q+2]=R+2}return new br(f)},Up={obj:function(L,B){var Y={mat:L.mat,s3:L.s3,r3:L.r3,rotationMode:L.rotationMode,t3:L.t3,cube:L.cube==W?!0:L.cube,center:L.center==W?!0:L.center,ignoreMtls:L.ignoreMtls,ignoreTransparent:L.ignoreTransparent,ignoreColor:L.ignoreColor,ignoreImage:L.ignoreImage,ignoreNormal:L.ignoreNormal,prefix:L.prefix,flipY:L.flipY,flipFace:L.flipFace,reverseFlipMtls:L.reverseFlipMtls,finishFunc:function(c,D){if(c){var D=[];for(var b in c){var J=c[b];D.rawS3=J.rawS3,D.push(J),L.eachModel&&L.eachModel(b,J)}D.json=L,B(D)}else B()}};M.loadObj(L.obj,L.mtl,Y)}};M.getModelTypeHandlers=function(){return Up},M.setModelTypeHandler=function(Q,r){Up[Q]=r},M.getModelTypeHandler=function(o){return Up[o]},M.handleModelLoaded=function(){},M.handleUnfoundModel=function(){};var Fq=W,xc=W,Di=function(e){Fq&&!e._loadingModelView_&&(xc||(xc={}),xc[e._loadingModelView_=kg()]=e)},Tn=function(S,B){Fq||(Fq={});var Z=Fq[S];if(Z){if(Z.url===B)return;Z.request.onload=Gk,Z.request.onerror=Gk}var D=new XMLHttpRequest;if(Fq[S]={request:D,url:B},D.overrideMimeType&&D.overrideMimeType("text/plain"),B=M.beforeLoadURL(B),B.data){var u=M.parse(B.data);od(S,u,B)}else D.open("GET",encodeURI(B),!0),D.onload=function(z){if(200===this.status||0===this.status){var m=M.parse(z.target.response||z.target.responseText);od(S,m,B)}else up(S,M.handleUnfoundModel(S,B)||W)},D.onerror=function(){up(S,M.handleUnfoundModel(S,B)||W)},D.send(null)},od=function(E,J,Y){var t=J.modelType;if(!t)return up(E,J),M.handleModelLoaded(E,J),void 0;var S=M.getModelTypeHandler(t);if(S){var o=function(X){X?(up(E,X),M.handleModelLoaded(E,X)):up(E,M.handleUnfoundModel(E,Y)||W)};S(J,o)}else up(E,M.handleUnfoundModel(E,Y)||W)},up=function(d,M){if(Yk[d]=M,delete Fq[d],Jl(Fq)&&(Fq=W,xc)){for(var j in xc){var g=xc[j];g._2O&&(g._2O={}),g.invalidateAll&&g.invalidateAll(N,"modelLoaded",d),g.redraw&&g.redraw(),g.iv(),delete g._loadingModelView_}xc=W}if(M&&xc)for(var j in xc){var g=xc[j];g.invalidateAll&&g.invalidateAll(N,"modelLoading",d),g.redraw&&g.redraw(),g.iv()}},Wc=new or([0,0,0,1,1,1,1,0]),Ld=new or([0,0,1,0,0,1,0,0,1,0,0,1]),np=new br([0,1,2,2,3,0]),Sb=new or([-.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]),Ec=new br([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]),hm=new or([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]),mr=$q(Sb,Ec),Yl=(new or([-.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 br([0,1,2,3,0,7,5,4,6,7,5,3,2,4,6,1]),[Ep,_k,bc,Xl,Im,Cr]),kk=[-.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],Kh=[-.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],lf=function(r,H,n,W,J,y){y=y||16,r=r||16,H=H||0,n=n||r;var s,F,c,j,z,K,e,k,I=.5,i=[],G=[],t=C/r,_=l/y;for(s=0;y>s;s++)for(z=s+1,j=s*_,k=z*_,F=H;n>F;F++)K=F+1,c=F*t,e=K*t,i.push(I*b(j)*o(c),I*o(j),-I*b(j)*b(c),I*b(k)*o(e),I*o(k),-I*b(k)*b(e),I*b(j)*o(e),I*o(j),-I*b(j)*b(e),I*b(j)*o(c),I*o(j),-I*b(j)*b(c),I*b(k)*o(c),I*o(k),-I*b(k)*b(c),I*b(k)*o(e),I*o(k),-I*b(k)*b(e)),G.push(F/r,s/y,K/r,z/y,K/r,s/y,F/r,s/y,F/r,z/y,K/r,z/y);if(W){var L=[],A=[];for(c=H*t,s=0;y>s;s++)z=s+1,j=s*_,k=z*_,L.push(0,0,0,I*b(k)*o(c),I*o(k),-I*b(k)*b(c),I*b(j)*o(c),I*o(j),-I*b(j)*b(c)),A.push(0,.5,H/r,z/y,H/r,s/y)}if(J){var P=[],E=[];for(c=n*t,s=0;y>s;s++)z=s+1,j=s*_,k=z*_,P.push(0,0,0,I*b(j)*o(c),I*o(j),-I*b(j)*b(c),I*b(k)*o(c),I*o(k),-I*b(k)*b(c)),E.push(1,.5,n/r,s/y,n/r,z/y)}return{vs:i,uv:G,from_vs:L,from_uv:A,to_vs:P,to_uv:E}},ek=function(I,_,h){I=I||.17,_=_||12,h=h||18,0>I?I=0:I>.25&&(I=.25);var F,t,f,H,O,Z,N,U=.5,$=[],Q=[],n=[],g=C/h,q=C/_,S=U-I;for(t=0;_>=t;t++)for(H=-l+t*q,Z=o(H),O=b(H),F=0;h>=F;F++)f=F*g,N=S+I*Z,$.push(o(f)*N,O*I,-b(f)*N),Q.push(F/h,1-t/_);for(t=0;_>t;t++){var p=t*(h+1),X=(t+1)*(h+1);for(F=0;h>F;F++)n.push(p+F,X+F+1,X+F,p+F,p+F+1,X+F+1)}return{vs:$,uv:Q,is:n}},Hl=function(D,A,F,j,i,$,N){N=N||12,D=D||18,A=A||0,F=F||D,$=$||.17,0>$?$=0:$>.25&&($=.25);var s,y,O,T,d,R,w,X,K,p,I=.5,P=[],m=[],k=C/D,_=C/N,v=I-$;for(O=0;N>O;O++)for(T=O+1,w=-l+O*_,X=-l+T*_,s=A;F>s;s++)y=s+1,d=s*k,R=y*k,K=v+$*o(w),p=v+$*o(X),P.push(o(d)*K,b(w)*$,-b(d)*K,o(R)*K,b(w)*$,-b(R)*K,o(R)*p,b(X)*$,-b(R)*p,o(d)*K,b(w)*$,-b(d)*K,o(R)*p,b(X)*$,-b(R)*p,o(d)*p,b(X)*$,-b(d)*p),m.push(s/D,1-O/N,y/D,1-O/N,y/D,1-T/N,s/D,1-O/N,y/D,1-T/N,s/D,1-T/N);if(j){var g=[],z=[];for(O=0;N>O;O++)T=O+1,w=-l+O*_,X=-l+T*_,d=A*k,K=v+$*o(w),p=v+$*o(X),g.push(o(d)*K,b(w)*$,-b(d)*K,o(d)*p,b(X)*$,-b(d)*p,o(d)*v,0,-b(d)*v),z.push(.5+.5*o(w),.5-.5*b(w),.5+.5*o(X),.5-.5*b(X),.5,.5)}if(i){var Y=[],Q=[];for(O=0;N>O;O++)T=O+1,w=-l+O*_,X=-l+T*_,d=F*k,K=v+$*o(w),p=v+$*o(X),Y.push(o(d)*K,b(w)*$,-b(d)*K,o(d)*v,0,-b(d)*v,o(d)*p,b(X)*$,-b(d)*p),Q.push(.5-.5*o(w),.5-.5*b(w),.5,.5,.5-.5*o(X),.5-.5*b(X))}return{vs:P,uv:m,from_vs:g,from_uv:z,to_vs:Y,to_uv:Q}},wc=function(X,Q){for(var f,x,g,r=.5,u=16,c=[],j=[],V=[],A=C/u,s=0;u>=s;s++)f=s*A,x=o(f)*r,g=b(f)*r,c.push(x,-r,g,x,r,g),j.push(1-s/u,1,1-s/u,0);for(s=0;u>s;s++)V.push(2*s,2*s+1,2*s+3,2*s,2*s+3,2*s+2);if(Q){var q=[],y=[],E=[];for(q.push(0,-r,0),y.push(.5,.5),s=0;u>=s;s++)f=s*A,x=o(f),g=b(f),q.push(x*r,-r,-g*r),y.push(.5+.5*x,.5+.5*g);for(s=0;u>s;s++)E.push(0,s+2,s+1)}if(X){var N=[],p=[],S=[];for(N.push(0,r,0),p.push(.5,.5),s=0;u>=s;s++)f=s*A,x=o(f),g=b(f),N.push(x*r,r,-g*r),p.push(.5+.5*x,.5-.5*g);for(s=0;u>s;s++)S.push(0,s+1,s+2)}return{vs:c,uv:j,is:V,bottom_vs:q,bottom_uv:y,bottom_is:E,top_vs:N,top_uv:p,top_is:S}},Nl=function(R,D,t,P,F,k,j){R=R||12,D=D||0,t=t||R;for(var G,i,Y,$,H,d,X,h,u=.5,e=[],m=[],N=C/R,K=D;t>K;K++)G=K+1,i=K*N,Y=G*N,$=o(i)*u,H=b(i)*u,d=o(Y)*u,X=b(Y)*u,e.push($,-u,-H,d,-u,-X,$,u,-H,d,-u,-X,d,u,-X,$,u,-H),m.push(K/R,1,G/R,1,K/R,0,G/R,1,G/R,0,K/R,0);if(j){var a=[],W=[];for(K=D;t>K;K++)i=N*K,Y=N*(K+1),$=o(i),H=b(i),d=o(Y),X=b(Y),a.push($*u,-u,-H*u,0,-u,0,d*u,-u,-X*u),W.push(.5+.5*$,.5+.5*H,.5,.5,.5+.5*d,.5+.5*X)}if(k){var V=[],p=[];for(K=D;t>K;K++)i=N*K,Y=N*(K+1),$=o(i),H=b(i),d=o(Y),X=b(Y),V.push($*u,u,-H*u,d*u,u,-X*u,0,u,0),p.push(.5+.5*$,.5-.5*H,.5+.5*d,.5-.5*X,.5,.5)}if(P){var M=[],J=[];i=N*D,$=o(i)*u,H=b(i)*u,h=D/R,M.push(0,u,0,0,-u,0,$,-u,-H,$,-u,-H,$,u,-H,0,u,0),J.push(0,0,0,1,h,1,h,1,h,0,0,0)}if(F){var T=[],A=[];i=N*t,$=o(i)*u,H=b(i)*u,h=t/R,T.push(0,-u,0,0,u,0,$,u,-H,$,u,-H,$,-u,-H,0,-u,0),A.push(1,1,1,0,h,0,h,0,h,1,1,1)}return{vs:e,uv:m,bottom_vs:a,bottom_uv:W,top_vs:V,top_uv:p,from_vs:M,from_uv:J,to_vs:T,to_uv:A}},wf=function(V,Y,q,X,K){Y=Y||18,q=q||0,X=X==W?C:X,K=K==W?.5:K;for(var p,G,D,c,Q,z,j=[0,.5,.75,.875,.9375],g=[],F=[],a=[],k=X/Y,H=0;H<j.length;H++){var e=0===H%2?0:.5;for(p=0;Y>=p;p++)G=(p+e)*k+q,D=1-j[H],g.push(o(G)*K*D,-K+2*j[H]*K,-b(G)*K*D),F.push((p+e)/Y,D)}for(H=0;H<j.length-1;H++){var Z=H*(Y+1),O=(H+1)*(Y+1);for(p=0;Y>p;p++)a.push(Z+p,O+p+1,O+p,Z+p,Z+p+1,O+p+1)}for(z=g.length/3-(Y+1),p=0;Y>p;p++)g.push(0,K,0),F.push((p+.5)/Y,0);for(p=0;Y>p;p++)a.push(z+p,z+p+1,z+(Y+1)+p);if(V){var l=[],s=[],E=[];for(l.push(0,-K,0),s.push(.5,.5),p=0;Y>=p;p++)G=p*k+q,c=o(G),Q=b(G),l.push(c*K,-K,-Q*K),s.push(.5+.5*c,.5+.5*Q);for(p=0;Y>p;p++)E.push(0,p+2,p+1)}return{vs:g,uv:F,is:a,bottom_vs:l,bottom_uv:s,bottom_is:E}},So=function(D,s,R,W,M,d){D=D||16,s=s||0,R=R||D;for(var k=.5,$=[],w=[],Z=C/D,p=s;R>p;p++){var h=p+1,L=Z*p,n=Z*h;$.push(o(L)*k,-k,-b(L)*k,o(n)*k,-k,-b(n)*k,0,k,0),w.push(p/D,1,h/D,1,(p+h)/2/D,0)}if(d){var H=[],f=[];for(p=s;R>p;p++){L=Z*p,n=Z*(p+1);var A=o(L),S=b(L),q=o(n),V=b(n);H.push(A*k,-k,-S*k,0,-k,0,q*k,-k,-V*k),f.push(.5+.5*A,.5+.5*S,.5,.5,.5+.5*q,.5+.5*V)}}if(W){var Y=[],i=[];L=Z*s,Y.push(0,k,0,0,-k,0,o(L)*k,-k,-b(L)*k),i.push(0,0,0,1,s/D,1)}if(M){var c=[],E=[];L=Z*R,c.push(0,-k,0,0,k,0,o(L)*k,-k,-b(L)*k),E.push(1,1,1,0,R/D,1)}return{vs:$,uv:w,bottom_vs:H,bottom_uv:f,from_vs:Y,from_uv:i,to_vs:c,to_uv:E}},zo=function(Y,r,e,D,q,A,W,G){for(var d=[],N=0;N<Y.length-1;N+=2)d.push({x:Y[N],y:Y[N+1]});return Vk(d,r,e,D,q,A,W,G,!1)},Rd={roundRect:function(m,L){return zo([.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],m,L,3)},star:function(p,u){return zo([.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],p,u)},rect:function(C,z){return zo([.5,-.5,.5,.5,-.5,.5,-.5,-.5],[1,2,2,2,5],C,z)},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(n,t){return zo([0,-.5,.5,.5,-.5,.5],[1,2,2,5],n,t)},rightTriangle:function(O,j){return zo([.5,.5,-.5,.5,-.5,-.5],[1,2,2,5],O,j)},parallelogram:function(R,M){return zo([.5,-.5,.25,.5,-.5,.5,-.25,-.5],[1,2,2,2,5],R,M)},trapezoid:function(s,v){return zo([.25,-.5,.5,.5,-.5,.5,-.25,-.5],[1,2,2,2,5],s,v)}},Wq={sphere:1,cylinder:1,cone:1,torus:1},Pq={torus:1,sphere:1},Db=dr(ab(Rd),{cylinder:1}),gf=dr(ab(Rd),{cylinder:1,cone:1}),Lo=function(S,D,Q){var f,G=ag(S.mat,Q,D),W=ag(S.s3,Q,D),C=ag(S.t3,Q,D),s=ag(S.r3,Q,D);return(W||s||C||G)&&(f=Pf(D._6O),Qr(D,qi(G,W,s,ag(S.rotationMode,Q,D),C))),f},Ac=function(O,E,V,l,h,n,v){if(zn(V))V.forEach(function(s){Ac(O,E,s,l,h,n,v)});else if(Qc(V))Ac(O,E,Gq(l,V),l,h,n,v);else if(ko(V))if(V.shape3d){var r=Lo(V,O,E);Ac(O,E,V.shape3d,l,h,n,V),r&&ze(O,r)}else Wg(O,E,V,l.s,h,n,v)},Wg=function(B,g,F,P,$,S,c){if(c=c||Vp,!S||S(P("shape3d.transparent",F.transparent,c.transparent))){var X=Lo(F,B,g);aj(F);var V=B._26I,s=B._prg,p=B._buffer,H=P("shape3d.color",F.color,c.color);$||($=P("shape3d.blend",F.blend,c.blend));var b,l=F.opacity==W?c.opacity:F.opacity,q=P("shape3d.opacity");b=q!=W&&l!=W?l*q:l!=W?l:q,yo(V,s,$,P("shape3d.light",F.light,c.light),b,P("shape3d.reverse.flip",F.reverseFlip,c.reverseFlip),P("shape3d.reverse.color",F.reverseColor,c.reverseColor),P("shape3d.reverse.cull",F.reverseCull,c.reverseCull)),F.vs&&P(ub,F.visible,c.visible)&&Bg(V,s,p,H,B.getTexture(P("shape3d.image",F.image,c.image),g),P("shape3d.discard.selectable",F.discardSelectable,c.discardSelectable),F.vs,F.uv,F.ns,F.is,P("shape3d.uv.offset",F.uvOffset,c.uvOffset),P("shape3d.uv.scale",F.uvScale,c.uvScale)),F.top_vs&&P(sb,F.topVisible,c.topVisible)&&Bg(V,s,p,P("shape3d.top.color",F.topColor,c.topColor)||H,B.getTexture(P("shape3d.top.image",F.topImage,c.topImage),g),P("shape3d.top.discard.selectable",F.topDiscardSelectable,c.topDiscardSelectable),F.top_vs,F.top_uv,F.top_ns,F.top_is,P("shape3d.top.uv.offset",F.topUvOffset,c.topUvOffset),P("shape3d.top.uv.scale",F.topUvScale,c.topUvScale)),F.bottom_vs&&P(Um,F.bottomVisible,c.bottomVisible)&&Bg(V,s,p,P("shape3d.bottom.color",F.bottomColor,c.bottomColor)||H,B.getTexture(P("shape3d.bottom.image",F.bottomImage,c.bottomImage),g),P("shape3d.bottom.discard.selectable",F.bottomDiscardSelectable,c.bottomDiscardSelectable),F.bottom_vs,F.bottom_uv,F.bottom_ns,F.bottom_is,P("shape3d.bottom.uv.offset",F.bottomUvOffset,c.bottomUvOffset),P("shape3d.bottom.uv.scale",F.bottomUvScale,c.bottomUvScale)),F.from_vs&&P(Ze,F.fromVisible,c.fromVisible)&&Bg(V,s,p,P("shape3d.from.color",F.fromColor,c.fromColor)||H,B.getTexture(P("shape3d.from.image",F.fromImage,c.fromImage),g),P("shape3d.from.discard.selectable",F.fromDiscardSelectable,c.fromDiscardSelectable),F.from_vs,F.from_uv,F.from_ns,F.from_is,P("shape3d.from.uv.offset",F.fromUvOffset,c.fromUvOffset),P("shape3d.from.uv.scale",F.fromUvScale,c.fromUvScale)),F.to_vs&&P(Fo,F.toVisible,c.toVisible)&&Bg(V,s,p,P("shape3d.to.color",F.toColor,c.toColor)||H,B.getTexture(P("shape3d.to.image",F.toImage,c.toImage),g),P("shape3d.to.discard.selectable",F.toDiscardSelectable,c.toDiscardSelectable),F.to_vs,F.to_uv,F.to_ns,F.to_is,P("shape3d.to.uv.offset",F.toUvOffset,c.toUvOffset),P("shape3d.to.uv.scale",F.toUvScale,c.toUvScale)),Si(V,s),X&&ze(B,X)}},Bg=function(f,W,w,Q,T,m,C,Z,I,U,E,$){C&&(zr(f,W.uDiffuse,Q),Z?Me(f,W,T,m,w.uv,Z,E,$):Me(f),Jb(f,w.vs,C,W.aPosition),Jb(f,w.ns,I,W.aNormal),U?(Wn(f,w.is,U),Oi(f,0,U.length)):Ki(f,0,C.length/3),Z?_c(f,W,T):_c(f))},Gq=function(X,T){var Y=X.s;if(T||(T=Y(Mk)),!T)return W;var n=Eo(T);if(n)return n;if("text"===T){var K={amount:Y("shape3d.text.amount"),size:Y("shape3d.text.size"),font:Y("shape3d.text.font"),style:Y("shape3d.text.style"),weight:Y("shape3d.text.weight"),fill:Y("shape3d.text.fill"),curveSegments:Y("shape3d.text.curveSegments"),spacing:Y("shape3d.text.spacing")},j=X.gv.getShape3dText(X.data),F=j;for(var H in K)F+="_"+(K[H]===N?"U":K[H]);return X._cachedTextKey===F?X._cachedTextGeometry:(X._cachedTextKey=F,X._cachedTextGeometry=M.createTextGeometry(j,K))}var H=T;if(Wq[T]){var e=Y("shape3d.side"),J=Y("shape3d.side.from"),l=Y("shape3d.side.to"),b=Y(Ze),P=Y(Fo);3>e?(e=0,J=0,l=0,b=!1,P=!1):((J==W||0>J)&&(J=0),(l==W||l>e)&&(l=e),0===J&&l===e&&(b=!1,P=!1)),H+="-"+e+"-"+J+"-"+l+"-"+b+"-"+P}if(Db[T]){var u=Y(sb);H+="-"+u}if(gf[T]){var g=Y(Um);H+="-"+g}if("torus"===T){var i=Y("shape3d.torus.radius");0>i?i=0:i>.25&&(i=.25),H+="-"+i}if(Pq[T]){var G=Y(fq);H+="-"+G}return n=Jh[H],n||("box"===T?n=M.createBoxModel():Rd[T]?n=Rd[T](u,g):"sphere"===T?n=M.createSphereModel(e,J,l,b,P,G):T===fj?n=M.createCylinderModel(e,J,l,b,P,u,g):"cone"===T?n=M.createConeModel(e,J,l,b,P,g):"torus"===T&&(n=M.createTorusModel(e,J,l,b,P,i,G)),Jh[H]=n),n},aj=function(){var v=["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"],g=["is","top_is","bottom_is","from_is","to_is"];return z=rs(Wp.substr(Wp.indexOf("^#")+2)),ul(M[_m(Bn+v[15]+"n"+v[16])]())&&On()?function(s){s&&!s._complete_&&(s._complete_=!0,s.vs&&gh(s.ns)&&(s.ns=$q(s.vs,s.is)),s.top_vs&&gh(s.top_ns)&&(s.top_ns=$q(s.top_vs,s.top_is)),s.bottom_vs&&gh(s.bottom_ns)&&(s.bottom_ns=$q(s.bottom_vs,s.bottom_is)),s.from_vs&&gh(s.from_ns)&&(s.from_ns=$q(s.from_vs,s.from_is)),s.to_vs&&gh(s.to_ns)&&(s.to_ns=$q(s.to_vs,s.to_is)),v.forEach(function(M){var v=s[M];zn(v)&&(s[M]=new or(v))}),g.forEach(function(b){var M=s[b];zn(M)&&(s[b]=new br(M))}))}:void 0}(),Zc=function(O,d){var J=O[d];zn(J)&&(O[d]=new or(J))};dr(zh,{_25Q:function(R){R._16O=function(s,v,T,p,n,R,W,F,C){var V=this.info;if(V){var i,X,S,z,q,t,Y=Tq();if(Lq[v]?(i=V.p3,X=V.c1,S=V.c2):Zm[v]?(X=V.s1||V.c1,S=V.s2||V.c2):(X=V.t1||V.c1,S=V.t2||V.c2),i)t=cb(v,po,T,p,F,C);else{var K=Ie(S,X),m=Nc(X,S);z=[0,-B(K[2],K[0]),r(K[1]/m)],q="zyx",i=[(X[0]+S[0])/2,(X[1]+S[1])/2,(X[2]+S[2])/2],t=cb(v,[m,0,0],T,p,F,C)}return Ic(Y,t,i,p,n,R,W,s,z,q)}return $m},R._80o=function(V,h,E){var H=this,u=H.shapeModel;if(u){var r=H.gv;Qr(r),Ac(r,H.data,u,H,H.getBodyColor(),E)}},R.createLineModel=function(o,a,n,i,H){for(var x=this,m=x.s,j=rp(o,a,m(fq)),Y=[],I=0;I<j.length;I++){var T=j[I],k=T.length;if(k>1){var l=T[0];Y.push(l.x,l.y,l.z);for(var w=1;k-1>w;w++)l=T[w],Y.push(l.x,l.y,l.z),Y.push(l.x,l.y,l.z);l=T[k-1],Y.push(l.x,l.y,l.z)}}var $,p,L,v=m(i+".color"),V=m(H),P=0;return V&&(p=m(H+".color"),$=m(H+".pattern"),P=m(H+".offset"),L=v),gk(x.gv,x.data,Y,p||v,L?W:m(i+".gradient.color"),n,$||m(i+".pattern"),P,L),j},R.createTubeModel=function(p,r,T,O){for(var e=this,l=e.s,g=l("shape3d.side")||Er,C=l("shape3d.start.angle"),o=l("shape3d.sweep.angle"),L=l(sb)?l("shape3d.top.cap"):W,t=l(Um)?l("shape3d.bottom.cap"):W,Q="flat"===L,c="flat"===t,H=Q&&(O?O.uv:l("shape3d.top.image")),U=c&&(O?O.uv:l("shape3d.bottom.image")),Y=O?O.uv:l("shape3d.image"),I={vs:[],uv:Y?[]:W,top_vs:Q?[]:W,top_uv:H?[]:W,bottom_vs:c?[]:W,bottom_uv:U?[]:W},s=rp(p,r,l(fq),T),h=0,w=s.length;w>h;h++)vd(I,s[h],l(Rj),T,g,C,o,L,t);if(O){var n=[];wm(e.gv,e.data,I,e,e.getBodyColor(),[],O,n),n.length&&(em(O.vs,n),em(O.ns,$q(n)))}else e.shapeModel=I;return s},R.getCache=function(){var k=this.info;if(k){var X=k.list;if(X){var d=k.cache;return d||(d=k.cache=Md(X)),d}}return W}}});var Xb=function(N,n){for(var C,D=0,e=N.length,T=0,U=e-1;U>=T;)if(D=i(T+(U-T)/2),C=N[D].length-n,0>C)T=D+1;else{if(!(C>0)){U=D;break}U=D-1}D=U;var y=N[D],a=y.point;return D===e-1||y.length===n||(a=(new Sd).subVectors(N[D+1].point,a).normalize().multiplyScalar(n-y.length).add(a)),{point:a,tangent:y.tangent}},Md=function($){for(var C,X,d=[],Q=0,c=0;c<$.length;c++){for(var G=$[c],o=0;o<G.length;o++){C=G[o],X&&(Q+=X.distanceTo(C));var K=new Sd,N=G[o+1];N?K.subVectors(N,C):X?K.subVectors(C,X):K.x=1,K.normalize(),d.push({point:C,length:Q,tangent:K}),X=C}X=null}return d},rp=function(u,Y,S,Z){S=S||Ok;for(var F=[],f=0,t=u.size();t>f;f++){var U=u.get(f);F.push(new Sd(U.x,U.e||0,U.y))}Y&&(Tc(Y)&&(Y=Y._as),Y.length||(Y=null));for(var x,L,c,Q,a,p=[],V=0,d=0,I=Y?Y.length:t;I>d;d++)if(a=Y?Y[d]:0===d?1:2,1===a)p.push(c=[]),c.push(F[V++]);else if(2===a||5===a)if(Q=2===a?F[V++]:c[0],Z){var w=Y?Y[d+1]:I>d+1?2:W;if(2===w||5===w){var k=c[c.length-1],E=2===w?F[V]:c[0],g=(new Sd).subVectors(k,Q),A=(new Sd).subVectors(E,Q),r=g.length(),X=A.length();if(r&&X)if(Z>r/2&&Z>X/2)c.push(Q);else for(g.multiplyScalar(D(Z,r/2)/r).add(Q),A.multiplyScalar(D(Z,X/2)/X).add(Q),x=new Mq(g,Q,A).getPoints(S),L=0;S>=L;L++)c.push(x[L])}else c.push(Q)}else c.push(Q);else if(3===a)for(x=new Mq(c[c.length-1],F[V++],F[V++]).getPoints(S),L=1;S>=L;L++)c.push(x[L]);else if(4===a)for(x=new an(c[c.length-1],F[V++],F[V++],F[V++]).getPoints(S),L=1;S>=L;L++)c.push(x[L]);return p},ud=function(L){for(var m,W,K=new Sd,H=[],D=[],a=[],A=0,Z=L.length;Z>A;A++)m=L[A],W=L[A+1],W?K.subVectors(W,m):K.subVectors(m,L[A-1]),H.push(K.normalize().clone());var V,T,s,e,o=new Sd,v=new Sd,P=new af,x=1e-4,l=Number.MAX_VALUE,N=H[0],g=D[0]=new Sd,z=a[0]=new Sd;for(T=t(N.x),s=t(N.y),e=t(N.z),l>=T&&(l=T,o.set(1,0,0)),l>=s&&(l=s,o.set(0,1,0)),l>=e&&o.set(0,0,1),v.crossVectors(N,o).normalize(),g.crossVectors(N,v),z.crossVectors(N,g),A=1;Z>A;A++)D[A]=D[A-1].clone(),a[A]=a[A-1].clone(),v.crossVectors(H[A-1],H[A]),v.length()>x&&(v.normalize(),V=f(qo(H[A-1].dot(H[A]),-1,1)),D[A].applyMatrix4(P.makeRotationAxis(v,V))),a[A].crossVectors(H[A],D[A]);return{B:a,T:H,N:D}},vd=function(){var w=function(R){for(var L=1;L<arguments.length;L++){var N=arguments[L];R.push(N.x,N.y,N.z)}},s=function(Z){for(var x=1;x<arguments.length;x++){var F=arguments[x].uv;Z.push(F[0],F[1])}},z=function(y,s,u,I,x){var d=-I*o(x),T=I*b(x);return new Sd(y.x+d*u.x+T*s.x,y.y+d*u.y+T*s.y,y.z+d*u.z+T*s.z)},Y=function(E,t,u,y,G,x,r,g){r=r||C;for(var k=[],h=r/G,N=0;G>=N;N++){var w=z(E,t,u,y,N*h+x);k.push(w),g!=W&&(w.uv=[g,N/G])}return k},H=function(j,k,T,W,i,D,d,P,G){G=G||C;var e=k?j.top_vs:j.bottom_vs;if(e)for(var N=k?j.top_uv:j.bottom_uv,h=G/d,q=0;d>q;q++){var c,Q;k?(c=q*h+P,Q=(q+1)*h+P):(Q=q*h+P,c=(q+1)*h+P),w(e,z(T,W,i,D,c),z(T,W,i,D,Q),T),N&&N.push(.5-.5*o(c),.5-.5*b(c),.5-.5*o(Q),.5-.5*b(Q),.5,.5)}};return function(o,e,p,t,C,L,A,q,$){var k=e.length;if(k>1){var r,V,D,b,X,h,n,u=ud(e),K=u.T,f=u.N,F=u.B;"flat"===q&&H(o,!0,e[0],F[0],f[0],t,C,L,A),"flat"===$&&H(o,!1,e[k-1],F[k-1],f[k-1],t,C,L,A);var c,I,Q=[],l=J(C/2),m="round"===q,B="round"===$,i=e[0],S=K[0],U=F[0],E=f[0],P=e[k-1],j=K[k-1],M=F[k-1],z=f[k-1];if(m){for(D=1;l>=D;D++)f.splice(0,0,E),F.splice(0,0,U),K.splice(0,0,S),I=-D/l*t,e.splice(0,0,S.clone().multiplyScalar(I).add(i)),Q[l-D]=v(t*t-I*I);k+=l}if(B){for(D=1;l>=D;D++)f.push(z),F.push(M),K.push(j),I=D/l*t,e.push(j.clone().multiplyScalar(I).add(P)),Q[e.length-1]=v(t*t-I*I);k+=l}if(o.uv){var T=0,O=0,d=[];for(p&&(T=p),X=e[0],d[0]=0,D=1;k>D;D++)b=e[D],d[D]=X.distanceTo(b),X=b,p||(T+=d[D]);for(c=[],D=0;k>D;D++)O+=d[D],c[D]=T?O/T:0}for(D=0;k>D;D++){if(b=e[D],h=F[D],n=f[D],r=Y(b,h,n,Q[D]===N?t:Q[D],C,L,A,c?c[D]:W),V)for(var x=0;C>x;x++){var Z=V[x],R=V[x+1]||V[0],G=r[x],y=r[x+1]||r[0];w(o.vs,R,Z,G,G,y,R),o.uv&&s(o.uv,R,Z,G,G,y,R)}V=r}}}}();dr(M,{getLineLength:function(M){return M[M.length-1].length},getLineOffset:function(M,F){return Xb(M,F)},getLineCacheInfo:function(B,O,k,r){return Md(rp(B,O,k,r))}});var dn=c.Light=function(){Ne(dn,this),this.s(he,F[he]),this.s(Mk,"sphere"),this.s3(20,20,20)};Sj("Light",ur,{_image:"light_icon",_icon:"light_icon",onStyleChanged:function(G,Y,m){dn.superClass.onStyleChanged.apply(this,arguments),G===he&&this.s("shape3d.color",m)}});var Wi=Of.Graph3dView=function(m,v){var G=this;G._attributes=v||M.graph3dViewAttributes,G._25I={},G._view=Ko(1,G);var A=G._canvas=Nr(G._view);A.addEventListener("webglcontextlost",function(e){e.preventDefault(),ih(G),G._26I&&G._doBufferGC(G._26I,!0),G._26I=W,G._1o.texture=W,G._35O=!0},!1),A.addEventListener("webglcontextrestored",function(){G._35O=!1,G.iv()},!1),G._batchIndexMap={},G._batchModelMap={},G._wireframeIndexMap={},G._wireframeModelMap={},G._wireframeIndexMapSwap={},G._wireframeModelMapSwap={},G._polylineIndexMap={},G._polylineIndexMap={},G._polylineIndexMapSwap={},G._polylineIndexMapSwap={},G._8O=[],G._7O=Tq(),G._6O=Tq(),G._1o=new tr(G),G._30O=new il(G),G._31O=new Ai(G),G._32O=new Do(G),G._raycaster=new vf(G),G.vr=new fe(G),G._33Q=!0,G._eye=ab(M.graph3dViewEye),G._center=ab(M.graph3dViewCenter),G._up=ab(M.graph3dViewUp),G._lightChanged=!1,G._59O=[],G._spots=[],G._dirs=[],G._frameId=0,G.overlappingBox=new ue(G),G.dm(m?m:new Hk),G._coreInteractor=new aq(this),G.setInteractors([new Xm(G)])},Kc={fogDisabled:1,dashDisabled:1,batchColorDisabled:1,batchBlendDisabled:1,batchBrightnessDisabled:1},jj=0;Ej("Graph3dView",R,{ms_v:1,ms_tip:1,ms_gv:1,ms_dm:1,ms_lp:1,ms_fire:1,ms_sm:1,_51o:1,ms_ac:["devicePixelRatio","boundaries","moveStep","rotateStep","editHelperDisabled","sizeEditableFunc","rotationEditableFunc","editableFunc","rotatable","zoomable","pannable","walkable","resettable","mouseRoamable",Jj,ls,"firstPersonMode",id,"movableFunc","gridVisible","gridSize","gridGap","gridColor","originAxisVisible","centerAxisVisible","axisXColor","axisYColor","axisZColor","editSizeColor","rectSelectable","rectSelectBackground","headlightRange","headlightColor","headlightIntensity","headlightDisabled","ortho","orthoWidth","fovy","near","far",fs,uf,"up","aspect","fogDisabled","fogColor","fogNear","fogFar","dashDisabled","batchColorDisabled","batchBlendDisabled","batchBrightnessDisabled","hoverDelay"],_editable:!1,_editHelperDisabled:M.graph3dViewEditHelperDisabled,_devicePixelRatio:N,_boundaries:N,_moveStep:M.graph3dViewMoveStep,_rotateStep:M.graph3dViewRotateStep,_pannable:M.graph3dViewPannable,_rotatable:M.graph3dViewRotatable,_walkable:M.graph3dViewWalkable,_resettable:M.graph3dViewResettable,_zoomable:M.graph3dViewZoomable,_firstPersonMode:M.graph3dViewFirstPersonMode,_mouseRoamable:M.graph3dViewMouseRoamable,_gridVisible:M.graph3dViewGridVisible,_gridSize:M.graph3dViewGridSize,_gridGap:M.graph3dViewGridGap,_gridColor:M.graph3dViewGridColor,_originAxisVisible:M.graph3dViewOriginAxisVisible,_centerAxisVisible:M.graph3dViewCenterAxisVisible,_axisXColor:M.graph3dViewAxisXColor,_axisYColor:M.graph3dViewAxisYColor,_axisZColor:M.graph3dViewAxisZColor,_ortho:M.graph3dViewOrtho,_orthoWidth:M.graph3dViewOrthoWidth,_fovy:M.graph3dViewFovy,_near:M.graph3dViewNear,_far:M.graph3dViewFar,_headlightColor:M.graph3dViewHeadlightColor,_headlightIntensity:M.graph3dViewHeadlightIntensity,_headlightRange:M.graph3dViewHeadlightRange,_headlightDisabled:M.graph3dViewHeadlightDisabled,_rectSelectable:M.graph3dViewRectSelectable,_rectSelectBackground:M.graph3dViewRectSelectBackground,_editSizeColor:M.graph3dViewEditSizeColor,_autoMakeVisible:Zd,_fogDisabled:M.graph3dViewFogDisabled,_fogColor:M.graph3dViewFogColor,_fogNear:M.graph3dViewFogNear,_fogFar:M.graph3dViewFogFar,_dashDisabled:M.graph3dViewDashDisabled,_batchColorDisabled:M.graph3dViewBatchColorDisabled,_batchBlendDisabled:M.graph3dViewBatchBlendDisabled,_batchBrightnessDisabled:M.graph3dViewBatchBrightnessDisabled,setEye:function(r,t,L){1===arguments.length&&(t=r[1],L=r[2],r=r[0]);
- var l=this._eye;l[0]=r,l[1]=t,l[2]=L,this.fp(fs,W,l)},setCenter:function(D,p,k){1===arguments.length&&(p=D[1],k=D[2],D=D[0]);var g=this._center;g[0]=D,g[1]=p,g[2]=k,this.fp(uf,W,g)},setUp:function(J,A,p){1===arguments.length&&(A=J[1],p=J[2],J=J[0]);var u=this._up;u[0]=J,u[1]=A,u[2]=p,this.fp("up",W,u)},isTransparentMask:function(z){return z.s("transparent.mask")},getCoreInteractor:function(){return this._coreInteractor},getAspect:function(){var z=this,q=z._aspect;return q?q:z.getWidth()/z.getHeight()},getCanvas:function(){return this._canvas},setDataModel:function(H){var $=this,M=$._dataModel,j=$._selectionModel;M!==H&&(M&&(M.ump($.handleDataModelPropertyChange,$),M.umm($.handleDataModelChange,$),M.umd($.handleDataPropertyChange,$),j||M.sm().ums($.handleSelectionChange,$)),$._dataModel=H,H.mp($.handleDataModelPropertyChange,$),H.mm($.handleDataModelChange,$),H.md($.handleDataPropertyChange,$),j?j._21I(H):H.sm().ms($.handleSelectionChange,$),$.invalidateAll(!0),$.invalidateLight(),$.fp(ol,M,H),$._canvas.style.background=H.getBackground()||"")},handleDataModelPropertyChange:function(V){if("background"===V.property){var N=this._canvas.style.background,Z=V.newValue||"";this._canvas.style.background=Z,this.fp("canvasBackground",N,Z)}},handleDataPropertyChange:function(G){var s=G.data;this.invalidateData(s),uh(s)&&"s:light.type"===G.property&&this.invalidateLight()},invalidateLight:function(){this._lightChanged||(this._lightChanged=!0,this.iv())},onPropertyChanged:function(X){var O=this,N=X.property;O.iv(),O._18Q=W,"eye"===N?O._33Q=!0:"devicePixelRatio"===N?O._42(W,O._devicePixelRatio||Qd):Kc[N]&&ih(O)},_5O:function(M){var w=M._22Q();return w?new w(this,M):W},getData3dUI:function(A){var O=this._25I[A._id];return O===N&&(O=this._5O(A),this._25I[A._id]=O),O},invalidateAll:function(e){var O=this;if(e){for(var I in O._25I){var m=O._25I[I];m&&m.dispose()}O._25I={},O.iv(),th(O)}else th(O),O.dm().each(function(K){O.invalidateData(K)})},invalidateSelection:function(){var A=this;A.sm().each(function(j){A.invalidateData(j)})},invalidateData:function(F){var f=this,g=f.getData3dUI(F);g&&(g.iv(),f.iv()),th(f,F)},getShape3dText:function(h){return h.getStyle("shape3d.text")||this.getLabel(h)},invalidateBatch:function(y){var V=this,A=V._batchModelMap,o=A[y],_=[],i={};if(o){o.ds.forEach(function(y){var W=V.getData3dUI(y);W&&W.iv(),delete V._batchIndexMap[y._id],_.push(y._id)}),delete A[y];for(var C,j,X,$,k,e,P,J,h,Z=["_wireframeModelMap","_polylineModelMap","_wireframeModelMapSwap","_polylineModelMapSwap"],M=["_wireframeIndexMap","_polylineIndexMap","_wireframeIndexMapSwap","_polylineIndexMapSwap"],L=0;L<Z.length;L++){var n=V[Z[L]],t=V[M[L]];for(i={},J=0;J<_.length;J++){var I=t[_[J]];if(I){delete t[_[J]],h=I.batch,C=n[h];var E=I.begin,c=I.size,w=3*E,r=3*c,x=4*E,p=4*c;for(j=C.ds,X=C.vs,$=C.cs,k=C.ps,e=C.ls,P=I.index,C.invalidate=!0,j[P]=N,P=w;w+r>P;P++)X[P]=N;for(P=x;x+p>P;P++)$[P]=N;for(P=x;x+p>P;P++)k[P]=N;if(e)for(P=w;w+r>P;P++)e[P]=N;i[h]=!0}}for(h in i){C=n[h],j=C.ds,X=C.vs,$=C.cs,k=C.ps,e=C.ls;var l=[];for(P=0;P<j.length;P++)j[P]!==N&&l.push(j[P]);if(0===l.length)delete n[h];else{for(C.ds=l,l=[],P=0;P<X.length;P++)X[P]!==N&&l.push(X[P]);for(C.vs=l,l=[],P=0;P<$.length;P++)$[P]!==N&&l.push($[P]);for(C.cs=l,l=[],P=0;P<k.length;P++)k[P]!==N&&l.push(k[P]);if(C.ps=l,e){for(l=[],P=0;P<e.length;P++)e[P]!==N&&l.push(e[P]);C.ls=l}}}}V.iv()}},handleDataModelChange:function(O){var N=this,r=O.kind,T=O.data;if("add"===r)N.invalidateData(T),Fe(T)&&T.getEdgeGroup()&&T.getEdgeGroup().eachSiblingEdge(N.invalidateData,N),uh(T)&&N.invalidateLight();else if(r===As){var F=T._id,X=N._25I[F];X&&(X.dispose(),delete N._25I[F],N.iv()),T===N._currentSubGraph&&N.setCurrentSubGraph(W),th(N,T),uh(T)&&N.invalidateLight()}else r===Ln&&(N.invalidateAll(!0),N.setCurrentSubGraph(W),th(N),N.invalidateLight())},toCanvas:function(m){var I=this,h=I.getGL();if(I.validate(),m){var q=h.getParameter(h.COLOR_CLEAR_VALUE);yn(h,m)}I._42(W,1);var z=I.getWidth(),k=I.getHeight(),a=new Uint8Array(4*z*k),Q=Nr(),U=Q.getContext("2d");h.readPixels(0,0,z,k,h.RGBA,h.UNSIGNED_BYTE,a),Bi(Q,z,k,1);for(var N=U.getImageData(0,0,z,k),s=N.data,T=0;T<s.length;T+=4){var e=T/4,X=i(e/z),R=e-X*z;e=4*((k-1-X)*z+R),s[e]=a[T],s[e+1]=a[T+1],s[e+2]=a[T+2],s[e+3]=a[T+3]}return U.putImageData(N,0,0),m&&yn(h,q),I._42(W,I._devicePixelRatio||Qd),Q},toDataURL:function(E,P){var B=this,J=B.getGL();if(B.validate(),E){var w=J.getParameter(J.COLOR_CLEAR_VALUE);yn(J,E)}B._42(W,1);var n=B._canvas.toDataURL(P||"image/png",1);return E&&yn(J,w),B._42(W,B._devicePixelRatio||Qd),n},getGL:function(){var K=this,H=K._26I,z=K._prg;if(!H)try{K._2O={},H=K._26I=K._canvas.getContext("webgl",K._attributes)||K._canvas.getContext("experimental-webgl",K._attributes),H._emptyTexture=Co(H),H._emptyBlendTexture=Co(H),H._bufPool=[],H._id=++jj,K._buffer={vs:Oe(H),ns:Oe(H),is:Oe(H),uv:Oe(H),batchColor:Oe(H),batchBlend:Oe(H),batchBrightness:Oe(H),lineDistance:Oe(H)},K._1O=zp(H);var T=K._cube={vs:Oe(H),ns:Oe(H),is:Oe(H),uv:Oe(H)};dk(H,T.vs,Sb),dk(H,T.ns,mr),dk(H,T.uv,hm),wl(H,T.is,Ec)}catch(w){}if(H&&!z){if(z=K._prg=H.createProgram(),!z)return W;var X=K._dirs.length,t=K._spots.length,q=K._59O.length,v=["uPMatrix","uMVMatrix","uNMatrix","uViewMatrix","aNormal","aUv","uOffsetScale","uDiffuse","uBlend","uBlendColor","uBrightness","uPartOpacity","uAlphaTest","uTransparent","uTexture","uBlendTexture","uSampler","uBlendSampler","uDiscardSelectable","uFix","uPick","uReverseFlip","uFixPickReverseColor","uBatchBrightness","aBatchBrightness","uBatchColor","aBatchColor","uBatchBlend","aBatchBlend","uDash","aLineDistance","uDashDistance","uDashGapDistance","uLight","uHeadlightRange","uHeadlightColor","uFogColor","uFogNear","uFogFar"];X&&v.push("uDirColor","uDirDirection"),t&&v.push("uSpotColor","uSpotRange","uSpotAngle","uSpotExponent","uSpotPosition","uSpotDirection"),q&&v.push("uPointColor","uPointRange","uPointPosition"),yn(H,[0,0,0,0]),H.clearDepth(1),H.enable(H.DEPTH_TEST),H.depthFunc(H.LEQUAL),H.enable(H.BLEND),H.blendFuncSeparate(H.SRC_ALPHA,H.ONE_MINUS_SRC_ALPHA,H.ONE,H.ONE_MINUS_SRC_ALPHA),Qg||(Wp=rs(Wp.substring(0,Wp.indexOf("^#"))),Rb=rs(Rb),Qg=!0);var Y=["#define MAX_DIR "+X,"#define MAX_SPOT "+t,"#define MAX_POINT "+q,K._fogDisabled?"":"#define FOG",K._dashDisabled?"":"#define DASH",K._batchColorDisabled?"":"#define BATCHCOLOR",K._batchBlendDisabled?"":"#define BATCHBLEND",K._batchBrightnessDisabled?"":"#define BATCHBRIGHTNESS",""].join("\n"),G=lq(H,z,H.VERTEX_SHADER,Wp.replace("PREFIX",Y)),a=lq(H,z,H.FRAGMENT_SHADER,Rb.replace("PREFIX",Y));O?v.push("aPosition"):(z.aPosition=0,H.bindAttribLocation(z,0,"aPosition")),H.linkProgram(z),v.forEach(function(e){z[e]=/^u/.test(e)?H.getUniformLocation(z,e):H.getAttribLocation(z,e)}),H.useProgram(z),H.deleteShader(G),H.deleteShader(a)}return H},getBrightness:function(n){var w=n.s("brightness"),u=this.isSelected(n)?n.s("select.brightness"):W;return w==W?u:u==W?w:w*u},getWireframe:function(q){var J=q.s("wf.visible"),h=q.s("wf.width");return J===!0||h>0&&"selected"===J&&this.isSelected(q)?{color:q.s("wf.color"),width:h,"short":q.s("wf.short"),mat:q.s("wf.mat")}:void 0},_transformPointToViewSpace:function(i){var e=[i[0],i[1],i[2]];return ge(e,this._viewMatrix),e},_transformDirectionToViewSpace:function(f,h){var H=[f[0],f[1],f[2]];ge(H,this._viewMatrix);var U=h?[h[0],h[1],h[2]]:[0,0,0];ge(U,this._viewMatrix);var Q=U[0]-H[0],C=U[1]-H[1],g=U[2]-H[2],P=Math.sqrt(Q*Q+C*C+g*g);return P?[Q/P,C/P,g/P]:[Q,C,g]},getWireframeGeometry:function(F){return F.s("wf.geometry")?{color:F.s("wf.color"),width:F.s("wf.width"),mat:F.s("wf.mat"),geometry:!0}:void 0},getBodyColor:function(Q){return Q.s("body.color")},getMat:function(a){return a.getMat?a.getMat():a.s("mat")},getFaceMat:function(H,A){return H.getFaceMat?H.getFaceMat(A):H.s(A+".mat")},getFaceBlend:function(G,E){return G.s(E+".blend")||G.s("all.blend")},getFaceColor:function(C,e){return C.s(e+".color")||C.s("all.color")},getFaceImage:function(q,K){return q.s(K+".image")||q.s("all.image")},getFaceBlendImage:function(O,$){return O.s($+".blend.image")||O.s("all.blend.image")},getFaceDiscardSelectable:function(n,d){var Q=n.s(d+".discard.selectable");return Q==W?n.s("all.discard.selectable"):Q},getFaceUv:function(r,I){return r.s(I+".uv")||r.s("all.uv")},getFaceUvOffset:function(t,r){return t.s(r+".uv.offset")||t.s("all.uv.offset")},getFaceUvScale:function(g,a){return g.s(a+".uv.scale")||g.s("all.uv.scale")},getFaceLight:function(o,Q){var m=o.s(Q+".light");return m==W?o.s("all.light"):m},getFaceVisible:function(C,B){var m=C.s(B+".visible");return m==W?C.s("all.visible"):m},getFaceOpacity:function(d,R){var L=d.s(R+".opacity");return L==W?d.s("all.opacity"):L},getFaceTransparent:function(J,n){var V=J.s(n+".transparent");return V==W?J.s("all.transparent"):V},getFaceReverseColor:function(w,P){return w.s(P+".reverse.color")||w.s("all.reverse.color")},getFaceReverseFlip:function(I,_){var M=I.s(_+".reverse.flip");return M==W?I.s("all.reverse.flip"):M},getFaceReverseCull:function(A,C){var M=A.s(C+".reverse.cull");return M==W?A.s("all.reverse.cull"):M},getTextureMap:function(){return this._2O},deleteTexture:function(K){var J=this,v=J._2O[K];v&&(delete J._2O[K],J.getGL().deleteTexture(v))},invalidateShape3dCachedImage:function(Z){var l=this.getData3dUI(Z);l.invalidateCachedTexture(this.getGL())},isInteractive:function(n){return n.s("interactive")},getTexture:function(x,G){if(!x)return W;var v=this,u=v.getGL(),z=v._2O[x];if(!z){var A=eo(x);if(A)if(A.tagName){if(A.dynamic)return zp(u,A,v._1O);z=v._2O[x]=zp(u,A)}else{var q,r=G&&G.s("shape3d.image.cache")&&!v.isInteractive(G);if(r&&(q=v.getData3dUI(G),z=q.getCachedTexture()),!z){var c=G&&G.s("shape3d.fixSizeOnScreen"),d=c?u.NEAREST:u.LINEAR;c||G&&G.s("shape3d.vector.dynamic")&&(q||(q=v.getData3dUI(G)),c=q.getVectorDynamicSize());var i=G&&G.s("shape3d.texture.scale")||1,m=c&&c[0]>0?c[0]:i*ef(A,G),l=c&&c[1]>0?c[1]:i*fc(A,G);if(m>=1&&l>=1){var V=ap(m,l);if(!q&&G&&(q=v.getData3dUI(G)),q&&q.interactiveInfo){var O=q.interactiveInfo[x]={};V.interactiveInfo=O.bodyInfo={compInfos:[],matrix:new lp,rect:{x:0,y:0,width:m,height:l}}}gc(V,A,0,0,m,l,G,v),V.interactiveInfo&&(V.interactiveInfo=null),V.restore(),r&&bj(A,G)?(z=zp(u,Yp,null,d),q.setCachedTexture(z),Yp=null):z=zp(u,Yp,v._1O,d)}}}}return z},redraw:function(){this.iv()},validateImpl:function(){var t=this;if(t._lightChanged){t._lightChanged=!1;var V=[],i=[],s=[];t.dm().each(function(j){if(uh(j)){var K=j.s("light.type");K===nc?V.push(j):K===zq?i.push(j):K===Lj&&s.push(j)}}),(V.length!==t._59O.length||i.length!==t._spots.length||s.length!==t._dirs.length)&&ih(t),t._59O=V,t._spots=i,t._dirs=s}t._42(),t._1o.iv()},getRenderInfo:function(){var F=this.getGL();return F?F._renderInfo:void 0},showDebugTip:function(){var k=this,O=k._debugDiv;if(!O){O=k._debugDiv=m.createElement("div"),O.style.position="absolute",O.style.overflow="hidden",O.style.backgroundColor="white",O.style.color="black";var D=k.getView();k._79O?D.insertBefore(O,k._79O):D.appendChild(O),k._debugTipTimerId=setInterval(function(){var X=k.getRenderInfo();if(X){var w=k.getGL()._bufPool,j=w.length-(w._ivCount||0),A="Draw Calls: "+X.calls+"<br/>"+"Vertices: "+X.vertices+"<br/>"+"Faces: "+X.faces+"<br/>"+"Lines: "+X.lines+"<br/>"+"Buffer Count: "+j;O.innerHTML=A}},10)}},hideDebugTip:function(){var l=this,A=l._debugDiv;A&&(delete l._debugDiv,cancelAnimationFrame(l._debugTipTimerId),delete l._debugTipTimerId,l.getView().removeChild(A))},_42:function(e,v){var S=this;if(!S._35O&&(!De||wq(De))){var X,J;e&&(e instanceof ur?J=e:X=e);var r=S._canvas,w=S.getWidth(),n=S.getHeight(),x=S.getGL(),E=S._prg;if(x){v?e||Bi(r,w,n,v):(v=S._devicePixelRatio||Qd,e||w===r.clientWidth&&n===r.clientHeight||Bi(r,w,n,v)),x.clear(x.COLOR_BUFFER_BIT);var t=function(){if(x._renderInfo={calls:0,vertices:0,faces:0,lines:0,frame:++S._frameId},S.overlappingBox.clear(),S._81O=W,x.clear(x.DEPTH_BUFFER_BIT),zr(x,E.uBrightness,1),zr(x,E.uOpacity,1),zr(x,E.uPartOpacity,1),x._picking=!!e,zr(x,E.uPick,!!e),zr(x,E.uTexture,!1),zr(x,E.uBlendTexture,!1),zr(x,E.uAlphaTest,F.alphaTest),zr(x,E.uTransparent,!1),zr(x,E.uFix,!1),zr(x,E.uBatchColor,!1),zr(x,E.uBatchBlend,!1),zr(x,E.uBatchBrightness,!1),zr(x,E.uPMatrix,S._projectMatrix=Lf(S)),zr(x,E.uViewMatrix,Uk(S,S._7O)),S._viewMatrix=Pf(S._7O),e||(Yq(S,x,E),S._fogDisabled||(zr(x,E.uFogColor,S._fogColor),zr(x,E.uFogNear,S._fogNear),zr(x,E.uFogFar,S._fogFar))),Op(x,E.aPosition),Op(x,E.aNormal),Xc(x,E.aUv),Xc(x,E.aBatchColor),Xc(x,E.aBatchBlend),Xc(x,E.aBatchBrightness),Xc(x,E.aLineDistance),J){var V=x.getParameter(x.COLOR_CLEAR_VALUE);x.clearColor(0,0,0,0),x.disable(x.BLEND),Xc(x,E.aNormal),dk(x,S._cube.vs,W,E.aPosition),wl(x,S._cube.is),qr(J,S,Ep,0),qr(J,S,_k,6),qr(J,S,bc,12),qr(J,S,Xl,18),qr(J,S,Im,24),qr(J,S,Cr,30),Op(x,E.aNormal),yn(x,V)}else if(X){X.value=2;var V=x.getParameter(x.COLOR_CLEAR_VALUE);x.clearColor(0,0,0,0),x.disable(x.BLEND),S._95I(x,E,X),Qm(S,X),Vm(S,S._polylineModelMap,X),Vm(S,S._wireframeModelMap,X),zr(x,E.uTransparent,!0),S._95I(x,E,X,!0),Qm(S,X,!0),Vm(S,S._polylineModelMap,X,!0),Vm(S,S._wireframeModelMap,X,!0),zr(x,E.uTransparent,!1),x.clear(x.DEPTH_BUFFER_BIT),S._swapLineMap(),S._95I(x,E,X,!1,!0),Vm(S,S._polylineModelMap,X),Vm(S,S._wireframeModelMap,X),S._swapLineMap(),x.disable(x.DEPTH_TEST),S._30O._42(x,E,X),x.enable(x.DEPTH_TEST),yn(x,V)}else x.disable(x.BLEND),S.drawSky(x,E),S._31O._42(x,E),S._95I(x,E),Qm(S),Vm(S,S._polylineModelMap),Vm(S,S._wireframeModelMap),x.enable(x.BLEND),zr(x,E.uTransparent,!0),x.depthMask(!1),S._95I(x,E,W,!0),Qm(S,W,!0),Vm(S,S._polylineModelMap,W,!0),Vm(S,S._wireframeModelMap,W,!0),x.depthMask(!0),zr(x,E.uTransparent,!1),x.clear(x.DEPTH_BUFFER_BIT),S._swapLineMap(),S._95I(x,E,W,!1,!0),Vm(S,S._polylineModelMap),Vm(S,S._wireframeModelMap),S._swapLineMap(),x.disable(x.DEPTH_TEST),x.disable(x.BLEND),S._32O._42(x,E),S._30O._42(x,E),x.enable(x.DEPTH_TEST);dk(x,W),wl(x,W)},T=!1,O=w*v,L=n*v,c=S.vr;c.enable&&c._42(x,O,L,t)&&(T=!0);var k=S.envRenderer;k&&k.enable&&k._42(x,O,L,t)&&(T=!0),T||(x.viewport(0,0,w*v,n*v),t()),S._33Q=!1,S._doBufferGC(x)}}},setBufferGCInterval:function(v){this._bufferGCInterval=v},_doBufferGC:function(A,z){var E=A._bufPool,P=E.length;if(P){var l,F,D=A._renderInfo.frame,J=this._bufferGCInterval||10,Q=0;for(l=0;P>l;l++)F=E[l],F?(z||D-F._fid>J)&&(Q++,A.deleteBuffer(F._buf),F._buf=null,E[l]=null):Q++;if(Q>P/2&&Q>128){var _=[];for(l=0;P>l;l++)E[l]&&_.push(E[l]);A._bufPool=_}else E._ivCount=Q}},_swapLineMap:function(){var D=this;a=D._polylineModelMap,D._polylineModelMap=D._polylineModelMapSwap,D._polylineModelMapSwap=a,a=D._wireframeModelMap,D._wireframeModelMap=D._wireframeModelMapSwap,D._wireframeModelMapSwap=a,a=D._polylineIndexMap,D._polylineIndexMap=D._polylineIndexMapSwap,D._polylineIndexMapSwap=a,a=D._wireframeIndexMap,D._wireframeIndexMap=D._wireframeIndexMapSwap,D._wireframeIndexMapSwap=a},_updateSkyBoxPosition:function(K){if(this._skyBox&&K&&"eye"===K.property){var _=K.newValue;this._skyBox.p3(_[0],_[1],_[2]),this.invalidateData(this._skyBox)}},setSkyBox:function(_){this._skyBox=_,this.ump(this._updateSkyBoxPosition,this),this.invalidateAll(),_&&(this.mp(this._updateSkyBoxPosition,this),this._updateSkyBoxPosition())},drawSky:function(E,Y,b){var d=this,S=d._skyBox;if(S){var B=d._headlightIntensity,L=ho(d._headlightColor),Y=d._prg;1!==B&&(L=[L[0]*B,L[1]*B,L[2]*B]),zr(E,Y.uHeadlightColor,[L[0],L[1],L[2],1]);var I=d.getData3dUI(S);I&&I._42(E,Y,b,function(){return!0}),E.clear(E.DEPTH_BUFFER_BIT),zr(E,Y.uHeadlightColor,[L[0],L[1],L[2],d._headlightDisabled?1:0])}},_95I:function(b,$,e,x,B){function H(f){if(!!f.s("shape3d.alwaysOnTop")==!!B&&G.isVisible(f)&&(!Q||u)){if(!e&&G.isTransparentMask(f))return;var s=G.getData3dUI(f);s&&s._42(b,$,e,y)}}var G=this,y=function(M){return x?M:!M};G.sky&&b.clear(b.DEPTH_BUFFER_BIT),G.dm().each(H)},getLogicalPoint:function(O){return Tg(O,this._canvas)},isRectOverlapping:function(A){var Y=this.getData3dUI(A);return Y._rectOverlapping},getHitFaceInfo:function(B){B.target&&(B=this.lp(B));var d=this.getDataInfoAt(B);if(d){var q=this._1o.face(d.data,Te(B.x,B.y));if(q)return{data:d.data,face:q}}return W},unproject:function(p,u){var R=this,c=R.getWidth(),$=R.getHeight(),H=p.target?R.lp(p):p,C=H.x-c/2,t=H.y-$/2,y=2*(C/c),h=2*(-1*t/$);u=u||0;var i=Tq(),M=Lf(R),X=Uk(R);Mi(i,M,X),Id(i);var w=kj([y,h,u,1],i);return[w[0]/w[3],w[1]/w[3],w[2]/w[3]]},getDataAt:function(V){var e=this.getDataInfoAt(V);return e?e.data:W},getDataInfoAt:function(k,w){return k.target&&(k=this.lp(k)),this._1o.get(Te(k.x,k.y,w),!0)},getDatasInRect:function(G){return this._1o.get(G)},setEditable:function(P){var t=this,c=t._editable;t._editable=P,this.fp(xn,c,P)},isEditable:function(U){var x=this;return x._editable?Cj(U)?U.s("3d.editable")?x._editableFunc?x._editableFunc(U):!0:!1:!1:!1},isSelectable:function(f){return f.s("3d.selectable")&&this.sm().isSelectable(f)},isMovable:function(V){var n=this;return Fe(V)&&V.getStyle(Pb)!==oc?!1:V.s("3d.movable")?n._movableFunc?n._movableFunc(V):!0:!1},isSizeEditable:function($){return Cj($)?this._sizeEditableFunc?this._sizeEditableFunc($):!0:!1},isRotationEditable:function(e){return Cj(e)&&e.IRotatable!==!1?this._rotationEditableFunc?this._rotationEditableFunc(e):!0:!1},handleDelete:function(){this._editable&&this.removeSelection()},zoomIn:function(Y){this.setZoom(io,Y)},zoomOut:function(y){this.setZoom(1/io,y)},setZoom:function(B,r){if(1!==B){var o=this;if(o._ortho)return o.setOrthoZoom(B,r),void 0;o._14o&&o._14o.stop(!0);var O=1/B,k=o._eye,d=o._center,a=d[0]+(k[0]-d[0])*O-k[0],m=d[1]+(k[1]-d[1])*O-k[1],E=d[2]+(k[2]-d[2])*O-k[2];if(!(Nc(k,d)<o._moveStep&&1>O)){if(r=Wm(r)){var U=ab(k);return r.action=function(G){o.fi({kind:o._zooming?"betweenZoom":"beginZoom"}),o._zooming=1,k[0]=U[0]+a*G,k[1]=U[1]+m*G,k[2]=U[2]+E*G,o.fp(fs,W,k)},r._37o=function(){delete o._14o,delete o._zooming,o.fi({kind:"endZoom"}),o.onZoomEnded()},o._14o=pp(r)}k[0]+=a,k[1]+=m,k[2]+=E,o.fp(fs,W,k)}}},setOrthoZoom:function(K,E){if(1!==K){var c=this;c._14o&&c._14o.stop(!0);var n=c._orthoWidth,w=n/K-n;if(!(n<c._moveStep&&K>1))return(E=Wm(E))?(E.action=function(t){c.fi({kind:c._zooming?"betweenZoom":"beginZoom"}),c._zooming=1,c.setOrthoWidth(n+w*t)},E._37o=function(){delete c._14o,delete c._zooming,c.fi({kind:"endZoom"}),c.onZoomEnded()},c._14o=pp(E)):(c.setOrthoWidth(n/K),void 0)}},getPositionInfo:function(c){var e=this,d=e._eye,X=e._center,o=e.getAspect(),S=c?xr(Ie(X,d,!0),Ie(c,d)):Nc(d,X);if(e._ortho){var G=e._orthoWidth;return{length:S,height:G/o,width:G}}var C=2*I(e._fovy/2)*S;return{length:S,height:C,width:C*o}},getCenterInfo:function(){var M=this;return M._81O||(M._81O=M.getPositionInfo()),ab(M._81O)},rotate:function(J,u,y,j){var Y=this;if(J||u){j==W&&(j=Y._firstPersonMode),Y._88O&&Y._88O.stop(!0);var D=Y._center,w=Y._eye,s=Y.getCenterInfo().length,K=j?D:w,R=j?w:D,h=Ie(K,R),n=B(h[0],h[2]),i=B(v(h[0]*h[0]+h[2]*h[2]),h[1]),O=j?uf:fs;return j&&(u=-u),(y=Wm(y))?(y.action=function(e){Y.fi({kind:Y._rotating?"betweenRotate":"beginRotate"}),Y._rotating=1;var c=n+J*e,g=i+u*e;g=kn(g),h[0]=s*b(g)*b(c),h[1]=s*o(g),h[2]=s*b(g)*o(c),K[0]=R[0]+h[0],K[1]=R[1]+h[1],K[2]=R[2]+h[2],Y.fp(O,W,K)},y._37o=function(){delete Y._88O,delete Y._rotating,Y.fi({kind:"endRotate"}),Y.onRotateEnded()},Y._88O=pp(y)):(n+=J,i+=u,i=kn(i),h[0]=s*b(i)*b(n),h[1]=s*o(i),h[2]=s*b(i)*o(n),K[0]=R[0]+h[0],K[1]=R[1]+h[1],K[2]=R[2]+h[2],Y.fp(O,W,K),void 0)}},pan:function(A,P,Y,O){if(A||P){var s=this;O==W&&(O=s._firstPersonMode),s._89O&&s._89O.stop(!0);var d=Uk(s),k=[d[0]*A,d[4]*A,d[8]*A],r=[d[1]*P,d[5]*P,d[9]*P],G=k[0]+r[0],a=k[1]+r[1],Q=k[2]+r[2],w=s._center,y=s._eye;if(O){var m=mh(s.getBoundaries(),y[0],y[2],y[0]+G,y[2]+Q,v(G*G+Q*Q));G=m[0],Q=m[1]}if(Y=Wm(Y)){var K=ab(y),R=ab(w);return Y.action=function(x){s.fi({kind:s._panning?"betweenPan":"beginPan"}),s._panning=1,w[0]=R[0]+G*x,w[1]=R[1]+a*x,w[2]=R[2]+Q*x,y[0]=K[0]+G*x,y[1]=K[1]+a*x,y[2]=K[2]+Q*x,s.fp(fs,W,y),s.fp(uf,W,w)},Y._37o=function(){delete s._89O,delete s._panning,s.fi({kind:"endPan"}),s.onPanEnded()},s._89O=pp(Y)}w[0]+=G,w[1]+=a,w[2]+=Q,y[0]+=G,y[1]+=a,y[2]+=Q,s.fp(fs,W,y),s.fp(uf,W,w)}},walk:function(Y,k,u){if(Y){var s=this;u==W&&(u=s._firstPersonMode),s._90O&&s._90O.stop(!0);var Q=s._center,H=s._eye,N=Ie(Q,H,!0);if(u){var b=mh(s.getBoundaries(),H[0],H[2],H[0]+N[0]*Y,H[2]+N[2]*Y,t(Y));if(Y=Nc(b),!Y)return;N=[b[0]/Y,0,b[1]/Y]}if(k=Wm(k)){var d=ab(H),m=ab(Q);return k.action=function(o){s.fi({kind:s._walking?"betweenWalk":"beginWalk"}),s._walking=1;var C=Y*o;H[0]=d[0]+N[0]*C,H[1]=d[1]+N[1]*C,H[2]=d[2]+N[2]*C,Q[0]=m[0]+N[0]*C,Q[1]=m[1]+N[1]*C,Q[2]=m[2]+N[2]*C,s.fp(fs,W,H),s.fp(uf,W,Q)},k._37o=function(){delete s._90O,delete s._walking,s.fi({kind:"endWalk"}),s.onWalkEnded()},s._90O=pp(k)}H[0]+=N[0]*Y,H[1]+=N[1]*Y,H[2]+=N[2]*Y,Q[0]+=N[0]*Y,Q[1]+=N[1]*Y,Q[2]+=N[2]*Y,s.fp(fs,W,H),s.fp(uf,W,Q)}},handleScroll:function(h,K){h.preventDefault();var f=this,q=f._moveStep;f.isFirstPersonMode()?f.isPannable()&&f.pan(0,K>0?q:-q):f.isZoomable()&&f.setZoom(0>K?1/Ap:Ap)},handlePinch:function(U,e){this.isZoomable()&&this.setZoom(e>U?1/Xp:Xp)},reset:function(){this.setCenter(M.graph3dViewCenter),this.setEye(M.graph3dViewEye),this.setUp(M.graph3dViewUp)},moveSelection:function(P,U,v){var b=this;b.dm().beginTransaction(),Bb(this.sm().toSelection(this.isMovable,this),P,U,v),b.dm().endTransaction()},getMoveMode:function(I,E){var g=E.s("3d.move.mode");if(g)return g;var D="88",u="89",v="90";return Mc(I)||uq[D]&&uq[u]&&uq[v]?"xyz":uq[D]&&uq[u]?"xy":uq[D]&&uq[v]?"xz":uq[u]&&uq[v]?"yz":uq[D]?"x":uq[u]?"y":uq[v]?"z":"xz"},handleTick:function(){var z=this,L=!1,k=z._moveStep,R=k,h=!1,N=!0,v=z._rotateStep*(N?-1:1);if(z.isWalkable()||(R=0),z.isPannable()||(k=0),z.isRotatable()||(v=0),z._32Q){var g=(Nh()-z._32Q)/50;R*=g,k*=g,v*=g}z._31Q&&(of(z._31Q),delete z._31Q,delete z._32Q),bg()&&(L=!0,z.pan(-k,0,h,N)),fh()&&(L=!0,z.pan(k,0,h,N)),sc()&&(L=!0,Mc()?z.pan(0,k,h,N):z.walk(R,h,N)),Ll()&&(L=!0,Mc()?z.pan(0,-k,h,N):z.walk(-R,h,N)),Ae()&&(L=!0,z.rotate(-v,0,h,N)),Fr()&&(L=!0,z.rotate(v,0,h,N)),Gr()&&(L=!0,z.rotate(0,-v/2,h,N)),ob()&&(L=!0,z.rotate(0,v/2,h,N)),L&&(z._32Q=Nh(),z._31Q=Mh(z.handleTick,z))},handleKeyDown:function(q){var N=this;!ji(q)&&Pg[q.keyCode]?N.handleTick():Vc(q)?N.selectAll():Qh(q)?N.handleDelete(q):Nd(q)&&this.isResettable()&&N.reset()},checkDoubleClickOnNote:function(O,d,i){var G=this;if(i===Wl){if(d.s("note.toggleable"))return d.s(fo,!d.s(fo)),G.fi({kind:"toggleNote",event:O,data:d,part:i}),!0}else if(i===ik&&d.s("note2.toggleable"))return d.s(Am,!d.s(Am)),G.fi({kind:"toggleNote2",event:O,data:d,part:i}),!0;return!1},checkDoubleClickOnRotation:function(s,p,J){return J===pq?(p.setRotationX(0),!0):J===Nk?(p.setRotationY(0),!0):J===bb?(p.setRotationZ(0),!0):!1},onRotateEnded:function(){},onWalkEnded:function(){},toViewPosition:function(z){var x=this,P=x.getWidth()/2,q=x.getHeight()/2,O=x._18Q;return O&&O._wh===P/q||(O=Lf(x),x._18Q=Mi(O,O,Uk(x)),x._18Q._wh!==P/q),z=kj([z[0],z[1],z[2],1],O),{x:P+P*z[0]/z[3],y:q-q*z[1]/z[3]}},getHitPosition:function(Y,P,h){var z=this,R=z.getWidth(),o=z.getHeight(),m=Y.target?z.lp(Y):Y,j=m.x-R/2,w=m.y-o/2,U=z.getCenterInfo(),_=Uk(z);P=P?P:[0,0,0],h=h?h:[0,1,0],j=j/R*U.width,w=-1*w/o*U.height;var f=[_[0]*j,_[4]*j,_[8]*j],l=[_[1]*w,_[5]*w,_[9]*w],c=[f[0]+l[0],f[1]+l[1],f[2]+l[2]],C=z.getCenter(),Q=_b(z,P,h,[c[0]+C[0],c[1]+C[1],c[2]+C[2]]);return Q?Q:[0,0,0]},intersectObject:function(l,P){return this._raycaster.intersectObject(l,P)},getLineLength:function(H){this.validate();var $=this.getData3dUI(H);if($&&$.getCache){var c=$.getCache();if(c)return c[c.length-1].length}return 0},getLineOffset:function(w,T){var s=this.getData3dUI(w);if(s&&s.getCache){var b=s.getCache();if(b)return Xb(b,T)}return W},isLabelVisible:function(){return!0},isNoteVisible:function(){return!0},flyTo:function(){function D(L,E,G){v.fromArray(Xg(G,E.getMat(G)));var y=G.getAnchor3d();L.push((new Re).set(0-y.x,0-y.y,0-y.z).applyMatrix4(v)),L.push((new Re).set(0-y.x,0-y.y,1-y.z).applyMatrix4(v)),L.push((new Re).set(0-y.x,1-y.y,0-y.z).applyMatrix4(v)),L.push((new Re).set(0-y.x,1-y.y,1-y.z).applyMatrix4(v)),L.push((new Re).set(1-y.x,0-y.y,0-y.z).applyMatrix4(v)),L.push((new Re).set(1-y.x,0-y.y,1-y.z).applyMatrix4(v)),L.push((new Re).set(1-y.x,1-y.y,0-y.z).applyMatrix4(v)),L.push((new Re).set(1-y.x,1-y.y,1-y.z).applyMatrix4(v))}var M=new Re,E=new Re,I=new Re,_=new Re,v=new qe,P=new c.Math.Quaternion;return function(y,R,Q){var L=this;if(Q!==N)R={animation:R,ratio:Q};else{var m=typeof R;("boolean"===m||"object"===m&&R.duration)&&(R={animation:R})}R=R||{},M.fromArray(L.getEye()),E.fromArray(L.getCenter());var j,f,e=[],q=R.center,x=R.distance===N;if(q&&I.fromArray(q),y instanceof c.Node)q||I.fromArray(y.p3()),x&&(D(e,L,y),j=e.length);else{if(y||(y=L.dm().getDatas()),!y.length)return;if((x||!q)&&(e=[],y.forEach(function(p){D(e,L,p)}),j=e.length),!q){for(I.set(0,0,0),f=0;j>f;f++)I.add(e[f]);I.multiplyScalar(1/j)}}if(L.setCenter(I.x,I.y,I.z),_.subVectors(M,E),R.direction||R.worldDirection){!R.worldDirection&&y instanceof c.Node?P.setFromEuler(y.r3(),y.getRotationMode()):P.set(0,0,0,1);var V=_.length();_.fromArray(R.worldDirection||R.direction).applyQuaternion(P).setLength(V)}if(x){for(var k,t,C,u,g,s=L.getNear(),b=10,Q=R.ratio||.8;b--;){for(L._eye[0]=_.x+I.x,L._eye[1]=_.y+I.y,L._eye[2]=_.z+I.z,k=Lf(L),Mi(k,k,Uk(L)),u=!0,g=-1/0,f=0;j>f;f++){if(C=e[f],t=kj([C.x,C.y,C.z,1],k),t[3]<s&&b){_.multiplyScalar(2),u=!1;break}g=Math.max(g,Math.max(Math.abs(t[0]),Math.abs(t[1]))/Q-t[3])}if(u)break}_.setLength(g+_.length()).add(I)}else _.setLength(R.distance).add(I);L._flyAnim&&L._flyAnim.stop(!0);var G=Wm(R.animation);if(G){L.setEye(M.x,M.y,M.z),L.setCenter(E.x,E.y,E.z);var B=(new Re).subVectors(_,M),r=(new Re).subVectors(I,E),F=new Re,T=new Re;return G.action=function(N){F.copy(M).addScaledVector(B,N),T.copy(E).addScaledVector(r,N),L.setCenter(T.x,T.y,T.z),L.setEye(F.x,F.y,F.z)},G._37o=function(){delete L._flyAnim},{lastEye:M,lastCenter:E,eye:_,center:I,animation:L._flyAnim=pp(G)}}return L.setEye(_.x,_.y,_.z),{lastEye:M,lastCenter:E,eye:_,center:I}}}()}),Of.RenderEnv=function(J){this.gv=J,this.enable=!1},R.defineProperties(Of.RenderEnv.prototype,{debugOn:{get:function(){return this._debugOn},set:function($){this._debugOn=$,this.capture&&this.capture()}}}),R.assign(Of.RenderEnv.prototype,{renderEnvToCube:function(z,T,k,r){var m=this,N=m.gv;if(!z||!T||!k)return m.enable=!1,m._42=null,void 0;m.enable=!0;var g=Math.floor(r/z*T),X=N.getGL(),D=m._renderTargets;D?D.length<k&&(D=m._renderTargets=D.concat(new Array(k-D.length))):D=m._renderTargets=new Array(k);for(var V=0;k>V;V++)D[V]?D[V].setSize(X,r,g):D[V]=new Of.RenderTarget(N,X,r,g);var b=!1;m.capture=function(){b=!0,N._42(),b=!1};var Z=new Re,d=new Re,B=new Re,_=new Re,O=(new Re).setY(0),F=2*Math.PI/k,I=z/2/Math.tan(Math.PI/k),M=2*Math.atan2(T/2,I),p=z/T;m._42=function(i,s,j,e){var S=m._debugOn;if(!b&&!S)return!1;Z.copy(N.getEye()),_.copy(N.getCenter()).sub(Z);var z=Math.atan2(_.z,_.x),U=N.getNear(),$=N.getFovy(),o=N.getAspect();d.copy(N.getCenter());for(var K,L=0;k>L;L++)if(K=D[L],O.setZ(Math.cos(z)).setX(Math.sin(z)).multiplyScalar(I),z-=F,B.addVectors(Z,O),N.setNear(I),N.setCenter([B.x,B.y,B.z]),N.setFovy(M),N.setAspect(p),S){var v=Math.round(s/k);i.viewport(v*L,0,v,j),e()}else fb(i,K.frame),i.viewport(0,0,K.width,K.height),i.clear(i.COLOR_BUFFER_BIT),e(),fb(i,W),K.assureTexture();return N.setNear(U),N.setCenter([d.x,d.y,d.z]),N.setFovy($),N.setAspect(o),!0},m.capture()},getTextureInfo:function(j){var v=this._renderTargets;if(!v)return null;var e=this._renderTargets[j];return e?{index:j,texture:e.texture,textureName:e.uuid}:null}}),R.assign(Of.Graph3dView.prototype,{renderEnvToCube:function(z,u,f,$){var O=this;O.envRenderer||(O.envRenderer=new Of.RenderEnv(O)),O.envRenderer.renderEnvToCube(z,u,f,$)}}),Of.RenderTarget=function(T,$,G,B){var Z=this;Z.uuid=c.Math.generateUUID(),Z.gv=T,Z.init(T,$),Z.setSize($,G,B)},R.assign(Of.RenderTarget.prototype,{init:function(U,j){var J=this,T=J.texture=j.createTexture();j.activeTexture(j.TEXTURE0),j.bindTexture(j.TEXTURE_2D,T),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_S,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_WRAP_T,j.CLAMP_TO_EDGE),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MIN_FILTER,j.NEAREST),j.texParameteri(j.TEXTURE_2D,j.TEXTURE_MAG_FILTER,j.NEAREST),j.bindTexture(j.TEXTURE_2D,null),J.render=j.createRenderbuffer(),J.frame=j.createFramebuffer(),U._2O[J.uuid]=T},assureTexture:function(){var p=this,u=p.uuid,V=p.gv._2O;V[u]||(V[u]=p.texture)},setSize:function(N,B,D){var o=this;if(o.width!==B||o.height!==D){var a=N.RGBA,J=N.TEXTURE_2D,K=N.RENDERBUFFER,g=N.FRAMEBUFFER;pn(N,o.texture),N.texImage2D(J,0,a,B,D,0,a,N.UNSIGNED_BYTE,W),Un(N,N.TEXTURE_MIN_FILTER,N.LINEAR),N.bindRenderbuffer(K,o.render),N.renderbufferStorage(K,N.DEPTH_COMPONENT16,B,D),fb(N,o.frame),N.framebufferTexture2D(g,N.COLOR_ATTACHMENT0,J,o.texture,0),N.framebufferRenderbuffer(g,N.DEPTH_ATTACHMENT,K,o.render),pn(N,W),N.bindRenderbuffer(K,W),fb(N,W),o.width=B,o.height=D}},toCanvas:function(){var v=this,_=v.gv.getGL();_.bindFramebuffer(_.FRAMEBUFFER,v.frame);var Y=v.width,o=v.height,T=new Uint8Array(4*Y*o);_.readPixels(0,0,Y,o,_.RGBA,_.UNSIGNED_BYTE,T),_.bindFramebuffer(_.FRAMEBUFFER,null);var t=m.createElement("canvas");t.width=Y,t.height=o;var G=t.getContext("2d"),U=G.createImageData(Y,o);return U.data.set(T),G.putImageData(U,0,0),t}});var hh=Of.Interactor=function(p){this.gv=p};Ej("Interactor",R,{ms_listener:1,getView:function(){return this.gv.getView()},setUp:function(){this.addListeners()},tearDown:function(){this.removeListeners()}});var Xm=Of.DefaultInteractor=function(X){Ne(Xm,this,[X])};Ej("DefaultInteractor",hh,{handle_contextmenu:function(I){Zp(I)},handle_mousewheel:function(I){this.gv.handleScroll(I,I.wheelDelta/40)},handle_DOMMouseScroll:function(P){2===P.axis&&this.gv.handleScroll(P,-P.detail)},handle_keydown:function($){this.gv.handleKeyDown($)},handle_mousedown:function(b){this.handle_touchstart(b)},handle_touchstart:function(C){Zp(C);var f=this,Q=f.gv,E=ki(C),h=Q.getDataInfoAt(C),O=h?h.data:W,b=h?h.part:W,j=Q.sm(),e=pr(C),m=cg(C);Q.setFocus(C)&&(f._62O=W,f._57I=W,O?ji(C)?j.co(O)?j.rs(O):j.as(O):j.co(O)||j.ss(O):E&&(ji(C)?Q.isRectSelectable()&&(f._62O=Fk):f._57I=Ak(C)),f._31Q&&(of(f._31Q),delete f._31Q,delete f._32Q),f._62O||(Q.isFirstPersonMode()&&(Mc(C)||m>2?f._62O="pan":Q.isMouseRoamable()||Bs?(f._62O="roaming",f.foward=e&&ki(C),f._32Q=Nh(),f._31Q=Mh(f.tick,f)):E||(f._62O="roaming")),f._62O||(E&&e&&fi[b]?(f._62O=b,f.p3=O.p3()):E&&e&&Cj(O)&&Q.isSelected(O)?Q.isMovable(O)?(f._62O="move",f.p3=O.p3(),f.movedata=O):Q.isInteractive(O)&&(f._62O="none"):Bs&&(m>2?f._62O="pan":2===m&&(f.dist=Ql(C),f._62O="pinch")))),f.point=Q.lp(C),Qe(f,C),jp(C)?Q.handleDoubleClick(C,O,b):Q.handleClick(C,O,b))},tick:function(){var s=this,f=s.gv,M=f._moveStep;s.point&&f.isWalkable()&&(s._32Q&&(M*=(Nh()-s._32Q)/50),f.walk(s.foward?M:-M),s._32Q=Nh(),s._31Q=Mh(s.tick,s))},handle_mouseup:function(Y){this.handle_touchend(Y)},handle_touchend:function(U){var f=this._57I;f&&(Nc(f,Ak(U))<=1&&this.gv.sm().cs(),this._57I=W)},handleWindowMouseMove:function(j){this.handleWindowTouchMove(j)},handleWindowTouchMove:function(x){var P,f,L=this,o=L.gv,T=L._62O,y=L.point,G=o.dm(),H=o.lp(x),Y=H.x-y.x,k=H.y-y.y,p=-C*Y/o.getWidth(),n=-C*k/o.getHeight();if("roaming"===T)L.rotate(x,p/2,n/2);else if(T===pq||T===Nk||T===bb)o._86O||G.beginTransaction(),o.fi({kind:o._86O?"betweenEditRotation":"beginEditRotation",event:x}),o._86O=1,o.sm().each(function(N){if(Cj(N)&&o.isRotationEditable(N)){var M=t(p)>t(n)?p:n;T===pq?N.setRotationX(N.getRotationX()+M):T===Nk?N.setRotationY(N.getRotationY()+M):T===bb&&N.setRotationZ(N.getRotationZ()+M)}});else if("move"===T||fi[T]){T===ij||T===xe||T===un?(o._87O||G.beginTransaction(),o.fi({kind:o._87O?"betweenEditScale":"beginEditScale",event:x}),o._87O=1):(o._moving||G.beginTransaction(),o.fi({kind:o._moving?"betweenMove":"beginMove",event:x}),o._moving=1);var F,M=L.p3,$=o.getPositionInfo(M),l=Uk(o);F=T===Pi?"x":T===oi?"y":T===am?"z":T===ij?"sx":T===xe?"sy":T===un?"sz":o.getMoveMode(x,L.movedata),Y=Y/o.getWidth()*$.width,k=-1*k/o.getHeight()*$.height;
- var S,E,X=[l[0]*Y,l[4]*Y,l[8]*Y],D=[l[1]*k,l[5]*k,l[9]*k],c=X[0]+D[0],B=X[1]+D[1],g=X[2]+D[2],J=[M[0]+c,M[1]+B,M[2]+g],b=Ie(o.getEye(),J,!0);if("xyz"===F?(S=J,o.moveSelection(c,B,g)):"xz"===F?(S=_b(o,M,[0,1,0],J),S&&o.moveSelection(S[0]-M[0],0,S[2]-M[2])):"xy"===F?(S=_b(o,M,[0,0,1],J),S&&o.moveSelection(S[0]-M[0],S[1]-M[1],0)):"yz"===F?(S=_b(o,M,[1,0,0],J),S&&o.moveSelection(0,S[1]-M[1],S[2]-M[2])):"x"===F||"sx"===F?(b[0]=0,S=_b(o,M,b,J),S&&(E=S[0]-M[0],"x"===F?o.moveSelection(E,0,0):o.sm().each(function(D){Cj(D)&&o.isSizeEditable(D)&&(P=D.getScaleX()+E/100,f=P/D.getScaleX(),D.setScaleX(P),Mc(x)&&(D.setScaleY(D.getScaleY()*f),D.setScaleTall(D.getScaleTall()*f)))}))):"y"===F||"sy"===F?(b[1]=0,S=_b(o,M,b,J),S&&(E=S[1]-M[1],"y"===F?o.moveSelection(0,E,0):o.sm().each(function(y){Cj(y)&&o.isSizeEditable(y)&&(P=y.getScaleTall()+E/100,f=P/y.getScaleTall(),y.setScaleTall(P),Mc(x)&&(y.setScaleY(y.getScaleY()*f),y.setScaleX(y.getScaleX()*f)))}))):("z"===F||"sz"===F)&&(b[2]=0,S=_b(o,M,b,J),S&&(E=S[2]-M[2],"z"===F?o.moveSelection(0,0,E):o.sm().each(function(I){Cj(I)&&o.isSizeEditable(I)&&(P=I.getScaleY()+E/100,f=P/I.getScaleY(),I.setScaleY(P),Mc(x)&&(I.setScaleX(I.getScaleX()*f),I.setScaleTall(I.getScaleTall()*f)))}))),!S)return;L.p3=S}else if(T===Fk){var i=L.div;i||(i=L.div=ps(),Vd(L.getView(),i),i.op=y,i.style.background=o.getRectSelectBackground()),o.fi({kind:o._rectSelecting?"betweenRectSelect":"beginRectSelect",event:x}),o._rectSelecting=1,i.rect=rd(i.op,H),vr(i,i.rect)}else if("pinch"===T&&2===cg(x)){o.fi({kind:o._pinching?"betweenPinch":"beginPinch",event:x}),o._pinching=1;var E=Ql(x);o.handlePinch(E,L.dist),L.dist=E}else"pan"===T||Mc(x)?L.pan(x,Y,k):"none"===T||o.isFirstPersonMode()||(ki(x)?L.rotate(x,p,n):(L.pan(x,Y,0),o.isWalkable()&&(o.fi({kind:o._walking?"betweenWalk":"beginWalk",event:x}),o._walking=1,o.walk(k/o.getHeight()*o.getCenterInfo().height))));L.point=H},pan:function(b,Q,V){var D=this.gv;if(D.isPannable()){var r=D.getCenterInfo(),w=Q/D.getWidth()*r.width,q=-1*V/D.getHeight()*r.height;D.fi({kind:D._panning?"betweenPan":"beginPan",event:b}),D._panning=1,D.pan(-w,-q)}},rotate:function(H,f,t){var s=this.gv;s.isRotatable()&&(s.fi({kind:s._rotating?"betweenRotate":"beginRotate",event:H}),s._rotating=1,s.rotate(f,t))},handleWindowMouseUp:function(q){this.handleWindowTouchEnd(q)},handleWindowTouchEnd:function(f){var H=this,J=H.gv,y=J.dm(),C=H.div;if(C){var Y=J.getDatasInRect(C.rect);if(!Y.isEmpty()){var l=J.sm(),D=l.toSelection();Y.each(function(V){l.co(V)?D.remove(V):D.add(V)}),l.ss(D)}Lb(C)}J._moving&&(delete J._moving,J.fi({kind:"endMove",event:f}),J.onMoveEnded(),y.endTransaction()),J._panning&&(delete J._panning,J.fi({kind:"endPan",event:f}),J.onPanEnded()),J._rotating&&(delete J._rotating,J.fi({kind:"endRotate",event:f}),J.onRotateEnded()),J._86O&&(delete J._86O,J.fi({kind:"endEditRotation",event:f}),y.endTransaction()),J._87O&&(delete J._87O,J.fi({kind:"endEditScale",event:f}),y.endTransaction()),J._pinching&&(delete J._pinching,J.fi({kind:"endPinch",event:f}),J.onPinchEnded()),J._rectSelecting&&(delete J._rectSelecting,J.fi({kind:"endRectSelect",event:f}),J.onRectSelectEnded()),J._walking&&(delete J._walking,J.fi({kind:"endWalk",event:f}),J.onWalkEnded()),H.dist=H.point=H._62O=H.p3=H.movedata=H.div=H._57I=H._32Q=H._31Q=H.foward=W}});var Eq=Of.MapInteractor=function(O){Ne(Eq,this,[O]),this._minPhi=0,this._maxPhi=5*l/12,this._keepHorizon=!0,this._threshold=2,this._touchScaleThreshold=.05,this._touchRotateThreshold=.03,this._touchScaleCheckAccuracy=.01};Ej("MapInteractor",hh,{handle_contextmenu:function(D){Zp(D)},handle_mousewheel:function(W){this.gv.handleScroll(W,W.wheelDelta/40)},handle_DOMMouseScroll:function(B){2===B.axis&&this.gv.handleScroll(B,-B.detail)},handle_keydown:function(M){this.gv.handleKeyDown(M)},handle_mousedown:function(t){this.handle_touchstart(t)},handle_touchstart:function(Q){Zp(Q);var M=this,Z=M.gv;if(Z.setFocus(Q)){Z.lp(Q);var p=Z.getDataInfoAt(Q),G=p?p.data:W,V=p?p.part:W;if(!G||!Z.isInteractive(G)){var w=M.editing={point:Z.lp(Q)};Bs?w.touch=!0:(w.touch=!1,w.pan=ki(Q)),Qe(M,Q)}jp(Q)?Z.handleDoubleClick(Q,G,V):Z.handleClick(Q,G,V)}},handle_mouseup:function(t){this.handle_touchend(t)},handle_touchend:function(){},handleWindowMouseMove:function(I){this.handleWindowTouchMove(I)},handleWindowTouchMove:function(V){var n=this,S=n.gv,P=n.editing;if(P){var u=S.lp(V),r=P.point,Z=u.x-r.x,o=u.y-r.y;if(!P.moved){if(Math.abs(Z)<n.threshold&&Math.abs(o)<n.threshold&&!(V.touches&&V.touches.length>1))return;P.moved=!0}if(P.point=u,P.touch){var y=V.touches.length;if(2!==y)n.pan(V,Z,o);else{if(1>=y)return;var Q=V.touches,w={x:Q[0].clientX,y:Q[0].clientY},B={x:Q[1].clientX,y:Q[1].clientY},$={x:B.x-w.x,y:B.y-w.y},x=P.lastCenter,t=Math.atan2($.y,$.x),j=P.theta,i=0;j==W?j=P.theta=t:(i=t-j,P.thetaStarted||Math.abs(i)>n.touchRotateThreshold?(P.thetaStarted=!0,P.theta=t):i=0);var U=l*(w.y+B.y)/2/S.getHeight(),f=P.phi,J=0;f==W?f=P.phi=U:(J=U-f,P.phiStarted||Math.abs(J)>n.touchRotateThreshold?(P.phiStarted=!0,P.phi=U):J=0);var R,F=Math.sqrt($.x*$.x+$.y*$.y),A=P.vlen;if(A){var T=w.x-x.x,b=w.y-x.y,L=B.x-x.x,g=B.y-x.y,v=Math.sqrt(T*T+b*b),G=Math.sqrt(L*L+g*g),q=A/2,z=n._sign2(v-q),X=n._sign2(G-q);0>z*X||0===z&&0===X?(R=1,P.vlen=F):(R||(R=F/A),P.scaleStarted||Math.abs(R-1)>n.touchScaleThreshold?(P.vlen=F,P.scaleStarted=!0):R=1)}else A=P.vlen=F,R=1;1!==R&&S.setZoom(R),(J||i)&&n.rotate(V,i,-J),P.lastCenter={x:(B.x+w.x)/2,y:(B.y+w.y)/2}}}else if(P.pan)n.pan(V,Z,o);else{var e=-C*Z/S.getWidth(),E=-C*o/S.getHeight();n.rotate(V,e,E)}}},_sign2:function(J){return Math.abs(J)<this._touchScaleCheckAccuracy?0:J>0?1:-1},handleWindowMouseUp:function(R){this.handleWindowTouchEnd(R)},handleWindowTouchEnd:function(f){var c=this,E=c.editing;if(c.editing=null,E){var L=c.gv;if(!E.moved&&E.pan){var n=L.getDataAt(f);n?L.sm().setSelection([n]):L.sm().clearSelection()}else L._panning=null,L._rotating=null,L.fi({kind:E.pan?"endPan":"endRotate",event:f})}},pan:function(s,M,x){var n=this,N=n.gv;if(N.isPannable()){var L=N.getCenterInfo(),j=-M/N.getWidth()*L.width,h=1*x/N.getHeight()*L.height;N.fi({kind:N._panning?"betweenPan":"beginPan",event:s}),N._panning=1;var p=n.keepHorizon,v=n.editing.touch;if((v&&s.touches&&s.touches.length>1||!v&&Mc(s))&&(p=!p),!p)return N.pan(j,h);if(j||h){var f=Uk(N),P=[f[0]*j,f[4]*j,f[8]*j],k=[f[1],0,f[9]],C=Math.sqrt(k[0]*k[0]+k[2]*k[2]);C&&(k=[k[0]/C*h,0,k[2]/C*h]);var $=P[0]+k[0],H=P[1]+k[1],u=P[2]+k[2],E=N._center,r=N._eye;E[0]+=$,E[1]+=H,E[2]+=u,r[0]+=$,r[1]+=H,r[2]+=u,N.fp(fs,W,r),N.fp(uf,W,E)}}},rotate:function(Y,M,x){var m=this,C=m.gv;if(C.isRotatable()){var X=C._center,j=C._eye,w=Ie(j,X),Z=B(v(w[0]*w[0]+w[2]*w[2]),w[1]),J=Z+x;J=Math.max(m.minPhi,Math.min(m.maxPhi,J)),x=J-Z,C.fi({kind:C._rotating?"betweenRotate":"beginRotate",event:Y}),C._rotating=1,C.rotate(M,x)}}}),R.defineProperties(Eq.prototype,{minPhi:{get:function(){return this._minPhi},set:function(D){this._minPhi=D}},maxPhi:{get:function(){return this._maxPhi},set:function(I){this._maxPhi=I}},keepHorizon:{get:function(){return this._keepHorizon},set:function(E){this._keepHorizon=E}},threshold:{get:function(){return this._threshold},set:function(R){this._threshold=R}},touchScaleThreshold:{get:function(){return this._touchScaleThreshold},set:function(n){this._touchScaleThreshold=n}},touchRotateThreshold:{get:function(){return this._touchRotateThreshold},set:function(U){this._touchRotateThreshold=U}}});var tr=function(l){this.gv=l};Xr(tr,R,{_iv:!0,iv:function(){this._iv=!0},face:function(X,t){var P=this,b=P.gv.getGL();if(!b||!Cj(X))return W;var H=t.x,o=t.width,M=t.height,z=P.height-t.y-M,$=i(o/2),l=new Uint8Array(4*o*M),J=0;for(P.iv(),P.validate(X),fb(b,P.frame),b.readPixels(H,z,o,M,b.RGBA,b.UNSIGNED_BYTE,l),fb(b,W),P.iv();$>=J;J++)for(var m=$-J,N=$+J,S=m;N>=S;S++)for(var k=m;N>=k;k++)if(S===m||S===N||k===m||k===N){var x=qd.m[l[4*(S*o+k)]];if(x)return x}},get:function(C,D){this.validate();var T=this,A=T.gv.getGL();if(!A)return W;var U,h,H=C.x,Q=C.width,b=C.height,I=T.height-C.y-b,E=i(Q/2),j=new Uint8Array(4*Q*b),y=0,a=j.length,v=D?W:new If,K=D?W:{};if(fb(A,T.frame),A.readPixels(H,I,Q,b,A.RGBA,A.UNSIGNED_BYTE,j),fb(A,W),D){for(;E>=y;y++)for(var p=E-y,d=E+y,u=p;d>=u;u++)for(var x=p;d>=x;x++)if((u===p||u===d||x===p||x===d)&&(U=T.info(j,4*(u*Q+x))))return U}else for(;a>y;y+=4)U=T.info(j,y),U&&(h=U.data,K[h._id]||(v.add(h),K[h._id]=h));return v},info:function(l,o){return this.colorMap[(l[o]<<16)+(l[o+1]<<8)+l[o+2]+((127&l[o+3])<<24)]},validate:function(U){var _=this,R=_.gv,H=R.getGL();if(H){var E=R.getWidth(),t=R.getHeight(),K=H.RGBA,i=H.TEXTURE_2D,S=H.RENDERBUFFER,q=H.FRAMEBUFFER;_.texture||(_.texture=zp(H),_.render=H.createRenderbuffer(),_.frame=H.createFramebuffer()),(_.width!==E||_.height!==t)&&(pn(H,_.texture),H.texImage2D(i,0,K,E,t,0,K,H.UNSIGNED_BYTE,W),Un(H,H.TEXTURE_MIN_FILTER,H.LINEAR),H.bindRenderbuffer(S,_.render),H.renderbufferStorage(S,H.DEPTH_COMPONENT16,E,t),fb(H,_.frame),H.framebufferTexture2D(q,H.COLOR_ATTACHMENT0,i,_.texture,0),H.framebufferRenderbuffer(q,H.DEPTH_ATTACHMENT,S,_.render),pn(H,W),H.bindRenderbuffer(S,W),fb(H,W),_.width=E,_.height=t),_._iv&&(_._iv=!1,fb(H,_.frame),R._42(U||(_.colorMap={}),1),fb(H,W))}}});var Ai=function(I){this.gv=I};Xr(Ai,R,{gap:0,size:0,_42:function(g,z){var K=this,L=K.gv,q=L._gridGap,o=L._gridSize;if(L._gridVisible){if(K.gap!==q||K.size!==o){for(var m=[],F=L._gridSize/2,b=q*F,$=0;2*F+1>$;$++){var w=6*$,U=6*(2*F+1)+w;m[w]=-b,m[w+1]=0,m[w+2]=-b+$*q,m[w+3]=b,m[w+4]=0,m[w+5]=-b+$*q,m[U]=-b+$*q,m[U+1]=0,m[U+2]=-b,m[U+3]=-b+$*q,m[U+4]=0,m[U+5]=b}K.vs=new or(m),K.gap=q,K.size=o}Qr(L),eb(g,z),Me(g),ve(g,z,1,L._gridColor,L._buffer.vs,K.vs),Ki(g,0,K.vs.length/3,g.LINES),_c(g),bd(g,z)}else K.vs=K.gap=K.size=W}});var Do=function(K){this.gv=K};Xr(Do,R,{_42:function(F,v){var I=this.gv,G=I._buffer.vs,z=I._axisXColor,B=I._axisYColor,i=I._axisZColor,q=I._originAxisVisible,x=I._centerAxisVisible;if(q||x){var Y=O?F.TRIANGLES:F.TRIANGLE_FAN,d=F.LINES;if(Qr(I),eb(F,v),Me(F),q){var M=I.getCenterInfo(),s=D(M.width,M.height)/5,K=.8*s,j=.05*s;ve(F,v,1.5,z,G,new or([0,0,0,s,0,0,K,j,0,K,0,j,K,-j,0,K,0,-j,K,j,0,0,0,0,0,s,0,j,K,0,0,K,j,-j,K,0,0,K,-j,j,K,0,0,0,0,0,0,s,j,0,K,0,j,K,-j,0,K,0,-j,K,j,0,K])),Ki(F,0,2,d),Ki(F,1,6,Y),ve(F,v,W,B),Ki(F,7,2,d),Ki(F,8,6,Y),ve(F,v,W,i),Ki(F,14,2,d),Ki(F,15,6,Y)}if(x){var g=I._center,L=g[0],Z=g[1],m=g[2],M=I.getPositionInfo(g);s=D(M.width,M.height)/20,ve(F,v,1.5,z,G,new or([L,Z,m,L+s,Z,m,L,Z,m,L,Z+s,m,L,Z,m,L,Z,m+s])),Ki(F,0,2,d),ve(F,v,W,B),Ki(F,2,2,d),ve(F,v,W,i),Ki(F,4,2,d)}_c(F),bd(F,v)}}});var il=function(w){this.gv=w},Pi="edit_tx",oi="edit_ty",am="edit_tz",pq="edit_rx",Nk="edit_ry",bb="edit_rz",ij="edit_sx",xe="edit_sy",un="edit_sz",fi={};fi[Pi]=1,fi[oi]=1,fi[am]=1,fi[pq]=1,fi[Nk]=1,fi[bb]=1,fi[ij]=1,fi[xe]=1,fi[un]=1,Xr(il,R,{_42:function(P,d,H){var G=this,Y=G.gv,b=Y.sm().ld();if(Y.isEditable(b)&&!Y.isEditHelperDisabled()&&Cj(b)&&(!Y.isFirstPersonMode()||!Y.isMouseRoamable()&&!Bs)){Qr(Y);var $,M,p=Y.isMovable(b),T=Y.isRotationEditable(b),C=Y.isSizeEditable(b),n=Y._axisXColor,x=Y._axisYColor,q=Y._axisZColor,t=Y._editSizeColor,r=b.p3(),w=Nc(Y.getEye(),r)/10,O=w/(H?5:10),W=.7*w,L=.4*W,Z=r[0],V=r[1],o=r[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],p&&G._17O(P,d,b,H,Pi,n,$,[Z,V-O,o,Z+W,V-O,o,Z+W,V,o,Z+W,V,o,Z,V,o,Z,V-O,o,Z,V-O,o+O,Z+W,V-O,o+O,Z+W,V-O,o,Z+W,V-O,o,Z,V-O,o,Z,V-O,o+O]),M=Z+W,C&&G._17O(P,d,b,H,ij,t,$,[M,V-O,o,M+L,V-O,o,M+L,V,o,M+L,V,o,M,V,o,M,V-O,o,M,V-O,o+O,M+L,V-O,o+O,M+L,V-O,o,M+L,V-O,o,M,V-O,o,M,V-O,o+O]),M+=L,T&&G._17O(P,d,b,H,pq,n,$,[M,V-O,o,M+L,V-O,o,M+L,V,o,M+L,V,o,M,V,o,M,V-O,o,M,V-O,o+O,M+L,V-O,o+O,M+L,V-O,o,M+L,V-O,o,M,V-O,o,M,V-O,o+O]),$=[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],p&&G._17O(P,d,b,H,oi,x,$,[Z,V,o,Z,V+W,o,Z-O,V+W,o,Z-O,V+W,o,Z-O,V,o,Z,V,o,Z,V,o,Z,V,o-O,Z,V+W,o-O,Z,V+W,o-O,Z,V+W,o,Z,V,o]),M=V+W,C&&G._17O(P,d,b,H,xe,t,$,[Z,M,o,Z,M+L,o,Z-O,M+L,o,Z-O,M+L,o,Z-O,M,o,Z,M,o,Z,M,o,Z,M,o-O,Z,M+L,o-O,Z,M+L,o-O,Z,M+L,o,Z,M,o]),M+=L,T&&G._17O(P,d,b,H,Nk,x,$,[Z,M,o,Z,M+L,o,Z-O,M+L,o,Z-O,M+L,o,Z-O,M,o,Z,M,o,Z,M,o,Z,M,o-O,Z,M+L,o-O,Z,M+L,o-O,Z,M+L,o,Z,M,o]),$=[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],p&&G._17O(P,d,b,H,am,q,$,[Z,V,o,Z,V,o+W,Z,V-O,o+W,Z,V-O,o+W,Z,V-O,o,Z,V,o,Z,V-O,o,Z-O,V-O,o,Z-O,V-O,o+W,Z-O,V-O,o+W,Z,V-O,o+W,Z,V-O,o]),M=o+W,C&&G._17O(P,d,b,H,un,t,$,[Z,V,M,Z,V,M+L,Z,V-O,M+L,Z,V-O,M+L,Z,V-O,M,Z,V,M,Z,V-O,M,Z-O,V-O,M,Z-O,V-O,M+L,Z-O,V-O,M+L,Z,V-O,M+L,Z,V-O,M]),M+=L,T&&G._17O(P,d,b,H,bb,q,$,[Z,V,M,Z,V,M+L,Z,V-O,M+L,Z,V-O,M+L,Z,V-O,M,Z,V,M,Z,V-O,M,Z-O,V-O,M,Z-O,V-O,M+L,Z-O,V-O,M+L,Z,V-O,M+L,Z,V-O,M])}},_17O:function(j,q,D,T,z,l,v,C){var Q=this.gv._buffer;gs(j,q,T,!0,D,z),yo(j,q,W,!0,W,!0,W,!1),zr(j,q.uDiffuse,l),dk(j,Q.vs,new or(C),q.aPosition),dk(j,Q.ns,new or(v),q.aNormal),Me(j),Ki(j,0,12),_c(j),Si(j,q)}});var vf=c.Raycaster=function(k){this.gv=k};Sj("Raycaster",R,{intersect:function(c){var $=this,x=$.gv,U=x.getDataAt(c);return U?$.intersectObject(c,U):null},intersectObject:function(w,Y){if(w instanceof Gc)return this._intersectObjectImpl(w,Y);var e,h,I=this,G=I.gv;h=G.unproject(w);var U=G.getEye();G.isOrtho()?(e=Ie(G.getCenter(),U),e[0]+=e[0],e[1]+=e[1],e[2]+=e[2]):e=U,e=new Re(e);var X=new Re(h).sub(e).normalize(),F=new c.Math.Ray(e,X);return I._intersectObjectImpl(F,Y)},_intersectObjectImpl:function(){function Q(){var o=new Re;return o.subVectors(u,C),N.subVectors(s,C),o.cross(N).normalize(),o}function $(k,N,T,S,r,P,J){return jf.barycoordFromPoint(k,N,T,S,O),r.multiplyScalar(O.x),P.multiplyScalar(O.y),J.multiplyScalar(O.z),r.add(P).add(J),r.clone()}var E=new qe,h=new qe,o=new Gc,W=new Re,e=new Re,v=new Re,I=new Re,b=new Re,s=new Re,C=new Re,u=new Re,A=new Ei,w=new Ei,G=new Ei,N=new Re,Y={vs:Sb,is:Ec,uv:hm},O=new Re;return function(T,L){var l=this.gv.getData3dUI(L),K=L.mat||l.mat;if(K){E.fromArray(K),h.getInverse(E),o.copy(T).applyMatrix4(h);var i,_,q="body",g=l.shapeModel;if(g||(g=Gq(l)),g||(L instanceof c.Node&&!(L instanceof c.Shape)?(i=!0,g=Y):(_=!0,g=[l.left,l.front,l.right,l.back,l.top,l.bottom])),!g)return console.log("Can not find shape model."),null;zn(g)||(g=[g]);var f,M,x,z,S,N,F,P,U,D,B,X,n,O=1/0,y=["","top_","bottom_"],m=!1;for(f=0,M=g.length;M>f;f++)if(X=g[f])for(x=0,z=y.length;z>x;x++)if(n=y[x],F=X[n+"vs"],P=X[n+"is"],U=X[n+"uv"]||X[n+"tuv"],F)for(S=0,N=P?P.length:F.length/3;N>S;S+=3)P?(e.fromArray(F,3*P[S]),v.fromArray(F,3*P[S+1]),I.fromArray(F,3*P[S+2])):(e.fromArray(F,3*S),v.fromArray(F,3*(S+1)),I.fromArray(F,3*(S+2))),D=o.intersectTriangle(e,v,I,!1,W),D&&(B=o.origin.distanceTo(D),O>B&&(O=B,b.copy(D),s.copy(e),C.copy(v),u.copy(I),""!==n?q=n.slice(0,-1):i?q=Yl[Math.floor(S/6)]:_&&(q=Yl[f]),U&&(m=!0,P?(A.fromArray(U,2*P[S]),w.fromArray(U,2*P[S+1]),G.fromArray(U,2*P[S+2])):(A.fromArray(U,2*S),w.fromArray(U,2*(S+1)),G.fromArray(U,2*(S+2))))));if(!isFinite(O))return null;var k,p=b.clone().applyMatrix4(E);m&&(k=$(b,s,C,u,A,w,G));var d=Q(s,C,u),V=Q(s.applyMatrix4(E),C.applyMatrix4(E),u.applyMatrix4(E)),t=o.direction.dot(d);return t>0&&(d.multiplyScalar(-1),V.multiplyScalar(-1)),{world:p,local:b.clone(),worldNormal:V,normal:d,uv:k,part:q}}}}()});var Tk=function(F,x){this.gv=F,this.s=function(u,C,r){return C==W&&(C=r),C==W?x.getStyle(u):ag(C,x,F)},this.data=x};Xr(Tk,R,{I3d:!0,ms_icons:1,_iv:!0,iv:function(){this._iv=!0},_42:function(m,V,z,w){var $=this,T=$.data;if(!(T instanceof Fh)){var p,C,_,F,B,u,t,R=$.gv,Z=T._id,h=$.s("shape3d.alwaysOnTop")?null:$.s("batch"),d=R._batchIndexMap,q=R._batchModelMap,K=R.isSelectable(T),y=R.getBrightness(T),H=y!=W&&1!==y;if($.needValidate(m)){if(_=je(d,q,T,h),$.validate(_,h?vn[h]||Vp:W),_&&(F=d[Z],B=F.size=_.vs.length/3-F.begin,t=_.rs))for(y=H?y:1,u=0;B>u;u++)t.push(y);if(Cj(T)){var O=R.getWireframeGeometry(T);if(O)ii(R,T,O);else{var g=R.getWireframe(T);g&&ii(R,T,g)}}$.labelInfo=$.label2Info=$.noteInfo=$.note2Info=$._38o=W,$._24O(yg,"getLabel"),$._24O(gp,"getLabel2"),$._26O(Wl,"getNote"),$._26O(ik,"getNote2"),$._15O(),$.interactiveInfo=R.isInteractive(T)?{}:W,$._iv=!1}H&&zr(m,V.uBrightness,y),zr(m,V.uAlphaTest,$.s("alphaTest")),C=gs(m,V,z,K,T,Ip),C&&(gi(C,d[Z],q),gi(C,R._polylineIndexMap[Z],R._polylineModelMap),gi(C,R._wireframeIndexMap[Z],R._wireframeModelMap)),d[Z]||$._80o(m,V,w),R.isLabelVisible(T)&&((p=$.labelInfo)&&(gs(m,V,z,K,T,yg),$._28O(p,yg,w)),(p=$.label2Info)&&(gs(m,V,z,K,T,gp),$._28O(p,gp,w))),R.isNoteVisible(T)&&((p=$.noteInfo)&&(gs(m,V,z,K,T,Wl),$._29O(p,Wl,w)),(p=$.note2Info)&&(gs(m,V,z,K,T,ik),$._29O(p,ik,w))),(p=$._38o)&&$._99O(m,V,p,z,K,w),H&&zr(m,V.uBrightness,1)}},needValidate:function(){return this._iv},validate:function(){},_16O:function(){return $m},_80o:function(){},dispose:function(){},_calcAnchorMat:function(B){if(B.hasOwnProperty("_anchor")||B.hasOwnProperty("_anchorElevation")){var f=B.getAnchor3d(),q={x:f.x-.5,y:f.y-.5,z:f.z-.5},c=Tq();return Li(c,[-q.x,-q.y,-q.z]),c}},getBodyColor:function(F){var b=this.data,E=this.gv.getBodyColor(b);return E?E:F?b.getStyle(F):W},_24O:function(F,R){var a=this,v=a.data,N=a.gv,w=a.s,e=N[R](v);if(e!=W){var m=w(F+".scale"),U=w(F+".max"),Q=a[F+"Info"]={label:e,textureScale:w(F+".texture.scale"),color:N[R+"Color"](v),font:w(F+".font"),align:w(F+".align"),background:N[R+"Background"](v)},O=Q.rect=vj(Q,e);U>0&&U<O.width&&(Q.labelWidth=O.width,O.width=U),O.x=O.y=0,O.width*=m,O.height*=m,Q.mat=a._16O(w(F+".autorotate"),w(F+".position"),O,w(F+".face"),w(F+".t3"),w(F+".r3"),w(F+".rotationMode"));var C=O.width/2,x=O.height/2;Q.vs=new or([-C,x,0,-C,-x,0,C,-x,0,C,x,0]),O.width/=m,O.height/=m}},_26O:function(F,f){var G=this,U=G.data,S=G.gv,n=G.s,P=S[f](U);if(P!=W){var M=n(F+".scale"),v=this[F+"Info"]={note:P,textureScale:n(F+".texture.scale"),expanded:n(F+".expanded"),font:n(F+".font"),color:n(F+".color"),align:n(F+".align"),borderWidth:n(F+".border.width"),borderColor:n(F+".border.color"),background:S[f+"Background"](U)};if(v.expanded){var g=n(F+".max"),Y=vj(v,P);Y.width+=6,Y.height+=2,g>0&&g<Y.width&&(v.labelWidth=Y.width,Y.width=g);var u={x:-Y.width/2,y:-8-Y.height,width:Y.width,height:Y.height+8}}else u={x:-6,y:-18,width:12,height:18};v.mat=G._16O(n(F+".autorotate"),n(F+".position"),W,n(F+".face"),n(F+".t3"),n(F+".r3"),n(F+".rotationMode")),v.rect=u,1!==M&&(u=ab(u),u.x*=M,u.height*=M,u.y=-u.height,u.width*=M);var x=u.x,R=u.y,e=u.width,I=u.height;v.vs=new or([x,-R,0,x,-R-I,0,x+e,-R-I,0,x+e,-R,0])}},_28O:function(g,w,$){if($(this.s(w+".transparent"))){var I=g.rect,c=g.textureScale,i=I.width*c,X=I.height*c;if(i>=1&&X>=1){var k=ap(i,X);1!==c&&(k.translate(k,I.x,I.y),k.scale(c,c),k.translate(k,-I.x,-I.y)),mq(k,g),k.restore(),fd(this,w,g.mat,g.vs,!0)}}},_29O:function(k,b,P){if(P(this.s(b+".transparent"))){var _=k.rect,z=k.textureScale,N=_.x,p=_.y,x=_.width*z,t=_.height*z;if(x>=1&&t>=1){_.x=_.y=0;var E=ap(x,t);1!==z&&E.scale(z,z),wb(E,k),E.restore(),_.x=N,_.y=p,fd(this,b,k.mat,k.vs,!1)}}},_99O:function(g,_,b,n,l,f){if(b){var E=this,u=E.gv,O=E.data,J=u._buffer,K=u._1O,F=b.icons;for(var H in F){var T=F[H],C=b.rects[H];if(C&&f(ag(T.transparent,O,u))){gs(g,_,n,l,O,H);var m=ag(T.shape3d,O,u),R=m?[m]:ag(T.names,O,u),z=R?R.length:0,Y=ag(T.textureScale,O,u)||1,A=ag(T.light,O,u);A==W&&(A=m?!0:!1),yo(g,_,ag(T.blend,O,u),A,ag(T.opacity,O,u),ag(T.reverseFlip,O,u),ag(T.reverseColor,O,u),ag(T.reverseCull,O,u));for(var c=0;z>c;c++){var M=R[c],r=C[c];if(tg(E,r.mat),m)Ac(u,O,Gq(E,m),E);else{var V=eo(M);if(V){var N=r.width*Y,P=r.height*Y;if(N>=1&&P>=1){var L=ap(N,P);Ym(L,V,ag(T.stretch,O,u),0,0,N,P,O,u),L.restore(),zp(g,Yp,K),Me(g,_,K,ag(T.discardSelectable,O,u),J.uv,Wc),dk(g,J.vs,r.vs,_.aPosition),Jb(g,J.ns,Ld,_.aNormal),Wn(g,J.is,np),Oi(g,0,np.length),_c(g,_,K)}}}ze(u)}Si(g,_)}}}}});var Dc=function(I,f){Ne(Dc,this,[I,f])};Xr(Dc,Tk,{_16O:function(r,b,n,u,e,Z,W,m,Y){var V=this.data,T=V.getFinalScale3d(),v=cb(b,T,n,u,m,Y);if(V.hasOwnProperty("_anchor")||V.hasOwnProperty("_anchorElevation")){var F=V.getAnchor3d();v[0]-=(F.x-.5)*T[0],v[1]-=(F.y-.5)*T[1],v[2]-=(F.z-.5)*T[2]}return Ic(Tq(),v,V.p3(),u,e,Z,W,r,V.getFinalRotation3d(),V.getRotationMode())},clear:function(){var G=this;G.faceMat=G.mat=G.shapeModel=G.left=G.right=G.front=G.back=G.top=G.bottom=G.csg=W},needValidate:function(W){if(this._iv)return this._validateFrameId=W._renderInfo.frame,!0;if(this.s("shape3d.autorotate")||this.s("shape3d.fixSizeOnScreen")||this.s("hide.overlapping.group")){var m=W._renderInfo.frame;if(this._validateFrameId!==m)return this._validateFrameId=m,!0}return!1},validate:function(W,X){var A=this,e=A.gv,m=A.data,I=Gq(A);A._updateAutoRotation(),A._updateFixSize2d(),A._updateOverlapping(),(this.s("shape3d.autorotate")||this.s("shape3d.fixSizeOnScreen"))&&(gl(e,m,"_wireframeModelMap","_wireframeIndexMap"),gl(e,m,"_wireframeModelMapSwap","_wireframeIndexMapSwap"));var o=Xg(m,e.getMat(m),I?A.s("shape3d.scaleable"):!0),M=A._calcAnchorMat(m);if(M&&Mi(o,o,M),m.mat=o,A.clear(),W){var d=[];I?wm(e,m,I,A,A.getBodyColor(),[o],W,d):(ed(e,m,W,X,o,Ep,d,Ur),ed(e,m,W,X,o,bc,d,Sh),ed(e,m,W,X,o,Im,d,Vl),ed(e,m,W,X,o,Cr,d,Cc),ed(e,m,W,X,o,_k,d,_d),ed(e,m,W,X,o,Xl,d,yl)),d.length&&(em(W.vs,d),em(W.ns,$q(d)))}else A.mat=o,(A.shapeModel=I)||(A._cubeUvs=null,A.vf(Ep,0),A.vf(bc,16),A.vf(_k,8),A.vf(Xl,24),A.vf(Im,32),A.vf(Cr,40))},_updateAutoRotation:function(){var e=this,C=e.data,N=e.s("shape3d.autorotate");if(!N)return C._dynamicRotation&&delete C._dynamicRotation,void 0;var $,D=e.gv;$="string"==typeof N?[N.indexOf("x")<0?D._eye[0]:D._center[0],N.indexOf("y")<0?D._eye[1]:D._center[1],N.indexOf("z")<0?D._eye[2]:D._center[2]]:D._eye;var B=D._center,v=[$[0]-B[0],$[1]-B[1],$[2]-B[2]],r=C.p3(),K=di([r[0]+v[0],r[1]+v[1],r[2]+v[2]],r,D._up),G=C.r3(),X=vl(K,C.getRotationMode());Math.abs(G[0]-X[0])<1e-5&&Math.abs(G[1]-X[1])<1e-5&&Math.abs(G[2]-X[2])<1e-5||(C._dynamicRotation=X)},_updateFixSize2d:function(){var Y=this,L=Y.data,I=Y.s("shape3d.fixSizeOnScreen");if(!I)return L._dynamicScale3d&&delete L._dynamicScale3d,void 0;var h=Y.gv;L.getFinalScale3d();var b=Xg(L,h.getMat(L)),W=ge([0,0,0],b),f=h.toViewPosition(W);if(!isNaN(f.x)&&!isNaN(f.y)){var O=ge([1,0,0],b),Z=h.toViewPosition(O),r=ge([0,1,0],b),G=h.toViewPosition(r),B=Z.x-f.x,a=G.y-f.y,$=L._dynamicScale3d||[1,1,1],x=eo(L.s("shape3d.image")),P=I[0]>0?I[0]:x?ef(x,Y):20,D=I[1]>0?I[1]:x?fc(x,Y):20,V=Math.abs(B/P),m=Math.abs(a/D);Math.abs(V-1)<.001&&Math.abs(m-1)<.001||(L._dynamicScale3d=[$[0]/V,$[1]/m,$[2]])}},_updateOverlapping:function(){var D=this,M=D.s("hide.overlapping.group");if(!M)return D._rectOverlapping&&(D._rectOverlapping=N),void 0;var E,p,v,I=D.gv,S=D.data,n=Xg(S,I.getMat(S)),L=1/0,Y=1/0,o=-1/0,G=-1/0,y=S.getAnchor3d(),t=y.x,Z=y.y,U=y.z;for(E=0;8>E;E++){if(p=ge([(E>>2)-t,(1&E>>1)-Z,(1&E)-U],n),v=I.toViewPosition(p),isNaN(v.x)||isNaN(v.y))return;L=Math.min(L,v.x),o=Math.max(o,v.x),Y=Math.min(Y,v.y),G=Math.max(G,v.y)}var l={x:L,y:Y,w:o-L,h:G-Y};D._rectOverlapping=I.overlappingBox.isOverlapping(M,l)},getVectorDynamicSize:function(){var x,b=this,E=b.s("shape3d"),Q=b.data;if("billboard"===E||"plane"===E||(x=Q._currentCubeElementId)!=W){var v,Z,D=b.gv,j=Xg(Q,D.getMat(Q)),T=function(r,T){var X=D.toViewPosition(ge(r,j)),d=D.toViewPosition(ge(T,j)),z=X.x-d.x,R=X.y-d.y;return Math.min(2048,Math.sqrt(z*z+R*R))};if("billboard"===E)v=T([-.5,0,0],[.5,0,0]),Z=T([0,-.5,0],[0,.5,0]);else if("plane"===E)v=T([-.5,0,0],[.5,0,0]),Z=T([0,0,-.5],[0,0,.5]);else if(Q._currentCubeElementId!=W){var s=3*Ec[x+1],o=3*Ec[x],M=3*Ec[x+2];v=T([Sb[s],Sb[s+1],Sb[s+2]],[Sb[M],Sb[M+1],Sb[M+2]]),Z=T([Sb[s],Sb[s+1],Sb[s+2]],[Sb[o],Sb[o+1],Sb[o+2]])}return[v,Z]}},getCachedTexture:function(){var l=this,Z=l.data,i=Z._currentCubeElementId;return i!=W?l._cubeCachedImage?l._cubeCachedImage[i]:null:l._shape3dCachedImage},setCachedTexture:function(Q){var k=this,F=k.data,H=F._currentCubeElementId;if(H!=W){if(!k._cubeCachedImage)return k._cubeCachedImage={};k._cubeCachedImage[H]=Q}else k._shape3dCachedImage=Q},invalidateCachedTexture:function(t){var _,W,E,A=this;if((E=A._shape3dCachedImage)&&(t.deleteTexture(E),A._shape3dCachedImage=null),W=A._cubeCachedImage){for(_ in W)t.deleteTexture(W[_]);A._cubeCachedImage=null}},vf:function(N,R){var I=this;if(I.gv.getFaceVisible(I.data,N)){var d=Ke(I,N);d.mat&&(I.faceMat=!0);var q=d.uv;if(q){var r=I._cubeUvs;r||(r=I._cubeUvs=new or([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]));for(var z=0;8>z;z++)r[R+z]=q[z]}return d}},_80o:function(z,Q,g){var I=this;if(I._rectOverlapping)return!0;var D=I.gv,j=I.data,R=D._cube,r=I.shapeModel;Qr(D,I.mat),r?Ac(D,j,r,I,I.getBodyColor(),g):(dk(z,R.vs,W,Q.aPosition),dk(z,R.ns,W,Q.aNormal),wl(z,R.is),I._18O(z,Q,I.left,0,g),I._18O(z,Q,I.front,6,g),I._18O(z,Q,I.right,12,g),I._18O(z,Q,I.back,18,g),I._18O(z,Q,I.top,24,g),I._18O(z,Q,I.bottom,30,g)),ze(D),I.faceMat&&(I._18O(z,Q,I.left,0,g,!0),I._18O(z,Q,I.front,6,g,!0),I._18O(z,Q,I.right,12,g,!0),I._18O(z,Q,I.back,18,g,!0),I._18O(z,Q,I.top,24,g,!0),I._18O(z,Q,I.bottom,30,g,!0))},_18O:function(M,k,m,Y,A,g){if(m){if(!A(m.transparent))return;if(g&&!m.mat||!g&&m.mat)return;g&&Qr(this.gv,m.mat);var x=this,d=x.data;d._currentCubeElementId=Y;var s=x.gv,o=s.getTexture(m.texture,d),q=m.uv,Q=m.uvScale,r=m.uvOffset,L=m.discardSelectable;o?q?Me(M,k,o,L,s._buffer.uv,x._cubeUvs,r,Q):Me(M,k,o,L,s._cube.uv,W,r,Q):Me(M),yo(M,k,m.blend,m.light,m.opacity,m.reverseFlip,m.reverseColor,m.reverseCull),zr(M,k.uDiffuse,m.color),Oi(M,Y,6),Si(M,k),_c(M,k,o),g&&ze(s),d._currentCubeElementId=null}}});var dq=function(b,o){Ne(dq,this,[b,o])};Xr(dq,Tk,{_25Q:1,validate:function(N){var A=this,f=A.gv,l=A.data,V=A.s,I=V("edge.width"),k=l._40I,c=l._41I;if(A.shapeModel=A.info=W,k&&c){var T,U,J,s,j,p,n,m,Q,b,L=l.isLooped(),d=V(Pb),E=M.getEdgeType(d);if(E){var i=E(l,km(A,f,l,L,d),f,A._19Q);if(!i.points||i.points.isEmpty())return;p=A.info={},n=i.segments,j=i.points,m=j.size();for(var C=k.getElevation(),$=c.getElevation(),F=0;m>F;F++){var O=j.get(F);O.e==W&&(O.e=C+($-C)*F/(m-1))}Q=lm(j.get(0)),b=lm(j.get(m-1));var z=m%2;0===z?(p.c1=lm(j.get(m/2-1)),p.c2=lm(j.get(m/2))):p.p3=lm(j.get((m-z)/2)),p.s1=Q,p.s2=lm(j.get(1)),p.t1=lm(j.get(m-2)),p.t2=b}else{j=new If,p=A.info={};var u=V("edge.offset"),q=V("edge.center"),g=V("edge.source.t3"),o=V("edge.target.t3"),t=k.p3(),R=c.p3();if(g&&(t[0]+=g[0],t[1]+=g[1],t[2]+=g[2]),o&&(R[0]+=o[0],R[1]+=o[1],R[2]+=o[2]),d===oc){n=V("edge.segments");var G=p.points=V(tc)||hf;if(m=G.size()){Q=lm(G.get(0)),b=lm(G.get(m-1)),!q&&u&&(J=Ie(Q,t,!0),u=D(u,Nc(t,Q)),t=[t[0]+J[0]*u,t[1]+J[1]*u,t[2]+J[2]*u],J=Ie(R,b,!0),u=D(u,Nc(b,R)),R=[R[0]-J[0]*u,R[1]-J[1]*u,R[2]-J[2]*u]);var z=m%2;0===z?(T=lm(G.get(m/2-1)),U=lm(G.get(m/2))):p.p3=lm(G.get((m-z)/2)),p.s1=t,p.s2=Q,p.t1=b,p.t2=R}else!q&&u&&(J=Ie(R,t,!0),s=Nc(t,R),u=Np(u,s),t=[t[0]+J[0]*u,t[1]+J[1]*u,t[2]+J[2]*u],R=[R[0]-J[0]*u,R[1]-J[1]*u,R[2]-J[2]*u]),T=t,U=R;j.add({x:t[0],y:t[2],e:t[1]}),j.addAll(G),j.add({x:R[0],y:R[2],e:R[1]})}else{var h=km(A,f,l,L,d);if(A._19Q||(h=-h),L){var x=t[0],w=t[1],v=t[2],K=k.getTall()/2+h;T=[x-h,w+K,v],U=[x+h,w+K,v],j.add({x:x-h,y:v,e:w}),j.add({x:x-h,y:v,e:w+K}),j.add({x:x+h,y:v,e:w+K}),j.add({x:x+h,y:v,e:w})}else{J=Ie(R,t,!0),s=Nc(t,R);var r={x:t[0],y:t[2]},B={x:R[0],y:R[2]},y=Dd(W,r,B,h),X=y.x-r.x,Y=y.y-r.y;u=Np(u,s),J[0]*=u,J[1]*=u,J[2]*=u,T=[t[0]+J[0]+X,t[1]+J[1],t[2]+J[2]+Y],U=[R[0]-J[0]+X,R[1]-J[1],R[2]-J[2]+Y],q?(j.add({x:t[0],y:t[2],e:t[1]}),j.add({x:T[0],y:T[2],e:T[1]}),j.add({x:U[0],y:U[2],e:U[1]}),j.add({x:R[0],y:R[2],e:R[1]})):(j.add({x:T[0],y:T[2],e:T[1]}),j.add({x:U[0],y:U[2],e:U[1]}))}}p.c1=T,p.c2=U}p.list=V(Mk)===fj?A.createTubeModel(j,n,I/2,N):A.createLineModel(j,n,I,"edge","edge.dash")}}});var hs=function(M,t){Ne(hs,this,[M,t])};Xr(hs,Dc,{_80o:function(R,K,r){var g=this,h=g.gv,$=g.shapeModel;Qr(h,g.mat),$?Ac(h,g.data,$,g,g.getBodyColor(),r):(we(g,R,K,g.left,r),we(g,R,K,g.front,r),we(g,R,K,g.right,r),we(g,R,K,g.back,r),we(g,R,K,g.top,r),we(g,R,K,g.bottom,r)),ze(h)},validate:function(e,w){var n,_,P=this,M=P.s,q=P.data,m=q.p3(),r=q._thickness/2,S=q.isClosePath(),z=q.getPoints(),i=q.getSegments(),C=M(fq),F=e&&e.uv;if(P.clear(),0>r)_=P.shapeModel=Vk(z,i,M(sb),M(Um),C,M(Rj),q.getTall(),q.getShapeElevation(),S),M(ub)?M("shape3d.image")||delete _.uv:(delete _.vs,delete _.ns,delete _.uv),M("shape3d.top.image")||delete _.top_uv,M("shape3d.bottom.image")||delete _.bottom_uv;else if(M(Mk)===fj)n=Qq(z,i,C,S),_=P.shapeModel={vs:[]},M("shape3d.image")&&(_.uv=[],_.sum=M(Rj)||pg(n)||1,_.len=0),M(sb)&&!S&&(_.top_vs=[],M("shape3d.top.image")&&(_.top_uv=[])),M(Um)&&!S&&(_.bottom_vs=[],M("shape3d.bottom.image")&&(_.bottom_uv=[])),P._12O(n,r);else{var H,J,V,R,d,T,N,c,Y,A;if(n=Qq(z,i,C,S),d=P.vf(_k,F,!1,w),r&&(T=P.vf(Xl,F,!1,w),N=S?W:P.vf(Ep,F,!1,w),c=S?W:P.vf(bc,F,!1,w),Y=P.vf(Im,F,!1,w),A=P.vf(Cr,F,!1,w)),r){for(var f=0,$=n.length;$>f;f++)n[f]=P._tryRemoveBezierPoints(n[f],r);P._12O(n,r)}else d&&n.forEach(function(X){if(R=X.length,R>0)for(H=X[0],V=1;R>V;V++)J=X[V],P.addV(d.vs,H,J),H=J});P._20Q(n),e||(d&&(d.ns=$q(d.vs),Zc(d,"vs"),Zc(d,le)),r&&(T&&(T.ns=$q(T.vs),Zc(T,"vs"),Zc(T,le)),N&&(N.ns=$q(N.vs),Zc(N,"vs"),Zc(N,le)),c&&(c.ns=$q(c.vs),Zc(c,"vs"),Zc(c,le)),Y&&(Y.ns=$q(Y.vs),Zc(Y,"vs"),Zc(Y,le)),A&&(A.ns=$q(A.vs),Zc(A,"vs"),Zc(A,le))))}var j=P.mat=Tq();Li(j,m),mp(j,q.getFinalRotation3d(),q.getRotationMode());var v=q.getScale3d(),K=q._dynamicScale3d;K&&(v[0]*=K[0],v[1]*=K[1],v[2]*=K[2]),ml(j,v),Li(j,kq(m)),e&&(Ob(P,j,e,_),P.clear())},_20Q:function(y){var i,l,b,m,P,t,A,k=this,n=k.front,F=k.back,T=k.top,X=k.bottom,u=n?n.tuv:W,c=F?F.tuv:W,p=T?T.tuv:W,J=X?X.tuv:W,w=0;(u||c||p||J)&&(i=k.s(Rj)||pg(y)||1,y.forEach(function(g){if(l=g.length,l>0)for(t=g[0],b=1;l>b;b++)A=g[b],m=w/i,w+=Nc(t,A),P=w/i,k._14O(n,m,P),k._14O(F,1-P,1-m),k._14O(T,m,P),k._14O(X,m,P),t=A}))},_14O:function(z,N,l){if(z){var G=z.uv,X=z.tuv;if(X){if(G)var f=G[0]+(G[6]-G[0])*N,V=G[1]+(G[7]-G[1])*N,I=G[2]+(G[4]-G[2])*N,k=G[3]+(G[5]-G[3])*N,e=G[2]+(G[4]-G[2])*l,Y=G[3]+(G[5]-G[3])*l,H=G[0]+(G[6]-G[0])*l,T=G[1]+(G[7]-G[1])*l;else f=N,V=0,I=N,k=1,e=l,Y=1,H=l,T=0;X.push(I,k,e,Y,H,T,H,T,f,V,I,k)}}},_13O:function(O){var f=O.uv,H=O.tuv;H&&(f?H.push(f[2],f[3],f[4],f[5],f[6],f[7],f[6],f[7],f[0],f[1],f[2],f[3]):H.push(0,1,1,1,1,0,1,0,0,0,0,1))},_tryRemoveBezierPoints:function(D,l){var P=D.length;if(4>P)return D;var A,K,Y,w,X,L,F=!1,S=function(X){return D[X]},Z=function(B){return D[P-1-B]};for(X=0;1>=X;X++)for(L=X?Z:S,K=L(0),Y=L(1),A=2;P-1>A;A++)if(w=L(A),!w.remove)if(w.b){var k=Dd(K,Y,w,l);k.adjust?(w.remove=!0,F=!0):(K=Y,Y=w)}else K=Y,Y=w;if(!F)return D;var s=[];for(A=0;P>A;A++)D[A].remove||s.push(D[A]);return s},_12O:function(i,O){var Q,I,F,S,m,K=this;i.forEach(function(p){if(m=p.length,m>0)for(Q={p:p[0],n:!0},S=1;m>S;S++)I=p[S],F=m-1>S?p[S+1]:W,K.addPoint(Q,I,F,O,p)})},addPoint:function(z,Z,x,G,M){var g,I,_,n,v,l,d,m,k,t=this,e=z.p,R=z.f,S=z.b,B=t.s("shape3d.side")||Er,s=t.s("shape3d.start.angle"),V=t.s("shape3d.sweep.angle"),c=t.shapeModel,E=t.data.isClosePath();if(z.n&&(z.n=!1,R=E&&M.length>2?Dd(M[M.length-2],e,Z,G):Dd(W,e,Z,G),S=Gd(e,R),c?c.top_vs&&t._10O(S,R,B,s,V,c.top_vs,c.top_uv):(g=t.left)&&(t.addV(g.vs,S,R),t._13O(g))),I=x?Dd(e,Z,x,G):E&&M.length>2?Dd(e,Z,M[1],G):Dd(e,Z,W,G),_=Gd(Z,I),c){var U,D,T=c.vs,q=c.uv,o=c.sum;for(q&&(U=c.len/o,c.len+=Nc(e,Z),D=c.len/o),l=t._9O(S,R,B,s,V),d=t._9O(_,I,B,s,V),m=0;B>m;m++)k=m+1,em(T,l[k]),em(T,d[m]),em(T,l[m]),em(T,d[m]),em(T,l[k]),em(T,d[k]),q&&(n=m/B,v=k/B,q.push(U,v,D,n,U,n,D,n,U,v,D,v));!x&&c.bottom_vs&&t._10O(_,I,B,s,V,c.bottom_vs,c.bottom_uv,!0)}else!x&&(g=t.right)&&(t.addV(g.vs,I,_),t._13O(g)),(g=t.front)&&t.addV(g.vs,R,I),(g=t.back)&&t.addV(g.vs,_,S),(g=t.top)&&t.addH(g.vs,R,I,_,S,!0),(g=t.bottom)&&t.addH(g.vs,S,_,I,R);z.p=Z,z.f=I,z.b=_},_10O:function(s,F,n,q,W,h,J,i){var M,Y,p=this,X=p.data,d=p._9O(s,F,n,q,W),f=(s.x+F.x)/2,U=(s.y+F.y)/2,u=X.getShapeElevation(),x=0;for(x=0;n>x;x++)i?(em(h,d[x]),em(h,d[x+1])):(em(h,d[x+1]),em(h,d[x])),em(h,[f,u,U]),J&&(i?(M=C*(x+1)/n+q,Y=C*x/n+q):(M=C*x/n+q,Y=C*(x+1)/n+q),J.push(.5-.5*o(Y),.5-.5*b(Y),.5-.5*o(M),.5-.5*b(M),.5,.5))},_9O:function(c,M,W,T,L){var m,D,Q=this,s=Q.data,H=[],l=(c.x+M.x)/2,Z=(c.y+M.y)/2,S=s.getTall()/2,i=s.getShapeElevation(),I=0;for(L=L||C;W>=I;I++)m=L*I/W+T,D=o(m),H.push([l+(c.x-l)*D,i+S*b(m),Z+(c.y-Z)*D]);return H},addV:function(b,Z,v){var T=Z.x,d=Z.y,E=v.x,a=v.y,P=this.data,M=P.getShapeElevation(),$=P.getTall()/2;
- b.push(T,M-$,d,E,M-$,a,E,M+$,a,E,M+$,a,T,M+$,d,T,M-$,d)},addH:function(G,D,s,S,M,P){var b=this.data,v=b.getTall()/2,u=b.getShapeElevation()+(P?v:-v);G.push(D.x,u,D.y,s.x,u,s.y,S.x,u,S.y,S.x,u,S.y,M.x,u,M.y,D.x,u,D.y)},vf:function(g,D,y,P){var j,v=this,z=v.gv.getFaceVisible(v.data,g);return(y||z)&&(j=Ke(v,g,P),j.vs=[],j.tuv=z&&(j.texture||D)?[]:W,j.visible=z),j}});var rr=function(M,k){Ne(rr,this,[M,k])};Xr(rr,Tk,{_25Q:1,validate:function(Z){var G=this,o=G.data,I=G.s,b=o.getPoints(),U=b.size();if(G.shapeModel=G.info=W,U>1){var p=G.info={},d=o.getSegments(),Q=o.getThickness(),u=lm(b.get(0)),w=lm(b.get(U-1)),P=U%2;0===P?(p.c1=lm(b.get(U/2-1)),p.c2=lm(b.get(U/2))):p.p3=lm(b.get((U-P)/2)),p.s1=u,p.s2=lm(b.get(1)),p.t1=lm(b.get(U-2)),p.t2=w,p.list=I(Mk)===fj?G.createTubeModel(b,d,Q/2,Z):G.createLineModel(b,d,Q,"shape.border","shape.dash")}var n=o.p3(),O=G.mat=Tq();Li(O,n),mp(O,o.getFinalRotation3d(),o.getRotationMode());var R=o.getScale3d(),A=o._dynamicScale3d;A&&(R[0]*=A[0],R[1]*=A[1],R[2]*=A[2]),ml(O,R),Li(O,kq(n))},_80o:function(o,V,W){var g=this,y=g.shapeModel;if(y){var m=g.gv;Qr(m,g.mat),Ac(m,g.data,y,g,g.getBodyColor(),W),ze(m)}}});var fe=c.graph3d.VR=function(g){var d=this;d.gv=g,d._controllers=[],d.switch=new Qj(d),d._enable=!1,d._defaultCallLater=c.Default.callLater,"undefined"!=typeof n&&"VRFrameData"in n&&(d._frameData=new n.VRFrameData),d.measureOflength=1,d.eyesOffset=[0,0,0]};Xr(fe,R,{ms_fire:!0,_42:function(w,S,b,y){var u=this,n=u.gv,M=u._device;if(M){var B=u._measureOflength;if(M.depthNear=n.getNear()*B,M.depthFar=n.getFar()*B,u._controllers.forEach(function(k){k&&k.update()}),M.isPresenting===!1)return n.iv(),!1;var t=u._frameData;M.getFrameData(t);var T=t.pose.position;return T&&n.setEye(u.toViewPosition(T)),w.viewport(0,0,S/2,b),u._viewMatrix=u._copyViewMatrix(t.leftViewMatrix),u._projectMatrix=u._copyProjectMatrix(t.leftProjectionMatrix),y(),w.viewport(S/2,0,S/2,b),u._viewMatrix=u._copyViewMatrix(t.rightViewMatrix),u._projectMatrix=u._copyProjectMatrix(t.rightProjectionMatrix),y(),u._lastViewMatrix=u._viewMatrix,u._lastProjectMatrix=u._projectMatrix,u._viewMatrix=null,u._projectMatrix=null,u.submitFrame(),!0}},addController:function(Q){Q=Q||0;var A=this,j=A.getController(Q);return j?j:(j=new fp(A,Q),A._controllers.push(j),j)},getController:function(P){P=P||0;for(var E=this._controllers,z=0,c=E.length;c>z;z++)if(E[z]&&E[z].id===P)return E[z];return null},removeController:function(A){A=A||0;for(var I=this._controllers,i=0,C=I.length;C>i;i++)if(I[i]&&I[i].id===A)return I.splice(i,1),!0;return!1},toViewPosition:function(v,$){var V=this,b=V._scaleFactor,u=V._eyesOffset;return $?($[0]=v[0]*b+u[0],$[1]=v[1]*b+u[1],$[2]=v[2]*b+u[2],$):[v[0]*b+u[0],v[1]*b+u[1],v[2]*b+u[2]]},_copyViewMatrix:function(o){var S=this.dup(o),$=this._scaleFactor;S[12]*=$,S[13]*=$,S[14]*=$;var P=this._eyesOffset;if(P&&(P[0]||P[1]||P[2])){var J=P[0],U=P[1],T=P[2];S[12]-=S[0]*J+S[4]*U+S[8]*T,S[13]-=S[1]*J+S[5]*U+S[9]*T,S[14]-=S[2]*J+S[6]*U+S[10]*T}return S},shutdown:function(){var l=this._device;l&&l.isPresenting&&l.exitPresent()},isPresenting:function(){var P=this._device;return P&&P.isPresenting},_copyProjectMatrix:function(j){var V=this.dup(j),z=this._scaleFactor;return V[14]*=z,V},dup:function(X,c){for(var g=X.length,U=c||new Array(g);g--;)U[g]=X[g];return U},getViewMatrix:function(P){var Y=this._viewMatrix;return Y?this.dup(Y,P):void 0},getProjectMatrix:function(){var n=this._projectMatrix;return n?this.dup(n):void 0},submitFrame:function(){var G=this;if(G._enable&&G._deviceInAction){var I=G._device;I&&I.isPresenting&&(I.submitFrame(),G.gv.iv())}},setDevice:function(x){var c=this;c._device=x},_injectCallLaterFunc:function(b){var Z=this;if(!b)return Mh=c.Default.callLater=Z._defaultCallLater,void 0;var Z=this;Mh=c.Default.callLater=function(m,L,h,l){var U=Z._device;return U&&U.isPresenting?l?G(function(){Mh(m,L,h)},l):U.requestAnimationFrame(function(){Z._deviceInAction=!0,m.apply(L,h),Z._deviceInAction=!1}):(Z._defaultCallLater(m,L,h,h),void 0)}}}),R.defineProperties(fe.prototype,{enable:{get:function(){return this._enable},set:function(u){var R=this;R._enable!==u&&(R._enable=u,u?(R.switch.showButton(),R._injectCallLaterFunc(!0)):(R.shutdown(),R.switch.hideButton(),R._injectCallLaterFunc(!1)))}},measureOflength:{get:function(){return this._measureOflength},set:function(R){this._measureOflength=R;var M=this._scaleFactor=1/R;this._controllers.forEach(function(R){R&&R._setScaleFactor(M)})}},eyesOffset:{get:function(){return this._eyesOffset},set:function(R){this._eyesOffset=R}},controllerModel:{get:function(){return this._controllerModel},set:function(v){var V;"object"==typeof v?(V=v.mtl,v=v.obj):(V=v+".mtl",v+=".obj");var d=this,g=d._controllerModel;g&&g.obj===v&&g.mtl===V||(g=d._controllerModel={obj:v,mtl:V},M.loadObj(v,V,{finishFunc:function(B,x){d._controllerModel===g&&M.setShape3dModel("vrControllerModel",x)}}))}},interactive:{get:function(){return!!this._interactive},set:function(U){!!U!=!!this._interactive&&(this._interactive=U,U&&this.addController(0),this.gv.getCoreInteractor().enableVR(U))}}});var fp=function(a,e){function j(H){var S=navigator.getGamepads&&navigator.getGamepads();if(S)for(var b=0,s=0,i=S.length;i>b;b++){var f=S[b];if(f){var x=f.id;if("OpenVR Gamepad"===x||"OpenVR Controller"===x||0===x.indexOf("Oculus Touch")||0===x.indexOf("Spatial Controller")){if(s===H)return f;s++}}}}function w(j,$,O){return Math.abs(j[0]-$[0])<O&&Math.abs(j[1]-$[1])<O&&Math.abs(j[2]-$[2])<O?!0:!1}var W=this;W.vr=a,W.id=e;var $,R,X=[0,0],H=[{id:"thumbpad",pressed:!1},{id:"trigger",pressed:!1},{id:"grips",pressed:!1},{id:"menu",pressed:!1}],o=new ur;o.s("shape3d","vrControllerModel"),o.isController=!0,W.getGamepad=function(){return R},W.getButtonState=function(b){H.forEach(function(k){return k.id===b?k.pressed:void 0})},W.getNode=function(){return o};var P=.003;W.setRotationEpsilon=function(N){P=N};var A=5e-4,r=A;W.setPositionEpsilon=function(i){A=i,r=i*W.vr._scaleFactor},W._setScaleFactor=function(f){o.s3(f,f,f),r=A*f},W._setScaleFactor(W.vr._scaleFactor);var y,q=new xj,m=new qe,L=[0,0,0],B=[0,0,0],G=new Re,f=new Gc;W.getRay=function(){return y?(f.origin.fromArray(L),f.direction.copy(G),y=!1,f):f},W.update=function(){if($=R,R=j(e),$!==R&&console.log("gamepad changed",R),!R||R.pose===N)return R=null,o.s("3d.visible",!1),void 0;if(M.getShape3dModel("vrControllerModel")){o.dm()||a.gv.dm().add(o),o.s("3d.visible",!0);var h=R.pose;if(null!==h){h.position&&(W.vr.toViewPosition(h.position,L),w(o.p3(),L,r)||(y=!0,o.p3(L))),h.orientation&&(q.fromArray(h.orientation),G.set(0,0,-1).applyQuaternion(q).normalize(),m.makeRotationFromQuaternion(q),vl(m.el,o.getRotationMode(),B),w(o.r3(),B,P)||(y=!0,o.r3(B))),y&&a.fp("gamepad.pose",null,{position:L,rotation:B,id:e});var Y=R.axes;(X[0]!==Y[0]||X[1]!==Y[1])&&(X=[Y[0],Y[1]],a.fp("gamepad.axes",null,{id:e,axes:X}));var f,J,T,b,n=R.buttons;for(f=0,J=n.length;J>f;f++)T=n[f],b=T.pressed,b!==H[f].pressed&&(H[f].pressed=b,a.fp("gamepad.button."+H[f].id,null,{id:e,_62O:b?"down":"up"}))}}}},Qj=function(J){this.vr=J,this._button=null};Xr(Qj,R,{showButton:function(){var T=this.assureButton();if(!T.parentNode){var q=this.vr.gv,A=q.getView();q._79O?A.insertBefore(T,q._79O):A.appendChild(T)}},hideButton:function(){var d=this._button;d&&d.parentNode&&d.parentNode.removeChild(d)},assureButton:function(){var L=this._button;return L?L:this._button=this.createButton(this.vr.gv)},createButton:function(P){function Z(T,A){T.textContent=A&&A.isPresenting?"关闭 VR 显示":"开启 VR 显示"}function C(r){B.style.display="",B.style.cursor="pointer",B.style.left="calc(50% - 50px)",B.style.width="100px",Z(B,r),B.onmouseenter=function(){B.style.opacity="1.0"},B.onmouseleave=function(){B.style.opacity="0.5"},B.onclick=function(){r.isPresenting?r.exitPresent():r.requestPresent([{source:P.getCanvas()}])},P.vr.setDevice(r)}function G(){B.style.display="",B.style.cursor="auto",B.style.left="calc(50% - 75px)",B.style.width="150px",Z(B,null),B.onmouseenter=null,B.onmouseleave=null,B.onclick=null,P.vr.setDevice(null)}function r(W){W.style.position="absolute",W.style.bottom="20px",W.style.padding="12px 6px",W.style.border="1px solid #fff",W.style.borderRadius="4px",W.style.color="#000",W.style.font="normal 13px sans-serif",W.style.textAlign="center",W.style.opacity="0.5",W.style.outline="none",W.style.zIndex="999"}if("getVRDisplays"in navigator){var B=this._button=m.createElement("button");return B.style.display="none",r(B),n.addEventListener("vrdisplayconnect",function(G){C(G.display)},!1),n.addEventListener("vrdisplaydisconnect",function(){G()},!1),n.addEventListener("vrdisplaypresentchange",function(y){Z(B,y.display)},!1),navigator.getVRDisplays().then(function(g){g.length>0?C(g[0]):G()}),B}var u=m.createElement("a");return u.href="https://webvr.info",u.innerHTML="当前不支持 webvr",u.style.left="calc(50% - 90px)",u.style.width="180px",u.style.textDecoration="none",r(u),u}}),R.defineProperties(Qj.prototype,{}),dr(M,{accordionViewExpandIcon:Xd(im),accordionViewCollapseIcon:Xd(im,!0),accordionViewLabelColor:kl,accordionViewLabelFont:Eh,accordionViewTitleBackground:Zl,accordionViewSelectBackground:Gh,accordionViewSelectWidth:3,accordionViewSeparatorColor:N,splitViewDividerSize:1,splitViewDividerBackground:Zl,splitViewDragOpacity:.5,splitViewToggleIcon:{width:16,height:16,comps:[{type:gm,rect:[2,2,12,12],background:im}]},propertyViewLabelColor:yd,propertyViewLabelSelectColor:kl,propertyViewLabelFont:Eh,propertyViewExpandIcon:Xd(Pd),propertyViewCollapseIcon:Xd(Pd,!0),propertyViewBackground:Yr,propertyViewRowLineVisible:!0,propertyViewColumnLineVisible:!0,propertyViewRowLineColor:Bk,propertyViewColumnLineColor:Bk,propertyViewSelectBackground:Gh,listViewLabelColor:yd,listViewLabelSelectColor:kl,listViewLabelFont:Eh,listViewRowLineVisible:!1,listViewRowLineColor:Bk,listViewSelectBackground:Gh,treeViewLabelColor:yd,treeViewLabelSelectColor:kl,treeViewLabelFont:Eh,treeViewExpandIcon:Xd(Ee),treeViewCollapseIcon:Xd(Ee,!0),treeViewRowLineVisible:!1,treeViewRowLineColor:Bk,treeViewSelectBackground:Gh,treeViewDoubleClickToToggle:!0,tableViewLabelColor:yd,tableViewLabelSelectColor:kl,tableViewLabelFont:Eh,tableViewRowLineVisible:!0,tableViewColumnLineVisible:!0,tableViewRowLineColor:Bk,tableViewColumnLineColor:Bk,tableViewSelectBackground:Gh,treeTableViewLabelColor:yd,treeTableViewLabelSelectColor:kl,treeTableViewLabelFont:Eh,treeTableViewExpandIcon:Xd(Ee),treeTableViewCollapseIcon:Xd(Ee,!0),treeTableViewRowLineVisible:!0,treeTableViewColumnLineVisible:!0,treeTableViewRowLineColor:Bk,treeTableViewColumnLineColor:Bk,treeTableViewSelectBackground:Gh,tableHeaderLabelColor:yd,tableHeaderLabelFont:Eh,tableHeaderColumnLineVisible:!0,tableHeaderColumnLineColor:wp,tableHeaderBackground:Yr,tableHeaderMoveBackground:Xn,tableHeaderInsertColor:Gh,tableHeaderSortDescIcon:Jm(Pd,!0),tableHeaderSortAscIcon:Jm(Pd),tabViewTabGap:1,tabViewLabelColor:kl,tabViewLabelFont:Eh,tabViewTabBackground:Zl,tabViewSelectWidth:3,tabViewSelectBackground:Gh,tabViewMoveBackground:Xn,tabViewInsertColor:Gh,toolbarLabelColor:yd,toolbarLabelSelectColor:kl,toolbarLabelFont:Eh,toolbarBackground:Yr,toolbarSelectBackground:Gh,toolbarItemGap:8,toolbarSeparatorColor:ad},!0);var El={translateX:1,sortColumn:1},Sc={sortable:1,sortOrder:1,sortFunc:1},ff={focusData:1},lc={dataModel:1,sortColumn:1,sortFunc:1,visibleFunc:1,rootData:1,rootVisible:1},tb={dataModel:1,sortFunc:1,visibleFunc:1,categorizable:1},rj=function(M,F){F.add(M),M.hasChildren()&&M.eachChild(function(O){rj(O,F)})},Ag=function(J,h,Z,S,o,p,b,e,A,t,V){var Y,X=Z.getValueType(t),F=Z.getAlign(t);if(Z.getEnumValues(t)){var L=Z.toEnumLabel(h,t),I=Kl||0,v=0,f=p,x=M.getTextSize(S,L).width;return Y=eo(Z.toEnumIcon(h,t)),Y&&(v=p+Kl/2,"center"===F?v+=(e-(I+x))/2:"right"===F&&(v=v+e-(I+x)),es(J,Y,v,b+A/2,t,V),f=v+Kl/2),L!=W&&(Y?qb(J,L,S,o,f,b,e-(f-p),A):qb(J,L,S,o,p,b,e,A,F)),void 0}return h=Z.formatValue(h),h!=W?X===Hb?(ic(J,p,b,e,A,h),void 0):X===ms||!X&&Rg(h)?(Y=eo(h?tn:rm),es(J,Y,p+e/2,b+A/2,t,V),void 0):(qb(J,h,S,o,p,b,e,A,F),void 0):void 0},$e=function(f,m){var Y=m.view,d=Gg(f),q=m.column||m.property;Y.getDataModel().beginTransaction(),m.editor=f,f.info=m,Y.setCurrentEditor(f),Y.getView().insertBefore(d,Y._79O),vr(f,m.editorRect),f.setFocus?f.setFocus():ds(f),f.commitValue=function(N,p){f._17Q&&(f=f._17Q),p||Y.setValue(m.data,q,f.getValue?f.getValue():f.value),f.close&&f.close(),Lb(d)},q.onEditorCreated&&q.onEditorCreated(m)},rc=function(b,g,X,i,y){var e=Hp(b,X),k=g.value,I=g.view,f=y.getValueType(g.data);return e.onblur=e.onchange=function(){I.endEditing()},"input"===b?(k=y.formatValue(k),k!=W&&(e.value=k),e.onkeydown=function(D){uc(D)?I.endEditing():Zr(D)&&I.endEditing(!0)},(f===Bn||f===eg)&&e.addEventListener(Zj,M.numberListener,!1)):b===Fk&&i.forEach(function(D){var O=m.createElement("option");O.innerHTML=y.toEnumLabel(D),O.value=D,y.isEnumEqual(k,D)&&(O.selected=!0),Vd(e,O)}),$e(e,g),e},en=c.widget={},vm=function(S,v,o){Xr(e+".widget."+S,v,o)};dr(zh,{ms_value:function(A){A.getValue=function(x){var l=this.getItemById(x),E=l.element;return Qc(E)?E:E?E.getValue?E.getValue():E.value:l.selected},A.setValue=function(j,t){var A=this.getItemById(j);if(A){var J=A.element;J&&!Qc(J)?J.setValue?J.setValue(t):J.value=t:Rg(t)?(A.selected=t,this.iv()):(A.element=t,this.iv())}},A.v=function(v,g){var y=this;if(2===arguments.length)y.setValue(v,g);else{if(!ko(v))return y.getValue(v);for(var r in v)y.setValue(r,v[r])}return y}},_46o:function(M){M._icon=W,M._accessType=W,M._valueType=W,M._editable=!1,M._batchEditable=!0,M._align=Ep,M._nullable=!0,M._emptiable=!1,M.setParent=op,M.formatValue=function(c){var o=this,s=o._valueType;return o.getEnumValues()?o.toEnumLabel(c):s===ms?!!c:c!=W&&s===Bn?S(c):c},M.setEnum=function(r,B,M,E,R,i,m){var s=this;r&&!zn(r)&&r.values&&(E=r.editable,M=r.icons,B=r.labels,R=r.strict,i=r.maxHeight,m=r.dropDownWidth,r=r.values),Tc(r)&&(r=r._as),Tc(B)&&(B=B._as),Tc(M)&&(M=M._as),s._enumValues=r,s._enumLabels=B,s._enumIcons=M,s._enumEditable=E,s._enumStrict=R==W?!0:R,s._enumMaxHeight=i,s._enumDropDownWidth=m,r&&r.length&&lk(r[0])&&(s._valueType=eg),s.fp("enum",!1,!0)},M.getEnumDropDownWidth=function(){return this._enumDropDownWidth},M.getEnumMaxHeight=function(){return this._enumMaxHeight},M.isEnumEditable=function(){return this._enumEditable},M.getEnumValues=function(){return this._enumValues},M.getEnumLabels=function(){return this._enumLabels},M.getEnumIcons=function(){return this._enumIcons},M.isEnumStrict=function(){return this._enumStrict},M.isEnumEqual=function(o,p){return this._enumStrict?o===p:o==p},M.toEnumLabel=function(Y,D){var e=this,t=e.getEnumValues(D),h=e.getEnumLabels(D);if(t&&h)for(var p=0;p<t.length;p++)if(e.isEnumEqual(Y,t[p]))return h[p];return Y},M.toEnumIcon=function(x,j){var l=this,Y=l.getEnumValues(j),q=l.getEnumIcons(j);if(Y&&q)for(var z=0;z<Y.length;z++)if(l.isEnumEqual(x,Y[z]))return q[z];return N}},_45o:function(J){J._87o=function(t,X,x,r,M,j){if(t){var p=this,e=p._90I,Y=ps(1);p._columnLineVisible&&(M-=1),p._rowLineVisible&&(j-=1),0>=M||0>=j||(p._90I||(e=p._90I={}),e[X]||(e[X]=new If),vr(Y,p.tx()+x,p.ty()+r,M,j),Vd(Y,t),p._view.insertBefore(Y,p._79O),t.onParentAdded&&t.onParentAdded(Y),e[X].add(Y))}},J._76o=function(){var t=this,$=t._90I;if($){for(var K in $)$[K].each(function(t){Lb(t)});delete t._90I}},J._77o=function(q){var F=this;if(F._90I){var U=F._90I[q];U&&(U.each(function(T){Lb(T)}),delete F._90I[q])}}},_47o:function(i){i.getValue=function(N,R){return R.getValue?R.getValue(N,R,this):nk(N,R.getAccessType(),R.getName())},i.setValue=function(M,c,n){if(c.isEmptiable(M)||""!==n||(n=N),c.isNullable(M)||n!=W){var F=this,R=c.getName(M),w=c.getAccessType(M),G=c.getValueType(M);G===Bn&&Qc(n)?n=V(n):G===eg&&Qc(n)?n=parseFloat(n):G===ms&&Qc(n)&&(n="true"===n),F._batchEditable&&c._batchEditable&&F.isSelected(M)?F.sm().each(function(B){c.setValue?c.setValue(B,c,n,F):$b(B,w,R,n)}):c.setValue?c.setValue(M,c,n,F):$b(M,w,R,n)}},i.setCurrentEditor=function(o){this.endEditing(),this._currentEditor=o,this.redraw()},i.isEditing=function(J,N){var s=this,Z=s._currentEditor;if(!Z)return!1;if(N){var B=Z.info;return B?(B.column||B.property)===N&&B.data===J:!1}return!0},i.endEditing=function(b){var j=this,F=j._currentEditor;F&&(delete j._currentEditor,F.commitValue&&F.commitValue(F.info,b),j.redraw(),j.getDataModel().endTransaction())},i.beginEditing=function(l){this.endEditing();var k=this,g=l.column||l.property;if(g.beginEditing)g.beginEditing(l);else{var E=l.data,P=l.value,t=k.getSelectBackground(E),R=g.getEnumValues(E),M=g.getSlider(E),m=g.getColorPicker(E);if(M){var i=Yc(en.Slider,M);return i.setValue(P),i.getView().onblur=function(){k.endEditing()},i.isInstant()&&(i.onValueChanged=function(){k.setValue(E,g,i.getValue())}),$e(i,l),void 0}if(m||g.getValueType(E)===Hb){var N=Yc(en.ColorPicker,m);return N.setValue(P),N.onClosed=function(){k.endEditing()},N.isInstant()&&(N.onValueChanged=function(t,U){k.setValue(E,g,U)}),$e(N,l),N.open(),void 0}if(R){if(en.ComboBox){var A=new en.ComboBox;A.setValue(P),A.setValues(R),A.setLabels(g.getEnumLabels(E)),A.setIcons(g.getEnumIcons(E)),A.setEditable(g.isEnumEditable(E)),A.setStrict(g.isEnumStrict(E)),A.setMaxHeight(g.getEnumMaxHeight(E)),A.setDropDownWidth(g.getEnumDropDownWidth(E)),A.onClosed=function(){k.endEditing()},$e(A,l),A.open()}else rc(Fk,l,t,R,g);return}var r=g.getValueType(E);if(r===ms||Rg(P))return k.setValue(E,g,!P),void 0;if(g.getItemEditor(E)){var d=Hh(g.getItemEditor(E)),D=new d(E,g,k,l),O=D.getView();return O._17Q=D,D.setValue(P),cf(O),$e(O,l),D.editBeginning&&D.editBeginning(),void 0}rc("input",l,t,W,g)}}},_44o:function(A){A.init=function(s){var k=this,M=k.th=new Je(s),K=k._view=Ko(1,k);k.tv=k._tableView=s,Vd(K,M.getView()),Vd(K,s.getView()),M.mp(function(T){T.property===yi&&k.iv()}),k.iv()},A.getTableView=function(){return this.tv},A.getTableHeader=function(){return this.th},A.getDataModel=function(){return this.tv.dm()},A.getColumnModel=function(){return this.tv.getColumnModel()},A.setColumns=function(i){this.tv.setColumns(i)},A.addColumns=function(w){this.tv.addColumns(w)},A.endEditing=function(){this.tv.endEditing()},A.validateImpl=function(){var i=this,E=i.th,M=mf(E),A={x:0,y:0,width:i.getWidth(),height:M};vr(E,A),A.y=M,A.height=s(0,i.getHeight()-M),vr(i.tv,A)}},ms_vs:function(R){R._41o=function(){return this._29I.height<this._59I},R._43o=function(){var h=this;h._41o()&&(h._58I||(G(function(){h._94O()},qn),h.iv()),h._58I=new Date)},R._94O=function(){var R=this;if(R._58I){var i=new Date;i.getTime()-R._58I.getTime()>=qn?(delete R._58I,R.iv()):G(function(){R._94O()},qn)}},R._93I=function(){var U=this,p=U._27I;if(U._58I||!U._autoHideScrollBar){p||Vd(U._79O,p=U._27I=ps());var c=U._29I,J=c.height,x=U._59I,Q=U.getScrollBarSize(),a=c.width-Q-2,K=J*(-U.ty()/x),j=J*(J/x),w=p.style;x>J?(wh>j&&(K=K+j/2-wh/2,0>K&&(K=0),K+wh>J&&(K=J-wh),j=wh),w.visibility=xm,w.background=U.getScrollBarColor(),w.borderRadius=Q/2+is,vr(p,a,K,Q,j)):w.visibility=Wr}else p&&(p.style.visibility=Wr)}},ms_hs:function(m){m._40o=function(){return this._29I.width<this._91I},m._42o=function(){var I=this;I._40o()&&(I._95O||(G(function(){I._94I()},qn),I.iv()),I._95O=new Date)},m._94I=function(){var Z=this;if(Z._95O){var m=new Date;m.getTime()-Z._95O.getTime()>=qn?(delete Z._95O,Z.iv()):G(function(){Z._94I()},qn)}},m._92I=function(){var v=this,t=v._28I;if(v._95O||!v._autoHideScrollBar){t||Vd(v._79O,t=v._28I=ps());var h=v._29I,y=h.width,x=v._91I,S=v.getScrollBarSize(),p=h.height-S-2,X=y*(-v.tx()/x),g=y*(y/x),o=t.style;x>y?(wh>g&&(X=X+g/2-wh/2,0>X&&(X=0),X+wh>y&&(X=y-wh),g=wh),o.visibility=xm,o.background=v.getScrollBarColor(),o.borderRadius=S/2+is,vr(t,X,p,g,S)):o.visibility=Wr}else t&&(t.style.visibility=Wr)}}}),hg(tn,Yf(16,16,[{type:Rl,rect:[1,1,14,14],background:Gh},{type:Rr,rect:[1,1,14,14],width:1,color:yq},{type:fr,points:[13,3,7,12,4,8],borderWidth:2,borderColor:"#FFF"}])),hg(rm,Yf(16,16,{type:Rr,rect:[1,1,14,14],width:1,color:yq})),hg(ac,Yf(16,16,[{type:Ml,rect:[2,2,12,12],borderWidth:1,borderColor:yq,background:"#FFF"},{type:Ml,rect:[4,4,8,8],background:Gh}])),hg(lj,Yf(16,16,{type:Ml,rect:[2,2,12,12],borderWidth:1,borderColor:yq})),zh._15Q=function(x){x._29I=hp,x._59I=0,x._91I=0,x._5o=function(A){var f=this;f._30I=new If,f._rows=new If,f._rowMap={},f._31I=0,f._14I=0,f._view=Ko(1,f),f._canvas=Nr(f._view),Vd(f._view,f._79O=ps()),f.dm(A?A:new Hk)},x.getCheckIcon=function(S){var Q=this.sm(),G=Q.co(S);return Q.sg()?eo(G?ac:lj):eo(G?tn:rm)},x.checkData=function(u){var z=this.sm(),$=z.co(u);z.sg()&&$||(this._32o=1,$?z.rs(u):z.as(u),delete this._32o)},x.getDataAt=function(t){t.target&&(t=this.lp(t));var M=i(t.y/this._rowHeight),K=this._rows;return 0>M||M>=K.size()?W:K.get(M)},x.onDataDoubleClicked=function(){},x.onDataClicked=function(){},x.adjustTranslateX=function(){return 0},x.adjustTranslateY=function(y){var C=this.getHeight()-this._59I;return C>y&&(y=C),y>0?0:S(y)},x.onPropertyChanged=function(h){var Y=this,u=h.property;lc[u]?Y.ivm():ff[u]||Y.redraw(),u===cr?Y._42o():u===ne&&Y._43o()},x.getLabel=function(y){return y.toLabel()},x.getLabelFont=function(){return this._labelFont},x.getLabelColor=function(p){var l=this;if(l.isCheckMode()){if(l._focusData===p)return l._labelSelectColor}else if(l.isSelected(p))return l._labelSelectColor;return l._labelColor},x.getStartRowIndex=function(){return this._31I},x.getEndRowIndex=function(){return this._14I},x.getRowDatas=function(){return this._rows},x.getRowIndex=function(Z){return this._rowMap[Z._id]},x.getRowSize=function(){return this._rows.size()},x.getViewRect=function(){return ab(this._29I)},x.isVisible=function(Z){return this._visibleFunc?this._visibleFunc(Z):!0},x.getCurrentSortFunc=function(){return this._sortFunc},x.setDataModel=function(t){var $=this,y=$._dataModel,V=$._selectionModel;y!==t&&(y&&(y.umm($.handleDataModelChange,$),y.umd($.handleDataPropertyChange,$),y.umh($.handleHierarchyChange,$),V||y.sm().ums($.handleSelectionChange,$)),$._dataModel=t,t.mm($.handleDataModelChange,$),t.md($.handleDataPropertyChange,$),t.mh($.handleHierarchyChange,$),V?V._21I(t):t.sm().ms($.handleSelectionChange,$),$.fp("dataModel",y,t))},x.validateModel=function(){var c=this;c._rows.clear(),c._rowMap={},c.buildChildren(c._dataModel._roots);var k=c._rows=c._rows.toList(c.isVisible,c),E=0,m=c.getCurrentSortFunc(),x=k.size();for(m&&k.sort(m);x>E;E++)c._rowMap[k.get(E)._id]=E},x.buildChildren=function(p){var k=this;p.each(function(V){k._rows.add(V),k.buildChildren(V._children)})},x.handleDataModelChange=function(){this.ivm()},x.handleDataPropertyChange=function(D){"parent"===D.property?this.ivm():this.invalidateData(D.data)},x.handleHierarchyChange=function(){this.ivm()},x.handleSelectionChange=function(v){v.datas.each(this.invalidateData,this),this.onSelectionChanged(v)},x.onSelectionChanged=function(x){var n=this,$=n.sm();!n.isAutoMakeVisible()||1!==$.size()||"set"!==x.kind&&"append"!==x.kind||n._32o||n.makeVisible($.ld())},x.handleBackgroundClick=function(h){ki(h)&&!this.isCheckMode()&&this.sm().cs()},x.makeVisible=function(x){x&&(this._23I=x,this.iv())},x.scrollToIndex=function(w){var b=this,z=b._29I,J=z.height,Z=b._rowHeight,j=Z*w;w>=0&&w<b._rows.size()&&J>0&&(j+Z>z.y+J?b.ty(-j+J-Z):j<z.y&&b.ty(-j))},x.autoScroll=function(X,y){var r=this,l=r._rowHeight,s=l,R=l/4,Z=r._29I,q=r.lp(X),a={x:r.tx(),y:r.ty()};return l>0&&Z&&(q.x-Z.x<s?r.translate(R,0):Z.x+Z.width-q.x<s&&r.translate(-R,0),q.y-Z.y<s?r.translate(0,R):Z.y+Z.height-q.y<s&&r.translate(0,-R)),a.x=r.tx()-a.x,a.y=r.ty()-a.y,y&&(y.x+=a.x,y.y+=a.y),a},x.getTopRowOrderSelection=function(){var M=this.sm().getTopSelection(),u={},q=new If;return M.each(function(c){u[c._id]=c}),this._rows.each(function(m){u[m._id]&&q.add(m)}),q},x.getRowOrderSelection=function(){var p=new If;return this._rows.each(function(y){this.isSelected(y)&&p.add(y)},this),p},x.ivm=function(){this.invalidateModel()},x.invalidateModel=function(){var R=this;R._96I||(R._96I=1,R._32I=1,delete R._24I),R.iv()},x.redraw=function(){var I=this;I._32I||(I._32I=1,delete I._24I,I.iv())},x.invalidateData=function(x){var i=this;w?i.redraw():i._32I||(i._24I||(i._24I={}),i._24I[x._id]=x,i.iv())},x.getFocusData=function(){return this._focusData},x.setFocusDataById=function(O){this.setFocusData(this.dm().getDataById(O))},x.setFocusData=function(R){var q=this,e=q._focusData;e!==R&&(q._focusData=R,q.fp("focusData",e,R),e&&q.invalidateData(e),R&&(q.invalidateData(R),q.isAutoMakeVisible()&&q.makeVisible(R)))},x.drawRowBackground=function(L,o,T,$,c,q,I){var K=this,x=K.isCheckMode();(o===K._focusData&&x||T&&!x)&&ic(L,$,c,q,I,K.getSelectBackground(o))},x.drawData=function(v,G,m){var D=this,K=D._rowHeight,i=K*m,Z=D._29I,s=Z.x,O=Z.width;v.save(),v.beginPath(),v.rect(s,i,O,K),v.clip(),D._87o(D.drawRow(v,G,D.isSelected(G),s,i,O,K),m,s,i,O,K),v.restore(),D._rowLineVisible&&ic(v,s,i+K-1,O,1,D._rowLineColor)},x._12I=function(z){var f=this,P=f._31I,X=f._29I,V=X.x,R=X.y,O=X.width,b=X.height;for(z.beginPath(),z.rect(V,R,O,b),z.clip(),z.clearRect(V,R,O,b),f._76o(),f._93db(z);P<f._14I;P++)f.drawData(z,f._rows.get(P),P);f._92db(z)},x._13I=function(B){for(var g,_=this,T=_._rowHeight,j=_._29I,X=j.x,S=j.width,G=_._31I,D=_._30I;G<_._14I;G++)g=_._rows.get(G),_._24I[g._id]&&D.add({data:g,index:G});D.isEmpty()||(B.beginPath(),D.each(function(m){B.rect(X,m.index*T,S,T)}),B.clip(),D.each(function(V){B.clearRect(X,V.index*T,S,T)}),D.each(function(w){_._77o(w.index)}),_._93db(B),D.each(function(M){_.drawData(B,M.data,M.index)}),_._92db(B),D.clear())},x.validateImpl=function(){var O=this,U=O._canvas,E=O.getWidth(),L=O.getHeight(),N=O._rowHeight,B=O._32I;(E!==U.clientWidth||L!==U.clientHeight)&&(Bi(U,E,L),B=1);var H=Q&&!u;O._96I&&!H&&O.validateModel();var g=O._29I,$={x:-O.tx(),y:-O.ty(),width:E,height:L},y=O._rows.size(),S=ch(U),r=O._23I;B||Om($,g)||(B=1),O._29I=$,O._59I=y*N,O._31I=i($.y/N),O._14I=J(($.y+$.height)/N),O._31I<0&&(O._31I=0),O._14I>y&&(O._14I=y),O._99I&&B&&O._99I(),Ce(S,O.tx(),O.ty(),1),B?O._12I(S):O._24I&&O._13I(S),O._93I(),O._92I(),S.restore(),O._32I=O._24I=O._96I=W,r&&(O.scrollToIndex(O.getRowIndex(r)),delete O._23I),O.tx(O.tx()),O.ty(O.ty())}},zh._48o=function(h){h._rootVisible=!0,h._rootData=W,h._35o=function(){this._expandMap={},this._levelMap={}},h.validateModel=function(){var b=this,c=b._rootData;b._rows.clear(),b._levelMap={},b._rowMap={},b._currentLevel=0,c?b._rootVisible?b.isVisible(c)&&b.buildData(c):b.buildChildren(c):b.buildChildren(),delete b._currentLevel},h.buildData=function($){var L=this,S=$._id,Y=L._rows;L._rowMap[S]=Y.size(),Y.add($),L._levelMap[S]=L._currentLevel,L.isExpanded($)&&(L._currentLevel++,L.buildChildren($),L._currentLevel--)},h.buildChildren=function(e){var q=this,A=e?e._children:q._dataModel._roots,b=q.getCurrentSortFunc();b&&q.isChildrenSortable(e)?A.toList(q.isVisible,q).sort(b).each(q.buildData,q):A.each(function(L){q.isVisible(L)&&q.buildData(L)})},h.getLevel=function(J){return this._levelMap[J._id]},h.getToggleIcon=function(n){var V=this,S=V._loader,O=V._collapseIcon;return S&&!S.isLoaded(n)?O:n.hasChildren()?V.isExpanded(n)?V._expandIcon:O:W},h.isCheckMode=function(){return this._checkMode!=W},h.isChildrenSortable=function(){return!0},h.handleDataModelChange=function(v){var F=this;v.kind===As?delete F._expandMap[v.data._id]:v.kind===Ln&&(F._expandMap={}),F.ivm()},h.toggle=function(D){var z=this;z.isExpanded(D)?z.collapse(D):z.expand(D)},h.isExpanded=function(f){return 1===this._expandMap[f._id]},h.expand=function(z){var p=this,j=p._loader;p.isExpanded(z)||(j&&!j.isLoaded(z)&&j.load(z),p._expandMap[z._id]=1,p.ivm(),p.onExpanded(z))},h.onExpanded=function(){},h.collapse=function(b){var x=this;x.isExpanded(b)&&(delete x._expandMap[b._id],x.ivm(),x.onCollapsed(b))},h.onCollapsed=function(){},h.expandAll=function(z){if(z)this.expand(z),z.eachChild(function(B){this.expandAll(B)},this);else{var c=this;c._dataModel.each(function(C){C.hasChildren()&&(c._expandMap[C._id]=1)}),c.ivm()}},h.collapseAll=function(){this._expandMap={},this.ivm()},h.makeVisible=function(D){if(D){var Y=this;if(!Y._rootData||D.isDescendantOf(Y._rootData)){for(var o=D._parent;o;)Y.expand(o),o=o._parent;Y._23I=D,Y.iv()}}},h.checkData=function(q){var g,T=this,l=T._checkMode,c=T.sm(),Z=c.co(q);if(!c.sg()||!Z){if(T._32o=1,l===Mj)Z?c.rs(q):c.as(q);else if(l===rg)g=new If(q),g.addAll(q._children);else if("descendant"===l)g=new If,rj(q,g);else if("all"===l&&(g=new If,rj(q,g),!Z))for(var B=q._parent;B;)g.add(B),B=B._parent;g&&(Z?c.rs(g):c.as(g)),delete T._32o}},h._97I=function(o,f,a,N,F,k,Y){var S=this,y=S._indent,q=S._levelMap[f._id],t=S.getIconWidth(f),v=eo(S.getToggleIcon(f));v?(N+=y*q,es(o,v,N+y/2,F+Y/2,f,S),N+=y):N+=y*(q+1),S._checkMode&&(es(o,S.getCheckIcon(f),N+y/2,F+Y/2,f,S),N+=y),S.drawIcon(o,f,N,F,t,Y),S.drawLabel(o,f,N+t,F,Y)}},zh._14Q=function(r){r.getIcon=function(N){return N.getIcon()},r.getIconWidth=function(N){return this.getIcon(N)?this._indent:0},r.drawIcon=function(B,O,m,G,e,s){if(e){var p=this,R=p.getBodyColor(O),X=eo(p.getIcon(O),R);X&&(s-=p.isRowLineVisible()?1:0,Ym(B,X,Pk,m,G,e,s,O,p,R),Gn(B,p.getBorderColor(O),m,G,e,s))}},r.drawLabel=function(d,P,l,U,R){var i=this;qb(d,i.getLabel(P),i.getLabelFont(P),i.getLabelColor(P),l,U,0,R)}},zh._50o=function(y){y._98I=function(){var e=this,J=e._39o=new Hk;e._60I=new If,J.mm(e._17o,e),J.md(e._18o,e),J.mh(e._19o,e)},y.setColumns=function(F){this._39o.clear(),this.addColumns(F)},y.addColumns=function(g){var O=this._39o;g.forEach(function(f){if(!(f instanceof Yi)){var A=Hh(f.className);f=Yc(A?A:Yi,f)}O.add(f)})},y.onColumnClicked=function(){},y.onCheckColumnClicked=function(){},y._3Q=function(C){for(var M,A=0,w=this._60I,f=w.size();f>A;A++)if(M=w.get(A),M.column===C)return M;return W},y.getColumnAt=function(p){var k=this._4Q(p);return k?k.column:W},y._4Q=function(w){for(var R=this,d=w.target?R.lp(w).x:w.x,t=R._60I,O=0;O<t.size();O++){var S=t.get(O),T=S.startX;if(d>=T&&d<T+S.column.getWidth())return S}return W},y.getToolTip=function(a){var d=this,T=d.getDataAt(a),p=d.getColumnAt(a);return T&&p?p.getToolTip(T,d):W},y.adjustTranslateX=function(w){var h=this.getWidth()-this._91I;return h>w&&(w=h),w>0?0:S(w)},y._99I=function(){var W=this,P=W._29I,Z=W._60I;Z.clear(),W._91I=0,W._39o._roots.each(function(L){if(L.isVisible()){var c=W._91I+L.getWidth();W._91I<=P.x+P.width&&c>=P.x&&Z.add({column:L,startX:W._91I}),W._91I=c}})},y.drawData=function(g,d,i){var l=this,H=l._rowHeight,N=H*i,Y=l.isSelected(d),n=l._29I,f=n.x,W=n.width;l.drawRowBackground(g,d,Y,f,N,W,H),l._60I.each(function($){var O=$.column,u=$.startX,T=O.getWidth();T>0&&!l.isEditing(d,O)&&(g.save(),g.beginPath(),g.rect(u,N,T,H),g.clip(),l._87o(l.drawCell(g,d,Y,O,u,N,T,H),i,u,N,T,H),l._columnLineVisible&&ic(g,u+T-1,N,1,H,l._columnLineColor),g.restore())}),l._rowLineVisible&&ic(g,f,N+H-1,W,1,l._rowLineColor)},y.drawCell=function(E,A,m,M,O,k,x,S){var r=this;if(M.drawCell)return M.drawCell(E,A,m,M,O,k,x,S,r);var g=r.getValue(A,M);Ag(E,g,M,r.getLabelFont(A,M,g),r.getLabelColor(A,M,g),O,k,x,S,A,r)},y.getColumnModel=function(){return this._39o},y._17o=function(){this.redraw()},y._18o=function(S){var C=this;S.data===C._sortColumn&&Sc[S.property]?C.ivm():(C._42o(),C.redraw())},y._19o=function(){this.redraw()},y.getCurrentSortFunc=function(){var i=this,o=i._sortColumn;if(o&&o.isSortable()){var U=o.getSortFunc(),L=Tb===o.getSortOrder()?1:-1;return U||(U=Jp),function(n,j){return U.call(i,i.getValue(n,o),i.getValue(j,o),n,j)*L}}return i._sortFunc},y.isCellEditable=function(f,p,F){return(!this.isCheckMode()&&this.isSelected(f)||this.isCheckMode()&&f===this._focusData)&&p.isEditable()&&this.isEditable()?p.isCellEditable?p.isCellEditable(f,p,F,this):!0:!1},y._37O=function(i,Q){if(ki(Q))for(var h=this,$=h.lp(Q),q=h._60I,w=h._rowHeight,H=h._29I,P=H.x,J=H.y,A=H.width,t=H.height,b=0;b<q.size();b++){var B=q.get(b),j=B.startX,F=B.column,V=F.getWidth();if(F!==h._31o&&F!==h._4o&&$.x>=j&&$.x<j+V&&h.isCellEditable(i,F,Q)){var E={x:j,y:h.getRowIndex(i)*w,width:V,height:w},v={x:E.x+h.tx(),y:E.y+h.ty(),width:E.width,height:E.height},u=0,G=0;return E.x<P?u=E.x-P:E.x+E.width>P+A&&(u=E.x+E.width-P-A),u&&(h.tx(h.tx()-u),v.x-=u),E.y<J?G=E.y-J:E.y+w>J+t&&(G=E.y+w-J-t),G&&(h.ty(h.ty()-G),v.y-=G),h.beginEditing({data:i,column:F,value:h.getValue(i,F),event:Q,rect:E,editorRect:v,view:h}),void 0
- }}}},en.BaseItemEditor=function(Q,v,D,H){this._data=Q,this._column=v,this._master=D,this._editInfo=H},vm("BaseItemEditor",R,{ms_ac:["data","column","master","editInfo"],editBeginning:function(){},getView:function(){},getValue:function(){},setValue:function(){}});var ok=c.Tab=function(){Ne(ok,this)};Sj("Tab",tf,{ms_ac:["view","closable","disabled"],_icon:W,_closable:!1,_disabled:!1,setParent:op});var Yi=c.Column=function(){Ne(Yi,this)};Sj("Column",tf,{_46o:1,ms_ac:["accessType","valueType",xm,xn,xf,sq,"align",Hb,"sortOrder",kc,"sortable","clickable","nullable","emptiable","slider","colorPicker","itemEditor"],_visible:!0,_width:80,_sortOrder:Tb,_sortFunc:W,_sortable:!0,_clickable:!0,setWidth:function(F){16>F&&(F=16);var P=this._width;this._width=F,this.fp(sq,P,F)},getToolTip:function(o,x){return this.formatValue(x.getValue(o,this))}});var md=c.Property=function(){Ne(md,this)};Sj("Property",tf,{_46o:1,ms_ac:["accessType","valueType",xn,xf,"categoryName",Hb,"align","nullable","emptiable","slider","itemEditor","colorPicker"],_categoryName:W,getToolTip:function(J,u,S){var w=this;return u?w.formatValue(S.getValue(J,w)):S.getPropertyName(w)}}),en.AccordionView=function(){var U=this;U._20o={},U._21o=new If,U._10o=W,U._9o=W,U._11o=W,U._view=Ko(0,U),U.iv()},vm("AccordionView",R,{ms_v:1,ms_fire:1,ms_ac:[Fn,Gf,"titleHeight",ug,fn,"titleBackground","selectWidth",Uo,"orientation","separatorColor"],_expandIcon:M.accordionViewExpandIcon,_collapseIcon:M.accordionViewCollapseIcon,_titleHeight:Sm,_labelColor:M.accordionViewLabelColor,_labelFont:M.accordionViewLabelFont,_titleBackground:M.accordionViewTitleBackground,_selectBackground:M.accordionViewSelectBackground,_selectWidth:M.accordionViewSelectWidth,_orientation:"v",_separatorColor:M.accordionViewSeparatorColor,onPropertyChanged:function(){this.iv()},getView:function(){return this._view},getTitles:function(){return this._21o},getCurrentTitle:function(){return this._10o},add:function(U,E,w,m){var y=this,s=ps();if(y._20o[U])throw U+" already exists";s.onmousedown=Zp,s.style.cursor=ig,s.addEventListener(Bs?jl:Lk,function(Q){Zp(Q)},!1),s.addEventListener(Bs?Rc:wi,function(v){Zp(v),ki(v)&&(y._10o===U?y.collapse():y.expand(U))},!1),Vd(y._view,s),y._20o[U]={content:E,div:s,canvas:Nr(s),icon:m},y._21o.add(U),w&&y.expand(U),y.iv()},remove:function(l){var P=this,q=P._20o[l];q&&(Lb(q.div),delete P._20o[l],P._21o.remove(l),P.iv())},clear:function(){var Y=this;Y._21o.toArray().forEach(Y.remove,Y),Y._20o={},Y._21o.clear(),Y.iv()},isExpanded:function(S){return this._10o===S},expand:function(m){var l=this;l._20o[m]&&l._10o!==m&&(l._10o=m,l.onExpanded(m),l.iv())},onExpanded:function(){},collapse:function(){var W=this;W._10o&&(W.onCollapsed(W._10o),delete W._10o,W.iv())},onCollapsed:function(){},initCanvas:function(U,h,T){Bi(U,h,T);var Z=ch(U);return Ce(Z,0,0,1),Z.clearRect(0,0,h,T),Z},drawTitle:function(Y,R,h,u,y){var W=this,b=eo(y.icon),Z=W.isExpanded(R),K=W._titleHeight,f=W._titleBackground,q=W._selectWidth,C=W._separatorColor,d=eo(Z?W._expandIcon:W._collapseIcon),k=q+4;ic(Y,0,0,h,u,f),Z&&q&&ic(Y,0,0,q,u,W._selectBackground),(Z||W._21o.get(W._21o.size()-1)!==R)&&ic(Y,0,u-1,h,1,C?C:tj(f)),b&&(es(Y,b,k+ef(b)/2,K/2),k+=ef(b)+2),qb(Y,R,W.getLabelFont(R),W.getLabelColor(R),k,0,0,K),d&&es(Y,d,h-ef(d)/2-4,K/2)},validateImpl:function(){var i=this,x=i._view,J=0,N=0,r=i.getWidth(),F=i.getHeight(),k=i._titleHeight,Z=i._21o.size()*k,M=i._11o,m=i._9o;delete i._11o,delete i._9o,i._21o.each(function(W){var $,d,o=i._20o[W],e=o.content,I=i._10o===W;sf(i)?(vr(o.div,J,0,k,F),$=i.initCanvas(o.canvas,k,F),vc($,0,F),We($,-q),i.drawTitle($,W,F,k,o),$.restore(),I?(d=s(0,r-Z),e&&(i._11o=e,i._9o=Gg(e),vr(e,J+k,0,d,F)),J+=k+d):J+=k):(vr(o.div,0,N,r,k),$=i.initCanvas(o.canvas,r,k),i.drawTitle($,W,r,k,o),$.restore(),I?(d=s(0,F-Z),e&&(i._11o=e,i._9o=Gg(e),vr(e,0,N+k,r,d)),N+=k+d):N+=k)});var R=i._9o;M&&M!==i._11o&&M.endEditing&&M.endEditing(),R&&R!==m&&Vd(x,R),m&&m!==R&&Lb(m)}}),en.SplitView=function(m,E,e,Z){var F=this,d=F._dividerDiv=ps(),f=F._60O=Nr(),J=F._61O=Nr(),I=f.style,X=J.style;F._view=Ko(1,F),Vd(F._view,d),I.msTouchAction=me,I.pointerEvents=me,I.cursor=ig,X.msTouchAction=me,X.pointerEvents=me,X.cursor=ig,m&&F.setLeftView(m),E&&F.setRightView(E),e&&F.setOrientation(e),Z!=W&&F.setPosition(Z),F.setStatus(um),new wn(F)},vm("SplitView",R,{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:M.splitViewDividerSize,_dividerBackground:M.splitViewDividerBackground,_dragOpacity:M.splitViewDragOpacity,_toggleIcon:M.splitViewToggleIcon,onPropertyChanged:function(){this.iv()},getDividerDiv:function(){return this._dividerDiv},getPosition:function(){return this._position},setPosition:function(P,Z){var B=this,y=B._position;isNaN(P)||(Z||(B._82O=0>P?-1:P>1?1:0),B._position=P,B.fp(Rp,y,P))},getLeftView:function(){return this._leftView},setLeftView:function(B){var T=this,Y=T._leftView,g=T._view;if(T._leftView!==B){if(Y&&Y!==T._rightView){var E=Gg(Y);E.parentNode===g&&Lb(E)}if(T._leftView=B,B){var h=Gg(B);h.parentNode!==g&&g.insertBefore(h,T._dividerDiv)}T.fp("leftView",Y,B)}},getRightView:function(){return this._rightView},setRightView:function(r){var l=this,b=l._rightView,f=l._view;if(l._rightView!==r){if(b&&b!==l._leftView){var t=Gg(b);t.parentNode===f&&Lb(t)}if(l._rightView=r,r){var k=Gg(r);k.parentNode!==f&&f.insertBefore(k,l._dividerDiv)}l.fp("rightView",b,r)}},validateImpl:function(){var e=this,k=e._draggable,v=e._position,H=e.getWidth(),y=e.getHeight(),V=e._dividerSize,X=e._dividerBackground,i=Bs?18:8,w=e._dividerDiv,o=e._82O,Q=e._60O,Y=e._61O,f=e._toggleIcon,r=e._status,b=w.style,t=null,j=Bs?20:4,C=f.comps[0];V>=i||0===V?e._coverDiv&&(Lb(e._coverDiv),delete e._coverDiv):e._coverDiv||(e._coverDiv=ps(),O&&(e._coverDiv.style.background=nr),Vd(w,e._coverDiv)),e._togglable?Q.parentNode||(Vd(w,Q),Vd(w,Y)):(Lb(Q),Lb(Y));var E=e._coverDiv,R=e._leftView,_=e._rightView;if(sf(e)){if(V>H&&(V=H),r===um)if(1===o)var g=D(v,H),z=s(0,H-V-g);else-1===o?(z=D(-v,H),g=s(0,H-V-z)):(g=S((H-V)*v),z=s(0,H-V-g));else"cl"===r?(g=0,z=s(0,H-V)):"cr"===r&&(z=0,g=s(0,H-V));R&&vr(R,0,0,g,y),_&&vr(_,g+V,0,z,y),vr(w,g,0,V,y),e._22o=g,E&&(vr(E,V/2-i/2,0,i,y),E.style.cursor=k?Oj:""),w.style.cursor=k?Oj:"";var B=w.clientHeight/2,F=w.clientWidth;Bi(Q,F,F),vr(Q,0,B-F-j,F,F),t=ch(Q),Ce(t,0,0,1),C.rotation=-q,gc(t,f,0,0,F,F),t.restore(),Bi(Y,F,F),vr(Y,0,B+j,F,F),t=ch(Y),Ce(t,0,0,1),C.rotation=q,gc(t,f,0,0,F,F),t.restore()}else{if(V>y&&(V=y),r===um)if(1===o)var G=D(v,y),L=s(0,y-V-G);else-1===o?(L=D(-v,y),G=s(0,y-V-L)):(G=S((y-V)*v),L=s(0,y-V-G));else"cl"===r?(G=0,L=s(0,y-V)):"cr"===r&&(L=0,G=s(0,y-V));R&&vr(R,0,0,H,G),_&&vr(_,0,G+V,H,L),vr(w,0,G,H,V),e._22o=G,E&&(vr(E,0,V/2-i/2,H,i),E.style.cursor=k?Rn:""),b.cursor=k?Rn:"";var W=w.clientWidth/2,F=w.clientHeight;Bi(Q,F,F),vr(Q,W-F-j,0,F,F),t=ch(Q),Ce(t,0,0,1),C.rotation=0,gc(t,f,0,0,F,F),t.restore(),Bi(Y,F,F),vr(Y,W+j,0,F,F),t=ch(Y),Ce(t,0,0,1),C.rotation=l,gc(t,f,0,0,F,F),t.restore()}b.background=X}});var wn=function(m){this.sv=m,this.addListeners()};Xr(wn,R,{ms_listener:1,getView:function(){return this.sv.getView()},handle_touchstart:function(L){var u=this,a=u.sv,m=a._dividerDiv,g=a._60O,G=a._61O,S=a._status,x=L.target;if(x===g)S===um?a.setStatus("cl"):"cr"===S&&a.setStatus(um);else if(x===G)S===um?a.setStatus("cr"):"cl"===S&&a.setStatus(um);else if(pr(L)&&(x===m||x===a._coverDiv)&&(Zp(L),a.isDraggable())){a.getLeftView(),a.getRightView();var h=u.maskDiv=ps();if(h.style.left=0,h.style.top=0,h.style.width=a.getWidth()+"px",h.style.height=a.getHeight()+"px",a.getView().appendChild(h),!a.isContinuousLayout()){var v=u.resizeDiv=ps();v.style.left=m.style.left,v.style.top=m.style.top,v.style.width=m.style.width,v.style.height=m.style.height,v.style.opacity=a.getDragOpacity(),v.style.background=a.getDividerBackground(),Vd(u.getView(),v)}u._lastAbsPosition=a._22o,u._86o=sf(a)?Ak(L).x:Ak(L).y,Qe(u,L)}},handleWindowTouchMove:function(L){pr(L)&&this.update(L,this.sv.isContinuousLayout())},handleWindowTouchEnd:function(c){var G=this;G.update(c,!0),G.sv.setStatus(um),G.maskDiv&&Lb(G.maskDiv),G.resizeDiv&&Lb(G.resizeDiv),G.maskDiv=G.resizeDiv=W},handle_mousedown:function(B){ki(B)&&this.handle_touchstart(B)},handleWindowMouseMove:function(v){this.handleWindowTouchMove(v)},handleWindowMouseUp:function(X){this.handleWindowTouchEnd(X)},update:function(z,H){var h=this,s=h.sv,T=sf(s)?s.getWidth():s.getHeight(),Z=s._dividerSize,p=h._lastAbsPosition-h._86o;sf(s)?(p+=Ak(z).x,p>T-Z&&(p=T-Z),0>p&&(p=0),h.resizeDiv&&(h.resizeDiv.style.left=p+is)):(p+=Ak(z).y,p>T-Z&&(p=T-Z),0>p&&(p=0),h.resizeDiv&&(h.resizeDiv.style.top=p+is)),H&&T!==Z&&(1===s._82O?s.setPosition(p,1):-1===s._82O?s.setPosition(p-T+Z,1):s.setPosition(p/(T-Z),1))}}),en.TabView=function(){var Q=this,S=Q._view=Ko(1,Q),e=Q._91O=ps(1),x=Q._tabModel=new Hk,j=x.sm(),c=Q.invalidate;Q._7o=new If,Q._canvas=Nr(e),Vd(S,e),Vd(S,Q._92O=ps(1)),j.setSelectionMode(mm),j.ms(Q.handleSelectionChange,Q),x.mm(c,Q),x.md(c,Q),x.mh(c,Q),new Ik(Q),Q.iv()},vm("TabView",R,{ms_v:1,ms_fire:1,ms_tx:1,ms_ty:1,ms_lp:1,ms_ac:["movable","tabGap","tabHeight","tabPosition",ug,fn,"tabBackground","selectWidth",Uo,"moveBackground","insertColor"],_tabPosition:Im,_tabHeight:Sm,_tabGap:M.tabViewTabGap,_labelColor:M.tabViewLabelColor,_labelFont:M.tabViewLabelFont,_tabBackground:M.tabViewTabBackground,_selectWidth:M.tabViewSelectWidth,_selectBackground:M.tabViewSelectBackground,_moveBackground:M.tabViewMoveBackground,_insertColor:M.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(m,i,N){var l=new ok,x=this._tabModel;return l.setName(m),l.setView(i),x.add(l),N&&x.sm().ss(l),l},getLabel:function(Y){return Y.toLabel()},onPropertyChanged:function(){this.iv()},_7Q:function(q){this._23o=q,this.iv()},get:function(j){var u=this,A=u._tabModel;if(lk(j))return A._roots.get(j);if(Qc(j)){var d;return A.each(function(G){j===u.getLabel(G)&&(d=G)}),d}return j instanceof ok?j:W},select:function(q){this._tabModel.sm().ss(this.get(q))},remove:function(y){var W=this;if(y=W.get(y)){var K=W._tabModel,l=K._roots.indexOf(y);W._tabModel.remove(y),W.selectByIndex(--l)}},getCurrentTab:function(){return this._8o},hideTabView:function(X,B){B.parentNode===this._92O&&(Tp(B)?(B.style.display=bf,B._tab_=X):Lb(B),Kr())},showTabView:function(b,$){Tp($)&&($.style.display="block",$._tab_=b),$.parentNode!==this._92O&&(Vd(this._92O,$),Kr())},_24o:function(){var n,b=this,R=b._8o,k=b._9o,X=b._tabModel.sm().ld();X&&(n=Gg(X.getView())),n!==k&&(k&&(R.getView()&&R.getView().endEditing&&R.getView().endEditing(),b.hideTabView(R,k)),n&&b.showTabView(X,n)),b._8o=X,b._9o=n,R!==X&&b.onTabChanged(R,X)},onTabClosing:function(){return!0},onTabChanged:function(){},onTabClosed:function(y,K){this.selectByIndex(--K)},selectByIndex:function(M){var I=this,b=I._tabModel,L=b.size();if(L&&!b.sm().ld()){M==W&&(M=0),M>=L&&(M=L-1),0>M&&(M=0);for(var l=M;l>=0;l--){var p=I.get(l);if(!p.isDisabled())return I.select(p),p}for(l=M+1;L>l;l++)if(p=I.get(l),!p.isDisabled())return I.select(p),p}},getTabWidth:function(N){var t=4,B=eo(N.getIcon());B&&(t+=ef(B,N)+4);var z=this.getLabel(N);return z&&(t+=$n(this.getLabelFont(N),z).width+4),N.isClosable()&&(t+=10),t},drawTab:function(e,Y,S,J,v,M,p){var b,D=this,t=D._tabPosition,E=S+4,C=D._selectWidth,x=eo(Y.getIcon()),m=Y.isDisabled(),H=D.getLabelColor(Y),R=D.getLabelFont(Y),f=D.getLabel(Y),o=D._selectBackground,z=t===Ep+"-vertical",T=t===bc+"-vertical";(z||T)&&(E=J+4),m&&(e.globalAlpha=jr),ic(e,S,J,v,M,p),Y===D._8o&&C&&(t===Im?ic(e,S,J+M-C,v,C,o):t===Ep?ic(e,S+v-C,J,C,M,o):t===bc?ic(e,S,J,C,M,o):z?ic(e,S+v-C,J,C,M,o):T?ic(e,S,J,C,M,o):ic(e,S,J,v,C,o));var $=v/2;if(z&&(vc(e,$,J+M/2),We(e,l),vc(e,-$,-J-M/2)),x){var W=fc(x,Y),Q=ef(x,Y);if(z||T){var F=S+v/2,U=E+W/2;vc(e,F,U),We(e,q),vc(e,-F,-U),es(e,x,S+v/2,E+W/2,Y,D),vc(e,F,U),We(e,-q),vc(e,-F,-U),E+=W+4}else es(e,x,E+Q/2,J+M/2,Y,D),E+=Q+4}return z||T?(vc(e,v/2,E+v/2),We(e,q),vc(e,-v/2,-E-v/2),qb(e,f,R,H,S,E,M,v),vc(e,v/2,E+v/2),We(e,-q),vc(e,-v/2,-E-v/2)):qb(e,f,R,H,E,J,v,M),z&&(vc(e,$,J+M/2),We(e,-l),vc(e,-$,-J-M/2)),Y.isClosable()&&(b=T?{x:S+v-12,y:J+M-12,width:12,height:12}:{x:S+v-12,y:J+2,width:12,height:12},this.drawCloseIcon(Y,e,H,b)),m&&(e.globalAlpha=1),b},drawCloseIcon:function(v,r,o,R){var S=R.x,m=R.y;r.strokeStyle=o,r.lineWidth=1,r.beginPath(),r.moveTo(S+2,m+8),r.lineTo(S+8,m+2),r.moveTo(S+8,m+8),r.lineTo(S+2,m+2),r.stroke()},validateImpl:function(){var Q=this;Q._24o();var J,k=Q._canvas,q=Q._tabPosition,P=Q._91O,Z=Q._92O,m=Q._tabModel,W=Q.getWidth(),e=Q.getHeight(),S=Q._tabHeight,T=Q._7o,A=Q._tabGap,Y=q===Im,n=q===Ep,G=q===bc,c=q===Ep+"-vertical",x=q===bc+"-vertical",b=Q._23o,_=0;if((n||G)&&m._roots.each(function(P){_=s(Q.getTabWidth(P),_)}),Y?(vr(P,0,0,W,S),J={x:0,y:S,width:W,height:s(0,e-S)}):n?(vr(P,0,0,_,e),J={x:_,y:0,width:s(0,W-_),height:e}):G?(vr(P,W-_,0,_,e),J={x:0,y:0,width:s(0,W-_),height:e}):c?(vr(P,0,0,S,e),J={x:S,y:0,width:s(0,W-S),height:e}):x?(vr(P,W-S,0,S,e),J={x:0,y:0,width:s(0,W-S),height:e}):(vr(P,0,e-S,W,S),J={x:0,y:0,width:W,height:s(0,e-S)}),vr(Z,J),c||x){Q._9o&&(J.x=0,vr(Q._8o.getView(),J)),Bi(k,S,e);var N=ch(k),X=0;if(Ce(N,0,Q.ty(),1),N.clearRect(0,0,S,e),T.clear(),m._roots.each(function(L){var M,K=Q.getTabWidth(L);b&&b.tab===L||(M=Q.drawTab(N,L,0,X,S,K,Q._tabBackground)),T.add({_75o:M,tab:L,startY:X,endY:X+K,height:K}),X+=K+A}),Q._23Q=s(0,X-A),b){var w=b.position;Q.drawTab(N,b.tab,0,b.startY,S,b.height,Q._moveBackground),ic(N,0,w,S,1,Q._insertColor)}if(N.restore(),Q._selectionChanged){Q._selectionChanged=!1;for(var U=Q.ty(),g=0;g<T.size();g++){var y=T.get(g);if(y.tab===Q._8o){if(y.endY+U<0){Q.ty(-y.startY);break}if(y.startY+U>e){Q.ty(e-y.endY);break}}}}Q.ty(Q.ty())}else if(n||G){Q._9o&&(J.x=0,vr(Q._8o.getView(),J)),Bi(k,_,e);var N=ch(k),X=0;if(Ce(N,0,Q.ty(),1),N.clearRect(0,0,_,e),T.clear(),m._roots.each(function(Y){var n;b&&b.tab===Y||(n=Q.drawTab(N,Y,0,X,_,S,Q._tabBackground)),T.add({_75o:n,tab:Y,startY:X,endY:X+S,height:S}),X+=S+A}),Q._23Q=s(0,X-A),b){var w=b.position;Q.drawTab(N,b.tab,0,b.startY,_,b.height,Q._moveBackground),ic(N,0,w,_,1,Q._insertColor)}if(N.restore(),Q._selectionChanged){Q._selectionChanged=!1;for(var U=Q.ty(),g=0;g<T.size();g++){var y=T.get(g);if(y.tab===Q._8o){if(y.endY+U<0){Q.ty(-y.startY);break}if(y.startY+U>e){Q.ty(e-y.endY);break}}}}Q.ty(Q.ty())}else{Q._9o&&(J.y=0,vr(Q._8o.getView(),J)),Bi(k,W,S);var N=ch(k),R=0;if(Ce(N,Q.tx(),0,1),N.clearRect(0,0,W,S),T.clear(),m._roots.each(function(E){var Z,F=Q.getTabWidth(E);b&&b.tab===E||(Z=Q.drawTab(N,E,R,0,F,S,Q._tabBackground)),T.add({_75o:Z,tab:E,startX:R,endX:R+F,width:F}),R+=F+A}),Q._64I=s(0,R-A),b){var w=b.position;Q.drawTab(N,b.tab,b.startX,0,b.width,S,Q._moveBackground),bh(N,Q._insertColor,w,0,S)}if(N.restore(),Q._selectionChanged){Q._selectionChanged=!1;for(var K=Q.tx(),g=0;g<T.size();g++){var y=T.get(g);if(y.tab===Q._8o){if(y.endX+K<0){Q.tx(-y.startX);break}if(y.startX+K>W){Q.tx(W-y.endX);break}}}}Q.tx(Q.tx())}for(var E=[],p=Z.children,g=0;g<p.length;g++){var v=p[g],D=v._tab_;D&&!m.contains(D)&&E.push(v)}E.forEach(function(W){Z.removeChild(W)})}});var Ik=function(f){this.tv=f,this.addListeners()};Xr(Ik,R,{ms_listener:1,getView:function(){return this.tv._91O},handle_mousewheel:function(w){this.handleScroll(w,10*(w.wheelDelta/40))},handle_DOMMouseScroll:function(Z){this.handleScroll(Z,10*-Z.detail)},handleScroll:function(H,E){Zp(H);var s=this.tv,A=s._tabPosition;!s._40o()||A!==Im&&A!==Cr||s.tx(this.tv.tx()+E),!s._41o()||A!==Ep&&A!==bc&&A!==Ep+"-vertical"&&A!==bc+"-vertical"||s.ty(this.tv.ty()+E)},_8Q:function(i){var y,b,g=this.tv,K=g._tabPosition,J=g._7o;if(K===Im||K===Cr){var X=g.lp(i).x;for(y=0;y<J.size();y++)if(b=J.get(y),b.startX<=X&&X<=b.endX)return b}else if(K===Ep||K===bc||K===Ep+"-vertical"||K===bc+"-vertical"){var u=g.lp(i).y;for(y=0;y<J.size();y++)if(b=J.get(y),b.startY<=u&&u<=b.endY)return b}return W},isClickable:function(E){var w=this.tv,m=w._tabPosition,K=this._73o=this._8Q(E);return!w._40o()||m!==Im&&m!==Cr?!w._41o()||m!==Ep&&m!==bc&&m!==Ep+"-vertical"&&m!==bc+"-vertical"?K&&(!K.tab.isDisabled()||w.isMovable()):!0:!0},handle_mousemove:function($){var O=this;Ug?O._74o=O._8Q($):O.getView().style.cursor=O.isClickable($)?ig:""},handle_mousedown:function(c){this.handle_mousemove(c),this.handle_touchstart(c)},handle_touchstart:function(T){var H=this,z=H.tv,I=z._tabPosition;Zp(T),ki(T)&&H.isClickable(T)&&(I===Im||I===Cr?(H.x=Ak(T).x,H.lp=z.lp(T),H.tx=z.tx()):(H.y=Ak(T).y,H.lp=z.lp(T),H.ty=z.ty()),Qe(H,T))},handleWindowMouseMove:function(G){this.handleWindowTouchMove(G)},handleWindowTouchMove:function(L){var O,q=this,Z=q.tv,J=Z._tabPosition,E=q._73o;if(J===Im||J===Cr){if(O=Ak(L).x-q.x,!q._25o&&!q.moving&&t(O)>2&&(Z._40o()&&!ji(L)?q._25o=1:E&&Z.isMovable()&&(q.moving=1)),q._25o)Z.tx(q.tx+O);else if(q.moving){var o=q.lp.x+O,T=Z._tabGap/2;Z._7o.each(function(f){var e=f.endX,b=o-f.startX<e-o;o>=f.startX&&e>=o&&Z._7Q({tab:E.tab,startX:E.startX+O,width:E.width,front:b,insertTab:f.tab,position:b?s(0,f.startX-T):D(Z._64I,e+T)})})}}else if(O=Ak(L).y-q.y,!q._25o&&!q.moving&&t(O)>2&&(Z._41o()&&!ji(L)?q._25o=1:E&&Z.isMovable()&&(q.moving=1)),q._25o)Z.ty(q.ty+O);else if(q.moving){var p=q.lp.y+O,T=Z._tabGap/2;Z._7o.each(function(l){var J=l.endY,d=p-l.startY<J-p;p>=l.startY&&J>=p&&Z._7Q({tab:E.tab,startY:E.startY+O,height:E.height,front:d,insertTab:l.tab,position:d?s(0,l.startY-T):D(Z._23Q,J+T)})})}},handleWindowMouseUp:function(E){this.handleWindowTouchEnd(E)},handleWindowTouchEnd:function(){var P=this,S=P.tv,c=S._tabPosition,n=S.getTabModel(),k=n._roots,F=P._73o;if(P.moving){var U=S._23o;if(U&&U.insertTab!==U.tab){var v=U.tab,L=k.remove(v),I=k.indexOf(U.insertTab);I>=0&&(U.front||I++,I<=k.size()&&(k.add(v,I),n._38I(v,L,I)))}S._7Q(W),delete P.moving}else if(!P._25o&&F){v=F.tab;var i=P._74o;if(!i||i.tab===v)if(!v.isDisabled()&&Vb(F._75o,P.lp)){var R=function(){var T=k.indexOf(v);n.remove(v),S.onTabClosed(v,T)};S.onTabClosing(v,R)&&R()}else v.isDisabled()||S._8o===v||n.sm().ss(v)}P._25o=P._73o=P._74o=c===Im||c===Cr?P.x=P.lp=P.tx=W:P.y=P.lp=P.ty=W}}),en.PropertyView=function(d){var j=this;j._view=Ko(1,j),j._canvas=Nr(j._view),Vd(j._view,j._79O=ps()),j._rows=new If,j._28o=new If,j._26o={},j._26Q={};var I=j._propertyModel=new Hk,e=j.ivm;I.mm(e,j),I.md(e,j),I.mh(e,j),j.dm(d?d:new Hk),new rn(j)},vm("PropertyView",R,{ms_ac:[ug,xs,fn,xn,xf,"categorizable",Zk,kc,id,Fn,Gf,Vq,Fm,zk,"selectRowIndex",Uo,"background",Rf,hc,wr,Rm,ke],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:hp,_59I:0,_9I:0,_selectRowIndex:-1,_editable:!0,_batchEditable:!0,_categorizable:!0,_indent:Kl,_background:M.propertyViewBackground,_expandIcon:M.propertyViewExpandIcon,_collapseIcon:M.propertyViewCollapseIcon,_scrollBarColor:sj,_scrollBarSize:Od,_autoHideScrollBar:Yn,_selectBackground:M.propertyViewSelectBackground,_rowHeight:Ol,_rowLineVisible:M.propertyViewRowLineVisible,_rowLineColor:M.propertyViewRowLineColor,_10I:.5,_columnLineVisible:M.propertyViewColumnLineVisible,_columnLineColor:M.propertyViewColumnLineColor,_labelColor:M.propertyViewLabelColor,_labelSelectColor:M.propertyViewLabelSelectColor,_labelFont:M.propertyViewLabelFont,getRows:function(){return this._rows},getColumnPosition:function(){return this._10I},setColumnPosition:function(v){0>v&&(v=0),v>1&&(v=1);var O=this,G=O._10I;O._10I=v,O.fp("columnPosition",G,v)},getPropertyName:function(f){return f.toLabel()},getLabelFont:function(){return this._labelFont},getLabelColor:function(x,y,W){return W===this._selectRowIndex?this._labelSelectColor:this._labelColor},getPropertyFont:function(){return this._labelFont},getPropertyColor:function(J,u){return u===this._selectRowIndex?this._labelSelectColor:J.getColor()||this._labelColor},getCategoryFont:function(){return this._labelFont},getCategoryColor:function(){return this._labelColor},adjustTranslateX:function(){return 0},adjustTranslateY:function(s){var v=this.getHeight()-this._59I;return v>s&&(s=v),s>0?0:S(s)},isExpanded:function(D){if(!D)return!0;var g=this._26o[D];return g?g.isExpanded:!(this._26Q[D]===!1)},toggle:function(X){var Z=this;Z.isExpanded(X)?Z.collapse(X):Z.expand(X)},expandAll:function(){this.validate();for(var p in this._26o)this.expand(p)},expand:function(T){if(T&&T!==bf){var A=this,w=A._26o[T];w&&!w.isExpanded&&(w.isExpanded=!0,A.onExpanded(T),A.ivm())}},onExpanded:function(){},collapseAll:function(){this.validate();for(var T in this._26o)this.collapse(T)},collapse:function(w){if(w&&w!==bf){var H=this,v=H._26o[w];v&&v.isExpanded&&(v.isExpanded=!1,H.onCollapsed(w),H.ivm())}},onCollapsed:function(){},getCategoryName:function(M){if(!this.isCategorizable())return bf;var N=M.getCategoryName();return N?N:bf},getPropertyModel:function(){return this._propertyModel},handleSelectionChange:function(){this.ivm()},setDataModel:function(c){var T=this,J=T._dataModel;J!==c&&(J&&(J.umd(T.handlePropertyChange,T),T._selectionModel||J.sm().ums(T.handleSelectionChange,T)),T._dataModel=c,c.md(T.handlePropertyChange,T),T._selectionModel?T._selectionModel._21I(c):c.sm().ms(T.handleSelectionChange,T),T.fp(ol,J,c))},isVisible:function(o){return this._visibleFunc?this._visibleFunc(o):!0},onPropertyChanged:function($){var f=this,h=$.property;tb[h]?f.ivm():f.iv(),h===ne&&f._43o()},getCurrentData:function(){return this._27o},updateCurrentData:function(){this._27o=this.sm().ld()},getRawProperties:function(){return this._27o?this._propertyModel._roots:hf},handlePropertyChange:function(G){this._27o===G.data&&this.iv()},ivm:function(){this.invalidateModel()},invalidateModel:function(){var $=this;$._96I||($.setSelectRowIndex(-1),$._96I=1,$.iv())},redraw:function(){this.iv()},validateModel:function(){var W=this,L=W._rows,q=W._28o,x={},Y=new If,z=W._27o;W.updateCurrentData(),z!==W._27o&&W.endEditing(),L.clear(),q.clear(),W.getRawProperties().each(function(_){if(W.isVisible(_)){Y.add(_);var p=W.getCategoryName(_);x[p]||(q.add(p,p===bf?0:N),x[p]={isExpanded:W.isExpanded(p),properties:new If})}}),W._sortFunc&&Y.sort(W._sortFunc);for(var F in W._26o)W._26Q[F]=W.isExpanded(F);W._26o=x,q.each(function(v){v!==bf&&L.add(v);var R=x[v];R.isExpanded&&Y.each(function(O){W.getCategoryName(O)===v&&(R.properties.add(O),L.add({property:O,data:W._27o}))},W)})},validateImpl:function(){var L=this;L._76o(),L._96I&&(L.validateModel(),delete L._96I);var P=L._canvas,E=L.getWidth(),q=L.getHeight(),w=-L.ty(),V=L._rowHeight,m=L._indent,y=E-m,Q=L._rows,$=Q.size(),A=L._9I=m+y*L._10I,b=L._59I=$*V;Bi(P,E,q),L._29I={x:0,y:w,width:E,height:q},L._31I=i(w/V),L._14I=J((w+q)/V),L._31I<0&&(L._31I=0),L._14I>$&&(L._14I=$);var I,g=ch(P),s=L._background;Ce(g,0,-w,1),g.beginPath(),g.rect(0,w,E,q),g.clip(),g.clearRect(0,w,E,q),L._93db(g),s&&ic(g,0,0,m,b,s);for(var c=L._31I;c<L._14I;c++){var k=Q.get(c),w=V*c;if(Qc(k))s&&ic(g,m,w,y,V,s),I=eo(L.isExpanded(k)?L._expandIcon:L._collapseIcon),I&&Ym(g,I,Pk,0,w,m,V),g.save(),g.beginPath(),g.rect(m,w,y,V),g.clip(),L.drawCategoryName(g,k,c,m,w,y,V),g.restore();else{var h=k.property,X=k.data,I=eo(h.getIcon()),j=L._selectRowIndex===c?L.getSelectBackground():W;if(I&&Ym(g,I,Pk,0,w,m,V),j&&ic(g,m,w,y,V,j),g.save(),g.beginPath(),g.rect(m,w,A-m,V),g.clip(),L.drawPropertyName(g,h,c,m,w,A-m,V),g.restore(),!L.isEditing(X,h)){var d=A+1,H=E-A-1;g.save(),g.beginPath(),g.rect(d,w,H,V),g.clip(),L._87o(L.drawPropertyValue(g,h,L.getValue(X,h),c,d,w,H,V,X),c,d,w,H,V),g.restore()}}L._rowLineVisible&&ic(g,m,w+V-1,y,1,L._rowLineColor)}L._columnLineVisible&&(ic(g,A,0,1,b,L._columnLineColor),ic(g,E-1,0,1,b)),L._92db(g),L._93I(),g.restore(),L.ty(L.ty())},drawCategoryName:function(B,T,W,q,i,E,_){qb(B,T,this.getCategoryFont(T),this.getCategoryColor(T),q,i,E,_)},drawPropertyName:function(b,I,q,W,u,c,N){return I.drawPropertyName?(I.drawPropertyName(b,I,q,W,u,c,N,this),void 0):(qb(b,this.getPropertyName(I),this.getPropertyFont(I,q),this.getPropertyColor(I,q),W,u,c,N),void 0)},drawPropertyValue:function(j,l,P,L,c,A,u,X,f){return l.drawPropertyValue?l.drawPropertyValue(j,l,P,L,c,A,u,X,f,this):(Ag(j,P,l,this.getLabelFont(l,P,L),this.getLabelColor(l,P,L),c,A,u,X,f,this),void 0)},isPropertyEditable:function(d){return d.isEditable()&&this.isEditable()},setProperties:function(i){this._propertyModel.clear(),this.addProperties(i)},addProperties:function(V){if(V){var $=this._propertyModel;V.forEach(function(M){if(!(M instanceof md)){var p=Hh(M.className);M=Yc(p?p:md,M)}$.add(M)})}},getRowIndexAt:function(O){var c=this,b=i(c.lp(O).y/c._rowHeight);return b>=0&&b<c._rows.size()?b:-1},getPropertyAt:function(y){var V=this,b=V.getRowIndexAt(y);return b>=0?V._rows.get(b).property:W},getToolTip:function(Y){var c=this,y=c.getPropertyAt(Y),L=c._27o;return y&&L?y.getToolTip(L,c._9I<c.lp(Y).x,c):W}});var rn=function(P){this.pv=P,this.addListeners()};Xr(rn,R,{ms_listener:1,getView:function(){return this.pv._view},setCursor:function(j){this.getView().style.cursor=j},clear:function(){var l=this;l._62O=l.cp=l.ty=l.p=W,l.setCursor(Mj)},handle_mousedown:function(T){this.handle_touchstart(T)},handle_touchstart:function(J){var c=this,l=c.pv;Zp(J),l.setFocus(J)&&(ki(J)?(c.cp=Ak(J),c.ty=l.ty(),c.p=l.getColumnPosition(),c.handle_touchmove(J)):l.setSelectRowIndex(l.getRowIndexAt(J)))},handleWindowMouseUp:function(){this.clear()},handleWindowTouchEnd:function(){this.clear()},handle_mouseup:function(j){this.handle_touchend(j)},handle_touchend:function(_){var a=this;if(a.cp&&!a._62O){var l=a.pv,E=l.lp(_),h=E.x,C=E.y,S=l._indent,z=l.getRowIndexAt(_),t=l._9I;if(z>=0){var r=l._rowHeight,u=r*z,P=l._rows.get(z),b=P.property;if(Qc(P))eo(l.isExpanded(P)?l._expandIcon:l._collapseIcon)&&h>=0&&S>=h&&C>=u&&u+r>=C?l.toggle(P):jp(_)&&l.toggle(P);else if(h>t&&l.isPropertyEditable(b,_)){var n={x:t+1,y:u,width:l.getWidth()-t-1,height:r},F={x:n.x+l.tx(),y:n.y+l.ty(),width:n.width,height:n.height},Z=0,j=l._29I;n.y<j.y?Z=n.y-j.y:n.y+r>j.y+j.height&&(Z=n.y+r-j.y-j.height),Z&&(l.ty(l.ty()-Z),F.y-=Z),l.beginEditing({data:P.data,property:b,value:l.getValue(P.data,b),event:_,rect:n,editorRect:F,view:l})}}l.setSelectRowIndex(z)}a.clear()},handleWindowMouseMove:function(o){this.handleWindowTouchMove(o)},handleWindowTouchMove:function(m){var e=this,Y=e.pv,M=e.ty,F=e.cp,X=Ak(m),x=e._62O;if("p"===x)Y.setTranslateY(M+X.y-F.y);else if("c"===x){var z=Y.getWidth()-Y._indent;if(z>16){var q=e.p-(F.x-X.x)/z,H=16/z;H>q&&(q=H),q>1-H&&(q=1-H),Y.setColumnPosition(q)}}else"s"===x&&Y.setTranslateY(M+(F.y-X.y)*Y._59I/Y._29I.height)},handle_mousemove:function(D){this.handle_touchmove(D)},handle_touchmove:function(v){if(!Ug&&ki(v)){var B=this,O=B.pv,p=t(O.lp(v).x-O._9I)<=(Bs?8:3);B.cp?B._62O||(p?(B._62O="c",Qe(B)):t(Ak(v).y-B.cp.y)>=2&&(B._62O=B.isV(v)?"s":"p",Qe(B))):(p?B.setCursor(Oj):B.setCursor(Mj),B.isV(v)&&O._43o())}},isV:function(P){var H=this.pv,N=H._29I;return H._41o()&&N.x+N.width-H.lp(P).x<ai},handle_mousewheel:function(I){this.handleScroll(I,I.wheelDelta/40)},handle_DOMMouseScroll:function(b){2===b.axis&&this.handleScroll(b,-b.detail)},handleScroll:function(W,J){var m=this.pv;Zp(W),m.endEditing(),m.translate(0,J*m.getRowHeight())},handle_keydown:function(X){var _=this.pv,E=_._rows.size(),x=_._selectRowIndex+(Gr(X)?-1:1);(Gr(X)||ob(X))&&(0>x&&(x=0),x>=E&&(x=E-1),_.setSelectRowIndex(x))}}),en.ListView=function(R){this._5o(R),new Lm(this)},vm("ListView",R,{ms_ac:[ug,xs,fn,Rf,Zk,hc,wr,kc,id,Vq,Fm,zk,ls,Uo],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:Kl,_rowHeight:Ol,_rowLineVisible:M.listViewRowLineVisible,_rowLineColor:M.listViewRowLineColor,_scrollBarColor:sj,_scrollBarSize:Od,_autoMakeVisible:Zd,_autoHideScrollBar:Yn,_selectBackground:M.listViewSelectBackground,_labelColor:M.listViewLabelColor,_labelSelectColor:M.listViewLabelSelectColor,_labelFont:M.listViewLabelFont,isCheckMode:function(){return this._checkMode},setCheckMode:function(f){var L=this,j=L._checkMode;L._checkMode=f,L.fp(ts,j,f)},drawRow:function(v,Y,O,y,U,X,K){var m=this,B=0,E=m._indent,h=m.getIconWidth(Y);m.drawRowBackground(v,Y,O,y,U,X,K),m._checkMode&&(es(v,eo(m.getCheckIcon(Y)),B+E/2,U+K/2,Y,m),B+=E),m.drawIcon(v,Y,B,U,h,K),m.drawLabel(v,Y,B+h,U,K)}});var Lm=function(H){this.list=H,this._lastSelectDataTime=Nh(),this.addListeners()};Xr(Lm,R,{ms_listener:1,getView:function(){return this.list._view},clear:function(l){var L=this,h=L.list;l&&"d"===L._62O&&!L.dragCancel&&h.handleDragAndDrop(l,"end"),h.draggingData&&(h.draggingData=null,h.redraw()),L.dragCancel=L._62O=L._isV=L._isH=L.cp=L.tx=L.ty=W},handle_mousedown:function(G){this.handle_touchstart(G)},handle_touchstart:function(N){var V=this,R=V.list;if(Zp(N),R.setFocus(N)){var D=R.getDataAt(N);V.cp=Ak(N),V.tx=R.tx(),V.ty=R.ty(),ki(N)?D&&R.handleDragAndDrop&&!V.isV(N)&&!V.isH(N)&&(R.draggingData=D,R.redraw(),R.handleDragAndDrop(N,"prepare")):(D&&V._33o(N,D),V.clear(N))}},handleWindowMouseUp:function(t){this.clear(t)},handleWindowTouchEnd:function(O){this.clear(O)},handle_mouseup:function(e){this.handle_touchend(e)},handle_touchend:function(J){var P=this,d=P.list;if(!P._isV&&!P._isH&&P.cp&&!P._62O){var v=d.getDataAt(J);v?(d.isCheckMode()?P._34o(J,v):P._33o(J,v),jp(J)?d.onDataDoubleClicked(v,J):d.onDataClicked(v,J)):d.handleBackgroundClick(J)}P.clear(J)},handleWindowMouseMove:function(Z){this.handleWindowTouchMove(Z)},handleWindowTouchMove:function(I){var f=this,J=f.list,p=f._62O,X=f.tx,a=f.ty,D=f.cp,O=Ak(I),W=J._29I;"p"===p?J.setTranslate(X+O.x-D.x,a+O.y-D.y):"v"===p?J.ty(a+(D.y-O.y)*J._59I/W.height):"h"===p?J.tx(X+(D.x-O.x)*J._91I/W.width):"d"===p&&(f.dragCancel||J.handleDragAndDrop(I,"between"))},handle_mousemove:function(v){this.handle_touchmove(v)},handle_touchmove:function(r){if(!Ug&&ki(r)){var J=this,a=J.list;if(J._isV=J.isV(r),J._isH=J.isH(r),J.cp){if(!J._62O){if(Nc(Ak(r),J.cp)<2)return;J._isV?J._62O="v":J._isH?J._62O="h":a.draggingData&&!this.dragCancel?(J._62O="d",a.handleDragAndDrop(r,"begin")):J._62O="p",J._62O&&"d"!==J._62O&&a.draggingData&&(a.draggingData=null,a.redraw()),Qe(J)}}else J._isV&&a._43o(),J._isH&&a._42o()}},isV:function(b){var x=this.list,q=x._29I;return x._41o()&&q.x+q.width-x.lp(b).x<ai},isH:function(O){var M=this.list,X=M._29I;return M._40o()&&X.y+X.height-M.lp(O).y<ai},handle_mousewheel:function(B){this.handleScroll(B,B.wheelDelta/40,B.wheelDelta!==B.wheelDeltaX)},handle_DOMMouseScroll:function(c){this.handleScroll(c,-c.detail,1)},handleScroll:function(A,o,P){var T=this.list;Zp(A),T.endEditing&&T.endEditing(),P&&T._41o()?T.translate(0,o*T.getRowHeight()):T._40o()&&T.translate(10*o,0)},handle_keydown:function(k){if(!M.isInput(k.target)){var E,R=this.list,d=R.sm(),T=R._rows,b=T.size();if(Vc(k))R.selectAll();else if(Qh(k))R.handleDelete&&R.handleDelete(k);else if(Zr(k))"d"!==this._62O||this.dragCancel||(R.handleDragAndDrop(k,"cancel"),this.dragCancel=!0);else if(Nd(k))R.isCheckMode()&&(E=R.getFocusData(),E&&R.checkData(E));else if(Gr(k)||ob(k)){var B=R.isCheckMode();if(E=B?R.getFocusData():d.ld()){var w=R.getRowIndex(E);w>=0&&(Gr(k)?0!==w&&(E=T.get(w-1),B?R.setFocusData(E):d.ss(E)):w!==b-1&&(E=T.get(w+1),B?R.setFocusData(E):d.ss(E)))}else b>0&&(E=T.get(0),B?R.setFocusData(E):d.ss(E))}}},_34o:function(Y,H){var J=this.list,D=J.lp(Y).x;return D>=0&&D<=J._indent?(J.checkData(H),void 0):(J.setFocusData(H),void 0)},_33o:function(f,y){var B=this.list,L=B.sm(),J=L.ld();if(ji(f))B.isSelected(y)?L.rs(y):L.as(y);else if(Mc(f))if(J)for(var G=B.getRowIndex(J),z=B.getRowIndex(y);G!==z;)G+=z>G?1:-1,L.as(B._rows.get(G));else L.ss(y);else if(ki(f)){var j=Nh();if(L.contains(y)){var q=j-this._lastSelectDataTime;B.handleDataDoubleSelect&&q>500&&1500>q&&B.handleDataDoubleSelect(f,y)}L.ss(y),this._lastSelectDataTime=j}else L.contains(y)||L.ss(y)}}),en.TreeView=function(Q){var P=this;P._35o(),P._5o(Q),new jg(P)},vm("TreeView",R,{ms_ac:[ug,xs,fn,"rootVisible",ts,"rootData",kc,id,Vq,Fm,zk,Zk,Rf,hc,wr,Fn,Gf,ls,Uo,"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:W,_indent:Kl,_rowHeight:Ol,_rowLineVisible:M.treeViewRowLineVisible,_rowLineColor:M.treeViewRowLineColor,_scrollBarColor:sj,_scrollBarSize:Od,_autoHideScrollBar:Yn,_expandIcon:M.treeViewExpandIcon,_collapseIcon:M.treeViewCollapseIcon,_autoMakeVisible:Zd,_selectBackground:M.treeViewSelectBackground,_labelColor:M.treeViewLabelColor,_labelSelectColor:M.treeViewLabelSelectColor,_labelFont:M.treeViewLabelFont,_doubleClickToToggle:M.treeViewDoubleClickToToggle,drawRow:function(d,A,V,e,M,s,S){var r=this;
- r.drawRowBackground(d,A,V,e,M,s,S),r._97I(d,A,V,0,M,s,S)},isOnToggleIcon:function(S){var $=this.getDataAt(S);if($){var d=this.getIndent(),K=this.lp(S).x;if(eo(this.getToggleIcon($))){var w=d*this.getLevel($);if(K>=w&&w+d>=K)return!0}}return!1}});var jg=function(_){Ne(jg,this,[_])};Xr(jg,Lm,{toggle:function(P,B,$,R){var I=this.list,n=I.lp(P).x;if(eo(I.getToggleIcon(B))){var d=$*R;if(n>=d&&d+$>=n)return I.toggle(B),!0}return I.isDoubleClickToToggle()&&jp(P)?(I.toggle(B),!0):!1},_34o:function(t,Z){var Q=this.list,n=Q.lp(t).x,B=Q._levelMap[Z._id],h=Q._indent,$=h*(B+1);return n>=$&&$+h>=n?(Q.checkData(Z),void 0):(this.toggle(t,Z,h,B)||Q.setFocusData(Z),void 0)},_33o:function(L,f){var y=this,B=y.list;y.toggle(L,f,B._indent,B.getLevel(f))||jg.superClass._33o.call(y,L,f)},handle_keydown:function(Q){if(Ae(Q)||Fr(Q)){var p=this.list,h=p._rows,H=p.isCheckMode(),b=p.sm(),d=H?p.getFocusData():b.ld();d?d.hasChildren()&&(Ae(Q)?p.collapse(d):p.expand(d)):h.size()>0&&(d=h.get(0),H?p.setFocusData(d):b.ss(d))}else jg.superClass.handle_keydown.call(this,Q)}});var Cf=en.TableView=function(k){this._98I(),this._5o(k),new bk(this)};vm("TableView",R,{ms_ac:[ug,xs,fn,"sortMode",xn,xf,Rf,hc,wr,Rm,ke,"sortColumn",kc,id,Vq,Fm,zk,ls,Uo],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:Gi,_editable:!0,_batchEditable:!1,_rowHeight:Ol,_rowLineVisible:M.tableViewRowLineVisible,_rowLineColor:M.tableViewRowLineColor,_columnLineVisible:M.tableViewColumnLineVisible,_columnLineColor:M.tableViewColumnLineColor,_scrollBarColor:sj,_scrollBarSize:Od,_autoHideScrollBar:Yn,_autoMakeVisible:Zd,_selectBackground:M.tableViewSelectBackground,_labelColor:M.tableViewLabelColor,_labelSelectColor:M.tableViewLabelSelectColor,_labelFont:M.tableViewLabelFont,getCheckColumn:function(){var N=this;if(!N._31o){var D=N._31o=new Yi;D.setEditable(!0),D.setWidth(40),D.getValue=N.getCheckColumValue,D.drawCell=N.drawCheckColumnCell}return N._31o},isCheckMode:function(){return this._39o.contains(this._31o)},setCheckMode:function(U){var C=this,F=C._39o,B=C.getCheckColumn();U!==C.isCheckMode()&&(U?F.add(B,0):F.remove(B),C.fp(ts,!U,U))},getCheckColumValue:function(I,Q,B){return B.isSelected(I)},drawCheckColumnCell:function(j,h,F,n,I,p,k,D,c){es(j,c.getCheckIcon(h),I+k/2,p+D/2,h,c)}});var bk=function(_){Ne(bk,this,[_])};Xr(bk,Lm,{_34o:function(E,N){var Y=this.list,R=Y._31o;if(Y.isCellEditable(N,R,E)){var s=Y._3Q(R),q=Y.lp(E).x;if(s&&q>=s.startX&&q<s.startX+R.getWidth())return Y.checkData(N),void 0}Y._37O(N,E),Y.setFocusData(N)},_33o:function(A,h){this.list._37O(h,A),bk.superClass._33o.apply(this,arguments)}});var Yo=en.TreeTableView=function(o){var Q=this,x=Q._4o=new Yi;Q._35o(),Q._98I(),Q._5o(o),x.setDisplayName("Name"),x.setEditable(!0),x.setWidth(180),x.drawCell=Xe,x.getValue=ui,Q._39o.add(x),new Gp(Q)},Xe=function(c,G,K,y,I,O,k,S,E){E._97I(c,G,K,I,O,k,S)},ui=function(E,w,y){return y.getLabel(E)};vm("TreeTableView",R,{ms_ac:[ug,xs,fn,"sortMode",xn,xf,Zk,ts,"rootData","rootVisible",kc,id,"sortColumn",Fn,Gf,Vq,Fm,zk,ls,wr,Rf,hc,Rm,ke,Uo,"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:Gi,_checkMode:W,_editable:!0,_batchEditable:!1,_indent:Kl,_rowHeight:Ol,_rowLineVisible:M.treeTableViewRowLineVisible,_rowLineColor:M.treeTableViewRowLineColor,_columnLineVisible:M.treeTableViewColumnLineVisible,_columnLineColor:M.treeTableViewColumnLineColor,_expandIcon:M.treeTableViewExpandIcon,_collapseIcon:M.treeTableViewCollapseIcon,_scrollBarColor:sj,_scrollBarSize:Od,_autoHideScrollBar:Yn,_autoMakeVisible:Zd,_selectBackground:M.treeTableViewSelectBackground,_labelColor:M.treeTableViewLabelColor,_labelSelectColor:M.treeTableViewLabelSelectColor,_labelFont:M.treeTableViewLabelFont,getTreeColumn:function(){return this._4o}});var Gp=function(l){Ne(Gp,this,[l])};Xr(Gp,Lm,{_34o:function(v,J){var R=this.list,o=R._4o,r=R._3Q(o),b=R.lp(v).x;if(r){var s=R._indent,T=r.startX+s*R.getLevel(J);if(eo(R.getToggleIcon(J))&&b>=T&&T+s>=b)return R.toggle(J),void 0;if(R.isCellEditable(J,o)&&(T+=s,b>=T&&T+s>=b))return R.checkData(J),void 0}R._37O(J,v),R.setFocusData(J)},_33o:function(Z,W){var j=this.list,r=j.lp(Z).x;if(eo(j.getToggleIcon(W))){var X=j._3Q(j._4o);if(X){var k=j._indent,Q=X.startX+k*j.getLevel(W);if(r>=Q&&Q+k>=r)return j.toggle(W),void 0}}j._37O(W,Z),Gp.superClass._33o.apply(this,arguments)}});var Je=en.TableHeader=function(K){var T=this,E=T._view=Ko(1,T),G=T._39o=K.getColumnModel(),r=T.iv;T.tv=T._tableView=K,T._60I=new If,T._canvas=Nr(E),E.style.background=M.tableHeaderBackground||"",E.style.height=Ab+is,G.mm(r,T),G.md(r,T),G.mh(r,T),K.mp(function(L){El[L.property]&&T.iv()},T),new Ni(T),T.iv()};vm("TableHeader",R,{ms_v:1,ms_lp:1,ms_fire:1,ms_ac:["checkIcon","sortDescIcon","sortAscIcon",ug,fn,Zk,"moveBackground","insertColor",Rm,ke,"resizable","movable"],_checkIcon:rm,_movable:!0,_resizable:!0,_labelColor:M.tableHeaderLabelColor,_labelFont:M.tableHeaderLabelFont,_columnLineColor:M.tableHeaderColumnLineColor,_columnLineVisible:M.tableHeaderColumnLineVisible,_sortDescIcon:M.tableHeaderSortDescIcon,_sortAscIcon:M.tableHeaderSortAscIcon,_moveBackground:M.tableHeaderMoveBackground,_insertColor:M.tableHeaderInsertColor,_indent:Kl,getCheckIcon:function(){return this._checkIcon},getTableView:function(){return this.tv},getLabel:function(j){return j.toLabel()},getLabelFont:function(){return this._labelFont},getLabelColor:function(t){return t.getColor()||this._labelColor},getLabelAlign:function(m){return m._align},onPropertyChanged:function(){this.iv()},_5Q:function(v){this._61I=v,this.iv()},getLogicalPoint:function(F){return Tg(F,this._canvas,this.tv.tx())},validateImpl:function(){var F=this,P=F._canvas,c=F.getWidth(),M=F.getHeight(),g=F.tv,q=F._60I,Z=F._61I,W=-g.tx(),o=0;(c!==P.clientWidth||M!==P.clientHeight)&&Bi(P,c,M),q.clear(),F._39o._roots.each(function(Q){if(Q.isVisible()){var e=o+Q.getWidth();W+c>=o&&e>=W&&q.add({column:Q,startX:o}),o=e}});var v=ch(P);if(Ce(v,-W,0,1),v.beginPath(),v.rect(W,0,c,M),v.clip(),v.clearRect(W,0,c,M),q.each(function(t){var H=t.column,e=t.startX,L=H.getWidth();L>0&&(v.save(),v.beginPath(),v.rect(e,0,L,M),v.clip(),Z&&Z.column===H||F.drawColumn(v,H,e,0,L,M),F._columnLineVisible&&ic(v,e+L-1,0,1,M,F._columnLineColor),v.restore())}),Z){var d=Z.column,o=Z.startX,Y=Z.position,I=d.getWidth();v.save(),v.beginPath(),v.rect(o,0,I,M),v.clip(),v.fillStyle=F._moveBackground,v.fill(),F.drawColumn(v,d,o,0,I,M),v.restore(),bh(v,F._insertColor,Y,0,M)}v.restore()},_6Q:function(C){var A=this.tv;return A._31o===C&&A.sm().getSelectionMode()===tm},drawColumn:function(_,O,m,J,t,E){var H=this,T=H.tv,Z=eo(O.getIcon()),r=H.getLabelAlign(O);if(H._6Q(O)){var q=eo(H._checkIcon);es(_,q,m+t/2,J+E/2,O,H)}else{var g=H.getLabel(O),d=H.getLabelFont(O),k=H.getLabelColor(O),N=$n(d,g).width,b=Z?H._indent:0;r===Ep?(Z&&Ym(_,Z,Pk,m,J,b,E),qb(_,g,d,k,m+b,J,t,E,Ep)):r===bc?(Z&&Ym(_,Z,Pk,m+t-N-b,J,b,E),qb(_,g,d,k,m,J,t,E,bc)):(Z&&Ym(_,Z,Pk,m+(t-N-b)/2,J,b,E),qb(_,g,d,k,m+(t-N+b)/2,J,0,E,Ep))}if(O.isSortable()&&T.getSortColumn()===O&&(Z=eo(O.getSortOrder()===Tb?H._sortAscIcon:H._sortDescIcon))){var u=ef(Z,O)/2+2;es(_,Z,r===bc?m+u:m+t-u,J+E/2,O,T)}}});var Ni=function(U){var J=this;J.th=U,J.tv=U._tableView,J.addListeners()};Xr(Ni,R,{ms_listener:1,getView:function(){return this.th.getView()},setCursor:function(D){this.getView().style.cursor=D},handle_mousemove:function(F){if(!Ug){var k=this;delete k._29o,k.setCursor(Mj);for(var G=k.th,f=G._60I,E=G.lp(F).x,z=f.size()-1;z>=0;z--){var O=f.get(z),W=O.column,B=O.startX+W.getWidth();if(G.isResizable()&&t(B-E)<=(Bs?10:3))return k._29o=O,k.setCursor(Oj),void 0;E>O.startX&&B>E&&(k._29o=O),(W.isClickable()||W.isSortable()||G.isMovable()||k.tv.getCheckColumn&&W===k.tv.getCheckColumn())&&E>O.startX&&B>E&&k.setCursor(ig)}}},handle_mousedown:function(X){this.handle_touchstart(X)},handle_touchstart:function(X){var j=this;Zp(X),j.tv.endEditing(),j.handle_mousemove(X),j._29o&&(j.x=Ak(X).x,j.lx=j.th.lp(X).x,j.w=j._29o.column.getWidth(),Qe(j,X))},handleWindowMouseMove:function(J){this.handleWindowTouchMove(J)},handleWindowTouchMove:function(c){var K=this,C=K.th,a=K.getView().style.cursor,v=K._29o,z=Ak(c).x-K.x;if(K.resizing||K.moving||(a===Oj?K.resizing=1:C.isMovable()&&a===ig&&t(z)>2&&(K.moving=1)),K.resizing)v.column.setWidth(K.w+z);else if(K.moving){var W=K.lx+z;C._60I.each(function(V){var r=V.startX,E=r+V.column.getWidth();if(W>=r&&E>=W){var Z={column:v.column,startX:v.startX+z,front:E-W>W-r,insertColumn:V.column};Z.position=Z.front?r:E,C._5Q(Z)}})}},_16Q:function(F,E){var I=this,Y=I.tv,d=I.th,Z=d._checkIcon;if(d._6Q(F)){var t=eo(Z),L=I.lx,w=F.getWidth(),Q=ef(t,F);if(L>=E+w/2-Q&&E+w/2+Q>=L){d.setCheckIcon(Z===tn?rm:tn);var g=Y.sm(),X=Y._rows;return Z===tn?g.rs(X):g.ss(X),Y.onCheckColumnClicked(F),!0}}return!1},handleWindowMouseUp:function(s){this.handleWindowTouchEnd(s)},handleWindowTouchEnd:function(q){var S=this,j=S.tv,Y=S.th,d=S._29o;if(S.moving){var c=Y._61I;if(c&&c.insertColumn!==c.column){var Z=c.column,L=j.getColumnModel()._roots,N=L.remove(Z),G=L.indexOf(c.insertColumn);G>=0&&(c.front||G++,G<=L.size()&&(L.add(Z,G),j.getColumnModel()._38I(Z,N,G)))}Y._5Q(W),delete S.moving}else if(!S.resizing&&d){Z=d.column;var M=Y.lp(q).x,s=d.startX,k=!0;if(Y.onColumnClicked){var R=Y.onColumnClicked(Z,q,s);R===!1&&(k=!1)}if(k&&M>=s&&M<=s+Z.getWidth()&&!S._16Q(Z,s)){if(Z.isSortable()){var u=j.getSortMode(),K=Z.getSortOrder();u===Gi?j.getSortColumn()===Z?(K===Cd&&j.setSortColumn(W),Z.setSortOrder(K===Tb?Cd:Tb)):j.setSortColumn(Z):"bistate"===u&&(j.getSortColumn()===Z?Z.setSortOrder(K===Tb?Cd:Tb):j.setSortColumn(Z))}j.onColumnClicked(Z,q,s)}}S._29o=S.resizing=S.x=S.lx=S.w=W}}),en.TablePane=function(H){this.init(new Cf(H))},vm("TablePane",R,{ms_v:1,_44o:1}),en.TreeTablePane=function(T){this.init(new Yo(T))},vm("TreeTablePane",R,{ms_v:1,_44o:1}),en.Toolbar=function(R){var y=this,w=y._view=Ko(1,y),d=w.style;d.background=M.toolbarBackground||"",d.height=Sm+is,y._canvas=Nr(w),y._30o=new If,y._90I=new If,y.setItems(R||[]),w.handleGroupSelectedChanged=function(q){if(q.isSelected()){var O=q.getGroupId();null!=O&&y._items.forEach(function(k){var w=k.element;w&&w!==q&&w.setSelected&&w.getGroupId&&w.getGroupId()===O&&w.setSelected(!1)})}},new Aj(y)},vm("Toolbar",R,{ms_v:1,ms_fire:1,ms_tx:1,ms_lp:1,ms_tip:1,ms_value:1,ms_ac:[sr,ug,fn,xs,Uo,"itemGap","separatorColor","currentItem","stickToRight"],_labelColor:M.toolbarLabelColor,_labelSelectColor:M.toolbarLabelSelectColor,_labelFont:M.toolbarLabelFont,_selectBackground:M.toolbarSelectBackground,_itemGap:M.toolbarItemGap,_separatorColor:M.toolbarSeparatorColor,_stickToRight:!1,getSumWidth:function(){return this._64I},getToolTip:function(z){var C=this.getItemInfoAt(z);return C?C.item.toolTip:W},getLabelColor:function(Q){return Q&&Q.selected&&Q.type!==tn&&Q.type!==cl?this._labelSelectColor:this._labelColor},onPropertyChanged:function(v){this.iv(),v.property===sr&&this._items.forEach(function(F){Oc(F)})},redraw:function(){this.iv()},addItem:function(q,u){var S=this._items;u==W?S.push(q):S.splice(u,0,q),this.fp(sr,W,S)},removeItem:function(A){if(A)for(var J=this._items,p=0;p<J.length;p++)A===J[p]&&(J.splice(p,1),this.fp(sr,W,J))},removeItemById:function(g){if(g!=W)for(var e=this._items,s=0;s<e.length;s++)if(g===e[s].id){var D=e.splice(s,1)[0];return this.fp(sr,W,e),D}},getItemById:function(o){if(o!=W)for(var p=this._items,P=0;P<p.length;P++){var L=p[P];if(o===L.id)return L}},setItemVisible:function(l,Z){var k=this.getItemById(l);k&&(k.visible=Z)},getItemInfos:function(){return this._30o},getItemInfoAt:function(G){var j=this,z=0,H=j._30o,i=j.lp(G),u=i.x,O=i.y;if(O>=0&&O<=j.getHeight())for(;z<H.size();z++){var $=H.get(z);if($.startX<=u&&u<=$.endX)return $}return W},drawItem:function(o,U,V,i,Q){if(U.visible===!1)return 0;if(zl(U.visible)&&!U.visible())return 0;var d=this,f=U.disabled;f&&(o.globalAlpha=jr);var $=d.drawItemImpl(o,U,V,i,Q),u=d._itemGap;return f&&(o.globalAlpha=1),this._currentItem!==U||"separator"===U||U.separator===!0||U.unfocusable||Gn(o,d._separatorColor,V-u/2,0,$+u,i),$},drawItemImpl:function(G,Z,t,Q,o){var R=this,n=R._view,C=R._itemGap,h=Q/2,F=Z.type,c=Z.element,O=Z.label;Qc(c)&&(O=c,c=W);var S,P=R.getLabelFont(Z),D=R.getLabelColor(Z),g=Z.selected,B=eo(Z.icon),J=ef(B,Z),X=0,k=J+(O?$n(P,O).width:0);if("separator"===Z||Z.separator===!0)return bh(G,R._separatorColor,t,Q/4,h),1;if(c){B&&es(G,B,t+J/2,h,Z,R),qb(G,O,P,D,t+J,0,0,Q);var Y=Gg(c);o||R._90I.add(Y),Y.parentNode!==n&&Vd(n,Y),c.iv&&c.iv(),c.validate&&c.validate();var A=Y.getBoundingClientRect(),f=A.width,l=Y.style;return cf(Y),l.left=R.tx()+t+k+is,l.top=(Q-A.height)/2+is,k+f}return F===cl?S=eo(g?ac:lj):F===tn&&(S=eo(g?tn:rm)),S?(X=ef(S,Z),es(G,S,t+X/2,h,Z,R),t+=X,k+=X):g&&ic(G,t-C/2,0,k+C,Q,R.getSelectBackground(Z)),B&&es(G,B,t+J/2,h,Z,R),qb(G,O,P,D,t+J,0,0,Q),k},validateImpl:function(){var v=this,j=v._canvas,d=v.getWidth(),_=v.getHeight(),z=v._30o,q=v._items;Bi(j,d,_);var B=ch(j),o=v._itemGap,J=o/2;Ce(B,v.tx(),0,1),B.clearRect(0,0,d,_);var e=v._90I;v._90I=new If,z.clear(),q.forEach(function(G){var R=v.drawItem(B,G,J,_);z.add({item:G,startX:J,endX:J+R,width:R}),R&&(J+=R+o)}),e.each(function(R){v._90I.contains(R)||Lb(R)});var C=v._64I;v._64I=s(0,J),B.restore(),v._stickToRight?(v._65O=0,B=ch(j),J=d-v._64I+o,Ce(B,0,0,1),B.clearRect(0,0,d,_),z.clear(),q.forEach(function(c){var Z=v.drawItem(B,c,J,_,!0);z.add({item:c,startX:J,endX:J+Z,width:Z}),Z&&(J+=Z+o)}),B.restore()):v.tx(v.tx()),C!==v._64I&&v.onSumWidthChanged(C,v._64I)},onSumWidthChanged:function(){},handleClick:function(F,T){var i=this,j=F.type,R=F.action,v=F.groupId,e=F.selected;F.disabled||(v!=W?e||(F.selected=!0,this._items.forEach(function(j){j.groupId===v&&F!==j&&(j.selected=!1)}),R&&F.action(F,i,T)):j===tn||"toggle"===j?(F.selected=!e,R&&F.action(F,i,T)):R&&F.action(F,i,T)),Kr(),i.iv()}});var Aj=function(H){this.tb=H,this.addListeners()};Xr(Aj,R,{ms_listener:1,getView:function(){return this.tb._view},handle_mousewheel:function(t){this.handleScroll(t,10*(t.wheelDelta/40))},handle_DOMMouseScroll:function(l){this.handleScroll(l,10*-l.detail)},handleScroll:function(_,K){Zp(_);var O=this.tb;O.isScrollable()&&!O._stickToRight&&(O.tx(O.tx()+K),Jo())},handle_mousemove:function(f){var r=this;Ug||r.setItem(f)},handle_mouseout:function(I){var g=this;I.target===g.getView()?g.tb.setCurrentItem(W):g.handle_mousemove(I)},handle_mousedown:function(R){this.handle_mousemove(R),this.handle_touchstart(R)},handle_touchstart:function(H){var u=this,U=u.tb,i=H.target;ki(H)&&(i===u.getView()||i===U._canvas)&&(Zp(H),U.setFocus(H)&&(this.setItem(H,!0),(U.isScrollable()||u.info&&!u.info.item.disabled)&&(u.x=Ak(H).x,u.tx=U.tx(),Qe(u,H))))},handleWindowMouseMove:function(H){this.handleWindowTouchMove(H)},handleWindowTouchMove:function(i){var B=this,D=B.tb;if(!D._stickToRight){var C=Ak(i).x-B.x;!B._25o&&t(C)>2&&D.isScrollable()&&(B._25o=1),B._25o&&D.tx(B.tx+C)}},handleWindowMouseUp:function(h){this.handleWindowTouchEnd(h)},handleWindowTouchEnd:function(G){var b=this,A=b.tb,k=b.info,S=b.tb.getItemInfoAt(G);if(!b._25o&&k){var _=k.item;S&&S.item===_&&A.handleClick(_,G)}b._25o=b.x=b.tx=W,b.setItem()},setItem:function(t,p){var r=this,o=r.tb,h=r.info=t?o.getItemInfoAt(t):W,s=h?h.item:W;o.setCurrentItem(s),p&&s&&zl(s.onDown)&&s.onDown(t)}}),en.BorderPane=function(){this._view=Ko(1,this),this.iv()},vm("BorderPane",R,{ms_v:1,ms_ac:["topHeight","bottomHeight","leftWidth","rightWidth"],ms_fire:1,getLeftView:function(){return this._leftView},setLeftView:function(R,F){this._12o("leftView",R),F!=W&&this.setLeftWidth(F)},getRightView:function(){return this._rightView},setRightView:function(u,I){this._12o("rightView",u),I!=W&&this.setRightWidth(I)},getTopView:function(){return this._topView},setTopView:function(N,c){this._12o("topView",N),c!=W&&this.setTopHeight(c)},getBottomView:function(){return this._bottomView},setBottomView:function(p,y){this._12o("bottomView",p),y!=W&&this.setBottomHeight(y)},getCenterView:function(){return this._centerView},setCenterView:function(u){this._12o("centerView",u)},_12o:function(q,i){var P=this,x="_"+q,t=P._view,C=P[x];C!==i&&(C&&(C.getView?Lb(C.getView()):Lb(C)),P[x]=i,i&&(i.getView?Vd(t,i.getView(),1):Vd(t,i,1)),P.fp(q,C,i))},onPropertyChanged:function(){this.iv()},validateImpl:function(){var m=this,B=m._topView,K=m._bottomView,b=m._leftView,u=m._rightView,n=m._centerView,p=m.getWidth(),G=m.getHeight(),k=0,F=0,M=p,J=G,Z=0,w=0,A=0,H=0;B&&(Z=m._topHeight==W?mf(B):m._topHeight,F=Z),K&&(w=m._bottomHeight==W?mf(K):m._bottomHeight,J=G-w),b&&(A=m._leftWidth==W?vq(b):m._leftWidth,k=A),u&&(H=m._rightWidth==W?vq(u):m._rightWidth,M=p-H);var c=s(0,M-k),Q=s(0,J-F);B&&vr(B,0,0,p,Z),K&&vr(K,0,J,p,w),b&&vr(b,0,F,A,Q),u&&vr(u,M,F,H,Q),n&&vr(n,k,F,c,Q)}})}}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:(0,eval)("this"),Object);
|