UNPKG

docking-egid

Version:

This library is built to provide a solution for Angular enables the creation of complex layouts consisting of panels that can be floated, docked, nested, resized, pinned, unpinned and closed. Additional components can be integrated to create an IDE-like l

1 lines 163 kB
var __awaiter=this&&this.__awaiter||function(e,t,n,i){function o(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{c(i.next(e))}catch(e){a(e)}}function s(e){try{c(i.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):o(e.value).then(r,s)}c((i=i.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var n,i,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,i=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=r.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=t.call(e,r)}catch(e){a=[6,e],i=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}},__spreadArray=this&&this.__spreadArray||function(e,t){for(var n=0,i=t.length,o=e.length;n<i;n++,o++)e[o]=t[n];return e};import{r as registerInstance,h,H as Host,c as createEvent,F as Fragment,g as getElement,f as forceUpdate}from"./index-cbe7fc41.js";import{h as IgcDockingIndicatorPosition,f as IgcSplitPaneOrientation,e as IgcDockManagerPaneType,g as IgcUnpinnedLocation,i as IgcPaneDragActionType,k as IgcResizerLocation,r as resourceStringsMap,d as addResourceStrings}from"./locale-7d22d721.js";var buttonComponentCss="button{position:static;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:auto;height:100%;min-width:10px;padding:2px 4px;border-radius:2px;color:var(--igc-button-text, rgba(0, 0, 0, 0.72));cursor:pointer;outline-style:none;font-size:14px;font-family:inherit;background:transparent;border:none;-webkit-tap-highlight-color:transparent;opacity:0.7;-webkit-transition:background 0.25s ease-out, opacity 0.25s ease-out, -webkit-box-shadow 0.25s ease-out;transition:background 0.25s ease-out, opacity 0.25s ease-out, -webkit-box-shadow 0.25s ease-out;transition:background 0.25s ease-out, opacity 0.25s ease-out, box-shadow 0.25s ease-out;transition:background 0.25s ease-out, opacity 0.25s ease-out, box-shadow 0.25s ease-out, -webkit-box-shadow 0.25s ease-out}:host([disabled]){pointer-events:none}:host{display:-ms-flexbox;display:flex}button{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}button:hover{opacity:1}button:focus{background:var(--igc-accent-color, #fff);-webkit-box-shadow:inset 0 0 0 1px var(--igc-active-color, cornflowerblue);box-shadow:inset 0 0 0 1px var(--igc-active-color, cornflowerblue);opacity:1}button[disabled]{opacity:0.54}",IgcButtonComponent=function(){function e(e){registerInstance(this,e)}return e.prototype.render=function(){return h(Host,{disabled:this.disabled},h("button",{name:this.name,type:this.type,value:this.value,"aria-disabled":this.disabled?"true":null},h("slot",null)))},e}();IgcButtonComponent.style=buttonComponentCss;var IgcTabHeadersPosition,IgcContextMenuOrientation,IgcPinBehavior,Utils=function(){function e(){}return e.isDockingIndicatorVertical=function(e){return e===IgcDockingIndicatorPosition.top||e===IgcDockingIndicatorPosition.bottom||e===IgcDockingIndicatorPosition.outerTop||e===IgcDockingIndicatorPosition.outerBottom},e.isDockingIndicatorBefore=function(e){return e===IgcDockingIndicatorPosition.top||e===IgcDockingIndicatorPosition.left||e===IgcDockingIndicatorPosition.outerTop||e===IgcDockingIndicatorPosition.outerLeft},e.isDockingIndicatorBeforeRTL=function(e){return e===IgcDockingIndicatorPosition.top||e===IgcDockingIndicatorPosition.right||e===IgcDockingIndicatorPosition.outerTop||e===IgcDockingIndicatorPosition.outerRight},e.isDockingIndicatorOuter=function(e){return e===IgcDockingIndicatorPosition.outerLeft||e===IgcDockingIndicatorPosition.outerRight||e===IgcDockingIndicatorPosition.outerTop||e===IgcDockingIndicatorPosition.outerBottom},e.isSplitPaneVertical=function(e){return e.orientation===IgcSplitPaneOrientation.vertical},e.isAltPressed=function(e){return e.altKey||e.getModifierState("Alt")||e.getModifierState("AltGraph")},e.isControlOrMetaPressed=function(e){return e.ctrlKey||e.metaKey||e.getModifierState("Meta")||e.getModifierState("OS")},e.partNameMap=function(e,t){return void 0===t&&(t=" "),Object.keys(e).filter((function(t){return e[t]})).join(t)},e.getDirection=function(e){var t="";if(""!==e.dir)t=e.dir;else for(var n=e.parentElement;n;){if(""!==n.dir){t=n.dir;break}n=n.parentElement}return t},e}(),IGC_DEFAULT_PANE_SIZE=100,IGC_DEFAULT_UNPIN_PANE_SIZE=200,IGC_RESIZING_MIN_SIZE=42,IGC_DEFAULT_RESIZE=10,IGC_DRAG_FLYOUT_THRESHOLD=50;!function(e){e.top="top",e.bottom="bottom"}(IgcTabHeadersPosition||(IgcTabHeadersPosition={})),function(e){e.top="top",e.bottom="bottom"}(IgcContextMenuOrientation||(IgcContextMenuOrientation={})),function(e){e.allPanes="allPanes",e.selectedPane="selectedPane"}(IgcPinBehavior||(IgcPinBehavior={}));var contentPaneComponentCss=":host{--min-pane-size:0px;position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:hidden;width:100%;height:100%;min-width:var(--min-pane-size);min-height:var(--min-pane-size);-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:all}:host(:focus){outline-style:none}:host([part~=disabled]:not([part~=single-floating])),:host([part~=disabled])>slot:not([name]){pointer-events:none}",IgcContentPaneComponent=function(){function e(e){registerInstance(this,e),this.rendered=createEvent(this,"rendered",7),this.disabled=!1,this.isSingleFloating=!1}return e.prototype.componentDidRender=function(){this.rendered.emit()},e.prototype.render=function(){var e=this.size||0===this.size?this.size:IGC_DEFAULT_PANE_SIZE,t=this.unpinnedSize?this.unpinnedSize:IGC_DEFAULT_UNPIN_PANE_SIZE,n=Utils.partNameMap({"content-pane":!0,disabled:this.disabled,"single-floating":this.isSingleFloating});return h(Host,{role:"group","aria-label":this.header,"aria-disabled":this.disabled?"true":"false",tabindex:this.disabled?-1:0,style:{flex:this.isFlyout?"0 1 "+t+"px":e+" 1 "+e+"px"},part:n},h("slot",{name:"header"}),h("slot",null))},e}();IgcContentPaneComponent.style=contentPaneComponentCss;var contextMenuComponentCss=":host{position:absolute;display:block;-webkit-box-sizing:border-box;box-sizing:border-box;top:0;left:0;bottom:0;right:0;z-index:10002;pointer-events:none}:host igc-icon-component svg{width:17px;height:17px}:host igc-icon-component{margin-left:8px}[part=menu-content]{position:absolute;visibility:hidden;color:var(--igc-context-menu-color, var(--igc-text-color, rgba(0, 0, 0, 0.72)));background:var(--igc-context-menu-background, var(--igc-accent-color, #fff));border:1px solid var(--igc-context-menu-background, var(--igc-accent-color, #fff));pointer-events:all;-webkit-box-shadow:0 5px 22px rgba(0, 0, 0, 0.08), 0 12px 17px 2px rgba(0, 0, 0, 0.12), 0 7px 8px -4px rgba(0, 0, 0, 0.26);box-shadow:0 5px 22px rgba(0, 0, 0, 0.08), 0 12px 17px 2px rgba(0, 0, 0, 0.12), 0 7px 8px -4px rgba(0, 0, 0, 0.26);-webkit-box-sizing:border-box;box-sizing:border-box}[part~=menu-item]{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:6px 8px;font-size:0.75em;line-height:1.7;cursor:pointer;-webkit-transition:background 0.25s ease-out, color 0.25s ease-out;transition:background 0.25s ease-out, color 0.25s ease-out;outline-style:none}[part~=menu-item]:hover{background:var(--igc-context-menu-background-active, var(--igc-border-color, #F3F5F7));color:var(--igc-context-menu-color-active, #000)}[part~=menu-item]:focus{background:var(--igc-context-menu-background-active, var(--igc-border-color, #F3F5F7));color:var(--igc-context-menu-color-active, #000)}[part~=disabled]{pointer-events:none;color:var(--igc-disabled-color, rgba(0, 0, 0, 0.38))}",IgcContextMenuComponent=function(){function e(e){var t=this;registerInstance(this,e),this.menuClosed=createEvent(this,"menuClosed",7),this.activeIndex=0,this.handleDocumentResize=function(){t.menuClosed.emit()},this.handleDocumentMouseDown=function(e){e.composedPath().every((function(e){return e!==t.elem}))&&t.menuClosed.emit()}}return e.prototype.emitMenuClosed=function(){this.menuClosed.emit()},e.prototype.connectedCallback=function(){document.defaultView.addEventListener("resize",this.handleDocumentResize,!1),document.defaultView.addEventListener("mousedown",this.handleDocumentMouseDown,!1)},e.prototype.disconnectedCallback=function(){document.defaultView.removeEventListener("resize",this.handleDocumentResize,!1),document.defaultView.removeEventListener("mousedown",this.handleDocumentMouseDown,!1)},e.prototype.componentDidLoad=function(){var e=null!==this.target.querySelector('slot[name="tabsMoreButton"]'),t=this.menuItemsDiv.getBoundingClientRect(),n=this.elem.getBoundingClientRect(),i=this.target.getRootNode(),o=i.host.getBoundingClientRect(),a="igc-tab-header-component"===i.host.tagName.toLowerCase(),r=a?i.host.parentElement.shadowRoot:i,s=r.host.getBoundingClientRect(),c=r.querySelector('div[part~="tabs-content"]').getBoundingClientRect(),l=o.right-t.right<=0,d=s.bottom+t.bottom>=window.innerHeight||s.height+t.bottom>=window.innerHeight||e&&c.height-t.height>0?c.top+(c.height-t.bottom):o.top-t.top+o.height,h=c.top-t.top,p=l?o.right-t.width:o.left,g=l?o.left:o.right-t.width,u=o.left+(o.width-t.width)/2,f=l?g:p,m=this.orientation===IgcContextMenuOrientation.bottom?a?d:h:d,v=m+t.height;switch(m=m>=0?m:d,this.position){case"start":f=p;break;case"center":f=o.width>t.width&&u;break;case"stretch":this.menuItemsDiv.style.width=o.width>t.width&&o.width+"px";break;default:f=g}this.orientation===IgcContextMenuOrientation.bottom&&v>n.height&&(m=h),f-=t.left,this.menuItemsDiv.style.left=f+"px",this.menuItemsDiv.style.top=m+"px",this.menuItemsDiv.style.visibility="visible",this.focusItemAndSetActiveIndex()},e.prototype.focusItemAndSetActiveIndex=function(){var e;null===(e=this.menuItemsDiv.querySelector('div[part="menu-item"]'))||void 0===e||e.focus()},e.prototype.handleKeyboardEvents=function(e,t){var n=this.menuItemsDiv.querySelectorAll('div[part="menu-item"]');"ArrowDown"===t.key?this.activeIndex<n.length-1&&(this.activeIndex++,n[this.activeIndex].focus()):"ArrowUp"===t.key?this.activeIndex>0&&(this.activeIndex--,n[this.activeIndex].focus()):"Enter"===t.key||" "===t.key?(e.clickHandler(),this.emitMenuClosed()):"Escape"===t.key&&this.emitMenuClosed()},e.prototype.handleMenuItemClick=function(e){e.clickHandler(),this.emitMenuClosed()},e.prototype.renderItemIcon=function(e){return h(Fragment,null,"close"===e.iconName&&this.renderCloseButton(),"unpin"===e.iconName&&this.renderUnpinButton(),null!==e.iconName&&"close"!==e.iconName&&"unpin"!==e.iconName&&h("igc-icon-component",{name:e.iconName}))},e.prototype.renderCloseButton=function(){return h("slot",{name:"contextMenuCloseButton"},h("igc-icon-component",{part:"context-menu-close-button",name:"close"}))},e.prototype.renderUnpinButton=function(){return h("slot",{name:"contextMenuUnpinButton"},h("igc-icon-component",{part:"context-menu-unpin-button",name:"unpin"}))},e.prototype.render=function(){var e=this;return h(Host,{part:"context-menu",exportparts:"context-menu,\r\n menu-item: context-menu-item,\r\n menu-content: context-menu-content,\r\n context-menu-close-button,\r\n context-menu-unpin-button"},h("div",{role:"menu",part:"menu-content",ref:function(t){return e.menuItemsDiv=t},onMouseDown:function(e){e.preventDefault()}},this.items.map((function(t){var n=Utils.partNameMap({"menu-item":!0,disabled:t.disabled});return h("div",{role:"menuitem",part:n,tabindex:"-1",onKeyDown:e.handleKeyboardEvents.bind(e,t),onClick:e.handleMenuItemClick.bind(e,t)},h("span",{style:{flexGrow:"1",userSelect:"none"}},t.displayText),e.renderItemIcon(t))}))))},Object.defineProperty(e.prototype,"elem",{get:function(){return getElement(this)},enumerable:!1,configurable:!0}),e}();function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,i=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;n=Reflect.construct(i,arguments,o)}else n=i.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return _wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(n,e)},_wrapNativeSuper(e)}function _construct(e,t,n){return _construct=_isNativeReflectConstruct()?Reflect.construct:function(e,t,n){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return n&&_setPrototypeOf(o,n.prototype),o},_construct.apply(null,arguments)}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}IgcContextMenuComponent.style=contextMenuComponentCss;var ActionReason,TwoWayMap=function(){function e(){this.map=new Map,this.reversedMap=new Map}return e.prototype.set=function(e,t){this.map.set(e,t),this.reversedMap.set(t,e)},e.prototype.get=function(e){return this.map.get(e)},e.prototype.getByValue=function(e){return this.reversedMap.get(e)},e.prototype.delete=function(e){var t=this.map.get(e);this.map.delete(e),this.reversedMap.delete(t)},e.prototype.has=function(e){return this.map.has(e)},e.prototype.hasValue=function(e){return this.reversedMap.has(e)},e}(),IgcDockManagerService=function(){function e(e){this.dockManager=e,this.unpinnedLocationMap=new Map}return e.prototype.getContent=function(e){return this.clientContentPanesMap.get(e)},e.prototype.generateUuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},e.prototype.populatePaneParents=function(e,t,n){if(e){e.id||(e.id=this.generateUuid());for(var i=0,o=e.panes;i<o.length;i++){var a=o[i];if(this.paneParentMap.set(a,e),a.id||(a.id=this.generateUuid()),a.type!==IgcDockManagerPaneType.contentPane||a.hidden)if(a.type===IgcDockManagerPaneType.splitPane)this.populatePaneParents(a,t,n);else if(a.type===IgcDockManagerPaneType.tabGroupPane)for(var r=0,s=a.panes;r<s.length;r++){var c=s[r];c.id||(c.id=this.generateUuid()),this.paneParentMap.set(c,a),c.hidden||(this.clientContentPanesMap.set(c.contentId,c),n?this.visibleDocuments.push(c):this.visibleContentPanes.push(c))}else a.type===IgcDockManagerPaneType.documentHost&&(t&&this.documentHosts.push(a),this.paneParentMap.set(a.rootPane,a),this.populatePaneParents(a.rootPane,t,!0));else this.clientContentPanesMap.set(a.contentId,a),n?this.visibleDocuments.push(a):this.visibleContentPanes.push(a)}}},e.prototype.populatePinLocations=function(e){if(e)for(var t=0,n=e.panes;t<n.length;t++){var i=n[t];if(i.type===IgcDockManagerPaneType.splitPane)this.populatePinLocations(i);else if(i.type===IgcDockManagerPaneType.tabGroupPane)for(var o=0,a=i.panes;o<a.length;o++){var r=a[o];this.addContentPanePinLocation(r),this.paneParentMap.set(r,i)}else i.type===IgcDockManagerPaneType.contentPane&&this.addContentPanePinLocation(i)}},e.prototype.resolvePaneUnpinLocation=function(e){var t;if(e.unpinnedLocation)t=e.unpinnedLocation;else{var n=this.findClosestDocumentHost(e);t=n?this.findPaneUnpinLocation(e,n):IgcUnpinnedLocation.left}return t},e.prototype.addContentPanePinLocation=function(e){if(!1===e.isPinned){var t=this.resolvePaneUnpinLocation(e);this.unpinnedLocationMap.set(e,t)}},e.prototype.findClosestDocumentHost=function(e){for(var t,n=this.getPanePath(e),i=-1,o=0,a=this.documentHosts;o<a.length;o++){var r=a[o],s=this.getPanePath(r),c=void 0;for(c=0;c<n.length;c++){if(n[c]!==s[c])break}c>i&&(i=c,t=r)}return t},e.prototype.findPaneUnpinLocation=function(e,t){for(var n=this.getPanePath(e),i=this.getPanePath(t),o=-1,a=0;a<n.length;a++){if(n[a]!==i[a])break;o=a}if(o>=0){var r=n[o],s=r.panes.indexOf(n[o+1]),c=r.panes.indexOf(i[o+1]);return r.orientation===IgcSplitPaneOrientation.horizontal?s<c?IgcUnpinnedLocation.left:IgcUnpinnedLocation.right:s<c?IgcUnpinnedLocation.top:IgcUnpinnedLocation.bottom}return IgcUnpinnedLocation.left},e.prototype.removePane=function(e){e===this.dockManager.maximizedPane&&(this.dockManager.maximizedPane=null);var t=this.paneParentMap.get(e);if(t)if(t.type===IgcDockManagerPaneType.splitPane||t.type===IgcDockManagerPaneType.tabGroupPane){var n=t.panes.indexOf(e);if(t.panes.splice(n,1),0===t.panes.length)if(t.allowEmpty){var i=this.getRootParent(e);this.isFloatingPane(i)&&this.removeFloatingPaneIfEmpty(i)}else this.removePane(t);else if(t.type===IgcDockManagerPaneType.splitPane){i=this.getRootParent(t);this.isFloatingPane(i)&&this.removeFloatingPaneIfEmpty(t)}}else t.type===IgcDockManagerPaneType.documentHost&&(t.rootPane=null,this.removePane(t));else if(this.dockManager.layout.floatingPanes){var o=this.dockManager.layout.floatingPanes.indexOf(e);o>-1&&this.dockManager.layout.floatingPanes.splice(o,1)}},e.prototype.removeFloatingPaneIfEmpty=function(e){0===this.getChildContentPanes(e).length&&this.removePane(e)},e.prototype.isFloatingPane=function(e){return!!this.dockManager.layout.floatingPanes&&this.dockManager.layout.floatingPanes.indexOf(e)>-1},e.prototype.addFloatingPane=function(e,t,n,i){var o={type:IgcDockManagerPaneType.splitPane,orientation:IgcSplitPaneOrientation.vertical,panes:[e]};o.floatingLocation=t,o.floatingWidth=n,o.floatingHeight=i,this.dockManager.layout.floatingPanes||(this.dockManager.layout.floatingPanes=[]),this.dockManager.layout.floatingPanes.push(o),this.dockManager.draggedPane=o,this.initialFloatingPaneLocation=o.floatingLocation,this.forceDragPane=o},e.prototype.getChildContentPanes=function(e){var t=[];return this.getChildContentPanesRecursive(e,t),t},e.prototype.getChildContentPanesRecursive=function(e,t){for(var n=0,i=e.panes;n<i.length;n++){var o=i[n];o.type===IgcDockManagerPaneType.contentPane?t.push(o):o.type===IgcDockManagerPaneType.tabGroupPane||o.type===IgcDockManagerPaneType.splitPane?this.getChildContentPanesRecursive(o,t):o.type===IgcDockManagerPaneType.documentHost&&this.getChildContentPanesRecursive(o.rootPane,t)}},e.prototype.getChildDocHostRecursive=function(e){for(var t=0,n=e.panes;t<n.length;t++){var i=n[t];if(i.type===IgcDockManagerPaneType.documentHost)return i;if(i.type===IgcDockManagerPaneType.splitPane){var o=this.getChildDocHostRecursive(i);if(o)return o}}return null},e.prototype.getVisibleContentPanes=function(e){var t=this;return e.panes.filter((function(e){return t.isContentPaneVisible(e)}))},e.prototype.getPaneToDock=function(e){return e.type===IgcDockManagerPaneType.contentPane?e:(e.type===IgcDockManagerPaneType.tabGroupPane||e.type===IgcDockManagerPaneType.splitPane)&&1===e.panes.length?e.panes[0]:e},e.prototype.removeDocumentHost=function(e){var t=this.getChildDocHostRecursive(e);if(t){var n=this.getParent(t),i=n.panes.indexOf(t);n.panes[i]=1===t.rootPane.panes.length?t.rootPane.panes[0]:t.rootPane}},e.prototype.dockToCenter=function(e,t){var n,i;if(e.type===IgcDockManagerPaneType.tabGroupPane)i=e;else if(e.type===IgcDockManagerPaneType.contentPane){i={type:IgcDockManagerPaneType.tabGroupPane,size:e.size,panes:[e]};var o=this.paneParentMap.get(e),a=o.panes.indexOf(e);o.panes[a]=i}else e.type===IgcDockManagerPaneType.splitPane?i=e:e.type===IgcDockManagerPaneType.documentHost&&(i=e.rootPane);if(i.type===IgcDockManagerPaneType.tabGroupPane){var r=t.type===IgcDockManagerPaneType.contentPane?[t]:this.getChildContentPanes(t);(n=i.panes).push.apply(n,r)}else if(i.type===IgcDockManagerPaneType.splitPane){var s=t;if((null==t?void 0:t.type)===IgcDockManagerPaneType.splitPane&&this.dockManager.documentOnlyDrag){this.removeDocumentHost(t);var c=this.getChildContentPanes(t);s=1===c.length?c[0]:s}i.panes.push(s)}},e.prototype.dockToEdge=function(e,t){var n=this.getParent(e),i=n.panes.indexOf(e),o=Utils.isDockingIndicatorVertical(t),a=Utils.isSplitPaneVertical(n),r=this.dockingIndicator&&"rtl"===this.dockingIndicator.direction,s=this.dockManager.draggedPane;(null==s?void 0:s.type)===IgcDockManagerPaneType.splitPane&&this.dockManager.documentOnlyDrag&&!this.dockManager.dropTargetPaneInfo.floatingPaneWithoutDocHost?this.removeDocumentHost(s):(null==s?void 0:s.type)===IgcDockManagerPaneType.contentPane&&this.dockManager.documentOnlyDrag&&this.dockManager.dropTargetPaneInfo.floatingPaneWithoutDocHost&&(s={type:IgcDockManagerPaneType.documentHost,rootPane:{type:IgcDockManagerPaneType.splitPane,orientation:IgcSplitPaneOrientation.horizontal,panes:[s]}});var c=s?this.getPaneToDock(s):this.dockManager.activePane;if(o&&a||!o&&!a){var l=Utils.isDockingIndicatorBefore(t)&&!r||Utils.isDockingIndicatorBeforeRTL(t)&&r?i:i+1;n.panes.splice(l,0,c)}else{var d={type:IgcDockManagerPaneType.splitPane,orientation:a?IgcSplitPaneOrientation.horizontal:IgcSplitPaneOrientation.vertical,panes:Utils.isDockingIndicatorBefore(t)&&!r||Utils.isDockingIndicatorBeforeRTL(t)&&r?[c,e]:[e,c],size:e.size};e.size=void 0,c.size=void 0,n.panes[i]=d}},e.prototype.updateLayout=function(){this.dockManager.layout=Object.assign({},this.dockManager.layout)},e.prototype.processLayout=function(){this.paneParentMap=new Map,this.unpinnedLocationMap=new Map,this.clientContentPanesMap=new Map,this.documentHosts=[],this.visibleContentPanes=[],this.visibleDocuments=[];var e=this.dockManager.layout;if(e){if(this.populatePaneParents(e.rootPane,!0,!1),e.floatingPanes){for(var t=new Map(this.dockManager.floatingPaneZIndicesMap),n=0;n<e.floatingPanes.length;n++){var i=e.floatingPanes[n];this.populatePaneParents(i,!1,!1),this.dockManager.floatingPaneZIndicesMap.has(i)?t.delete(i):this.dockManager.floatingPaneZIndicesMap.set(i,n)}for(var o=0,a=t.keys();o<a.length;o++){var r=a[o];this.dockManager.floatingPaneZIndicesMap.delete(r)}}this.populatePinLocations(e.rootPane),this.dockManager.flyoutPane&&!this.unpinnedLocationMap.has(this.dockManager.flyoutPane)&&(this.dockManager.flyoutPane=null)}},e.prototype.getParent=function(e){return this.paneParentMap.get(e)},e.prototype.getRootParent=function(e){return this.getPanePath(e)[0]},e.prototype.getPanePath=function(e){for(var t=[],n=e;n;)t.splice(0,0,n),n=this.paneParentMap.get(n);return t},e.prototype.getDocHostParent=function(e){var t=e;do{t=this.paneParentMap.get(t)}while(t&&t.type!==IgcDockManagerPaneType.documentHost);return t},e.prototype.resizeFlyoutPane=function(e){var t=this.dockManager.flyoutPane,n=this.unpinnedLocationMap.get(t),i=t.unpinnedSize?t.unpinnedSize:IGC_DEFAULT_UNPIN_PANE_SIZE,o=n===IgcUnpinnedLocation.left||n===IgcUnpinnedLocation.top?i+e:i-e;t.unpinnedSize=o,this.updateLayout()},e.prototype.resizePane=function(e,t){var n=this.getParent(e),i=this.getSplitPaneVisibleChildren(n),o=i.indexOf(e),a=i.map((function(e){return e.size||0===e.size?e.size:IGC_DEFAULT_PANE_SIZE})),r=a.reduce((function(e,t){return t+e}),0),s=t*r;i[o-1].size=a[o-1]+s,i[o].size=a[o]-s,this.updateLayout()},e.prototype.togglePin=function(e,t){void 0===t&&(t=IgcPinBehavior.allPanes);var n=!this.getActualIsPinned(e),i=this.paneParentMap.get(e),o={sourcePane:e,panes:i.type===IgcDockManagerPaneType.tabGroupPane&&t===IgcPinBehavior.allPanes?i.panes.filter((function(e){return!1!==e.allowPinning})):[e],newValue:n,location:this.resolvePaneUnpinLocation(e)};if(!this.dockManager.panePinnedToggle.emit(o).defaultPrevented){for(var a=0,r=o.panes;a<r.length;a++){r[a].isPinned=n}this.dockManager.maximizedPane?(this.dockManager.maximizedPane=null,n?this.dockManager.flyoutPane=null:this.flyoutPane(e)):n&&(this.dockManager.flyoutPane=null),this.updateLayout()}},e.prototype.closePane=function(e){var t=e;if(e.type===IgcDockManagerPaneType.contentPane&&e!==this.dockManager.flyoutPane){var n=this.paneParentMap.get(e);n.type===IgcDockManagerPaneType.tabGroupPane&&(t=n)}((t.type===IgcDockManagerPaneType.tabGroupPane?this.removeAllowedPanes(e,t):this.emitPaneClose(e,[t]))||e.hidden)&&e===this.dockManager.flyoutPane&&(this.dockManager.flyoutPane=null),this.updateLayout()},e.prototype.closeFloatingPane=function(e){this.removeAllowedPanes(e,e),this.updateLayout()},e.prototype.emitPaneClose=function(e,t){var n=!1,i={sourcePane:e,panes:t};if(!this.dockManager.paneClose.emit(i).defaultPrevented)for(var o=0,a=i.panes;o<a.length;o++){var r=a[o];this.removePane(r),n=!0}return n},e.prototype.removeAllowedPanes=function(e,t){var n=this,i=this.getChildContentPanes(t).filter((function(e){return n.getActualAllowClose(e)})).filter((function(n){return t.type!==IgcDockManagerPaneType.tabGroupPane||e.type!==IgcDockManagerPaneType.contentPane||!1!==n.isPinned}));return this.emitPaneClose(e,i)},e.prototype.flyoutPane=function(e){this.dockManager.flyoutPane=this.dockManager.flyoutPane===e?null:e},e.prototype.maximizePane=function(e){var t=this.getParent(e),n=t&&t.type===IgcDockManagerPaneType.tabGroupPane&&e!==this.dockManager.flyoutPane?t:e;this.dockManager.maximizedPane=this.dockManager.maximizedPane===n?null:n},e.prototype.moveFloatingPane=function(e,t){e.floatingLocation=t,this.updateLayout()},e.prototype.resizeFloatingPaneStart=function(e,t){var n,i,o,a={sourcePane:e,resizerLocation:t};return!this.dockManager.floatingPaneResizeStart.emit(a).defaultPrevented&&(this.initialFloatingPaneLocation=null!==(n=e.floatingLocation)&&void 0!==n?n:{x:0,y:0},this.initialFloatingPaneWidth=null!==(i=e.floatingWidth)&&void 0!==i?i:IGC_DEFAULT_PANE_SIZE,this.initialFloatingPaneHeight=null!==(o=e.floatingHeight)&&void 0!==o?o:IGC_DEFAULT_PANE_SIZE,!0)},e.prototype.resizeFloatingPane=function(e,t){var n=e.floatingLocation?e.floatingLocation.x:0,i=e.floatingLocation?e.floatingLocation.y:0,o=e.floatingWidth?e.floatingWidth:IGC_DEFAULT_PANE_SIZE,a=e.floatingHeight?e.floatingHeight:IGC_DEFAULT_PANE_SIZE,r=IGC_DEFAULT_PANE_SIZE,s=IGC_DEFAULT_PANE_SIZE,c=this.initialFloatingPaneWidth,l=this.initialFloatingPaneHeight,d=this.initialFloatingPaneLocation,h=t.dragMoveArgs.totalOffsetY,p=t.dragMoveArgs.totalOffsetX,g=n,u=i,f=o,m=a,v=document.documentElement.clientHeight,P=document.documentElement.clientWidth;switch(t.resizerLocation){case IgcResizerLocation.top:case IgcResizerLocation.topLeft:case IgcResizerLocation.topRight:(m=l-h)<s&&(h=l-s,m=s),(u=d.y+h)<0?(m+=u,u=0):u>=v-1&&(u=v-1);break;case IgcResizerLocation.bottom:case IgcResizerLocation.bottomLeft:case IgcResizerLocation.bottomRight:(m=l+h)<s&&(m=s),u+m>v&&(m=v-u)}switch(t.resizerLocation){case IgcResizerLocation.left:case IgcResizerLocation.topLeft:case IgcResizerLocation.bottomLeft:(f=c-p)<r&&(p=c-r,f=r),(g=d.x+p)<0?(f+=g,g=0):g>=P&&(g=P);break;case IgcResizerLocation.right:case IgcResizerLocation.topRight:case IgcResizerLocation.bottomRight:(f=c+p)<r&&(f=r),g+f>P&&(f=P-g)}if(n!==g||i!==u||o!==f||a!==m){var b={sourcePane:e,oldWidth:o,newWidth:f,oldHeight:a,newHeight:m,oldLocation:{x:n,y:i},newLocation:{x:g,y:u},resizerLocation:t.resizerLocation};this.dockManager.floatingPaneResizeMove.emit(b).defaultPrevented?t.dragMoveArgs.cancel=!0:(e.floatingLocation=b.newLocation,e.floatingWidth=b.newWidth,e.floatingHeight=b.newHeight,this.updateLayout())}},e.prototype.resizeFloatingPaneEnd=function(e,t){this.dockManager.floatingPaneResizeEnd.emit({sourcePane:e,resizerLocation:t}),this.dockManager.layoutChange.emit()},e.prototype.floatPane=function(e,t,n,i,o){var a=this,r=[e],s=e,c=this.paneParentMap.get(e);if(e!==this.dockManager.flyoutPane&&c.type===IgcDockManagerPaneType.tabGroupPane)if(c.allowEmpty){var l=__spreadArray([],c.panes);r=l,s=1===c.panes.length?e:{type:IgcDockManagerPaneType.tabGroupPane,panes:l,selectedIndex:c.selectedIndex}}else r=[c],s=c;r.forEach((function(e){return a.removePane(e)})),this.addFloatingPane(s,{x:t,y:n},i,o),e===this.dockManager.flyoutPane&&(e.isPinned=!0,this.dockManager.flyoutPane=null),this.updateLayout()},e.prototype.floatTab=function(e,t,n,i,o){var a;(this.removePane(e),!!this.getDocHostParent(e)&&e.documentOnly)?a={type:IgcDockManagerPaneType.documentHost,rootPane:{type:IgcDockManagerPaneType.splitPane,orientation:IgcSplitPaneOrientation.vertical,panes:[e]}}:a=e;this.addFloatingPane(a,{x:t,y:n},i,o),this.updateLayout()},e.prototype.hasFloatingPaneHeader=function(e){var t=this.getSplitPaneVisibleChildren(e);if(t&&t.length){if(t.length>1)return!0;var n=t[0];if(n.type===IgcDockManagerPaneType.splitPane)return this.hasFloatingPaneHeader(n);if(n.type===IgcDockManagerPaneType.documentHost)return!0}return!1},e.prototype.rootDockPane=function(e){var t=this.dockManager.layout,n=t.rootPane,i=this.dockManager.draggedPane?this.getPaneToDock(this.dockManager.draggedPane):this.dockManager.activePane;this.removePane(i);var o=e===IgcDockingIndicatorPosition.top||e===IgcDockingIndicatorPosition.bottom,a=Utils.isSplitPaneVertical(n),r=this.dockingIndicator&&"rtl"===this.dockingIndicator.direction;if(o&&a||!o&&!a){var s=e===IgcDockingIndicatorPosition.left&&!r||e===IgcDockingIndicatorPosition.right&&r||e===IgcDockingIndicatorPosition.top?0:n.panes.length;n.panes.splice(s,0,i)}else{var c={type:IgcDockManagerPaneType.splitPane,orientation:a?IgcSplitPaneOrientation.horizontal:IgcSplitPaneOrientation.vertical,panes:e===IgcDockingIndicatorPosition.left&&!r||e===IgcDockingIndicatorPosition.right&&r||e===IgcDockingIndicatorPosition.top?[i,n]:[n,i]};n.size=void 0,i.size=void 0,t.rootPane=c}this.updateLayout()},e.prototype.dockPane=function(e){var t,n=null!==(t=this.dockManager.draggedPane)&&void 0!==t?t:this.dockManager.activePane,i=this.dockManager.dropTargetPaneInfo;this.removePane(n);var o=this.dockManager.draggedPane?i.pane:this.getParent(this.dockManager.activePane);switch(e){case IgcDockingIndicatorPosition.center:this.dockToCenter(o,n);break;case IgcDockingIndicatorPosition.left:case IgcDockingIndicatorPosition.top:case IgcDockingIndicatorPosition.right:case IgcDockingIndicatorPosition.bottom:this.dockToEdge(o,e);break;case IgcDockingIndicatorPosition.outerLeft:case IgcDockingIndicatorPosition.outerTop:case IgcDockingIndicatorPosition.outerRight:case IgcDockingIndicatorPosition.outerBottom:var a=this.dockManager.dropTargetPaneInfo.docHost;this.dockToEdge(a,e)}this.updateLayout()},e.prototype.getActualIsPinned=function(e){return!1!==e.isPinned},e.prototype.getActualAllowClose=function(e){return!1!==e.allowClose},e.prototype.isContentPaneVisible=function(e){return!1!==e.isPinned&&!0!==e.hidden},e.prototype.getSplitPaneVisibleChildren=function(e){var t=this;return e.panes.filter((function(e){return e.type===IgcDockManagerPaneType.contentPane?t.isContentPaneVisible(e):e.type===IgcDockManagerPaneType.splitPane?e.allowEmpty||t.getSplitPaneVisibleChildren(e).length:e.type===IgcDockManagerPaneType.tabGroupPane?e.allowEmpty||e.panes.some((function(e){return t.isContentPaneVisible(e)})):e.type===IgcDockManagerPaneType.documentHost?e.rootPane.allowEmpty||t.getSplitPaneVisibleChildren(e.rootPane).length:void 0}))},e.prototype.closeTabPane=function(e){this.emitPaneClose(e,[e]),this.updateLayout()},e.prototype.bringFloatingPaneOnTop=function(e){for(var t=this.dockManager.layout.floatingPanes,n=this.dockManager.floatingPaneZIndicesMap,i=n.get(e),o=0,a=t;o<a.length;o++){var r=a[o],s=n.get(r);s<i||(s>i?n.set(r,s-1):n.set(r,t.length-1))}this.dockManager.floatingPaneZIndicesMap=new Map(n)},e.prototype.createContextMenuItems=function(e){var t=this,n=[];return this.getActualAllowClose(e)&&n.push({displayText:this.dockManager.resourceStrings.close,iconName:"close",clickHandler:function(){return t.closeTabPane(e)}}),!1!==e.allowPinning&&n.push({displayText:this.dockManager.resourceStrings.unpin,iconName:"unpin",clickHandler:function(){return t.togglePin(e,IgcPinBehavior.selectedPane)}}),n},e.prototype.dragPaneStart=function(e,t,n,i){var o,a,r;if(this.dockManager.maximizedPane)return!1;if(e.type===IgcDockManagerPaneType.contentPane)a=(r=this.getParent(e)).type===IgcDockManagerPaneType.tabGroupPane&&e!==this.dockManager.flyoutPane?r.panes:[e];else{if(this.dockManager.draggedPane===e)return!0;a=this.getChildContentPanes(e)}var s=a.some((function(e){return!1===e.allowDocking}))&&a.some((function(e){return!1===e.allowFloating}));if(e.type===IgcDockManagerPaneType.contentPane&&s)return!1;if(this.dockManager.paneDragStart.emit({sourcePane:e,panes:a}).defaultPrevented)return!1;if(this.draggedPanes=a,this.initialDragClientPoint={x:n,y:i},e.type!==IgcDockManagerPaneType.splitPane){if(this.draggedPanes.some((function(e){return!1===e.allowFloating})))return this.dockManager.draggedPane=a.length>1?r:e,!0;var c={type:IgcPaneDragActionType.floatPane,location:{x:t.x,y:t.y},width:t.width,height:t.height},l=this.dockManager.paneDragOver.emit({sourcePane:e,panes:a,action:c,isValid:!0});return!l.defaultPrevented&&(l.detail.isValid?(this.floatPane(e,t.x,t.y,c.width,c.height),!1):(this.dockManager.draggedPane=a.length>1?r:e,!0))}return this.dockManager.draggedPane=e,this.initialFloatingPaneLocation=null!==(o=e.floatingLocation)&&void 0!==o?o:{x:0,y:0},!0},e.prototype.dragPaneMove=function(e,t){var n=this.dockManager.draggedPane;if(n.type===IgcDockManagerPaneType.splitPane){var i=n.floatingLocation?n.floatingLocation:{x:0,y:0},o={x:this.initialFloatingPaneLocation.x+e-this.initialDragClientPoint.x,y:this.initialFloatingPaneLocation.y+t-this.initialDragClientPoint.y},a=this.dockManager.paneDragOver.emit({sourcePane:n,panes:this.draggedPanes,action:{type:IgcPaneDragActionType.moveFloatingPane,oldLocation:i,newLocation:o},isValid:!0});if(a.defaultPrevented)return!1;a.detail.isValid&&this.moveFloatingPane(n,o),this.dockManager.isValidDrop=a.detail.isValid}return this.dragOver()},e.prototype.dragPaneEnd=function(){var e,t=this.dockingIndicator,n=null!==(e=this.dockManager.draggedPane)&&void 0!==e?e:this.draggedTab,i=!1;return this.dockManager.paneDragEnd.emit({sourcePane:n,panes:this.draggedPanes}),t&&this.dockManager.isValidDrop&&(n.type===IgcDockManagerPaneType.contentPane&&!1===n.isPinned&&(n.isPinned=!0,n===this.dockManager.flyoutPane&&(this.dockManager.flyoutPane=null)),t.isRoot?this.rootDockPane(t.position):this.dockPane(t.position),i=!0),this.draggedPanes=null,this.draggedTab=null,this.dockManager.draggedPane=null,this.dockManager.dropTargetPaneInfo=null,this.dockManager.dropShadowRect=null,this.dockManager.isValidDrop=!0,this.dockManager.layoutChange.emit(),i},e.prototype.dragOver=function(){var e;if(this.dockingIndicator){var t=this.dockManager.paneDragOver.emit({sourcePane:this.dockManager.draggedPane,panes:this.draggedPanes,action:{type:IgcPaneDragActionType.dockPane,dockingIndicator:this.dockingIndicator,targetPane:null===(e=this.dockManager.dropTargetPaneInfo)||void 0===e?void 0:e.pane},isValid:!0});if(t.defaultPrevented)return!1;this.dockManager.isValidDrop=t.detail.isValid,this.dockManager.dropShadowRect=this.dockManager.isValidDrop?this.dockingIndicator.isRoot?this.getDropShadowRectRoot():this.getDropShadowRect():null}else this.dockManager.dropShadowRect=null,this.dockManager.draggedPane.type!==IgcDockManagerPaneType.splitPane&&(this.dockManager.isValidDrop=!1);return!0},e.prototype.dragTabStart=function(e){return this.shiftLeftThreshold=Number.MAX_VALUE,this.shiftRightThreshold=0,this.dockManager.draggedPane===e||!this.dockManager.paneDragStart.emit({sourcePane:e,panes:[e]}).defaultPrevented&&(this.initialTabHeaderClickOffset=null,this.draggedTab=e,this.draggedPanes=[e],!0)},e.prototype.dragTabMove=function(e,t,n){var i=t.clientX,o=t.clientY,a=t.offsetX,r=t.totalOffsetX,s=t.totalOffsetY,c=n.headerRect,l=n.prevHeaderRect,d=n.nextHeaderRect,h=n.lastVisibleHeaderRect,p=n.tabsRect;if(!this.initialTabHeaderClickOffset){var g=i-r-c.left,u=o-s-c.top;this.initialTabHeaderClickOffset={x:g,y:u}}if(!1===e.allowFloating&&(i<p.left||i>p.right||o<c.top||o>c.bottom))return this.dockManager.draggedPane=e,this.dragOver();this.dockManager.draggedPane=null,this.dockManager.isValidDrop=!0;var f=this.getParent(e).panes.indexOf(e);if(l&&i<c.left&&i<this.shiftLeftThreshold&&a<0){this.shiftLeftThreshold=l.left;var m={type:IgcPaneDragActionType.moveTab,oldIndex:f,newIndex:f-1};if((v=this.dockManager.paneDragOver.emit({sourcePane:e,panes:[e],action:m,isValid:!0})).defaultPrevented)return!1;if(!v.detail.isValid)return!0;this.shiftTabLeft(e)}else if(d&&i>c.right&&i>this.shiftRightThreshold&&a>0&&(this.shiftRightThreshold=d.right,c.top===d.top)){var v;m={type:IgcPaneDragActionType.moveTab,oldIndex:f,newIndex:f+1};if((v=this.dockManager.paneDragOver.emit({sourcePane:e,panes:[e],action:m,isValid:!0})).defaultPrevented)return!1;if(!v.detail.isValid)return!0;this.shiftTabRight(e)}return!((Math.abs(s)>IGC_DRAG_FLYOUT_THRESHOLD||p.left-i>IGC_DRAG_FLYOUT_THRESHOLD||i-h.right>IGC_DRAG_FLYOUT_THRESHOLD)&&!1!==e.allowFloating&&!this.dockManager.maximizedPane)||this.floatTabHeader(e,i,o,p)},e.prototype.floatTabHeader=function(e,t,n,i){var o,a,r=new DOMRect(t-this.initialTabHeaderClickOffset.x,n-this.initialTabHeaderClickOffset.y,i.width,i.height);e.type===IgcDockManagerPaneType.contentPane&&(o=(a=this.getParent(e)).type===IgcDockManagerPaneType.tabGroupPane&&e!==this.dockManager.flyoutPane?a.panes:[e]),this.draggedTab=null;var s={type:IgcPaneDragActionType.floatPane,location:{x:r.x,y:r.y},width:r.width,height:r.height},c=this.dockManager.paneDragOver.emit({sourcePane:e,panes:o,action:s,isValid:!0});return!c.defaultPrevented&&(!c.detail.isValid||(this.initialDragClientPoint={x:t,y:n},this.floatTab(e,r.x,r.y,s.width,s.height),!1))},e.prototype.resolveChildPanesAllowMaximize=function(e){var t=this;return this.getChildContentPanes(e).filter((function(e){return t.isContentPaneVisible(e)})).every((function(e){var n;return null!==(n=e.allowMaximize)&&void 0!==n?n:t.dockManager.allowMaximize}))},e.prototype.normalizeMaximizedPane=function(e){this.dockManager.maximizedPane&&((this.dockManager.maximizedPane.type===IgcDockManagerPaneType.splitPane||this.dockManager.maximizedPane.type===IgcDockManagerPaneType.tabGroupPane?this.getChildContentPanes(this.dockManager.maximizedPane):[this.dockManager.maximizedPane]).every((function(t){return t!==e}))&&this.maximizePane(this.dockManager.maximizedPane))},e.prototype.resolveAllowMaximize=function(e){var t,n;if(e.type===IgcDockManagerPaneType.splitPane||e.type===IgcDockManagerPaneType.tabGroupPane)return this.resolveChildPanesAllowMaximize(e);if(e.type===IgcDockManagerPaneType.contentPane){if(!this.getActualIsPinned(e))return null!==(t=e.allowMaximize)&&void 0!==t?t:this.dockManager.allowMaximize;var i=this.getParent(e);return i.type===IgcDockManagerPaneType.tabGroupPane?this.resolveChildPanesAllowMaximize(i):null!==(n=e.allowMaximize)&&void 0!==n?n:this.dockManager.allowMaximize}},e.prototype.getDropShadowRect=function(){var e,t=this.dropTargetParentRect,n=this.dockManager.dropTargetPaneInfo;if(n){var i=new DOMRect,o=null!==(e=this.getPaneToDock(this.dockManager.draggedPane).size)&&void 0!==e?e:IGC_DEFAULT_PANE_SIZE,a=Utils.isDockingIndicatorOuter(this.dockingIndicator.position),r=a?t:n.targetRect;if(this.dockingIndicator.position===IgcDockingIndicatorPosition.center)return i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i;var s=a?n.docHost:n.pane,c=this.getParent(s),l=this.getSplitPaneVisibleChildren(c),d=l.indexOf(this.dockManager.draggedPane);d>-1&&l.splice(d,1);var h=l.indexOf(s),p=Utils.isDockingIndicatorVertical(this.dockingIndicator.position),g=Utils.isSplitPaneVertical(c),u=p&&g||!p&&!g,f="rtl"===this.dockingIndicator.direction,m=l.reduce((function(e,t){return e+(t.size||IGC_DEFAULT_PANE_SIZE)}),0),v=!f||p?l.slice(0,h).reduce((function(e,t){return e+(t.size||IGC_DEFAULT_PANE_SIZE)}),0):l.slice(h,l.length).reduce((function(e,t){return e+(t.size||IGC_DEFAULT_PANE_SIZE)}),0),P=!f||p?l.slice(0,h+1).reduce((function(e,t){return e+(t.size||IGC_DEFAULT_PANE_SIZE)}),0):l.slice(h+1,l.length).reduce((function(e,t){return e+(t.size||IGC_DEFAULT_PANE_SIZE)}),0);switch(this.dockingIndicator.position){case IgcDockingIndicatorPosition.left:case IgcDockingIndicatorPosition.outerLeft:i.x=r.x,i.y=r.y,i.height=r.height,u?(i.width=o/(o+m)*t.width,i.x=f?t.left+P/(o+m)*t.width:t.left+v/(o+m)*t.width):i.width=t.width/2;break;case IgcDockingIndicatorPosition.right:case IgcDockingIndicatorPosition.outerRight:i.y=r.y,i.height=r.height,u?(i.width=o/(o+m)*t.width,i.x=f?t.left+v/(o+m)*t.width:t.left+P/(o+m)*t.width):(i.width=t.width/2,i.x=t.right-i.width);break;case IgcDockingIndicatorPosition.top:case IgcDockingIndicatorPosition.outerTop:i.x=r.x,i.y=r.y,i.width=r.width,u?(i.height=o/(o+m)*t.height,i.y=t.top+v/(o+m)*t.height):i.height=t.height/2;break;case IgcDockingIndicatorPosition.bottom:case IgcDockingIndicatorPosition.outerBottom:i.x=r.x,i.width=r.width,u?(i.height=o/(o+m)*t.height,i.y=t.top+P/(o+m)*t.height):(i.height=t.height/2,i.y=t.bottom-i.height)}return i}},e.prototype.getDropShadowRectRoot=function(){var e,t=this.dropTargetParentRect,n=new DOMRect,i=null!==(e=this.getPaneToDock(this.dockManager.draggedPane).size)&&void 0!==e?e:IGC_DEFAULT_PANE_SIZE,o=this.getSplitPaneVisibleChildren(this.dockManager.layout.rootPane),a=o.indexOf(this.dockManager.draggedPane);a>-1&&o.splice(a,1);var r=o.reduce((function(e,t){return e+(t.size||IGC_DEFAULT_PANE_SIZE)}),0),s=Utils.isDockingIndicatorVertical(this.dockingIndicator.position),c=Utils.isSplitPaneVertical(this.dockManager.layout.rootPane),l=s&&c||!s&&!c,d=0===o.length;switch(this.dockingIndicator.position){case IgcDockingIndicatorPosition.left:n.x=t.x,n.y=t.y,n.height=t.height,n.width=l||d?i/(i+r)*t.width:t.width/2;break;case IgcDockingIndicatorPosition.right:n.y=t.y,n.height=t.height,n.width=l||d?n.width=i/(i+r)*t.width:t.width/2,n.x=t.right-n.width;break;case IgcDockingIndicatorPosition.top:n.x=t.x,n.y=t.y,n.width=t.width,n.height=l||d?i/(i+r)*t.height:t.height/2;break;case IgcDockingIndicatorPosition.bottom:n.x=t.x,n.width=t.width,n.height=l||d?i/(i+r)*t.height:t.height/2,n.y=t.bottom-n.height}return n},e.prototype.selectHiddenTab=function(e,t){var n=e.panes.indexOf(t);e.panes.splice(n,1),e.panes.splice(0,0,t),e.selectedIndex=0,this.updateLayout()},e.prototype.shiftTabLeft=function(e){var t=this.getParent(e),n=t.panes.indexOf(e);n>0&&(t.panes.splice(n,1),t.panes.splice(n-1,0,e),t.selectedIndex=n-1,this.updateLayout()),this.forceDragTabHeader=e},e.prototype.shiftTabRight=function(e){var t=this.getParent(e),n=t.panes.indexOf(e);n<t.panes.length-1&&(t.panes.splice(n,1),t.panes.splice(n+1,0,e),t.selectedIndex=n+1,this.updateLayout()),this.forceDragTabHeader=e},e.prototype.cacheDocumentsOrder=function(){this.documentsCache=this.visibleDocuments.filter((function(e){return!e.disabled}))},e.prototype.cacheContentPanesOrder=function(){this.contentPanesCache=this.visibleContentPanes.filter((function(e){return!e.disabled}))},e.prototype.focusPrevContentPane=function(e){var t=e?this.documentsCache:this.contentPanesCache,n=t.indexOf(this.dockManager.activePane),i=n>0?t[n-1]:t[t.length-1];this.normalizeMaximizedPane(i),this.dockManager.activePane=i},e.prototype.focusNextContentPane=function(e){var t=e?this.documentsCache:this.contentPanesCache,n=t.indexOf(this.dockManager.activePane),i=n>=0&&n<t.length-1?t[n+1]:t[0];this.normalizeMaximizedPane(i),this.dockManager.activePane=i},e}(),IgcDockManagerKeyboardService=function(){function e(e){this.service=e}return e.prototype.handleKeydown=function(e){if(!this.service.dockManager.disableKeyboardNavigation){var t=this.service.dockManager.activePane,n=Utils.isControlOrMetaPressed(e),i=Utils.isAltPressed(e),o=e.shiftKey;if("Control"===e.key||"Meta"===e.key||"OS"===e.key)this.service.cacheDocumentsOrder();else if("Alt"===e.key||"AltGraph"===e.key)this.service.cacheContentPanesOrder();else if("F6"===e.key||e.key.startsWith("Arrow")&&!o&&n)this.handleFocusPane(e),e.stopPropagation();else if("F3"===e.key&&i&&t)this.service.dockManager.focusElement(),this.service.closePane(t),e.stopPropagation();else if(e.key.startsWith("Arrow")&&o&&t)this.service.dockManager.focusElement(),this.handleDockPane(e),e.stopPropagation();else{if("F7"!==e.key&&"F8"!==e.key||!i&&!n)return;this.setPaneNavigatorMeta(i,n,o),e.stopPropagation()}}},e.prototype.handleFocusPane=function(e){var t=Utils.isAltPressed(e),n=Utils.isControlOrMetaPressed(e),i=e.shiftKey,o="F6"===e.key,a="ArrowLeft"===e.key,r="ArrowRight"===e.key;t&&i&&o?this.service.focusPrevContentPane(!1):t&&o?this.service.focusNextContentPane(!1):n&&i&&o||n&&a?this.service.focusPrevContentPane(!0):(n&&o||n&&r)&&this.service.focusNextContentPane(!0)},e.prototype.handleDockPane=function(e){var t=e.key,n=Utils.isControlOrMetaPressed(e),i=e.shiftKey;if(n&&i)this.handleRootDockPane(t);else if(i){var o=this.service.dockManager.activePane,a=this.service.getParent(o);a.type===IgcDockManagerPaneType.tabGroupPane&&a.panes.length>1&&this.handleInnerDockPane(t)}},e.prototype.handleRootDockPane=function(e){switch(e){case"ArrowUp":this.service.rootDockPane(IgcDockingIndicatorPosition.top);break;case"ArrowDown":this.service.rootDockPane(IgcDockingIndicatorPosition.bottom);break;case"ArrowLeft":this.service.rootDockPane(IgcDockingIndicatorPosition.left);break;case"ArrowRight":this.service.rootDockPane(IgcDockingIndicatorPosition.right)}},e.prototype.handleInnerDockPane=function(e){switch(e){case"ArrowUp":this.service.dockPane(IgcDockingIndicatorPosition.top);break;case"ArrowDown":this.service.dockPane(IgcDockingIndicatorPosition.bottom);break;case"ArrowLeft":this.service.dockPane(IgcDockingIndicatorPosition.left);break;case"ArrowRight":this.service.dockPane(IgcDockingIndicatorPosition.right)}},e.prototype.setPaneNavigatorMeta=function(e,t,n){var i=0,o=this.service.visibleContentPanes.concat(this.service.visibleDocuments);if(o.length>0){t?i=this.service.visibleDocuments.length>0?n?this.service.visibleContentPanes.length+this.service.visibleDocuments.length-1:this.service.visibleContentPanes.length:n?this.service.visibleContentPanes.length-1:0:e&&(i=n?this.service.visibleContentPanes.length>0?this.service.visibleContentPanes.length-1:this.service.visibleDocuments.length-1:0);var a={activePanes:this.service.visibleContentPanes,activeDocuments:this.service.visibleDocuments,initialIndex:i,previousActivePaneIndex:o.indexOf(this.service.dockManager.activePane)};this.service.dockManager.activePane=null,this.service.dockManager.navigationPaneMeta=a}},e}(),dockmanagerComponentCss=':host{position:relative;display:-ms-flexbox;display:flex;overflow:hidden;-webkit-box-sizing:border-box;box-sizing:border-box;height:100%;background:var(--igc-dock-background, var(--igc-background-color, #E5E7E9));color:var(--igc-dock-text, var(--igc-text-color, rgba(0, 0, 0, 0.72)));font-family:var(--igc-font-family, "Titillium Web", "Roboto", "Helvetica Neue", sans-serif);outline-style:none;--unpinned-tab-area-size:30px}:host igc-icon-component svg{width:17px;height:17px}.pane-container--vertical,.pane-container--horizontal,.pane-container{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;height:100%;width:100%;overflow:hidden}.pane-container--vertical{-ms-flex-direction:column;flex-direction:column}.unpinned-tab-area{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;width:var(--unpinned-tab-area-size);height:auto}.unpinned-tab-area--left{padding:8px 8px 8px 0}.unpinned-tab-area--right{padding:8px 0 8px 8px}.unpinned-tab-area--bottom{padding-top:8px}.unpinned-tab-area--horizontal{-ms-flex-direction:row;flex-direction:row;width:auto;height:var(--unpinned-tab-area-size)}.unpinned-tab-area--hidden{display:none}.flyout-pane{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:absolute;width:100%;height:100%;pointer-events:none;z-index:2}.flyout-pane igc-content-pane-component{-webkit-box-shadow:0 12px 8px var(--igc-flyout-shadow-color, rgba(0, 0, 0, 0.08));box-shadow:0 12px 8px v