this._canOrientTabs=!0,this._events={},this._root=null,this._frameList=[],this._floatingList=[],this._modalList=[],this._persistentList=[],this._focusFrame=null,this._placeholderPanel=null,this._contextTimer=0,this._dirty=!1,this._dirtyDontMove=!1,this._splitterList=[],this._tabList=[],this._collapser={},this._dockPanelTypeList=[],this._creatingPanel=!1,this._draggingSplitter=null,this._draggingFrame=null,this._draggingFrameSizer=null,this._draggingFrameTab=null,this._draggingFrameTopper=!1,this._draggingCustomTabFrame=null,this._ghost=null,this._menuTimer=0,this._mouseOrigin={x:0,y:0},this._resizeData={time:-1,timeout:!1,delta:150};vara={themePath:"Themes",theme:"default",loadingClass:"fa fa-spinner fa-pulse",allowContextMenu:!0,hideOnResize:!1,allowCollapse:!0,responseRate:10,moveStartDelay:300,edgeAnchorSize:50,panelAnchorSize:"15%",detachToWidth:"50%",detachToHeight:"50%"};this._options={};for(varrinf)a[r+"Class"]=f[r];for(varrina)this._options[r]=a[r];for(varrine)this._options[r]=e[r];this.__init()},themePath:function(t){returnvoid0!==t&&(this._options.themePath=t),this._options.themePath},theme:function(t){if(void0!==t){vare=$("#wcTheme"),a=(newDate).getTime(),r=t.indexOf(".css");r>-1&&(t=t.substring(0,r));varo=$('<link id="wcTheme" rel="stylesheet" type="text/css" href="'+this._options.themePath+"/"+t+".css?v="+a+'"/>');this._options.theme=t;vari=this;o[0].onload=function(){e.remove(),i.__update()},$("head").append(o)}returnthis._options.theme},isCollapseEnabled:function(){returnthis._canOrientTabs&&this._options.allowCollapse},registerPanelType:function(t,e,a){varr=e;"function"==typeofr&&(r={onCreate:e},console.log("WARNING: Passing in the creation function directly to wcDocker.registerPanelType parameter 2 is now deprecated and will be removed in the next version! Please use the preferred options object instead.")),"undefined"!=typeofa&&(r.isPrivate=a,console.log("WARNING: Passing in the isPrivate flag to wcDocker.registerPanelType parameter 3 is now deprecated and will be removed in the next version! Please use the preferred options object instead.")),$.isEmptyObject(r)&&(r=null);for(varo=0;o<this._dockPanelTypeList.length;++o)if(this._dockPanelTypeList[o].name===t)return!1;this._dockPanelTypeList.push({name:t,options:r});vari=$("menu").find("menu");returni.append($('<menuitem label="'+t+'">')),!0},panelTypes:function(t){for(vare=[],a=0;a<this._dockPanelTypeList.length;++a)(t||!this._dockPanelTypeList[a].options.isPrivate)&&e.push(this._dockPanelTypeList[a].name);returne},panelTypeInfo:function(t){for(vare=0;e<this._dockPanelTypeList.length;++e)if(this._dockPanelTypeList[e].name==t)returnthis._dockPanelTypeList[e].options;return!1},addPanel:function(t,a,r,o){functioni(t){a===e.DOCK.STACKED?this.__addPanelGrouped(t,r,o):this.__addPanelAlone(t,a,r,o),this._placeholderPanel&&t.moveable()&&a!==e.DOCK.FLOAT&&a!==e.DOCK.MODAL&&this.removePanel(this._placeholderPanel)&&(this._placeholderPanel=null),this.__forceUpdate()}for(varn=0;n<this._persistentList.length;++n)if(this._persistentList[n]._type===t){vars=this._persistentList.splice(n,1)[0];returni.call(this,s),s.__trigger(e.EVENT.PERSISTENT_OPENED),s}for(varl=0;l<this._dockPanelTypeList.length;++l)if(this._dockPanelTypeList[l].name===t){varc=this._dockPanelTypeList[l],s=new(this.__getClass("wcPanel"))(this,t,c.options);s.__container(this.$transition);varh=c.options&&c.options.options||{};returns._panelObject=newc.options.onCreate(s,h),i.call(this,s),s}return!1},removePanel:function(t,a){if(!t)return!1;varr=this.__isLastPanel(t),o=t._parent;if(o&&o.instanceOf("wcFrame")){for(vari=t.__trigger(e.EVENT.CLOSING),n=0;n<i.length;++n)if(!i[n])return!1;if(a?(t.__container(this.$transition),t._parent=null):t.__trigger(e.EVENT.CLOSED),!o.removePanel(t)&&!o.isCollapser()){if(r)returnthis.__addPlaceholder(o),a?t.__trigger(e.EVENT.PERSISTENT_CLOSED):t.__destroy(),!0;vars=this._floatingList.indexOf(o);-1!==s&&this._floatingList.splice(s,1),s=this._frameList.indexOf(o),-1!==s&&this._frameList.splice(s,1),s=this._modalList.indexOf(o),-1!==
this._focusFrame&&(this._focusFrame._isFloating&&(this._focusFrame.$frame.addClass("wcFloatingFocus"),r&&$("body").append(this._focusFrame.$frame)),this._focusFrame.__focus(a),this._focusFrame.__trigger(e.EVENT.GAIN_FOCUS)),this.__orderPanels()},__trigger:function(t,e){if(t){vara=[];if(this._events[t])for(varr=this._events[t].slice(0),o=0;o<r.length;++o)a.push(r[o].call(this,e));returna}},__isLastPanel:function(t){for(vare=0;e<this._frameList.length;++e){vara=this._frameList[e];if(!a._isFloating&&!a.isCollapser())for(varr=0;r<a._panelList.length;++r){varo=a._panelList[r];if(o!==t&&o.moveable())return!1}}return!0},__isLastFrame:function(t){for(vare=0;e<this._frameList.length;++e){vara=this._frameList[e];if(!a._isFloating&&a!==t&&!a.isCollapser())for(varr=0;r<a._panelList.length;++r){varo=a._panelList[r];if(o.moveable())return!1}}return!0},__create:function(t,a,r){switch(t.type){case"wcSplitter":varo=new(this.__getClass("wcSplitter"))(r,a,t.horizontal);returno.scrollable(0,!1,!1),o.scrollable(1,!1,!1),o;case"wcFrame":vari=new(this.__getClass("wcFrame"))(r,a,t.floating);returnthis._frameList.push(i),t.floating&&this._floatingList.push(i),i;case"wcPanel":if(t.panelType===e.PANEL_PLACEHOLDER)returnthis._placeholderPanel||(this._placeholderPanel=new(this.__getClass("wcPanel"))(a,e.PANEL_PLACEHOLDER,{}),this._placeholderPanel._isPlaceholder=!0,this._placeholderPanel.__container(this.$transition),this._placeholderPanel._panelObject=newfunction(t){t.title(!1),t.closeable(!1)}(this._placeholderPanel),this._placeholderPanel.__container(r)),this._placeholderPanel;for(varn=0;n<this._dockPanelTypeList.length;++n)if(this._dockPanelTypeList[n].name===t.panelType){vars=new(this.__getClass("wcPanel"))(a,t.panelType,this._dockPanelTypeList[n].options);s.__container(this.$transition);varl=this._dockPanelTypeList[n].options&&this._dockPanelTypeList[n].options.options||{};s._panelObject=newthis._dockPanelTypeList[n].options.onCreate(s,l),s.__container(r);break}returns}returnnull},__addPanelGrouped:function(t,a,r){varo=a;returno&&o.instanceOf("wcPanel")&&(o=a._parent),o&&o.instanceOf("wcFrame")?(r&&r.tabOrientation&&o.tabOrientation(r.tabOrientation),voido.addPanel(t)):voidthis.__addPanelAlone(t,e.DOCK.LEFT,a,r)},__addPanelAlone:function(t,a,r,o){if(r&&r._shift){vari=r;r=r._shift,i._shift=void0}if(o){varn=this.$container.width(),s=this.$container.height();o.hasOwnProperty("x")&&(o.x=this.__stringToPixel(o.x,n)),o.hasOwnProperty("y")&&(o.y=this.__stringToPixel(o.y,s)),o.hasOwnProperty("w")||(o.w=t.initSize().x),o.hasOwnProperty("h")||(o.h=t.initSize().y),o.w=this.__stringToPixel(o.w,n),o.h=this.__stringToPixel(o.h,s),t._size.x=o.w,t._size.y=o.h}if(r===e.COLLAPSED){if(this.__initCollapsers(),this._collapser[a]){r=this._collapser[a]._drawer._frame.addPanel(t);varl=this;returnsetTimeout(function(){l.__update()}),t}returnconsole.log('ERROR: Attempted to collapse panel "'+t._type+'" to invalid location: '+a),!1}if(a===e.DOCK.FLOAT||a===e.DOCK.MODAL){varc=new(this.__getClass("wcFrame"))(this.$container,this,!0);if(o&&o.tabOrientation&&c.tabOrientation(o.tabOrientation),this._frameList.push(c),this._floatingList.push(c),this.__focus(c),c.addPanel(t),c.pos(t._pos.x,t._pos.y,!1),a===e.DOCK.MODAL&&(c.$modalBlocker=$('<div class="wcModalBlocker"></div>'),c.$frame.prepend(c.$modalBlocker),t.moveable(!1),c.$frame.addClass("wcModal"),this._modalList.push(c)),o){varh=c.pos(void0,void0,!0);o.hasOwnProperty("x")&&(h.x=o.x+o.w/2),o.hasOwnProperty("y")&&(h.y=o.y+o.h/2),c.pos(h.x,h.y,!0),c._size={x:o.w,y:o.h}}returnvoidthis.__orderPanels()}if(r){for(varu=r._parent,d=r;u&&!u.instanceOf("wcSplitter")&&!u.instanceOf("wcDocker");)d=u,u=u._parent;if(u&&u.instanceOf("wcSplitter")){varf,p=u.pane(0),b=(u.pane(1),{x:-1,y:-1});if(p===d?(f=new(this.__getClass("wcSplitter"))(this.$transition,u,a!==e.DOCK.BOTTOM&&a!==e.DOCK.TOP),b.x=u.$pane[0].width(),b.y=u.$pane[0].height(),u.pane(0,f)):(f=new(this.__getClass("wcSplitter"))(this.$transition,u,a!==e.DOCK.BOTTOM&&a!==e.DOCK.TOP),b.x=u.$pane[1].width(),b.y=u.$pane[1].height(),u.pane(1,f)
info:"The ghost border radius",create:this.addPixelControl,attribute:"border-radius",value:"0px",mobileValue:"0px"}]},{name:"Frames",scrollable:!0,create:this.addTab,controls:[{name:"Floating Frames",create:this.addSpacer},{selector:".wcFrameEdge",elem:'<div class="wcFrameEdge"></div>',name:"Edge Color",info:"The color of a floating frame",create:this.addColorControl,attribute:"background-color",value:""},{selector:".wcFrameEdge",elem:'<div class="wcFrameEdge"></div>',name:"Edge Border Color",info:"The border color of a floating frame",create:this.addColorControl,attribute:"border-color",value:""},{selector:".wcFrameEdge",attribute:"border-width",value:"2"},{selector:".wcFrameEdge",attribute:"border-style",value:"solid"},{name:"",create:this.addSpacer},{name:"Splitter Frames",create:this.addSpacer},{create:this.addTabFrame,controls:[{name:"Moveable Splitter",create:this.addTab,controls:[{name:"Moveable Splitter",create:this.addSpacer},{selector:".wcSplitterBar.wcSplitterBarV:not(.wcSplitterBarStatic)",elem:'<div class="wcSplitterBar wcSplitterBarV"></div>',name:"Size",info:"The size of a splitter bar",create:this.addPixelControl,attribute:"width",value:"",also:[{selector:".wcSplitterBar.wcSplitterBarH:not(.wcSplitterBarStatic)",attribute:"height"}]},{selector:".wcSplitterBar.wcSplitterBarV:not(.wcSplitterBarStatic), .wcSplitterBar.wcSplitterBarH:not(.wcSplitterBarStatic)",elem:'<div class="wcSplitterBar wcSplitterBarV"></div>',name:"Color",info:"The color of a splitter bar",create:this.addColorControl,attribute:"background-color",value:""},{selector:".wcSplitterBar.wcSplitterBarV:not(.wcSplitterBarStatic), .wcSplitterBar.wcSplitterBarH:not(.wcSplitterBarStatic)",elem:'<div class="wcSplitterBar wcSplitterBarV"></div>',name:"Border Style",info:"The border style of a splitter bar",create:this.addListControl(this._borderStyles),attribute:"border-style",value:""},{selector:".wcSplitterBar.wcSplitterBarV:not(.wcSplitterBarStatic), .wcSplitterBar.wcSplitterBarH:not(.wcSplitterBarStatic)",elem:'<div class="wcSplitterBar wcSplitterBarV"></div>',name:"Border Size",info:"The border size of a splitter bar",create:this.addPixelControl,attribute:"border-width",value:"0px",mobileValue:"0px"},{selector:".wcSplitterBar.wcSplitterBarV:not(.wcSplitterBarStatic), .wcSplitterBar.wcSplitterBarH:not(.wcSplitterBarStatic)",elem:'<div class="wcSplitterBar wcSplitterBarV"></div>',name:"Border Color",info:"The border color of a splitter bar",create:this.addColorControl,attribute:"border-color",value:""}]},{name:"Static Splitter",create:this.addTab,controls:[{name:"Static Splitter",create:this.addSpacer},{selector:".wcSplitterBar.wcSplitterBarV.wcSplitterBarStatic",elem:'<div class="wcSplitterBar wcSplitterBarV wcSplitterBarStatic"></div>',name:"Size",info:"The size of a static splitter bar",create:this.addPixelControl,attribute:"width",value:"",also:[{selector:".wcSplitterBar.wcSplitterBarH.wcSplitterBarStatic",attribute:"height"}]},{selector:".wcSplitterBar.wcSplitterBarV.wcSplitterBarStatic, .wcSplitterBar.wcSplitterBarH.wcSplitterBarStatic",elem:'<div class="wcSplitterBar wcSplitterBarV wcSplitterBarStatic"></div>',name:"Color",info:"The color of a static splitter bar",create:this.addColorControl,attribute:"background-color",value:""},{selector:".wcSplitterBar.wcSplitterBarV.wcSplitterBarStatic, .wcSplitterBar.wcSplitterBarH.wcSplitterBarStatic",elem:'<div class="wcSplitterBar wcSplitterBarV wcSplitterBarStatic"></div>',name:"Border Style",info:"The border style of a static splitter bar",create:this.addListControl(this._borderStyles),attribute:"border-style",value:""},{selector:".wcSplitterBar.wcSplitterBarV.wcSplitterBarStatic, .wcSplitterBar.wcSplitterBarH.wcSplitterBarStatic",elem:'<div class="wcSplitterBar wcSplitterBarV wcSplitterBarStatic"></div>',name:"Border Size",info:"The border size of a static splitter bar",create:this.addPixelControl,attribute:"border-width",value:"0px",mobileValue:"0px"},{selector:".wcSplitterBar.wcSplitterBarV.wcSplitterBarStatic, .wcSplitterBar.wcSplitterBarH.wcSplitterBarStatic",elem:'<divclass="wcSplitterBar
name:"Box-Shadow Left Offset",info:"The box shadow horizontal offset from the left (can be negative)",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(1),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcPanelTabActive",elem:'<div class="wcPanelTab wcPanelTabActive"></div>',name:"Box-Shadow Top Offset",info:"The box shadow vertical offset from the top (can be negative)",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(2),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcPanelTabActive",elem:'<div class="wcPanelTab wcPanelTabActive"></div>',name:"Box-Shadow Blur",info:"The box shadow blur",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(3),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcPanelTabActive",elem:'<div class="wcPanelTab wcPanelTabActive"></div>',name:"Box-Shadow Spread",info:"The box shadow spread",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(4),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcPanelTabActive",elem:'<div class="wcPanelTab wcPanelTabActive"></div>',name:"Box-Shadow Color",info:"The box shadow color",create:this.addColorControl,parser:this._parseBoxShadowColor,attribute:"box-shadow",append:!0,grouped:!0,value:""}]},{name:"Tab Active Hover State",create:this.addTab,controls:[{name:"Tab Active Hover State",create:this.addSpacer},{selector:".wcPanelTabActive:hover > div, .wcPanelTabActiveHover > div",elem:'<div class="wcPanelTab"><div></div></div>',name:"Font Top Offset",info:"The font top offset of a tab item",create:this.addPixelControl,attribute:"margin-top",value:""},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Font Size",info:"The font size of a tab item",create:this.addPixelControl,attribute:"font-size",value:""},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Font Weight",info:"The font weight of a tab item",create:this.addListControl(this._fontWeights),attribute:"font-weight",value:""},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Font Padding",info:"The padding between text and tab border",create:this.addPixelControl,attribute:"padding-left,padding-right",value:""},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Font Color",info:"The font color of a tab item",create:this.addColorControl,attribute:"color",value:""},{name:"",create:this.addSpacer},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Top Offset",info:"The top offset of a tab item",create:this.addPixelControl,attribute:"margin-top",value:""},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Height",info:"The height of a tab item",create:this.addPixelControl,attribute:"height",notValue:"0px",value:""},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Spacing",info:"The spacing between tab items",create:this.addPixelControl,attribute:"margin-right",value:""},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Color",info:"The color of a tab item",create:this.addColorControl,attribute:"background-color",value:""},{name:"",create:this.addSpacer},{selector:".wcPanelTabActive:hover, .wcPanelTabActiveHover",elem:'<div class="wcPanelTab wcPanelTabActive wcPanelTabActiveHover"></div>',name:"Border Style",info:"The border style of a tab item",create:this.addListControl(this._b
attribute:"font-weight",value:""},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Font Size",info:"The font size of the control",create:this.addPixelControl,attribute:"font-size",value:""},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Font Color",info:"The font color of the control",create:this.addColorControl,attribute:"color",value:""},{name:"",create:this.addSpacer},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Color",info:"The color of the control",create:this.addColorControl,attribute:"background-color",value:""},{name:"",create:this.addSpacer},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Border Style",info:"The border style of the control",create:this.addListControl(this._borderStyles),attribute:"border-style",value:""},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Border Size",info:"The border size of the control",create:this.addPixelControl,attribute:"border-width",value:"0px",mobileValue:"0px"},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Border Radius",info:"The border radius of the control",create:this.addPixelControl,attribute:"border-radius",value:"0px",mobileValue:"0px"},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Border Color",info:"The border color of the control",create:this.addColorControl,attribute:"border-color",value:""},{name:"",create:this.addSpacer},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Box-Shadow Style",info:"The box shadow style",create:this.addListControl(this._shadowStyle),parser:this._parseBoxShadowStyle,attribute:"box-shadow",value:""},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Box-Shadow Left Offset",info:"The box shadow horizontal offset from the left (can be negative)",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(1),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Box-Shadow Top Offset",info:"The box shadow vertical offset from the top (can be negative)",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(2),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Box-Shadow Blur",info:"The box shadow blur",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(3),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Box-Shadow Spread",info:"The box shadow spread",create:this.addPixelControl,parser:this._parseBoxShadowAttribute(4),attribute:"box-shadow",append:!0,grouped:!0,value:"0px",mobileValue:"0px"},{selector:".wcSelect, select",elem:'<select class="wcSelect"></select>',name:"Box-Shadow Color",info:"The box shadow color",create:this.addColorControl,parser:this._parseBoxShadowColor,attribute:"box-shadow",append:!0,grouped:!0,value:""}]},{name:"Buttons",create:this.addTab,controls:[{name:"Button Controls",create:this.addSpacer},{create:this.addTabFrame,controls:[{name:"Button Normal State",create:this.addTab,controls:[{name:"Button Normal State",create:this.addSpacer},{selector:".wcButton:focus, button:focus",attribute:"outline",value:"0"},{selector:".wcButton, button",elem:'<button class="wcButton"></button>',name:"Font Family",info:"The font family of the control",create:this.addTextControl,attribute:"font-family",value:""},{selector:".wcButton, button",elem:'<button class="wcButton"></button>',name:"Font Weight",info:"The font weight of the control",create:this.addListControl(this._fontWeights),attribute:"font-weight",value:""},{selector:".wcButton, button",elem:'<button class="wcButton"></button>',name:"Font Size",info:"The font size of the control",create:this.addPixelControl,attribute:"font-size",value:""},{selector:".wcButton, button",elem:'<butto