!function(x,X,H){"use strict";var r="px",e="0",Y="innerHTML",z="className",F=ht.Default,_=ht.Color,f=ht.Node,K="position",Z="top",m="left",S=F.animate,c=F.getInternal(),l="width",e="0",d="none",L="max-height",G="font",Q="background",h="border-box",b="user-select",B="box-sizing",E="overflow",s=F.isTouchable,c=F.getInternal(),u=_.titleIconBackground,O=F.scrollBarInteractiveSize,g=/msie 9/.test(x.navigator?x.navigator.userAgent.toLowerCase():""),W=null,R=function(){return document},o=function(i){return R().createElement(i)},M=function(){return o("div")},C=function(){var m=M(),E=m.style;return E.msTouchAction=d,E.cursor="default",s&&E.setProperty("-webkit-tap-highlight-color","rgba(0, 0, 0, 0)",W),E.position="absolute",E.left=e,E.top=e,m},P=function(){return o("canvas")},U=function(){return document.body},$=function(u,j,T){u.style.setProperty(j,T,W)},N=function(y,r){y.style.removeProperty(r)},a=function(s,N,H){F.def(ht.widget[s],N,H)},D=function(_,y){_.appendChild(y)},j=function(L,H){L.removeChild(H)},p=function(_,M,w,r){_.addEventListener(M,w,!!r)};c.addMethod(F,{paletteExpandIcon:{width:16,height:16,comps:[{type:"triangle",rect:[4,4,10,8],background:u,rotation:3.14}]},paletteCollapseIcon:{width:16,height:16,comps:[{type:"triangle",rect:[4,4,10,8],background:u}]},paletteTitleLabelColor:F.labelSelectColor,paletteTitleLabelFont:F.labelFont,paletteContentLabelFont:F.labelFont,paletteContentLabelColor:"#777",paletteContentBackground:"#fff",paletteTitleHeight:F.widgetTitleHeight,paletteTitleBackground:_.titleBackground,paletteTitleHoverBackground:_.titleBackground,paletteSeparatorWidth:1,paletteSeparatorColor:H,paletteItemHoverBorderColor:_.highlight,paletteItemSelectBackground:_.highlight},!0);var w=".palette-item:hover{border: 1px solid "+F.paletteItemHoverBorderColor+" !important}"+" .palette-header:hover{background: "+F.paletteTitleHoverBackground+" !important}",v=document.createElement("style");s||(v.styleSheet?v.styleSheet.cssText=w:v.appendChild(R().createTextNode(w))),R().getElementsByTagName("head")[0].appendChild(v);var t=function(G){var p=this;p.$22h=G,p.addListeners()};F.def(t,X,{ms_listener:1,getView:function(){return this.$22h.getView()},$26h:function(){var l=this;l.$36h&&U().removeChild(l.$36h),l.$23h=l.$24h=l.$25h=l.$35h=l.$36h=W},handle_touchstart:function(Y){for(var e,d=this,y=d.$22h,b=Y.target,j=y.sm(),c=y.dm(),O="palette-header",m="palette-header-tool",I="palette-item",W=!1,h=!1,u=!1;b&&(b[z]||"").indexOf(O)<0&&(b[z]||"").indexOf(I)<0;)b=b.parentNode;if(b&&b[z].indexOf(m)>=0?W=!0:b&&b[z].indexOf(O)>=0?u=!0:b&&b[z].indexOf(I)>=0&&(h=!0),F.isLeftButton(Y))if(d.$27h(Y))d.$24h=F.getClientPoint(Y),d.$25h=y.ty();else if(W){F.preventDefault(Y),e=b.parentNode.$11h;var $=c.getDataById(e),x=$.s("tools")[b.toolIndex];x.action&&x.action.call(y)}else if(u){F.preventDefault(Y),e=b.$11h;var $=c.getDataById(e);$.isExpanded()?$.setExpanded(!1):$.setExpanded(!0)}else if(h){e=b.$11h;var g=c.getDataById(e);j.ss(g),y.handleDragAndDrop&&(F.preventDefault(Y),g.s("draggable")&&(y.handleDragAndDrop(Y,"prepare"),d.$35h=0)),g.s("draggable")||(F.preventDefault(Y),d.$24h=F.getClientPoint(Y),d.$25h=y.ty())}else F.preventDefault(Y),d.$24h=F.getClientPoint(Y),d.$25h=y.ty();else d.$26h(Y)},handle_mousedown:function(L){this.handle_touchstart(L)},handle_mousewheel:function(w){this.handleScroll(w,w.wheelDelta/40,w.wheelDelta!==w.wheelDeltaX)},handle_DOMMouseScroll:function(X){this.handleScroll(X,-X.detail,1)},handleScroll:function(g,K,A){var Z=this.$22h;F.preventDefault(g),A&&Z._41o()&&Z.ty(Z.ty()+20*K)},handle_mouseup:function(r){this.handle_touchend(r)},handle_touchend:function(P){var s=this;s.$37h(P),s.$26h(P)},handleWindowMouseUp:function(e){this.handleWindowTouchEnd(e)},handleWindowTouchEnd:function(S){var c=this;c.$37h(S),c.$26h(S)},$37h:function(o){var P=this,W=P.$22h;2===P.$35h&&(P.$35h=3,W.handleDragAndDrop(o,"end"))},handleWindowMouseMove:function(d){this.handleWindowTouchMove(d)},handleWindowTouchMove:function(B){var u=this,b=u.$22h,y=u.$23h,n=u.$24h,I=u.$25h,j=F.getClientPoint(B),e=b._29I,m=u.$36h;if(1===u.$35h||2===u.$35h){if(u.$35h=2,b.handleDragAndDrop(B,"between"),s){var t=B.touches[0];B=t?t:B.changedTouches[0]}m.style.left=B.pageX-parseInt(m.width)/2+r,m.style.top=B.pageY-parseInt(m.height)/2+r}else"p"===y?b.ty(I+j.y-n.y):"v"===y&&b.ty(I+(n.y-j.y)/e.height*b._59I)},handle_mousemove:function(f){this.handle_touchmove(f)},handle_touchmove:function(m){if(!F.isDragging()&&F.isLeftButton(m)){var y=this,N=y.$22h,g=y.$27h(m);if(y.$24h){if(!y.$23h){if(F.getDistance(F.getClientPoint(m),y.$24h)<2)return;y.$23h=g?"v":"p",F.startDragging(y)}}else if(g)N._43o();else if(0===y.$35h){if(y.$35h=1,N.handleDragAndDrop(m,"begin"),s){var L=m.touches[0];m=L?L:m.changedTouches[0]}var B=y.$36h=new Image,P=N.$10h[N.sm().ld().getId()].querySelector(".image-box"),E=parseInt(P.style.width),n=parseInt(P.style.height);B.draggable=!1,B.src=P.toDataURL(),B.width=E,B.height=n,B.style.position="absolute",B.style.left=m.pageX-E/2+r,B.style.top=m.pageY-n/2+r,U().appendChild(B),F.startDragging(y)}}},$27h:function(S){var T=this.$22h,b=T.getView(),f=b.getBoundingClientRect(),x=T._29I,k=S.clientX-f.left+b.scrollLeft;return T._41o()&&x.x+x.width-kH||(N.$21h=H)}}for(var A in _){P=_[A];var t,w;if(l.contains(P)){if(P instanceof ht.Group){var b,x=N.$1h(P),B=s[P.getId()];B&&(b=B.nextSibling,j(k,b),j(k,B)),v=l.getSiblings(P).indexOf(P);var U=k.children[2*v]||N._79O;U&&U.parentNode?(k.insertBefore(x[0],U),k.insertBefore(b||x[1],U)):(k.appendChild(x[0]),k.appendChild(b||x[1])),s[P.getId()]=x[0],a=y[P.getId()]=b||x[1],w=P.$12h;var C=P.s("promptText");w||(P.$12h=o("div"),P.$12h[Y]=C||"",w=P.$12h),0===P.getChildren().size()?a.contains(w)||D(a,w):a.contains(w)&&j(a,w)}else if(t=P.getParent()){var R=N.$2h(P),V=s[P.getId()];a=y[t.getId()],V&&j(V.parentNode,V),v=l.getSiblings(P).indexOf(P);var p=a.children[v];p?a.insertBefore(R,p):D(a,R),s[P.getId()]=R,N.$14h(P)}}else{var n=s[P.getId()],q=n.parentNode;if(P instanceof ht.Group){var X=n.nextSibling;j(k,n),j(k,X),delete y[P.getId()]}else j(q,n),0===q.children.length&&(t=l.getDataById(q.$11h),w=t.$12h,w&&!q.contains(w)&&D(q,w));delete s[P.getId()]}}N.$4h={};var M=function(){var j=N._59I,V=0;N.$32h!=W&&(clearInterval(N.$32h),V=0,delete N.$32h),N.$32h=setInterval(function(){N.$31h(),j===N._59I?(V++,V>=2&&(clearInterval(N.$32h),delete N.$32h)):(V=0,j=N._59I)},30)};for(var d in y)if(a=y[d],P=l.getDataById(y[d].$11h),N.$15h(P),N._drawToolsIcon(P),P.isExpanded()){if(a.style.maxHeight===0+r){var h=a.scrollHeight+N._itemMargin+r;S(a).duration(200).set(L,h).set("padding-bottom",N._itemMargin+r).end(function(){return function(){M()}}(h))}else a.style.maxHeight=a.scrollHeight+r;a.style.paddingBottom=N._itemMargin+r}else a.style.maxHeight!==0+r&&S(a).duration(200).set(L,e).set("padding-bottom",e).end(function(){return function(){M()}}(a));N.$28h(),N.$31h()},$31h:function(){for(var w=this,j=w._view,v=0,A=j.children,M=0;M=0&&(v+=t.offsetHeight)}w._59I=v,w.$30h=w.$33h(w.ty());var S=w.ty();j.scrollTop=-S,w._29I={x:0,y:-S,width:j.clientWidth,height:j.clientHeight},$(w._79O,Z,-S+r),w._93I()},$33h:function(l){var M=this,n=M._29I.height-M._59I;return n>l&&(l=n),l>0?0:Math.round(l)},redraw:function(){this.$13h||(this.$13h=1,this.iv())},onPropertyChanged:function(d){["autoHideScrollBar","scrollBarSize","scrollBarColor","translateY"].indexOf(d.property)<0&&this.redraw(),"translateY"===d.property&&(this.iv(),this._43o())},findDataByName:function(G){for(var k=this.dm().getDatas(),K=0;K=0&&(U===t?$(e,Q,F.paletteItemSelectBackground):N(e,Q))})}})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:this,Object);