/* @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(t){return null!=t}function i(t){return null==t}function o(t,e,o){return i(t)?~~o:n.s2F(t,e)}var n=n||window.exontrol,s=n.G,r=Math.round,h=n.ToS,l=Math.max,a=Math.min;n.Shapes.OrgChart={dfnode:{normal:{frameColor:"black"},disabled:{opacity:.5},hover:{},click:{}}};var u={type:void 0,dir:void 0,width:void 0,color:void 0,arrow:void 0,arrowSize:void 0,arrowShape:void 0,style:void 0};n.Mrg(n,function(){function t(t,e){n.host.call(this,arguments)}return t.version="5.5",t.type="OrgChart",t.SingleSelEnum={exDisableSel:0,exEnableSel:1,exSingleSel:2,exToggleSel:4,exDisableCtrlSel:8,exDisableShiftSel:16,exDisableDrag:32},t.Options={scrollBars:null,scrollBarsRoot:void 0,tfi:null,locked:null,readOnly:null,wheelChange:null,expandGlyphSize:null,flow:null,align:null,margins:null,showExpandGlyphs:null,singleExpandGlyphs:null,show:null,filter:null,smooth:null,singleSel:null,ensureOnExpand:null,expandOnDblClick:null,pad:null,formatText:null,imageAlign:null,imageSize:null,size:null,shapes:null,cursors:null,showLinks:null,link:null,linka:null,linkg:null,nodes:null,zoom:null,zoomLevels:null,allowActions:null,selection:null,focus:null},t.prototype.init=function(t,e){var i=new n.OrgChart.CV(this);this.oCV=i,this.oCV.oG=this,this.oVS=new n.ScrollBar(null,null),this.oVS.oCV=this.oCV,this.oVS.getWheelChange=function(){return this.oCV.getWheelChange()},this.oVS.getLocked=function(){return this.oCV.getLocked()};var o=this.oVS.drawP;this.oVS.drawP=function(t,e,n,s){o.call(this,t,e,n,s),i.onDrawPartScroll(this,t,e,n,s)},this.oHS=new n.ScrollBar(null,null),this.oHS.oCV=this.oCV,this.oHS.getWheelChange=function(){return this.oCV.getWheelChange()},this.oHS.getLocked=function(){return this.oCV.getLocked()};var s=this.oHS.drawP;this.oHS.drawP=function(t,e,o,n){s.call(this,t,e,o,n),i.onDrawPartScroll(this,t,e,o,n)},this.Root=this.oCV.oR,this.Listeners=this.oLts=this.oCV.oLts,this.oCW=new n.CW(t,{AllowXChg:0,ScrollBars:this.defOpt().scrollBars}),this.oCW.oT=this,this.Shortcuts=this.oCW.oSts,this.initCW(),this.exports(),this.SetOptions(e,!0),n.DPR.Reg(this),this.Refresh()},t.prototype.defOpt=function(){return n[this.constructor.type].Options},t.prototype.initCW=function(){var t=this.oCW,e=(t=t.Add("control",{Dock:5})).Add("vertical",{Dock:4,Resizable:!1,Size:16,VisibleExtends:"vscroll,control",Opacity:0,HoverOpacity:1});e.Add("grip",{Dock:2,Size:16,AllowXChg:!1,SizeExtends:"grip,hscroll",VisibleExtends:"hscroll",Resizable:!1}),e.Add("vscroll",{Dock:5,AllowXChg:!1,Control:this.oVS}),t.Add("hscroll",{Dock:2,Resizable:!1,VisibleExtends:"control",Control:this.oHS,Opacity:0,HoverOpacity:1}),t.Add("main",{Dock:5,HoverExtends:"vertical,vscroll,hscroll,grip",Extends:"vertical,hscroll",Control:this.oCV,HScroll:"hscroll",VScroll:"vscroll"})},t.prototype.exports=function(){var i=this.oCW;i&&(["GetCanvas","SetCanvas","SetClientRect","GetClientRect","p2W","W","gPtr","inv"].forEach(function(t){t in this||(this[t]=i[t].bind(i))},this),this.GetScrollBars=i.GetSBs.bind(i),this.SetScrollBars=i.SetSBs.bind(i));var o=this.oCV;if(o){["SetOptions","GetOptions","opt","bU","eU","onRL","Node","Refresh","Smooth","GetFocus","SetFocus","GetSelection","SetSelection","SelectAll","UnselectAll","RemoveSelection","EnsureVisibleNode","EnsureVisibleSelection","getSelCount","Shuffle","Unshuffle","Soom","Home","FitToClient","ToggleExpandNode","EnsureVisibleClient"].forEach(function(t){t in this||(this[t]=o[t].bind(o))},this);var s=o.W();e(s)&&["GetScroll","SetScroll","GetSI","SetSI","toEVP","toEVR","SSw"].forEach(function(t){void 0===o[t]&&(o[t]=s[t].bind(s))}),n.expO(t.Options,this,o),n.expO({Canvas:null,Options:null,Focus:null,Selection:null},this,o)}},n.Lts.Onf(t.prototype),t.prototype.defAA=function(){return"fit(Shift+MButton,Ctrl+MButton,Alt+MButton),zoom(MButton),select(Shift,Ctrl),scroll"},t.prototype.roAA=function(){return"scroll,zoom,fit,select"},t.prototype.GetStatistics=function(){function t(t,e){return n.Format(t,e||0)}var e="",i=n.C2R(this.GetClientRect()),o=this.oCV;return e+="Size: "+t(i[2])+"x"+t(i[3]),e+="\nZoom: "+t(o.getZoom())+"%",e+="\nNode: "+t(o.nN)+"/"+t(o.oR.dscn().len()),e+="\nLink: "+t(o.nL),e+="\nSel: "+t(o.getSelCount())},t.prototype.GetLayout=function(t){return n.Lay.Save(this.onlayout,this,t)},t.prototype.SetLayout=function(t,e){n.Lay.Load(t,this.onlayout,this,e)},t.prototype.onlayout=function(t){this.oCW.onlayout(t)},t.prototype.BeginUpdate=function(){this.bU()},t.prototype.EndUpdate=function(){this.eU()},t.prototype.Update=function(t,e){this.bU(),t&&t.call(e||this),this.eU()},t.prototype.feN=function(t,e){this.Root.forEach(t,e||this)},t.prototype.feNU=function(t,e){return this.Root.forEachU(t,e||this)},n.ComboBox&&(t.prototype.dCBl=function(t,e,i){var o=this.oCV,n=o.getSel(),s=n&&n.first();o.drawCS(t,e,o.getSelCount(),36),i.oO.label=s&&i.label(s.getImage(),s.getCaption())||""},t.prototype.cCB=function(e){var i=this.oCV,o=i.e2V(e),n=i.p2O(i.gPtr(e));return!o||o instanceof t.CV&&(!n||!n.expandType)},t.prototype.sCB=function(t){return t&&this.SetSelection(null),this.getSelCount()},n.CW.prototype.SetCanvas=function(t,e){return n.ComboBox.implExHost(t,"onselchange")}(n.CW.prototype.SetCanvas)),n.expO({Layout:null,Statistics:null},t.prototype),{OrgChart:t}}()),n.Mrg(n.OrgChart,function(){function t(t){this.init(t)}function p(t){this.oN=t,this.rgVO=new n.M1,this.oSize=this.doL()}var c={exNodeChild:1,exNodeAssistant:2,exNodeGroup:4},f={visible:!0,caption:null,image:null,key:null,flow:null,align:null,margins:null,show:null,showExpandGlyphs:null,singleExpandGlyphs:null,expand:null,expandAssistant:null,expandChild:null,expandGroup:null,pad:null,formatText:null,size:void 0,imageAlign:null,imageSize:void 0,shapes:null,shape:null,cursors:null,cursor:null,enabled:!0,selectable:!0,link:null,linka:null,linkg:null};return t.prototype.init=function(t){this.oT=t,this.oR=new Node(this),this.sSA="smth-"+n.Rand(),this.lI=0,this.nN=0,this.nL=0,this.iLts(),this.oO=n.Cpy(t.defOpt()),this.oR.SetCaption("Root")},n.SB.addProto(t.prototype),t.prototype.defOpt=function(){return this.oT.defOpt()},t.prototype.GetOptions=function(){return this.oO},t.prototype.SetOptions=function(t,i){var o=!1;if(e(t)){var s=[],r=this.GetOptions();if(e(r)){for(var h in r){var l=t[h];void 0!==l&&(s.push(h),r[h]!==l&&(r[h]=n.CpV(l)))}if(i)for(var h in t)h in r||(r[h]=n.CpV(t[h]));if(o=0!=s.length){var a=this.oG||{};this.bU(),s.forEach(function(t){var e=n.setM(t);e in this?this[e].call(this,r[t]):e in a&&a[e].call(a,r[t])},this),this.eU()}}}return o},t.prototype.opt=function(t,e){var o=this.oO[t];return i(o)&&i(o=this.defOpt()[t])&&(o=e),o},t.prototype.GetCanvas=function(){return this.canvas},t.prototype.SetCanvas=function(t,e){this.udefSts(this.oSts),this.oSts=null,this.resAO(),t=n.CC.GetCanvas(t),!e&&n.CC.SetCanvas(this,t),this.canvas=t,n.CC.GetCanvas(this.canvas)&&this.defSts(this.oSts=new n.Sts)},t.prototype.SetClientRect=function(t){var e=n.CC.GetCanvas(t);e&&(t=[0,0,e.width,e.height]),this.client=n.C2R(t),this.resVO(),this.updSPR()},t.prototype.GetClientRect=function(){return this.client.slice()},t.prototype.GetInsideRect=function(t){var e=this.unscaled(this.getBorder()),i=n.IRt(this.GetClientRect(),-e,-e);return t||(i[2]=this.scaled(i[2]),i[3]=this.scaled(i[3])),i},t.prototype.GetCanvasRect=function(){var t=this.GetClientRect(),i=this.GetCanvas();return e(i)&&(t=[0,0,i.width,i.height]),t},t.prototype.GetVisibleRect=function(){return n.NRt(this.GetClientRect(),this.GetCanvasRect())},t.prototype.GetViewRect=function(){return n.EArtC(this.GetCanvas())},t.prototype.c2V=function(t,e){return n.CW.prototype.c2V.apply(this,arguments)},t.prototype.v2C=function(t,e){return n.CW.prototype.v2C.apply(this,arguments)},t.prototype.c2Vrt=function(t){var e=this.c2V(t);return[e.x,e.y,t[2],t[3]]},t.prototype.v2Crt=function(t){var e=this.v2C(t);return[e.x,e.y,t[2],t[3]]},t.prototype.onpaint=function(t){this.lI||(this.updSPR(),n.SB.prototype.onpaint.call(this,t))},t.prototype.e2W=function(t){return this.gCW().e2W(t)},t.prototype.e2V=function(t){return(this.e2W(t)||{}).oC||null},t.prototype.onmousemove=function(t){var e,i=this.gPtr(t),o=this.getCursor(i);return o&&(e=this.GetCanvas())&&(e.style.cursor=o),o},t.prototype.onwheel=function(t){if(this.isSelectable()){var i=this.gPtr(t);if(e(i)&&n.PInR(i.x,i.y,this.GetClientRect()))return this.dowheel(t)}return!1},t.prototype.dowheel=function(t){return!!(2&n.ModK(t))&&(this.zoomOnWheel(t),!0)},t.prototype.ondown=function(t){if(this.isSelectable()){n.A.Cancel("ss*");var e=this.gAA();e.Do(this,t),e.CanDo(t,!0)&&!n.RUR.Rng()&&this.doRUR(t,function(){})}return!0},t.toClick=function(t){return{uiEvent:t,dblClick:t.drag&&(t.drag.long||1!=t.drag.click)||!1,button:n.e2B(t),modifiers:n.ModK(t)}},t.prototype.toClick=function(t,e){e.node=this.p2N(this.gPtr(t))},t.prototype.onA=function(t,e){t&&(n.H.VisitA(this,t),this.inv(),this.onanchorclick(t))},t.prototype.onClick=function(e,i,o){var n=e?e.node||e:null,s=this.gPtr(o),r=t.toClick(o);this.toClick(o,r),i&&(e&&void 0!==e.expandType||this.allowSelect()&&this.gAA().Has("select")&&(this.selectModifierEvent(o),this.select(n),this.selectModifierEvent(o)),n&&(this.EnsureVisibleNode(n),e.node&&(this.ToggleExpandNode(n,e.expandType),this.onChange("expand-node",n)))),this.onA(this.p2A(s),r),e&&void 0!==e.expandType||this.onclick(r)},t.prototype.onDblClick=function(i,o){var n=i?i.node||i:null,s=t.toClick(o);this.toClick(o,s),e(n)&&this.getExpandOnDblClick()&&this.ToggleExpandNode(n,i.expandType),i&&void 0!==i.expandType||this.onclick(s)},t.prototype.onclick=function(t){this.oLts.onclick.do(t)},t.prototype.onanchorclick=function(t){this.oLts.onanchorclick.do(t)},t.prototype.onChange=function(t,e){this.onchange({object:e,action:t})},t.prototype.onchange=function(t){this.oLts.onchange.do(t)},t.prototype.onkeydown=function(t){this.onkey(t,-1)},t.prototype.onkeyup=function(t){this.onkey(t,0)},t.prototype.onkeypress=function(t){this.onkey(t,1)},t.prototype.onkey=function(t,e){this.oSts&&this.oSts.onkey(t,e)},t.prototype.onlayout=function(t){var i;t.IsSave()?(i=this.GetScroll(),t.Add("zoom",this.GetZoom()),t.Add("sel",function(){var t=[];return this.getSel().forEach(function(e){t.push(e.getKey())}),t.join()}.call(this)),t.Add("coll",function(){var t=new Map,e="";return this.oR.forEach(function(e){e.isExpanded(1)||t.set(e,1|(t.get(e)||0)),e.isExpanded(2)||t.set(e,2|(t.get(e)||0)),e.isExpanded(4)||t.set(e,4|(t.get(e)||0))}),t.forEach(function(t,i){e+=(e?",":"")+i.getKey()+"("+t+")"}),e}.call(this)),t.Add("hscroll",i.x),t.Add("vscroll",i.y)):(this.oLts.lock(),this.bU(),this.SetZoom(t.GetValue("zoom")),function(t){e(t)&&this.SetSelection(t.split(","))}.call(this,t.GetValue("sel")),function(t){e(t)&&(this.oR.forEach(function(t){t.SetExpand(!0)}),n.B.split(t).forEach(function(t){var e,i=this.Node(t.caption);i&&(e=~~t.subText)&&i.SetExpandType(e,!1)},this))}.call(this,t.GetValue("coll")),this.SetScroll({x:t.GetValue("hscroll"),y:t.GetValue("vscroll")}),this.eU(),this.oLts.unlock())},t.prototype.onScroll=function(t){this.onscroll({view:this,type:t.type,value:t.value})},t.prototype.onscroll=function(t){this.oLts.onscroll.do(t)},t.prototype.onhscroll=function(t){this.resVO(),this.onScroll({type:1,value:t})},t.prototype.onvscroll=function(t){this.resVO(),this.onScroll({type:0,value:t})},t.prototype.udefSts=function(t){t&&t.RemoveOf(this)},t.prototype.defSts=function(t){e(this.oG)&&(this.oG.oSts=t)},t.prototype.iLts=function(){this.oLts=new n.Lts,this.oLts.Add("onselchange"),this.oLts.Add("onclick"),this.oLts.Add("onanchorclick"),this.oLts.Add("onchange"),this.oLts.Add("onscroll")},t.prototype.p2O=function(t){var e=this.GetClientRect(),i=s.X(t)-e[0],o=s.Y(t)-e[1];return this.getVO().p2O(this.scaled(i),this.scaled(o))},t.prototype.p2N=function(t){var e=this.p2O(t);return e&&(e.node||e)||null},t.prototype.p2V=function(t){var e=this.ptCA(t,!0),i=this.origin();return{x:s.X(e)+i[0],y:s.Y(e)+i[1]}},t.prototype.p2A=function(t){return t=this.p2V(t),n.H.P2A(this,s.X(t),s.Y(t))},t.prototype.hitTest=function(t){var e;if(this.isSelectable()&&(e=this.p2O(t)))return{code:e,callback:null,thisArg:this}},t.prototype.getMoveNodes=function(t,e){var o=null;return t instanceof Node&&(o=(e=i(e)||e)&&this.getSelCount()>1&&this.isSelected(t)?this.getSel().byO():[t]),o},t.prototype.ToggleExpandNode=function(t,i){var o=this.oR.Item(t);o&&this.Smooth(function(){var t=this.o2R(o);o.ToggleExpand(i),this.updSPR();var s=this.o2R(o);if(e(s)&&e(t)){var r=this.GetScroll();r.x+=s[0]-t[0],r.y+=s[1]-t[1],this.SetScroll(r)}if(this.getEnsureOnExpand()){var h=this.Lyt(),l=h.o2R(o),a=o.getVisibleDescendant(i);e(a)&&(l=null,a.forEach(function(t){l=n.URts(l,h.o2R(t))})),this.EnsureVisibleClient(l)}},this,function(t,e,n,r,h,l,a,u){var p=n.o2R(o.getExpandGlyph(i),this.origin(r))||n.o2R(o,this.origin(r));p=s.C2R(s.R2C(p));var c=l.o2R(o.getExpandGlyph(i),this.origin(a))||l.o2R(o,this.origin(a));c=s.C2R(s.R2C(c)),o.dscn(i).forEach(function(t){[t,t.getExpandGlyph(null),t.getExpandGlyph(2),t.getExpandGlyph(1),t.getExpandGlyph(4)].forEach(function(t){var i=h.has(t),o=u.has(t);if(!i||!o){var s=n.has(t);s!=l.has(t)?(i?o||u.push(t,c.slice()):(h.push(t,p.slice()),o||u.push(t,l.o2R(t,this.origin(a)))),e.remove(t)):s&&e.push(t)}},this)},this)})},t.prototype.EnsureVisibleClient=function(t,i){if(e(t)){var o=t,s=(i=i||{}).allowScale,r=i.nearestFit;if(n.IsA(t)||(o=this.Lyt().o2R(t)),!n.EyR(o)){var h=this.GetScroll(),l=this.getScale(),u=l;if(s){var p=this.GetInsideRect(!0),c=this.rtCA(o,!1);u=a(l*p[2]/c[2],l*p[3]/c[3]),s=u0&&(n.A.Cancel(this.sSA),l=this.getVO(),a=this.Lyt(),u=this.GetScroll(),p=this.GetInsideRect(),this.bU()),e(this.rgVO)&&this.rgVO.clean(),t.call(o),h>0){var c=this.updSPR;this.updSPR(this.Lyt().oSize),this.updSPR=function(){},this.rgVO=l,this.oLyt=a,this.eU(),this.oLyt=null,this.rgVO=null,this.updSPR=c;var f=this.getVO(),d=this.Lyt(),g=this.GetScroll(),y=new n.Arr(l.diff(f));r instanceof Function&&r.call(this,p,y,a,u,l,d,g,f),y.forEach(function(t){var e=l.get(t),o=f.get(t);i(e)&&l.push(t,a.o2R(t,this.origin(u))||s.C2R(s.R2C(o))),i(o)&&f.push(t,d.o2R(t,this.origin(g))||s.C2R(s.R2C(e)))},this),(this.rgVO=l).morph(f,{inv:this.invAO,refresh:this.Refresh,thisArg:this,name:this.sSA,onXDoL:!1,duration:h})}}},t.prototype.GetFocus=function(){var t=this.rgSel;return(e(t)?"first"in t?t.first():t:null)||this.oR},t.prototype.SetFocus=function(t){var e=this.Node(t)||this.oR;return this.SetSelection(e),this.EnsureVisibleNode(e),e},t.prototype.isSelected=function(t){var o=e(this.rgSel);return i(t)?!o:!!o&&(this.rgSel instanceof n.Arr?this.rgSel.has(t):this.rgSel==t)},t.prototype.getSelCount=function(){var t=0;if(e(this.rgSel)){if(this.rgSel instanceof n.Arr)return this.rgSel.len();t++}return t},t.prototype.selectModifierEvent=function(t){this.oSelEv=t&&{modifier:n.ModK(t),selection:this.rgSel}},t.prototype.removeSel=function(t){this.rgSel&&this.isSelected(t)&&(this.rgSel instanceof n.Arr?(this.rgSel.remove(t),this.rgSel.len()||(this.rgSel=null)):this.rgSel=null)},t.prototype.valueToNodes=function(t){if(e(t)){if(t instanceof Array||t instanceof n.Arr){var i=new n.Arr;return t.forEach(function(t){var o=this.Node(t);e(o)&&i.push(o)},this),i}return this.Node(t)}return null},t.prototype.isSable=function(t){return t instanceof Node&&t.isSelectable()},t.prototype.select=function(t,o,s){function r(t,o,s){var r=!1,h=t.isSelected(o),l=o&&t.isSable(o);if(i(o))r=e(t.rgSel),t.rgSel=null;else if(t.isSingleSel()){var a=t.rgSel;t.rgSel=!l||s&&h?null:o,r=a!=t.rgSel}else s&&h?(r=h,t.removeSel(o)):(s||(r=e(t.rgSel)&&(!h||t.rgSel.len()>1),t.rgSel=null),l&&(t.rgSel=t.rgSel||new n.Arr).push(o)),r|=h!=t.isSelected(o);return r}var h=!1,l=!s&&(this.isToggleSel()||this.isToggleCtrlSel()&&2&this.oSelEv.modifier),a=this.valueToNodes(t);a instanceof n.Arr?l?a.forEach(function(t){h|=r(this,t,l)},this):(h=!a.equal(this.rgSel))&&(this.isSingleSel()?r(this,a.last()):(this.rgSel=new n.Arr,a.forEach(function(t){this.isSable(t)&&this.rgSel.push(t)},this))):h=r(this,a,l),h&&(0==this.lI&&(void 0===o||o)&&this.invAO(),this.onselchange(this.GetSelection()))},t.prototype.onselchange=function(t){this.oLts.onselchange.do(t)},t.prototype.onSetAO=function(t){function i(i,o){var l=s.getShape(i);e(l)&&(!n.EyO(l.hover)&&t.set({owner:s,id:i.idAOH,object:i,inv:s.inv,hitTest:function(t,e,o){return h?h===i:s.isAP(t,e)&&o.object==s.p2O([t,e])},duration:r}),!n.EyO(l.click)&&t.set({owner:s,id:i.idAOC,object:i,inv:s.inv,hitTest:function(t,e,o){return h?h===i:s.isAP(t,e)&&o.object==s.p2O([t,e])},actOn:h==i?1:4,duration:r}))}var o=null;if(this.isSelectable()&&!t.hasOf(this)&&(o=this.getVO())){var s=this,r=s.getSmooth(),h=s.orurOnlyAO;h instanceof Node?i(h,o.indexOf(h)):o.forEach(function(t,e,o){i(e)},this)}},t.prototype.onimg=function(){this.Smooth(function(){this.Refresh()},this)},t.prototype.onRL=function(){this.resVO(),this.oLyt=null},t.prototype.resVO=function(){this.rgVO=null,this.resAO()},t.prototype.bU=function(){this.lI++},t.prototype.eU=function(){if(!--this.lI){var t=this.gCW();!t||this.oLyt?this.invAO():(this.resAO(),t.Render())}},t.prototype.beU=function(){this.bU(),this.eU()},t.prototype.Lyt=function(){if(i(this.oLyt)){var t=this.gCtx(),e=null;t&&(e=n.TFI.bCTX(t,this.getTfi())),this.oLyt=new p(this.oR),t&&n.TFI.eCTX(t,e)}return this.oLyt},t.prototype.getVO=function(){if(i(this.rgVO)){var t=this.GetScrollRect();this.getShowLinks()&&n.IRt(t,t[2],t[3]),this.rgVO=this.Lyt().scroll(t,this.origin())}return this.rgVO},t.prototype.GetScroll=function(){return this.W().GetScroll()},t.prototype.SetScroll=function(t){this.W().SetScroll(t)},t.prototype.isExtSBS=function(){var t=this.gCW();return t&&12288==(12288&t.gSBs())},t.prototype.getScale=function(){return i(this.scale)&&(this.scale=this.getZoom()/100),this.scale},t.prototype.scaled=function(t){return t/this.getScale()},t.prototype.unscaled=function(t){return t*this.getScale()},t.prototype.origin=function(t){t=t||this.GetScroll();var e=this.getBorder();return[-t.x+e,-t.y+e]},t.prototype.GetScrollRect=function(){var t=this.origin(),e=this.GetClientRect();return[-t[0],-t[1],this.scaled(e[2]),this.scaled(e[3])]},t.prototype.GetZoom=function(){return this.oO.zoom},t.prototype.SetZoom=function(t){this.bU(),this.scale=null,this.oO.zoom=t,this.updSPR(),this.eU()},t.prototype.getZoom=function(){var t=this.GetZoom(),e=this.getZoomLevels();return i(t)&&(t=100),l(e[0],a(e[e.length-1],t))},t.prototype.GetZoomLevels=function(){return this.oO.zoomLevels},t.prototype.SetZoomLevels=function(t){this.bU(),this.scale=null,this.oO.zoomLevels=t,this.updSPR(),this.eU()},t.prototype.getZoomLevels=function(){var t=[100],e=new n.Arr;return h(this.GetZoomLevels(),"25,35,50,65,75,80,90,100,110,125,150,175,200,250,300,400,500").split(",").forEach(function(t){e.push(l(10,a(1e3,n.ToN(t,100))))}),e.isEmpty()||(t=e.byO()).sort(function(t,e){return t-e}),t},t.prototype.zoomOnWheel=function(t){var e=!1,i=n.WhelInc(t);if(i){var o=this.getZoomLevels(),s=100*this.getScale(),r=function(t,e){var i=0,o=e.length;if(t>=e[i])for(;t>=e[i+1]&&iMath.abs(t.drag.offset.dy)?t.drag.offset.dx:t.drag.offset.dy),t.drag.current);break;case 3:case 4:case 5:e(h)&&h.call(l,t)}},this)}},t.prototype.rurFit=function(t,o){o.rurOnlyAO={},o.rurDrop=function(t){this.FitToClient(this.focusRectAbs(t))};var n=this.getShape("frameFit");if(e(n)){function r(t,e,i){e.drawShape(i,n.normal||n)}o.rurEFPaint=r,i(o.rurEFPaint)&&(o.rurDrag=function(t){r(0,this.gCtx(),this.rtCA(s.Rect(t.from,t.to),!1))})}this.rurDrag(t,o)},t.prototype.rurSelect=function(t,o){if(this.allowSelect()&&this.isSelectByDrag(t)){var n=this.getShape("frameSel");if(e(n)){function r(t,e,i){e.drawShape(i,n.normal||n)}o.rurEFPaint=r}var h=!1;o.rurDrag=function(t){!h&&(h=2==t.event.drag.status)&&(this.orurOnlyAO={},this.invAO()),i(o.rurEFPaint)&&e(n)&&r(0,this.gCtx(),this.rtCA(t.frame,!1))},o.rurDrop=function(t){this.bU(),this.selectModifierEvent(t.event),this.isSingleSel()?this.select(this.p2O(this.ptCA(t.to,!1))):this.select(this.Lyt().r2O(s.Rect(t.from,t.to))),this.EnsureVisibleClient(this.focusRectAbs(t),{allowScale:!0,nearestFit:!0}),this.selectModifierEvent(null),this.eU()},this.rurDrag(t,o)}},t.prototype.rurMove=function(t,o){var s=this.gPtr(t),r=this.p2O(s),h=this.Lyt().o2R(r),l=this.getMoveNodes(r,!0);if(l&&h){var a=this.getShape("frameDrag"),u=l.length>1?l.length:null,p=null,c=null,f=null;n.EyO(a)&&(a=null);o.rurEFPaint=function(t,e,i,o){p=p||o;var s=!1,h=this.p2O(this.ptCA(t.to,!1)),c=[this.scaled(i[0]),this.scaled(i[1]),this.scaled(i[2]),this.scaled(i[3])];h instanceof Node&&(s=Node.canParent(l,h)),this.ctxScale(e,[0,0,0,0],function(){s||(e.globalAlpha=.25),a?e.drawShape(c,a.normal||a):this.drawO(e,c,r)},this),u&&e.drawHTMLText(u,i,n.DrawTextFormatEnum.exTextAlignCenter|n.DrawTextFormatEnum.exTextAlignVCenter)},o.rurEFOpts=function(t,e){e.visible=!1,e.limitClient=!1},o.rurDrag=function(t){e(p)&&p.SetVisible(t.from!=t.to),t.frame=n.ORt(h.slice(),t.to.x-t.from.x,t.to.y-t.from.y),clearTimeout(f);var o=this.p2O(this.ptCA(t.to,!1));if(o instanceof Node&&Node.canPosition(l,o)){var s=this,a=o.GetPosition();f=setTimeout(function(){s.Smooth(function(){i(c)&&(c=r.ownCol())&&c.savePos(),s.bU(),l.forEach(function(t){t.SetPosition(a++)}),s.EnsureVisibleNode(r),s.eU(),e(p)&&p.Render()})},512)}},o.rurCancel=function(t){clearTimeout(f),e(c)&&this.Smooth(function(){this.bU(),c.loadPos(),this.eU()},this)},o.rurDrop=function(t){clearTimeout(f);var e=this.p2O(this.ptCA(t.to,!1));e instanceof Node&&Node.canParent(l,e)&&this.Smooth(function(){this.bU(),l.forEach(function(t){t.SetParent(e)}),this.EnsureVisibleNode(r),this.eU()},this)},this.rurDrag(t,o)}},t.prototype.rurDragDrop=function(t,e){var i=this.p2O(this.gPtr(t));this.isSable(i)&&n.RUR.D3(t,{object:i,shape:this.getShape(i),client:this.rtCA(this.Lyt().o2R(i),!1),source:this,onpaint:function(t,e){this.source.drawO(t,e,this.object)},onclick:function(t){e.rurStatus&&e.rurStatus.call(this,t)},onmove:function(t){t.drag.setCursor(n.GP.Get(e.rurName,this.getCursors()))}})},t.prototype.ptCA=function(t,e){var o={x:s.X(t),y:s.Y(t)},n=this.GetScroll(),r=this.GetInsideRect(!0);return i(e)||e?(o.x-=r[0],o.y-=r[1],o.x=this.scaled(o.x),o.y=this.scaled(o.y),o.x+=n.x,o.y+=n.y):(o.x-=n.x,o.y-=n.y,o.x=this.unscaled(o.x),o.y=this.unscaled(o.y),o.x+=r[0],o.y+=r[1]),o},t.prototype.rtCA=function(t,e){return s.Rect(this.ptCA(s.R2C(t,17),e),this.ptCA(s.R2C(t,68),e))},t.prototype.doRUR=function(t,e,i,o){return n.RUR.Do(t,function(t){switch(t.drag.status){case 3:this.gAA().CanDo(t,!0)&&(n.RUR.Cancel(),this.gAA().Do(this,t,!0))}e.call(i,t)},this,o)},t.prototype.rurScroll=function(t,o){if(t){var n={oH:this.GetSI(!0),oV:this.GetSI(!1),scrollRange:this.sR},s=this.ptCA(this.GetInsideRect(!0),!0),r=null,h=this;e(o)&&(o.rurStatus instanceof Function&&(r=o.rurStatus),e(o.thisArg)&&(h=o.thisArg)),this.doRUR(t,function(t){switch(t.drag.status){case 1:this.orurOnlyAO=(e(o)?o.rurOnlyAO:null)||null,this.beU();break;case 7:this.orurOnlyAO=null,t.drag.cancel?this.Soom(null,s,[0,0]):i(t.drag.swipe)&&this.beU();break;case 2:this.rurScrollD(-t.drag.offset.dx,-t.drag.offset.dy,n);break;case 6:this.SSw(t.drag.swipe);break;case 3:case 4:case 5:e(r)&&r.call(h,t)}},this)}},t.prototype.rurScrollD=function(t,e,i){(i=i||{oH:this.GetSI(!0),oV:this.GetSI(!1)}).oH=i.oH||{pos:0,page:0},i.oV=i.oV||{pos:0,page:0},this.bU();var o=i.oH.pos+this.scaled(t),n=i.oV.pos+this.scaled(e);this.SetScroll({x:o,y:n}),this.eU()},t.prototype.rurDrag=function(t,i){function o(t){e(E)&&(t.updSPR=E,E=null)}function r(){p.frame=s.Rect(p.from,p.to),e(g)&&g.call(x,p)}if(e(t)){var h=this.GetClientRect(),a=this.gPtr(t),u=this.ptCA(a,!0),p={from:u,to:u,event:null,frame:s.Rect(u,u)},c={oH:this.GetSI(!0),oV:this.GetSI(!1),scrollRange:this.sR},f=null,d=null,g=null,y=null,S=null,v=null,C=null,O=null,x=this,G=null,E=null,A=null;e(i)&&(i.rurEFPaint instanceof Function&&(f=i.rurEFPaint),i.rurEFOpts instanceof Function&&(d=i.rurEFOpts),i.rurDrag instanceof Function&&(g=i.rurDrag),i.rurCancel instanceof Function&&(y=i.rurCancel),i.rurDrop instanceof Function&&(S=i.rurDrop),i.rurStatus instanceof Function&&(v=i.rurStatus),i.rurDragStart instanceof Function&&(C=i.rurDragStart),i.rurDragEnd instanceof Function&&(O=i.rurDragEnd),e(i.thisArg)&&(x=i.thisArg)),this.doRUR(t,function(t){switch(p.event=t,t.drag.status){case 1:if(e(C)&&C.call(x,p),this.orurOnlyAO=(e(i)?i.rurOnlyAO:null)||null,i&&i.rurAllowUpdateScrollRange||(E=this.updSPR,this.updSPR=function(){}),this.beU(),e(f)){r();var s={name:"frame",client:this.rtCA(p.frame,!1),relative:this.GetCanvas(),clip:this.GetCanvas(),inflateClient:8,onpaint:function(t,e){f.call(x,p,t,e,this)}};e(d)&&d.call(x,p,s),G=n.EF.Create(s)}break;case 7:clearTimeout(A),this.orurOnlyAO=null,o(this),this.bU(),t.drag.cancel?(this.rurScrollD(0,0,c),e(y)&&y.call(x,p)):t.drag.click||t.drag.long||!S||S.call(x,p),n.A.Rng(this.sSA)||this.onRL(),this.eU(),n.EF.Destroy(G),e(O)&&O.call(x,p);break;case 2:var a=t.drag.current.x-n.LOf(h);a>0&&(a=l(0,t.drag.current.x-n.ROf(h)));var u=t.drag.current.y-n.TOf(h);u>0&&(u=l(0,t.drag.current.y-n.BOf(h))),(a||u)&&this.rurScrollD(a,u),clearTimeout(A);var g=this.p2O(t.drag.current);e(g)&&e(g.node)&&!g.node.isExpanded(g.expandType)&&(A=setTimeout(function(){var t=g.node,i=t.oCV,o=null;e(E)&&(o=i.updSPR,i.updSPR=E),i.ToggleExpandNode(t,g.expandType),e(E)&&(i.updSPR=o)},512)),p.to=this.ptCA(t.drag.current,!0),p.dx=p.to.x-p.from.x,p.dy=p.to.y-p.from.y,r(),e(G)&&G.SetClient(this.rtCA(p.frame,!1));break;case 3:case 4:case 5:o(this),e(v)&&v.call(x,t)}},this,{contiguously:!0,client:h})}},t.prototype.focusPointAbs=function(t){var i=this.ptCA(t,!0),o=this.p2O(t);return e(o)&&(i=s.R2C(this.Lyt().o2R(o))),i},t.prototype.focusRectAbs=function(t){var e=s.Rect(t.from,t.to);if(!n.EyR(e)){var i=this.Lyt().r2O(e);if(i.length){var o=this.Lyt();i.forEach(function(t){e=n.URt(e,o.o2R(t))})}}return e},t.prototype.allowRur=function(t,i){return e(t)},t.prototype.rurAction=function(t,e,i){var o=this.gPtr(i),s={rurName:t,rurFlags:e,rurOnlyAO:this.p2O(o)||{},rurStatus:function(e){this.rurActionClick(t,e)}};if(this.allowRur(i,s)){var r="rur"+n.getP(function(t){for(var e,i="",o=0,n=t.length;oh?l=null:l1){var r,h,l=this.toShape("multiSel");l&&(i=n.Format(i,0),r=t.sizeHTMLText(i),h=s.C2R(s.R2C(e,o),r.width+8,r.height+8,o),t.drawShape(h,l,{text:i}))}},t.prototype.onDrawPartScroll=function(t,i,o,n,r){if(640==o){var h=this.getScrollBarsRoot();if(e(h)){var l=this.Lyt(),a=s.R2C(l.o2R(this.oR)),u=s.R2C(n);t.isV()?u[1]=n[1]+a[1]/l.oSize.height*n[3]:u[0]=n[0]+a[0]/l.oSize.width*n[2],i.drawShape(s.C2R(u,3,3),{fillColor:h,primitive:"Circle"})}}},t.prototype.ctxScale=function(t,e,i,o){t.translate(e[0],e[1]),t.save(),t.scale(this.getScale(),this.getScale()),i.call(o||this,[0,0,this.scaled(e[2]),this.scaled(e[3])]),t.restore(),t.translate(-e[0],-e[1])},t.prototype.draw=function(t,e,i){this.nN=0,this.nL=0,this.ctxScale(t,e,function(){var e=this.getShowLinks();e==n.ShowLinksEnum.exHide?this.nN=this.drawN(t):e&n.ShowLinksEnum.exFront?(this.nN=this.drawN(t),this.nL=this.drawL(t)):(this.nL=this.drawL(t),this.nN=this.drawN(t))},this)},t.prototype.GetTfi=function(){return this.oO.tfi},t.prototype.SetTfi=function(t){this.bU(),this.oO.tfi=t||null,this.onRL(),this.eU()},t.prototype.getTfi=function(){return this.opt("tfi")},t.prototype.GetLocked=function(){return this.oO.locked},t.prototype.SetLocked=function(t){this.bU(),this.oO.locked=t,this.onRL(),this.eU()},t.prototype.getLocked=function(){return this.opt("locked",!1)},t.prototype.GetReadOnly=function(){return this.oO.readOnly},t.prototype.SetReadOnly=function(t){this.bU(),this.oAA=null,this.oO.readOnly=t,this.onRL(),this.eU()},t.prototype.isReadOnly=function(){return this.opt("readOnly",!1)},t.prototype.GetWheelChange=function(){return this.oO.wheelChange},t.prototype.SetWheelChange=function(t){this.bU(),this.oO.wheelChange=t,this.onRL(),this.eU()},t.prototype.getWheelChange=function(){return this.opt("wheelChange",18)},t.prototype.GetExpandGlyphSize=function(){return this.oO.expandGlyphSize},t.prototype.SetExpandGlyphSize=function(t){this.bU(),this.oO.expandGlyphSize=t,this.onRL(),this.eU()},t.prototype.getExpandGlyphSize=function(){return l(0,n.ToN(this.opt("expandGlyphSize",16)))},t.prototype.GetFlow=function(){return this.oO.flow},t.prototype.SetFlow=function(t){this.bU(),this.oFlow=null,this.oO.flow=t||null,this.onRL(),this.eU()},t.prototype.getFlow=function(){return i(this.oFlow)&&(this.oFlow=p[this.opt("flow")]||p.flowVertical),this.oFlow},t.prototype.GetAlign=function(){return this.oO.align},t.prototype.SetAlign=function(t){this.bU(),this.oO.align=e(t)?t:null,this.onRL(),this.eU()},t.prototype.getAlign=function(){return this.opt("align",n.AlignEnum.exAlignCenter)},t.prototype.GetMargins=function(){return this.oO.margins},t.prototype.SetMargins=function(t){this.bU(),this.oM=null,this.oO.margins=t||null,this.onRL(),this.eU()},t.prototype.getMargins=function(){if(i(this.oM)){var t=this.opt("margins",null);n.IsO(t)||(t={}),this.oM=n.Inh(t,this.defOpt().margins||{x:16,y:16,indent:16,border:8})}return this.oM},t.prototype.GetShowExpandGlyphs=function(){return this.oO.showExpandGlyphs},t.prototype.SetShowExpandGlyphs=function(t){this.bU(),this.oO.showExpandGlyphs=t,this.onRL(),this.eU()},t.prototype.getShowExpandGlyphs=function(){var t=this.opt("showExpandGlyphs",null);return e(t)&&(t=o(t,c)),t},t.prototype.GetSingleExpandGlyphs=function(){return this.oO.singleExpandGlyphs},t.prototype.SetSingleExpandGlyphs=function(t){this.bU(),this.oO.singleExpandGlyphs=t,this.onRL(),this.eU()},t.prototype.getSingleExpandGlyphs=function(){return!!this.opt("singleExpandGlyphs")},t.prototype.GetShow=function(){return this.oO.show},t.prototype.SetShow=function(t){this.bU(),this.oO.show=t,this.onRL(),this.eU()},t.prototype.getShow=function(){var t=this.opt("show",null);return e(t)&&(t=o(t,c)),t},t.prototype.GetFilter=function(){return this.oO.filter},t.prototype.SetFilter=function(t){this.bU(),this.oO.filter=t||null,this.onRL(),this.eU()},t.prototype.getFilter=function(){return this.opt("filter",null)},t.prototype.getFilterNodes=function(){return this.oR.fN(this.getShow(),this.getFilter())},t.prototype.GetSmooth=function(){return this.oO.smooth},t.prototype.SetSmooth=function(t){this.oO.smooth=t},t.prototype.getSmooth=function(){return l(0,n.ToN(this.opt("smooth",125)))},t.prototype.onAdd=function(t){this.onUpdateKey(t)},t.prototype.onRemove=function(t){this.onUpdateKey(t),this.removeSel(t)},t.prototype.onUpdateKey=function(t){this.mK2I=null},t.prototype.Node=function(t,o){function n(t,i){i.set(t.getKey(),t);var o=t.rgCld;e(o)&&o.forEach(function(t){n(t,i)});var s=t.rgAst;e(s)&&s.forEach(function(t){n(t,i)});var r=t.rgGrp;return e(r)&&r.forEach(function(t){n(t,i)}),i}if(t instanceof Node)return t;o=o||this.oR,this.mK2I=this.mK2I||new Map;var s=this.mK2I.get(o);return i(s)&&this.mK2I.set(o,n(o,s=new Map)),s.get(t)||null},t.prototype.GetSingleSel=function(){return this.oO.singleSel},t.prototype.SetSingleSel=function(t){this.bU(),this.n1S=null,this.oO.singleSel=t,this.onRL(),this.eU()},t.prototype.getSingleSel=function(){var t=this.n1S;return i(t)&&(i(t=this.GetSingleSel())&&(t=this.defOpt().singleSel),t=o(t,n.OrgChart.SingleSelEnum,n.OrgChart.SingleSelEnum.exEnableSel),this.n1S=t),t},t.prototype.GetSelection=function(){return this.rgSel&&(this.rgSel.byO&&this.rgSel.byO()||this.rgSel)},t.prototype.SetSelection=function(t){this.select(t,!0,!0)},t.prototype.SelectAll=function(){this.SetSelection(this.oR.dscn())},t.prototype.UnselectAll=function(){this.SetSelection(null)},t.prototype.getSel=function(){var t=n.Arr.empty;return e(this.rgSel)&&(t=this.rgSel instanceof n.Arr?this.rgSel:new n.Arr(this.rgSel)),t},t.prototype.EnsureVisibleSelection=function(){var t=this.getSel();if(!t.isEmpty()){var e=null,i=this.Lyt().rgVO;t.forEach(function(t){e=n.URt(e,i.get(t))}),this.EnsureVisibleClient(e,{allowScale:!0})}},t.prototype.RemoveSelection=function(){this.Smooth(function(){if(e(this.rgSel)){var t=new n.Arr(this.rgSel);t.isEmpty()||(this.rgSel=null,this.bU(),t.forEach(function(t){t.Remove()}),this.onRL(),this.eU())}},this)},t.prototype.allowSelect=function(){return this.getSingleSel()!=n.OrgChart.SingleSelEnum.exDisableSel},t.prototype.isSingleSel=function(){return this.getSingleSel()&n.OrgChart.SingleSelEnum.exSingleSel},t.prototype.isToggleSel=function(){return this.getSingleSel()&n.OrgChart.SingleSelEnum.exToggleSel},t.prototype.isToggleCtrlSel=function(){return 0==(this.getSingleSel()&n.OrgChart.SingleSelEnum.exDisableCtrlSel)},t.prototype.isShiftSel=function(){return 0==(this.getSingleSel()&n.OrgChart.SingleSelEnum.exDisableShiftSel)},t.prototype.allowSelectByDrag=function(){return 0==(this.getSingleSel()&n.OrgChart.SingleSelEnum.exDisableDrag)},t.prototype.isSelectByDrag=function(t){return 1&n.ModK(t)&&this.allowSelectByDrag()&&this.isShiftSel()},t.prototype.GetEnsureOnExpand=function(){return this.oO.ensureOnExpand},t.prototype.SetEnsureOnExpand=function(t){this.bU(),this.oO.ensureOnExpand=t,this.onRL(),this.eU()},t.prototype.getEnsureOnExpand=function(){return!!this.opt("ensureOnExpand",!0)},t.prototype.GetExpandOnDblClick=function(){return this.oO.expandOnDblClick},t.prototype.SetExpandOnDblClick=function(t){this.bU(),this.oO.expandOnDblClick=t,this.onRL(),this.eU()},t.prototype.getExpandOnDblClick=function(){return!!this.opt("expandOnDblClick",!0)},t.prototype.GetPad=function(){return this.oO.pad},t.prototype.SetPad=function(t){this.bU(),this.rgPad=null,this.oO.pad=t,this.onRL(),this.eU()},t.prototype.getPad=function(){return i(this.rgPad)&&(this.rgPad=n.pad2A(this.opt("pad",[4,4]))),this.rgPad},t.prototype.GetFormatText=function(){return this.oO.formatText},t.prototype.SetFormatText=function(t){this.bU(),this.nFT=null,this.oO.formatText=t,this.onRL(),this.eU()},t.prototype.getFormatText=function(){return i(this.nFT)&&(this.nFT=o(this.opt("formatText"),n.DrawTextFormatEnum,n.DrawTextFormatEnum.exTextAlignCenter|n.DrawTextFormatEnum.exTextAlignVCenter|n.DrawTextFormatEnum.exTextWordBreak|n.DrawTextFormatEnum.exTextWordEllipsis)),this.nFT},t.prototype.GetImageAlign=function(){return this.oO.imageAlign},t.prototype.SetImageAlign=function(t){this.bU(),this.nIA=null,this.oO.imageAlign=t,this.onRL(),this.eU()},t.prototype.getImageAlign=function(){return i(this.nIA)&&(this.nIA=~~this.opt("imageAlign",0)),this.nIA},t.prototype.GetSize=function(){return this.oO.size},t.prototype.SetSize=function(t){this.bU(),this.aSize=void 0,this.oO.size=t,this.onRL(),this.eU()},t.prototype.getSize=function(){return void 0===this.aSize&&(this.aSize=this.opt("size",null)),this.aSize},t.prototype.GetImageSize=function(){return this.oO.imageSize},t.prototype.SetImageSize=function(t){this.bU(),this.aIS=void 0,this.oO.imageSize=t,this.onRL(),this.eU()},t.prototype.getImageSize=function(){return void 0===this.aIS&&(this.aIS=this.opt("imageSize",null)),this.aIS},t.prototype.getBorder=function(){return this.getMargins().border},t.prototype.GetShapes=function(){return this.oO.shapes},t.prototype.SetShapes=function(t){this.bU(),this.sShs=null,this.oO.shapes=t,this.onRL(),this.eU()},t.prototype.getShapes=function(){return i(this.sShs)&&(this.sShs=h(this.opt("shapes","Border(node),Expand(expand),FrameSel(select,frameSel),FrameFit(frameFit),Empty(frameDrag)"))),this.sShs},t.prototype.GetCursors=function(){return this.oO.cursors},t.prototype.SetCursors=function(t){this.bU(),this.sCrs=null,this.oO.cursors=t,this.onRL(),this.eU()},t.prototype.getCursors=function(){return i(this.sCrs)&&(this.sCrs=h(this.opt("cursors","pointer(expand,drag-drop,pointer)"))),this.sCrs},t.prototype.GetShowLinks=function(){return this.oO.showLinks},t.prototype.SetShowLinks=function(t){this.bU(),this.nSL=null,this.oO.showLinks=t,this.onRL(),this.eU()},t.prototype.getShowLinks=function(){var t=this.nSL;return i(t)&&(i(t=this.GetShowLinks())&&(t=this.defOpt().showLinks),t=o(t,n.ShowLinksEnum,n.ShowLinksEnum.exExtended|n.ShowLinksEnum.exCrossRect),this.nSL=t),t},t.prototype.GetLink=function(){return this.oO.link},t.prototype.SetLink=function(t){this.bU(),this.oL=null,this.oO.link=t,this.onRL(),this.eU()},t.prototype.getLink=function(){var t=this.oL;return t||((t=this.GetLink())||(t=this.defOpt().link),t=t||{arrow:"rgb(192,192,192)",color:"rgba(0,0,0,0.25)"},this.oL=t),t},t.prototype.GetLinka=function(){return this.oO.linka},t.prototype.SetLinka=function(t){this.bU(),this.oLinka=null,this.oO.linka=t,this.onRL(),this.eU()},t.prototype.getLinka=function(){var t=this.oLinka;return i(t)&&(i(t=this.GetLinka())&&(t=this.defOpt().linka),t=t||{style:[2],color:"rgba(0,0,0,0.25)",arrow:"rgb(192,192,192)"},this.oLinka=t),t},t.prototype.GetLinkg=function(){return this.oO.linkg},t.prototype.SetLinkg=function(t){this.bU(),this.oLinkg=null,this.oO.linkg=t,this.onRL(),this.eU()},t.prototype.getLinkg=function(){var t=this.oLinkg;return i(t)&&(i(t=this.GetLinkg())&&(t=this.defOpt().linkg),t=t||{type:3,style:[2],color:"rgba(0,0,0,0.125)",arrow:"rgb(224,224,224)"},this.oLinkg=t),t},t.prototype.linkAttr=function(t){var e=this.getLink();switch(t){case 2:e=this.getLinka()||e;break;case 4:e=this.getLinkg()||e}return e},t.prototype.GetNodes=function(){return this.oO.nodes=this.oR.GetNodes()},t.prototype.SetNodes=function(t){this.bU(),this.oO.nodes=t,this.oR.SetNodes(t),this.updSPR(),this.onRL(),this.eU()},t.prototype.getObjectTypes=function(t){var i=null;if(e(t))if(e(t.expandType))i="expand";else switch(i="node",t.getType()){case 2:i+=",nodea";break;case 4:i+=",nodeg"}return i},t.prototype.getCursor=function(t){var o,s,r;if(this.isSelectable())if(!n.H.lA&&this.p2A(t))o=n.GP.Get("anchor",this.getCursors());else if(s=this.p2O(t))if(r=s.node||s,e(s.expandType))o=n.GP.Get("expand",r.getCursors());else if(!this.isReadOnly()&&(o=r.GetCursor(),i(o))){var h=r.getCursors();if(this.isSelected(r)&&(o=n.GP.Get("select",h)),i(o))for(var l=this.getObjectTypes(s).split(","),a=l.length-1;i(o)&&a>=0;a--)o=n.GP.Get(l[a],h)}return o},t.prototype.getShape=function(t){var i=null;if(e(t))if(n.IsS(t))i=n.S.GetOf(t.toString(),this.getShapes(),"OrgChart");else{var o=t.node||t;if(e(t.expandType))i=n.S.GetOf("expand",o.getShapes(),"OrgChart");else{var s=o.GetShape();i=e(s)?n.S.Get(s,"OrgChart"):n.S.GetOf(this.getObjectTypes(t),o.getShapes(),"OrgChart")}}return i},t.prototype.toShape=function(t,e){var i=this.getShape(t),o=i&&i.normal||i;return o&&e&&i&&i.disabled&&(o=n.Inh(i.disabled,o)),o},t.prototype.Unshuffle=function(){this.Shuffle(0)},t.prototype.Shuffle=function(t){var o=this.getVO();if(e(o)){i(o.original)&&(o.original=o.copy());var n=o.original;(t=e(t)?t:.5)&&(n=o.copy().shuffle(t)),o.morph(n,{inv:this.invAO,thisArg:this,duration:this.getSmooth(),name:"shuffle",transition:"ease"})}},t.prototype.GetScrollBarsRoot=function(){return this.oO.scrollBarsRoot},t.prototype.SetScrollBarsRoot=function(t){this.bU(),this.oO.scrollBarsRoot=t,this.eU()},t.prototype.getScrollBarsRoot=function(){var t=this.GetScrollBarsRoot();return void 0===t&&(t="black"),t||null},t.prototype.GetAllowActions=function(){return this.oO.allowActions},t.prototype.SetAllowActions=function(t){this.bU(),this.oAA=null,this.oO.allowActions=t,this.eU()},t.prototype.gAA=function(){return this.oAA||(this.oAA=new n.AA(this.opt("allowActions",this.oT.defAA()),this.isReadOnly()?this.oT.roAA():"")),this.oAA},Node=function(t,e,i){this.oCV=t,this.oM=null,this.oO=n.Cpy(f),this.nType=i||1,this.oP=e||null,this.rgCld=null,this.rgAst=null,this.rgGrp=null,this.expGps=null,this.idAOH={},this.idAOC={},this.add()},Node.prototype.ownCol=function(t){var i=null;if(e(this.oP))switch(this.nType){case 2:i=this.oP.rgAst,t&&!i&&(this.oP.rgAst=i=new n.Arr);break;case 4:i=this.oP.rgGrp,t&&!i&&(this.oP.rgGrp=i=new n.Arr);break;default:i=this.oP.rgCld,t&&!i&&(this.oP.rgCld=i=new n.Arr)}return i},Node.prototype.resOwnCol=function(){if(e(this.oP))switch(this.nType){case 2:e(this.oP.rgAst)&&(this.oP.rgAst.len()||(this.oP.rgAst=null));break;case 4:e(this.oP.rgGrp)&&(this.oP.rgGrp.len()||(this.oP.rgGrp=null));break;default:e(this.oP.rgCld)&&(this.oP.rgCld.len()||(this.oP.rgCld=null))}},Node.prototype.add=function(){e(this.oP)&&this.ownCol(!0).add(this)},Node.prototype.AddChild=function(t){var e=null;return this.bU(),(e=new Node(this.oCV,this,1)).SetOptions(t),this.oCV.onAdd(e),this.eU(),e},Node.prototype.AddAssistant=function(t){var e=null;return this.bU(),(e=new Node(this.oCV,this,2)).SetOptions(t),this.oCV.onAdd(e),this.eU(),e},Node.prototype.AddGroup=function(t){var e=null;return this.bU(),(e=new Node(this.oCV,this,4)).SetOptions(t),this.oCV.onAdd(e),this.eU(),e},Node.prototype.Remove=function(){this.bU(),this.Clear();var t=this.ownCol();e(t)&&(t.remove(this),this.resOwnCol()),this.oP&&this.oCV.onRemove(this),this.onRL(),this.eU()},Node.prototype.ClearChild=function(){if(e(this.rgCld)){this.bU();var t=this.rgCld.byO().slice();this.rgCld.clear(),this.rgCld=null,t.forEach(function(t){t.Remove()}),this.eU()}},Node.prototype.ClearAssistant=function(){if(e(this.rgAst)){this.bU();var t=this.rgAst.byO().slice();this.rgAst.clear(),this.rgAst=null,t.forEach(function(t){t.Remove()}),this.eU()}},Node.prototype.ClearGroup=function(){if(e(this.rgGrp)){this.bU();var t=this.rgGrp.byO().slice();this.rgGrp.clear(),this.rgGrp=null,t.forEach(function(t){t.Remove()}),this.eU()}},Node.prototype.Clear=function(){this.bU(),this.ClearChild(),this.ClearAssistant(),this.ClearGroup(),this.eU()},Node.prototype.Item=function(t){return this.oCV.Node(t,this)},Node.prototype.bU=function(){this.oCV.bU()},Node.prototype.eU=function(){this.oCV.eU()},Node.prototype.onRL=function(){this.oCV.onRL()},Node.prototype.onUpdateKey=function(){this.oCV.onUpdateKey(this)},Node.prototype.toString=function(){return this.getKey()},Node.prototype.dscn=function(t){var o=new n.Arr;if(0!=t){i(t)?o.add(this):(4&t&&e(this.rgGrp)&&o.push(this.rgGrp),2&t&&e(this.rgAst)&&o.push(this.rgAst),1&t&&e(this.rgCld)&&o.push(this.rgCld));for(var s=0;s"+n+":",s.forEach(function(e){i+="\n",i+=e.Debug(t+"\t")}))}}),i},Node.prototype.mF=function(){var t=this.oCV.rgFN;return!t||t.has(this)},Node.prototype.hasChild=function(){return!(!e(this.rgCld)||!this.shows(1))},Node.prototype.getVisibleChild=function(){var t=null;return this.hasChild()&&this.isExpanded(1)&&this.rgCld.forEach(function(e){e.getVisible()&&e.mF()&&(t=t||[]).push(e)}),t},Node.prototype.hasVisibleChild=function(){var t=null;return this.hasChild()&&this.rgCld.forEachU(function(i){return i.getVisible()&&i.mF()&&(t=i),e(t)}),t},Node.prototype.hasAssistant=function(){return!(!e(this.rgAst)||!this.shows(2))},Node.prototype.getVisibleAssistant=function(){var t=null;return this.hasAssistant()&&this.isExpanded(2)&&this.rgAst.forEach(function(e){e.getVisible()&&e.mF()&&(t=t||[]).push(e)}),t},Node.prototype.hasVisibleAssistant=function(){var t=null;return this.hasAssistant()&&this.rgAst.forEachU(function(i){return i.getVisible()&&i.mF()&&(t=i),e(t)}),t},Node.prototype.hasGroup=function(){return!(!e(this.rgGrp)||!this.shows(4))},Node.prototype.getVisibleGroup=function(){var t=null;return this.hasGroup()&&this.isExpanded(4)&&this.rgGrp.forEach(function(e){e.getVisible()&&e.mF()&&(t=t||[]).push(e)}),t},Node.prototype.hasVisibleGroup=function(){var t=null;return this.hasGroup()&&this.rgGrp.forEachU(function(i){return i.getVisible()&&i.mF()&&(t=i),e(t)}),t},Node.prototype.hasVisibleDescendant=function(t){var e=null;return 0!=t&&(i(e)&&(i(t)||2&t)&&(e=this.hasVisibleAssistant()),i(e)&&(i(t)||1&t)&&(e=this.hasVisibleChild()),i(e)&&(i(t)||4&t)&&(e=this.hasVisibleGroup())),e},Node.prototype.getVisibleDescendant=function(t){var o=null;if(0!=t){if(i(t)||2&t){var n=this.getVisibleAssistant();e(n)&&(o=o||[]).push.apply(o,n)}if(i(t)||1&t){var s=this.getVisibleChild();e(s)&&(o=o||[]).push.apply(o,s)}if(i(t)||4&t){var r=this.getVisibleGroup();e(r)&&(o=o||[]).push.apply(o,r)}}return o},Node.prototype.getExpandGlyph=function(t){this.expGps=this.expGps||{child:{node:this,expandType:1}};var e=this.expGps.child;if(i(t)||"null"==t)this.expGps.single=this.expGps.single||{node:this,expandType:-1},e=this.expGps.single;else switch(~~t){case 2:this.expGps.assistant=this.expGps.assistant||{node:this,expandType:2},e=this.expGps.assistant;break;case 4:this.expGps.group=this.expGps.group||{node:this,expandType:4},e=this.expGps.group}return e},Node.prototype.GetPad=function(){return this.oO.pad},Node.prototype.SetPad=function(t){this.bU(),this.oO.pad=t,this.onRL(),this.eU()},Node.prototype.getPad=function(){var t=this.GetPad();return e(t)?n.pad2A(t):this.oCV.getPad()},Node.prototype.GetFormatText=function(){return this.oO.formatText},Node.prototype.SetFormatText=function(t){this.bU(),this.oO.formatText=t,this.onRL(),this.eU()},Node.prototype.getFormatText=function(){var t=this.GetFormatText();return e(t)?~~t:this.oCV.getFormatText()},Node.prototype.GetSize=function(){return this.oO.size},Node.prototype.SetSize=function(t){this.bU(),this.oO.size=t,this.onRL(),this.eU()},Node.prototype.getSize=function(){var t=this.GetSize();return void 0!==t?t:this.oCV.getSize()},Node.prototype.GetImageAlign=function(){return this.oO.imageAlign},Node.prototype.SetImageAlign=function(t){this.bU(),this.oO.imageAlign=t,this.onRL(),this.eU()},Node.prototype.getImageAlign=function(){var t=this.GetImageAlign();return e(t)?n.ToI(t,0):this.oCV.getImageAlign()},Node.prototype.GetImageSize=function(){return this.oO.imageSize},Node.prototype.SetImageSize=function(t){this.bU(),this.oO.imageSize=t,this.onRL(),this.eU()},Node.prototype.getImageSize=function(){var t=this.GetImageSize();return void 0!==t?t:this.oCV.getImageSize()},Node.prototype.gCnt=function(t,i){var o=this.getPad(),s=n.HP.Measure(this.getImage(),this.getImageSize(),t),r=n.PRt(i.slice(),o,-1),h=null;if(e(s)){var l=r.slice();switch(this.getImageAlign()){case 3:(h=r.slice())[1]=n.BOf(r)-s.height,h[3]=s.height,h[0]+=(h[2]-s.width)/2,h[2]=s.width,r[3]-=s.height+o[1];break;case 2:(h=r.slice())[3]=s.height,h[0]+=(h[2]-s.width)/2,h[2]=s.width,r[1]+=s.height+o[1],r[3]-=s.height+o[1];break;case 1:(h=r.slice())[0]=n.ROf(r)-s.width,h[2]=s.width,h[1]+=(h[3]-s.height)/2,h[3]=s.height,r[2]-=s.width+o[0];break;default:(h=r.slice())[2]=s.width,h[1]+=(h[3]-s.height)/2,h[3]=s.height,r[0]+=s.width+o[0],r[2]-=s.width+o[0]}h=n.NRt(h,l)}return{rtCaption:r,rtImage:h}},Node.prototype.getContentSize=function(t){var i,o,s={width:0,height:0},r=!this.isEnabled(),h=this.getPad(),a=this.oCV.getShape(this)||{},u=a.normal||a;return r&&n.H.lA++,i=n.H.Measure(t,this.getCaption(),this.getSize(),this.getFormatText(),u.tfi&&n.ToTFI(u.tfi)),o=n.HP.Measure(this.getImage(),this.getImageSize(),t),e(i)&&(s.width+=i.width+1,s.height+=i.height+1),e(o)&&(this.getImageAlign()>=2?(s.width=l(s.width,o.width),s.height&&(s.height+=h[1]),s.height+=o.height):(s.height=l(s.height,o.height),s.width&&(s.width+=h[0]),s.width+=o.width)),s.width+=h[0]<<1,s.height+=h[1]<<1,r&&--n.H.lA,s},Node.prototype.GetShapes=function(){return this.oO.shapes},Node.prototype.SetShapes=function(t){this.bU(),this.oO.shapes=t,this.onRL(),this.eU()},Node.prototype.getShapes=function(){var t=this.GetShapes();return e(t)?t:e(this.oP)?this.oP.getShapes():this.oCV.getShapes()},Node.prototype.GetShape=function(){return this.oO.shape},Node.prototype.SetShape=function(t){this.bU(),this.oO.shape=n.S.A2S(t),this.onRL(),this.eU()},Node.prototype.GetCursors=function(){return this.oO.cursors},Node.prototype.SetCursors=function(t){this.bU(),this.oO.cursors=t,this.onRL(),this.eU()},Node.prototype.getCursors=function(){var t=this.GetCursors();return e(t)?t:e(this.oP)?this.oP.getCursors():this.oCV.getCursors()},Node.prototype.GetCursor=function(){return this.oO.cursor},Node.prototype.SetCursor=function(t){this.bU(),this.oO.cursor=t,this.onRL(),this.eU()},Node.prototype.GetEnabled=function(){return this.oO.enabled},Node.prototype.SetEnabled=function(t){this.bU(),this.oO.enabled=t,this.onRL(),this.eU()},Node.prototype.getEnabled=function(){return!!this.GetEnabled()},Node.prototype.isEnabled=function(){return!!this.getEnabled()&&(!e(this.oP)||this.oP.isEnabled())},Node.prototype.GetSelectable=function(){return this.oO.selectable},Node.prototype.SetSelectable=function(t){this.bU(),this.oO.selectable=t,this.eU()},Node.prototype.getSelectable=function(){return i(this.GetSelectable())||this.GetSelectable()},Node.prototype.isSelectable=function(){return this.getSelectable()},Node.prototype.GetLink=function(){return this.oO.link},Node.prototype.SetLink=function(t){this.bU(),this.oO.link=t,this.onRL(),this.eU()},Node.prototype.GetLinka=function(){return this.oO.linka},Node.prototype.SetLinka=function(t){this.bU(),this.oO.linka=t,this.onRL(),this.eU()},Node.prototype.GetLinkg=function(){return this.oO.linkg},Node.prototype.SetLinkg=function(t){this.bU(),this.oO.linkg=t,this.onRL(),this.eU()},Node.prototype.linkAttr=function(t){var i=this.GetLink();switch(t){case 2:i=this.GetLinka()||i;break;case 4:i=this.GetLinkg()||i}return e(i)?i:(this.oP||this.oCV).linkAttr(t)},Node.prototype.GetNodes=function(){function t(i){var o=n.B.quoteC(i.getCaption());o+=n.B.quoteF(function(t){function i(t,e){(o=o||new Map).set(t,e||null)}var o=null;switch(t.nType){case 2:i("a");break;case 4:i("g")}var n=t.GetFlow();e(n)&&i(p.Flows.get(n)||n),t.GetExpandType(1)||i("c"),t.GetExpandType(2)||i("ca"),t.GetExpandType(4)||i("cg");var s=t.GetImage();e(s)&&i("img",s);var r=t.GetShape();e(r)&&i("shape",r);var h=t.GetCursor();e(h)&&i("cursor",h),t.GetEnabled()||i("dis"),t.GetSelectable()||i("nsel");var l=t.GetKey();return e(l)&&i("id",l),o}(i));var s=[];return[i.rgCld,i.rgAst,i.rgGrp].forEach(function(i){e(i)&&i.forEach(function(e){s.push(t(e))})}),o+=n.B.quoteS(s,s.length)}return t(this)},Node.prototype.SetNodes=function(t){function i(t,o,s){n.B.split(o).forEach(function(o){function r(t){var e=null;if(f)if(n.IsA(t))for(var i=t.length,o=0;!e&&o1;o&&s0)switch(e){case 1:case 2:t[3]+=i;break;case 3:case 4:t[2]+=i}return t},p.deflateExpandGlyphs=function(t,e,i){if(e&&i>0)switch(e){case 1:t[1]-=i,t[3]=i;break;case 2:t[1]=n.BOf(t),t[3]=i;break;case 3:t[0]-=i,t[2]=i;break;case 4:t[0]=n.ROf(t),t[2]=i}return t},p.FlowEnum={exFlowVertical:"flowVertical",exFlowHorizontal:"flowHorizontal",exFlowVerticalTree:"flowVerticalTree",exFlowHorizontalTree:"flowHorizontalTree"},p.getFlows=function(){var t=p.FlowEnum,e=new n.BiM;return e.set(t.exFlowVertical,"vert"),e.set(t.exFlowHorizontal,"horz"),e.set(t.exFlowVerticalTree,"tree"),e.set(t.exFlowHorizontalTree,"htree"),e},p.Flows=p.getFlows(),p.flowVertical={initAssistant:function(t,e){return{x:n.LOf(t),y:n.BOf(t)+e.y}},nextAssistant:function(t,e,i){t.x+=e[2]+i.x},initChild:function(t,e){return{x:n.LOf(t),y:n.BOf(t)+e.y}},nextChild:function(t,e,i){t.x+=e[2]+i.x},initGroup:function(t,e){return{x:n.ROf(t)+e.x,y:n.TOf(t)}},nextGroup:function(t,e,i){t.x+=e[2]+i.x},alignDir:function(){return 0},alignOffset:function(t,e,i){if(t){var o=1;switch(t){case n.AlignEnum.exAlignCenter:case n.AlignEnum.exAlignVCenter:o=2}return i[0]+(i[2]-e[2])/o-e[0]}return 0},anchorExpandGlyphs:function(t){switch(t){case 2:return 3;case 4:return 4}return 2},linkcSE:function(t){return{cS:4==t?18:66,cE:18}}},p.flowHorizontal={initAssistant:function(t,e){return{x:n.ROf(t)+e.x,y:n.TOf(t)}},nextAssistant:function(t,e,i){t.y+=e[3]+i.y},initChild:function(t,e){return{x:n.ROf(t)+e.x,y:n.TOf(t)}},nextChild:function(t,e,i){t.y+=e[3]+i.y},initGroup:function(t,e){return{x:n.LOf(t),y:n.BOf(t)+e.y}},nextGroup:function(t,e,i){t.y+=e[3]+i.y},alignDir:function(){return 1},alignOffset:function(t,e,i){if(t){var o=1;switch(t){case n.AlignEnum.exAlignCenter:case n.AlignEnum.exAlignVCenter:o=2}return i[1]+(i[3]-e[3])/o-e[1]}return 0},anchorExpandGlyphs:function(t){switch(t){case 2:return 3;case 4:return 2}return 4},linkcSE:function(t){return{cS:4==t?33:36,cE:33}}},p.flowVerticalTree={initAssistant:function(t,e){return{x:n.LOf(t)+e.indent,y:n.BOf(t)+e.y}},nextAssistant:function(t,e,i){t.y+=e[3]+i.x},initChild:function(t,e){return{x:n.LOf(t)+e.indent,y:n.BOf(t)+e.y}},nextChild:function(t,e,i){t.y+=e[3]+i.y},initGroup:function(t,e){return{x:n.ROf(t)+e.x,y:n.TOf(t)}},nextGroup:function(t,e,i){t.x+=e[2]+i.x},alignDir:function(){return 0},alignOffset:function(t,e,i){return 0},anchorExpandGlyphs:function(t){switch(t){case 2:return 3;case 4:return 4}return 2},linkcSE:function(t){return{cS:4==t?18:66,cE:4==t?18:33}}},p.flowHorizontalTree={initAssistant:function(t,e){return{x:n.ROf(t)+e.x,y:n.TOf(t)+e.indent}},nextAssistant:function(t,e,i){t.x+=e[2]+i.x},initChild:function(t,e){return{x:n.ROf(t)+e.x,y:n.TOf(t)+e.indent}},nextChild:function(t,e,i){t.x+=e[2]+i.x},initGroup:function(t,e){return{x:n.LOf(t),y:n.BOf(t)+e.y}},nextGroup:function(t,e,i){t.y+=e[3]+i.y},alignDir:function(){return 1},alignOffset:function(t,e,i){return 0},anchorExpandGlyphs:function(t){switch(t){case 2:return 3;case 4:return 2}return 4},linkcSE:function(t){return{cS:4==t?33:36,cE:4==t?33:18}}},p.prototype.doL=function(){function t(t,i,o,n){var s=t.unionOf(n);if(e(s)){var r=d.alignOffset(i,o,s);if(r){var h=n[0],l=d.alignDir();t.rgVO.forEachU(function(t,e){if(e==h)return!0;t[l]+=r},t)}}}var o=this.oN,n=o.oCV,s=n.gCtx(),h=n.getExpandGlyphSize(),l=o.getContentSize(s),a=[0,0,l.width,l.height],u=a.slice(),c=o.getAlign(),f=o.getMargins(),d=o.getFlow();if(i(o.oP)&&(n.rgFN=n.getFilterNodes()),this.rgVO.push(o,a),o.getVisible()){var g=null;if(h>0){var y=!1,S=!1,v=[null];if(o.getSingleExpandGlyphs()||(v=[2,1,4]),v.forEach(function(t){if(o.showsExpandGlyphs(t)){var e=d.anchorExpandGlyphs(t);e&&((g=g||{})[t]=e,y=y||e>=3,S=S||e<3)}}),e(g)){if(y){var C=h-f.x;C>0&&p.inflateExpandGlyphs(u,4,C)}if(S){var O=h-f.y;O>0&&p.inflateExpandGlyphs(u,2,O)}}}var x=o.getVisibleAssistant();if(e(x)){var G=d.initAssistant(u,f),E=[];x.forEach(function(t){var e=new p(t);e.offset(G.x,G.y),this.add(e),d.nextAssistant(G,e.union(),f),E.push(t)},this),t(this,c,a,E),u=this.union()}var A=o.getVisibleChild();if(e(A)){var G=d.initChild(u,f),E=[];A.forEach(function(t){var e=new p(t);e.offset(G.x,G.y),this.add(e),d.nextChild(G,e.union(),f),E.push(t)},this),t(this,c,a,E),u=this.union()}var b=o.getVisibleGroup();if(e(b)){G=d.initGroup(u,f);b.forEach(function(t){var e=new p(t);e.offset(G.x,G.y),this.add(e),d.nextGroup(G,e.union(),f)},this)}if(e(g))for(var m in g){var R=a.slice();p.deflateExpandGlyphs(R,g[m],h),R[0]+=(R[2]-h)/2,R[2]=h,R[1]+=(R[3]-h)/2,R[3]=h,this.rgVO.push(o.getExpandGlyph(m),R)}}return i(o.oP)&&(n.rgFN=null),this.rgVO.forEach(function(t){for(var e=0,i=t.length;e