@hpcc-js/phosphor 3.2.1 → 3.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.p-Widget,.lm-Widget{box-sizing:border-box;position:relative;overflow:hidden;cursor:default}.p-Widget.p-mod-hidden,.lm-Widget.lm-mod-hidden{display:none!important}.p-CommandPalette,.lm-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-CommandPalette-search,.lm-CommandPalette-search{flex:0 0 auto}.p-CommandPalette-content,.lm-CommandPalette-content{flex:1 1 auto;margin:0;padding:0;min-height:0;overflow:auto;list-style-type:none}.p-CommandPalette-header,.lm-CommandPalette-header{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.p-CommandPalette-item,.lm-CommandPalette-item{display:flex;flex-direction:row}.p-CommandPalette-itemIcon,.lm-CommandPalette-itemIcon{flex:0 0 auto}.p-CommandPalette-itemContent,.lm-CommandPalette-itemContent{flex:1 1 auto;overflow:hidden}.p-CommandPalette-itemShortcut,.lm-CommandPalette-itemShortcut{flex:0 0 auto}.p-CommandPalette-itemLabel,.lm-CommandPalette-itemLabel{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-close-icon{border:1px solid transparent;background-color:transparent;position:absolute;z-index:1;right:3%;top:0;bottom:0;margin:auto;padding:7px 0;display:none;vertical-align:middle;outline:0;cursor:pointer}.lm-close-icon:after{content:"X";display:block;width:15px;height:15px;text-align:center;color:#000;font-weight:400;font-size:12px;cursor:pointer}.p-DockPanel,.lm-DockPanel,.p-DockPanel-widget,.lm-DockPanel-widget{z-index:0}.p-DockPanel-tabBar,.lm-DockPanel-tabBar{z-index:1}.p-DockPanel-handle,.lm-DockPanel-handle{z-index:2}.p-DockPanel-handle.p-mod-hidden,.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.p-DockPanel-handle:after,.lm-DockPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-DockPanel-handle[data-orientation=horizontal],.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.p-DockPanel-handle[data-orientation=vertical],.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.p-DockPanel-handle[data-orientation=horizontal]:after,.lm-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translate(-50%)}.p-DockPanel-handle[data-orientation=vertical]:after,.lm-DockPanel-handle[data-orientation=vertical]:after{top:50%;min-height:8px;transform:translateY(-50%)}.p-DockPanel-overlay,.lm-DockPanel-overlay{z-index:3;box-sizing:border-box;pointer-events:none}.p-DockPanel-overlay.p-mod-hidden,.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.p-Menu,.lm-Menu{z-index:10000;position:absolute;white-space:nowrap;overflow-x:hidden;overflow-y:auto;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-Menu-content,.lm-Menu-content{margin:0;padding:0;display:table;list-style-type:none}.p-Menu-item,.lm-Menu-item{display:table-row}.p-Menu-item.p-mod-hidden,.p-Menu-item.p-mod-collapsed,.lm-Menu-item.lm-mod-hidden,.lm-Menu-item.lm-mod-collapsed{display:none!important}.p-Menu-itemIcon,.p-Menu-itemSubmenuIcon,.lm-Menu-itemIcon,.lm-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.p-Menu-itemLabel,.lm-Menu-itemLabel{display:table-cell;text-align:left}.p-Menu-itemShortcut,.lm-Menu-itemShortcut{display:table-cell;text-align:right}.p-MenuBar,.lm-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-MenuBar-content,.lm-MenuBar-content{margin:0;padding:0;display:flex;flex-direction:row;list-style-type:none}.p--MenuBar-item,.lm-MenuBar-item{box-sizing:border-box}.p-MenuBar-itemIcon,.p-MenuBar-itemLabel,.lm-MenuBar-itemIcon,.lm-MenuBar-itemLabel{display:inline-block}.p-ScrollBar,.lm-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-ScrollBar[data-orientation=horizontal],.lm-ScrollBar[data-orientation=horizontal]{flex-direction:row}.p-ScrollBar[data-orientation=vertical],.lm-ScrollBar[data-orientation=vertical]{flex-direction:column}.p-ScrollBar-button,.lm-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.p-ScrollBar-track,.lm-ScrollBar-track{box-sizing:border-box;position:relative;overflow:hidden;flex:1 1 auto}.p-ScrollBar-thumb,.lm-ScrollBar-thumb{box-sizing:border-box;position:absolute}.p-SplitPanel-child,.lm-SplitPanel-child{z-index:0}.p-SplitPanel-handle,.lm-SplitPanel-handle{z-index:1}.p-SplitPanel-handle.p-mod-hidden,.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.p-SplitPanel-handle:after,.lm-SplitPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle,.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle,.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle:after,.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{left:50%;min-width:8px;transform:translate(-50%)}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle:after,.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{top:50%;min-height:8px;transform:translateY(-50%)}.p-TabBar,.lm-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-TabBar[data-orientation=horizontal],.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.p-TabBar[data-orientation=vertical],.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.p-TabBar-content,.lm-TabBar-content{margin:0;padding:0;display:flex;flex:1 1 auto;list-style-type:none}.p-TabBar[data-orientation=horizontal]>.p-TabBar-content,.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.p-TabBar[data-orientation=vertical]>.p-TabBar-content,.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.p-TabBar-tab,.lm-TabBar-tab{display:flex;flex-direction:row;box-sizing:border-box;overflow:hidden;touch-action:none}.p-TabBar-tabIcon,.p-TabBar-tabCloseIcon,.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:0 0 auto}.p-TabBar-tabLabel,.lm-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box}.p-TabBar-tab.p-mod-hidden,.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.p-TabBar.p-mod-dragging .p-TabBar-tab,.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab,.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{left:0;transition:left .15s ease}.p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab,.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{top:0;transition:top .15s ease}.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging,.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box;background:inherit}.p-TabPanel-tabBar,.lm-TabPanel-tabBar{z-index:1}.p-TabPanel-stackedPanel,.lm-TabPanel-stackedPanel{z-index:0}.phosphor_WidgetAdapter{border-left:1px solid #C0C0C0;border-right:1px solid #C0C0C0;border-bottom:1px solid #C0C0C0;background:#fff;min-width:64px;min-height:64px}.phosphor_WidgetAdapter.p-DockPanel-widget{border-top:none;box-shadow:0 -1px #0003,1px 1px 2px #0003}.phosphor_WidgetAdapter.p-SplitPanel-child{border:none}.p-DockPanel-overlay{background:#fff9;border:1px dashed black;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.p-TabBar{min-height:24px;max-height:24px}.p-TabBar-content{min-width:0;min-height:0;align-items:flex-end}.p-TabPanel-tabBar .p-TabBar-content{border-bottom:1px solid #C0C0C0}.p-TabBar-tab{padding:0 10px;background:#e5e5e5;border:1px solid #C0C0C0;border-bottom:none;font:12px Helvetica,Arial,sans-serif;flex:0 1 125px;min-height:20px;max-height:20px;min-width:35px;margin-left:-1px;line-height:20px}.p-TabBar-tab.p-mod-current{background:#fff}.p-TabBar-tab:hover:not(.p-mod-current){background:#f0f0f0}.p-TabBar-tab:first-child{margin-left:0}.p-TabBar-tab.p-mod-current{min-height:23px;max-height:23px;transform:translateY(1px)}.p-TabBar-tabIcon,.p-TabBar-tabLabel,.p-TabBar-tabCloseIcon{display:inline-block}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon{margin-left:4px}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon:before{content:"";font-family:FontAwesome}.p-TabBar-tab.p-mod-drag-image{min-height:23px;max-height:23px;min-width:125px;border:none;box-shadow:1px 1px 2px #0000004d;transform:translate(-40%) translateY(-58%)}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide{min-height:1px!important;max-height:1px!important}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide .p-TabBar-tab.p-mod-current{display:none}')),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- (function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@hpcc-js/common")):typeof define=="function"&&define.amd?define(["exports","@hpcc-js/common"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global["@hpcc-js/phosphor"]={},global["@hpcc-js/common"]))})(this,function(exports2,common){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);const PKG_NAME="@hpcc-js/phosphor",PKG_VERSION="3.1.0",BUILD_VERSION="3.2.1";var ArrayExt;(function(ArrayExt2){function firstIndexOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i){var j=(start+i)%n;if(array[j]===value)return j}return-1}ArrayExt2.firstIndexOf=firstIndexOf;function lastIndexOf(array,value,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;start<stop?span=start+1+(n-stop):span=start-stop+1;for(var i=0;i<span;++i){var j=(start-i+n)%n;if(array[j]===value)return j}return-1}ArrayExt2.lastIndexOf=lastIndexOf;function findFirstIndex(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i){var j=(start+i)%n;if(fn(array[j],j))return j}return-1}ArrayExt2.findFirstIndex=findFirstIndex;function findLastIndex(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var d;start<stop?d=start+1+(n-stop):d=start-stop+1;for(var i=0;i<d;++i){var j=(start-i+n)%n;if(fn(array[j],j))return j}return-1}ArrayExt2.findLastIndex=findLastIndex;function findFirstValue(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var index=findFirstIndex(array,fn,start,stop);return index!==-1?array[index]:void 0}ArrayExt2.findFirstValue=findFirstValue;function findLastValue(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var index=findLastIndex(array,fn,start,stop);return index!==-1?array[index]:void 0}ArrayExt2.findLastValue=findLastValue;function lowerBound(array,value,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var begin=start,span=stop-start+1;span>0;){var half=span>>1,middle=begin+half;fn(array[middle],value)<0?(begin=middle+1,span-=half+1):span=half}return begin}ArrayExt2.lowerBound=lowerBound;function upperBound(array,value,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var begin=start,span=stop-start+1;span>0;){var half=span>>1,middle=begin+half;fn(array[middle],value)>0?span=half:(begin=middle+1,span-=half+1)}return begin}ArrayExt2.upperBound=upperBound;function shallowEqual(a,b,fn){if(a===b)return!0;if(a.length!==b.length)return!1;for(var i=0,n=a.length;i<n;++i)if(fn?!fn(a[i],b[i]):a[i]!==b[i])return!1;return!0}ArrayExt2.shallowEqual=shallowEqual;function slice(array,options){options===void 0&&(options={});var start=options.start,stop=options.stop,step=options.step;if(step===void 0&&(step=1),step===0)throw new Error("Slice `step` cannot be zero.");var n=array.length;start===void 0?start=step<0?n-1:0:start<0?start=Math.max(start+n,step<0?-1:0):start>=n&&(start=step<0?n-1:n),stop===void 0?stop=step<0?-1:n:stop<0?stop=Math.max(stop+n,step<0?-1:0):stop>=n&&(stop=step<0?n-1:n);var length;step<0&&stop>=start||step>0&&start>=stop?length=0:step<0?length=Math.floor((stop-start+1)/step+1):length=Math.floor((stop-start-1)/step+1);for(var result=[],i=0;i<length;++i)result[i]=array[start+i*step];return result}ArrayExt2.slice=slice;function move(array,fromIndex,toIndex){var n=array.length;if(!(n<=1)&&(fromIndex<0?fromIndex=Math.max(0,fromIndex+n):fromIndex=Math.min(fromIndex,n-1),toIndex<0?toIndex=Math.max(0,toIndex+n):toIndex=Math.min(toIndex,n-1),fromIndex!==toIndex)){for(var value=array[fromIndex],d=fromIndex<toIndex?1:-1,i=fromIndex;i!==toIndex;i+=d)array[i]=array[i+d];array[toIndex]=value}}ArrayExt2.move=move;function reverse(array,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(!(n<=1))for(start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);start<stop;){var a=array[start],b=array[stop];array[start++]=b,array[stop--]=a}}ArrayExt2.reverse=reverse;function rotate(array,delta,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(!(n<=1)&&(start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1),!(start>=stop))){var length=stop-start+1;if(delta>0?delta=delta%length:delta<0&&(delta=(delta%length+length)%length),delta!==0){var pivot=start+delta;reverse(array,start,pivot-1),reverse(array,pivot,stop),reverse(array,start,stop)}}}ArrayExt2.rotate=rotate;function fill(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n!==0){start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i)array[(start+i)%n]=value}}ArrayExt2.fill=fill;function insert(array,index,value){var n=array.length;index<0?index=Math.max(0,index+n):index=Math.min(index,n);for(var i=n;i>index;--i)array[i]=array[i-1];array[index]=value}ArrayExt2.insert=insert;function removeAt(array,index){var n=array.length;if(index<0&&(index+=n),!(index<0||index>=n)){for(var value=array[index],i=index+1;i<n;++i)array[i-1]=array[i];return array.length=n-1,value}}ArrayExt2.removeAt=removeAt;function removeFirstOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var index=firstIndexOf(array,value,start,stop);return index!==-1&&removeAt(array,index),index}ArrayExt2.removeFirstOf=removeFirstOf;function removeLastOf(array,value,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var index=lastIndexOf(array,value,start,stop);return index!==-1&&removeAt(array,index),index}ArrayExt2.removeLastOf=removeLastOf;function removeAllOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var count=0,i=0;i<n;++i)start<=stop&&i>=start&&i<=stop&&array[i]===value||stop<start&&(i<=stop||i>=start)&&array[i]===value?count++:count>0&&(array[i-count]=array[i]);return count>0&&(array.length=n-count),count}ArrayExt2.removeAllOf=removeAllOf;function removeFirstWhere(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var value,index=findFirstIndex(array,fn,start,stop);return index!==-1&&(value=removeAt(array,index)),{index,value}}ArrayExt2.removeFirstWhere=removeFirstWhere;function removeLastWhere(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var value,index=findLastIndex(array,fn,start,stop);return index!==-1&&(value=removeAt(array,index)),{index,value}}ArrayExt2.removeLastWhere=removeLastWhere;function removeAllWhere(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var count=0,i=0;i<n;++i)start<=stop&&i>=start&&i<=stop&&fn(array[i],i)||stop<start&&(i<=stop||i>=start)&&fn(array[i],i)?count++:count>0&&(array[i-count]=array[i]);return count>0&&(array.length=n-count),count}ArrayExt2.removeAllWhere=removeAllWhere})(ArrayExt||(ArrayExt={}));function iter(object){var it;return typeof object.iter=="function"?it=object.iter():it=new ArrayIterator(object),it}function each(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++)===!1)return}function every(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(!fn(value,index++))return!1;return!0}function some(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++))return!0;return!1}function toArray(object){for(var index=0,result=[],it=iter(object),value;(value=it.next())!==void 0;)result[index++]=value;return result}var ArrayIterator=function(){function ArrayIterator2(source){this._index=0,this._source=source}return ArrayIterator2.prototype.iter=function(){return this},ArrayIterator2.prototype.clone=function(){var result=new ArrayIterator2(this._source);return result._index=this._index,result},ArrayIterator2.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},ArrayIterator2}();function chain(){for(var objects=[],_i=0;_i<arguments.length;_i++)objects[_i]=arguments[_i];return new ChainIterator(iter(objects.map(iter)))}var ChainIterator=function(){function ChainIterator2(source){this._cloned=!1,this._source=source,this._active=void 0}return ChainIterator2.prototype.iter=function(){return this},ChainIterator2.prototype.clone=function(){var result=new ChainIterator2(this._source.clone());return result._active=this._active&&this._active.clone(),result._cloned=!0,this._cloned=!0,result},ChainIterator2.prototype.next=function(){if(this._active===void 0){var active=this._source.next();if(active===void 0)return;this._active=this._cloned?active.clone():active}var value=this._active.next();return value!==void 0?value:(this._active=void 0,this.next())},ChainIterator2}();function empty(){return new EmptyIterator}var EmptyIterator=function(){function EmptyIterator2(){}return EmptyIterator2.prototype.iter=function(){return this},EmptyIterator2.prototype.clone=function(){return new EmptyIterator2},EmptyIterator2.prototype.next=function(){},EmptyIterator2}();function filter(object,fn){return new FilterIterator(iter(object),fn)}var FilterIterator=function(){function FilterIterator2(source,fn){this._index=0,this._source=source,this._fn=fn}return FilterIterator2.prototype.iter=function(){return this},FilterIterator2.prototype.clone=function(){var result=new FilterIterator2(this._source.clone(),this._fn);return result._index=this._index,result},FilterIterator2.prototype.next=function(){for(var fn=this._fn,it=this._source,value;(value=it.next())!==void 0;)if(fn(value,this._index++))return value},FilterIterator2}();function find(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++))return value}function max(object,fn){var it=iter(object),value=it.next();if(value!==void 0){for(var result=value;(value=it.next())!==void 0;)fn(value,result)>0&&(result=value);return result}}function map(object,fn){return new MapIterator(iter(object),fn)}var MapIterator=function(){function MapIterator2(source,fn){this._index=0,this._source=source,this._fn=fn}return MapIterator2.prototype.iter=function(){return this},MapIterator2.prototype.clone=function(){var result=new MapIterator2(this._source.clone(),this._fn);return result._index=this._index,result},MapIterator2.prototype.next=function(){var value=this._source.next();if(value!==void 0)return this._fn.call(void 0,value,this._index++)},MapIterator2}(),Private$s;(function(Private2){function rangeLength(start,stop,step){return step===0?1/0:start>stop&&step>0||start<stop&&step<0?0:Math.ceil((stop-start)/step)}Private2.rangeLength=rangeLength})(Private$s||(Private$s={}));function reduce(object,fn,initial){var index=0,it=iter(object),first=it.next();if(first===void 0)return initial;var second=it.next();if(second===void 0)return fn(initial,first,index++);var accumulator;accumulator=fn(fn(initial,first,index++),second,index++);for(var next;(next=it.next())!==void 0;)accumulator=fn(accumulator,next,index++);return accumulator}function once(value){return new RepeatIterator(value,1)}var RepeatIterator=function(){function RepeatIterator2(value,count){this._value=value,this._count=count}return RepeatIterator2.prototype.iter=function(){return this},RepeatIterator2.prototype.clone=function(){return new RepeatIterator2(this._value,this._count)},RepeatIterator2.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},RepeatIterator2}();function retro(object){var it;return typeof object.retro=="function"?it=object.retro():it=new RetroArrayIterator(object),it}var RetroArrayIterator=function(){function RetroArrayIterator2(source){this._source=source,this._index=source.length-1}return RetroArrayIterator2.prototype.iter=function(){return this},RetroArrayIterator2.prototype.clone=function(){var result=new RetroArrayIterator2(this._source);return result._index=this._index,result},RetroArrayIterator2.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},RetroArrayIterator2}(),StringExt;(function(StringExt2){function findIndices(source,query,start){start===void 0&&(start=0);for(var indices=new Array(query.length),i=0,j=start,n=query.length;i<n;++i,++j){if(j=source.indexOf(query[i],j),j===-1)return null;indices[i]=j}return indices}StringExt2.findIndices=findIndices;function matchSumOfSquares(source,query,start){start===void 0&&(start=0);var indices=findIndices(source,query,start);if(!indices)return null;for(var score=0,i=0,n=indices.length;i<n;++i){var j=indices[i]-start;score+=j*j}return{score,indices}}StringExt2.matchSumOfSquares=matchSumOfSquares;function matchSumOfDeltas(source,query,start){start===void 0&&(start=0);var indices=findIndices(source,query,start);if(!indices)return null;for(var score=0,last=start-1,i=0,n=indices.length;i<n;++i){var j=indices[i];score+=j-last-1,last=j}return{score,indices}}StringExt2.matchSumOfDeltas=matchSumOfDeltas;function highlight(source,indices,fn){for(var result=[],k=0,last=0,n=indices.length;k<n;){for(var i=indices[k],j=indices[k];++k<n&&indices[k]===j+1;)j++;last<i&&result.push(source.slice(last,i)),i<j+1&&result.push(fn(source.slice(i,j+1))),last=j+1}return last<source.length&&result.push(source.slice(last)),result}StringExt2.highlight=highlight;function cmp(a,b){return a<b?-1:a>b?1:0}StringExt2.cmp=cmp})(StringExt||(StringExt={}));var JSONExt;(function(JSONExt2){JSONExt2.emptyObject=Object.freeze({}),JSONExt2.emptyArray=Object.freeze([]);function isPrimitive(value){return value===null||typeof value=="boolean"||typeof value=="number"||typeof value=="string"}JSONExt2.isPrimitive=isPrimitive;function isArray(value){return Array.isArray(value)}JSONExt2.isArray=isArray;function isObject(value){return!isPrimitive(value)&&!isArray(value)}JSONExt2.isObject=isObject;function deepEqual(first,second){if(first===second)return!0;if(isPrimitive(first)||isPrimitive(second))return!1;var a1=isArray(first),a2=isArray(second);return a1!==a2?!1:a1&&a2?deepArrayEqual(first,second):deepObjectEqual(first,second)}JSONExt2.deepEqual=deepEqual;function deepCopy(value){return isPrimitive(value)?value:isArray(value)?deepArrayCopy(value):deepObjectCopy(value)}JSONExt2.deepCopy=deepCopy;function deepArrayEqual(first,second){if(first===second)return!0;if(first.length!==second.length)return!1;for(var i=0,n=first.length;i<n;++i)if(!deepEqual(first[i],second[i]))return!1;return!0}function deepObjectEqual(first,second){if(first===second)return!0;for(var key in first)if(first[key]!==void 0&&!(key in second))return!1;for(var key in second)if(second[key]!==void 0&&!(key in first))return!1;for(var key in first){var firstValue=first[key],secondValue=second[key];if(!(firstValue===void 0&&secondValue===void 0)&&(firstValue===void 0||secondValue===void 0||!deepEqual(firstValue,secondValue)))return!1}return!0}function deepArrayCopy(value){for(var result=new Array(value.length),i=0,n=value.length;i<n;++i)result[i]=deepCopy(value[i]);return result}function deepObjectCopy(value){var result={};for(var key in value){var subvalue=value[key];subvalue!==void 0&&(result[key]=deepCopy(subvalue))}return result}})(JSONExt||(JSONExt={}));var MimeData=function(){function MimeData2(){this._types=[],this._values=[]}return MimeData2.prototype.types=function(){return this._types.slice()},MimeData2.prototype.hasData=function(mime){return this._types.indexOf(mime)!==-1},MimeData2.prototype.getData=function(mime){var i=this._types.indexOf(mime);return i!==-1?this._values[i]:void 0},MimeData2.prototype.setData=function(mime,data){this.clearData(mime),this._types.push(mime),this._values.push(data)},MimeData2.prototype.clearData=function(mime){var i=this._types.indexOf(mime);i!==-1&&(this._types.splice(i,1),this._values.splice(i,1))},MimeData2.prototype.clear=function(){this._types.length=0,this._values.length=0},MimeData2}();function fallbackRandomValues(buffer){for(var value=0,i=0,n=buffer.length;i<n;++i)i%4===0&&(value=Math.random()*4294967295>>>0),buffer[i]=value&255,value>>>=8}var Random;(function(Random2){Random2.getRandomValues=function(){var crypto=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return crypto&&typeof crypto.getRandomValues=="function"?function(buffer){return crypto.getRandomValues(buffer)}:fallbackRandomValues}()})(Random||(Random={}));function uuid4Factory(getRandomValues){for(var bytes=new Uint8Array(16),lut=new Array(256),i=0;i<16;++i)lut[i]="0"+i.toString(16);for(var i=16;i<256;++i)lut[i]=i.toString(16);return function(){return getRandomValues(bytes),bytes[6]=64|bytes[6]&15,bytes[8]=128|bytes[8]&63,lut[bytes[0]]+lut[bytes[1]]+lut[bytes[2]]+lut[bytes[3]]+"-"+lut[bytes[4]]+lut[bytes[5]]+"-"+lut[bytes[6]]+lut[bytes[7]]+"-"+lut[bytes[8]]+lut[bytes[9]]+"-"+lut[bytes[10]]+lut[bytes[11]]+lut[bytes[12]]+lut[bytes[13]]+lut[bytes[14]]+lut[bytes[15]]}}var UUID;(function(UUID2){UUID2.uuid4=uuid4Factory(Random.getRandomValues)})(UUID||(UUID={}));var AttachedProperty=function(){function AttachedProperty2(options){this._pid=Private$r.nextPID(),this.name=options.name,this._create=options.create,this._coerce=options.coerce||null,this._compare=options.compare||null,this._changed=options.changed||null}return AttachedProperty2.prototype.get=function(owner){var value,map2=Private$r.ensureMap(owner);return this._pid in map2?value=map2[this._pid]:value=map2[this._pid]=this._createValue(owner),value},AttachedProperty2.prototype.set=function(owner,value){var oldValue,map2=Private$r.ensureMap(owner);this._pid in map2?oldValue=map2[this._pid]:oldValue=map2[this._pid]=this._createValue(owner);var newValue=this._coerceValue(owner,value);this._maybeNotify(owner,oldValue,map2[this._pid]=newValue)},AttachedProperty2.prototype.coerce=function(owner){var oldValue,map2=Private$r.ensureMap(owner);this._pid in map2?oldValue=map2[this._pid]:oldValue=map2[this._pid]=this._createValue(owner);var newValue=this._coerceValue(owner,oldValue);this._maybeNotify(owner,oldValue,map2[this._pid]=newValue)},AttachedProperty2.prototype._createValue=function(owner){var create=this._create;return create(owner)},AttachedProperty2.prototype._coerceValue=function(owner,value){var coerce=this._coerce;return coerce?coerce(owner,value):value},AttachedProperty2.prototype._compareValue=function(oldValue,newValue){var compare=this._compare;return compare?compare(oldValue,newValue):oldValue===newValue},AttachedProperty2.prototype._maybeNotify=function(owner,oldValue,newValue){var changed=this._changed;changed&&!this._compareValue(oldValue,newValue)&&changed(owner,oldValue,newValue)},AttachedProperty2}();(function(AttachedProperty2){function clearData(owner){Private$r.ownerData.delete(owner)}AttachedProperty2.clearData=clearData})(AttachedProperty);var Private$r;(function(Private2){Private2.ownerData=new WeakMap,Private2.nextPID=function(){var id=0;return function(){var rand=Math.random(),stem=(""+rand).slice(2);return"pid-"+stem+"-"+id++}}();function ensureMap(owner){var map2=Private2.ownerData.get(owner);return map2||(map2=Object.create(null),Private2.ownerData.set(owner,map2),map2)}Private2.ensureMap=ensureMap})(Private$r||(Private$r={}));var Signal=function(){function Signal2(sender){this._blockedCount=0,this.sender=sender}return Signal2.prototype.block=function(fn){this._blockedCount++;try{fn()}finally{this._blockedCount--}},Signal2.prototype.connect=function(slot,thisArg){return Private$q.connect(this,slot,thisArg)},Signal2.prototype.disconnect=function(slot,thisArg){return Private$q.disconnect(this,slot,thisArg)},Signal2.prototype.emit=function(args){this._blockedCount||Private$q.emit(this,args)},Signal2}();(function(Signal2){function blockAll(sender,fn){var blockedProperty=Private$q.blockedProperty;blockedProperty.set(sender,blockedProperty.get(sender)+1);try{fn()}finally{blockedProperty.set(sender,blockedProperty.get(sender)-1)}}Signal2.blockAll=blockAll;function disconnectBetween(sender,receiver){Private$q.disconnectBetween(sender,receiver)}Signal2.disconnectBetween=disconnectBetween;function disconnectSender(sender){Private$q.disconnectSender(sender)}Signal2.disconnectSender=disconnectSender;function disconnectReceiver(receiver){Private$q.disconnectReceiver(receiver)}Signal2.disconnectReceiver=disconnectReceiver;function disconnectAll(object){Private$q.disconnectAll(object)}Signal2.disconnectAll=disconnectAll;function clearData(object){Private$q.disconnectAll(object)}Signal2.clearData=clearData;function getExceptionHandler(){return Private$q.exceptionHandler}Signal2.getExceptionHandler=getExceptionHandler;function setExceptionHandler(handler){var old=Private$q.exceptionHandler;return Private$q.exceptionHandler=handler,old}Signal2.setExceptionHandler=setExceptionHandler})(Signal);var Private$q;(function(Private2){Private2.exceptionHandler=function(err){console.error(err)};function connect(signal,slot,thisArg){thisArg=thisArg||void 0;var receivers=receiversForSender.get(signal.sender);if(receivers||(receivers=[],receiversForSender.set(signal.sender,receivers)),findConnection(receivers,signal,slot,thisArg))return!1;var receiver=thisArg||slot,senders=sendersForReceiver.get(receiver);senders||(senders=[],sendersForReceiver.set(receiver,senders));var connection={signal,slot,thisArg};return receivers.push(connection),senders.push(connection),!0}Private2.connect=connect;function disconnect(signal,slot,thisArg){thisArg=thisArg||void 0;var receivers=receiversForSender.get(signal.sender);if(!receivers||receivers.length===0)return!1;var connection=findConnection(receivers,signal,slot,thisArg);if(!connection)return!1;var receiver=thisArg||slot,senders=sendersForReceiver.get(receiver);return connection.signal=null,scheduleCleanup(receivers),scheduleCleanup(senders),!0}Private2.disconnect=disconnect;function disconnectBetween(sender,receiver){var receivers=receiversForSender.get(sender);if(!(!receivers||receivers.length===0)){var senders=sendersForReceiver.get(receiver);!senders||senders.length===0||(each(senders,function(connection){connection.signal&&connection.signal.sender===sender&&(connection.signal=null)}),scheduleCleanup(receivers),scheduleCleanup(senders))}}Private2.disconnectBetween=disconnectBetween;function disconnectSender(sender){var receivers=receiversForSender.get(sender);!receivers||receivers.length===0||(each(receivers,function(connection){if(connection.signal){var receiver=connection.thisArg||connection.slot;connection.signal=null,scheduleCleanup(sendersForReceiver.get(receiver))}}),scheduleCleanup(receivers))}Private2.disconnectSender=disconnectSender;function disconnectReceiver(receiver){var senders=sendersForReceiver.get(receiver);!senders||senders.length===0||(each(senders,function(connection){if(connection.signal){var sender=connection.signal.sender;connection.signal=null,scheduleCleanup(receiversForSender.get(sender))}}),scheduleCleanup(senders))}Private2.disconnectReceiver=disconnectReceiver;function disconnectAll(object){disconnectSender(object),disconnectReceiver(object)}Private2.disconnectAll=disconnectAll;function emit(signal,args){if(!(Private2.blockedProperty.get(signal.sender)>0)){var receivers=receiversForSender.get(signal.sender);if(!(!receivers||receivers.length===0))for(var i=0,n=receivers.length;i<n;++i){var connection=receivers[i];connection.signal===signal&&invokeSlot(connection,args)}}}Private2.emit=emit;var receiversForSender=new WeakMap,sendersForReceiver=new WeakMap,dirtySet=new Set,schedule=function(){var ok=typeof requestAnimationFrame=="function";return ok?requestAnimationFrame:setImmediate}();function findConnection(connections,signal,slot,thisArg){return find(connections,function(connection){return connection.signal===signal&&connection.slot===slot&&connection.thisArg===thisArg})}function invokeSlot(connection,args){var signal=connection.signal,slot=connection.slot,thisArg=connection.thisArg;try{slot.call(thisArg,signal.sender,args)}catch(err){Private2.exceptionHandler(err)}}function scheduleCleanup(array){dirtySet.size===0&&schedule(cleanupDirtySet),dirtySet.add(array)}function cleanupDirtySet(){dirtySet.forEach(cleanupConnections),dirtySet.clear()}function cleanupConnections(connections){ArrayExt.removeAllWhere(connections,isDeadConnection)}function isDeadConnection(connection){return connection.signal===null}Private2.blockedProperty=new AttachedProperty({name:"blocked",create:function(){return 0}})})(Private$q||(Private$q={}));/*! *****************************************************************************
1
+ (function(global,factory){typeof exports=="object"&&typeof module<"u"?factory(exports,require("@hpcc-js/common")):typeof define=="function"&&define.amd?define(["exports","@hpcc-js/common"],factory):(global=typeof globalThis<"u"?globalThis:global||self,factory(global["@hpcc-js/phosphor"]={},global["@hpcc-js/common"]))})(this,function(exports2,common){"use strict";var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:!0,configurable:!0,writable:!0,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!="symbol"?key+"":key,value);const PKG_NAME="@hpcc-js/phosphor",PKG_VERSION="3.1.0",BUILD_VERSION="3.2.1";var ArrayExt;(function(ArrayExt2){function firstIndexOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i){var j=(start+i)%n;if(array[j]===value)return j}return-1}ArrayExt2.firstIndexOf=firstIndexOf;function lastIndexOf(array,value,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;start<stop?span=start+1+(n-stop):span=start-stop+1;for(var i=0;i<span;++i){var j=(start-i+n)%n;if(array[j]===value)return j}return-1}ArrayExt2.lastIndexOf=lastIndexOf;function findFirstIndex(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i){var j=(start+i)%n;if(fn(array[j],j))return j}return-1}ArrayExt2.findFirstIndex=findFirstIndex;function findLastIndex(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var n=array.length;if(n===0)return-1;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var d;start<stop?d=start+1+(n-stop):d=start-stop+1;for(var i=0;i<d;++i){var j=(start-i+n)%n;if(fn(array[j],j))return j}return-1}ArrayExt2.findLastIndex=findLastIndex;function findFirstValue(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var index=findFirstIndex(array,fn,start,stop);return index!==-1?array[index]:void 0}ArrayExt2.findFirstValue=findFirstValue;function findLastValue(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var index=findLastIndex(array,fn,start,stop);return index!==-1?array[index]:void 0}ArrayExt2.findLastValue=findLastValue;function lowerBound(array,value,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var begin=start,span=stop-start+1;span>0;){var half=span>>1,middle=begin+half;fn(array[middle],value)<0?(begin=middle+1,span-=half+1):span=half}return begin}ArrayExt2.lowerBound=lowerBound;function upperBound(array,value,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var begin=start,span=stop-start+1;span>0;){var half=span>>1,middle=begin+half;fn(array[middle],value)>0?span=half:(begin=middle+1,span-=half+1)}return begin}ArrayExt2.upperBound=upperBound;function shallowEqual(a,b,fn){if(a===b)return!0;if(a.length!==b.length)return!1;for(var i=0,n=a.length;i<n;++i)if(fn?!fn(a[i],b[i]):a[i]!==b[i])return!1;return!0}ArrayExt2.shallowEqual=shallowEqual;function slice(array,options){options===void 0&&(options={});var start=options.start,stop=options.stop,step=options.step;if(step===void 0&&(step=1),step===0)throw new Error("Slice `step` cannot be zero.");var n=array.length;start===void 0?start=step<0?n-1:0:start<0?start=Math.max(start+n,step<0?-1:0):start>=n&&(start=step<0?n-1:n),stop===void 0?stop=step<0?-1:n:stop<0?stop=Math.max(stop+n,step<0?-1:0):stop>=n&&(stop=step<0?n-1:n);var length;step<0&&stop>=start||step>0&&start>=stop?length=0:step<0?length=Math.floor((stop-start+1)/step+1):length=Math.floor((stop-start-1)/step+1);for(var result=[],i=0;i<length;++i)result[i]=array[start+i*step];return result}ArrayExt2.slice=slice;function move(array,fromIndex,toIndex){var n=array.length;if(!(n<=1)&&(fromIndex<0?fromIndex=Math.max(0,fromIndex+n):fromIndex=Math.min(fromIndex,n-1),toIndex<0?toIndex=Math.max(0,toIndex+n):toIndex=Math.min(toIndex,n-1),fromIndex!==toIndex)){for(var value=array[fromIndex],d=fromIndex<toIndex?1:-1,i=fromIndex;i!==toIndex;i+=d)array[i]=array[i+d];array[toIndex]=value}}ArrayExt2.move=move;function reverse(array,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(!(n<=1))for(start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);start<stop;){var a=array[start],b=array[stop];array[start++]=b,array[stop--]=a}}ArrayExt2.reverse=reverse;function rotate(array,delta,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(!(n<=1)&&(start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1),!(start>=stop))){var length=stop-start+1;if(delta>0?delta=delta%length:delta<0&&(delta=(delta%length+length)%length),delta!==0){var pivot=start+delta;reverse(array,start,pivot-1),reverse(array,pivot,stop),reverse(array,start,stop)}}}ArrayExt2.rotate=rotate;function fill(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n!==0){start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);var span;stop<start?span=stop+1+(n-start):span=stop-start+1;for(var i=0;i<span;++i)array[(start+i)%n]=value}}ArrayExt2.fill=fill;function insert(array,index,value){var n=array.length;index<0?index=Math.max(0,index+n):index=Math.min(index,n);for(var i=n;i>index;--i)array[i]=array[i-1];array[index]=value}ArrayExt2.insert=insert;function removeAt(array,index){var n=array.length;if(index<0&&(index+=n),!(index<0||index>=n)){for(var value=array[index],i=index+1;i<n;++i)array[i-1]=array[i];return array.length=n-1,value}}ArrayExt2.removeAt=removeAt;function removeFirstOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var index=firstIndexOf(array,value,start,stop);return index!==-1&&removeAt(array,index),index}ArrayExt2.removeFirstOf=removeFirstOf;function removeLastOf(array,value,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var index=lastIndexOf(array,value,start,stop);return index!==-1&&removeAt(array,index),index}ArrayExt2.removeLastOf=removeLastOf;function removeAllOf(array,value,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var count=0,i=0;i<n;++i)start<=stop&&i>=start&&i<=stop&&array[i]===value||stop<start&&(i<=stop||i>=start)&&array[i]===value?count++:count>0&&(array[i-count]=array[i]);return count>0&&(array.length=n-count),count}ArrayExt2.removeAllOf=removeAllOf;function removeFirstWhere(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var value,index=findFirstIndex(array,fn,start,stop);return index!==-1&&(value=removeAt(array,index)),{index,value}}ArrayExt2.removeFirstWhere=removeFirstWhere;function removeLastWhere(array,fn,start,stop){start===void 0&&(start=-1),stop===void 0&&(stop=0);var value,index=findLastIndex(array,fn,start,stop);return index!==-1&&(value=removeAt(array,index)),{index,value}}ArrayExt2.removeLastWhere=removeLastWhere;function removeAllWhere(array,fn,start,stop){start===void 0&&(start=0),stop===void 0&&(stop=-1);var n=array.length;if(n===0)return 0;start<0?start=Math.max(0,start+n):start=Math.min(start,n-1),stop<0?stop=Math.max(0,stop+n):stop=Math.min(stop,n-1);for(var count=0,i=0;i<n;++i)start<=stop&&i>=start&&i<=stop&&fn(array[i],i)||stop<start&&(i<=stop||i>=start)&&fn(array[i],i)?count++:count>0&&(array[i-count]=array[i]);return count>0&&(array.length=n-count),count}ArrayExt2.removeAllWhere=removeAllWhere})(ArrayExt||(ArrayExt={}));function iter(object){var it;return typeof object.iter=="function"?it=object.iter():it=new ArrayIterator(object),it}function each(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++)===!1)return}function every(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(!fn(value,index++))return!1;return!0}function some(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++))return!0;return!1}function toArray(object){for(var index=0,result=[],it=iter(object),value;(value=it.next())!==void 0;)result[index++]=value;return result}var ArrayIterator=function(){function ArrayIterator2(source){this._index=0,this._source=source}return ArrayIterator2.prototype.iter=function(){return this},ArrayIterator2.prototype.clone=function(){var result=new ArrayIterator2(this._source);return result._index=this._index,result},ArrayIterator2.prototype.next=function(){if(!(this._index>=this._source.length))return this._source[this._index++]},ArrayIterator2}();function chain(){for(var objects=[],_i=0;_i<arguments.length;_i++)objects[_i]=arguments[_i];return new ChainIterator(iter(objects.map(iter)))}var ChainIterator=function(){function ChainIterator2(source){this._cloned=!1,this._source=source,this._active=void 0}return ChainIterator2.prototype.iter=function(){return this},ChainIterator2.prototype.clone=function(){var result=new ChainIterator2(this._source.clone());return result._active=this._active&&this._active.clone(),result._cloned=!0,this._cloned=!0,result},ChainIterator2.prototype.next=function(){if(this._active===void 0){var active=this._source.next();if(active===void 0)return;this._active=this._cloned?active.clone():active}var value=this._active.next();return value!==void 0?value:(this._active=void 0,this.next())},ChainIterator2}();function empty(){return new EmptyIterator}var EmptyIterator=function(){function EmptyIterator2(){}return EmptyIterator2.prototype.iter=function(){return this},EmptyIterator2.prototype.clone=function(){return new EmptyIterator2},EmptyIterator2.prototype.next=function(){},EmptyIterator2}();function filter(object,fn){return new FilterIterator(iter(object),fn)}var FilterIterator=function(){function FilterIterator2(source,fn){this._index=0,this._source=source,this._fn=fn}return FilterIterator2.prototype.iter=function(){return this},FilterIterator2.prototype.clone=function(){var result=new FilterIterator2(this._source.clone(),this._fn);return result._index=this._index,result},FilterIterator2.prototype.next=function(){for(var fn=this._fn,it=this._source,value;(value=it.next())!==void 0;)if(fn(value,this._index++))return value},FilterIterator2}();function find(object,fn){for(var index=0,it=iter(object),value;(value=it.next())!==void 0;)if(fn(value,index++))return value}function max(object,fn){var it=iter(object),value=it.next();if(value!==void 0){for(var result=value;(value=it.next())!==void 0;)fn(value,result)>0&&(result=value);return result}}function map(object,fn){return new MapIterator(iter(object),fn)}var MapIterator=function(){function MapIterator2(source,fn){this._index=0,this._source=source,this._fn=fn}return MapIterator2.prototype.iter=function(){return this},MapIterator2.prototype.clone=function(){var result=new MapIterator2(this._source.clone(),this._fn);return result._index=this._index,result},MapIterator2.prototype.next=function(){var value=this._source.next();if(value!==void 0)return this._fn.call(void 0,value,this._index++)},MapIterator2}(),Private$s;(function(Private2){function rangeLength(start,stop,step){return step===0?1/0:start>stop&&step>0||start<stop&&step<0?0:Math.ceil((stop-start)/step)}Private2.rangeLength=rangeLength})(Private$s||(Private$s={}));function reduce(object,fn,initial){var index=0,it=iter(object),first=it.next();if(first===void 0)return initial;var second=it.next();if(second===void 0)return fn(initial,first,index++);var accumulator;accumulator=fn(fn(initial,first,index++),second,index++);for(var next;(next=it.next())!==void 0;)accumulator=fn(accumulator,next,index++);return accumulator}function once(value){return new RepeatIterator(value,1)}var RepeatIterator=function(){function RepeatIterator2(value,count){this._value=value,this._count=count}return RepeatIterator2.prototype.iter=function(){return this},RepeatIterator2.prototype.clone=function(){return new RepeatIterator2(this._value,this._count)},RepeatIterator2.prototype.next=function(){if(!(this._count<=0))return this._count--,this._value},RepeatIterator2}();function retro(object){var it;return typeof object.retro=="function"?it=object.retro():it=new RetroArrayIterator(object),it}var RetroArrayIterator=function(){function RetroArrayIterator2(source){this._source=source,this._index=source.length-1}return RetroArrayIterator2.prototype.iter=function(){return this},RetroArrayIterator2.prototype.clone=function(){var result=new RetroArrayIterator2(this._source);return result._index=this._index,result},RetroArrayIterator2.prototype.next=function(){if(!(this._index<0||this._index>=this._source.length))return this._source[this._index--]},RetroArrayIterator2}(),StringExt;(function(StringExt2){function findIndices(source,query,start){start===void 0&&(start=0);for(var indices=new Array(query.length),i=0,j=start,n=query.length;i<n;++i,++j){if(j=source.indexOf(query[i],j),j===-1)return null;indices[i]=j}return indices}StringExt2.findIndices=findIndices;function matchSumOfSquares(source,query,start){start===void 0&&(start=0);var indices=findIndices(source,query,start);if(!indices)return null;for(var score=0,i=0,n=indices.length;i<n;++i){var j=indices[i]-start;score+=j*j}return{score,indices}}StringExt2.matchSumOfSquares=matchSumOfSquares;function matchSumOfDeltas(source,query,start){start===void 0&&(start=0);var indices=findIndices(source,query,start);if(!indices)return null;for(var score=0,last=start-1,i=0,n=indices.length;i<n;++i){var j=indices[i];score+=j-last-1,last=j}return{score,indices}}StringExt2.matchSumOfDeltas=matchSumOfDeltas;function highlight(source,indices,fn){for(var result=[],k=0,last=0,n=indices.length;k<n;){for(var i=indices[k],j=indices[k];++k<n&&indices[k]===j+1;)j++;last<i&&result.push(source.slice(last,i)),i<j+1&&result.push(fn(source.slice(i,j+1))),last=j+1}return last<source.length&&result.push(source.slice(last)),result}StringExt2.highlight=highlight;function cmp(a,b){return a<b?-1:a>b?1:0}StringExt2.cmp=cmp})(StringExt||(StringExt={}));var JSONExt;(function(JSONExt2){JSONExt2.emptyObject=Object.freeze({}),JSONExt2.emptyArray=Object.freeze([]);function isPrimitive(value){return value===null||typeof value=="boolean"||typeof value=="number"||typeof value=="string"}JSONExt2.isPrimitive=isPrimitive;function isArray(value){return Array.isArray(value)}JSONExt2.isArray=isArray;function isObject(value){return!isPrimitive(value)&&!isArray(value)}JSONExt2.isObject=isObject;function deepEqual(first,second){if(first===second)return!0;if(isPrimitive(first)||isPrimitive(second))return!1;var a1=isArray(first),a2=isArray(second);return a1!==a2?!1:a1&&a2?deepArrayEqual(first,second):deepObjectEqual(first,second)}JSONExt2.deepEqual=deepEqual;function deepCopy(value){return isPrimitive(value)?value:isArray(value)?deepArrayCopy(value):deepObjectCopy(value)}JSONExt2.deepCopy=deepCopy;function deepArrayEqual(first,second){if(first===second)return!0;if(first.length!==second.length)return!1;for(var i=0,n=first.length;i<n;++i)if(!deepEqual(first[i],second[i]))return!1;return!0}function deepObjectEqual(first,second){if(first===second)return!0;for(var key in first)if(first[key]!==void 0&&!(key in second))return!1;for(var key in second)if(second[key]!==void 0&&!(key in first))return!1;for(var key in first){var firstValue=first[key],secondValue=second[key];if(!(firstValue===void 0&&secondValue===void 0)&&(firstValue===void 0||secondValue===void 0||!deepEqual(firstValue,secondValue)))return!1}return!0}function deepArrayCopy(value){for(var result=new Array(value.length),i=0,n=value.length;i<n;++i)result[i]=deepCopy(value[i]);return result}function deepObjectCopy(value){var result={};for(var key in value){var subvalue=value[key];subvalue!==void 0&&(result[key]=deepCopy(subvalue))}return result}})(JSONExt||(JSONExt={}));var MimeData=function(){function MimeData2(){this._types=[],this._values=[]}return MimeData2.prototype.types=function(){return this._types.slice()},MimeData2.prototype.hasData=function(mime){return this._types.indexOf(mime)!==-1},MimeData2.prototype.getData=function(mime){var i=this._types.indexOf(mime);return i!==-1?this._values[i]:void 0},MimeData2.prototype.setData=function(mime,data){this.clearData(mime),this._types.push(mime),this._values.push(data)},MimeData2.prototype.clearData=function(mime){var i=this._types.indexOf(mime);i!==-1&&(this._types.splice(i,1),this._values.splice(i,1))},MimeData2.prototype.clear=function(){this._types.length=0,this._values.length=0},MimeData2}();function fallbackRandomValues(buffer){for(var value=0,i=0,n=buffer.length;i<n;++i)i%4===0&&(value=Math.random()*4294967295>>>0),buffer[i]=value&255,value>>>=8}var Random;(function(Random2){Random2.getRandomValues=function(){var crypto=typeof window<"u"&&(window.crypto||window.msCrypto)||null;return crypto&&typeof crypto.getRandomValues=="function"?function(buffer){return crypto.getRandomValues(buffer)}:fallbackRandomValues}()})(Random||(Random={}));function uuid4Factory(getRandomValues){for(var bytes=new Uint8Array(16),lut=new Array(256),i=0;i<16;++i)lut[i]="0"+i.toString(16);for(var i=16;i<256;++i)lut[i]=i.toString(16);return function(){return getRandomValues(bytes),bytes[6]=64|bytes[6]&15,bytes[8]=128|bytes[8]&63,lut[bytes[0]]+lut[bytes[1]]+lut[bytes[2]]+lut[bytes[3]]+"-"+lut[bytes[4]]+lut[bytes[5]]+"-"+lut[bytes[6]]+lut[bytes[7]]+"-"+lut[bytes[8]]+lut[bytes[9]]+"-"+lut[bytes[10]]+lut[bytes[11]]+lut[bytes[12]]+lut[bytes[13]]+lut[bytes[14]]+lut[bytes[15]]}}var UUID;(function(UUID2){UUID2.uuid4=uuid4Factory(Random.getRandomValues)})(UUID||(UUID={}));var AttachedProperty=function(){function AttachedProperty2(options){this._pid=Private$r.nextPID(),this.name=options.name,this._create=options.create,this._coerce=options.coerce||null,this._compare=options.compare||null,this._changed=options.changed||null}return AttachedProperty2.prototype.get=function(owner){var value,map2=Private$r.ensureMap(owner);return this._pid in map2?value=map2[this._pid]:value=map2[this._pid]=this._createValue(owner),value},AttachedProperty2.prototype.set=function(owner,value){var oldValue,map2=Private$r.ensureMap(owner);this._pid in map2?oldValue=map2[this._pid]:oldValue=map2[this._pid]=this._createValue(owner);var newValue=this._coerceValue(owner,value);this._maybeNotify(owner,oldValue,map2[this._pid]=newValue)},AttachedProperty2.prototype.coerce=function(owner){var oldValue,map2=Private$r.ensureMap(owner);this._pid in map2?oldValue=map2[this._pid]:oldValue=map2[this._pid]=this._createValue(owner);var newValue=this._coerceValue(owner,oldValue);this._maybeNotify(owner,oldValue,map2[this._pid]=newValue)},AttachedProperty2.prototype._createValue=function(owner){var create=this._create;return create(owner)},AttachedProperty2.prototype._coerceValue=function(owner,value){var coerce=this._coerce;return coerce?coerce(owner,value):value},AttachedProperty2.prototype._compareValue=function(oldValue,newValue){var compare=this._compare;return compare?compare(oldValue,newValue):oldValue===newValue},AttachedProperty2.prototype._maybeNotify=function(owner,oldValue,newValue){var changed=this._changed;changed&&!this._compareValue(oldValue,newValue)&&changed(owner,oldValue,newValue)},AttachedProperty2}();(function(AttachedProperty2){function clearData(owner){Private$r.ownerData.delete(owner)}AttachedProperty2.clearData=clearData})(AttachedProperty||(AttachedProperty={}));var Private$r;(function(Private2){Private2.ownerData=new WeakMap,Private2.nextPID=function(){var id=0;return function(){var rand=Math.random(),stem=(""+rand).slice(2);return"pid-"+stem+"-"+id++}}();function ensureMap(owner){var map2=Private2.ownerData.get(owner);return map2||(map2=Object.create(null),Private2.ownerData.set(owner,map2),map2)}Private2.ensureMap=ensureMap})(Private$r||(Private$r={}));var Signal=function(){function Signal2(sender){this._blockedCount=0,this.sender=sender}return Signal2.prototype.block=function(fn){this._blockedCount++;try{fn()}finally{this._blockedCount--}},Signal2.prototype.connect=function(slot,thisArg){return Private$q.connect(this,slot,thisArg)},Signal2.prototype.disconnect=function(slot,thisArg){return Private$q.disconnect(this,slot,thisArg)},Signal2.prototype.emit=function(args){this._blockedCount||Private$q.emit(this,args)},Signal2}();(function(Signal2){function blockAll(sender,fn){var blockedProperty=Private$q.blockedProperty;blockedProperty.set(sender,blockedProperty.get(sender)+1);try{fn()}finally{blockedProperty.set(sender,blockedProperty.get(sender)-1)}}Signal2.blockAll=blockAll;function disconnectBetween(sender,receiver){Private$q.disconnectBetween(sender,receiver)}Signal2.disconnectBetween=disconnectBetween;function disconnectSender(sender){Private$q.disconnectSender(sender)}Signal2.disconnectSender=disconnectSender;function disconnectReceiver(receiver){Private$q.disconnectReceiver(receiver)}Signal2.disconnectReceiver=disconnectReceiver;function disconnectAll(object){Private$q.disconnectAll(object)}Signal2.disconnectAll=disconnectAll;function clearData(object){Private$q.disconnectAll(object)}Signal2.clearData=clearData;function getExceptionHandler(){return Private$q.exceptionHandler}Signal2.getExceptionHandler=getExceptionHandler;function setExceptionHandler(handler){var old=Private$q.exceptionHandler;return Private$q.exceptionHandler=handler,old}Signal2.setExceptionHandler=setExceptionHandler})(Signal||(Signal={}));var Private$q;(function(Private2){Private2.exceptionHandler=function(err){console.error(err)};function connect(signal,slot,thisArg){thisArg=thisArg||void 0;var receivers=receiversForSender.get(signal.sender);if(receivers||(receivers=[],receiversForSender.set(signal.sender,receivers)),findConnection(receivers,signal,slot,thisArg))return!1;var receiver=thisArg||slot,senders=sendersForReceiver.get(receiver);senders||(senders=[],sendersForReceiver.set(receiver,senders));var connection={signal,slot,thisArg};return receivers.push(connection),senders.push(connection),!0}Private2.connect=connect;function disconnect(signal,slot,thisArg){thisArg=thisArg||void 0;var receivers=receiversForSender.get(signal.sender);if(!receivers||receivers.length===0)return!1;var connection=findConnection(receivers,signal,slot,thisArg);if(!connection)return!1;var receiver=thisArg||slot,senders=sendersForReceiver.get(receiver);return connection.signal=null,scheduleCleanup(receivers),scheduleCleanup(senders),!0}Private2.disconnect=disconnect;function disconnectBetween(sender,receiver){var receivers=receiversForSender.get(sender);if(!(!receivers||receivers.length===0)){var senders=sendersForReceiver.get(receiver);!senders||senders.length===0||(each(senders,function(connection){connection.signal&&connection.signal.sender===sender&&(connection.signal=null)}),scheduleCleanup(receivers),scheduleCleanup(senders))}}Private2.disconnectBetween=disconnectBetween;function disconnectSender(sender){var receivers=receiversForSender.get(sender);!receivers||receivers.length===0||(each(receivers,function(connection){if(connection.signal){var receiver=connection.thisArg||connection.slot;connection.signal=null,scheduleCleanup(sendersForReceiver.get(receiver))}}),scheduleCleanup(receivers))}Private2.disconnectSender=disconnectSender;function disconnectReceiver(receiver){var senders=sendersForReceiver.get(receiver);!senders||senders.length===0||(each(senders,function(connection){if(connection.signal){var sender=connection.signal.sender;connection.signal=null,scheduleCleanup(receiversForSender.get(sender))}}),scheduleCleanup(senders))}Private2.disconnectReceiver=disconnectReceiver;function disconnectAll(object){disconnectSender(object),disconnectReceiver(object)}Private2.disconnectAll=disconnectAll;function emit(signal,args){if(!(Private2.blockedProperty.get(signal.sender)>0)){var receivers=receiversForSender.get(signal.sender);if(!(!receivers||receivers.length===0))for(var i=0,n=receivers.length;i<n;++i){var connection=receivers[i];connection.signal===signal&&invokeSlot(connection,args)}}}Private2.emit=emit;var receiversForSender=new WeakMap,sendersForReceiver=new WeakMap,dirtySet=new Set,schedule=function(){var ok=typeof requestAnimationFrame=="function";return ok?requestAnimationFrame:setImmediate}();function findConnection(connections,signal,slot,thisArg){return find(connections,function(connection){return connection.signal===signal&&connection.slot===slot&&connection.thisArg===thisArg})}function invokeSlot(connection,args){var signal=connection.signal,slot=connection.slot,thisArg=connection.thisArg;try{slot.call(thisArg,signal.sender,args)}catch(err){Private2.exceptionHandler(err)}}function scheduleCleanup(array){dirtySet.size===0&&schedule(cleanupDirtySet),dirtySet.add(array)}function cleanupDirtySet(){dirtySet.forEach(cleanupConnections),dirtySet.clear()}function cleanupConnections(connections){ArrayExt.removeAllWhere(connections,isDeadConnection)}function isDeadConnection(connection){return connection.signal===null}Private2.blockedProperty=new AttachedProperty({name:"blocked",create:function(){return 0}})})(Private$q||(Private$q={}));/*! *****************************************************************************
3
2
  Copyright (c) Microsoft Corporation.
4
3
 
5
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,7 +11,7 @@
12
11
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
13
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var extendStatics$3=function(d,b){return extendStatics$3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$3(d,b)};function __extends$3(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$3(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var DisposableDelegate=function(){function DisposableDelegate2(fn){this._fn=fn}return Object.defineProperty(DisposableDelegate2.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),DisposableDelegate2.prototype.dispose=function(){if(this._fn){var fn=this._fn;this._fn=null,fn()}},DisposableDelegate2}();(function(_super){__extends$3(ObservableDisposableDelegate,_super);function ObservableDisposableDelegate(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._disposed=new Signal(_this),_this}return Object.defineProperty(ObservableDisposableDelegate.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),ObservableDisposableDelegate.prototype.dispose=function(){this.isDisposed||(_super.prototype.dispose.call(this),this._disposed.emit(void 0),Signal.clearData(this))},ObservableDisposableDelegate})(DisposableDelegate);var DisposableSet=function(){function DisposableSet2(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(DisposableSet2.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),DisposableSet2.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(item){item.dispose()}),this._items.clear())},DisposableSet2.prototype.contains=function(item){return this._items.has(item)},DisposableSet2.prototype.add=function(item){this._items.add(item)},DisposableSet2.prototype.remove=function(item){this._items.delete(item)},DisposableSet2.prototype.clear=function(){this._items.clear()},DisposableSet2}();(function(DisposableSet2){function from(items){var set=new DisposableSet2;return each(items,function(item){set.add(item)}),set}DisposableSet2.from=from})(DisposableSet);var ObservableDisposableSet=function(_super){__extends$3(ObservableDisposableSet2,_super);function ObservableDisposableSet2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._disposed=new Signal(_this),_this}return Object.defineProperty(ObservableDisposableSet2.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),ObservableDisposableSet2.prototype.dispose=function(){this.isDisposed||(_super.prototype.dispose.call(this),this._disposed.emit(void 0),Signal.clearData(this))},ObservableDisposableSet2}(DisposableSet);(function(ObservableDisposableSet2){function from(items){var set=new ObservableDisposableSet2;return each(items,function(item){set.add(item)}),set}ObservableDisposableSet2.from=from})(ObservableDisposableSet);var ClipboardExt;(function(ClipboardExt2){function copyText(text){var body=document.body,handler=function(event){event.preventDefault(),event.stopPropagation(),event.clipboardData.setData("text",text),body.removeEventListener("copy",handler,!0)};body.addEventListener("copy",handler,!0),document.execCommand("copy")}ClipboardExt2.copyText=copyText})(ClipboardExt||(ClipboardExt={}));var ElementExt;(function(ElementExt2){function boxSizing(element){var style=window.getComputedStyle(element),bt=parseFloat(style.borderTopWidth)||0,bl=parseFloat(style.borderLeftWidth)||0,br=parseFloat(style.borderRightWidth)||0,bb=parseFloat(style.borderBottomWidth)||0,pt=parseFloat(style.paddingTop)||0,pl=parseFloat(style.paddingLeft)||0,pr=parseFloat(style.paddingRight)||0,pb=parseFloat(style.paddingBottom)||0,hs=bl+pl+pr+br,vs=bt+pt+pb+bb;return{borderTop:bt,borderLeft:bl,borderRight:br,borderBottom:bb,paddingTop:pt,paddingLeft:pl,paddingRight:pr,paddingBottom:pb,horizontalSum:hs,verticalSum:vs}}ElementExt2.boxSizing=boxSizing;function sizeLimits(element){var style=window.getComputedStyle(element),minWidth=parseFloat(style.minWidth)||0,minHeight=parseFloat(style.minHeight)||0,maxWidth=parseFloat(style.maxWidth)||1/0,maxHeight=parseFloat(style.maxHeight)||1/0;return maxWidth=Math.max(minWidth,maxWidth),maxHeight=Math.max(minHeight,maxHeight),{minWidth,minHeight,maxWidth,maxHeight}}ElementExt2.sizeLimits=sizeLimits;function hitTest(element,clientX,clientY){var rect=element.getBoundingClientRect();return clientX>=rect.left&&clientX<rect.right&&clientY>=rect.top&&clientY<rect.bottom}ElementExt2.hitTest=hitTest;function scrollIntoViewIfNeeded(area,element){var ar=area.getBoundingClientRect(),er=element.getBoundingClientRect();if(!(er.top<=ar.top&&er.bottom>=ar.bottom)){if(er.top<ar.top&&er.height<=ar.height){area.scrollTop-=ar.top-er.top;return}if(er.bottom>ar.bottom&&er.height>=ar.height){area.scrollTop-=ar.top-er.top;return}if(er.top<ar.top&&er.height>ar.height){area.scrollTop-=ar.bottom-er.bottom;return}if(er.bottom>ar.bottom&&er.height<ar.height){area.scrollTop-=ar.bottom-er.bottom;return}}}ElementExt2.scrollIntoViewIfNeeded=scrollIntoViewIfNeeded})(ElementExt||(ElementExt={}));var Platform;(function(Platform2){Platform2.IS_MAC=!!navigator.platform.match(/Mac/i),Platform2.IS_WIN=!!navigator.platform.match(/Win/i),Platform2.IS_IE=/Trident/.test(navigator.userAgent),Platform2.IS_EDGE=/Edge/.test(navigator.userAgent);function accelKey(event){return Platform2.IS_MAC?event.metaKey:event.ctrlKey}Platform2.accelKey=accelKey})(Platform||(Platform={}));var Selector;(function(Selector2){function calculateSpecificity(selector){if(selector in Private$p.specificityCache)return Private$p.specificityCache[selector];var result=Private$p.calculateSingle(selector);return Private$p.specificityCache[selector]=result}Selector2.calculateSpecificity=calculateSpecificity;function isValid(selector){if(selector in Private$p.validityCache)return Private$p.validityCache[selector];var result=!0;try{Private$p.testElem.querySelector(selector)}catch{result=!1}return Private$p.validityCache[selector]=result}Selector2.isValid=isValid;function matches(element,selector){return Private$p.protoMatchFunc.call(element,selector)}Selector2.matches=matches})(Selector||(Selector={}));var Private$p;(function(Private2){Private2.specificityCache=Object.create(null),Private2.validityCache=Object.create(null),Private2.testElem=document.createElement("div"),Private2.protoMatchFunc=function(){var proto=Element.prototype;return proto.matches||proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector||function(selector){var elem=this,matches=elem.ownerDocument?elem.ownerDocument.querySelectorAll(selector):[];return Array.prototype.indexOf.call(matches,elem)!==-1}}();function calculateSingle(selector){selector=selector.split(",",1)[0];var a=0,b=0,c=0;function match(re){var match2=selector.match(re);return match2===null?!1:(selector=selector.slice(match2[0].length),!0)}for(selector=selector.replace(NEGATION_RE," $1 ");selector.length>0;){if(match(ID_RE)){a++;continue}if(match(CLASS_RE)){b++;continue}if(match(ATTR_RE)){b++;continue}if(match(PSEUDO_ELEM_RE)){c++;continue}if(match(PSEDUO_CLASS_RE)){b++;continue}if(match(TYPE_RE)){c++;continue}if(!match(IGNORE_RE))return 0}return a=Math.min(a,255),b=Math.min(b,255),c=Math.min(c,255),a<<16|b<<8|c}Private2.calculateSingle=calculateSingle;var ID_RE=/^#[^\s\+>~#\.\[:]+/,CLASS_RE=/^\.[^\s\+>~#\.\[:]+/,ATTR_RE=/^\[[^\]]+\]/,TYPE_RE=/^[^\s\+>~#\.\[:]+/,PSEUDO_ELEM_RE=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,PSEDUO_CLASS_RE=/^:[^\s\+>~#\.\[:]+/,IGNORE_RE=/^[\s\+>~\*]+/,NEGATION_RE=/:not\(([^\)]+)\)/g})(Private$p||(Private$p={}));function getKeyboardLayout(){return Private$o.keyboardLayout}var KeycodeLayout=function(){function KeycodeLayout2(name2,codes,modifierKeys){modifierKeys===void 0&&(modifierKeys=[]),this.name=name2,this._codes=codes,this._keys=KeycodeLayout2.extractKeys(codes),this._modifierKeys=KeycodeLayout2.convertToKeySet(modifierKeys)}return KeycodeLayout2.prototype.keys=function(){return Object.keys(this._keys)},KeycodeLayout2.prototype.isValidKey=function(key){return key in this._keys},KeycodeLayout2.prototype.isModifierKey=function(key){return key in this._modifierKeys},KeycodeLayout2.prototype.keyForKeydownEvent=function(event){return this._codes[event.keyCode]||""},KeycodeLayout2}();(function(KeycodeLayout2){function extractKeys(codes){var keys=Object.create(null);for(var c in codes)keys[codes[c]]=!0;return keys}KeycodeLayout2.extractKeys=extractKeys;function convertToKeySet(keys){for(var keySet=Object(null),i=0,n=keys.length;i<n;++i)keySet[keys[i]]=!0;return keySet}KeycodeLayout2.convertToKeySet=convertToKeySet})(KeycodeLayout);var EN_US=new KeycodeLayout("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]),Private$o;(function(Private2){Private2.keyboardLayout=EN_US})(Private$o||(Private$o={}));/*! *****************************************************************************
14
+ ***************************************************************************** */var extendStatics$3=function(d,b){return extendStatics$3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$3(d,b)};function __extends$3(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$3(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var DisposableDelegate=function(){function DisposableDelegate2(fn){this._fn=fn}return Object.defineProperty(DisposableDelegate2.prototype,"isDisposed",{get:function(){return!this._fn},enumerable:!0,configurable:!0}),DisposableDelegate2.prototype.dispose=function(){if(this._fn){var fn=this._fn;this._fn=null,fn()}},DisposableDelegate2}();(function(_super){__extends$3(ObservableDisposableDelegate,_super);function ObservableDisposableDelegate(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._disposed=new Signal(_this),_this}return Object.defineProperty(ObservableDisposableDelegate.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),ObservableDisposableDelegate.prototype.dispose=function(){this.isDisposed||(_super.prototype.dispose.call(this),this._disposed.emit(void 0),Signal.clearData(this))},ObservableDisposableDelegate})(DisposableDelegate);var DisposableSet=function(){function DisposableSet2(){this._isDisposed=!1,this._items=new Set}return Object.defineProperty(DisposableSet2.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),DisposableSet2.prototype.dispose=function(){this._isDisposed||(this._isDisposed=!0,this._items.forEach(function(item){item.dispose()}),this._items.clear())},DisposableSet2.prototype.contains=function(item){return this._items.has(item)},DisposableSet2.prototype.add=function(item){this._items.add(item)},DisposableSet2.prototype.remove=function(item){this._items.delete(item)},DisposableSet2.prototype.clear=function(){this._items.clear()},DisposableSet2}();(function(DisposableSet2){function from(items){var set=new DisposableSet2;return each(items,function(item){set.add(item)}),set}DisposableSet2.from=from})(DisposableSet||(DisposableSet={}));var ObservableDisposableSet=function(_super){__extends$3(ObservableDisposableSet2,_super);function ObservableDisposableSet2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._disposed=new Signal(_this),_this}return Object.defineProperty(ObservableDisposableSet2.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),ObservableDisposableSet2.prototype.dispose=function(){this.isDisposed||(_super.prototype.dispose.call(this),this._disposed.emit(void 0),Signal.clearData(this))},ObservableDisposableSet2}(DisposableSet);(function(ObservableDisposableSet2){function from(items){var set=new ObservableDisposableSet2;return each(items,function(item){set.add(item)}),set}ObservableDisposableSet2.from=from})(ObservableDisposableSet||(ObservableDisposableSet={}));var ClipboardExt;(function(ClipboardExt2){function copyText(text){var body=document.body,handler=function(event){event.preventDefault(),event.stopPropagation(),event.clipboardData.setData("text",text),body.removeEventListener("copy",handler,!0)};body.addEventListener("copy",handler,!0),document.execCommand("copy")}ClipboardExt2.copyText=copyText})(ClipboardExt||(ClipboardExt={}));var ElementExt;(function(ElementExt2){function boxSizing(element){var style=window.getComputedStyle(element),bt=parseFloat(style.borderTopWidth)||0,bl=parseFloat(style.borderLeftWidth)||0,br=parseFloat(style.borderRightWidth)||0,bb=parseFloat(style.borderBottomWidth)||0,pt=parseFloat(style.paddingTop)||0,pl=parseFloat(style.paddingLeft)||0,pr=parseFloat(style.paddingRight)||0,pb=parseFloat(style.paddingBottom)||0,hs=bl+pl+pr+br,vs=bt+pt+pb+bb;return{borderTop:bt,borderLeft:bl,borderRight:br,borderBottom:bb,paddingTop:pt,paddingLeft:pl,paddingRight:pr,paddingBottom:pb,horizontalSum:hs,verticalSum:vs}}ElementExt2.boxSizing=boxSizing;function sizeLimits(element){var style=window.getComputedStyle(element),minWidth=parseFloat(style.minWidth)||0,minHeight=parseFloat(style.minHeight)||0,maxWidth=parseFloat(style.maxWidth)||1/0,maxHeight=parseFloat(style.maxHeight)||1/0;return maxWidth=Math.max(minWidth,maxWidth),maxHeight=Math.max(minHeight,maxHeight),{minWidth,minHeight,maxWidth,maxHeight}}ElementExt2.sizeLimits=sizeLimits;function hitTest(element,clientX,clientY){var rect=element.getBoundingClientRect();return clientX>=rect.left&&clientX<rect.right&&clientY>=rect.top&&clientY<rect.bottom}ElementExt2.hitTest=hitTest;function scrollIntoViewIfNeeded(area,element){var ar=area.getBoundingClientRect(),er=element.getBoundingClientRect();if(!(er.top<=ar.top&&er.bottom>=ar.bottom)){if(er.top<ar.top&&er.height<=ar.height){area.scrollTop-=ar.top-er.top;return}if(er.bottom>ar.bottom&&er.height>=ar.height){area.scrollTop-=ar.top-er.top;return}if(er.top<ar.top&&er.height>ar.height){area.scrollTop-=ar.bottom-er.bottom;return}if(er.bottom>ar.bottom&&er.height<ar.height){area.scrollTop-=ar.bottom-er.bottom;return}}}ElementExt2.scrollIntoViewIfNeeded=scrollIntoViewIfNeeded})(ElementExt||(ElementExt={}));var Platform;(function(Platform2){Platform2.IS_MAC=!!navigator.platform.match(/Mac/i),Platform2.IS_WIN=!!navigator.platform.match(/Win/i),Platform2.IS_IE=/Trident/.test(navigator.userAgent),Platform2.IS_EDGE=/Edge/.test(navigator.userAgent);function accelKey(event){return Platform2.IS_MAC?event.metaKey:event.ctrlKey}Platform2.accelKey=accelKey})(Platform||(Platform={}));var Selector;(function(Selector2){function calculateSpecificity(selector){if(selector in Private$p.specificityCache)return Private$p.specificityCache[selector];var result=Private$p.calculateSingle(selector);return Private$p.specificityCache[selector]=result}Selector2.calculateSpecificity=calculateSpecificity;function isValid(selector){if(selector in Private$p.validityCache)return Private$p.validityCache[selector];var result=!0;try{Private$p.testElem.querySelector(selector)}catch{result=!1}return Private$p.validityCache[selector]=result}Selector2.isValid=isValid;function matches(element,selector){return Private$p.protoMatchFunc.call(element,selector)}Selector2.matches=matches})(Selector||(Selector={}));var Private$p;(function(Private2){Private2.specificityCache=Object.create(null),Private2.validityCache=Object.create(null),Private2.testElem=document.createElement("div"),Private2.protoMatchFunc=function(){var proto=Element.prototype;return proto.matches||proto.matchesSelector||proto.mozMatchesSelector||proto.msMatchesSelector||proto.oMatchesSelector||proto.webkitMatchesSelector||function(selector){var elem=this,matches=elem.ownerDocument?elem.ownerDocument.querySelectorAll(selector):[];return Array.prototype.indexOf.call(matches,elem)!==-1}}();function calculateSingle(selector){selector=selector.split(",",1)[0];var a=0,b=0,c=0;function match(re){var match2=selector.match(re);return match2===null?!1:(selector=selector.slice(match2[0].length),!0)}for(selector=selector.replace(NEGATION_RE," $1 ");selector.length>0;){if(match(ID_RE)){a++;continue}if(match(CLASS_RE)){b++;continue}if(match(ATTR_RE)){b++;continue}if(match(PSEUDO_ELEM_RE)){c++;continue}if(match(PSEDUO_CLASS_RE)){b++;continue}if(match(TYPE_RE)){c++;continue}if(!match(IGNORE_RE))return 0}return a=Math.min(a,255),b=Math.min(b,255),c=Math.min(c,255),a<<16|b<<8|c}Private2.calculateSingle=calculateSingle;var ID_RE=/^#[^\s\+>~#\.\[:]+/,CLASS_RE=/^\.[^\s\+>~#\.\[:]+/,ATTR_RE=/^\[[^\]]+\]/,TYPE_RE=/^[^\s\+>~#\.\[:]+/,PSEUDO_ELEM_RE=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/,PSEDUO_CLASS_RE=/^:[^\s\+>~#\.\[:]+/,IGNORE_RE=/^[\s\+>~\*]+/,NEGATION_RE=/:not\(([^\)]+)\)/g})(Private$p||(Private$p={}));function getKeyboardLayout(){return Private$o.keyboardLayout}var KeycodeLayout=function(){function KeycodeLayout2(name2,codes,modifierKeys){modifierKeys===void 0&&(modifierKeys=[]),this.name=name2,this._codes=codes,this._keys=KeycodeLayout2.extractKeys(codes),this._modifierKeys=KeycodeLayout2.convertToKeySet(modifierKeys)}return KeycodeLayout2.prototype.keys=function(){return Object.keys(this._keys)},KeycodeLayout2.prototype.isValidKey=function(key){return key in this._keys},KeycodeLayout2.prototype.isModifierKey=function(key){return key in this._modifierKeys},KeycodeLayout2.prototype.keyForKeydownEvent=function(event){return this._codes[event.keyCode]||""},KeycodeLayout2}();(function(KeycodeLayout2){function extractKeys(codes){var keys=Object.create(null);for(var c in codes)keys[codes[c]]=!0;return keys}KeycodeLayout2.extractKeys=extractKeys;function convertToKeySet(keys){for(var keySet=Object(null),i=0,n=keys.length;i<n;++i)keySet[keys[i]]=!0;return keySet}KeycodeLayout2.convertToKeySet=convertToKeySet})(KeycodeLayout||(KeycodeLayout={}));var EN_US=new KeycodeLayout("en-us",{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",27:"Escape",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",61:"=",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",93:"ContextMenu",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Meta"},["Shift","Ctrl","Alt","Meta"]),Private$o;(function(Private2){Private2.keyboardLayout=EN_US})(Private$o||(Private$o={}));/*! *****************************************************************************
16
15
  Copyright (c) Microsoft Corporation.
17
16
 
18
17
  Permission to use, copy, modify, and/or distribute this software for any
@@ -25,7 +24,7 @@
25
24
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26
25
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
26
  PERFORMANCE OF THIS SOFTWARE.
28
- ***************************************************************************** */var __assign$1=function(){return __assign$1=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign$1.apply(this,arguments)},CommandRegistry=function(){function CommandRegistry2(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new Signal(this),this._commandExecuted=new Signal(this),this._keyBindingChanged=new Signal(this)}return Object.defineProperty(CommandRegistry2.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry2.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry2.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry2.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),CommandRegistry2.prototype.listCommands=function(){return Object.keys(this._commands)},CommandRegistry2.prototype.hasCommand=function(id){return id in this._commands},CommandRegistry2.prototype.addCommand=function(id,options){var _this=this;if(id in this._commands)throw new Error("Command '"+id+"' already registered.");return this._commands[id]=Private$n.createCommand(options),this._commandChanged.emit({id,type:"added"}),new DisposableDelegate(function(){delete _this._commands[id],_this._commandChanged.emit({id,type:"removed"})})},CommandRegistry2.prototype.notifyCommandChanged=function(id){if(id!==void 0&&!(id in this._commands))throw new Error("Command '"+id+"' is not registered.");this._commandChanged.emit({id,type:id?"changed":"many-changed"})},CommandRegistry2.prototype.describedBy=function(id){var cmd=this._commands[id];return cmd?cmd.describedBy||{args:null}:{args:null}},CommandRegistry2.prototype.label=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.label.call(void 0,args):""},CommandRegistry2.prototype.mnemonic=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.mnemonic.call(void 0,args):-1},CommandRegistry2.prototype.icon=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.icon.call(void 0,args):""},CommandRegistry2.prototype.iconClass=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.iconClass.call(void 0,args):""},CommandRegistry2.prototype.iconLabel=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.iconLabel.call(void 0,args):""},CommandRegistry2.prototype.caption=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.caption.call(void 0,args):""},CommandRegistry2.prototype.usage=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.usage.call(void 0,args):""},CommandRegistry2.prototype.className=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.className.call(void 0,args):""},CommandRegistry2.prototype.dataset=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.dataset.call(void 0,args):{}},CommandRegistry2.prototype.isEnabled=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isEnabled.call(void 0,args):!1},CommandRegistry2.prototype.isToggled=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isToggled.call(void 0,args):!1},CommandRegistry2.prototype.isToggleable=function(id,args){var cmd=this._commands[id];return cmd?cmd.isToggleable:!1},CommandRegistry2.prototype.isVisible=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isVisible.call(void 0,args):!1},CommandRegistry2.prototype.execute=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];if(!cmd)return Promise.reject(new Error("Command '"+id+"' not registered."));var value;try{value=cmd.execute.call(void 0,args)}catch(err){value=Promise.reject(err)}var result=Promise.resolve(value);return this._commandExecuted.emit({id,args,result}),result},CommandRegistry2.prototype.addKeyBinding=function(options){var _this=this,binding=Private$n.createKeyBinding(options);return this._keyBindings.push(binding),this._keyBindingChanged.emit({binding,type:"added"}),new DisposableDelegate(function(){ArrayExt.removeFirstOf(_this._keyBindings,binding),_this._keyBindingChanged.emit({binding,type:"removed"})})},CommandRegistry2.prototype.processKeydownEvent=function(event){if(!(this._replaying||CommandRegistry2.isModifierKeyPressed(event))){var keystroke=CommandRegistry2.keystrokeForKeydownEvent(event);if(!keystroke){this._replayKeydownEvents(),this._clearPendingState();return}this._keystrokes.push(keystroke);var _a=Private$n.matchKeyBinding(this._keyBindings,this._keystrokes,event),exact=_a.exact,partial=_a.partial;if(!exact&&!partial){this._replayKeydownEvents(),this._clearPendingState();return}if(event.preventDefault(),event.stopPropagation(),exact&&!partial){this._executeKeyBinding(exact),this._clearPendingState();return}exact&&(this._exactKeyMatch=exact),this._keydownEvents.push(event),this._startTimer()}},CommandRegistry2.prototype._startTimer=function(){var _this=this;this._clearTimer(),this._timerID=window.setTimeout(function(){_this._onPendingTimeout()},Private$n.CHORD_TIMEOUT)},CommandRegistry2.prototype._clearTimer=function(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)},CommandRegistry2.prototype._replayKeydownEvents=function(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Private$n.replayKeyEvent),this._replaying=!1)},CommandRegistry2.prototype._executeKeyBinding=function(binding){var command=binding.command,args=binding.args;if(!this.hasCommand(command)||!this.isEnabled(command,args)){var word=this.hasCommand(command)?"enabled":"registered",keys=binding.keys.join(", "),msg1="Cannot execute key binding '"+keys+"':",msg2="command '"+command+"' is not "+word+".";console.warn(msg1+" "+msg2);return}this.execute(command,args)},CommandRegistry2.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},CommandRegistry2.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},CommandRegistry2}();(function(CommandRegistry2){function parseKeystroke(keystroke){for(var key="",alt=!1,cmd=!1,ctrl=!1,shift=!1,_i=0,_a=keystroke.split(/\s+/);_i<_a.length;_i++){var token=_a[_i];token==="Accel"?Platform.IS_MAC?cmd=!0:ctrl=!0:token==="Alt"?alt=!0:token==="Cmd"?cmd=!0:token==="Ctrl"?ctrl=!0:token==="Shift"?shift=!0:token.length>0&&(key=token)}return{cmd,ctrl,alt,shift,key}}CommandRegistry2.parseKeystroke=parseKeystroke;function normalizeKeystroke(keystroke){var mods="",parts=parseKeystroke(keystroke);return parts.ctrl&&(mods+="Ctrl "),parts.alt&&(mods+="Alt "),parts.shift&&(mods+="Shift "),parts.cmd&&Platform.IS_MAC&&(mods+="Cmd "),mods+parts.key}CommandRegistry2.normalizeKeystroke=normalizeKeystroke;function normalizeKeys(options){var keys;return Platform.IS_WIN?keys=options.winKeys||options.keys:Platform.IS_MAC?keys=options.macKeys||options.keys:keys=options.linuxKeys||options.keys,keys.map(normalizeKeystroke)}CommandRegistry2.normalizeKeys=normalizeKeys;function formatKeystroke(keystroke){return typeof keystroke=="string"?formatSingleKey(keystroke):keystroke.map(formatSingleKey).join(", ");function formatSingleKey(key){var mods=[],separator=Platform.IS_MAC?" ":"+",parts=parseKeystroke(key);return parts.ctrl&&mods.push("Ctrl"),parts.alt&&mods.push("Alt"),parts.shift&&mods.push("Shift"),Platform.IS_MAC&&parts.cmd&&mods.push("Cmd"),mods.push(parts.key),mods.map(Private$n.formatKey).join(separator)}}CommandRegistry2.formatKeystroke=formatKeystroke;function isModifierKeyPressed(event){var layout=getKeyboardLayout(),key=layout.keyForKeydownEvent(event);return layout.isModifierKey(key)}CommandRegistry2.isModifierKeyPressed=isModifierKeyPressed;function keystrokeForKeydownEvent(event){var layout=getKeyboardLayout(),key=layout.keyForKeydownEvent(event);if(!key||layout.isModifierKey(key))return"";var mods=[];return event.ctrlKey&&mods.push("Ctrl"),event.altKey&&mods.push("Alt"),event.shiftKey&&mods.push("Shift"),event.metaKey&&Platform.IS_MAC&&mods.push("Cmd"),mods.push(key),mods.join(" ")}CommandRegistry2.keystrokeForKeydownEvent=keystrokeForKeydownEvent})(CommandRegistry);var Private$n;(function(Private2){Private2.CHORD_TIMEOUT=1e3;function createCommand(options){var icon,iconClass;return!options.icon||typeof options.icon=="string"?(iconClass=asFunc(options.iconClass||options.icon,emptyStringFunc),icon=iconClass):(iconClass=asFunc(options.iconClass,emptyStringFunc),icon=asFunc(options.icon,undefinedFunc)),{execute:options.execute,describedBy:__assign$1({args:null},options.describedBy),label:asFunc(options.label,emptyStringFunc),mnemonic:asFunc(options.mnemonic,negativeOneFunc),icon,iconClass,iconLabel:asFunc(options.iconLabel,emptyStringFunc),caption:asFunc(options.caption,emptyStringFunc),usage:asFunc(options.usage,emptyStringFunc),className:asFunc(options.className,emptyStringFunc),dataset:asFunc(options.dataset,emptyDatasetFunc),isEnabled:options.isEnabled||trueFunc,isToggled:options.isToggled||falseFunc,isToggleable:options.isToggleable||!!options.isToggled,isVisible:options.isVisible||trueFunc}}Private2.createCommand=createCommand;function createKeyBinding(options){return{keys:CommandRegistry.normalizeKeys(options),selector:validateSelector(options),command:options.command,args:options.args||JSONExt.emptyObject}}Private2.createKeyBinding=createKeyBinding;function matchKeyBinding(bindings,keys,event){for(var exact=null,partial=!1,distance=1/0,specificity=0,i=0,n=bindings.length;i<n;++i){var binding=bindings[i],sqm=matchSequence(binding.keys,keys);if(sqm!==0){if(sqm===2){!partial&&targetDistance(binding.selector,event)!==-1&&(partial=!0);continue}var td=targetDistance(binding.selector,event);if(!(td===-1||td>distance)){var sp=Selector.calculateSpecificity(binding.selector);(!exact||td<distance||sp>=specificity)&&(exact=binding,distance=td,specificity=sp)}}}return{exact,partial}}Private2.matchKeyBinding=matchKeyBinding;function replayKeyEvent(event){event.target.dispatchEvent(cloneKeyboardEvent(event))}Private2.replayKeyEvent=replayKeyEvent;function formatKey(key){return Platform.IS_MAC?MAC_DISPLAY.hasOwnProperty(key)?MAC_DISPLAY[key]:key:WIN_DISPLAY.hasOwnProperty(key)?WIN_DISPLAY[key]:key}Private2.formatKey=formatKey;var MAC_DISPLAY={Backspace:"⌫",Tab:"⇥",Enter:"↩",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},WIN_DISPLAY={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},emptyStringFunc=function(){return""},negativeOneFunc=function(){return-1},trueFunc=function(){return!0},falseFunc=function(){return!1},emptyDatasetFunc=function(){return{}},undefinedFunc=function(){};function asFunc(value,dfault){return value===void 0?dfault:typeof value=="function"?value:function(){return value}}function validateSelector(options){if(options.selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+options.selector);if(!Selector.isValid(options.selector))throw new Error("Invalid selector: "+options.selector);return options.selector}function matchSequence(bindKeys,userKeys){if(bindKeys.length<userKeys.length)return 0;for(var i=0,n=userKeys.length;i<n;++i)if(bindKeys[i]!==userKeys[i])return 0;return bindKeys.length>userKeys.length?2:1}function targetDistance(selector,event){for(var targ=event.target,curr=event.currentTarget,dist=0;targ!==null;targ=targ.parentElement,++dist){if(targ.hasAttribute("data-lm-suppress-shortcuts")||targ.hasAttribute("data-p-suppress-shortcuts"))return-1;if(Selector.matches(targ,selector))return dist;if(targ===curr)return-1}return-1}function cloneKeyboardEvent(event){var clone=document.createEvent("Event"),bubbles=event.bubbles||!0,cancelable=event.cancelable||!0;return clone.initEvent(event.type||"keydown",bubbles,cancelable),clone.key=event.key||"",clone.keyCode=event.keyCode||0,clone.which=event.keyCode||0,clone.ctrlKey=event.ctrlKey||!1,clone.altKey=event.altKey||!1,clone.shiftKey=event.shiftKey||!1,clone.metaKey=event.metaKey||!1,clone.view=event.view||window,clone}})(Private$n||(Private$n={}));var BPlusTree=function(){function BPlusTree2(cmp){this._root=new Private$1$1.LeafNode,this.cmp=cmp}return Object.defineProperty(BPlusTree2.prototype,"isEmpty",{get:function(){return this._root.size===0},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"first",{get:function(){var node=Private$1$1.firstLeaf(this._root);return node.size>0?node.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"last",{get:function(){var node=Private$1$1.lastLeaf(this._root);return node.size>0?node.items[node.size-1]:void 0},enumerable:!0,configurable:!0}),BPlusTree2.prototype.iter=function(){return Private$1$1.iterItems(this._root)},BPlusTree2.prototype.retro=function(){return Private$1$1.retroItems(this._root)},BPlusTree2.prototype.slice=function(start,stop){return Private$1$1.sliceItems(this._root,start,stop)},BPlusTree2.prototype.retroSlice=function(start,stop){return Private$1$1.retroSliceItems(this._root,start,stop)},BPlusTree2.prototype.at=function(index){return Private$1$1.itemAt(this._root,index)},BPlusTree2.prototype.has=function(key,cmp){return Private$1$1.hasItem(this._root,key,cmp)},BPlusTree2.prototype.indexOf=function(key,cmp){return Private$1$1.indexOf(this._root,key,cmp)},BPlusTree2.prototype.get=function(key,cmp){return Private$1$1.getItem(this._root,key,cmp)},BPlusTree2.prototype.assign=function(items){this.clear(),this.update(items)},BPlusTree2.prototype.insert=function(item){var existing=Private$1$1.insertItem(this._root,item,this.cmp);return this._root=Private$1$1.maybeSplitRoot(this._root),existing},BPlusTree2.prototype.update=function(items){var _this=this;each(items,function(item){_this.insert(item)})},BPlusTree2.prototype.delete=function(key,cmp){var item=Private$1$1.deleteItem(this._root,key,cmp);return this._root=Private$1$1.maybeExtractRoot(this._root),item},BPlusTree2.prototype.remove=function(index){var item=Private$1$1.removeItem(this._root,index);return this._root=Private$1$1.maybeExtractRoot(this._root),item},BPlusTree2.prototype.clear=function(){Private$1$1.clear(this._root),this._root=new Private$1$1.LeafNode},BPlusTree2}();(function(BPlusTree2){function from(items,cmp){var tree=new BPlusTree2(cmp);return tree.assign(items),tree}BPlusTree2.from=from})(BPlusTree);var Private$1$1;(function(Private2){var BranchNode=function(){function BranchNode2(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(BranchNode2.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(BranchNode2.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(BranchNode2.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),BranchNode2}();Private2.BranchNode=BranchNode;var LeafNode=function(){function LeafNode2(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(LeafNode2.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(LeafNode2.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(LeafNode2.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),LeafNode2}();Private2.LeafNode=LeafNode;function firstLeaf(node){for(;node.type===0;)node=node.children[0];return node}Private2.firstLeaf=firstLeaf;function lastLeaf(node){for(;node.type===0;)node=node.children[node.children.length-1];return node}Private2.lastLeaf=lastLeaf;function iterItems(node){var leaf=firstLeaf(node);return new ForwardIterator(leaf,0,-1)}Private2.iterItems=iterItems;function retroItems(node){var leaf=lastLeaf(node);return new RetroIterator(leaf,leaf.size-1,-1)}Private2.retroItems=retroItems;function sliceItems(node,start,stop){start===void 0?start=0:start<0?start=Math.max(0,start+node.size):start=Math.min(start,node.size),stop===void 0?stop=node.size:stop<0?stop=Math.max(0,stop+node.size):stop=Math.min(stop,node.size);var count=Math.max(0,stop-start);if(count===0)return empty();for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,start);i>0&&(start-=node.sizes[i-1]),node=node.children[i]}return new ForwardIterator(node,start,count)}Private2.sliceItems=sliceItems;function retroSliceItems(node,start,stop){start===void 0?start=node.size-1:start<0?start=Math.max(-1,start+node.size):start=Math.min(start,node.size-1),stop===void 0?stop=-1:stop<0?stop=Math.max(-1,stop+node.size):stop=Math.min(stop,node.size-1);var count=Math.max(0,start-stop);if(count===0)return empty();for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,start);i>0&&(start-=node.sizes[i-1]),node=node.children[i]}return new RetroIterator(node,start,count)}Private2.retroSliceItems=retroSliceItems;function itemAt(node,index){if(index<0&&(index+=node.size),!(index<0||index>=node.size)){for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,index);i>0&&(index-=node.sizes[i-1]),node=node.children[i]}return node.items[index]}}Private2.itemAt=itemAt;function hasItem(node,key,cmp){for(;node.type===0;){var i_1=findPivotIndexByKey(node.items,key,cmp);node=node.children[i_1]}var i=findKeyIndex(node.items,key,cmp);return i>=0}Private2.hasItem=hasItem;function indexOf(node,key,cmp){for(var index=0;node.type===0;){var i_2=findPivotIndexByKey(node.items,key,cmp);i_2>0&&(index+=node.sizes[i_2-1]),node=node.children[i_2]}var i=findKeyIndex(node.items,key,cmp);return i>=0?index+i:-index+i}Private2.indexOf=indexOf;function getItem(node,key,cmp){for(;node.type===0;){var i_3=findPivotIndexByKey(node.items,key,cmp);node=node.children[i_3]}var i=findKeyIndex(node.items,key,cmp);return i>=0?node.items[i]:void 0}Private2.getItem=getItem;function insertItem(node,item,cmp){if(node.type===1){var i_4=findKeyIndex(node.items,item,cmp),existing_1;return i_4>=0?(existing_1=node.items[i_4],node.items[i_4]=item):(existing_1=void 0,ArrayExt.insert(node.items,-i_4-1,item)),existing_1}var i=findPivotIndexByKey(node.items,item,cmp),child=node.children[i],prevSize=child.size,existing=insertItem(child,item,cmp),currSize=child.size;if(node.items[i]=child.items[0],prevSize===currSize)return existing;if(child.width>MAX_NODE_WIDTH){var next=splitNode(child);ArrayExt.insert(node.children,i+1,next),ArrayExt.insert(node.items,i+1,next.items[0])}return updateSizes(node,i),existing}Private2.insertItem=insertItem;function deleteItem(node,key,cmp){if(node.type===1){var i_5=findKeyIndex(node.items,key,cmp);return i_5<0?void 0:ArrayExt.removeAt(node.items,i_5)}var i=findPivotIndexByKey(node.items,key,cmp),child=node.children[i],prevSize=child.size,item=deleteItem(child,key,cmp),currSize=child.size;return prevSize===currSize||(node.items[i]=child.items[0],child.width<MIN_NODE_WIDTH&&(i=joinChild(node,i)),updateSizes(node,i)),item}Private2.deleteItem=deleteItem;function removeItem(node,index){if(index<0&&(index+=node.size),!(index<0||index>=node.size)){if(node.type===1)return ArrayExt.removeAt(node.items,index);var i=findPivotIndexByIndex(node.sizes,index);i>0&&(index-=node.sizes[i]);var child=node.children[i],item=removeItem(child,index);return node.items[i]=child.items[0],child.width<MIN_NODE_WIDTH&&(i=joinChild(node,i)),updateSizes(node,i),item}}Private2.removeItem=removeItem;function clear(node){node.type===0?(each(node.children,clear),node.children.length=0,node.sizes.length=0,node.items.length=0):(node.items.length=0,node.next=null,node.prev=null)}Private2.clear=clear;function maybeSplitRoot(node){if(node.width<=MAX_NODE_WIDTH)return node;var root=new BranchNode,next=splitNode(node);return root.sizes[0]=node.size,root.sizes[1]=node.size+next.size,root.children[0]=node,root.children[1]=next,root.items[0]=node.items[0],root.items[1]=next.items[0],root}Private2.maybeSplitRoot=maybeSplitRoot;function maybeExtractRoot(node){if(node.type===1||node.children.length>1)return node;var root=node.children.pop();return clear(node),root}Private2.maybeExtractRoot=maybeExtractRoot;var MAX_NODE_WIDTH=32,MIN_NODE_WIDTH=MAX_NODE_WIDTH>>1,ForwardIterator=function(){function ForwardIterator2(node,index,count){this._node=node,this._index=index,this._count=count}return ForwardIterator2.prototype.iter=function(){return this},ForwardIterator2.prototype.clone=function(){return new ForwardIterator2(this._node,this._index,this._count)},ForwardIterator2.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},ForwardIterator2}(),RetroIterator=function(){function RetroIterator2(node,index,count){this._node=node,this._index=index,this._count=count}return RetroIterator2.prototype.iter=function(){return this},RetroIterator2.prototype.clone=function(){return new RetroIterator2(this._node,this._index,this._count)},RetroIterator2.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},RetroIterator2}();function findPivotIndexByIndex(sizes,index){for(var n=sizes.length,i=0;i<n;++i)if(sizes[i]>index)return i;return n-1}function findPivotIndexByKey(items,key,cmp){for(var n=items.length,i=1;i<n;++i)if(cmp(items[i],key)>0)return i-1;return n-1}function findKeyIndex(items,key,cmp){for(var n=items.length,i=0;i<n;++i){var c=cmp(items[i],key);if(c===0)return i;if(c>0)return-i-1}return-n-1}function updateSizes(node,i){for(var sizes=node.sizes,children=node.children,last=i>0?sizes[i-1]:0,n=children.length;i<n;++i)last=sizes[i]=last+children[i].size;sizes.length=children.length}function splitNode(node){if(node.type===1){for(var next_1=new LeafNode,v1_1=node.items,v2_1=next_1.items,i=MIN_NODE_WIDTH,n=v1_1.length;i<n;++i)v2_1.push(v1_1[i]);return v1_1.length=MIN_NODE_WIDTH,node.next&&(node.next.prev=next_1),next_1.next=node.next,next_1.prev=node,node.next=next_1,next_1}for(var next=new BranchNode,c1=node.children,c2=next.children,i=MIN_NODE_WIDTH,n=c1.length;i<n;++i)c2.push(c1[i]);c1.length=MIN_NODE_WIDTH;for(var v1=node.items,v2=next.items,i=MIN_NODE_WIDTH,n=v1.length;i<n;++i)v2.push(v1[i]);return v1.length=MIN_NODE_WIDTH,updateSizes(node,MIN_NODE_WIDTH),updateSizes(next,0),next}function joinChild(node,i){var _a,_b,_c,_d,_e,_f,child=node.children[i],sibling=i===0?node.children[i+1]:node.children[i-1],hasNext=i===0,isLeaf=child.type===1,hasExtra=sibling.width>MIN_NODE_WIDTH;if(isLeaf&&hasExtra&&hasNext){var c=child,s=sibling;return c.items.push(s.items.shift()),node.items[i+1]=s.items[0],i}if(isLeaf&&hasExtra&&!hasNext){var c=child,s=sibling;return c.items.unshift(s.items.pop()),node.items[i]=c.items[0],i-1}if(isLeaf&&!hasExtra&&hasNext){var c=child,s=sibling;return(_a=s.items).unshift.apply(_a,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i+1),c.prev&&(c.prev.next=s),s.prev=c.prev,clear(c),i}if(isLeaf&&!hasExtra&&!hasNext){var c=child,s=sibling;return(_b=s.items).push.apply(_b,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i),c.next&&(c.next.prev=s),s.next=c.next,clear(c),i-1}if(!isLeaf&&hasExtra&&hasNext){var c=child,s=sibling;return c.children.push(s.children.shift()),c.items.push(s.items.shift()),node.items[i+1]=s.items[0],updateSizes(c,c.width-1),updateSizes(s,0),i}if(!isLeaf&&hasExtra&&!hasNext){var c=child,s=sibling;return c.children.unshift(s.children.pop()),c.items.unshift(s.items.pop()),node.items[i]=c.items[0],updateSizes(c,0),updateSizes(s,s.width-1),i-1}if(!isLeaf&&!hasExtra&&hasNext){var c=child,s=sibling;return(_c=s.children).unshift.apply(_c,c.children),(_d=s.items).unshift.apply(_d,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i+1),updateSizes(s,0),c.children.length=0,clear(c),i}if(!isLeaf&&!hasExtra&&!hasNext){var c=child,s=sibling;return(_e=s.children).push.apply(_e,c.children),(_f=s.items).push.apply(_f,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i),updateSizes(s,0),c.children.length=0,clear(c),i-1}throw"unreachable"}})(Private$1$1||(Private$1$1={}));var LinkedList=function(){function LinkedList2(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(LinkedList2.prototype,"isEmpty",{get:function(){return this._size===0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),LinkedList2.prototype.iter=function(){return new LinkedList2.ForwardValueIterator(this._first)},LinkedList2.prototype.retro=function(){return new LinkedList2.RetroValueIterator(this._last)},LinkedList2.prototype.nodes=function(){return new LinkedList2.ForwardNodeIterator(this._first)},LinkedList2.prototype.retroNodes=function(){return new LinkedList2.RetroNodeIterator(this._last)},LinkedList2.prototype.assign=function(values){var _this=this;this.clear(),each(values,function(value){_this.addLast(value)})},LinkedList2.prototype.push=function(value){this.addLast(value)},LinkedList2.prototype.pop=function(){return this.removeLast()},LinkedList2.prototype.shift=function(value){this.addFirst(value)},LinkedList2.prototype.unshift=function(){return this.removeFirst()},LinkedList2.prototype.addFirst=function(value){var node=new Private$m.LinkedListNode(this,value);return this._first?(node.next=this._first,this._first.prev=node,this._first=node):(this._first=node,this._last=node),this._size++,node},LinkedList2.prototype.addLast=function(value){var node=new Private$m.LinkedListNode(this,value);return this._last?(node.prev=this._last,this._last.next=node,this._last=node):(this._first=node,this._last=node),this._size++,node},LinkedList2.prototype.insertBefore=function(value,ref){if(!ref||ref===this._first)return this.addFirst(value);if(!(ref instanceof Private$m.LinkedListNode)||ref.list!==this)throw new Error("Reference node is not owned by the list.");var node=new Private$m.LinkedListNode(this,value),_ref=ref,prev=_ref.prev;return node.next=_ref,node.prev=prev,_ref.prev=node,prev.next=node,this._size++,node},LinkedList2.prototype.insertAfter=function(value,ref){if(!ref||ref===this._last)return this.addLast(value);if(!(ref instanceof Private$m.LinkedListNode)||ref.list!==this)throw new Error("Reference node is not owned by the list.");var node=new Private$m.LinkedListNode(this,value),_ref=ref,next=_ref.next;return node.next=next,node.prev=_ref,_ref.next=node,next.prev=node,this._size++,node},LinkedList2.prototype.removeFirst=function(){var node=this._first;if(node)return node===this._last?(this._first=null,this._last=null):(this._first=node.next,this._first.prev=null),node.list=null,node.next=null,node.prev=null,this._size--,node.value},LinkedList2.prototype.removeLast=function(){var node=this._last;if(node)return node===this._first?(this._first=null,this._last=null):(this._last=node.prev,this._last.next=null),node.list=null,node.next=null,node.prev=null,this._size--,node.value},LinkedList2.prototype.removeNode=function(node){if(!(node instanceof Private$m.LinkedListNode)||node.list!==this)throw new Error("Node is not owned by the list.");var _node=node;_node===this._first&&_node===this._last?(this._first=null,this._last=null):_node===this._first?(this._first=_node.next,this._first.prev=null):_node===this._last?(this._last=_node.prev,this._last.next=null):(_node.next.prev=_node.prev,_node.prev.next=_node.next),_node.list=null,_node.next=null,_node.prev=null,this._size--},LinkedList2.prototype.clear=function(){for(var node=this._first;node;){var next=node.next;node.list=null,node.prev=null,node.next=null,node=next}this._first=null,this._last=null,this._size=0},LinkedList2}();(function(LinkedList2){function from(values){var list=new LinkedList2;return list.assign(values),list}LinkedList2.from=from;var ForwardValueIterator=function(){function ForwardValueIterator2(node){this._node=node}return ForwardValueIterator2.prototype.iter=function(){return this},ForwardValueIterator2.prototype.clone=function(){return new ForwardValueIterator2(this._node)},ForwardValueIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.next,node.value}},ForwardValueIterator2}();LinkedList2.ForwardValueIterator=ForwardValueIterator;var RetroValueIterator=function(){function RetroValueIterator2(node){this._node=node}return RetroValueIterator2.prototype.iter=function(){return this},RetroValueIterator2.prototype.clone=function(){return new RetroValueIterator2(this._node)},RetroValueIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.prev,node.value}},RetroValueIterator2}();LinkedList2.RetroValueIterator=RetroValueIterator;var ForwardNodeIterator=function(){function ForwardNodeIterator2(node){this._node=node}return ForwardNodeIterator2.prototype.iter=function(){return this},ForwardNodeIterator2.prototype.clone=function(){return new ForwardNodeIterator2(this._node)},ForwardNodeIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.next,node}},ForwardNodeIterator2}();LinkedList2.ForwardNodeIterator=ForwardNodeIterator;var RetroNodeIterator=function(){function RetroNodeIterator2(node){this._node=node}return RetroNodeIterator2.prototype.iter=function(){return this},RetroNodeIterator2.prototype.clone=function(){return new RetroNodeIterator2(this._node)},RetroNodeIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.prev,node}},RetroNodeIterator2}();LinkedList2.RetroNodeIterator=RetroNodeIterator})(LinkedList);var Private$m;(function(Private2){var LinkedListNode=function(){function LinkedListNode2(list,value){this.list=null,this.next=null,this.prev=null,this.list=list,this.value=value}return LinkedListNode2}();Private2.LinkedListNode=LinkedListNode})(Private$m||(Private$m={}));/*! *****************************************************************************
27
+ ***************************************************************************** */var __assign$1=function(){return __assign$1=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign$1.apply(this,arguments)};exports2.CommandRegistry=function(){function CommandRegistry(){this._timerID=0,this._replaying=!1,this._keystrokes=[],this._keydownEvents=[],this._keyBindings=[],this._exactKeyMatch=null,this._commands=Object.create(null),this._commandChanged=new Signal(this),this._commandExecuted=new Signal(this),this._keyBindingChanged=new Signal(this)}return Object.defineProperty(CommandRegistry.prototype,"commandChanged",{get:function(){return this._commandChanged},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry.prototype,"commandExecuted",{get:function(){return this._commandExecuted},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry.prototype,"keyBindingChanged",{get:function(){return this._keyBindingChanged},enumerable:!0,configurable:!0}),Object.defineProperty(CommandRegistry.prototype,"keyBindings",{get:function(){return this._keyBindings},enumerable:!0,configurable:!0}),CommandRegistry.prototype.listCommands=function(){return Object.keys(this._commands)},CommandRegistry.prototype.hasCommand=function(id){return id in this._commands},CommandRegistry.prototype.addCommand=function(id,options){var _this=this;if(id in this._commands)throw new Error("Command '"+id+"' already registered.");return this._commands[id]=Private$n.createCommand(options),this._commandChanged.emit({id,type:"added"}),new DisposableDelegate(function(){delete _this._commands[id],_this._commandChanged.emit({id,type:"removed"})})},CommandRegistry.prototype.notifyCommandChanged=function(id){if(id!==void 0&&!(id in this._commands))throw new Error("Command '"+id+"' is not registered.");this._commandChanged.emit({id,type:id?"changed":"many-changed"})},CommandRegistry.prototype.describedBy=function(id){var cmd=this._commands[id];return cmd?cmd.describedBy||{args:null}:{args:null}},CommandRegistry.prototype.label=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.label.call(void 0,args):""},CommandRegistry.prototype.mnemonic=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.mnemonic.call(void 0,args):-1},CommandRegistry.prototype.icon=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.icon.call(void 0,args):""},CommandRegistry.prototype.iconClass=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.iconClass.call(void 0,args):""},CommandRegistry.prototype.iconLabel=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.iconLabel.call(void 0,args):""},CommandRegistry.prototype.caption=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.caption.call(void 0,args):""},CommandRegistry.prototype.usage=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.usage.call(void 0,args):""},CommandRegistry.prototype.className=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.className.call(void 0,args):""},CommandRegistry.prototype.dataset=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.dataset.call(void 0,args):{}},CommandRegistry.prototype.isEnabled=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isEnabled.call(void 0,args):!1},CommandRegistry.prototype.isToggled=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isToggled.call(void 0,args):!1},CommandRegistry.prototype.isToggleable=function(id,args){var cmd=this._commands[id];return cmd?cmd.isToggleable:!1},CommandRegistry.prototype.isVisible=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];return cmd?cmd.isVisible.call(void 0,args):!1},CommandRegistry.prototype.execute=function(id,args){args===void 0&&(args=JSONExt.emptyObject);var cmd=this._commands[id];if(!cmd)return Promise.reject(new Error("Command '"+id+"' not registered."));var value;try{value=cmd.execute.call(void 0,args)}catch(err){value=Promise.reject(err)}var result=Promise.resolve(value);return this._commandExecuted.emit({id,args,result}),result},CommandRegistry.prototype.addKeyBinding=function(options){var _this=this,binding=Private$n.createKeyBinding(options);return this._keyBindings.push(binding),this._keyBindingChanged.emit({binding,type:"added"}),new DisposableDelegate(function(){ArrayExt.removeFirstOf(_this._keyBindings,binding),_this._keyBindingChanged.emit({binding,type:"removed"})})},CommandRegistry.prototype.processKeydownEvent=function(event){if(!(this._replaying||CommandRegistry.isModifierKeyPressed(event))){var keystroke=CommandRegistry.keystrokeForKeydownEvent(event);if(!keystroke){this._replayKeydownEvents(),this._clearPendingState();return}this._keystrokes.push(keystroke);var _a=Private$n.matchKeyBinding(this._keyBindings,this._keystrokes,event),exact=_a.exact,partial=_a.partial;if(!exact&&!partial){this._replayKeydownEvents(),this._clearPendingState();return}if(event.preventDefault(),event.stopPropagation(),exact&&!partial){this._executeKeyBinding(exact),this._clearPendingState();return}exact&&(this._exactKeyMatch=exact),this._keydownEvents.push(event),this._startTimer()}},CommandRegistry.prototype._startTimer=function(){var _this=this;this._clearTimer(),this._timerID=window.setTimeout(function(){_this._onPendingTimeout()},Private$n.CHORD_TIMEOUT)},CommandRegistry.prototype._clearTimer=function(){this._timerID!==0&&(clearTimeout(this._timerID),this._timerID=0)},CommandRegistry.prototype._replayKeydownEvents=function(){this._keydownEvents.length!==0&&(this._replaying=!0,this._keydownEvents.forEach(Private$n.replayKeyEvent),this._replaying=!1)},CommandRegistry.prototype._executeKeyBinding=function(binding){var command=binding.command,args=binding.args;if(!this.hasCommand(command)||!this.isEnabled(command,args)){var word=this.hasCommand(command)?"enabled":"registered",keys=binding.keys.join(", "),msg1="Cannot execute key binding '"+keys+"':",msg2="command '"+command+"' is not "+word+".";console.warn(msg1+" "+msg2);return}this.execute(command,args)},CommandRegistry.prototype._clearPendingState=function(){this._clearTimer(),this._exactKeyMatch=null,this._keystrokes.length=0,this._keydownEvents.length=0},CommandRegistry.prototype._onPendingTimeout=function(){this._timerID=0,this._exactKeyMatch?this._executeKeyBinding(this._exactKeyMatch):this._replayKeydownEvents(),this._clearPendingState()},CommandRegistry}(),function(CommandRegistry){function parseKeystroke(keystroke){for(var key="",alt=!1,cmd=!1,ctrl=!1,shift=!1,_i=0,_a=keystroke.split(/\s+/);_i<_a.length;_i++){var token=_a[_i];token==="Accel"?Platform.IS_MAC?cmd=!0:ctrl=!0:token==="Alt"?alt=!0:token==="Cmd"?cmd=!0:token==="Ctrl"?ctrl=!0:token==="Shift"?shift=!0:token.length>0&&(key=token)}return{cmd,ctrl,alt,shift,key}}CommandRegistry.parseKeystroke=parseKeystroke;function normalizeKeystroke(keystroke){var mods="",parts=parseKeystroke(keystroke);return parts.ctrl&&(mods+="Ctrl "),parts.alt&&(mods+="Alt "),parts.shift&&(mods+="Shift "),parts.cmd&&Platform.IS_MAC&&(mods+="Cmd "),mods+parts.key}CommandRegistry.normalizeKeystroke=normalizeKeystroke;function normalizeKeys(options){var keys;return Platform.IS_WIN?keys=options.winKeys||options.keys:Platform.IS_MAC?keys=options.macKeys||options.keys:keys=options.linuxKeys||options.keys,keys.map(normalizeKeystroke)}CommandRegistry.normalizeKeys=normalizeKeys;function formatKeystroke(keystroke){return typeof keystroke=="string"?formatSingleKey(keystroke):keystroke.map(formatSingleKey).join(", ");function formatSingleKey(key){var mods=[],separator=Platform.IS_MAC?" ":"+",parts=parseKeystroke(key);return parts.ctrl&&mods.push("Ctrl"),parts.alt&&mods.push("Alt"),parts.shift&&mods.push("Shift"),Platform.IS_MAC&&parts.cmd&&mods.push("Cmd"),mods.push(parts.key),mods.map(Private$n.formatKey).join(separator)}}CommandRegistry.formatKeystroke=formatKeystroke;function isModifierKeyPressed(event){var layout=getKeyboardLayout(),key=layout.keyForKeydownEvent(event);return layout.isModifierKey(key)}CommandRegistry.isModifierKeyPressed=isModifierKeyPressed;function keystrokeForKeydownEvent(event){var layout=getKeyboardLayout(),key=layout.keyForKeydownEvent(event);if(!key||layout.isModifierKey(key))return"";var mods=[];return event.ctrlKey&&mods.push("Ctrl"),event.altKey&&mods.push("Alt"),event.shiftKey&&mods.push("Shift"),event.metaKey&&Platform.IS_MAC&&mods.push("Cmd"),mods.push(key),mods.join(" ")}CommandRegistry.keystrokeForKeydownEvent=keystrokeForKeydownEvent}(exports2.CommandRegistry||(exports2.CommandRegistry={}));var Private$n;(function(Private2){Private2.CHORD_TIMEOUT=1e3;function createCommand(options){var icon,iconClass;return!options.icon||typeof options.icon=="string"?(iconClass=asFunc(options.iconClass||options.icon,emptyStringFunc),icon=iconClass):(iconClass=asFunc(options.iconClass,emptyStringFunc),icon=asFunc(options.icon,undefinedFunc)),{execute:options.execute,describedBy:__assign$1({args:null},options.describedBy),label:asFunc(options.label,emptyStringFunc),mnemonic:asFunc(options.mnemonic,negativeOneFunc),icon,iconClass,iconLabel:asFunc(options.iconLabel,emptyStringFunc),caption:asFunc(options.caption,emptyStringFunc),usage:asFunc(options.usage,emptyStringFunc),className:asFunc(options.className,emptyStringFunc),dataset:asFunc(options.dataset,emptyDatasetFunc),isEnabled:options.isEnabled||trueFunc,isToggled:options.isToggled||falseFunc,isToggleable:options.isToggleable||!!options.isToggled,isVisible:options.isVisible||trueFunc}}Private2.createCommand=createCommand;function createKeyBinding(options){return{keys:exports2.CommandRegistry.normalizeKeys(options),selector:validateSelector(options),command:options.command,args:options.args||JSONExt.emptyObject}}Private2.createKeyBinding=createKeyBinding;function matchKeyBinding(bindings,keys,event){for(var exact=null,partial=!1,distance=1/0,specificity=0,i=0,n=bindings.length;i<n;++i){var binding=bindings[i],sqm=matchSequence(binding.keys,keys);if(sqm!==0){if(sqm===2){!partial&&targetDistance(binding.selector,event)!==-1&&(partial=!0);continue}var td=targetDistance(binding.selector,event);if(!(td===-1||td>distance)){var sp=Selector.calculateSpecificity(binding.selector);(!exact||td<distance||sp>=specificity)&&(exact=binding,distance=td,specificity=sp)}}}return{exact,partial}}Private2.matchKeyBinding=matchKeyBinding;function replayKeyEvent(event){event.target.dispatchEvent(cloneKeyboardEvent(event))}Private2.replayKeyEvent=replayKeyEvent;function formatKey(key){return Platform.IS_MAC?MAC_DISPLAY.hasOwnProperty(key)?MAC_DISPLAY[key]:key:WIN_DISPLAY.hasOwnProperty(key)?WIN_DISPLAY[key]:key}Private2.formatKey=formatKey;var MAC_DISPLAY={Backspace:"⌫",Tab:"⇥",Enter:"↩",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"},WIN_DISPLAY={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"},emptyStringFunc=function(){return""},negativeOneFunc=function(){return-1},trueFunc=function(){return!0},falseFunc=function(){return!1},emptyDatasetFunc=function(){return{}},undefinedFunc=function(){};function asFunc(value,dfault){return value===void 0?dfault:typeof value=="function"?value:function(){return value}}function validateSelector(options){if(options.selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+options.selector);if(!Selector.isValid(options.selector))throw new Error("Invalid selector: "+options.selector);return options.selector}function matchSequence(bindKeys,userKeys){if(bindKeys.length<userKeys.length)return 0;for(var i=0,n=userKeys.length;i<n;++i)if(bindKeys[i]!==userKeys[i])return 0;return bindKeys.length>userKeys.length?2:1}function targetDistance(selector,event){for(var targ=event.target,curr=event.currentTarget,dist=0;targ!==null;targ=targ.parentElement,++dist){if(targ.hasAttribute("data-lm-suppress-shortcuts")||targ.hasAttribute("data-p-suppress-shortcuts"))return-1;if(Selector.matches(targ,selector))return dist;if(targ===curr)return-1}return-1}function cloneKeyboardEvent(event){var clone=document.createEvent("Event"),bubbles=event.bubbles||!0,cancelable=event.cancelable||!0;return clone.initEvent(event.type||"keydown",bubbles,cancelable),clone.key=event.key||"",clone.keyCode=event.keyCode||0,clone.which=event.keyCode||0,clone.ctrlKey=event.ctrlKey||!1,clone.altKey=event.altKey||!1,clone.shiftKey=event.shiftKey||!1,clone.metaKey=event.metaKey||!1,clone.view=event.view||window,clone}})(Private$n||(Private$n={}));var BPlusTree=function(){function BPlusTree2(cmp){this._root=new Private$1$1.LeafNode,this.cmp=cmp}return Object.defineProperty(BPlusTree2.prototype,"isEmpty",{get:function(){return this._root.size===0},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"size",{get:function(){return this._root.size},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"first",{get:function(){var node=Private$1$1.firstLeaf(this._root);return node.size>0?node.items[0]:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(BPlusTree2.prototype,"last",{get:function(){var node=Private$1$1.lastLeaf(this._root);return node.size>0?node.items[node.size-1]:void 0},enumerable:!0,configurable:!0}),BPlusTree2.prototype.iter=function(){return Private$1$1.iterItems(this._root)},BPlusTree2.prototype.retro=function(){return Private$1$1.retroItems(this._root)},BPlusTree2.prototype.slice=function(start,stop){return Private$1$1.sliceItems(this._root,start,stop)},BPlusTree2.prototype.retroSlice=function(start,stop){return Private$1$1.retroSliceItems(this._root,start,stop)},BPlusTree2.prototype.at=function(index){return Private$1$1.itemAt(this._root,index)},BPlusTree2.prototype.has=function(key,cmp){return Private$1$1.hasItem(this._root,key,cmp)},BPlusTree2.prototype.indexOf=function(key,cmp){return Private$1$1.indexOf(this._root,key,cmp)},BPlusTree2.prototype.get=function(key,cmp){return Private$1$1.getItem(this._root,key,cmp)},BPlusTree2.prototype.assign=function(items){this.clear(),this.update(items)},BPlusTree2.prototype.insert=function(item){var existing=Private$1$1.insertItem(this._root,item,this.cmp);return this._root=Private$1$1.maybeSplitRoot(this._root),existing},BPlusTree2.prototype.update=function(items){var _this=this;each(items,function(item){_this.insert(item)})},BPlusTree2.prototype.delete=function(key,cmp){var item=Private$1$1.deleteItem(this._root,key,cmp);return this._root=Private$1$1.maybeExtractRoot(this._root),item},BPlusTree2.prototype.remove=function(index){var item=Private$1$1.removeItem(this._root,index);return this._root=Private$1$1.maybeExtractRoot(this._root),item},BPlusTree2.prototype.clear=function(){Private$1$1.clear(this._root),this._root=new Private$1$1.LeafNode},BPlusTree2}();(function(BPlusTree2){function from(items,cmp){var tree=new BPlusTree2(cmp);return tree.assign(items),tree}BPlusTree2.from=from})(BPlusTree||(BPlusTree={}));var Private$1$1;(function(Private2){var BranchNode=function(){function BranchNode2(){this.items=[],this.sizes=[],this.children=[]}return Object.defineProperty(BranchNode2.prototype,"type",{get:function(){return 0},enumerable:!0,configurable:!0}),Object.defineProperty(BranchNode2.prototype,"size",{get:function(){return this.sizes[this.sizes.length-1]},enumerable:!0,configurable:!0}),Object.defineProperty(BranchNode2.prototype,"width",{get:function(){return this.children.length},enumerable:!0,configurable:!0}),BranchNode2}();Private2.BranchNode=BranchNode;var LeafNode=function(){function LeafNode2(){this.next=null,this.prev=null,this.items=[]}return Object.defineProperty(LeafNode2.prototype,"type",{get:function(){return 1},enumerable:!0,configurable:!0}),Object.defineProperty(LeafNode2.prototype,"size",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),Object.defineProperty(LeafNode2.prototype,"width",{get:function(){return this.items.length},enumerable:!0,configurable:!0}),LeafNode2}();Private2.LeafNode=LeafNode;function firstLeaf(node){for(;node.type===0;)node=node.children[0];return node}Private2.firstLeaf=firstLeaf;function lastLeaf(node){for(;node.type===0;)node=node.children[node.children.length-1];return node}Private2.lastLeaf=lastLeaf;function iterItems(node){var leaf=firstLeaf(node);return new ForwardIterator(leaf,0,-1)}Private2.iterItems=iterItems;function retroItems(node){var leaf=lastLeaf(node);return new RetroIterator(leaf,leaf.size-1,-1)}Private2.retroItems=retroItems;function sliceItems(node,start,stop){start===void 0?start=0:start<0?start=Math.max(0,start+node.size):start=Math.min(start,node.size),stop===void 0?stop=node.size:stop<0?stop=Math.max(0,stop+node.size):stop=Math.min(stop,node.size);var count=Math.max(0,stop-start);if(count===0)return empty();for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,start);i>0&&(start-=node.sizes[i-1]),node=node.children[i]}return new ForwardIterator(node,start,count)}Private2.sliceItems=sliceItems;function retroSliceItems(node,start,stop){start===void 0?start=node.size-1:start<0?start=Math.max(-1,start+node.size):start=Math.min(start,node.size-1),stop===void 0?stop=-1:stop<0?stop=Math.max(-1,stop+node.size):stop=Math.min(stop,node.size-1);var count=Math.max(0,start-stop);if(count===0)return empty();for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,start);i>0&&(start-=node.sizes[i-1]),node=node.children[i]}return new RetroIterator(node,start,count)}Private2.retroSliceItems=retroSliceItems;function itemAt(node,index){if(index<0&&(index+=node.size),!(index<0||index>=node.size)){for(;node.type===0;){var i=findPivotIndexByIndex(node.sizes,index);i>0&&(index-=node.sizes[i-1]),node=node.children[i]}return node.items[index]}}Private2.itemAt=itemAt;function hasItem(node,key,cmp){for(;node.type===0;){var i_1=findPivotIndexByKey(node.items,key,cmp);node=node.children[i_1]}var i=findKeyIndex(node.items,key,cmp);return i>=0}Private2.hasItem=hasItem;function indexOf(node,key,cmp){for(var index=0;node.type===0;){var i_2=findPivotIndexByKey(node.items,key,cmp);i_2>0&&(index+=node.sizes[i_2-1]),node=node.children[i_2]}var i=findKeyIndex(node.items,key,cmp);return i>=0?index+i:-index+i}Private2.indexOf=indexOf;function getItem(node,key,cmp){for(;node.type===0;){var i_3=findPivotIndexByKey(node.items,key,cmp);node=node.children[i_3]}var i=findKeyIndex(node.items,key,cmp);return i>=0?node.items[i]:void 0}Private2.getItem=getItem;function insertItem(node,item,cmp){if(node.type===1){var i_4=findKeyIndex(node.items,item,cmp),existing_1;return i_4>=0?(existing_1=node.items[i_4],node.items[i_4]=item):(existing_1=void 0,ArrayExt.insert(node.items,-i_4-1,item)),existing_1}var i=findPivotIndexByKey(node.items,item,cmp),child=node.children[i],prevSize=child.size,existing=insertItem(child,item,cmp),currSize=child.size;if(node.items[i]=child.items[0],prevSize===currSize)return existing;if(child.width>MAX_NODE_WIDTH){var next=splitNode(child);ArrayExt.insert(node.children,i+1,next),ArrayExt.insert(node.items,i+1,next.items[0])}return updateSizes(node,i),existing}Private2.insertItem=insertItem;function deleteItem(node,key,cmp){if(node.type===1){var i_5=findKeyIndex(node.items,key,cmp);return i_5<0?void 0:ArrayExt.removeAt(node.items,i_5)}var i=findPivotIndexByKey(node.items,key,cmp),child=node.children[i],prevSize=child.size,item=deleteItem(child,key,cmp),currSize=child.size;return prevSize===currSize||(node.items[i]=child.items[0],child.width<MIN_NODE_WIDTH&&(i=joinChild(node,i)),updateSizes(node,i)),item}Private2.deleteItem=deleteItem;function removeItem(node,index){if(index<0&&(index+=node.size),!(index<0||index>=node.size)){if(node.type===1)return ArrayExt.removeAt(node.items,index);var i=findPivotIndexByIndex(node.sizes,index);i>0&&(index-=node.sizes[i]);var child=node.children[i],item=removeItem(child,index);return node.items[i]=child.items[0],child.width<MIN_NODE_WIDTH&&(i=joinChild(node,i)),updateSizes(node,i),item}}Private2.removeItem=removeItem;function clear(node){node.type===0?(each(node.children,clear),node.children.length=0,node.sizes.length=0,node.items.length=0):(node.items.length=0,node.next=null,node.prev=null)}Private2.clear=clear;function maybeSplitRoot(node){if(node.width<=MAX_NODE_WIDTH)return node;var root=new BranchNode,next=splitNode(node);return root.sizes[0]=node.size,root.sizes[1]=node.size+next.size,root.children[0]=node,root.children[1]=next,root.items[0]=node.items[0],root.items[1]=next.items[0],root}Private2.maybeSplitRoot=maybeSplitRoot;function maybeExtractRoot(node){if(node.type===1||node.children.length>1)return node;var root=node.children.pop();return clear(node),root}Private2.maybeExtractRoot=maybeExtractRoot;var MAX_NODE_WIDTH=32,MIN_NODE_WIDTH=MAX_NODE_WIDTH>>1,ForwardIterator=function(){function ForwardIterator2(node,index,count){this._node=node,this._index=index,this._count=count}return ForwardIterator2.prototype.iter=function(){return this},ForwardIterator2.prototype.clone=function(){return new ForwardIterator2(this._node,this._index,this._count)},ForwardIterator2.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size?(this._node=this._node.next,this._index=0,this.next()):(this._count>0&&this._count--,this._node.items[this._index++])},ForwardIterator2}(),RetroIterator=function(){function RetroIterator2(node,index,count){this._node=node,this._index=index,this._count=count}return RetroIterator2.prototype.iter=function(){return this},RetroIterator2.prototype.clone=function(){return new RetroIterator2(this._node,this._index,this._count)},RetroIterator2.prototype.next=function(){if(!(this._node===null||this._count===0))return this._index>=this._node.size&&(this._index=this._node.size-1),this._index<0?(this._node=this._node.prev,this._index=this._node?this._node.size-1:-1,this.next()):(this._count>0&&this._count--,this._node.items[this._index--])},RetroIterator2}();function findPivotIndexByIndex(sizes,index){for(var n=sizes.length,i=0;i<n;++i)if(sizes[i]>index)return i;return n-1}function findPivotIndexByKey(items,key,cmp){for(var n=items.length,i=1;i<n;++i)if(cmp(items[i],key)>0)return i-1;return n-1}function findKeyIndex(items,key,cmp){for(var n=items.length,i=0;i<n;++i){var c=cmp(items[i],key);if(c===0)return i;if(c>0)return-i-1}return-n-1}function updateSizes(node,i){for(var sizes=node.sizes,children=node.children,last=i>0?sizes[i-1]:0,n=children.length;i<n;++i)last=sizes[i]=last+children[i].size;sizes.length=children.length}function splitNode(node){if(node.type===1){for(var next_1=new LeafNode,v1_1=node.items,v2_1=next_1.items,i=MIN_NODE_WIDTH,n=v1_1.length;i<n;++i)v2_1.push(v1_1[i]);return v1_1.length=MIN_NODE_WIDTH,node.next&&(node.next.prev=next_1),next_1.next=node.next,next_1.prev=node,node.next=next_1,next_1}for(var next=new BranchNode,c1=node.children,c2=next.children,i=MIN_NODE_WIDTH,n=c1.length;i<n;++i)c2.push(c1[i]);c1.length=MIN_NODE_WIDTH;for(var v1=node.items,v2=next.items,i=MIN_NODE_WIDTH,n=v1.length;i<n;++i)v2.push(v1[i]);return v1.length=MIN_NODE_WIDTH,updateSizes(node,MIN_NODE_WIDTH),updateSizes(next,0),next}function joinChild(node,i){var _a,_b,_c,_d,_e,_f,child=node.children[i],sibling=i===0?node.children[i+1]:node.children[i-1],hasNext=i===0,isLeaf=child.type===1,hasExtra=sibling.width>MIN_NODE_WIDTH;if(isLeaf&&hasExtra&&hasNext){var c=child,s=sibling;return c.items.push(s.items.shift()),node.items[i+1]=s.items[0],i}if(isLeaf&&hasExtra&&!hasNext){var c=child,s=sibling;return c.items.unshift(s.items.pop()),node.items[i]=c.items[0],i-1}if(isLeaf&&!hasExtra&&hasNext){var c=child,s=sibling;return(_a=s.items).unshift.apply(_a,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i+1),c.prev&&(c.prev.next=s),s.prev=c.prev,clear(c),i}if(isLeaf&&!hasExtra&&!hasNext){var c=child,s=sibling;return(_b=s.items).push.apply(_b,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i),c.next&&(c.next.prev=s),s.next=c.next,clear(c),i-1}if(!isLeaf&&hasExtra&&hasNext){var c=child,s=sibling;return c.children.push(s.children.shift()),c.items.push(s.items.shift()),node.items[i+1]=s.items[0],updateSizes(c,c.width-1),updateSizes(s,0),i}if(!isLeaf&&hasExtra&&!hasNext){var c=child,s=sibling;return c.children.unshift(s.children.pop()),c.items.unshift(s.items.pop()),node.items[i]=c.items[0],updateSizes(c,0),updateSizes(s,s.width-1),i-1}if(!isLeaf&&!hasExtra&&hasNext){var c=child,s=sibling;return(_c=s.children).unshift.apply(_c,c.children),(_d=s.items).unshift.apply(_d,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i+1),updateSizes(s,0),c.children.length=0,clear(c),i}if(!isLeaf&&!hasExtra&&!hasNext){var c=child,s=sibling;return(_e=s.children).push.apply(_e,c.children),(_f=s.items).push.apply(_f,c.items),ArrayExt.removeAt(node.children,i),ArrayExt.removeAt(node.items,i),updateSizes(s,0),c.children.length=0,clear(c),i-1}throw"unreachable"}})(Private$1$1||(Private$1$1={}));var LinkedList=function(){function LinkedList2(){this._first=null,this._last=null,this._size=0}return Object.defineProperty(LinkedList2.prototype,"isEmpty",{get:function(){return this._size===0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"length",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"first",{get:function(){return this._first?this._first.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"last",{get:function(){return this._last?this._last.value:void 0},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"firstNode",{get:function(){return this._first},enumerable:!0,configurable:!0}),Object.defineProperty(LinkedList2.prototype,"lastNode",{get:function(){return this._last},enumerable:!0,configurable:!0}),LinkedList2.prototype.iter=function(){return new LinkedList2.ForwardValueIterator(this._first)},LinkedList2.prototype.retro=function(){return new LinkedList2.RetroValueIterator(this._last)},LinkedList2.prototype.nodes=function(){return new LinkedList2.ForwardNodeIterator(this._first)},LinkedList2.prototype.retroNodes=function(){return new LinkedList2.RetroNodeIterator(this._last)},LinkedList2.prototype.assign=function(values){var _this=this;this.clear(),each(values,function(value){_this.addLast(value)})},LinkedList2.prototype.push=function(value){this.addLast(value)},LinkedList2.prototype.pop=function(){return this.removeLast()},LinkedList2.prototype.shift=function(value){this.addFirst(value)},LinkedList2.prototype.unshift=function(){return this.removeFirst()},LinkedList2.prototype.addFirst=function(value){var node=new Private$m.LinkedListNode(this,value);return this._first?(node.next=this._first,this._first.prev=node,this._first=node):(this._first=node,this._last=node),this._size++,node},LinkedList2.prototype.addLast=function(value){var node=new Private$m.LinkedListNode(this,value);return this._last?(node.prev=this._last,this._last.next=node,this._last=node):(this._first=node,this._last=node),this._size++,node},LinkedList2.prototype.insertBefore=function(value,ref){if(!ref||ref===this._first)return this.addFirst(value);if(!(ref instanceof Private$m.LinkedListNode)||ref.list!==this)throw new Error("Reference node is not owned by the list.");var node=new Private$m.LinkedListNode(this,value),_ref=ref,prev=_ref.prev;return node.next=_ref,node.prev=prev,_ref.prev=node,prev.next=node,this._size++,node},LinkedList2.prototype.insertAfter=function(value,ref){if(!ref||ref===this._last)return this.addLast(value);if(!(ref instanceof Private$m.LinkedListNode)||ref.list!==this)throw new Error("Reference node is not owned by the list.");var node=new Private$m.LinkedListNode(this,value),_ref=ref,next=_ref.next;return node.next=next,node.prev=_ref,_ref.next=node,next.prev=node,this._size++,node},LinkedList2.prototype.removeFirst=function(){var node=this._first;if(node)return node===this._last?(this._first=null,this._last=null):(this._first=node.next,this._first.prev=null),node.list=null,node.next=null,node.prev=null,this._size--,node.value},LinkedList2.prototype.removeLast=function(){var node=this._last;if(node)return node===this._first?(this._first=null,this._last=null):(this._last=node.prev,this._last.next=null),node.list=null,node.next=null,node.prev=null,this._size--,node.value},LinkedList2.prototype.removeNode=function(node){if(!(node instanceof Private$m.LinkedListNode)||node.list!==this)throw new Error("Node is not owned by the list.");var _node=node;_node===this._first&&_node===this._last?(this._first=null,this._last=null):_node===this._first?(this._first=_node.next,this._first.prev=null):_node===this._last?(this._last=_node.prev,this._last.next=null):(_node.next.prev=_node.prev,_node.prev.next=_node.next),_node.list=null,_node.next=null,_node.prev=null,this._size--},LinkedList2.prototype.clear=function(){for(var node=this._first;node;){var next=node.next;node.list=null,node.prev=null,node.next=null,node=next}this._first=null,this._last=null,this._size=0},LinkedList2}();(function(LinkedList2){function from(values){var list=new LinkedList2;return list.assign(values),list}LinkedList2.from=from;var ForwardValueIterator=function(){function ForwardValueIterator2(node){this._node=node}return ForwardValueIterator2.prototype.iter=function(){return this},ForwardValueIterator2.prototype.clone=function(){return new ForwardValueIterator2(this._node)},ForwardValueIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.next,node.value}},ForwardValueIterator2}();LinkedList2.ForwardValueIterator=ForwardValueIterator;var RetroValueIterator=function(){function RetroValueIterator2(node){this._node=node}return RetroValueIterator2.prototype.iter=function(){return this},RetroValueIterator2.prototype.clone=function(){return new RetroValueIterator2(this._node)},RetroValueIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.prev,node.value}},RetroValueIterator2}();LinkedList2.RetroValueIterator=RetroValueIterator;var ForwardNodeIterator=function(){function ForwardNodeIterator2(node){this._node=node}return ForwardNodeIterator2.prototype.iter=function(){return this},ForwardNodeIterator2.prototype.clone=function(){return new ForwardNodeIterator2(this._node)},ForwardNodeIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.next,node}},ForwardNodeIterator2}();LinkedList2.ForwardNodeIterator=ForwardNodeIterator;var RetroNodeIterator=function(){function RetroNodeIterator2(node){this._node=node}return RetroNodeIterator2.prototype.iter=function(){return this},RetroNodeIterator2.prototype.clone=function(){return new RetroNodeIterator2(this._node)},RetroNodeIterator2.prototype.next=function(){if(this._node){var node=this._node;return this._node=node.prev,node}},RetroNodeIterator2}();LinkedList2.RetroNodeIterator=RetroNodeIterator})(LinkedList||(LinkedList={}));var Private$m;(function(Private2){var LinkedListNode=function(){function LinkedListNode2(list,value){this.list=null,this.next=null,this.prev=null,this.list=list,this.value=value}return LinkedListNode2}();Private2.LinkedListNode=LinkedListNode})(Private$m||(Private$m={}));/*! *****************************************************************************
29
28
  Copyright (c) Microsoft Corporation.
30
29
 
31
30
  Permission to use, copy, modify, and/or distribute this software for any
@@ -38,7 +37,7 @@
38
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
39
  PERFORMANCE OF THIS SOFTWARE.
41
- ***************************************************************************** */var extendStatics$2=function(d,b){return extendStatics$2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$2(d,b)};function __extends$2(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$2(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var Message=function(){function Message2(type){this.type=type}return Object.defineProperty(Message2.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),Message2.prototype.conflate=function(other){return!1},Message2}(),ConflatableMessage=function(_super){__extends$2(ConflatableMessage2,_super);function ConflatableMessage2(){return _super!==null&&_super.apply(this,arguments)||this}return Object.defineProperty(ConflatableMessage2.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),ConflatableMessage2.prototype.conflate=function(other){return!0},ConflatableMessage2}(Message),MessageLoop;(function(MessageLoop2){function sendMessage(handler,msg){var hooks=messageHooks.get(handler);if(!hooks||hooks.length===0){invokeHandler(handler,msg);return}var passed=every(retro(hooks),function(hook){return hook?invokeHook(hook,handler,msg):!0});passed&&invokeHandler(handler,msg)}MessageLoop2.sendMessage=sendMessage;function postMessage(handler,msg){if(!msg.isConflatable){enqueueMessage(handler,msg);return}var conflated=some(messageQueue,function(posted){return posted.handler!==handler||!posted.msg||posted.msg.type!==msg.type||!posted.msg.isConflatable?!1:posted.msg.conflate(msg)});conflated||enqueueMessage(handler,msg)}MessageLoop2.postMessage=postMessage;function installMessageHook(handler,hook){var hooks=messageHooks.get(handler);hooks&&hooks.indexOf(hook)!==-1||(hooks?hooks.push(hook):messageHooks.set(handler,[hook]))}MessageLoop2.installMessageHook=installMessageHook;function removeMessageHook(handler,hook){var hooks=messageHooks.get(handler);if(hooks){var i=hooks.indexOf(hook);i!==-1&&(hooks[i]=null,scheduleCleanup(hooks))}}MessageLoop2.removeMessageHook=removeMessageHook;function clearData(handler){var hooks=messageHooks.get(handler);hooks&&hooks.length>0&&(ArrayExt.fill(hooks,null),scheduleCleanup(hooks)),each(messageQueue,function(posted){posted.handler===handler&&(posted.handler=null,posted.msg=null)})}MessageLoop2.clearData=clearData;function flush(){flushGuard||loopTaskID===0||(unschedule(loopTaskID),flushGuard=!0,runMessageLoop(),flushGuard=!1)}MessageLoop2.flush=flush;function getExceptionHandler(){return exceptionHandler}MessageLoop2.getExceptionHandler=getExceptionHandler;function setExceptionHandler(handler){var old=exceptionHandler;return exceptionHandler=handler,old}MessageLoop2.setExceptionHandler=setExceptionHandler;var messageQueue=new LinkedList,messageHooks=new WeakMap,dirtySet=new Set,exceptionHandler=function(err){console.error(err)},loopTaskID=0,flushGuard=!1,schedule=function(){var ok=typeof requestAnimationFrame=="function";return ok?requestAnimationFrame:setImmediate}(),unschedule=function(){var ok=typeof cancelAnimationFrame=="function";return ok?cancelAnimationFrame:clearImmediate}();function invokeHook(hook,handler,msg){var result=!0;try{typeof hook=="function"?result=hook(handler,msg):result=hook.messageHook(handler,msg)}catch(err){exceptionHandler(err)}return result}function invokeHandler(handler,msg){try{handler.processMessage(msg)}catch(err){exceptionHandler(err)}}function enqueueMessage(handler,msg){messageQueue.addLast({handler,msg}),loopTaskID===0&&(loopTaskID=schedule(runMessageLoop))}function runMessageLoop(){if(loopTaskID=0,!messageQueue.isEmpty){var sentinel={handler:null,msg:null};for(messageQueue.addLast(sentinel);;){var posted=messageQueue.removeFirst();if(posted===sentinel)return;posted.handler&&posted.msg&&sendMessage(posted.handler,posted.msg)}}}function scheduleCleanup(hooks){dirtySet.size===0&&schedule(cleanupDirtySet),dirtySet.add(hooks)}function cleanupDirtySet(){dirtySet.forEach(cleanupHooks),dirtySet.clear()}function cleanupHooks(hooks){ArrayExt.removeAllWhere(hooks,isNull)}function isNull(value){return value===null}})(MessageLoop||(MessageLoop={}));var Drag=function(){function Drag2(options){var _this=this;this._onScrollFrame=function(){if(_this._scrollTarget){var _a=_this._scrollTarget,element=_a.element,edge=_a.edge,distance=_a.distance,d=Private$l.SCROLL_EDGE_SIZE-distance,f=Math.pow(d/Private$l.SCROLL_EDGE_SIZE,2),s=Math.max(1,Math.round(f*Private$l.SCROLL_EDGE_SIZE));switch(edge){case"top":element.scrollTop-=s;break;case"left":element.scrollLeft-=s;break;case"right":element.scrollLeft+=s;break;case"bottom":element.scrollTop+=s;break}requestAnimationFrame(_this._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=options.document||document,this.mimeData=options.mimeData,this.dragImage=options.dragImage||null,this.proposedAction=options.proposedAction||"copy",this.supportedActions=options.supportedActions||"all",this.source=options.source||null}return Drag2.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var event_1=Private$l.createMouseEvent("pointerup",-1,-1);Private$l.dispatchDragLeave(this,this._currentTarget,null,event_1)}this._finalize("none")}},Object.defineProperty(Drag2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Drag2.prototype.start=function(clientX,clientY){var _this=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(clientX,clientY),this._promise=new Promise(function(resolve,reject){_this._resolve=resolve});var event=Private$l.createMouseEvent("pointermove",clientX,clientY);return document.dispatchEvent(event),this._promise},Drag2.prototype.handleEvent=function(event){switch(event.type){case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;default:event.preventDefault(),event.stopPropagation();break}},Drag2.prototype.moveDragImage=function(clientX,clientY){if(this.dragImage){var style=this.dragImage.style;style.top=clientY+"px",style.left=clientX+"px"}},Drag2.prototype._evtMouseMove=function(event){event.preventDefault(),event.stopPropagation(),this._updateCurrentTarget(event),this._updateDragScroll(event),this.moveDragImage(event.clientX,event.clientY)},Drag2.prototype._evtMouseUp=function(event){if(event.preventDefault(),event.stopPropagation(),event.button===0){if(this._updateCurrentTarget(event),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Private$l.dispatchDragLeave(this,this._currentTarget,null,event),this._finalize("none");return}var action=Private$l.dispatchDrop(this,this._currentTarget,event);this._finalize(action)}},Drag2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&this.dispose()},Drag2.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},Drag2.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},Drag2.prototype._updateDragScroll=function(event){var target=Private$l.findScrollTarget(event);!this._scrollTarget&&!target||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=target)},Drag2.prototype._updateCurrentTarget=function(event){var prevTarget=this._currentTarget,currTarget=this._currentTarget,prevElem=this._currentElement,currElem=this.document.elementFromPoint(event.clientX,event.clientY);this._currentElement=currElem,currElem!==prevElem&&currElem!==currTarget&&Private$l.dispatchDragExit(this,currTarget,currElem,event),currElem!==prevElem&&currElem!==currTarget&&(currTarget=Private$l.dispatchDragEnter(this,currElem,currTarget,event)),currTarget!==prevTarget&&(this._currentTarget=currTarget,Private$l.dispatchDragLeave(this,prevTarget,currTarget,event));var action=Private$l.dispatchDragOver(this,currTarget,event);this._setDropAction(action)},Drag2.prototype._attachDragImage=function(clientX,clientY){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var style=this.dragImage.style;style.pointerEvents="none",style.position="fixed",style.top=clientY+"px",style.left=clientX+"px";var body=this.document instanceof Document?this.document.body:this.document.firstElementChild;body.appendChild(this.dragImage)}},Drag2.prototype._detachDragImage=function(){if(this.dragImage){var parent=this.dragImage.parentNode;parent&&parent.removeChild(this.dragImage)}},Drag2.prototype._setDropAction=function(action){if(action=Private$l.validateAction(action,this.supportedActions),!(this._override&&this._dropAction===action))switch(action){case"none":this._dropAction=action,this._override=Drag2.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=action,this._override=Drag2.overrideCursor("copy",this.document);break;case"link":this._dropAction=action,this._override=Drag2.overrideCursor("alias",this.document);break;case"move":this._dropAction=action,this._override=Drag2.overrideCursor("move",this.document);break}},Drag2.prototype._finalize=function(action){var resolve=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,resolve&&resolve(action)},Drag2}();(function(Drag2){function overrideCursor(cursor,doc){doc===void 0&&(doc=document);var id=++overrideCursorID,body=doc instanceof Document?doc.body:doc.firstElementChild;return body.style.cursor=cursor,body.classList.add("lm-mod-override-cursor"),body.classList.add("p-mod-override-cursor"),new DisposableDelegate(function(){id===overrideCursorID&&(body.style.cursor="",body.classList.remove("lm-mod-override-cursor"),body.classList.remove("p-mod-override-cursor"))})}Drag2.overrideCursor=overrideCursor;var overrideCursorID=0})(Drag);var Private$l;(function(Private2){Private2.SCROLL_EDGE_SIZE=20;function validateAction(action,supported){return actionTable[action]&supportedTable[supported]?action:"none"}Private2.validateAction=validateAction;function createMouseEvent(type,clientX,clientY){var event=document.createEvent("MouseEvent");return event.initMouseEvent(type,!0,!0,window,0,0,0,clientX,clientY,!1,!1,!1,!1,0,null),event}Private2.createMouseEvent=createMouseEvent;function findScrollTarget(event){for(var x=event.clientX,y=event.clientY,element=document.elementFromPoint(x,y);element;element=element.parentElement){var scrollable=element.hasAttribute("data-lm-dragscroll");if(scrollable=scrollable||element.hasAttribute("data-p-dragscroll"),!!scrollable){var offsetX=0,offsetY=0;element===document.body&&(offsetX=window.pageXOffset,offsetY=window.pageYOffset);var r=element.getBoundingClientRect(),top_1=r.top+offsetY,left=r.left+offsetX,right=left+r.width,bottom=top_1+r.height;if(!(x<left||x>=right||y<top_1||y>=bottom)){var dl=x-left+1,dt=y-top_1+1,dr=right-x,db=bottom-y,distance=Math.min(dl,dt,dr,db);if(!(distance>Private2.SCROLL_EDGE_SIZE)){var edge=void 0;switch(distance){case db:edge="bottom";break;case dt:edge="top";break;case dr:edge="right";break;case dl:edge="left";break;default:throw"unreachable"}var dsw=element.scrollWidth-element.clientWidth,dsh=element.scrollHeight-element.clientHeight,shouldScroll=void 0;switch(edge){case"top":shouldScroll=dsh>0&&element.scrollTop>0;break;case"left":shouldScroll=dsw>0&&element.scrollLeft>0;break;case"right":shouldScroll=dsw>0&&element.scrollLeft<dsw;break;case"bottom":shouldScroll=dsh>0&&element.scrollTop<dsh;break;default:throw"unreachable"}if(shouldScroll)return{element,edge,distance}}}}}return null}Private2.findScrollTarget=findScrollTarget;function dispatchDragEnter(drag,currElem,currTarget,event){if(!currElem)return null;var dragEvent=createDragEvent("lm-dragenter",drag,event,currTarget),canceled=!currElem.dispatchEvent(dragEvent);if(canceled||(dragEvent=createDragEvent("p-dragenter",drag,event,currTarget),canceled=!currElem.dispatchEvent(dragEvent),canceled))return currElem;var body=drag.document instanceof Document?drag.document.body:drag.document.firstElementChild;return currElem===body?currTarget:(dragEvent=createDragEvent("lm-dragenter",drag,event,currTarget),body.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragenter",drag,event,currTarget),body.dispatchEvent(dragEvent),body)}Private2.dispatchDragEnter=dispatchDragEnter;function dispatchDragExit(drag,prevTarget,currTarget,event){if(prevTarget){var dragEvent=createDragEvent("lm-dragexit",drag,event,currTarget);prevTarget.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragexit",drag,event,currTarget),prevTarget.dispatchEvent(dragEvent)}}Private2.dispatchDragExit=dispatchDragExit;function dispatchDragLeave(drag,prevTarget,currTarget,event){if(prevTarget){var dragEvent=createDragEvent("lm-dragleave",drag,event,currTarget);prevTarget.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragleave",drag,event,currTarget),prevTarget.dispatchEvent(dragEvent)}}Private2.dispatchDragLeave=dispatchDragLeave;function dispatchDragOver(drag,currTarget,event){if(!currTarget)return"none";var dragEvent=createDragEvent("lm-dragover",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent);return canceled||(dragEvent=createDragEvent("p-dragover",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent),canceled)?dragEvent.dropAction:"none"}Private2.dispatchDragOver=dispatchDragOver;function dispatchDrop(drag,currTarget,event){if(!currTarget)return"none";var dragEvent=createDragEvent("lm-drop",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent);return canceled||(dragEvent=createDragEvent("p-drop",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent),canceled)?dragEvent.dropAction:"none"}Private2.dispatchDrop=dispatchDrop;var actionTable={none:0,copy:1,link:2,move:4},supportedTable={none:actionTable.none,copy:actionTable.copy,link:actionTable.link,move:actionTable.move,"copy-link":actionTable.copy|actionTable.link,"copy-move":actionTable.copy|actionTable.move,"link-move":actionTable.link|actionTable.move,all:actionTable.copy|actionTable.link|actionTable.move};function createDragEvent(type,drag,event,related){var dragEvent=document.createEvent("MouseEvent");return dragEvent.initMouseEvent(type,!0,!0,window,0,event.screenX,event.screenY,event.clientX,event.clientY,event.ctrlKey,event.altKey,event.shiftKey,event.metaKey,event.button,related),dragEvent.dropAction="none",dragEvent.mimeData=drag.mimeData,dragEvent.proposedAction=drag.proposedAction,dragEvent.supportedActions=drag.supportedActions,dragEvent.source=drag.source,dragEvent}})(Private$l||(Private$l={}));/*! *****************************************************************************
40
+ ***************************************************************************** */var extendStatics$2=function(d,b){return extendStatics$2=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$2(d,b)};function __extends$2(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$2(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var Message=function(){function Message2(type){this.type=type}return Object.defineProperty(Message2.prototype,"isConflatable",{get:function(){return!1},enumerable:!0,configurable:!0}),Message2.prototype.conflate=function(other){return!1},Message2}(),ConflatableMessage=function(_super){__extends$2(ConflatableMessage2,_super);function ConflatableMessage2(){return _super!==null&&_super.apply(this,arguments)||this}return Object.defineProperty(ConflatableMessage2.prototype,"isConflatable",{get:function(){return!0},enumerable:!0,configurable:!0}),ConflatableMessage2.prototype.conflate=function(other){return!0},ConflatableMessage2}(Message),MessageLoop;(function(MessageLoop2){function sendMessage(handler,msg){var hooks=messageHooks.get(handler);if(!hooks||hooks.length===0){invokeHandler(handler,msg);return}var passed=every(retro(hooks),function(hook){return hook?invokeHook(hook,handler,msg):!0});passed&&invokeHandler(handler,msg)}MessageLoop2.sendMessage=sendMessage;function postMessage(handler,msg){if(!msg.isConflatable){enqueueMessage(handler,msg);return}var conflated=some(messageQueue,function(posted){return posted.handler!==handler||!posted.msg||posted.msg.type!==msg.type||!posted.msg.isConflatable?!1:posted.msg.conflate(msg)});conflated||enqueueMessage(handler,msg)}MessageLoop2.postMessage=postMessage;function installMessageHook(handler,hook){var hooks=messageHooks.get(handler);hooks&&hooks.indexOf(hook)!==-1||(hooks?hooks.push(hook):messageHooks.set(handler,[hook]))}MessageLoop2.installMessageHook=installMessageHook;function removeMessageHook(handler,hook){var hooks=messageHooks.get(handler);if(hooks){var i=hooks.indexOf(hook);i!==-1&&(hooks[i]=null,scheduleCleanup(hooks))}}MessageLoop2.removeMessageHook=removeMessageHook;function clearData(handler){var hooks=messageHooks.get(handler);hooks&&hooks.length>0&&(ArrayExt.fill(hooks,null),scheduleCleanup(hooks)),each(messageQueue,function(posted){posted.handler===handler&&(posted.handler=null,posted.msg=null)})}MessageLoop2.clearData=clearData;function flush(){flushGuard||loopTaskID===0||(unschedule(loopTaskID),flushGuard=!0,runMessageLoop(),flushGuard=!1)}MessageLoop2.flush=flush;function getExceptionHandler(){return exceptionHandler}MessageLoop2.getExceptionHandler=getExceptionHandler;function setExceptionHandler(handler){var old=exceptionHandler;return exceptionHandler=handler,old}MessageLoop2.setExceptionHandler=setExceptionHandler;var messageQueue=new LinkedList,messageHooks=new WeakMap,dirtySet=new Set,exceptionHandler=function(err){console.error(err)},loopTaskID=0,flushGuard=!1,schedule=function(){var ok=typeof requestAnimationFrame=="function";return ok?requestAnimationFrame:setImmediate}(),unschedule=function(){var ok=typeof cancelAnimationFrame=="function";return ok?cancelAnimationFrame:clearImmediate}();function invokeHook(hook,handler,msg){var result=!0;try{typeof hook=="function"?result=hook(handler,msg):result=hook.messageHook(handler,msg)}catch(err){exceptionHandler(err)}return result}function invokeHandler(handler,msg){try{handler.processMessage(msg)}catch(err){exceptionHandler(err)}}function enqueueMessage(handler,msg){messageQueue.addLast({handler,msg}),loopTaskID===0&&(loopTaskID=schedule(runMessageLoop))}function runMessageLoop(){if(loopTaskID=0,!messageQueue.isEmpty){var sentinel={handler:null,msg:null};for(messageQueue.addLast(sentinel);;){var posted=messageQueue.removeFirst();if(posted===sentinel)return;posted.handler&&posted.msg&&sendMessage(posted.handler,posted.msg)}}}function scheduleCleanup(hooks){dirtySet.size===0&&schedule(cleanupDirtySet),dirtySet.add(hooks)}function cleanupDirtySet(){dirtySet.forEach(cleanupHooks),dirtySet.clear()}function cleanupHooks(hooks){ArrayExt.removeAllWhere(hooks,isNull)}function isNull(value){return value===null}})(MessageLoop||(MessageLoop={}));var Drag=function(){function Drag2(options){var _this=this;this._onScrollFrame=function(){if(_this._scrollTarget){var _a=_this._scrollTarget,element=_a.element,edge=_a.edge,distance=_a.distance,d=Private$l.SCROLL_EDGE_SIZE-distance,f=Math.pow(d/Private$l.SCROLL_EDGE_SIZE,2),s=Math.max(1,Math.round(f*Private$l.SCROLL_EDGE_SIZE));switch(edge){case"top":element.scrollTop-=s;break;case"left":element.scrollLeft-=s;break;case"right":element.scrollLeft+=s;break;case"bottom":element.scrollTop+=s;break}requestAnimationFrame(_this._onScrollFrame)}},this._disposed=!1,this._dropAction="none",this._override=null,this._currentTarget=null,this._currentElement=null,this._promise=null,this._scrollTarget=null,this._resolve=null,this.document=options.document||document,this.mimeData=options.mimeData,this.dragImage=options.dragImage||null,this.proposedAction=options.proposedAction||"copy",this.supportedActions=options.supportedActions||"all",this.source=options.source||null}return Drag2.prototype.dispose=function(){if(!this._disposed){if(this._disposed=!0,this._currentTarget){var event_1=Private$l.createMouseEvent("pointerup",-1,-1);Private$l.dispatchDragLeave(this,this._currentTarget,null,event_1)}this._finalize("none")}},Object.defineProperty(Drag2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Drag2.prototype.start=function(clientX,clientY){var _this=this;if(this._disposed)return Promise.resolve("none");if(this._promise)return this._promise;this._addListeners(),this._attachDragImage(clientX,clientY),this._promise=new Promise(function(resolve,reject){_this._resolve=resolve});var event=Private$l.createMouseEvent("pointermove",clientX,clientY);return document.dispatchEvent(event),this._promise},Drag2.prototype.handleEvent=function(event){switch(event.type){case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;default:event.preventDefault(),event.stopPropagation();break}},Drag2.prototype.moveDragImage=function(clientX,clientY){if(this.dragImage){var style=this.dragImage.style;style.top=clientY+"px",style.left=clientX+"px"}},Drag2.prototype._evtMouseMove=function(event){event.preventDefault(),event.stopPropagation(),this._updateCurrentTarget(event),this._updateDragScroll(event),this.moveDragImage(event.clientX,event.clientY)},Drag2.prototype._evtMouseUp=function(event){if(event.preventDefault(),event.stopPropagation(),event.button===0){if(this._updateCurrentTarget(event),!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){Private$l.dispatchDragLeave(this,this._currentTarget,null,event),this._finalize("none");return}var action=Private$l.dispatchDrop(this,this._currentTarget,event);this._finalize(action)}},Drag2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&this.dispose()},Drag2.prototype._addListeners=function(){document.addEventListener("mousedown",this,!0),document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("mouseenter",this,!0),document.addEventListener("mouseleave",this,!0),document.addEventListener("mouseover",this,!0),document.addEventListener("mouseout",this,!0),document.addEventListener("pointerdown",this,!0),document.addEventListener("pointermove",this,!0),document.addEventListener("pointerup",this,!0),document.addEventListener("pointerenter",this,!0),document.addEventListener("pointerleave",this,!0),document.addEventListener("pointerover",this,!0),document.addEventListener("pointerout",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("keyup",this,!0),document.addEventListener("keypress",this,!0),document.addEventListener("contextmenu",this,!0)},Drag2.prototype._removeListeners=function(){document.removeEventListener("mousedown",this,!0),document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("mouseenter",this,!0),document.removeEventListener("mouseleave",this,!0),document.removeEventListener("mouseover",this,!0),document.removeEventListener("mouseout",this,!0),document.removeEventListener("pointerdown",this,!0),document.removeEventListener("pointermove",this,!0),document.removeEventListener("pointerup",this,!0),document.removeEventListener("pointerenter",this,!0),document.removeEventListener("pointerleave",this,!0),document.removeEventListener("pointerover",this,!0),document.removeEventListener("pointerout",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("keyup",this,!0),document.removeEventListener("keypress",this,!0),document.removeEventListener("contextmenu",this,!0)},Drag2.prototype._updateDragScroll=function(event){var target=Private$l.findScrollTarget(event);!this._scrollTarget&&!target||(this._scrollTarget||setTimeout(this._onScrollFrame,500),this._scrollTarget=target)},Drag2.prototype._updateCurrentTarget=function(event){var prevTarget=this._currentTarget,currTarget=this._currentTarget,prevElem=this._currentElement,currElem=this.document.elementFromPoint(event.clientX,event.clientY);this._currentElement=currElem,currElem!==prevElem&&currElem!==currTarget&&Private$l.dispatchDragExit(this,currTarget,currElem,event),currElem!==prevElem&&currElem!==currTarget&&(currTarget=Private$l.dispatchDragEnter(this,currElem,currTarget,event)),currTarget!==prevTarget&&(this._currentTarget=currTarget,Private$l.dispatchDragLeave(this,prevTarget,currTarget,event));var action=Private$l.dispatchDragOver(this,currTarget,event);this._setDropAction(action)},Drag2.prototype._attachDragImage=function(clientX,clientY){if(this.dragImage){this.dragImage.classList.add("lm-mod-drag-image"),this.dragImage.classList.add("p-mod-drag-image");var style=this.dragImage.style;style.pointerEvents="none",style.position="fixed",style.top=clientY+"px",style.left=clientX+"px";var body=this.document instanceof Document?this.document.body:this.document.firstElementChild;body.appendChild(this.dragImage)}},Drag2.prototype._detachDragImage=function(){if(this.dragImage){var parent=this.dragImage.parentNode;parent&&parent.removeChild(this.dragImage)}},Drag2.prototype._setDropAction=function(action){if(action=Private$l.validateAction(action,this.supportedActions),!(this._override&&this._dropAction===action))switch(action){case"none":this._dropAction=action,this._override=Drag2.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=action,this._override=Drag2.overrideCursor("copy",this.document);break;case"link":this._dropAction=action,this._override=Drag2.overrideCursor("alias",this.document);break;case"move":this._dropAction=action,this._override=Drag2.overrideCursor("move",this.document);break}},Drag2.prototype._finalize=function(action){var resolve=this._resolve;this._removeListeners(),this._detachDragImage(),this._override&&(this._override.dispose(),this._override=null),this.mimeData.clear(),this._disposed=!0,this._dropAction="none",this._currentTarget=null,this._currentElement=null,this._scrollTarget=null,this._promise=null,this._resolve=null,resolve&&resolve(action)},Drag2}();(function(Drag2){function overrideCursor(cursor,doc){doc===void 0&&(doc=document);var id=++overrideCursorID,body=doc instanceof Document?doc.body:doc.firstElementChild;return body.style.cursor=cursor,body.classList.add("lm-mod-override-cursor"),body.classList.add("p-mod-override-cursor"),new DisposableDelegate(function(){id===overrideCursorID&&(body.style.cursor="",body.classList.remove("lm-mod-override-cursor"),body.classList.remove("p-mod-override-cursor"))})}Drag2.overrideCursor=overrideCursor;var overrideCursorID=0})(Drag||(Drag={}));var Private$l;(function(Private2){Private2.SCROLL_EDGE_SIZE=20;function validateAction(action,supported){return actionTable[action]&supportedTable[supported]?action:"none"}Private2.validateAction=validateAction;function createMouseEvent(type,clientX,clientY){var event=document.createEvent("MouseEvent");return event.initMouseEvent(type,!0,!0,window,0,0,0,clientX,clientY,!1,!1,!1,!1,0,null),event}Private2.createMouseEvent=createMouseEvent;function findScrollTarget(event){for(var x=event.clientX,y=event.clientY,element=document.elementFromPoint(x,y);element;element=element.parentElement){var scrollable=element.hasAttribute("data-lm-dragscroll");if(scrollable=scrollable||element.hasAttribute("data-p-dragscroll"),!!scrollable){var offsetX=0,offsetY=0;element===document.body&&(offsetX=window.pageXOffset,offsetY=window.pageYOffset);var r=element.getBoundingClientRect(),top_1=r.top+offsetY,left=r.left+offsetX,right=left+r.width,bottom=top_1+r.height;if(!(x<left||x>=right||y<top_1||y>=bottom)){var dl=x-left+1,dt=y-top_1+1,dr=right-x,db=bottom-y,distance=Math.min(dl,dt,dr,db);if(!(distance>Private2.SCROLL_EDGE_SIZE)){var edge=void 0;switch(distance){case db:edge="bottom";break;case dt:edge="top";break;case dr:edge="right";break;case dl:edge="left";break;default:throw"unreachable"}var dsw=element.scrollWidth-element.clientWidth,dsh=element.scrollHeight-element.clientHeight,shouldScroll=void 0;switch(edge){case"top":shouldScroll=dsh>0&&element.scrollTop>0;break;case"left":shouldScroll=dsw>0&&element.scrollLeft>0;break;case"right":shouldScroll=dsw>0&&element.scrollLeft<dsw;break;case"bottom":shouldScroll=dsh>0&&element.scrollTop<dsh;break;default:throw"unreachable"}if(shouldScroll)return{element,edge,distance}}}}}return null}Private2.findScrollTarget=findScrollTarget;function dispatchDragEnter(drag,currElem,currTarget,event){if(!currElem)return null;var dragEvent=createDragEvent("lm-dragenter",drag,event,currTarget),canceled=!currElem.dispatchEvent(dragEvent);if(canceled||(dragEvent=createDragEvent("p-dragenter",drag,event,currTarget),canceled=!currElem.dispatchEvent(dragEvent),canceled))return currElem;var body=drag.document instanceof Document?drag.document.body:drag.document.firstElementChild;return currElem===body?currTarget:(dragEvent=createDragEvent("lm-dragenter",drag,event,currTarget),body.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragenter",drag,event,currTarget),body.dispatchEvent(dragEvent),body)}Private2.dispatchDragEnter=dispatchDragEnter;function dispatchDragExit(drag,prevTarget,currTarget,event){if(prevTarget){var dragEvent=createDragEvent("lm-dragexit",drag,event,currTarget);prevTarget.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragexit",drag,event,currTarget),prevTarget.dispatchEvent(dragEvent)}}Private2.dispatchDragExit=dispatchDragExit;function dispatchDragLeave(drag,prevTarget,currTarget,event){if(prevTarget){var dragEvent=createDragEvent("lm-dragleave",drag,event,currTarget);prevTarget.dispatchEvent(dragEvent),dragEvent=createDragEvent("p-dragleave",drag,event,currTarget),prevTarget.dispatchEvent(dragEvent)}}Private2.dispatchDragLeave=dispatchDragLeave;function dispatchDragOver(drag,currTarget,event){if(!currTarget)return"none";var dragEvent=createDragEvent("lm-dragover",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent);return canceled||(dragEvent=createDragEvent("p-dragover",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent),canceled)?dragEvent.dropAction:"none"}Private2.dispatchDragOver=dispatchDragOver;function dispatchDrop(drag,currTarget,event){if(!currTarget)return"none";var dragEvent=createDragEvent("lm-drop",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent);return canceled||(dragEvent=createDragEvent("p-drop",drag,event,null),canceled=!currTarget.dispatchEvent(dragEvent),canceled)?dragEvent.dropAction:"none"}Private2.dispatchDrop=dispatchDrop;var actionTable={none:0,copy:1,link:2,move:4},supportedTable={none:actionTable.none,copy:actionTable.copy,link:actionTable.link,move:actionTable.move,"copy-link":actionTable.copy|actionTable.link,"copy-move":actionTable.copy|actionTable.move,"link-move":actionTable.link|actionTable.move,all:actionTable.copy|actionTable.link|actionTable.move};function createDragEvent(type,drag,event,related){var dragEvent=document.createEvent("MouseEvent");return dragEvent.initMouseEvent(type,!0,!0,window,0,event.screenX,event.screenY,event.clientX,event.clientY,event.ctrlKey,event.altKey,event.shiftKey,event.metaKey,event.button,related),dragEvent.dropAction="none",dragEvent.mimeData=drag.mimeData,dragEvent.proposedAction=drag.proposedAction,dragEvent.supportedActions=drag.supportedActions,dragEvent.source=drag.source,dragEvent}})(Private$l||(Private$l={}));/*! *****************************************************************************
42
41
  Copyright (c) Microsoft Corporation.
43
42
 
44
43
  Permission to use, copy, modify, and/or distribute this software for any
@@ -51,7 +50,7 @@
51
50
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
52
51
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
53
52
  PERFORMANCE OF THIS SOFTWARE.
54
- ***************************************************************************** */var extendStatics$1=function(d,b){return extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$1(d,b)};function __extends$1(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$1(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var VirtualText=function(){function VirtualText2(content){this.type="text",this.content=content}return VirtualText2}(),VirtualElement=function(){function VirtualElement2(tag,attrs,children,renderer){this.type="element",this.tag=tag,this.attrs=attrs,this.children=children,this.renderer=renderer}return VirtualElement2}();(function(_super){__extends$1(VirtualElementPass,_super);function VirtualElementPass(tag,attrs,renderer){return _super.call(this,tag,attrs,[],renderer||void 0)||this}return VirtualElementPass})(VirtualElement);function h(tag){for(var attrs={},renderer,children=[],i=1,n=arguments.length;i<n;++i){var arg=arguments[i];typeof arg=="string"?children.push(new VirtualText(arg)):arg instanceof VirtualText||arg instanceof VirtualElement?children.push(arg):arg instanceof Array?extend(children,arg):(i===1||i===2)&&arg&&typeof arg=="object"&&("render"in arg?renderer=arg:attrs=arg)}return new VirtualElement(tag,attrs,children,renderer);function extend(array,values){for(var _i=0,values_1=values;_i<values_1.length;_i++){var child=values_1[_i];typeof child=="string"?array.push(new VirtualText(child)):(child instanceof VirtualText||child instanceof VirtualElement)&&array.push(child)}}}(function(h2){h2.a=h2.bind(void 0,"a"),h2.abbr=h2.bind(void 0,"abbr"),h2.address=h2.bind(void 0,"address"),h2.area=h2.bind(void 0,"area"),h2.article=h2.bind(void 0,"article"),h2.aside=h2.bind(void 0,"aside"),h2.audio=h2.bind(void 0,"audio"),h2.b=h2.bind(void 0,"b"),h2.bdi=h2.bind(void 0,"bdi"),h2.bdo=h2.bind(void 0,"bdo"),h2.blockquote=h2.bind(void 0,"blockquote"),h2.br=h2.bind(void 0,"br"),h2.button=h2.bind(void 0,"button"),h2.canvas=h2.bind(void 0,"canvas"),h2.caption=h2.bind(void 0,"caption"),h2.cite=h2.bind(void 0,"cite"),h2.code=h2.bind(void 0,"code"),h2.col=h2.bind(void 0,"col"),h2.colgroup=h2.bind(void 0,"colgroup"),h2.data=h2.bind(void 0,"data"),h2.datalist=h2.bind(void 0,"datalist"),h2.dd=h2.bind(void 0,"dd"),h2.del=h2.bind(void 0,"del"),h2.dfn=h2.bind(void 0,"dfn"),h2.div=h2.bind(void 0,"div"),h2.dl=h2.bind(void 0,"dl"),h2.dt=h2.bind(void 0,"dt"),h2.em=h2.bind(void 0,"em"),h2.embed=h2.bind(void 0,"embed"),h2.fieldset=h2.bind(void 0,"fieldset"),h2.figcaption=h2.bind(void 0,"figcaption"),h2.figure=h2.bind(void 0,"figure"),h2.footer=h2.bind(void 0,"footer"),h2.form=h2.bind(void 0,"form"),h2.h1=h2.bind(void 0,"h1"),h2.h2=h2.bind(void 0,"h2"),h2.h3=h2.bind(void 0,"h3"),h2.h4=h2.bind(void 0,"h4"),h2.h5=h2.bind(void 0,"h5"),h2.h6=h2.bind(void 0,"h6"),h2.header=h2.bind(void 0,"header"),h2.hr=h2.bind(void 0,"hr"),h2.i=h2.bind(void 0,"i"),h2.iframe=h2.bind(void 0,"iframe"),h2.img=h2.bind(void 0,"img"),h2.input=h2.bind(void 0,"input"),h2.ins=h2.bind(void 0,"ins"),h2.kbd=h2.bind(void 0,"kbd"),h2.label=h2.bind(void 0,"label"),h2.legend=h2.bind(void 0,"legend"),h2.li=h2.bind(void 0,"li"),h2.main=h2.bind(void 0,"main"),h2.map=h2.bind(void 0,"map"),h2.mark=h2.bind(void 0,"mark"),h2.meter=h2.bind(void 0,"meter"),h2.nav=h2.bind(void 0,"nav"),h2.noscript=h2.bind(void 0,"noscript"),h2.object=h2.bind(void 0,"object"),h2.ol=h2.bind(void 0,"ol"),h2.optgroup=h2.bind(void 0,"optgroup"),h2.option=h2.bind(void 0,"option"),h2.output=h2.bind(void 0,"output"),h2.p=h2.bind(void 0,"p"),h2.param=h2.bind(void 0,"param"),h2.pre=h2.bind(void 0,"pre"),h2.progress=h2.bind(void 0,"progress"),h2.q=h2.bind(void 0,"q"),h2.rp=h2.bind(void 0,"rp"),h2.rt=h2.bind(void 0,"rt"),h2.ruby=h2.bind(void 0,"ruby"),h2.s=h2.bind(void 0,"s"),h2.samp=h2.bind(void 0,"samp"),h2.section=h2.bind(void 0,"section"),h2.select=h2.bind(void 0,"select"),h2.small=h2.bind(void 0,"small"),h2.source=h2.bind(void 0,"source"),h2.span=h2.bind(void 0,"span"),h2.strong=h2.bind(void 0,"strong"),h2.sub=h2.bind(void 0,"sub"),h2.summary=h2.bind(void 0,"summary"),h2.sup=h2.bind(void 0,"sup"),h2.table=h2.bind(void 0,"table"),h2.tbody=h2.bind(void 0,"tbody"),h2.td=h2.bind(void 0,"td"),h2.textarea=h2.bind(void 0,"textarea"),h2.tfoot=h2.bind(void 0,"tfoot"),h2.th=h2.bind(void 0,"th"),h2.thead=h2.bind(void 0,"thead"),h2.time=h2.bind(void 0,"time"),h2.title=h2.bind(void 0,"title"),h2.tr=h2.bind(void 0,"tr"),h2.track=h2.bind(void 0,"track"),h2.u=h2.bind(void 0,"u"),h2.ul=h2.bind(void 0,"ul"),h2.var_=h2.bind(void 0,"var"),h2.video=h2.bind(void 0,"video"),h2.wbr=h2.bind(void 0,"wbr")})(h);var VirtualDOM;(function(VirtualDOM2){function realize(node){return Private$k.createDOMNode(node)}VirtualDOM2.realize=realize;function render(content,host){var oldContent=Private$k.hostMap.get(host)||[],newContent=Private$k.asContentArray(content);Private$k.hostMap.set(host,newContent),Private$k.updateContent(host,oldContent,newContent)}VirtualDOM2.render=render})(VirtualDOM||(VirtualDOM={}));var Private$k;(function(Private2){Private2.hostMap=new WeakMap;function asContentArray(value){return value?value instanceof Array?value:[value]:[]}Private2.asContentArray=asContentArray;function createDOMNode(node){var host=arguments[1]||null,before=arguments[2]||null;if(host)host.insertBefore(createDOMNode(node),before);else{if(node.type==="text")return document.createTextNode(node.content);if(host=document.createElement(node.tag),addAttrs(host,node.attrs),node.renderer)return node.renderer.render(host,{attrs:node.attrs,children:node.children}),host;for(var i=0,n=node.children.length;i<n;++i)createDOMNode(node.children[i],host)}return host}Private2.createDOMNode=createDOMNode;function updateContent(host,oldContent,newContent){if(oldContent!==newContent){for(var oldKeyed=collectKeys(host,oldContent),oldCopy=oldContent.slice(),currElem=host.firstChild,newCount=newContent.length,i=0;i<newCount;++i){if(i>=oldCopy.length){createDOMNode(newContent[i],host);continue}var oldVNode=oldCopy[i],newVNode=newContent[i];if(oldVNode===newVNode){currElem=currElem.nextSibling;continue}if(oldVNode.type==="text"&&newVNode.type==="text"){currElem.textContent!==newVNode.content&&(currElem.textContent=newVNode.content),currElem=currElem.nextSibling;continue}if(oldVNode.type==="text"||newVNode.type==="text"){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}if(!oldVNode.renderer!=!newVNode.renderer){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}var newKey=newVNode.attrs.key;if(newKey&&newKey in oldKeyed){var pair=oldKeyed[newKey];pair.vNode!==oldVNode&&(ArrayExt.move(oldCopy,oldCopy.indexOf(pair.vNode,i+1),i),host.insertBefore(pair.element,currElem),oldVNode=pair.vNode,currElem=pair.element)}if(oldVNode===newVNode){currElem=currElem.nextSibling;continue}var oldKey=oldVNode.attrs.key;if(oldKey&&oldKey!==newKey){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}if(oldVNode.tag!==newVNode.tag){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}updateAttrs(currElem,oldVNode.attrs,newVNode.attrs),newVNode.renderer?newVNode.renderer.render(currElem,{attrs:newVNode.attrs,children:newVNode.children}):updateContent(currElem,oldVNode.children,newVNode.children),currElem=currElem.nextSibling}removeContent(host,oldCopy,newCount,!0)}}Private2.updateContent=updateContent;function removeContent(host,oldContent,newCount,_sentinel){for(var i=oldContent.length-1;i>=newCount;--i){var oldNode=oldContent[i],child=_sentinel?host.lastChild:host.childNodes[i];oldNode.type==="text"||(oldNode.renderer&&oldNode.renderer.unrender?oldNode.renderer.unrender(child,{attrs:oldNode.attrs,children:oldNode.children}):removeContent(child,oldNode.children,0,!1)),_sentinel&&host.removeChild(child)}}var specialAttrs={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function addAttrs(element,attrs){for(var name_1 in attrs)name_1 in specialAttrs||(name_1.substr(0,2)==="on"?element[name_1]=attrs[name_1]:element.setAttribute(name_1,attrs[name_1]));attrs.className!==void 0&&element.setAttribute("class",attrs.className),attrs.htmlFor!==void 0&&element.setAttribute("for",attrs.htmlFor),attrs.dataset&&addDataset(element,attrs.dataset),attrs.style&&addStyle(element,attrs.style)}function updateAttrs(element,oldAttrs,newAttrs){if(oldAttrs!==newAttrs){var name2;for(name2 in oldAttrs)name2 in specialAttrs||name2 in newAttrs||(name2.substr(0,2)==="on"?element[name2]=null:element.removeAttribute(name2));for(name2 in newAttrs)name2 in specialAttrs||oldAttrs[name2]===newAttrs[name2]||(name2.substr(0,2)==="on"?element[name2]=newAttrs[name2]:element.setAttribute(name2,newAttrs[name2]));oldAttrs.className!==newAttrs.className&&(newAttrs.className!==void 0?element.setAttribute("class",newAttrs.className):element.removeAttribute("class")),oldAttrs.htmlFor!==newAttrs.htmlFor&&(newAttrs.htmlFor!==void 0?element.setAttribute("for",newAttrs.htmlFor):element.removeAttribute("for")),oldAttrs.dataset!==newAttrs.dataset&&updateDataset(element,oldAttrs.dataset||{},newAttrs.dataset||{}),oldAttrs.style!==newAttrs.style&&updateStyle(element,oldAttrs.style||{},newAttrs.style||{})}}function addDataset(element,dataset){for(var name_2 in dataset)element.setAttribute("data-"+name_2,dataset[name_2])}function updateDataset(element,oldDataset,newDataset){for(var name_3 in oldDataset)name_3 in newDataset||element.removeAttribute("data-"+name_3);for(var name_4 in newDataset)oldDataset[name_4]!==newDataset[name_4]&&element.setAttribute("data-"+name_4,newDataset[name_4])}function addStyle(element,style){var elemStyle=element.style,name2;for(name2 in style)elemStyle[name2]=style[name2]}function updateStyle(element,oldStyle,newStyle){var elemStyle=element.style,name2;for(name2 in oldStyle)name2 in newStyle||(elemStyle[name2]="");for(name2 in newStyle)oldStyle[name2]!==newStyle[name2]&&(elemStyle[name2]=newStyle[name2])}function collectKeys(host,content){for(var node=host.firstChild,keyMap=Object.create(null),_i=0,content_1=content;_i<content_1.length;_i++){var vNode=content_1[_i];vNode.type==="element"&&vNode.attrs.key&&(keyMap[vNode.attrs.key]={vNode,element:node}),node=node.nextSibling}return keyMap}})(Private$k||(Private$k={}));/*! *****************************************************************************
53
+ ***************************************************************************** */var extendStatics$1=function(d,b){return extendStatics$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics$1(d,b)};function __extends$1(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics$1(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var VirtualText=function(){function VirtualText2(content){this.type="text",this.content=content}return VirtualText2}(),VirtualElement=function(){function VirtualElement2(tag,attrs,children,renderer){this.type="element",this.tag=tag,this.attrs=attrs,this.children=children,this.renderer=renderer}return VirtualElement2}();(function(_super){__extends$1(VirtualElementPass,_super);function VirtualElementPass(tag,attrs,renderer){return _super.call(this,tag,attrs,[],renderer||void 0)||this}return VirtualElementPass})(VirtualElement);function h(tag){for(var attrs={},renderer,children=[],i=1,n=arguments.length;i<n;++i){var arg=arguments[i];typeof arg=="string"?children.push(new VirtualText(arg)):arg instanceof VirtualText||arg instanceof VirtualElement?children.push(arg):arg instanceof Array?extend(children,arg):(i===1||i===2)&&arg&&typeof arg=="object"&&("render"in arg?renderer=arg:attrs=arg)}return new VirtualElement(tag,attrs,children,renderer);function extend(array,values){for(var _i=0,values_1=values;_i<values_1.length;_i++){var child=values_1[_i];typeof child=="string"?array.push(new VirtualText(child)):(child instanceof VirtualText||child instanceof VirtualElement)&&array.push(child)}}}(function(h2){h2.a=h2.bind(void 0,"a"),h2.abbr=h2.bind(void 0,"abbr"),h2.address=h2.bind(void 0,"address"),h2.area=h2.bind(void 0,"area"),h2.article=h2.bind(void 0,"article"),h2.aside=h2.bind(void 0,"aside"),h2.audio=h2.bind(void 0,"audio"),h2.b=h2.bind(void 0,"b"),h2.bdi=h2.bind(void 0,"bdi"),h2.bdo=h2.bind(void 0,"bdo"),h2.blockquote=h2.bind(void 0,"blockquote"),h2.br=h2.bind(void 0,"br"),h2.button=h2.bind(void 0,"button"),h2.canvas=h2.bind(void 0,"canvas"),h2.caption=h2.bind(void 0,"caption"),h2.cite=h2.bind(void 0,"cite"),h2.code=h2.bind(void 0,"code"),h2.col=h2.bind(void 0,"col"),h2.colgroup=h2.bind(void 0,"colgroup"),h2.data=h2.bind(void 0,"data"),h2.datalist=h2.bind(void 0,"datalist"),h2.dd=h2.bind(void 0,"dd"),h2.del=h2.bind(void 0,"del"),h2.dfn=h2.bind(void 0,"dfn"),h2.div=h2.bind(void 0,"div"),h2.dl=h2.bind(void 0,"dl"),h2.dt=h2.bind(void 0,"dt"),h2.em=h2.bind(void 0,"em"),h2.embed=h2.bind(void 0,"embed"),h2.fieldset=h2.bind(void 0,"fieldset"),h2.figcaption=h2.bind(void 0,"figcaption"),h2.figure=h2.bind(void 0,"figure"),h2.footer=h2.bind(void 0,"footer"),h2.form=h2.bind(void 0,"form"),h2.h1=h2.bind(void 0,"h1"),h2.h2=h2.bind(void 0,"h2"),h2.h3=h2.bind(void 0,"h3"),h2.h4=h2.bind(void 0,"h4"),h2.h5=h2.bind(void 0,"h5"),h2.h6=h2.bind(void 0,"h6"),h2.header=h2.bind(void 0,"header"),h2.hr=h2.bind(void 0,"hr"),h2.i=h2.bind(void 0,"i"),h2.iframe=h2.bind(void 0,"iframe"),h2.img=h2.bind(void 0,"img"),h2.input=h2.bind(void 0,"input"),h2.ins=h2.bind(void 0,"ins"),h2.kbd=h2.bind(void 0,"kbd"),h2.label=h2.bind(void 0,"label"),h2.legend=h2.bind(void 0,"legend"),h2.li=h2.bind(void 0,"li"),h2.main=h2.bind(void 0,"main"),h2.map=h2.bind(void 0,"map"),h2.mark=h2.bind(void 0,"mark"),h2.meter=h2.bind(void 0,"meter"),h2.nav=h2.bind(void 0,"nav"),h2.noscript=h2.bind(void 0,"noscript"),h2.object=h2.bind(void 0,"object"),h2.ol=h2.bind(void 0,"ol"),h2.optgroup=h2.bind(void 0,"optgroup"),h2.option=h2.bind(void 0,"option"),h2.output=h2.bind(void 0,"output"),h2.p=h2.bind(void 0,"p"),h2.param=h2.bind(void 0,"param"),h2.pre=h2.bind(void 0,"pre"),h2.progress=h2.bind(void 0,"progress"),h2.q=h2.bind(void 0,"q"),h2.rp=h2.bind(void 0,"rp"),h2.rt=h2.bind(void 0,"rt"),h2.ruby=h2.bind(void 0,"ruby"),h2.s=h2.bind(void 0,"s"),h2.samp=h2.bind(void 0,"samp"),h2.section=h2.bind(void 0,"section"),h2.select=h2.bind(void 0,"select"),h2.small=h2.bind(void 0,"small"),h2.source=h2.bind(void 0,"source"),h2.span=h2.bind(void 0,"span"),h2.strong=h2.bind(void 0,"strong"),h2.sub=h2.bind(void 0,"sub"),h2.summary=h2.bind(void 0,"summary"),h2.sup=h2.bind(void 0,"sup"),h2.table=h2.bind(void 0,"table"),h2.tbody=h2.bind(void 0,"tbody"),h2.td=h2.bind(void 0,"td"),h2.textarea=h2.bind(void 0,"textarea"),h2.tfoot=h2.bind(void 0,"tfoot"),h2.th=h2.bind(void 0,"th"),h2.thead=h2.bind(void 0,"thead"),h2.time=h2.bind(void 0,"time"),h2.title=h2.bind(void 0,"title"),h2.tr=h2.bind(void 0,"tr"),h2.track=h2.bind(void 0,"track"),h2.u=h2.bind(void 0,"u"),h2.ul=h2.bind(void 0,"ul"),h2.var_=h2.bind(void 0,"var"),h2.video=h2.bind(void 0,"video"),h2.wbr=h2.bind(void 0,"wbr")})(h||(h={}));var VirtualDOM;(function(VirtualDOM2){function realize(node){return Private$k.createDOMNode(node)}VirtualDOM2.realize=realize;function render(content,host){var oldContent=Private$k.hostMap.get(host)||[],newContent=Private$k.asContentArray(content);Private$k.hostMap.set(host,newContent),Private$k.updateContent(host,oldContent,newContent)}VirtualDOM2.render=render})(VirtualDOM||(VirtualDOM={}));var Private$k;(function(Private2){Private2.hostMap=new WeakMap;function asContentArray(value){return value?value instanceof Array?value:[value]:[]}Private2.asContentArray=asContentArray;function createDOMNode(node){var host=arguments[1]||null,before=arguments[2]||null;if(host)host.insertBefore(createDOMNode(node),before);else{if(node.type==="text")return document.createTextNode(node.content);if(host=document.createElement(node.tag),addAttrs(host,node.attrs),node.renderer)return node.renderer.render(host,{attrs:node.attrs,children:node.children}),host;for(var i=0,n=node.children.length;i<n;++i)createDOMNode(node.children[i],host)}return host}Private2.createDOMNode=createDOMNode;function updateContent(host,oldContent,newContent){if(oldContent!==newContent){for(var oldKeyed=collectKeys(host,oldContent),oldCopy=oldContent.slice(),currElem=host.firstChild,newCount=newContent.length,i=0;i<newCount;++i){if(i>=oldCopy.length){createDOMNode(newContent[i],host);continue}var oldVNode=oldCopy[i],newVNode=newContent[i];if(oldVNode===newVNode){currElem=currElem.nextSibling;continue}if(oldVNode.type==="text"&&newVNode.type==="text"){currElem.textContent!==newVNode.content&&(currElem.textContent=newVNode.content),currElem=currElem.nextSibling;continue}if(oldVNode.type==="text"||newVNode.type==="text"){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}if(!oldVNode.renderer!=!newVNode.renderer){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}var newKey=newVNode.attrs.key;if(newKey&&newKey in oldKeyed){var pair=oldKeyed[newKey];pair.vNode!==oldVNode&&(ArrayExt.move(oldCopy,oldCopy.indexOf(pair.vNode,i+1),i),host.insertBefore(pair.element,currElem),oldVNode=pair.vNode,currElem=pair.element)}if(oldVNode===newVNode){currElem=currElem.nextSibling;continue}var oldKey=oldVNode.attrs.key;if(oldKey&&oldKey!==newKey){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}if(oldVNode.tag!==newVNode.tag){ArrayExt.insert(oldCopy,i,newVNode),createDOMNode(newVNode,host,currElem);continue}updateAttrs(currElem,oldVNode.attrs,newVNode.attrs),newVNode.renderer?newVNode.renderer.render(currElem,{attrs:newVNode.attrs,children:newVNode.children}):updateContent(currElem,oldVNode.children,newVNode.children),currElem=currElem.nextSibling}removeContent(host,oldCopy,newCount,!0)}}Private2.updateContent=updateContent;function removeContent(host,oldContent,newCount,_sentinel){for(var i=oldContent.length-1;i>=newCount;--i){var oldNode=oldContent[i],child=_sentinel?host.lastChild:host.childNodes[i];oldNode.type==="text"||(oldNode.renderer&&oldNode.renderer.unrender?oldNode.renderer.unrender(child,{attrs:oldNode.attrs,children:oldNode.children}):removeContent(child,oldNode.children,0,!1)),_sentinel&&host.removeChild(child)}}var specialAttrs={key:!0,className:!0,htmlFor:!0,dataset:!0,style:!0};function addAttrs(element,attrs){for(var name_1 in attrs)name_1 in specialAttrs||(name_1.substr(0,2)==="on"?element[name_1]=attrs[name_1]:element.setAttribute(name_1,attrs[name_1]));attrs.className!==void 0&&element.setAttribute("class",attrs.className),attrs.htmlFor!==void 0&&element.setAttribute("for",attrs.htmlFor),attrs.dataset&&addDataset(element,attrs.dataset),attrs.style&&addStyle(element,attrs.style)}function updateAttrs(element,oldAttrs,newAttrs){if(oldAttrs!==newAttrs){var name2;for(name2 in oldAttrs)name2 in specialAttrs||name2 in newAttrs||(name2.substr(0,2)==="on"?element[name2]=null:element.removeAttribute(name2));for(name2 in newAttrs)name2 in specialAttrs||oldAttrs[name2]===newAttrs[name2]||(name2.substr(0,2)==="on"?element[name2]=newAttrs[name2]:element.setAttribute(name2,newAttrs[name2]));oldAttrs.className!==newAttrs.className&&(newAttrs.className!==void 0?element.setAttribute("class",newAttrs.className):element.removeAttribute("class")),oldAttrs.htmlFor!==newAttrs.htmlFor&&(newAttrs.htmlFor!==void 0?element.setAttribute("for",newAttrs.htmlFor):element.removeAttribute("for")),oldAttrs.dataset!==newAttrs.dataset&&updateDataset(element,oldAttrs.dataset||{},newAttrs.dataset||{}),oldAttrs.style!==newAttrs.style&&updateStyle(element,oldAttrs.style||{},newAttrs.style||{})}}function addDataset(element,dataset){for(var name_2 in dataset)element.setAttribute("data-"+name_2,dataset[name_2])}function updateDataset(element,oldDataset,newDataset){for(var name_3 in oldDataset)name_3 in newDataset||element.removeAttribute("data-"+name_3);for(var name_4 in newDataset)oldDataset[name_4]!==newDataset[name_4]&&element.setAttribute("data-"+name_4,newDataset[name_4])}function addStyle(element,style){var elemStyle=element.style,name2;for(name2 in style)elemStyle[name2]=style[name2]}function updateStyle(element,oldStyle,newStyle){var elemStyle=element.style,name2;for(name2 in oldStyle)name2 in newStyle||(elemStyle[name2]="");for(name2 in newStyle)oldStyle[name2]!==newStyle[name2]&&(elemStyle[name2]=newStyle[name2])}function collectKeys(host,content){for(var node=host.firstChild,keyMap=Object.create(null),_i=0,content_1=content;_i<content_1.length;_i++){var vNode=content_1[_i];vNode.type==="element"&&vNode.attrs.key&&(keyMap[vNode.attrs.key]={vNode,element:node}),node=node.nextSibling}return keyMap}})(Private$k||(Private$k={}));/*! *****************************************************************************
55
54
  Copyright (c) Microsoft Corporation.
56
55
 
57
56
  Permission to use, copy, modify, and/or distribute this software for any
@@ -64,5 +63,6 @@
64
63
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
65
64
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
66
65
  PERFORMANCE OF THIS SOFTWARE.
67
- ***************************************************************************** */var extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics(d,b)};function __extends(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t}function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;for(var r=Array(s),k=0,i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var BoxSizer=function(){function BoxSizer2(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}return BoxSizer2}(),BoxEngine;(function(BoxEngine2){function calc(sizers,space){var count=sizers.length;if(count===0)return space;for(var totalMin=0,totalMax=0,totalSize=0,totalStretch=0,stretchCount=0,i=0;i<count;++i){var sizer=sizers[i],min=sizer.minSize,max2=sizer.maxSize,hint=sizer.sizeHint;sizer.done=!1,sizer.size=Math.max(min,Math.min(hint,max2)),totalSize+=sizer.size,totalMin+=min,totalMax+=max2,sizer.stretch>0&&(totalStretch+=sizer.stretch,stretchCount++)}if(space===totalSize)return 0;if(space<=totalMin){for(var i=0;i<count;++i){var sizer=sizers[i];sizer.size=sizer.minSize}return space-totalMin}if(space>=totalMax){for(var i=0;i<count;++i){var sizer=sizers[i];sizer.size=sizer.maxSize}return space-totalMax}var nearZero=.01,notDoneCount=count;if(space<totalSize){for(var freeSpace=totalSize-space;stretchCount>0&&freeSpace>nearZero;)for(var distSpace=freeSpace,distStretch=totalStretch,i=0;i<count;++i){var sizer=sizers[i];if(!(sizer.done||sizer.stretch===0)){var amt=sizer.stretch*distSpace/distStretch;sizer.size-amt<=sizer.minSize?(freeSpace-=sizer.size-sizer.minSize,totalStretch-=sizer.stretch,sizer.size=sizer.minSize,sizer.done=!0,notDoneCount--,stretchCount--):(freeSpace-=amt,sizer.size-=amt)}}for(;notDoneCount>0&&freeSpace>nearZero;)for(var amt=freeSpace/notDoneCount,i=0;i<count;++i){var sizer=sizers[i];sizer.done||(sizer.size-amt<=sizer.minSize?(freeSpace-=sizer.size-sizer.minSize,sizer.size=sizer.minSize,sizer.done=!0,notDoneCount--):(freeSpace-=amt,sizer.size-=amt))}}else{for(var freeSpace=space-totalSize;stretchCount>0&&freeSpace>nearZero;)for(var distSpace=freeSpace,distStretch=totalStretch,i=0;i<count;++i){var sizer=sizers[i];if(!(sizer.done||sizer.stretch===0)){var amt=sizer.stretch*distSpace/distStretch;sizer.size+amt>=sizer.maxSize?(freeSpace-=sizer.maxSize-sizer.size,totalStretch-=sizer.stretch,sizer.size=sizer.maxSize,sizer.done=!0,notDoneCount--,stretchCount--):(freeSpace-=amt,sizer.size+=amt)}}for(;notDoneCount>0&&freeSpace>nearZero;)for(var amt=freeSpace/notDoneCount,i=0;i<count;++i){var sizer=sizers[i];sizer.done||(sizer.size+amt>=sizer.maxSize?(freeSpace-=sizer.maxSize-sizer.size,sizer.size=sizer.maxSize,sizer.done=!0,notDoneCount--):(freeSpace-=amt,sizer.size+=amt))}}return 0}BoxEngine2.calc=calc;function adjust(sizers,index,delta){sizers.length===0||delta===0||(delta>0?growSizer(sizers,index,delta):shrinkSizer(sizers,index,-delta))}BoxEngine2.adjust=adjust;function growSizer(sizers,index,delta){for(var growLimit=0,i=0;i<=index;++i){var sizer=sizers[i];growLimit+=sizer.maxSize-sizer.size}for(var shrinkLimit=0,i=index+1,n=sizers.length;i<n;++i){var sizer=sizers[i];shrinkLimit+=sizer.size-sizer.minSize}delta=Math.min(delta,growLimit,shrinkLimit);for(var grow=delta,i=index;i>=0&&grow>0;--i){var sizer=sizers[i],limit=sizer.maxSize-sizer.size;limit>=grow?(sizer.sizeHint=sizer.size+grow,grow=0):(sizer.sizeHint=sizer.size+limit,grow-=limit)}for(var shrink=delta,i=index+1,n=sizers.length;i<n&&shrink>0;++i){var sizer=sizers[i],limit=sizer.size-sizer.minSize;limit>=shrink?(sizer.sizeHint=sizer.size-shrink,shrink=0):(sizer.sizeHint=sizer.size-limit,shrink-=limit)}}function shrinkSizer(sizers,index,delta){for(var growLimit=0,i=index+1,n=sizers.length;i<n;++i){var sizer=sizers[i];growLimit+=sizer.maxSize-sizer.size}for(var shrinkLimit=0,i=0;i<=index;++i){var sizer=sizers[i];shrinkLimit+=sizer.size-sizer.minSize}delta=Math.min(delta,growLimit,shrinkLimit);for(var grow=delta,i=index+1,n=sizers.length;i<n&&grow>0;++i){var sizer=sizers[i],limit=sizer.maxSize-sizer.size;limit>=grow?(sizer.sizeHint=sizer.size+grow,grow=0):(sizer.sizeHint=sizer.size+limit,grow-=limit)}for(var shrink=delta,i=index;i>=0&&shrink>0;--i){var sizer=sizers[i],limit=sizer.size-sizer.minSize;limit>=shrink?(sizer.sizeHint=sizer.size-shrink,shrink=0):(sizer.sizeHint=sizer.size-limit,shrink-=limit)}}})(BoxEngine||(BoxEngine={}));var Title=function(){function Title2(options){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Signal(this),this._isDisposed=!1,this.owner=options.owner,options.label!==void 0&&(this._label=options.label),options.mnemonic!==void 0&&(this._mnemonic=options.mnemonic),options.icon!==void 0?typeof options.icon=="string"?(this._icon=null,this._iconClass=options.icon):this._icon=options.icon:this._icon=null,options.iconClass!==void 0&&(this._iconClass=options.iconClass),options.iconLabel!==void 0&&(this._iconLabel=options.iconLabel),options.iconRenderer!==void 0&&(this._icon=options.iconRenderer),options.caption!==void 0&&(this._caption=options.caption),options.className!==void 0&&(this._className=options.className),options.closable!==void 0&&(this._closable=options.closable),this._dataset=options.dataset||{}}return Object.defineProperty(Title2.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"label",{get:function(){return this._label},set:function(value){this._label!==value&&(this._label=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(value){this._mnemonic!==value&&(this._mnemonic=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"icon",{get:function(){return this._icon===null?this.iconClass:this._icon},set:function(value){if(typeof value=="string")this._icon=null,this.iconClass=value;else{if(this._icon===value)return;this._icon=value,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconClass",{get:function(){return this._iconClass},set:function(value){this._iconClass!==value&&(this._iconClass=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(value){this._iconLabel!==value&&(this._iconLabel=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(value){this.icon=value},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"caption",{get:function(){return this._caption},set:function(value){this._caption!==value&&(this._caption=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"className",{get:function(){return this._className},set:function(value){this._className!==value&&(this._className=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"closable",{get:function(){return this._closable},set:function(value){this._closable!==value&&(this._closable=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"dataset",{get:function(){return this._dataset},set:function(value){this._dataset!==value&&(this._dataset=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),Title2.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,Signal.clearData(this))},Title2}(),Widget=function(){function Widget2(options){options===void 0&&(options={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new Signal(this),this._hiddenMode=Widget2.HiddenMode.Display,this.node=Private$j.createNode(options),this.addClass("lm-Widget"),this.addClass("p-Widget")}return Widget2.prototype.dispose=function(){this.isDisposed||(this.setFlag(Widget2.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&Widget2.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Signal.clearData(this),MessageLoop.clearData(this),AttachedProperty.clearData(this))},Object.defineProperty(Widget2.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isDisposed",{get:function(){return this.testFlag(Widget2.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isAttached",{get:function(){return this.testFlag(Widget2.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isHidden",{get:function(){return this.testFlag(Widget2.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isVisible",{get:function(){return this.testFlag(Widget2.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"title",{get:function(){return Private$j.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"id",{get:function(){return this.node.id},set:function(value){this.node.id=value},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(value){this._hiddenMode!==value&&(this.isHidden&&this._toggleHidden(!1),value==Widget2.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=value,this.isHidden&&this._toggleHidden(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"parent",{get:function(){return this._parent},set:function(value){if(this._parent!==value){if(value&&this.contains(value))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var msg=new Widget2.ChildMessage("child-removed",this);MessageLoop.sendMessage(this._parent,msg)}if(this._parent=value,this._parent&&!this._parent.isDisposed){var msg=new Widget2.ChildMessage("child-added",this);MessageLoop.sendMessage(this._parent,msg)}this.isDisposed||MessageLoop.sendMessage(this,Widget2.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"layout",{get:function(){return this._layout},set:function(value){if(this._layout!==value){if(this.testFlag(Widget2.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(value.parent)throw new Error("Cannot change layout parent.");this._layout=value,value.parent=this}},enumerable:!0,configurable:!0}),Widget2.prototype.children=function(){return this._layout?this._layout.iter():empty()},Widget2.prototype.contains=function(widget){for(var value=widget;value;value=value._parent)if(value===this)return!0;return!1},Widget2.prototype.hasClass=function(name2){return this.node.classList.contains(name2)},Widget2.prototype.addClass=function(name2){this.node.classList.add(name2)},Widget2.prototype.removeClass=function(name2){this.node.classList.remove(name2)},Widget2.prototype.toggleClass=function(name2,force){return force===!0?(this.node.classList.add(name2),!0):force===!1?(this.node.classList.remove(name2),!1):this.node.classList.toggle(name2)},Widget2.prototype.update=function(){MessageLoop.postMessage(this,Widget2.Msg.UpdateRequest)},Widget2.prototype.fit=function(){MessageLoop.postMessage(this,Widget2.Msg.FitRequest)},Widget2.prototype.activate=function(){MessageLoop.postMessage(this,Widget2.Msg.ActivateRequest)},Widget2.prototype.close=function(){MessageLoop.sendMessage(this,Widget2.Msg.CloseRequest)},Widget2.prototype.show=function(){if(this.testFlag(Widget2.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.BeforeShow),this.clearFlag(Widget2.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.AfterShow),this.parent)){var msg=new Widget2.ChildMessage("child-shown",this);MessageLoop.sendMessage(this.parent,msg)}},Widget2.prototype.hide=function(){if(!this.testFlag(Widget2.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.BeforeHide),this.setFlag(Widget2.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.AfterHide),this.parent)){var msg=new Widget2.ChildMessage("child-hidden",this);MessageLoop.sendMessage(this.parent,msg)}},Widget2.prototype.setHidden=function(hidden){hidden?this.hide():this.show()},Widget2.prototype.testFlag=function(flag){return(this._flags&flag)!==0},Widget2.prototype.setFlag=function(flag){this._flags|=flag},Widget2.prototype.clearFlag=function(flag){this._flags&=~flag},Widget2.prototype.processMessage=function(msg){switch(msg.type){case"resize":this.notifyLayout(msg),this.onResize(msg);break;case"update-request":this.notifyLayout(msg),this.onUpdateRequest(msg);break;case"fit-request":this.notifyLayout(msg),this.onFitRequest(msg);break;case"before-show":this.notifyLayout(msg),this.onBeforeShow(msg);break;case"after-show":this.setFlag(Widget2.Flag.IsVisible),this.notifyLayout(msg),this.onAfterShow(msg);break;case"before-hide":this.notifyLayout(msg),this.onBeforeHide(msg);break;case"after-hide":this.clearFlag(Widget2.Flag.IsVisible),this.notifyLayout(msg),this.onAfterHide(msg);break;case"before-attach":this.notifyLayout(msg),this.onBeforeAttach(msg);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(Widget2.Flag.IsVisible),this.setFlag(Widget2.Flag.IsAttached),this.notifyLayout(msg),this.onAfterAttach(msg);break;case"before-detach":this.notifyLayout(msg),this.onBeforeDetach(msg);break;case"after-detach":this.clearFlag(Widget2.Flag.IsVisible),this.clearFlag(Widget2.Flag.IsAttached),this.notifyLayout(msg),this.onAfterDetach(msg);break;case"activate-request":this.notifyLayout(msg),this.onActivateRequest(msg);break;case"close-request":this.notifyLayout(msg),this.onCloseRequest(msg);break;case"child-added":this.notifyLayout(msg),this.onChildAdded(msg);break;case"child-removed":this.notifyLayout(msg),this.onChildRemoved(msg);break;default:this.notifyLayout(msg);break}},Widget2.prototype.notifyLayout=function(msg){this._layout&&this._layout.processParentMessage(msg)},Widget2.prototype.onCloseRequest=function(msg){this.parent?this.parent=null:this.isAttached&&Widget2.detach(this)},Widget2.prototype.onResize=function(msg){},Widget2.prototype.onUpdateRequest=function(msg){},Widget2.prototype.onFitRequest=function(msg){},Widget2.prototype.onActivateRequest=function(msg){},Widget2.prototype.onBeforeShow=function(msg){},Widget2.prototype.onAfterShow=function(msg){},Widget2.prototype.onBeforeHide=function(msg){},Widget2.prototype.onAfterHide=function(msg){},Widget2.prototype.onBeforeAttach=function(msg){},Widget2.prototype.onAfterAttach=function(msg){},Widget2.prototype.onBeforeDetach=function(msg){},Widget2.prototype.onAfterDetach=function(msg){},Widget2.prototype.onChildAdded=function(msg){},Widget2.prototype.onChildRemoved=function(msg){},Widget2.prototype._toggleHidden=function(hidden){if(hidden)switch(this._hiddenMode){case Widget2.HiddenMode.Display:this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden");break;case Widget2.HiddenMode.Scale:this.node.style.transform="scale(0)";break;case Widget2.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case Widget2.HiddenMode.Display:this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden");break;case Widget2.HiddenMode.Scale:this.node.style.transform="";break;case Widget2.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}},Widget2}();(function(Widget2){(function(HiddenMode){HiddenMode[HiddenMode.Display=0]="Display",HiddenMode[HiddenMode.Scale=1]="Scale",HiddenMode[HiddenMode.ContentVisibility=2]="ContentVisibility"})(Widget2.HiddenMode||(Widget2.HiddenMode={})),function(Flag){Flag[Flag.IsDisposed=1]="IsDisposed",Flag[Flag.IsAttached=2]="IsAttached",Flag[Flag.IsHidden=4]="IsHidden",Flag[Flag.IsVisible=8]="IsVisible",Flag[Flag.DisallowLayout=16]="DisallowLayout"}(Widget2.Flag||(Widget2.Flag={})),function(Msg){Msg.BeforeShow=new Message("before-show"),Msg.AfterShow=new Message("after-show"),Msg.BeforeHide=new Message("before-hide"),Msg.AfterHide=new Message("after-hide"),Msg.BeforeAttach=new Message("before-attach"),Msg.AfterAttach=new Message("after-attach"),Msg.BeforeDetach=new Message("before-detach"),Msg.AfterDetach=new Message("after-detach"),Msg.ParentChanged=new Message("parent-changed"),Msg.UpdateRequest=new ConflatableMessage("update-request"),Msg.FitRequest=new ConflatableMessage("fit-request"),Msg.ActivateRequest=new ConflatableMessage("activate-request"),Msg.CloseRequest=new ConflatableMessage("close-request")}(Widget2.Msg||(Widget2.Msg={}));var ChildMessage=function(_super){__extends(ChildMessage2,_super);function ChildMessage2(type,child){var _this=_super.call(this,type)||this;return _this.child=child,_this}return ChildMessage2}(Message);Widget2.ChildMessage=ChildMessage;var ResizeMessage=function(_super){__extends(ResizeMessage2,_super);function ResizeMessage2(width,height){var _this=_super.call(this,"resize")||this;return _this.width=width,_this.height=height,_this}return ResizeMessage2}(Message);Widget2.ResizeMessage=ResizeMessage,function(ResizeMessage2){ResizeMessage2.UnknownSize=new ResizeMessage2(-1,-1)}(ResizeMessage=Widget2.ResizeMessage||(Widget2.ResizeMessage={}));function attach(widget,host,ref){if(ref===void 0&&(ref=null),widget.parent)throw new Error("Cannot attach a child widget.");if(widget.isAttached||widget.node.isConnected)throw new Error("Widget is already attached.");if(!host.isConnected)throw new Error("Host is not attached.");MessageLoop.sendMessage(widget,Widget2.Msg.BeforeAttach),host.insertBefore(widget.node,ref),MessageLoop.sendMessage(widget,Widget2.Msg.AfterAttach)}Widget2.attach=attach;function detach(widget){if(widget.parent)throw new Error("Cannot detach a child widget.");if(!widget.isAttached||!widget.node.isConnected)throw new Error("Widget is not attached.");MessageLoop.sendMessage(widget,Widget2.Msg.BeforeDetach),widget.node.parentNode.removeChild(widget.node),MessageLoop.sendMessage(widget,Widget2.Msg.AfterDetach)}Widget2.detach=detach})(Widget);var Private$j;(function(Private2){Private2.titleProperty=new AttachedProperty({name:"title",create:function(owner){return new Title({owner})}});function createNode(options){return options.node||document.createElement(options.tag||"div")}Private2.createNode=createNode})(Private$j||(Private$j={}));var Layout=function(){function Layout2(options){options===void 0&&(options={}),this._disposed=!1,this._parent=null,this._fitPolicy=options.fitPolicy||"set-min-size"}return Layout2.prototype.dispose=function(){this._parent=null,this._disposed=!0,Signal.clearData(this),AttachedProperty.clearData(this)},Object.defineProperty(Layout2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(Layout2.prototype,"parent",{get:function(){return this._parent},set:function(value){if(this._parent!==value){if(this._parent)throw new Error("Cannot change parent widget.");if(value.layout!==this)throw new Error("Invalid parent widget.");this._parent=value,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(Layout2.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(value){if(this._fitPolicy!==value&&(this._fitPolicy=value,this._parent)){var style=this._parent.node.style;style.minWidth="",style.minHeight="",style.maxWidth="",style.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),Layout2.prototype.processParentMessage=function(msg){switch(msg.type){case"resize":this.onResize(msg);break;case"update-request":this.onUpdateRequest(msg);break;case"fit-request":this.onFitRequest(msg);break;case"before-show":this.onBeforeShow(msg);break;case"after-show":this.onAfterShow(msg);break;case"before-hide":this.onBeforeHide(msg);break;case"after-hide":this.onAfterHide(msg);break;case"before-attach":this.onBeforeAttach(msg);break;case"after-attach":this.onAfterAttach(msg);break;case"before-detach":this.onBeforeDetach(msg);break;case"after-detach":this.onAfterDetach(msg);break;case"child-removed":this.onChildRemoved(msg);break;case"child-shown":this.onChildShown(msg);break;case"child-hidden":this.onChildHidden(msg);break}},Layout2.prototype.init=function(){var _this=this;each(this,function(widget){widget.parent=_this.parent})},Layout2.prototype.onResize=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,Widget.ResizeMessage.UnknownSize)})},Layout2.prototype.onUpdateRequest=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,Widget.ResizeMessage.UnknownSize)})},Layout2.prototype.onBeforeAttach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterAttach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeDetach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterDetach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeShow=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterShow=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeHide=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterHide=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onChildRemoved=function(msg){this.removeWidget(msg.child)},Layout2.prototype.onFitRequest=function(msg){},Layout2.prototype.onChildShown=function(msg){},Layout2.prototype.onChildHidden=function(msg){},Layout2}();(function(Layout2){function getHorizontalAlignment(widget){return Private$i.horizontalAlignmentProperty.get(widget)}Layout2.getHorizontalAlignment=getHorizontalAlignment;function setHorizontalAlignment(widget,value){Private$i.horizontalAlignmentProperty.set(widget,value)}Layout2.setHorizontalAlignment=setHorizontalAlignment;function getVerticalAlignment(widget){return Private$i.verticalAlignmentProperty.get(widget)}Layout2.getVerticalAlignment=getVerticalAlignment;function setVerticalAlignment(widget,value){Private$i.verticalAlignmentProperty.set(widget,value)}Layout2.setVerticalAlignment=setVerticalAlignment})(Layout);var LayoutItem=function(){function LayoutItem2(widget){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=widget,this.widget.node.style.position="absolute"}return LayoutItem2.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var style=this.widget.node.style;style.position="",style.top="",style.left="",style.width="",style.height=""}},Object.defineProperty(LayoutItem2.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),LayoutItem2.prototype.fit=function(){var limits=ElementExt.sizeLimits(this.widget.node);this._minWidth=limits.minWidth,this._minHeight=limits.minHeight,this._maxWidth=limits.maxWidth,this._maxHeight=limits.maxHeight},LayoutItem2.prototype.update=function(left,top,width,height){var clampW=Math.max(this._minWidth,Math.min(width,this._maxWidth)),clampH=Math.max(this._minHeight,Math.min(height,this._maxHeight));if(clampW<width)switch(Layout.getHorizontalAlignment(this.widget)){case"left":break;case"center":left+=(width-clampW)/2;break;case"right":left+=width-clampW;break;default:throw"unreachable"}if(clampH<height)switch(Layout.getVerticalAlignment(this.widget)){case"top":break;case"center":top+=(height-clampH)/2;break;case"bottom":top+=height-clampH;break;default:throw"unreachable"}var resized=!1,style=this.widget.node.style;if(this._top!==top&&(this._top=top,style.top=top+"px"),this._left!==left&&(this._left=left,style.left=left+"px"),this._width!==clampW&&(resized=!0,this._width=clampW,style.width=clampW+"px"),this._height!==clampH&&(resized=!0,this._height=clampH,style.height=clampH+"px"),resized){var msg=new Widget.ResizeMessage(clampW,clampH);MessageLoop.sendMessage(this.widget,msg)}},LayoutItem2}(),Private$i;(function(Private2){Private2.horizontalAlignmentProperty=new AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:onAlignmentChanged}),Private2.verticalAlignmentProperty=new AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:onAlignmentChanged});function onAlignmentChanged(child){child.parent&&child.parent.layout&&child.parent.update()}})(Private$i||(Private$i={}));var PanelLayout=function(_super){__extends(PanelLayout2,_super);function PanelLayout2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._widgets=[],_this}return PanelLayout2.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();_super.prototype.dispose.call(this)},Object.defineProperty(PanelLayout2.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),PanelLayout2.prototype.iter=function(){return iter(this._widgets)},PanelLayout2.prototype.addWidget=function(widget){this.insertWidget(this._widgets.length,widget)},PanelLayout2.prototype.insertWidget=function(index,widget){widget.parent=this.parent;var i=this._widgets.indexOf(widget),j=Math.max(0,Math.min(index,this._widgets.length));if(i===-1){ArrayExt.insert(this._widgets,j,widget),this.parent&&this.attachWidget(j,widget);return}j===this._widgets.length&&j--,i!==j&&(ArrayExt.move(this._widgets,i,j),this.parent&&this.moveWidget(i,j,widget))},PanelLayout2.prototype.removeWidget=function(widget){this.removeWidgetAt(this._widgets.indexOf(widget))},PanelLayout2.prototype.removeWidgetAt=function(index){var widget=ArrayExt.removeAt(this._widgets,index);widget&&this.parent&&this.detachWidget(index,widget)},PanelLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget,index){_this.attachWidget(index,widget)})},PanelLayout2.prototype.attachWidget=function(index,widget){var ref=this.parent.node.children[index];this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.insertBefore(widget.node,ref),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},PanelLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach);var ref=this.parent.node.children[toIndex];this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.insertBefore(widget.node,ref),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},PanelLayout2.prototype.detachWidget=function(index,widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach)},PanelLayout2}(Layout),Utils;(function(Utils2){function clampDimension(value){return Math.max(0,Math.floor(value))}Utils2.clampDimension=clampDimension})(Utils||(Utils={}));var Utils$1=Utils,SplitLayout=function(_super){__extends(SplitLayout2,_super);function SplitLayout2(options){var _this=_super.call(this)||this;return _this.widgetOffset=0,_this._fixed=0,_this._spacing=4,_this._dirty=!1,_this._hasNormedSizes=!1,_this._sizers=[],_this._items=[],_this._handles=[],_this._box=null,_this._alignment="start",_this._orientation="horizontal",_this.renderer=options.renderer,options.orientation!==void 0&&(_this._orientation=options.orientation),options.alignment!==void 0&&(_this._alignment=options.alignment),options.spacing!==void 0&&(_this._spacing=Utils.clampDimension(options.spacing)),_this}return SplitLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(SplitLayout2.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._orientation=value,this.parent&&(this.parent.dataset.orientation=value,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"alignment",{get:function(){return this._alignment},set:function(value){this._alignment!==value&&(this._alignment=value,this.parent&&(this.parent.dataset.alignment=value,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),SplitLayout2.prototype.absoluteSizes=function(){return this._sizers.map(function(sizer){return sizer.size})},SplitLayout2.prototype.relativeSizes=function(){return Private$h.normalize(this._sizers.map(function(sizer){return sizer.size}))},SplitLayout2.prototype.setRelativeSizes=function(sizes,update){update===void 0&&(update=!0);for(var n=this._sizers.length,temp=sizes.slice(0,n);temp.length<n;)temp.push(0);for(var normed=Private$h.normalize(temp),i=0;i<n;++i){var sizer=this._sizers[i];sizer.sizeHint=normed[i],sizer.size=normed[i]}this._hasNormedSizes=!0,update&&this.parent&&this.parent.update()},SplitLayout2.prototype.moveHandle=function(index,position){var handle=this._handles[index];if(!(!handle||handle.classList.contains("lm-mod-hidden"))){var delta;if(this._orientation==="horizontal"?delta=position-handle.offsetLeft:delta=position-handle.offsetTop,delta!==0){for(var _i=0,_a=this._sizers;_i<_a.length;_i++){var sizer=_a[_i];sizer.size>0&&(sizer.sizeHint=sizer.size)}BoxEngine.adjust(this._sizers,index,delta),this.parent&&this.parent.update()}}},SplitLayout2.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,_super.prototype.init.call(this)},SplitLayout2.prototype.attachWidget=function(index,widget){var item=new LayoutItem(widget),handle=Private$h.createHandle(this.renderer),average=Private$h.averageSize(this._sizers),sizer=Private$h.createSizer(average);ArrayExt.insert(this._items,index,item),ArrayExt.insert(this._sizers,index,sizer),ArrayExt.insert(this._handles,index,handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.node.appendChild(handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},SplitLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),ArrayExt.move(this._sizers,fromIndex,toIndex),ArrayExt.move(this._handles,fromIndex,toIndex),this.parent.fit()},SplitLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index),handle=ArrayExt.removeAt(this._handles,index);ArrayExt.removeAt(this._sizers,index),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.node.removeChild(handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.dispose(),this.parent.fit()},SplitLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},SplitLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},SplitLayout2.prototype.onChildShown=function(msg){this.parent.fit()},SplitLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},SplitLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},SplitLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},SplitLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},SplitLayout2.prototype.updateItemPosition=function(i,isHorizontal,left,top,height,width,size){var item=this._items[i];if(!item.isHidden){var handleStyle=this._handles[i].style;isHorizontal?(left+=this.widgetOffset,item.update(left,top,size,height),left+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=this._spacing+"px",handleStyle.height=height+"px"):(top+=this.widgetOffset,item.update(left,top,width,size),top+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=width+"px",handleStyle.height=this._spacing+"px")}},SplitLayout2.prototype._fit=function(){for(var nVisible=0,lastHandleIndex=-1,i=0,n=this._items.length;i<n;++i)this._items[i].isHidden?(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")):(this._handles[i].classList.remove("lm-mod-hidden"),this._handles[i].classList.remove("p-mod-hidden"),lastHandleIndex=i,nVisible++);lastHandleIndex!==-1&&(this._handles[lastHandleIndex].classList.add("lm-mod-hidden"),this._handles[lastHandleIndex].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,nVisible-1)+this.widgetOffset*this._items.length;for(var horz=this._orientation==="horizontal",minW=horz?this._fixed:0,minH=horz?0:this._fixed,i=0,n=this._items.length;i<n;++i){var item=this._items[i],sizer=this._sizers[i];if(sizer.size>0&&(sizer.sizeHint=sizer.size),item.isHidden){sizer.minSize=0,sizer.maxSize=0;continue}item.fit(),sizer.stretch=SplitLayout2.getStretch(item.widget),horz?(sizer.minSize=item.minWidth,sizer.maxSize=item.maxWidth,minW+=item.minWidth,minH=Math.max(minH,item.minHeight)):(sizer.minSize=item.minHeight,sizer.maxSize=item.maxHeight,minH+=item.minHeight,minW=Math.max(minW,item.minWidth))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},SplitLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(!(nVisible===0&&this.widgetOffset===0)){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,extra=0,offset=0,horz=this._orientation==="horizontal";if(nVisible>0){var space=void 0;if(horz?space=Math.max(0,width-this._fixed):space=Math.max(0,height-this._fixed),this._hasNormedSizes){for(var _i=0,_a=this._sizers;_i<_a.length;_i++){var sizer=_a[_i];sizer.sizeHint*=space}this._hasNormedSizes=!1}var delta=BoxEngine.calc(this._sizers,space);if(delta>0)switch(this._alignment){case"start":break;case"center":extra=0,offset=delta/2;break;case"end":extra=0,offset=delta;break;case"justify":extra=delta/nVisible,offset=0;break;default:throw"unreachable"}}for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i],size=item.isHidden?0:this._sizers[i].size+extra;this.updateItemPosition(i,horz,horz?left+offset:left,horz?top:top+offset,height,width,size);var fullOffset=this.widgetOffset+(this._handles[i].classList.contains("lm-mod-hidden")?0:this._spacing);horz?left+=size+fullOffset:top+=size+fullOffset}}},SplitLayout2}(PanelLayout);(function(SplitLayout2){function getStretch(widget){return Private$h.stretchProperty.get(widget)}SplitLayout2.getStretch=getStretch;function setStretch(widget,value){Private$h.stretchProperty.set(widget,value)}SplitLayout2.setStretch=setStretch})(SplitLayout);var Private$h;(function(Private2){Private2.stretchProperty=new AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged});function createSizer(size){var sizer=new BoxSizer;return sizer.sizeHint=Math.floor(size),sizer}Private2.createSizer=createSizer;function createHandle(renderer){var handle=renderer.createHandle();return handle.style.position="absolute",handle}Private2.createHandle=createHandle;function averageSize(sizers){return sizers.reduce(function(v,s){return v+s.size},0)/sizers.length||0}Private2.averageSize=averageSize;function normalize(values){var n=values.length;if(n===0)return[];var sum=values.reduce(function(a,b){return a+Math.abs(b)},0);return sum===0?values.map(function(v){return 1/n}):values.map(function(v){return v/sum})}Private2.normalize=normalize;function onChildSizingChanged(child){child.parent&&child.parent.layout instanceof SplitLayout&&child.parent.fit()}})(Private$h||(Private$h={}));var AccordionLayout=function(_super){__extends(AccordionLayout2,_super);function AccordionLayout2(options){var _this=_super.call(this,__assign(__assign({},options),{orientation:options.orientation||"vertical"}))||this;return _this._titles=[],_this.titleSpace=options.titleSpace||22,_this}return Object.defineProperty(AccordionLayout2.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(value){value=Utils$1.clampDimension(value),this.widgetOffset!==value&&(this.widgetOffset=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionLayout2.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),AccordionLayout2.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,_super.prototype.dispose.call(this))},AccordionLayout2.prototype.updateTitle=function(index,widget){var oldTitle=this._titles[index],expanded=oldTitle.classList.contains("lm-mod-expanded"),newTitle=Private$g.createTitle(this.renderer,widget.title,expanded);this._titles[index]=newTitle,this.parent.node.replaceChild(newTitle,oldTitle)},AccordionLayout2.prototype.attachWidget=function(index,widget){var title=Private$g.createTitle(this.renderer,widget.title);ArrayExt.insert(this._titles,index,title),this.parent.node.appendChild(title),widget.node.setAttribute("role","region"),widget.node.setAttribute("aria-labelledby",title.id),_super.prototype.attachWidget.call(this,index,widget)},AccordionLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._titles,fromIndex,toIndex),_super.prototype.moveWidget.call(this,fromIndex,toIndex,widget)},AccordionLayout2.prototype.detachWidget=function(index,widget){var title=ArrayExt.removeAt(this._titles,index);this.parent.node.removeChild(title),_super.prototype.detachWidget.call(this,index,widget)},AccordionLayout2.prototype.updateItemPosition=function(i,isHorizontal,left,top,height,width,size){var titleStyle=this._titles[i].style;titleStyle.top=top+"px",titleStyle.left=left+"px",titleStyle.height=this.widgetOffset+"px",isHorizontal?titleStyle.width=height+"px":titleStyle.width=width+"px",_super.prototype.updateItemPosition.call(this,i,isHorizontal,left,top,height,width,size)},AccordionLayout2}(SplitLayout),Private$g;(function(Private2){function createTitle(renderer,data,expanded){expanded===void 0&&(expanded=!0);var title=renderer.createSectionTitle(data);return title.style.position="absolute",title.setAttribute("aria-label",data.label+" Section"),title.setAttribute("aria-expanded",expanded?"true":"false"),title.setAttribute("aria-controls",data.owner.id),expanded&&title.classList.add("lm-mod-expanded"),title}Private2.createTitle=createTitle})(Private$g||(Private$g={}));var Panel=function(_super){__extends(Panel2,_super);function Panel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;return _this.addClass("lm-Panel"),_this.addClass("p-Panel"),_this.layout=Private$f.createLayout(options),_this}return Object.defineProperty(Panel2.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),Panel2.prototype.addWidget=function(widget){this.layout.addWidget(widget)},Panel2.prototype.insertWidget=function(index,widget){this.layout.insertWidget(index,widget)},Panel2}(Widget),Private$f;(function(Private2){function createLayout(options){return options.layout||new PanelLayout}Private2.createLayout=createLayout})(Private$f||(Private$f={}));var SplitPanel$1=function(_super){__extends(SplitPanel2,_super);function SplitPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$e.createLayout(options)})||this;return _this._handleMoved=new Signal(_this),_this._pressData=null,_this.addClass("lm-SplitPanel"),_this.addClass("p-SplitPanel"),_this}return SplitPanel2.prototype.dispose=function(){this._releaseMouse(),_super.prototype.dispose.call(this)},Object.defineProperty(SplitPanel2.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(value){this.layout.orientation=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(value){this.layout.alignment=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),SplitPanel2.prototype.relativeSizes=function(){return this.layout.relativeSizes()},SplitPanel2.prototype.setRelativeSizes=function(sizes,update){update===void 0&&(update=!0),this.layout.setRelativeSizes(sizes,update)},SplitPanel2.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},SplitPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},SplitPanel2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},SplitPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-SplitPanel-child"),msg.child.addClass("p-SplitPanel-child"),this._releaseMouse()},SplitPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-SplitPanel-child"),msg.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},SplitPanel2.prototype._evtKeyDown=function(event){this._pressData&&(event.preventDefault(),event.stopPropagation()),event.keyCode===27&&this._releaseMouse()},SplitPanel2.prototype._evtMouseDown=function(event){if(event.button===0){var layout=this.layout,index=ArrayExt.findFirstIndex(layout.handles,function(handle2){return handle2.contains(event.target)});if(index!==-1){event.preventDefault(),event.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 delta,handle=layout.handles[index],rect=handle.getBoundingClientRect();layout.orientation==="horizontal"?delta=event.clientX-rect.left:delta=event.clientY-rect.top;var style=window.getComputedStyle(handle),override=Drag.overrideCursor(style.cursor);this._pressData={index,delta,override}}}},SplitPanel2.prototype._evtMouseMove=function(event){event.preventDefault(),event.stopPropagation();var pos,layout=this.layout,rect=this.node.getBoundingClientRect();layout.orientation==="horizontal"?pos=event.clientX-rect.left-this._pressData.delta:pos=event.clientY-rect.top-this._pressData.delta,layout.moveHandle(this._pressData.index,pos)},SplitPanel2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse())},SplitPanel2.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))},SplitPanel2}(Panel);(function(SplitPanel2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.createHandle=function(){var handle=document.createElement("div");return handle.className="lm-SplitPanel-handle",handle.classList.add("p-SplitPanel-handle"),handle},Renderer2}();SplitPanel2.Renderer=Renderer,SplitPanel2.defaultRenderer=new Renderer;function getStretch(widget){return SplitLayout.getStretch(widget)}SplitPanel2.getStretch=getStretch;function setStretch(widget,value){SplitLayout.setStretch(widget,value)}SplitPanel2.setStretch=setStretch})(SplitPanel$1);var Private$e;(function(Private2){function createLayout(options){return options.layout||new SplitLayout({renderer:options.renderer||SplitPanel$1.defaultRenderer,orientation:options.orientation,alignment:options.alignment,spacing:options.spacing})}Private2.createLayout=createLayout})(Private$e||(Private$e={}));var AccordionPanel=function(_super){__extends(AccordionPanel2,_super);function AccordionPanel2(options){options===void 0&&(options={});var _this=_super.call(this,__assign(__assign({},options),{layout:Private$d.createLayout(options)}))||this;return _this._widgetSizesCache=new WeakMap,_this.addClass("lm-AccordionPanel"),_this}return Object.defineProperty(AccordionPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionPanel2.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(value){this.layout.titleSpace=value},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionPanel2.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),AccordionPanel2.prototype.addWidget=function(widget){_super.prototype.addWidget.call(this,widget),widget.title.changed.connect(this._onTitleChanged,this)},AccordionPanel2.prototype.collapse=function(index){var widget=this.layout.widgets[index];widget&&!widget.isHidden&&this._toggleExpansion(index)},AccordionPanel2.prototype.expand=function(index){var widget=this.layout.widgets[index];widget&&widget.isHidden&&this._toggleExpansion(index)},AccordionPanel2.prototype.insertWidget=function(index,widget){_super.prototype.insertWidget.call(this,index,widget),widget.title.changed.connect(this._onTitleChanged,this)},AccordionPanel2.prototype.handleEvent=function(event){switch(_super.prototype.handleEvent.call(this,event),event.type){case"click":this._evtClick(event);break;case"keydown":this._eventKeyDown(event);break}},AccordionPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),_super.prototype.onBeforeAttach.call(this,msg)},AccordionPanel2.prototype.onAfterDetach=function(msg){_super.prototype.onAfterDetach.call(this,msg),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},AccordionPanel2.prototype._onTitleChanged=function(sender){var index=ArrayExt.findFirstIndex(this.widgets,function(widget){return widget.contains(sender.owner)});index>=0&&(this.layout.updateTitle(index,sender.owner),this.update())},AccordionPanel2.prototype._computeWidgetSize=function(index){var layout=this.layout,widget=layout.widgets[index];if(widget){var isHidden=widget.isHidden,widgetSizes=layout.absoluteSizes(),delta=(isHidden?-1:1)*this.spacing,totalSize=widgetSizes.reduce(function(prev,curr){return prev+curr}),newSize=__spreadArrays(widgetSizes);if(isHidden){var previousSize_1=this._widgetSizesCache.get(widget);if(!previousSize_1)return;newSize[index]+=previousSize_1;var widgetToCollapse=newSize.map(function(sz){return sz-previousSize_1>0}).lastIndexOf(!0);widgetToCollapse===-1?newSize.forEach(function(_,idx){idx!==index&&(newSize[idx]-=widgetSizes[idx]/totalSize*(previousSize_1-delta))}):newSize[widgetToCollapse]-=previousSize_1-delta}else{var currentSize=widgetSizes[index];this._widgetSizesCache.set(widget,currentSize),newSize[index]=0;var widgetToCollapse=newSize.map(function(sz){return sz>0}).lastIndexOf(!0);if(widgetToCollapse===-1)return;newSize[widgetToCollapse]=widgetSizes[widgetToCollapse]+currentSize+delta}return newSize.map(function(sz){return sz/(totalSize+delta)})}},AccordionPanel2.prototype._evtClick=function(event){var target=event.target;if(target){var index=ArrayExt.findFirstIndex(this.titles,function(title){return title.contains(target)});index>=0&&(event.preventDefault(),event.stopPropagation(),this._toggleExpansion(index))}},AccordionPanel2.prototype._eventKeyDown=function(event){if(!event.defaultPrevented){var target=event.target,handled=!1;if(target){var index=ArrayExt.findFirstIndex(this.titles,function(title){return title.contains(target)});if(index>=0){var keyCode=event.keyCode.toString();if(event.key.match(/Space|Enter/)||keyCode.match(/13|32/))target.click(),handled=!0;else if(this.orientation==="horizontal"?event.key.match(/ArrowLeft|ArrowRight/)||keyCode.match(/37|39/):event.key.match(/ArrowUp|ArrowDown/)||keyCode.match(/38|40/)){var direction=event.key.match(/ArrowLeft|ArrowUp/)||keyCode.match(/37|38/)?-1:1,length_1=this.titles.length,newIndex=(index+length_1+direction)%length_1;this.titles[newIndex].focus(),handled=!0}else event.key==="End"||keyCode==="35"?(this.titles[this.titles.length-1].focus(),handled=!0):(event.key==="Home"||keyCode==="36")&&(this.titles[0].focus(),handled=!0)}handled&&event.preventDefault()}}},AccordionPanel2.prototype._toggleExpansion=function(index){var title=this.titles[index],widget=this.layout.widgets[index],newSize=this._computeWidgetSize(index);newSize&&this.setRelativeSizes(newSize,!1),widget.isHidden?(title.classList.add("lm-mod-expanded"),title.setAttribute("aria-expanded","true"),widget.show()):(title.classList.remove("lm-mod-expanded"),title.setAttribute("aria-expanded","false"),widget.hide())},AccordionPanel2}(SplitPanel$1);(function(AccordionPanel2){var Renderer=function(_super){__extends(Renderer2,_super);function Renderer2(){var _this=_super.call(this)||this;return _this.titleClassName="lm-AccordionPanel-title",_this._titleID=0,_this._titleKeys=new WeakMap,_this._uuid=++Renderer2._nInstance,_this}return Renderer2.prototype.createCollapseIcon=function(data){return document.createElement("span")},Renderer2.prototype.createSectionTitle=function(data){var handle=document.createElement("h3");handle.setAttribute("role","button"),handle.setAttribute("tabindex","0"),handle.id=this.createTitleKey(data),handle.className=this.titleClassName;for(var aData in data.dataset)handle.dataset[aData]=data.dataset[aData];var collapser=handle.appendChild(this.createCollapseIcon(data));collapser.className="lm-AccordionPanel-titleCollapser";var label=handle.appendChild(document.createElement("span"));return label.className="lm-AccordionPanel-titleLabel",label.textContent=data.label,label.title=data.caption||data.label,handle},Renderer2.prototype.createTitleKey=function(data){var key=this._titleKeys.get(data);return key===void 0&&(key="title-key-"+this._uuid+"-"+this._titleID++,this._titleKeys.set(data,key)),key},Renderer2._nInstance=0,Renderer2}(SplitPanel$1.Renderer);AccordionPanel2.Renderer=Renderer,AccordionPanel2.defaultRenderer=new Renderer})(AccordionPanel);var Private$d;(function(Private2){function createLayout(options){return options.layout||new AccordionLayout({renderer:options.renderer||AccordionPanel.defaultRenderer,orientation:options.orientation,alignment:options.alignment,spacing:options.spacing,titleSpace:options.titleSpace})}Private2.createLayout=createLayout})(Private$d||(Private$d={}));var BoxLayout=function(_super){__extends(BoxLayout2,_super);function BoxLayout2(options){options===void 0&&(options={});var _this=_super.call(this)||this;return _this._fixed=0,_this._spacing=4,_this._dirty=!1,_this._sizers=[],_this._items=[],_this._box=null,_this._alignment="start",_this._direction="top-to-bottom",options.direction!==void 0&&(_this._direction=options.direction),options.alignment!==void 0&&(_this._alignment=options.alignment),options.spacing!==void 0&&(_this._spacing=Utils$1.clampDimension(options.spacing)),_this}return BoxLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(BoxLayout2.prototype,"direction",{get:function(){return this._direction},set:function(value){this._direction!==value&&(this._direction=value,this.parent&&(this.parent.dataset.direction=value,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(BoxLayout2.prototype,"alignment",{get:function(){return this._alignment},set:function(value){this._alignment!==value&&(this._alignment=value,this.parent&&(this.parent.dataset.alignment=value,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(BoxLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils$1.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),BoxLayout2.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,_super.prototype.init.call(this)},BoxLayout2.prototype.attachWidget=function(index,widget){ArrayExt.insert(this._items,index,new LayoutItem(widget)),ArrayExt.insert(this._sizers,index,new BoxSizer),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},BoxLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),ArrayExt.move(this._sizers,fromIndex,toIndex),this.parent.update()},BoxLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index);ArrayExt.removeAt(this._sizers,index),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.dispose(),this.parent.fit()},BoxLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},BoxLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},BoxLayout2.prototype.onChildShown=function(msg){this.parent.fit()},BoxLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},BoxLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},BoxLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},BoxLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},BoxLayout2.prototype._fit=function(){for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,nVisible-1);for(var horz=Private$c.isHorizontal(this._direction),minW=horz?this._fixed:0,minH=horz?0:this._fixed,i=0,n=this._items.length;i<n;++i){var item=this._items[i],sizer=this._sizers[i];if(item.isHidden){sizer.minSize=0,sizer.maxSize=0;continue}item.fit(),sizer.sizeHint=BoxLayout2.getSizeBasis(item.widget),sizer.stretch=BoxLayout2.getStretch(item.widget),horz?(sizer.minSize=item.minWidth,sizer.maxSize=item.maxWidth,minW+=item.minWidth,minH=Math.max(minH,item.minHeight)):(sizer.minSize=item.minHeight,sizer.maxSize=item.maxHeight,minH+=item.minHeight,minW=Math.max(minW,item.minWidth))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},BoxLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(nVisible!==0){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,delta;switch(this._direction){case"left-to-right":delta=BoxEngine.calc(this._sizers,Math.max(0,width-this._fixed));break;case"top-to-bottom":delta=BoxEngine.calc(this._sizers,Math.max(0,height-this._fixed));break;case"right-to-left":delta=BoxEngine.calc(this._sizers,Math.max(0,width-this._fixed)),left+=width;break;case"bottom-to-top":delta=BoxEngine.calc(this._sizers,Math.max(0,height-this._fixed)),top+=height;break;default:throw"unreachable"}var extra=0,offset=0;if(delta>0)switch(this._alignment){case"start":break;case"center":extra=0,offset=delta/2;break;case"end":extra=0,offset=delta;break;case"justify":extra=delta/nVisible,offset=0;break;default:throw"unreachable"}for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i];if(!item.isHidden){var size=this._sizers[i].size;switch(this._direction){case"left-to-right":item.update(left+offset,top,size+extra,height),left+=size+extra+this._spacing;break;case"top-to-bottom":item.update(left,top+offset,width,size+extra),top+=size+extra+this._spacing;break;case"right-to-left":item.update(left-offset-size-extra,top,size+extra,height),left-=size+extra+this._spacing;break;case"bottom-to-top":item.update(left,top-offset-size-extra,width,size+extra),top-=size+extra+this._spacing;break;default:throw"unreachable"}}}}},BoxLayout2}(PanelLayout);(function(BoxLayout2){function getStretch(widget){return Private$c.stretchProperty.get(widget)}BoxLayout2.getStretch=getStretch;function setStretch(widget,value){Private$c.stretchProperty.set(widget,value)}BoxLayout2.setStretch=setStretch;function getSizeBasis(widget){return Private$c.sizeBasisProperty.get(widget)}BoxLayout2.getSizeBasis=getSizeBasis;function setSizeBasis(widget,value){Private$c.sizeBasisProperty.set(widget,value)}BoxLayout2.setSizeBasis=setSizeBasis})(BoxLayout);var Private$c;(function(Private2){Private2.stretchProperty=new AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged}),Private2.sizeBasisProperty=new AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged});function isHorizontal(dir){return dir==="left-to-right"||dir==="right-to-left"}Private2.isHorizontal=isHorizontal;function clampSpacing(value){return Math.max(0,Math.floor(value))}Private2.clampSpacing=clampSpacing;function onChildSizingChanged(child){child.parent&&child.parent.layout instanceof BoxLayout&&child.parent.fit()}})(Private$c||(Private$c={}));var BoxPanel=function(_super){__extends(BoxPanel2,_super);function BoxPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$b.createLayout(options)})||this;return _this.addClass("lm-BoxPanel"),_this.addClass("p-BoxPanel"),_this}return Object.defineProperty(BoxPanel2.prototype,"direction",{get:function(){return this.layout.direction},set:function(value){this.layout.direction=value},enumerable:!0,configurable:!0}),Object.defineProperty(BoxPanel2.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(value){this.layout.alignment=value},enumerable:!0,configurable:!0}),Object.defineProperty(BoxPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),BoxPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-BoxPanel-child"),msg.child.addClass("p-BoxPanel-child")},BoxPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-BoxPanel-child"),msg.child.removeClass("p-BoxPanel-child")},BoxPanel2}(Panel);(function(BoxPanel2){function getStretch(widget){return BoxLayout.getStretch(widget)}BoxPanel2.getStretch=getStretch;function setStretch(widget,value){BoxLayout.setStretch(widget,value)}BoxPanel2.setStretch=setStretch;function getSizeBasis(widget){return BoxLayout.getSizeBasis(widget)}BoxPanel2.getSizeBasis=getSizeBasis;function setSizeBasis(widget,value){BoxLayout.setSizeBasis(widget,value)}BoxPanel2.setSizeBasis=setSizeBasis})(BoxPanel);var Private$b;(function(Private2){function createLayout(options){return options.layout||new BoxLayout(options)}Private2.createLayout=createLayout})(Private$b||(Private$b={}));var CommandPalette=function(_super){__extends(CommandPalette2,_super);function CommandPalette2(options){var _this=_super.call(this,{node:Private$a.createNode()})||this;return _this._activeIndex=-1,_this._items=[],_this._results=null,_this.addClass("lm-CommandPalette"),_this.addClass("p-CommandPalette"),_this.setFlag(Widget.Flag.DisallowLayout),_this.commands=options.commands,_this.renderer=options.renderer||CommandPalette2.defaultRenderer,_this.commands.commandChanged.connect(_this._onGenericChange,_this),_this.commands.keyBindingChanged.connect(_this._onGenericChange,_this),_this}return CommandPalette2.prototype.dispose=function(){this._items.length=0,this._results=null,_super.prototype.dispose.call(this)},Object.defineProperty(CommandPalette2.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette2.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette2.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),CommandPalette2.prototype.addItem=function(options){var item=Private$a.createItem(this.commands,options);return this._items.push(item),this.refresh(),item},CommandPalette2.prototype.addItems=function(items){var _this=this,newItems=items.map(function(item){return Private$a.createItem(_this.commands,item)});return newItems.forEach(function(item){return _this._items.push(item)}),this.refresh(),newItems},CommandPalette2.prototype.removeItem=function(item){this.removeItemAt(this._items.indexOf(item))},CommandPalette2.prototype.removeItemAt=function(index){var item=ArrayExt.removeAt(this._items,index);item&&this.refresh()},CommandPalette2.prototype.clearItems=function(){this._items.length!==0&&(this._items.length=0,this.refresh())},CommandPalette2.prototype.refresh=function(){if(this._results=null,this.inputNode.value!==""){var clear=this.node.getElementsByClassName("lm-close-icon")[0];clear.style.display="inherit"}else{var clear=this.node.getElementsByClassName("lm-close-icon")[0];clear.style.display="none"}this.update()},CommandPalette2.prototype.handleEvent=function(event){switch(event.type){case"click":this._evtClick(event);break;case"keydown":this._evtKeyDown(event);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}},CommandPalette2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},CommandPalette2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},CommandPalette2.prototype.onActivateRequest=function(msg){if(this.isAttached){var input=this.inputNode;input.focus(),input.select()}},CommandPalette2.prototype.onUpdateRequest=function(msg){var query=this.inputNode.value,contentNode=this.contentNode,results=this._results;if(results||(results=this._results=Private$a.search(this._items,query),this._activeIndex=query?ArrayExt.findFirstIndex(results,Private$a.canActivate):-1),!query&&results.length===0){VirtualDOM.render(null,contentNode);return}if(query&&results.length===0){var content_1=this.renderer.renderEmptyMessage({query});VirtualDOM.render(content_1,contentNode);return}for(var renderer=this.renderer,activeIndex=this._activeIndex,content=new Array(results.length),i=0,n=results.length;i<n;++i){var result=results[i];if(result.type==="header"){var indices=result.indices,category=result.category;content[i]=renderer.renderHeader({category,indices})}else{var item=result.item,indices=result.indices,active=i===activeIndex;content[i]=renderer.renderItem({item,indices,active})}}if(VirtualDOM.render(content,contentNode),activeIndex<0||activeIndex>=results.length)contentNode.scrollTop=0;else{var element=contentNode.children[activeIndex];ElementExt.scrollIntoViewIfNeeded(contentNode,element)}},CommandPalette2.prototype._evtClick=function(event){if(event.button===0){if(event.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return node.contains(event.target)});index!==-1&&(event.preventDefault(),event.stopPropagation(),this._execute(index))}},CommandPalette2.prototype._evtKeyDown=function(event){if(!(event.altKey||event.ctrlKey||event.metaKey||event.shiftKey))switch(event.keyCode){case 13:event.preventDefault(),event.stopPropagation(),this._execute(this._activeIndex);break;case 38:event.preventDefault(),event.stopPropagation(),this._activatePreviousItem();break;case 40:event.preventDefault(),event.stopPropagation(),this._activateNextItem();break}},CommandPalette2.prototype._activateNextItem=function(){if(!(!this._results||this._results.length===0)){var ai=this._activeIndex,n=this._results.length,start=ai<n-1?ai+1:0,stop=start===0?n-1:start-1;this._activeIndex=ArrayExt.findFirstIndex(this._results,Private$a.canActivate,start,stop),this.update()}},CommandPalette2.prototype._activatePreviousItem=function(){if(!(!this._results||this._results.length===0)){var ai=this._activeIndex,n=this._results.length,start=ai<=0?n-1:ai-1,stop=start===n-1?0:start+1;this._activeIndex=ArrayExt.findLastIndex(this._results,Private$a.canActivate,start,stop),this.update()}},CommandPalette2.prototype._execute=function(index){if(this._results){var part=this._results[index];if(part){if(part.type==="header"){var input=this.inputNode;input.value=part.category.toLowerCase()+" ",input.focus(),this.refresh();return}part.item.isEnabled&&(this.commands.execute(part.item.command,part.item.args),this.inputNode.value="",this.refresh())}}},CommandPalette2.prototype._toggleFocused=function(){var focused=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",focused),this.toggleClass("p-mod-focused",focused)},CommandPalette2.prototype._onGenericChange=function(){this.refresh()},CommandPalette2}(Widget);(function(CommandPalette2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderHeader=function(data){var content=this.formatHeader(data);return h.li({className:"lm-CommandPalette-header p-CommandPalette-header"},content)},Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data);return data.item.isToggleable?h.li({className,dataset,role:"checkbox","aria-checked":""+data.item.isToggled},this.renderItemIcon(data),this.renderItemContent(data),this.renderItemShortcut(data)):h.li({className,dataset},this.renderItemIcon(data),this.renderItemContent(data),this.renderItemShortcut(data))},Renderer2.prototype.renderEmptyMessage=function(data){var content=this.formatEmptyMessage(data);return h.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},content)},Renderer2.prototype.renderItemIcon=function(data){var className=this.createIconClass(data);return typeof data.item.icon=="string"?h.div({className},data.item.iconLabel):h.div({className},data.item.icon,data.item.iconLabel)},Renderer2.prototype.renderItemContent=function(data){return h.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(data),this.renderItemCaption(data))},Renderer2.prototype.renderItemLabel=function(data){var content=this.formatItemLabel(data);return h.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},content)},Renderer2.prototype.renderItemCaption=function(data){var content=this.formatItemCaption(data);return h.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},content)},Renderer2.prototype.renderItemShortcut=function(data){var content=this.formatItemShortcut(data);return h.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},content)},Renderer2.prototype.createItemClass=function(data){var name2="lm-CommandPalette-item";name2+=" p-CommandPalette-item",data.item.isEnabled||(name2+=" lm-mod-disabled",name2+=" p-mod-disabled"),data.item.isToggled&&(name2+=" lm-mod-toggled",name2+=" p-mod-toggled"),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active");var extra=data.item.className;return extra&&(name2+=" "+extra),name2},Renderer2.prototype.createItemDataset=function(data){return __assign(__assign({},data.item.dataset),{command:data.item.command})},Renderer2.prototype.createIconClass=function(data){var name2="lm-CommandPalette-itemIcon";name2+=" p-CommandPalette-itemIcon";var extra=data.item.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.formatHeader=function(data){return!data.indices||data.indices.length===0?data.category:StringExt.highlight(data.category,data.indices,h.mark)},Renderer2.prototype.formatEmptyMessage=function(data){return"No commands found that match '"+data.query+"'"},Renderer2.prototype.formatItemShortcut=function(data){var kb=data.item.keyBinding;return kb?CommandRegistry.formatKeystroke(kb.keys):null},Renderer2.prototype.formatItemLabel=function(data){return!data.indices||data.indices.length===0?data.item.label:StringExt.highlight(data.item.label,data.indices,h.mark)},Renderer2.prototype.formatItemCaption=function(data){return data.item.caption},Renderer2}();CommandPalette2.Renderer=Renderer,CommandPalette2.defaultRenderer=new Renderer})(CommandPalette);var Private$a;(function(Private2){function createNode(){var node=document.createElement("div"),search2=document.createElement("div"),wrapper=document.createElement("div"),input=document.createElement("input"),content=document.createElement("ul"),clear=document.createElement("button");return search2.className="lm-CommandPalette-search",wrapper.className="lm-CommandPalette-wrapper",input.className="lm-CommandPalette-input",clear.className="lm-close-icon",content.className="lm-CommandPalette-content",search2.classList.add("p-CommandPalette-search"),wrapper.classList.add("p-CommandPalette-wrapper"),input.classList.add("p-CommandPalette-input"),content.classList.add("p-CommandPalette-content"),input.spellcheck=!1,wrapper.appendChild(input),wrapper.appendChild(clear),search2.appendChild(wrapper),node.appendChild(search2),node.appendChild(content),node}Private2.createNode=createNode;function createItem(commands,options){return new CommandItem(commands,options)}Private2.createItem=createItem;function search(items,query){var scores=matchItems(items,query);return scores.sort(scoreCmp),createResults(scores)}Private2.search=search;function canActivate(result){return result.type==="item"&&result.item.isEnabled}Private2.canActivate=canActivate;function normalizeCategory(category){return category.trim().replace(/\s+/g," ")}function normalizeQuery(text){return text.replace(/\s+/g,"").toLowerCase()}function matchItems(items,query){query=normalizeQuery(query);for(var scores=[],i=0,n=items.length;i<n;++i){var item=items[i];if(item.isVisible){if(!query){scores.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item});continue}var score=fuzzySearch(item,query);score&&(item.isEnabled||(score.score+=1e3),scores.push(score))}}return scores}function fuzzySearch(item,query){for(var category=item.category.toLowerCase(),label=item.label.toLowerCase(),source=category+" "+label,score=1/0,indices=null,rgx=/\b\w/g;;){var rgxMatch=rgx.exec(source);if(!rgxMatch)break;var match=StringExt.matchSumOfDeltas(source,query,rgxMatch.index);if(!match)break;match&&match.score<=score&&(score=match.score,indices=match.indices)}if(!indices||score===1/0)return null;for(var pivot=category.length+1,j=ArrayExt.lowerBound(indices,pivot,function(a,b){return a-b}),categoryIndices=indices.slice(0,j),labelIndices=indices.slice(j),i=0,n=labelIndices.length;i<n;++i)labelIndices[i]-=pivot;return categoryIndices.length===0?{matchType:0,categoryIndices:null,labelIndices,score,item}:labelIndices.length===0?{matchType:1,categoryIndices,labelIndices:null,score,item}:{matchType:2,categoryIndices,labelIndices,score,item}}function scoreCmp(a,b){var m1=a.matchType-b.matchType;if(m1!==0)return m1;var d1=a.score-b.score;if(d1!==0)return d1;var i1=0,i2=0;switch(a.matchType){case 0:i1=a.labelIndices[0],i2=b.labelIndices[0];break;case 1:case 2:i1=a.categoryIndices[0],i2=b.categoryIndices[0];break}if(i1!==i2)return i1-i2;var d2=a.item.category.localeCompare(b.item.category);if(d2!==0)return d2;var r1=a.item.rank,r2=b.item.rank;return r1!==r2?r1<r2?-1:1:a.item.label.localeCompare(b.item.label)}function createResults(scores){var visited=new Array(scores.length);ArrayExt.fill(visited,!1);for(var results=[],i=0,n=scores.length;i<n;++i)if(!visited[i]){var _a=scores[i],item=_a.item,categoryIndices=_a.categoryIndices,category=item.category;results.push({type:"header",category,indices:categoryIndices});for(var j=i;j<n;++j)if(!visited[j]){var _b=scores[j],item_1=_b.item,labelIndices=_b.labelIndices;item_1.category===category&&(results.push({type:"item",item:item_1,indices:labelIndices}),visited[j]=!0)}}return results}var CommandItem=function(){function CommandItem2(commands,options){this._commands=commands,this.category=normalizeCategory(options.category),this.command=options.command,this.args=options.args||JSONExt.emptyObject,this.rank=options.rank!==void 0?options.rank:1/0}return Object.defineProperty(CommandItem2.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"keyBinding",{get:function(){var _a=this,command=_a.command,args=_a.args;return ArrayExt.findLastValue(this._commands.keyBindings,function(kb){return kb.command===command&&JSONExt.deepEqual(kb.args,args)})||null},enumerable:!0,configurable:!0}),CommandItem2}()})(Private$a||(Private$a={}));var Menu=function(_super){__extends(Menu2,_super);function Menu2(options){var _this=_super.call(this,{node:Private$9.createNode()})||this;return _this._childIndex=-1,_this._activeIndex=-1,_this._openTimerID=0,_this._closeTimerID=0,_this._items=[],_this._childMenu=null,_this._parentMenu=null,_this._aboutToClose=new Signal(_this),_this._menuRequested=new Signal(_this),_this.addClass("lm-Menu"),_this.addClass("p-Menu"),_this.setFlag(Widget.Flag.DisallowLayout),_this.commands=options.commands,_this.renderer=options.renderer||Menu2.defaultRenderer,_this}return Menu2.prototype.dispose=function(){this.close(),this._items.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(Menu2.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"rootMenu",{get:function(){for(var menu=this;menu._parentMenu;)menu=menu._parentMenu;return menu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"leafMenu",{get:function(){for(var menu=this;menu._childMenu;)menu=menu._childMenu;return menu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(value){this.activeIndex=value?this._items.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(value){(value<0||value>=this._items.length)&&(value=-1),value!==-1&&!Private$9.canActivate(this._items[value])&&(value=-1),this._activeIndex!==value&&(this._activeIndex=value,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Menu2.prototype.activateNextItem=function(){var n=this._items.length,ai=this._activeIndex,start=ai<n-1?ai+1:0,stop=start===0?n-1:start-1;this.activeIndex=ArrayExt.findFirstIndex(this._items,Private$9.canActivate,start,stop)},Menu2.prototype.activatePreviousItem=function(){var n=this._items.length,ai=this._activeIndex,start=ai<=0?n-1:ai-1,stop=start===n-1?0:start+1;this.activeIndex=ArrayExt.findLastIndex(this._items,Private$9.canActivate,start,stop)},Menu2.prototype.triggerActiveItem=function(){if(this.isAttached){var item=this.activeItem;if(item){if(this._cancelOpenTimer(),this._cancelCloseTimer(),item.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();var command=item.command,args=item.args;this.commands.isEnabled(command,args)?this.commands.execute(command,args):console.log("Command '"+command+"' is disabled.")}}},Menu2.prototype.addItem=function(options){return this.insertItem(this._items.length,options)},Menu2.prototype.insertItem=function(index,options){this.isAttached&&this.close(),this.activeIndex=-1;var i=Math.max(0,Math.min(index,this._items.length)),item=Private$9.createItem(this,options);return ArrayExt.insert(this._items,i,item),this.update(),item},Menu2.prototype.removeItem=function(item){this.removeItemAt(this._items.indexOf(item))},Menu2.prototype.removeItemAt=function(index){this.isAttached&&this.close(),this.activeIndex=-1;var item=ArrayExt.removeAt(this._items,index);item&&this.update()},Menu2.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())},Menu2.prototype.open=function(x,y,options){if(options===void 0&&(options={}),!this.isAttached){var forceX=options.forceX||!1,forceY=options.forceY||!1;Private$9.openRootMenu(this,x,y,forceX,forceY),this.activate()}},Menu2.prototype.handleEvent=function(event){switch(event.type){case"keydown":this._evtKeyDown(event);break;case"mouseup":this._evtMouseUp(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseenter":this._evtMouseEnter(event);break;case"mouseleave":this._evtMouseLeave(event);break;case"mousedown":this._evtMouseDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},Menu2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},Menu2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},Menu2.prototype.onActivateRequest=function(msg){this.isAttached&&this.node.focus()},Menu2.prototype.onUpdateRequest=function(msg){for(var _this=this,items=this._items,renderer=this.renderer,activeIndex=this._activeIndex,collapsedFlags=Private$9.computeCollapsed(items),content=new Array(items.length),_loop_1=function(i2,n2){var item=items[i2],active=i2===activeIndex,collapsed=collapsedFlags[i2];content[i2]=renderer.renderItem({item,active,collapsed,onfocus:function(){_this.activeIndex=i2}})},i=0,n=items.length;i<n;++i)_loop_1(i);VirtualDOM.render(content,this.contentNode)},Menu2.prototype.onCloseRequest=function(msg){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var childMenu=this._childMenu;childMenu&&(this._childIndex=-1,this._childMenu=null,childMenu._parentMenu=null,childMenu.close());var parentMenu=this._parentMenu;parentMenu&&(this._parentMenu=null,parentMenu._childIndex=-1,parentMenu._childMenu=null,parentMenu.activate()),this.isAttached&&this._aboutToClose.emit(void 0),_super.prototype.onCloseRequest.call(this,msg)},Menu2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation();var kc=event.keyCode;if(kc===13){this.triggerActiveItem();return}if(kc===27){this.close();return}if(kc===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(kc===38){this.activatePreviousItem();return}if(kc===39){var item=this.activeItem;item&&item.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(kc===40){this.activateNextItem();return}var key=getKeyboardLayout().keyForKeydownEvent(event);if(key){var start=this._activeIndex+1,result=Private$9.findMnemonic(this._items,key,start);result.index!==-1&&!result.multiple?(this.activeIndex=result.index,this.triggerActiveItem()):result.index!==-1?this.activeIndex=result.index:result.auto!==-1&&(this.activeIndex=result.auto)}},Menu2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this.triggerActiveItem())},Menu2.prototype._evtMouseMove=function(event){var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index!==this._activeIndex){if(this.activeIndex=index,index=this.activeIndex,index===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();var item=this.activeItem;!item||item.type!=="submenu"||!item.submenu||this._startOpenTimer()}},Menu2.prototype._evtMouseEnter=function(event){for(var menu=this._parentMenu;menu;menu=menu._parentMenu)menu._cancelOpenTimer(),menu._cancelCloseTimer(),menu.activeIndex=menu._childIndex},Menu2.prototype._evtMouseLeave=function(event){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var clientX=event.clientX,clientY=event.clientY;if(ElementExt.hitTest(this._childMenu.node,clientX,clientY)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()},Menu2.prototype._evtMouseDown=function(event){this._parentMenu||(Private$9.hitTestMenus(this,event.clientX,event.clientY)?(event.preventDefault(),event.stopPropagation()):this.close())},Menu2.prototype._openChildMenu=function(activateFirst){activateFirst===void 0&&(activateFirst=!1);var item=this.activeItem;if(!item||item.type!=="submenu"||!item.submenu){this._closeChildMenu();return}var submenu=item.submenu;if(submenu!==this._childMenu){Menu2.saveWindowData(),this._closeChildMenu(),this._childMenu=submenu,this._childIndex=this._activeIndex,submenu._parentMenu=this,MessageLoop.sendMessage(this,Widget.Msg.UpdateRequest);var itemNode=this.contentNode.children[this._activeIndex];Private$9.openSubmenu(submenu,itemNode),activateFirst&&(submenu.activeIndex=-1,submenu.activateNextItem()),submenu.activate()}},Menu2.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},Menu2.prototype._startOpenTimer=function(){var _this=this;this._openTimerID===0&&(this._openTimerID=window.setTimeout(function(){_this._openTimerID=0,_this._openChildMenu()},Private$9.TIMER_DELAY))},Menu2.prototype._startCloseTimer=function(){var _this=this;this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(function(){_this._closeTimerID=0,_this._closeChildMenu()},Private$9.TIMER_DELAY))},Menu2.prototype._cancelOpenTimer=function(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)},Menu2.prototype._cancelCloseTimer=function(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},Menu2.saveWindowData=function(){Private$9.saveWindowData()},Menu2}(Widget);(function(Menu2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data),aria=this.createItemARIA(data);return h.li(__assign({className,dataset,tabindex:"0",onfocus:data.onfocus},aria),this.renderIcon(data),this.renderLabel(data),this.renderShortcut(data),this.renderSubmenu(data))},Renderer2.prototype.renderIcon=function(data){var className=this.createIconClass(data);return typeof data.item.icon=="string"?h.div({className},data.item.iconLabel):h.div({className},data.item.icon,data.item.iconLabel)},Renderer2.prototype.renderLabel=function(data){var content=this.formatLabel(data);return h.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},content)},Renderer2.prototype.renderShortcut=function(data){var content=this.formatShortcut(data);return h.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},content)},Renderer2.prototype.renderSubmenu=function(data){return h.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},Renderer2.prototype.createItemClass=function(data){var name2="lm-Menu-item";name2+=" p-Menu-item",data.item.isEnabled||(name2+=" lm-mod-disabled",name2+=" p-mod-disabled"),data.item.isToggled&&(name2+=" lm-mod-toggled",name2+=" p-mod-toggled"),data.item.isVisible||(name2+=" lm-mod-hidden",name2+=" p-mod-hidden"),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active"),data.collapsed&&(name2+=" lm-mod-collapsed",name2+=" p-mod-collapsed");var extra=data.item.className;return extra&&(name2+=" "+extra),name2},Renderer2.prototype.createItemDataset=function(data){var result,_a=data.item,type=_a.type,command=_a.command,dataset=_a.dataset;return type==="command"?result=__assign(__assign({},dataset),{type,command}):result=__assign(__assign({},dataset),{type}),result},Renderer2.prototype.createIconClass=function(data){var name2="lm-Menu-itemIcon";name2+=" p-Menu-itemIcon";var extra=data.item.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.createItemARIA=function(data){var aria={};switch(data.item.type){case"separator":aria.role="presentation";break;case"submenu":aria["aria-haspopup"]="true",data.item.isEnabled||(aria["aria-disabled"]="true");break;default:data.item.isEnabled||(aria["aria-disabled"]="true"),aria.role="menuitem"}return aria},Renderer2.prototype.formatLabel=function(data){var _a=data.item,label=_a.label,mnemonic=_a.mnemonic;if(mnemonic<0||mnemonic>=label.length)return label;var prefix=label.slice(0,mnemonic),suffix=label.slice(mnemonic+1),char=label[mnemonic],span=h.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},char);return[prefix,span,suffix]},Renderer2.prototype.formatShortcut=function(data){var kb=data.item.keyBinding;return kb?CommandRegistry.formatKeystroke(kb.keys):null},Renderer2}();Menu2.Renderer=Renderer,Menu2.defaultRenderer=new Renderer})(Menu);var Private$9;(function(Private2){Private2.TIMER_DELAY=300,Private2.SUBMENU_OVERLAP=3;var transientWindowDataCache=null,transientCacheCounter=0;function getWindowData(){return transientCacheCounter>0?(transientCacheCounter--,transientWindowDataCache):_getWindowData()}function saveWindowData(){transientWindowDataCache=_getWindowData(),transientCacheCounter++}Private2.saveWindowData=saveWindowData;function createNode(){var node=document.createElement("div"),content=document.createElement("ul");return content.className="lm-Menu-content",content.classList.add("p-Menu-content"),node.appendChild(content),content.setAttribute("role","menu"),node.tabIndex=0,node}Private2.createNode=createNode;function canActivate(item){return item.type!=="separator"&&item.isEnabled&&item.isVisible}Private2.canActivate=canActivate;function createItem(owner,options){return new MenuItem(owner.commands,options)}Private2.createItem=createItem;function hitTestMenus(menu,x,y){for(var temp=menu;temp;temp=temp.childMenu)if(ElementExt.hitTest(temp.node,x,y))return!0;return!1}Private2.hitTestMenus=hitTestMenus;function computeCollapsed(items){var result=new Array(items.length);ArrayExt.fill(result,!1);for(var k1=0,n=items.length;k1<n;++k1){var item=items[k1];if(item.isVisible){if(item.type!=="separator")break;result[k1]=!0}}for(var k2=n-1;k2>=0;--k2){var item=items[k2];if(item.isVisible){if(item.type!=="separator")break;result[k2]=!0}}for(var hide=!1;++k1<k2;){var item=items[k1];item.isVisible&&(item.type!=="separator"?hide=!1:hide?result[k1]=!0:hide=!0)}return result}Private2.computeCollapsed=computeCollapsed;function _getWindowData(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function openRootMenu(menu,x,y,forceX,forceY){var windowData=getWindowData(),px=windowData.pageXOffset,py=windowData.pageYOffset,cw=windowData.clientWidth,ch=windowData.clientHeight;MessageLoop.sendMessage(menu,Widget.Msg.UpdateRequest);var maxHeight=ch-(forceY?y:0),node=menu.node,style=node.style;style.opacity="0",style.maxHeight=maxHeight+"px",Widget.attach(menu,document.body);var _a=node.getBoundingClientRect(),width=_a.width,height=_a.height;!forceX&&x+width>px+cw&&(x=px+cw-width),!forceY&&y+height>py+ch&&(y>py+ch?y=py+ch-height:y=y-height),style.transform="translate("+Math.max(0,x)+"px, "+Math.max(0,y)+"px",style.opacity="1"}Private2.openRootMenu=openRootMenu;function openSubmenu(submenu,itemNode){var windowData=getWindowData(),px=windowData.pageXOffset,py=windowData.pageYOffset,cw=windowData.clientWidth,ch=windowData.clientHeight;MessageLoop.sendMessage(submenu,Widget.Msg.UpdateRequest);var maxHeight=ch,node=submenu.node,style=node.style;style.opacity="0",style.maxHeight=maxHeight+"px",Widget.attach(submenu,document.body);var _a=node.getBoundingClientRect(),width=_a.width,height=_a.height,box=ElementExt.boxSizing(submenu.node),itemRect=itemNode.getBoundingClientRect(),x=itemRect.right-Private2.SUBMENU_OVERLAP;x+width>px+cw&&(x=itemRect.left+Private2.SUBMENU_OVERLAP-width);var y=itemRect.top-box.borderTop-box.paddingTop;y+height>py+ch&&(y=itemRect.bottom+box.borderBottom+box.paddingBottom-height),style.transform="translate("+Math.max(0,x)+"px, "+Math.max(0,y)+"px",style.opacity="1"}Private2.openSubmenu=openSubmenu;function findMnemonic(items,key,start){for(var index=-1,auto=-1,multiple=!1,upperKey=key.toUpperCase(),i=0,n=items.length;i<n;++i){var k=(i+start)%n,item=items[k];if(canActivate(item)){var label=item.label;if(label.length!==0){var mn=item.mnemonic;if(mn>=0&&mn<label.length){label[mn].toUpperCase()===upperKey&&(index===-1?index=k:multiple=!0);continue}auto===-1&&label[0].toUpperCase()===upperKey&&(auto=k)}}}return{index,multiple,auto}}Private2.findMnemonic=findMnemonic;var MenuItem=function(){function MenuItem2(commands,options){this._commands=commands,this.type=options.type||"command",this.command=options.command||"",this.args=options.args||JSONExt.emptyObject,this.submenu=options.submenu||null}return Object.defineProperty(MenuItem2.prototype,"label",{get:function(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"mnemonic",{get:function(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"icon",{get:function(){return this.type==="command"?this._commands.icon(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.icon:this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"iconClass",{get:function(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"iconLabel",{get:function(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"caption",{get:function(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"className",{get:function(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"dataset",{get:function(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isEnabled",{get:function(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isToggled",{get:function(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isVisible",{get:function(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"keyBinding",{get:function(){if(this.type==="command"){var _a=this,command_1=_a.command,args_1=_a.args;return ArrayExt.findLastValue(this._commands.keyBindings,function(kb){return kb.command===command_1&&JSONExt.deepEqual(kb.args,args_1)})||null}return null},enumerable:!0,configurable:!0}),MenuItem2}()})(Private$9||(Private$9={}));var ContextMenu=function(){function ContextMenu2(options){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var groupByTarget=options.groupByTarget,sortBySelector=options.sortBySelector,others=__rest(options,["groupByTarget","sortBySelector"]);this.menu=new Menu(others),this._groupByTarget=groupByTarget!==!1,this._sortBySelector=sortBySelector!==!1}return ContextMenu2.prototype.addItem=function(options){var _this=this,item=Private$8.createItem(options,this._idTick++);return this._items.push(item),new DisposableDelegate(function(){ArrayExt.removeFirstOf(_this._items,item)})},ContextMenu2.prototype.open=function(event){var _this=this;if(Menu.saveWindowData(),this.menu.clearItems(),this._items.length===0)return!1;var items=Private$8.matchItems(this._items,event,this._groupByTarget,this._sortBySelector);return!items||items.length===0?!1:(each(items,function(item){_this.menu.addItem(item)}),this.menu.open(event.clientX,event.clientY),!0)},ContextMenu2}(),Private$8;(function(Private2){function createItem(options,id){var selector=validateSelector(options.selector),rank=options.rank!==void 0?options.rank:1/0;return __assign(__assign({},options),{selector,rank,id})}Private2.createItem=createItem;function matchItems(items,event,groupByTarget,sortBySelector){var target=event.target;if(!target)return null;var currentTarget=event.currentTarget;if(!currentTarget||!currentTarget.contains(target)&&(target=document.elementFromPoint(event.clientX,event.clientY),!target||!currentTarget.contains(target)))return null;for(var result=[],availableItems=items.slice();target!==null;){for(var matches=[],i=0,n=availableItems.length;i<n;++i){var item=availableItems[i];item&&Selector.matches(target,item.selector)&&(matches.push(item),availableItems[i]=null)}if(matches.length!==0&&(groupByTarget&&matches.sort(sortBySelector?itemCmp:itemCmpRank),result.push.apply(result,matches)),target===currentTarget)break;target=target.parentElement}return groupByTarget||result.sort(sortBySelector?itemCmp:itemCmpRank),result}Private2.matchItems=matchItems;function validateSelector(selector){if(selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+selector);if(!Selector.isValid(selector))throw new Error("Invalid selector: "+selector);return selector}function itemCmpRank(a,b){var r1=a.rank,r2=b.rank;return r1!==r2?r1<r2?-1:1:a.id-b.id}function itemCmp(a,b){var s1=Selector.calculateSpecificity(a.selector),s2=Selector.calculateSpecificity(b.selector);return s1!==s2?s2-s1:itemCmpRank(a,b)}})(Private$8||(Private$8={}));var TabBar=function(_super){__extends(TabBar2,_super);function TabBar2(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$7.createNode()})||this;return _this._currentIndex=-1,_this._titles=[],_this._titlesEditable=!1,_this._previousTitle=null,_this._dragData=null,_this._addButtonEnabled=!1,_this._tabMoved=new Signal(_this),_this._currentChanged=new Signal(_this),_this._addRequested=new Signal(_this),_this._tabCloseRequested=new Signal(_this),_this._tabDetachRequested=new Signal(_this),_this._tabActivateRequested=new Signal(_this),_this.addClass("lm-TabBar"),_this.addClass("p-TabBar"),_this.contentNode.setAttribute("role","tablist"),_this.setFlag(Widget.Flag.DisallowLayout),_this._document=options.document||document,_this.tabsMovable=options.tabsMovable||!1,_this.titlesEditable=options.titlesEditable||!1,_this.allowDeselect=options.allowDeselect||!1,_this.addButtonEnabled=options.addButtonEnabled||!1,_this.insertBehavior=options.insertBehavior||"select-tab-if-needed",_this.name=options.name||"",_this.orientation=options.orientation||"horizontal",_this.removeBehavior=options.removeBehavior||"select-tab-after",_this.renderer=options.renderer||TabBar2.defaultRenderer,_this}return TabBar2.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,_super.prototype.dispose.call(this)},Object.defineProperty(TabBar2.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(value){this._titlesEditable=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(value){this.currentIndex=value?this._titles.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(value){if((value<0||value>=this._titles.length)&&(value=-1),this._currentIndex!==value){var pi=this._currentIndex,pt=this._titles[pi]||null,ci=value,ct=this._titles[ci]||null;this._currentIndex=ci,this._previousTitle=pt,this.update(),this._currentChanged.emit({previousIndex:pi,previousTitle:pt,currentIndex:ci,currentTitle:ct})}},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"name",{get:function(){return this._name},set:function(value){this._name=value,value?this.contentNode.setAttribute("aria-label",value):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._releaseMouse(),this._orientation=value,this.dataset.orientation=value,this.contentNode.setAttribute("aria-orientation",value))},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(value){this._addButtonEnabled!==value&&(this._addButtonEnabled=value,value?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),TabBar2.prototype.addTab=function(value){return this.insertTab(this._titles.length,value)},TabBar2.prototype.insertTab=function(index,value){this._releaseMouse();var title=Private$7.asTitle(value),i=this._titles.indexOf(title),j=Math.max(0,Math.min(index,this._titles.length));return i===-1?(ArrayExt.insert(this._titles,j,title),title.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(j,title),title):(j===this._titles.length&&j--,i===j||(ArrayExt.move(this._titles,i,j),this.update(),this._adjustCurrentForMove(i,j)),title)},TabBar2.prototype.removeTab=function(title){this.removeTabAt(this._titles.indexOf(title))},TabBar2.prototype.removeTabAt=function(index){this._releaseMouse();var title=ArrayExt.removeAt(this._titles,index);title&&(title.changed.disconnect(this._onTitleChanged,this),title===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(index,title))},TabBar2.prototype.clearTabs=function(){if(this._titles.length!==0){this._releaseMouse();for(var _i=0,_a=this._titles;_i<_a.length;_i++){var title=_a[_i];title.changed.disconnect(this._onTitleChanged,this)}var pi=this.currentIndex,pt=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),pi!==-1&&this._currentChanged.emit({previousIndex:pi,previousTitle:pt,currentIndex:-1,currentTitle:null})}},TabBar2.prototype.releaseMouse=function(){this._releaseMouse()},TabBar2.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"dblclick":this._evtDblClick(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},TabBar2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},TabBar2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},TabBar2.prototype.onUpdateRequest=function(msg){for(var titles=this._titles,renderer=this.renderer,currentTitle=this.currentTitle,content=new Array(titles.length),i=0,n=titles.length;i<n;++i){var title=titles[i],current=title===currentTitle,zIndex=current?n:n-i-1;content[i]=renderer.renderTab({title,current,zIndex})}VirtualDOM.render(content,this.contentNode)},TabBar2.prototype._evtDblClick=function(event){if(this.titlesEditable){var tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(index!==-1){var title=this.titles[index],label=tabs[index].querySelector(".lm-TabBar-tabLabel");if(label&&label.contains(event.target)){var value=title.label||"",oldValue_1=label.innerHTML;label.innerHTML="";var input_1=document.createElement("input");input_1.classList.add("lm-TabBar-tabInput"),input_1.value=value,label.appendChild(input_1);var onblur_1=function(){input_1.removeEventListener("blur",onblur_1),label.innerHTML=oldValue_1};input_1.addEventListener("dblclick",function(event2){return event2.stopPropagation()}),input_1.addEventListener("blur",onblur_1),input_1.addEventListener("keydown",function(event2){event2.key==="Enter"?(input_1.value!==""&&(title.label=title.caption=input_1.value),onblur_1()):event2.key==="Escape"&&onblur_1()}),input_1.select(),input_1.focus(),label.children.length>0&&label.children[0].focus()}}}},TabBar2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&this._releaseMouse()},TabBar2.prototype._evtMouseDown=function(event){if(!(event.button!==0&&event.button!==1)&&!this._dragData){var addButtonClicked=this.addButtonEnabled&&this.addButtonNode.contains(event.target),tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(!(index===-1&&!addButtonClicked)&&(event.preventDefault(),event.stopPropagation(),this._dragData={tab:tabs[index],index,pressX:event.clientX,pressY:event.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("mouseup",this,!0),this.document.addEventListener("pointerup",this,!0),!(event.button===1||addButtonClicked))){var icon=tabs[index].querySelector(this.renderer.closeIconSelector);icon&&icon.contains(event.target)||(this.tabsMovable&&(this.document.addEventListener("mousemove",this,!0),this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===index?this.currentIndex=-1:this.currentIndex=index,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},TabBar2.prototype._evtMouseMove=function(event){var data=this._dragData;if(data){event.preventDefault(),event.stopPropagation();var tabs=this.contentNode.children;if(!(!data.dragActive&&!Private$7.dragExceeded(data,event))){if(!data.dragActive){var tabRect=data.tab.getBoundingClientRect();this._orientation==="horizontal"?(data.tabPos=data.tab.offsetLeft,data.tabSize=tabRect.width,data.tabPressPos=data.pressX-tabRect.left):(data.tabPos=data.tab.offsetTop,data.tabSize=tabRect.height,data.tabPressPos=data.pressY-tabRect.top),data.tabLayout=Private$7.snapTabLayout(tabs,this._orientation),data.contentRect=this.contentNode.getBoundingClientRect(),data.override=Drag.overrideCursor("default"),data.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),data.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),data.dragActive=!0}if(!data.detachRequested&&Private$7.detachExceeded(data,event)){data.detachRequested=!0;var index=data.index,clientX=event.clientX,clientY=event.clientY,tab=tabs[index],title=this._titles[index];if(this._tabDetachRequested.emit({index,title,tab,clientX,clientY}),data.dragAborted)return}Private$7.layoutTabs(tabs,data,event,this._orientation)}}},TabBar2.prototype._evtMouseUp=function(event){var _this=this;if(!(event.button!==0&&event.button!==1)){var data=this._dragData;if(data){if(event.preventDefault(),event.stopPropagation(),this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!data.dragActive){this._dragData=null;var addButtonClicked=this.addButtonEnabled&&this.addButtonNode.contains(event.target);if(addButtonClicked){this._addRequested.emit(void 0);return}var tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(index!==data.index)return;var title=this._titles[index];if(!title.closable)return;if(event.button===1){this._tabCloseRequested.emit({index,title});return}var icon=tabs[index].querySelector(this.renderer.closeIconSelector);if(icon&&icon.contains(event.target)){this._tabCloseRequested.emit({index,title});return}return}if(event.button===0){Private$7.finalizeTabPosition(data,this._orientation),data.tab.classList.remove("lm-mod-dragging"),data.tab.classList.remove("p-mod-dragging");var duration=Private$7.parseTransitionDuration(data.tab);setTimeout(function(){if(!data.dragAborted){_this._dragData=null,Private$7.resetTabPositions(_this.contentNode.children,_this._orientation),data.override.dispose(),_this.removeClass("lm-mod-dragging"),_this.removeClass("p-mod-dragging");var i=data.index,j=data.targetIndex;j===-1||i===j||(ArrayExt.move(_this._titles,i,j),_this._adjustCurrentForMove(i,j),_this._tabMoved.emit({fromIndex:i,toIndex:j,title:_this._titles[j]}),MessageLoop.sendMessage(_this,Widget.Msg.UpdateRequest))}},duration)}}}},TabBar2.prototype._releaseMouse=function(){var data=this._dragData;data&&(this._dragData=null,this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),data.dragAborted=!0,data.dragActive&&(Private$7.resetTabPositions(this.contentNode.children,this._orientation),data.override.dispose(),data.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),data.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},TabBar2.prototype._adjustCurrentForInsert=function(i,title){var ct=this.currentTitle,ci=this._currentIndex,bh=this.insertBehavior;if(bh==="select-tab"||bh==="select-tab-if-needed"&&ci===-1){this._currentIndex=i,this._previousTitle=ct,this._currentChanged.emit({previousIndex:ci,previousTitle:ct,currentIndex:i,currentTitle:title});return}ci>=i&&this._currentIndex++},TabBar2.prototype._adjustCurrentForMove=function(i,j){this._currentIndex===i?this._currentIndex=j:this._currentIndex<i&&this._currentIndex>=j?this._currentIndex++:this._currentIndex>i&&this._currentIndex<=j&&this._currentIndex--},TabBar2.prototype._adjustCurrentForRemove=function(i,title){var ci=this._currentIndex,bh=this.removeBehavior;if(ci!==i){ci>i&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:-1,currentTitle:null});return}if(bh==="select-tab-after"){this._currentIndex=Math.min(i,this._titles.length-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(bh==="select-tab-before"){this._currentIndex=Math.max(0,i-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(bh==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(i,this._titles.length-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:-1,currentTitle:null})},TabBar2.prototype._onTitleChanged=function(sender){this.update()},TabBar2}(Widget);(function(TabBar2){var Renderer=function(){function Renderer2(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++Renderer2._nInstance}return Renderer2.prototype.renderTab=function(data){var title=data.title.caption,key=this.createTabKey(data),id=key,style=this.createTabStyle(data),className=this.createTabClass(data),dataset=this.createTabDataset(data),aria=this.createTabARIA(data);return data.title.closable?h.li(__assign({id,key,className,title,style,dataset},aria),this.renderIcon(data),this.renderLabel(data),this.renderCloseIcon(data)):h.li(__assign({id,key,className,title,style,dataset},aria),this.renderIcon(data),this.renderLabel(data))},Renderer2.prototype.renderIcon=function(data){var title=data.title,className=this.createIconClass(data);return typeof title.icon=="string"?h.div({className},title.iconLabel):h.div({className},title.icon,title.iconLabel)},Renderer2.prototype.renderLabel=function(data){return h.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},data.title.label)},Renderer2.prototype.renderCloseIcon=function(data){return h.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},Renderer2.prototype.createTabKey=function(data){var key=this._tabKeys.get(data.title);return key===void 0&&(key="tab-key-"+this._uuid+"-"+this._tabID++,this._tabKeys.set(data.title,key)),key},Renderer2.prototype.createTabStyle=function(data){return{zIndex:""+data.zIndex}},Renderer2.prototype.createTabClass=function(data){var name2="lm-TabBar-tab";return name2+=" p-TabBar-tab",data.title.className&&(name2+=" "+data.title.className),data.title.closable&&(name2+=" lm-mod-closable",name2+=" p-mod-closable"),data.current&&(name2+=" lm-mod-current",name2+=" p-mod-current"),name2},Renderer2.prototype.createTabDataset=function(data){return data.title.dataset},Renderer2.prototype.createTabARIA=function(data){return{role:"tab","aria-selected":data.current.toString()}},Renderer2.prototype.createIconClass=function(data){var name2="lm-TabBar-tabIcon";name2+=" p-TabBar-tabIcon";var extra=data.title.iconClass;return extra?name2+" "+extra:name2},Renderer2._nInstance=0,Renderer2}();TabBar2.Renderer=Renderer,TabBar2.defaultRenderer=new Renderer,TabBar2.addButtonSelector=".lm-TabBar-addButton"})(TabBar);var Private$7;(function(Private2){Private2.DRAG_THRESHOLD=5,Private2.DETACH_THRESHOLD=20;function createNode(){var node=document.createElement("div"),content=document.createElement("ul");content.setAttribute("role","tablist"),content.className="lm-TabBar-content",content.classList.add("p-TabBar-content"),node.appendChild(content);var add=document.createElement("div");return add.className="lm-TabBar-addButton lm-mod-hidden",node.appendChild(add),node}Private2.createNode=createNode;function asTitle(value){return value instanceof Title?value:new Title(value)}Private2.asTitle=asTitle;function parseTransitionDuration(tab){var style=window.getComputedStyle(tab);return 1e3*(parseFloat(style.transitionDuration)||0)}Private2.parseTransitionDuration=parseTransitionDuration;function snapTabLayout(tabs,orientation){for(var layout=new Array(tabs.length),i=0,n=tabs.length;i<n;++i){var node=tabs[i],style=window.getComputedStyle(node);orientation==="horizontal"?layout[i]={pos:node.offsetLeft,size:node.offsetWidth,margin:parseFloat(style.marginLeft)||0}:layout[i]={pos:node.offsetTop,size:node.offsetHeight,margin:parseFloat(style.marginTop)||0}}return layout}Private2.snapTabLayout=snapTabLayout;function dragExceeded(data,event){var dx=Math.abs(event.clientX-data.pressX),dy=Math.abs(event.clientY-data.pressY);return dx>=Private2.DRAG_THRESHOLD||dy>=Private2.DRAG_THRESHOLD}Private2.dragExceeded=dragExceeded;function detachExceeded(data,event){var rect=data.contentRect;return event.clientX<rect.left-Private2.DETACH_THRESHOLD||event.clientX>=rect.right+Private2.DETACH_THRESHOLD||event.clientY<rect.top-Private2.DETACH_THRESHOLD||event.clientY>=rect.bottom+Private2.DETACH_THRESHOLD}Private2.detachExceeded=detachExceeded;function layoutTabs(tabs,data,event,orientation){var pressPos,localPos,clientPos,clientSize;orientation==="horizontal"?(pressPos=data.pressX,localPos=event.clientX-data.contentRect.left,clientPos=event.clientX,clientSize=data.contentRect.width):(pressPos=data.pressY,localPos=event.clientY-data.contentRect.top,clientPos=event.clientY,clientSize=data.contentRect.height);for(var targetIndex=data.index,targetPos=localPos-data.tabPressPos,targetEnd=targetPos+data.tabSize,i=0,n=tabs.length;i<n;++i){var pxPos=void 0,layout=data.tabLayout[i],threshold=layout.pos+(layout.size>>1);if(i<data.index&&targetPos<threshold)pxPos=data.tabSize+data.tabLayout[i+1].margin+"px",targetIndex=Math.min(targetIndex,i);else if(i>data.index&&targetEnd>threshold)pxPos=-data.tabSize-layout.margin+"px",targetIndex=Math.max(targetIndex,i);else if(i===data.index){var ideal=clientPos-pressPos,limit=clientSize-(data.tabPos+data.tabSize);pxPos=Math.max(-data.tabPos,Math.min(ideal,limit))+"px"}else pxPos="";orientation==="horizontal"?tabs[i].style.left=pxPos:tabs[i].style.top=pxPos}data.targetIndex=targetIndex}Private2.layoutTabs=layoutTabs;function finalizeTabPosition(data,orientation){var clientSize;orientation==="horizontal"?clientSize=data.contentRect.width:clientSize=data.contentRect.height;var ideal;if(data.targetIndex===data.index)ideal=0;else if(data.targetIndex>data.index){var tgt=data.tabLayout[data.targetIndex];ideal=tgt.pos+tgt.size-data.tabSize-data.tabPos}else{var tgt=data.tabLayout[data.targetIndex];ideal=tgt.pos-data.tabPos}var limit=clientSize-(data.tabPos+data.tabSize),final=Math.max(-data.tabPos,Math.min(ideal,limit));orientation==="horizontal"?data.tab.style.left=final+"px":data.tab.style.top=final+"px"}Private2.finalizeTabPosition=finalizeTabPosition;function resetTabPositions(tabs,orientation){each(tabs,function(tab){orientation==="horizontal"?tab.style.left="":tab.style.top=""})}Private2.resetTabPositions=resetTabPositions})(Private$7||(Private$7={}));var DockLayout=function(_super){__extends(DockLayout2,_super);function DockLayout2(options){var _this=_super.call(this)||this;return _this._spacing=4,_this._dirty=!1,_this._root=null,_this._box=null,_this._items=new Map,_this.renderer=options.renderer,options.spacing!==void 0&&(_this._spacing=Utils$1.clampDimension(options.spacing)),_this._document=options.document||document,_this._hiddenMode=options.hiddenMode!==void 0?options.hiddenMode:Widget.HiddenMode.Display,_this}return DockLayout2.prototype.dispose=function(){var widgets=this.iter();this._items.forEach(function(item){item.dispose()}),this._box=null,this._root=null,this._items.clear(),each(widgets,function(widget){widget.dispose()}),_super.prototype.dispose.call(this)},Object.defineProperty(DockLayout2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(v){var _this=this;this._hiddenMode!==v&&(this._hiddenMode=v,each(this.tabBars(),function(bar){bar.titles.length>1&&bar.titles.forEach(function(title){title.owner.hiddenMode=_this._hiddenMode})}))},enumerable:!0,configurable:!0}),Object.defineProperty(DockLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils$1.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(DockLayout2.prototype,"isEmpty",{get:function(){return this._root===null},enumerable:!0,configurable:!0}),DockLayout2.prototype.iter=function(){return this._root?this._root.iterAllWidgets():empty()},DockLayout2.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():empty()},DockLayout2.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():empty()},DockLayout2.prototype.tabBars=function(){return this._root?this._root.iterTabBars():empty()},DockLayout2.prototype.handles=function(){return this._root?this._root.iterHandles():empty()},DockLayout2.prototype.moveHandle=function(handle,offsetX,offsetY){var hidden=handle.classList.contains("lm-mod-hidden");if(hidden=hidden||handle.classList.contains("p-mod-hidden"),!(!this._root||hidden)){var data=this._root.findSplitNode(handle);if(data){var delta;data.node.orientation==="horizontal"?delta=offsetX-handle.offsetLeft:delta=offsetY-handle.offsetTop,delta!==0&&(data.node.holdSizes(),BoxEngine.adjust(data.node.sizers,data.index,delta),this.parent&&this.parent.update())}}},DockLayout2.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},DockLayout2.prototype.restoreLayout=function(config){var _this=this,widgetSet=new Set,mainConfig;config.main?mainConfig=Private$6.normalizeAreaConfig(config.main,widgetSet):mainConfig=null;var oldWidgets=this.widgets(),oldTabBars=this.tabBars(),oldHandles=this.handles();this._root=null,each(oldWidgets,function(widget){widgetSet.has(widget)||(widget.parent=null)}),each(oldTabBars,function(tabBar){tabBar.dispose()}),each(oldHandles,function(handle){handle.parentNode&&handle.parentNode.removeChild(handle)}),widgetSet.forEach(function(widget){widget.parent=_this.parent}),mainConfig?this._root=Private$6.realizeAreaConfig(mainConfig,{createTabBar:function(document2){return _this._createTabBar()},createHandle:function(){return _this._createHandle()}},this._document):this._root=null,this.parent&&(widgetSet.forEach(function(widget){_this.attachWidget(widget)}),this.parent.fit())},DockLayout2.prototype.addWidget=function(widget,options){options===void 0&&(options={});var ref=options.ref||null,mode=options.mode||"tab-after",refNode=null;if(this._root&&ref&&(refNode=this._root.findTabNode(ref)),ref&&!refNode)throw new Error("Reference widget is not in the layout.");switch(widget.parent=this.parent,mode){case"tab-after":this._insertTab(widget,ref,refNode,!0);break;case"tab-before":this._insertTab(widget,ref,refNode,!1);break;case"split-top":this._insertSplit(widget,ref,refNode,"vertical",!1);break;case"split-left":this._insertSplit(widget,ref,refNode,"horizontal",!1);break;case"split-right":this._insertSplit(widget,ref,refNode,"horizontal",!0);break;case"split-bottom":this._insertSplit(widget,ref,refNode,"vertical",!0);break}this.parent&&(this.attachWidget(widget),this.parent.fit())},DockLayout2.prototype.removeWidget=function(widget){this._removeWidget(widget),this.parent&&(this.detachWidget(widget),this.parent.fit())},DockLayout2.prototype.hitTestTabAreas=function(clientX,clientY){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=ElementExt.boxSizing(this.parent.node));var rect=this.parent.node.getBoundingClientRect(),x=clientX-rect.left-this._box.borderLeft,y=clientY-rect.top-this._box.borderTop,tabNode=this._root.hitTestTabNodes(x,y);if(!tabNode)return null;var tabBar=tabNode.tabBar,top=tabNode.top,left=tabNode.left,width=tabNode.width,height=tabNode.height,borderWidth=this._box.borderLeft+this._box.borderRight,borderHeight=this._box.borderTop+this._box.borderBottom,right=rect.width-borderWidth-(left+width),bottom=rect.height-borderHeight-(top+height);return{tabBar,x,y,top,left,right,bottom,width,height}},DockLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)}),each(this.handles(),function(handle){_this.parent.node.appendChild(handle)}),this.parent.fit()},DockLayout2.prototype.attachWidget=function(widget){this.parent.node!==widget.node.parentNode&&(this._items.set(widget,new LayoutItem(widget)),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach))},DockLayout2.prototype.detachWidget=function(widget){if(this.parent.node===widget.node.parentNode){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach);var item=this._items.get(widget);item&&(this._items.delete(widget),item.dispose())}},DockLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},DockLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},DockLayout2.prototype.onChildShown=function(msg){this.parent.fit()},DockLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},DockLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},DockLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},DockLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},DockLayout2.prototype._removeWidget=function(widget){if(this._root){var tabNode=this._root.findTabNode(widget);if(tabNode){if(Private$6.removeAria(widget),tabNode.tabBar.titles.length>1){if(tabNode.tabBar.removeTab(widget.title),this._hiddenMode===Widget.HiddenMode.Scale&&tabNode.tabBar.titles.length==1){var existingWidget=tabNode.tabBar.titles[0].owner;existingWidget.hiddenMode=Widget.HiddenMode.Display}return}if(tabNode.tabBar.dispose(),this._root===tabNode){this._root=null;return}this._root.holdAllSizes();var splitNode=tabNode.parent;tabNode.parent=null;var i=ArrayExt.removeFirstOf(splitNode.children,tabNode),handle=ArrayExt.removeAt(splitNode.handles,i);if(ArrayExt.removeAt(splitNode.sizers,i),handle.parentNode&&handle.parentNode.removeChild(handle),splitNode.children.length>1){splitNode.syncHandles();return}var maybeParent=splitNode.parent;splitNode.parent=null;var childNode=splitNode.children[0],childHandle=splitNode.handles[0];if(splitNode.children.length=0,splitNode.handles.length=0,splitNode.sizers.length=0,childHandle.parentNode&&childHandle.parentNode.removeChild(childHandle),this._root===splitNode){childNode.parent=null,this._root=childNode;return}var parentNode=maybeParent,j=parentNode.children.indexOf(splitNode);if(childNode instanceof Private$6.TabLayoutNode){childNode.parent=parentNode,parentNode.children[j]=childNode;return}var splitHandle=ArrayExt.removeAt(parentNode.handles,j);ArrayExt.removeAt(parentNode.children,j),ArrayExt.removeAt(parentNode.sizers,j),splitHandle.parentNode&&splitHandle.parentNode.removeChild(splitHandle);for(var i_1=0,n=childNode.children.length;i_1<n;++i_1){var gChild=childNode.children[i_1],gHandle=childNode.handles[i_1],gSizer=childNode.sizers[i_1];ArrayExt.insert(parentNode.children,j+i_1,gChild),ArrayExt.insert(parentNode.handles,j+i_1,gHandle),ArrayExt.insert(parentNode.sizers,j+i_1,gSizer),gChild.parent=parentNode}childNode.children.length=0,childNode.handles.length=0,childNode.sizers.length=0,childNode.parent=null,parentNode.syncHandles()}}},DockLayout2.prototype._insertTab=function(widget,ref,refNode,after){if(widget!==ref){if(!this._root){var tabNode=new Private$6.TabLayoutNode(this._createTabBar());tabNode.tabBar.addTab(widget.title),this._root=tabNode,Private$6.addAria(widget,tabNode.tabBar);return}refNode||(refNode=this._root.findFirstTabNode()),refNode.tabBar.titles.indexOf(widget.title)===-1&&(this._removeWidget(widget),widget.hide());var index;if(ref?index=refNode.tabBar.titles.indexOf(ref.title):index=refNode.tabBar.currentIndex,this._hiddenMode===Widget.HiddenMode.Scale)if(refNode.tabBar.titles.length===0)widget.hiddenMode=Widget.HiddenMode.Display;else if(refNode.tabBar.titles.length==1){var existingWidget=refNode.tabBar.titles[0].owner;existingWidget.hiddenMode=Widget.HiddenMode.Scale}else widget.hiddenMode=Widget.HiddenMode.Scale;else widget.hiddenMode=this._hiddenMode;refNode.tabBar.insertTab(index+(after?1:0),widget.title),Private$6.addAria(widget,refNode.tabBar)}},DockLayout2.prototype._insertSplit=function(widget,ref,refNode,orientation,after){if(!(widget===ref&&refNode&&refNode.tabBar.titles.length===1)){this._removeWidget(widget);var tabNode=new Private$6.TabLayoutNode(this._createTabBar());if(tabNode.tabBar.addTab(widget.title),Private$6.addAria(widget,tabNode.tabBar),!this._root){this._root=tabNode;return}if(!refNode||!refNode.parent){var root=this._splitRoot(orientation),i_2=after?root.children.length:0;root.normalizeSizes();var sizer=Private$6.createSizer(refNode?1:Private$6.GOLDEN_RATIO);ArrayExt.insert(root.children,i_2,tabNode),ArrayExt.insert(root.sizers,i_2,sizer),ArrayExt.insert(root.handles,i_2,this._createHandle()),tabNode.parent=root,root.normalizeSizes(),root.syncHandles();return}var splitNode=refNode.parent;if(splitNode.orientation===orientation){var i_3=splitNode.children.indexOf(refNode);splitNode.normalizeSizes();var s=splitNode.sizers[i_3].sizeHint/=2,j_1=i_3+(after?1:0);ArrayExt.insert(splitNode.children,j_1,tabNode),ArrayExt.insert(splitNode.sizers,j_1,Private$6.createSizer(s)),ArrayExt.insert(splitNode.handles,j_1,this._createHandle()),tabNode.parent=splitNode,splitNode.syncHandles();return}var i=ArrayExt.removeFirstOf(splitNode.children,refNode),childNode=new Private$6.SplitLayoutNode(orientation);childNode.normalized=!0,childNode.children.push(refNode),childNode.sizers.push(Private$6.createSizer(.5)),childNode.handles.push(this._createHandle()),refNode.parent=childNode;var j=after?1:0;ArrayExt.insert(childNode.children,j,tabNode),ArrayExt.insert(childNode.sizers,j,Private$6.createSizer(.5)),ArrayExt.insert(childNode.handles,j,this._createHandle()),tabNode.parent=childNode,childNode.syncHandles(),ArrayExt.insert(splitNode.children,i,childNode),childNode.parent=splitNode}},DockLayout2.prototype._splitRoot=function(orientation){var oldRoot=this._root;if(oldRoot instanceof Private$6.SplitLayoutNode&&oldRoot.orientation===orientation)return oldRoot;var newRoot=this._root=new Private$6.SplitLayoutNode(orientation);return oldRoot&&(newRoot.children.push(oldRoot),newRoot.sizers.push(Private$6.createSizer(0)),newRoot.handles.push(this._createHandle()),oldRoot.parent=newRoot),newRoot},DockLayout2.prototype._fit=function(){var minW=0,minH=0;if(this._root){var limits=this._root.fit(this._spacing,this._items);minW=limits.minWidth,minH=limits.minHeight}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},DockLayout2.prototype._update=function(offsetWidth,offsetHeight){if(this._dirty=!1,!!this._root){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var x=this._box.paddingTop,y=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum;this._root.update(x,y,width,height,this._spacing,this._items)}},DockLayout2.prototype._createTabBar=function(){var tabBar=this.renderer.createTabBar(this._document);return tabBar.orientation="horizontal",this.parent&&(tabBar.parent=this.parent,this.attachWidget(tabBar)),tabBar},DockLayout2.prototype._createHandle=function(){var handle=this.renderer.createHandle(),style=handle.style;return style.position="absolute",style.top="0",style.left="0",style.width="0",style.height="0",this.parent&&this.parent.node.appendChild(handle),handle},DockLayout2}(Layout),Private$6;(function(Private2){Private2.GOLDEN_RATIO=.618;function createSizer(hint){var sizer=new BoxSizer;return sizer.sizeHint=hint,sizer.size=hint,sizer}Private2.createSizer=createSizer;function normalizeAreaConfig(config,widgetSet){var result;return config.type==="tab-area"?result=normalizeTabAreaConfig(config,widgetSet):result=normalizeSplitAreaConfig(config,widgetSet),result}Private2.normalizeAreaConfig=normalizeAreaConfig;function realizeAreaConfig(config,renderer,document2){var node;return config.type==="tab-area"?node=realizeTabAreaConfig(config,renderer,document2):node=realizeSplitAreaConfig(config,renderer,document2),node}Private2.realizeAreaConfig=realizeAreaConfig;var TabLayoutNode=function(){function TabLayoutNode2(tabBar){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var tabSizer=new BoxSizer,widgetSizer=new BoxSizer;tabSizer.stretch=0,widgetSizer.stretch=1,this.tabBar=tabBar,this.sizers=[tabSizer,widgetSizer]}return Object.defineProperty(TabLayoutNode2.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),TabLayoutNode2.prototype.iterAllWidgets=function(){return chain(once(this.tabBar),this.iterUserWidgets())},TabLayoutNode2.prototype.iterUserWidgets=function(){return map(this.tabBar.titles,function(title){return title.owner})},TabLayoutNode2.prototype.iterSelectedWidgets=function(){var title=this.tabBar.currentTitle;return title?once(title.owner):empty()},TabLayoutNode2.prototype.iterTabBars=function(){return once(this.tabBar)},TabLayoutNode2.prototype.iterHandles=function(){return empty()},TabLayoutNode2.prototype.findTabNode=function(widget){return this.tabBar.titles.indexOf(widget.title)!==-1?this:null},TabLayoutNode2.prototype.findSplitNode=function(handle){return null},TabLayoutNode2.prototype.findFirstTabNode=function(){return this},TabLayoutNode2.prototype.hitTestTabNodes=function(x,y){return x<this._left||x>=this._left+this._width||y<this._top||y>=this._top+this._height?null:this},TabLayoutNode2.prototype.createConfig=function(){var widgets=this.tabBar.titles.map(function(title){return title.owner}),currentIndex=this.tabBar.currentIndex;return{type:"tab-area",widgets,currentIndex}},TabLayoutNode2.prototype.holdAllSizes=function(){},TabLayoutNode2.prototype.fit=function(spacing,items){var minWidth=0,minHeight=0,maxWidth=1/0,maxHeight=1/0,tabBarItem=items.get(this.tabBar),current=this.tabBar.currentTitle,widgetItem=current?items.get(current.owner):void 0,_a=this.sizers,tabBarSizer=_a[0],widgetSizer=_a[1];return tabBarItem&&tabBarItem.fit(),widgetItem&&widgetItem.fit(),tabBarItem&&!tabBarItem.isHidden?(minWidth=Math.max(minWidth,tabBarItem.minWidth),minHeight+=tabBarItem.minHeight,tabBarSizer.minSize=tabBarItem.minHeight,tabBarSizer.maxSize=tabBarItem.maxHeight):(tabBarSizer.minSize=0,tabBarSizer.maxSize=0),widgetItem&&!widgetItem.isHidden?(minWidth=Math.max(minWidth,widgetItem.minWidth),minHeight+=widgetItem.minHeight,widgetSizer.minSize=widgetItem.minHeight,widgetSizer.maxSize=1/0):(widgetSizer.minSize=0,widgetSizer.maxSize=1/0),{minWidth,minHeight,maxWidth,maxHeight}},TabLayoutNode2.prototype.update=function(left,top,width,height,spacing,items){this._top=top,this._left=left,this._width=width,this._height=height;var tabBarItem=items.get(this.tabBar),current=this.tabBar.currentTitle,widgetItem=current?items.get(current.owner):void 0;if(BoxEngine.calc(this.sizers,height),tabBarItem&&!tabBarItem.isHidden){var size=this.sizers[0].size;tabBarItem.update(left,top,width,size),top+=size}if(widgetItem&&!widgetItem.isHidden){var size=this.sizers[1].size;widgetItem.update(left,top,width,size)}},TabLayoutNode2}();Private2.TabLayoutNode=TabLayoutNode;var SplitLayoutNode=function(){function SplitLayoutNode2(orientation){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=orientation}return SplitLayoutNode2.prototype.iterAllWidgets=function(){var children=map(this.children,function(child){return child.iterAllWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterUserWidgets=function(){var children=map(this.children,function(child){return child.iterUserWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterSelectedWidgets=function(){var children=map(this.children,function(child){return child.iterSelectedWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterTabBars=function(){var children=map(this.children,function(child){return child.iterTabBars()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterHandles=function(){var children=map(this.children,function(child){return child.iterHandles()});return chain(this.handles,new ChainIterator(children))},SplitLayoutNode2.prototype.findTabNode=function(widget){for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].findTabNode(widget);if(result)return result}return null},SplitLayoutNode2.prototype.findSplitNode=function(handle){var index=this.handles.indexOf(handle);if(index!==-1)return{index,node:this};for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].findSplitNode(handle);if(result)return result}return null},SplitLayoutNode2.prototype.findFirstTabNode=function(){return this.children.length===0?null:this.children[0].findFirstTabNode()},SplitLayoutNode2.prototype.hitTestTabNodes=function(x,y){for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].hitTestTabNodes(x,y);if(result)return result}return null},SplitLayoutNode2.prototype.createConfig=function(){var orientation=this.orientation,sizes=this.createNormalizedSizes(),children=this.children.map(function(child){return child.createConfig()});return{type:"split-area",orientation,children,sizes}},SplitLayoutNode2.prototype.syncHandles=function(){var _this=this;each(this.handles,function(handle,i){handle.setAttribute("data-orientation",_this.orientation),i===_this.handles.length-1?(handle.classList.add("lm-mod-hidden"),handle.classList.add("p-mod-hidden")):(handle.classList.remove("lm-mod-hidden"),handle.classList.remove("p-mod-hidden"))})},SplitLayoutNode2.prototype.holdSizes=function(){each(this.sizers,function(sizer){sizer.sizeHint=sizer.size})},SplitLayoutNode2.prototype.holdAllSizes=function(){each(this.children,function(child){return child.holdAllSizes()}),this.holdSizes()},SplitLayoutNode2.prototype.normalizeSizes=function(){var n=this.sizers.length;if(n!==0){this.holdSizes();var sum=reduce(this.sizers,function(v,sizer){return v+sizer.sizeHint},0);sum===0?each(this.sizers,function(sizer){sizer.size=sizer.sizeHint=1/n}):each(this.sizers,function(sizer){sizer.size=sizer.sizeHint/=sum}),this.normalized=!0}},SplitLayoutNode2.prototype.createNormalizedSizes=function(){var n=this.sizers.length;if(n===0)return[];var sizes=this.sizers.map(function(sizer){return sizer.size}),sum=reduce(sizes,function(v,size){return v+size},0);return sum===0?each(sizes,function(size,i){sizes[i]=1/n}):each(sizes,function(size,i){sizes[i]=size/sum}),sizes},SplitLayoutNode2.prototype.fit=function(spacing,items){for(var horizontal=this.orientation==="horizontal",fixed=Math.max(0,this.children.length-1)*spacing,minWidth=horizontal?fixed:0,minHeight=horizontal?0:fixed,maxWidth=1/0,maxHeight=1/0,i=0,n=this.children.length;i<n;++i){var limits=this.children[i].fit(spacing,items);horizontal?(minHeight=Math.max(minHeight,limits.minHeight),minWidth+=limits.minWidth,this.sizers[i].minSize=limits.minWidth):(minWidth=Math.max(minWidth,limits.minWidth),minHeight+=limits.minHeight,this.sizers[i].minSize=limits.minHeight)}return{minWidth,minHeight,maxWidth,maxHeight}},SplitLayoutNode2.prototype.update=function(left,top,width,height,spacing,items){var horizontal=this.orientation==="horizontal",fixed=Math.max(0,this.children.length-1)*spacing,space=Math.max(0,(horizontal?width:height)-fixed);this.normalized&&(each(this.sizers,function(sizer){sizer.sizeHint*=space}),this.normalized=!1),BoxEngine.calc(this.sizers,space);for(var i=0,n=this.children.length;i<n;++i){var child=this.children[i],size=this.sizers[i].size,handleStyle=this.handles[i].style;horizontal?(child.update(left,top,size,height,spacing,items),left+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=spacing+"px",handleStyle.height=height+"px",left+=spacing):(child.update(left,top,width,size,spacing,items),top+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=width+"px",handleStyle.height=spacing+"px",top+=spacing)}},SplitLayoutNode2}();Private2.SplitLayoutNode=SplitLayoutNode;function addAria(widget,tabBar){widget.node.setAttribute("role","tabpanel");var renderer=tabBar.renderer;if(renderer instanceof TabBar.Renderer){var tabId=renderer.createTabKey({title:widget.title,current:!1,zIndex:0});widget.node.setAttribute("aria-labelledby",tabId)}}Private2.addAria=addAria;function removeAria(widget){widget.node.removeAttribute("role"),widget.node.removeAttribute("aria-labelledby")}Private2.removeAria=removeAria;function normalizeTabAreaConfig(config,widgetSet){if(config.widgets.length===0)return null;var widgets=[];if(each(config.widgets,function(widget){widgetSet.has(widget)||(widgetSet.add(widget),widgets.push(widget))}),widgets.length===0)return null;var index=config.currentIndex;return index!==-1&&(index<0||index>=widgets.length)&&(index=0),{type:"tab-area",widgets,currentIndex:index}}function normalizeSplitAreaConfig(config,widgetSet){for(var orientation=config.orientation,children=[],sizes=[],i=0,n=config.children.length;i<n;++i){var child=normalizeAreaConfig(config.children[i],widgetSet);child&&(child.type==="tab-area"||child.orientation!==orientation?(children.push(child),sizes.push(Math.abs(config.sizes[i]||0))):(children.push.apply(children,child.children),sizes.push.apply(sizes,child.sizes)))}return children.length===0?null:children.length===1?children[0]:{type:"split-area",orientation,children,sizes}}function realizeTabAreaConfig(config,renderer,document2){var tabBar=renderer.createTabBar(document2);return each(config.widgets,function(widget){widget.hide(),tabBar.addTab(widget.title),Private2.addAria(widget,tabBar)}),tabBar.currentIndex=config.currentIndex,new TabLayoutNode(tabBar)}function realizeSplitAreaConfig(config,renderer,document2){var node=new SplitLayoutNode(config.orientation);return each(config.children,function(child,i){var childNode=realizeAreaConfig(child,renderer,document2),sizer=createSizer(config.sizes[i]),handle=renderer.createHandle();node.children.push(childNode),node.handles.push(handle),node.sizers.push(sizer),childNode.parent=node}),node.syncHandles(),node.normalizeSizes(),node}})(Private$6||(Private$6={}));var DockPanel$1=function(_super){__extends(DockPanel2,_super);function DockPanel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;_this._drag=null,_this._tabsMovable=!0,_this._tabsConstrained=!1,_this._addButtonEnabled=!1,_this._pressData=null,_this._layoutModified=new Signal(_this),_this._addRequested=new Signal(_this),_this.addClass("lm-DockPanel"),_this.addClass("p-DockPanel"),_this._document=options.document||document,_this._mode=options.mode||"multiple-document",_this._renderer=options.renderer||DockPanel2.defaultRenderer,_this._edges=options.edges||Private$5.DEFAULT_EDGES,options.tabsMovable!==void 0&&(_this._tabsMovable=options.tabsMovable),options.tabsConstrained!==void 0&&(_this._tabsConstrained=options.tabsConstrained),options.addButtonEnabled!==void 0&&(_this._addButtonEnabled=options.addButtonEnabled),_this.dataset.mode=_this._mode;var renderer={createTabBar:function(){return _this._createTabBar()},createHandle:function(){return _this._createHandle()}};return _this.layout=new DockLayout({document:_this._document,renderer,spacing:options.spacing,hiddenMode:options.hiddenMode}),_this.overlay=options.overlay||new DockPanel2.Overlay,_this.node.appendChild(_this.overlay.node),_this}return DockPanel2.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),_super.prototype.dispose.call(this)},Object.defineProperty(DockPanel2.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(v){this.layout.hiddenMode=v},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"mode",{get:function(){return this._mode},set:function(value){if(this._mode!==value){this._mode=value,this.dataset.mode=value;var layout=this.layout;switch(value){case"multiple-document":each(layout.tabBars(),function(tabBar){tabBar.show()});break;case"single-document":layout.restoreLayout(Private$5.createSingleDocumentConfig(this));break;default:throw"unreachable"}MessageLoop.postMessage(this,Private$5.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(value){this._tabsMovable=value,each(this.tabBars(),function(tabbar){tabbar.tabsMovable=value})},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(value){this._tabsConstrained=value},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(value){this._addButtonEnabled=value,each(this.tabBars(),function(tabbar){tabbar.addButtonEnabled=value})},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),DockPanel2.prototype.widgets=function(){return this.layout.widgets()},DockPanel2.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},DockPanel2.prototype.tabBars=function(){return this.layout.tabBars()},DockPanel2.prototype.handles=function(){return this.layout.handles()},DockPanel2.prototype.selectWidget=function(widget){var tabBar=find(this.tabBars(),function(bar){return bar.titles.indexOf(widget.title)!==-1});if(!tabBar)throw new Error("Widget is not contained in the dock panel.");tabBar.currentTitle=widget.title},DockPanel2.prototype.activateWidget=function(widget){this.selectWidget(widget),widget.activate()},DockPanel2.prototype.saveLayout=function(){return this.layout.saveLayout()},DockPanel2.prototype.restoreLayout=function(config){this._mode="multiple-document",this.layout.restoreLayout(config),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush(),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype.addWidget=function(widget,options){options===void 0&&(options={}),this._mode==="single-document"?this.layout.addWidget(widget):this.layout.addWidget(widget,options),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype.processMessage=function(msg){msg.type==="layout-modified"?this._layoutModified.emit(void 0):_super.prototype.processMessage.call(this,msg)},DockPanel2.prototype.handleEvent=function(event){switch(event.type){case"lm-dragenter":this._evtDragEnter(event);break;case"lm-dragleave":this._evtDragLeave(event);break;case"lm-dragover":this._evtDragOver(event);break;case"lm-drop":this._evtDrop(event);break;case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},DockPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},DockPanel2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},DockPanel2.prototype.onChildAdded=function(msg){Private$5.isGeneratedTabBarProperty.get(msg.child)||(msg.child.addClass("lm-DockPanel-widget"),msg.child.addClass("p-DockPanel-widget"))},DockPanel2.prototype.onChildRemoved=function(msg){Private$5.isGeneratedTabBarProperty.get(msg.child)||(msg.child.removeClass("lm-DockPanel-widget"),msg.child.removeClass("p-DockPanel-widget"),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._evtDragEnter=function(event){event.mimeData.hasData("application/vnd.lumino.widget-factory")&&(event.preventDefault(),event.stopPropagation())},DockPanel2.prototype._evtDragLeave=function(event){event.preventDefault(),!(this._tabsConstrained&&event.source!==this)&&(event.stopPropagation(),this.overlay.hide(1))},DockPanel2.prototype._evtDragOver=function(event){event.preventDefault(),this._tabsConstrained&&event.source!==this||this._showOverlay(event.clientX,event.clientY)==="invalid"?event.dropAction="none":(event.stopPropagation(),event.dropAction=event.proposedAction)},DockPanel2.prototype._evtDrop=function(event){if(event.preventDefault(),this.overlay.hide(0),event.proposedAction==="none"){event.dropAction="none";return}var clientX=event.clientX,clientY=event.clientY,_a=Private$5.findDropTarget(this,clientX,clientY,this._edges),zone=_a.zone,target=_a.target;if(this._tabsConstrained&&event.source!==this||zone==="invalid"){event.dropAction="none";return}var mimeData=event.mimeData,factory=mimeData.getData("application/vnd.lumino.widget-factory");if(typeof factory!="function"){event.dropAction="none";return}var widget=factory();if(!(widget instanceof Widget)){event.dropAction="none";return}if(widget.contains(this)){event.dropAction="none";return}var ref=target?Private$5.getDropRef(target.tabBar):null;switch(zone){case"root-all":this.addWidget(widget);break;case"root-top":this.addWidget(widget,{mode:"split-top"});break;case"root-left":this.addWidget(widget,{mode:"split-left"});break;case"root-right":this.addWidget(widget,{mode:"split-right"});break;case"root-bottom":this.addWidget(widget,{mode:"split-bottom"});break;case"widget-all":this.addWidget(widget,{mode:"tab-after",ref});break;case"widget-top":this.addWidget(widget,{mode:"split-top",ref});break;case"widget-left":this.addWidget(widget,{mode:"split-left",ref});break;case"widget-right":this.addWidget(widget,{mode:"split-right",ref});break;case"widget-bottom":this.addWidget(widget,{mode:"split-bottom",ref});break;case"widget-tab":this.addWidget(widget,{mode:"tab-after",ref});break;default:throw"unreachable"}event.dropAction=event.proposedAction,event.stopPropagation(),this.activateWidget(widget)},DockPanel2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&(this._releaseMouse(),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._evtMouseDown=function(event){if(event.button===0){var layout=this.layout,target=event.target,handle=find(layout.handles(),function(handle2){return handle2.contains(target)});if(handle){event.preventDefault(),event.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("mouseup",this,!0),this._document.addEventListener("mousemove",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var rect=handle.getBoundingClientRect(),deltaX=event.clientX-rect.left,deltaY=event.clientY-rect.top,style=window.getComputedStyle(handle),override=Drag.overrideCursor(style.cursor,this._document);this._pressData={handle,deltaX,deltaY,override}}}},DockPanel2.prototype._evtMouseMove=function(event){if(this._pressData){event.preventDefault(),event.stopPropagation();var rect=this.node.getBoundingClientRect(),xPos=event.clientX-rect.left-this._pressData.deltaX,yPos=event.clientY-rect.top-this._pressData.deltaY,layout=this.layout;layout.moveHandle(this._pressData.handle,xPos,yPos)}},DockPanel2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse(),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("mouseup",this,!0),this._document.removeEventListener("mousemove",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))},DockPanel2.prototype._showOverlay=function(clientX,clientY){var _a=Private$5.findDropTarget(this,clientX,clientY,this._edges),zone=_a.zone,target=_a.target;if(zone==="invalid")return this.overlay.hide(100),zone;var top,left,right,bottom,box=ElementExt.boxSizing(this.node),rect=this.node.getBoundingClientRect();switch(zone){case"root-all":top=box.paddingTop,left=box.paddingLeft,right=box.paddingRight,bottom=box.paddingBottom;break;case"root-top":top=box.paddingTop,left=box.paddingLeft,right=box.paddingRight,bottom=rect.height*Private$5.GOLDEN_RATIO;break;case"root-left":top=box.paddingTop,left=box.paddingLeft,right=rect.width*Private$5.GOLDEN_RATIO,bottom=box.paddingBottom;break;case"root-right":top=box.paddingTop,left=rect.width*Private$5.GOLDEN_RATIO,right=box.paddingRight,bottom=box.paddingBottom;break;case"root-bottom":top=rect.height*Private$5.GOLDEN_RATIO,left=box.paddingLeft,right=box.paddingRight,bottom=box.paddingBottom;break;case"widget-all":top=target.top,left=target.left,right=target.right,bottom=target.bottom;break;case"widget-top":top=target.top,left=target.left,right=target.right,bottom=target.bottom+target.height/2;break;case"widget-left":top=target.top,left=target.left,right=target.right+target.width/2,bottom=target.bottom;break;case"widget-right":top=target.top,left=target.left+target.width/2,right=target.right,bottom=target.bottom;break;case"widget-bottom":top=target.top+target.height/2,left=target.left,right=target.right,bottom=target.bottom;break;case"widget-tab":var tabHeight=target.tabBar.node.getBoundingClientRect().height;top=target.top,left=target.left,right=target.right,bottom=target.bottom+target.height-tabHeight;break;default:throw"unreachable"}return this.overlay.show({top,left,right,bottom}),zone},DockPanel2.prototype._createTabBar=function(){var tabBar=this._renderer.createTabBar(this._document);return Private$5.isGeneratedTabBarProperty.set(tabBar,!0),this._mode==="single-document"&&tabBar.hide(),tabBar.tabsMovable=this._tabsMovable,tabBar.allowDeselect=!1,tabBar.addButtonEnabled=this._addButtonEnabled,tabBar.removeBehavior="select-previous-tab",tabBar.insertBehavior="select-tab-if-needed",tabBar.tabMoved.connect(this._onTabMoved,this),tabBar.currentChanged.connect(this._onCurrentChanged,this),tabBar.tabCloseRequested.connect(this._onTabCloseRequested,this),tabBar.tabDetachRequested.connect(this._onTabDetachRequested,this),tabBar.tabActivateRequested.connect(this._onTabActivateRequested,this),tabBar.addRequested.connect(this._onTabAddRequested,this),tabBar},DockPanel2.prototype._createHandle=function(){return this._renderer.createHandle()},DockPanel2.prototype._onTabMoved=function(){MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype._onCurrentChanged=function(sender,args){var previousTitle=args.previousTitle,currentTitle=args.currentTitle;previousTitle&&previousTitle.owner.hide(),currentTitle&&currentTitle.owner.show(),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush(),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype._onTabAddRequested=function(sender){this._addRequested.emit(sender)},DockPanel2.prototype._onTabActivateRequested=function(sender,args){args.title.owner.activate()},DockPanel2.prototype._onTabCloseRequested=function(sender,args){args.title.owner.close()},DockPanel2.prototype._onTabDetachRequested=function(sender,args){var _this=this;if(!this._drag){sender.releaseMouse();var title=args.title,tab=args.tab,clientX=args.clientX,clientY=args.clientY,mimeData=new MimeData,factory=function(){return title.owner};mimeData.setData("application/vnd.lumino.widget-factory",factory);var dragImage=tab.cloneNode(!0);this._drag=new Drag({document:this._document,mimeData,dragImage,proposedAction:"move",supportedActions:"move",source:this}),tab.classList.add("lm-mod-hidden"),tab.classList.add("p-mod-hidden");var cleanup=function(){_this._drag=null,tab.classList.remove("lm-mod-hidden"),tab.classList.remove("p-mod-hidden")};this._drag.start(clientX,clientY).then(cleanup)}},DockPanel2}(Widget);(function(DockPanel2){var Overlay=function(){function Overlay2(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return Overlay2.prototype.show=function(geo){var style=this.node.style;style.top=geo.top+"px",style.left=geo.left+"px",style.right=geo.right+"px",style.bottom=geo.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"),this.node.classList.remove("p-mod-hidden"))},Overlay2.prototype.hide=function(delay){var _this=this;if(!this._hidden){if(delay<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(function(){_this._timer=-1,_this._hidden=!0,_this.node.classList.add("lm-mod-hidden"),_this.node.classList.add("p-mod-hidden")},delay))}},Overlay2}();DockPanel2.Overlay=Overlay;var Renderer=function(){function Renderer2(){}return Renderer2.prototype.createTabBar=function(document2){var bar=new TabBar({document:document2});return bar.addClass("lm-DockPanel-tabBar"),bar.addClass("p-DockPanel-tabBar"),bar},Renderer2.prototype.createHandle=function(){var handle=document.createElement("div");return handle.className="lm-DockPanel-handle",handle.classList.add("p-DockPanel-handle"),handle},Renderer2}();DockPanel2.Renderer=Renderer,DockPanel2.defaultRenderer=new Renderer})(DockPanel$1);var Private$5;(function(Private2){Private2.GOLDEN_RATIO=.618,Private2.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},Private2.LayoutModified=new ConflatableMessage("layout-modified"),Private2.isGeneratedTabBarProperty=new AttachedProperty({name:"isGeneratedTabBar",create:function(){return!1}});function createSingleDocumentConfig(panel){if(panel.isEmpty)return{main:null};var widgets=toArray(panel.widgets()),selected=panel.selectedWidgets().next(),currentIndex=selected?widgets.indexOf(selected):-1;return{main:{type:"tab-area",widgets,currentIndex}}}Private2.createSingleDocumentConfig=createSingleDocumentConfig;function findDropTarget(panel,clientX,clientY,edges){if(!ElementExt.hitTest(panel.node,clientX,clientY))return{zone:"invalid",target:null};var layout=panel.layout;if(layout.isEmpty)return{zone:"root-all",target:null};if(panel.mode==="multiple-document"){var panelRect=panel.node.getBoundingClientRect(),pl=clientX-panelRect.left+1,pt=clientY-panelRect.top+1,pr=panelRect.right-clientX,pb=panelRect.bottom-clientY,pd=Math.min(pt,pr,pb,pl);switch(pd){case pt:if(pt<edges.top)return{zone:"root-top",target:null};break;case pr:if(pr<edges.right)return{zone:"root-right",target:null};break;case pb:if(pb<edges.bottom)return{zone:"root-bottom",target:null};break;case pl:if(pl<edges.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var target=layout.hitTestTabAreas(clientX,clientY);if(!target)return{zone:"invalid",target:null};if(panel.mode==="single-document")return{zone:"widget-all",target};var al=target.x-target.left+1,at=target.y-target.top+1,ar=target.left+target.width-target.x,ab=target.top+target.height-target.y,tabHeight=target.tabBar.node.getBoundingClientRect().height;if(at<tabHeight)return{zone:"widget-tab",target};var rx=Math.round(target.width/3),ry=Math.round(target.height/3);if(al>rx&&ar>rx&&at>ry&&ab>ry)return{zone:"widget-all",target};al/=rx,at/=ry,ar/=rx,ab/=ry;var ad=Math.min(al,at,ar,ab),zone;switch(ad){case al:zone="widget-left";break;case at:zone="widget-top";break;case ar:zone="widget-right";break;case ab:zone="widget-bottom";break;default:throw"unreachable"}return{zone,target}}Private2.findDropTarget=findDropTarget;function getDropRef(tabBar){return tabBar.titles.length===0?null:tabBar.currentTitle?tabBar.currentTitle.owner:tabBar.titles[tabBar.titles.length-1].owner}Private2.getDropRef=getDropRef})(Private$5||(Private$5={})),function(){function FocusTracker(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new Signal(this),this._currentChanged=new Signal(this)}return FocusTracker.prototype.dispose=function(){var _this=this;this._counter<0||(this._counter=-1,Signal.clearData(this),each(this._widgets,function(w){w.node.removeEventListener("focus",_this,!0),w.node.removeEventListener("blur",_this,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(FocusTracker.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),FocusTracker.prototype.focusNumber=function(widget){var n=this._numbers.get(widget);return n===void 0?-1:n},FocusTracker.prototype.has=function(widget){return this._numbers.has(widget)},FocusTracker.prototype.add=function(widget){if(!this._numbers.has(widget)){var focused=widget.node.contains(document.activeElement),n=focused?this._counter++:-1;this._widgets.push(widget),this._numbers.set(widget,n),this._nodes.set(widget.node,widget),widget.node.addEventListener("focus",this,!0),widget.node.addEventListener("blur",this,!0),widget.disposed.connect(this._onWidgetDisposed,this),focused&&this._setWidgets(widget,widget)}},FocusTracker.prototype.remove=function(widget){var _this=this;if(this._numbers.has(widget)&&(widget.disposed.disconnect(this._onWidgetDisposed,this),widget.node.removeEventListener("focus",this,!0),widget.node.removeEventListener("blur",this,!0),ArrayExt.removeFirstOf(this._widgets,widget),this._nodes.delete(widget.node),this._numbers.delete(widget),this._currentWidget===widget)){var valid=filter(this._widgets,function(w){return _this._numbers.get(w)!==-1}),previous=max(valid,function(first,second){var a=_this._numbers.get(first),b=_this._numbers.get(second);return a-b})||null;this._setWidgets(previous,null)}},FocusTracker.prototype.handleEvent=function(event){switch(event.type){case"focus":this._evtFocus(event);break;case"blur":this._evtBlur(event);break}},FocusTracker.prototype._setWidgets=function(current,active){var oldCurrent=this._currentWidget;this._currentWidget=current;var oldActive=this._activeWidget;this._activeWidget=active,oldCurrent!==current&&this._currentChanged.emit({oldValue:oldCurrent,newValue:current}),oldActive!==active&&this._activeChanged.emit({oldValue:oldActive,newValue:active})},FocusTracker.prototype._evtFocus=function(event){var widget=this._nodes.get(event.currentTarget);widget!==this._currentWidget&&this._numbers.set(widget,this._counter++),this._setWidgets(widget,widget)},FocusTracker.prototype._evtBlur=function(event){var widget=this._nodes.get(event.currentTarget),focusTarget=event.relatedTarget;if(!focusTarget){this._setWidgets(this._currentWidget,null);return}if(!widget.node.contains(focusTarget)&&!find(this._widgets,function(w){return w.node.contains(focusTarget)})){this._setWidgets(this._currentWidget,null);return}},FocusTracker.prototype._onWidgetDisposed=function(sender){this.remove(sender)},FocusTracker}();var GridLayout=function(_super){__extends(GridLayout2,_super);function GridLayout2(options){options===void 0&&(options={});var _this=_super.call(this,options)||this;return _this._dirty=!1,_this._rowSpacing=4,_this._columnSpacing=4,_this._items=[],_this._rowStarts=[],_this._columnStarts=[],_this._rowSizers=[new BoxSizer],_this._columnSizers=[new BoxSizer],_this._box=null,options.rowCount!==void 0&&Private$4.reallocSizers(_this._rowSizers,options.rowCount),options.columnCount!==void 0&&Private$4.reallocSizers(_this._columnSizers,options.columnCount),options.rowSpacing!==void 0&&(_this._rowSpacing=Private$4.clampValue(options.rowSpacing)),options.columnSpacing!==void 0&&(_this._columnSpacing=Private$4.clampValue(options.columnSpacing)),_this}return GridLayout2.prototype.dispose=function(){each(this._items,function(item){var widget=item.widget;item.dispose(),widget.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(GridLayout2.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(value){value!==this.rowCount&&(Private$4.reallocSizers(this._rowSizers,value),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(value){value!==this.columnCount&&(Private$4.reallocSizers(this._columnSizers,value),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(value){value=Private$4.clampValue(value),this._rowSpacing!==value&&(this._rowSpacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(value){value=Private$4.clampValue(value),this._columnSpacing!==value&&(this._columnSpacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),GridLayout2.prototype.rowStretch=function(index){var sizer=this._rowSizers[index];return sizer?sizer.stretch:-1},GridLayout2.prototype.setRowStretch=function(index,value){var sizer=this._rowSizers[index];sizer&&(value=Private$4.clampValue(value),sizer.stretch!==value&&(sizer.stretch=value,this.parent&&this.parent.update()))},GridLayout2.prototype.columnStretch=function(index){var sizer=this._columnSizers[index];return sizer?sizer.stretch:-1},GridLayout2.prototype.setColumnStretch=function(index,value){var sizer=this._columnSizers[index];sizer&&(value=Private$4.clampValue(value),sizer.stretch!==value&&(sizer.stretch=value,this.parent&&this.parent.update()))},GridLayout2.prototype.iter=function(){return map(this._items,function(item){return item.widget})},GridLayout2.prototype.addWidget=function(widget){var i=ArrayExt.findFirstIndex(this._items,function(it){return it.widget===widget});i===-1&&(this._items.push(new LayoutItem(widget)),this.parent&&this.attachWidget(widget))},GridLayout2.prototype.removeWidget=function(widget){var i=ArrayExt.findFirstIndex(this._items,function(it){return it.widget===widget});if(i!==-1){var item=ArrayExt.removeAt(this._items,i);this.parent&&this.detachWidget(widget),item.dispose()}},GridLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)})},GridLayout2.prototype.attachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},GridLayout2.prototype.detachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),this.parent.fit()},GridLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},GridLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},GridLayout2.prototype.onChildShown=function(msg){this.parent.fit()},GridLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},GridLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},GridLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},GridLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},GridLayout2.prototype._fit=function(){for(var i=0,n=this.rowCount;i<n;++i)this._rowSizers[i].minSize=0;for(var i=0,n=this.columnCount;i<n;++i)this._columnSizers[i].minSize=0;for(var items=this._items.filter(function(it){return!it.isHidden}),i=0,n=items.length;i<n;++i)items[i].fit();var maxRow=this.rowCount-1,maxCol=this.columnCount-1;items.sort(Private$4.rowSpanCmp);for(var i=0,n=items.length;i<n;++i){var item=items[i],config=GridLayout2.getCellConfig(item.widget),r1=Math.min(config.row,maxRow),r2=Math.min(config.row+config.rowSpan-1,maxRow);Private$4.distributeMin(this._rowSizers,r1,r2,item.minHeight)}items.sort(Private$4.columnSpanCmp);for(var i=0,n=items.length;i<n;++i){var item=items[i],config=GridLayout2.getCellConfig(item.widget),c1=Math.min(config.column,maxCol),c2=Math.min(config.column+config.columnSpan-1,maxCol);Private$4.distributeMin(this._columnSizers,c1,c2,item.minWidth)}if(this.fitPolicy==="set-no-constraint"){MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest);return}for(var minH=maxRow*this._rowSpacing,minW=maxCol*this._columnSpacing,i=0,n=this.rowCount;i<n;++i)minH+=this._rowSizers[i].minSize;for(var i=0,n=this.columnCount;i<n;++i)minW+=this._columnSizers[i].minSize;var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},GridLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1,offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,maxRow=this.rowCount-1,maxCol=this.columnCount-1,fixedRowSpace=maxRow*this._rowSpacing,fixedColSpace=maxCol*this._columnSpacing;BoxEngine.calc(this._rowSizers,Math.max(0,height-fixedRowSpace)),BoxEngine.calc(this._columnSizers,Math.max(0,width-fixedColSpace));for(var i=0,pos=top,n=this.rowCount;i<n;++i)this._rowStarts[i]=pos,pos+=this._rowSizers[i].size+this._rowSpacing;for(var i=0,pos=left,n=this.columnCount;i<n;++i)this._columnStarts[i]=pos,pos+=this._columnSizers[i].size+this._columnSpacing;for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i];if(!item.isHidden){var config=GridLayout2.getCellConfig(item.widget),r1=Math.min(config.row,maxRow),c1=Math.min(config.column,maxCol),r2=Math.min(config.row+config.rowSpan-1,maxRow),c2=Math.min(config.column+config.columnSpan-1,maxCol),x=this._columnStarts[c1],y=this._rowStarts[r1],w=this._columnStarts[c2]+this._columnSizers[c2].size-x,h2=this._rowStarts[r2]+this._rowSizers[r2].size-y;item.update(x,y,w,h2)}}},GridLayout2}(Layout);(function(GridLayout2){function getCellConfig(widget){return Private$4.cellConfigProperty.get(widget)}GridLayout2.getCellConfig=getCellConfig;function setCellConfig(widget,value){Private$4.cellConfigProperty.set(widget,Private$4.normalizeConfig(value))}GridLayout2.setCellConfig=setCellConfig})(GridLayout);var Private$4;(function(Private2){Private2.cellConfigProperty=new AttachedProperty({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:onChildCellConfigChanged});function normalizeConfig(config){var row=Math.max(0,Math.floor(config.row||0)),column=Math.max(0,Math.floor(config.column||0)),rowSpan=Math.max(1,Math.floor(config.rowSpan||0)),columnSpan=Math.max(1,Math.floor(config.columnSpan||0));return{row,column,rowSpan,columnSpan}}Private2.normalizeConfig=normalizeConfig;function clampValue(value){return Math.max(0,Math.floor(value))}Private2.clampValue=clampValue;function rowSpanCmp(a,b){var c1=Private2.cellConfigProperty.get(a.widget),c2=Private2.cellConfigProperty.get(b.widget);return c1.rowSpan-c2.rowSpan}Private2.rowSpanCmp=rowSpanCmp;function columnSpanCmp(a,b){var c1=Private2.cellConfigProperty.get(a.widget),c2=Private2.cellConfigProperty.get(b.widget);return c1.columnSpan-c2.columnSpan}Private2.columnSpanCmp=columnSpanCmp;function reallocSizers(sizers,count){for(count=Math.max(1,Math.floor(count));sizers.length<count;)sizers.push(new BoxSizer);sizers.length>count&&(sizers.length=count)}Private2.reallocSizers=reallocSizers;function distributeMin(sizers,i1,i2,minSize){if(!(i2<i1)){if(i1===i2){var sizer=sizers[i1];sizer.minSize=Math.max(sizer.minSize,minSize);return}for(var totalMin=0,i=i1;i<=i2;++i)totalMin+=sizers[i].minSize;if(!(totalMin>=minSize))for(var portion=(minSize-totalMin)/(i2-i1+1),i=i1;i<=i2;++i)sizers[i].minSize+=portion}}Private2.distributeMin=distributeMin;function onChildCellConfigChanged(child){child.parent&&child.parent.layout instanceof GridLayout&&child.parent.fit()}})(Private$4||(Private$4={}));var MenuBar=function(_super){__extends(MenuBar2,_super);function MenuBar2(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$3.createNode()})||this;return _this._activeIndex=-1,_this._tabFocusIndex=0,_this._menus=[],_this._childMenu=null,_this.addClass("lm-MenuBar"),_this.addClass("p-MenuBar"),_this.setFlag(Widget.Flag.DisallowLayout),_this.renderer=options.renderer||MenuBar2.defaultRenderer,_this._forceItemsPosition=options.forceItemsPosition||{forceX:!0,forceY:!0},_this}return MenuBar2.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(MenuBar2.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(value){this.activeIndex=value?this._menus.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(value){(value<0||value>=this._menus.length)&&(value=-1),this._activeIndex!==value&&(this._activeIndex=value,value!==-1&&(this._tabFocusIndex=value),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),MenuBar2.prototype.openActiveMenu=function(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},MenuBar2.prototype.addMenu=function(menu){this.insertMenu(this._menus.length,menu)},MenuBar2.prototype.insertMenu=function(index,menu){this._closeChildMenu();var i=this._menus.indexOf(menu),j=Math.max(0,Math.min(index,this._menus.length));if(i===-1){ArrayExt.insert(this._menus,j,menu),menu.addClass("lm-MenuBar-menu"),menu.addClass("p-MenuBar-menu"),menu.aboutToClose.connect(this._onMenuAboutToClose,this),menu.menuRequested.connect(this._onMenuMenuRequested,this),menu.title.changed.connect(this._onTitleChanged,this),this.update();return}j===this._menus.length&&j--,i!==j&&(ArrayExt.move(this._menus,i,j),this.update())},MenuBar2.prototype.removeMenu=function(menu){this.removeMenuAt(this._menus.indexOf(menu))},MenuBar2.prototype.removeMenuAt=function(index){this._closeChildMenu();var menu=ArrayExt.removeAt(this._menus,index);menu&&(menu.aboutToClose.disconnect(this._onMenuAboutToClose,this),menu.menuRequested.disconnect(this._onMenuMenuRequested,this),menu.title.changed.disconnect(this._onTitleChanged,this),menu.removeClass("lm-MenuBar-menu"),menu.removeClass("p-MenuBar-menu"),this.update())},MenuBar2.prototype.clearMenus=function(){if(this._menus.length!==0){this._closeChildMenu();for(var _i=0,_a=this._menus;_i<_a.length;_i++){var menu=_a[_i];menu.aboutToClose.disconnect(this._onMenuAboutToClose,this),menu.menuRequested.disconnect(this._onMenuMenuRequested,this),menu.title.changed.disconnect(this._onTitleChanged,this),menu.removeClass("lm-MenuBar-menu"),menu.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},MenuBar2.prototype.handleEvent=function(event){switch(event.type){case"keydown":this._evtKeyDown(event);break;case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseleave":this._evtMouseLeave(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},MenuBar2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},MenuBar2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},MenuBar2.prototype.onActivateRequest=function(msg){this.isAttached&&(this.activeIndex=0)},MenuBar2.prototype.onUpdateRequest=function(msg){for(var _this=this,menus=this._menus,renderer=this.renderer,activeIndex=this._activeIndex,tabFocusIndex=this._tabFocusIndex>=0&&this._tabFocusIndex<menus.length?this._tabFocusIndex:0,content=new Array(menus.length),_loop_1=function(i2,n2){var title=menus[i2].title,active=i2===activeIndex;active&&menus[i2].items.length==0&&(active=!1),content[i2]=renderer.renderItem({title,active,tabbable:i2===tabFocusIndex,onfocus:function(){_this.activeIndex=i2}})},i=0,n=menus.length;i<n;++i)_loop_1(i);VirtualDOM.render(content,this.contentNode)},MenuBar2.prototype._evtKeyDown=function(event){var kc=event.keyCode;if(kc===9){this.activeIndex=-1;return}if(event.preventDefault(),event.stopPropagation(),kc===13||kc===32||kc===38||kc===40){this.openActiveMenu();return}if(kc===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(kc===37){var i=this._activeIndex,n=this._menus.length;this.activeIndex=i===0?n-1:i-1;return}if(kc===39){var i=this._activeIndex,n=this._menus.length;this.activeIndex=i===n-1?0:i+1;return}var key=getKeyboardLayout().keyForKeydownEvent(event);if(key){var start=this._activeIndex+1,result=Private$3.findMnemonic(this._menus,key,start);result.index!==-1&&!result.multiple?(this.activeIndex=result.index,this.openActiveMenu()):result.index!==-1?this.activeIndex=result.index:result.auto!==-1&&(this.activeIndex=result.auto)}},MenuBar2.prototype._evtMouseDown=function(event){if(ElementExt.hitTest(this.node,event.clientX,event.clientY)){event.preventDefault(),event.stopPropagation(),event.stopImmediatePropagation();var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index===-1){this._closeChildMenu();return}if(event.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=index;else{var position=this._positionForMenu(index);Menu.saveWindowData(),this.activeIndex=index,this._openChildMenu(position)}}},MenuBar2.prototype._evtMouseMove=function(event){var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index!==this._activeIndex&&!(index===-1&&this._childMenu)){var position=this._positionForMenu(index);Menu.saveWindowData(),this.activeIndex=index,this._childMenu&&this._openChildMenu(position)}},MenuBar2.prototype._positionForMenu=function(index){var itemNode=this.contentNode.children[index],_a=itemNode.getBoundingClientRect(),left=_a.left,bottom=_a.bottom;return{top:bottom,left}},MenuBar2.prototype._evtMouseLeave=function(event){this._childMenu||(this.activeIndex=-1)},MenuBar2.prototype._openChildMenu=function(options){var _a;options===void 0&&(options={});var newMenu=this.activeMenu;if(!newMenu){this._closeChildMenu();return}var oldMenu=this._childMenu;if(oldMenu!==newMenu){this._childMenu=newMenu,oldMenu?oldMenu.close():document.addEventListener("mousedown",this,!0),MessageLoop.sendMessage(this,Widget.Msg.UpdateRequest);var left=options.left,top=options.top;(typeof left>"u"||typeof top>"u")&&(_a=this._positionForMenu(this._activeIndex),left=_a.left,top=_a.top),oldMenu||(this.addClass("lm-mod-active"),this.addClass("p-mod-active")),newMenu.items.length>0&&newMenu.open(left,top,this._forceItemsPosition)}},MenuBar2.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var menu=this._childMenu;this._childMenu=null,menu.close(),this.activeIndex=-1}},MenuBar2.prototype._onMenuAboutToClose=function(sender){sender===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},MenuBar2.prototype._onMenuMenuRequested=function(sender,args){if(sender===this._childMenu){var i=this._activeIndex,n=this._menus.length;switch(args){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=i===0?n-1:i-1;break}this.openActiveMenu()}},MenuBar2.prototype._onTitleChanged=function(){this.update()},MenuBar2}(Widget);(function(MenuBar2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data),aria=this.createItemARIA(data);return h.li(__assign({className,dataset,tabindex:data.tabbable?"0":"-1",onfocus:data.onfocus},aria),this.renderIcon(data),this.renderLabel(data))},Renderer2.prototype.renderIcon=function(data){var className=this.createIconClass(data);return typeof data.title.icon=="string"?h.div({className},data.title.iconLabel):h.div({className},data.title.icon,data.title.iconLabel)},Renderer2.prototype.renderLabel=function(data){var content=this.formatLabel(data);return h.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},content)},Renderer2.prototype.createItemClass=function(data){var name2="lm-MenuBar-item";return name2+=" p-MenuBar-item",data.title.className&&(name2+=" "+data.title.className),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active"),name2},Renderer2.prototype.createItemDataset=function(data){return data.title.dataset},Renderer2.prototype.createItemARIA=function(data){return{role:"menuitem","aria-haspopup":"true"}},Renderer2.prototype.createIconClass=function(data){var name2="lm-MenuBar-itemIcon";name2+=" p-MenuBar-itemIcon";var extra=data.title.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.formatLabel=function(data){var _a=data.title,label=_a.label,mnemonic=_a.mnemonic;if(mnemonic<0||mnemonic>=label.length)return label;var prefix=label.slice(0,mnemonic),suffix=label.slice(mnemonic+1),char=label[mnemonic],span=h.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},char);return[prefix,span,suffix]},Renderer2}();MenuBar2.Renderer=Renderer,MenuBar2.defaultRenderer=new Renderer})(MenuBar);var Private$3;(function(Private2){function createNode(){var node=document.createElement("div"),content=document.createElement("ul");return content.className="lm-MenuBar-content",content.classList.add("p-MenuBar-content"),node.appendChild(content),content.setAttribute("role","menubar"),node}Private2.createNode=createNode;function findMnemonic(menus,key,start){for(var index=-1,auto=-1,multiple=!1,upperKey=key.toUpperCase(),i=0,n=menus.length;i<n;++i){var k=(i+start)%n,title=menus[k].title;if(title.label.length!==0){var mn=title.mnemonic;if(mn>=0&&mn<title.label.length){title.label[mn].toUpperCase()===upperKey&&(index===-1?index=k:multiple=!0);continue}auto===-1&&title.label[0].toUpperCase()===upperKey&&(auto=k)}}return{index,multiple,auto}}Private2.findMnemonic=findMnemonic})(Private$3||(Private$3={})),function(_super){__extends(ScrollBar,_super);function ScrollBar(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$2.createNode()})||this;return _this._onRepeat=function(){if(_this._repeatTimer=-1,!!_this._pressData){var part=_this._pressData.part;if(part!=="thumb"){_this._repeatTimer=window.setTimeout(_this._onRepeat,20);var mouseX=_this._pressData.mouseX,mouseY=_this._pressData.mouseY;if(part==="decrement"){if(!ElementExt.hitTest(_this.decrementNode,mouseX,mouseY))return;_this._stepRequested.emit("decrement");return}if(part==="increment"){if(!ElementExt.hitTest(_this.incrementNode,mouseX,mouseY))return;_this._stepRequested.emit("increment");return}if(part==="track"){if(!ElementExt.hitTest(_this.trackNode,mouseX,mouseY))return;var thumbNode=_this.thumbNode;if(ElementExt.hitTest(thumbNode,mouseX,mouseY))return;var thumbRect=thumbNode.getBoundingClientRect(),dir=void 0;_this._orientation==="horizontal"?dir=mouseX<thumbRect.left?"decrement":"increment":dir=mouseY<thumbRect.top?"decrement":"increment",_this._pageRequested.emit(dir);return}}}},_this._value=0,_this._page=10,_this._maximum=100,_this._repeatTimer=-1,_this._pressData=null,_this._thumbMoved=new Signal(_this),_this._stepRequested=new Signal(_this),_this._pageRequested=new Signal(_this),_this.addClass("lm-ScrollBar"),_this.addClass("p-ScrollBar"),_this.setFlag(Widget.Flag.DisallowLayout),_this._orientation=options.orientation||"vertical",_this.dataset.orientation=_this._orientation,options.maximum!==void 0&&(_this._maximum=Math.max(0,options.maximum)),options.page!==void 0&&(_this._page=Math.max(0,options.page)),options.value!==void 0&&(_this._value=Math.max(0,Math.min(options.value,_this._maximum))),_this}return Object.defineProperty(ScrollBar.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._releaseMouse(),this._orientation=value,this.dataset.orientation=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"value",{get:function(){return this._value},set:function(value){value=Math.max(0,Math.min(value,this._maximum)),this._value!==value&&(this._value=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"page",{get:function(){return this._page},set:function(value){value=Math.max(0,value),this._page!==value&&(this._page=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"maximum",{get:function(){return this._maximum},set:function(value){value=Math.max(0,value),this._maximum!==value&&(this._maximum=value,this._value=Math.min(this._value,value),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),ScrollBar.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},ScrollBar.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.update()},ScrollBar.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this._releaseMouse()},ScrollBar.prototype.onUpdateRequest=function(msg){var value=this._value*100/this._maximum,page=this._page*100/(this._page+this._maximum);value=Math.max(0,Math.min(value,100)),page=Math.max(0,Math.min(page,100));var thumbStyle=this.thumbNode.style;this._orientation==="horizontal"?(thumbStyle.top="",thumbStyle.height="",thumbStyle.left=value+"%",thumbStyle.width=page+"%",thumbStyle.transform="translate("+-value+"%, 0%)"):(thumbStyle.left="",thumbStyle.width="",thumbStyle.top=value+"%",thumbStyle.height=page+"%",thumbStyle.transform="translate(0%, "+-value+"%)")},ScrollBar.prototype._evtKeyDown=function(event){if(event.preventDefault(),event.stopPropagation(),event.keyCode===27){var value=this._pressData?this._pressData.value:-1;this._releaseMouse(),value!==-1&&this._moveThumb(value)}},ScrollBar.prototype._evtMouseDown=function(event){if(event.button===0&&(this.activate(),!this._pressData)){var part=Private$2.findPart(this,event.target);if(part){event.preventDefault(),event.stopPropagation();var override=Drag.overrideCursor("default");if(this._pressData={part,override,delta:-1,value:-1,mouseX:event.clientX,mouseY:event.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),part==="thumb"){var thumbNode=this.thumbNode,thumbRect=thumbNode.getBoundingClientRect();this._orientation==="horizontal"?this._pressData.delta=event.clientX-thumbRect.left:this._pressData.delta=event.clientY-thumbRect.top,thumbNode.classList.add("lm-mod-active"),thumbNode.classList.add("p-mod-active"),this._pressData.value=this._value;return}if(part==="track"){var thumbRect=this.thumbNode.getBoundingClientRect(),dir=void 0;this._orientation==="horizontal"?dir=event.clientX<thumbRect.left?"decrement":"increment":dir=event.clientY<thumbRect.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),this._pageRequested.emit(dir);return}if(part==="decrement"){this.decrementNode.classList.add("lm-mod-active"),this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("decrement");return}if(part==="increment"){this.incrementNode.classList.add("lm-mod-active"),this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("increment");return}}}},ScrollBar.prototype._evtMouseMove=function(event){if(this._pressData&&(event.preventDefault(),event.stopPropagation(),this._pressData.mouseX=event.clientX,this._pressData.mouseY=event.clientY,this._pressData.part==="thumb")){var thumbRect=this.thumbNode.getBoundingClientRect(),trackRect=this.trackNode.getBoundingClientRect(),trackPos,trackSpan;this._orientation==="horizontal"?(trackPos=event.clientX-trackRect.left-this._pressData.delta,trackSpan=trackRect.width-thumbRect.width):(trackPos=event.clientY-trackRect.top-this._pressData.delta,trackSpan=trackRect.height-thumbRect.height);var value=trackSpan===0?0:trackPos*this._maximum/trackSpan;this._moveThumb(value)}},ScrollBar.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse())},ScrollBar.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("lm-mod-active"),this.decrementNode.classList.remove("lm-mod-active"),this.incrementNode.classList.remove("lm-mod-active"),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},ScrollBar.prototype._moveThumb=function(value){value=Math.max(0,Math.min(value,this._maximum)),this._value!==value&&(this._value=value,this.update(),this._thumbMoved.emit(value))},ScrollBar}(Widget);var Private$2;(function(Private2){function createNode(){var node=document.createElement("div"),decrement=document.createElement("div"),increment=document.createElement("div"),track=document.createElement("div"),thumb=document.createElement("div");return decrement.className="lm-ScrollBar-button",increment.className="lm-ScrollBar-button",decrement.dataset.action="decrement",increment.dataset.action="increment",track.className="lm-ScrollBar-track",thumb.className="lm-ScrollBar-thumb",decrement.classList.add("p-ScrollBar-button"),increment.classList.add("p-ScrollBar-button"),track.classList.add("p-ScrollBar-track"),thumb.classList.add("p-ScrollBar-thumb"),track.appendChild(thumb),node.appendChild(decrement),node.appendChild(track),node.appendChild(increment),node}Private2.createNode=createNode;function findPart(scrollBar,target){return scrollBar.thumbNode.contains(target)?"thumb":scrollBar.trackNode.contains(target)?"track":scrollBar.decrementNode.contains(target)?"decrement":scrollBar.incrementNode.contains(target)?"increment":null}Private2.findPart=findPart})(Private$2||(Private$2={})),function(_super){__extends(SingletonLayout,_super);function SingletonLayout(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._widget=null,_this}return SingletonLayout.prototype.dispose=function(){if(this._widget){var widget=this._widget;this._widget=null,widget.dispose()}_super.prototype.dispose.call(this)},Object.defineProperty(SingletonLayout.prototype,"widget",{get:function(){return this._widget},set:function(widget){widget&&(widget.parent=this.parent),this._widget!==widget&&(this._widget&&this._widget.dispose(),this._widget=widget,this.parent&&widget&&this.attachWidget(widget))},enumerable:!0,configurable:!0}),SingletonLayout.prototype.iter=function(){return this._widget?once(this._widget):empty()},SingletonLayout.prototype.removeWidget=function(widget){this._widget===widget&&(this._widget=null,this.parent&&this.detachWidget(widget))},SingletonLayout.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)})},SingletonLayout.prototype.attachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},SingletonLayout.prototype.detachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach)},SingletonLayout}(Layout);var StackedLayout=function(_super){__extends(StackedLayout2,_super);function StackedLayout2(options){options===void 0&&(options={});var _this=_super.call(this,options)||this;return _this._dirty=!1,_this._items=[],_this._box=null,_this._hiddenMode=options.hiddenMode!==void 0?options.hiddenMode:Widget.HiddenMode.Display,_this}return Object.defineProperty(StackedLayout2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(v){var _this=this;this._hiddenMode!==v&&(this._hiddenMode=v,this.widgets.length>1&&this.widgets.forEach(function(w){w.hiddenMode=_this._hiddenMode}))},enumerable:!0,configurable:!0}),StackedLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,_super.prototype.dispose.call(this)},StackedLayout2.prototype.attachWidget=function(index,widget){this._hiddenMode===Widget.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Widget.HiddenMode.Scale),widget.hiddenMode=Widget.HiddenMode.Scale):widget.hiddenMode=Widget.HiddenMode.Display,ArrayExt.insert(this._items,index,new LayoutItem(widget)),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},StackedLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),this.parent.update()},StackedLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index);this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.widget.node.style.zIndex="",this._hiddenMode===Widget.HiddenMode.Scale&&(widget.hiddenMode=Widget.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Widget.HiddenMode.Display)),item.dispose(),this.parent.fit()},StackedLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},StackedLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},StackedLayout2.prototype.onChildShown=function(msg){this.parent.fit()},StackedLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},StackedLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},StackedLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},StackedLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},StackedLayout2.prototype._fit=function(){for(var minW=0,minH=0,i=0,n=this._items.length;i<n;++i){var item=this._items[i];item.isHidden||(item.fit(),minW=Math.max(minW,item.minWidth),minH=Math.max(minH,item.minHeight))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},StackedLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(nVisible!==0){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));for(var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,i=0,n=this._items.length;i<n;++i){var item=this._items[i];item.isHidden||(item.widget.node.style.zIndex=""+i,item.update(left,top,width,height))}}},StackedLayout2}(PanelLayout),StackedPanel=function(_super){__extends(StackedPanel2,_super);function StackedPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$1.createLayout(options)})||this;return _this._widgetRemoved=new Signal(_this),_this.addClass("lm-StackedPanel"),_this.addClass("p-StackedPanel"),_this}return Object.defineProperty(StackedPanel2.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(v){this.layout.hiddenMode=v},enumerable:!0,configurable:!0}),Object.defineProperty(StackedPanel2.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),StackedPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-StackedPanel-child"),msg.child.addClass("p-StackedPanel-child")},StackedPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-StackedPanel-child"),msg.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(msg.child)},StackedPanel2}(Panel),Private$1;(function(Private2){function createLayout(options){return options.layout||new StackedLayout}Private2.createLayout=createLayout})(Private$1||(Private$1={}));var TabPanel$1=function(_super){__extends(TabPanel2,_super);function TabPanel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;_this._currentChanged=new Signal(_this),_this._addRequested=new Signal(_this),_this.addClass("lm-TabPanel"),_this.addClass("p-TabPanel"),_this.tabBar=new TabBar(options),_this.tabBar.addClass("lm-TabPanel-tabBar"),_this.stackedPanel=new StackedPanel,_this.stackedPanel.addClass("lm-TabPanel-stackedPanel"),_this.tabBar.addClass("p-TabPanel-tabBar"),_this.stackedPanel.addClass("p-TabPanel-stackedPanel"),_this.tabBar.tabMoved.connect(_this._onTabMoved,_this),_this.tabBar.currentChanged.connect(_this._onCurrentChanged,_this),_this.tabBar.tabCloseRequested.connect(_this._onTabCloseRequested,_this),_this.tabBar.tabActivateRequested.connect(_this._onTabActivateRequested,_this),_this.tabBar.addRequested.connect(_this._onTabAddRequested,_this),_this.stackedPanel.widgetRemoved.connect(_this._onWidgetRemoved,_this),_this._tabPlacement=options.tabPlacement||"top";var direction=Private.directionFromPlacement(_this._tabPlacement),orientation=Private.orientationFromPlacement(_this._tabPlacement);_this.tabBar.orientation=orientation,_this.tabBar.dataset.placement=_this._tabPlacement;var layout=new BoxLayout({direction,spacing:0});return BoxLayout.setStretch(_this.tabBar,0),BoxLayout.setStretch(_this.stackedPanel,1),layout.addWidget(_this.tabBar),layout.addWidget(_this.stackedPanel),_this.layout=layout,_this}return Object.defineProperty(TabPanel2.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(value){this.tabBar.currentIndex=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"currentWidget",{get:function(){var title=this.tabBar.currentTitle;return title?title.owner:null},set:function(value){this.tabBar.currentTitle=value?value.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(value){this.tabBar.tabsMovable=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(value){this.tabBar.addButtonEnabled=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(value){if(this._tabPlacement!==value){this._tabPlacement=value;var direction=Private.directionFromPlacement(value),orientation=Private.orientationFromPlacement(value);this.tabBar.orientation=orientation,this.tabBar.dataset.placement=value,this.layout.direction=direction}},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),TabPanel2.prototype.addWidget=function(widget){this.insertWidget(this.widgets.length,widget)},TabPanel2.prototype.insertWidget=function(index,widget){widget!==this.currentWidget&&widget.hide(),this.stackedPanel.insertWidget(index,widget),this.tabBar.insertTab(index,widget.title),widget.node.setAttribute("role","tabpanel");var renderer=this.tabBar.renderer;if(renderer instanceof TabBar.Renderer){var tabId=renderer.createTabKey({title:widget.title,current:!1,zIndex:0});widget.node.setAttribute("aria-labelledby",tabId)}},TabPanel2.prototype._onCurrentChanged=function(sender,args){var previousIndex=args.previousIndex,previousTitle=args.previousTitle,currentIndex=args.currentIndex,currentTitle=args.currentTitle,previousWidget=previousTitle?previousTitle.owner:null,currentWidget=currentTitle?currentTitle.owner:null;previousWidget&&previousWidget.hide(),currentWidget&&currentWidget.show(),this._currentChanged.emit({previousIndex,previousWidget,currentIndex,currentWidget}),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush()},TabPanel2.prototype._onTabAddRequested=function(sender,args){this._addRequested.emit(sender)},TabPanel2.prototype._onTabActivateRequested=function(sender,args){args.title.owner.activate()},TabPanel2.prototype._onTabCloseRequested=function(sender,args){args.title.owner.close()},TabPanel2.prototype._onTabMoved=function(sender,args){this.stackedPanel.insertWidget(args.toIndex,args.title.owner)},TabPanel2.prototype._onWidgetRemoved=function(sender,widget){widget.node.removeAttribute("role"),widget.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(widget.title)},TabPanel2}(Widget),Private;(function(Private2){function orientationFromPlacement(plc){return placementToOrientationMap[plc]}Private2.orientationFromPlacement=orientationFromPlacement;function directionFromPlacement(plc){return placementToDirectionMap[plc]}Private2.directionFromPlacement=directionFromPlacement;var placementToOrientationMap={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},placementToDirectionMap={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(Private||(Private={})),exports2.Msg=void 0,(Msg2=>{class WAConflatableMessage extends ConflatableMessage{constructor(wa,msg){super(msg);__publicField(this,"_wa");this._wa=wa}get wa(){return this._wa}conflate(other){return this._wa=other.wa,!0}}Msg2.WAConflatableMessage=WAConflatableMessage;const _WAActivateRequest=class _WAActivateRequest extends WAConflatableMessage{constructor(wa){super(wa,_WAActivateRequest.type)}};__publicField(_WAActivateRequest,"type","wa-activate-request");let WAActivateRequest=_WAActivateRequest;Msg2.WAActivateRequest=WAActivateRequest;const _WALayoutChanged=class _WALayoutChanged extends WAConflatableMessage{constructor(wa){super(wa,_WALayoutChanged.type)}};__publicField(_WALayoutChanged,"type","wa-layout-changed");let WALayoutChanged=_WALayoutChanged;Msg2.WALayoutChanged=WALayoutChanged})(exports2.Msg||(exports2.Msg={}));class WidgetAdapter extends Widget{constructor(owner,widget,lparam={},closable=!1,ext={}){super();__publicField(this,"_owner");__publicField(this,"_element");__publicField(this,"_widget");__publicField(this,"_widgetLayout");__publicField(this,"lparam",{});__publicField(this,"padding",0);__publicField(this,"_width",0);__publicField(this,"_height",0);__publicField(this,"_ext");__publicField(this,"_closable");this._owner=owner,this._element=common.select(this.node),this.addClass("phosphor_WidgetAdapter"),this.title.label="",this.title.closable=!!closable,this.title.caption=`Long description for: ${name}`,this._ext=ext,typeof closable=="boolean"?this._closable={canClose(e,wa){return closable}}:this._closable=closable,widget instanceof common.Widget?this._widget=widget.target(this.node):this._widgetLayout=widget,this.lparam=lparam}get widget(){return this._widget}get inputNode(){return this.node.getElementsByTagName("input")[0]}resizeAndRender(){this._widget&&(common.select(this.node).style("padding",this.padding+"px").style("width",this._width+"px").style("height",this._height+"px").style("overflow-x",this._ext.overflowX).style("overflow-y",this._ext.overflowY),this._widget.resize({width:this._width-this.padding*2-2,height:this._height-this.padding*2-2}).lazyRender(),this._owner&&MessageLoop.postMessage(this._owner,new exports2.Msg.WALayoutChanged(this)))}onActivateRequest(msg){super.onActivateRequest(msg),this._widget&&this.resizeAndRender(),this._owner&&MessageLoop.postMessage(this._owner,new exports2.Msg.WAActivateRequest(this))}onResize(msg){super.onResize(msg),this.node&&this.node.offsetParent!==null&&msg.width>=0&&msg.height>=0?(this._width=msg.width,this._height=msg.height,this.resizeAndRender()):this._widgetLayout}onCloseRequest(msg){this._closable.canClose(this._widget,this)&&this.dispose()}}class WidgetAdapterArray extends Array{constructor(items){super(...items)}static create(){return Object.create(WidgetAdapterArray.prototype)}watchRendered(w,callback){if(!callback)return;const content=this.map(wa=>({wa,w:wa.widget,rc:wa.widget.renderCount()})),intervalHandle=setInterval(()=>{complete()&&(clearInterval(intervalHandle),callback(w))},20);function complete(){for(const item of content)if(item.wa.isVisible&&item.rc>=item.w.renderCount())return!1;return!0}}}class PRenderer extends DockPanel$1.Renderer{constructor(){super();__publicField(this,"_owner")}createTabBar(){const bar=super.createTabBar();return bar.tabsMovable=this._owner.tabsMovable,bar}}class PDockPanel extends DockPanel$1{constructor(options={}){options.renderer=options.renderer||new PRenderer;super(options);__publicField(this,"_content");__publicField(this,"_contentMap");this._renderer instanceof PRenderer&&(this._renderer._owner=this),this._content=WidgetAdapterArray.create(),this._contentMap={}}appendContent(wa){this._content.push(wa),this._contentMap[wa.widget.id()]=wa}removeContent(wa){const idx=this._content.indexOf(wa);idx>=0&&this._content.splice(idx,1),delete this._contentMap[wa.widget.id()],wa.dispose()}content(){return this._content}serializeWidget(widget){if(widget instanceof WidgetAdapter)try{return{__id:widget.widget.id()}}catch(e){return{exception:{message:e.message??"",stack:e.stack??[]}}}return null}deserializeWidget(layout){let wa=this._contentMap[layout.__id];return wa||(wa=new WidgetAdapter(void 0,layout)),wa}serializeITabAreaConfig(config,deserialize){return{...config,widgets:config.widgets.map(widget=>deserialize?this.deserializeWidget(widget):this.serializeWidget(widget))}}serializeISplitAreaConfig(config,deserialize){return{...config,children:config.children.map(child=>this.serializeAreaConfig(child,deserialize))}}serializeAreaConfig(config,deserialize){if(config)switch(config.type){case"tab-area":return this.serializeITabAreaConfig(config,deserialize);case"split-area":return this.serializeISplitAreaConfig(config,deserialize)}}saveLayout(){return{main:this.serializeAreaConfig(super.saveLayout().main,!1)}}restoreLayout(config){return super.restoreLayout({main:this.serializeAreaConfig(config.main,!0)})}}class DockPanel extends common.HTMLWidget{constructor(){super();__publicField(this,"_dock",new PDockPanel({mode:"multiple-document"}));__publicField(this,"_layoutObj",null);__publicField(this,"_pPlaceholder");__publicField(this,"_prevHideSingleTabs");__publicField(this,"_lazyLayoutChanged",common.Utility.debounce(async()=>{this.layoutChanged()},1e3));__publicField(this,"_prevActive");this._tag="div",this._dock.id="p"+this.id(),MessageLoop.installMessageHook(this,this)}getWidgetAdapter(widget){let retVal=null;return this._dock.content().some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget,title,location="split-right",refWidget,closable,padding=8){const addMode={mode:location,ref:this.getWidgetAdapter(refWidget)},wa=new WidgetAdapter(this,widget,{},closable);return wa.title.label=title,wa.padding=padding,this._dock.addWidget(wa,addMode),this._dock.appendContent(wa),this._dock.tabsMovable=!0,this}removeWidget(widget){const wa=this.getWidgetAdapter(widget);return wa&&(widget.target(null),this._dock.removeContent(wa)),this}isVisible(widget){return this.getWidgetAdapter(widget).isVisible}widgetAdapters(){return this._dock.content()}widgets(){return this._dock.content().map(wa=>wa.widget)}layout(_){return arguments.length?(this._dock.restoreLayout(_),this):this._dock.saveLayout()}layoutObj(_){return this._layoutObj=_,this}enter(domNode,element){super.enter(domNode,element),this._pPlaceholder=element.append("div"),Widget.attach(this._dock,this._pPlaceholder.node())}update(domNode,element){super.update(domNode,element),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","auto"),element.select(".p-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach(w=>w.render())}exit(domNode,element){[...this.widgets()].forEach(w=>this.removeWidget(w)),Widget.detach(this._dock),super.exit(domNode,element)}render(callback){const context=this;return this._layoutObj!==null&&(this.layout(this._layoutObj),this.layoutObj(null)),super.render(w=>{this._dock.content().watchRendered(this,callback),this._dock.update(),setTimeout(()=>{const tabBars=this.element().selectAll(".p-Widget.p-TabBar.p-DockPanel-tabBar");let refit=!1;tabBars.each(function(){const tabBar=common.select(this),tabsCount=tabBar.node().childNodes[0].childNodes.length,hide=context.hideSingleTabs()&&tabsCount===1;hide!==tabBar.classed("hide")&&(tabBar.classed("hide",hide),refit=!0)}),refit&&this._dock.fit()},0)})}refit(){this._dock.fit()}messageHook(handler,msg){return handler===this&&this.processMessage(msg),!0}processMessage(msg){switch(msg.type){case exports2.Msg.WAActivateRequest.type:const wa=msg.wa,widget=wa.widget;this._prevActive!==widget&&(this._prevActive=widget,this.childActivation(widget,wa));break;case exports2.Msg.WALayoutChanged.type:this._lazyLayoutChanged();break}}active(){return this._prevActive}childActivation(w,wa){}layoutChanged(){}}DockPanel.prototype._class+=" phosphor_DockPanel",DockPanel.prototype.publish("hideSingleTabs",!1,"boolean");class SplitPanel extends common.HTMLWidget{constructor(orientation="vertical"){super();__publicField(this,"_split");__publicField(this,"content",WidgetAdapterArray.create());this._split=new SplitPanel$1({orientation}),this._tag="div",this._split.id="p"+this.id()}getWidgetAdapter(widget){let retVal=null;return this.content.some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget){const wa=new WidgetAdapter(this,widget);return this._split.addWidget(wa),this.content.push(wa),this}relativeSizes(_){return arguments.length?(this._split.setRelativeSizes(_),this):this._split.relativeSizes()}enter(domNode,element){super.enter(domNode,element),Widget.attach(this._split,domNode)}update(domNode,element){super.update(domNode,element),element.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(domNode,element){Widget.detach(this._split),super.exit(domNode,element)}render(callback){return super.render(w=>{this.content.watchRendered(this,callback),this._split.update()})}}SplitPanel.prototype._class+=" phosphor_SplitPanel";class TabPanel extends common.HTMLWidget{constructor(){super();__publicField(this,"_tab",new TabPanel$1({tabPlacement:"top"}));__publicField(this,"content",WidgetAdapterArray.create());__publicField(this,"_prevActive");this._tag="div",this._tab.id="p"+this.id()}getWidget(wa){if(wa instanceof WidgetAdapter)return wa.widget}getWidgetAdapter(widget){let retVal=null;return this.content.some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget,title,ext={}){this._prevActive||(this._prevActive=widget);const wa=new WidgetAdapter(this,widget,void 0,void 0,ext);return wa.title.label=title,wa.padding=8,this._tab.addWidget(wa),this.content.push(wa),this}removeWidget(widget){const wa=this.getWidgetAdapter(widget);if(wa){const found=this.content.indexOf(wa);found>=0&&this.content.splice(found,1),widget.target(null),wa.dispose()}return this}enter(domNode,element){super.enter(domNode,element),Widget.attach(this._tab,domNode)}update(domNode,element){super.update(domNode,element),element.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(domNode,element){Widget.detach(this._tab),super.exit(domNode,element)}render(callback){return super.render(w=>{this.content.watchRendered(this,callback),this._tab.update()})}messageHook(handler,msg){return handler===this&&this.processMessage(msg),!0}processMessage(msg){switch(msg.type){case"wa-activate-request":const widget=msg.wa.widget;this._prevActive!==widget&&(this._prevActive=widget,this.childActivation(widget));break}}childActivation(w){}active(_){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(_),this):this.getWidget(this._tab.currentWidget)}}TabPanel.prototype._class+=" phosphor_TabPanel",exports2.BUILD_VERSION=BUILD_VERSION,exports2.CommandPalette=CommandPalette,exports2.CommandRegistry=CommandRegistry,exports2.ContextMenu=ContextMenu,exports2.DockPanel=DockPanel,exports2.PKG_NAME=PKG_NAME,exports2.PKG_VERSION=PKG_VERSION,exports2.SplitPanel=SplitPanel,exports2.TabPanel=TabPanel,exports2.WidgetAdapter=WidgetAdapter,exports2.WidgetAdapterArray=WidgetAdapterArray,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
66
+ ***************************************************************************** */var extendStatics=function(d,b){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d2,b2){d2.__proto__=b2}||function(d2,b2){for(var p in b2)Object.prototype.hasOwnProperty.call(b2,p)&&(d2[p]=b2[p])},extendStatics(d,b)};function __extends(d,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");extendStatics(d,b);function __(){this.constructor=d}d.prototype=b===null?Object.create(b):(__.prototype=b.prototype,new __)}var __assign=function(){return __assign=Object.assign||function(t){for(var s,i=1,n=arguments.length;i<n;i++){s=arguments[i];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(t[p]=s[p])}return t},__assign.apply(this,arguments)};function __rest(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t}function __spreadArrays(){for(var s=0,i=0,il=arguments.length;i<il;i++)s+=arguments[i].length;for(var r=Array(s),k=0,i=0;i<il;i++)for(var a=arguments[i],j=0,jl=a.length;j<jl;j++,k++)r[k]=a[j];return r}var BoxSizer=function(){function BoxSizer2(){this.sizeHint=0,this.minSize=0,this.maxSize=1/0,this.stretch=1,this.size=0,this.done=!1}return BoxSizer2}(),BoxEngine;(function(BoxEngine2){function calc(sizers,space){var count=sizers.length;if(count===0)return space;for(var totalMin=0,totalMax=0,totalSize=0,totalStretch=0,stretchCount=0,i=0;i<count;++i){var sizer=sizers[i],min=sizer.minSize,max2=sizer.maxSize,hint=sizer.sizeHint;sizer.done=!1,sizer.size=Math.max(min,Math.min(hint,max2)),totalSize+=sizer.size,totalMin+=min,totalMax+=max2,sizer.stretch>0&&(totalStretch+=sizer.stretch,stretchCount++)}if(space===totalSize)return 0;if(space<=totalMin){for(var i=0;i<count;++i){var sizer=sizers[i];sizer.size=sizer.minSize}return space-totalMin}if(space>=totalMax){for(var i=0;i<count;++i){var sizer=sizers[i];sizer.size=sizer.maxSize}return space-totalMax}var nearZero=.01,notDoneCount=count;if(space<totalSize){for(var freeSpace=totalSize-space;stretchCount>0&&freeSpace>nearZero;)for(var distSpace=freeSpace,distStretch=totalStretch,i=0;i<count;++i){var sizer=sizers[i];if(!(sizer.done||sizer.stretch===0)){var amt=sizer.stretch*distSpace/distStretch;sizer.size-amt<=sizer.minSize?(freeSpace-=sizer.size-sizer.minSize,totalStretch-=sizer.stretch,sizer.size=sizer.minSize,sizer.done=!0,notDoneCount--,stretchCount--):(freeSpace-=amt,sizer.size-=amt)}}for(;notDoneCount>0&&freeSpace>nearZero;)for(var amt=freeSpace/notDoneCount,i=0;i<count;++i){var sizer=sizers[i];sizer.done||(sizer.size-amt<=sizer.minSize?(freeSpace-=sizer.size-sizer.minSize,sizer.size=sizer.minSize,sizer.done=!0,notDoneCount--):(freeSpace-=amt,sizer.size-=amt))}}else{for(var freeSpace=space-totalSize;stretchCount>0&&freeSpace>nearZero;)for(var distSpace=freeSpace,distStretch=totalStretch,i=0;i<count;++i){var sizer=sizers[i];if(!(sizer.done||sizer.stretch===0)){var amt=sizer.stretch*distSpace/distStretch;sizer.size+amt>=sizer.maxSize?(freeSpace-=sizer.maxSize-sizer.size,totalStretch-=sizer.stretch,sizer.size=sizer.maxSize,sizer.done=!0,notDoneCount--,stretchCount--):(freeSpace-=amt,sizer.size+=amt)}}for(;notDoneCount>0&&freeSpace>nearZero;)for(var amt=freeSpace/notDoneCount,i=0;i<count;++i){var sizer=sizers[i];sizer.done||(sizer.size+amt>=sizer.maxSize?(freeSpace-=sizer.maxSize-sizer.size,sizer.size=sizer.maxSize,sizer.done=!0,notDoneCount--):(freeSpace-=amt,sizer.size+=amt))}}return 0}BoxEngine2.calc=calc;function adjust(sizers,index,delta){sizers.length===0||delta===0||(delta>0?growSizer(sizers,index,delta):shrinkSizer(sizers,index,-delta))}BoxEngine2.adjust=adjust;function growSizer(sizers,index,delta){for(var growLimit=0,i=0;i<=index;++i){var sizer=sizers[i];growLimit+=sizer.maxSize-sizer.size}for(var shrinkLimit=0,i=index+1,n=sizers.length;i<n;++i){var sizer=sizers[i];shrinkLimit+=sizer.size-sizer.minSize}delta=Math.min(delta,growLimit,shrinkLimit);for(var grow=delta,i=index;i>=0&&grow>0;--i){var sizer=sizers[i],limit=sizer.maxSize-sizer.size;limit>=grow?(sizer.sizeHint=sizer.size+grow,grow=0):(sizer.sizeHint=sizer.size+limit,grow-=limit)}for(var shrink=delta,i=index+1,n=sizers.length;i<n&&shrink>0;++i){var sizer=sizers[i],limit=sizer.size-sizer.minSize;limit>=shrink?(sizer.sizeHint=sizer.size-shrink,shrink=0):(sizer.sizeHint=sizer.size-limit,shrink-=limit)}}function shrinkSizer(sizers,index,delta){for(var growLimit=0,i=index+1,n=sizers.length;i<n;++i){var sizer=sizers[i];growLimit+=sizer.maxSize-sizer.size}for(var shrinkLimit=0,i=0;i<=index;++i){var sizer=sizers[i];shrinkLimit+=sizer.size-sizer.minSize}delta=Math.min(delta,growLimit,shrinkLimit);for(var grow=delta,i=index+1,n=sizers.length;i<n&&grow>0;++i){var sizer=sizers[i],limit=sizer.maxSize-sizer.size;limit>=grow?(sizer.sizeHint=sizer.size+grow,grow=0):(sizer.sizeHint=sizer.size+limit,grow-=limit)}for(var shrink=delta,i=index;i>=0&&shrink>0;--i){var sizer=sizers[i],limit=sizer.size-sizer.minSize;limit>=shrink?(sizer.sizeHint=sizer.size-shrink,shrink=0):(sizer.sizeHint=sizer.size-limit,shrink-=limit)}}})(BoxEngine||(BoxEngine={}));var Title=function(){function Title2(options){this._label="",this._caption="",this._mnemonic=-1,this._iconClass="",this._iconLabel="",this._className="",this._closable=!1,this._changed=new Signal(this),this._isDisposed=!1,this.owner=options.owner,options.label!==void 0&&(this._label=options.label),options.mnemonic!==void 0&&(this._mnemonic=options.mnemonic),options.icon!==void 0?typeof options.icon=="string"?(this._icon=null,this._iconClass=options.icon):this._icon=options.icon:this._icon=null,options.iconClass!==void 0&&(this._iconClass=options.iconClass),options.iconLabel!==void 0&&(this._iconLabel=options.iconLabel),options.iconRenderer!==void 0&&(this._icon=options.iconRenderer),options.caption!==void 0&&(this._caption=options.caption),options.className!==void 0&&(this._className=options.className),options.closable!==void 0&&(this._closable=options.closable),this._dataset=options.dataset||{}}return Object.defineProperty(Title2.prototype,"changed",{get:function(){return this._changed},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"label",{get:function(){return this._label},set:function(value){this._label!==value&&(this._label=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"mnemonic",{get:function(){return this._mnemonic},set:function(value){this._mnemonic!==value&&(this._mnemonic=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"icon",{get:function(){return this._icon===null?this.iconClass:this._icon},set:function(value){if(typeof value=="string")this._icon=null,this.iconClass=value;else{if(this._icon===value)return;this._icon=value,this._changed.emit(void 0)}},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconClass",{get:function(){return this._iconClass},set:function(value){this._iconClass!==value&&(this._iconClass=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconLabel",{get:function(){return this._iconLabel},set:function(value){this._iconLabel!==value&&(this._iconLabel=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"iconRenderer",{get:function(){return this._icon||void 0},set:function(value){this.icon=value},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"caption",{get:function(){return this._caption},set:function(value){this._caption!==value&&(this._caption=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"className",{get:function(){return this._className},set:function(value){this._className!==value&&(this._className=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"closable",{get:function(){return this._closable},set:function(value){this._closable!==value&&(this._closable=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"dataset",{get:function(){return this._dataset},set:function(value){this._dataset!==value&&(this._dataset=value,this._changed.emit(void 0))},enumerable:!0,configurable:!0}),Object.defineProperty(Title2.prototype,"isDisposed",{get:function(){return this._isDisposed},enumerable:!0,configurable:!0}),Title2.prototype.dispose=function(){this.isDisposed||(this._isDisposed=!0,Signal.clearData(this))},Title2}(),Widget=function(){function Widget2(options){options===void 0&&(options={}),this._flags=0,this._layout=null,this._parent=null,this._disposed=new Signal(this),this._hiddenMode=Widget2.HiddenMode.Display,this.node=Private$j.createNode(options),this.addClass("lm-Widget"),this.addClass("p-Widget")}return Widget2.prototype.dispose=function(){this.isDisposed||(this.setFlag(Widget2.Flag.IsDisposed),this._disposed.emit(void 0),this.parent?this.parent=null:this.isAttached&&Widget2.detach(this),this._layout&&(this._layout.dispose(),this._layout=null),this.title.dispose(),Signal.clearData(this),MessageLoop.clearData(this),AttachedProperty.clearData(this))},Object.defineProperty(Widget2.prototype,"disposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isDisposed",{get:function(){return this.testFlag(Widget2.Flag.IsDisposed)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isAttached",{get:function(){return this.testFlag(Widget2.Flag.IsAttached)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isHidden",{get:function(){return this.testFlag(Widget2.Flag.IsHidden)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"isVisible",{get:function(){return this.testFlag(Widget2.Flag.IsVisible)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"title",{get:function(){return Private$j.titleProperty.get(this)},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"id",{get:function(){return this.node.id},set:function(value){this.node.id=value},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"dataset",{get:function(){return this.node.dataset},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(value){this._hiddenMode!==value&&(this.isHidden&&this._toggleHidden(!1),value==Widget2.HiddenMode.Scale?this.node.style.willChange="transform":this.node.style.willChange="auto",this._hiddenMode=value,this.isHidden&&this._toggleHidden(!0))},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"parent",{get:function(){return this._parent},set:function(value){if(this._parent!==value){if(value&&this.contains(value))throw new Error("Invalid parent widget.");if(this._parent&&!this._parent.isDisposed){var msg=new Widget2.ChildMessage("child-removed",this);MessageLoop.sendMessage(this._parent,msg)}if(this._parent=value,this._parent&&!this._parent.isDisposed){var msg=new Widget2.ChildMessage("child-added",this);MessageLoop.sendMessage(this._parent,msg)}this.isDisposed||MessageLoop.sendMessage(this,Widget2.Msg.ParentChanged)}},enumerable:!0,configurable:!0}),Object.defineProperty(Widget2.prototype,"layout",{get:function(){return this._layout},set:function(value){if(this._layout!==value){if(this.testFlag(Widget2.Flag.DisallowLayout))throw new Error("Cannot set widget layout.");if(this._layout)throw new Error("Cannot change widget layout.");if(value.parent)throw new Error("Cannot change layout parent.");this._layout=value,value.parent=this}},enumerable:!0,configurable:!0}),Widget2.prototype.children=function(){return this._layout?this._layout.iter():empty()},Widget2.prototype.contains=function(widget){for(var value=widget;value;value=value._parent)if(value===this)return!0;return!1},Widget2.prototype.hasClass=function(name2){return this.node.classList.contains(name2)},Widget2.prototype.addClass=function(name2){this.node.classList.add(name2)},Widget2.prototype.removeClass=function(name2){this.node.classList.remove(name2)},Widget2.prototype.toggleClass=function(name2,force){return force===!0?(this.node.classList.add(name2),!0):force===!1?(this.node.classList.remove(name2),!1):this.node.classList.toggle(name2)},Widget2.prototype.update=function(){MessageLoop.postMessage(this,Widget2.Msg.UpdateRequest)},Widget2.prototype.fit=function(){MessageLoop.postMessage(this,Widget2.Msg.FitRequest)},Widget2.prototype.activate=function(){MessageLoop.postMessage(this,Widget2.Msg.ActivateRequest)},Widget2.prototype.close=function(){MessageLoop.sendMessage(this,Widget2.Msg.CloseRequest)},Widget2.prototype.show=function(){if(this.testFlag(Widget2.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.BeforeShow),this.clearFlag(Widget2.Flag.IsHidden),this.node.removeAttribute("aria-hidden"),this._toggleHidden(!1),this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.AfterShow),this.parent)){var msg=new Widget2.ChildMessage("child-shown",this);MessageLoop.sendMessage(this.parent,msg)}},Widget2.prototype.hide=function(){if(!this.testFlag(Widget2.Flag.IsHidden)&&(this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.BeforeHide),this.setFlag(Widget2.Flag.IsHidden),this.node.setAttribute("aria-hidden","true"),this._toggleHidden(!0),this.isAttached&&(!this.parent||this.parent.isVisible)&&MessageLoop.sendMessage(this,Widget2.Msg.AfterHide),this.parent)){var msg=new Widget2.ChildMessage("child-hidden",this);MessageLoop.sendMessage(this.parent,msg)}},Widget2.prototype.setHidden=function(hidden){hidden?this.hide():this.show()},Widget2.prototype.testFlag=function(flag){return(this._flags&flag)!==0},Widget2.prototype.setFlag=function(flag){this._flags|=flag},Widget2.prototype.clearFlag=function(flag){this._flags&=~flag},Widget2.prototype.processMessage=function(msg){switch(msg.type){case"resize":this.notifyLayout(msg),this.onResize(msg);break;case"update-request":this.notifyLayout(msg),this.onUpdateRequest(msg);break;case"fit-request":this.notifyLayout(msg),this.onFitRequest(msg);break;case"before-show":this.notifyLayout(msg),this.onBeforeShow(msg);break;case"after-show":this.setFlag(Widget2.Flag.IsVisible),this.notifyLayout(msg),this.onAfterShow(msg);break;case"before-hide":this.notifyLayout(msg),this.onBeforeHide(msg);break;case"after-hide":this.clearFlag(Widget2.Flag.IsVisible),this.notifyLayout(msg),this.onAfterHide(msg);break;case"before-attach":this.notifyLayout(msg),this.onBeforeAttach(msg);break;case"after-attach":!this.isHidden&&(!this.parent||this.parent.isVisible)&&this.setFlag(Widget2.Flag.IsVisible),this.setFlag(Widget2.Flag.IsAttached),this.notifyLayout(msg),this.onAfterAttach(msg);break;case"before-detach":this.notifyLayout(msg),this.onBeforeDetach(msg);break;case"after-detach":this.clearFlag(Widget2.Flag.IsVisible),this.clearFlag(Widget2.Flag.IsAttached),this.notifyLayout(msg),this.onAfterDetach(msg);break;case"activate-request":this.notifyLayout(msg),this.onActivateRequest(msg);break;case"close-request":this.notifyLayout(msg),this.onCloseRequest(msg);break;case"child-added":this.notifyLayout(msg),this.onChildAdded(msg);break;case"child-removed":this.notifyLayout(msg),this.onChildRemoved(msg);break;default:this.notifyLayout(msg);break}},Widget2.prototype.notifyLayout=function(msg){this._layout&&this._layout.processParentMessage(msg)},Widget2.prototype.onCloseRequest=function(msg){this.parent?this.parent=null:this.isAttached&&Widget2.detach(this)},Widget2.prototype.onResize=function(msg){},Widget2.prototype.onUpdateRequest=function(msg){},Widget2.prototype.onFitRequest=function(msg){},Widget2.prototype.onActivateRequest=function(msg){},Widget2.prototype.onBeforeShow=function(msg){},Widget2.prototype.onAfterShow=function(msg){},Widget2.prototype.onBeforeHide=function(msg){},Widget2.prototype.onAfterHide=function(msg){},Widget2.prototype.onBeforeAttach=function(msg){},Widget2.prototype.onAfterAttach=function(msg){},Widget2.prototype.onBeforeDetach=function(msg){},Widget2.prototype.onAfterDetach=function(msg){},Widget2.prototype.onChildAdded=function(msg){},Widget2.prototype.onChildRemoved=function(msg){},Widget2.prototype._toggleHidden=function(hidden){if(hidden)switch(this._hiddenMode){case Widget2.HiddenMode.Display:this.addClass("lm-mod-hidden"),this.addClass("p-mod-hidden");break;case Widget2.HiddenMode.Scale:this.node.style.transform="scale(0)";break;case Widget2.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden",this.node.style.zIndex="-1";break}else switch(this._hiddenMode){case Widget2.HiddenMode.Display:this.removeClass("lm-mod-hidden"),this.removeClass("p-mod-hidden");break;case Widget2.HiddenMode.Scale:this.node.style.transform="";break;case Widget2.HiddenMode.ContentVisibility:this.node.style.contentVisibility="",this.node.style.zIndex="";break}},Widget2}();(function(Widget2){(function(HiddenMode){HiddenMode[HiddenMode.Display=0]="Display",HiddenMode[HiddenMode.Scale=1]="Scale",HiddenMode[HiddenMode.ContentVisibility=2]="ContentVisibility"})(Widget2.HiddenMode||(Widget2.HiddenMode={})),function(Flag){Flag[Flag.IsDisposed=1]="IsDisposed",Flag[Flag.IsAttached=2]="IsAttached",Flag[Flag.IsHidden=4]="IsHidden",Flag[Flag.IsVisible=8]="IsVisible",Flag[Flag.DisallowLayout=16]="DisallowLayout"}(Widget2.Flag||(Widget2.Flag={})),function(Msg){Msg.BeforeShow=new Message("before-show"),Msg.AfterShow=new Message("after-show"),Msg.BeforeHide=new Message("before-hide"),Msg.AfterHide=new Message("after-hide"),Msg.BeforeAttach=new Message("before-attach"),Msg.AfterAttach=new Message("after-attach"),Msg.BeforeDetach=new Message("before-detach"),Msg.AfterDetach=new Message("after-detach"),Msg.ParentChanged=new Message("parent-changed"),Msg.UpdateRequest=new ConflatableMessage("update-request"),Msg.FitRequest=new ConflatableMessage("fit-request"),Msg.ActivateRequest=new ConflatableMessage("activate-request"),Msg.CloseRequest=new ConflatableMessage("close-request")}(Widget2.Msg||(Widget2.Msg={}));var ChildMessage=function(_super){__extends(ChildMessage2,_super);function ChildMessage2(type,child){var _this=_super.call(this,type)||this;return _this.child=child,_this}return ChildMessage2}(Message);Widget2.ChildMessage=ChildMessage;var ResizeMessage=function(_super){__extends(ResizeMessage2,_super);function ResizeMessage2(width,height){var _this=_super.call(this,"resize")||this;return _this.width=width,_this.height=height,_this}return ResizeMessage2}(Message);Widget2.ResizeMessage=ResizeMessage,function(ResizeMessage2){ResizeMessage2.UnknownSize=new ResizeMessage2(-1,-1)}(ResizeMessage=Widget2.ResizeMessage||(Widget2.ResizeMessage={}));function attach(widget,host,ref){if(ref===void 0&&(ref=null),widget.parent)throw new Error("Cannot attach a child widget.");if(widget.isAttached||widget.node.isConnected)throw new Error("Widget is already attached.");if(!host.isConnected)throw new Error("Host is not attached.");MessageLoop.sendMessage(widget,Widget2.Msg.BeforeAttach),host.insertBefore(widget.node,ref),MessageLoop.sendMessage(widget,Widget2.Msg.AfterAttach)}Widget2.attach=attach;function detach(widget){if(widget.parent)throw new Error("Cannot detach a child widget.");if(!widget.isAttached||!widget.node.isConnected)throw new Error("Widget is not attached.");MessageLoop.sendMessage(widget,Widget2.Msg.BeforeDetach),widget.node.parentNode.removeChild(widget.node),MessageLoop.sendMessage(widget,Widget2.Msg.AfterDetach)}Widget2.detach=detach})(Widget||(Widget={}));var Private$j;(function(Private2){Private2.titleProperty=new AttachedProperty({name:"title",create:function(owner){return new Title({owner})}});function createNode(options){return options.node||document.createElement(options.tag||"div")}Private2.createNode=createNode})(Private$j||(Private$j={}));var Layout=function(){function Layout2(options){options===void 0&&(options={}),this._disposed=!1,this._parent=null,this._fitPolicy=options.fitPolicy||"set-min-size"}return Layout2.prototype.dispose=function(){this._parent=null,this._disposed=!0,Signal.clearData(this),AttachedProperty.clearData(this)},Object.defineProperty(Layout2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(Layout2.prototype,"parent",{get:function(){return this._parent},set:function(value){if(this._parent!==value){if(this._parent)throw new Error("Cannot change parent widget.");if(value.layout!==this)throw new Error("Invalid parent widget.");this._parent=value,this.init()}},enumerable:!0,configurable:!0}),Object.defineProperty(Layout2.prototype,"fitPolicy",{get:function(){return this._fitPolicy},set:function(value){if(this._fitPolicy!==value&&(this._fitPolicy=value,this._parent)){var style=this._parent.node.style;style.minWidth="",style.minHeight="",style.maxWidth="",style.maxHeight="",this._parent.fit()}},enumerable:!0,configurable:!0}),Layout2.prototype.processParentMessage=function(msg){switch(msg.type){case"resize":this.onResize(msg);break;case"update-request":this.onUpdateRequest(msg);break;case"fit-request":this.onFitRequest(msg);break;case"before-show":this.onBeforeShow(msg);break;case"after-show":this.onAfterShow(msg);break;case"before-hide":this.onBeforeHide(msg);break;case"after-hide":this.onAfterHide(msg);break;case"before-attach":this.onBeforeAttach(msg);break;case"after-attach":this.onAfterAttach(msg);break;case"before-detach":this.onBeforeDetach(msg);break;case"after-detach":this.onAfterDetach(msg);break;case"child-removed":this.onChildRemoved(msg);break;case"child-shown":this.onChildShown(msg);break;case"child-hidden":this.onChildHidden(msg);break}},Layout2.prototype.init=function(){var _this=this;each(this,function(widget){widget.parent=_this.parent})},Layout2.prototype.onResize=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,Widget.ResizeMessage.UnknownSize)})},Layout2.prototype.onUpdateRequest=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,Widget.ResizeMessage.UnknownSize)})},Layout2.prototype.onBeforeAttach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterAttach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeDetach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterDetach=function(msg){each(this,function(widget){MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeShow=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterShow=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onBeforeHide=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onAfterHide=function(msg){each(this,function(widget){widget.isHidden||MessageLoop.sendMessage(widget,msg)})},Layout2.prototype.onChildRemoved=function(msg){this.removeWidget(msg.child)},Layout2.prototype.onFitRequest=function(msg){},Layout2.prototype.onChildShown=function(msg){},Layout2.prototype.onChildHidden=function(msg){},Layout2}();(function(Layout2){function getHorizontalAlignment(widget){return Private$i.horizontalAlignmentProperty.get(widget)}Layout2.getHorizontalAlignment=getHorizontalAlignment;function setHorizontalAlignment(widget,value){Private$i.horizontalAlignmentProperty.set(widget,value)}Layout2.setHorizontalAlignment=setHorizontalAlignment;function getVerticalAlignment(widget){return Private$i.verticalAlignmentProperty.get(widget)}Layout2.getVerticalAlignment=getVerticalAlignment;function setVerticalAlignment(widget,value){Private$i.verticalAlignmentProperty.set(widget,value)}Layout2.setVerticalAlignment=setVerticalAlignment})(Layout||(Layout={}));var LayoutItem=function(){function LayoutItem2(widget){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=widget,this.widget.node.style.position="absolute"}return LayoutItem2.prototype.dispose=function(){if(!this._disposed){this._disposed=!0;var style=this.widget.node.style;style.position="",style.top="",style.left="",style.width="",style.height=""}},Object.defineProperty(LayoutItem2.prototype,"minWidth",{get:function(){return this._minWidth},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"minHeight",{get:function(){return this._minHeight},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"maxWidth",{get:function(){return this._maxWidth},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"maxHeight",{get:function(){return this._maxHeight},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isDisposed",{get:function(){return this._disposed},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isHidden",{get:function(){return this.widget.isHidden},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isVisible",{get:function(){return this.widget.isVisible},enumerable:!0,configurable:!0}),Object.defineProperty(LayoutItem2.prototype,"isAttached",{get:function(){return this.widget.isAttached},enumerable:!0,configurable:!0}),LayoutItem2.prototype.fit=function(){var limits=ElementExt.sizeLimits(this.widget.node);this._minWidth=limits.minWidth,this._minHeight=limits.minHeight,this._maxWidth=limits.maxWidth,this._maxHeight=limits.maxHeight},LayoutItem2.prototype.update=function(left,top,width,height){var clampW=Math.max(this._minWidth,Math.min(width,this._maxWidth)),clampH=Math.max(this._minHeight,Math.min(height,this._maxHeight));if(clampW<width)switch(Layout.getHorizontalAlignment(this.widget)){case"left":break;case"center":left+=(width-clampW)/2;break;case"right":left+=width-clampW;break;default:throw"unreachable"}if(clampH<height)switch(Layout.getVerticalAlignment(this.widget)){case"top":break;case"center":top+=(height-clampH)/2;break;case"bottom":top+=height-clampH;break;default:throw"unreachable"}var resized=!1,style=this.widget.node.style;if(this._top!==top&&(this._top=top,style.top=top+"px"),this._left!==left&&(this._left=left,style.left=left+"px"),this._width!==clampW&&(resized=!0,this._width=clampW,style.width=clampW+"px"),this._height!==clampH&&(resized=!0,this._height=clampH,style.height=clampH+"px"),resized){var msg=new Widget.ResizeMessage(clampW,clampH);MessageLoop.sendMessage(this.widget,msg)}},LayoutItem2}(),Private$i;(function(Private2){Private2.horizontalAlignmentProperty=new AttachedProperty({name:"horizontalAlignment",create:function(){return"center"},changed:onAlignmentChanged}),Private2.verticalAlignmentProperty=new AttachedProperty({name:"verticalAlignment",create:function(){return"top"},changed:onAlignmentChanged});function onAlignmentChanged(child){child.parent&&child.parent.layout&&child.parent.update()}})(Private$i||(Private$i={}));var PanelLayout=function(_super){__extends(PanelLayout2,_super);function PanelLayout2(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._widgets=[],_this}return PanelLayout2.prototype.dispose=function(){for(;this._widgets.length>0;)this._widgets.pop().dispose();_super.prototype.dispose.call(this)},Object.defineProperty(PanelLayout2.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),PanelLayout2.prototype.iter=function(){return iter(this._widgets)},PanelLayout2.prototype.addWidget=function(widget){this.insertWidget(this._widgets.length,widget)},PanelLayout2.prototype.insertWidget=function(index,widget){widget.parent=this.parent;var i=this._widgets.indexOf(widget),j=Math.max(0,Math.min(index,this._widgets.length));if(i===-1){ArrayExt.insert(this._widgets,j,widget),this.parent&&this.attachWidget(j,widget);return}j===this._widgets.length&&j--,i!==j&&(ArrayExt.move(this._widgets,i,j),this.parent&&this.moveWidget(i,j,widget))},PanelLayout2.prototype.removeWidget=function(widget){this.removeWidgetAt(this._widgets.indexOf(widget))},PanelLayout2.prototype.removeWidgetAt=function(index){var widget=ArrayExt.removeAt(this._widgets,index);widget&&this.parent&&this.detachWidget(index,widget)},PanelLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget,index){_this.attachWidget(index,widget)})},PanelLayout2.prototype.attachWidget=function(index,widget){var ref=this.parent.node.children[index];this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.insertBefore(widget.node,ref),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},PanelLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach);var ref=this.parent.node.children[toIndex];this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.insertBefore(widget.node,ref),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},PanelLayout2.prototype.detachWidget=function(index,widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach)},PanelLayout2}(Layout),Utils;(function(Utils2){function clampDimension(value){return Math.max(0,Math.floor(value))}Utils2.clampDimension=clampDimension})(Utils||(Utils={}));var Utils$1=Utils,SplitLayout=function(_super){__extends(SplitLayout2,_super);function SplitLayout2(options){var _this=_super.call(this)||this;return _this.widgetOffset=0,_this._fixed=0,_this._spacing=4,_this._dirty=!1,_this._hasNormedSizes=!1,_this._sizers=[],_this._items=[],_this._handles=[],_this._box=null,_this._alignment="start",_this._orientation="horizontal",_this.renderer=options.renderer,options.orientation!==void 0&&(_this._orientation=options.orientation),options.alignment!==void 0&&(_this._alignment=options.alignment),options.spacing!==void 0&&(_this._spacing=Utils.clampDimension(options.spacing)),_this}return SplitLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,this._handles.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(SplitLayout2.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._orientation=value,this.parent&&(this.parent.dataset.orientation=value,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"alignment",{get:function(){return this._alignment},set:function(value){this._alignment!==value&&(this._alignment=value,this.parent&&(this.parent.dataset.alignment=value,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(SplitLayout2.prototype,"handles",{get:function(){return this._handles},enumerable:!0,configurable:!0}),SplitLayout2.prototype.absoluteSizes=function(){return this._sizers.map(function(sizer){return sizer.size})},SplitLayout2.prototype.relativeSizes=function(){return Private$h.normalize(this._sizers.map(function(sizer){return sizer.size}))},SplitLayout2.prototype.setRelativeSizes=function(sizes,update){update===void 0&&(update=!0);for(var n=this._sizers.length,temp=sizes.slice(0,n);temp.length<n;)temp.push(0);for(var normed=Private$h.normalize(temp),i=0;i<n;++i){var sizer=this._sizers[i];sizer.sizeHint=normed[i],sizer.size=normed[i]}this._hasNormedSizes=!0,update&&this.parent&&this.parent.update()},SplitLayout2.prototype.moveHandle=function(index,position){var handle=this._handles[index];if(!(!handle||handle.classList.contains("lm-mod-hidden"))){var delta;if(this._orientation==="horizontal"?delta=position-handle.offsetLeft:delta=position-handle.offsetTop,delta!==0){for(var _i=0,_a=this._sizers;_i<_a.length;_i++){var sizer=_a[_i];sizer.size>0&&(sizer.sizeHint=sizer.size)}BoxEngine.adjust(this._sizers,index,delta),this.parent&&this.parent.update()}}},SplitLayout2.prototype.init=function(){this.parent.dataset.orientation=this.orientation,this.parent.dataset.alignment=this.alignment,_super.prototype.init.call(this)},SplitLayout2.prototype.attachWidget=function(index,widget){var item=new LayoutItem(widget),handle=Private$h.createHandle(this.renderer),average=Private$h.averageSize(this._sizers),sizer=Private$h.createSizer(average);ArrayExt.insert(this._items,index,item),ArrayExt.insert(this._sizers,index,sizer),ArrayExt.insert(this._handles,index,handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.node.appendChild(handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},SplitLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),ArrayExt.move(this._sizers,fromIndex,toIndex),ArrayExt.move(this._handles,fromIndex,toIndex),this.parent.fit()},SplitLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index),handle=ArrayExt.removeAt(this._handles,index);ArrayExt.removeAt(this._sizers,index),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.node.removeChild(handle),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.dispose(),this.parent.fit()},SplitLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},SplitLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},SplitLayout2.prototype.onChildShown=function(msg){this.parent.fit()},SplitLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},SplitLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},SplitLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},SplitLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},SplitLayout2.prototype.updateItemPosition=function(i,isHorizontal,left,top,height,width,size){var item=this._items[i];if(!item.isHidden){var handleStyle=this._handles[i].style;isHorizontal?(left+=this.widgetOffset,item.update(left,top,size,height),left+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=this._spacing+"px",handleStyle.height=height+"px"):(top+=this.widgetOffset,item.update(left,top,width,size),top+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=width+"px",handleStyle.height=this._spacing+"px")}},SplitLayout2.prototype._fit=function(){for(var nVisible=0,lastHandleIndex=-1,i=0,n=this._items.length;i<n;++i)this._items[i].isHidden?(this._handles[i].classList.add("lm-mod-hidden"),this._handles[i].classList.add("p-mod-hidden")):(this._handles[i].classList.remove("lm-mod-hidden"),this._handles[i].classList.remove("p-mod-hidden"),lastHandleIndex=i,nVisible++);lastHandleIndex!==-1&&(this._handles[lastHandleIndex].classList.add("lm-mod-hidden"),this._handles[lastHandleIndex].classList.add("p-mod-hidden")),this._fixed=this._spacing*Math.max(0,nVisible-1)+this.widgetOffset*this._items.length;for(var horz=this._orientation==="horizontal",minW=horz?this._fixed:0,minH=horz?0:this._fixed,i=0,n=this._items.length;i<n;++i){var item=this._items[i],sizer=this._sizers[i];if(sizer.size>0&&(sizer.sizeHint=sizer.size),item.isHidden){sizer.minSize=0,sizer.maxSize=0;continue}item.fit(),sizer.stretch=SplitLayout2.getStretch(item.widget),horz?(sizer.minSize=item.minWidth,sizer.maxSize=item.maxWidth,minW+=item.minWidth,minH=Math.max(minH,item.minHeight)):(sizer.minSize=item.minHeight,sizer.maxSize=item.maxHeight,minH+=item.minHeight,minW=Math.max(minW,item.minWidth))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},SplitLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(!(nVisible===0&&this.widgetOffset===0)){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,extra=0,offset=0,horz=this._orientation==="horizontal";if(nVisible>0){var space=void 0;if(horz?space=Math.max(0,width-this._fixed):space=Math.max(0,height-this._fixed),this._hasNormedSizes){for(var _i=0,_a=this._sizers;_i<_a.length;_i++){var sizer=_a[_i];sizer.sizeHint*=space}this._hasNormedSizes=!1}var delta=BoxEngine.calc(this._sizers,space);if(delta>0)switch(this._alignment){case"start":break;case"center":extra=0,offset=delta/2;break;case"end":extra=0,offset=delta;break;case"justify":extra=delta/nVisible,offset=0;break;default:throw"unreachable"}}for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i],size=item.isHidden?0:this._sizers[i].size+extra;this.updateItemPosition(i,horz,horz?left+offset:left,horz?top:top+offset,height,width,size);var fullOffset=this.widgetOffset+(this._handles[i].classList.contains("lm-mod-hidden")?0:this._spacing);horz?left+=size+fullOffset:top+=size+fullOffset}}},SplitLayout2}(PanelLayout);(function(SplitLayout2){function getStretch(widget){return Private$h.stretchProperty.get(widget)}SplitLayout2.getStretch=getStretch;function setStretch(widget,value){Private$h.stretchProperty.set(widget,value)}SplitLayout2.setStretch=setStretch})(SplitLayout||(SplitLayout={}));var Private$h;(function(Private2){Private2.stretchProperty=new AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged});function createSizer(size){var sizer=new BoxSizer;return sizer.sizeHint=Math.floor(size),sizer}Private2.createSizer=createSizer;function createHandle(renderer){var handle=renderer.createHandle();return handle.style.position="absolute",handle}Private2.createHandle=createHandle;function averageSize(sizers){return sizers.reduce(function(v,s){return v+s.size},0)/sizers.length||0}Private2.averageSize=averageSize;function normalize(values){var n=values.length;if(n===0)return[];var sum=values.reduce(function(a,b){return a+Math.abs(b)},0);return sum===0?values.map(function(v){return 1/n}):values.map(function(v){return v/sum})}Private2.normalize=normalize;function onChildSizingChanged(child){child.parent&&child.parent.layout instanceof SplitLayout&&child.parent.fit()}})(Private$h||(Private$h={}));var AccordionLayout=function(_super){__extends(AccordionLayout2,_super);function AccordionLayout2(options){var _this=_super.call(this,__assign(__assign({},options),{orientation:options.orientation||"vertical"}))||this;return _this._titles=[],_this.titleSpace=options.titleSpace||22,_this}return Object.defineProperty(AccordionLayout2.prototype,"titleSpace",{get:function(){return this.widgetOffset},set:function(value){value=Utils$1.clampDimension(value),this.widgetOffset!==value&&(this.widgetOffset=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionLayout2.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),AccordionLayout2.prototype.dispose=function(){this.isDisposed||(this._titles.length=0,_super.prototype.dispose.call(this))},AccordionLayout2.prototype.updateTitle=function(index,widget){var oldTitle=this._titles[index],expanded=oldTitle.classList.contains("lm-mod-expanded"),newTitle=Private$g.createTitle(this.renderer,widget.title,expanded);this._titles[index]=newTitle,this.parent.node.replaceChild(newTitle,oldTitle)},AccordionLayout2.prototype.attachWidget=function(index,widget){var title=Private$g.createTitle(this.renderer,widget.title);ArrayExt.insert(this._titles,index,title),this.parent.node.appendChild(title),widget.node.setAttribute("role","region"),widget.node.setAttribute("aria-labelledby",title.id),_super.prototype.attachWidget.call(this,index,widget)},AccordionLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._titles,fromIndex,toIndex),_super.prototype.moveWidget.call(this,fromIndex,toIndex,widget)},AccordionLayout2.prototype.detachWidget=function(index,widget){var title=ArrayExt.removeAt(this._titles,index);this.parent.node.removeChild(title),_super.prototype.detachWidget.call(this,index,widget)},AccordionLayout2.prototype.updateItemPosition=function(i,isHorizontal,left,top,height,width,size){var titleStyle=this._titles[i].style;titleStyle.top=top+"px",titleStyle.left=left+"px",titleStyle.height=this.widgetOffset+"px",isHorizontal?titleStyle.width=height+"px":titleStyle.width=width+"px",_super.prototype.updateItemPosition.call(this,i,isHorizontal,left,top,height,width,size)},AccordionLayout2}(SplitLayout),Private$g;(function(Private2){function createTitle(renderer,data,expanded){expanded===void 0&&(expanded=!0);var title=renderer.createSectionTitle(data);return title.style.position="absolute",title.setAttribute("aria-label",data.label+" Section"),title.setAttribute("aria-expanded",expanded?"true":"false"),title.setAttribute("aria-controls",data.owner.id),expanded&&title.classList.add("lm-mod-expanded"),title}Private2.createTitle=createTitle})(Private$g||(Private$g={}));var Panel=function(_super){__extends(Panel2,_super);function Panel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;return _this.addClass("lm-Panel"),_this.addClass("p-Panel"),_this.layout=Private$f.createLayout(options),_this}return Object.defineProperty(Panel2.prototype,"widgets",{get:function(){return this.layout.widgets},enumerable:!0,configurable:!0}),Panel2.prototype.addWidget=function(widget){this.layout.addWidget(widget)},Panel2.prototype.insertWidget=function(index,widget){this.layout.insertWidget(index,widget)},Panel2}(Widget),Private$f;(function(Private2){function createLayout(options){return options.layout||new PanelLayout}Private2.createLayout=createLayout})(Private$f||(Private$f={}));var SplitPanel$1=function(_super){__extends(SplitPanel2,_super);function SplitPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$e.createLayout(options)})||this;return _this._handleMoved=new Signal(_this),_this._pressData=null,_this.addClass("lm-SplitPanel"),_this.addClass("p-SplitPanel"),_this}return SplitPanel2.prototype.dispose=function(){this._releaseMouse(),_super.prototype.dispose.call(this)},Object.defineProperty(SplitPanel2.prototype,"orientation",{get:function(){return this.layout.orientation},set:function(value){this.layout.orientation=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(value){this.layout.alignment=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"handleMoved",{get:function(){return this._handleMoved},enumerable:!0,configurable:!0}),Object.defineProperty(SplitPanel2.prototype,"handles",{get:function(){return this.layout.handles},enumerable:!0,configurable:!0}),SplitPanel2.prototype.relativeSizes=function(){return this.layout.relativeSizes()},SplitPanel2.prototype.setRelativeSizes=function(sizes,update){update===void 0&&(update=!0),this.layout.setRelativeSizes(sizes,update)},SplitPanel2.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},SplitPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},SplitPanel2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},SplitPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-SplitPanel-child"),msg.child.addClass("p-SplitPanel-child"),this._releaseMouse()},SplitPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-SplitPanel-child"),msg.child.removeClass("p-SplitPanel-child"),this._releaseMouse()},SplitPanel2.prototype._evtKeyDown=function(event){this._pressData&&(event.preventDefault(),event.stopPropagation()),event.keyCode===27&&this._releaseMouse()},SplitPanel2.prototype._evtMouseDown=function(event){if(event.button===0){var layout=this.layout,index=ArrayExt.findFirstIndex(layout.handles,function(handle2){return handle2.contains(event.target)});if(index!==-1){event.preventDefault(),event.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 delta,handle=layout.handles[index],rect=handle.getBoundingClientRect();layout.orientation==="horizontal"?delta=event.clientX-rect.left:delta=event.clientY-rect.top;var style=window.getComputedStyle(handle),override=Drag.overrideCursor(style.cursor);this._pressData={index,delta,override}}}},SplitPanel2.prototype._evtMouseMove=function(event){event.preventDefault(),event.stopPropagation();var pos,layout=this.layout,rect=this.node.getBoundingClientRect();layout.orientation==="horizontal"?pos=event.clientX-rect.left-this._pressData.delta:pos=event.clientY-rect.top-this._pressData.delta,layout.moveHandle(this._pressData.index,pos)},SplitPanel2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse())},SplitPanel2.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))},SplitPanel2}(Panel);(function(SplitPanel2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.createHandle=function(){var handle=document.createElement("div");return handle.className="lm-SplitPanel-handle",handle.classList.add("p-SplitPanel-handle"),handle},Renderer2}();SplitPanel2.Renderer=Renderer,SplitPanel2.defaultRenderer=new Renderer;function getStretch(widget){return SplitLayout.getStretch(widget)}SplitPanel2.getStretch=getStretch;function setStretch(widget,value){SplitLayout.setStretch(widget,value)}SplitPanel2.setStretch=setStretch})(SplitPanel$1||(SplitPanel$1={}));var Private$e;(function(Private2){function createLayout(options){return options.layout||new SplitLayout({renderer:options.renderer||SplitPanel$1.defaultRenderer,orientation:options.orientation,alignment:options.alignment,spacing:options.spacing})}Private2.createLayout=createLayout})(Private$e||(Private$e={}));var AccordionPanel=function(_super){__extends(AccordionPanel2,_super);function AccordionPanel2(options){options===void 0&&(options={});var _this=_super.call(this,__assign(__assign({},options),{layout:Private$d.createLayout(options)}))||this;return _this._widgetSizesCache=new WeakMap,_this.addClass("lm-AccordionPanel"),_this}return Object.defineProperty(AccordionPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionPanel2.prototype,"titleSpace",{get:function(){return this.layout.titleSpace},set:function(value){this.layout.titleSpace=value},enumerable:!0,configurable:!0}),Object.defineProperty(AccordionPanel2.prototype,"titles",{get:function(){return this.layout.titles},enumerable:!0,configurable:!0}),AccordionPanel2.prototype.addWidget=function(widget){_super.prototype.addWidget.call(this,widget),widget.title.changed.connect(this._onTitleChanged,this)},AccordionPanel2.prototype.collapse=function(index){var widget=this.layout.widgets[index];widget&&!widget.isHidden&&this._toggleExpansion(index)},AccordionPanel2.prototype.expand=function(index){var widget=this.layout.widgets[index];widget&&widget.isHidden&&this._toggleExpansion(index)},AccordionPanel2.prototype.insertWidget=function(index,widget){_super.prototype.insertWidget.call(this,index,widget),widget.title.changed.connect(this._onTitleChanged,this)},AccordionPanel2.prototype.handleEvent=function(event){switch(_super.prototype.handleEvent.call(this,event),event.type){case"click":this._evtClick(event);break;case"keydown":this._eventKeyDown(event);break}},AccordionPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),_super.prototype.onBeforeAttach.call(this,msg)},AccordionPanel2.prototype.onAfterDetach=function(msg){_super.prototype.onAfterDetach.call(this,msg),this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this)},AccordionPanel2.prototype._onTitleChanged=function(sender){var index=ArrayExt.findFirstIndex(this.widgets,function(widget){return widget.contains(sender.owner)});index>=0&&(this.layout.updateTitle(index,sender.owner),this.update())},AccordionPanel2.prototype._computeWidgetSize=function(index){var layout=this.layout,widget=layout.widgets[index];if(widget){var isHidden=widget.isHidden,widgetSizes=layout.absoluteSizes(),delta=(isHidden?-1:1)*this.spacing,totalSize=widgetSizes.reduce(function(prev,curr){return prev+curr}),newSize=__spreadArrays(widgetSizes);if(isHidden){var previousSize_1=this._widgetSizesCache.get(widget);if(!previousSize_1)return;newSize[index]+=previousSize_1;var widgetToCollapse=newSize.map(function(sz){return sz-previousSize_1>0}).lastIndexOf(!0);widgetToCollapse===-1?newSize.forEach(function(_,idx){idx!==index&&(newSize[idx]-=widgetSizes[idx]/totalSize*(previousSize_1-delta))}):newSize[widgetToCollapse]-=previousSize_1-delta}else{var currentSize=widgetSizes[index];this._widgetSizesCache.set(widget,currentSize),newSize[index]=0;var widgetToCollapse=newSize.map(function(sz){return sz>0}).lastIndexOf(!0);if(widgetToCollapse===-1)return;newSize[widgetToCollapse]=widgetSizes[widgetToCollapse]+currentSize+delta}return newSize.map(function(sz){return sz/(totalSize+delta)})}},AccordionPanel2.prototype._evtClick=function(event){var target=event.target;if(target){var index=ArrayExt.findFirstIndex(this.titles,function(title){return title.contains(target)});index>=0&&(event.preventDefault(),event.stopPropagation(),this._toggleExpansion(index))}},AccordionPanel2.prototype._eventKeyDown=function(event){if(!event.defaultPrevented){var target=event.target,handled=!1;if(target){var index=ArrayExt.findFirstIndex(this.titles,function(title){return title.contains(target)});if(index>=0){var keyCode=event.keyCode.toString();if(event.key.match(/Space|Enter/)||keyCode.match(/13|32/))target.click(),handled=!0;else if(this.orientation==="horizontal"?event.key.match(/ArrowLeft|ArrowRight/)||keyCode.match(/37|39/):event.key.match(/ArrowUp|ArrowDown/)||keyCode.match(/38|40/)){var direction=event.key.match(/ArrowLeft|ArrowUp/)||keyCode.match(/37|38/)?-1:1,length_1=this.titles.length,newIndex=(index+length_1+direction)%length_1;this.titles[newIndex].focus(),handled=!0}else event.key==="End"||keyCode==="35"?(this.titles[this.titles.length-1].focus(),handled=!0):(event.key==="Home"||keyCode==="36")&&(this.titles[0].focus(),handled=!0)}handled&&event.preventDefault()}}},AccordionPanel2.prototype._toggleExpansion=function(index){var title=this.titles[index],widget=this.layout.widgets[index],newSize=this._computeWidgetSize(index);newSize&&this.setRelativeSizes(newSize,!1),widget.isHidden?(title.classList.add("lm-mod-expanded"),title.setAttribute("aria-expanded","true"),widget.show()):(title.classList.remove("lm-mod-expanded"),title.setAttribute("aria-expanded","false"),widget.hide())},AccordionPanel2}(SplitPanel$1);(function(AccordionPanel2){var Renderer=function(_super){__extends(Renderer2,_super);function Renderer2(){var _this=_super.call(this)||this;return _this.titleClassName="lm-AccordionPanel-title",_this._titleID=0,_this._titleKeys=new WeakMap,_this._uuid=++Renderer2._nInstance,_this}return Renderer2.prototype.createCollapseIcon=function(data){return document.createElement("span")},Renderer2.prototype.createSectionTitle=function(data){var handle=document.createElement("h3");handle.setAttribute("role","button"),handle.setAttribute("tabindex","0"),handle.id=this.createTitleKey(data),handle.className=this.titleClassName;for(var aData in data.dataset)handle.dataset[aData]=data.dataset[aData];var collapser=handle.appendChild(this.createCollapseIcon(data));collapser.className="lm-AccordionPanel-titleCollapser";var label=handle.appendChild(document.createElement("span"));return label.className="lm-AccordionPanel-titleLabel",label.textContent=data.label,label.title=data.caption||data.label,handle},Renderer2.prototype.createTitleKey=function(data){var key=this._titleKeys.get(data);return key===void 0&&(key="title-key-"+this._uuid+"-"+this._titleID++,this._titleKeys.set(data,key)),key},Renderer2._nInstance=0,Renderer2}(SplitPanel$1.Renderer);AccordionPanel2.Renderer=Renderer,AccordionPanel2.defaultRenderer=new Renderer})(AccordionPanel||(AccordionPanel={}));var Private$d;(function(Private2){function createLayout(options){return options.layout||new AccordionLayout({renderer:options.renderer||AccordionPanel.defaultRenderer,orientation:options.orientation,alignment:options.alignment,spacing:options.spacing,titleSpace:options.titleSpace})}Private2.createLayout=createLayout})(Private$d||(Private$d={}));var BoxLayout=function(_super){__extends(BoxLayout2,_super);function BoxLayout2(options){options===void 0&&(options={});var _this=_super.call(this)||this;return _this._fixed=0,_this._spacing=4,_this._dirty=!1,_this._sizers=[],_this._items=[],_this._box=null,_this._alignment="start",_this._direction="top-to-bottom",options.direction!==void 0&&(_this._direction=options.direction),options.alignment!==void 0&&(_this._alignment=options.alignment),options.spacing!==void 0&&(_this._spacing=Utils$1.clampDimension(options.spacing)),_this}return BoxLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,this._sizers.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(BoxLayout2.prototype,"direction",{get:function(){return this._direction},set:function(value){this._direction!==value&&(this._direction=value,this.parent&&(this.parent.dataset.direction=value,this.parent.fit()))},enumerable:!0,configurable:!0}),Object.defineProperty(BoxLayout2.prototype,"alignment",{get:function(){return this._alignment},set:function(value){this._alignment!==value&&(this._alignment=value,this.parent&&(this.parent.dataset.alignment=value,this.parent.update()))},enumerable:!0,configurable:!0}),Object.defineProperty(BoxLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils$1.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),BoxLayout2.prototype.init=function(){this.parent.dataset.direction=this.direction,this.parent.dataset.alignment=this.alignment,_super.prototype.init.call(this)},BoxLayout2.prototype.attachWidget=function(index,widget){ArrayExt.insert(this._items,index,new LayoutItem(widget)),ArrayExt.insert(this._sizers,index,new BoxSizer),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},BoxLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),ArrayExt.move(this._sizers,fromIndex,toIndex),this.parent.update()},BoxLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index);ArrayExt.removeAt(this._sizers,index),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.dispose(),this.parent.fit()},BoxLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},BoxLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},BoxLayout2.prototype.onChildShown=function(msg){this.parent.fit()},BoxLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},BoxLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},BoxLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},BoxLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},BoxLayout2.prototype._fit=function(){for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;this._fixed=this._spacing*Math.max(0,nVisible-1);for(var horz=Private$c.isHorizontal(this._direction),minW=horz?this._fixed:0,minH=horz?0:this._fixed,i=0,n=this._items.length;i<n;++i){var item=this._items[i],sizer=this._sizers[i];if(item.isHidden){sizer.minSize=0,sizer.maxSize=0;continue}item.fit(),sizer.sizeHint=BoxLayout2.getSizeBasis(item.widget),sizer.stretch=BoxLayout2.getStretch(item.widget),horz?(sizer.minSize=item.minWidth,sizer.maxSize=item.maxWidth,minW+=item.minWidth,minH=Math.max(minH,item.minHeight)):(sizer.minSize=item.minHeight,sizer.maxSize=item.maxHeight,minH+=item.minHeight,minW=Math.max(minW,item.minWidth))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},BoxLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(nVisible!==0){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,delta;switch(this._direction){case"left-to-right":delta=BoxEngine.calc(this._sizers,Math.max(0,width-this._fixed));break;case"top-to-bottom":delta=BoxEngine.calc(this._sizers,Math.max(0,height-this._fixed));break;case"right-to-left":delta=BoxEngine.calc(this._sizers,Math.max(0,width-this._fixed)),left+=width;break;case"bottom-to-top":delta=BoxEngine.calc(this._sizers,Math.max(0,height-this._fixed)),top+=height;break;default:throw"unreachable"}var extra=0,offset=0;if(delta>0)switch(this._alignment){case"start":break;case"center":extra=0,offset=delta/2;break;case"end":extra=0,offset=delta;break;case"justify":extra=delta/nVisible,offset=0;break;default:throw"unreachable"}for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i];if(!item.isHidden){var size=this._sizers[i].size;switch(this._direction){case"left-to-right":item.update(left+offset,top,size+extra,height),left+=size+extra+this._spacing;break;case"top-to-bottom":item.update(left,top+offset,width,size+extra),top+=size+extra+this._spacing;break;case"right-to-left":item.update(left-offset-size-extra,top,size+extra,height),left-=size+extra+this._spacing;break;case"bottom-to-top":item.update(left,top-offset-size-extra,width,size+extra),top-=size+extra+this._spacing;break;default:throw"unreachable"}}}}},BoxLayout2}(PanelLayout);(function(BoxLayout2){function getStretch(widget){return Private$c.stretchProperty.get(widget)}BoxLayout2.getStretch=getStretch;function setStretch(widget,value){Private$c.stretchProperty.set(widget,value)}BoxLayout2.setStretch=setStretch;function getSizeBasis(widget){return Private$c.sizeBasisProperty.get(widget)}BoxLayout2.getSizeBasis=getSizeBasis;function setSizeBasis(widget,value){Private$c.sizeBasisProperty.set(widget,value)}BoxLayout2.setSizeBasis=setSizeBasis})(BoxLayout||(BoxLayout={}));var Private$c;(function(Private2){Private2.stretchProperty=new AttachedProperty({name:"stretch",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged}),Private2.sizeBasisProperty=new AttachedProperty({name:"sizeBasis",create:function(){return 0},coerce:function(owner,value){return Math.max(0,Math.floor(value))},changed:onChildSizingChanged});function isHorizontal(dir){return dir==="left-to-right"||dir==="right-to-left"}Private2.isHorizontal=isHorizontal;function clampSpacing(value){return Math.max(0,Math.floor(value))}Private2.clampSpacing=clampSpacing;function onChildSizingChanged(child){child.parent&&child.parent.layout instanceof BoxLayout&&child.parent.fit()}})(Private$c||(Private$c={}));var BoxPanel=function(_super){__extends(BoxPanel2,_super);function BoxPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$b.createLayout(options)})||this;return _this.addClass("lm-BoxPanel"),_this.addClass("p-BoxPanel"),_this}return Object.defineProperty(BoxPanel2.prototype,"direction",{get:function(){return this.layout.direction},set:function(value){this.layout.direction=value},enumerable:!0,configurable:!0}),Object.defineProperty(BoxPanel2.prototype,"alignment",{get:function(){return this.layout.alignment},set:function(value){this.layout.alignment=value},enumerable:!0,configurable:!0}),Object.defineProperty(BoxPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),BoxPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-BoxPanel-child"),msg.child.addClass("p-BoxPanel-child")},BoxPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-BoxPanel-child"),msg.child.removeClass("p-BoxPanel-child")},BoxPanel2}(Panel);(function(BoxPanel2){function getStretch(widget){return BoxLayout.getStretch(widget)}BoxPanel2.getStretch=getStretch;function setStretch(widget,value){BoxLayout.setStretch(widget,value)}BoxPanel2.setStretch=setStretch;function getSizeBasis(widget){return BoxLayout.getSizeBasis(widget)}BoxPanel2.getSizeBasis=getSizeBasis;function setSizeBasis(widget,value){BoxLayout.setSizeBasis(widget,value)}BoxPanel2.setSizeBasis=setSizeBasis})(BoxPanel||(BoxPanel={}));var Private$b;(function(Private2){function createLayout(options){return options.layout||new BoxLayout(options)}Private2.createLayout=createLayout})(Private$b||(Private$b={})),exports2.CommandPalette=function(_super){__extends(CommandPalette,_super);function CommandPalette(options){var _this=_super.call(this,{node:Private$a.createNode()})||this;return _this._activeIndex=-1,_this._items=[],_this._results=null,_this.addClass("lm-CommandPalette"),_this.addClass("p-CommandPalette"),_this.setFlag(Widget.Flag.DisallowLayout),_this.commands=options.commands,_this.renderer=options.renderer||CommandPalette.defaultRenderer,_this.commands.commandChanged.connect(_this._onGenericChange,_this),_this.commands.keyBindingChanged.connect(_this._onGenericChange,_this),_this}return CommandPalette.prototype.dispose=function(){this._items.length=0,this._results=null,_super.prototype.dispose.call(this)},Object.defineProperty(CommandPalette.prototype,"searchNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette.prototype,"inputNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(CommandPalette.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),CommandPalette.prototype.addItem=function(options){var item=Private$a.createItem(this.commands,options);return this._items.push(item),this.refresh(),item},CommandPalette.prototype.addItems=function(items){var _this=this,newItems=items.map(function(item){return Private$a.createItem(_this.commands,item)});return newItems.forEach(function(item){return _this._items.push(item)}),this.refresh(),newItems},CommandPalette.prototype.removeItem=function(item){this.removeItemAt(this._items.indexOf(item))},CommandPalette.prototype.removeItemAt=function(index){var item=ArrayExt.removeAt(this._items,index);item&&this.refresh()},CommandPalette.prototype.clearItems=function(){this._items.length!==0&&(this._items.length=0,this.refresh())},CommandPalette.prototype.refresh=function(){if(this._results=null,this.inputNode.value!==""){var clear=this.node.getElementsByClassName("lm-close-icon")[0];clear.style.display="inherit"}else{var clear=this.node.getElementsByClassName("lm-close-icon")[0];clear.style.display="none"}this.update()},CommandPalette.prototype.handleEvent=function(event){switch(event.type){case"click":this._evtClick(event);break;case"keydown":this._evtKeyDown(event);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}},CommandPalette.prototype.onBeforeAttach=function(msg){this.node.addEventListener("click",this),this.node.addEventListener("keydown",this),this.node.addEventListener("input",this),this.node.addEventListener("focus",this,!0),this.node.addEventListener("blur",this,!0)},CommandPalette.prototype.onAfterDetach=function(msg){this.node.removeEventListener("click",this),this.node.removeEventListener("keydown",this),this.node.removeEventListener("input",this),this.node.removeEventListener("focus",this,!0),this.node.removeEventListener("blur",this,!0)},CommandPalette.prototype.onActivateRequest=function(msg){if(this.isAttached){var input=this.inputNode;input.focus(),input.select()}},CommandPalette.prototype.onUpdateRequest=function(msg){var query=this.inputNode.value,contentNode=this.contentNode,results=this._results;if(results||(results=this._results=Private$a.search(this._items,query),this._activeIndex=query?ArrayExt.findFirstIndex(results,Private$a.canActivate):-1),!query&&results.length===0){VirtualDOM.render(null,contentNode);return}if(query&&results.length===0){var content_1=this.renderer.renderEmptyMessage({query});VirtualDOM.render(content_1,contentNode);return}for(var renderer=this.renderer,activeIndex=this._activeIndex,content=new Array(results.length),i=0,n=results.length;i<n;++i){var result=results[i];if(result.type==="header"){var indices=result.indices,category=result.category;content[i]=renderer.renderHeader({category,indices})}else{var item=result.item,indices=result.indices,active=i===activeIndex;content[i]=renderer.renderItem({item,indices,active})}}if(VirtualDOM.render(content,contentNode),activeIndex<0||activeIndex>=results.length)contentNode.scrollTop=0;else{var element=contentNode.children[activeIndex];ElementExt.scrollIntoViewIfNeeded(contentNode,element)}},CommandPalette.prototype._evtClick=function(event){if(event.button===0){if(event.target.classList.contains("lm-close-icon")){this.inputNode.value="",this.refresh();return}var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return node.contains(event.target)});index!==-1&&(event.preventDefault(),event.stopPropagation(),this._execute(index))}},CommandPalette.prototype._evtKeyDown=function(event){if(!(event.altKey||event.ctrlKey||event.metaKey||event.shiftKey))switch(event.keyCode){case 13:event.preventDefault(),event.stopPropagation(),this._execute(this._activeIndex);break;case 38:event.preventDefault(),event.stopPropagation(),this._activatePreviousItem();break;case 40:event.preventDefault(),event.stopPropagation(),this._activateNextItem();break}},CommandPalette.prototype._activateNextItem=function(){if(!(!this._results||this._results.length===0)){var ai=this._activeIndex,n=this._results.length,start=ai<n-1?ai+1:0,stop=start===0?n-1:start-1;this._activeIndex=ArrayExt.findFirstIndex(this._results,Private$a.canActivate,start,stop),this.update()}},CommandPalette.prototype._activatePreviousItem=function(){if(!(!this._results||this._results.length===0)){var ai=this._activeIndex,n=this._results.length,start=ai<=0?n-1:ai-1,stop=start===n-1?0:start+1;this._activeIndex=ArrayExt.findLastIndex(this._results,Private$a.canActivate,start,stop),this.update()}},CommandPalette.prototype._execute=function(index){if(this._results){var part=this._results[index];if(part){if(part.type==="header"){var input=this.inputNode;input.value=part.category.toLowerCase()+" ",input.focus(),this.refresh();return}part.item.isEnabled&&(this.commands.execute(part.item.command,part.item.args),this.inputNode.value="",this.refresh())}}},CommandPalette.prototype._toggleFocused=function(){var focused=document.activeElement===this.inputNode;this.toggleClass("lm-mod-focused",focused),this.toggleClass("p-mod-focused",focused)},CommandPalette.prototype._onGenericChange=function(){this.refresh()},CommandPalette}(Widget),function(CommandPalette){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderHeader=function(data){var content=this.formatHeader(data);return h.li({className:"lm-CommandPalette-header p-CommandPalette-header"},content)},Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data);return data.item.isToggleable?h.li({className,dataset,role:"checkbox","aria-checked":""+data.item.isToggled},this.renderItemIcon(data),this.renderItemContent(data),this.renderItemShortcut(data)):h.li({className,dataset},this.renderItemIcon(data),this.renderItemContent(data),this.renderItemShortcut(data))},Renderer2.prototype.renderEmptyMessage=function(data){var content=this.formatEmptyMessage(data);return h.li({className:"lm-CommandPalette-emptyMessage p-CommandPalette-emptyMessage"},content)},Renderer2.prototype.renderItemIcon=function(data){var className=this.createIconClass(data);return typeof data.item.icon=="string"?h.div({className},data.item.iconLabel):h.div({className},data.item.icon,data.item.iconLabel)},Renderer2.prototype.renderItemContent=function(data){return h.div({className:"lm-CommandPalette-itemContent p-CommandPalette-itemContent"},this.renderItemLabel(data),this.renderItemCaption(data))},Renderer2.prototype.renderItemLabel=function(data){var content=this.formatItemLabel(data);return h.div({className:"lm-CommandPalette-itemLabel p-CommandPalette-itemLabel"},content)},Renderer2.prototype.renderItemCaption=function(data){var content=this.formatItemCaption(data);return h.div({className:"lm-CommandPalette-itemCaption p-CommandPalette-itemCaption"},content)},Renderer2.prototype.renderItemShortcut=function(data){var content=this.formatItemShortcut(data);return h.div({className:"lm-CommandPalette-itemShortcut p-CommandPalette-itemShortcut"},content)},Renderer2.prototype.createItemClass=function(data){var name2="lm-CommandPalette-item";name2+=" p-CommandPalette-item",data.item.isEnabled||(name2+=" lm-mod-disabled",name2+=" p-mod-disabled"),data.item.isToggled&&(name2+=" lm-mod-toggled",name2+=" p-mod-toggled"),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active");var extra=data.item.className;return extra&&(name2+=" "+extra),name2},Renderer2.prototype.createItemDataset=function(data){return __assign(__assign({},data.item.dataset),{command:data.item.command})},Renderer2.prototype.createIconClass=function(data){var name2="lm-CommandPalette-itemIcon";name2+=" p-CommandPalette-itemIcon";var extra=data.item.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.formatHeader=function(data){return!data.indices||data.indices.length===0?data.category:StringExt.highlight(data.category,data.indices,h.mark)},Renderer2.prototype.formatEmptyMessage=function(data){return"No commands found that match '"+data.query+"'"},Renderer2.prototype.formatItemShortcut=function(data){var kb=data.item.keyBinding;return kb?exports2.CommandRegistry.formatKeystroke(kb.keys):null},Renderer2.prototype.formatItemLabel=function(data){return!data.indices||data.indices.length===0?data.item.label:StringExt.highlight(data.item.label,data.indices,h.mark)},Renderer2.prototype.formatItemCaption=function(data){return data.item.caption},Renderer2}();CommandPalette.Renderer=Renderer,CommandPalette.defaultRenderer=new Renderer}(exports2.CommandPalette||(exports2.CommandPalette={}));var Private$a;(function(Private2){function createNode(){var node=document.createElement("div"),search2=document.createElement("div"),wrapper=document.createElement("div"),input=document.createElement("input"),content=document.createElement("ul"),clear=document.createElement("button");return search2.className="lm-CommandPalette-search",wrapper.className="lm-CommandPalette-wrapper",input.className="lm-CommandPalette-input",clear.className="lm-close-icon",content.className="lm-CommandPalette-content",search2.classList.add("p-CommandPalette-search"),wrapper.classList.add("p-CommandPalette-wrapper"),input.classList.add("p-CommandPalette-input"),content.classList.add("p-CommandPalette-content"),input.spellcheck=!1,wrapper.appendChild(input),wrapper.appendChild(clear),search2.appendChild(wrapper),node.appendChild(search2),node.appendChild(content),node}Private2.createNode=createNode;function createItem(commands,options){return new CommandItem(commands,options)}Private2.createItem=createItem;function search(items,query){var scores=matchItems(items,query);return scores.sort(scoreCmp),createResults(scores)}Private2.search=search;function canActivate(result){return result.type==="item"&&result.item.isEnabled}Private2.canActivate=canActivate;function normalizeCategory(category){return category.trim().replace(/\s+/g," ")}function normalizeQuery(text){return text.replace(/\s+/g,"").toLowerCase()}function matchItems(items,query){query=normalizeQuery(query);for(var scores=[],i=0,n=items.length;i<n;++i){var item=items[i];if(item.isVisible){if(!query){scores.push({matchType:3,categoryIndices:null,labelIndices:null,score:0,item});continue}var score=fuzzySearch(item,query);score&&(item.isEnabled||(score.score+=1e3),scores.push(score))}}return scores}function fuzzySearch(item,query){for(var category=item.category.toLowerCase(),label=item.label.toLowerCase(),source=category+" "+label,score=1/0,indices=null,rgx=/\b\w/g;;){var rgxMatch=rgx.exec(source);if(!rgxMatch)break;var match=StringExt.matchSumOfDeltas(source,query,rgxMatch.index);if(!match)break;match&&match.score<=score&&(score=match.score,indices=match.indices)}if(!indices||score===1/0)return null;for(var pivot=category.length+1,j=ArrayExt.lowerBound(indices,pivot,function(a,b){return a-b}),categoryIndices=indices.slice(0,j),labelIndices=indices.slice(j),i=0,n=labelIndices.length;i<n;++i)labelIndices[i]-=pivot;return categoryIndices.length===0?{matchType:0,categoryIndices:null,labelIndices,score,item}:labelIndices.length===0?{matchType:1,categoryIndices,labelIndices:null,score,item}:{matchType:2,categoryIndices,labelIndices,score,item}}function scoreCmp(a,b){var m1=a.matchType-b.matchType;if(m1!==0)return m1;var d1=a.score-b.score;if(d1!==0)return d1;var i1=0,i2=0;switch(a.matchType){case 0:i1=a.labelIndices[0],i2=b.labelIndices[0];break;case 1:case 2:i1=a.categoryIndices[0],i2=b.categoryIndices[0];break}if(i1!==i2)return i1-i2;var d2=a.item.category.localeCompare(b.item.category);if(d2!==0)return d2;var r1=a.item.rank,r2=b.item.rank;return r1!==r2?r1<r2?-1:1:a.item.label.localeCompare(b.item.label)}function createResults(scores){var visited=new Array(scores.length);ArrayExt.fill(visited,!1);for(var results=[],i=0,n=scores.length;i<n;++i)if(!visited[i]){var _a=scores[i],item=_a.item,categoryIndices=_a.categoryIndices,category=item.category;results.push({type:"header",category,indices:categoryIndices});for(var j=i;j<n;++j)if(!visited[j]){var _b=scores[j],item_1=_b.item,labelIndices=_b.labelIndices;item_1.category===category&&(results.push({type:"item",item:item_1,indices:labelIndices}),visited[j]=!0)}}return results}var CommandItem=function(){function CommandItem2(commands,options){this._commands=commands,this.category=normalizeCategory(options.category),this.command=options.command,this.args=options.args||JSONExt.emptyObject,this.rank=options.rank!==void 0?options.rank:1/0}return Object.defineProperty(CommandItem2.prototype,"label",{get:function(){return this._commands.label(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"icon",{get:function(){return this._commands.icon(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"iconClass",{get:function(){return this._commands.iconClass(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"iconLabel",{get:function(){return this._commands.iconLabel(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"caption",{get:function(){return this._commands.caption(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"className",{get:function(){return this._commands.className(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"dataset",{get:function(){return this._commands.dataset(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isEnabled",{get:function(){return this._commands.isEnabled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isToggled",{get:function(){return this._commands.isToggled(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isToggleable",{get:function(){return this._commands.isToggleable(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"isVisible",{get:function(){return this._commands.isVisible(this.command,this.args)},enumerable:!0,configurable:!0}),Object.defineProperty(CommandItem2.prototype,"keyBinding",{get:function(){var _a=this,command=_a.command,args=_a.args;return ArrayExt.findLastValue(this._commands.keyBindings,function(kb){return kb.command===command&&JSONExt.deepEqual(kb.args,args)})||null},enumerable:!0,configurable:!0}),CommandItem2}()})(Private$a||(Private$a={}));var Menu=function(_super){__extends(Menu2,_super);function Menu2(options){var _this=_super.call(this,{node:Private$9.createNode()})||this;return _this._childIndex=-1,_this._activeIndex=-1,_this._openTimerID=0,_this._closeTimerID=0,_this._items=[],_this._childMenu=null,_this._parentMenu=null,_this._aboutToClose=new Signal(_this),_this._menuRequested=new Signal(_this),_this.addClass("lm-Menu"),_this.addClass("p-Menu"),_this.setFlag(Widget.Flag.DisallowLayout),_this.commands=options.commands,_this.renderer=options.renderer||Menu2.defaultRenderer,_this}return Menu2.prototype.dispose=function(){this.close(),this._items.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(Menu2.prototype,"aboutToClose",{get:function(){return this._aboutToClose},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"menuRequested",{get:function(){return this._menuRequested},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"parentMenu",{get:function(){return this._parentMenu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"rootMenu",{get:function(){for(var menu=this;menu._parentMenu;)menu=menu._parentMenu;return menu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"leafMenu",{get:function(){for(var menu=this;menu._childMenu;)menu=menu._childMenu;return menu},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-Menu-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"activeItem",{get:function(){return this._items[this._activeIndex]||null},set:function(value){this.activeIndex=value?this._items.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(value){(value<0||value>=this._items.length)&&(value=-1),value!==-1&&!Private$9.canActivate(this._items[value])&&(value=-1),this._activeIndex!==value&&(this._activeIndex=value,this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(Menu2.prototype,"items",{get:function(){return this._items},enumerable:!0,configurable:!0}),Menu2.prototype.activateNextItem=function(){var n=this._items.length,ai=this._activeIndex,start=ai<n-1?ai+1:0,stop=start===0?n-1:start-1;this.activeIndex=ArrayExt.findFirstIndex(this._items,Private$9.canActivate,start,stop)},Menu2.prototype.activatePreviousItem=function(){var n=this._items.length,ai=this._activeIndex,start=ai<=0?n-1:ai-1,stop=start===n-1?0:start+1;this.activeIndex=ArrayExt.findLastIndex(this._items,Private$9.canActivate,start,stop)},Menu2.prototype.triggerActiveItem=function(){if(this.isAttached){var item=this.activeItem;if(item){if(this._cancelOpenTimer(),this._cancelCloseTimer(),item.type==="submenu"){this._openChildMenu(!0);return}this.rootMenu.close();var command=item.command,args=item.args;this.commands.isEnabled(command,args)?this.commands.execute(command,args):console.log("Command '"+command+"' is disabled.")}}},Menu2.prototype.addItem=function(options){return this.insertItem(this._items.length,options)},Menu2.prototype.insertItem=function(index,options){this.isAttached&&this.close(),this.activeIndex=-1;var i=Math.max(0,Math.min(index,this._items.length)),item=Private$9.createItem(this,options);return ArrayExt.insert(this._items,i,item),this.update(),item},Menu2.prototype.removeItem=function(item){this.removeItemAt(this._items.indexOf(item))},Menu2.prototype.removeItemAt=function(index){this.isAttached&&this.close(),this.activeIndex=-1;var item=ArrayExt.removeAt(this._items,index);item&&this.update()},Menu2.prototype.clearItems=function(){this.isAttached&&this.close(),this.activeIndex=-1,this._items.length!==0&&(this._items.length=0,this.update())},Menu2.prototype.open=function(x,y,options){if(options===void 0&&(options={}),!this.isAttached){var forceX=options.forceX||!1,forceY=options.forceY||!1;Private$9.openRootMenu(this,x,y,forceX,forceY),this.activate()}},Menu2.prototype.handleEvent=function(event){switch(event.type){case"keydown":this._evtKeyDown(event);break;case"mouseup":this._evtMouseUp(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseenter":this._evtMouseEnter(event);break;case"mouseleave":this._evtMouseLeave(event);break;case"mousedown":this._evtMouseDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},Menu2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("keydown",this),this.node.addEventListener("mouseup",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseenter",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this),document.addEventListener("mousedown",this,!0)},Menu2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mouseup",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseenter",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),document.removeEventListener("mousedown",this,!0)},Menu2.prototype.onActivateRequest=function(msg){this.isAttached&&this.node.focus()},Menu2.prototype.onUpdateRequest=function(msg){for(var _this=this,items=this._items,renderer=this.renderer,activeIndex=this._activeIndex,collapsedFlags=Private$9.computeCollapsed(items),content=new Array(items.length),_loop_1=function(i2,n2){var item=items[i2],active=i2===activeIndex,collapsed=collapsedFlags[i2];content[i2]=renderer.renderItem({item,active,collapsed,onfocus:function(){_this.activeIndex=i2}})},i=0,n=items.length;i<n;++i)_loop_1(i);VirtualDOM.render(content,this.contentNode)},Menu2.prototype.onCloseRequest=function(msg){this._cancelOpenTimer(),this._cancelCloseTimer(),this.activeIndex=-1;var childMenu=this._childMenu;childMenu&&(this._childIndex=-1,this._childMenu=null,childMenu._parentMenu=null,childMenu.close());var parentMenu=this._parentMenu;parentMenu&&(this._parentMenu=null,parentMenu._childIndex=-1,parentMenu._childMenu=null,parentMenu.activate()),this.isAttached&&this._aboutToClose.emit(void 0),_super.prototype.onCloseRequest.call(this,msg)},Menu2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation();var kc=event.keyCode;if(kc===13){this.triggerActiveItem();return}if(kc===27){this.close();return}if(kc===37){this._parentMenu?this.close():this._menuRequested.emit("previous");return}if(kc===38){this.activatePreviousItem();return}if(kc===39){var item=this.activeItem;item&&item.type==="submenu"?this.triggerActiveItem():this.rootMenu._menuRequested.emit("next");return}if(kc===40){this.activateNextItem();return}var key=getKeyboardLayout().keyForKeydownEvent(event);if(key){var start=this._activeIndex+1,result=Private$9.findMnemonic(this._items,key,start);result.index!==-1&&!result.multiple?(this.activeIndex=result.index,this.triggerActiveItem()):result.index!==-1?this.activeIndex=result.index:result.auto!==-1&&(this.activeIndex=result.auto)}},Menu2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this.triggerActiveItem())},Menu2.prototype._evtMouseMove=function(event){var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index!==this._activeIndex){if(this.activeIndex=index,index=this.activeIndex,index===this._childIndex){this._cancelOpenTimer(),this._cancelCloseTimer();return}this._childIndex!==-1&&this._startCloseTimer(),this._cancelOpenTimer();var item=this.activeItem;!item||item.type!=="submenu"||!item.submenu||this._startOpenTimer()}},Menu2.prototype._evtMouseEnter=function(event){for(var menu=this._parentMenu;menu;menu=menu._parentMenu)menu._cancelOpenTimer(),menu._cancelCloseTimer(),menu.activeIndex=menu._childIndex},Menu2.prototype._evtMouseLeave=function(event){if(this._cancelOpenTimer(),!this._childMenu){this.activeIndex=-1;return}var clientX=event.clientX,clientY=event.clientY;if(ElementExt.hitTest(this._childMenu.node,clientX,clientY)){this._cancelCloseTimer();return}this.activeIndex=-1,this._startCloseTimer()},Menu2.prototype._evtMouseDown=function(event){this._parentMenu||(Private$9.hitTestMenus(this,event.clientX,event.clientY)?(event.preventDefault(),event.stopPropagation()):this.close())},Menu2.prototype._openChildMenu=function(activateFirst){activateFirst===void 0&&(activateFirst=!1);var item=this.activeItem;if(!item||item.type!=="submenu"||!item.submenu){this._closeChildMenu();return}var submenu=item.submenu;if(submenu!==this._childMenu){Menu2.saveWindowData(),this._closeChildMenu(),this._childMenu=submenu,this._childIndex=this._activeIndex,submenu._parentMenu=this,MessageLoop.sendMessage(this,Widget.Msg.UpdateRequest);var itemNode=this.contentNode.children[this._activeIndex];Private$9.openSubmenu(submenu,itemNode),activateFirst&&(submenu.activeIndex=-1,submenu.activateNextItem()),submenu.activate()}},Menu2.prototype._closeChildMenu=function(){this._childMenu&&this._childMenu.close()},Menu2.prototype._startOpenTimer=function(){var _this=this;this._openTimerID===0&&(this._openTimerID=window.setTimeout(function(){_this._openTimerID=0,_this._openChildMenu()},Private$9.TIMER_DELAY))},Menu2.prototype._startCloseTimer=function(){var _this=this;this._closeTimerID===0&&(this._closeTimerID=window.setTimeout(function(){_this._closeTimerID=0,_this._closeChildMenu()},Private$9.TIMER_DELAY))},Menu2.prototype._cancelOpenTimer=function(){this._openTimerID!==0&&(clearTimeout(this._openTimerID),this._openTimerID=0)},Menu2.prototype._cancelCloseTimer=function(){this._closeTimerID!==0&&(clearTimeout(this._closeTimerID),this._closeTimerID=0)},Menu2.saveWindowData=function(){Private$9.saveWindowData()},Menu2}(Widget);(function(Menu2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data),aria=this.createItemARIA(data);return h.li(__assign({className,dataset,tabindex:"0",onfocus:data.onfocus},aria),this.renderIcon(data),this.renderLabel(data),this.renderShortcut(data),this.renderSubmenu(data))},Renderer2.prototype.renderIcon=function(data){var className=this.createIconClass(data);return typeof data.item.icon=="string"?h.div({className},data.item.iconLabel):h.div({className},data.item.icon,data.item.iconLabel)},Renderer2.prototype.renderLabel=function(data){var content=this.formatLabel(data);return h.div({className:"lm-Menu-itemLabel p-Menu-itemLabel"},content)},Renderer2.prototype.renderShortcut=function(data){var content=this.formatShortcut(data);return h.div({className:"lm-Menu-itemShortcut p-Menu-itemShortcut"},content)},Renderer2.prototype.renderSubmenu=function(data){return h.div({className:"lm-Menu-itemSubmenuIcon p-Menu-itemSubmenuIcon"})},Renderer2.prototype.createItemClass=function(data){var name2="lm-Menu-item";name2+=" p-Menu-item",data.item.isEnabled||(name2+=" lm-mod-disabled",name2+=" p-mod-disabled"),data.item.isToggled&&(name2+=" lm-mod-toggled",name2+=" p-mod-toggled"),data.item.isVisible||(name2+=" lm-mod-hidden",name2+=" p-mod-hidden"),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active"),data.collapsed&&(name2+=" lm-mod-collapsed",name2+=" p-mod-collapsed");var extra=data.item.className;return extra&&(name2+=" "+extra),name2},Renderer2.prototype.createItemDataset=function(data){var result,_a=data.item,type=_a.type,command=_a.command,dataset=_a.dataset;return type==="command"?result=__assign(__assign({},dataset),{type,command}):result=__assign(__assign({},dataset),{type}),result},Renderer2.prototype.createIconClass=function(data){var name2="lm-Menu-itemIcon";name2+=" p-Menu-itemIcon";var extra=data.item.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.createItemARIA=function(data){var aria={};switch(data.item.type){case"separator":aria.role="presentation";break;case"submenu":aria["aria-haspopup"]="true",data.item.isEnabled||(aria["aria-disabled"]="true");break;default:data.item.isEnabled||(aria["aria-disabled"]="true"),aria.role="menuitem"}return aria},Renderer2.prototype.formatLabel=function(data){var _a=data.item,label=_a.label,mnemonic=_a.mnemonic;if(mnemonic<0||mnemonic>=label.length)return label;var prefix=label.slice(0,mnemonic),suffix=label.slice(mnemonic+1),char=label[mnemonic],span=h.span({className:"lm-Menu-itemMnemonic p-Menu-itemMnemonic"},char);return[prefix,span,suffix]},Renderer2.prototype.formatShortcut=function(data){var kb=data.item.keyBinding;return kb?exports2.CommandRegistry.formatKeystroke(kb.keys):null},Renderer2}();Menu2.Renderer=Renderer,Menu2.defaultRenderer=new Renderer})(Menu||(Menu={}));var Private$9;(function(Private2){Private2.TIMER_DELAY=300,Private2.SUBMENU_OVERLAP=3;var transientWindowDataCache=null,transientCacheCounter=0;function getWindowData(){return transientCacheCounter>0?(transientCacheCounter--,transientWindowDataCache):_getWindowData()}function saveWindowData(){transientWindowDataCache=_getWindowData(),transientCacheCounter++}Private2.saveWindowData=saveWindowData;function createNode(){var node=document.createElement("div"),content=document.createElement("ul");return content.className="lm-Menu-content",content.classList.add("p-Menu-content"),node.appendChild(content),content.setAttribute("role","menu"),node.tabIndex=0,node}Private2.createNode=createNode;function canActivate(item){return item.type!=="separator"&&item.isEnabled&&item.isVisible}Private2.canActivate=canActivate;function createItem(owner,options){return new MenuItem(owner.commands,options)}Private2.createItem=createItem;function hitTestMenus(menu,x,y){for(var temp=menu;temp;temp=temp.childMenu)if(ElementExt.hitTest(temp.node,x,y))return!0;return!1}Private2.hitTestMenus=hitTestMenus;function computeCollapsed(items){var result=new Array(items.length);ArrayExt.fill(result,!1);for(var k1=0,n=items.length;k1<n;++k1){var item=items[k1];if(item.isVisible){if(item.type!=="separator")break;result[k1]=!0}}for(var k2=n-1;k2>=0;--k2){var item=items[k2];if(item.isVisible){if(item.type!=="separator")break;result[k2]=!0}}for(var hide=!1;++k1<k2;){var item=items[k1];item.isVisible&&(item.type!=="separator"?hide=!1:hide?result[k1]=!0:hide=!0)}return result}Private2.computeCollapsed=computeCollapsed;function _getWindowData(){return{pageXOffset:window.pageXOffset,pageYOffset:window.pageYOffset,clientWidth:document.documentElement.clientWidth,clientHeight:document.documentElement.clientHeight}}function openRootMenu(menu,x,y,forceX,forceY){var windowData=getWindowData(),px=windowData.pageXOffset,py=windowData.pageYOffset,cw=windowData.clientWidth,ch=windowData.clientHeight;MessageLoop.sendMessage(menu,Widget.Msg.UpdateRequest);var maxHeight=ch-(forceY?y:0),node=menu.node,style=node.style;style.opacity="0",style.maxHeight=maxHeight+"px",Widget.attach(menu,document.body);var _a=node.getBoundingClientRect(),width=_a.width,height=_a.height;!forceX&&x+width>px+cw&&(x=px+cw-width),!forceY&&y+height>py+ch&&(y>py+ch?y=py+ch-height:y=y-height),style.transform="translate("+Math.max(0,x)+"px, "+Math.max(0,y)+"px",style.opacity="1"}Private2.openRootMenu=openRootMenu;function openSubmenu(submenu,itemNode){var windowData=getWindowData(),px=windowData.pageXOffset,py=windowData.pageYOffset,cw=windowData.clientWidth,ch=windowData.clientHeight;MessageLoop.sendMessage(submenu,Widget.Msg.UpdateRequest);var maxHeight=ch,node=submenu.node,style=node.style;style.opacity="0",style.maxHeight=maxHeight+"px",Widget.attach(submenu,document.body);var _a=node.getBoundingClientRect(),width=_a.width,height=_a.height,box=ElementExt.boxSizing(submenu.node),itemRect=itemNode.getBoundingClientRect(),x=itemRect.right-Private2.SUBMENU_OVERLAP;x+width>px+cw&&(x=itemRect.left+Private2.SUBMENU_OVERLAP-width);var y=itemRect.top-box.borderTop-box.paddingTop;y+height>py+ch&&(y=itemRect.bottom+box.borderBottom+box.paddingBottom-height),style.transform="translate("+Math.max(0,x)+"px, "+Math.max(0,y)+"px",style.opacity="1"}Private2.openSubmenu=openSubmenu;function findMnemonic(items,key,start){for(var index=-1,auto=-1,multiple=!1,upperKey=key.toUpperCase(),i=0,n=items.length;i<n;++i){var k=(i+start)%n,item=items[k];if(canActivate(item)){var label=item.label;if(label.length!==0){var mn=item.mnemonic;if(mn>=0&&mn<label.length){label[mn].toUpperCase()===upperKey&&(index===-1?index=k:multiple=!0);continue}auto===-1&&label[0].toUpperCase()===upperKey&&(auto=k)}}}return{index,multiple,auto}}Private2.findMnemonic=findMnemonic;var MenuItem=function(){function MenuItem2(commands,options){this._commands=commands,this.type=options.type||"command",this.command=options.command||"",this.args=options.args||JSONExt.emptyObject,this.submenu=options.submenu||null}return Object.defineProperty(MenuItem2.prototype,"label",{get:function(){return this.type==="command"?this._commands.label(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.label:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"mnemonic",{get:function(){return this.type==="command"?this._commands.mnemonic(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.mnemonic:-1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"icon",{get:function(){return this.type==="command"?this._commands.icon(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.icon:this.iconClass},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"iconClass",{get:function(){return this.type==="command"?this._commands.iconClass(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconClass:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"iconLabel",{get:function(){return this.type==="command"?this._commands.iconLabel(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.iconLabel:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"caption",{get:function(){return this.type==="command"?this._commands.caption(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.caption:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"className",{get:function(){return this.type==="command"?this._commands.className(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.className:""},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"dataset",{get:function(){return this.type==="command"?this._commands.dataset(this.command,this.args):this.type==="submenu"&&this.submenu?this.submenu.title.dataset:{}},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isEnabled",{get:function(){return this.type==="command"?this._commands.isEnabled(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isToggled",{get:function(){return this.type==="command"?this._commands.isToggled(this.command,this.args):!1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"isVisible",{get:function(){return this.type==="command"?this._commands.isVisible(this.command,this.args):this.type==="submenu"?this.submenu!==null:!0},enumerable:!0,configurable:!0}),Object.defineProperty(MenuItem2.prototype,"keyBinding",{get:function(){if(this.type==="command"){var _a=this,command_1=_a.command,args_1=_a.args;return ArrayExt.findLastValue(this._commands.keyBindings,function(kb){return kb.command===command_1&&JSONExt.deepEqual(kb.args,args_1)})||null}return null},enumerable:!0,configurable:!0}),MenuItem2}()})(Private$9||(Private$9={}));var ContextMenu=function(){function ContextMenu2(options){this._groupByTarget=!0,this._idTick=0,this._items=[],this._sortBySelector=!0;var groupByTarget=options.groupByTarget,sortBySelector=options.sortBySelector,others=__rest(options,["groupByTarget","sortBySelector"]);this.menu=new Menu(others),this._groupByTarget=groupByTarget!==!1,this._sortBySelector=sortBySelector!==!1}return ContextMenu2.prototype.addItem=function(options){var _this=this,item=Private$8.createItem(options,this._idTick++);return this._items.push(item),new DisposableDelegate(function(){ArrayExt.removeFirstOf(_this._items,item)})},ContextMenu2.prototype.open=function(event){var _this=this;if(Menu.saveWindowData(),this.menu.clearItems(),this._items.length===0)return!1;var items=Private$8.matchItems(this._items,event,this._groupByTarget,this._sortBySelector);return!items||items.length===0?!1:(each(items,function(item){_this.menu.addItem(item)}),this.menu.open(event.clientX,event.clientY),!0)},ContextMenu2}(),Private$8;(function(Private2){function createItem(options,id){var selector=validateSelector(options.selector),rank=options.rank!==void 0?options.rank:1/0;return __assign(__assign({},options),{selector,rank,id})}Private2.createItem=createItem;function matchItems(items,event,groupByTarget,sortBySelector){var target=event.target;if(!target)return null;var currentTarget=event.currentTarget;if(!currentTarget||!currentTarget.contains(target)&&(target=document.elementFromPoint(event.clientX,event.clientY),!target||!currentTarget.contains(target)))return null;for(var result=[],availableItems=items.slice();target!==null;){for(var matches=[],i=0,n=availableItems.length;i<n;++i){var item=availableItems[i];item&&Selector.matches(target,item.selector)&&(matches.push(item),availableItems[i]=null)}if(matches.length!==0&&(groupByTarget&&matches.sort(sortBySelector?itemCmp:itemCmpRank),result.push.apply(result,matches)),target===currentTarget)break;target=target.parentElement}return groupByTarget||result.sort(sortBySelector?itemCmp:itemCmpRank),result}Private2.matchItems=matchItems;function validateSelector(selector){if(selector.indexOf(",")!==-1)throw new Error("Selector cannot contain commas: "+selector);if(!Selector.isValid(selector))throw new Error("Invalid selector: "+selector);return selector}function itemCmpRank(a,b){var r1=a.rank,r2=b.rank;return r1!==r2?r1<r2?-1:1:a.id-b.id}function itemCmp(a,b){var s1=Selector.calculateSpecificity(a.selector),s2=Selector.calculateSpecificity(b.selector);return s1!==s2?s2-s1:itemCmpRank(a,b)}})(Private$8||(Private$8={}));var TabBar=function(_super){__extends(TabBar2,_super);function TabBar2(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$7.createNode()})||this;return _this._currentIndex=-1,_this._titles=[],_this._titlesEditable=!1,_this._previousTitle=null,_this._dragData=null,_this._addButtonEnabled=!1,_this._tabMoved=new Signal(_this),_this._currentChanged=new Signal(_this),_this._addRequested=new Signal(_this),_this._tabCloseRequested=new Signal(_this),_this._tabDetachRequested=new Signal(_this),_this._tabActivateRequested=new Signal(_this),_this.addClass("lm-TabBar"),_this.addClass("p-TabBar"),_this.contentNode.setAttribute("role","tablist"),_this.setFlag(Widget.Flag.DisallowLayout),_this._document=options.document||document,_this.tabsMovable=options.tabsMovable||!1,_this.titlesEditable=options.titlesEditable||!1,_this.allowDeselect=options.allowDeselect||!1,_this.addButtonEnabled=options.addButtonEnabled||!1,_this.insertBehavior=options.insertBehavior||"select-tab-if-needed",_this.name=options.name||"",_this.orientation=options.orientation||"horizontal",_this.removeBehavior=options.removeBehavior||"select-tab-after",_this.renderer=options.renderer||TabBar2.defaultRenderer,_this}return TabBar2.prototype.dispose=function(){this._releaseMouse(),this._titles.length=0,this._previousTitle=null,_super.prototype.dispose.call(this)},Object.defineProperty(TabBar2.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabMoved",{get:function(){return this._tabMoved},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabActivateRequested",{get:function(){return this._tabActivateRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabCloseRequested",{get:function(){return this._tabCloseRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"tabDetachRequested",{get:function(){return this._tabDetachRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"document",{get:function(){return this._document},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"titlesEditable",{get:function(){return this._titlesEditable},set:function(value){this._titlesEditable=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"currentTitle",{get:function(){return this._titles[this._currentIndex]||null},set:function(value){this.currentIndex=value?this._titles.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"currentIndex",{get:function(){return this._currentIndex},set:function(value){if((value<0||value>=this._titles.length)&&(value=-1),this._currentIndex!==value){var pi=this._currentIndex,pt=this._titles[pi]||null,ci=value,ct=this._titles[ci]||null;this._currentIndex=ci,this._previousTitle=pt,this.update(),this._currentChanged.emit({previousIndex:pi,previousTitle:pt,currentIndex:ci,currentTitle:ct})}},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"name",{get:function(){return this._name},set:function(value){this._name=value,value?this.contentNode.setAttribute("aria-label",value):this.contentNode.removeAttribute("aria-label")},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._releaseMouse(),this._orientation=value,this.dataset.orientation=value,this.contentNode.setAttribute("aria-orientation",value))},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(value){this._addButtonEnabled!==value&&(this._addButtonEnabled=value,value?this.addButtonNode.classList.remove("lm-mod-hidden"):this.addButtonNode.classList.add("lm-mod-hidden"))},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"titles",{get:function(){return this._titles},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(TabBar2.prototype,"addButtonNode",{get:function(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]},enumerable:!0,configurable:!0}),TabBar2.prototype.addTab=function(value){return this.insertTab(this._titles.length,value)},TabBar2.prototype.insertTab=function(index,value){this._releaseMouse();var title=Private$7.asTitle(value),i=this._titles.indexOf(title),j=Math.max(0,Math.min(index,this._titles.length));return i===-1?(ArrayExt.insert(this._titles,j,title),title.changed.connect(this._onTitleChanged,this),this.update(),this._adjustCurrentForInsert(j,title),title):(j===this._titles.length&&j--,i===j||(ArrayExt.move(this._titles,i,j),this.update(),this._adjustCurrentForMove(i,j)),title)},TabBar2.prototype.removeTab=function(title){this.removeTabAt(this._titles.indexOf(title))},TabBar2.prototype.removeTabAt=function(index){this._releaseMouse();var title=ArrayExt.removeAt(this._titles,index);title&&(title.changed.disconnect(this._onTitleChanged,this),title===this._previousTitle&&(this._previousTitle=null),this.update(),this._adjustCurrentForRemove(index,title))},TabBar2.prototype.clearTabs=function(){if(this._titles.length!==0){this._releaseMouse();for(var _i=0,_a=this._titles;_i<_a.length;_i++){var title=_a[_i];title.changed.disconnect(this._onTitleChanged,this)}var pi=this.currentIndex,pt=this.currentTitle;this._currentIndex=-1,this._previousTitle=null,this._titles.length=0,this.update(),pi!==-1&&this._currentChanged.emit({previousIndex:pi,previousTitle:pt,currentIndex:-1,currentTitle:null})}},TabBar2.prototype.releaseMouse=function(){this._releaseMouse()},TabBar2.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"dblclick":this._evtDblClick(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},TabBar2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this),this.node.addEventListener("dblclick",this)},TabBar2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this.node.removeEventListener("dblclick",this),this._releaseMouse()},TabBar2.prototype.onUpdateRequest=function(msg){for(var titles=this._titles,renderer=this.renderer,currentTitle=this.currentTitle,content=new Array(titles.length),i=0,n=titles.length;i<n;++i){var title=titles[i],current=title===currentTitle,zIndex=current?n:n-i-1;content[i]=renderer.renderTab({title,current,zIndex})}VirtualDOM.render(content,this.contentNode)},TabBar2.prototype._evtDblClick=function(event){if(this.titlesEditable){var tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(index!==-1){var title=this.titles[index],label=tabs[index].querySelector(".lm-TabBar-tabLabel");if(label&&label.contains(event.target)){var value=title.label||"",oldValue_1=label.innerHTML;label.innerHTML="";var input_1=document.createElement("input");input_1.classList.add("lm-TabBar-tabInput"),input_1.value=value,label.appendChild(input_1);var onblur_1=function(){input_1.removeEventListener("blur",onblur_1),label.innerHTML=oldValue_1};input_1.addEventListener("dblclick",function(event2){return event2.stopPropagation()}),input_1.addEventListener("blur",onblur_1),input_1.addEventListener("keydown",function(event2){event2.key==="Enter"?(input_1.value!==""&&(title.label=title.caption=input_1.value),onblur_1()):event2.key==="Escape"&&onblur_1()}),input_1.select(),input_1.focus(),label.children.length>0&&label.children[0].focus()}}}},TabBar2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&this._releaseMouse()},TabBar2.prototype._evtMouseDown=function(event){if(!(event.button!==0&&event.button!==1)&&!this._dragData){var addButtonClicked=this.addButtonEnabled&&this.addButtonNode.contains(event.target),tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(!(index===-1&&!addButtonClicked)&&(event.preventDefault(),event.stopPropagation(),this._dragData={tab:tabs[index],index,pressX:event.clientX,pressY:event.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:!1,dragAborted:!1,detachRequested:!1},this.document.addEventListener("mouseup",this,!0),this.document.addEventListener("pointerup",this,!0),!(event.button===1||addButtonClicked))){var icon=tabs[index].querySelector(this.renderer.closeIconSelector);icon&&icon.contains(event.target)||(this.tabsMovable&&(this.document.addEventListener("mousemove",this,!0),this.document.addEventListener("pointermove",this,!0),this.document.addEventListener("keydown",this,!0),this.document.addEventListener("contextmenu",this,!0)),this.allowDeselect&&this.currentIndex===index?this.currentIndex=-1:this.currentIndex=index,this.currentIndex!==-1&&this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle}))}}},TabBar2.prototype._evtMouseMove=function(event){var data=this._dragData;if(data){event.preventDefault(),event.stopPropagation();var tabs=this.contentNode.children;if(!(!data.dragActive&&!Private$7.dragExceeded(data,event))){if(!data.dragActive){var tabRect=data.tab.getBoundingClientRect();this._orientation==="horizontal"?(data.tabPos=data.tab.offsetLeft,data.tabSize=tabRect.width,data.tabPressPos=data.pressX-tabRect.left):(data.tabPos=data.tab.offsetTop,data.tabSize=tabRect.height,data.tabPressPos=data.pressY-tabRect.top),data.tabLayout=Private$7.snapTabLayout(tabs,this._orientation),data.contentRect=this.contentNode.getBoundingClientRect(),data.override=Drag.overrideCursor("default"),data.tab.classList.add("lm-mod-dragging"),this.addClass("lm-mod-dragging"),data.tab.classList.add("p-mod-dragging"),this.addClass("p-mod-dragging"),data.dragActive=!0}if(!data.detachRequested&&Private$7.detachExceeded(data,event)){data.detachRequested=!0;var index=data.index,clientX=event.clientX,clientY=event.clientY,tab=tabs[index],title=this._titles[index];if(this._tabDetachRequested.emit({index,title,tab,clientX,clientY}),data.dragAborted)return}Private$7.layoutTabs(tabs,data,event,this._orientation)}}},TabBar2.prototype._evtMouseUp=function(event){var _this=this;if(!(event.button!==0&&event.button!==1)){var data=this._dragData;if(data){if(event.preventDefault(),event.stopPropagation(),this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),!data.dragActive){this._dragData=null;var addButtonClicked=this.addButtonEnabled&&this.addButtonNode.contains(event.target);if(addButtonClicked){this._addRequested.emit(void 0);return}var tabs=this.contentNode.children,index=ArrayExt.findFirstIndex(tabs,function(tab){return ElementExt.hitTest(tab,event.clientX,event.clientY)});if(index!==data.index)return;var title=this._titles[index];if(!title.closable)return;if(event.button===1){this._tabCloseRequested.emit({index,title});return}var icon=tabs[index].querySelector(this.renderer.closeIconSelector);if(icon&&icon.contains(event.target)){this._tabCloseRequested.emit({index,title});return}return}if(event.button===0){Private$7.finalizeTabPosition(data,this._orientation),data.tab.classList.remove("lm-mod-dragging"),data.tab.classList.remove("p-mod-dragging");var duration=Private$7.parseTransitionDuration(data.tab);setTimeout(function(){if(!data.dragAborted){_this._dragData=null,Private$7.resetTabPositions(_this.contentNode.children,_this._orientation),data.override.dispose(),_this.removeClass("lm-mod-dragging"),_this.removeClass("p-mod-dragging");var i=data.index,j=data.targetIndex;j===-1||i===j||(ArrayExt.move(_this._titles,i,j),_this._adjustCurrentForMove(i,j),_this._tabMoved.emit({fromIndex:i,toIndex:j,title:_this._titles[j]}),MessageLoop.sendMessage(_this,Widget.Msg.UpdateRequest))}},duration)}}}},TabBar2.prototype._releaseMouse=function(){var data=this._dragData;data&&(this._dragData=null,this.document.removeEventListener("mousemove",this,!0),this.document.removeEventListener("mouseup",this,!0),this.document.removeEventListener("pointermove",this,!0),this.document.removeEventListener("pointerup",this,!0),this.document.removeEventListener("keydown",this,!0),this.document.removeEventListener("contextmenu",this,!0),data.dragAborted=!0,data.dragActive&&(Private$7.resetTabPositions(this.contentNode.children,this._orientation),data.override.dispose(),data.tab.classList.remove("lm-mod-dragging"),this.removeClass("lm-mod-dragging"),data.tab.classList.remove("p-mod-dragging"),this.removeClass("p-mod-dragging")))},TabBar2.prototype._adjustCurrentForInsert=function(i,title){var ct=this.currentTitle,ci=this._currentIndex,bh=this.insertBehavior;if(bh==="select-tab"||bh==="select-tab-if-needed"&&ci===-1){this._currentIndex=i,this._previousTitle=ct,this._currentChanged.emit({previousIndex:ci,previousTitle:ct,currentIndex:i,currentTitle:title});return}ci>=i&&this._currentIndex++},TabBar2.prototype._adjustCurrentForMove=function(i,j){this._currentIndex===i?this._currentIndex=j:this._currentIndex<i&&this._currentIndex>=j?this._currentIndex++:this._currentIndex>i&&this._currentIndex<=j&&this._currentIndex--},TabBar2.prototype._adjustCurrentForRemove=function(i,title){var ci=this._currentIndex,bh=this.removeBehavior;if(ci!==i){ci>i&&this._currentIndex--;return}if(this._titles.length===0){this._currentIndex=-1,this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:-1,currentTitle:null});return}if(bh==="select-tab-after"){this._currentIndex=Math.min(i,this._titles.length-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(bh==="select-tab-before"){this._currentIndex=Math.max(0,i-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(bh==="select-previous-tab"){this._previousTitle?(this._currentIndex=this._titles.indexOf(this._previousTitle),this._previousTitle=null):this._currentIndex=Math.min(i,this._titles.length-1),this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1,this._currentChanged.emit({previousIndex:i,previousTitle:title,currentIndex:-1,currentTitle:null})},TabBar2.prototype._onTitleChanged=function(sender){this.update()},TabBar2}(Widget);(function(TabBar2){var Renderer=function(){function Renderer2(){this.closeIconSelector=".lm-TabBar-tabCloseIcon",this._tabID=0,this._tabKeys=new WeakMap,this._uuid=++Renderer2._nInstance}return Renderer2.prototype.renderTab=function(data){var title=data.title.caption,key=this.createTabKey(data),id=key,style=this.createTabStyle(data),className=this.createTabClass(data),dataset=this.createTabDataset(data),aria=this.createTabARIA(data);return data.title.closable?h.li(__assign({id,key,className,title,style,dataset},aria),this.renderIcon(data),this.renderLabel(data),this.renderCloseIcon(data)):h.li(__assign({id,key,className,title,style,dataset},aria),this.renderIcon(data),this.renderLabel(data))},Renderer2.prototype.renderIcon=function(data){var title=data.title,className=this.createIconClass(data);return typeof title.icon=="string"?h.div({className},title.iconLabel):h.div({className},title.icon,title.iconLabel)},Renderer2.prototype.renderLabel=function(data){return h.div({className:"lm-TabBar-tabLabel p-TabBar-tabLabel"},data.title.label)},Renderer2.prototype.renderCloseIcon=function(data){return h.div({className:"lm-TabBar-tabCloseIcon p-TabBar-tabCloseIcon"})},Renderer2.prototype.createTabKey=function(data){var key=this._tabKeys.get(data.title);return key===void 0&&(key="tab-key-"+this._uuid+"-"+this._tabID++,this._tabKeys.set(data.title,key)),key},Renderer2.prototype.createTabStyle=function(data){return{zIndex:""+data.zIndex}},Renderer2.prototype.createTabClass=function(data){var name2="lm-TabBar-tab";return name2+=" p-TabBar-tab",data.title.className&&(name2+=" "+data.title.className),data.title.closable&&(name2+=" lm-mod-closable",name2+=" p-mod-closable"),data.current&&(name2+=" lm-mod-current",name2+=" p-mod-current"),name2},Renderer2.prototype.createTabDataset=function(data){return data.title.dataset},Renderer2.prototype.createTabARIA=function(data){return{role:"tab","aria-selected":data.current.toString()}},Renderer2.prototype.createIconClass=function(data){var name2="lm-TabBar-tabIcon";name2+=" p-TabBar-tabIcon";var extra=data.title.iconClass;return extra?name2+" "+extra:name2},Renderer2._nInstance=0,Renderer2}();TabBar2.Renderer=Renderer,TabBar2.defaultRenderer=new Renderer,TabBar2.addButtonSelector=".lm-TabBar-addButton"})(TabBar||(TabBar={}));var Private$7;(function(Private2){Private2.DRAG_THRESHOLD=5,Private2.DETACH_THRESHOLD=20;function createNode(){var node=document.createElement("div"),content=document.createElement("ul");content.setAttribute("role","tablist"),content.className="lm-TabBar-content",content.classList.add("p-TabBar-content"),node.appendChild(content);var add=document.createElement("div");return add.className="lm-TabBar-addButton lm-mod-hidden",node.appendChild(add),node}Private2.createNode=createNode;function asTitle(value){return value instanceof Title?value:new Title(value)}Private2.asTitle=asTitle;function parseTransitionDuration(tab){var style=window.getComputedStyle(tab);return 1e3*(parseFloat(style.transitionDuration)||0)}Private2.parseTransitionDuration=parseTransitionDuration;function snapTabLayout(tabs,orientation){for(var layout=new Array(tabs.length),i=0,n=tabs.length;i<n;++i){var node=tabs[i],style=window.getComputedStyle(node);orientation==="horizontal"?layout[i]={pos:node.offsetLeft,size:node.offsetWidth,margin:parseFloat(style.marginLeft)||0}:layout[i]={pos:node.offsetTop,size:node.offsetHeight,margin:parseFloat(style.marginTop)||0}}return layout}Private2.snapTabLayout=snapTabLayout;function dragExceeded(data,event){var dx=Math.abs(event.clientX-data.pressX),dy=Math.abs(event.clientY-data.pressY);return dx>=Private2.DRAG_THRESHOLD||dy>=Private2.DRAG_THRESHOLD}Private2.dragExceeded=dragExceeded;function detachExceeded(data,event){var rect=data.contentRect;return event.clientX<rect.left-Private2.DETACH_THRESHOLD||event.clientX>=rect.right+Private2.DETACH_THRESHOLD||event.clientY<rect.top-Private2.DETACH_THRESHOLD||event.clientY>=rect.bottom+Private2.DETACH_THRESHOLD}Private2.detachExceeded=detachExceeded;function layoutTabs(tabs,data,event,orientation){var pressPos,localPos,clientPos,clientSize;orientation==="horizontal"?(pressPos=data.pressX,localPos=event.clientX-data.contentRect.left,clientPos=event.clientX,clientSize=data.contentRect.width):(pressPos=data.pressY,localPos=event.clientY-data.contentRect.top,clientPos=event.clientY,clientSize=data.contentRect.height);for(var targetIndex=data.index,targetPos=localPos-data.tabPressPos,targetEnd=targetPos+data.tabSize,i=0,n=tabs.length;i<n;++i){var pxPos=void 0,layout=data.tabLayout[i],threshold=layout.pos+(layout.size>>1);if(i<data.index&&targetPos<threshold)pxPos=data.tabSize+data.tabLayout[i+1].margin+"px",targetIndex=Math.min(targetIndex,i);else if(i>data.index&&targetEnd>threshold)pxPos=-data.tabSize-layout.margin+"px",targetIndex=Math.max(targetIndex,i);else if(i===data.index){var ideal=clientPos-pressPos,limit=clientSize-(data.tabPos+data.tabSize);pxPos=Math.max(-data.tabPos,Math.min(ideal,limit))+"px"}else pxPos="";orientation==="horizontal"?tabs[i].style.left=pxPos:tabs[i].style.top=pxPos}data.targetIndex=targetIndex}Private2.layoutTabs=layoutTabs;function finalizeTabPosition(data,orientation){var clientSize;orientation==="horizontal"?clientSize=data.contentRect.width:clientSize=data.contentRect.height;var ideal;if(data.targetIndex===data.index)ideal=0;else if(data.targetIndex>data.index){var tgt=data.tabLayout[data.targetIndex];ideal=tgt.pos+tgt.size-data.tabSize-data.tabPos}else{var tgt=data.tabLayout[data.targetIndex];ideal=tgt.pos-data.tabPos}var limit=clientSize-(data.tabPos+data.tabSize),final=Math.max(-data.tabPos,Math.min(ideal,limit));orientation==="horizontal"?data.tab.style.left=final+"px":data.tab.style.top=final+"px"}Private2.finalizeTabPosition=finalizeTabPosition;function resetTabPositions(tabs,orientation){each(tabs,function(tab){orientation==="horizontal"?tab.style.left="":tab.style.top=""})}Private2.resetTabPositions=resetTabPositions})(Private$7||(Private$7={}));var DockLayout=function(_super){__extends(DockLayout2,_super);function DockLayout2(options){var _this=_super.call(this)||this;return _this._spacing=4,_this._dirty=!1,_this._root=null,_this._box=null,_this._items=new Map,_this.renderer=options.renderer,options.spacing!==void 0&&(_this._spacing=Utils$1.clampDimension(options.spacing)),_this._document=options.document||document,_this._hiddenMode=options.hiddenMode!==void 0?options.hiddenMode:Widget.HiddenMode.Display,_this}return DockLayout2.prototype.dispose=function(){var widgets=this.iter();this._items.forEach(function(item){item.dispose()}),this._box=null,this._root=null,this._items.clear(),each(widgets,function(widget){widget.dispose()}),_super.prototype.dispose.call(this)},Object.defineProperty(DockLayout2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(v){var _this=this;this._hiddenMode!==v&&(this._hiddenMode=v,each(this.tabBars(),function(bar){bar.titles.length>1&&bar.titles.forEach(function(title){title.owner.hiddenMode=_this._hiddenMode})}))},enumerable:!0,configurable:!0}),Object.defineProperty(DockLayout2.prototype,"spacing",{get:function(){return this._spacing},set:function(value){value=Utils$1.clampDimension(value),this._spacing!==value&&(this._spacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(DockLayout2.prototype,"isEmpty",{get:function(){return this._root===null},enumerable:!0,configurable:!0}),DockLayout2.prototype.iter=function(){return this._root?this._root.iterAllWidgets():empty()},DockLayout2.prototype.widgets=function(){return this._root?this._root.iterUserWidgets():empty()},DockLayout2.prototype.selectedWidgets=function(){return this._root?this._root.iterSelectedWidgets():empty()},DockLayout2.prototype.tabBars=function(){return this._root?this._root.iterTabBars():empty()},DockLayout2.prototype.handles=function(){return this._root?this._root.iterHandles():empty()},DockLayout2.prototype.moveHandle=function(handle,offsetX,offsetY){var hidden=handle.classList.contains("lm-mod-hidden");if(hidden=hidden||handle.classList.contains("p-mod-hidden"),!(!this._root||hidden)){var data=this._root.findSplitNode(handle);if(data){var delta;data.node.orientation==="horizontal"?delta=offsetX-handle.offsetLeft:delta=offsetY-handle.offsetTop,delta!==0&&(data.node.holdSizes(),BoxEngine.adjust(data.node.sizers,data.index,delta),this.parent&&this.parent.update())}}},DockLayout2.prototype.saveLayout=function(){return this._root?(this._root.holdAllSizes(),{main:this._root.createConfig()}):{main:null}},DockLayout2.prototype.restoreLayout=function(config){var _this=this,widgetSet=new Set,mainConfig;config.main?mainConfig=Private$6.normalizeAreaConfig(config.main,widgetSet):mainConfig=null;var oldWidgets=this.widgets(),oldTabBars=this.tabBars(),oldHandles=this.handles();this._root=null,each(oldWidgets,function(widget){widgetSet.has(widget)||(widget.parent=null)}),each(oldTabBars,function(tabBar){tabBar.dispose()}),each(oldHandles,function(handle){handle.parentNode&&handle.parentNode.removeChild(handle)}),widgetSet.forEach(function(widget){widget.parent=_this.parent}),mainConfig?this._root=Private$6.realizeAreaConfig(mainConfig,{createTabBar:function(document2){return _this._createTabBar()},createHandle:function(){return _this._createHandle()}},this._document):this._root=null,this.parent&&(widgetSet.forEach(function(widget){_this.attachWidget(widget)}),this.parent.fit())},DockLayout2.prototype.addWidget=function(widget,options){options===void 0&&(options={});var ref=options.ref||null,mode=options.mode||"tab-after",refNode=null;if(this._root&&ref&&(refNode=this._root.findTabNode(ref)),ref&&!refNode)throw new Error("Reference widget is not in the layout.");switch(widget.parent=this.parent,mode){case"tab-after":this._insertTab(widget,ref,refNode,!0);break;case"tab-before":this._insertTab(widget,ref,refNode,!1);break;case"split-top":this._insertSplit(widget,ref,refNode,"vertical",!1);break;case"split-left":this._insertSplit(widget,ref,refNode,"horizontal",!1);break;case"split-right":this._insertSplit(widget,ref,refNode,"horizontal",!0);break;case"split-bottom":this._insertSplit(widget,ref,refNode,"vertical",!0);break}this.parent&&(this.attachWidget(widget),this.parent.fit())},DockLayout2.prototype.removeWidget=function(widget){this._removeWidget(widget),this.parent&&(this.detachWidget(widget),this.parent.fit())},DockLayout2.prototype.hitTestTabAreas=function(clientX,clientY){if(!this._root||!this.parent||!this.parent.isVisible)return null;this._box||(this._box=ElementExt.boxSizing(this.parent.node));var rect=this.parent.node.getBoundingClientRect(),x=clientX-rect.left-this._box.borderLeft,y=clientY-rect.top-this._box.borderTop,tabNode=this._root.hitTestTabNodes(x,y);if(!tabNode)return null;var tabBar=tabNode.tabBar,top=tabNode.top,left=tabNode.left,width=tabNode.width,height=tabNode.height,borderWidth=this._box.borderLeft+this._box.borderRight,borderHeight=this._box.borderTop+this._box.borderBottom,right=rect.width-borderWidth-(left+width),bottom=rect.height-borderHeight-(top+height);return{tabBar,x,y,top,left,right,bottom,width,height}},DockLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)}),each(this.handles(),function(handle){_this.parent.node.appendChild(handle)}),this.parent.fit()},DockLayout2.prototype.attachWidget=function(widget){this.parent.node!==widget.node.parentNode&&(this._items.set(widget,new LayoutItem(widget)),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach))},DockLayout2.prototype.detachWidget=function(widget){if(this.parent.node===widget.node.parentNode){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach);var item=this._items.get(widget);item&&(this._items.delete(widget),item.dispose())}},DockLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},DockLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},DockLayout2.prototype.onChildShown=function(msg){this.parent.fit()},DockLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},DockLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},DockLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},DockLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},DockLayout2.prototype._removeWidget=function(widget){if(this._root){var tabNode=this._root.findTabNode(widget);if(tabNode){if(Private$6.removeAria(widget),tabNode.tabBar.titles.length>1){if(tabNode.tabBar.removeTab(widget.title),this._hiddenMode===Widget.HiddenMode.Scale&&tabNode.tabBar.titles.length==1){var existingWidget=tabNode.tabBar.titles[0].owner;existingWidget.hiddenMode=Widget.HiddenMode.Display}return}if(tabNode.tabBar.dispose(),this._root===tabNode){this._root=null;return}this._root.holdAllSizes();var splitNode=tabNode.parent;tabNode.parent=null;var i=ArrayExt.removeFirstOf(splitNode.children,tabNode),handle=ArrayExt.removeAt(splitNode.handles,i);if(ArrayExt.removeAt(splitNode.sizers,i),handle.parentNode&&handle.parentNode.removeChild(handle),splitNode.children.length>1){splitNode.syncHandles();return}var maybeParent=splitNode.parent;splitNode.parent=null;var childNode=splitNode.children[0],childHandle=splitNode.handles[0];if(splitNode.children.length=0,splitNode.handles.length=0,splitNode.sizers.length=0,childHandle.parentNode&&childHandle.parentNode.removeChild(childHandle),this._root===splitNode){childNode.parent=null,this._root=childNode;return}var parentNode=maybeParent,j=parentNode.children.indexOf(splitNode);if(childNode instanceof Private$6.TabLayoutNode){childNode.parent=parentNode,parentNode.children[j]=childNode;return}var splitHandle=ArrayExt.removeAt(parentNode.handles,j);ArrayExt.removeAt(parentNode.children,j),ArrayExt.removeAt(parentNode.sizers,j),splitHandle.parentNode&&splitHandle.parentNode.removeChild(splitHandle);for(var i_1=0,n=childNode.children.length;i_1<n;++i_1){var gChild=childNode.children[i_1],gHandle=childNode.handles[i_1],gSizer=childNode.sizers[i_1];ArrayExt.insert(parentNode.children,j+i_1,gChild),ArrayExt.insert(parentNode.handles,j+i_1,gHandle),ArrayExt.insert(parentNode.sizers,j+i_1,gSizer),gChild.parent=parentNode}childNode.children.length=0,childNode.handles.length=0,childNode.sizers.length=0,childNode.parent=null,parentNode.syncHandles()}}},DockLayout2.prototype._insertTab=function(widget,ref,refNode,after){if(widget!==ref){if(!this._root){var tabNode=new Private$6.TabLayoutNode(this._createTabBar());tabNode.tabBar.addTab(widget.title),this._root=tabNode,Private$6.addAria(widget,tabNode.tabBar);return}refNode||(refNode=this._root.findFirstTabNode()),refNode.tabBar.titles.indexOf(widget.title)===-1&&(this._removeWidget(widget),widget.hide());var index;if(ref?index=refNode.tabBar.titles.indexOf(ref.title):index=refNode.tabBar.currentIndex,this._hiddenMode===Widget.HiddenMode.Scale)if(refNode.tabBar.titles.length===0)widget.hiddenMode=Widget.HiddenMode.Display;else if(refNode.tabBar.titles.length==1){var existingWidget=refNode.tabBar.titles[0].owner;existingWidget.hiddenMode=Widget.HiddenMode.Scale}else widget.hiddenMode=Widget.HiddenMode.Scale;else widget.hiddenMode=this._hiddenMode;refNode.tabBar.insertTab(index+(after?1:0),widget.title),Private$6.addAria(widget,refNode.tabBar)}},DockLayout2.prototype._insertSplit=function(widget,ref,refNode,orientation,after){if(!(widget===ref&&refNode&&refNode.tabBar.titles.length===1)){this._removeWidget(widget);var tabNode=new Private$6.TabLayoutNode(this._createTabBar());if(tabNode.tabBar.addTab(widget.title),Private$6.addAria(widget,tabNode.tabBar),!this._root){this._root=tabNode;return}if(!refNode||!refNode.parent){var root=this._splitRoot(orientation),i_2=after?root.children.length:0;root.normalizeSizes();var sizer=Private$6.createSizer(refNode?1:Private$6.GOLDEN_RATIO);ArrayExt.insert(root.children,i_2,tabNode),ArrayExt.insert(root.sizers,i_2,sizer),ArrayExt.insert(root.handles,i_2,this._createHandle()),tabNode.parent=root,root.normalizeSizes(),root.syncHandles();return}var splitNode=refNode.parent;if(splitNode.orientation===orientation){var i_3=splitNode.children.indexOf(refNode);splitNode.normalizeSizes();var s=splitNode.sizers[i_3].sizeHint/=2,j_1=i_3+(after?1:0);ArrayExt.insert(splitNode.children,j_1,tabNode),ArrayExt.insert(splitNode.sizers,j_1,Private$6.createSizer(s)),ArrayExt.insert(splitNode.handles,j_1,this._createHandle()),tabNode.parent=splitNode,splitNode.syncHandles();return}var i=ArrayExt.removeFirstOf(splitNode.children,refNode),childNode=new Private$6.SplitLayoutNode(orientation);childNode.normalized=!0,childNode.children.push(refNode),childNode.sizers.push(Private$6.createSizer(.5)),childNode.handles.push(this._createHandle()),refNode.parent=childNode;var j=after?1:0;ArrayExt.insert(childNode.children,j,tabNode),ArrayExt.insert(childNode.sizers,j,Private$6.createSizer(.5)),ArrayExt.insert(childNode.handles,j,this._createHandle()),tabNode.parent=childNode,childNode.syncHandles(),ArrayExt.insert(splitNode.children,i,childNode),childNode.parent=splitNode}},DockLayout2.prototype._splitRoot=function(orientation){var oldRoot=this._root;if(oldRoot instanceof Private$6.SplitLayoutNode&&oldRoot.orientation===orientation)return oldRoot;var newRoot=this._root=new Private$6.SplitLayoutNode(orientation);return oldRoot&&(newRoot.children.push(oldRoot),newRoot.sizers.push(Private$6.createSizer(0)),newRoot.handles.push(this._createHandle()),oldRoot.parent=newRoot),newRoot},DockLayout2.prototype._fit=function(){var minW=0,minH=0;if(this._root){var limits=this._root.fit(this._spacing,this._items);minW=limits.minWidth,minH=limits.minHeight}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},DockLayout2.prototype._update=function(offsetWidth,offsetHeight){if(this._dirty=!1,!!this._root){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var x=this._box.paddingTop,y=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum;this._root.update(x,y,width,height,this._spacing,this._items)}},DockLayout2.prototype._createTabBar=function(){var tabBar=this.renderer.createTabBar(this._document);return tabBar.orientation="horizontal",this.parent&&(tabBar.parent=this.parent,this.attachWidget(tabBar)),tabBar},DockLayout2.prototype._createHandle=function(){var handle=this.renderer.createHandle(),style=handle.style;return style.position="absolute",style.top="0",style.left="0",style.width="0",style.height="0",this.parent&&this.parent.node.appendChild(handle),handle},DockLayout2}(Layout),Private$6;(function(Private2){Private2.GOLDEN_RATIO=.618;function createSizer(hint){var sizer=new BoxSizer;return sizer.sizeHint=hint,sizer.size=hint,sizer}Private2.createSizer=createSizer;function normalizeAreaConfig(config,widgetSet){var result;return config.type==="tab-area"?result=normalizeTabAreaConfig(config,widgetSet):result=normalizeSplitAreaConfig(config,widgetSet),result}Private2.normalizeAreaConfig=normalizeAreaConfig;function realizeAreaConfig(config,renderer,document2){var node;return config.type==="tab-area"?node=realizeTabAreaConfig(config,renderer,document2):node=realizeSplitAreaConfig(config,renderer,document2),node}Private2.realizeAreaConfig=realizeAreaConfig;var TabLayoutNode=function(){function TabLayoutNode2(tabBar){this.parent=null,this._top=0,this._left=0,this._width=0,this._height=0;var tabSizer=new BoxSizer,widgetSizer=new BoxSizer;tabSizer.stretch=0,widgetSizer.stretch=1,this.tabBar=tabBar,this.sizers=[tabSizer,widgetSizer]}return Object.defineProperty(TabLayoutNode2.prototype,"top",{get:function(){return this._top},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"left",{get:function(){return this._left},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(TabLayoutNode2.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),TabLayoutNode2.prototype.iterAllWidgets=function(){return chain(once(this.tabBar),this.iterUserWidgets())},TabLayoutNode2.prototype.iterUserWidgets=function(){return map(this.tabBar.titles,function(title){return title.owner})},TabLayoutNode2.prototype.iterSelectedWidgets=function(){var title=this.tabBar.currentTitle;return title?once(title.owner):empty()},TabLayoutNode2.prototype.iterTabBars=function(){return once(this.tabBar)},TabLayoutNode2.prototype.iterHandles=function(){return empty()},TabLayoutNode2.prototype.findTabNode=function(widget){return this.tabBar.titles.indexOf(widget.title)!==-1?this:null},TabLayoutNode2.prototype.findSplitNode=function(handle){return null},TabLayoutNode2.prototype.findFirstTabNode=function(){return this},TabLayoutNode2.prototype.hitTestTabNodes=function(x,y){return x<this._left||x>=this._left+this._width||y<this._top||y>=this._top+this._height?null:this},TabLayoutNode2.prototype.createConfig=function(){var widgets=this.tabBar.titles.map(function(title){return title.owner}),currentIndex=this.tabBar.currentIndex;return{type:"tab-area",widgets,currentIndex}},TabLayoutNode2.prototype.holdAllSizes=function(){},TabLayoutNode2.prototype.fit=function(spacing,items){var minWidth=0,minHeight=0,maxWidth=1/0,maxHeight=1/0,tabBarItem=items.get(this.tabBar),current=this.tabBar.currentTitle,widgetItem=current?items.get(current.owner):void 0,_a=this.sizers,tabBarSizer=_a[0],widgetSizer=_a[1];return tabBarItem&&tabBarItem.fit(),widgetItem&&widgetItem.fit(),tabBarItem&&!tabBarItem.isHidden?(minWidth=Math.max(minWidth,tabBarItem.minWidth),minHeight+=tabBarItem.minHeight,tabBarSizer.minSize=tabBarItem.minHeight,tabBarSizer.maxSize=tabBarItem.maxHeight):(tabBarSizer.minSize=0,tabBarSizer.maxSize=0),widgetItem&&!widgetItem.isHidden?(minWidth=Math.max(minWidth,widgetItem.minWidth),minHeight+=widgetItem.minHeight,widgetSizer.minSize=widgetItem.minHeight,widgetSizer.maxSize=1/0):(widgetSizer.minSize=0,widgetSizer.maxSize=1/0),{minWidth,minHeight,maxWidth,maxHeight}},TabLayoutNode2.prototype.update=function(left,top,width,height,spacing,items){this._top=top,this._left=left,this._width=width,this._height=height;var tabBarItem=items.get(this.tabBar),current=this.tabBar.currentTitle,widgetItem=current?items.get(current.owner):void 0;if(BoxEngine.calc(this.sizers,height),tabBarItem&&!tabBarItem.isHidden){var size=this.sizers[0].size;tabBarItem.update(left,top,width,size),top+=size}if(widgetItem&&!widgetItem.isHidden){var size=this.sizers[1].size;widgetItem.update(left,top,width,size)}},TabLayoutNode2}();Private2.TabLayoutNode=TabLayoutNode;var SplitLayoutNode=function(){function SplitLayoutNode2(orientation){this.parent=null,this.normalized=!1,this.children=[],this.sizers=[],this.handles=[],this.orientation=orientation}return SplitLayoutNode2.prototype.iterAllWidgets=function(){var children=map(this.children,function(child){return child.iterAllWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterUserWidgets=function(){var children=map(this.children,function(child){return child.iterUserWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterSelectedWidgets=function(){var children=map(this.children,function(child){return child.iterSelectedWidgets()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterTabBars=function(){var children=map(this.children,function(child){return child.iterTabBars()});return new ChainIterator(children)},SplitLayoutNode2.prototype.iterHandles=function(){var children=map(this.children,function(child){return child.iterHandles()});return chain(this.handles,new ChainIterator(children))},SplitLayoutNode2.prototype.findTabNode=function(widget){for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].findTabNode(widget);if(result)return result}return null},SplitLayoutNode2.prototype.findSplitNode=function(handle){var index=this.handles.indexOf(handle);if(index!==-1)return{index,node:this};for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].findSplitNode(handle);if(result)return result}return null},SplitLayoutNode2.prototype.findFirstTabNode=function(){return this.children.length===0?null:this.children[0].findFirstTabNode()},SplitLayoutNode2.prototype.hitTestTabNodes=function(x,y){for(var i=0,n=this.children.length;i<n;++i){var result=this.children[i].hitTestTabNodes(x,y);if(result)return result}return null},SplitLayoutNode2.prototype.createConfig=function(){var orientation=this.orientation,sizes=this.createNormalizedSizes(),children=this.children.map(function(child){return child.createConfig()});return{type:"split-area",orientation,children,sizes}},SplitLayoutNode2.prototype.syncHandles=function(){var _this=this;each(this.handles,function(handle,i){handle.setAttribute("data-orientation",_this.orientation),i===_this.handles.length-1?(handle.classList.add("lm-mod-hidden"),handle.classList.add("p-mod-hidden")):(handle.classList.remove("lm-mod-hidden"),handle.classList.remove("p-mod-hidden"))})},SplitLayoutNode2.prototype.holdSizes=function(){each(this.sizers,function(sizer){sizer.sizeHint=sizer.size})},SplitLayoutNode2.prototype.holdAllSizes=function(){each(this.children,function(child){return child.holdAllSizes()}),this.holdSizes()},SplitLayoutNode2.prototype.normalizeSizes=function(){var n=this.sizers.length;if(n!==0){this.holdSizes();var sum=reduce(this.sizers,function(v,sizer){return v+sizer.sizeHint},0);sum===0?each(this.sizers,function(sizer){sizer.size=sizer.sizeHint=1/n}):each(this.sizers,function(sizer){sizer.size=sizer.sizeHint/=sum}),this.normalized=!0}},SplitLayoutNode2.prototype.createNormalizedSizes=function(){var n=this.sizers.length;if(n===0)return[];var sizes=this.sizers.map(function(sizer){return sizer.size}),sum=reduce(sizes,function(v,size){return v+size},0);return sum===0?each(sizes,function(size,i){sizes[i]=1/n}):each(sizes,function(size,i){sizes[i]=size/sum}),sizes},SplitLayoutNode2.prototype.fit=function(spacing,items){for(var horizontal=this.orientation==="horizontal",fixed=Math.max(0,this.children.length-1)*spacing,minWidth=horizontal?fixed:0,minHeight=horizontal?0:fixed,maxWidth=1/0,maxHeight=1/0,i=0,n=this.children.length;i<n;++i){var limits=this.children[i].fit(spacing,items);horizontal?(minHeight=Math.max(minHeight,limits.minHeight),minWidth+=limits.minWidth,this.sizers[i].minSize=limits.minWidth):(minWidth=Math.max(minWidth,limits.minWidth),minHeight+=limits.minHeight,this.sizers[i].minSize=limits.minHeight)}return{minWidth,minHeight,maxWidth,maxHeight}},SplitLayoutNode2.prototype.update=function(left,top,width,height,spacing,items){var horizontal=this.orientation==="horizontal",fixed=Math.max(0,this.children.length-1)*spacing,space=Math.max(0,(horizontal?width:height)-fixed);this.normalized&&(each(this.sizers,function(sizer){sizer.sizeHint*=space}),this.normalized=!1),BoxEngine.calc(this.sizers,space);for(var i=0,n=this.children.length;i<n;++i){var child=this.children[i],size=this.sizers[i].size,handleStyle=this.handles[i].style;horizontal?(child.update(left,top,size,height,spacing,items),left+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=spacing+"px",handleStyle.height=height+"px",left+=spacing):(child.update(left,top,width,size,spacing,items),top+=size,handleStyle.top=top+"px",handleStyle.left=left+"px",handleStyle.width=width+"px",handleStyle.height=spacing+"px",top+=spacing)}},SplitLayoutNode2}();Private2.SplitLayoutNode=SplitLayoutNode;function addAria(widget,tabBar){widget.node.setAttribute("role","tabpanel");var renderer=tabBar.renderer;if(renderer instanceof TabBar.Renderer){var tabId=renderer.createTabKey({title:widget.title,current:!1,zIndex:0});widget.node.setAttribute("aria-labelledby",tabId)}}Private2.addAria=addAria;function removeAria(widget){widget.node.removeAttribute("role"),widget.node.removeAttribute("aria-labelledby")}Private2.removeAria=removeAria;function normalizeTabAreaConfig(config,widgetSet){if(config.widgets.length===0)return null;var widgets=[];if(each(config.widgets,function(widget){widgetSet.has(widget)||(widgetSet.add(widget),widgets.push(widget))}),widgets.length===0)return null;var index=config.currentIndex;return index!==-1&&(index<0||index>=widgets.length)&&(index=0),{type:"tab-area",widgets,currentIndex:index}}function normalizeSplitAreaConfig(config,widgetSet){for(var orientation=config.orientation,children=[],sizes=[],i=0,n=config.children.length;i<n;++i){var child=normalizeAreaConfig(config.children[i],widgetSet);child&&(child.type==="tab-area"||child.orientation!==orientation?(children.push(child),sizes.push(Math.abs(config.sizes[i]||0))):(children.push.apply(children,child.children),sizes.push.apply(sizes,child.sizes)))}return children.length===0?null:children.length===1?children[0]:{type:"split-area",orientation,children,sizes}}function realizeTabAreaConfig(config,renderer,document2){var tabBar=renderer.createTabBar(document2);return each(config.widgets,function(widget){widget.hide(),tabBar.addTab(widget.title),Private2.addAria(widget,tabBar)}),tabBar.currentIndex=config.currentIndex,new TabLayoutNode(tabBar)}function realizeSplitAreaConfig(config,renderer,document2){var node=new SplitLayoutNode(config.orientation);return each(config.children,function(child,i){var childNode=realizeAreaConfig(child,renderer,document2),sizer=createSizer(config.sizes[i]),handle=renderer.createHandle();node.children.push(childNode),node.handles.push(handle),node.sizers.push(sizer),childNode.parent=node}),node.syncHandles(),node.normalizeSizes(),node}})(Private$6||(Private$6={}));var DockPanel$1=function(_super){__extends(DockPanel2,_super);function DockPanel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;_this._drag=null,_this._tabsMovable=!0,_this._tabsConstrained=!1,_this._addButtonEnabled=!1,_this._pressData=null,_this._layoutModified=new Signal(_this),_this._addRequested=new Signal(_this),_this.addClass("lm-DockPanel"),_this.addClass("p-DockPanel"),_this._document=options.document||document,_this._mode=options.mode||"multiple-document",_this._renderer=options.renderer||DockPanel2.defaultRenderer,_this._edges=options.edges||Private$5.DEFAULT_EDGES,options.tabsMovable!==void 0&&(_this._tabsMovable=options.tabsMovable),options.tabsConstrained!==void 0&&(_this._tabsConstrained=options.tabsConstrained),options.addButtonEnabled!==void 0&&(_this._addButtonEnabled=options.addButtonEnabled),_this.dataset.mode=_this._mode;var renderer={createTabBar:function(){return _this._createTabBar()},createHandle:function(){return _this._createHandle()}};return _this.layout=new DockLayout({document:_this._document,renderer,spacing:options.spacing,hiddenMode:options.hiddenMode}),_this.overlay=options.overlay||new DockPanel2.Overlay,_this.node.appendChild(_this.overlay.node),_this}return DockPanel2.prototype.dispose=function(){this._releaseMouse(),this.overlay.hide(0),this._drag&&this._drag.dispose(),_super.prototype.dispose.call(this)},Object.defineProperty(DockPanel2.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(v){this.layout.hiddenMode=v},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"layoutModified",{get:function(){return this._layoutModified},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"renderer",{get:function(){return this.layout.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"spacing",{get:function(){return this.layout.spacing},set:function(value){this.layout.spacing=value},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"mode",{get:function(){return this._mode},set:function(value){if(this._mode!==value){this._mode=value,this.dataset.mode=value;var layout=this.layout;switch(value){case"multiple-document":each(layout.tabBars(),function(tabBar){tabBar.show()});break;case"single-document":layout.restoreLayout(Private$5.createSingleDocumentConfig(this));break;default:throw"unreachable"}MessageLoop.postMessage(this,Private$5.LayoutModified)}},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"tabsMovable",{get:function(){return this._tabsMovable},set:function(value){this._tabsMovable=value,each(this.tabBars(),function(tabbar){tabbar.tabsMovable=value})},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"tabsConstrained",{get:function(){return this._tabsConstrained},set:function(value){this._tabsConstrained=value},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"addButtonEnabled",{get:function(){return this._addButtonEnabled},set:function(value){this._addButtonEnabled=value,each(this.tabBars(),function(tabbar){tabbar.addButtonEnabled=value})},enumerable:!0,configurable:!0}),Object.defineProperty(DockPanel2.prototype,"isEmpty",{get:function(){return this.layout.isEmpty},enumerable:!0,configurable:!0}),DockPanel2.prototype.widgets=function(){return this.layout.widgets()},DockPanel2.prototype.selectedWidgets=function(){return this.layout.selectedWidgets()},DockPanel2.prototype.tabBars=function(){return this.layout.tabBars()},DockPanel2.prototype.handles=function(){return this.layout.handles()},DockPanel2.prototype.selectWidget=function(widget){var tabBar=find(this.tabBars(),function(bar){return bar.titles.indexOf(widget.title)!==-1});if(!tabBar)throw new Error("Widget is not contained in the dock panel.");tabBar.currentTitle=widget.title},DockPanel2.prototype.activateWidget=function(widget){this.selectWidget(widget),widget.activate()},DockPanel2.prototype.saveLayout=function(){return this.layout.saveLayout()},DockPanel2.prototype.restoreLayout=function(config){this._mode="multiple-document",this.layout.restoreLayout(config),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush(),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype.addWidget=function(widget,options){options===void 0&&(options={}),this._mode==="single-document"?this.layout.addWidget(widget):this.layout.addWidget(widget,options),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype.processMessage=function(msg){msg.type==="layout-modified"?this._layoutModified.emit(void 0):_super.prototype.processMessage.call(this,msg)},DockPanel2.prototype.handleEvent=function(event){switch(event.type){case"lm-dragenter":this._evtDragEnter(event);break;case"lm-dragleave":this._evtDragLeave(event);break;case"lm-dragover":this._evtDragOver(event);break;case"lm-drop":this._evtDrop(event);break;case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"pointerdown":this._evtMouseDown(event);break;case"pointermove":this._evtMouseMove(event);break;case"pointerup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},DockPanel2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("lm-dragenter",this),this.node.addEventListener("lm-dragleave",this),this.node.addEventListener("lm-dragover",this),this.node.addEventListener("lm-drop",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("pointerdown",this)},DockPanel2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("lm-dragenter",this),this.node.removeEventListener("lm-dragleave",this),this.node.removeEventListener("lm-dragover",this),this.node.removeEventListener("lm-drop",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("pointerdown",this),this._releaseMouse()},DockPanel2.prototype.onChildAdded=function(msg){Private$5.isGeneratedTabBarProperty.get(msg.child)||(msg.child.addClass("lm-DockPanel-widget"),msg.child.addClass("p-DockPanel-widget"))},DockPanel2.prototype.onChildRemoved=function(msg){Private$5.isGeneratedTabBarProperty.get(msg.child)||(msg.child.removeClass("lm-DockPanel-widget"),msg.child.removeClass("p-DockPanel-widget"),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._evtDragEnter=function(event){event.mimeData.hasData("application/vnd.lumino.widget-factory")&&(event.preventDefault(),event.stopPropagation())},DockPanel2.prototype._evtDragLeave=function(event){event.preventDefault(),!(this._tabsConstrained&&event.source!==this)&&(event.stopPropagation(),this.overlay.hide(1))},DockPanel2.prototype._evtDragOver=function(event){event.preventDefault(),this._tabsConstrained&&event.source!==this||this._showOverlay(event.clientX,event.clientY)==="invalid"?event.dropAction="none":(event.stopPropagation(),event.dropAction=event.proposedAction)},DockPanel2.prototype._evtDrop=function(event){if(event.preventDefault(),this.overlay.hide(0),event.proposedAction==="none"){event.dropAction="none";return}var clientX=event.clientX,clientY=event.clientY,_a=Private$5.findDropTarget(this,clientX,clientY,this._edges),zone=_a.zone,target=_a.target;if(this._tabsConstrained&&event.source!==this||zone==="invalid"){event.dropAction="none";return}var mimeData=event.mimeData,factory=mimeData.getData("application/vnd.lumino.widget-factory");if(typeof factory!="function"){event.dropAction="none";return}var widget=factory();if(!(widget instanceof Widget)){event.dropAction="none";return}if(widget.contains(this)){event.dropAction="none";return}var ref=target?Private$5.getDropRef(target.tabBar):null;switch(zone){case"root-all":this.addWidget(widget);break;case"root-top":this.addWidget(widget,{mode:"split-top"});break;case"root-left":this.addWidget(widget,{mode:"split-left"});break;case"root-right":this.addWidget(widget,{mode:"split-right"});break;case"root-bottom":this.addWidget(widget,{mode:"split-bottom"});break;case"widget-all":this.addWidget(widget,{mode:"tab-after",ref});break;case"widget-top":this.addWidget(widget,{mode:"split-top",ref});break;case"widget-left":this.addWidget(widget,{mode:"split-left",ref});break;case"widget-right":this.addWidget(widget,{mode:"split-right",ref});break;case"widget-bottom":this.addWidget(widget,{mode:"split-bottom",ref});break;case"widget-tab":this.addWidget(widget,{mode:"tab-after",ref});break;default:throw"unreachable"}event.dropAction=event.proposedAction,event.stopPropagation(),this.activateWidget(widget)},DockPanel2.prototype._evtKeyDown=function(event){event.preventDefault(),event.stopPropagation(),event.keyCode===27&&(this._releaseMouse(),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._evtMouseDown=function(event){if(event.button===0){var layout=this.layout,target=event.target,handle=find(layout.handles(),function(handle2){return handle2.contains(target)});if(handle){event.preventDefault(),event.stopPropagation(),this._document.addEventListener("keydown",this,!0),this._document.addEventListener("mouseup",this,!0),this._document.addEventListener("mousemove",this,!0),this._document.addEventListener("pointerup",this,!0),this._document.addEventListener("pointermove",this,!0),this._document.addEventListener("contextmenu",this,!0);var rect=handle.getBoundingClientRect(),deltaX=event.clientX-rect.left,deltaY=event.clientY-rect.top,style=window.getComputedStyle(handle),override=Drag.overrideCursor(style.cursor,this._document);this._pressData={handle,deltaX,deltaY,override}}}},DockPanel2.prototype._evtMouseMove=function(event){if(this._pressData){event.preventDefault(),event.stopPropagation();var rect=this.node.getBoundingClientRect(),xPos=event.clientX-rect.left-this._pressData.deltaX,yPos=event.clientY-rect.top-this._pressData.deltaY,layout=this.layout;layout.moveHandle(this._pressData.handle,xPos,yPos)}},DockPanel2.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse(),MessageLoop.postMessage(this,Private$5.LayoutModified))},DockPanel2.prototype._releaseMouse=function(){this._pressData&&(this._pressData.override.dispose(),this._pressData=null,this._document.removeEventListener("keydown",this,!0),this._document.removeEventListener("mouseup",this,!0),this._document.removeEventListener("mousemove",this,!0),this._document.removeEventListener("pointerup",this,!0),this._document.removeEventListener("pointermove",this,!0),this._document.removeEventListener("contextmenu",this,!0))},DockPanel2.prototype._showOverlay=function(clientX,clientY){var _a=Private$5.findDropTarget(this,clientX,clientY,this._edges),zone=_a.zone,target=_a.target;if(zone==="invalid")return this.overlay.hide(100),zone;var top,left,right,bottom,box=ElementExt.boxSizing(this.node),rect=this.node.getBoundingClientRect();switch(zone){case"root-all":top=box.paddingTop,left=box.paddingLeft,right=box.paddingRight,bottom=box.paddingBottom;break;case"root-top":top=box.paddingTop,left=box.paddingLeft,right=box.paddingRight,bottom=rect.height*Private$5.GOLDEN_RATIO;break;case"root-left":top=box.paddingTop,left=box.paddingLeft,right=rect.width*Private$5.GOLDEN_RATIO,bottom=box.paddingBottom;break;case"root-right":top=box.paddingTop,left=rect.width*Private$5.GOLDEN_RATIO,right=box.paddingRight,bottom=box.paddingBottom;break;case"root-bottom":top=rect.height*Private$5.GOLDEN_RATIO,left=box.paddingLeft,right=box.paddingRight,bottom=box.paddingBottom;break;case"widget-all":top=target.top,left=target.left,right=target.right,bottom=target.bottom;break;case"widget-top":top=target.top,left=target.left,right=target.right,bottom=target.bottom+target.height/2;break;case"widget-left":top=target.top,left=target.left,right=target.right+target.width/2,bottom=target.bottom;break;case"widget-right":top=target.top,left=target.left+target.width/2,right=target.right,bottom=target.bottom;break;case"widget-bottom":top=target.top+target.height/2,left=target.left,right=target.right,bottom=target.bottom;break;case"widget-tab":var tabHeight=target.tabBar.node.getBoundingClientRect().height;top=target.top,left=target.left,right=target.right,bottom=target.bottom+target.height-tabHeight;break;default:throw"unreachable"}return this.overlay.show({top,left,right,bottom}),zone},DockPanel2.prototype._createTabBar=function(){var tabBar=this._renderer.createTabBar(this._document);return Private$5.isGeneratedTabBarProperty.set(tabBar,!0),this._mode==="single-document"&&tabBar.hide(),tabBar.tabsMovable=this._tabsMovable,tabBar.allowDeselect=!1,tabBar.addButtonEnabled=this._addButtonEnabled,tabBar.removeBehavior="select-previous-tab",tabBar.insertBehavior="select-tab-if-needed",tabBar.tabMoved.connect(this._onTabMoved,this),tabBar.currentChanged.connect(this._onCurrentChanged,this),tabBar.tabCloseRequested.connect(this._onTabCloseRequested,this),tabBar.tabDetachRequested.connect(this._onTabDetachRequested,this),tabBar.tabActivateRequested.connect(this._onTabActivateRequested,this),tabBar.addRequested.connect(this._onTabAddRequested,this),tabBar},DockPanel2.prototype._createHandle=function(){return this._renderer.createHandle()},DockPanel2.prototype._onTabMoved=function(){MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype._onCurrentChanged=function(sender,args){var previousTitle=args.previousTitle,currentTitle=args.currentTitle;previousTitle&&previousTitle.owner.hide(),currentTitle&&currentTitle.owner.show(),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush(),MessageLoop.postMessage(this,Private$5.LayoutModified)},DockPanel2.prototype._onTabAddRequested=function(sender){this._addRequested.emit(sender)},DockPanel2.prototype._onTabActivateRequested=function(sender,args){args.title.owner.activate()},DockPanel2.prototype._onTabCloseRequested=function(sender,args){args.title.owner.close()},DockPanel2.prototype._onTabDetachRequested=function(sender,args){var _this=this;if(!this._drag){sender.releaseMouse();var title=args.title,tab=args.tab,clientX=args.clientX,clientY=args.clientY,mimeData=new MimeData,factory=function(){return title.owner};mimeData.setData("application/vnd.lumino.widget-factory",factory);var dragImage=tab.cloneNode(!0);this._drag=new Drag({document:this._document,mimeData,dragImage,proposedAction:"move",supportedActions:"move",source:this}),tab.classList.add("lm-mod-hidden"),tab.classList.add("p-mod-hidden");var cleanup=function(){_this._drag=null,tab.classList.remove("lm-mod-hidden"),tab.classList.remove("p-mod-hidden")};this._drag.start(clientX,clientY).then(cleanup)}},DockPanel2}(Widget);(function(DockPanel2){var Overlay=function(){function Overlay2(){this._timer=-1,this._hidden=!0,this.node=document.createElement("div"),this.node.classList.add("lm-DockPanel-overlay"),this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-DockPanel-overlay"),this.node.classList.add("p-mod-hidden"),this.node.style.position="absolute"}return Overlay2.prototype.show=function(geo){var style=this.node.style;style.top=geo.top+"px",style.left=geo.left+"px",style.right=geo.right+"px",style.bottom=geo.bottom+"px",clearTimeout(this._timer),this._timer=-1,this._hidden&&(this._hidden=!1,this.node.classList.remove("lm-mod-hidden"),this.node.classList.remove("p-mod-hidden"))},Overlay2.prototype.hide=function(delay){var _this=this;if(!this._hidden){if(delay<=0){clearTimeout(this._timer),this._timer=-1,this._hidden=!0,this.node.classList.add("lm-mod-hidden"),this.node.classList.add("p-mod-hidden");return}this._timer===-1&&(this._timer=window.setTimeout(function(){_this._timer=-1,_this._hidden=!0,_this.node.classList.add("lm-mod-hidden"),_this.node.classList.add("p-mod-hidden")},delay))}},Overlay2}();DockPanel2.Overlay=Overlay;var Renderer=function(){function Renderer2(){}return Renderer2.prototype.createTabBar=function(document2){var bar=new TabBar({document:document2});return bar.addClass("lm-DockPanel-tabBar"),bar.addClass("p-DockPanel-tabBar"),bar},Renderer2.prototype.createHandle=function(){var handle=document.createElement("div");return handle.className="lm-DockPanel-handle",handle.classList.add("p-DockPanel-handle"),handle},Renderer2}();DockPanel2.Renderer=Renderer,DockPanel2.defaultRenderer=new Renderer})(DockPanel$1||(DockPanel$1={}));var Private$5;(function(Private2){Private2.GOLDEN_RATIO=.618,Private2.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40},Private2.LayoutModified=new ConflatableMessage("layout-modified"),Private2.isGeneratedTabBarProperty=new AttachedProperty({name:"isGeneratedTabBar",create:function(){return!1}});function createSingleDocumentConfig(panel){if(panel.isEmpty)return{main:null};var widgets=toArray(panel.widgets()),selected=panel.selectedWidgets().next(),currentIndex=selected?widgets.indexOf(selected):-1;return{main:{type:"tab-area",widgets,currentIndex}}}Private2.createSingleDocumentConfig=createSingleDocumentConfig;function findDropTarget(panel,clientX,clientY,edges){if(!ElementExt.hitTest(panel.node,clientX,clientY))return{zone:"invalid",target:null};var layout=panel.layout;if(layout.isEmpty)return{zone:"root-all",target:null};if(panel.mode==="multiple-document"){var panelRect=panel.node.getBoundingClientRect(),pl=clientX-panelRect.left+1,pt=clientY-panelRect.top+1,pr=panelRect.right-clientX,pb=panelRect.bottom-clientY,pd=Math.min(pt,pr,pb,pl);switch(pd){case pt:if(pt<edges.top)return{zone:"root-top",target:null};break;case pr:if(pr<edges.right)return{zone:"root-right",target:null};break;case pb:if(pb<edges.bottom)return{zone:"root-bottom",target:null};break;case pl:if(pl<edges.left)return{zone:"root-left",target:null};break;default:throw"unreachable"}}var target=layout.hitTestTabAreas(clientX,clientY);if(!target)return{zone:"invalid",target:null};if(panel.mode==="single-document")return{zone:"widget-all",target};var al=target.x-target.left+1,at=target.y-target.top+1,ar=target.left+target.width-target.x,ab=target.top+target.height-target.y,tabHeight=target.tabBar.node.getBoundingClientRect().height;if(at<tabHeight)return{zone:"widget-tab",target};var rx=Math.round(target.width/3),ry=Math.round(target.height/3);if(al>rx&&ar>rx&&at>ry&&ab>ry)return{zone:"widget-all",target};al/=rx,at/=ry,ar/=rx,ab/=ry;var ad=Math.min(al,at,ar,ab),zone;switch(ad){case al:zone="widget-left";break;case at:zone="widget-top";break;case ar:zone="widget-right";break;case ab:zone="widget-bottom";break;default:throw"unreachable"}return{zone,target}}Private2.findDropTarget=findDropTarget;function getDropRef(tabBar){return tabBar.titles.length===0?null:tabBar.currentTitle?tabBar.currentTitle.owner:tabBar.titles[tabBar.titles.length-1].owner}Private2.getDropRef=getDropRef})(Private$5||(Private$5={})),function(){function FocusTracker(){this._counter=0,this._widgets=[],this._activeWidget=null,this._currentWidget=null,this._numbers=new Map,this._nodes=new Map,this._activeChanged=new Signal(this),this._currentChanged=new Signal(this)}return FocusTracker.prototype.dispose=function(){var _this=this;this._counter<0||(this._counter=-1,Signal.clearData(this),each(this._widgets,function(w){w.node.removeEventListener("focus",_this,!0),w.node.removeEventListener("blur",_this,!0)}),this._activeWidget=null,this._currentWidget=null,this._nodes.clear(),this._numbers.clear(),this._widgets.length=0)},Object.defineProperty(FocusTracker.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"activeChanged",{get:function(){return this._activeChanged},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"isDisposed",{get:function(){return this._counter<0},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"currentWidget",{get:function(){return this._currentWidget},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"activeWidget",{get:function(){return this._activeWidget},enumerable:!0,configurable:!0}),Object.defineProperty(FocusTracker.prototype,"widgets",{get:function(){return this._widgets},enumerable:!0,configurable:!0}),FocusTracker.prototype.focusNumber=function(widget){var n=this._numbers.get(widget);return n===void 0?-1:n},FocusTracker.prototype.has=function(widget){return this._numbers.has(widget)},FocusTracker.prototype.add=function(widget){if(!this._numbers.has(widget)){var focused=widget.node.contains(document.activeElement),n=focused?this._counter++:-1;this._widgets.push(widget),this._numbers.set(widget,n),this._nodes.set(widget.node,widget),widget.node.addEventListener("focus",this,!0),widget.node.addEventListener("blur",this,!0),widget.disposed.connect(this._onWidgetDisposed,this),focused&&this._setWidgets(widget,widget)}},FocusTracker.prototype.remove=function(widget){var _this=this;if(this._numbers.has(widget)&&(widget.disposed.disconnect(this._onWidgetDisposed,this),widget.node.removeEventListener("focus",this,!0),widget.node.removeEventListener("blur",this,!0),ArrayExt.removeFirstOf(this._widgets,widget),this._nodes.delete(widget.node),this._numbers.delete(widget),this._currentWidget===widget)){var valid=filter(this._widgets,function(w){return _this._numbers.get(w)!==-1}),previous=max(valid,function(first,second){var a=_this._numbers.get(first),b=_this._numbers.get(second);return a-b})||null;this._setWidgets(previous,null)}},FocusTracker.prototype.handleEvent=function(event){switch(event.type){case"focus":this._evtFocus(event);break;case"blur":this._evtBlur(event);break}},FocusTracker.prototype._setWidgets=function(current,active){var oldCurrent=this._currentWidget;this._currentWidget=current;var oldActive=this._activeWidget;this._activeWidget=active,oldCurrent!==current&&this._currentChanged.emit({oldValue:oldCurrent,newValue:current}),oldActive!==active&&this._activeChanged.emit({oldValue:oldActive,newValue:active})},FocusTracker.prototype._evtFocus=function(event){var widget=this._nodes.get(event.currentTarget);widget!==this._currentWidget&&this._numbers.set(widget,this._counter++),this._setWidgets(widget,widget)},FocusTracker.prototype._evtBlur=function(event){var widget=this._nodes.get(event.currentTarget),focusTarget=event.relatedTarget;if(!focusTarget){this._setWidgets(this._currentWidget,null);return}if(!widget.node.contains(focusTarget)&&!find(this._widgets,function(w){return w.node.contains(focusTarget)})){this._setWidgets(this._currentWidget,null);return}},FocusTracker.prototype._onWidgetDisposed=function(sender){this.remove(sender)},FocusTracker}();var GridLayout=function(_super){__extends(GridLayout2,_super);function GridLayout2(options){options===void 0&&(options={});var _this=_super.call(this,options)||this;return _this._dirty=!1,_this._rowSpacing=4,_this._columnSpacing=4,_this._items=[],_this._rowStarts=[],_this._columnStarts=[],_this._rowSizers=[new BoxSizer],_this._columnSizers=[new BoxSizer],_this._box=null,options.rowCount!==void 0&&Private$4.reallocSizers(_this._rowSizers,options.rowCount),options.columnCount!==void 0&&Private$4.reallocSizers(_this._columnSizers,options.columnCount),options.rowSpacing!==void 0&&(_this._rowSpacing=Private$4.clampValue(options.rowSpacing)),options.columnSpacing!==void 0&&(_this._columnSpacing=Private$4.clampValue(options.columnSpacing)),_this}return GridLayout2.prototype.dispose=function(){each(this._items,function(item){var widget=item.widget;item.dispose(),widget.dispose()}),this._box=null,this._items.length=0,this._rowStarts.length=0,this._rowSizers.length=0,this._columnStarts.length=0,this._columnSizers.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(GridLayout2.prototype,"rowCount",{get:function(){return this._rowSizers.length},set:function(value){value!==this.rowCount&&(Private$4.reallocSizers(this._rowSizers,value),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"columnCount",{get:function(){return this._columnSizers.length},set:function(value){value!==this.columnCount&&(Private$4.reallocSizers(this._columnSizers,value),this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"rowSpacing",{get:function(){return this._rowSpacing},set:function(value){value=Private$4.clampValue(value),this._rowSpacing!==value&&(this._rowSpacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),Object.defineProperty(GridLayout2.prototype,"columnSpacing",{get:function(){return this._columnSpacing},set:function(value){value=Private$4.clampValue(value),this._columnSpacing!==value&&(this._columnSpacing=value,this.parent&&this.parent.fit())},enumerable:!0,configurable:!0}),GridLayout2.prototype.rowStretch=function(index){var sizer=this._rowSizers[index];return sizer?sizer.stretch:-1},GridLayout2.prototype.setRowStretch=function(index,value){var sizer=this._rowSizers[index];sizer&&(value=Private$4.clampValue(value),sizer.stretch!==value&&(sizer.stretch=value,this.parent&&this.parent.update()))},GridLayout2.prototype.columnStretch=function(index){var sizer=this._columnSizers[index];return sizer?sizer.stretch:-1},GridLayout2.prototype.setColumnStretch=function(index,value){var sizer=this._columnSizers[index];sizer&&(value=Private$4.clampValue(value),sizer.stretch!==value&&(sizer.stretch=value,this.parent&&this.parent.update()))},GridLayout2.prototype.iter=function(){return map(this._items,function(item){return item.widget})},GridLayout2.prototype.addWidget=function(widget){var i=ArrayExt.findFirstIndex(this._items,function(it){return it.widget===widget});i===-1&&(this._items.push(new LayoutItem(widget)),this.parent&&this.attachWidget(widget))},GridLayout2.prototype.removeWidget=function(widget){var i=ArrayExt.findFirstIndex(this._items,function(it){return it.widget===widget});if(i!==-1){var item=ArrayExt.removeAt(this._items,i);this.parent&&this.detachWidget(widget),item.dispose()}},GridLayout2.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)})},GridLayout2.prototype.attachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},GridLayout2.prototype.detachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),this.parent.fit()},GridLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},GridLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},GridLayout2.prototype.onChildShown=function(msg){this.parent.fit()},GridLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},GridLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},GridLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},GridLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},GridLayout2.prototype._fit=function(){for(var i=0,n=this.rowCount;i<n;++i)this._rowSizers[i].minSize=0;for(var i=0,n=this.columnCount;i<n;++i)this._columnSizers[i].minSize=0;for(var items=this._items.filter(function(it){return!it.isHidden}),i=0,n=items.length;i<n;++i)items[i].fit();var maxRow=this.rowCount-1,maxCol=this.columnCount-1;items.sort(Private$4.rowSpanCmp);for(var i=0,n=items.length;i<n;++i){var item=items[i],config=GridLayout2.getCellConfig(item.widget),r1=Math.min(config.row,maxRow),r2=Math.min(config.row+config.rowSpan-1,maxRow);Private$4.distributeMin(this._rowSizers,r1,r2,item.minHeight)}items.sort(Private$4.columnSpanCmp);for(var i=0,n=items.length;i<n;++i){var item=items[i],config=GridLayout2.getCellConfig(item.widget),c1=Math.min(config.column,maxCol),c2=Math.min(config.column+config.columnSpan-1,maxCol);Private$4.distributeMin(this._columnSizers,c1,c2,item.minWidth)}if(this.fitPolicy==="set-no-constraint"){MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest);return}for(var minH=maxRow*this._rowSpacing,minW=maxCol*this._columnSpacing,i=0,n=this.rowCount;i<n;++i)minH+=this._rowSizers[i].minSize;for(var i=0,n=this.columnCount;i<n;++i)minW+=this._columnSizers[i].minSize;var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},GridLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1,offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,maxRow=this.rowCount-1,maxCol=this.columnCount-1,fixedRowSpace=maxRow*this._rowSpacing,fixedColSpace=maxCol*this._columnSpacing;BoxEngine.calc(this._rowSizers,Math.max(0,height-fixedRowSpace)),BoxEngine.calc(this._columnSizers,Math.max(0,width-fixedColSpace));for(var i=0,pos=top,n=this.rowCount;i<n;++i)this._rowStarts[i]=pos,pos+=this._rowSizers[i].size+this._rowSpacing;for(var i=0,pos=left,n=this.columnCount;i<n;++i)this._columnStarts[i]=pos,pos+=this._columnSizers[i].size+this._columnSpacing;for(var i=0,n=this._items.length;i<n;++i){var item=this._items[i];if(!item.isHidden){var config=GridLayout2.getCellConfig(item.widget),r1=Math.min(config.row,maxRow),c1=Math.min(config.column,maxCol),r2=Math.min(config.row+config.rowSpan-1,maxRow),c2=Math.min(config.column+config.columnSpan-1,maxCol),x=this._columnStarts[c1],y=this._rowStarts[r1],w=this._columnStarts[c2]+this._columnSizers[c2].size-x,h2=this._rowStarts[r2]+this._rowSizers[r2].size-y;item.update(x,y,w,h2)}}},GridLayout2}(Layout);(function(GridLayout2){function getCellConfig(widget){return Private$4.cellConfigProperty.get(widget)}GridLayout2.getCellConfig=getCellConfig;function setCellConfig(widget,value){Private$4.cellConfigProperty.set(widget,Private$4.normalizeConfig(value))}GridLayout2.setCellConfig=setCellConfig})(GridLayout||(GridLayout={}));var Private$4;(function(Private2){Private2.cellConfigProperty=new AttachedProperty({name:"cellConfig",create:function(){return{row:0,column:0,rowSpan:1,columnSpan:1}},changed:onChildCellConfigChanged});function normalizeConfig(config){var row=Math.max(0,Math.floor(config.row||0)),column=Math.max(0,Math.floor(config.column||0)),rowSpan=Math.max(1,Math.floor(config.rowSpan||0)),columnSpan=Math.max(1,Math.floor(config.columnSpan||0));return{row,column,rowSpan,columnSpan}}Private2.normalizeConfig=normalizeConfig;function clampValue(value){return Math.max(0,Math.floor(value))}Private2.clampValue=clampValue;function rowSpanCmp(a,b){var c1=Private2.cellConfigProperty.get(a.widget),c2=Private2.cellConfigProperty.get(b.widget);return c1.rowSpan-c2.rowSpan}Private2.rowSpanCmp=rowSpanCmp;function columnSpanCmp(a,b){var c1=Private2.cellConfigProperty.get(a.widget),c2=Private2.cellConfigProperty.get(b.widget);return c1.columnSpan-c2.columnSpan}Private2.columnSpanCmp=columnSpanCmp;function reallocSizers(sizers,count){for(count=Math.max(1,Math.floor(count));sizers.length<count;)sizers.push(new BoxSizer);sizers.length>count&&(sizers.length=count)}Private2.reallocSizers=reallocSizers;function distributeMin(sizers,i1,i2,minSize){if(!(i2<i1)){if(i1===i2){var sizer=sizers[i1];sizer.minSize=Math.max(sizer.minSize,minSize);return}for(var totalMin=0,i=i1;i<=i2;++i)totalMin+=sizers[i].minSize;if(!(totalMin>=minSize))for(var portion=(minSize-totalMin)/(i2-i1+1),i=i1;i<=i2;++i)sizers[i].minSize+=portion}}Private2.distributeMin=distributeMin;function onChildCellConfigChanged(child){child.parent&&child.parent.layout instanceof GridLayout&&child.parent.fit()}})(Private$4||(Private$4={}));var MenuBar=function(_super){__extends(MenuBar2,_super);function MenuBar2(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$3.createNode()})||this;return _this._activeIndex=-1,_this._tabFocusIndex=0,_this._menus=[],_this._childMenu=null,_this.addClass("lm-MenuBar"),_this.addClass("p-MenuBar"),_this.setFlag(Widget.Flag.DisallowLayout),_this.renderer=options.renderer||MenuBar2.defaultRenderer,_this._forceItemsPosition=options.forceItemsPosition||{forceX:!0,forceY:!0},_this}return MenuBar2.prototype.dispose=function(){this._closeChildMenu(),this._menus.length=0,_super.prototype.dispose.call(this)},Object.defineProperty(MenuBar2.prototype,"childMenu",{get:function(){return this._childMenu},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"contentNode",{get:function(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"activeMenu",{get:function(){return this._menus[this._activeIndex]||null},set:function(value){this.activeIndex=value?this._menus.indexOf(value):-1},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"activeIndex",{get:function(){return this._activeIndex},set:function(value){(value<0||value>=this._menus.length)&&(value=-1),this._activeIndex!==value&&(this._activeIndex=value,value!==-1&&(this._tabFocusIndex=value),this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]&&this.contentNode.childNodes[this._activeIndex].focus(),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(MenuBar2.prototype,"menus",{get:function(){return this._menus},enumerable:!0,configurable:!0}),MenuBar2.prototype.openActiveMenu=function(){this._activeIndex!==-1&&(this._openChildMenu(),this._childMenu&&(this._childMenu.activeIndex=-1,this._childMenu.activateNextItem()))},MenuBar2.prototype.addMenu=function(menu){this.insertMenu(this._menus.length,menu)},MenuBar2.prototype.insertMenu=function(index,menu){this._closeChildMenu();var i=this._menus.indexOf(menu),j=Math.max(0,Math.min(index,this._menus.length));if(i===-1){ArrayExt.insert(this._menus,j,menu),menu.addClass("lm-MenuBar-menu"),menu.addClass("p-MenuBar-menu"),menu.aboutToClose.connect(this._onMenuAboutToClose,this),menu.menuRequested.connect(this._onMenuMenuRequested,this),menu.title.changed.connect(this._onTitleChanged,this),this.update();return}j===this._menus.length&&j--,i!==j&&(ArrayExt.move(this._menus,i,j),this.update())},MenuBar2.prototype.removeMenu=function(menu){this.removeMenuAt(this._menus.indexOf(menu))},MenuBar2.prototype.removeMenuAt=function(index){this._closeChildMenu();var menu=ArrayExt.removeAt(this._menus,index);menu&&(menu.aboutToClose.disconnect(this._onMenuAboutToClose,this),menu.menuRequested.disconnect(this._onMenuMenuRequested,this),menu.title.changed.disconnect(this._onTitleChanged,this),menu.removeClass("lm-MenuBar-menu"),menu.removeClass("p-MenuBar-menu"),this.update())},MenuBar2.prototype.clearMenus=function(){if(this._menus.length!==0){this._closeChildMenu();for(var _i=0,_a=this._menus;_i<_a.length;_i++){var menu=_a[_i];menu.aboutToClose.disconnect(this._onMenuAboutToClose,this),menu.menuRequested.disconnect(this._onMenuMenuRequested,this),menu.title.changed.disconnect(this._onTitleChanged,this),menu.removeClass("lm-MenuBar-menu"),menu.removeClass("p-MenuBar-menu")}this._menus.length=0,this.update()}},MenuBar2.prototype.handleEvent=function(event){switch(event.type){case"keydown":this._evtKeyDown(event);break;case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseleave":this._evtMouseLeave(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},MenuBar2.prototype.onBeforeAttach=function(msg){this.node.addEventListener("keydown",this),this.node.addEventListener("mousedown",this),this.node.addEventListener("mousemove",this),this.node.addEventListener("mouseleave",this),this.node.addEventListener("contextmenu",this)},MenuBar2.prototype.onAfterDetach=function(msg){this.node.removeEventListener("keydown",this),this.node.removeEventListener("mousedown",this),this.node.removeEventListener("mousemove",this),this.node.removeEventListener("mouseleave",this),this.node.removeEventListener("contextmenu",this),this._closeChildMenu()},MenuBar2.prototype.onActivateRequest=function(msg){this.isAttached&&(this.activeIndex=0)},MenuBar2.prototype.onUpdateRequest=function(msg){for(var _this=this,menus=this._menus,renderer=this.renderer,activeIndex=this._activeIndex,tabFocusIndex=this._tabFocusIndex>=0&&this._tabFocusIndex<menus.length?this._tabFocusIndex:0,content=new Array(menus.length),_loop_1=function(i2,n2){var title=menus[i2].title,active=i2===activeIndex;active&&menus[i2].items.length==0&&(active=!1),content[i2]=renderer.renderItem({title,active,tabbable:i2===tabFocusIndex,onfocus:function(){_this.activeIndex=i2}})},i=0,n=menus.length;i<n;++i)_loop_1(i);VirtualDOM.render(content,this.contentNode)},MenuBar2.prototype._evtKeyDown=function(event){var kc=event.keyCode;if(kc===9){this.activeIndex=-1;return}if(event.preventDefault(),event.stopPropagation(),kc===13||kc===32||kc===38||kc===40){this.openActiveMenu();return}if(kc===27){this._closeChildMenu(),this.activeIndex=-1,this.node.blur();return}if(kc===37){var i=this._activeIndex,n=this._menus.length;this.activeIndex=i===0?n-1:i-1;return}if(kc===39){var i=this._activeIndex,n=this._menus.length;this.activeIndex=i===n-1?0:i+1;return}var key=getKeyboardLayout().keyForKeydownEvent(event);if(key){var start=this._activeIndex+1,result=Private$3.findMnemonic(this._menus,key,start);result.index!==-1&&!result.multiple?(this.activeIndex=result.index,this.openActiveMenu()):result.index!==-1?this.activeIndex=result.index:result.auto!==-1&&(this.activeIndex=result.auto)}},MenuBar2.prototype._evtMouseDown=function(event){if(ElementExt.hitTest(this.node,event.clientX,event.clientY)){event.preventDefault(),event.stopPropagation(),event.stopImmediatePropagation();var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index===-1){this._closeChildMenu();return}if(event.button===0)if(this._childMenu)this._closeChildMenu(),this.activeIndex=index;else{var position=this._positionForMenu(index);Menu.saveWindowData(),this.activeIndex=index,this._openChildMenu(position)}}},MenuBar2.prototype._evtMouseMove=function(event){var index=ArrayExt.findFirstIndex(this.contentNode.children,function(node){return ElementExt.hitTest(node,event.clientX,event.clientY)});if(index!==this._activeIndex&&!(index===-1&&this._childMenu)){var position=this._positionForMenu(index);Menu.saveWindowData(),this.activeIndex=index,this._childMenu&&this._openChildMenu(position)}},MenuBar2.prototype._positionForMenu=function(index){var itemNode=this.contentNode.children[index],_a=itemNode.getBoundingClientRect(),left=_a.left,bottom=_a.bottom;return{top:bottom,left}},MenuBar2.prototype._evtMouseLeave=function(event){this._childMenu||(this.activeIndex=-1)},MenuBar2.prototype._openChildMenu=function(options){var _a;options===void 0&&(options={});var newMenu=this.activeMenu;if(!newMenu){this._closeChildMenu();return}var oldMenu=this._childMenu;if(oldMenu!==newMenu){this._childMenu=newMenu,oldMenu?oldMenu.close():document.addEventListener("mousedown",this,!0),MessageLoop.sendMessage(this,Widget.Msg.UpdateRequest);var left=options.left,top=options.top;(typeof left>"u"||typeof top>"u")&&(_a=this._positionForMenu(this._activeIndex),left=_a.left,top=_a.top),oldMenu||(this.addClass("lm-mod-active"),this.addClass("p-mod-active")),newMenu.items.length>0&&newMenu.open(left,top,this._forceItemsPosition)}},MenuBar2.prototype._closeChildMenu=function(){if(this._childMenu){this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0);var menu=this._childMenu;this._childMenu=null,menu.close(),this.activeIndex=-1}},MenuBar2.prototype._onMenuAboutToClose=function(sender){sender===this._childMenu&&(this.removeClass("lm-mod-active"),this.removeClass("p-mod-active"),document.removeEventListener("mousedown",this,!0),this._childMenu=null,this.activeIndex=-1)},MenuBar2.prototype._onMenuMenuRequested=function(sender,args){if(sender===this._childMenu){var i=this._activeIndex,n=this._menus.length;switch(args){case"next":this.activeIndex=i===n-1?0:i+1;break;case"previous":this.activeIndex=i===0?n-1:i-1;break}this.openActiveMenu()}},MenuBar2.prototype._onTitleChanged=function(){this.update()},MenuBar2}(Widget);(function(MenuBar2){var Renderer=function(){function Renderer2(){}return Renderer2.prototype.renderItem=function(data){var className=this.createItemClass(data),dataset=this.createItemDataset(data),aria=this.createItemARIA(data);return h.li(__assign({className,dataset,tabindex:data.tabbable?"0":"-1",onfocus:data.onfocus},aria),this.renderIcon(data),this.renderLabel(data))},Renderer2.prototype.renderIcon=function(data){var className=this.createIconClass(data);return typeof data.title.icon=="string"?h.div({className},data.title.iconLabel):h.div({className},data.title.icon,data.title.iconLabel)},Renderer2.prototype.renderLabel=function(data){var content=this.formatLabel(data);return h.div({className:"lm-MenuBar-itemLabel p-MenuBar-itemLabel"},content)},Renderer2.prototype.createItemClass=function(data){var name2="lm-MenuBar-item";return name2+=" p-MenuBar-item",data.title.className&&(name2+=" "+data.title.className),data.active&&(name2+=" lm-mod-active",name2+=" p-mod-active"),name2},Renderer2.prototype.createItemDataset=function(data){return data.title.dataset},Renderer2.prototype.createItemARIA=function(data){return{role:"menuitem","aria-haspopup":"true"}},Renderer2.prototype.createIconClass=function(data){var name2="lm-MenuBar-itemIcon";name2+=" p-MenuBar-itemIcon";var extra=data.title.iconClass;return extra?name2+" "+extra:name2},Renderer2.prototype.formatLabel=function(data){var _a=data.title,label=_a.label,mnemonic=_a.mnemonic;if(mnemonic<0||mnemonic>=label.length)return label;var prefix=label.slice(0,mnemonic),suffix=label.slice(mnemonic+1),char=label[mnemonic],span=h.span({className:"lm-MenuBar-itemMnemonic p-MenuBar-itemMnemonic"},char);return[prefix,span,suffix]},Renderer2}();MenuBar2.Renderer=Renderer,MenuBar2.defaultRenderer=new Renderer})(MenuBar||(MenuBar={}));var Private$3;(function(Private2){function createNode(){var node=document.createElement("div"),content=document.createElement("ul");return content.className="lm-MenuBar-content",content.classList.add("p-MenuBar-content"),node.appendChild(content),content.setAttribute("role","menubar"),node}Private2.createNode=createNode;function findMnemonic(menus,key,start){for(var index=-1,auto=-1,multiple=!1,upperKey=key.toUpperCase(),i=0,n=menus.length;i<n;++i){var k=(i+start)%n,title=menus[k].title;if(title.label.length!==0){var mn=title.mnemonic;if(mn>=0&&mn<title.label.length){title.label[mn].toUpperCase()===upperKey&&(index===-1?index=k:multiple=!0);continue}auto===-1&&title.label[0].toUpperCase()===upperKey&&(auto=k)}}return{index,multiple,auto}}Private2.findMnemonic=findMnemonic})(Private$3||(Private$3={})),function(_super){__extends(ScrollBar,_super);function ScrollBar(options){options===void 0&&(options={});var _this=_super.call(this,{node:Private$2.createNode()})||this;return _this._onRepeat=function(){if(_this._repeatTimer=-1,!!_this._pressData){var part=_this._pressData.part;if(part!=="thumb"){_this._repeatTimer=window.setTimeout(_this._onRepeat,20);var mouseX=_this._pressData.mouseX,mouseY=_this._pressData.mouseY;if(part==="decrement"){if(!ElementExt.hitTest(_this.decrementNode,mouseX,mouseY))return;_this._stepRequested.emit("decrement");return}if(part==="increment"){if(!ElementExt.hitTest(_this.incrementNode,mouseX,mouseY))return;_this._stepRequested.emit("increment");return}if(part==="track"){if(!ElementExt.hitTest(_this.trackNode,mouseX,mouseY))return;var thumbNode=_this.thumbNode;if(ElementExt.hitTest(thumbNode,mouseX,mouseY))return;var thumbRect=thumbNode.getBoundingClientRect(),dir=void 0;_this._orientation==="horizontal"?dir=mouseX<thumbRect.left?"decrement":"increment":dir=mouseY<thumbRect.top?"decrement":"increment",_this._pageRequested.emit(dir);return}}}},_this._value=0,_this._page=10,_this._maximum=100,_this._repeatTimer=-1,_this._pressData=null,_this._thumbMoved=new Signal(_this),_this._stepRequested=new Signal(_this),_this._pageRequested=new Signal(_this),_this.addClass("lm-ScrollBar"),_this.addClass("p-ScrollBar"),_this.setFlag(Widget.Flag.DisallowLayout),_this._orientation=options.orientation||"vertical",_this.dataset.orientation=_this._orientation,options.maximum!==void 0&&(_this._maximum=Math.max(0,options.maximum)),options.page!==void 0&&(_this._page=Math.max(0,options.page)),options.value!==void 0&&(_this._value=Math.max(0,Math.min(options.value,_this._maximum))),_this}return Object.defineProperty(ScrollBar.prototype,"thumbMoved",{get:function(){return this._thumbMoved},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"stepRequested",{get:function(){return this._stepRequested},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"pageRequested",{get:function(){return this._pageRequested},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"orientation",{get:function(){return this._orientation},set:function(value){this._orientation!==value&&(this._releaseMouse(),this._orientation=value,this.dataset.orientation=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"value",{get:function(){return this._value},set:function(value){value=Math.max(0,Math.min(value,this._maximum)),this._value!==value&&(this._value=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"page",{get:function(){return this._page},set:function(value){value=Math.max(0,value),this._page!==value&&(this._page=value,this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"maximum",{get:function(){return this._maximum},set:function(value){value=Math.max(0,value),this._maximum!==value&&(this._maximum=value,this._value=Math.min(this._value,value),this.update())},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"decrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"incrementNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-button")[1]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"trackNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-track")[0]},enumerable:!0,configurable:!0}),Object.defineProperty(ScrollBar.prototype,"thumbNode",{get:function(){return this.node.getElementsByClassName("lm-ScrollBar-thumb")[0]},enumerable:!0,configurable:!0}),ScrollBar.prototype.handleEvent=function(event){switch(event.type){case"mousedown":this._evtMouseDown(event);break;case"mousemove":this._evtMouseMove(event);break;case"mouseup":this._evtMouseUp(event);break;case"keydown":this._evtKeyDown(event);break;case"contextmenu":event.preventDefault(),event.stopPropagation();break}},ScrollBar.prototype.onBeforeAttach=function(msg){this.node.addEventListener("mousedown",this),this.update()},ScrollBar.prototype.onAfterDetach=function(msg){this.node.removeEventListener("mousedown",this),this._releaseMouse()},ScrollBar.prototype.onUpdateRequest=function(msg){var value=this._value*100/this._maximum,page=this._page*100/(this._page+this._maximum);value=Math.max(0,Math.min(value,100)),page=Math.max(0,Math.min(page,100));var thumbStyle=this.thumbNode.style;this._orientation==="horizontal"?(thumbStyle.top="",thumbStyle.height="",thumbStyle.left=value+"%",thumbStyle.width=page+"%",thumbStyle.transform="translate("+-value+"%, 0%)"):(thumbStyle.left="",thumbStyle.width="",thumbStyle.top=value+"%",thumbStyle.height=page+"%",thumbStyle.transform="translate(0%, "+-value+"%)")},ScrollBar.prototype._evtKeyDown=function(event){if(event.preventDefault(),event.stopPropagation(),event.keyCode===27){var value=this._pressData?this._pressData.value:-1;this._releaseMouse(),value!==-1&&this._moveThumb(value)}},ScrollBar.prototype._evtMouseDown=function(event){if(event.button===0&&(this.activate(),!this._pressData)){var part=Private$2.findPart(this,event.target);if(part){event.preventDefault(),event.stopPropagation();var override=Drag.overrideCursor("default");if(this._pressData={part,override,delta:-1,value:-1,mouseX:event.clientX,mouseY:event.clientY},document.addEventListener("mousemove",this,!0),document.addEventListener("mouseup",this,!0),document.addEventListener("keydown",this,!0),document.addEventListener("contextmenu",this,!0),part==="thumb"){var thumbNode=this.thumbNode,thumbRect=thumbNode.getBoundingClientRect();this._orientation==="horizontal"?this._pressData.delta=event.clientX-thumbRect.left:this._pressData.delta=event.clientY-thumbRect.top,thumbNode.classList.add("lm-mod-active"),thumbNode.classList.add("p-mod-active"),this._pressData.value=this._value;return}if(part==="track"){var thumbRect=this.thumbNode.getBoundingClientRect(),dir=void 0;this._orientation==="horizontal"?dir=event.clientX<thumbRect.left?"decrement":"increment":dir=event.clientY<thumbRect.top?"decrement":"increment",this._repeatTimer=window.setTimeout(this._onRepeat,350),this._pageRequested.emit(dir);return}if(part==="decrement"){this.decrementNode.classList.add("lm-mod-active"),this.decrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("decrement");return}if(part==="increment"){this.incrementNode.classList.add("lm-mod-active"),this.incrementNode.classList.add("p-mod-active"),this._repeatTimer=window.setTimeout(this._onRepeat,350),this._stepRequested.emit("increment");return}}}},ScrollBar.prototype._evtMouseMove=function(event){if(this._pressData&&(event.preventDefault(),event.stopPropagation(),this._pressData.mouseX=event.clientX,this._pressData.mouseY=event.clientY,this._pressData.part==="thumb")){var thumbRect=this.thumbNode.getBoundingClientRect(),trackRect=this.trackNode.getBoundingClientRect(),trackPos,trackSpan;this._orientation==="horizontal"?(trackPos=event.clientX-trackRect.left-this._pressData.delta,trackSpan=trackRect.width-thumbRect.width):(trackPos=event.clientY-trackRect.top-this._pressData.delta,trackSpan=trackRect.height-thumbRect.height);var value=trackSpan===0?0:trackPos*this._maximum/trackSpan;this._moveThumb(value)}},ScrollBar.prototype._evtMouseUp=function(event){event.button===0&&(event.preventDefault(),event.stopPropagation(),this._releaseMouse())},ScrollBar.prototype._releaseMouse=function(){this._pressData&&(clearTimeout(this._repeatTimer),this._repeatTimer=-1,this._pressData.override.dispose(),this._pressData=null,document.removeEventListener("mousemove",this,!0),document.removeEventListener("mouseup",this,!0),document.removeEventListener("keydown",this,!0),document.removeEventListener("contextmenu",this,!0),this.thumbNode.classList.remove("lm-mod-active"),this.decrementNode.classList.remove("lm-mod-active"),this.incrementNode.classList.remove("lm-mod-active"),this.thumbNode.classList.remove("p-mod-active"),this.decrementNode.classList.remove("p-mod-active"),this.incrementNode.classList.remove("p-mod-active"))},ScrollBar.prototype._moveThumb=function(value){value=Math.max(0,Math.min(value,this._maximum)),this._value!==value&&(this._value=value,this.update(),this._thumbMoved.emit(value))},ScrollBar}(Widget);var Private$2;(function(Private2){function createNode(){var node=document.createElement("div"),decrement=document.createElement("div"),increment=document.createElement("div"),track=document.createElement("div"),thumb=document.createElement("div");return decrement.className="lm-ScrollBar-button",increment.className="lm-ScrollBar-button",decrement.dataset.action="decrement",increment.dataset.action="increment",track.className="lm-ScrollBar-track",thumb.className="lm-ScrollBar-thumb",decrement.classList.add("p-ScrollBar-button"),increment.classList.add("p-ScrollBar-button"),track.classList.add("p-ScrollBar-track"),thumb.classList.add("p-ScrollBar-thumb"),track.appendChild(thumb),node.appendChild(decrement),node.appendChild(track),node.appendChild(increment),node}Private2.createNode=createNode;function findPart(scrollBar,target){return scrollBar.thumbNode.contains(target)?"thumb":scrollBar.trackNode.contains(target)?"track":scrollBar.decrementNode.contains(target)?"decrement":scrollBar.incrementNode.contains(target)?"increment":null}Private2.findPart=findPart})(Private$2||(Private$2={})),function(_super){__extends(SingletonLayout,_super);function SingletonLayout(){var _this=_super!==null&&_super.apply(this,arguments)||this;return _this._widget=null,_this}return SingletonLayout.prototype.dispose=function(){if(this._widget){var widget=this._widget;this._widget=null,widget.dispose()}_super.prototype.dispose.call(this)},Object.defineProperty(SingletonLayout.prototype,"widget",{get:function(){return this._widget},set:function(widget){widget&&(widget.parent=this.parent),this._widget!==widget&&(this._widget&&this._widget.dispose(),this._widget=widget,this.parent&&widget&&this.attachWidget(widget))},enumerable:!0,configurable:!0}),SingletonLayout.prototype.iter=function(){return this._widget?once(this._widget):empty()},SingletonLayout.prototype.removeWidget=function(widget){this._widget===widget&&(this._widget=null,this.parent&&this.detachWidget(widget))},SingletonLayout.prototype.init=function(){var _this=this;_super.prototype.init.call(this),each(this,function(widget){_this.attachWidget(widget)})},SingletonLayout.prototype.attachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach)},SingletonLayout.prototype.detachWidget=function(widget){this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach)},SingletonLayout}(Layout);var StackedLayout=function(_super){__extends(StackedLayout2,_super);function StackedLayout2(options){options===void 0&&(options={});var _this=_super.call(this,options)||this;return _this._dirty=!1,_this._items=[],_this._box=null,_this._hiddenMode=options.hiddenMode!==void 0?options.hiddenMode:Widget.HiddenMode.Display,_this}return Object.defineProperty(StackedLayout2.prototype,"hiddenMode",{get:function(){return this._hiddenMode},set:function(v){var _this=this;this._hiddenMode!==v&&(this._hiddenMode=v,this.widgets.length>1&&this.widgets.forEach(function(w){w.hiddenMode=_this._hiddenMode}))},enumerable:!0,configurable:!0}),StackedLayout2.prototype.dispose=function(){each(this._items,function(item){item.dispose()}),this._box=null,this._items.length=0,_super.prototype.dispose.call(this)},StackedLayout2.prototype.attachWidget=function(index,widget){this._hiddenMode===Widget.HiddenMode.Scale&&this._items.length>0?(this._items.length===1&&(this.widgets[0].hiddenMode=Widget.HiddenMode.Scale),widget.hiddenMode=Widget.HiddenMode.Scale):widget.hiddenMode=Widget.HiddenMode.Display,ArrayExt.insert(this._items,index,new LayoutItem(widget)),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeAttach),this.parent.node.appendChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterAttach),this.parent.fit()},StackedLayout2.prototype.moveWidget=function(fromIndex,toIndex,widget){ArrayExt.move(this._items,fromIndex,toIndex),this.parent.update()},StackedLayout2.prototype.detachWidget=function(index,widget){var item=ArrayExt.removeAt(this._items,index);this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.BeforeDetach),this.parent.node.removeChild(widget.node),this.parent.isAttached&&MessageLoop.sendMessage(widget,Widget.Msg.AfterDetach),item.widget.node.style.zIndex="",this._hiddenMode===Widget.HiddenMode.Scale&&(widget.hiddenMode=Widget.HiddenMode.Display,this._items.length===1&&(this._items[0].widget.hiddenMode=Widget.HiddenMode.Display)),item.dispose(),this.parent.fit()},StackedLayout2.prototype.onBeforeShow=function(msg){_super.prototype.onBeforeShow.call(this,msg),this.parent.update()},StackedLayout2.prototype.onBeforeAttach=function(msg){_super.prototype.onBeforeAttach.call(this,msg),this.parent.fit()},StackedLayout2.prototype.onChildShown=function(msg){this.parent.fit()},StackedLayout2.prototype.onChildHidden=function(msg){this.parent.fit()},StackedLayout2.prototype.onResize=function(msg){this.parent.isVisible&&this._update(msg.width,msg.height)},StackedLayout2.prototype.onUpdateRequest=function(msg){this.parent.isVisible&&this._update(-1,-1)},StackedLayout2.prototype.onFitRequest=function(msg){this.parent.isAttached&&this._fit()},StackedLayout2.prototype._fit=function(){for(var minW=0,minH=0,i=0,n=this._items.length;i<n;++i){var item=this._items[i];item.isHidden||(item.fit(),minW=Math.max(minW,item.minWidth),minH=Math.max(minH,item.minHeight))}var box=this._box=ElementExt.boxSizing(this.parent.node);minW+=box.horizontalSum,minH+=box.verticalSum;var style=this.parent.node.style;style.minWidth=minW+"px",style.minHeight=minH+"px",this._dirty=!0,this.parent.parent&&MessageLoop.sendMessage(this.parent.parent,Widget.Msg.FitRequest),this._dirty&&MessageLoop.sendMessage(this.parent,Widget.Msg.UpdateRequest)},StackedLayout2.prototype._update=function(offsetWidth,offsetHeight){this._dirty=!1;for(var nVisible=0,i=0,n=this._items.length;i<n;++i)nVisible+=+!this._items[i].isHidden;if(nVisible!==0){offsetWidth<0&&(offsetWidth=this.parent.node.offsetWidth),offsetHeight<0&&(offsetHeight=this.parent.node.offsetHeight),this._box||(this._box=ElementExt.boxSizing(this.parent.node));for(var top=this._box.paddingTop,left=this._box.paddingLeft,width=offsetWidth-this._box.horizontalSum,height=offsetHeight-this._box.verticalSum,i=0,n=this._items.length;i<n;++i){var item=this._items[i];item.isHidden||(item.widget.node.style.zIndex=""+i,item.update(left,top,width,height))}}},StackedLayout2}(PanelLayout),StackedPanel=function(_super){__extends(StackedPanel2,_super);function StackedPanel2(options){options===void 0&&(options={});var _this=_super.call(this,{layout:Private$1.createLayout(options)})||this;return _this._widgetRemoved=new Signal(_this),_this.addClass("lm-StackedPanel"),_this.addClass("p-StackedPanel"),_this}return Object.defineProperty(StackedPanel2.prototype,"hiddenMode",{get:function(){return this.layout.hiddenMode},set:function(v){this.layout.hiddenMode=v},enumerable:!0,configurable:!0}),Object.defineProperty(StackedPanel2.prototype,"widgetRemoved",{get:function(){return this._widgetRemoved},enumerable:!0,configurable:!0}),StackedPanel2.prototype.onChildAdded=function(msg){msg.child.addClass("lm-StackedPanel-child"),msg.child.addClass("p-StackedPanel-child")},StackedPanel2.prototype.onChildRemoved=function(msg){msg.child.removeClass("lm-StackedPanel-child"),msg.child.removeClass("p-StackedPanel-child"),this._widgetRemoved.emit(msg.child)},StackedPanel2}(Panel),Private$1;(function(Private2){function createLayout(options){return options.layout||new StackedLayout}Private2.createLayout=createLayout})(Private$1||(Private$1={}));var TabPanel$1=function(_super){__extends(TabPanel2,_super);function TabPanel2(options){options===void 0&&(options={});var _this=_super.call(this)||this;_this._currentChanged=new Signal(_this),_this._addRequested=new Signal(_this),_this.addClass("lm-TabPanel"),_this.addClass("p-TabPanel"),_this.tabBar=new TabBar(options),_this.tabBar.addClass("lm-TabPanel-tabBar"),_this.stackedPanel=new StackedPanel,_this.stackedPanel.addClass("lm-TabPanel-stackedPanel"),_this.tabBar.addClass("p-TabPanel-tabBar"),_this.stackedPanel.addClass("p-TabPanel-stackedPanel"),_this.tabBar.tabMoved.connect(_this._onTabMoved,_this),_this.tabBar.currentChanged.connect(_this._onCurrentChanged,_this),_this.tabBar.tabCloseRequested.connect(_this._onTabCloseRequested,_this),_this.tabBar.tabActivateRequested.connect(_this._onTabActivateRequested,_this),_this.tabBar.addRequested.connect(_this._onTabAddRequested,_this),_this.stackedPanel.widgetRemoved.connect(_this._onWidgetRemoved,_this),_this._tabPlacement=options.tabPlacement||"top";var direction=Private.directionFromPlacement(_this._tabPlacement),orientation=Private.orientationFromPlacement(_this._tabPlacement);_this.tabBar.orientation=orientation,_this.tabBar.dataset.placement=_this._tabPlacement;var layout=new BoxLayout({direction,spacing:0});return BoxLayout.setStretch(_this.tabBar,0),BoxLayout.setStretch(_this.stackedPanel,1),layout.addWidget(_this.tabBar),layout.addWidget(_this.stackedPanel),_this.layout=layout,_this}return Object.defineProperty(TabPanel2.prototype,"currentChanged",{get:function(){return this._currentChanged},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"currentIndex",{get:function(){return this.tabBar.currentIndex},set:function(value){this.tabBar.currentIndex=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"currentWidget",{get:function(){var title=this.tabBar.currentTitle;return title?title.owner:null},set:function(value){this.tabBar.currentTitle=value?value.title:null},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"tabsMovable",{get:function(){return this.tabBar.tabsMovable},set:function(value){this.tabBar.tabsMovable=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"addButtonEnabled",{get:function(){return this.tabBar.addButtonEnabled},set:function(value){this.tabBar.addButtonEnabled=value},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"tabPlacement",{get:function(){return this._tabPlacement},set:function(value){if(this._tabPlacement!==value){this._tabPlacement=value;var direction=Private.directionFromPlacement(value),orientation=Private.orientationFromPlacement(value);this.tabBar.orientation=orientation,this.tabBar.dataset.placement=value,this.layout.direction=direction}},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"addRequested",{get:function(){return this._addRequested},enumerable:!0,configurable:!0}),Object.defineProperty(TabPanel2.prototype,"widgets",{get:function(){return this.stackedPanel.widgets},enumerable:!0,configurable:!0}),TabPanel2.prototype.addWidget=function(widget){this.insertWidget(this.widgets.length,widget)},TabPanel2.prototype.insertWidget=function(index,widget){widget!==this.currentWidget&&widget.hide(),this.stackedPanel.insertWidget(index,widget),this.tabBar.insertTab(index,widget.title),widget.node.setAttribute("role","tabpanel");var renderer=this.tabBar.renderer;if(renderer instanceof TabBar.Renderer){var tabId=renderer.createTabKey({title:widget.title,current:!1,zIndex:0});widget.node.setAttribute("aria-labelledby",tabId)}},TabPanel2.prototype._onCurrentChanged=function(sender,args){var previousIndex=args.previousIndex,previousTitle=args.previousTitle,currentIndex=args.currentIndex,currentTitle=args.currentTitle,previousWidget=previousTitle?previousTitle.owner:null,currentWidget=currentTitle?currentTitle.owner:null;previousWidget&&previousWidget.hide(),currentWidget&&currentWidget.show(),this._currentChanged.emit({previousIndex,previousWidget,currentIndex,currentWidget}),(Platform.IS_EDGE||Platform.IS_IE)&&MessageLoop.flush()},TabPanel2.prototype._onTabAddRequested=function(sender,args){this._addRequested.emit(sender)},TabPanel2.prototype._onTabActivateRequested=function(sender,args){args.title.owner.activate()},TabPanel2.prototype._onTabCloseRequested=function(sender,args){args.title.owner.close()},TabPanel2.prototype._onTabMoved=function(sender,args){this.stackedPanel.insertWidget(args.toIndex,args.title.owner)},TabPanel2.prototype._onWidgetRemoved=function(sender,widget){widget.node.removeAttribute("role"),widget.node.removeAttribute("aria-labelledby"),this.tabBar.removeTab(widget.title)},TabPanel2}(Widget),Private;(function(Private2){function orientationFromPlacement(plc){return placementToOrientationMap[plc]}Private2.orientationFromPlacement=orientationFromPlacement;function directionFromPlacement(plc){return placementToDirectionMap[plc]}Private2.directionFromPlacement=directionFromPlacement;var placementToOrientationMap={top:"horizontal",left:"vertical",right:"vertical",bottom:"horizontal"},placementToDirectionMap={top:"top-to-bottom",left:"left-to-right",right:"right-to-left",bottom:"bottom-to-top"}})(Private||(Private={})),exports2.Msg=void 0,(Msg2=>{class WAConflatableMessage extends ConflatableMessage{constructor(wa,msg){super(msg);__publicField(this,"_wa");this._wa=wa}get wa(){return this._wa}conflate(other){return this._wa=other.wa,!0}}Msg2.WAConflatableMessage=WAConflatableMessage;const _WAActivateRequest=class _WAActivateRequest extends WAConflatableMessage{constructor(wa){super(wa,_WAActivateRequest.type)}};__publicField(_WAActivateRequest,"type","wa-activate-request");let WAActivateRequest=_WAActivateRequest;Msg2.WAActivateRequest=WAActivateRequest;const _WALayoutChanged=class _WALayoutChanged extends WAConflatableMessage{constructor(wa){super(wa,_WALayoutChanged.type)}};__publicField(_WALayoutChanged,"type","wa-layout-changed");let WALayoutChanged=_WALayoutChanged;Msg2.WALayoutChanged=WALayoutChanged})(exports2.Msg||(exports2.Msg={}));class WidgetAdapter extends Widget{constructor(owner,widget,lparam={},closable=!1,ext={}){super();__publicField(this,"_owner");__publicField(this,"_element");__publicField(this,"_widget");__publicField(this,"_widgetLayout");__publicField(this,"lparam",{});__publicField(this,"padding",0);__publicField(this,"_width",0);__publicField(this,"_height",0);__publicField(this,"_ext");__publicField(this,"_closable");this._owner=owner,this._element=common.select(this.node),this.addClass("phosphor_WidgetAdapter"),this.title.label="",this.title.closable=!!closable,this.title.caption=`Long description for: ${name}`,this._ext=ext,typeof closable=="boolean"?this._closable={canClose(e,wa){return closable}}:this._closable=closable,widget instanceof common.Widget?this._widget=widget.target(this.node):this._widgetLayout=widget,this.lparam=lparam}get widget(){return this._widget}get inputNode(){return this.node.getElementsByTagName("input")[0]}resizeAndRender(){this._widget&&(common.select(this.node).style("padding",this.padding+"px").style("width",this._width+"px").style("height",this._height+"px").style("overflow-x",this._ext.overflowX).style("overflow-y",this._ext.overflowY),this._widget.resize({width:this._width-this.padding*2-2,height:this._height-this.padding*2-2}).lazyRender(),this._owner&&MessageLoop.postMessage(this._owner,new exports2.Msg.WALayoutChanged(this)))}onActivateRequest(msg){super.onActivateRequest(msg),this._widget&&this.resizeAndRender(),this._owner&&MessageLoop.postMessage(this._owner,new exports2.Msg.WAActivateRequest(this))}onResize(msg){super.onResize(msg),this.node&&this.node.offsetParent!==null&&msg.width>=0&&msg.height>=0?(this._width=msg.width,this._height=msg.height,this.resizeAndRender()):this._widgetLayout}onCloseRequest(msg){this._closable.canClose(this._widget,this)&&this.dispose()}}class WidgetAdapterArray extends Array{constructor(items){super(...items)}static create(){return Object.create(WidgetAdapterArray.prototype)}watchRendered(w,callback){if(!callback)return;const content=this.map(wa=>({wa,w:wa.widget,rc:wa.widget.renderCount()})),intervalHandle=setInterval(()=>{complete()&&(clearInterval(intervalHandle),callback(w))},20);function complete(){for(const item of content)if(item.wa.isVisible&&item.rc>=item.w.renderCount())return!1;return!0}}}class PRenderer extends DockPanel$1.Renderer{constructor(){super();__publicField(this,"_owner")}createTabBar(){const bar=super.createTabBar();return bar.tabsMovable=this._owner.tabsMovable,bar}}class PDockPanel extends DockPanel$1{constructor(options={}){options.renderer=options.renderer||new PRenderer;super(options);__publicField(this,"_content");__publicField(this,"_contentMap");this._renderer instanceof PRenderer&&(this._renderer._owner=this),this._content=WidgetAdapterArray.create(),this._contentMap={}}appendContent(wa){this._content.push(wa),this._contentMap[wa.widget.id()]=wa}removeContent(wa){const idx=this._content.indexOf(wa);idx>=0&&this._content.splice(idx,1),delete this._contentMap[wa.widget.id()],wa.dispose()}content(){return this._content}serializeWidget(widget){if(widget instanceof WidgetAdapter)try{return{__id:widget.widget.id()}}catch(e){return{exception:{message:e.message??"",stack:e.stack??[]}}}return null}deserializeWidget(layout){let wa=this._contentMap[layout.__id];return wa||(wa=new WidgetAdapter(void 0,layout)),wa}serializeITabAreaConfig(config,deserialize){return{...config,widgets:config.widgets.map(widget=>deserialize?this.deserializeWidget(widget):this.serializeWidget(widget))}}serializeISplitAreaConfig(config,deserialize){return{...config,children:config.children.map(child=>this.serializeAreaConfig(child,deserialize))}}serializeAreaConfig(config,deserialize){if(config)switch(config.type){case"tab-area":return this.serializeITabAreaConfig(config,deserialize);case"split-area":return this.serializeISplitAreaConfig(config,deserialize)}}saveLayout(){return{main:this.serializeAreaConfig(super.saveLayout().main,!1)}}restoreLayout(config){return super.restoreLayout({main:this.serializeAreaConfig(config.main,!0)})}}class DockPanel extends common.HTMLWidget{constructor(){super();__publicField(this,"_dock",new PDockPanel({mode:"multiple-document"}));__publicField(this,"_layoutObj",null);__publicField(this,"_pPlaceholder");__publicField(this,"_prevHideSingleTabs");__publicField(this,"_lazyLayoutChanged",common.Utility.debounce(async()=>{this.layoutChanged()},1e3));__publicField(this,"_prevActive");this._tag="div",this._dock.id="p"+this.id(),MessageLoop.installMessageHook(this,this)}getWidgetAdapter(widget){let retVal=null;return this._dock.content().some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget,title,location="split-right",refWidget,closable,padding=8){const addMode={mode:location,ref:this.getWidgetAdapter(refWidget)},wa=new WidgetAdapter(this,widget,{},closable);return wa.title.label=title,wa.padding=padding,this._dock.addWidget(wa,addMode),this._dock.appendContent(wa),this._dock.tabsMovable=!0,this}removeWidget(widget){const wa=this.getWidgetAdapter(widget);return wa&&(widget.target(null),this._dock.removeContent(wa)),this}isVisible(widget){return this.getWidgetAdapter(widget).isVisible}widgetAdapters(){return this._dock.content()}widgets(){return this._dock.content().map(wa=>wa.widget)}layout(_){return arguments.length?(this._dock.restoreLayout(_),this):this._dock.saveLayout()}layoutObj(_){return this._layoutObj=_,this}enter(domNode,element){super.enter(domNode,element),this._pPlaceholder=element.append("div"),Widget.attach(this._dock,this._pPlaceholder.node())}update(domNode,element){super.update(domNode,element),this._pPlaceholder.style("width",this.width()+"px").style("height",this.height()+"px").style("overflow","hidden"),element.select(".p-Widget").style("width",this._pPlaceholder.node().clientWidth+"px").style("height",this.height()+"px"),this.widgets().forEach(w=>w.render())}exit(domNode,element){[...this.widgets()].forEach(w=>this.removeWidget(w)),Widget.detach(this._dock),super.exit(domNode,element)}render(callback){const context=this;return this._layoutObj!==null&&(this.layout(this._layoutObj),this.layoutObj(null)),super.render(w=>{this._dock.content().watchRendered(this,callback),this._dock.update(),setTimeout(()=>{const tabBars=this.element().selectAll(".p-Widget.p-TabBar.p-DockPanel-tabBar");let refit=!1;tabBars.each(function(){const tabBar=common.select(this),tabsCount=tabBar.node().childNodes[0].childNodes.length,hide=context.hideSingleTabs()&&tabsCount===1;hide!==tabBar.classed("hide")&&(tabBar.classed("hide",hide),refit=!0)}),refit&&this._dock.fit()},0)})}refit(){this._dock.fit()}messageHook(handler,msg){return handler===this&&this.processMessage(msg),!0}processMessage(msg){switch(msg.type){case exports2.Msg.WAActivateRequest.type:const wa=msg.wa,widget=wa.widget;this._prevActive!==widget&&(this._prevActive=widget,this.childActivation(widget,wa));break;case exports2.Msg.WALayoutChanged.type:this._lazyLayoutChanged();break}}active(){return this._prevActive}childActivation(w,wa){}layoutChanged(){}}DockPanel.prototype._class+=" phosphor_DockPanel",DockPanel.prototype.publish("hideSingleTabs",!1,"boolean");class SplitPanel extends common.HTMLWidget{constructor(orientation="vertical"){super();__publicField(this,"_split");__publicField(this,"content",WidgetAdapterArray.create());this._split=new SplitPanel$1({orientation}),this._tag="div",this._split.id="p"+this.id()}getWidgetAdapter(widget){let retVal=null;return this.content.some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget){const wa=new WidgetAdapter(this,widget);return this._split.addWidget(wa),this.content.push(wa),this}relativeSizes(_){return arguments.length?(this._split.setRelativeSizes(_),this):this._split.relativeSizes()}enter(domNode,element){super.enter(domNode,element),Widget.attach(this._split,domNode)}update(domNode,element){super.update(domNode,element),element.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(domNode,element){Widget.detach(this._split),super.exit(domNode,element)}render(callback){return super.render(w=>{this.content.watchRendered(this,callback),this._split.update()})}}SplitPanel.prototype._class+=" phosphor_SplitPanel";class TabPanel extends common.HTMLWidget{constructor(){super();__publicField(this,"_tab",new TabPanel$1({tabPlacement:"top"}));__publicField(this,"content",WidgetAdapterArray.create());__publicField(this,"_prevActive");this._tag="div",this._tab.id="p"+this.id()}getWidget(wa){if(wa instanceof WidgetAdapter)return wa.widget}getWidgetAdapter(widget){let retVal=null;return this.content.some(wa=>wa.widget===widget?(retVal=wa,!0):!1),retVal}addWidget(widget,title,ext={}){this._prevActive||(this._prevActive=widget);const wa=new WidgetAdapter(this,widget,void 0,void 0,ext);return wa.title.label=title,wa.padding=8,this._tab.addWidget(wa),this.content.push(wa),this}removeWidget(widget){const wa=this.getWidgetAdapter(widget);if(wa){const found=this.content.indexOf(wa);found>=0&&this.content.splice(found,1),widget.target(null),wa.dispose()}return this}enter(domNode,element){super.enter(domNode,element),Widget.attach(this._tab,domNode)}update(domNode,element){super.update(domNode,element),element.select(".p-Widget").style("width",this.width()+"px").style("height",this.height()+"px")}exit(domNode,element){Widget.detach(this._tab),super.exit(domNode,element)}render(callback){return super.render(w=>{this.content.watchRendered(this,callback),this._tab.update()})}messageHook(handler,msg){return handler===this&&this.processMessage(msg),!0}processMessage(msg){switch(msg.type){case"wa-activate-request":const widget=msg.wa.widget;this._prevActive!==widget&&(this._prevActive=widget,this.childActivation(widget));break}}childActivation(w){}active(_){return arguments.length?(this._tab.currentWidget=this.getWidgetAdapter(_),this):this.getWidget(this._tab.currentWidget)}}TabPanel.prototype._class+=" phosphor_TabPanel",exports2.BUILD_VERSION=BUILD_VERSION,exports2.ContextMenu=ContextMenu,exports2.DockPanel=DockPanel,exports2.PKG_NAME=PKG_NAME,exports2.PKG_VERSION=PKG_VERSION,exports2.SplitPanel=SplitPanel,exports2.TabPanel=TabPanel,exports2.WidgetAdapter=WidgetAdapter,exports2.WidgetAdapterArray=WidgetAdapterArray,Object.defineProperty(exports2,Symbol.toStringTag,{value:"Module"})});
68
67
  //# sourceMappingURL=index.umd.cjs.map
68
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.p-Widget,.lm-Widget{box-sizing:border-box;position:relative;overflow:hidden;cursor:default}.p-Widget.p-mod-hidden,.lm-Widget.lm-mod-hidden{display:none!important}.p-CommandPalette,.lm-CommandPalette{display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-CommandPalette-search,.lm-CommandPalette-search{flex:0 0 auto}.p-CommandPalette-content,.lm-CommandPalette-content{flex:1 1 auto;margin:0;padding:0;min-height:0;overflow:auto;list-style-type:none}.p-CommandPalette-header,.lm-CommandPalette-header{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.p-CommandPalette-item,.lm-CommandPalette-item{display:flex;flex-direction:row}.p-CommandPalette-itemIcon,.lm-CommandPalette-itemIcon{flex:0 0 auto}.p-CommandPalette-itemContent,.lm-CommandPalette-itemContent{flex:1 1 auto;overflow:hidden}.p-CommandPalette-itemShortcut,.lm-CommandPalette-itemShortcut{flex:0 0 auto}.p-CommandPalette-itemLabel,.lm-CommandPalette-itemLabel{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.lm-close-icon{border:1px solid transparent;background-color:transparent;position:absolute;z-index:1;right:3%;top:0;bottom:0;margin:auto;padding:7px 0;display:none;vertical-align:middle;outline:0;cursor:pointer}.lm-close-icon:after{content:"X";display:block;width:15px;height:15px;text-align:center;color:#000;font-weight:400;font-size:12px;cursor:pointer}.p-DockPanel,.lm-DockPanel,.p-DockPanel-widget,.lm-DockPanel-widget{z-index:0}.p-DockPanel-tabBar,.lm-DockPanel-tabBar{z-index:1}.p-DockPanel-handle,.lm-DockPanel-handle{z-index:2}.p-DockPanel-handle.p-mod-hidden,.lm-DockPanel-handle.lm-mod-hidden{display:none!important}.p-DockPanel-handle:after,.lm-DockPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-DockPanel-handle[data-orientation=horizontal],.lm-DockPanel-handle[data-orientation=horizontal]{cursor:ew-resize}.p-DockPanel-handle[data-orientation=vertical],.lm-DockPanel-handle[data-orientation=vertical]{cursor:ns-resize}.p-DockPanel-handle[data-orientation=horizontal]:after,.lm-DockPanel-handle[data-orientation=horizontal]:after{left:50%;min-width:8px;transform:translate(-50%)}.p-DockPanel-handle[data-orientation=vertical]:after,.lm-DockPanel-handle[data-orientation=vertical]:after{top:50%;min-height:8px;transform:translateY(-50%)}.p-DockPanel-overlay,.lm-DockPanel-overlay{z-index:3;box-sizing:border-box;pointer-events:none}.p-DockPanel-overlay.p-mod-hidden,.lm-DockPanel-overlay.lm-mod-hidden{display:none!important}.p-Menu,.lm-Menu{z-index:10000;position:absolute;white-space:nowrap;overflow-x:hidden;overflow-y:auto;outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-Menu-content,.lm-Menu-content{margin:0;padding:0;display:table;list-style-type:none}.p-Menu-item,.lm-Menu-item{display:table-row}.p-Menu-item.p-mod-hidden,.p-Menu-item.p-mod-collapsed,.lm-Menu-item.lm-mod-hidden,.lm-Menu-item.lm-mod-collapsed{display:none!important}.p-Menu-itemIcon,.p-Menu-itemSubmenuIcon,.lm-Menu-itemIcon,.lm-Menu-itemSubmenuIcon{display:table-cell;text-align:center}.p-Menu-itemLabel,.lm-Menu-itemLabel{display:table-cell;text-align:left}.p-Menu-itemShortcut,.lm-Menu-itemShortcut{display:table-cell;text-align:right}.p-MenuBar,.lm-MenuBar{outline:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-MenuBar-content,.lm-MenuBar-content{margin:0;padding:0;display:flex;flex-direction:row;list-style-type:none}.p--MenuBar-item,.lm-MenuBar-item{box-sizing:border-box}.p-MenuBar-itemIcon,.p-MenuBar-itemLabel,.lm-MenuBar-itemIcon,.lm-MenuBar-itemLabel{display:inline-block}.p-ScrollBar,.lm-ScrollBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-ScrollBar[data-orientation=horizontal],.lm-ScrollBar[data-orientation=horizontal]{flex-direction:row}.p-ScrollBar[data-orientation=vertical],.lm-ScrollBar[data-orientation=vertical]{flex-direction:column}.p-ScrollBar-button,.lm-ScrollBar-button{box-sizing:border-box;flex:0 0 auto}.p-ScrollBar-track,.lm-ScrollBar-track{box-sizing:border-box;position:relative;overflow:hidden;flex:1 1 auto}.p-ScrollBar-thumb,.lm-ScrollBar-thumb{box-sizing:border-box;position:absolute}.p-SplitPanel-child,.lm-SplitPanel-child{z-index:0}.p-SplitPanel-handle,.lm-SplitPanel-handle{z-index:1}.p-SplitPanel-handle.p-mod-hidden,.lm-SplitPanel-handle.lm-mod-hidden{display:none!important}.p-SplitPanel-handle:after,.lm-SplitPanel-handle:after{position:absolute;top:0;left:0;width:100%;height:100%;content:""}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle,.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle{cursor:ew-resize}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle,.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle{cursor:ns-resize}.p-SplitPanel[data-orientation=horizontal]>.p-SplitPanel-handle:after,.lm-SplitPanel[data-orientation=horizontal]>.lm-SplitPanel-handle:after{left:50%;min-width:8px;transform:translate(-50%)}.p-SplitPanel[data-orientation=vertical]>.p-SplitPanel-handle:after,.lm-SplitPanel[data-orientation=vertical]>.lm-SplitPanel-handle:after{top:50%;min-height:8px;transform:translateY(-50%)}.p-TabBar,.lm-TabBar{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.p-TabBar[data-orientation=horizontal],.lm-TabBar[data-orientation=horizontal]{flex-direction:row;align-items:flex-end}.p-TabBar[data-orientation=vertical],.lm-TabBar[data-orientation=vertical]{flex-direction:column;align-items:flex-end}.p-TabBar-content,.lm-TabBar-content{margin:0;padding:0;display:flex;flex:1 1 auto;list-style-type:none}.p-TabBar[data-orientation=horizontal]>.p-TabBar-content,.lm-TabBar[data-orientation=horizontal]>.lm-TabBar-content{flex-direction:row}.p-TabBar[data-orientation=vertical]>.p-TabBar-content,.lm-TabBar[data-orientation=vertical]>.lm-TabBar-content{flex-direction:column}.p-TabBar-tab,.lm-TabBar-tab{display:flex;flex-direction:row;box-sizing:border-box;overflow:hidden;touch-action:none}.p-TabBar-tabIcon,.p-TabBar-tabCloseIcon,.lm-TabBar-tabIcon,.lm-TabBar-tabCloseIcon{flex:0 0 auto}.p-TabBar-tabLabel,.lm-TabBar-tabLabel{flex:1 1 auto;overflow:hidden;white-space:nowrap}.lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box}.p-TabBar-tab.p-mod-hidden,.lm-TabBar-tab.lm-mod-hidden,.lm-TabBar-addButton.lm-mod-hidden{display:none!important}.p-TabBar.p-mod-dragging .p-TabBar-tab,.lm-TabBar.lm-mod-dragging .lm-TabBar-tab{position:relative}.p-TabBar.p-mod-dragging[data-orientation=horizontal] .p-TabBar-tab,.lm-TabBar.lm-mod-dragging[data-orientation=horizontal] .lm-TabBar-tab{left:0;transition:left .15s ease}.p-TabBar.p-mod-dragging[data-orientation=vertical] .p-TabBar-tab,.lm-TabBar.lm-mod-dragging[data-orientation=vertical] .lm-TabBar-tab{top:0;transition:top .15s ease}.p-TabBar.p-mod-dragging .p-TabBar-tab.p-mod-dragging,.lm-TabBar.lm-mod-dragging .lm-TabBar-tab.lm-mod-dragging{transition:none}.lm-TabBar-tabLabel .lm-TabBar-tabInput{-webkit-user-select:all;user-select:all;width:100%;box-sizing:border-box;background:inherit}.p-TabPanel-tabBar,.lm-TabPanel-tabBar{z-index:1}.p-TabPanel-stackedPanel,.lm-TabPanel-stackedPanel{z-index:0}.phosphor_WidgetAdapter{border-left:1px solid #C0C0C0;border-right:1px solid #C0C0C0;border-bottom:1px solid #C0C0C0;background:#fff;min-width:64px;min-height:64px}.phosphor_WidgetAdapter.p-DockPanel-widget{border-top:none;box-shadow:0 -1px #0003,1px 1px 2px #0003}.phosphor_WidgetAdapter.p-SplitPanel-child{border:none}.p-DockPanel-overlay{background:#fff9;border:1px dashed black;transition-property:top,left,right,bottom;transition-duration:.15s;transition-timing-function:ease}.p-TabBar{min-height:24px;max-height:24px}.p-TabBar-content{min-width:0;min-height:0;align-items:flex-end}.p-TabPanel-tabBar .p-TabBar-content{border-bottom:1px solid #C0C0C0}.p-TabBar-tab{padding:0 10px;background:#e5e5e5;border:1px solid #C0C0C0;border-bottom:none;font:12px Helvetica,Arial,sans-serif;flex:0 1 125px;min-height:20px;max-height:20px;min-width:35px;margin-left:-1px;line-height:20px}.p-TabBar-tab.p-mod-current{background:#fff}.p-TabBar-tab:hover:not(.p-mod-current){background:#f0f0f0}.p-TabBar-tab:first-child{margin-left:0}.p-TabBar-tab.p-mod-current{min-height:23px;max-height:23px;transform:translateY(1px)}.p-TabBar-tabIcon,.p-TabBar-tabLabel,.p-TabBar-tabCloseIcon{display:inline-block}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon{margin-left:4px}.p-TabBar-tab.p-mod-closable>.p-TabBar-tabCloseIcon:before{content:"";font-family:FontAwesome}.p-TabBar-tab.p-mod-drag-image{min-height:23px;max-height:23px;min-width:125px;border:none;box-shadow:1px 1px 2px #0000004d;transform:translate(-40%) translateY(-58%)}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide{min-height:1px!important;max-height:1px!important}.p-Widget.p-TabBar.p-DockPanel-tabBar.hide .p-TabBar-tab.p-mod-current{display:none}')),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();