@lumino/widgets
Version:
Lumino Widgets
15 lines (13 loc) • 172 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@lumino/algorithm"),require("@lumino/domutils"),require("@lumino/messaging"),require("@lumino/properties"),require("@lumino/signaling"),require("@lumino/dragdrop"),require("@lumino/coreutils"),require("@lumino/commands"),require("@lumino/virtualdom"),require("@lumino/disposable"),require("@lumino/keyboard")):"function"==typeof define&&define.amd?define(["exports","@lumino/algorithm","@lumino/domutils","@lumino/messaging","@lumino/properties","@lumino/signaling","@lumino/dragdrop","@lumino/coreutils","@lumino/commands","@lumino/virtualdom","@lumino/disposable","@lumino/keyboard"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).lumino_widgets={},e.lumino_algorithm,e.lumino_domutils,e.lumino_messaging,e.lumino_properties,e.lumino_signaling,e.lumino_dragdrop,e.lumino_coreutils,e.lumino_commands,e.lumino_virtualdom,e.lumino_disposable,e.lumino_keyboard)}(this,(function(e,t,i,n,o,r,s,a,d,h,c,l){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function p(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var m=function(){return(m=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var f,g=function(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1};e.BoxEngine=void 0,(f=e.BoxEngine||(e.BoxEngine={})).calc=function(e,t){var i=e.length;if(0===i)return t;for(var n=0,o=0,r=0,s=0,a=0,d=0;d<i;++d){var h=(y=e[d]).minSize,c=y.maxSize,l=y.sizeHint;y.done=!1,y.size=Math.max(h,Math.min(l,c)),r+=y.size,n+=h,o+=c,y.stretch>0&&(s+=y.stretch,a++)}if(t===r)return 0;if(t<=n){for(d=0;d<i;++d)(y=e[d]).size=y.minSize;return t-n}if(t>=o){for(d=0;d<i;++d)(y=e[d]).size=y.maxSize;return t-o}var u=.01,p=i;if(t<r){for(var m=r-t;a>0&&m>u;){var f=m,g=s;for(d=0;d<i;++d)if(!(y=e[d]).done&&0!==y.stretch){var v=y.stretch*f/g;y.size-v<=y.minSize?(m-=y.size-y.minSize,s-=y.stretch,y.size=y.minSize,y.done=!0,p--,a--):(m-=v,y.size-=v)}}for(;p>0&&m>u;)for(v=m/p,d=0;d<i;++d)(y=e[d]).done||(y.size-v<=y.minSize?(m-=y.size-y.minSize,y.size=y.minSize,y.done=!0,p--):(m-=v,y.size-=v))}else{for(m=t-r;a>0&&m>u;)for(f=m,g=s,d=0;d<i;++d)(y=e[d]).done||0===y.stretch||(v=y.stretch*f/g,y.size+v>=y.maxSize?(m-=y.maxSize-y.size,s-=y.stretch,y.size=y.maxSize,y.done=!0,p--,a--):(m-=v,y.size+=v));for(;p>0&&m>u;)for(v=m/p,d=0;d<i;++d){var y;(y=e[d]).done||(y.size+v>=y.maxSize?(m-=y.maxSize-y.size,y.size=y.maxSize,y.done=!0,p--):(m-=v,y.size+=v))}}return 0},f.adjust=function(e,t,i){0!==e.length&&0!==i&&(i>0?function(e,t,i){for(var n=0,o=0;o<=t;++o)n+=(h=e[o]).maxSize-h.size;for(var r=0,s=(o=t+1,e.length);o<s;++o)r+=(h=e[o]).size-h.minSize;var a=i=Math.min(i,n,r);for(o=t;o>=0&&a>0;--o)(c=(h=e[o]).maxSize-h.size)>=a?(h.sizeHint=h.size+a,a=0):(h.sizeHint=h.size+c,a-=c);var d=i;for(o=t+1,s=e.length;o<s&&d>0;++o){var h,c;(c=(h=e[o]).size-h.minSize)>=d?(h.sizeHint=h.size-d,d=0):(h.sizeHint=h.size-c,d-=c)}}(e,t,i):function(e,t,i){for(var n=0,o=t+1,r=e.length;o<r;++o)n+=(h=e[o]).maxSize-h.size;var s=0;for(o=0;o<=t;++o)s+=(h=e[o]).size-h.minSize;var a=i=Math.min(i,n,s);for(o=t+1,r=e.length;o<r&&a>0;++o)(c=(h=e[o]).maxSize-h.size)>=a?(h.sizeHint=h.size+a,a=0):(h.sizeHint=h.size+c,a-=c);var d=i;for(o=t;o>=0&&d>0;--o){var h,c;(c=(h=e[o]).size-h.minSize)>=d?(h.sizeHint=h.size-d,d=0):(h.sizeHint=h.size-c,d-=c)}}(e,t,-i))};var v,y,b=function(){function e(e){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new r.Signal(this),this.owner=e.owner,void 0!==e.label&&(this._label=e.label),void 0!==e.mnemonic&&(this._mnemonic=e.mnemonic),void 0!==e.icon?"string"==typeof e.icon?(this._icon=null,this._iconClass=e.icon):this._icon=e.icon:this._icon=null,void 0!==e.iconClass&&(this._iconClass=e.iconClass),void 0!==e.iconLabel&&(this._iconLabel=e.iconLabel),void 0!==e.iconRenderer&&(this._icon=e.iconRenderer),void 0!==e.caption&&(this._caption=e.caption),void 0!==e.className&&(this._className=e.className),void 0!==e.closable&&(this._closable=e.closable),this._dataset=e.dataset||{}}return Object.defineProperty(e.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"label",{get:function(){return this._label},set:function(e){this._label!==e&&(this._label=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(e){this._mnemonic!==e&&(this._mnemonic=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"icon",{get:function(){return null===this._icon?this.iconClass:this._icon},set:function(e){if("string"==typeof e)this._icon=null,this.iconClass=e;else{if(this._icon===e)return;this._icon=e,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconClass",{get:function(){return this._iconClass},set:function(e){this._iconClass!==e&&(this._iconClass=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(e){this._iconLabel!==e&&(this._iconLabel=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(e){this.icon=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"caption",{get:function(){return this._caption},set:function(e){this._caption!==e&&(this._caption=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"className",{get:function(){return this._className},set:function(e){this._className!==e&&(this._className=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"closable",{get:function(){return this._closable},set:function(e){this._closable!==e&&(this._closable=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return this._dataset},set:function(e){this._dataset!==e&&(this._dataset=e,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),e}();e.Widget=function(){function e(t){void 0===t&&(t={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new r.Signal(this),this._hiddenMode=e.HiddenMode.Display,this.node=v.createNode(t),this.addClass("lm-Widget"),this.addClass("p-Widget")}return e.prototype.dispose=function(){this.isDisposed||(this.setFlag(e.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&e.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),r.Signal.clearData(this),n.MessageLoop.clearData(this),o.AttachedProperty.clearData(this))},Object.defineProperty(e.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isDisposed",{get:function(){return this.testFlag(e.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAttached",{get:function(){return this.testFlag(e.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isHidden",{get:function(){return this.testFlag(e.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isVisible",{get:function(){return this.testFlag(e.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"title",{get:function(){return v.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.node.id},set:function(e){this.node.id=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(t){if(this._hiddenMode!==t){switch(this._hiddenMode=t,t){case e.HiddenMode.Display:this.node.style.willChange="auto";break;case e.HiddenMode.Scale:this.node.style.willChange="transform"}this.isHidden&&(t===e.HiddenMode.Display?(this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden"),this.node.style.transform=""):(this.node.style.transform="scale(0)",this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden")))}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},set:function(t){if(this._parent!==t){if(t&&this.contains(t))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var i=new e.ChildMessage("child-removed",this);n.MessageLoop.sendMessage(this._parent,i)}if(this._parent=t,this._parent&&!this._parent.isDisposed){i=new e.ChildMessage("child-added",this);n.MessageLoop.sendMessage(this._parent,i)}this.isDisposed||n.MessageLoop.sendMessage(this,e.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"layout",{get:function(){return this._layout},set:function(t){if(this._layout!==t){if(this.testFlag(e.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(t.parent)throw new Error("Cannot change layout parent.");this._layout=t,t.parent=this}},enumerable:!0,configurable:!0}),e.prototype.children=function(){return this._layout?this._layout.iter():t.empty()},e.prototype.contains=function(e){for(var t=e;t;t=t._parent)if(t===this)return!0;return!1},e.prototype.hasClass=function(e){return this.node.classList.contains(e)},e.prototype.addClass=function(e){this.node.classList.add(e)},e.prototype.removeClass=function(e){this.node.classList.remove(e)},e.prototype.toggleClass=function(e,t){return!0===t?(this.node.classList.add(e),!0):!1===t?(this.node.classList.remove(e),!1):this.node.classList.toggle(e)},e.prototype.update=function(){n.MessageLoop.postMessage(this,e.Msg.UpdateRequest)},e.prototype.fit=function(){n.MessageLoop.postMessage(this,e.Msg.FitRequest)},e.prototype.activate=function(){n.MessageLoop.postMessage(this,e.Msg.ActivateRequest)},e.prototype.close=function(){n.MessageLoop.sendMessage(this,e.Msg.CloseRequest)},e.prototype.show=function(){if(this.testFlag(e.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.BeforeShow),this.clearFlag(e.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this.hiddenMode===e.HiddenMode.Display?(this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden")):this.node.style.transform="",!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.AfterShow),this.parent)){var t=new e.ChildMessage("child-shown",this);n.MessageLoop.sendMessage(this.parent,t)}},e.prototype.hide=function(){if(!this.testFlag(e.Flag.IsHidden)&&(!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.BeforeHide),this.setFlag(e.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this.hiddenMode===e.HiddenMode.Display?(this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden")):this.node.style.transform="scale(0)",!this.isAttached||this.parent&&!this.parent.isVisible||n.MessageLoop.sendMessage(this,e.Msg.AfterHide),this.parent)){var t=new e.ChildMessage("child-hidden",this);n.MessageLoop.sendMessage(this.parent,t)}},e.prototype.setHidden=function(e){e?this.hide():this.show()},e.prototype.testFlag=function(e){return 0!=(this._flags&e)},e.prototype.setFlag=function(e){this._flags|=e},e.prototype.clearFlag=function(e){this._flags&=~e},e.prototype.processMessage=function(t){switch(t.type){case"resize":this.notifyLayout(t),this.onResize(t);break;case"update-request":this.notifyLayout(t),this.onUpdateRequest(t);break;case"fit-request":this.notifyLayout(t),this.onFitRequest(t);break;case"before-show":this.notifyLayout(t),this.onBeforeShow(t);break;case"after-show":this.setFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterShow(t);break;case"before-hide":this.notifyLayout(t),this.onBeforeHide(t);break;case"after-hide":this.clearFlag(e.Flag.IsVisible),this.notifyLayout(t),this.onAfterHide(t);break;case"before-attach":this.notifyLayout(t),this.onBeforeAttach(t);break;case"after-attach":this.isHidden||this.parent&&!this.parent.isVisible||this.setFlag(e.Flag.IsVisible),this.setFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterAttach(t);break;case"before-detach":this.notifyLayout(t),this.onBeforeDetach(t);break;case"after-detach":this.clearFlag(e.Flag.IsVisible),this.clearFlag(e.Flag.IsAttached),this.notifyLayout(t),this.onAfterDetach(t);break;case"activate-request":this.notifyLayout(t),this.onActivateRequest(t);break;case"close-request":this.notifyLayout(t),this.onCloseRequest(t);break;case"child-added":this.notifyLayout(t),this.onChildAdded(t);break;case"child-removed":this.notifyLayout(t),this.onChildRemoved(t);break;default:this.notifyLayout(t)}},e.prototype.notifyLayout=function(e){this._layout&&this._layout.processParentMessage(e)},e.prototype.onCloseRequest=function(t){this.parent?this.parent=null:this.isAttached&&e.detach(this)},e.prototype.onResize=function(e){},e.prototype.onUpdateRequest=function(e){},e.prototype.onFitRequest=function(e){},e.prototype.onActivateRequest=function(e){},e.prototype.onBeforeShow=function(e){},e.prototype.onAfterShow=function(e){},e.prototype.onBeforeHide=function(e){},e.prototype.onAfterHide=function(e){},e.prototype.onBeforeAttach=function(e){},e.prototype.onAfterAttach=function(e){},e.prototype.onBeforeDetach=function(e){},e.prototype.onAfterDetach=function(e){},e.prototype.onChildAdded=function(e){},e.prototype.onChildRemoved=function(e){},e}(),function(e){var t,i,o;(t=e.HiddenMode||(e.HiddenMode={}))[t.Display=0]="Display",t[t.Scale=1]="Scale",(i=e.Flag||(e.Flag={}))[i.IsDisposed=1]="IsDisposed",i[i.IsAttached=2]="IsAttached",i[i.IsHidden=4]="IsHidden",i[i.IsVisible=8]="IsVisible",i[i.DisallowLayout=16]="DisallowLayout",(o=e.Msg||(e.Msg={})).BeforeShow=new n.Message("before-show"),o.AfterShow=new n.Message("after-show"),o.BeforeHide=new n.Message("before-hide"),o.AfterHide=new n.Message("after-hide"),o.BeforeAttach=new n.Message("before-attach"),o.AfterAttach=new n.Message("after-attach"),o.BeforeDetach=new n.Message("before-detach"),o.AfterDetach=new n.Message("after-detach"),o.ParentChanged=new n.Message("parent-changed"),o.UpdateRequest=new n.ConflatableMessage("update-request"),o.FitRequest=new n.ConflatableMessage("fit-request"),o.ActivateRequest=new n.ConflatableMessage("activate-request"),o.CloseRequest=new n.ConflatableMessage("close-request");var r=function(e){function t(t,i){var n=e.call(this,t)||this;return n.child=i,n}return p(t,e),t}(n.Message);e.ChildMessage=r;var s=function(e){function t(t,i){var n=e.call(this,"resize")||this;return n.width=t,n.height=i,n}return p(t,e),t}(n.Message);e.ResizeMessage=s,function(e){e.UnknownSize=new e(-1,-1)}(s=e.ResizeMessage||(e.ResizeMessage={})),e.attach=function(t,i,o){if(void 0===o&&(o=null),t.parent)throw new Error("Cannot attach a child widget.");if(t.isAttached||t.node.isConnected)throw new Error("Widget is already attached.");if(!i.isConnected)throw new Error("Host is not attached.");n.MessageLoop.sendMessage(t,e.Msg.BeforeAttach),i.insertBefore(t.node,o),n.MessageLoop.sendMessage(t,e.Msg.AfterAttach)},e.detach=function(t){if(t.parent)throw new Error("Cannot detach a child widget.");if(!t.isAttached||!t.node.isConnected)throw new Error("Widget is not attached.");n.MessageLoop.sendMessage(t,e.Msg.BeforeDetach),t.node.parentNode.removeChild(t.node),n.MessageLoop.sendMessage(t,e.Msg.AfterDetach)}}(e.Widget||(e.Widget={})),function(e){e.titleProperty=new o.AttachedProperty({name:"title",create:function(e){return new b({owner:e})}}),e.createNode=function(e){return e.node||document.createElement(e.tag||"div")}}(v||(v={})),e.Layout=function(){function i(e){void 0===e&&(e={}),this._disposed=!1,this._parent=null,this._fitPolicy=e.fitPolicy||"set-min-size"}return i.prototype.dispose=function(){this._parent=null,this._disposed=!0,r.Signal.clearData(this),o.AttachedProperty.clearData(this)},Object.defineProperty(i.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"parent",{get:function(){return this._parent},set:function(e){if(this._parent!==e){if(this._parent)throw new Error("Cannot change parent widget.");if(e.layout!==this)throw new Error("Invalid parent widget.");this._parent=e,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(e){if(this._fitPolicy!==e&&(this._fitPolicy=e,this._parent)){var t=this._parent.node.style;t.minWidth="",t.minHeight="",t.maxWidth="",t.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),i.prototype.processParentMessage=function(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e)}},i.prototype.init=function(){var e=this;t.each(this,(function(t){t.parent=e.parent}))},i.prototype.onResize=function(i){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e.Widget.ResizeMessage.UnknownSize)}))},i.prototype.onUpdateRequest=function(i){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e.Widget.ResizeMessage.UnknownSize)}))},i.prototype.onBeforeAttach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterAttach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onBeforeDetach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterDetach=function(e){t.each(this,(function(t){n.MessageLoop.sendMessage(t,e)}))},i.prototype.onBeforeShow=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterShow=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onBeforeHide=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onAfterHide=function(e){t.each(this,(function(t){t.isHidden||n.MessageLoop.sendMessage(t,e)}))},i.prototype.onChildRemoved=function(e){this.removeWidget(e.child)},i.prototype.onFitRequest=function(e){},i.prototype.onChildShown=function(e){},i.prototype.onChildHidden=function(e){},i}(),(y=e.Layout||(e.Layout={})).getHorizontalAlignment=function(e){return _.horizontalAlignmentProperty.get(e)},y.setHorizontalAlignment=function(e,t){_.horizontalAlignmentProperty.set(e,t)},y.getVerticalAlignment=function(e){return _.verticalAlignmentProperty.get(e)},y.setVerticalAlignment=function(e,t){_.verticalAlignmentProperty.set(e,t)};var _,M=function(){function t(e){this._top=NaN,this._left=NaN,this._width=NaN,this._height=NaN,this._minWidth=0,this._minHeight=0,this._maxWidth=1/0,this._maxHeight=1/0,this._disposed=!1,this.widget=e,this.widget.node.style.position="absolute"}return t.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var e=this.widget.node.style;e.position="",e.top="",e.left="",e.width="",e.height=""}},Object.defineProperty(t.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),t.prototype.fit=function(){var e=i.ElementExt.sizeLimits(this.widget.node);this._minWidth=e.minWidth,this._minHeight=e.minHeight,this._maxWidth=e.maxWidth,this._maxHeight=e.maxHeight},t.prototype.update=function(t,i,o,r){var s=Math.max(this._minWidth,Math.min(o,this._maxWidth)),a=Math.max(this._minHeight,Math.min(r,this._maxHeight));if(s<o)switch(e.Layout.getHorizontalAlignment(this.widget)){case"left":break;case"center":t+=(o-s)/2;break;case"right":t+=o-s;break;default:throw"unreachable"}if(a<r)switch(e.Layout.getVerticalAlignment(this.widget)){case"top":break;case"center":i+=(r-a)/2;break;case"bottom":i+=r-a;break;default:throw"unreachable"}var d=!1,h=this.widget.node.style;if(this._top!==i&&(this._top=i,h.top=i+"px"),this._left!==t&&(this._left=t,h.left=t+"px"),this._width!==s&&(d=!0,this._width=s,h.width=s+"px"),this._height!==a&&(d=!0,this._height=a,h.height=a+"px"),d){var c=new e.Widget.ResizeMessage(s,a);n.MessageLoop.sendMessage(this.widget,c)}},t}();!function(e){function t(e){e.parent&&e.parent.layout&&e.parent.update()}e.horizontalAlignmentProperty=new o.AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:t}),e.verticalAlignmentProperty=new o.AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:t})}(_||(_={}));var x,w=function(i){function o(){var e=null!==i&&i.apply(this,arguments)||this;return e._widgets=[],e}return p(o,i),o.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();i.prototype.dispose.call(this)},Object.defineProperty(o.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),o.prototype.iter=function(){return t.iter(this._widgets)},o.prototype.addWidget=function(e){this.insertWidget(this._widgets.length,e)},o.prototype.insertWidget=function(e,i){i.parent=this.parent;var n=this._widgets.indexOf(i),o=Math.max(0,Math.min(e,this._widgets.length));if(-1===n)return t.ArrayExt.insert(this._widgets,o,i),void(this.parent&&this.attachWidget(o,i));o===this._widgets.length&&o--,n!==o&&(t.ArrayExt.move(this._widgets,n,o),this.parent&&this.moveWidget(n,o,i))},o.prototype.removeWidget=function(e){this.removeWidgetAt(this._widgets.indexOf(e))},o.prototype.removeWidgetAt=function(e){var i=t.ArrayExt.removeAt(this._widgets,e);i&&this.parent&&this.detachWidget(e,i)},o.prototype.init=function(){var e=this;i.prototype.init.call(this),t.each(this,(function(t,i){e.attachWidget(i,t)}))},o.prototype.attachWidget=function(t,i){var o=this.parent.node.children[t];this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(i.node,o),this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.AfterAttach)},o.prototype.moveWidget=function(t,i,o){this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterDetach);var r=this.parent.node.children[i];this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeAttach),this.parent.node.insertBefore(o.node,r),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterAttach)},o.prototype.detachWidget=function(t,i){this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(i.node),this.parent.isAttached&&n.MessageLoop.sendMessage(i,e.Widget.Msg.AfterDetach)},o}(e.Layout);!function(e){e.clampDimension=function(e){return Math.max(0,Math.floor(e))}}(x||(x={}));var C,L,E=x;e.SplitLayout=function(o){function r(e){var t=o.call(this)||this;return t.widgetOffset=0,t._fixed=0,t._spacing=4,t._dirty=!1,t._hasNormedSizes=!1,t._sizers=[],t._items=[],t._handles=[],t._box=null,t._alignment="start",t._orientation="horizontal",t.renderer=e.renderer,void 0!==e.orientation&&(t._orientation=e.orientation),void 0!==e.alignment&&(t._alignment=e.alignment),void 0!==e.spacing&&(t._spacing=x.clampDimension(e.spacing)),t}return p(r,o),r.prototype.dispose=function(){t.each(this._items,(function(e){e.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,o.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"orientation",{get:function(){return this._orientation},set:function(e){this._orientation!==e&&(this._orientation=e,this.parent&&(this.parent.dataset.orientation=e,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"alignment",{get:function(){return this._alignment},set:function(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"spacing",{get:function(){return this._spacing},set:function(e){e=x.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),r.prototype.relativeSizes=function(){return L.normalize(this._sizers.map((function(e){return e.size})))},r.prototype.setRelativeSizes=function(e){for(var t=this._sizers.length,i=e.slice(0,t);i.length<t;)i.push(0);for(var n=L.normalize(i),o=0;o<t;++o){var r=this._sizers[o];r.sizeHint=n[o],r.size=n[o]}this._hasNormedSizes=!0,this.parent&&this.parent.update()},r.prototype.moveHandle=function(t,i){var n,o=this._handles[t];if(o&&!o.classList.contains("lm-mod-hidden")&&0!==(n="horizontal"===this._orientation?i-o.offsetLeft:i-o.offsetTop)){for(var r=0,s=this._sizers;r<s.length;r++){var a=s[r];a.size>0&&(a.sizeHint=a.size)}e.BoxEngine.adjust(this._sizers,t,n),this.parent&&this.parent.update()}},r.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,o.prototype.init.call(this)},r.prototype.attachWidget=function(i,o){var r=new M(o),s=L.createHandle(this.renderer),a=L.averageSize(this._sizers),d=L.createSizer(a);t.ArrayExt.insert(this._items,i,r),t.ArrayExt.insert(this._sizers,i,d),t.ArrayExt.insert(this._handles,i,s),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(o.node),this.parent.node.appendChild(s),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterAttach),this.parent.fit()},r.prototype.moveWidget=function(e,i,n){t.ArrayExt.move(this._items,e,i),t.ArrayExt.move(this._sizers,e,i),t.ArrayExt.move(this._handles,e,i),this.parent.fit()},r.prototype.detachWidget=function(i,o){var r=t.ArrayExt.removeAt(this._items,i),s=t.ArrayExt.removeAt(this._handles,i);t.ArrayExt.removeAt(this._sizers,i),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(o.node),this.parent.node.removeChild(s),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterDetach),r.dispose(),this.parent.fit()},r.prototype.onBeforeShow=function(e){o.prototype.onBeforeShow.call(this,e),this.parent.update()},r.prototype.onBeforeAttach=function(e){o.prototype.onBeforeAttach.call(this,e),this.parent.fit()},r.prototype.onChildShown=function(e){this.parent.fit()},r.prototype.onChildHidden=function(e){this.parent.fit()},r.prototype.onResize=function(e){this.parent.isVisible&&this._update(e.width,e.height)},r.prototype.onUpdateRequest=function(e){this.parent.isVisible&&this._update(-1,-1)},r.prototype.onFitRequest=function(e){this.parent.isAttached&&this._fit()},r.prototype.updateItemPosition=function(e,t,i,n,o,r,s){var a=this._items[e];if(!a.isHidden){var d=this._handles[e].style;t?(i+=this.widgetOffset,a.update(i,n,s,o),i+=s,d.top=n+"px",d.left=i+"px",d.width=this._spacing+"px",d.height=o+"px"):(n+=this.widgetOffset,a.update(i,n,r,s),n+=s,d.top=n+"px",d.left=i+"px",d.width=r+"px",d.height=this._spacing+"px")}},r.prototype._fit=function(){for(var t=0,o=-1,s=0,a=this._items.length;s<a;++s)this._items[s].isHidden?(this._handles[s].classList.add("lm-mod-hidden"),this._handles[s].classList.add("p-mod-hidden")):(this._handles[s].classList.remove("lm-mod-hidden"),this._handles[s].classList.remove("p-mod-hidden"),o=s,t++);-1!==o&&(this._handles[o].classList.add("lm-mod-hidden"),this._handles[o].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,t-1)+this.widgetOffset*this._items.length;var d="horizontal"===this._orientation,h=d?this._fixed:0,c=d?0:this._fixed;for(s=0,a=this._items.length;s<a;++s){var l=this._items[s],u=this._sizers[s];u.size>0&&(u.sizeHint=u.size),l.isHidden?(u.minSize=0,u.maxSize=0):(l.fit(),u.stretch=r.getStretch(l.widget),d?(u.minSize=l.minWidth,u.maxSize=l.maxWidth,h+=l.minWidth,c=Math.max(c,l.minHeight)):(u.minSize=l.minHeight,u.maxSize=l.maxHeight,c+=l.minHeight,h=Math.max(h,l.minWidth)))}var p=this._box=i.ElementExt.boxSizing(this.parent.node);h+=p.horizontalSum,c+=p.verticalSum;var m=this.parent.node.style;m.minWidth=h+"px",m.minHeight=c+"px",this._dirty=!0,this.parent.parent&&n.MessageLoop.sendMessage(this.parent.parent,e.Widget.Msg.FitRequest),this._dirty&&n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)},r.prototype._update=function(t,n){this._dirty=!1;for(var o=0,r=0,s=this._items.length;r<s;++r)o+=+!this._items[r].isHidden;if(0!==o||0!==this.widgetOffset){t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var a=this._box.paddingTop,d=this._box.paddingLeft,h=t-this._box.horizontalSum,c=n-this._box.verticalSum,l=0,u=0,p="horizontal"===this._orientation;if(o>0){var m=void 0;if(m=p?Math.max(0,h-this._fixed):Math.max(0,c-this._fixed),this._hasNormedSizes){for(var f=0,g=this._sizers;f<g.length;f++){g[f].sizeHint*=m}this._hasNormedSizes=!1}var v=e.BoxEngine.calc(this._sizers,m);if(v>0)switch(this._alignment){case"start":break;case"center":l=0,u=v/2;break;case"end":l=0,u=v;break;case"justify":l=v/o,u=0;break;default:throw"unreachable"}}for(r=0,s=this._items.length;r<s;++r){var y=this._items[r].isHidden?0:this._sizers[r].size+l;this.updateItemPosition(r,p,p?d+u:d,p?a:a+u,c,h,y);var b=this.widgetOffset+(this._handles[r].classList.contains("lm-mod-hidden")?0:this._spacing);p?d+=y+b:a+=y+b}}},r}(w),(C=e.SplitLayout||(e.SplitLayout={})).getStretch=function(e){return L.stretchProperty.get(e)},C.setStretch=function(e,t){L.stretchProperty.set(e,t)},function(t){t.stretchProperty=new o.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(e,t){return Math.max(0,Math.floor(t))},changed:function(t){t.parent&&t.parent.layout instanceof e.SplitLayout&&t.parent.fit()}}),t.createSizer=function(e){var t=new g;return t.sizeHint=Math.floor(e),t},t.createHandle=function(e){var t=e.createHandle();return t.style.position="absolute",t},t.averageSize=function(e){return e.reduce((function(e,t){return e+t.size}),0)/e.length||0},t.normalize=function(e){var t=e.length;if(0===t)return[];var i=e.reduce((function(e,t){return e+Math.abs(t)}),0);return 0===i?e.map((function(e){return 1/t})):e.map((function(e){return e/i}))}}(L||(L={}));var A,S=function(e){function i(t){var i=e.call(this,m(m({},t),{orientation:t.orientation||"vertical"}))||this;return i._titles=[],i.titleSpace=t.titleSpace||22,i}return p(i,e),Object.defineProperty(i.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(e){e=E.clampDimension(e),this.widgetOffset!==e&&(this.widgetOffset=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),i.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,e.prototype.dispose.call(this))},i.prototype.updateTitle=function(e,t){var i=this._titles[e],n=i.classList.contains("lm-mod-expanded"),o=A.createTitle(this.renderer,t.title,n);this._titles[e]=o,this.parent.node.replaceChild(o,i)},i.prototype.attachWidget=function(i,n){var o=A.createTitle(this.renderer,n.title);t.ArrayExt.insert(this._titles,i,o),this.parent.node.appendChild(o),n.node.setAttribute("role","region"),n.node.setAttribute("aria-labelledby",o.id),e.prototype.attachWidget.call(this,i,n)},i.prototype.moveWidget=function(i,n,o){t.ArrayExt.move(this._titles,i,n),e.prototype.moveWidget.call(this,i,n,o)},i.prototype.detachWidget=function(i,n){var o=t.ArrayExt.removeAt(this._titles,i);this.parent.node.removeChild(o),e.prototype.detachWidget.call(this,i,n)},i.prototype.updateItemPosition=function(t,i,n,o,r,s,a){var d=this._titles[t].style;d.top=o+"px",d.left=n+"px",d.height=this.widgetOffset+"px",d.width=i?r+"px":s+"px",e.prototype.updateItemPosition.call(this,t,i,n,o,r,s,a)},i}(e.SplitLayout);!function(e){e.createTitle=function(e,t,i){void 0===i&&(i=!0);var n=e.createSectionTitle(t);return n.style.position="absolute",n.setAttribute("aria-label",t.label+" Section"),n.setAttribute("aria-expanded",i?"true":"false"),n.setAttribute("aria-controls",t.owner.id),i&&n.classList.add("lm-mod-expanded"),n}}(A||(A={}));var P,I,z,B,T,D,k,O,W,R,N,H=function(e){function t(t){void 0===t&&(t={});var i=e.call(this)||this;return i.addClass("lm-Panel"),i.addClass("p-Panel"),i.layout=P.createLayout(t),i}return p(t,e),Object.defineProperty(t.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),t.prototype.addWidget=function(e){this.layout.addWidget(e)},t.prototype.insertWidget=function(e,t){this.layout.insertWidget(e,t)},t}(e.Widget);!function(e){e.createLayout=function(e){return e.layout||new w}}(P||(P={})),e.SplitPanel=function(e){function i(t){void 0===t&&(t={});var i=e.call(this,{layout:B.createLayout(t)})||this;return i._handleMoved=new r.Signal(i),i._pressData=null,i.addClass("lm-SplitPanel"),i.addClass("p-SplitPanel"),i}return p(i,e),i.prototype.dispose=function(){this._releaseMouse(),e.prototype.dispose.call(this)},Object.defineProperty(i.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(e){this.layout.orientation=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(e){this.layout.alignment=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(e){this.layout.spacing=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),i.prototype.relativeSizes=function(){return this.layout.relativeSizes()},i.prototype.setRelativeSizes=function(e){this.layout.setRelativeSizes(e)},i.prototype.handleEvent=function(e){switch(e.type){case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"pointerdown":this._evtMouseDown(e);break;case"pointermove":this._evtMouseMove(e);break;case"pointerup":this._evtMouseUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault(),e.stopPropagation()}},i.prototype.onBeforeAttach=function(e){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},i.prototype.onAfterDetach=function(e){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},i.prototype.onChildAdded=function(e){e.child.addClass("lm-SplitPanel-child"),e.child.addClass("p-SplitPanel-child"),this._releaseMouse()},i.prototype.onChildRemoved=function(e){e.child.removeClass("lm-SplitPanel-child"),e.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},i.prototype._evtKeyDown=function(e){this._pressData&&(e.preventDefault(),e.stopPropagation()),27===e.keyCode&&this._releaseMouse()},i.prototype._evtMouseDown=function(e){if(0===e.button){var i=this.layout,n=t.ArrayExt.findFirstIndex(i.handles,(function(t){return t.contains(e.target)}));if(-1!==n){var o;e.preventDefault(),e.stopPropagation(),document.addEventListener("mouseup",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0);var r=i.handles[n],a=r.getBoundingClientRect();o="horizontal"===i.orientation?e.clientX-a.left:e.clientY-a.top;var d=window.getComputedStyle(r),h=s.Drag.overrideCursor(d.cursor);this._pressData={index:n,delta:o,override:h}}}},i.prototype._evtMouseMove=function(e){var t;e.preventDefault(),e.stopPropagation();var i=this.layout,n=this.node.getBoundingClientRect();t="horizontal"===i.orientation?e.clientX-n.left-this._pressData.delta:e.clientY-n.top-this._pressData.delta,i.moveHandle(this._pressData.index,t)},i.prototype._evtMouseUp=function(e){0===e.button&&(e.preventDefault(),e.stopPropagation(),this._releaseMouse())},i.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._handleMoved.emit(),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("contextmenu",this,!0))},i}(H),I=e.SplitPanel||(e.SplitPanel={}),z=function(){function e(){}return e.prototype.createHandle=function(){var e=document.createElement("div");return e.className="lm-SplitPanel-handle",e.classList.add("p-SplitPanel-handle"),e},e}(),I.Renderer=z,I.defaultRenderer=new z,I.getStretch=function(t){return e.SplitLayout.getStretch(t)},I.setStretch=function(t,i){e.SplitLayout.setStretch(t,i)},function(t){t.createLayout=function(t){return t.layout||new e.SplitLayout({renderer:t.renderer||e.SplitPanel.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing})}}(B||(B={})),e.AccordionPanel=function(e){function i(t){void 0===t&&(t={});var i=e.call(this,m(m({},t),{layout:T.createLayout(t)}))||this;return i.addClass("lm-AccordionPanel"),i}return p(i,e),Object.defineProperty(i.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(e){this.layout.titleSpace=e},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),i.prototype.addWidget=function(t){e.prototype.addWidget.call(this,t),t.title.changed.connect(this._onTitleChanged,this)},i.prototype.insertWidget=function(t,i){e.prototype.insertWidget.call(this,t,i),i.title.changed.connect(this._onTitleChanged,this)},i.prototype.handleEvent=function(t){switch(e.prototype.handleEvent.call(this,t),t.type){case"click":this._evtClick(t);break;case"keydown":this._eventKeyDown(t)}},i.prototype.onBeforeAttach=function(t){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),e.prototype.onBeforeAttach.call(this,t)},i.prototype.onAfterDetach=function(t){e.prototype.onAfterDetach.call(this,t),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},i.prototype._onTitleChanged=function(e){var i=t.ArrayExt.findFirstIndex(this.widgets,(function(t){return t.contains(e.owner)}));i>=0&&(this.layout.updateTitle(i,e.owner),this.update())},i.prototype._evtClick=function(e){var i=e.target;if(i){var n=t.ArrayExt.findFirstIndex(this.titles,(function(e){return e.contains(i)}));if(n>=0){e.preventDefault(),e.stopPropagation();var o=this.titles[n],r=this.layout.widgets[n];r.isHidden?(o.classList.add("lm-mod-expanded"),o.setAttribute("aria-expanded","true"),r.show()):(o.classList.remove("lm-mod-expanded"),o.setAttribute("aria-expanded","false"),r.hide())}}},i.prototype._eventKeyDown=function(e){if(!e.defaultPrevented){var i=e.target,n=!1;if(i){var o=t.ArrayExt.findFirstIndex(this.titles,(function(e){return e.contains(i)}));if(o>=0){var r=e.keyCode.toString();if(e.key.match(/Space|Enter/)||r.match(/13|32/))i.click(),n=!0;else if("horizontal"===this.orientation?e.key.match(/ArrowLeft|ArrowRight/)||r.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||r.match(/38|40/)){var s=e.key.match(/ArrowLeft|ArrowUp/)||r.match(/37|38/)?-1:1,a=this.titles.length,d=(o+a+s)%a;this.titles[d].focus(),n=!0}else"End"===e.key||"35"===r?(this.titles[this.titles.length-1].focus(),n=!0):"Home"!==e.key&&"36"!==r||(this.titles[0].focus(),n=!0)}n&&e.preventDefault()}}},i}(e.SplitPanel),function(t){var i=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.titleClassName="lm-AccordionPanel-title",t._titleID=0,t._titleKeys=new WeakMap,t}return p(t,e),t.prototype.createCollapseIcon=function(e){return document.createElement("span")},t.prototype.createSectionTitle=function(e){var t=document.createElement("h3");for(var i in t.setAttribute("role","button"),t.setAttribute("tabindex","0"),t.id=this.createTitleKey(e),t.className=this.titleClassName,t.title=e.caption,e.dataset)t.dataset[i]=e.dataset[i];t.appendChild(this.createCollapseIcon(e)).className="lm-AccordionPanel-titleCollapser";var n=t.appendChild(document.createElement("span"));return n.className="lm-AccordionPanel-titleLabel",n.textContent=e.label,t},t.prototype.createTitleKey=function(e){var t=this._titleKeys.get(e);return void 0===t&&(t="title-key-"+this._titleID++,this._titleKeys.set(e,t)),t},t}(e.SplitPanel.Renderer);t.Renderer=i,t.defaultRenderer=new i}(e.AccordionPanel||(e.AccordionPanel={})),function(t){t.createLayout=function(t){return t.layout||new S({renderer:t.renderer||e.AccordionPanel.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:t.titleSpace})}}(T||(T={})),e.BoxLayout=function(o){function r(e){void 0===e&&(e={});var t=o.call(this)||this;return t._fixed=0,t._spacing=4,t._dirty=!1,t._sizers=[],t._items=[],t._box=null,t._alignment="start",t._direction="top-to-bottom",void 0!==e.direction&&(t._direction=e.direction),void 0!==e.alignment&&(t._alignment=e.alignment),void 0!==e.spacing&&(t._spacing=E.clampDimension(e.spacing)),t}return p(r,o),r.prototype.dispose=function(){t.each(this._items,(function(e){e.dispose()})),this._box=null,this._items.length=0,this._sizers.length=0,o.prototype.dispose.call(this)},Object.defineProperty(r.prototype,"direction",{get:function(){return this._direction},set:function(e){this._direction!==e&&(this._direction=e,this.parent&&(this.parent.dataset.direction=e,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"alignment",{get:function(){return this._alignment},set:function(e){this._alignment!==e&&(this._alignment=e,this.parent&&(this.parent.dataset.alignment=e,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"spacing",{get:function(){return this._spacing},set:function(e){e=E.clampDimension(e),this._spacing!==e&&(this._spacing=e,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),r.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,o.prototype.init.call(this)},r.prototype.attachWidget=function(i,o){t.ArrayExt.insert(this._items,i,new M(o)),t.ArrayExt.insert(this._sizers,i,new g),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeAttach),this.parent.node.appendChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterAttach),this.parent.fit()},r.prototype.moveWidget=function(e,i,n){t.ArrayExt.move(this._items,e,i),t.ArrayExt.move(this._sizers,e,i),this.parent.update()},r.prototype.detachWidget=function(i,o){var r=t.ArrayExt.removeAt(this._items,i);t.ArrayExt.removeAt(this._sizers,i),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.BeforeDetach),this.parent.node.removeChild(o.node),this.parent.isAttached&&n.MessageLoop.sendMessage(o,e.Widget.Msg.AfterDetach),r.dispose(),this.parent.fit()},r.prototype.onBeforeShow=function(e){o.prototype.onBeforeShow.call(this,e),this.parent.update()},r.prototype.onBeforeAttach=function(e){o.prototype.onBeforeAttach.call(this,e),this.parent.fit()},r.prototype.onChildShown=function(e){this.parent.fit()},r.prototype.onChildHidden=function(e){this.parent.fit()},r.prototype.onResize=function(e){this.parent.isVisible&&this._update(e.width,e.height)},r.prototype.onUpdateRequest=function(e){this.parent.isVisible&&this._update(-1,-1)},r.prototype.onFitRequest=function(e){this.parent.isAttached&&this._fit()},r.prototype._fit=function(){for(var t=0,o=0,s=this._items.length;o<s;++o)t+=+!this._items[o].isHidden;this._fixed=this._spacing*Math.max(0,t-1);var a=k.isHorizontal(this._direction),d=a?this._fixed:0,h=a?0:this._fixed;for(o=0,s=this._items.length;o<s;++o){var c=this._items[o],l=this._sizers[o];c.isHidden?(l.minSize=0,l.maxSize=0):(c.fit(),l.sizeHint=r.getSizeBasis(c.widget),l.stretch=r.getStretch(c.widget),a?(l.minSize=c.minWidth,l.maxSize=c.maxWidth,d+=c.minWidth,h=Math.max(h,c.minHeight)):(l.minSize=c.minHeight,l.maxSize=c.maxHeight,h+=c.minHeight,d=Math.max(d,c.minWidth)))}var u=this._box=i.ElementExt.boxSizing(this.parent.node);d+=u.horizontalSum,h+=u.verticalSum;var p=this.parent.node.style;p.minWidth=d+"px",p.minHeight=h+"px",this._dirty=!0,this.parent.parent&&n.MessageLoop.sendMessage(this.parent.parent,e.Widget.Msg.FitRequest),this._dirty&&n.MessageLoop.sendMessage(this.parent,e.Widget.Msg.UpdateRequest)},r.prototype._update=function(t,n){this._dirty=!1;for(var o=0,r=0,s=this._items.length;r<s;++r)o+=+!this._items[r].isHidden;if(0!==o){t<0&&(t=this.parent.node.offsetWidth),n<0&&(n=this.parent.node.offsetHeight),this._box||(this._box=i.ElementExt.boxSizing(this.parent.node));var a,d=this._box.paddingTop,h=this._box.paddingLeft,c=t-this._box.horizontalSum,l=n-this._box.verticalSum;switch(this._direction){case"left-to-right":a=e.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed));break;case"top-to-bottom":a=e.BoxEngine.calc(this._sizers,Math.max(0,l-this._fixed));break;case"right-to-left":a=e.BoxEngine.calc(this._sizers,Math.max(0,c-this._fixed)),h+=c;break;case"bottom-to-top":a=e.BoxEngine.calc(this._sizers,Math.max(0,l-this._fixed)),d+=l;break;default:throw"unreachable"}var u=0,p=0;if(a>0)switch(this._alignment){case"start":break;case"center":u=0,p=a/2;break;case"end":u=0,p=a;break;case"justify":u=a/o,p=0;break;default:throw"unreachable"}for(r=0,s=this._items.length;r<s;++r){var m=this._items[r];if(!m.isHidden){var f=this._sizers[r].size;switch(this._direction){case"left-to-right":m.update(h+p,d,f+u,l),h+=f+u+this._spacing;break;case"top-to-bottom":m.update(h,d+p,c,f+u),d+=f+u+this._spacing;break;case"right-to-left":m.update(h-p-f-u,d,f+u,l),h-=f+u+this._spacing;break;case"bottom-to-top":m.update(h,d-p-f-u,c,f+u),d-=f+u+this._spacing;break;default:throw"unreachable"}}}}},r}(w),(D=e.BoxLayout||(e.BoxLayout={})).getStretch=function(e){return k.stretchProperty.get(e)},D.setStretch=function(e,t){k.stretchProperty.set(e,t)},D.getSizeBasis=function(e){return k.sizeBasisProperty.get(e)},D.setSizeBasis=function(e,t){k.sizeBasisProperty.set(e,t)},function(t){function i(t){t.parent&&t.parent.layout instanceof e.BoxLayout&&t.parent.fit()}t.stretchProperty=new o.AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(e,t){return Math.max(0,Math.floor(t))},changed:i}),t.sizeBasisProperty=new o.AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(e,t){return Math.max(0,Math.floor(t))},changed:i}),t.isHorizontal=function(e){return"left-to-right"===e||"right-to-left"===e},t.clampSpacing=function(e){return Math.max(0,Math.floor(e))}}(k||(k={})),e.BoxPanel=function(e){function t(t){void 0===t&&(t={});var i=e.call(this,{layout:W.createLayout(t)})||this;return i.addClass("lm-BoxPanel"),i.ad