!function(v,k){"use strict";var b="ht",s=v[b],h="position",Y="absolute",n="px",c="left",N="top",R="innerHTML",t="className",I="width",O="height",z="0",j="display",B="none",w="visibility",d="user-select",H="margin",e="padding",A=null,X=s.Color,J=s.Default,K=J.getInternal(),G=v.setTimeout,E=v.setInterval,$=v.clearTimeout,V=v.clearInterval,Q=v.parseInt,q=J.isLeftButton,u=J.isDragging,o=J.startDragging,x=J.getDistance,l=J.isTouchable,a=X.widgetIconHighlight,_=X.widgetIconBorder,W=X.widgetIconGradient,Z=function(){return document},i=function(l,x){return l.querySelectorAll(x)},U=function(m, borderColor){var f=Z().createElement(m);return"ul"===m&&(D(f,h,"relative"),D(f,H,z),D(f,e,z),D(f,"list-style",B),D(f,"box-sizing","border-box"),D(f,"-moz-box-sizing","border-box"),D(f,j,"inline-block"),D(f,"vertical-align","text-bottom"),D(f,"border","1px solid "+(borderColor || J.contextMenuBorderColor)),D(f,"box-shadow","0 0 16px 1px "+J.contextMenuShadowColor),D(f,"overflow","hidden"),J.contextMenuBorderRadius&&D(f,"border-radius",J.contextMenuBorderRadius+n)),f},M=function(f){var T=f.touches[0];return T?T:f.changedTouches[0]},m=function(){return U("div")},C=function(){return U("canvas")},D=function(p,w,S){p.style.setProperty(w,S,A)},g=function(j,f,g){J.def(s.widget[j],f,g)},y=function(L,J){L.appendChild(J)},f=function(b,t){b.removeChild(t)},S=function(){return Z().body},L=function(U,i,T,B){U.addEventListener(i,T,!!B)},r=function(O,R,E,C){O.removeEventListener(R,E,!!C)};K.addMethod(J,{contextMenuCheckIcon:{width:16,height:16,comps:[{type:"border",rect:[1,1,14,14],width:1,color:_},{type:"shape",points:[13,3,7,12,4,8],borderWidth:2,borderColor:a}]},contextMenuRadioIcon:{width:16,height:16,comps:[{type:"circle",rect:[2,2,12,12],borderWidth:1,borderColor:_},{type:"circle",rect:[4,4,8,8],borderWidth:1,borderColor:a,gradient:J.imageGradient,gradientColor:W,background:a}]},contextMenuLabelFont:(l?"16":"13")+"px arial, sans-serif",contextMenuLabelColor:"#000",contextMenuBackground:"#fff",contextMenuDisabledLabelColor:"#888",contextMenuHoverBackground:"#648BFE",contextMenuHoverLabelColor:"#fff",contextMenuSeparatorWidth:1,contextMenuSeparatorColor:"#E5E5E5",contextMenuScrollerColor1:"#FDFDFD",contextMenuScrollerColor2:"#D3D3D3",contextMenuScrollerBorderColor:"#C3C3C3",contextMenuBorderColor:"#C3C3C3",contextMenuShadowColor:"rgba(128, 128, 128, 0.5)",contextMenuBorderRadius:5,contextMenuSubmenuMark:"▶"},!0);var P=function(F){var W=this,n=F._view;if(W.$11b=F,W.addListeners(),L(n,"contextmenu",function(U){U.preventDefault()}),!l){var I=W.$37b=W.$36b.bind(W);L(n,"mouseover",I),L(n,"mouseout",I)}};J.def(P,k,{ms_listener:1,getView:function(){return this.$11b._view},handle_touchstart:function(e){if(J.preventDefault(e),q(e)){for(var w=this,i=w.$11b,C=w.getView(),R=C.children,L=0;L1)return delete w.$30b,void 0;for(var g=w.getView(),Z=w.$11b,H=P.target,z=A,b=A,n=Z._items,k=g.$26b,J=0;J=0))return A}},s=function(T){for(var L=0;L=0))return N}},z=function(y){var F=s("menu-item"+y.$45b),j=F.getBoundingClientRect(),m=j.top-i.top,A=j.left-i.left;D(y,N,m+n),D(y,c,A+j.width+n);var v=y.getBoundingClientRect(),V=v.top,r=v.left,E=v.height,X=v.width,b=V+E+2,x=r+X+2;b>K&&D(y,N,m+K-b+n),x>l&&D(y,c,A-X+n)};if(A)$=q;else{if("mouseover"===q.type){for(var _=0;_2&&(o(K,s),K.$34b=X,K.$35b=X.$18b)}},handleWindowTouchMove:function(G){G.preventDefault();var z=this,O=z.$11b,n=z.$34b,U=z.$35b,W=z.$30b;if(W&&n){var b=l?{x:M(G).pageX,y:M(G).pageY}:{x:G.pageX,y:G.pageY},i=b.y-W.y;i>0?O.scrollUp(n,n.$18b-(U-i)):O.scrollDown(n,U-i-n.$18b)}},handleWindowMouseMove:function(V){this.handleWindowTouchMove(V)},$10b:function($,O){$.preventDefault();for(var T=this,Z=T.getView().children,M=A,R=0;R.05&&(O>0?H.scrollUp(M,O*s):0>O&&H.scrollDown(M,-O*s))}},handle_mousewheel:function(n){this.$10b(n,n.wheelDelta/40)},handle_DOMMouseScroll:function(o){this.$10b(o,-o.detail)},$44b:function(k){this.getView().contains(k.target)||this.$11b.hide()},$41b:function(l){this.$11b.show(l)},$4b:function(A,E){var x=this.$11b;if(E=E||x._items,E&&E.length&&A.keyCode){var Y=[A.keyCode];A.shiftKey&&Y.push(16),A.ctrlKey&&Y.push(17),A.altKey&&Y.push(18),/mac/.test(v.navigator?v.navigator.userAgent.toLowerCase():"")?A.metaKey&&Y.push(17):A.metaKey&&Y.push(91),Y.sort();var C=Y.join(),D=x.$17b(E,function($){if($.key){var p=$.key.slice(0);return p.sort(),C===p.join()}});if(D){D.preventDefault!==!1&&A.preventDefault();var W=!1;D.disabled instanceof Function?W=D.disabled.call(x,D):D.disabled===!0&&(W=!0),W||x.$1b(D,A)}}},$39b:function(h){var W=this,V=M(h);W.$32b={x:V.pageX,y:V.pageY}},$38b:function(F){var Q=this,K=M(F);Q.$31b={x:K.pageX,y:K.pageY},Q.$33b=G(function(){Q.$31b&&(Q.$32b?x(Q.$31b,Q.$32b)<10&&Q.$11b.show(F):Q.$11b.show(F)),delete Q.$33b,delete Q.$31b,delete Q.$32b},600)},$40b:function(){var J=this;J.$33b!=A&&($(J.$33b),delete J.$33b,delete J.$31b,delete J.$32b)}}),s.widget.ContextMenu=function(l){var i=this,c=i._view=K.createView(null,i);c[t]="ht-widget-contextmenu",i.setItems(l),i.$13b=new P(i),D(c,"font",i.contextMenuLabelFont||J.contextMenuLabelFont),D(c,h,Y),D(c,"cursor","default"),D(c,"-webkit-"+d,B),D(c,"-moz-"+d,B),D(c,"-ms-"+d,B),D(c,d,B),D(c,"box-sizing","border-box"),D(c,"-moz-box-sizing","border-box"),J.baseZIndex!=A&&D(c,"z-index",Q(J.baseZIndex)+2+""),i.$3b=function(n){i.$13b.$4b(n)}},g("ContextMenu",k,{$5b:0,_items:A,$21b:A,_enableGlobalKey:!1,ms_v:1,enableGlobalKey:function(){var J=this,z=J._enableGlobalKey;z===!1&&(L(Z(),"keydown",J.$3b),J._enableGlobalKey=!0)},disableGlobalKey:function(){this._enableGlobalKey=!1,r(Z(),"keydown",this.$3b)},setItems:function(s){this._items=s},getItems:function(){return this._items},setVisibleFunc:function(W){this.$16b=W},setLabelMaxWidth:function(v){this.$43b=v},$1b:function(q,J){var Z=this;if("check"===q.type)q.selected=!q.selected;else if("radio"===q.type){var W=q.groupId;Z.$17b(Z._items,function(G){G.groupId===W&&(G.selected=!1)}),q.selected=!0}if(Z.hide(),q.action)q.action.apply(q.scope||Z,[q,J]);else if(q.href){var _=q.linkTarget||"_self";v.open(q.href,_)}},getItemByProperty:function(k,T,l){var o=this;if(l=l||o._items,!l||0===l.length)return A;var Z=o.$17b(l,function(j){return j[k]===T});return Z||A},scrollUp:function(v,t){var B=this;if(t=t==A?20:t,t=Q(t),0!==t){var e=0;v.$18b>t&&(e=v.$18b-t),B.$42b(v,e),v.scrollTop=e,v.$18b=e}},scrollDown:function(z,P){var $=this;if(P=P==A?20:P,P=Q(P),0!==P){var y=z.$22b,x=z.$23b,V=y-x;x+z.$18b+PT&&d(K);var $=F+(g?1:0),E=G+(g?1:0),B=function(o){for(var y=0,A=0,l=0,d=U.$43b;l1&&(Y=V[1]),Y.offsetWidth>d&&(Y[R]=""+Y[R]+"",Y.children[0].style.verticalAlign="text-bottom",D(Y,I,d+n),D(Y,j,"inline-block"))}var b=i.offsetWidth,x=v.offsetWidth;b>y&&(y=b),x>A&&(A=x)}}for(l=0;lT&&!wf?D(P,N,$-(r-T)+C+n):D(P,N,$+C+n),k>s?D(P,c,E-(k-s)+p+n):D(P,c,E+p+n);var b=U.$21b;b&&b.each(function(N){B(N),N.offsetHeight>T&&d(N)}),U.$9b&&L(Z(),l?"touchstart":"mousedown",U.$9b,!0),U.afterShow&&U.afterShow(Q),U.$47b()}}},isShowing:function(){return this._view?this._view.parentNode!=A:!1},getRelatedView:function(){return this.$12b},hide:function(){var J=this,F=J._view;F&&F.parentNode&&(f(F.parentNode,F),r(Z(),l?"touchstart":"mousedown",J.$9b,!0),J.afterHide&&J.afterHide())},dispose:function(){var j=this,Z=j.$12b,v=j._view;v&&(v.parentNode&&f(v.parentNode,v),j.disableGlobalKey(),Z&&(l?(r(Z,"touchstart",j.$6b,!0),r(Z,"touchmove",j.$7b),r(Z,"touchend",j.$8b)):r(Z,"contextmenu",j.$27b)),j._view=j._items=j.$21b=j.$19b=j.$12b=j.beforeShow=j.afterShow=j.afterHide=j.$9b=j.$3b=j.$6b=j.$7b=j.$8b=j.$27b=A)},$46b:function(p,L,$,O){var N=K.initContext(p);K.translateAndScale(N,0,0,1),N.clearRect(0,0,$,O),J.drawStretchImage(N,J.getImage(L),"fill",0,0,$,O),N.restore()},$47b:function(){var I,q,F,X=this,T=X._view;if(X.isShowing()){var v=i(T,".check-prefix");for(F=0;F