/* @license Copyright (C) Exontrol. All rights reserved. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,e(t.exontrol||{}))}(this,function(t){"use strict";function e(){return Math.max.apply(0,arguments)}function i(){return Math.min.apply(null,arguments)}function o(t,i){var o=!1;if(null!=i.gridLineColor){if(null!=i.gridLineColor){var n=1;null!=i.gridLineSize&&(n=e(0,a.ToN(i.gridLineSize,0))),(o=n>0)&&(t.save(),t.strokeStyle=i.gridLineColor,1!=n&&(t.lineWidth=n),null!=i.gridLineDash&&t.setLineDash(i.gridLineDash),null!=i.gridLineJoin&&(t.lineJoin=i.gridLineJoin),null!=i.gridLineCap&&(t.lineCap=i.gridLineCap))}}return o}function n(t){t.restore()}function r(t){if(a.EyR(t)){var e=l.R2C(t);t=[l.X(e),l.Y(e),0,0]}return new l.Ellipse(t)}function s(t,e){switch(t){case 1:break;case 2:e>=Math.PI&&(e-=Math.PI);break;case 3:e<3*Math.PI/2&&(e>=Math.PI?e-=Math.PI:e>=Math.PI/2&&(e+=Math.PI));break;case 4:e-=Math.PI/2;break;default:e=0}return e}var a=a||window.exontrol,l=a.G,p=a.Gauge,h=p.prototype,u=p.Layer,y=u.prototype,f=p.Layers.prototype,c=p.LayerObject.prototype;a.Shapes.RadialMenu={dfsubitems:{normal:{gridLineColor:"#A4A4A4",frameColor:"#808080",fillColor:"#F4F4F4",pad:-2,primitive:"Ellipse"},hover:{frameColor:"#666666",fillColor:"#A4A4A4",primitive:"Pie"},disabled:{opacity:.5}},dfitems:{normal:{gridLineColor:"#A4A4A4",frameColor:"#808080",fillColor:"#FFFFFF",pad:-2,primitive:"Ellipse"},hover:{frameColor:"#666666",fillColor:"#E4E4E4",primitive:"Pie"},disabled:{opacity:.5}},dfparent:{normal:{gridLineColor:"#A4A4A4",frameColor:"#808080",fillColor:"#F4F4F4",pad:-2,primitive:"Ellipse"},hover:{frameColor:"#666666",fillColor:"#A4A4A4",primitive:"Ellipse"},disabled:{opacity:.5}}},a.RadialMenu=p,p.states="DisplayAngle,"+p.states,p.vAlpha=16,y.isEmpty=function(t){return function(){return t.apply(this,arguments)&&!this.isSubItemsLayer()&&!this.isItemsLayer()&&!this.isParentLayer()}}(y.isEmpty),y.lP2A=function(t){return function(e,i){var o,n=t.apply(this,arguments),r=this.key;return!n&&this.rfeVIU(function(t){var s=t.oA[r];if(s&&s.axy){var p=s.axy[0],h=e,u=i;return p&&(o=l.RPO([h,u],[s.axy[1],s.axy[2]],-p),h=l.X(o),u=l.Y(o)),n=a.H.P2A(s,h,u)}}),n}}(y.lP2A),y.onA=function(t){return function(e,i){t.apply(this,arguments),e&&i.item&&a.H.VisitA(i.item.oA[i.layer.key],e)}}(y.onA),y.refresh_Pointer=function(){var t,e=this.oLys.oT,i=e.nHP,o=i>=0;this.bU(),this.SetVisible(o),this.SetSelectable(!1),(t=e.oVRI.getVRI(i))&&this.SetRotateAngle(l.R2D(t.startAngle+t.sweepAngle/2)),this.eU()},y.isSubItemsLayer=function(){return this==this.oLys.oLSu},y.isItemsLayer=function(){return this==this.oLys.oLIt},y.isParentLayer=function(){return this==this.oLys.oLPa},y.rfeVIU=function(t,e){if(t instanceof Function){if(this.onDrawLayer==this.onDrawParent)return t(this.oLys.oT.oBI,e);if(this.onDrawLayer!=y.onDrawLayer)return this.oLys.oT.oVRI.rforEachIU(t,e)}},u.Drags=a.BiM.Split("move(1),rotate(2),rotamove(3),sweep(4)"),y.GetDisplayAngle=function(){return this.oLys.oT.GetDisplayAngle()},y.SetDisplayAngle=function(t){this.oLys.oT.SetDisplayAngle(t)},y.getShape=function(t){return this.oLys.oT.getShape(t)},y.oVRI=function(){return this.oLys.oT.oVRI},y.isClick=function(){return!!this.oLys.oT.lClk},y.onDrawSubItems=function(t,e){var i=this.oLys.oT,s=~~e[2],l=~~e[3];if(s>0&&l>0){var p=i.getCompatCanvas(s,l);(function(t,e,s){var l=r(e),p=i.getSubItemsClip(e),h=r(p);if(null!=s&&(p[2]!=e[2]||p[2]!=e[2])){var u=(this.isClick()?s.click:s.hover)||s.hover;s=s.normal||s;var y=t.drawShape(e,s),f=null!=u?i.nHP:-1;l=r(y);var c=o(t,s);if(c&&t.selClip(y,s.primitive,s.pArg),this.oVRI().forEach(function(e){if(i.radBk(t,y,e,"SubColor",this),i.isPieEnabled(e.index)&&e.index==f){var o=u.pArg;u.pArg=e,t.drawShape(y,u),u.pArg=o}if(c){t.beginPath(),t.moveTo(l.xm,l.ym);var n=l.a2P(e.startAngle);t.lineTo(n.x,n.y),t.stroke()}},this),c&&(t.resClip(),n(t)),!a.EyR(p)){h=r(t.drawShape(p,{frameColor:s.frameColor,frameSize:s.frameSize,frameDash:s.frameDash,frameJoin:s.frameJoin,frameCap:s.frameCap,pad:s.pad,primitive:s.primitive,pArg:s.pArg}));var g=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.drawShape(a.IRt(p,-.5,-.5),{fillColor:"#000000",pad:s.pad,primitive:s.primitive,pArg:s.pArg}),t.globalCompositeOperation=g}}this.oVRI().forEach(function(e){(function(t,e,i){var o=this.pieToItem(e.pie.index);o&&this.display(t,o,i,this.getDisplaySubItems(),{caption:o.getSubCaption(),image:o.getSubImage(),disabled:!o.isEnabled(),hasChildren:0!=o.visible().length},e)}).call(i,t,{out:l,in:h,pie:e},this)},this)}).call(this,p.getContext("2d"),[0,0,s,l],this.getShape("subitems")),t.drawImage(p,e[0],e[1]),p=null}},y.onDrawItems=function(t,e){var i=this.oLys.oT,s=~~e[2],l=~~e[3];if(s>0&&l>0){var p=i.getCompatCanvas(s,l);(function(t,e,s){var l=r(e),p=i.getItemsClip(e),h=r(p);if(null!=s&&(p[2]!=e[2]||p[2]!=e[2])){var u=(this.isClick()?s.click:s.hover)||s.hover;s=s.normal||s;var y=t.drawShape(e,s),f=r(y),c=y[2]!=y[3],g=null!=u?i.nHP:-1;l=f,c&&(t.selClip(y,s.primitive,s.pArg),y=i.getSubItemsClip(y,!0),l=r(y));var d=o(t,s);if(d&&t.selClip(y,s.primitive,s.pArg),this.oVRI().forEach(function(e){if(i.radBk(t,y,e,"Color",this),i.isPieEnabled(e.index)&&e.index==g){var o=u.pArg;u.pArg=e,t.drawShape(y,u),u.pArg=o}if(d){t.beginPath(),t.moveTo(l.xm,l.ym);var n=l.a2P(e.startAngle);t.lineTo(n.x,n.y),t.stroke()}},this),d&&(t.resClip(),n(t)),!a.EyR(p)){h=r(t.drawShape(p,{frameColor:s.frameColor,frameSize:s.frameSize,frameDash:s.frameDash,frameJoin:s.frameJoin,frameCap:s.frameCap,pad:s.pad,primitive:s.primitive,pArg:s.pArg}));var m=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.drawShape(a.IRt(p,-.5,-.5),{fillColor:"#000000",pad:s.pad,primitive:s.primitive,pArg:s.pArg}),t.globalCompositeOperation=m}c&&(t.resClip(),l=f)}this.oVRI().forEach(function(e){(function(t,e,i){var o=this.pieToItem(e.pie.index);o&&this.display(t,o,i,this.getDisplayItems(),{caption:o.getCaption(),image:o.getImage(),disabled:!o.isEnabled(),hasChildren:0!=o.visible().length},e)}).call(i,t,{out:l,in:h,pie:e},this)},this)}).call(this,p.getContext("2d"),i.getSubItemsClip([0,0,s,l]),this.getShape("items")),t.drawImage(p,e[0],e[1]),p=null}},y.onDrawParent=function(t,e){function i(t,e,i){if(i){var n=o.oBI,s=!n.isEnabled(),p=(this.isClick()?i.click:i.hover)||i.hover;s&&(a.EyO(i.disabled)||(i=p=a.Inh(i.disabled,i.normal||i))),i=i.normal||i,t.drawShape(e,(o.bHP?p:i)||i),function(t,e,i){var o,n=i.oLObj.oLR.getRotateCenter(),s=2*this.getParentSize(),a={out:r(l.C2R(n,s,s)),in:r(l.C2R(n)),pie:{index:-1,startAngle:0,sweepAngle:0}},p=this.getDisplayParent(),h=p.visible,u=this.getParent(e),y=u.caption,f=u.image;16&h?(o=this.gCnt(this.gCtx(),y,f))&&o.rtImage&&(y=null):(1&h||(y=null),2&h||(f=null)),e&&this.display(t,e,i,p,{caption:y,image:f,disabled:!e.isEnabled(),hasChildren:0!=e.visible().length},a)}.call(o,t,n,this)}}var o=this.oLys.oT;i.call(this,t,o.getItemsClip(e),this.getShape("parent"))},c.GetValue=function(t){return function(){switch(this.onDrag){case 4:return this.oLayer.oVRI().getDisplayAngle()}return t.apply(this,arguments)}}(c.GetValue),c.getDValue=function(t){return function(){switch(this.onDrag){case 4:return this.oLayer.oVRI().getDisplayAngle()}return t.apply(this,arguments)}}(c.getDValue),c.setDValue=function(t){return function(e){switch(this.onDrag){case 4:var i=this.oLayer.getLayerRect(this.oLayer.getLayersClientRect()),o=l.Angle(l.R2C(i),e.drag.start,e.drag.current),n=e.value+o;return this.oLayer.oVRI().setDisplayAngle(n)}return t.apply(this,arguments)}}(c.setDValue),c.SetValue=function(t){return function(e){switch(this.onDrag){case 4:this.oLayer.oVRI().setDisplayAngle(e)}t.apply(this,arguments)}}(c.SetValue),f.init=function(t){return function(e){t.apply(this,arguments)}}(f.init),f.getVisibleLayers=function(t){return function(){var e=t.apply(this,arguments);return function(t){return t instanceof a.RadialMenu}(this.oT)&&(this.oT.isExpanded()||(e=this.oT.getCollapseLayers())),e}}(f.getVisibleLayers),f.onChangeLayers=function(t){return function(){t.apply(this,arguments),this.onSubItemsLayer(),this.onItemsLayer(),this.onPointerLayer(),this.onParentLayer()}}(f.onChangeLayers),f.onSubItemsLayer=function(){var t=this.oLSu;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("subitems")||this.item("background")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawSubItems),this.oLSu=t},f.onItemsLayer=function(){var t=this.oLIt;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("items")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawItems),this.oLIt=t},f.onSubItemsLayer=function(){var t=this.oLSu;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("subitems")||this.item("background")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawSubItems),this.oLSu=t},f.onPointerLayer=function(){var t=this.oLPo;t&&void 0!==t._refresh&&(t.refresh=t._refresh,t._refresh=void 0),(t=this.item("pointer")||null)&&(t._refresh=t.refresh,(t.refresh=t.refresh_Pointer).call(t)),this.oLPo=t},f.onParentLayer=function(){var t=this.oLPa;t&&void 0!==t._onDrawLayer&&(t.onDrawLayer=t._onDrawLayer,t._onDrawLayer=void 0),(t=this.item("parent")||null)&&(t._onDrawLayer=t.onDrawLayer,t.onDrawLayer=t.onDrawParent),this.oLPa=t},a.Mrg(a,function(){function t(t,e){this.init(t,e)}function o(t){this.set(t)}function n(t){this.oT=t}function r(t){this.init(t)}function u(t){this.init(null,t)}return Object.addPrototypeOf(t.prototype,h),t.version="3.0",t.type="RadialMenu",t.OnDragLayerEnum={exDoNothing:0,exDoMove:1,exDoRotate:2,exDoRotamove:3,exDoSweep:4},a.Mrg(p.Options,{shapes:null,displayAngle:null,minVisibleCount:null,circular:null,subItemsSize:null,parentSize:null,expanded:null,collapseLayers:null,allowToggleExpand:null,displaySubItems:{},displayItems:{},displayParent:{},items:null,sweepOnSelect:null,highlightAny:null,browseItem:null,parent:null}),t.DisplayRadialEnum={exDisplayRadialFlat:0,exDisplayRadialRotated:1,exDisplayRadialRotated180:2,exDisplayRadialRotated270:3,exDisplayRadialRotated90:4},t.prototype.init=function(t){return function(e,i){this.oVRI=new n(this),this.lClk=0,this.lHov=0,this.nHP=-1,this.Root=this.oR=new u(this),this.oBI=this.oR,this.nBHP=-1,t.apply(this,arguments)}}(t.prototype.init),a.ComboBox&&(t.prototype.dCBl=function(t,e,i){i.oO.label=this.oClkI&&this.oClkI.i&&i.label(2==this.oClkI.ht&&this.oClkI.i.getSubImage()||this.oClkI.i.getImage(),2==this.oClkI.ht&&this.oClkI.i.getSubCaption()||this.oClkI.i.getCaption())||""},t.prototype.cCB=function(t){var e,i=this.htItem(t),o=i.hitTest;return!i.pie&&4!=o||(1==o||2==o)&&(e=i.item)&&(!e.rgC||!e.rgC.len())},t.prototype.sCB=function(t){return t&&(this.oClkI=null),this.oClkI},t.prototype.SetCanvas=function(t,e){return a.ComboBox.implExHost(t,"onselect,onbrowse,onexpand,onchange")}(t.prototype.SetCanvas)),t.prototype.GetLayersClientRect=function(t){return function(){var e=t.apply(this,arguments);if(this.getCircular()){var o=i(e[2],e[3])/2,n=l.R2C(e);e=[n[0]-o,n[1]-o,2*o,2*o]}return e}}(t.prototype.GetLayersClientRect),t.prototype.onSwipe=function(t){return function(e,i,o,n){switch(t.apply(this,arguments),e.GetOnDrag()){case 4:n.push({f:e.GetDisplayAngle(),d:2.66*o*l.Angle(e.oLObj.oLR.getRotateCenter(!0),i,[i.x+i.dx,i.y+i.dy]),c:e.SetDisplayAngle})}}}(t.prototype.onSwipe),t.prototype.getRadius=function(){var t=this.GetLayersClientRect();return e(0,i(t[2],t[3])/2)},t.prototype.onRURStart=function(t){return function(e){t.apply(this,arguments),this.lClk++,this.lHov++,this.Refresh()}}(t.prototype.onRURStart),t.prototype.onRUREnd=function(t){return function(e){t.apply(this,arguments),this.lClk--,this.lHov--,this.onHover(this.gPtr(e)),this.Refresh()}}(t.prototype.onRUREnd),t.prototype.onHover=function(t){return function(e){if(0==this.lHov++){var i=this.p2L(e);this.oPtr=e?[l.X(e),l.Y(e)]:null,t.apply(this,arguments),this.onHoverPie(this.p2IP(e)),this.onHoverParent(i&&i.isParentLayer())}this.lHov--}}(t.prototype.onHover),t.prototype.onHoverPie=function(t){this.isLocked()||this.nHP==t||(this.nHP=t,this.resetILV()&&(this.bU(),function(t){t&&(a.A.Rng(this.sSA)?(null!=this.nRefreshLayerID&&clearTimeout(this.nRefreshLayerID),this.nRefreshLayerID=setTimeout(function(){t.refresh()})):t.refresh())}.call(this,this.oLys.oLPo),this.eU()))},t.prototype.onHoverParent=function(t){this.isLocked()||this.bHP==t||(this.bHP=t,this.oLys.oLPa&&this.oLys.oLPa.refresh())},t.prototype.resetILV=function(){var t=!1,e=this.oLys;return[e.oLSu,e.oLIt,e.oLPa,e.oLPo].forEach(function(e){null!=e&&(t=!0,this.resetLV(e))},this),t},t.prototype.defSts=function(t){return function(e){t.apply(this,arguments),e&&e.Add("Esc",this.GoBack,this)}}(t.prototype.defSts),t.prototype.iLts=function(t){return function(){t.apply(this,arguments),this.oLts.add("onselect"),this.oLts.add("onbrowse"),this.oLts.add("onexpand")}}(t.prototype.iLts),t.prototype.toClick=function(t){return function(e,i){var o;return t.apply(this,arguments),this.htItem(e,i),this.isReadOnly()||a.ComboBox&&4!=i.hitTest&&((o=i.item)&&o.rgC&&o.rgC.len()||(this.oClkI={i:o,ht:i.hitTest})),i}}(t.prototype.toClick),t.prototype.onClick=function(t){return function(e){var i=t.apply(this,arguments);return this.isLocked()||i.dblClick||(this.bHP?function(){this.isExpanded()&&null!=this.oBI.oP?this.GoBack():this.onToggleExpand()}.call(this):this.nHP>=0&&function(t){var e=this.pieToItem(t);e&&e.isEnabled()&&(this.onBrowseItem(e)||this.isReadOnly()||this.onSelect(e))}.call(this,this.nHP)),i}}(t.prototype.onClick),a.ComboBox&&(t.prototype.onClick=function(t){return function(e){this.setTimeout(function(){t.call(this,e);var i=this.GetCanvas().parentElement;i&&i.oCV&&i.oCV.inv&&i.oCV.inv()})}}(t.prototype.onClick)),t.prototype.onSelect=function(t){this.onselect(t)},t.prototype.onselect=function(t){this.oLts.onselect.do(t)},t.prototype.onBrowse=function(t){this.onbrowse(t)},t.prototype.onbrowse=function(t){this.oLts.onbrowse.do(t)},t.prototype.onExpand=function(){this.onexpand(this.oR)},t.prototype.onexpand=function(t){this.oLts.onexpand.do(t)},t.prototype.htItem=function(t,e){e=e||{};var i,o,n,r=this.gPtr(t),s=this.p2LV(r);return e.pie=this.oVRI.getVRI(this.p2IP(r)),e.item=null,(n=null!=e.pie)?(o=s.oLayerView.oLayer.isItemsLayer(),e.item=this.pieToItem(e.pie.index)):s&&s.oLayerView&&(i=s.oLayerView.oLayer.isParentLayer())&&(e.item=this.oBI),e.hitTest=i?4:n?o?1:2:0,e},t.prototype.p2I=function(t){return this.pieToItem(this.p2IP(t))},t.prototype.onDrag=function(t){return function(e){this.oLys.onPointerLayer(),t.apply(this,arguments)}}(t.prototype.onDrag),t.prototype.EndUpdate=function(t){return function(){t.apply(this,arguments),this.lI||this.onHover(this.oPtr)}}(t.prototype.EndUpdate),t.prototype.eU=t.prototype.EndUpdate,t.prototype.p2IP=function(t){var e,i,o,n=-1;return t&&(e=this.p2LV(t))&&((i=e.oLayerView.oLayer).isSubItemsLayer()||i.isItemsLayer())&&(o=this.oVRI.VRIFromPointer(t,e.rtView,i.getRotateAngle()))&&(n=o.index),n},t.prototype.defLayers=function(t){return function(){return t.apply(this,arguments)+"[key=subitems][drag=sweep],[key=items][drag=sweep],[key=parent][drag=nothing]"}}(t.prototype.defLayers),t.prototype.getSmooth=function(){return e(0,a.ToN(this.opt("smooth",250)))},t.prototype.GetShapes=function(){return this.oO.shapes},t.prototype.SetShapes=function(t){this.bU(),this.sShs=null,this.oO.shapes=t,this.Refresh(),this.eU()},t.prototype.getShapes=function(){var t=this.sShs;return null==t&&(null==(t=this.GetShapes())&&(t=a.Def.Gauge.shapes),t=a.ToS(t,"dfsubitems(subitems),dfitems(items),dfparent(parent)"),this.sShs=t),t},t.prototype.getShape=function(t){var e=null;return null!=t&&(e=a.S.GetOf(t,this.getShapes(),"RadialMenu")),e},t.prototype.GetDisplayAngle=function(){return this.oO.displayAngle},t.prototype.SetDisplayAngle=function(t){this.bU();var e=this.getDisplayAngle();this.oO.displayAngle=t,this.resetILV(),e!=this.getDisplayAngle()&&this.oLys.onChange(this.oLys.oLSu||this.oLys.oLIt),null==this.oBI.oP&&(this.bDA=this.getDisplayAngle()),this.eU()},t.prototype.getDisplayAngle=function(){return a.ToN(this.opt("displayAngle",0))},t.prototype.GetMinVisibleCount=function(){return this.oO.minVisibleCount},t.prototype.SetMinVisibleCount=function(t){this.bU(),this.oO.minVisibleCount=t,this.resetILV(),this.eU()},t.prototype.getMinVisibleCount=function(){return i(360,a.ToN(this.opt("minVisibleCount",8)))},t.prototype.GetCircular=function(){return this.oO.circular},t.prototype.SetCircular=function(t){this.bU(),this.oO.circular=t,this.Refresh(),this.eU()},t.prototype.getCircular=function(){return!!this.opt("circular",!0)},t.prototype.getSubItemsClip=function(t,i){var o=(i?1:-1)*e(0,this.getSubItemsSize());return a.IRt(t.slice(),o,o)},t.prototype.GetSubItemsSize=function(){return this.oO.subItemsSize},t.prototype.SetSubItemsSize=function(t){this.bU(),this.oSIS=null,this.oO.subItemsSize=t,this.Refresh(),this.eU()},t.prototype.getSubItemsSize=function(){return null==this.oSIS&&(this.oSIS=new o(this.opt("subItemsSize","24"))),this.oSIS.eval(this.getRadius())},t.prototype.getItemsClip=function(t){var i=2*e(0,this.getParentSize());return l.C2R(l.R2C(t),i,i)},t.prototype.GetParentSize=function(){return this.oO.parentSize},t.prototype.SetParentSize=function(t){this.bU(),this.oPS=null,this.oO.parentSize=t,this.Refresh(),this.eU()},t.prototype.getParentSize=function(){return null==this.oPS&&(this.oPS=new o(this.opt("parentSize","24"))),this.oPS.eval(this.getRadius())},t.prototype.GetExpanded=function(){return this.oO.expanded},t.prototype.SetExpanded=function(t){this.smoothExpand(t)||(this.bU(),this.oO.expanded=t,this.oLys.rgSL=void 0,this.onExpand(),this.Refresh(),this.eU())},t.prototype.isExpanded=function(){return!!this.opt("expanded",!0)},t.prototype.smoothExpand=function(t){function e(t){var e=new a.Arr;return t.getVO().forEach(function(t,i){e.push(i.oLayer)}),e}function i(t,e){t.oO.expanded=e,t.oLys.rgSL=void 0,t.onExpand(),t.onRL()}function o(t,e){t.lock(),y.forEach(function(t,i){var o=t.transparency;null!=o&&i.SetTransparency(100*(1-(o.from+e*(o.to-o.from))));var n=t.rotate;null!=n&&i.SetDefaultRotateAngle(n.from+e*(n.to-n.from));var r=t.sweep;null!=r&&i.SetDisplayAngle(r.from+e*(r.to-r.from))}),t.unlock()}a.A.Cancel(this.sSA);var n=this.getSweepOnSelect()&&this.getSmooth();if(n){var r=e(this),s=this.GetExpanded();this.lock(),i(this,t),this.unlock();var p=e(this),h=new a.Arr(r),u=new a.Arr;if(h.push(p),h.forEach(function(t){r.has(t)&&p.has(t)||u.push(t)}),n=0!=u.len()){var y=new Map;u.forEach(function(t){var e,i=p.has(t),o={};o.transparency={restore:t.GetTransparency(),from:i?0:t.getAlpha(),to:i?t.getAlpha():0},t.oLObj.isRotate()?(e=t.GetDefaultRotateAngle(),o.rotate={restore:e,from:i?e+90:e,to:i?e:e+90}):(e=t.GetDisplayAngle(),o.sweep={restore:e,from:i?e+90:e,to:i?e:e+90}),y.set(t,o)},this),t||(this.lock(),i(this,s),this.unlock());var f=this.draw,c=0;this.draw=function(e,i,o){this.getVO().forEach(function(i,o){if(u.has(o.oLayer)){i=i.slice();for(var n=l.C2R(l.R2C(i)),r=0;r<4;r++)i[r]=n[r]+(t?c:1-c)*(n[r]-i[r])}o.draw(e,i)})},o(this,0);var g=!1;a.A.Progress(function(e){c=e,o(this,e),this.Refresh(),!g&&(g=1==e)&&(this.draw=f,this.bU(),this.lock(),y.forEach(function(t,e){null!=t.transparency&&e.SetTransparency(t.transparency.restore),null!=t.rotate&&e.SetDefaultRotateAngle(t.rotate.restore),null!=t.sweep&&e.SetDisplayAngle(t.sweep.restore)}),this.unlock(),i(this,t),this.eU())},{name:this.sSA,thisArg:this,duration:this.getSmooth(),transition:t?"ease-out":"ease-in"})}}return n},t.prototype.GetAllowToggleExpand=function(){return this.oO.allowToggleExpand},t.prototype.SetAllowToggleExpand=function(t){this.oO.allowToggleExpand=t},t.prototype.allowToggleExpand=function(){return this.opt("allowToggleExpand",!0)},t.prototype.onToggleExpand=function(){this.allowToggleExpand()&&this.SetExpanded(!this.isExpanded())},t.prototype.GetCollapseLayers=function(){return this.oO.collapseLayers},t.prototype.SetCollapseLayers=function(t){this.bU(),this.oO.collapseLayers=t,this.oLys.rgSL=void 0,this.Refresh(),this.eU()},t.prototype.getCollapseLayers=function(){return this.opt("collapseLayers","parent")},t.prototype.GetDisplaySubItems=function(){return this.oO.displaySubItems},t.prototype.SetDisplaySubItems=function(t){this.bU(),this.oDSI=void 0,this.oO.displaySubItems=t,this.Refresh(),this.eU()},t.prototype.getDisplaySubItems=function(){return void 0===this.oDSI&&(this.oDSI=a.IsO(this.GetDisplaySubItems())?this.GetDisplaySubItems():null,null!=this.oDSI&&(this.oDSI=a.Inh(this.oDSI,a.Def.Gauge.displaySubItems||{arrow:.35,content:.5,radial:1}))),this.oDSI},t.prototype.GetDisplayItems=function(){return this.oO.displayItems},t.prototype.SetDisplayItems=function(t){this.bU(),this.oDI=void 0,this.oO.displayItems=t,this.Refresh(),this.eU()},t.prototype.getDisplayItems=function(){return void 0===this.oDI&&(this.oDI=a.IsO(this.GetDisplayItems())?this.GetDisplayItems():null,null!=this.oDI&&(this.oDI=a.Inh(this.oDI,a.Def.Gauge.displayItems||{content:.35,radial:1}))),this.oDI},t.prototype.GetDisplayParent=function(){return this.oO.displayParent},t.prototype.SetDisplayParent=function(t){this.bU(),this.oDP=void 0,this.oO.displayParent=t,this.Refresh(),this.eU()},t.prototype.getDisplayParent=function(){return void 0===this.oDP&&(this.oDP=a.IsO(this.GetDisplayParent())?this.GetDisplayParent():null,null!=this.oDP&&(this.oDP=a.Inh(this.oDP,a.Def.Gauge.displayParent||{imageSize:[24,24],visible:16,image:1,caption:1}))),this.oDP},t.prototype.GetParent=function(){return this.oO.parent},t.prototype.SetParent=function(t){this.bU(),this.oO.parent=t,this.eU()},t.prototype.getParent=function(t){var e=this.GetParent();return t&&(null==(e=a.Cpy(e)||{}).caption&&(e.caption=t.getCaption()),null==e.image&&(e.image=t.getImage())),e},t.prototype.GetItems=function(){return this.oR.Save()},t.prototype.SetItems=function(t){this.bU(),this.oR.Load(t),this.Refresh(),this.eU()},t.prototype.GetSweepOnSelect=function(){return this.oO.sweepOnSelect},t.prototype.SetSweepOnSelect=function(t){this.bU(),this.oO.sweepOnSelect=t,this.Refresh(),this.eU()},t.prototype.getSweepOnSelect=function(){return this.opt("sweepOnSelect",!0)},t.prototype.GoBack=function(){if(this.isSelectable()){var t,e=this.oBI.oP;e&&(t=this.nHP,this.nHP=-1,this.setBI(e),this.nHP=t)}},t.prototype.GetBrowseItem=function(){return this.oBI},t.prototype.SetBrowseItem=function(t){this.setBI(t,!0)},t.prototype.setBI=function(t,e){(function(){this.oLys.forEach(null,function(t){a.H.StoreA(t),t.rfeVIU(function(e){a.H.StoreA(e.oA[t.key])})})}).call(this);var i=this.oR.item(t),o=!0,n=!1;if(e){var s=i;if(null==i&&t instanceof r)for(t=t.oP;t&&null==(i=this.oR.item(t));)t=t.oP;for(null==i&&(i=this.oR);i.oP&&(!i.isVisible()||!i.visible().length);)i=i.oP;o=s==i}if(i&&i!=this.oBI){var p=i.visible().length;if(n=!i.oP||p>0){var h;if(this.getSweepOnSelect()){var u=o?this.oVRI.getVRI(this.nHP):null,y=null==u;if(y?(h=l.D2R(this.bDA||0),null!=i.oP&&p180?h-=360:d<-180&&(h+=360),this.Smooth(function(){this.SetDisplayAngle(h)},this))}this.resetILV(),this.eU(),this.onBrowse(this.oBI)}}return n},t.prototype.GetHighlightAny=function(){return this.oO.highlightAny},t.prototype.SetHighlightAny=function(t){this.bU(),this.oO.highlightAny=t,this.Refresh(),this.eU()},t.prototype.getHighlightAny=function(){return this.opt("highlightAny",!0)},t.prototype.Item=function(t){return this.oR.Item(t)},t.prototype.pieToItem=function(t){var e=this.oBI.visible();return t>=0&&t=0&&t<(o=this.getVRICount())&&(n=360/o,e={index:t,startAngle:l.D2R(t*n-n/2+this.getDisplayAngle()),sweepAngle:l.D2R(i(359.99,n))}),e},n.prototype.forEach=function(t,e){if(t instanceof Function)for(var i=0,o=this.getVRICount();i=0;a--)n=this.getVRI(a),(o=r.pieToItem(n.index))&&(i=t.call(e,o));return i},n.prototype.VRIFromPointer=function(t,e,i){function o(t){if(i){var e=l.X(t)-a,o=l.Y(t)-p;return[a+(e*s-o*r),p+(o*s+e*r)]}return t}i=l.D2R(i)||0;for(var n=new l.Ellipse(e),r=Math.sin(i),s=Math.cos(i),a=n.xm,p=n.ym,h=[a,p],u=0,y=this.getVRICount(),f=this.getVRI(u),c=f.startAngle,g=c,d=o(n.a2P(c)),m=l.D236(l.Angle(h,d,t));u=m)break}return f},n.prototype.getDisplayAngle=function(){return this.oT.getDisplayAngle()},n.prototype.setDisplayAngle=function(t){var e=this.oT,i=this.getDisplayAngle();return e.lI++,e.SetDisplayAngle(t),e.lI--,i!=this.getDisplayAngle()},n.prototype.getMinVisibleCount=function(){return a.ToN(this.oT.getMinVisibleCount(),1)},t.ItemOptions={visible:!0,enabled:!0,key:null,caption:null,image:null,color:null,subCaption:null,subImage:null,subColor:null,parent:null},r.prototype.init=function(t){this.oO={},this.oA={},t&&(this.oR=t.oR,this.oP=t,this.add())},r.prototype.ownCol=function(t){var e=null;return null!=this.oP&&(e=this.oP.rgC,t&&(e=e||new a.Arr,this.oP.rgC=e)),e},r.prototype.resOwnCol=function(){var t=this.oP;null!=t&&null!=t.rgC&&0==t.rgC.len()&&(t.rgC=null)},r.prototype.resetParentVisible=function(){for(var t=this,e=null;null!=(e=t.oP);)e.rgV=void 0,t=e},r.prototype.add=function(){var t=this.ownCol(!0);null!=t&&t.push(this)},r.prototype.toString=function(){return this.getKey()},r.prototype.forEach=function(t,e){e=e||this,this.rgC&&this.rgC.forEach(function(i){t.call(e,i),i.forEach(t,e)})},r.prototype.parents=function(){for(var t=[],e=this.oP;null!=e;)t.push(e),e=e.oP;return t},r.prototype.descendants=function(){var t=new a.Arr;if(this.rgC){t.push(this.rgC);for(var e=0;e=0&&(o=o||[]).push({o:n,p:l})}e(n,i.subText)}),null!=o&&(o.sort(function(t,e){return t.p-e.p}),o.forEach(function(t){t.o.SetPosition(t.p)}))}var i=this.oR,o=this.oP;return i.bU(),this.Remove(),e(o||this,t),i.eU(),this},r.prototype.Save=function(){function t(e){var i="",o=null==e.oP;if(!o){i=a.B.quoteC(e.getCaption());var n=r.F.Save(e);e.GetPosition()!=e.GetIndex()&&(n=n||new Map).set("pos",e.GetPosition()),i+=a.B.quoteF(n)}var s=[];return e.rgC&&e.rgC.forEachI(function(e){s.push(t(e))}),i+=a.B.quoteS(s,!o&&s.length)}return t(this)},r.prototype.GetOptions=function(){return this.oO},r.prototype.SetOptions=function(t){var e=this.oR;e.bU(),a.IsO(t)?a.Mrg(this.oO,t):this.SetCaption(t),e.onKey(this),e.eU()},r.prototype.GetKey=function(){return this.oO.key},r.prototype.SetKey=function(t){var e=this.oR;e.bU(),this.oO.key=t,e.onKey(this),e.eU()},r.prototype.getKey=function(){var t=this.GetKey();return(t=null!=t?t.toString():"")||this.getPlainCaption()},r.prototype.GetVisible=function(){return this.oO.visible},r.prototype.SetVisible=function(t){var e=this.oR;e.bU(),this.resetParentVisible(),this.oO.visible=t,e.eU()},r.prototype.isVisible=function(){var t=this.GetVisible();return!(!t&&null!=t)&&(null==this.oP||this.oP.isVisible())},r.prototype.GetEnabled=function(){return this.oO.enabled},r.prototype.SetEnabled=function(t){var e=this.oR;e.bU(),this.oO.enabled=t,e.eU()},r.prototype.GetDisabled=function(){return!this.GetEnabled()},r.prototype.SetDisabled=function(t){this.SetEnabled(!t)},r.prototype.isEnabled=function(){var t=this.GetEnabled();return!(!t&&null!=t)&&(null==this.oP||this.oP.isEnabled())},r.prototype.GetIndex=function(){var t=this.ownCol();return null!=t?t.indexOf(this):-1},r.prototype.GetPosition=function(){var t=this.ownCol();return null!=t?t.getPos(this):-1},r.prototype.SetPosition=function(t){if(null!=t){var e=this.ownCol(),i=this.oR;null!=e&&(i.bU(),this.resetParentVisible(),e.setPos(this,t),i.eU())}},r.prototype.GetCaption=function(){return this.oO.caption},r.prototype.SetCaption=function(t){var e=this.oR;return e.bU(),this.oO.caption=t,e.onKey(this),e.eU(),this},r.prototype.getCaption=function(){return this.GetCaption()},r.prototype.getPlainCaption=function(){return a.H.TextNoHTML(this.getCaption())},r.prototype.GetImage=function(){return this.oO.image},r.prototype.SetImage=function(t){var e=this.oR;e.bU(),this.oO.image=t,e.eU()},r.prototype.getImage=function(){return this.GetImage()},r.prototype.GetColor=function(){return this.oO.color},r.prototype.SetColor=function(t){var e=this.oR;e.bU(),this.oO.color=t,e.eU()},r.prototype.getColor=function(){return this.GetColor()},r.prototype.GetSubCaption=function(){return this.oO.subCaption},r.prototype.SetSubCaption=function(t){var e=this.oR;return e.bU(),this.oO.subCaption=t,e.eU(),this},r.prototype.getSubCaption=function(){return this.GetSubCaption()},r.prototype.GetSubImage=function(){return this.oO.subImage},r.prototype.SetSubImage=function(t){var e=this.oR;e.bU(),this.oO.subImage=t,e.eU()},r.prototype.getSubImage=function(){return this.GetSubImage()},r.prototype.GetSubColor=function(){return this.oO.subColor},r.prototype.SetSubColor=function(t){var e=this.oR;e.bU(),this.oO.subColor=t,e.eU()},r.prototype.getSubColor=function(){return this.GetSubColor()},r.prototype.GetParent=function(){return this.oP},r.prototype.getParent=r.prototype.GetParent,Object.addPrototypeOf(u.prototype,r.prototype),u.prototype.init=function(t){return function(e,i){t.call(this,e),this.lU=0,this.oR=this,this.oT=i,this.mK2I=null}}(u.prototype.init),u.prototype.item=function(t){function e(t,i){if(i=i||new Map,t.oP){var o=t.getKey();i.get(o)||i.set(o,t)}return t.rgC&&t.rgC.forEach(function(t){e(t,i)}),i}return this.has(t)?t:(null==this.mK2I&&(this.mK2I=e(this)),this.mK2I.get(t)||null)},u.prototype.has=function(t){var e=t==this;if(!e&&t instanceof r&&this.rgC){for(var i=null;(i=t.ownCol())&&i.has(t);t=t.oP);e=t==this}return e},u.prototype.bU=function(){this.lU++,this.oT.bU()},u.prototype.eU=function(){0==--this.lU&&(this.oT.onRL(),this.oT.setBI(this.oT.oBI,!0)),this.oT.eU()},u.prototype.onKey=function(t){this.mK2I=null},u.prototype.onAdd=function(t){t.resetParentVisible(),this.onKey(t)},u.prototype.onRemove=function(t){for(var e in t.oA)a.H.StoreA(t.oA[e]);t.resetParentVisible(),this.onKey(t)},a.expO(a.Mrg({Options:null},p.Options),t.prototype),a.expO(a.Mrg({Options:null,Disabled:null,Index:null,Position:null},t.ItemOptions),r.prototype),{RadialMenu:t}}()),t.RadialMenu=a.RadialMenu});