dockview-angular 4.11.0 → 4.13.0
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.
- package/dist/cjs/lib/dockview/dockview-angular.component.js +2 -1
- package/dist/cjs/lib/dockview-angular.module.js +2 -4
- package/dist/cjs/lib/gridview/gridview-angular.component.js +2 -1
- package/dist/cjs/lib/paneview/paneview-angular.component.js +2 -1
- package/dist/cjs/lib/splitview/splitview-angular.component.js +2 -1
- package/dist/cjs/lib/utils/angular-renderer.js +11 -3
- package/dist/cjs/lib/utils/component-factory.js +1 -0
- package/dist/dockview-angular.amd.js +194 -65
- package/dist/dockview-angular.amd.js.map +1 -1
- package/dist/dockview-angular.amd.min.js +2 -2
- package/dist/dockview-angular.amd.min.js.map +1 -1
- package/dist/dockview-angular.amd.min.noStyle.js +2 -2
- package/dist/dockview-angular.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-angular.amd.noStyle.js +194 -65
- package/dist/dockview-angular.amd.noStyle.js.map +1 -1
- package/dist/dockview-angular.cjs.js +194 -65
- package/dist/dockview-angular.cjs.js.map +1 -1
- package/dist/dockview-angular.esm.js +194 -66
- package/dist/dockview-angular.esm.js.map +1 -1
- package/dist/dockview-angular.esm.min.js +2 -2
- package/dist/dockview-angular.esm.min.js.map +1 -1
- package/dist/dockview-angular.js +194 -65
- package/dist/dockview-angular.js.map +1 -1
- package/dist/dockview-angular.min.js +2 -2
- package/dist/dockview-angular.min.js.map +1 -1
- package/dist/dockview-angular.min.noStyle.js +2 -2
- package/dist/dockview-angular.min.noStyle.js.map +1 -1
- package/dist/dockview-angular.noStyle.js +194 -65
- package/dist/dockview-angular.noStyle.js.map +1 -1
- package/dist/esm/lib/dockview/dockview-angular.component.js +2 -1
- package/dist/esm/lib/dockview-angular.module.js +2 -4
- package/dist/esm/lib/gridview/gridview-angular.component.js +2 -1
- package/dist/esm/lib/paneview/paneview-angular.component.js +2 -1
- package/dist/esm/lib/splitview/splitview-angular.component.js +2 -1
- package/dist/esm/lib/utils/angular-renderer.js +11 -3
- package/dist/esm/lib/utils/component-factory.js +1 -0
- package/package.json +4 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-angular
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.13.0
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
import{createComponent as e,ViewChild as t,Input as i,Output as n,Component as o,ChangeDetectionStrategy as s,EventEmitter as r,inject as a,Injector as d,EnvironmentInjector as h,ElementRef as l,Type as p,NgModule as c}from"@angular/core";import{CommonModule as v}from"@angular/common";import{Subject as u}from"rxjs";var m,g;!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.dv-scrollable {\n position: relative;\n overflow: hidden;\n}\n.dv-scrollable .dv-scrollbar-horizontal {\n position: absolute;\n bottom: 0px;\n left: 0px;\n height: 4px;\n border-radius: 2px;\n background-color: transparent;\n /* GPU optimizations */\n will-change: background-color, transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n transition-property: background-color;\n transition-timing-function: ease-in-out;\n transition-duration: 1s;\n transition-delay: 0s;\n}\n.dv-scrollable:hover .dv-scrollbar-horizontal, .dv-scrollable.dv-scrollable-resizing .dv-scrollbar-horizontal, .dv-scrollable.dv-scrollable-scrolling .dv-scrollbar-horizontal {\n background-color: var(--dv-scrollbar-background-color, rgba(255, 255, 255, 0.25));\n}\n.dv-svg {\n display: inline-block;\n fill: currentcolor;\n line-height: 1;\n stroke: currentcolor;\n stroke-width: 0;\n}\n.dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n.dockview-theme-dark .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-scrollbar-background-color: rgba(0, 0, 0, 0.25);\n}\n.dockview-theme-light .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-tabs-and-actions-container-background-color: #2d2d30;\n --dv-tabs-and-actions-container-height: 20px;\n --dv-tabs-and-actions-container-font-size: 11px;\n --dv-activegroup-visiblepanel-tab-background-color: #007acc;\n --dv-inactivegroup-visiblepanel-tab-background-color: #3f3f46;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: white;\n --dv-inactivegroup-visiblepanel-tab-color: white;\n --dv-inactivegroup-hiddenpanel-tab-color: white;\n}\n.dockview-theme-vs .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n.dockview-theme-vs .dv-groupview.dv-active-group > .dv-tabs-and-actions-container {\n box-sizing: content-box;\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tab.dv-active-tab {\n border-top: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tab.dv-inactive-tab {\n border-top: 2px solid var(--dv-activegroup-hiddenpanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container {\n box-sizing: content-box;\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tab.dv-active-tab {\n border-top: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tab.dv-inactive-tab {\n border-top: 2px solid var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n}\n\n.dockview-theme-abyss {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-color-abyss-dark: #000c18;\n --dv-color-abyss: #10192c;\n --dv-color-abyss-light: #1c1c2a;\n --dv-color-abyss-lighter: #2b2b4a;\n --dv-color-abyss-accent: rgb(91, 30, 207);\n --dv-color-abyss-primary-text: white;\n --dv-color-abyss-secondary-text: rgb(148, 151, 169);\n --dv-group-view-background-color: var(--dv-color-abyss-dark);\n --dv-tabs-and-actions-container-background-color: var(\n --dv-color-abyss-light\n );\n --dv-activegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-dark\n );\n --dv-activegroup-hiddenpanel-tab-background-color: var(--dv-color-abyss);\n --dv-inactivegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-dark\n );\n --dv-inactivegroup-hiddenpanel-tab-background-color: var(--dv-color-abyss);\n --dv-tab-divider-color: var(--dv-color-abyss-lighter);\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: rgba(255, 255, 255, 0.5);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(255, 255, 255, 0.5);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(255, 255, 255, 0.25);\n --dv-separator-border: var(--dv-color-abyss-lighter);\n --dv-paneview-header-border-color: var(--dv-color-abyss-lighter);\n --dv-paneview-active-outline-color: #596f99;\n}\n.dockview-theme-abyss .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n\n.dockview-theme-dracula {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: #282a36;\n --dv-tabs-and-actions-container-background-color: #191a21;\n --dv-activegroup-visiblepanel-tab-background-color: #282a36;\n --dv-activegroup-hiddenpanel-tab-background-color: #21222c;\n --dv-inactivegroup-visiblepanel-tab-background-color: #282a36;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #21222c;\n --dv-tab-divider-color: #191a21;\n --dv-activegroup-visiblepanel-tab-color: rgb(248, 248, 242);\n --dv-activegroup-hiddenpanel-tab-color: rgb(98, 114, 164);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(248, 248, 242, 0.5);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(98, 114, 164, 0.5);\n --dv-separator-border: #bd93f9;\n --dv-paneview-header-border-color: #bd93f9;\n --dv-paneview-active-outline-color: #6272a4;\n}\n.dockview-theme-dracula .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n position: relative;\n}\n.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab::after {\n position: absolute;\n left: 0px;\n top: 0px;\n content: "";\n width: 100%;\n height: 1px;\n background-color: #94527e;\n z-index: 999;\n}\n.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n position: relative;\n}\n.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab::after {\n position: absolute;\n left: 0px;\n bottom: 0px;\n content: "";\n width: 100%;\n height: 1px;\n background-color: #5e3d5a;\n z-index: 999;\n}\n\n.dockview-theme-replit {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n box-sizing: border-box;\n padding: 10px;\n background-color: #ebeced;\n --dv-group-view-background-color: #ebeced;\n --dv-tabs-and-actions-container-background-color: #fcfcfc;\n --dv-activegroup-visiblepanel-tab-background-color: #f0f1f2;\n --dv-activegroup-hiddenpanel-tab-background-color: #fcfcfc;\n --dv-inactivegroup-visiblepanel-tab-background-color: #f0f1f2;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #fcfcfc;\n --dv-tab-divider-color: transparent;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgb(51, 51, 51);\n --dv-inactivegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-inactivegroup-hiddenpanel-tab-color: rgb(51, 51, 51);\n --dv-separator-border: transparent;\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-sash-color: #cfd1d3;\n --dv-active-sash-color: #babbbb;\n}\n.dockview-theme-replit .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n.dockview-theme-replit .dv-resize-container:has(> .dv-groupview) {\n border-radius: 8px;\n}\n.dockview-theme-replit .dv-resize-container {\n border-radius: 10px !important;\n border: none;\n}\n.dockview-theme-replit .dv-groupview {\n overflow: hidden;\n border-radius: 10px;\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container {\n border-bottom: 1px solid rgba(128, 128, 128, 0.35);\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container .dv-tab {\n margin: 4px;\n border-radius: 8px;\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container .dv-tab .dv-svg {\n height: 8px;\n width: 8px;\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container .dv-tab:hover {\n background-color: #e4e5e6 !important;\n}\n.dockview-theme-replit .dv-groupview .dv-content-container {\n background-color: #fcfcfc;\n}\n.dockview-theme-replit .dv-groupview.dv-active-group {\n border: 1px solid rgba(128, 128, 128, 0.35);\n}\n.dockview-theme-replit .dv-groupview.dv-inactive-group {\n border: 1px solid transparent;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled)::after {\n content: "";\n height: 4px;\n width: 40px;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: var(--dv-sash-color);\n position: absolute;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):hover, .dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):active {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):hover::after, .dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):active::after {\n background-color: var(--dv-active-sash-color);\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled)::after {\n content: "";\n height: 40px;\n width: 4px;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: var(--dv-sash-color);\n position: absolute;\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):hover, .dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):active {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):hover::after, .dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):active::after {\n background-color: var(--dv-active-sash-color);\n}\n\n.dockview-theme-abyss-spaced {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-tab-font-size: 12px;\n --dv-border-radius: 20px;\n --dv-tab-margin: 0.5rem 0.25rem;\n --dv-tabs-and-actions-container-height: 44px;\n --dv-border-radius: 20px;\n box-sizing: border-box;\n --dv-color-abyss-dark: rgb(11, 6, 17);\n --dv-color-abyss: #16121f;\n --dv-color-abyss-light: #201d2b;\n --dv-color-abyss-lighter: #2a2837;\n --dv-color-abyss-accent: rgb(91, 30, 207);\n --dv-color-abyss-primary-text: white;\n --dv-color-abyss-secondary-text: rgb(148, 151, 169);\n --dv-drag-over-border: 2px solid var(--dv-color-abyss-accent);\n --dv-drag-over-background-color: "";\n --dv-group-view-background-color: var(--dv-color-abyss-dark);\n --dv-tabs-and-actions-container-background-color: var(--dv-color-abyss);\n --dv-activegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-lighter\n );\n --dv-activegroup-hiddenpanel-tab-background-color: var(\n --dv-color-abyss-light\n );\n --dv-inactivegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-lighter\n );\n --dv-inactivegroup-hiddenpanel-tab-background-color: var(\n --dv-color-abyss-light\n );\n --dv-tab-divider-color: transparent;\n --dv-activegroup-visiblepanel-tab-color: var(--dv-color-abyss-primary-text);\n --dv-activegroup-hiddenpanel-tab-color: var(\n --dv-color-abyss-secondary-text\n );\n --dv-inactivegroup-visiblepanel-tab-color: var(\n --dv-color-abyss-primary-text\n );\n --dv-inactivegroup-hiddenpanel-tab-color: var(\n --dv-color-abyss-secondary-text\n );\n --dv-separator-border: transparent;\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-active-sash-color: var(--dv-color-abyss-accent);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(0, 0, 0, 0.5);\n padding: 10px;\n background-color: var(--dv-color-abyss-dark);\n}\n.dockview-theme-abyss-spaced .dv-resize-container:has(> .dv-groupview) {\n border-radius: 8px;\n}\n.dockview-theme-abyss-spaced .dv-sash {\n border-radius: 4px;\n}\n.dockview-theme-abyss-spaced .dv-drop-target-anchor {\n border-radius: calc(var(--dv-border-radius) / 4);\n}\n.dockview-theme-abyss-spaced .dv-drop-target-anchor.dv-drop-target-content {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-abyss-spaced .dv-resize-container {\n border-radius: var(--dv-border-radius) !important;\n border: none;\n}\n.dockview-theme-abyss-spaced .dv-tabs-overflow-container,\n.dockview-theme-abyss-spaced .dv-tabs-overflow-dropdown-default {\n border-radius: 8px;\n height: unset !important;\n}\n.dockview-theme-abyss-spaced .dv-tab {\n border-radius: 8px;\n}\n.dockview-theme-abyss-spaced .dv-tab .dv-svg {\n height: 8px;\n width: 8px;\n}\n.dockview-theme-abyss-spaced .dv-groupview {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-abyss-spaced .dv-groupview .dv-tabs-and-actions-container {\n padding: 0px calc(var(--dv-border-radius) / 2);\n}\n.dockview-theme-abyss-spaced .dv-groupview .dv-content-container {\n background-color: var(--dv-tabs-and-actions-container-background-color);\n}\n.dockview-theme-abyss-spaced .dv-resize-container .dv-groupview {\n border: 2px solid var(--dv-color-abyss-dark);\n}\n\n.dockview-theme-light-spaced {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-tab-font-size: 12px;\n --dv-border-radius: 20px;\n --dv-tab-margin: 0.5rem 0.25rem;\n --dv-tabs-and-actions-container-height: 44px;\n --dv-border-radius: 20px;\n box-sizing: border-box;\n --dv-drag-over-border: 2px solid rgb(91, 30, 207);\n --dv-drag-over-background-color: "";\n --dv-group-view-background-color: #f6f5f9;\n --dv-tabs-and-actions-container-background-color: white;\n --dv-activegroup-visiblepanel-tab-background-color: #ededf0;\n --dv-activegroup-hiddenpanel-tab-background-color: #f9f9fa;\n --dv-inactivegroup-visiblepanel-tab-background-color: #ededf0;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #f9f9fa;\n --dv-tab-divider-color: transparent;\n --dv-activegroup-visiblepanel-tab-color: rgb(104, 107, 130);\n --dv-activegroup-hiddenpanel-tab-color: rgb(148, 151, 169);\n --dv-inactivegroup-visiblepanel-tab-color: rgb(104, 107, 130);\n --dv-inactivegroup-hiddenpanel-tab-color: rgb(148, 151, 169);\n --dv-separator-border: transparent;\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-active-sash-color: rgb(91, 30, 207);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(0, 0, 0, 0.1);\n padding: 10px;\n background-color: #f6f5f9;\n --dv-scrollbar-background-color: rgba(0, 0, 0, 0.25);\n}\n.dockview-theme-light-spaced .dv-resize-container:has(> .dv-groupview) {\n border-radius: 8px;\n}\n.dockview-theme-light-spaced .dv-sash {\n border-radius: 4px;\n}\n.dockview-theme-light-spaced .dv-drop-target-anchor {\n border-radius: calc(var(--dv-border-radius) / 4);\n}\n.dockview-theme-light-spaced .dv-drop-target-anchor.dv-drop-target-content {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-light-spaced .dv-resize-container {\n border-radius: var(--dv-border-radius) !important;\n border: none;\n}\n.dockview-theme-light-spaced .dv-tabs-overflow-container,\n.dockview-theme-light-spaced .dv-tabs-overflow-dropdown-default {\n border-radius: 8px;\n height: unset !important;\n}\n.dockview-theme-light-spaced .dv-tab {\n border-radius: 8px;\n}\n.dockview-theme-light-spaced .dv-tab .dv-svg {\n height: 8px;\n width: 8px;\n}\n.dockview-theme-light-spaced .dv-groupview {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-light-spaced .dv-groupview .dv-tabs-and-actions-container {\n padding: 0px calc(var(--dv-border-radius) / 2);\n}\n.dockview-theme-light-spaced .dv-groupview .dv-content-container {\n background-color: var(--dv-tabs-and-actions-container-background-color);\n}\n.dockview-theme-light-spaced .dv-resize-container .dv-groupview {\n border: 2px solid rgba(255, 255, 255, 0.1);\n}\n.dv-drop-target-container {\n position: absolute;\n z-index: 9999;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n pointer-events: none;\n overflow: hidden;\n --dv-transition-duration: 300ms;\n}\n.dv-drop-target-container .dv-drop-target-anchor {\n position: relative;\n border: var(--dv-drag-over-border);\n background-color: var(--dv-drag-over-background-color);\n opacity: 1;\n /* GPU optimizations */\n will-change: transform, opacity;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n contain: layout paint;\n transition: opacity var(--dv-transition-duration) ease-in, transform var(--dv-transition-duration) ease-out;\n}\n.dv-drop-target {\n position: relative;\n --dv-transition-duration: 70ms;\n}\n.dv-drop-target > .dv-drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 1000;\n pointer-events: none;\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection {\n position: relative;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n border: var(--dv-drag-over-border);\n background-color: var(--dv-drag-over-background-color);\n transition: top var(--dv-transition-duration) ease-out, left var(--dv-transition-duration) ease-out, width var(--dv-transition-duration) ease-out, height var(--dv-transition-duration) ease-out, opacity var(--dv-transition-duration) ease-out;\n will-change: transform;\n pointer-events: none;\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-top.dv-drop-target-small-vertical {\n border-top: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-bottom.dv-drop-target-small-vertical {\n border-bottom: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-left.dv-drop-target-small-horizontal {\n border-left: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-right.dv-drop-target-small-horizontal {\n border-right: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-dockview {\n position: relative;\n background-color: var(--dv-group-view-background-color);\n contain: layout;\n}\n.dv-dockview .dv-watermark-container {\n position: absolute;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n z-index: 1;\n}\n.dv-dockview .dv-overlay-render-container {\n position: relative;\n}\n\n.dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);\n color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-inactive-tab {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n\n/**\n * when a tab is dragged we lose the above stylings because they are conditional on parent elements\n * therefore we also set some stylings for the dragging event\n **/\n.dv-tab.dv-tab-dragging {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-groupview {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--dv-group-view-background-color);\n overflow: hidden;\n}\n.dv-groupview:focus {\n outline: none;\n}\n.dv-groupview > .dv-content-container {\n flex-grow: 1;\n min-height: 0;\n outline: none;\n}\n.dv-root-wrapper {\n height: 100%;\n width: 100%;\n}\n.dv-grid-view,\n.dv-branch-node {\n height: 100%;\n width: 100%;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-top {\n background-color: red;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-bottom {\n background-color: green;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-left {\n background-color: yellow;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-right {\n background-color: blue;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-topleft,\n.dv-debug .dv-resize-container .dv-resize-handle-topright,\n.dv-debug .dv-resize-container .dv-resize-handle-bottomleft,\n.dv-debug .dv-resize-container .dv-resize-handle-bottomright {\n background-color: cyan;\n}\n\n.dv-resize-container {\n --dv-overlay-z-index: var(--dv-overlay-z-index, 999);\n position: absolute;\n z-index: calc(var(--dv-overlay-z-index) - 2);\n border: 1px solid var(--dv-tab-divider-color);\n box-shadow: var(--dv-floating-box-shadow);\n /* GPU optimizations for floating group movement */\n will-change: transform, opacity;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n}\n.dv-resize-container.dv-hidden {\n display: none;\n}\n.dv-resize-container.dv-resize-container-dragging {\n opacity: 0.5;\n /* Enhanced GPU acceleration during drag */\n will-change: transform, opacity;\n}\n.dv-resize-container .dv-resize-handle-top {\n height: 4px;\n width: calc(100% - 8px);\n left: 4px;\n top: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ns-resize;\n}\n.dv-resize-container .dv-resize-handle-bottom {\n height: 4px;\n width: calc(100% - 8px);\n left: 4px;\n bottom: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ns-resize;\n}\n.dv-resize-container .dv-resize-handle-left {\n height: calc(100% - 8px);\n width: 4px;\n left: -2px;\n top: 4px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ew-resize;\n}\n.dv-resize-container .dv-resize-handle-right {\n height: calc(100% - 8px);\n width: 4px;\n right: -2px;\n top: 4px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ew-resize;\n}\n.dv-resize-container .dv-resize-handle-topleft {\n height: 4px;\n width: 4px;\n top: -2px;\n left: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: nw-resize;\n}\n.dv-resize-container .dv-resize-handle-topright {\n height: 4px;\n width: 4px;\n right: -2px;\n top: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ne-resize;\n}\n.dv-resize-container .dv-resize-handle-bottomleft {\n height: 4px;\n width: 4px;\n left: -2px;\n bottom: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: sw-resize;\n}\n.dv-resize-container .dv-resize-handle-bottomright {\n height: 4px;\n width: 4px;\n right: -2px;\n bottom: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: se-resize;\n}\n.dv-render-overlay {\n --dv-overlay-z-index: var(--dv-overlay-z-index, 999);\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n contain: layout paint;\n isolation: isolate;\n /* GPU optimizations */\n will-change: transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n}\n.dv-render-overlay.dv-render-overlay-float {\n z-index: calc(var(--dv-overlay-z-index) - 1);\n}\n\n.dv-debug .dv-render-overlay {\n outline: 1px solid red;\n outline-offset: -1;\n}\n.dv-pane-container {\n height: 100%;\n width: 100%;\n}\n.dv-pane-container.dv-animated .dv-view {\n /* GPU optimizations for smooth pane animations */\n will-change: transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n transition: transform 0.15s ease-out;\n}\n.dv-pane-container .dv-view {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding: 0px !important;\n}\n.dv-pane-container .dv-view:not(:first-child)::before {\n background-color: transparent !important;\n}\n.dv-pane-container .dv-view:not(:first-child) .dv-pane > .dv-pane-header {\n border-top: 1px solid var(--dv-paneview-header-border-color);\n}\n.dv-pane-container .dv-view .dv-default-header {\n background-color: var(--dv-group-view-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n display: flex;\n padding: 0px 8px;\n cursor: pointer;\n}\n.dv-pane-container .dv-view .dv-default-header .dv-pane-header-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.dv-pane-container .dv-view .dv-default-header > span {\n padding-left: 8px;\n flex-grow: 1;\n}\n.dv-pane-container:first-of-type > .dv-pane > .dv-pane-header {\n border-top: none !important;\n}\n.dv-pane-container .dv-pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n.dv-pane-container .dv-pane .dv-pane-header {\n box-sizing: border-box;\n user-select: none;\n position: relative;\n outline: none;\n}\n.dv-pane-container .dv-pane .dv-pane-header.dv-pane-draggable {\n cursor: pointer;\n}\n.dv-pane-container .dv-pane .dv-pane-header:focus:before, .dv-pane-container .dv-pane .dv-pane-header:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: "";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.dv-pane-container .dv-pane .dv-pane-body {\n overflow-y: auto;\n overflow-x: hidden;\n flex-grow: 1;\n position: relative;\n outline: none;\n}\n.dv-pane-container .dv-pane .dv-pane-body:focus:before, .dv-pane-container .dv-pane .dv-pane-body:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: "";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-enabled {\n background-color: black;\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-disabled {\n background-color: orange;\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-maximum {\n background-color: green;\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-minimum {\n background-color: red;\n}\n\n.dv-split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.dv-split-view-container.dv-splitview-disabled > .dv-sash-container > .dv-sash {\n pointer-events: none;\n}\n.dv-split-view-container.dv-animation .dv-view,\n.dv-split-view-container.dv-animation .dv-sash {\n /* GPU optimizations for smooth animations */\n will-change: transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n transition: transform 0.15s ease-out;\n}\n.dv-split-view-container.dv-horizontal {\n height: 100%;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash {\n height: 100%;\n width: 4px;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-enabled {\n cursor: ew-resize;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-disabled {\n cursor: default;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-maximum {\n cursor: w-resize;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-minimum {\n cursor: e-resize;\n}\n.dv-split-view-container.dv-horizontal > .dv-view-container > .dv-view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.dv-split-view-container.dv-vertical {\n width: 100%;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash {\n width: 100%;\n height: 4px;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-enabled {\n cursor: ns-resize;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-disabled {\n cursor: default;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-maximum {\n cursor: n-resize;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-minimum {\n cursor: s-resize;\n}\n.dv-split-view-container.dv-vertical > .dv-view-container > .dv-view {\n width: 100%;\n}\n.dv-split-view-container.dv-vertical > .dv-view-container > .dv-view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.dv-split-view-container .dv-sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.dv-split-view-container .dv-sash-container .dv-sash {\n position: absolute;\n z-index: 99;\n outline: none;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n touch-action: none;\n background-color: var(--dv-sash-color, transparent);\n}\n.dv-split-view-container .dv-sash-container .dv-sash:not(.disabled):active, .dv-split-view-container .dv-sash-container .dv-sash:not(.disabled):hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition-property: background-color;\n transition-timing-function: ease-in-out;\n transition-duration: var(--dv-active-sash-transition-duration, 0.1s);\n transition-delay: var(--dv-active-sash-transition-delay, 0.5s);\n}\n.dv-split-view-container .dv-view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.dv-split-view-container .dv-view-container .dv-view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.dv-split-view-container.dv-separator-border .dv-view:not(:first-child)::before {\n content: " ";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dv-dragged {\n transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.dv-tab {\n flex-shrink: 0;\n}\n.dv-tab:focus-within, .dv-tab:focus {\n position: relative;\n}\n.dv-tab:focus-within::after, .dv-tab:focus::after {\n position: absolute;\n content: "";\n height: 100%;\n width: 100%;\n top: 0px;\n left: 0px;\n pointer-events: none;\n outline: 1px solid var(--dv-tab-divider-color) !important;\n outline-offset: -1px;\n z-index: 5;\n}\n.dv-tab.dv-tab-dragging .dv-default-tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-tab.dv-active-tab .dv-default-tab .dv-default-tab-action {\n visibility: visible;\n}\n.dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action {\n visibility: hidden;\n}\n.dv-tab.dv-inactive-tab .dv-default-tab:hover .dv-default-tab-action {\n visibility: visible;\n}\n.dv-tab .dv-default-tab {\n position: relative;\n height: 100%;\n display: flex;\n align-items: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.dv-tab .dv-default-tab .dv-default-tab-content {\n flex-grow: 1;\n margin-right: 4px;\n}\n.dv-tab .dv-default-tab .dv-default-tab-action {\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n.dv-tab .dv-default-tab .dv-default-tab-action:hover {\n border-radius: 2px;\n background-color: var(--dv-icon-hover-background-color);\n}\n.dv-tabs-overflow-dropdown-default {\n height: 100%;\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n margin: var(--dv-tab-margin);\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: 0.25rem 0.5rem;\n cursor: pointer;\n}\n.dv-tabs-overflow-dropdown-default > span {\n padding-left: 0.25rem;\n}\n.dv-tabs-overflow-dropdown-default > svg {\n transform: rotate(90deg);\n}\n.dv-tabs-container {\n display: flex;\n height: 100%;\n overflow: auto;\n scrollbar-width: thin;\n /* GPU optimizations for smooth scrolling */\n will-change: scroll-position;\n transform: translate3d(0, 0, 0);\n /* Track */\n /* Handle */\n}\n.dv-tabs-container.dv-horizontal .dv-tab:not(:first-child)::before {\n content: " ";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-tab-divider-color);\n width: 1px;\n height: 100%;\n}\n.dv-tabs-container::-webkit-scrollbar {\n height: 3px;\n}\n.dv-tabs-container::-webkit-scrollbar-track {\n background: transparent;\n}\n.dv-tabs-container::-webkit-scrollbar-thumb {\n background: var(--dv-tabs-container-scrollbar-color);\n}\n\n.dv-scrollable > .dv-tabs-container {\n overflow: hidden;\n}\n\n.dv-tab {\n -webkit-user-drag: element;\n outline: none;\n padding: 0.25rem 0.5rem;\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n font-size: var(--dv-tab-font-size);\n margin: var(--dv-tab-margin);\n}\n\n.dv-tabs-overflow-container {\n flex-direction: column;\n height: unset;\n border: 1px solid var(--dv-tab-divider-color);\n background-color: var(--dv-group-view-background-color);\n}\n.dv-tabs-overflow-container .dv-tab:not(:last-child) {\n border-bottom: 1px solid var(--dv-tab-divider-color);\n}\n.dv-tabs-overflow-container .dv-active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-tabs-overflow-container .dv-inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.dv-tabs-and-actions-container {\n display: flex;\n background-color: var(--dv-tabs-and-actions-container-background-color);\n flex-shrink: 0;\n box-sizing: border-box;\n height: var(--dv-tabs-and-actions-container-height);\n font-size: var(--dv-tabs-and-actions-container-font-size);\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-scrollable {\n flex-grow: 1;\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-tabs-container {\n flex-grow: 1;\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-tabs-container .dv-tab {\n flex-grow: 1;\n padding: 0px;\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-void-container {\n flex-grow: 0;\n}\n.dv-tabs-and-actions-container .dv-void-container {\n display: flex;\n flex-grow: 1;\n}\n.dv-tabs-and-actions-container .dv-void-container.dv-draggable {\n cursor: grab;\n}\n.dv-tabs-and-actions-container .dv-right-actions-container {\n display: flex;\n}\n.dv-watermark {\n display: flex;\n height: 100%;\n}');class b{}class f extends b{constructor(e,t,i){super(),this.viewId=e,this.groupId=t,this.panelId=i}}class w extends b{constructor(e,t){super(),this.viewId=e,this.paneId=t}}class _{constructor(){}static getInstance(){return _.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,t){t&&(this.data=e,this.proto=t)}}function y(){const e=_.getInstance();if(e.hasData(f.prototype))return e.getData(f.prototype)[0]}function D(){const e=_.getInstance();if(e.hasData(w.prototype))return e.getData(w.prototype)[0]}_.INSTANCE=new _,function(e){e.any=(...e)=>t=>{const i=e.map((e=>e(t)));return{dispose:()=>{i.forEach((e=>{e.dispose()}))}}}}(m||(m={}));class x{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class C{constructor(){this._isAccepted=!1}get isAccepted(){return this._isAccepted}accept(){this._isAccepted=!0}}class z{static create(){var e;return new z(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn("dockview: stacktrace",this.value)}}class S{constructor(e,t){this.callback=e,this.stacktrace=t}}class A{static setLeakageMonitorEnabled(e){e!==A.ENABLE_TRACKING&&A.MEMORY_LEAK_WATCHER.clear(),A.ENABLE_TRACKING=e}get value(){return this._last}constructor(e){this.options=e,this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>{var t;(null===(t=this.options)||void 0===t?void 0:t.replay)&&void 0!==this._last&&e(this._last);const i=new S(e,A.ENABLE_TRACKING?z.create():void 0);return this._listeners.push(i),{dispose:()=>{const e=this._listeners.indexOf(i);e>-1?this._listeners.splice(e,1):A.ENABLE_TRACKING}}},A.ENABLE_TRACKING&&A.MEMORY_LEAK_WATCHER.add(this._event,z.create())),this._event}fire(e){var t;(null===(t=this.options)||void 0===t?void 0:t.replay)&&(this._last=e);for(const t of this._listeners)t.callback(e)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(A.ENABLE_TRACKING&&queueMicrotask((()=>{var e;for(const t of this._listeners)console.warn("dockview: stacktrace",null===(e=t.stacktrace)||void 0===e?void 0:e.print())})),this._listeners=[]),A.ENABLE_TRACKING&&this._event&&A.MEMORY_LEAK_WATCHER.delete(this._event))}}function k(e,t,i,n){return e.addEventListener(t,i,n),{dispose:()=>{e.removeEventListener(t,i,n)}}}A.ENABLE_TRACKING=!1,A.MEMORY_LEAK_WATCHER=new class{constructor(){this.events=new Map}get size(){return this.events.size}add(e,t){this.events.set(e,t)}delete(e){this.events.delete(e)}clear(){this.events.clear()}};class E{constructor(){this._onFired=new A,this._currentFireCount=0,this._queued=!1,this.onEvent=e=>{const t=this._currentFireCount;return this._onFired.event((()=>{this._currentFireCount>t&&e()}))}}fire(){this._currentFireCount++,this._queued||(this._queued=!0,queueMicrotask((()=>{this._queued=!1,this._onFired.fire()})))}dispose(){this._onFired.dispose()}}!function(e){e.NONE={dispose:()=>{}},e.from=function(e){return{dispose:()=>{e()}}}}(g||(g={}));class P{get isDisposed(){return this._isDisposed}constructor(...e){this._isDisposed=!1,this._disposables=e}addDisposables(...e){e.forEach((e=>this._disposables.push(e)))}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposables.forEach((e=>e.dispose())),this._disposables=[])}}class O{constructor(){this._disposable=g.NONE}set value(e){this._disposable&&this._disposable.dispose(),this._disposable=e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=g.NONE)}}class I extends P{constructor(e){super(),this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._value=null,this.addDisposables(this._onDidChange,G(e,(e=>{const t=e.target.scrollWidth>e.target.clientWidth,i=e.target.scrollHeight>e.target.clientHeight;this._value={hasScrollX:t,hasScrollY:i},this._onDidChange.fire(this._value)})))}}function G(e,t){const i=new ResizeObserver((e=>{requestAnimationFrame((()=>{const i=e[0];t(i)}))}));return i.observe(e),{dispose:()=>{i.unobserve(e),i.disconnect()}}}const V=(e,...t)=>{for(const i of t)e.classList.contains(i)&&e.classList.remove(i)},N=(e,...t)=>{for(const i of t)e.classList.contains(i)||e.classList.add(i)},T=(e,t,i)=>{const n=e.classList.contains(t);i&&!n&&e.classList.add(t),!i&&n&&e.classList.remove(t)};function L(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function R(e){return new M(e)}class M extends P{constructor(e){super(),this._onDidFocus=new A,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new A,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let t=L(document.activeElement,e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{L(document.activeElement,e)!==t&&(t?o():n())},this.addDisposables(k(e,"focus",n,!0)),this.addDisposables(k(e,"blur",o,!0))}refreshState(){this._refreshStateHandler()}}const W="dv-quasiPreventDefault";function H(e){return e[W]}function j(e){const{left:t,top:i,width:n,height:o}=e.getBoundingClientRect();return{left:t+window.scrollX,top:i+window.scrollY,width:n,height:o}}function F(e=document){const t=function(e){const t=[];return function i(n){if(n.nodeType===Node.ELEMENT_NODE){e.includes(n.tagName)&&t.push(n),n.shadowRoot&&i(n.shadowRoot);for(const e of n.children)i(e)}}(document.documentElement),t}(["IFRAME","WEBVIEW"]),i=new WeakMap;for(const e of t)i.set(e,e.style.pointerEvents),e.style.pointerEvents="none";return{release:()=>{var e;for(const n of t)n.style.pointerEvents=null!==(e=i.get(n))&&void 0!==e?e:"auto";t.splice(0,t.length)}}}class B{constructor(e){this.element=e,this._classNames=[]}setClassNames(e){for(const e of this._classNames)T(this.element,e,!1);this._classNames=e.split(" ").filter((e=>e.trim().length>0));for(const e of this._classNames)T(this.element,e,!0)}}function U(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function $(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}function J(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function Z(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Y(e,t){const i=e.findIndex((e=>e===t));return i>-1&&(e.splice(i,1),!0)}const X=(e,t,i)=>t>i?t:Math.min(i,Math.max(e,t)),q=()=>{let e=1;return{next:()=>(e++).toString()}},K=(e,t)=>{const i=[];if("number"!=typeof t&&(t=e,e=0),e<=t)for(let n=e;n<t;n++)i.push(n);else for(let n=e;n>t;n--)i.push(n);return i};class Q{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return void 0===this._cachedVisibleSize}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}setVisible(e,t){var i;e!==this.visible&&(e?(this.size=X(null!==(i=this._cachedVisibleSize)&&void 0!==i?i:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}dispose(){return this.disposable.dispose(),this.view}}var ee,te,ie,ne;!function(e){e.HORIZONTAL="HORIZONTAL",e.VERTICAL="VERTICAL"}(ee||(ee={})),function(e){e[e.MAXIMUM=0]="MAXIMUM",e[e.MINIMUM=1]="MINIMUM",e[e.DISABLED=2]="DISABLED",e[e.ENABLED=3]="ENABLED"}(te||(te={})),function(e){e.Low="low",e.High="high",e.Normal="normal"}(ie||(ie={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(ne||(ne={}));class oe{get contentSize(){return this._contentSize}get size(){return this._size}set size(e){this._size=e}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(e){this._orthogonalSize=e}get length(){return this.viewItems.length}get proportions(){return this._proportions?[...this._proportions]:void 0}get orientation(){return this._orientation}set orientation(e){this._orientation=e;const t=this.size;this.size=this.orthogonalSize,this.orthogonalSize=t,V(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==ee.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce(((e,t)=>e+t.minimumSize),0)}get maximumSize(){return 0===this.length?Number.POSITIVE_INFINITY:this.viewItems.reduce(((e,t)=>e+t.maximumSize),0)}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}get disabled(){return this._disabled}set disabled(e){this._disabled=e,T(this.element,"dv-splitview-disabled",e)}get margin(){return this._margin}set margin(e){this._margin=e,T(this.element,"dv-splitview-has-margin",0!==e)}constructor(e,t){var i,n;this.container=e,this.viewItems=[],this.sashes=[],this._size=0,this._orthogonalSize=0,this._contentSize=0,this._proportions=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this._disabled=!1,this._margin=0,this._onDidSashEnd=new A,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new A,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new A,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(e,t,i=this.viewItems.map((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,d)=>{if(e<0||e>this.viewItems.length)return 0;const h=K(e,-1),l=K(e+1,this.viewItems.length);if(o)for(const e of o)J(h,e),J(l,e);if(n)for(const e of n)Z(h,e),Z(l,e);const p=h.map((e=>this.viewItems[e])),c=h.map((e=>i[e])),v=l.map((e=>this.viewItems[e])),u=l.map((e=>i[e])),m=h.reduce(((e,t)=>e+this.viewItems[t].minimumSize-i[t]),0),g=h.reduce(((e,t)=>e+this.viewItems[t].maximumSize-i[t]),0),b=0===l.length?Number.POSITIVE_INFINITY:l.reduce(((e,t)=>e+i[t]-this.viewItems[t].minimumSize),0),f=0===l.length?Number.NEGATIVE_INFINITY:l.reduce(((e,t)=>e+i[t]-this.viewItems[t].maximumSize),0),w=Math.max(m,f),_=Math.min(b,g);let y=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;y=i!==e.visible,e.setVisible(i,a.size)}if(!y&&d){const e=this.viewItems[d.index],i=t<d.limitDelta;y=i!==e.visible,e.setVisible(i,d.size)}if(y)return this.resize(e,t,i,n,o,s,r);let D=0,x=X(t,w,_);for(let e=0;e<p.length;e++){const t=p[e],i=X(c[e]+x,t.minimumSize,t.maximumSize),n=i-c[e];D+=n,x-=n,t.size=i}let C=D;for(let e=0;e<v.length;e++){const t=v[e],i=X(u[e]-C,t.minimumSize,t.maximumSize);C+=i-u[e],t.size=i}return t},this._orientation=null!==(i=t.orientation)&&void 0!==i?i:ee.VERTICAL,this.element=this.createContainer(),this.margin=null!==(n=t.margin)&&void 0!==n?n:0,this.proportionalLayout=void 0===t.proportionalLayout||!!t.proportionalLayout,this.viewContainer=this.createViewContainer(),this.sashContainer=this.createSashContainer(),this.element.appendChild(this.sashContainer),this.element.appendChild(this.viewContainer),this.container.appendChild(this.element),this.style(t.styles),t.descriptor&&(this._size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=void 0===e.visible||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.addView(n,i,t,!0)})),this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}style(e){"transparent"===(null==e?void 0:e.separatorBorder)?(V(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(N(this.element,"dv-separator-border"),(null==e?void 0:e.separatorBorder)&&this.element.style.setProperty("--dv-separator-border",e.separatorBorder))}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");const i=this.viewItems[e];i.setVisible(t,i.size),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}resizeView(e,t){if(e<0||e>=this.viewItems.length)return;const i=K(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>this.viewItems[e].priority===ie.Low)),e],o=i.filter((e=>this.viewItems[e].priority===ie.High)),s=this.viewItems[e];t=Math.round(t),t=X(t,s.minimumSize,Math.min(s.maximumSize,this._size)),s.size=t,this.relayout(n,o)}getViews(){return this.viewItems.map((e=>e.view))}onDidChange(e,t){const i=this.viewItems.indexOf(e);if(i<0||i>=this.viewItems.length)return;t="number"==typeof t?t:e.size,t=X(t,e.minimumSize,e.maximumSize),e.size=t;const n=K(this.viewItems.length).filter((e=>e!==i)),o=[...n.filter((e=>this.viewItems[e].priority===ie.Low)),i],s=n.filter((e=>this.viewItems[e].priority===ie.High));this.relayout([...o,i],s)}addView(e,t={type:"distribute"},i=this.viewItems.length,n){const o=document.createElement("div");let s;o.className="dv-view",o.appendChild(e.element),s="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const r=e.onDidChange((e=>this.onDidChange(a,e.size))),a=new Q(o,e,s,{dispose:()=>{r.dispose(),this.viewContainer.removeChild(o)}});if(i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i)),this.viewItems.splice(i,0,a),this.viewItems.length>1){const e=document.createElement("div");e.className="dv-sash";const t=t=>{for(const e of this.viewItems)e.enabled=!1;const i=F(),n=this._orientation===ee.HORIZONTAL?t.clientX:t.clientY,o=function(e,t){for(let i=0;i<e.length;i++)if(t(e[i]))return i;return-1}(this.sashes,(t=>t.container===e)),s=this.viewItems.map((e=>e.size));let r,a;const d=K(o,-1),h=K(o+1,this.viewItems.length),l=d.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-s[t])),0),p=d.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-s[t])),0),c=0===h.length?Number.POSITIVE_INFINITY:h.reduce(((e,t)=>e+(s[t]-this.viewItems[t].minimumSize)),0),v=0===h.length?Number.NEGATIVE_INFINITY:h.reduce(((e,t)=>e+(s[t]-this.viewItems[t].viewMaximumSize)),0),u=Math.max(l,v),m=Math.min(c,p),g=this.findFirstSnapIndex(d),b=this.findFirstSnapIndex(h);if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?u-t:u+t,size:e.size}}if("number"==typeof b){const e=this.viewItems[b],t=Math.floor(e.viewMinimumSize/2);a={index:b,limitDelta:e.visible?m+t:m-t,size:e.size}}const f=e=>{const t=(this._orientation===ee.HORIZONTAL?e.clientX:e.clientY)-n;this.resize(o,t,s,void 0,void 0,u,m,r,a),this.distributeEmptySpace(),this.layoutViews()},w=()=>{for(const e of this.viewItems)e.enabled=!0;i.release(),this.saveProportions(),document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",f),document.addEventListener("pointerup",w),document.addEventListener("pointercancel",w)};e.addEventListener("pointerdown",t);const i={container:e,disposable:()=>{e.removeEventListener("pointerdown",t),this.sashContainer.removeChild(e)}};this.sashContainer.appendChild(e),this.sashes.push(i)}n||this.relayout([i]),n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes(),this._onDidAddView.fire(e)}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=X(i,t.minimumSize,t.maximumSize);const n=K(this.viewItems.length),o=n.filter((e=>this.viewItems[e].priority===ie.Low)),s=n.filter((e=>this.viewItems[e].priority===ie.High));this.relayout(o,s)}removeView(e,t,i=!1){const n=this.viewItems.splice(e,1)[0];if(n.dispose(),this.viewItems.length>=1){const t=Math.max(e-1,0);this.sashes.splice(t,1)[0].disposable()}return i||this.relayout(),t&&"distribute"===t.type&&this.distributeViewSizes(),this._onDidRemoveView.fire(n.view),n.view}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}moveView(e,t){const i=this.getViewCachedVisibleSize(e),n=void 0===i?this.getViewSize(e):ne.Invisible(i),o=this.removeView(e,void 0,!0);this.addView(o,n,t)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.orthogonalSize=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o?t+=o:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o&&t>0&&(n.size=X(Math.round(o*e/t),n.minimumSize,n.maximumSize))}}else{const t=K(this.viewItems.length),n=t.filter((e=>this.viewItems[e].priority===ie.Low)),o=t.filter((e=>this.viewItems[e].priority===ie.High));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this._size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(e){const t=this.viewItems.reduce(((e,t)=>e+t.size),0);let i=this.size-t;const n=K(this.viewItems.length-1,-1),o=n.filter((e=>this.viewItems[e].priority===ie.Low)),s=n.filter((e=>this.viewItems[e].priority===ie.High));for(const e of s)J(n,e);for(const e of o)Z(n,e);"number"==typeof e&&Z(n,e);for(let e=0;0!==i&&e<n.length;e++){const t=this.viewItems[n[e]],o=X(t.size+i,t.minimumSize,t.maximumSize);i-=o-t.size,t.size=o}}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this._proportions=this.viewItems.map((e=>e.visible?e.size/this._contentSize:void 0)))}layoutViews(){if(this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.updateSashEnablement(),0===this.viewItems.length)return;const e=this.viewItems.filter((e=>e.visible)),t=Math.max(0,e.length-1),i=this.margin*t/Math.max(1,e.length);let n=0;const o=[],s=this.viewItems.reduce(((e,t,i)=>{const n=t.visible?1:0;return 0===i?e.push(n):e.push(e[i-1]+n),e}),[]);this.viewItems.forEach(((e,r)=>{n+=this.viewItems[r].size,o.push(n);const a=e.visible?e.size-i:0,d=Math.max(0,s[r]-1),h=0===r||0===d?0:o[r-1]+d/t*i;if(r<this.viewItems.length-1){const t=e.visible?h+a-2+this.margin/2:h;this._orientation===ee.HORIZONTAL&&(this.sashes[r].container.style.left=`${t}px`,this.sashes[r].container.style.top="0px"),this._orientation===ee.VERTICAL&&(this.sashes[r].container.style.left="0px",this.sashes[r].container.style.top=`${t}px`)}this._orientation===ee.HORIZONTAL&&(e.container.style.width=`${a}px`,e.container.style.left=`${h}px`,e.container.style.top="",e.container.style.height=""),this._orientation===ee.VERTICAL&&(e.container.style.height=`${a}px`,e.container.style.top=`${h}px`,e.container.style.width="",e.container.style.left=""),e.view.layout(e.size-i,this._orthogonalSize)}))}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let e=0;e<this.sashes.length;e++){const n=this.sashes[e];r+=this.viewItems[e].size;const a=!(t[e]&&s[e+1]),d=!(i[e]&&o[e+1]);if(a&&d){const i=K(e,-1),s=K(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),d=this.findFirstSnapIndex(s),h="number"==typeof a&&!this.viewItems[a].visible,l="number"==typeof d&&!this.viewItems[d].visible;h&&o[e]&&(r>0||this.startSnappingEnabled)?this.updateSash(n,te.MINIMUM):l&&t[e]&&(r<this._contentSize||this.endSnappingEnabled)?this.updateSash(n,te.MAXIMUM):this.updateSash(n,te.DISABLED)}else a&&!d?this.updateSash(n,te.MINIMUM):!a&&d?this.updateSash(n,te.MAXIMUM):this.updateSash(n,te.ENABLED)}}updateSash(e,t){T(e.container,"dv-disabled",t===te.DISABLED),T(e.container,"dv-enabled",t===te.ENABLED),T(e.container,"dv-maximum",t===te.MAXIMUM),T(e.container,"dv-minimum",t===te.MINIMUM)}createViewContainer(){const e=document.createElement("div");return e.className="dv-view-container",e}createSashContainer(){const e=document.createElement("div");return e.className="dv-sash-container",e}createContainer(){const e=document.createElement("div"),t=this._orientation===ee.HORIZONTAL?"dv-horizontal":"dv-vertical";return e.className=`dv-split-view-container ${t}`,e}dispose(){this._onDidSashEnd.dispose(),this._onDidAddView.dispose(),this._onDidRemoveView.dispose();for(let e=0;e<this.element.children.length;e++)if(this.element.children.item(e)===this.element){this.element.removeChild(this.element);break}for(const e of this.viewItems)e.dispose();this.element.remove()}}const se=(()=>{const e={orientation:void 0,descriptor:void 0,proportionalLayout:void 0,styles:void 0,margin:void 0,disableAutoResizing:void 0,className:void 0};return Object.keys(e)})();class re extends P{get onDidAddView(){return this.splitview.onDidAddView}get onDidRemoveView(){return this.splitview.onDidRemoveView}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get orientation(){return this.splitview.orientation}get size(){return this.splitview.size}get orthogonalSize(){return this.splitview.orthogonalSize}constructor(e,t){var i;super(),this.paneItems=[],this.skipAnimation=!1,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._orientation=null!==(i=t.orientation)&&void 0!==i?i:ee.VERTICAL,this.element=document.createElement("div"),this.element.className="dv-pane-container",e.appendChild(this.element),this.splitview=new oe(this.element,{orientation:this._orientation,proportionalLayout:!1,descriptor:t.descriptor}),this.getPanes().forEach((e=>{const t=new P(e.onDidChangeExpansionState((()=>{this.setupAnimation(),this._onDidChange.fire(void 0)}))),i={pane:e,disposable:{dispose:()=>{t.dispose()}}};this.paneItems.push(i),e.orthogonalSize=this.splitview.orthogonalSize})),this.addDisposables(this._onDidChange,this.splitview.onDidSashEnd((()=>{this._onDidChange.fire(void 0)})),this.splitview.onDidAddView((()=>{this._onDidChange.fire()})),this.splitview.onDidRemoveView((()=>{this._onDidChange.fire()})))}setViewVisible(e,t){this.splitview.setViewVisible(e,t)}addPane(e,t,i=this.splitview.length,n=!1){const o=e.onDidChangeExpansionState((()=>{this.setupAnimation(),this._onDidChange.fire(void 0)})),s={pane:e,disposable:{dispose:()=>{o.dispose()}}};this.paneItems.splice(i,0,s),e.orthogonalSize=this.splitview.orthogonalSize,this.splitview.addView(e,t,i,n)}getViewSize(e){return this.splitview.getViewSize(e)}getPanes(){return this.splitview.getViews()}removePane(e,t={skipDispose:!1}){const i=this.paneItems.splice(e,1)[0];return this.splitview.removeView(e),t.skipDispose||(i.disposable.dispose(),i.pane.dispose()),i}moveView(e,t){if(e===t)return;const i=this.removePane(e,{skipDispose:!0});this.skipAnimation=!0;try{this.addPane(i.pane,i.pane.size,t,!1)}finally{this.skipAnimation=!1}}layout(e,t){this.splitview.layout(e,t)}setupAnimation(){this.skipAnimation||(this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),N(this.element,"dv-animated"),this.animationTimer=setTimeout((()=>{this.animationTimer=void 0,V(this.element,"dv-animated")}),200))}dispose(){super.dispose(),this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),this.paneItems.forEach((e=>{e.disposable.dispose(),e.pane.dispose()})),this.paneItems=[],this.splitview.dispose(),this.element.remove()}}class ae{get minimumWidth(){return this.view.minimumWidth}get maximumWidth(){return this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get priority(){return this.view.priority}get snap(){return this.view.snap}get minimumSize(){return this.orientation===ee.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===ee.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===ee.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===ee.HORIZONTAL?this.maximumWidth:this.maximumHeight}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get element(){return this.view.element}get width(){return this.orientation===ee.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===ee.HORIZONTAL?this.size:this.orthogonalSize}constructor(e,t,i,n=0){this.view=e,this.orientation=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._orthogonalSize=i,this._size=n,this._disposable=this.view.onDidChange((e=>{e?this._onDidChange.fire({size:this.orientation===ee.VERTICAL?e.width:e.height,orthogonalSize:this.orientation===ee.VERTICAL?e.height:e.width}):this._onDidChange.fire({})}))}setVisible(e){this.view.setVisible&&this.view.setVisible(e)}layout(e,t){this._size=e,this._orthogonalSize=t,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class de extends P{get width(){return this.orientation===ee.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===ee.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return 0===this.children.length?0:Math.max(...this.children.map(((e,t)=>this.splitview.isViewVisible(t)?e.minimumOrthogonalSize:0)))}get maximumSize(){return Math.min(...this.children.map(((e,t)=>this.splitview.isViewVisible(t)?e.maximumOrthogonalSize:Number.POSITIVE_INFINITY)))}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get minimumWidth(){return this.orientation===ee.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===ee.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===ee.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===ee.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(0===this.children.length)return ie.Normal;const e=this.children.map((e=>void 0===e.priority?ie.Normal:e.priority));return e.some((e=>e===ie.High))?ie.High:e.some((e=>e===ie.Low))?ie.Low:ie.Normal}get disabled(){return this.splitview.disabled}set disabled(e){this.splitview.disabled=e}get margin(){return this.splitview.margin}set margin(e){this.splitview.margin=e,this.children.forEach((t=>{t instanceof de&&(t.margin=e)}))}constructor(e,t,i,n,o,s,r,a){if(super(),this.orientation=e,this.proportionalLayout=t,this.styles=i,this._childrenDisposable=g.NONE,this.children=[],this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new A,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=o,this._size=n,this.element=document.createElement("div"),this.element.className="dv-branch-node",a){const e={views:a.map((e=>({view:e.node,size:e.node.size,visible:!(e.node instanceof ae&&void 0!==e.visible)||e.visible}))),size:this.orthogonalSize};this.children=a.map((e=>e.node)),this.splitview=new oe(this.element,{orientation:this.orientation,descriptor:e,proportionalLayout:t,styles:i,margin:r})}else this.splitview=new oe(this.element,{orientation:this.orientation,proportionalLayout:t,styles:i,margin:r}),this.splitview.layout(this.size,this.orthogonalSize);this.disabled=s,this.addDisposables(this._onDidChange,this._onDidVisibilityChange,this.splitview.onDidSashEnd((()=>{this._onDidChange.fire({})}))),this.setupChildrenEvents()}setVisible(e){}isChildVisible(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.isViewVisible(e)}setChildVisible(e,t){if(e<0||e>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(e)===t)return;const i=0===this.splitview.contentSize;this.splitview.setViewVisible(e,t);const n=0===this.splitview.contentSize;(t&&i||!t&&n)&&this._onDidVisibilityChange.fire({visible:t})}moveChild(e,t){if(e===t)return;if(e<0||e>=this.children.length)throw new Error("Invalid from index");e<t&&t--,this.splitview.moveView(e,t);const i=this._removeChild(e);this._addChild(i,t)}getChildSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(e)}resizeChild(e,t){if(e<0||e>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(e,t)}layout(e,t){this._size=t,this._orthogonalSize=e,this.splitview.layout(t,e)}addChild(e,t,i,n){if(i<0||i>this.children.length)throw new Error("Invalid index");this.splitview.addView(e,t,i,n),this._addChild(e,i)}getChildCachedVisibleSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(e)}removeChild(e,t){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(e,t),this._removeChild(e)}_addChild(e,t){this.children.splice(t,0,e),this.setupChildrenEvents()}_removeChild(e){const[t]=this.children.splice(e,1);return this.setupChildrenEvents(),t}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new P(m.any(...this.children.map((e=>e.onDidChange)))((e=>{this._onDidChange.fire({size:e.orthogonalSize})})),...this.children.map(((e,t)=>e instanceof de?e.onDidVisibilityChange((({visible:e})=>{this.setChildVisible(t,e)})):g.NONE)))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach((e=>e.dispose())),super.dispose()}}function he(e,t){if(e instanceof ae)return e;if(e instanceof de)return he(e.children[t?e.children.length-1:0],t);throw new Error("invalid node")}function le(e,t,i){if(e instanceof de){const n=new de(e.orientation,e.proportionalLayout,e.styles,t,i,e.disabled,e.margin);for(let t=e.children.length-1;t>=0;t--){const i=e.children[t];n.addChild(le(i,i.size,i.orthogonalSize),i.size,0,!0)}return n}return new ae(e.view,e.orientation,i)}function pe(e,t,i){if(e instanceof de){const n=new de(be(e.orientation),e.proportionalLayout,e.styles,t,i,e.disabled,e.margin);let o=0;for(let s=e.children.length-1;s>=0;s--){const r=e.children[s],a=r instanceof de?r.orthogonalSize:r.size;let d=0===e.size?0:Math.round(t*a/e.size);o+=d,0===s&&(d+=t-o),n.addChild(pe(r,i,d),d,0,!0)}return n}return new ae(e.view,be(e.orientation),i)}function ce(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");let i=t.firstElementChild,n=0;for(;i!==e&&i!==t.lastElementChild&&i;)i=i.nextElementSibling,n++;return n}function ve(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(t.className))return[];const i=ce(t);return[...ve(t.parentElement.parentElement.parentElement),i]}function ue(e,t,i){if(ge(e,t)===me(i)){const[e,n]=U(t);let o=n;return"right"!==i&&"bottom"!==i||(o+=1),[...e,o]}{const e="right"===i||"bottom"===i?1:0;return[...t,e]}}function me(e){return"top"===e||"bottom"===e?ee.VERTICAL:ee.HORIZONTAL}function ge(e,t){return t.length%2==0?be(e):e}const be=e=>e===ee.HORIZONTAL?ee.VERTICAL:ee.HORIZONTAL;function fe(e){return!!e.children}const we=(e,t)=>{const i=t===ee.VERTICAL?e.box.width:e.box.height;return fe(e)?{type:"branch",data:e.children.map((e=>we(e,be(t)))),size:i}:"number"==typeof e.cachedVisibleSize?{type:"leaf",data:e.view.toJSON(),size:e.cachedVisibleSize,visible:!1}:{type:"leaf",data:e.view.toJSON(),size:i}};class _e{get length(){return this._root?this._root.children.length:0}get orientation(){return this.root.orientation}set orientation(e){if(this.root.orientation===e)return;const{size:t,orthogonalSize:i}=this.root;this.root=pe(this.root,i,t),this.root.layout(t,i)}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get locked(){return this._locked}set locked(e){this._locked=e;const t=[this.root];for(;t.length>0;){const i=t.pop();i instanceof de&&(i.disabled=e,t.push(...i.children))}}get margin(){return this._margin}set margin(e){this._margin=e,this.root.margin=e}maximizedView(){var e;return null===(e=this._maximizedNode)||void 0===e?void 0:e.leaf.view}hasMaximizedView(){return void 0!==this._maximizedNode}maximizeView(e){var t;const i=ve(e.element),[n,o]=this.getNode(i);if(!(o instanceof ae))return;if((null===(t=this._maximizedNode)||void 0===t?void 0:t.leaf)===o)return;this.hasMaximizedView()&&this.exitMaximizedView(),we(this.getView(),this.orientation);const s=[];!function e(t,i){for(let n=0;n<t.children.length;n++){const o=t.children[n];o instanceof ae?o!==i&&(t.isChildVisible(n)?t.setChildVisible(n,!1):s.push(o)):e(o,i)}}(this.root,o),this._maximizedNode={leaf:o,hiddenOnMaximize:s},this._onDidMaximizedNodeChange.fire({view:o.view,isMaximized:!0})}exitMaximizedView(){if(!this._maximizedNode)return;const e=this._maximizedNode.hiddenOnMaximize;!function t(i){for(let n=i.children.length-1;n>=0;n--){const o=i.children[n];o instanceof ae?e.includes(o)||i.setChildVisible(n,!0):t(o)}}(this.root);const t=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:t.view,isMaximized:!1})}serialize(){const e=this.maximizedView();let t;e&&(t=ve(e.element)),this.hasMaximizedView()&&this.exitMaximizedView();const i={root:we(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return t&&(i.maximizedNode={location:t}),e&&this.maximizeView(e),i}dispose(){this.disposable.dispose(),this._onDidChange.dispose(),this._onDidMaximizedNodeChange.dispose(),this._onDidViewVisibilityChange.dispose(),this.root.dispose(),this._maximizedNode=void 0,this.element.remove()}clear(){const e=this.root.orientation;this.root=new de(e,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(e,t){const i=e.orientation,n=i===ee.VERTICAL?e.height:e.width;if(this._deserialize(e.root,i,t,n),this.layout(e.width,e.height),e.maximizedNode){const t=e.maximizedNode.location,[i,n]=this.getNode(t);if(!(n instanceof ae))return;this.maximizeView(n.view)}}_deserialize(e,t,i,n){this.root=this._deserializeNode(e,t,i,n)}_deserializeNode(e,t,i,n){var o;let s;if("branch"===e.type){const o=e.data.map((n=>({node:this._deserializeNode(n,be(t),i,e.size),visible:n.visible})));s=new de(t,this.proportionalLayout,this.styles,e.size,n,this.locked,this.margin,o)}else{const r=i.fromJSON(e);"boolean"==typeof e.visible&&(null===(o=r.setVisible)||void 0===o||o.call(r,e.visible)),s=new ae(r,t,n,e.size)}return s}get root(){return this._root}set root(e){const t=this._root;t&&(t.dispose(),this._maximizedNode=void 0,this.element.removeChild(t.element)),this._root=e,this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}normalize(){if(!this._root)return;if(1!==this._root.children.length)return;const e=this.root,t=e.children[0];if(t instanceof ae)return;e.element.remove();const i=e.removeChild(0);e.dispose(),i.dispose(),this._root=le(t,t.size,t.orthogonalSize),this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const e=this.root;if(e.element.remove(),this._root=new de(be(e.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),0===e.children.length);else if(1===e.children.length){const t=e.children[0];e.removeChild(0).dispose(),e.dispose(),this._root.addChild(pe(t,t.orthogonalSize,t.size),ne.Distribute,0)}else this._root.addChild(e,ne.Distribute,0);this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}next(e){return this.progmaticSelect(e)}previous(e){return this.progmaticSelect(e,!0)}getView(e){const t=e?this.getNode(e)[1]:this.root;return this._getViews(t,this.orientation)}_getViews(e,t,i){const n={height:e.height,width:e.width};if(e instanceof ae)return{box:n,view:e.view,cachedVisibleSize:i};const o=[];for(let i=0;i<e.children.length;i++){const n=e.children[i],s=e.getChildCachedVisibleSize(i);o.push(this._getViews(n,be(t),s))}return{box:n,children:o}}progmaticSelect(e,t=!1){const[i,n]=this.getNode(e);if(!(n instanceof ae))throw new Error("invalid location");for(let n=i.length-1;n>-1;n--){const o=i[n],s=e[n]||0;if(t?s-1>-1:s+1<o.children.length)return he(o.children[t?s-1:s+1],t)}return he(this.root,t)}constructor(e,t,i,n,o){this.proportionalLayout=e,this.styles=t,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new O,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new A,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new A,this.onDidMaximizedNodeChange=this._onDidMaximizedNodeChange.event,this.element=document.createElement("div"),this.element.className="dv-grid-view",this._locked=null!=n&&n,this._margin=null!=o?o:0,this.root=new de(i,e,t,0,0,this.locked,this.margin)}isViewVisible(e){const[t,i]=U(e),[,n]=this.getNode(t);if(!(n instanceof de))throw new Error("Invalid from location");return n.isChildVisible(i)}setViewVisible(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,n]=U(e),[,o]=this.getNode(i);if(!(o instanceof de))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),o.setChildVisible(n,t)}moveView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,n]=this.getNode(e);if(!(n instanceof de))throw new Error("Invalid location");n.moveChild(t,i)}addView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[n,o]=U(i),[s,r]=this.getNode(n);if(r instanceof de){const i=new ae(e,be(r.orientation),r.orthogonalSize);r.addChild(i,t,o)}else{const[i,...a]=[...s].reverse(),[d,...h]=[...n].reverse();let l=0;const p=i.getChildCachedVisibleSize(d);"number"==typeof p&&(l=ne.Invisible(p));i.removeChild(d).dispose();const c=new de(r.orientation,this.proportionalLayout,this.styles,r.size,r.orthogonalSize,this.locked,this.margin);i.addChild(c,r.size,d);const v=new ae(r.view,i.orientation,r.size);c.addChild(v,l,0),"number"!=typeof t&&"split"===t.type&&(t={type:"split",index:0});const u=new ae(e,i.orientation,r.size);c.addChild(u,t,o)}}remove(e,t){const i=ve(e.element);return this.removeView(i,t)}removeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,n]=U(e),[o,s]=this.getNode(i);if(!(s instanceof de))throw new Error("Invalid location");const r=s.children[n];if(!(r instanceof ae))throw new Error("Invalid location");if(s.removeChild(n,t),r.dispose(),1!==s.children.length)return r.view;const a=s.children[0];if(0===o.length)return a instanceof ae||(s.removeChild(0,t),this.root=a),r.view;const[d,...h]=[...o].reverse(),[l,...p]=[...i].reverse(),c=s.isChildVisible(0);s.removeChild(0,t);const v=d.children.map(((e,t)=>d.getChildSize(t)));if(d.removeChild(l,t).dispose(),a instanceof de){v.splice(l,1,...a.children.map((e=>e.size)));for(let e=0;e<a.children.length;e++){const t=a.children[e];d.addChild(t,t.size,l+e)}for(;a.children.length>0;)a.removeChild(0)}else{const e=new ae(a.view,be(a.orientation),a.size),t=c?a.orthogonalSize:ne.Invisible(a.orthogonalSize);d.addChild(e,t,l)}a.dispose();for(let e=0;e<v.length;e++)d.resizeChild(e,v[e]);return r.view}layout(e,t){const[i,n]=this.root.orientation===ee.HORIZONTAL?[t,e]:[e,t];this.root.layout(i,n)}getNode(e,t=this.root,i=[]){if(0===e.length)return[i,t];if(!(t instanceof de))throw new Error("Invalid location");const[n,...o]=e;if(n<0||n>=t.children.length)throw new Error("Invalid location");const s=t.children[n];return i.push(t),this.getNode(o,s,i)}}const ye=(()=>{const e={disableAutoResizing:void 0,proportionalLayout:void 0,orientation:void 0,hideBorders:void 0,className:void 0};return Object.keys(e)})();class De extends P{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(e){this._disableResizing=e}constructor(e,t=!1){super(),this._disableResizing=t,this._element=e,this.addDisposables(G(this._element,(e=>{if(this.isDisposed)return;if(this.disableResizing)return;if(!this._element.offsetParent)return;if(!function(e){let t=e;for(;null==t?void 0:t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof DocumentFragment?t.parentNode.host:t.parentNode}return!1}(this._element))return;const{width:t,height:i}=e.contentRect;this.layout(t,i)})))}}const xe=q();function Ce(e){switch(e){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";default:return"center"}}class ze extends De{get id(){return this._id}get size(){return this._groups.size}get groups(){return Array.from(this._groups.values()).map((e=>e.value))}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumHeight(){return this.gridview.minimumHeight}get maximumHeight(){return this.gridview.maximumHeight}get minimumWidth(){return this.gridview.minimumWidth}get maximumWidth(){return this.gridview.maximumWidth}get activeGroup(){return this._activeGroup}get locked(){return this.gridview.locked}set locked(e){this.gridview.locked=e}constructor(e,t){var i;super(document.createElement("div"),t.disableAutoResizing),this._id=xe.next(),this._groups=new Map,this._onDidRemove=new A,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new A,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new A,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new A,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new E,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new E,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new B(this.element),this._classNames.setClassNames(null!==(i=t.className)&&void 0!==i?i:""),e.appendChild(this.element),this.gridview=new _e(!!t.proportionalLayout,t.styles,t.orientation,t.locked,t.margin),this.gridview.locked=!!t.locked,this.element.appendChild(this.gridview.element),this.layout(0,0,!0),this.addDisposables(this.gridview.onDidMaximizedNodeChange((e=>{this._onDidMaximizedChange.fire({panel:e.view,isMaximized:e.isMaximized})})),this.gridview.onDidViewVisibilityChange((()=>this._onDidViewVisibilityChangeMicroTaskQueue.fire())),this.onDidViewVisibilityChangeMicroTaskQueue((()=>{this.layout(this.width,this.height,!0)})),g.from((()=>{var e;null===(e=this.element.parentElement)||void 0===e||e.removeChild(this.element)})),this.gridview.onDidChange((()=>{this._bufferOnDidLayoutChange.fire()})),m.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)((()=>{this._bufferOnDidLayoutChange.fire()})),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(e,t){this.gridview.setViewVisible(ve(e.element),t),this._bufferOnDidLayoutChange.fire()}isVisible(e){return this.gridview.isViewVisible(ve(e.element))}updateOptions(e){var t,i,n,o;e.proportionalLayout,e.orientation&&(this.gridview.orientation=e.orientation),"disableResizing"in e&&(this.disableResizing=null!==(t=e.disableAutoResizing)&&void 0!==t&&t),"locked"in e&&(this.locked=null!==(i=e.locked)&&void 0!==i&&i),"margin"in e&&(this.gridview.margin=null!==(n=e.margin)&&void 0!==n?n:0),"className"in e&&this._classNames.setClassNames(null!==(o=e.className)&&void 0!==o?o:"")}maximizeGroup(e){this.gridview.maximizeView(e),this.doSetGroupActive(e)}isMaximizedGroup(e){return this.gridview.maximizedView()===e}exitMaximizedGroup(){this.gridview.exitMaximizedView()}hasMaximizedGroup(){return this.gridview.hasMaximizedView()}doAddGroup(e,t=[0],i){this.gridview.addView(e,null!=i?i:ne.Distribute,t),this._onDidAdd.fire(e)}doRemoveGroup(e,t){if(!this._groups.has(e.id))throw new Error("invalid operation");const i=this._groups.get(e.id),n=this.gridview.remove(e,ne.Distribute);if(i&&!(null==t?void 0:t.skipDispose)&&(i.disposable.dispose(),i.value.dispose(),this._groups.delete(e.id),this._onDidRemove.fire(e)),!(null==t?void 0:t.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupActive(e.length>0?e[0].value:void 0)}return n}getPanel(e){var t;return null===(t=this._groups.get(e))||void 0===t?void 0:t.value}doSetGroupActive(e){this._activeGroup!==e&&(this._activeGroup&&this._activeGroup.setActive(!1),e&&e.setActive(!0),this._activeGroup=e,this._onDidActiveChange.fire(e))}removeGroup(e){this.doRemoveGroup(e)}moveToNext(e){var t;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=ve(e.group.element),n=null===(t=this.gridview.next(i))||void 0===t?void 0:t.view;this.doSetGroupActive(n)}moveToPrevious(e){var t;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=ve(e.group.element),n=null===(t=this.gridview.previous(i))||void 0===t?void 0:t.view;this.doSetGroupActive(n)}layout(e,t,i){(i||e!==this.width||t!==this.height)&&(this.gridview.element.style.height=`${t}px`,this.gridview.element.style.width=`${e}px`,this.gridview.layout(e,t))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const e of this.groups)e.dispose();this.gridview.dispose(),super.dispose()}}class Se{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get length(){return this.component.length}get orientation(){return this.component.orientation}get panels(){return this.component.panels}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}constructor(e){this.component=e}removePanel(e,t){this.component.removePanel(e,t)}focus(){this.component.focus()}getPanel(e){return this.component.getPanel(e)}layout(e,t){return this.component.layout(e,t)}addPanel(e){return this.component.addPanel(e)}movePanel(e,t){this.component.movePanel(e,t)}fromJSON(e){this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Ae{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get panels(){return this.component.panels}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}get onDidDrop(){return this.component.onDidDrop}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}constructor(e){this.component=e}removePanel(e){this.component.removePanel(e)}getPanel(e){return this.component.getPanel(e)}movePanel(e,t){this.component.movePanel(e,t)}focus(){this.component.focus()}layout(e,t){this.component.layout(e,t)}addPanel(e){return this.component.addPanel(e)}fromJSON(e){this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class ke{get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddPanel(){return this.component.onDidAddGroup}get onDidRemovePanel(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActiveGroupChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get panels(){return this.component.groups}get orientation(){return this.component.orientation}set orientation(e){this.component.updateOptions({orientation:e})}constructor(e){this.component=e}focus(){this.component.focus()}layout(e,t,i=!1){this.component.layout(e,t,i)}addPanel(e){return this.component.addPanel(e)}removePanel(e,t){this.component.removePanel(e,t)}movePanel(e,t){this.component.movePanel(e,t)}getPanel(e){return this.component.getPanel(e)}fromJSON(e){return this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Ee{get id(){return this.component.id}get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get size(){return this.component.size}get totalPanels(){return this.component.totalPanels}get onDidActiveGroupChange(){return this.component.onDidActiveGroupChange}get onDidAddGroup(){return this.component.onDidAddGroup}get onDidRemoveGroup(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActivePanelChange}get onDidAddPanel(){return this.component.onDidAddPanel}get onDidRemovePanel(){return this.component.onDidRemovePanel}get onDidMovePanel(){return this.component.onDidMovePanel}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidDrop(){return this.component.onDidDrop}get onWillDrop(){return this.component.onWillDrop}get onWillShowOverlay(){return this.component.onWillShowOverlay}get onWillDragGroup(){return this.component.onWillDragGroup}get onWillDragPanel(){return this.component.onWillDragPanel}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}get onDidPopoutGroupSizeChange(){return this.component.onDidPopoutGroupSizeChange}get onDidPopoutGroupPositionChange(){return this.component.onDidPopoutGroupPositionChange}get onDidOpenPopoutWindowFail(){return this.component.onDidOpenPopoutWindowFail}get panels(){return this.component.panels}get groups(){return this.component.groups}get activePanel(){return this.component.activePanel}get activeGroup(){return this.component.activeGroup}constructor(e){this.component=e}focus(){this.component.focus()}getPanel(e){return this.component.getGroupPanel(e)}layout(e,t,i=!1){this.component.layout(e,t,i)}addPanel(e){return this.component.addPanel(e)}removePanel(e){this.component.removePanel(e)}addGroup(e){return this.component.addGroup(e)}closeAllGroups(){return this.component.closeAllGroups()}removeGroup(e){this.component.removeGroup(e)}getGroup(e){return this.component.getPanel(e)}addFloatingGroup(e,t){return this.component.addFloatingGroup(e,t)}fromJSON(e){this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}moveToNext(e){this.component.moveToNext(e)}moveToPrevious(e){this.component.moveToPrevious(e)}maximizeGroup(e){this.component.maximizeGroup(e.group)}hasMaximizedGroup(){return this.component.hasMaximizedGroup()}exitMaximizedGroup(){this.component.exitMaximizedGroup()}get onDidMaximizedGroupChange(){return this.component.onDidMaximizedGroupChange}addPopoutGroup(e,t){return this.component.addPopoutGroup(e,t)}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Pe extends P{constructor(e,t){super(),this.el=e,this.disabled=t,this.dataDisposable=new O,this.pointerEventsDisposable=new O,this._onDragStart=new A,this.onDragStart=this._onDragStart.event,this.addDisposables(this._onDragStart,this.dataDisposable,this.pointerEventsDisposable),this.configure()}setDisabled(e){this.disabled=e}isCancelled(e){return!1}configure(){this.addDisposables(this._onDragStart,k(this.el,"dragstart",(e=>{if(e.defaultPrevented||this.isCancelled(e)||this.disabled)return void e.preventDefault();const t=F();if(this.pointerEventsDisposable.value={dispose:()=>{t.release()}},this.el.classList.add("dv-dragged"),setTimeout((()=>this.el.classList.remove("dv-dragged")),0),this.dataDisposable.value=this.getData(e),this._onDragStart.fire(e),e.dataTransfer){e.dataTransfer.effectAllowed="move";e.dataTransfer.items.length>0||e.dataTransfer.setData("text/plain","")}})),k(this.el,"dragend",(()=>{this.pointerEventsDisposable.dispose(),setTimeout((()=>{this.dataDisposable.dispose()}),0)})))}}class Oe extends P{constructor(e,t){super(),this.element=e,this.callbacks=t,this.target=null,this.registerListeners()}onDragEnter(e){this.target=e.target,this.callbacks.onDragEnter(e)}onDragOver(e){e.preventDefault(),this.callbacks.onDragOver&&this.callbacks.onDragOver(e)}onDragLeave(e){this.target===e.target&&(this.target=null,this.callbacks.onDragLeave(e))}onDragEnd(e){this.target=null,this.callbacks.onDragEnd(e)}onDrop(e){this.callbacks.onDrop(e)}registerListeners(){this.addDisposables(k(this.element,"dragenter",(e=>{this.onDragEnter(e)}),!0)),this.addDisposables(k(this.element,"dragover",(e=>{this.onDragOver(e)}),!0)),this.addDisposables(k(this.element,"dragleave",(e=>{this.onDragLeave(e)}))),this.addDisposables(k(this.element,"dragend",(e=>{this.onDragEnd(e)}))),this.addDisposables(k(this.element,"drop",(e=>{this.onDrop(e)})))}}class Ie extends x{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(e){super(),this.options=e}}function Ge(e){switch(e){case"above":return"top";case"below":return"bottom";case"left":return"left";case"right":return"right";case"within":return"center";default:throw new Error(`invalid direction '${e}'`)}}function Ve(e){switch(e){case"top":return"above";case"bottom":return"below";case"left":return"left";case"right":return"right";case"center":return"within";default:throw new Error(`invalid position '${e}'`)}}const Ne={value:20,type:"percentage"},Te={value:50,type:"percentage"};class Le extends P{get disabled(){return this._disabled}set disabled(e){this._disabled=e}get state(){return this._state}constructor(e,t){super(),this.element=e,this.options=t,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._disabled=!1,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new Oe(this.element,{onDragEnter:()=>{var e,t,i;null===(i=null===(t=(e=this.options).getOverrideTarget)||void 0===t?void 0:t.call(e))||void 0===i||i.getElements()},onDragOver:e=>{var t,i,n,o,s,r,a;Le.ACTUAL_TARGET=this;const d=null===(i=(t=this.options).getOverrideTarget)||void 0===i?void 0:i.call(t);if(0===this._acceptedTargetZonesSet.size){if(d)return;return void this.removeDropTarget()}const h=null!==(s=null===(o=(n=this.options).getOverlayOutline)||void 0===o?void 0:o.call(n))&&void 0!==s?s:this.element,l=h.offsetWidth,p=h.offsetHeight;if(0===l||0===p)return;const c=e.currentTarget.getBoundingClientRect(),v=(null!==(r=e.clientX)&&void 0!==r?r:0)-c.left,u=(null!==(a=e.clientY)&&void 0!==a?a:0)-c.top,m=this.calculateQuadrant(this._acceptedTargetZonesSet,v,u,l,p);if(this.isAlreadyUsed(e)||null===m)return void this.removeDropTarget();if(!this.options.canDisplayOverlay(e,m)){if(d)return;return void this.removeDropTarget()}const g=new Ie({nativeEvent:e,position:m});this._onWillShowOverlay.fire(g),g.defaultPrevented?this.removeDropTarget():(this.markAsUsed(e),d||this.targetElement||(this.targetElement=document.createElement("div"),this.targetElement.className="dv-drop-target-dropzone",this.overlayElement=document.createElement("div"),this.overlayElement.className="dv-drop-target-selection",this._state="center",this.targetElement.appendChild(this.overlayElement),h.classList.add("dv-drop-target"),h.append(this.targetElement)),this.toggleClasses(m,l,p),this._state=m)},onDragLeave:()=>{var e,t;(null===(t=(e=this.options).getOverrideTarget)||void 0===t?void 0:t.call(e))||this.removeDropTarget()},onDragEnd:e=>{var t,i;const n=null===(i=(t=this.options).getOverrideTarget)||void 0===i?void 0:i.call(t);n&&Le.ACTUAL_TARGET===this&&this._state&&(e.stopPropagation(),this._onDrop.fire({position:this._state,nativeEvent:e})),this.removeDropTarget(),null==n||n.clear()},onDrop:e=>{var t,i,n;e.preventDefault();const o=this._state;this.removeDropTarget(),null===(n=null===(i=(t=this.options).getOverrideTarget)||void 0===i?void 0:i.call(t))||void 0===n||n.clear(),o&&(e.stopPropagation(),this._onDrop.fire({position:o,nativeEvent:e}))}}),this.addDisposables(this._onDrop,this._onWillShowOverlay,this.dnd)}setTargetZones(e){this._acceptedTargetZonesSet=new Set(e)}setOverlayModel(e){this.options.overlayModel=e}dispose(){this.removeDropTarget(),super.dispose()}markAsUsed(e){e[Le.USED_EVENT_ID]=!0}isAlreadyUsed(e){const t=e[Le.USED_EVENT_ID];return"boolean"==typeof t&&t}toggleClasses(e,t,i){var n,o,s,r,a,d,h;const l=null===(o=(n=this.options).getOverrideTarget)||void 0===o?void 0:o.call(n);if(!l&&!this.overlayElement)return;const p=t<100,c=i<100,v="left"===e,u="right"===e,m="top"===e,g="bottom"===e,b=!p&&u,f=!p&&v,w=!c&&m,_=!c&&g;let y=1;const D=null!==(r=null===(s=this.options.overlayModel)||void 0===s?void 0:s.size)&&void 0!==r?r:Te;if("percentage"===D.type?y=X(D.value,0,100)/100:((b||f)&&(y=X(0,D.value,t)/t),(w||_)&&(y=X(0,D.value,i)/i)),l){const n=null!==(h=null===(d=(a=this.options).getOverlayOutline)||void 0===d?void 0:d.call(a))&&void 0!==h?h:this.element,o=n.getBoundingClientRect(),s=l.getElements(void 0,n),r=s.root,c=s.overlay,D=r.getBoundingClientRect(),x=o.top-D.top,C=o.left-D.left,z={top:x,left:C,width:t,height:i};if(b?(z.left=C+t*(1-y),z.width=t*y):f?z.width=t*y:w?z.height=i*y:_&&(z.top=x+i*(1-y),z.height=i*y),p&&v&&(z.width=4),p&&u&&(z.left=C+t-4,z.width=4),!function(e,t){const{top:i,left:n,width:o,height:s}=t,r=`${Math.round(i)}px`,a=`${Math.round(n)}px`,d=`${Math.round(o)}px`,h=`${Math.round(s)}px`;return e.style.top!==r||e.style.left!==a||e.style.width!==d||e.style.height!==h}(c,z))return;return function(e,t){const{top:i,left:n,width:o,height:s}=t,r=`${Math.round(i)}px`,a=`${Math.round(n)}px`,d=`${Math.round(o)}px`,h=`${Math.round(s)}px`;e.style.top=r,e.style.left=a,e.style.width=d,e.style.height=h,e.style.visibility="visible",e.style.transform&&""!==e.style.transform||(e.style.transform="translate3d(0, 0, 0)")}(c,z),c.className="dv-drop-target-anchor"+(this.options.className?` ${this.options.className}`:""),T(c,"dv-drop-target-left",v),T(c,"dv-drop-target-right",u),T(c,"dv-drop-target-top",m),T(c,"dv-drop-target-bottom",g),T(c,"dv-drop-target-center","center"===e),void(s.changed&&(T(c,"dv-drop-target-anchor-container-changed",!0),setTimeout((()=>{T(c,"dv-drop-target-anchor-container-changed",!1)}),10)))}if(!this.overlayElement)return;const x={top:"0px",left:"0px",width:"100%",height:"100%"};b?(x.left=100*(1-y)+"%",x.width=100*y+"%"):f?x.width=100*y+"%":w?x.height=100*y+"%":_&&(x.top=100*(1-y)+"%",x.height=100*y+"%"),function(e,t){const{top:i,left:n,width:o,height:s}=t;e.style.top=i,e.style.left=n,e.style.width=o,e.style.height=s,e.style.visibility="visible",e.style.transform&&""!==e.style.transform||(e.style.transform="translate3d(0, 0, 0)")}(this.overlayElement,x),T(this.overlayElement,"dv-drop-target-small-vertical",c),T(this.overlayElement,"dv-drop-target-small-horizontal",p),T(this.overlayElement,"dv-drop-target-left",v),T(this.overlayElement,"dv-drop-target-right",u),T(this.overlayElement,"dv-drop-target-top",m),T(this.overlayElement,"dv-drop-target-bottom",g),T(this.overlayElement,"dv-drop-target-center","center"===e)}calculateQuadrant(e,t,i,n,o){var s,r;const a=null!==(r=null===(s=this.options.overlayModel)||void 0===s?void 0:s.activationSize)&&void 0!==r?r:Ne;return"percentage"===a.type?function(e,t,i,n,o,s){const r=100*t/n,a=100*i/o;if(e.has("left")&&r<s)return"left";if(e.has("right")&&r>100-s)return"right";if(e.has("top")&&a<s)return"top";if(e.has("bottom")&&a>100-s)return"bottom";if(!e.has("center"))return null;return"center"}(e,t,i,n,o,a.value):function(e,t,i,n,o,s){if(e.has("left")&&t<s)return"left";if(e.has("right")&&t>n-s)return"right";if(e.has("top")&&i<s)return"top";if(e.has("bottom")&&i>o-s)return"bottom";if(!e.has("center"))return null;return"center"}(e,t,i,n,o,a.value)}removeDropTarget(){var e;this.targetElement&&(this._state=void 0,null===(e=this.targetElement.parentElement)||void 0===e||e.classList.remove("dv-drop-target"),this.targetElement.remove(),this.targetElement=void 0,this.overlayElement=void 0)}}Le.USED_EVENT_ID="__dockview_droptarget_event_is_used__";const Re=(()=>{const e={disableAutoResizing:void 0,disableDnd:void 0,className:void 0};return Object.keys(e)})();class Me extends C{constructor(e,t,i,n){super(),this.nativeEvent=e,this.position=t,this.getData=i,this.panel=n}}class We extends x{constructor(){super()}}class He extends P{get isFocused(){return this._isFocused}get isActive(){return this._isActive}get isVisible(){return this._isVisible}get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.id=e,this.component=t,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new O,this._onDidDimensionChange=new A,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new A,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new A,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new A,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new A,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new A,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new A,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new A,this.onDidParametersChange=this._onDidParametersChange.event,this.addDisposables(this.onDidFocusChange((e=>{this._isFocused=e.isFocused})),this.onDidActiveChange((e=>{this._isActive=e.isActive})),this.onDidVisibilityChange((e=>{this._isVisible=e.isVisible})),this.onDidDimensionsChange((e=>{this._width=e.width,this._height=e.height})),this.panelUpdatesDisposable,this._onDidDimensionChange,this._onDidChangeFocus,this._onDidVisibilityChange,this._onDidActiveChange,this._onWillFocus,this._onActiveChange,this._onWillFocus,this._onWillVisibilityChange,this._onDidParametersChange)}getParameters(){return this._parameters}initialize(e){this.panelUpdatesDisposable.value=this._onDidParametersChange.event((t=>{this._parameters=t,e.update({params:t})}))}setVisible(e){this._onWillVisibilityChange.fire({isVisible:e})}setActive(){this._onActiveChange.fire()}updateParameters(e){this._onDidParametersChange.fire(e)}}class je extends He{constructor(e,t){super(e,t),this._onDidConstraintsChangeInternal=new A,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new A({replay:!0}),this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new A,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class Fe extends je{set pane(e){this._pane=e}constructor(e,t){super(e,t),this._onDidExpansionChange=new A({replay:!0}),this.onDidExpansionChange=this._onDidExpansionChange.event,this._onMouseEnter=new A({}),this.onMouseEnter=this._onMouseEnter.event,this._onMouseLeave=new A({}),this.onMouseLeave=this._onMouseLeave.event,this.addDisposables(this._onDidExpansionChange,this._onMouseEnter,this._onMouseLeave)}setExpanded(e){var t;null===(t=this._pane)||void 0===t||t.setExpanded(e)}get isExpanded(){var e;return!!(null===(e=this._pane)||void 0===e?void 0:e.isExpanded())}}class Be extends P{get element(){return this._element}get width(){return this._width}get height(){return this._height}get params(){var e;return null===(e=this._params)||void 0===e?void 0:e.params}constructor(e,t,i){super(),this.id=e,this.component=t,this.api=i,this._height=0,this._width=0,this._element=document.createElement("div"),this._element.tabIndex=-1,this._element.style.outline="none",this._element.style.height="100%",this._element.style.width="100%",this._element.style.overflow="hidden";const n=R(this._element);this.addDisposables(this.api,n.onDidFocus((()=>{this.api._onDidChangeFocus.fire({isFocused:!0})})),n.onDidBlur((()=>{this.api._onDidChangeFocus.fire({isFocused:!1})})),n)}focus(){const e=new We;this.api._onWillFocus.fire(e),e.defaultPrevented||this._element.focus()}layout(e,t){this._width=e,this._height=t,this.api._onDidDimensionChange.fire({width:e,height:t}),this.part&&this._params&&this.part.update(this._params.params)}init(e){this._params=e,this.part=this.getComponent()}update(e){var t,i;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},null===(t=this._params)||void 0===t?void 0:t.params),e.params)});for(const t of Object.keys(e.params))void 0===e.params[t]&&delete this._params.params[t];null===(i=this.part)||void 0===i||i.update({params:this._params.params})}toJSON(){var e,t;const i=null!==(t=null===(e=this._params)||void 0===e?void 0:e.params)&&void 0!==t?t:{};return{id:this.id,component:this.component,params:Object.keys(i).length>0?i:void 0}}dispose(){var e;this.api.dispose(),null===(e=this.part)||void 0===e||e.dispose(),super.dispose()}}class Ue extends Be{set orientation(e){this._orientation=e}get orientation(){return this._orientation}get minimumSize(){return this.headerSize+(this.isExpanded()?this._minimumBodySize:0)}get maximumSize(){return this.headerSize+(this.isExpanded()?this._maximumBodySize:0)}get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(e){this._orthogonalSize=e}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(e){this._minimumBodySize="number"==typeof e?e:0}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(e){this._maximumBodySize="number"==typeof e?e:Number.POSITIVE_INFINITY}get headerVisible(){return this._headerVisible}set headerVisible(e){this._headerVisible=e,this.header.style.display=e?"":"none"}constructor(e){super(e.id,e.component,new Fe(e.id,e.component)),this._onDidChangeExpansionState=new A({replay:!0}),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._orthogonalSize=0,this._size=0,this._isExpanded=!1,this.api.pane=this,this.api.initialize(this),this.headerSize=e.headerSize,this.headerComponent=e.headerComponent,this._minimumBodySize=e.minimumBodySize,this._maximumBodySize=e.maximumBodySize,this._isExpanded=e.isExpanded,this._headerVisible=e.isHeaderVisible,this._onDidChangeExpansionState.fire(this.isExpanded()),this._orientation=e.orientation,this.element.classList.add("dv-pane"),this.addDisposables(this.api.onWillVisibilityChange((e=>{const{isVisible:t}=e,{accessor:i}=this._params;i.setVisible(this,t)})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({size:e.size})})),k(this.element,"mouseenter",(e=>{this.api._onMouseEnter.fire(e)})),k(this.element,"mouseleave",(e=>{this.api._onMouseLeave.fire(e)}))),this.addDisposables(this._onDidChangeExpansionState,this.onDidChangeExpansionState((e=>{this.api._onDidExpansionChange.fire({isExpanded:e})})),this.api.onDidFocusChange((e=>{this.header&&(e.isFocused?N(this.header,"focused"):V(this.header,"focused"))}))),this.renderOnce()}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}isExpanded(){return this._isExpanded}setExpanded(e){this._isExpanded!==e&&(this._isExpanded=e,e?(this.animationTimer&&clearTimeout(this.animationTimer),this.body&&this.element.appendChild(this.body)):this.animationTimer=setTimeout((()=>{var e;null===(e=this.body)||void 0===e||e.remove()}),200),this._onDidChange.fire(e?{size:this.width}:{}),this._onDidChangeExpansionState.fire(e))}layout(e,t){this._size=e,this._orthogonalSize=t;const[i,n]=this.orientation===ee.HORIZONTAL?[e,t]:[t,e];super.layout(i,n)}init(e){var t,i;super.init(e),"number"==typeof e.minimumBodySize&&(this.minimumBodySize=e.minimumBodySize),"number"==typeof e.maximumBodySize&&(this.maximumBodySize=e.maximumBodySize),this.bodyPart=this.getBodyComponent(),this.headerPart=this.getHeaderComponent(),this.bodyPart.init(Object.assign(Object.assign({},e),{api:this.api})),this.headerPart.init(Object.assign(Object.assign({},e),{api:this.api})),null===(t=this.body)||void 0===t||t.append(this.bodyPart.element),null===(i=this.header)||void 0===i||i.append(this.headerPart.element),"boolean"==typeof e.isExpanded&&this.setExpanded(e.isExpanded)}toJSON(){const e=this._params;return Object.assign(Object.assign({},super.toJSON()),{headerComponent:this.headerComponent,title:e.title})}renderOnce(){this.header=document.createElement("div"),this.header.tabIndex=0,this.header.className="dv-pane-header",this.header.style.height=`${this.headerSize}px`,this.header.style.lineHeight=`${this.headerSize}px`,this.header.style.minHeight=`${this.headerSize}px`,this.header.style.maxHeight=`${this.headerSize}px`,this.element.appendChild(this.header),this.body=document.createElement("div"),this.body.className="dv-pane-body",this.element.appendChild(this.body)}getComponent(){return{update:e=>{var t,i;null===(t=this.bodyPart)||void 0===t||t.update({params:e}),null===(i=this.headerPart)||void 0===i||i.update({params:e})},dispose:()=>{var e,t;null===(e=this.bodyPart)||void 0===e||e.dispose(),null===(t=this.headerPart)||void 0===t||t.dispose()}}}}class $e extends Ue{constructor(e){super({id:e.id,component:e.component,headerComponent:e.headerComponent,orientation:e.orientation,isExpanded:e.isExpanded,isHeaderVisible:!0,headerSize:e.headerSize,minimumBodySize:e.minimumBodySize,maximumBodySize:e.maximumBodySize}),this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.accessor=e.accessor,this.addDisposables(this._onDidDrop,this._onUnhandledDragOverEvent),e.disableDnd||this.initDragFeatures()}initDragFeatures(){if(!this.header)return;const e=this.id,t=this.accessor.id;this.header.draggable=!0,this.handler=new class extends Pe{getData(){return _.getInstance().setData([new w(t,e)],w.prototype),{dispose:()=>{_.getInstance().clearData(w.prototype)}}}}(this.header),this.target=new Le(this.element,{acceptedTargetZones:["top","bottom"],overlayModel:{activationSize:{type:"percentage",value:50}},canDisplayOverlay:(e,t)=>{const i=D();if(i&&i.paneId!==this.id&&i.viewId===this.accessor.id)return!0;const n=new Me(e,t,D,this);return this._onUnhandledDragOverEvent.fire(n),n.isAccepted}}),this.addDisposables(this._onDidDrop,this.handler,this.target,this.target.onDrop((e=>{this.onDrop(e)})))}onDrop(e){const t=D();if(!t||t.viewId!==this.accessor.id)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,api:new Ae(this.accessor),getData:D}));const i=this._params.containerApi,n=t.paneId,o=i.getPanel(n);if(!o)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,getData:D,api:new Ae(this.accessor)}));const s=i.panels,r=s.indexOf(o);let a=i.panels.indexOf(this);"left"!==e.position&&"top"!==e.position||(a=Math.max(0,a-1)),"right"!==e.position&&"bottom"!==e.position||(r>a&&a++,a=Math.min(s.length-1,a)),i.movePanel(r,a)}}class Je extends P{get element(){return this._element}constructor(e,t){super(),this.accessor=e,this.group=t,this.disposable=new O,this._onDidFocus=new A,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new A,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-content-container",this._element.tabIndex=-1,this.addDisposables(this._onDidFocus,this._onDidBlur);const i=t.dropTargetContainer;this.dropTarget=new Le(this.element,{getOverlayOutline:()=>{var t;return"group"===(null===(t=e.options.theme)||void 0===t?void 0:t.dndPanelOverlay)?this.element.parentElement:null},className:"dv-drop-target-content",acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(e,t)=>{if("no-drop-target"===this.group.locked||this.group.locked&&"center"===t)return!1;const i=y();return!(!i&&e.shiftKey&&"floating"!==this.group.location.type)&&(!(!i||i.viewId!==this.accessor.id)||this.group.canDisplayOverlay(e,t,"content"))},getOverrideTarget:i?()=>i.model:void 0}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(e,t={asActive:!0}){const i=t.asActive||this.panel&&this.group.isPanelActive(this.panel);let n;switch(this.panel&&this.panel.view.content.element.parentElement===this._element&&this._element.removeChild(this.panel.view.content.element),this.panel=e,e.api.renderer){case"onlyWhenVisible":this.group.renderContainer.detatch(e),this.panel&&i&&this._element.appendChild(this.panel.view.content.element),n=this._element;break;case"always":e.view.content.element.parentElement===this._element&&this._element.removeChild(e.view.content.element),n=this.group.renderContainer.attach({panel:e,referenceContainer:this});break;default:throw new Error(`dockview: invalid renderer type '${e.api.renderer}'`)}if(i){const e=R(n),t=new P;t.addDisposables(e,e.onDidFocus((()=>this._onDidFocus.fire())),e.onDidBlur((()=>this._onDidBlur.fire()))),this.disposable.value=t}}openPanel(e){this.panel!==e&&this.renderPanel(e)}layout(e,t){}closePanel(){var e;this.panel&&"onlyWhenVisible"===this.panel.api.renderer&&(null===(e=this.panel.view.content.element.parentElement)||void 0===e||e.removeChild(this.panel.view.content.element)),this.panel=void 0}dispose(){this.disposable.dispose(),super.dispose()}}function Ze(e,t,i){var n,o;N(t,"dv-dragged"),t.style.top="-9999px",document.body.appendChild(t),e.setDragImage(t,null!==(n=null==i?void 0:i.x)&&void 0!==n?n:0,null!==(o=null==i?void 0:i.y)&&void 0!==o?o:0),setTimeout((()=>{V(t,"dv-dragged"),t.remove()}),0)}class Ye extends Pe{constructor(e,t,i,n,o){super(e,o),this.accessor=t,this.group=i,this.panel=n,this.panelTransfer=_.getInstance()}getData(e){return this.panelTransfer.setData([new f(this.accessor.id,this.group.id,this.panel.id)],f.prototype),{dispose:()=>{this.panelTransfer.clearData(f.prototype)}}}}class Xe extends P{get element(){return this._element}constructor(e,t,i){super(),this.panel=e,this.accessor=t,this.group=i,this.content=void 0,this._onPointDown=new A,this.onPointerDown=this._onPointDown.event,this._onDropped=new A,this.onDrop=this._onDropped.event,this._onDragStart=new A,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-tab",this._element.tabIndex=0,this._element.draggable=!this.accessor.options.disableDnd,T(this.element,"dv-inactive-tab",!0),this.dragHandler=new Ye(this._element,this.accessor,this.group,this.panel,!!this.accessor.options.disableDnd),this.dropTarget=new Le(this._element,{acceptedTargetZones:["left","right"],overlayModel:{activationSize:{value:50,type:"percentage"}},canDisplayOverlay:(e,t)=>{if(this.group.locked)return!1;const i=y();return!(!i||this.accessor.id!==i.viewId)||this.group.model.canDisplayOverlay(e,t,"tab")},getOverrideTarget:()=>{var e;return null===(e=i.model.dropTargetContainer)||void 0===e?void 0:e.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this._onPointDown,this._onDropped,this._onDragStart,this.dragHandler.onDragStart((e=>{if(e.dataTransfer){const t=getComputedStyle(this.element),i=this.element.cloneNode(!0);Array.from(t).forEach((e=>i.style.setProperty(e,t.getPropertyValue(e),t.getPropertyPriority(e)))),i.style.position="absolute",Ze(e.dataTransfer,i,{y:-10,x:30})}this._onDragStart.fire(e)})),this.dragHandler,k(this._element,"pointerdown",(e=>{this._onPointDown.fire(e)})),this.dropTarget.onDrop((e=>{this._onDropped.fire(e)})),this.dropTarget)}setActive(e){T(this.element,"dv-active-tab",e),T(this.element,"dv-inactive-tab",!e)}setContent(e){this.content&&this._element.removeChild(this.content.element),this.content=e,this._element.appendChild(this.content.element)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,this.dragHandler.setDisabled(!!this.accessor.options.disableDnd)}dispose(){super.dispose()}}class qe{get kind(){return this.options.kind}get nativeEvent(){return this.event.nativeEvent}get position(){return this.event.position}get defaultPrevented(){return this.event.defaultPrevented}get panel(){return this.options.panel}get api(){return this.options.api}get group(){return this.options.group}preventDefault(){this.event.preventDefault()}getData(){return this.options.getData()}constructor(e,t){this.event=e,this.options=t}}class Ke extends Pe{constructor(e,t,i,n){super(e,n),this.accessor=t,this.group=i,this.panelTransfer=_.getInstance(),this.addDisposables(k(e,"pointerdown",(e=>{e.shiftKey&&(e[W]=!0)}),!0))}isCancelled(e){return"floating"===this.group.api.location.type&&!e.shiftKey}getData(e){const t=e.dataTransfer;this.panelTransfer.setData([new f(this.accessor.id,this.group.id,null)],f.prototype);const i=window.getComputedStyle(this.el),n=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),o=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(t){const e=document.createElement("div");e.style.backgroundColor=n,e.style.color=o,e.style.padding="2px 8px",e.style.height="24px",e.style.fontSize="11px",e.style.lineHeight="20px",e.style.borderRadius="12px",e.style.position="absolute",e.style.pointerEvents="none",e.style.top="-9999px",e.textContent=`Multiple Panels (${this.group.size})`,Ze(t,e,{y:-10,x:30})}return{dispose:()=>{this.panelTransfer.clearData(f.prototype)}}}}class Qe extends P{get element(){return this._element}constructor(e,t){super(),this.accessor=e,this.group=t,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onDragStart=new A,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!this.accessor.options.disableDnd,T(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.addDisposables(this._onDrop,this._onDragStart,k(this._element,"pointerdown",(()=>{this.accessor.doSetGroupActive(this.group)}))),this.handler=new Ke(this._element,e,t,!!this.accessor.options.disableDnd),this.dropTarget=new Le(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(e,i)=>{const n=y();return!(!n||this.accessor.id!==n.viewId)||t.model.canDisplayOverlay(e,i,"header_space")},getOverrideTarget:()=>{var e;return null===(e=t.model.dropTargetContainer)||void 0===e?void 0:e.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this.handler,this.handler.onDragStart((e=>{this._onDragStart.fire(e)})),this.dropTarget.onDrop((e=>{this._onDrop.fire(e)})),this.dropTarget)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,T(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.handler.setDisabled(!!this.accessor.options.disableDnd)}}class et extends P{get element(){return this._element}constructor(e){super(),this.scrollableElement=e,this._scrollLeft=0,this._element=document.createElement("div"),this._element.className="dv-scrollable",this._horizontalScrollbar=document.createElement("div"),this._horizontalScrollbar.className="dv-scrollbar-horizontal",this.element.appendChild(e),this.element.appendChild(this._horizontalScrollbar),this.addDisposables(k(this.element,"wheel",(e=>{this._scrollLeft+=e.deltaY*et.MouseWheelSpeed,this.calculateScrollbarStyles()})),k(this._horizontalScrollbar,"pointerdown",(e=>{e.preventDefault(),T(this.element,"dv-scrollable-scrolling",!0);const t=e.clientX,i=this._scrollLeft,n=e=>{const n=e.clientX-t,{clientWidth:o}=this.element,{scrollWidth:s}=this.scrollableElement,r=o/s;this._scrollLeft=i+n/r,this.calculateScrollbarStyles()},o=()=>{T(this.element,"dv-scrollable-scrolling",!1),document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",o),document.removeEventListener("pointercancel",o)};document.addEventListener("pointermove",n),document.addEventListener("pointerup",o),document.addEventListener("pointercancel",o)})),k(this.element,"scroll",(()=>{this.calculateScrollbarStyles()})),k(this.scrollableElement,"scroll",(()=>{this._scrollLeft=this.scrollableElement.scrollLeft,this.calculateScrollbarStyles()})),G(this.element,(()=>{T(this.element,"dv-scrollable-resizing",!0),this._animationTimer&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout((()=>{clearTimeout(this._animationTimer),T(this.element,"dv-scrollable-resizing",!1)}),500),this.calculateScrollbarStyles()})))}calculateScrollbarStyles(){const{clientWidth:e}=this.element,{scrollWidth:t}=this.scrollableElement;if(t>e){const i=e*(e/t);this._horizontalScrollbar.style.width=`${i}px`,this._scrollLeft=X(this._scrollLeft,0,this.scrollableElement.scrollWidth-e),this.scrollableElement.scrollLeft=this._scrollLeft;const n=this._scrollLeft/(t-e);this._horizontalScrollbar.style.left=(e-i)*n+"px"}else this._horizontalScrollbar.style.width="0px",this._horizontalScrollbar.style.left="0px",this._scrollLeft=0}}et.MouseWheelSpeed=1;class tt extends P{get showTabsOverflowControl(){return this._showTabsOverflowControl}set showTabsOverflowControl(e){if(this._showTabsOverflowControl!=e&&(this._showTabsOverflowControl=e,e)){const e=new I(this._tabsList);this._observerDisposable.value=new P(e,e.onDidChange((e=>{const t=e.hasScrollX||e.hasScrollY;this.toggleDropdown({reset:!t})})),k(this._tabsList,"scroll",(()=>{this.toggleDropdown({reset:!1})})))}}get element(){return this._element}get panels(){return this._tabs.map((e=>e.value.panel.id))}get size(){return this._tabs.length}get tabs(){return this._tabs.map((e=>e.value))}constructor(e,t,i){if(super(),this.group=e,this.accessor=t,this._observerDisposable=new O,this._tabs=[],this.selectedIndex=-1,this._showTabsOverflowControl=!1,this._onTabDragStart=new A,this.onTabDragStart=this._onTabDragStart.event,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onOverflowTabsChange=new A,this.onOverflowTabsChange=this._onOverflowTabsChange.event,this._tabsList=document.createElement("div"),this._tabsList.className="dv-tabs-container dv-horizontal",this.showTabsOverflowControl=i.showTabsOverflowControl,"native"===t.options.scrollbars)this._element=this._tabsList;else{const e=new et(this._tabsList);this._element=e.element,this.addDisposables(e)}this.addDisposables(this._onOverflowTabsChange,this._observerDisposable,this._onWillShowOverlay,this._onDrop,this._onTabDragStart,k(this.element,"pointerdown",(e=>{if(e.defaultPrevented)return;0===e.button&&this.accessor.doSetGroupActive(this.group)})),g.from((()=>{for(const{value:e,disposable:t}of this._tabs)t.dispose(),e.dispose();this._tabs=[]})))}indexOf(e){return this._tabs.findIndex((t=>t.value.panel.id===e))}isActive(e){return this.selectedIndex>-1&&this._tabs[this.selectedIndex].value===e}setActivePanel(e){let t=0;for(const i of this._tabs){const n=e.id===i.value.panel.id;if(i.value.setActive(n),n){const e=i.value.element,n=e.parentElement;(t<n.scrollLeft||t+e.clientWidth>n.scrollLeft+n.clientWidth)&&(n.scrollLeft=t)}t+=i.value.element.clientWidth}}openPanel(e,t=this._tabs.length){if(this._tabs.find((t=>t.value.panel.id===e.id)))return;const i=new Xe(e,this.accessor,this.group);i.setContent(e.view.tab);const n=new P(i.onDragStart((t=>{this._onTabDragStart.fire({nativeEvent:t,panel:e})})),i.onPointerDown((t=>{if(t.defaultPrevented)return;const n=!this.accessor.options.disableFloatingGroups,o="floating"===this.group.api.location.type&&1===this.size;if(n&&!o&&t.shiftKey){t.preventDefault();const e=this.accessor.getGroupPanel(i.panel.id),{top:n,left:o}=i.element.getBoundingClientRect(),{top:s,left:r}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(e,{x:o-r,y:n-s,inDragMode:!0})}else if(0===t.button)this.group.activePanel!==e&&this.group.model.openPanel(e)})),i.onDrop((e=>{this._onDrop.fire({event:e.nativeEvent,index:this._tabs.findIndex((e=>e.value===i))})})),i.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new qe(e,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:y}))}))),o={value:i,disposable:n};this.addTab(o,t)}delete(e){const t=this.indexOf(e),i=this._tabs.splice(t,1)[0],{value:n,disposable:o}=i;o.dispose(),n.dispose(),n.element.remove()}addTab(e,t=this._tabs.length){if(t<0||t>this._tabs.length)throw new Error("invalid location");this._tabsList.insertBefore(e.value.element,this._tabsList.children[t]),this._tabs=[...this._tabs.slice(0,t),e,...this._tabs.slice(t)],this.selectedIndex<0&&(this.selectedIndex=t)}toggleDropdown(e){const t=e.reset?[]:this._tabs.filter((e=>!function(e,t){const i=j(e),n=j(t);return!(i.left<n.left||i.left+i.width>n.left+n.width)}(e.value.element,this._tabsList))).map((e=>e.value.panel.id));this._onOverflowTabsChange.fire({tabs:t,reset:e.reset})}updateDragAndDropState(){for(const e of this._tabs)e.value.updateDragAndDropState()}}const it=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"height",e.height),t.setAttributeNS(null,"width",e.width),t.setAttributeNS(null,"viewBox",e.viewbox),t.setAttributeNS(null,"aria-hidden","false"),t.setAttributeNS(null,"focusable","false"),t.classList.add("dv-svg");const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",e.path),t.appendChild(i),t},nt=()=>it({width:"11",height:"11",viewbox:"0 0 15 25",path:"M2.15 24.1L0 21.95L9.9 12.05L0 2.15L2.15 0L14.2 12.05L2.15 24.1Z"});class ot extends P{get onTabDragStart(){return this.tabs.onTabDragStart}get panels(){return this.tabs.panels}get size(){return this.tabs.size}get hidden(){return this._hidden}set hidden(e){this._hidden=e,this.element.style.display=e?"none":""}get element(){return this._element}constructor(e,t){super(),this.accessor=e,this.group=t,this._hidden=!1,this.dropdownPart=null,this._overflowTabs=[],this._dropdownDisposable=new O,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onGroupDragStart=new A,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",T(this._element,"dv-full-width-single-tab","fullwidth"===this.accessor.options.singleTabMode),this.rightActionsContainer=document.createElement("div"),this.rightActionsContainer.className="dv-right-actions-container",this.leftActionsContainer=document.createElement("div"),this.leftActionsContainer.className="dv-left-actions-container",this.preActionsContainer=document.createElement("div"),this.preActionsContainer.className="dv-pre-actions-container",this.tabs=new tt(t,e,{showTabsOverflowControl:!e.options.disableTabsOverflowList}),this.voidContainer=new Qe(this.accessor,this.group),this._element.appendChild(this.preActionsContainer),this._element.appendChild(this.tabs.element),this._element.appendChild(this.leftActionsContainer),this._element.appendChild(this.voidContainer.element),this._element.appendChild(this.rightActionsContainer),this.addDisposables(this.tabs.onDrop((e=>this._onDrop.fire(e))),this.tabs.onWillShowOverlay((e=>this._onWillShowOverlay.fire(e))),e.onDidOptionsChange((()=>{this.tabs.showTabsOverflowControl=!e.options.disableTabsOverflowList})),this.tabs.onOverflowTabsChange((e=>{this.toggleDropdown(e)})),this.tabs,this._onWillShowOverlay,this._onDrop,this._onGroupDragStart,this.voidContainer,this.voidContainer.onDragStart((e=>{this._onGroupDragStart.fire({nativeEvent:e,group:this.group})})),this.voidContainer.onDrop((e=>{this._onDrop.fire({event:e.nativeEvent,index:this.tabs.size})})),this.voidContainer.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new qe(e,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:y}))})),k(this.voidContainer.element,"pointerdown",(e=>{if(e.defaultPrevented)return;if(!this.accessor.options.disableFloatingGroups&&e.shiftKey&&"floating"!==this.group.api.location.type){e.preventDefault();const{top:t,left:i}=this.element.getBoundingClientRect(),{top:n,left:o}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:i-o+20,y:t-n+20,inDragMode:!0})}})))}show(){this.hidden||(this.element.style.display="")}hide(){this._element.style.display="none"}setRightActionsElement(e){this.rightActions!==e&&(this.rightActions&&(this.rightActions.remove(),this.rightActions=void 0),e&&(this.rightActionsContainer.appendChild(e),this.rightActions=e))}setLeftActionsElement(e){this.leftActions!==e&&(this.leftActions&&(this.leftActions.remove(),this.leftActions=void 0),e&&(this.leftActionsContainer.appendChild(e),this.leftActions=e))}setPrefixActionsElement(e){this.preActions!==e&&(this.preActions&&(this.preActions.remove(),this.preActions=void 0),e&&(this.preActionsContainer.appendChild(e),this.preActions=e))}isActive(e){return this.tabs.isActive(e)}indexOf(e){return this.tabs.indexOf(e)}setActive(e){}delete(e){this.tabs.delete(e),this.updateClassnames()}setActivePanel(e){this.tabs.setActivePanel(e)}openPanel(e,t=this.tabs.size){this.tabs.openPanel(e,t),this.updateClassnames()}closePanel(e){this.delete(e.id)}updateClassnames(){T(this._element,"dv-single-tab",1===this.size)}toggleDropdown(e){const t=e.reset?[]:e.tabs;if(this._overflowTabs=t,this._overflowTabs.length>0&&this.dropdownPart)return void this.dropdownPart.update({tabs:t.length});if(0===this._overflowTabs.length)return void this._dropdownDisposable.dispose();const i=document.createElement("div");i.className="dv-tabs-overflow-dropdown-root";const n=function(){const e=document.createElement("div");e.className="dv-tabs-overflow-dropdown-default";const t=document.createElement("span");t.textContent="";const i=nt();return e.appendChild(i),e.appendChild(t),{element:e,update:e=>{t.textContent=`${e.tabs}`}}}();n.update({tabs:t.length}),this.dropdownPart=n,i.appendChild(n.element),this.rightActionsContainer.prepend(i),this._dropdownDisposable.value=new P(g.from((()=>{var e,t;i.remove(),null===(t=null===(e=this.dropdownPart)||void 0===e?void 0:e.dispose)||void 0===t||t.call(e),this.dropdownPart=null})),k(i,"pointerdown",(e=>{e.preventDefault()}),{capture:!0}),k(i,"click",(e=>{const t=document.createElement("div");t.style.overflow="auto",t.className="dv-tabs-overflow-container";for(const e of this.tabs.tabs.filter((e=>this._overflowTabs.includes(e.panel.id)))){const i=this.group.panels.find((t=>t===e.panel)),n=i.view.createTabRenderer("headerOverflow").element,o=document.createElement("div");T(o,"dv-tab",!0),T(o,"dv-active-tab",i.api.isActive),T(o,"dv-inactive-tab",!i.api.isActive),o.addEventListener("click",(t=>{this.accessor.popupService.close(),t.defaultPrevented||(e.element.scrollIntoView(),e.panel.api.setActive())})),o.appendChild(n),t.appendChild(o)}const n=function(e){let t=e;for(;t&&("auto"===t.style.zIndex||""===t.style.zIndex);)t=t.parentElement;return t}(i);this.accessor.popupService.openPopover(t,{x:e.clientX,y:e.clientY,zIndex:(null==n?void 0:n.style.zIndex)?`calc(${n.style.zIndex} * 2)`:void 0})})))}updateDragAndDropState(){this.tabs.updateDragAndDropState(),this.voidContainer.updateDragAndDropState()}}class st extends C{constructor(e,t,i,n,o){super(),this.nativeEvent=e,this.target=t,this.position=i,this.getData=n,this.group=o}}const rt=(()=>{const e={disableAutoResizing:void 0,hideBorders:void 0,singleTabMode:void 0,disableFloatingGroups:void 0,floatingGroupBounds:void 0,popoutUrl:void 0,defaultRenderer:void 0,debug:void 0,rootOverlayModel:void 0,locked:void 0,disableDnd:void 0,className:void 0,noPanelsOverlay:void 0,dndEdges:void 0,theme:void 0,disableTabsOverflowList:void 0,scrollbars:void 0};return Object.keys(e)})();function at(e){return!!e.referencePanel}function dt(e){return!!e.referenceGroup}function ht(e){return!!e.referencePanel}function lt(e){return!!e.referenceGroup}class pt extends x{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}get panel(){return this.options.panel}get group(){return this.options.group}get api(){return this.options.api}constructor(e){super(),this.options=e}getData(){return this.options.getData()}}class ct extends pt{get kind(){return this._kind}constructor(e){super(e),this._kind=e.kind}}class vt extends P{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(e){this._locked=e,T(this.container,"dv-locked-groupview","no-drop-target"===e||e)}get isActive(){return this._isGroupActive}get panels(){return this._panels}get size(){return this._panels.length}get isEmpty(){return 0===this._panels.length}get hasWatermark(){return!(!this.watermark||!this.container.contains(this.watermark.element))}get header(){return this.tabsContainer}get isContentFocused(){return!!document.activeElement&&L(document.activeElement,this.contentContainer.element)}get location(){return this._location}set location(e){switch(this._location=e,T(this.container,"dv-groupview-floating",!1),T(this.container,"dv-groupview-popout",!1),e.type){case"grid":this.contentContainer.dropTarget.setTargetZones(["top","bottom","left","right","center"]);break;case"floating":this.contentContainer.dropTarget.setTargetZones(["center"]),this.contentContainer.dropTarget.setTargetZones(e?["center"]:["top","bottom","left","right","center"]),T(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),T(this.container,"dv-groupview-popout",!0)}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(e,t,i,n,o){var s;super(),this.container=e,this.accessor=t,this.id=i,this.options=n,this.groupPanel=o,this._isGroupActive=!1,this._locked=!1,this._location={type:"grid"},this.mostRecentlyUsed=[],this._overwriteRenderContainer=null,this._overwriteDropTargetContainer=null,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new A,this.onMove=this._onMove.event,this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new A,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new A,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new A,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new A,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new A,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new A,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new A,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new A,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,T(this.container,"dv-groupview",!0),this._api=new Ee(this.accessor),this.tabsContainer=new ot(this.accessor,this.groupPanel),this.contentContainer=new Je(this.accessor,this),e.append(this.tabsContainer.element,this.contentContainer.element),this.header.hidden=!!n.hideHeader,this.locked=null!==(s=n.locked)&&void 0!==s&&s,this.addDisposables(this._onTabDragStart,this._onGroupDragStart,this._onWillShowOverlay,this.tabsContainer.onTabDragStart((e=>{this._onTabDragStart.fire(e)})),this.tabsContainer.onGroupDragStart((e=>{this._onGroupDragStart.fire(e)})),this.tabsContainer.onDrop((e=>{this.handleDropEvent("header",e.event,"center",e.index)})),this.contentContainer.onDidFocus((()=>{this.accessor.doSetGroupActive(this.groupPanel)})),this.contentContainer.onDidBlur((()=>{})),this.contentContainer.dropTarget.onDrop((e=>{this.handleDropEvent("content",e.nativeEvent,e.position)})),this.tabsContainer.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(e)})),this.contentContainer.dropTarget.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new qe(e,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:y}))})),this._onMove,this._onDidChange,this._onDidDrop,this._onWillDrop,this._onDidAddPanel,this._onDidRemovePanel,this._onDidActivePanelChange,this._onUnhandledDragOverEvent,this._onDidPanelTitleChange,this._onDidPanelParametersChange)}focusContent(){this.contentContainer.element.focus()}set renderContainer(e){this.panels.forEach((e=>{this.renderContainer.detatch(e)})),this._overwriteRenderContainer=e,this.panels.forEach((e=>{this.rerender(e)}))}get renderContainer(){var e;return null!==(e=this._overwriteRenderContainer)&&void 0!==e?e:this.accessor.overlayRenderContainer}set dropTargetContainer(e){this._overwriteDropTargetContainer=e}get dropTargetContainer(){var e;return null!==(e=this._overwriteDropTargetContainer)&&void 0!==e?e:this.accessor.rootDropTargetContainer}initialize(){this.options.panels&&this.options.panels.forEach((e=>{this.doAddPanel(e)})),this.options.activePanel&&this.openPanel(this.options.activePanel),this.setActive(this.isActive,!0),this.updateContainer(),this.accessor.options.createRightHeaderActionComponent&&(this._rightHeaderActions=this.accessor.options.createRightHeaderActionComponent(this.groupPanel),this.addDisposables(this._rightHeaderActions),this._rightHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element)),this.accessor.options.createLeftHeaderActionComponent&&(this._leftHeaderActions=this.accessor.options.createLeftHeaderActionComponent(this.groupPanel),this.addDisposables(this._leftHeaderActions),this._leftHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element)),this.accessor.options.createPrefixHeaderActionComponent&&(this._prefixHeaderActions=this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel),this.addDisposables(this._prefixHeaderActions),this._prefixHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element))}rerender(e){this.contentContainer.renderPanel(e,{asActive:!1})}indexOf(e){return this.tabsContainer.indexOf(e.id)}toJSON(){var e;const t={views:this.tabsContainer.panels,activeView:null===(e=this._activePanel)||void 0===e?void 0:e.id,id:this.id};return!1!==this.locked&&(t.locked=this.locked),this.header.hidden&&(t.hideHeader=!0),t}moveToNext(e){e||(e={}),e.panel||(e.panel=this.activePanel);const t=e.panel?this.panels.indexOf(e.panel):-1;let i;if(t<this.panels.length-1)i=t+1;else{if(e.suppressRoll)return;i=0}this.openPanel(this.panels[i])}moveToPrevious(e){if(e||(e={}),e.panel||(e.panel=this.activePanel),!e.panel)return;const t=this.panels.indexOf(e.panel);let i;if(t>0)i=t-1;else{if(e.suppressRoll)return;i=this.panels.length-1}this.openPanel(this.panels[i])}containsPanel(e){return this.panels.includes(e)}init(e){}update(e){}focus(){var e;null===(e=this._activePanel)||void 0===e||e.focus()}openPanel(e,t={}){("number"!=typeof t.index||t.index>this.panels.length)&&(t.index=this.panels.length);const i=!!t.skipSetActive;e.updateParentGroup(this.groupPanel,{skipSetActive:t.skipSetActive}),this.doAddPanel(e,t.index,{skipSetActive:i}),this._activePanel!==e?(i||this.doSetActivePanel(e),t.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),t.skipSetActive||this.updateContainer()):this.contentContainer.renderPanel(e,{asActive:!0})}removePanel(e,t={skipSetActive:!1}){const i="string"==typeof e?e:e.id,n=this._panels.find((e=>e.id===i));if(!n)throw new Error("invalid operation");return this._removePanel(n,t)}closeAllPanels(){if(this.panels.length>0){const e=[...this.panels];for(const t of e)this.doClose(t)}else this.accessor.removeGroup(this.groupPanel)}closePanel(e){this.doClose(e)}doClose(e){const t=1===this.panels.length&&1===this.accessor.groups.length;this.accessor.removePanel(e,t&&"emptyGroup"===this.accessor.options.noPanelsOverlay?{removeEmptyGroup:!1}:void 0)}isPanelActive(e){return this._activePanel===e}updateActions(e){this.tabsContainer.setRightActionsElement(e)}setActive(e,t=!1){(t||this.isActive!==e)&&(this._isGroupActive=e,T(this.container,"dv-active-group",e),T(this.container,"dv-inactive-group",!e),this.tabsContainer.setActive(this.isActive),!this._activePanel&&this.panels.length>0&&this.doSetActivePanel(this.panels[0]),this.updateContainer())}layout(e,t){var i;this._width=e,this._height=t,this.contentContainer.layout(this._width,this._height),(null===(i=this._activePanel)||void 0===i?void 0:i.layout)&&this._activePanel.layout(this._width,this._height)}_removePanel(e,t){const i=this._activePanel===e;if(this.doRemovePanel(e),i&&this.panels.length>0){const e=this.mostRecentlyUsed[0];this.openPanel(e,{skipSetActive:t.skipSetActive,skipSetGroupActive:t.skipSetActiveGroup})}return this._activePanel&&0===this.panels.length&&this.doSetActivePanel(void 0),t.skipSetActive||this.updateContainer(),e}doRemovePanel(e){const t=this.panels.indexOf(e);if(this._activePanel===e&&this.contentContainer.closePanel(),this.tabsContainer.delete(e.id),this._panels.splice(t,1),this.mostRecentlyUsed.includes(e)){const t=this.mostRecentlyUsed.indexOf(e);this.mostRecentlyUsed.splice(t,1)}const i=this._panelDisposables.get(e.id);i&&(i.dispose(),this._panelDisposables.delete(e.id)),this._onDidRemovePanel.fire({panel:e})}doAddPanel(e,t=this.panels.length,i={skipSetActive:!1}){const n=this._panels.indexOf(e)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(e,t),i.skipSetActive||this.contentContainer.openPanel(e),n||(this.updateMru(e),this.panels.splice(t,0,e),this._panelDisposables.set(e.id,new P(e.api.onDidTitleChange((e=>this._onDidPanelTitleChange.fire(e))),e.api.onDidParametersChange((e=>this._onDidPanelParametersChange.fire(e))))),this._onDidAddPanel.fire({panel:e}))}doSetActivePanel(e){this._activePanel!==e&&(this._activePanel=e,e&&(this.tabsContainer.setActivePanel(e),e.layout(this._width,this._height),this.updateMru(e),this._onDidActivePanelChange.fire({panel:e})))}updateMru(e){this.mostRecentlyUsed.includes(e)&&this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(e),1),this.mostRecentlyUsed=[e,...this.mostRecentlyUsed]}updateContainer(){var e,t;if(this.panels.forEach((e=>e.runEvents())),this.isEmpty&&!this.watermark){const e=this.accessor.createWatermarkComponent();e.init({containerApi:this._api,group:this.groupPanel}),this.watermark=e,k(this.watermark.element,"pointerdown",(()=>{this.isActive||this.accessor.doSetGroupActive(this.groupPanel)})),this.contentContainer.element.appendChild(this.watermark.element)}!this.isEmpty&&this.watermark&&(this.watermark.element.remove(),null===(t=(e=this.watermark).dispose)||void 0===t||t.call(e),this.watermark=void 0)}canDisplayOverlay(e,t,i){const n=new st(e,i,t,y,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(n),n.isAccepted}handleDropEvent(e,t,i,n){if("no-drop-target"===this.locked)return;const o="number"==typeof n?this.panels[n]:void 0,s=new ct({nativeEvent:t,position:i,panel:o,getData:()=>y(),kind:function(){switch(e){case"header":return"number"==typeof n?"tab":"header_space";case"content":return"content"}}(),group:this.groupPanel,api:this._api});if(this._onWillDrop.fire(s),s.defaultPrevented)return;const r=y();if(r&&r.viewId===this.accessor.id){if("content"===e&&r.groupId===this.id){if("center"===i)return;if(null===r.panelId)return}if("header"===e&&r.groupId===this.id&&null===r.panelId)return;if(null===r.panelId){const{groupId:e}=r;return void this._onMove.fire({target:i,groupId:e,index:n})}if(-1!==this.tabsContainer.indexOf(r.panelId)&&1===this.tabsContainer.size)return;const{groupId:t,panelId:o}=r;if(this.id===t&&!i){if(this.tabsContainer.indexOf(o)===n)return}this._onMove.fire({target:i,groupId:r.groupId,itemId:r.panelId,index:n})}else this._onDidDrop.fire(new pt({nativeEvent:t,position:i,panel:o,getData:()=>y(),group:this.groupPanel,api:this._api}))}updateDragAndDropState(){this.tabsContainer.updateDragAndDropState()}dispose(){var e,t,i;super.dispose(),null===(e=this.watermark)||void 0===e||e.element.remove(),null===(i=null===(t=this.watermark)||void 0===t?void 0:t.dispose)||void 0===i||i.call(t),this.watermark=void 0;for(const e of this.panels)e.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class ut extends He{constructor(e,t,i){super(e,t),this._onDidConstraintsChangeInternal=new A,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new A,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new A,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),i&&this.initialize(i)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class mt extends Be{get priority(){return this._priority}get snap(){return this._snap}get minimumWidth(){return this.__minimumWidth()}get minimumHeight(){return this.__minimumHeight()}get maximumHeight(){return this.__maximumHeight()}get maximumWidth(){return this.__maximumWidth()}__minimumWidth(){const e="function"==typeof this._minimumWidth?this._minimumWidth():this._minimumWidth;return e!==this._evaluatedMinimumWidth&&(this._evaluatedMinimumWidth=e,this.updateConstraints()),e}__maximumWidth(){const e="function"==typeof this._maximumWidth?this._maximumWidth():this._maximumWidth;return e!==this._evaluatedMaximumWidth&&(this._evaluatedMaximumWidth=e,this.updateConstraints()),e}__minimumHeight(){const e="function"==typeof this._minimumHeight?this._minimumHeight():this._minimumHeight;return e!==this._evaluatedMinimumHeight&&(this._evaluatedMinimumHeight=e,this.updateConstraints()),e}__maximumHeight(){const e="function"==typeof this._maximumHeight?this._maximumHeight():this._maximumHeight;return e!==this._evaluatedMaximumHeight&&(this._evaluatedMaximumHeight=e,this.updateConstraints()),e}get isActive(){return this.api.isActive}get isVisible(){return this.api.isVisible}constructor(e,t,i,n){super(e,t,null!=n?n:new ut(e,t)),this._evaluatedMinimumWidth=0,this._evaluatedMaximumWidth=Number.MAX_SAFE_INTEGER,this._evaluatedMinimumHeight=0,this._evaluatedMaximumHeight=Number.MAX_SAFE_INTEGER,this._minimumWidth=0,this._minimumHeight=0,this._maximumWidth=Number.MAX_SAFE_INTEGER,this._maximumHeight=Number.MAX_SAFE_INTEGER,this._snap=!1,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,"number"==typeof(null==i?void 0:i.minimumWidth)&&(this._minimumWidth=i.minimumWidth),"number"==typeof(null==i?void 0:i.maximumWidth)&&(this._maximumWidth=i.maximumWidth),"number"==typeof(null==i?void 0:i.minimumHeight)&&(this._minimumHeight=i.minimumHeight),"number"==typeof(null==i?void 0:i.maximumHeight)&&(this._maximumHeight=i.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange((e=>{const{isVisible:t}=e,{accessor:i}=this._params;i.setVisible(this,t)})),this.api.onActiveChange((()=>{const{accessor:e}=this._params;e.doSetGroupActive(this)})),this.api.onDidConstraintsChangeInternal((e=>{"number"!=typeof e.minimumWidth&&"function"!=typeof e.minimumWidth||(this._minimumWidth=e.minimumWidth),"number"!=typeof e.minimumHeight&&"function"!=typeof e.minimumHeight||(this._minimumHeight=e.minimumHeight),"number"!=typeof e.maximumWidth&&"function"!=typeof e.maximumWidth||(this._maximumWidth=e.maximumWidth),"number"!=typeof e.maximumHeight&&"function"!=typeof e.maximumHeight||(this._maximumHeight=e.maximumHeight)})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({height:e.height,width:e.width})})),this._onDidChange)}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}init(e){e.maximumHeight&&(this._maximumHeight=e.maximumHeight),e.minimumHeight&&(this._minimumHeight=e.minimumHeight),e.maximumWidth&&(this._maximumWidth=e.maximumWidth),e.minimumWidth&&(this._minimumWidth=e.minimumWidth),this._priority=e.priority,this._snap=!!e.snap,super.init(e),"boolean"==typeof e.isVisible&&this.setVisible(e.isVisible)}updateConstraints(){this.api._onDidConstraintsChange.fire({minimumWidth:this._evaluatedMinimumWidth,maximumWidth:this._evaluatedMaximumWidth,minimumHeight:this._evaluatedMinimumHeight,maximumHeight:this._evaluatedMaximumHeight})}toJSON(){const e=super.toJSON(),t=e=>e===Number.MAX_SAFE_INTEGER?void 0:e,i=e=>e<=0?void 0:e;return Object.assign(Object.assign({},e),{minimumHeight:i(this.minimumHeight),maximumHeight:t(this.maximumHeight),minimumWidth:i(this.minimumWidth),maximumWidth:t(this.maximumWidth),snap:this.snap,priority:this.priority})}}const gt="dockview: DockviewGroupPanelApiImpl not initialized";class bt extends ut{get location(){if(!this._group)throw new Error(gt);return this._group.model.location}constructor(e,t){super(e,"__dockviewgroup__"),this.accessor=t,this._onDidLocationChange=new A,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new A,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this.addDisposables(this._onDidLocationChange,this._onDidActivePanelChange)}close(){if(this._group)return this.accessor.removeGroup(this._group)}getWindow(){return"popout"===this.location.type?this.location.getWindow():window}moveTo(e){var t,i,n,o;if(!this._group)throw new Error(gt);const s=null!==(t=e.group)&&void 0!==t?t:this.accessor.addGroup({direction:Ve(null!==(i=e.position)&&void 0!==i?i:"right"),skipSetActive:null!==(n=e.skipSetActive)&&void 0!==n&&n});this.accessor.moveGroupOrPanel({from:{groupId:this._group.id},to:{group:s,position:e.group&&null!==(o=e.position)&&void 0!==o?o:"center",index:e.index},skipSetActive:e.skipSetActive})}maximize(){if(!this._group)throw new Error(gt);"grid"===this.location.type&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(gt);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(gt);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(e){this._group=e}}class ft extends mt{get minimumWidth(){var e;if("number"==typeof this._explicitConstraints.minimumWidth)return this._explicitConstraints.minimumWidth;const t=null===(e=this.activePanel)||void 0===e?void 0:e.minimumWidth;return"number"==typeof t?t:super.__minimumWidth()}get minimumHeight(){var e;if("number"==typeof this._explicitConstraints.minimumHeight)return this._explicitConstraints.minimumHeight;const t=null===(e=this.activePanel)||void 0===e?void 0:e.minimumHeight;return"number"==typeof t?t:super.__minimumHeight()}get maximumWidth(){var e;if("number"==typeof this._explicitConstraints.maximumWidth)return this._explicitConstraints.maximumWidth;const t=null===(e=this.activePanel)||void 0===e?void 0:e.maximumWidth;return"number"==typeof t?t:super.__maximumWidth()}get maximumHeight(){var e;if("number"==typeof this._explicitConstraints.maximumHeight)return this._explicitConstraints.maximumHeight;const t=null===(e=this.activePanel)||void 0===e?void 0:e.maximumHeight;return"number"==typeof t?t:super.__maximumHeight()}get panels(){return this._model.panels}get activePanel(){return this._model.activePanel}get size(){return this._model.size}get model(){return this._model}get locked(){return this._model.locked}set locked(e){this._model.locked=e}get header(){return this._model.header}constructor(e,t,i){var n,o,s,r,a,d;super(t,"groupview_default",{minimumHeight:null!==(o=null===(n=i.constraints)||void 0===n?void 0:n.minimumHeight)&&void 0!==o?o:100,minimumWidth:null!==(r=null===(s=i.constraints)||void 0===s?void 0:s.minimumWidth)&&void 0!==r?r:100,maximumHeight:null===(a=i.constraints)||void 0===a?void 0:a.maximumHeight,maximumWidth:null===(d=i.constraints)||void 0===d?void 0:d.maximumWidth},new bt(t,e)),this._explicitConstraints={},this.api.initialize(this),this._model=new vt(this.element,e,t,i,this),this.addDisposables(this.model.onDidActivePanelChange((e=>{this.api._onDidActivePanelChange.fire(e)})),this.api.onDidConstraintsChangeInternal((e=>{void 0!==e.minimumWidth&&(this._explicitConstraints.minimumWidth="function"==typeof e.minimumWidth?e.minimumWidth():e.minimumWidth),void 0!==e.minimumHeight&&(this._explicitConstraints.minimumHeight="function"==typeof e.minimumHeight?e.minimumHeight():e.minimumHeight),void 0!==e.maximumWidth&&(this._explicitConstraints.maximumWidth="function"==typeof e.maximumWidth?e.maximumWidth():e.maximumWidth),void 0!==e.maximumHeight&&(this._explicitConstraints.maximumHeight="function"==typeof e.maximumHeight?e.maximumHeight():e.maximumHeight)})))}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(e){super.setActive(e),this.model.setActive(e)}layout(e,t){super.layout(e,t),this.model.layout(e,t)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}const wt={name:"dark",className:"dockview-theme-dark"},_t={name:"light",className:"dockview-theme-light"},yt={name:"visualStudio",className:"dockview-theme-vs"},Dt={name:"abyss",className:"dockview-theme-abyss"},xt={name:"dracula",className:"dockview-theme-dracula"},Ct={name:"replit",className:"dockview-theme-replit",gap:10},zt={name:"abyssSpaced",className:"dockview-theme-abyss-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"},St={name:"lightSpaced",className:"dockview-theme-light-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"};class At extends ut{get location(){return this.group.api.location}get title(){return this.panel.title}get isGroupActive(){return this.group.isActive}get renderer(){return this.panel.renderer}set group(e){const t=this._group;this._group!==e&&(this._group=e,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(t),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(e,t,i,n,o){super(e.id,n),this.panel=e,this.accessor=i,this._onDidTitleChange=new A,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new A,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new A,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new A,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new A,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new O,this._tabComponent=o,this.initialize(e),this._group=t,this.setupGroupEventListeners(),this.addDisposables(this.groupEventsDisposable,this._onDidRendererChange,this._onDidTitleChange,this._onDidGroupChange,this._onDidActiveGroupChange,this._onDidLocationChange)}getWindow(){return this.group.api.getWindow()}moveTo(e){var t,i;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:null!==(t=e.group)&&void 0!==t?t:this._group,position:e.group&&null!==(i=e.position)&&void 0!==i?i:"center",index:e.index},skipSetActive:e.skipSetActive})}setTitle(e){this.panel.setTitle(e)}setRenderer(e){this.panel.setRenderer(e)}close(){this.group.model.closePanel(this.panel)}maximize(){this.group.api.maximize()}isMaximized(){return this.group.api.isMaximized()}exitMaximized(){this.group.api.exitMaximized()}setupGroupEventListeners(e){var t;let i=null!==(t=null==e?void 0:e.isActive)&&void 0!==t&&t;this.groupEventsDisposable.value=new P(this.group.api.onDidVisibilityChange((e=>{const t=!e.isVisible&&this.isVisible,i=e.isVisible&&!this.isVisible,n=this.group.model.isPanelActive(this.panel);(t||i&&n)&&this._onDidVisibilityChange.fire(e)})),this.group.api.onDidLocationChange((e=>{this.group===this.panel.group&&this._onDidLocationChange.fire(e)})),this.group.api.onDidActiveChange((()=>{this.group===this.panel.group&&i!==this.isGroupActive&&(i=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))})))}}class kt extends P{get params(){return this._params}get title(){return this._title}get group(){return this._group}get renderer(){var e;return null!==(e=this._renderer)&&void 0!==e?e:this.accessor.renderer}get minimumWidth(){return this._minimumWidth}get minimumHeight(){return this._minimumHeight}get maximumWidth(){return this._maximumWidth}get maximumHeight(){return this._maximumHeight}constructor(e,t,i,n,o,s,r,a){super(),this.id=e,this.accessor=n,this.containerApi=o,this.view=r,this._renderer=a.renderer,this._group=s,this._minimumWidth=a.minimumWidth,this._minimumHeight=a.minimumHeight,this._maximumWidth=a.maximumWidth,this._maximumHeight=a.maximumHeight,this.api=new At(this,this._group,n,t,i),this.addDisposables(this.api.onActiveChange((()=>{n.setActivePanel(this)})),this.api.onDidSizeChange((e=>{this.group.api.setSize(e)})),this.api.onDidRendererChange((()=>{this.group.model.rerender(this)})))}init(e){this._params=e.params,this.view.init(Object.assign(Object.assign({},e),{api:this.api,containerApi:this.containerApi})),this.setTitle(e.title)}focus(){const e=new We;this.api._onWillFocus.fire(e),e.defaultPrevented||this.api.isActive||this.api.setActive()}toJSON(){return{id:this.id,contentComponent:this.view.contentComponent,tabComponent:this.view.tabComponent,params:Object.keys(this._params||{}).length>0?this._params:void 0,title:this.title,renderer:this._renderer,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,minimumWidth:this._minimumWidth,maximumWidth:this._maximumWidth}}setTitle(e){e!==this.title&&(this._title=e,this.api._onDidTitleChange.fire({title:e}))}setRenderer(e){e!==this.renderer&&(this._renderer=e,this.api._onDidRendererChange.fire({renderer:e}))}update(e){var t;this._params=Object.assign(Object.assign({},null!==(t=this._params)&&void 0!==t?t:{}),e.params);for(const t of Object.keys(e.params))void 0===e.params[t]&&delete this._params[t];this.view.update({params:this._params})}updateParentGroup(e,t){this._group=e,this.api.group=this._group;const i=this._group.model.isPanelActive(this),n=this.group.api.isActive&&i;(null==t?void 0:t.skipSetActive)||this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&i}),this.api.isVisible!==i&&this.api._onDidVisibilityChange.fire({isVisible:i})}runEvents(){const e=this._group.model.isPanelActive(this),t=this.group.api.isActive&&e;this.api.isActive!==t&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&e}),this.api.isVisible!==e&&this.api._onDidVisibilityChange.fire({isVisible:e})}layout(e,t){this.api._onDidDimensionChange.fire({width:e,height:t}),this.view.layout(e,t)}dispose(){this.api.dispose(),this.view.dispose()}}class Et extends P{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-default-tab",this._content=document.createElement("div"),this._content.className="dv-default-tab-content",this.action=document.createElement("div"),this.action.className="dv-default-tab-action",this.action.appendChild(it({width:"11",height:"11",viewbox:"0 0 28 28",path:"M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z"})),this._element.appendChild(this._content),this._element.appendChild(this.action),this.render()}init(e){this._title=e.title,this.addDisposables(e.api.onDidTitleChange((e=>{this._title=e.title,this.render()})),k(this.action,"pointerdown",(e=>{e.preventDefault()})),k(this.action,"click",(t=>{t.defaultPrevented||(t.preventDefault(),e.api.close())}))),this.render()}render(){var e;this._content.textContent!==this._title&&(this._content.textContent=null!==(e=this._title)&&void 0!==e?e:"")}}class Pt{get content(){return this._content}get tab(){return this._tab}constructor(e,t,i,n){this.accessor=e,this.id=t,this.contentComponent=i,this.tabComponent=n,this._content=this.createContentComponent(this.id,i),this._tab=this.createTabComponent(this.id,n)}createTabRenderer(e){var t;const i=this.createTabComponent(this.id,this.tabComponent);return this._params&&i.init(Object.assign(Object.assign({},this._params),{tabLocation:e})),this._updateEvent&&(null===(t=i.update)||void 0===t||t.call(i,this._updateEvent)),i}init(e){this._params=e,this.content.init(e),this.tab.init(Object.assign(Object.assign({},e),{tabLocation:"header"}))}layout(e,t){var i,n;null===(n=(i=this.content).layout)||void 0===n||n.call(i,e,t)}update(e){var t,i,n,o;this._updateEvent=e,null===(i=(t=this.content).update)||void 0===i||i.call(t,e),null===(o=(n=this.tab).update)||void 0===o||o.call(n,e)}dispose(){var e,t,i,n;null===(t=(e=this.content).dispose)||void 0===t||t.call(e),null===(n=(i=this.tab).dispose)||void 0===n||n.call(i)}createContentComponent(e,t){return this.accessor.options.createComponent({id:e,name:t})}createTabComponent(e,t){const i=null!=t?t:this.accessor.options.defaultTabComponent;if(i){if(this.accessor.options.createTabComponent){const t=this.accessor.options.createTabComponent({id:e,name:i});return t||new Et}console.warn(`dockview: tabComponent '${t}' was not found. falling back to the default tab.`)}return new Et}}class Ot{constructor(e){this.accessor=e}fromJSON(e,t){var i,n;const o=e.id,s=e.params,r=e.title,a=e.view,d=a?a.content.id:null!==(i=e.contentComponent)&&void 0!==i?i:"unknown",h=a?null===(n=a.tab)||void 0===n?void 0:n.id:e.tabComponent,l=new Pt(this.accessor,o,d,h),p=new kt(o,d,h,this.accessor,new Ee(this.accessor),t,l,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return p.init({title:null!=r?r:o,params:null!=s?s:{}}),p}}class It extends P{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(e){}}const Gt=new class{constructor(){this._orderedList=[]}push(e){this._orderedList=[...this._orderedList.filter((t=>t!==e)),e],this.update()}destroy(e){this._orderedList=this._orderedList.filter((t=>t!==e)),this.update()}update(){for(let e=0;e<this._orderedList.length;e++)this._orderedList[e].setAttribute("aria-level",`${e}`),this._orderedList[e].style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${2*e})`}};class Vt extends P{set minimumInViewportWidth(e){this.options.minimumInViewportWidth=e}set minimumInViewportHeight(e){this.options.minimumInViewportHeight=e}get element(){return this._element}get isVisible(){return this._isVisible}constructor(e){super(),this.options=e,this._element=document.createElement("div"),this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new A,this.onDidChangeEnd=this._onDidChangeEnd.event,this.addDisposables(this._onDidChange,this._onDidChangeEnd),this._element.className="dv-resize-container",this._isVisible=!0,this.setupResize("top"),this.setupResize("bottom"),this.setupResize("left"),this.setupResize("right"),this.setupResize("topleft"),this.setupResize("topright"),this.setupResize("bottomleft"),this.setupResize("bottomright"),this._element.appendChild(this.options.content),this.options.container.appendChild(this._element),this.setBounds(Object.assign(Object.assign(Object.assign(Object.assign({height:this.options.height,width:this.options.width},"top"in this.options&&{top:this.options.top}),"bottom"in this.options&&{bottom:this.options.bottom}),"left"in this.options&&{left:this.options.left}),"right"in this.options&&{right:this.options.right})),Gt.push(this._element)}setVisible(e){e!==this.isVisible&&(this._isVisible=e,T(this.element,"dv-hidden",!this.isVisible))}bringToFront(){Gt.push(this._element)}setBounds(e={}){"number"==typeof e.height&&(this._element.style.height=`${e.height}px`),"number"==typeof e.width&&(this._element.style.width=`${e.width}px`),"top"in e&&"number"==typeof e.top&&(this._element.style.top=`${e.top}px`,this._element.style.bottom="auto",this.verticalAlignment="top"),"bottom"in e&&"number"==typeof e.bottom&&(this._element.style.bottom=`${e.bottom}px`,this._element.style.top="auto",this.verticalAlignment="bottom"),"left"in e&&"number"==typeof e.left&&(this._element.style.left=`${e.left}px`,this._element.style.right="auto",this.horiziontalAlignment="left"),"right"in e&&"number"==typeof e.right&&(this._element.style.right=`${e.right}px`,this._element.style.left="auto",this.horiziontalAlignment="right");const t=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),n=Math.max(0,this.getMinimumWidth(i.width)),o=Math.max(0,this.getMinimumHeight(i.height));if("top"===this.verticalAlignment){const e=X(i.top-t.top,-o,Math.max(0,t.height-i.height+o));this._element.style.top=`${e}px`,this._element.style.bottom="auto"}if("bottom"===this.verticalAlignment){const e=X(t.bottom-i.bottom,-o,Math.max(0,t.height-i.height+o));this._element.style.bottom=`${e}px`,this._element.style.top="auto"}if("left"===this.horiziontalAlignment){const e=X(i.left-t.left,-n,Math.max(0,t.width-i.width+n));this._element.style.left=`${e}px`,this._element.style.right="auto"}if("right"===this.horiziontalAlignment){const e=X(t.right-i.right,-n,Math.max(0,t.width-i.width+n));this._element.style.right=`${e}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const e=this.options.container.getBoundingClientRect(),t=this._element.getBoundingClientRect(),i={};return"top"===this.verticalAlignment?i.top=parseFloat(this._element.style.top):"bottom"===this.verticalAlignment?i.bottom=parseFloat(this._element.style.bottom):i.top=t.top-e.top,"left"===this.horiziontalAlignment?i.left=parseFloat(this._element.style.left):"right"===this.horiziontalAlignment?i.right=parseFloat(this._element.style.right):i.left=t.left-e.left,i.width=t.width,i.height=t.height,i}setupDrag(e,t={inDragMode:!1}){const i=new O,n=()=>{let e=null;const t=F();i.value=new P({dispose:()=>{t.release()}},k(window,"pointermove",(t=>{const i=this.options.container.getBoundingClientRect(),n=t.clientX-i.left,o=t.clientY-i.top;T(this._element,"dv-resize-container-dragging",!0);const s=this._element.getBoundingClientRect();null===e&&(e={x:t.clientX-s.left,y:t.clientY-s.top});const r=Math.max(0,this.getMinimumWidth(s.width)),a=Math.max(0,this.getMinimumHeight(s.height)),d=X(o-e.y,-a,Math.max(0,i.height-s.height+a)),h=X(e.y-o+i.height-s.height,-a,Math.max(0,i.height-s.height+a)),l=X(n-e.x,-r,Math.max(0,i.width-s.width+r)),p=X(e.x-n+i.width-s.width,-r,Math.max(0,i.width-s.width+r)),c={};d<=h?c.top=d:c.bottom=h,l<=p?c.left=l:c.right=p,this.setBounds(c)})),k(window,"pointerup",(()=>{T(this._element,"dv-resize-container-dragging",!1),i.dispose(),this._onDidChangeEnd.fire()})))};this.addDisposables(i,k(e,"pointerdown",(e=>{e.defaultPrevented?e.preventDefault():H(e)||n()})),k(this.options.content,"pointerdown",(e=>{e.defaultPrevented||H(e)||e.shiftKey&&n()})),k(this.options.content,"pointerdown",(()=>{Gt.push(this._element)}),!0)),t.inDragMode&&n()}setupResize(e){const t=document.createElement("div");t.className=`dv-resize-handle-${e}`,this._element.appendChild(t);const i=new O;this.addDisposables(i,k(t,"pointerdown",(t=>{t.preventDefault();let n=null;const o=F();i.value=new P(k(window,"pointermove",(t=>{const i=this.options.container.getBoundingClientRect(),o=this._element.getBoundingClientRect(),s=t.clientY-i.top,r=t.clientX-i.left;let a,d,h,l,p,c;null===n&&(n={originalY:s,originalHeight:o.height,originalX:r,originalWidth:o.width});const v=()=>{a=X(s,-Number.MAX_VALUE,n.originalY+n.originalHeight>i.height?this.getMinimumHeight(i.height):Math.max(0,n.originalY+n.originalHeight-Vt.MINIMUM_HEIGHT)),h=n.originalY+n.originalHeight-a,d=i.height-a-h},u=()=>{a=n.originalY-n.originalHeight,h=X(s-a,a<0&&"number"==typeof this.options.minimumInViewportHeight?-a+this.options.minimumInViewportHeight:Vt.MINIMUM_HEIGHT,Number.MAX_VALUE),d=i.height-a-h},m=()=>{l=X(r,-Number.MAX_VALUE,n.originalX+n.originalWidth>i.width?this.getMinimumWidth(i.width):Math.max(0,n.originalX+n.originalWidth-Vt.MINIMUM_WIDTH)),c=n.originalX+n.originalWidth-l,p=i.width-l-c},g=()=>{l=n.originalX-n.originalWidth,c=X(r-l,l<0&&"number"==typeof this.options.minimumInViewportWidth?-l+this.options.minimumInViewportWidth:Vt.MINIMUM_WIDTH,Number.MAX_VALUE),p=i.width-l-c};switch(e){case"top":v();break;case"bottom":u();break;case"left":m();break;case"right":g();break;case"topleft":v(),m();break;case"topright":v(),g();break;case"bottomleft":u(),m();break;case"bottomright":u(),g()}const b={};a<=d?b.top=a:b.bottom=d,l<=p?b.left=l:b.right=p,b.height=h,b.width=c,this.setBounds(b)})),{dispose:()=>{o.release()}},k(window,"pointerup",(()=>{i.dispose(),this._onDidChangeEnd.fire()})))})))}getMinimumWidth(e){return"number"==typeof this.options.minimumInViewportWidth?e-this.options.minimumInViewportWidth:0}getMinimumHeight(e){return"number"==typeof this.options.minimumInViewportHeight?e-this.options.minimumInViewportHeight:0}dispose(){Gt.destroy(this._element),this._element.remove(),super.dispose()}}Vt.MINIMUM_HEIGHT=20,Vt.MINIMUM_WIDTH=20;class Nt extends P{constructor(e,t){super(),this.group=e,this.overlay=t,this.addDisposables(t)}position(e){this.overlay.setBounds(e)}}const Tt=100,Lt=100,Rt=100,Mt=300,Wt=300;class Ht{constructor(){this.cache=new Map,this.currentFrameId=0,this.rafId=null}getPosition(e){const t=this.cache.get(e);if(t&&t.frameId===this.currentFrameId)return t.rect;this.scheduleFrameUpdate();const i=j(e);return this.cache.set(e,{rect:i,frameId:this.currentFrameId}),i}invalidate(){this.currentFrameId++}scheduleFrameUpdate(){this.rafId||(this.rafId=requestAnimationFrame((()=>{this.currentFrameId++,this.rafId=null})))}}class jt extends P{constructor(e,t){super(),this.element=e,this.accessor=t,this.map={},this._disposed=!1,this.positionCache=new Ht,this.pendingUpdates=new Set,this.addDisposables(g.from((()=>{for(const e of Object.values(this.map))e.disposable.dispose(),e.destroy.dispose();this._disposed=!0})))}updateAllPositions(){if(!this._disposed){this.positionCache.invalidate();for(const e of Object.values(this.map))e.panel.api.isVisible&&e.resize&&e.resize()}}detatch(e){if(this.map[e.api.id]){const{disposable:t,destroy:i}=this.map[e.api.id];return t.dispose(),i.dispose(),delete this.map[e.api.id],!0}return!1}attach(e){const{panel:t,referenceContainer:i}=e;if(!this.map[t.api.id]){const e=function(){const e=document.createElement("div");return e.tabIndex=-1,e}();e.className="dv-render-overlay",this.map[t.api.id]={panel:t,disposable:g.NONE,destroy:g.NONE,element:e}}const n=this.map[t.api.id].element;t.view.content.element.parentElement!==n&&n.appendChild(t.view.content.element),n.parentElement!==this.element&&this.element.appendChild(n);const o=()=>{const e=t.api.id;this.pendingUpdates.has(e)||(this.pendingUpdates.add(e),requestAnimationFrame((()=>{if(this.pendingUpdates.delete(e),this.isDisposed||!this.map[e])return;const o=this.positionCache.getPosition(i.element),s=this.positionCache.getPosition(this.element),r=o.left-s.left,a=o.top-s.top,d=o.width,h=o.height;n.style.left=`${r}px`,n.style.top=`${a}px`,n.style.width=`${d}px`,n.style.height=`${h}px`,T(n,"dv-render-overlay-float","floating"===t.group.api.location.type)})))},s=()=>{t.api.isVisible&&(this.positionCache.invalidate(),o()),n.style.display=t.api.isVisible?"":"none"},r=new O,a=()=>{"floating"===t.api.location.type?queueMicrotask((()=>{const e=this.accessor.floatingGroups.find((e=>e.group===t.api.group));if(!e)return;const i=e.overlay.element,o=()=>{const e=Number(i.getAttribute("aria-level"));n.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${2*e+1})`},s=new MutationObserver((()=>{o()}));r.value=g.from((()=>s.disconnect())),s.observe(i,{attributeFilter:["aria-level"],attributes:!0}),o()})):n.style.zIndex=""},d=new P(r,new Oe(n,{onDragEnd:e=>{i.dropTarget.dnd.onDragEnd(e)},onDragEnter:e=>{i.dropTarget.dnd.onDragEnter(e)},onDragLeave:e=>{i.dropTarget.dnd.onDragLeave(e)},onDrop:e=>{i.dropTarget.dnd.onDrop(e)},onDragOver:e=>{i.dropTarget.dnd.onDragOver(e)}}),t.api.onDidVisibilityChange((()=>{s()})),t.api.onDidDimensionsChange((()=>{t.api.isVisible&&o()})),t.api.onDidLocationChange((()=>{a()})));return this.map[t.api.id].destroy=g.from((()=>{var e;t.view.content.element.parentElement===n&&n.removeChild(t.view.content.element),null===(e=n.parentElement)||void 0===e||e.removeChild(n)})),a(),queueMicrotask((()=>{this.isDisposed||s()})),this.map[t.api.id].disposable.dispose(),this.map[t.api.id].disposable=d,this.map[t.api.id].resize=o,n}}var Ft=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((n=n.apply(e,t||[])).next())}))};class Bt extends P{get window(){var e,t;return null!==(t=null===(e=this._window)||void 0===e?void 0:e.value)&&void 0!==t?t:null}constructor(e,t,i){super(),this.target=e,this.className=t,this.options=i,this._onWillClose=new A,this.onWillClose=this._onWillClose.event,this._onDidClose=new A,this.onDidClose=this._onDidClose.event,this._window=null,this.addDisposables(this._onWillClose,this._onDidClose,{dispose:()=>{this.close()}})}dimensions(){if(!this._window)return null;const e=this._window.value.screenX;return{top:this._window.value.screenY,left:e,width:this._window.value.innerWidth,height:this._window.value.innerHeight}}close(){var e,t;this._window&&(this._onWillClose.fire(),null===(t=(e=this.options).onWillClose)||void 0===t||t.call(e,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var e,t;return Ft(this,void 0,void 0,(function*(){if(this._window)throw new Error("instance of popout window is already open");const i=`${this.options.url}`,n=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map((([e,t])=>`${e}=${t}`)).join(","),o=window.open(i,this.target,n);if(!o)return null;const s=new P;this._window={value:o,disposable:s},s.addDisposables(g.from((()=>{o.close()})),k(window,"beforeunload",(()=>{this.close()})));const r=this.createPopoutWindowContainer();return this.className&&r.classList.add(this.className),null===(t=(e=this.options).onDidOpen)||void 0===t||t.call(e,{id:this.target,window:o}),new Promise(((e,t)=>{o.addEventListener("unload",(e=>{})),o.addEventListener("load",(()=>{try{const t=o.document;t.title=document.title,t.body.appendChild(r),function(e,t){const i=Array.from(t);for(const t of i){if(t.href){const i=e.createElement("link");i.href=t.href,i.type=t.type,i.rel="stylesheet",e.head.appendChild(i)}let i=[];try{t.cssRules&&(i=Array.from(t.cssRules).map((e=>e.cssText)))}catch(e){}for(const t of i){const i=e.createElement("style");i.appendChild(e.createTextNode(t)),e.head.appendChild(i)}}}(t,window.document.styleSheets),k(o,"beforeunload",(()=>{this.close()})),e(r)}catch(e){t(e)}}))}))}))}createPopoutWindowContainer(){const e=document.createElement("div");return e.classList.add("dv-popout-window"),e.id="dv-popout-window",e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style.top="0px",e.style.left="0px",e}}class Ut extends P{constructor(e){super(),this.accessor=e,this.init()}init(){const e=new Set,t=new Set;this.addDisposables(this.accessor.onDidAddPanel((t=>{if(e.has(t.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${t.api.id} but panel already exists`);e.add(t.api.id)})),this.accessor.onDidRemovePanel((t=>{if(!e.has(t.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${t.api.id} but panel does not exists`);e.delete(t.api.id)})),this.accessor.onDidAddGroup((e=>{if(t.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${e.api.id} but group already exists`);t.add(e.api.id)})),this.accessor.onDidRemoveGroup((e=>{if(!t.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${e.api.id} but group does not exists`);t.delete(e.api.id)})))}}class $t extends P{constructor(e){super(),this.root=e,this._active=null,this._activeDisposable=new O,this._element=document.createElement("div"),this._element.className="dv-popover-anchor",this._element.style.position="relative",this.root.prepend(this._element),this.addDisposables(g.from((()=>{this.close()})),this._activeDisposable)}openPopover(e,t){var i;this.close();const n=document.createElement("div");n.style.position="absolute",n.style.zIndex=null!==(i=t.zIndex)&&void 0!==i?i:"var(--dv-overlay-z-index)",n.appendChild(e);const o=this._element.getBoundingClientRect(),s=o.left,r=o.top;n.style.top=t.y-r+"px",n.style.left=t.x-s+"px",this._element.appendChild(n),this._active=n,this._activeDisposable.value=new P(k(window,"pointerdown",(e=>{var t;const i=e.target;if(!(i instanceof HTMLElement))return;let o=i;for(;o&&o!==n;)o=null!==(t=null==o?void 0:o.parentElement)&&void 0!==t?t:null;o||this.close()}))),requestAnimationFrame((()=>{!function(e,t,i={buffer:10}){const n=i.buffer,o=e.getBoundingClientRect(),s=t.getBoundingClientRect();let r=0,a=0;const d=o.left-s.left,h=o.top-s.top,l=o.bottom-s.bottom,p=o.right-s.right;d<n?r=n-d:p>n&&(r=-n-p),h<n?a=n-h:l>n&&(a=-l-n),0===r&&0===a||(e.style.transform=`translate(${r}px, ${a}px)`)}(n,this.root)}))}close(){this._active&&(this._active.remove(),this._activeDisposable.dispose(),this._active=null)}}class Jt extends P{get disabled(){return this._disabled}set disabled(e){var t;this.disabled!==e&&(this._disabled=e,e&&(null===(t=this.model)||void 0===t||t.clear()))}get model(){if(!this.disabled)return{clear:()=>{var e;this._model&&(null===(e=this._model.root.parentElement)||void 0===e||e.removeChild(this._model.root)),this._model=void 0},exists:()=>!!this._model,getElements:(e,t)=>{const i=this._outline!==t;if(this._outline=t,this._model)return this._model.changed=i,this._model;const n=this.createContainer(),o=this.createAnchor();if(this._model={root:n,overlay:o,changed:i},n.appendChild(o),this.element.appendChild(n),(null==e?void 0:e.target)instanceof HTMLElement){const t=e.target.getBoundingClientRect(),i=this.element.getBoundingClientRect();o.style.left=t.left-i.left+"px",o.style.top=t.top-i.top+"px"}return this._model}}}constructor(e,t){super(),this.element=e,this._disabled=!1,this._disabled=t.disabled,this.addDisposables(g.from((()=>{var e;null===(e=this.model)||void 0===e||e.clear()})))}createContainer(){const e=document.createElement("div");return e.className="dv-drop-target-container",e}createAnchor(){const e=document.createElement("div");return e.className="dv-drop-target-anchor",e.style.visibility="hidden",e}}const Zt={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function Yt(e){const t=e.from.activePanel;[...e.from.panels].map((t=>{const i=e.from.model.removePanel(t);return e.from.model.renderContainer.detatch(t),i})).forEach((i=>{e.to.model.openPanel(i,{skipSetActive:t!==i,skipSetGroupActive:!0})}))}class Xt extends ze{get orientation(){return this.gridview.orientation}get totalPanels(){return this.panels.length}get panels(){return this.groups.flatMap((e=>e.panels))}get options(){return this._options}get activePanel(){const e=this.activeGroup;if(e)return e.activePanel}get renderer(){var e;return null!==(e=this.options.defaultRenderer)&&void 0!==e?e:"onlyWhenVisible"}get api(){return this._api}get floatingGroups(){return this._floatingGroups}get popoutRestorationPromise(){return this._popoutRestorationPromise}constructor(e,t){var i,n,o;super(e,{proportionalLayout:!0,orientation:ee.HORIZONTAL,styles:t.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:t.disableAutoResizing,locked:t.locked,margin:null!==(n=null===(i=t.theme)||void 0===i?void 0:i.gap)&&void 0!==n?n:0,className:t.className}),this.nextGroupId=q(),this._deserializer=new Ot(this),this._watermark=null,this._onWillDragPanel=new A,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new A,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new A,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new A,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new A,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPopoutGroupSizeChange=new A,this.onDidPopoutGroupSizeChange=this._onDidPopoutGroupSizeChange.event,this._onDidPopoutGroupPositionChange=new A,this.onDidPopoutGroupPositionChange=this._onDidPopoutGroupPositionChange.event,this._onDidOpenPopoutWindowFail=new A,this.onDidOpenPopoutWindowFail=this._onDidOpenPopoutWindowFail.event,this._onDidLayoutFromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new A({replay:!0}),this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new A,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new A,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._popoutRestorationPromise=Promise.resolve(),this._onDidRemoveGroup=new A,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new A,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidOptionsChange=new A,this.onDidOptionsChange=this._onDidOptionsChange.event,this._onDidActiveGroupChange=new A,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this._options=t,this.popupService=new $t(this.element),this._themeClassnames=new B(this.element),this._api=new Ee(this),this.rootDropTargetContainer=new Jt(this.element,{disabled:!0}),this.overlayRenderContainer=new jt(this.gridview.element,this),this._rootDropTarget=new Le(this.element,{className:"dv-drop-target-edge",canDisplayOverlay:(e,t)=>{const i=y();if(i)return i.viewId===this.id&&("center"!==t||0===this.gridview.length);if("center"===t&&0!==this.gridview.length)return!1;const n=new st(e,"edge",t,y);return this._onUnhandledDragOverEvent.fire(n),n.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:null!==(o=t.rootOverlayModel)&&void 0!==o?o:Zt,getOverrideTarget:()=>{var e;return null===(e=this.rootDropTargetContainer)||void 0===e?void 0:e.model}}),this.updateDropTargetModel(t),T(this.gridview.element,"dv-dockview",!0),T(this.element,"dv-debug",!!t.debug),this.updateTheme(),this.updateWatermark(),t.debug&&this.addDisposables(new Ut(this)),this.addDisposables(this.rootDropTargetContainer,this.overlayRenderContainer,this._onWillDragPanel,this._onWillDragGroup,this._onWillShowOverlay,this._onDidActivePanelChange,this._onDidAddPanel,this._onDidRemovePanel,this._onDidLayoutFromJSON,this._onDidDrop,this._onWillDrop,this._onDidMovePanel,this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this._onUnhandledDragOverEvent,this._onDidMaximizedGroupChange,this._onDidOptionsChange,this._onDidPopoutGroupSizeChange,this._onDidPopoutGroupPositionChange,this._onDidOpenPopoutWindowFail,this.onDidViewVisibilityChangeMicroTaskQueue((()=>{this.updateWatermark()})),this.onDidAdd((e=>{this._moving||this._onDidAddGroup.fire(e)})),this.onDidRemove((e=>{this._moving||this._onDidRemoveGroup.fire(e)})),this.onDidActiveChange((e=>{this._moving||this._onDidActiveGroupChange.fire(e)})),this.onDidMaximizedChange((e=>{this._onDidMaximizedGroupChange.fire({group:e.panel,isMaximized:e.isMaximized})})),m.any(this.onDidAdd,this.onDidRemove)((()=>{this.updateWatermark()})),m.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange,this.onDidPopoutGroupPositionChange,this.onDidPopoutGroupSizeChange)((()=>{this._bufferOnDidLayoutChange.fire()})),g.from((()=>{for(const e of[...this._floatingGroups])e.dispose();for(const e of[...this._popoutGroups])e.disposable.dispose()})),this._rootDropTarget,this._rootDropTarget.onWillShowOverlay((e=>{this.gridview.length>0&&"center"===e.position||this._onWillShowOverlay.fire(new qe(e,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:y}))})),this._rootDropTarget.onDrop((e=>{var t;const i=new ct({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:y,kind:"edge"});if(this._onWillDrop.fire(i),i.defaultPrevented)return;const n=y();n?this.moveGroupOrPanel({from:{groupId:n.groupId,panelId:null!==(t=n.panelId)&&void 0!==t?t:void 0},to:{group:this.orthogonalize(e.position),position:"center"}}):this._onDidDrop.fire(new pt({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:y}))})),this._rootDropTarget)}setVisible(e,t){switch(e.api.location.type){case"grid":super.setVisible(e,t);break;case"floating":{const i=this.floatingGroups.find((t=>t.group===e));i&&(i.overlay.setVisible(t),e.api._onDidVisibilityChange.fire({isVisible:t}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window")}}addPopoutGroup(e,t){var i,n,o,s,r;if(e instanceof kt&&1===e.group.size)return this.addPopoutGroup(e.group,t);const a=function(e){function t(e){const t=[];for(let i=0;i<e.classList.length;i++)t.push(e.classList.item(i));return t}let i,n=e;for(;null!==n&&(i=t(n).find((e=>e.startsWith("dockview-theme-"))),"string"!=typeof i);)n=n.parentElement;return i}(this.gridview.element),d=this.element;const h=(null==t?void 0:t.position)?t.position:e instanceof ft?e.element.getBoundingClientRect():e.group?e.group.element.getBoundingClientRect():d.getBoundingClientRect(),l=null!==(n=null===(i=null==t?void 0:t.overridePopoutGroup)||void 0===i?void 0:i.id)&&void 0!==n?n:this.getNextGroupId(),p=new Bt(`${this.id}-${l}`,null!=a?a:"",{url:null!==(r=null!==(o=null==t?void 0:t.popoutUrl)&&void 0!==o?o:null===(s=this.options)||void 0===s?void 0:s.popoutUrl)&&void 0!==r?r:"/popout.html",left:window.screenX+h.left,top:window.screenY+h.top,width:h.width,height:h.height,onDidOpen:null==t?void 0:t.onDidOpen,onWillClose:null==t?void 0:t.onWillClose}),c=new P(p,p.onDidClose((()=>{c.dispose()})));return p.open().then((i=>{var n;if(p.isDisposed)return!1;const o=(null==t?void 0:t.referenceGroup)?t.referenceGroup:e instanceof kt?e.group:e,s=e.api.location.type,r=null!==o.element.parentElement;let a;if(r?(null==t?void 0:t.overridePopoutGroup)?a=t.overridePopoutGroup:(a=this.createGroup({id:l}),i&&this._onDidAddGroup.fire(a)):a=o,null===i)return console.error("dockview: failed to create popout. perhaps you need to allow pop-ups for this website"),c.dispose(),this._onDidOpenPopoutWindowFail.fire(),this.movingLock((()=>Yt({from:a,to:o}))),o.api.isVisible||o.api.setVisible(!0),!1;const d=document.createElement("div");d.className="dv-overlay-render-container";const h=new jt(d,this);let v;if(a.model.renderContainer=h,a.layout(p.window.innerWidth,p.window.innerHeight),!(null==t?void 0:t.overridePopoutGroup)&&r)if(e instanceof kt)this.movingLock((()=>{const t=o.model.removePanel(e);a.model.openPanel(t)}));else switch(this.movingLock((()=>Yt({from:o,to:a}))),s){case"grid":o.api.setVisible(!1);break;case"floating":case"popout":v=null===(n=this._floatingGroups.find((t=>t.group.api.id===e.api.id)))||void 0===n?void 0:n.overlay.toJSON(),this.removeGroup(o)}i.classList.add("dv-dockview"),i.style.overflow="hidden",i.appendChild(d),i.appendChild(a.element);const u=document.createElement("div"),m=new Jt(u,{disabled:this.rootDropTargetContainer.disabled});let b;i.appendChild(u),a.model.dropTargetContainer=m,a.model.location={type:"popout",getWindow:()=>p.window,popoutUrl:null==t?void 0:t.popoutUrl},r&&"grid"===e.api.location.type&&e.api.setVisible(!1),this.doSetGroupAndPanelActive(a),c.addDisposables(a.api.onDidActiveChange((e=>{var t;e.isActive&&(null===(t=p.window)||void 0===t||t.focus())})),a.api.onWillFocus((()=>{var e;null===(e=p.window)||void 0===e||e.focus()})));const f=r&&o&&this.getPanel(o.id),w={window:p,popoutGroup:a,referenceGroup:f?o.id:void 0,disposable:{dispose:()=>(c.dispose(),b)}},_=function(e){const t=new A;let i,n=e.screenX,o=e.screenY;const s=()=>{if(e.closed)return;const r=e.screenX,a=e.screenY;r===n&&a===o||(clearTimeout(i),i=setTimeout((()=>{t.fire()}),100),n=r,o=a),requestAnimationFrame(s)};return s(),t}(p.window);return c.addDisposables(_,function(e,t){let i;return new P(k(e,"resize",(()=>{clearTimeout(i),i=setTimeout((()=>{t()}),100)})))}(p.window,(()=>{this._onDidPopoutGroupSizeChange.fire({width:p.window.innerWidth,height:p.window.innerHeight,group:a})})),_.event((()=>{this._onDidPopoutGroupPositionChange.fire({screenX:p.window.screenX,screenY:p.window.screenX,group:a})})),k(p.window,"resize",(()=>{a.layout(p.window.innerWidth,p.window.innerHeight)})),h,g.from((()=>{if(!this.isDisposed)if(r&&this.getPanel(o.id))this.movingLock((()=>Yt({from:a,to:o}))),o.api.isVisible||o.api.setVisible(!0),this.getPanel(a.id)&&this.doRemoveGroup(a,{skipPopoutAssociated:!0});else if(this.getPanel(a.id)){a.model.renderContainer=this.overlayRenderContainer,a.model.dropTargetContainer=this.rootDropTargetContainer,b=a;if(!this._popoutGroups.find((e=>e.popoutGroup===a)))return;v?this.addFloatingGroup(a,{height:v.height,width:v.width,position:v}):(this.doRemoveGroup(a,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),a.model.location={type:"grid"},this.movingLock((()=>{this.doAddGroup(a,[0])}))),this.doSetGroupAndPanelActive(a)}}))),this._popoutGroups.push(w),this.updateWatermark(),!0})).catch((e=>(console.error("dockview: failed to create popout.",e),!1)))}addFloatingGroup(e,t){var i,n,o,s,r;let a;if(e instanceof kt)a=this.createGroup(),this._onDidAddGroup.fire(a),this.movingLock((()=>this.removePanel(e,{removeEmptyGroup:!0,skipDispose:!0,skipSetActiveGroup:!0}))),this.movingLock((()=>a.model.openPanel(e,{skipSetGroupActive:!0})));else{a=e;const n=null===(i=this._popoutGroups.find((e=>e.popoutGroup===a)))||void 0===i?void 0:i.referenceGroup,o=n?this.getPanel(n):void 0;"boolean"==typeof(null==t?void 0:t.skipRemoveGroup)&&t.skipRemoveGroup||(o?(this.movingLock((()=>Yt({from:e,to:o}))),this.doRemoveGroup(e,{skipPopoutReturn:!0,skipPopoutAssociated:!0}),this.doRemoveGroup(o,{skipDispose:!0}),a=o):this.doRemoveGroup(e,{skipDispose:!0,skipPopoutReturn:!0,skipPopoutAssociated:!1}))}const d=function(){if(null==t?void 0:t.position){const e={};return"left"in t.position?e.left=Math.max(t.position.left,0):"right"in t.position?e.right=Math.max(t.position.right,0):e.left=Lt,"top"in t.position?e.top=Math.max(t.position.top,0):"bottom"in t.position?e.bottom=Math.max(t.position.bottom,0):e.top=Rt,"number"==typeof t.width?e.width=Math.max(t.width,0):e.width=Mt,"number"==typeof t.height?e.height=Math.max(t.height,0):e.height=Wt,e}return{left:"number"==typeof(null==t?void 0:t.x)?Math.max(t.x,0):Lt,top:"number"==typeof(null==t?void 0:t.y)?Math.max(t.y,0):Rt,width:"number"==typeof(null==t?void 0:t.width)?Math.max(t.width,0):Mt,height:"number"==typeof(null==t?void 0:t.height)?Math.max(t.height,0):Wt}}(),h=new Vt(Object.assign(Object.assign({container:this.gridview.element,content:a.element},d),{minimumInViewportWidth:"boundedWithinViewport"===this.options.floatingGroupBounds?void 0:null!==(o=null===(n=this.options.floatingGroupBounds)||void 0===n?void 0:n.minimumWidthWithinViewport)&&void 0!==o?o:Tt,minimumInViewportHeight:"boundedWithinViewport"===this.options.floatingGroupBounds?void 0:null!==(r=null===(s=this.options.floatingGroupBounds)||void 0===s?void 0:s.minimumHeightWithinViewport)&&void 0!==r?r:Tt})),l=a.element.querySelector(".dv-void-container");if(!l)throw new Error("failed to find drag handle");h.setupDrag(l,{inDragMode:"boolean"==typeof(null==t?void 0:t.inDragMode)&&t.inDragMode});const p=new Nt(a,h),c=new P(a.api.onDidActiveChange((e=>{e.isActive&&h.bringToFront()})),G(a.element,(e=>{const{width:t,height:i}=e.contentRect;a.layout(t,i)})));p.addDisposables(h.onDidChange((()=>{a.layout(a.width,a.height)})),h.onDidChangeEnd((()=>{this._bufferOnDidLayoutChange.fire()})),a.onDidChange((e=>{h.setBounds({height:null==e?void 0:e.height,width:null==e?void 0:e.width})})),{dispose:()=>{c.dispose(),Y(this._floatingGroups,p),a.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(p),a.model.location={type:"floating"},(null==t?void 0:t.skipActiveGroup)||this.doSetGroupAndPanelActive(a),this.updateWatermark()}orthogonalize(e,t){switch(this.gridview.normalize(),e){case"top":case"bottom":this.gridview.orientation===ee.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===ee.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot()}switch(e){case"top":case"left":case"center":return this.createGroupAtLocation([0],void 0,t);case"bottom":case"right":return this.createGroupAtLocation([this.gridview.length],void 0,t);default:throw new Error(`unsupported position ${e}`)}}updateOptions(e){var t,i;if(super.updateOptions(e),"floatingGroupBounds"in e)for(const n of this._floatingGroups){switch(e.floatingGroupBounds){case"boundedWithinViewport":n.overlay.minimumInViewportHeight=void 0,n.overlay.minimumInViewportWidth=void 0;break;case void 0:n.overlay.minimumInViewportHeight=Tt,n.overlay.minimumInViewportWidth=Tt;break;default:n.overlay.minimumInViewportHeight=null===(t=e.floatingGroupBounds)||void 0===t?void 0:t.minimumHeightWithinViewport,n.overlay.minimumInViewportWidth=null===(i=e.floatingGroupBounds)||void 0===i?void 0:i.minimumWidthWithinViewport}n.overlay.setBounds()}this.updateDropTargetModel(e);const n=this.options.disableDnd;this._options=Object.assign(Object.assign({},this.options),e);n!==this.options.disableDnd&&this.updateDragAndDropState(),"theme"in e&&this.updateTheme(),this.layout(this.gridview.width,this.gridview.height,!0)}layout(e,t,i){if(super.layout(e,t,i),this._floatingGroups)for(const e of this._floatingGroups)e.overlay.setBounds()}updateDragAndDropState(){for(const e of this.groups)e.model.updateDragAndDropState()}focus(){var e;null===(e=this.activeGroup)||void 0===e||e.focus()}getGroupPanel(e){return this.panels.find((t=>t.id===e))}setActivePanel(e){e.group.model.openPanel(e),this.doSetGroupAndPanelActive(e.group)}moveToNext(e={}){var t;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[e.group.panels.length-1])return void e.group.model.moveToNext({suppressRoll:!0});const i=ve(e.group.element),n=null===(t=this.gridview.next(i))||void 0===t?void 0:t.view;this.doSetGroupAndPanelActive(n)}moveToPrevious(e={}){var t;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[0])return void e.group.model.moveToPrevious({suppressRoll:!0});const i=ve(e.group.element),n=null===(t=this.gridview.previous(i))||void 0===t?void 0:t.view;n&&this.doSetGroupAndPanelActive(n)}toJSON(){var e;const t=this.gridview.serialize(),i=this.panels.reduce(((e,t)=>(e[t.id]=t.toJSON(),e)),{}),n=this._floatingGroups.map((e=>({data:e.group.toJSON(),position:e.overlay.toJSON()}))),o=this._popoutGroups.map((e=>({data:e.popoutGroup.toJSON(),gridReferenceGroup:e.referenceGroup,position:e.window.dimensions(),url:"popout"===e.popoutGroup.api.location.type?e.popoutGroup.api.location.popoutUrl:void 0}))),s={grid:t,panels:i,activeGroup:null===(e=this.activeGroup)||void 0===e?void 0:e.id};return n.length>0&&(s.floatingGroups=n),o.length>0&&(s.popoutGroups=o),s}fromJSON(e){var t,i;if(this.clear(),"object"!=typeof e||null===e)throw new Error("serialized layout must be a non-null object");const{grid:n,panels:o,activeGroup:s}=e;if("branch"!==n.root.type||!Array.isArray(n.root.data))throw new Error("root must be of type branch");try{const r=this.width,a=this.height,d=e=>{const{id:t,locked:i,hideHeader:n,views:s,activeView:r}=e;if("string"!=typeof t)throw new Error("group id must be of type string");const a=this.createGroup({id:t,locked:!!i,hideHeader:!!n});this._onDidAddGroup.fire(a);const d=[];for(const e of s){const t=this._deserializer.fromJSON(o[e],a);d.push(t)}for(let e=0;e<s.length;e++){const t=d[e],i="string"==typeof r&&r===t.id;a.model.openPanel(t,{skipSetActive:!i,skipSetGroupActive:!0})}return!a.activePanel&&a.panels.length>0&&a.model.openPanel(a.panels[a.panels.length-1],{skipSetGroupActive:!0}),a};this.gridview.deserialize(n,{fromJSON:e=>d(e.data)}),this.layout(r,a,!0);const h=null!==(t=e.floatingGroups)&&void 0!==t?t:[];for(const e of h){const{data:t,position:i}=e,n=d(t);this.addFloatingGroup(n,{position:i,width:i.width,height:i.height,skipRemoveGroup:!0,inDragMode:!1})}const l=null!==(i=e.popoutGroups)&&void 0!==i?i:[],p=[];l.forEach(((e,t)=>{const{data:i,position:n,gridReferenceGroup:o,url:s}=e,r=d(i),a=new Promise((e=>{setTimeout((()=>{this.addPopoutGroup(r,{position:null!=n?n:void 0,overridePopoutGroup:o?r:void 0,referenceGroup:o?this.getPanel(o):void 0,popoutUrl:s}),e()}),100*t)}));p.push(a)})),this._popoutRestorationPromise=Promise.all(p).then((()=>{}));for(const e of this._floatingGroups)e.overlay.setBounds();if("string"==typeof s){const e=this.getPanel(s);e&&this.doSetGroupAndPanelActive(e)}}catch(e){console.error("dockview: failed to deserialize layout. Reverting changes",e);for(const e of this.groups)for(const t of e.panels)this.removePanel(t,{removeEmptyGroup:!1,skipDispose:!1});for(const e of this.groups)e.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e);for(const e of[...this._floatingGroups])e.dispose();throw this.clear(),e}this.updateWatermark(),requestAnimationFrame((()=>{this.overlayRenderContainer.updateAllPositions()})),this._onDidLayoutFromJSON.fire()}clear(){const e=Array.from(this._groups.values()).map((e=>e.value)),t=!!this.activeGroup;for(const t of e)this.removeGroup(t,{skipActive:!0});t&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const e of this._groups.entries()){const[t,i]=e;i.value.model.closeAllPanels()}}addPanel(e){var t,i;if(this.panels.find((t=>t.id===e.id)))throw new Error(`panel with id ${e.id} already exists`);let n;if(e.position&&e.floating)throw new Error("you can only provide one of: position, floating as arguments to .addPanel(...)");const o={width:e.initialWidth,height:e.initialHeight};let s,r;if(e.position)if(at(e.position)){const t="string"==typeof e.position.referencePanel?this.getGroupPanel(e.position.referencePanel):e.position.referencePanel;if(s=e.position.index,!t)throw new Error(`referencePanel '${e.position.referencePanel}' does not exist`);n=this.findGroup(t)}else{if(!dt(e.position)){const t=this.orthogonalize(Ge(e.position.direction)),i=this.createPanel(e,t);return t.model.openPanel(i,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),e.inactive||this.doSetGroupAndPanelActive(t),t.api.setSize({height:null==o?void 0:o.height,width:null==o?void 0:o.width}),i}if(n="string"==typeof e.position.referenceGroup?null===(t=this._groups.get(e.position.referenceGroup))||void 0===t?void 0:t.value:e.position.referenceGroup,s=e.position.index,!n)throw new Error(`referenceGroup '${e.position.referenceGroup}' does not exist`)}else n=this.activeGroup;if(n){const t=Ce((null===(i=e.position)||void 0===i?void 0:i.direction)||"within");if(e.floating){const t=this.createGroup();this._onDidAddGroup.fire(t);const i="object"==typeof e.floating&&null!==e.floating?e.floating:{};this.addFloatingGroup(t,Object.assign(Object.assign({},i),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),r=this.createPanel(e,t),t.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s})}else if("floating"===n.api.location.type||"center"===t)r=this.createPanel(e,n),n.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),n.api.setSize({width:null==o?void 0:o.width,height:null==o?void 0:o.height}),e.inactive||this.doSetGroupAndPanelActive(n);else{const i=ve(n.element),a=ue(this.gridview.orientation,i,t),d=this.createGroupAtLocation(a,this.orientationAtLocation(a)===ee.VERTICAL?null==o?void 0:o.height:null==o?void 0:o.width);r=this.createPanel(e,d),d.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),e.inactive||this.doSetGroupAndPanelActive(d)}}else if(e.floating){const t=this.createGroup();this._onDidAddGroup.fire(t);const i="object"==typeof e.floating&&null!==e.floating?e.floating:{};this.addFloatingGroup(t,Object.assign(Object.assign({},i),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),r=this.createPanel(e,t),t.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s})}else{const t=this.createGroupAtLocation([0],this.gridview.orientation===ee.VERTICAL?null==o?void 0:o.height:null==o?void 0:o.width);r=this.createPanel(e,t),t.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),e.inactive||this.doSetGroupAndPanelActive(t)}return r}removePanel(e,t={removeEmptyGroup:!0}){const i=e.group;if(!i)throw new Error(`cannot remove panel ${e.id}. it's missing a group.`);i.model.removePanel(e,{skipSetActiveGroup:t.skipSetActiveGroup}),t.skipDispose||(e.group.model.renderContainer.detatch(e),e.dispose()),0===i.size&&t.removeEmptyGroup&&this.removeGroup(i,{skipActive:t.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new It}updateWatermark(){var e,t,i;if(0===this.groups.filter((e=>"grid"===e.api.location.type&&e.api.isVisible)).length){if(!this._watermark){this._watermark=this.createWatermarkComponent(),this._watermark.init({containerApi:new Ee(this)});const e=document.createElement("div");e.className="dv-watermark-container",i="watermark-component",e.setAttribute("data-testid",i),e.appendChild(this._watermark.element),this.gridview.element.appendChild(e)}}else this._watermark&&(this._watermark.element.parentElement.remove(),null===(t=(e=this._watermark).dispose)||void 0===t||t.call(e),this._watermark=null)}addGroup(e){var t;if(e){let i;if(ht(e)){const t="string"==typeof e.referencePanel?this.panels.find((t=>t.id===e.referencePanel)):e.referencePanel;if(!t)throw new Error(`reference panel ${e.referencePanel} does not exist`);if(i=this.findGroup(t),!i)throw new Error(`reference group for reference panel ${e.referencePanel} does not exist`)}else{if(!lt(e)){const t=this.orthogonalize(Ge(e.direction),e);return e.skipSetActive||this.doSetGroupAndPanelActive(t),t}if(i="string"==typeof e.referenceGroup?null===(t=this._groups.get(e.referenceGroup))||void 0===t?void 0:t.value:e.referenceGroup,!i)throw new Error(`reference group ${e.referenceGroup} does not exist`)}const n=Ce(e.direction||"within"),o=ve(i.element),s=ue(this.gridview.orientation,o,n),r=this.createGroup(e),a=this.getLocationOrientation(s)===ee.VERTICAL?e.initialHeight:e.initialWidth;return this.doAddGroup(r,s,a),e.skipSetActive||this.doSetGroupAndPanelActive(r),r}{const t=this.createGroup(e);return this.doAddGroup(t),this.doSetGroupAndPanelActive(t),t}}getLocationOrientation(e){return e.length%2==0&&this.gridview.orientation===ee.HORIZONTAL?ee.HORIZONTAL:ee.VERTICAL}removeGroup(e,t){this.doRemoveGroup(e,t)}doRemoveGroup(e,t){var i;const n=[...e.panels];if(!(null==t?void 0:t.skipDispose))for(const e of n)this.removePanel(e,{removeEmptyGroup:!1,skipDispose:null!==(i=null==t?void 0:t.skipDispose)&&void 0!==i&&i});const o=this.activePanel;if("floating"===e.api.location.type){const i=this._floatingGroups.find((t=>t.group===e));if(i){if((null==t?void 0:t.skipDispose)||(i.group.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)),Y(this._floatingGroups,i),i.dispose(),!(null==t?void 0:t.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return i.group}throw new Error("failed to find floating group")}if("popout"===e.api.location.type){const i=this._popoutGroups.find((t=>t.popoutGroup===e));if(i){if(!(null==t?void 0:t.skipDispose)){if(!(null==t?void 0:t.skipPopoutAssociated)){const e=i.referenceGroup?this.getPanel(i.referenceGroup):void 0;e&&0===e.panels.length&&this.removeGroup(e)}i.popoutGroup.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)}Y(this._popoutGroups,i);const n=i.disposable.dispose();if(!(null==t?void 0:t.skipPopoutReturn)&&n&&(this.doAddGroup(n,[0]),this.doSetGroupAndPanelActive(n)),!(null==t?void 0:t.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return this.updateWatermark(),i.popoutGroup}throw new Error("failed to find popout group")}const s=super.doRemoveGroup(e,t);return(null==t?void 0:t.skipActive)||this.activePanel!==o&&this._onDidActivePanelChange.fire(this.activePanel),s}movingLock(e){const t=this._moving;try{return this._moving=!0,e()}finally{this._moving=t}}moveGroupOrPanel(e){var t;const i=e.to.group,n=e.from.groupId,o=e.from.panelId,s=e.to.position,r=e.to.index,a=n?null===(t=this._groups.get(n))||void 0===t?void 0:t.value:void 0;if(!a)throw new Error(`Failed to find group id ${n}`);if(void 0!==o)if(s&&"center"!==s){const e=ve(i.element),t=ue(this.gridview.orientation,e,s);if(a.size<2){const[e,n]=U(t);if("grid"===a.api.location.type){const t=ve(a.element),[i,s]=U(t);if($(i,e))return this.gridview.moveView(i,s,n),void this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:a})}if("popout"===a.api.location.type){const e=this._popoutGroups.find((e=>e.popoutGroup===a)),i=this.movingLock((()=>e.popoutGroup.model.removePanel(e.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0})));this.doRemoveGroup(a,{skipActive:!0});const n=this.createGroupAtLocation(t);return this.movingLock((()=>n.model.openPanel(i))),this.doSetGroupAndPanelActive(n),void this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:a})}const r=this.movingLock((()=>this.doRemoveGroup(a,{skipActive:!0,skipDispose:!0}))),d=ve(i.element),h=ue(this.gridview.orientation,d,s);this.movingLock((()=>this.doAddGroup(r,h))),this.doSetGroupAndPanelActive(r),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:a})}else{const t=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!t)throw new Error(`No panel with id ${o}`);const i=ue(this.gridview.orientation,e,s),n=this.createGroupAtLocation(i);this.movingLock((()=>n.model.openPanel(t,{skipSetGroupActive:!0}))),this.doSetGroupAndPanelActive(n),this._onDidMovePanel.fire({panel:t,from:a})}}else{const t=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!t)throw new Error(`No panel with id ${o}`);0===a.model.size&&this.doRemoveGroup(a,{skipActive:!0});const n=0===i.model.size;this.movingLock((()=>{var o;return i.model.openPanel(t,{index:r,skipSetActive:null!==(o=e.skipSetActive)&&void 0!==o&&o&&!n,skipSetGroupActive:!0})})),e.skipSetActive||this.doSetGroupAndPanelActive(i),this._onDidMovePanel.fire({panel:t,from:a})}else this.moveGroup({from:{group:a},to:{group:i,position:s},skipSetActive:e.skipSetActive})}moveGroup(e){const t=e.from.group,i=e.to.group,n=e.to.position;if("center"===n){const n=t.activePanel,o=this.movingLock((()=>[...t.panels].map((e=>t.model.removePanel(e.id,{skipSetActive:!0})))));0===(null==t?void 0:t.model.size)&&this.doRemoveGroup(t,{skipActive:!0}),this.movingLock((()=>{for(const e of o)i.model.openPanel(e,{skipSetActive:e!==n,skipSetGroupActive:!0})})),!0!==e.skipSetActive?this.doSetGroupAndPanelActive(i):this.activePanel||this.doSetGroupAndPanelActive(i)}else{switch(t.api.location.type){case"grid":this.gridview.removeView(ve(t.element));break;case"floating":{const e=this._floatingGroups.find((e=>e.group===t));if(!e)throw new Error("failed to find floating group");e.dispose();break}case"popout":{const e=this._popoutGroups.find((e=>e.popoutGroup===t));if(!e)throw new Error("failed to find popout group");const n=this._popoutGroups.indexOf(e);if(n>=0&&this._popoutGroups.splice(n,1),e.referenceGroup){const t=this.getPanel(e.referenceGroup);t&&!t.api.isVisible&&this.doRemoveGroup(t,{skipActive:!0})}e.window.dispose(),"grid"===i.api.location.type?(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"grid"}):"floating"===i.api.location.type&&(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"floating"});break}}if("grid"===i.api.location.type){const e=ve(i.element),o=ue(this.gridview.orientation,e,n);let s;switch(this.gridview.orientation){case ee.VERTICAL:s=e.length%2==0?t.api.width:t.api.height;break;case ee.HORIZONTAL:s=e.length%2==0?t.api.height:t.api.width}this.gridview.addView(t,s,o)}else if("floating"===i.api.location.type){const e=this._floatingGroups.find((e=>e.group===i));if(e){const i=e.overlay.toJSON();let n,o;n="left"in i?i.left+50:"right"in i?Math.max(0,i.right-i.width-50):50,o="top"in i?i.top+50:"bottom"in i?Math.max(0,i.bottom-i.height-50):50,this.addFloatingGroup(t,{height:i.height,width:i.width,position:{left:n,top:o}})}}}if(t.panels.forEach((e=>{this._onDidMovePanel.fire({panel:e,from:t})})),!1===e.skipSetActive){const e=null!=i?i:t;this.doSetGroupAndPanelActive(e)}}doSetGroupActive(e){super.doSetGroupActive(e);const t=this.activePanel;this._moving||t===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(t)}doSetGroupAndPanelActive(e){super.doSetGroupActive(e);const t=this.activePanel;e&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(e)&&this.exitMaximizedGroup(),this._moving||t===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(t)}getNextGroupId(){let e=this.nextGroupId.next();for(;this._groups.has(e);)e=this.nextGroupId.next();return e}createGroup(e){e||(e={});let t=null==e?void 0:e.id;if(t&&this._groups.has(e.id)&&(console.warn(`dockview: Duplicate group id ${null==e?void 0:e.id}. reassigning group id to avoid errors`),t=void 0),!t)for(t=this.nextGroupId.next();this._groups.has(t);)t=this.nextGroupId.next();const i=new ft(this,t,e);if(i.init({params:{},accessor:this}),!this._groups.has(i.id)){const e=new P(i.model.onTabDragStart((e=>{this._onWillDragPanel.fire(e)})),i.model.onGroupDragStart((e=>{this._onWillDragGroup.fire(e)})),i.model.onMove((e=>{const{groupId:t,itemId:n,target:o,index:s}=e;this.moveGroupOrPanel({from:{groupId:t,panelId:n},to:{group:i,position:o,index:s}})})),i.model.onDidDrop((e=>{this._onDidDrop.fire(e)})),i.model.onWillDrop((e=>{this._onWillDrop.fire(e)})),i.model.onWillShowOverlay((e=>{this.options.disableDnd?e.preventDefault():this._onWillShowOverlay.fire(e)})),i.model.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})),i.model.onDidAddPanel((e=>{this._moving||this._onDidAddPanel.fire(e.panel)})),i.model.onDidRemovePanel((e=>{this._moving||this._onDidRemovePanel.fire(e.panel)})),i.model.onDidActivePanelChange((e=>{this._moving||e.panel===this.activePanel&&this._onDidActivePanelChange.value!==e.panel&&this._onDidActivePanelChange.fire(e.panel)})),m.any(i.model.onDidPanelTitleChange,i.model.onDidPanelParametersChange)((()=>{this._bufferOnDidLayoutChange.fire()})));this._groups.set(i.id,{value:i,disposable:e})}return i.initialize(),i}createPanel(e,t){var i,n,o;const s=e.component,r=null!==(i=e.tabComponent)&&void 0!==i?i:this.options.defaultTabComponent,a=new Pt(this,e.id,s,r),d=new kt(e.id,s,r,this,this._api,t,a,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return d.init({title:null!==(n=e.title)&&void 0!==n?n:e.id,params:null!==(o=null==e?void 0:e.params)&&void 0!==o?o:{}}),d}createGroupAtLocation(e,t,i){const n=this.createGroup(i);return this.doAddGroup(n,e,t),n}findGroup(e){var t;return null===(t=Array.from(this._groups.values()).find((t=>t.value.model.containsPanel(e))))||void 0===t?void 0:t.value}orientationAtLocation(e){const t=this.gridview.orientation;return e.length%2==1?t:be(t)}updateDropTargetModel(e){"dndEdges"in e&&(this._rootDropTarget.disabled="boolean"==typeof e.dndEdges&&!1===e.dndEdges,"object"==typeof e.dndEdges&&null!==e.dndEdges?this._rootDropTarget.setOverlayModel(e.dndEdges):this._rootDropTarget.setOverlayModel(Zt)),"rootOverlayModel"in e&&this.updateDropTargetModel({dndEdges:e.dndEdges})}updateTheme(){var e,t;const i=null!==(e=this._options.theme)&&void 0!==e?e:Dt;if(this._themeClassnames.setClassNames(i.className),this.gridview.margin=null!==(t=i.gap)&&void 0!==t?t:0,"absolute"===i.dndOverlayMounting)this.rootDropTargetContainer.disabled=!1;else this.rootDropTargetContainer.disabled=!0}}class qt extends ze{get orientation(){return this.gridview.orientation}set orientation(e){this.gridview.orientation=e}get options(){return this._options}get deserializer(){return this._deserializer}set deserializer(e){this._deserializer=e}constructor(e,t){var i;super(e,{proportionalLayout:null===(i=t.proportionalLayout)||void 0===i||i,orientation:t.orientation,styles:t.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:t.disableAutoResizing,className:t.className}),this._onDidLayoutfromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidRemoveGroup=new A,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new A,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new A,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._options=t,this.addDisposables(this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this.onDidAdd((e=>{this._onDidAddGroup.fire(e)})),this.onDidRemove((e=>{this._onDidRemoveGroup.fire(e)})),this.onDidActiveChange((e=>{this._onDidActiveGroupChange.fire(e)})))}updateOptions(e){super.updateOptions(e);const t="string"==typeof e.orientation&&this.gridview.orientation!==e.orientation;this._options=Object.assign(Object.assign({},this.options),e),t&&(this.gridview.orientation=e.orientation),this.layout(this.gridview.width,this.gridview.height,!0)}removePanel(e){this.removeGroup(e)}toJSON(){var e;return{grid:this.gridview.serialize(),activePanel:null===(e=this.activeGroup)||void 0===e?void 0:e.id}}setVisible(e,t){this.gridview.setViewVisible(ve(e.element),t)}setActive(e){this._groups.forEach(((t,i)=>{t.value.setActive(e===t.value)}))}focus(){var e;null===(e=this.activeGroup)||void 0===e||e.focus()}fromJSON(e){this.clear();const{grid:t,activePanel:i}=e;try{const e=[],n=this.width,o=this.height;if(this.gridview.deserialize(t,{fromJSON:t=>{const{data:i}=t,n=this.options.createComponent({id:i.id,name:i.component});return e.push((()=>n.init({params:i.params,minimumWidth:i.minimumWidth,maximumWidth:i.maximumWidth,minimumHeight:i.minimumHeight,maximumHeight:i.maximumHeight,priority:i.priority,snap:!!i.snap,accessor:this,isVisible:t.visible}))),this._onDidAddGroup.fire(n),this.registerPanel(n),n}}),this.layout(n,o,!0),e.forEach((e=>e())),"string"==typeof i){const e=this.getPanel(i);e&&this.doSetGroupActive(e)}}catch(e){for(const e of this.groups)e.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e);throw this.clear(),e}this._onDidLayoutfromJSON.fire()}clear(){const e=this.activeGroup,t=Array.from(this._groups.values());for(const e of t)e.disposable.dispose(),this.doRemoveGroup(e.value,{skipActive:!0});e&&this.doSetGroupActive(void 0),this.gridview.clear()}movePanel(e,t){var i;let n;const o=this.gridview.remove(e),s=null===(i=this._groups.get(t.reference))||void 0===i?void 0:i.value;if(!s)throw new Error(`reference group ${t.reference} does not exist`);const r=Ce(t.direction);if("center"===r)throw new Error(`${r} not supported as an option`);{const e=ve(s.element);n=ue(this.gridview.orientation,e,r)}this.doAddGroup(o,n,t.size)}addPanel(e){var t,i,n,o;let s=null!==(t=e.location)&&void 0!==t?t:[0];if(null===(i=e.position)||void 0===i?void 0:i.referencePanel){const t=null===(n=this._groups.get(e.position.referencePanel))||void 0===n?void 0:n.value;if(!t)throw new Error(`reference group ${e.position.referencePanel} does not exist`);const i=Ce(e.position.direction);if("center"===i)throw new Error(`${i} not supported as an option`);{const e=ve(t.element);s=ue(this.gridview.orientation,e,i)}}const r=this.options.createComponent({id:e.id,name:e.component});return r.init({params:null!==(o=e.params)&&void 0!==o?o:{},minimumWidth:e.minimumWidth,maximumWidth:e.maximumWidth,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,priority:e.priority,snap:!!e.snap,accessor:this,isVisible:!0}),this.doAddGroup(r,s,e.size),this.registerPanel(r),this.doSetGroupActive(r),r}registerPanel(e){const t=new P(e.api.onDidFocusChange((t=>{t.isFocused&&this._groups.forEach((t=>{const i=t.value;i!==e?i.setActive(!1):i.setActive(!0)}))})));this._groups.set(e.id,{value:e,disposable:t})}moveGroup(e,t,i){const n=this.getPanel(t);if(!n)throw new Error("invalid operation");const o=ve(e.element),s=ue(this.gridview.orientation,o,i),[r,a]=U(s),d=ve(n.element),[h,l]=U(d);if($(h,r))return void this.gridview.moveView(h,l,a);const p=this.doRemoveGroup(n,{skipActive:!0,skipDispose:!0}),c=ve(e.element),v=ue(this.gridview.orientation,c,i);this.doAddGroup(p,v)}removeGroup(e){super.removeGroup(e)}dispose(){super.dispose(),this._onDidLayoutfromJSON.dispose()}}class Kt extends De{get panels(){return this.splitview.getViews()}get options(){return this._options}get length(){return this._panels.size}get orientation(){return this.splitview.orientation}get splitview(){return this._splitview}set splitview(e){this._splitview&&this._splitview.dispose(),this._splitview=e,this._splitviewChangeDisposable.value=new P(this._splitview.onDidSashEnd((()=>{this._onDidLayoutChange.fire(void 0)})),this._splitview.onDidAddView((e=>this._onDidAddView.fire(e))),this._splitview.onDidRemoveView((e=>this._onDidRemoveView.fire(e))))}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get height(){return this.splitview.orientation===ee.HORIZONTAL?this.splitview.orthogonalSize:this.splitview.size}get width(){return this.splitview.orientation===ee.HORIZONTAL?this.splitview.size:this.splitview.orthogonalSize}constructor(e,t){var i;super(document.createElement("div"),t.disableAutoResizing),this._splitviewChangeDisposable=new O,this._panels=new Map,this._onDidLayoutfromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidAddView=new A,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new A,this.onDidRemoveView=this._onDidRemoveView.event,this._onDidLayoutChange=new A,this.onDidLayoutChange=this._onDidLayoutChange.event,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new B(this.element),this._classNames.setClassNames(null!==(i=t.className)&&void 0!==i?i:""),e.appendChild(this.element),this._options=t,this.splitview=new oe(this.element,t),this.addDisposables(this._onDidAddView,this._onDidLayoutfromJSON,this._onDidRemoveView,this._onDidLayoutChange)}updateOptions(e){var t,i;"className"in e&&this._classNames.setClassNames(null!==(t=e.className)&&void 0!==t?t:""),"disableResizing"in e&&(this.disableResizing=null!==(i=e.disableAutoResizing)&&void 0!==i&&i),"string"==typeof e.orientation&&(this.splitview.orientation=e.orientation),this._options=Object.assign(Object.assign({},this.options),e),this.splitview.layout(this.splitview.size,this.splitview.orthogonalSize)}focus(){var e;null===(e=this._activePanel)||void 0===e||e.focus()}movePanel(e,t){this.splitview.moveView(e,t)}setVisible(e,t){const i=this.panels.indexOf(e);this.splitview.setViewVisible(i,t)}setActive(e,t){this._activePanel=e,this.panels.filter((t=>t!==e)).forEach((e=>{e.api._onDidActiveChange.fire({isActive:!1}),t||e.focus()})),e.api._onDidActiveChange.fire({isActive:!0}),t||e.focus()}removePanel(e,t){const i=this._panels.get(e.id);if(!i)throw new Error(`unknown splitview panel ${e.id}`);i.dispose(),this._panels.delete(e.id);const n=this.panels.findIndex((t=>t===e));this.splitview.removeView(n,t).dispose();const o=this.panels;o.length>0&&this.setActive(o[o.length-1])}getPanel(e){return this.panels.find((t=>t.id===e))}addPanel(e){var t;if(this._panels.has(e.id))throw new Error(`panel ${e.id} already exists`);const i=this.options.createComponent({id:e.id,name:e.component});i.orientation=this.splitview.orientation,i.init({params:null!==(t=e.params)&&void 0!==t?t:{},minimumSize:e.minimumSize,maximumSize:e.maximumSize,snap:e.snap,priority:e.priority,accessor:this});const n="number"==typeof e.size?e.size:ne.Distribute,o="number"==typeof e.index?e.index:void 0;return this.splitview.addView(i,n,o),this.doAddView(i),this.setActive(i),i}layout(e,t){const[i,n]=this.splitview.orientation===ee.HORIZONTAL?[e,t]:[t,e];this.splitview.layout(i,n)}doAddView(e){const t=e.api.onDidFocusChange((t=>{t.isFocused&&this.setActive(e,!0)}));this._panels.set(e.id,t)}toJSON(){var e;return{views:this.splitview.getViews().map(((e,t)=>({size:this.splitview.getViewSize(t),data:e.toJSON(),snap:!!e.snap,priority:e.priority}))),activeView:null===(e=this._activePanel)||void 0===e?void 0:e.id,size:this.splitview.size,orientation:this.splitview.orientation}}fromJSON(e){this.clear();const{views:t,orientation:i,size:n,activeView:o}=e,s=[],r=this.width,a=this.height;if(this.splitview=new oe(this.element,{orientation:i,proportionalLayout:this.options.proportionalLayout,descriptor:{size:n,views:t.map((e=>{const t=e.data;if(this._panels.has(t.id))throw new Error(`panel ${t.id} already exists`);const n=this.options.createComponent({id:t.id,name:t.component});return s.push((()=>{var i;n.init({params:null!==(i=t.params)&&void 0!==i?i:{},minimumSize:t.minimumSize,maximumSize:t.maximumSize,snap:e.snap,priority:e.priority,accessor:this})})),n.orientation=i,this.doAddView(n),setTimeout((()=>{this._onDidAddView.fire(n)}),0),{size:e.size,view:n}}))}}),this.layout(r,a),s.forEach((e=>e())),"string"==typeof o){const e=this.getPanel(o);e&&this.setActive(e)}this._onDidLayoutfromJSON.fire()}clear(){for(const e of this._panels.values())e.dispose();for(this._panels.clear();this.splitview.length>0;){this.splitview.removeView(0,ne.Distribute,!0).dispose()}}dispose(){for(const e of this._panels.values())e.dispose();this._panels.clear();const e=this.splitview.getViews();this._splitviewChangeDisposable.dispose(),this.splitview.dispose();for(const t of e)t.dispose();this.element.remove(),super.dispose()}}class Qt extends P{get element(){return this._element}constructor(){super(),this._expandedIcon=it({width:"11",height:"11",viewbox:"0 0 24 15",path:"M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z"}),this._collapsedIcon=nt(),this.disposable=new O,this.apiRef={api:null},this._element=document.createElement("div"),this.element.className="dv-default-header",this._content=document.createElement("span"),this._expander=document.createElement("div"),this._expander.className="dv-pane-header-icon",this.element.appendChild(this._expander),this.element.appendChild(this._content),this.addDisposables(k(this._element,"click",(()=>{var e;null===(e=this.apiRef.api)||void 0===e||e.setExpanded(!this.apiRef.api.isExpanded)})))}init(e){this.apiRef.api=e.api,this._content.textContent=e.title,this.updateIcon(),this.disposable.value=e.api.onDidExpansionChange((()=>{this.updateIcon()}))}updateIcon(){var e;const t=!!(null===(e=this.apiRef.api)||void 0===e?void 0:e.isExpanded);T(this._expander,"collapsed",!t),t?(this._expander.contains(this._collapsedIcon)&&this._collapsedIcon.remove(),this._expander.contains(this._expandedIcon)||this._expander.appendChild(this._expandedIcon)):(this._expander.contains(this._expandedIcon)&&this._expandedIcon.remove(),this._expander.contains(this._collapsedIcon)||this._expander.appendChild(this._collapsedIcon))}update(e){}dispose(){this.disposable.dispose(),super.dispose()}}const ei=q(),ti=Number.MAX_SAFE_INTEGER;class ii extends $e{constructor(e){super({accessor:e.accessor,id:e.id,component:e.component,headerComponent:e.headerComponent,orientation:e.orientation,isExpanded:e.isExpanded,disableDnd:e.disableDnd,headerSize:e.headerSize,minimumBodySize:e.minimumBodySize,maximumBodySize:e.maximumBodySize}),this.options=e}getBodyComponent(){return this.options.body}getHeaderComponent(){return this.options.header}}class ni extends De{get id(){return this._id}get panels(){return this.paneview.getPanes()}set paneview(e){this._paneview=e,this._disposable.value=new P(this._paneview.onDidChange((()=>{this._onDidLayoutChange.fire(void 0)})),this._paneview.onDidAddView((e=>this._onDidAddView.fire(e))),this._paneview.onDidRemoveView((e=>this._onDidRemoveView.fire(e))))}get paneview(){return this._paneview}get minimumSize(){return this.paneview.minimumSize}get maximumSize(){return this.paneview.maximumSize}get height(){return this.paneview.orientation===ee.HORIZONTAL?this.paneview.orthogonalSize:this.paneview.size}get width(){return this.paneview.orientation===ee.HORIZONTAL?this.paneview.size:this.paneview.orthogonalSize}get options(){return this._options}constructor(e,t){var i;super(document.createElement("div"),t.disableAutoResizing),this._id=ei.next(),this._disposable=new O,this._viewDisposables=new Map,this._onDidLayoutfromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidLayoutChange=new A,this.onDidLayoutChange=this._onDidLayoutChange.event,this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onDidAddView=new A,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new A,this.onDidRemoveView=this._onDidRemoveView.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.element.style.height="100%",this.element.style.width="100%",this.addDisposables(this._onDidLayoutChange,this._onDidLayoutfromJSON,this._onDidDrop,this._onDidAddView,this._onDidRemoveView,this._onUnhandledDragOverEvent),this._classNames=new B(this.element),this._classNames.setClassNames(null!==(i=t.className)&&void 0!==i?i:""),e.appendChild(this.element),this._options=t,this.paneview=new re(this.element,{orientation:ee.VERTICAL}),this.addDisposables(this._disposable)}setVisible(e,t){const i=this.panels.indexOf(e);this.paneview.setViewVisible(i,t)}focus(){}updateOptions(e){var t,i;"className"in e&&this._classNames.setClassNames(null!==(t=e.className)&&void 0!==t?t:""),"disableResizing"in e&&(this.disableResizing=null!==(i=e.disableAutoResizing)&&void 0!==i&&i),this._options=Object.assign(Object.assign({},this.options),e)}addPanel(e){var t,i;const n=this.options.createComponent({id:e.id,name:e.component});let o;e.headerComponent&&this.options.createHeaderComponent&&(o=this.options.createHeaderComponent({id:e.id,name:e.headerComponent})),o||(o=new Qt);const s=new ii({id:e.id,component:e.component,headerComponent:e.headerComponent,header:o,body:n,orientation:ee.VERTICAL,isExpanded:!!e.isExpanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=e.headerSize)&&void 0!==t?t:22,minimumBodySize:0,maximumBodySize:ti});this.doAddPanel(s);const r="number"==typeof e.size?e.size:ne.Distribute,a="number"==typeof e.index?e.index:void 0;return s.init({params:null!==(i=e.params)&&void 0!==i?i:{},minimumBodySize:e.minimumBodySize,maximumBodySize:e.maximumBodySize,isExpanded:e.isExpanded,title:e.title,containerApi:new Ae(this),accessor:this}),this.paneview.addPane(s,r,a),s.orientation=this.paneview.orientation,s}removePanel(e){const t=this.panels.findIndex((t=>t===e));this.paneview.removePane(t),this.doRemovePanel(e)}movePanel(e,t){this.paneview.moveView(e,t)}getPanel(e){return this.panels.find((t=>t.id===e))}layout(e,t){const[i,n]=this.paneview.orientation===ee.HORIZONTAL?[e,t]:[t,e];this.paneview.layout(i,n)}toJSON(){const e=e=>e===Number.MAX_SAFE_INTEGER||e===Number.POSITIVE_INFINITY?void 0:e;return{views:this.paneview.getPanes().map(((t,i)=>{return{size:this.paneview.getViewSize(i),data:t.toJSON(),minimumSize:(n=t.minimumBodySize,n<=0?void 0:n),maximumSize:e(t.maximumBodySize),headerSize:t.headerSize,expanded:t.isExpanded()};var n})),size:this.paneview.size}}fromJSON(e){this.clear();const{views:t,size:i}=e,n=[],o=this.width,s=this.height;this.paneview=new re(this.element,{orientation:ee.VERTICAL,descriptor:{size:i,views:t.map((e=>{var t,i,o;const s=e.data,r=this.options.createComponent({id:s.id,name:s.component});let a;s.headerComponent&&this.options.createHeaderComponent&&(a=this.options.createHeaderComponent({id:s.id,name:s.headerComponent})),a||(a=new Qt);const d=new ii({id:s.id,component:s.component,headerComponent:s.headerComponent,header:a,body:r,orientation:ee.VERTICAL,isExpanded:!!e.expanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=e.headerSize)&&void 0!==t?t:22,minimumBodySize:null!==(i=e.minimumSize)&&void 0!==i?i:0,maximumBodySize:null!==(o=e.maximumSize)&&void 0!==o?o:ti});return this.doAddPanel(d),n.push((()=>{var t;d.init({params:null!==(t=s.params)&&void 0!==t?t:{},minimumBodySize:e.minimumSize,maximumBodySize:e.maximumSize,title:s.title,isExpanded:!!e.expanded,containerApi:new Ae(this),accessor:this}),d.orientation=this.paneview.orientation})),setTimeout((()=>{this._onDidAddView.fire(d)}),0),{size:e.size,view:d}}))}}),this.layout(o,s),n.forEach((e=>e())),this._onDidLayoutfromJSON.fire()}clear(){for(const[e,t]of this._viewDisposables.entries())t.dispose();this._viewDisposables.clear(),this.paneview.dispose()}doAddPanel(e){const t=new P(e.onDidDrop((e=>{this._onDidDrop.fire(e)})),e.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})));this._viewDisposables.set(e.id,t)}doRemovePanel(e){const t=this._viewDisposables.get(e.id);t&&(t.dispose(),this._viewDisposables.delete(e.id))}dispose(){super.dispose();for(const[e,t]of this._viewDisposables.entries())t.dispose();this._viewDisposables.clear(),this.element.remove(),this.paneview.dispose()}}class oi extends Be{get priority(){return this._priority}set orientation(e){this._orientation=e}get orientation(){return this._orientation}get minimumSize(){const e="function"==typeof this._minimumSize?this._minimumSize():this._minimumSize;return e!==this._evaluatedMinimumSize&&(this._evaluatedMinimumSize=e,this.updateConstraints()),e}get maximumSize(){const e="function"==typeof this._maximumSize?this._maximumSize():this._maximumSize;return e!==this._evaluatedMaximumSize&&(this._evaluatedMaximumSize=e,this.updateConstraints()),e}get snap(){return this._snap}constructor(e,t){super(e,t,new je(e,t)),this._evaluatedMinimumSize=0,this._evaluatedMaximumSize=Number.POSITIVE_INFINITY,this._minimumSize=0,this._maximumSize=Number.POSITIVE_INFINITY,this._snap=!1,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this.api.initialize(this),this.addDisposables(this._onDidChange,this.api.onWillVisibilityChange((e=>{const{isVisible:t}=e,{accessor:i}=this._params;i.setVisible(this,t)})),this.api.onActiveChange((()=>{const{accessor:e}=this._params;e.setActive(this)})),this.api.onDidConstraintsChangeInternal((e=>{"number"!=typeof e.minimumSize&&"function"!=typeof e.minimumSize||(this._minimumSize=e.minimumSize),"number"!=typeof e.maximumSize&&"function"!=typeof e.maximumSize||(this._maximumSize=e.maximumSize),this.updateConstraints()})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({size:e.size})})))}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}layout(e,t){const[i,n]=this.orientation===ee.HORIZONTAL?[e,t]:[t,e];super.layout(i,n)}init(e){super.init(e),this._priority=e.priority,e.minimumSize&&(this._minimumSize=e.minimumSize),e.maximumSize&&(this._maximumSize=e.maximumSize),e.snap&&(this._snap=e.snap)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{minimumSize:(e=this.minimumSize,e<=0?void 0:e),maximumSize:(e=>e===Number.MAX_SAFE_INTEGER||e===Number.POSITIVE_INFINITY?void 0:e)(this.maximumSize)});var e}updateConstraints(){this.api._onDidConstraintsChange.fire({maximumSize:this._evaluatedMaximumSize,minimumSize:this._evaluatedMinimumSize})}}function si(e,t){return new Xt(e,t).api}function ri(e,t){const i=new Kt(e,t);return new Se(i)}function ai(e,t){const i=new qt(e,t);return new ke(i)}function di(e,t){const i=new ni(e,t);return new Ae(i)}var hi=function(e,t){return hi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},hi(e,t)};function li(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}hi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function pi(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}function ci(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function vi(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((n=n.apply(e,t||[])).next())}))}function ui(e,t){var i,n,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(d){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(i=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=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++,n=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],n=0}finally{i=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function mi(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function gi(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,o,s=i.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)r.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return r}function bi(e,t,i){if(i||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function fi(e){return this instanceof fi?(this.v=e,this):new fi(e)}function wi(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=i.apply(e,t||[]),s=[];return n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n;function r(e){o[e]&&(n[e]=function(t){return new Promise((function(i,n){s.push([e,t,i,n])>1||a(e,t)}))})}function a(e,t){try{(i=o[e](t)).value instanceof fi?Promise.resolve(i.value.v).then(d,h):l(s[0][2],i)}catch(e){l(s[0][3],e)}var i}function d(e){a("next",e)}function h(e){a("throw",e)}function l(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function _i(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=mi(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,o){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,o,(t=e[i](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;class yi{constructor(e){this.options=e,this.componentRef=null,this._element=null}get element(){if(!this._element)throw new Error("Angular renderer not initialized");return this._element}init(e){this.render(e)}update(e){this.componentRef&&(Object.keys(e).forEach((t=>{this.componentRef.instance.hasOwnProperty(t)&&(this.componentRef.instance[t]=e[t])})),this.componentRef.changeDetectorRef.detectChanges())}render(t){try{this.componentRef=e(this.options.component,{environmentInjector:this.options.environmentInjector||this.options.injector,elementInjector:this.options.injector}),Object.keys(t).forEach((e=>{this.componentRef.instance.hasOwnProperty(e)&&(this.componentRef.instance[e]=t[e])}));const i=this.componentRef.hostView;this._element=i.rootNodes[0],this.componentRef.changeDetectorRef.detectChanges()}catch(e){throw console.error("Error creating Angular component:",e),e}}dispose(){this.componentRef&&(this.componentRef.destroy(),this.componentRef=null),this._element=null}}class Di extends mt{constructor(e,t,i,n,o){super(e,t),this.angularComponent=i,this.injector=n,this.environmentInjector=o}getComponent(){return new yi({component:this.angularComponent,injector:this.injector,environmentInjector:this.environmentInjector})}}class xi extends oi{constructor(e,t,i,n,o){super(e,t),this.angularComponent=i,this.injector=n,this.environmentInjector=o}getComponent(){return new yi({component:this.angularComponent,injector:this.injector,environmentInjector:this.environmentInjector})}}class Ci{constructor(e,t,i){this.angularComponent=e,this.injector=t,this.environmentInjector=i,this.renderer=new yi({component:this.angularComponent,injector:this.injector,environmentInjector:this.environmentInjector})}get element(){return this.renderer.element}init(e){this.renderer.init(e)}update(e){this.renderer.update(e)}dispose(){this.renderer.dispose()}}class zi{constructor(e,t,i,n,o,s,r){this.components=e,this.injector=t,this.environmentInjector=i,this.tabComponents=n,this.watermarkComponent=o,this.headerActionsComponents=s,this.defaultTabComponent=r}createDockviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);const i=new yi({component:t,injector:this.injector,environmentInjector:this.environmentInjector});return i.init(e),i}createGridviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);return new Di(e.id,e.name,t,this.injector,this.environmentInjector)}createSplitviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);return new xi(e.id,e.name,t,this.injector,this.environmentInjector)}createPaneviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);return new Ci(t,this.injector,this.environmentInjector)}createComponent(e){return this.createDockviewComponent(e)}createTabComponent(e){let t=this.tabComponents?.[e.name];if(!t&&this.defaultTabComponent&&(t=this.defaultTabComponent),!t)return;const i=new yi({component:t,injector:this.injector,environmentInjector:this.environmentInjector});return i.init(e),i}createWatermarkComponent(){if(!this.watermarkComponent)throw new Error("Watermark component not provided");const e=new yi({component:this.watermarkComponent,injector:this.injector,environmentInjector:this.environmentInjector});return e.init({}),e}createHeaderActionsComponent(e){const t=this.headerActionsComponents?.[e];if(!t)return;const i=new yi({component:t,injector:this.injector,environmentInjector:this.environmentInjector});return i.init({}),i}}function Si(e){return"function"==typeof e}function Ai(e){return function(t){if(function(e){return Si(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var ki=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};var Ei,Pi=((Ei=function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}((function(e){Error.call(e),e.stack=(new Error).stack}))).prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei);function Oi(e,t){if(e){var i=e.indexOf(t);0<=i&&e.splice(i,1)}}var Ii=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,i,n,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var r=mi(s),a=r.next();!a.done;a=r.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}else s.remove(this);var d=this.initialTeardown;if(Si(d))try{d()}catch(e){o=e instanceof Pi?e.errors:[e]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=mi(h),p=l.next();!p.done;p=l.next()){var c=p.value;try{Vi(c)}catch(e){o=null!=o?o:[],e instanceof Pi?o=bi(bi([],gi(o)),gi(e.errors)):o.push(e)}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}}if(o)throw new Pi(o)}},e.prototype.add=function(t){var i;if(t&&t!==this)if(this.closed)Vi(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Oi(t,e)},e.prototype.remove=function(t){var i=this._finalizers;i&&Oi(i,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function Gi(e){return e instanceof Ii||e&&"closed"in e&&Si(e.remove)&&Si(e.add)&&Si(e.unsubscribe)}function Vi(e){Si(e)?e():e.unsubscribe()}Ii.EMPTY;var Ni={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ti={setTimeout:function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return setTimeout.apply(void 0,bi([e,t],gi(i)))},clearTimeout:function(e){var t=Ti.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Li(e){Ti.setTimeout((function(){throw e}))}function Ri(){}var Mi=function(e){function t(t){var i=e.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Gi(t)&&t.add(i)):i.destination=Ui,i}return li(t,e),t.create=function(e,t,i){return new Fi(e,t,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ii),Wi=Function.prototype.bind;function Hi(e,t){return Wi.call(e,t)}var ji=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Bi(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Bi(e)}else Bi(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Bi(e)}},e}(),Fi=function(e){function t(t,i,n){var o,s,r=e.call(this)||this;Si(t)||!t?o={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=n?n:void 0}:r&&Ni.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return r.unsubscribe()},o={next:t.next&&Hi(t.next,s),error:t.error&&Hi(t.error,s),complete:t.complete&&Hi(t.complete,s)}):o=t;return r.destination=new ji(o),r}return li(t,e),t}(Mi);function Bi(e){Li(e)}var Ui={closed:!0,next:Ri,error:function(e){throw e},complete:Ri},$i="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ji(e){return e}var Zi=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var i=new e;return i.source=this,i.operator=t,i},e.prototype.subscribe=function(e,t,i){var n,o=this,s=(n=e)&&n instanceof Mi||function(e){return e&&Si(e.next)&&Si(e.error)&&Si(e.complete)}(n)&&Gi(n)?e:new Fi(e,t,i);return function(){var e=o,t=e.operator,i=e.source;s.add(t?t.call(s,i):i?o._subscribe(s):o._trySubscribe(s))}(),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var i=this;return new(t=Yi(t))((function(t,n){var o=new Fi({next:function(t){try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});i.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[$i]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return(0===(e=t).length?Ji:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Yi(e))((function(e,i){var n;t.subscribe((function(e){return n=e}),(function(e){return i(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Yi(e){var t;return null!==(t=null!=e?e:Ni.Promise)&&void 0!==t?t:Promise}var Xi="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function qi(e){if(e instanceof Zi)return e;if(null!=e){if(function(e){return Si(e[$i])}(e))return s=e,new Zi((function(e){var t=s[$i]();if(Si(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(ki(e))return o=e,new Zi((function(e){for(var t=0;t<o.length&&!e.closed;t++)e.next(o[t]);e.complete()}));if(Si(null==(n=e)?void 0:n.then))return i=e,new Zi((function(e){i.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Li)}));if(function(e){return Symbol.asyncIterator&&Si(null==e?void 0:e[Symbol.asyncIterator])}(e))return Ki(e);if(function(e){return Si(null==e?void 0:e[Xi])}(e))return t=e,new Zi((function(e){var i,n;try{for(var o=mi(t),s=o.next();!s.done;s=o.next()){var r=s.value;if(e.next(r),e.closed)return}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}e.complete()}));if(function(e){return Si(null==e?void 0:e.getReader)}(e))return Ki(function(e){return wi(this,arguments,(function(){var t,i,n;return ui(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,fi(t.read())];case 3:return i=o.sent(),n=i.value,i.done?[4,fi(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,fi(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,i,n,o,s;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function Ki(e){return new Zi((function(t){(function(e,t){var i,n,o,s;return vi(this,void 0,void 0,(function(){var r,a;return ui(this,(function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),i=_i(e),d.label=1;case 1:return[4,i.next()];case 2:if((n=d.sent()).done)return[3,4];if(r=n.value,t.next(r),t.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=d.sent(),o={error:a},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=i.return)?[4,s.call(i)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}var Qi=function(e){function t(t,i,n,o,s,r){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=r,a._next=i?function(e){try{i(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=o?function(e){try{o(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return li(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(Mi);function en(e){return Ai((function(t,i){var n,o;qi(e).subscribe(new Qi(i,(function(){return i.complete()}),Ri,n,o)),!i.closed&&t.subscribe(i)}))}class tn{constructor(){this._isDisposed=!1,this.disposeCallbacks=[]}get isDisposed(){return this._isDisposed}addDisposeCallback(e){this._isDisposed?e():this.disposeCallbacks.push(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this.disposeCallbacks.forEach((e=>{try{e()}catch(e){console.error("Error in dispose callback:",e)}})),this.disposeCallbacks=[])}}class nn{constructor(){this.destroySubject=new u,this.disposables=[]}get destroy$(){return this.destroySubject.asObservable()}addDisposable(e){this.disposables.push(e)}takeUntilDestroy(){return en(this.destroySubject)}destroy(){this.destroySubject.next(),this.destroySubject.complete(),this.disposables.forEach((e=>{try{e.dispose()}catch(e){console.error("Error disposing resource:",e)}})),this.disposables=[]}}function on(e){const t=new tn;return e&&t.addDisposeCallback(e),t}let sn=class{constructor(){this.ready=new r,this.didDrop=new r,this.willDrop=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializeDockview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.dockviewApi&&this.dockviewApi.dispose()}ngOnChanges(e){if(this.dockviewApi){const t={};let i=!1;rt.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.dockviewApi.updateOptions(t)}}getDockviewApi(){return this.dockviewApi}initializeDockview(){if(!this.components)throw new Error("DockviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.dockviewApi=si(this.containerRef.nativeElement,{...e,...t}),this.setupEventListeners(),this.ready.emit({api:this.dockviewApi})}extractCoreOptions(){const e={};return rt.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e={};this.leftHeaderActionsComponent&&(e.left=this.leftHeaderActionsComponent),this.rightHeaderActionsComponent&&(e.right=this.rightHeaderActionsComponent),this.prefixHeaderActionsComponent&&(e.prefix=this.prefixHeaderActionsComponent);const t=new zi(this.components,this.injector,this.environmentInjector,this.tabComponents,this.watermarkComponent,e,this.defaultTabComponent);return{createComponent:e=>t.createDockviewComponent(e),createTabComponent:e=>t.createTabComponent(e),createWatermarkComponent:this.watermarkComponent?()=>t.createWatermarkComponent():void 0,createLeftHeaderActionComponent:this.leftHeaderActionsComponent?e=>t.createHeaderActionsComponent("left"):void 0,createRightHeaderActionComponent:this.rightHeaderActionsComponent?e=>t.createHeaderActionsComponent("right"):void 0,createPrefixHeaderActionComponent:this.prefixHeaderActionsComponent?e=>t.createHeaderActionsComponent("prefix"):void 0}}setupEventListeners(){if(!this.dockviewApi)return;const e=this.dockviewApi;if(this.didDrop.observers.length>0){const t=e.onDidDrop((e=>{this.didDrop.emit(e)}));this.lifecycleManager.addDisposable(t)}if(this.willDrop.observers.length>0){const t=e.onWillDrop((e=>{this.willDrop.emit(e)}));this.lifecycleManager.addDisposable(t)}}};pi([t("dockviewContainer",{static:!0}),ci("design:type",l)],sn.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],sn.prototype,"components",void 0),pi([i(),ci("design:type",Object)],sn.prototype,"tabComponents",void 0),pi([i(),ci("design:type",p)],sn.prototype,"watermarkComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"defaultTabComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"leftHeaderActionsComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"rightHeaderActionsComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"prefixHeaderActionsComponent",void 0),pi([i(),ci("design:type",String)],sn.prototype,"className",void 0),pi([i(),ci("design:type",String)],sn.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"hideBorders",void 0),pi([i(),ci("design:type",String)],sn.prototype,"rootOverlayModel",void 0),pi([i(),ci("design:type",String)],sn.prototype,"defaultTabComponent_",void 0),pi([i(),ci("design:type",Number)],sn.prototype,"tabHeight",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"disableFloatingGroups",void 0),pi([i(),ci("design:type",String)],sn.prototype,"floatingGroupBounds",void 0),pi([i(),ci("design:type",String)],sn.prototype,"popoutUrl",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"locked",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"disableAutoResizing",void 0),pi([i(),ci("design:type",String)],sn.prototype,"singleTabMode",void 0),pi([n(),ci("design:type",Object)],sn.prototype,"ready",void 0),pi([n(),ci("design:type",Object)],sn.prototype,"didDrop",void 0),pi([n(),ci("design:type",Object)],sn.prototype,"willDrop",void 0),sn=pi([o({selector:"dv-dockview",template:'<div #dockviewContainer class="dockview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n \n .dockview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],sn);let rn=class{constructor(){this.ready=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializeGridview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.gridviewApi&&this.gridviewApi.dispose()}ngOnChanges(e){if(this.gridviewApi){const t={};let i=!1;ye.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.gridviewApi.updateOptions(t)}}getGridviewApi(){return this.gridviewApi}initializeGridview(){if(!this.components)throw new Error("GridviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.gridviewApi=ai(this.containerRef.nativeElement,{...e,...t}),this.ready.emit({api:this.gridviewApi})}extractCoreOptions(){const e={};return ye.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e=new zi(this.components,this.injector,this.environmentInjector);return{createComponent:t=>e.createGridviewComponent(t)}}};pi([t("gridviewContainer",{static:!0}),ci("design:type",l)],rn.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],rn.prototype,"components",void 0),pi([i(),ci("design:type",String)],rn.prototype,"className",void 0),pi([i(),ci("design:type",String)],rn.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"proportionalLayout",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"hideBorders",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"disableAutoResizing",void 0),pi([n(),ci("design:type",Object)],rn.prototype,"ready",void 0),rn=pi([o({selector:"dv-gridview",template:'<div #gridviewContainer class="gridview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n \n .gridview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],rn);let an=class{constructor(){this.ready=new r,this.drop=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializePaneview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.paneviewApi&&this.paneviewApi.dispose()}ngOnChanges(e){if(this.paneviewApi){const t={};let i=!1;Re.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.paneviewApi.updateOptions(t)}}getPaneviewApi(){return this.paneviewApi}initializePaneview(){if(!this.components)throw new Error("PaneviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.paneviewApi=di(this.containerRef.nativeElement,{...e,...t}),this.setupEventListeners(),this.ready.emit({api:this.paneviewApi})}extractCoreOptions(){const e={};return Re.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e=new zi(this.components,this.injector,this.environmentInjector,this.headerComponents);return{createComponent:t=>e.createPaneviewComponent(t),createHeaderComponent:this.headerComponents?e=>new Ci(this.headerComponents[e.name],this.injector,this.environmentInjector):void 0}}setupEventListeners(){if(!this.paneviewApi)return;const e=this.paneviewApi;if(this.drop.observers.length>0){const t=e.onDidDrop((e=>{this.drop.emit(e)}));this.lifecycleManager.addDisposable(t)}}};pi([t("paneviewContainer",{static:!0}),ci("design:type",l)],an.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],an.prototype,"components",void 0),pi([i(),ci("design:type",Object)],an.prototype,"headerComponents",void 0),pi([i(),ci("design:type",String)],an.prototype,"className",void 0),pi([i(),ci("design:type",String)],an.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],an.prototype,"hideBorders",void 0),pi([i(),ci("design:type",Boolean)],an.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],an.prototype,"disableAutoResizing",void 0),pi([n(),ci("design:type",Object)],an.prototype,"ready",void 0),pi([n(),ci("design:type",Object)],an.prototype,"drop",void 0),an=pi([o({selector:"dv-paneview",template:'<div #paneviewContainer class="paneview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n \n .paneview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],an);let dn=class{constructor(){this.ready=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializeSplitview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.splitviewApi&&this.splitviewApi.dispose()}ngOnChanges(e){if(this.splitviewApi){const t={};let i=!1;se.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.splitviewApi.updateOptions(t)}}getSplitviewApi(){return this.splitviewApi}initializeSplitview(){if(!this.components)throw new Error("SplitviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.splitviewApi=ri(this.containerRef.nativeElement,{...e,...t}),this.ready.emit({api:this.splitviewApi})}extractCoreOptions(){const e={};return se.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e=new zi(this.components,this.injector,this.environmentInjector);return{createComponent:t=>e.createSplitviewComponent(t)}}};pi([t("splitviewContainer",{static:!0}),ci("design:type",l)],dn.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],dn.prototype,"components",void 0),pi([i(),ci("design:type",String)],dn.prototype,"className",void 0),pi([i(),ci("design:type",String)],dn.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"proportionalLayout",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"hideBorders",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"disableAutoResizing",void 0),pi([n(),ci("design:type",Object)],dn.prototype,"ready",void 0),dn=pi([o({selector:"dv-splitview",template:'<div #splitviewContainer class="splitview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n \n .splitview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],dn);let hn=class{};hn=pi([c({declarations:[sn,rn,an,dn],imports:[v],exports:[sn,rn,an,dn]})],hn);export{tn as AngularDisposable,zi as AngularFrameworkComponentFactory,nn as AngularLifecycleManager,yi as AngularRenderer,ze as BaseGrid,Je as ContentContainer,Ot as DefaultDockviewDeserialzier,Et as DefaultTab,sn as DockviewAngularComponent,hn as DockviewAngularModule,Ee as DockviewApi,Xt as DockviewComponent,P as DockviewCompositeDisposable,pt as DockviewDidDropEvent,g as DockviewDisposable,A as DockviewEmitter,m as DockviewEvent,ft as DockviewGroupPanel,vt as DockviewGroupPanelModel,O as DockviewMutableDisposable,kt as DockviewPanel,st as DockviewUnhandledDragOverEvent,ct as DockviewWillDropEvent,$e as DraggablePaneviewPanel,_e as Gridview,rn as GridviewAngularComponent,ke as GridviewApi,qt as GridviewComponent,mt as GridviewPanel,ie as LayoutPriority,ee as Orientation,rt as PROPERTY_KEYS_DOCKVIEW,ye as PROPERTY_KEYS_GRIDVIEW,Re as PROPERTY_KEYS_PANEVIEW,se as PROPERTY_KEYS_SPLITVIEW,ii as PaneFramework,w as PaneTransfer,f as PanelTransfer,re as Paneview,an as PaneviewAngularComponent,Ae as PaneviewApi,ni as PaneviewComponent,Ue as PaneviewPanel,Me as PaneviewUnhandledDragOverEvent,te as SashState,ne as Sizing,oe as Splitview,dn as SplitviewAngularComponent,Se as SplitviewApi,Kt as SplitviewComponent,oi as SplitviewPanel,Xe as Tab,on as createAngularDisposable,si as createDockview,ai as createGridview,di as createPaneview,ri as createSplitview,Ge as directionToPosition,me as getDirectionOrientation,ve as getGridLocation,ge as getLocationOrientation,D as getPaneData,y as getPanelData,ue as getRelativeLocation,ce as indexInParent,fe as isGridBranchNode,lt as isGroupOptionsWithGroup,ht as isGroupOptionsWithPanel,dt as isPanelOptionsWithGroup,at as isPanelOptionsWithPanel,be as orthogonal,Ve as positionToDirection,Dt as themeAbyss,zt as themeAbyssSpaced,wt as themeDark,xt as themeDracula,_t as themeLight,St as themeLightSpaced,Ct as themeReplit,yt as themeVisualStudio,Ce as toTarget};
|
|
7
|
+
import{createComponent as e,ViewChild as t,Input as i,Output as n,Component as o,ChangeDetectionStrategy as s,EventEmitter as r,inject as a,Injector as d,EnvironmentInjector as h,ElementRef as l,Type as p,NgModule as c}from"@angular/core";import{CommonModule as v}from"@angular/common";import{Subject as u}from"rxjs";var m,g;!function(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===i&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.dv-scrollable {\n position: relative;\n overflow: hidden;\n}\n.dv-scrollable .dv-scrollbar-horizontal {\n position: absolute;\n bottom: 0px;\n left: 0px;\n height: 4px;\n border-radius: 2px;\n background-color: transparent;\n /* GPU optimizations */\n will-change: background-color, transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n transition-property: background-color;\n transition-timing-function: ease-in-out;\n transition-duration: 1s;\n transition-delay: 0s;\n}\n.dv-scrollable:hover .dv-scrollbar-horizontal, .dv-scrollable.dv-scrollable-resizing .dv-scrollbar-horizontal, .dv-scrollable.dv-scrollable-scrolling .dv-scrollbar-horizontal {\n background-color: var(--dv-scrollbar-background-color, rgba(255, 255, 255, 0.25));\n}\n.dv-svg {\n display: inline-block;\n fill: currentcolor;\n line-height: 1;\n stroke: currentcolor;\n stroke-width: 0;\n}\n.dockview-theme-dark {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n}\n.dockview-theme-dark .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n\n.dockview-theme-light {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: white;\n --dv-tabs-and-actions-container-background-color: #f3f3f3;\n --dv-activegroup-visiblepanel-tab-background-color: white;\n --dv-activegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-inactivegroup-visiblepanel-tab-background-color: white;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #ececec;\n --dv-tab-divider-color: white;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(51, 51, 51, 0.7);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(51, 51, 51, 0.35);\n --dv-separator-border: rgba(128, 128, 128, 0.35);\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-scrollbar-background-color: rgba(0, 0, 0, 0.25);\n}\n.dockview-theme-light .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n\n.dockview-theme-vs {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: #1e1e1e;\n --dv-tabs-and-actions-container-background-color: #252526;\n --dv-activegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-activegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-inactivegroup-visiblepanel-tab-background-color: #1e1e1e;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #2d2d2d;\n --dv-tab-divider-color: #1e1e1e;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: #969696;\n --dv-inactivegroup-visiblepanel-tab-color: #8f8f8f;\n --dv-inactivegroup-hiddenpanel-tab-color: #626262;\n --dv-separator-border: rgb(68, 68, 68);\n --dv-paneview-header-border-color: rgba(204, 204, 204, 0.2);\n --dv-tabs-and-actions-container-background-color: #2d2d30;\n --dv-tabs-and-actions-container-height: 20px;\n --dv-tabs-and-actions-container-font-size: 11px;\n --dv-activegroup-visiblepanel-tab-background-color: #007acc;\n --dv-inactivegroup-visiblepanel-tab-background-color: #3f3f46;\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: white;\n --dv-inactivegroup-visiblepanel-tab-color: white;\n --dv-inactivegroup-hiddenpanel-tab-color: white;\n}\n.dockview-theme-vs .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n.dockview-theme-vs .dv-groupview.dv-active-group > .dv-tabs-and-actions-container {\n box-sizing: content-box;\n border-bottom: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tab.dv-active-tab {\n border-top: 2px solid var(--dv-activegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tab.dv-inactive-tab {\n border-top: 2px solid var(--dv-activegroup-hiddenpanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container {\n box-sizing: content-box;\n border-bottom: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tab.dv-active-tab {\n border-top: 2px solid var(--dv-inactivegroup-visiblepanel-tab-background-color);\n}\n.dockview-theme-vs .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tab.dv-inactive-tab {\n border-top: 2px solid var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n}\n\n.dockview-theme-abyss {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-color-abyss-dark: #000c18;\n --dv-color-abyss: #10192c;\n --dv-color-abyss-light: #1c1c2a;\n --dv-color-abyss-lighter: #2b2b4a;\n --dv-color-abyss-accent: rgb(91, 30, 207);\n --dv-color-abyss-primary-text: white;\n --dv-color-abyss-secondary-text: rgb(148, 151, 169);\n --dv-group-view-background-color: var(--dv-color-abyss-dark);\n --dv-tabs-and-actions-container-background-color: var(\n --dv-color-abyss-light\n );\n --dv-activegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-dark\n );\n --dv-activegroup-hiddenpanel-tab-background-color: var(--dv-color-abyss);\n --dv-inactivegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-dark\n );\n --dv-inactivegroup-hiddenpanel-tab-background-color: var(--dv-color-abyss);\n --dv-tab-divider-color: var(--dv-color-abyss-lighter);\n --dv-activegroup-visiblepanel-tab-color: white;\n --dv-activegroup-hiddenpanel-tab-color: rgba(255, 255, 255, 0.5);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(255, 255, 255, 0.5);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(255, 255, 255, 0.25);\n --dv-separator-border: var(--dv-color-abyss-lighter);\n --dv-paneview-header-border-color: var(--dv-color-abyss-lighter);\n --dv-paneview-active-outline-color: #596f99;\n}\n.dockview-theme-abyss .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n\n.dockview-theme-dracula {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-group-view-background-color: #282a36;\n --dv-tabs-and-actions-container-background-color: #191a21;\n --dv-activegroup-visiblepanel-tab-background-color: #282a36;\n --dv-activegroup-hiddenpanel-tab-background-color: #21222c;\n --dv-inactivegroup-visiblepanel-tab-background-color: #282a36;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #21222c;\n --dv-tab-divider-color: #191a21;\n --dv-activegroup-visiblepanel-tab-color: rgb(248, 248, 242);\n --dv-activegroup-hiddenpanel-tab-color: rgb(98, 114, 164);\n --dv-inactivegroup-visiblepanel-tab-color: rgba(248, 248, 242, 0.5);\n --dv-inactivegroup-hiddenpanel-tab-color: rgba(98, 114, 164, 0.5);\n --dv-separator-border: #bd93f9;\n --dv-paneview-header-border-color: #bd93f9;\n --dv-paneview-active-outline-color: #6272a4;\n}\n.dockview-theme-dracula .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n position: relative;\n}\n.dockview-theme-dracula .dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab::after {\n position: absolute;\n left: 0px;\n top: 0px;\n content: "";\n width: 100%;\n height: 1px;\n background-color: #94527e;\n z-index: 999;\n}\n.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n position: relative;\n}\n.dockview-theme-dracula .dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab::after {\n position: absolute;\n left: 0px;\n bottom: 0px;\n content: "";\n width: 100%;\n height: 1px;\n background-color: #5e3d5a;\n z-index: 999;\n}\n\n.dockview-theme-replit {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n box-sizing: border-box;\n padding: 10px;\n background-color: #ebeced;\n --dv-group-view-background-color: #ebeced;\n --dv-tabs-and-actions-container-background-color: #fcfcfc;\n --dv-activegroup-visiblepanel-tab-background-color: #f0f1f2;\n --dv-activegroup-hiddenpanel-tab-background-color: #fcfcfc;\n --dv-inactivegroup-visiblepanel-tab-background-color: #f0f1f2;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #fcfcfc;\n --dv-tab-divider-color: transparent;\n --dv-activegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-activegroup-hiddenpanel-tab-color: rgb(51, 51, 51);\n --dv-inactivegroup-visiblepanel-tab-color: rgb(51, 51, 51);\n --dv-inactivegroup-hiddenpanel-tab-color: rgb(51, 51, 51);\n --dv-separator-border: transparent;\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-sash-color: #cfd1d3;\n --dv-active-sash-color: #babbbb;\n}\n.dockview-theme-replit .dv-drop-target-container .dv-drop-target-anchor.dv-drop-target-anchor-container-changed {\n opacity: 0;\n transition: none;\n}\n.dockview-theme-replit .dv-resize-container:has(> .dv-groupview) {\n border-radius: 8px;\n}\n.dockview-theme-replit .dv-resize-container {\n border-radius: 10px !important;\n border: none;\n}\n.dockview-theme-replit .dv-groupview {\n overflow: hidden;\n border-radius: 10px;\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container {\n border-bottom: 1px solid rgba(128, 128, 128, 0.35);\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container .dv-tab {\n margin: 4px;\n border-radius: 8px;\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container .dv-tab .dv-svg {\n height: 8px;\n width: 8px;\n}\n.dockview-theme-replit .dv-groupview .dv-tabs-and-actions-container .dv-tab:hover {\n background-color: #e4e5e6 !important;\n}\n.dockview-theme-replit .dv-groupview .dv-content-container {\n background-color: #fcfcfc;\n}\n.dockview-theme-replit .dv-groupview.dv-active-group {\n border: 1px solid rgba(128, 128, 128, 0.35);\n}\n.dockview-theme-replit .dv-groupview.dv-inactive-group {\n border: 1px solid transparent;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled)::after {\n content: "";\n height: 4px;\n width: 40px;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: var(--dv-sash-color);\n position: absolute;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):hover, .dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):active {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):hover::after, .dockview-theme-replit .dv-vertical > .dv-sash-container > .dv-sash:not(.disabled):active::after {\n background-color: var(--dv-active-sash-color);\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled)::after {\n content: "";\n height: 40px;\n width: 4px;\n border-radius: 2px;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background-color: var(--dv-sash-color);\n position: absolute;\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):hover, .dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):active {\n background-color: transparent;\n}\n.dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):hover::after, .dockview-theme-replit .dv-horizontal > .dv-sash-container > .dv-sash:not(.disabled):active::after {\n background-color: var(--dv-active-sash-color);\n}\n\n.dockview-theme-abyss-spaced {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-tab-font-size: 12px;\n --dv-border-radius: 20px;\n --dv-tab-margin: 0.5rem 0.25rem;\n --dv-tabs-and-actions-container-height: 44px;\n --dv-border-radius: 20px;\n box-sizing: border-box;\n --dv-color-abyss-dark: rgb(11, 6, 17);\n --dv-color-abyss: #16121f;\n --dv-color-abyss-light: #201d2b;\n --dv-color-abyss-lighter: #2a2837;\n --dv-color-abyss-accent: rgb(91, 30, 207);\n --dv-color-abyss-primary-text: white;\n --dv-color-abyss-secondary-text: rgb(148, 151, 169);\n --dv-drag-over-border: 2px solid var(--dv-color-abyss-accent);\n --dv-drag-over-background-color: "";\n --dv-group-view-background-color: var(--dv-color-abyss-dark);\n --dv-tabs-and-actions-container-background-color: var(--dv-color-abyss);\n --dv-activegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-lighter\n );\n --dv-activegroup-hiddenpanel-tab-background-color: var(\n --dv-color-abyss-light\n );\n --dv-inactivegroup-visiblepanel-tab-background-color: var(\n --dv-color-abyss-lighter\n );\n --dv-inactivegroup-hiddenpanel-tab-background-color: var(\n --dv-color-abyss-light\n );\n --dv-tab-divider-color: transparent;\n --dv-activegroup-visiblepanel-tab-color: var(--dv-color-abyss-primary-text);\n --dv-activegroup-hiddenpanel-tab-color: var(\n --dv-color-abyss-secondary-text\n );\n --dv-inactivegroup-visiblepanel-tab-color: var(\n --dv-color-abyss-primary-text\n );\n --dv-inactivegroup-hiddenpanel-tab-color: var(\n --dv-color-abyss-secondary-text\n );\n --dv-separator-border: transparent;\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-active-sash-color: var(--dv-color-abyss-accent);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(0, 0, 0, 0.5);\n padding: 10px;\n background-color: var(--dv-color-abyss-dark);\n}\n.dockview-theme-abyss-spaced .dv-resize-container:has(> .dv-groupview) {\n border-radius: 8px;\n}\n.dockview-theme-abyss-spaced .dv-sash {\n border-radius: 4px;\n}\n.dockview-theme-abyss-spaced .dv-drop-target-anchor {\n border-radius: calc(var(--dv-border-radius) / 4);\n}\n.dockview-theme-abyss-spaced .dv-drop-target-anchor.dv-drop-target-content {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-abyss-spaced .dv-resize-container {\n border-radius: var(--dv-border-radius) !important;\n border: none;\n}\n.dockview-theme-abyss-spaced .dv-tabs-overflow-container,\n.dockview-theme-abyss-spaced .dv-tabs-overflow-dropdown-default {\n border-radius: 8px;\n height: unset !important;\n}\n.dockview-theme-abyss-spaced .dv-tab {\n border-radius: 8px;\n}\n.dockview-theme-abyss-spaced .dv-tab .dv-svg {\n height: 8px;\n width: 8px;\n}\n.dockview-theme-abyss-spaced .dv-groupview {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-abyss-spaced .dv-groupview .dv-tabs-and-actions-container {\n padding: 0px calc(var(--dv-border-radius) / 2);\n}\n.dockview-theme-abyss-spaced .dv-groupview .dv-content-container {\n background-color: var(--dv-tabs-and-actions-container-background-color);\n}\n.dockview-theme-abyss-spaced .dv-resize-container .dv-groupview {\n border: 2px solid var(--dv-color-abyss-dark);\n}\n\n.dockview-theme-light-spaced {\n --dv-paneview-active-outline-color: dodgerblue;\n --dv-tabs-and-actions-container-font-size: 13px;\n --dv-tabs-and-actions-container-height: 35px;\n --dv-drag-over-background-color: rgba(83, 89, 93, 0.5);\n --dv-drag-over-border-color: transparent;\n --dv-tabs-container-scrollbar-color: #888;\n --dv-icon-hover-background-color: rgba(90, 93, 94, 0.31);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(83, 89, 93, 0.5);\n --dv-overlay-z-index: 999;\n --dv-tab-font-size: inherit;\n --dv-border-radius: 0px;\n --dv-tab-margin: 0;\n --dv-sash-color: transparent;\n --dv-active-sash-color: transparent;\n --dv-active-sash-transition-duration: 0.1s;\n --dv-active-sash-transition-delay: 0.5s;\n --dv-tab-font-size: 12px;\n --dv-border-radius: 20px;\n --dv-tab-margin: 0.5rem 0.25rem;\n --dv-tabs-and-actions-container-height: 44px;\n --dv-border-radius: 20px;\n box-sizing: border-box;\n --dv-drag-over-border: 2px solid rgb(91, 30, 207);\n --dv-drag-over-background-color: "";\n --dv-group-view-background-color: #f6f5f9;\n --dv-tabs-and-actions-container-background-color: white;\n --dv-activegroup-visiblepanel-tab-background-color: #ededf0;\n --dv-activegroup-hiddenpanel-tab-background-color: #f9f9fa;\n --dv-inactivegroup-visiblepanel-tab-background-color: #ededf0;\n --dv-inactivegroup-hiddenpanel-tab-background-color: #f9f9fa;\n --dv-tab-divider-color: transparent;\n --dv-activegroup-visiblepanel-tab-color: rgb(104, 107, 130);\n --dv-activegroup-hiddenpanel-tab-color: rgb(148, 151, 169);\n --dv-inactivegroup-visiblepanel-tab-color: rgb(104, 107, 130);\n --dv-inactivegroup-hiddenpanel-tab-color: rgb(148, 151, 169);\n --dv-separator-border: transparent;\n --dv-paneview-header-border-color: rgb(51, 51, 51);\n --dv-active-sash-color: rgb(91, 30, 207);\n --dv-floating-box-shadow: 8px 8px 8px 0px rgba(0, 0, 0, 0.1);\n padding: 10px;\n background-color: #f6f5f9;\n --dv-scrollbar-background-color: rgba(0, 0, 0, 0.25);\n}\n.dockview-theme-light-spaced .dv-resize-container:has(> .dv-groupview) {\n border-radius: 8px;\n}\n.dockview-theme-light-spaced .dv-sash {\n border-radius: 4px;\n}\n.dockview-theme-light-spaced .dv-drop-target-anchor {\n border-radius: calc(var(--dv-border-radius) / 4);\n}\n.dockview-theme-light-spaced .dv-drop-target-anchor.dv-drop-target-content {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-light-spaced .dv-resize-container {\n border-radius: var(--dv-border-radius) !important;\n border: none;\n}\n.dockview-theme-light-spaced .dv-tabs-overflow-container,\n.dockview-theme-light-spaced .dv-tabs-overflow-dropdown-default {\n border-radius: 8px;\n height: unset !important;\n}\n.dockview-theme-light-spaced .dv-tab {\n border-radius: 8px;\n}\n.dockview-theme-light-spaced .dv-tab .dv-svg {\n height: 8px;\n width: 8px;\n}\n.dockview-theme-light-spaced .dv-groupview {\n border-radius: var(--dv-border-radius);\n}\n.dockview-theme-light-spaced .dv-groupview .dv-tabs-and-actions-container {\n padding: 0px calc(var(--dv-border-radius) / 2);\n}\n.dockview-theme-light-spaced .dv-groupview .dv-content-container {\n background-color: var(--dv-tabs-and-actions-container-background-color);\n}\n.dockview-theme-light-spaced .dv-resize-container .dv-groupview {\n border: 2px solid rgba(255, 255, 255, 0.1);\n}\n.dv-drop-target-container {\n position: absolute;\n z-index: 9999;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n pointer-events: none;\n overflow: hidden;\n --dv-transition-duration: 300ms;\n}\n.dv-drop-target-container .dv-drop-target-anchor {\n position: relative;\n border: var(--dv-drag-over-border);\n background-color: var(--dv-drag-over-background-color);\n opacity: 1;\n /* GPU optimizations */\n will-change: transform, opacity;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n contain: layout paint;\n transition: opacity var(--dv-transition-duration) ease-in, transform var(--dv-transition-duration) ease-out;\n}\n.dv-drop-target {\n position: relative;\n --dv-transition-duration: 70ms;\n}\n.dv-drop-target > .dv-drop-target-dropzone {\n position: absolute;\n left: 0px;\n top: 0px;\n height: 100%;\n width: 100%;\n z-index: 1000;\n pointer-events: none;\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection {\n position: relative;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n border: var(--dv-drag-over-border);\n background-color: var(--dv-drag-over-background-color);\n transition: top var(--dv-transition-duration) ease-out, left var(--dv-transition-duration) ease-out, width var(--dv-transition-duration) ease-out, height var(--dv-transition-duration) ease-out, opacity var(--dv-transition-duration) ease-out;\n will-change: transform;\n pointer-events: none;\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-top.dv-drop-target-small-vertical {\n border-top: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-bottom.dv-drop-target-small-vertical {\n border-bottom: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-left.dv-drop-target-small-horizontal {\n border-left: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-drop-target > .dv-drop-target-dropzone > .dv-drop-target-selection.dv-drop-target-right.dv-drop-target-small-horizontal {\n border-right: 1px solid var(--dv-drag-over-border-color);\n}\n.dv-dockview {\n position: relative;\n background-color: var(--dv-group-view-background-color);\n contain: layout;\n}\n.dv-dockview .dv-watermark-container {\n position: absolute;\n top: 0px;\n left: 0px;\n height: 100%;\n width: 100%;\n z-index: 1;\n}\n.dv-dockview .dv-overlay-render-container {\n position: relative;\n}\n\n.dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-groupview.dv-active-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-active-tab {\n background-color: var(--dv-inactivegroup-visiblepanel-tab-background-color);\n color: var(--dv-inactivegroup-visiblepanel-tab-color);\n}\n.dv-groupview.dv-inactive-group > .dv-tabs-and-actions-container .dv-tabs-container > .dv-tab.dv-inactive-tab {\n background-color: var(--dv-inactivegroup-hiddenpanel-tab-background-color);\n color: var(--dv-inactivegroup-hiddenpanel-tab-color);\n}\n\n/**\n * when a tab is dragged we lose the above stylings because they are conditional on parent elements\n * therefore we also set some stylings for the dragging event\n **/\n.dv-tab.dv-tab-dragging {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-groupview {\n display: flex;\n flex-direction: column;\n height: 100%;\n background-color: var(--dv-group-view-background-color);\n overflow: hidden;\n}\n.dv-groupview:focus {\n outline: none;\n}\n.dv-groupview > .dv-content-container {\n flex-grow: 1;\n min-height: 0;\n outline: none;\n}\n.dv-root-wrapper {\n height: 100%;\n width: 100%;\n}\n.dv-grid-view,\n.dv-branch-node {\n height: 100%;\n width: 100%;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-top {\n background-color: red;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-bottom {\n background-color: green;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-left {\n background-color: yellow;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-right {\n background-color: blue;\n}\n.dv-debug .dv-resize-container .dv-resize-handle-topleft,\n.dv-debug .dv-resize-container .dv-resize-handle-topright,\n.dv-debug .dv-resize-container .dv-resize-handle-bottomleft,\n.dv-debug .dv-resize-container .dv-resize-handle-bottomright {\n background-color: cyan;\n}\n\n.dv-resize-container {\n --dv-overlay-z-index: var(--dv-overlay-z-index, 999);\n position: absolute;\n z-index: calc(var(--dv-overlay-z-index) - 2);\n border: 1px solid var(--dv-tab-divider-color);\n box-shadow: var(--dv-floating-box-shadow);\n /* GPU optimizations for floating group movement */\n will-change: transform, opacity;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n}\n.dv-resize-container.dv-hidden {\n display: none;\n}\n.dv-resize-container.dv-resize-container-dragging {\n opacity: 0.5;\n /* Enhanced GPU acceleration during drag */\n will-change: transform, opacity;\n}\n.dv-resize-container .dv-resize-handle-top {\n height: 4px;\n width: calc(100% - 8px);\n left: 4px;\n top: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ns-resize;\n}\n.dv-resize-container .dv-resize-handle-bottom {\n height: 4px;\n width: calc(100% - 8px);\n left: 4px;\n bottom: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ns-resize;\n}\n.dv-resize-container .dv-resize-handle-left {\n height: calc(100% - 8px);\n width: 4px;\n left: -2px;\n top: 4px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ew-resize;\n}\n.dv-resize-container .dv-resize-handle-right {\n height: calc(100% - 8px);\n width: 4px;\n right: -2px;\n top: 4px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ew-resize;\n}\n.dv-resize-container .dv-resize-handle-topleft {\n height: 4px;\n width: 4px;\n top: -2px;\n left: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: nw-resize;\n}\n.dv-resize-container .dv-resize-handle-topright {\n height: 4px;\n width: 4px;\n right: -2px;\n top: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: ne-resize;\n}\n.dv-resize-container .dv-resize-handle-bottomleft {\n height: 4px;\n width: 4px;\n left: -2px;\n bottom: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: sw-resize;\n}\n.dv-resize-container .dv-resize-handle-bottomright {\n height: 4px;\n width: 4px;\n right: -2px;\n bottom: -2px;\n z-index: var(--dv-overlay-z-index);\n position: absolute;\n cursor: se-resize;\n}\n.dv-render-overlay {\n --dv-overlay-z-index: var(--dv-overlay-z-index, 999);\n position: absolute;\n z-index: 1;\n width: 100%;\n height: 100%;\n contain: layout paint;\n isolation: isolate;\n /* GPU optimizations */\n will-change: transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n}\n.dv-render-overlay.dv-render-overlay-float {\n z-index: calc(var(--dv-overlay-z-index) - 1);\n}\n\n.dv-debug .dv-render-overlay {\n outline: 1px solid red;\n outline-offset: -1;\n}\n.dv-pane-container {\n height: 100%;\n width: 100%;\n}\n.dv-pane-container.dv-animated .dv-view {\n /* GPU optimizations for smooth pane animations */\n will-change: transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n transition: transform 0.15s ease-out;\n}\n.dv-pane-container .dv-view {\n overflow: hidden;\n display: flex;\n flex-direction: column;\n padding: 0px !important;\n}\n.dv-pane-container .dv-view:not(:first-child)::before {\n background-color: transparent !important;\n}\n.dv-pane-container .dv-view:not(:first-child) .dv-pane > .dv-pane-header {\n border-top: 1px solid var(--dv-paneview-header-border-color);\n}\n.dv-pane-container .dv-view .dv-default-header {\n background-color: var(--dv-group-view-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n display: flex;\n padding: 0px 8px;\n cursor: pointer;\n}\n.dv-pane-container .dv-view .dv-default-header .dv-pane-header-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.dv-pane-container .dv-view .dv-default-header > span {\n padding-left: 8px;\n flex-grow: 1;\n}\n.dv-pane-container:first-of-type > .dv-pane > .dv-pane-header {\n border-top: none !important;\n}\n.dv-pane-container .dv-pane {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n height: 100%;\n}\n.dv-pane-container .dv-pane .dv-pane-header {\n box-sizing: border-box;\n user-select: none;\n position: relative;\n outline: none;\n}\n.dv-pane-container .dv-pane .dv-pane-header.dv-pane-draggable {\n cursor: pointer;\n}\n.dv-pane-container .dv-pane .dv-pane-header:focus:before, .dv-pane-container .dv-pane .dv-pane-header:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: "";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.dv-pane-container .dv-pane .dv-pane-body {\n overflow-y: auto;\n overflow-x: hidden;\n flex-grow: 1;\n position: relative;\n outline: none;\n}\n.dv-pane-container .dv-pane .dv-pane-body:focus:before, .dv-pane-container .dv-pane .dv-pane-body:focus-within:before {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 5;\n content: "";\n pointer-events: none;\n outline: 1px solid;\n outline-width: -1px;\n outline-style: solid;\n outline-offset: -1px;\n outline-color: var(--dv-paneview-active-outline-color);\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-enabled {\n background-color: black;\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-disabled {\n background-color: orange;\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-maximum {\n background-color: green;\n}\n.dv-debug .dv-split-view-container .dv-sash-container .dv-sash.dv-minimum {\n background-color: red;\n}\n\n.dv-split-view-container {\n position: relative;\n overflow: hidden;\n height: 100%;\n width: 100%;\n}\n.dv-split-view-container.dv-splitview-disabled > .dv-sash-container > .dv-sash {\n pointer-events: none;\n}\n.dv-split-view-container.dv-animation .dv-view,\n.dv-split-view-container.dv-animation .dv-sash {\n /* GPU optimizations for smooth animations */\n will-change: transform;\n transform: translate3d(0, 0, 0);\n backface-visibility: hidden;\n transition: transform 0.15s ease-out;\n}\n.dv-split-view-container.dv-horizontal {\n height: 100%;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash {\n height: 100%;\n width: 4px;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-enabled {\n cursor: ew-resize;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-disabled {\n cursor: default;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-maximum {\n cursor: w-resize;\n}\n.dv-split-view-container.dv-horizontal > .dv-sash-container > .dv-sash.dv-minimum {\n cursor: e-resize;\n}\n.dv-split-view-container.dv-horizontal > .dv-view-container > .dv-view:not(:first-child)::before {\n height: 100%;\n width: 1px;\n}\n.dv-split-view-container.dv-vertical {\n width: 100%;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash {\n width: 100%;\n height: 4px;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-enabled {\n cursor: ns-resize;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-disabled {\n cursor: default;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-maximum {\n cursor: n-resize;\n}\n.dv-split-view-container.dv-vertical > .dv-sash-container > .dv-sash.dv-minimum {\n cursor: s-resize;\n}\n.dv-split-view-container.dv-vertical > .dv-view-container > .dv-view {\n width: 100%;\n}\n.dv-split-view-container.dv-vertical > .dv-view-container > .dv-view:not(:first-child)::before {\n height: 1px;\n width: 100%;\n}\n.dv-split-view-container .dv-sash-container {\n height: 100%;\n width: 100%;\n position: absolute;\n}\n.dv-split-view-container .dv-sash-container .dv-sash {\n position: absolute;\n z-index: 99;\n outline: none;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n touch-action: none;\n background-color: var(--dv-sash-color, transparent);\n}\n.dv-split-view-container .dv-sash-container .dv-sash:not(.disabled):active, .dv-split-view-container .dv-sash-container .dv-sash:not(.disabled):hover {\n background-color: var(--dv-active-sash-color, transparent);\n transition-property: background-color;\n transition-timing-function: ease-in-out;\n transition-duration: var(--dv-active-sash-transition-duration, 0.1s);\n transition-delay: var(--dv-active-sash-transition-delay, 0.5s);\n}\n.dv-split-view-container .dv-view-container {\n position: relative;\n height: 100%;\n width: 100%;\n}\n.dv-split-view-container .dv-view-container .dv-view {\n height: 100%;\n box-sizing: border-box;\n overflow: auto;\n position: absolute;\n}\n.dv-split-view-container.dv-separator-border .dv-view:not(:first-child)::before {\n content: " ";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-separator-border);\n}\n.dv-dragged {\n transform: translate3d(0px, 0px, 0px); /* forces tab to be drawn on a separate layer (see https://github.com/microsoft/vscode/issues/18733) */\n}\n\n.dv-tab {\n flex-shrink: 0;\n}\n.dv-tab:focus-within, .dv-tab:focus {\n position: relative;\n}\n.dv-tab:focus-within::after, .dv-tab:focus::after {\n position: absolute;\n content: "";\n height: 100%;\n width: 100%;\n top: 0px;\n left: 0px;\n pointer-events: none;\n outline: 1px solid var(--dv-tab-divider-color) !important;\n outline-offset: -1px;\n z-index: 5;\n}\n.dv-tab.dv-tab-dragging .dv-default-tab-action {\n background-color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-tab.dv-active-tab .dv-default-tab .dv-default-tab-action {\n visibility: visible;\n}\n.dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action {\n visibility: hidden;\n}\n.dv-tab.dv-inactive-tab .dv-default-tab:hover .dv-default-tab-action {\n visibility: visible;\n}\n.dv-tab .dv-default-tab {\n position: relative;\n height: 100%;\n display: flex;\n align-items: center;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n.dv-tab .dv-default-tab .dv-default-tab-content {\n flex-grow: 1;\n margin-right: 4px;\n}\n.dv-tab .dv-default-tab .dv-default-tab-action {\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n}\n.dv-tab .dv-default-tab .dv-default-tab-action:hover {\n border-radius: 2px;\n background-color: var(--dv-icon-hover-background-color);\n}\n.dv-tabs-overflow-dropdown-default {\n height: 100%;\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n margin: var(--dv-tab-margin);\n display: flex;\n align-items: center;\n flex-shrink: 0;\n padding: 0.25rem 0.5rem;\n cursor: pointer;\n}\n.dv-tabs-overflow-dropdown-default > span {\n padding-left: 0.25rem;\n}\n.dv-tabs-overflow-dropdown-default > svg {\n transform: rotate(90deg);\n}\n.dv-tabs-container {\n display: flex;\n height: 100%;\n overflow: auto;\n scrollbar-width: thin;\n /* GPU optimizations for smooth scrolling */\n will-change: scroll-position;\n transform: translate3d(0, 0, 0);\n /* Track */\n /* Handle */\n}\n.dv-tabs-container.dv-horizontal .dv-tab:not(:first-child)::before {\n content: " ";\n position: absolute;\n top: 0;\n left: 0;\n z-index: 5;\n pointer-events: none;\n background-color: var(--dv-tab-divider-color);\n width: 1px;\n height: 100%;\n}\n.dv-tabs-container::-webkit-scrollbar {\n height: 3px;\n}\n.dv-tabs-container::-webkit-scrollbar-track {\n background: transparent;\n}\n.dv-tabs-container::-webkit-scrollbar-thumb {\n background: var(--dv-tabs-container-scrollbar-color);\n}\n\n.dv-scrollable > .dv-tabs-container {\n overflow: hidden;\n}\n\n.dv-tab {\n -webkit-user-drag: element;\n outline: none;\n padding: 0.25rem 0.5rem;\n cursor: pointer;\n position: relative;\n box-sizing: border-box;\n font-size: var(--dv-tab-font-size);\n margin: var(--dv-tab-margin);\n}\n\n.dv-tabs-overflow-container {\n flex-direction: column;\n height: unset;\n border: 1px solid var(--dv-tab-divider-color);\n background-color: var(--dv-group-view-background-color);\n}\n.dv-tabs-overflow-container .dv-tab:not(:last-child) {\n border-bottom: 1px solid var(--dv-tab-divider-color);\n}\n.dv-tabs-overflow-container .dv-active-tab {\n background-color: var(--dv-activegroup-visiblepanel-tab-background-color);\n color: var(--dv-activegroup-visiblepanel-tab-color);\n}\n.dv-tabs-overflow-container .dv-inactive-tab {\n background-color: var(--dv-activegroup-hiddenpanel-tab-background-color);\n color: var(--dv-activegroup-hiddenpanel-tab-color);\n}\n.dv-tabs-and-actions-container {\n display: flex;\n background-color: var(--dv-tabs-and-actions-container-background-color);\n flex-shrink: 0;\n box-sizing: border-box;\n height: var(--dv-tabs-and-actions-container-height);\n font-size: var(--dv-tabs-and-actions-container-font-size);\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-scrollable {\n flex-grow: 1;\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-tabs-container {\n flex-grow: 1;\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-tabs-container .dv-tab {\n flex-grow: 1;\n padding: 0px;\n}\n.dv-tabs-and-actions-container.dv-single-tab.dv-full-width-single-tab .dv-void-container {\n flex-grow: 0;\n}\n.dv-tabs-and-actions-container .dv-void-container {\n display: flex;\n flex-grow: 1;\n}\n.dv-tabs-and-actions-container .dv-void-container.dv-draggable {\n cursor: grab;\n}\n.dv-tabs-and-actions-container .dv-right-actions-container {\n display: flex;\n}\n.dv-watermark {\n display: flex;\n height: 100%;\n}');class b{}class f extends b{constructor(e,t,i){super(),this.viewId=e,this.groupId=t,this.panelId=i}}class w extends b{constructor(e,t){super(),this.viewId=e,this.paneId=t}}class _{constructor(){}static getInstance(){return _.INSTANCE}hasData(e){return e&&e===this.proto}clearData(e){this.hasData(e)&&(this.proto=void 0,this.data=void 0)}getData(e){if(this.hasData(e))return this.data}setData(e,t){t&&(this.data=e,this.proto=t)}}function y(){const e=_.getInstance();if(e.hasData(f.prototype))return e.getData(f.prototype)[0]}function D(){const e=_.getInstance();if(e.hasData(w.prototype))return e.getData(w.prototype)[0]}_.INSTANCE=new _,function(e){e.any=(...e)=>t=>{const i=e.map((e=>e(t)));return{dispose:()=>{i.forEach((e=>{e.dispose()}))}}}}(m||(m={}));class x{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class C{constructor(){this._isAccepted=!1}get isAccepted(){return this._isAccepted}accept(){this._isAccepted=!0}}class z{static create(){var e;return new z(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn("dockview: stacktrace",this.value)}}class S{constructor(e,t){this.callback=e,this.stacktrace=t}}class A{static setLeakageMonitorEnabled(e){e!==A.ENABLE_TRACKING&&A.MEMORY_LEAK_WATCHER.clear(),A.ENABLE_TRACKING=e}get value(){return this._last}constructor(e){this.options=e,this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>{var t;(null===(t=this.options)||void 0===t?void 0:t.replay)&&void 0!==this._last&&e(this._last);const i=new S(e,A.ENABLE_TRACKING?z.create():void 0);return this._listeners.push(i),{dispose:()=>{const e=this._listeners.indexOf(i);e>-1?this._listeners.splice(e,1):A.ENABLE_TRACKING}}},A.ENABLE_TRACKING&&A.MEMORY_LEAK_WATCHER.add(this._event,z.create())),this._event}fire(e){var t;(null===(t=this.options)||void 0===t?void 0:t.replay)&&(this._last=e);for(const t of this._listeners)t.callback(e)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(A.ENABLE_TRACKING&&queueMicrotask((()=>{var e;for(const t of this._listeners)console.warn("dockview: stacktrace",null===(e=t.stacktrace)||void 0===e?void 0:e.print())})),this._listeners=[]),A.ENABLE_TRACKING&&this._event&&A.MEMORY_LEAK_WATCHER.delete(this._event))}}function k(e,t,i,n){return e.addEventListener(t,i,n),{dispose:()=>{e.removeEventListener(t,i,n)}}}A.ENABLE_TRACKING=!1,A.MEMORY_LEAK_WATCHER=new class{constructor(){this.events=new Map}get size(){return this.events.size}add(e,t){this.events.set(e,t)}delete(e){this.events.delete(e)}clear(){this.events.clear()}};class E{constructor(){this._onFired=new A,this._currentFireCount=0,this._queued=!1,this.onEvent=e=>{const t=this._currentFireCount;return this._onFired.event((()=>{this._currentFireCount>t&&e()}))}}fire(){this._currentFireCount++,this._queued||(this._queued=!0,queueMicrotask((()=>{this._queued=!1,this._onFired.fire()})))}dispose(){this._onFired.dispose()}}!function(e){e.NONE={dispose:()=>{}},e.from=function(e){return{dispose:()=>{e()}}}}(g||(g={}));class P{get isDisposed(){return this._isDisposed}constructor(...e){this._isDisposed=!1,this._disposables=e}addDisposables(...e){e.forEach((e=>this._disposables.push(e)))}dispose(){this._isDisposed||(this._isDisposed=!0,this._disposables.forEach((e=>e.dispose())),this._disposables=[])}}class O{constructor(){this._disposable=g.NONE}set value(e){this._disposable&&this._disposable.dispose(),this._disposable=e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=g.NONE)}}class I extends P{constructor(e){super(),this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._value=null,this.addDisposables(this._onDidChange,G(e,(e=>{const t=e.target.scrollWidth>e.target.clientWidth,i=e.target.scrollHeight>e.target.clientHeight;this._value={hasScrollX:t,hasScrollY:i},this._onDidChange.fire(this._value)})))}}function G(e,t){const i=new ResizeObserver((e=>{requestAnimationFrame((()=>{const i=e[0];t(i)}))}));return i.observe(e),{dispose:()=>{i.unobserve(e),i.disconnect()}}}const V=(e,...t)=>{for(const i of t)e.classList.contains(i)&&e.classList.remove(i)},N=(e,...t)=>{for(const i of t)e.classList.contains(i)||e.classList.add(i)},T=(e,t,i)=>{const n=e.classList.contains(t);i&&!n&&e.classList.add(t),!i&&n&&e.classList.remove(t)};function L(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function R(e){return new M(e)}class M extends P{constructor(e){super(),this._onDidFocus=new A,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new A,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let t=L(document.activeElement,e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},o=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{L(document.activeElement,e)!==t&&(t?o():n())},this.addDisposables(k(e,"focus",n,!0)),this.addDisposables(k(e,"blur",o,!0))}refreshState(){this._refreshStateHandler()}}const W="dv-quasiPreventDefault";function H(e){return e[W]}function j(e){const{left:t,top:i,width:n,height:o}=e.getBoundingClientRect();return{left:t+window.scrollX,top:i+window.scrollY,width:n,height:o}}function F(e=document){const t=function(e){const t=[];return function i(n){if(n.nodeType===Node.ELEMENT_NODE){e.includes(n.tagName)&&t.push(n),n.shadowRoot&&i(n.shadowRoot);for(const e of n.children)i(e)}}(document.documentElement),t}(["IFRAME","WEBVIEW"]),i=new WeakMap;for(const e of t)i.set(e,e.style.pointerEvents),e.style.pointerEvents="none";return{release:()=>{var e;for(const n of t)n.style.pointerEvents=null!==(e=i.get(n))&&void 0!==e?e:"auto";t.splice(0,t.length)}}}class B{constructor(e){this.element=e,this._classNames=[]}setClassNames(e){for(const e of this._classNames)T(this.element,e,!1);this._classNames=e.split(" ").filter((e=>e.trim().length>0));for(const e of this._classNames)T(this.element,e,!0)}}function U(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function $(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}function J(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function Z(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Y(e,t){const i=e.findIndex((e=>e===t));return i>-1&&(e.splice(i,1),!0)}const X=(e,t,i)=>t>i?t:Math.min(i,Math.max(e,t)),q=()=>{let e=1;return{next:()=>(e++).toString()}},K=(e,t)=>{const i=[];if("number"!=typeof t&&(t=e,e=0),e<=t)for(let n=e;n<t;n++)i.push(n);else for(let n=e;n>t;n--)i.push(n);return i};class Q{set size(e){this._size=e}get size(){return this._size}get cachedVisibleSize(){return this._cachedVisibleSize}get visible(){return void 0===this._cachedVisibleSize}get minimumSize(){return this.visible?this.view.minimumSize:0}get viewMinimumSize(){return this.view.minimumSize}get maximumSize(){return this.visible?this.view.maximumSize:0}get viewMaximumSize(){return this.view.maximumSize}get priority(){return this.view.priority}get snap(){return!!this.view.snap}set enabled(e){this.container.style.pointerEvents=e?"":"none"}constructor(e,t,i,n){this.container=e,this.view=t,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}setVisible(e,t){var i;e!==this.visible&&(e?(this.size=X(null!==(i=this._cachedVisibleSize)&&void 0!==i?i:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),this.view.setVisible&&this.view.setVisible(e))}dispose(){return this.disposable.dispose(),this.view}}var ee,te,ie,ne;!function(e){e.HORIZONTAL="HORIZONTAL",e.VERTICAL="VERTICAL"}(ee||(ee={})),function(e){e[e.MAXIMUM=0]="MAXIMUM",e[e.MINIMUM=1]="MINIMUM",e[e.DISABLED=2]="DISABLED",e[e.ENABLED=3]="ENABLED"}(te||(te={})),function(e){e.Low="low",e.High="high",e.Normal="normal"}(ie||(ie={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(ne||(ne={}));class oe{get contentSize(){return this._contentSize}get size(){return this._size}set size(e){this._size=e}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(e){this._orthogonalSize=e}get length(){return this.viewItems.length}get proportions(){return this._proportions?[...this._proportions]:void 0}get orientation(){return this._orientation}set orientation(e){this._orientation=e;const t=this.size;this.size=this.orthogonalSize,this.orthogonalSize=t,V(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==ee.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce(((e,t)=>e+t.minimumSize),0)}get maximumSize(){return 0===this.length?Number.POSITIVE_INFINITY:this.viewItems.reduce(((e,t)=>e+t.maximumSize),0)}get startSnappingEnabled(){return this._startSnappingEnabled}set startSnappingEnabled(e){this._startSnappingEnabled!==e&&(this._startSnappingEnabled=e,this.updateSashEnablement())}get endSnappingEnabled(){return this._endSnappingEnabled}set endSnappingEnabled(e){this._endSnappingEnabled!==e&&(this._endSnappingEnabled=e,this.updateSashEnablement())}get disabled(){return this._disabled}set disabled(e){this._disabled=e,T(this.element,"dv-splitview-disabled",e)}get margin(){return this._margin}set margin(e){this._margin=e,T(this.element,"dv-splitview-has-margin",0!==e)}constructor(e,t){var i,n;this.container=e,this.viewItems=[],this.sashes=[],this._size=0,this._orthogonalSize=0,this._contentSize=0,this._proportions=void 0,this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this._disabled=!1,this._margin=0,this._onDidSashEnd=new A,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new A,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new A,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(e,t,i=this.viewItems.map((e=>e.size)),n,o,s=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,d)=>{if(e<0||e>this.viewItems.length)return 0;const h=K(e,-1),l=K(e+1,this.viewItems.length);if(o)for(const e of o)J(h,e),J(l,e);if(n)for(const e of n)Z(h,e),Z(l,e);const p=h.map((e=>this.viewItems[e])),c=h.map((e=>i[e])),v=l.map((e=>this.viewItems[e])),u=l.map((e=>i[e])),m=h.reduce(((e,t)=>e+this.viewItems[t].minimumSize-i[t]),0),g=h.reduce(((e,t)=>e+this.viewItems[t].maximumSize-i[t]),0),b=0===l.length?Number.POSITIVE_INFINITY:l.reduce(((e,t)=>e+i[t]-this.viewItems[t].minimumSize),0),f=0===l.length?Number.NEGATIVE_INFINITY:l.reduce(((e,t)=>e+i[t]-this.viewItems[t].maximumSize),0),w=Math.max(m,f),_=Math.min(b,g);let y=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;y=i!==e.visible,e.setVisible(i,a.size)}if(!y&&d){const e=this.viewItems[d.index],i=t<d.limitDelta;y=i!==e.visible,e.setVisible(i,d.size)}if(y)return this.resize(e,t,i,n,o,s,r);let D=0,x=X(t,w,_);for(let e=0;e<p.length;e++){const t=p[e],i=X(c[e]+x,t.minimumSize,t.maximumSize),n=i-c[e];D+=n,x-=n,t.size=i}let C=D;for(let e=0;e<v.length;e++){const t=v[e],i=X(u[e]-C,t.minimumSize,t.maximumSize);C+=i-u[e],t.size=i}return t},this._orientation=null!==(i=t.orientation)&&void 0!==i?i:ee.VERTICAL,this.element=this.createContainer(),this.margin=null!==(n=t.margin)&&void 0!==n?n:0,this.proportionalLayout=void 0===t.proportionalLayout||!!t.proportionalLayout,this.viewContainer=this.createViewContainer(),this.sashContainer=this.createSashContainer(),this.element.appendChild(this.sashContainer),this.element.appendChild(this.viewContainer),this.container.appendChild(this.element),this.style(t.styles),t.descriptor&&(this._size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=void 0===e.visible||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.addView(n,i,t,!0)})),this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.saveProportions())}style(e){"transparent"===(null==e?void 0:e.separatorBorder)?(V(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(N(this.element,"dv-separator-border"),(null==e?void 0:e.separatorBorder)&&this.element.style.setProperty("--dv-separator-border",e.separatorBorder))}isViewVisible(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].visible}setViewVisible(e,t){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");const i=this.viewItems[e];i.setVisible(t,i.size),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}resizeView(e,t){if(e<0||e>=this.viewItems.length)return;const i=K(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>this.viewItems[e].priority===ie.Low)),e],o=i.filter((e=>this.viewItems[e].priority===ie.High)),s=this.viewItems[e];t=Math.round(t),t=X(t,s.minimumSize,Math.min(s.maximumSize,this._size)),s.size=t,this.relayout(n,o)}getViews(){return this.viewItems.map((e=>e.view))}onDidChange(e,t){const i=this.viewItems.indexOf(e);if(i<0||i>=this.viewItems.length)return;t="number"==typeof t?t:e.size,t=X(t,e.minimumSize,e.maximumSize),e.size=t;const n=K(this.viewItems.length).filter((e=>e!==i)),o=[...n.filter((e=>this.viewItems[e].priority===ie.Low)),i],s=n.filter((e=>this.viewItems[e].priority===ie.High));this.relayout([...o,i],s)}addView(e,t={type:"distribute"},i=this.viewItems.length,n){const o=document.createElement("div");let s;o.className="dv-view",o.appendChild(e.element),s="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize;const r=e.onDidChange((e=>this.onDidChange(a,e.size))),a=new Q(o,e,s,{dispose:()=>{r.dispose(),this.viewContainer.removeChild(o)}});if(i===this.viewItems.length?this.viewContainer.appendChild(o):this.viewContainer.insertBefore(o,this.viewContainer.children.item(i)),this.viewItems.splice(i,0,a),this.viewItems.length>1){const e=document.createElement("div");e.className="dv-sash";const t=t=>{for(const e of this.viewItems)e.enabled=!1;const i=F(),n=this._orientation===ee.HORIZONTAL?t.clientX:t.clientY,o=function(e,t){for(let i=0;i<e.length;i++)if(t(e[i]))return i;return-1}(this.sashes,(t=>t.container===e)),s=this.viewItems.map((e=>e.size));let r,a;const d=K(o,-1),h=K(o+1,this.viewItems.length),l=d.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-s[t])),0),p=d.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-s[t])),0),c=0===h.length?Number.POSITIVE_INFINITY:h.reduce(((e,t)=>e+(s[t]-this.viewItems[t].minimumSize)),0),v=0===h.length?Number.NEGATIVE_INFINITY:h.reduce(((e,t)=>e+(s[t]-this.viewItems[t].viewMaximumSize)),0),u=Math.max(l,v),m=Math.min(c,p),g=this.findFirstSnapIndex(d),b=this.findFirstSnapIndex(h);if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?u-t:u+t,size:e.size}}if("number"==typeof b){const e=this.viewItems[b],t=Math.floor(e.viewMinimumSize/2);a={index:b,limitDelta:e.visible?m+t:m-t,size:e.size}}const f=e=>{const t=(this._orientation===ee.HORIZONTAL?e.clientX:e.clientY)-n;this.resize(o,t,s,void 0,void 0,u,m,r,a),this.distributeEmptySpace(),this.layoutViews()},w=()=>{for(const e of this.viewItems)e.enabled=!0;i.release(),this.saveProportions(),document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",w),document.removeEventListener("pointercancel",w),document.removeEventListener("contextmenu",w),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",f),document.addEventListener("pointerup",w),document.addEventListener("pointercancel",w),document.addEventListener("contextmenu",w)};e.addEventListener("pointerdown",t);const i={container:e,disposable:()=>{e.removeEventListener("pointerdown",t),this.sashContainer.removeChild(e)}};this.sashContainer.appendChild(e),this.sashes.push(i)}n||this.relayout([i]),n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes(),this._onDidAddView.fire(e)}distributeViewSizes(){const e=[];let t=0;for(const i of this.viewItems)i.maximumSize-i.minimumSize>0&&(e.push(i),t+=i.size);const i=Math.floor(t/e.length);for(const t of e)t.size=X(i,t.minimumSize,t.maximumSize);const n=K(this.viewItems.length),o=n.filter((e=>this.viewItems[e].priority===ie.Low)),s=n.filter((e=>this.viewItems[e].priority===ie.High));this.relayout(o,s)}removeView(e,t,i=!1){const n=this.viewItems.splice(e,1)[0];if(n.dispose(),this.viewItems.length>=1){const t=Math.max(e-1,0);this.sashes.splice(t,1)[0].disposable()}return i||this.relayout(),t&&"distribute"===t.type&&this.distributeViewSizes(),this._onDidRemoveView.fire(n.view),n.view}getViewCachedVisibleSize(e){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");return this.viewItems[e].cachedVisibleSize}moveView(e,t){const i=this.getViewCachedVisibleSize(e),n=void 0===i?this.getViewSize(e):ne.Invisible(i),o=this.removeView(e,void 0,!0);this.addView(o,n,t)}layout(e,t){const i=Math.max(this.size,this._contentSize);if(this.size=e,this.orthogonalSize=t,this.proportions){let t=0;for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o?t+=o:e-=n.size}for(let i=0;i<this.viewItems.length;i++){const n=this.viewItems[i],o=this.proportions[i];"number"==typeof o&&t>0&&(n.size=X(Math.round(o*e/t),n.minimumSize,n.maximumSize))}}else{const t=K(this.viewItems.length),n=t.filter((e=>this.viewItems[e].priority===ie.Low)),o=t.filter((e=>this.viewItems[e].priority===ie.High));this.resize(this.viewItems.length-1,e-i,void 0,n,o)}this.distributeEmptySpace(),this.layoutViews()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.size),0);this.resize(this.viewItems.length-1,this._size-i,void 0,e,t),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(e){const t=this.viewItems.reduce(((e,t)=>e+t.size),0);let i=this.size-t;const n=K(this.viewItems.length-1,-1),o=n.filter((e=>this.viewItems[e].priority===ie.Low)),s=n.filter((e=>this.viewItems[e].priority===ie.High));for(const e of s)J(n,e);for(const e of o)Z(n,e);"number"==typeof e&&Z(n,e);for(let e=0;0!==i&&e<n.length;e++){const t=this.viewItems[n[e]],o=X(t.size+i,t.minimumSize,t.maximumSize);i-=o-t.size,t.size=o}}saveProportions(){this.proportionalLayout&&this._contentSize>0&&(this._proportions=this.viewItems.map((e=>e.visible?e.size/this._contentSize:void 0)))}layoutViews(){if(this._contentSize=this.viewItems.reduce(((e,t)=>e+t.size),0),this.updateSashEnablement(),0===this.viewItems.length)return;const e=this.viewItems.filter((e=>e.visible)),t=Math.max(0,e.length-1),i=this.margin*t/Math.max(1,e.length);let n=0;const o=[],s=this.viewItems.reduce(((e,t,i)=>{const n=t.visible?1:0;return 0===i?e.push(n):e.push(e[i-1]+n),e}),[]);this.viewItems.forEach(((e,r)=>{n+=this.viewItems[r].size,o.push(n);const a=e.visible?e.size-i:0,d=Math.max(0,s[r]-1),h=0===r||0===d?0:o[r-1]+d/t*i;if(r<this.viewItems.length-1){const t=e.visible?h+a-2+this.margin/2:h;this._orientation===ee.HORIZONTAL&&(this.sashes[r].container.style.left=`${t}px`,this.sashes[r].container.style.top="0px"),this._orientation===ee.VERTICAL&&(this.sashes[r].container.style.left="0px",this.sashes[r].container.style.top=`${t}px`)}this._orientation===ee.HORIZONTAL&&(e.container.style.width=`${a}px`,e.container.style.left=`${h}px`,e.container.style.top="",e.container.style.height=""),this._orientation===ee.VERTICAL&&(e.container.style.height=`${a}px`,e.container.style.top=`${h}px`,e.container.style.width="",e.container.style.left=""),e.view.layout(e.size-i,this._orthogonalSize)}))}findFirstSnapIndex(e){for(const t of e){const e=this.viewItems[t];if(e.visible&&e.snap)return t}for(const t of e){const e=this.viewItems[t];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return t}}updateSashEnablement(){let e=!1;const t=this.viewItems.map((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const o=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const s=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let e=0;e<this.sashes.length;e++){const n=this.sashes[e];r+=this.viewItems[e].size;const a=!(t[e]&&s[e+1]),d=!(i[e]&&o[e+1]);if(a&&d){const i=K(e,-1),s=K(e+1,this.viewItems.length),a=this.findFirstSnapIndex(i),d=this.findFirstSnapIndex(s),h="number"==typeof a&&!this.viewItems[a].visible,l="number"==typeof d&&!this.viewItems[d].visible;h&&o[e]&&(r>0||this.startSnappingEnabled)?this.updateSash(n,te.MINIMUM):l&&t[e]&&(r<this._contentSize||this.endSnappingEnabled)?this.updateSash(n,te.MAXIMUM):this.updateSash(n,te.DISABLED)}else a&&!d?this.updateSash(n,te.MINIMUM):!a&&d?this.updateSash(n,te.MAXIMUM):this.updateSash(n,te.ENABLED)}}updateSash(e,t){T(e.container,"dv-disabled",t===te.DISABLED),T(e.container,"dv-enabled",t===te.ENABLED),T(e.container,"dv-maximum",t===te.MAXIMUM),T(e.container,"dv-minimum",t===te.MINIMUM)}createViewContainer(){const e=document.createElement("div");return e.className="dv-view-container",e}createSashContainer(){const e=document.createElement("div");return e.className="dv-sash-container",e}createContainer(){const e=document.createElement("div"),t=this._orientation===ee.HORIZONTAL?"dv-horizontal":"dv-vertical";return e.className=`dv-split-view-container ${t}`,e}dispose(){this._onDidSashEnd.dispose(),this._onDidAddView.dispose(),this._onDidRemoveView.dispose();for(let e=0;e<this.element.children.length;e++)if(this.element.children.item(e)===this.element){this.element.removeChild(this.element);break}for(const e of this.viewItems)e.dispose();this.element.remove()}}const se=(()=>{const e={orientation:void 0,descriptor:void 0,proportionalLayout:void 0,styles:void 0,margin:void 0,disableAutoResizing:void 0,className:void 0};return Object.keys(e)})();class re extends P{get onDidAddView(){return this.splitview.onDidAddView}get onDidRemoveView(){return this.splitview.onDidRemoveView}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get orientation(){return this.splitview.orientation}get size(){return this.splitview.size}get orthogonalSize(){return this.splitview.orthogonalSize}constructor(e,t){var i;super(),this.paneItems=[],this.skipAnimation=!1,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._orientation=null!==(i=t.orientation)&&void 0!==i?i:ee.VERTICAL,this.element=document.createElement("div"),this.element.className="dv-pane-container",e.appendChild(this.element),this.splitview=new oe(this.element,{orientation:this._orientation,proportionalLayout:!1,descriptor:t.descriptor}),this.getPanes().forEach((e=>{const t=new P(e.onDidChangeExpansionState((()=>{this.setupAnimation(),this._onDidChange.fire(void 0)}))),i={pane:e,disposable:{dispose:()=>{t.dispose()}}};this.paneItems.push(i),e.orthogonalSize=this.splitview.orthogonalSize})),this.addDisposables(this._onDidChange,this.splitview.onDidSashEnd((()=>{this._onDidChange.fire(void 0)})),this.splitview.onDidAddView((()=>{this._onDidChange.fire()})),this.splitview.onDidRemoveView((()=>{this._onDidChange.fire()})))}setViewVisible(e,t){this.splitview.setViewVisible(e,t)}addPane(e,t,i=this.splitview.length,n=!1){const o=e.onDidChangeExpansionState((()=>{this.setupAnimation(),this._onDidChange.fire(void 0)})),s={pane:e,disposable:{dispose:()=>{o.dispose()}}};this.paneItems.splice(i,0,s),e.orthogonalSize=this.splitview.orthogonalSize,this.splitview.addView(e,t,i,n)}getViewSize(e){return this.splitview.getViewSize(e)}getPanes(){return this.splitview.getViews()}removePane(e,t={skipDispose:!1}){const i=this.paneItems.splice(e,1)[0];return this.splitview.removeView(e),t.skipDispose||(i.disposable.dispose(),i.pane.dispose()),i}moveView(e,t){if(e===t)return;const i=this.removePane(e,{skipDispose:!0});this.skipAnimation=!0;try{this.addPane(i.pane,i.pane.size,t,!1)}finally{this.skipAnimation=!1}}layout(e,t){this.splitview.layout(e,t)}setupAnimation(){this.skipAnimation||(this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),N(this.element,"dv-animated"),this.animationTimer=setTimeout((()=>{this.animationTimer=void 0,V(this.element,"dv-animated")}),200))}dispose(){super.dispose(),this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),this.paneItems.forEach((e=>{e.disposable.dispose(),e.pane.dispose()})),this.paneItems=[],this.splitview.dispose(),this.element.remove()}}class ae{get minimumWidth(){return this.view.minimumWidth}get maximumWidth(){return this.view.maximumWidth}get minimumHeight(){return this.view.minimumHeight}get maximumHeight(){return this.view.maximumHeight}get priority(){return this.view.priority}get snap(){return this.view.snap}get minimumSize(){return this.orientation===ee.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===ee.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===ee.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===ee.HORIZONTAL?this.maximumWidth:this.maximumHeight}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get element(){return this.view.element}get width(){return this.orientation===ee.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===ee.HORIZONTAL?this.size:this.orthogonalSize}constructor(e,t,i,n=0){this.view=e,this.orientation=t,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._orthogonalSize=i,this._size=n,this._disposable=this.view.onDidChange((e=>{e?this._onDidChange.fire({size:this.orientation===ee.VERTICAL?e.width:e.height,orthogonalSize:this.orientation===ee.VERTICAL?e.height:e.width}):this._onDidChange.fire({})}))}setVisible(e){this.view.setVisible&&this.view.setVisible(e)}layout(e,t){this._size=e,this._orthogonalSize=t,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class de extends P{get width(){return this.orientation===ee.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===ee.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return 0===this.children.length?0:Math.max(...this.children.map(((e,t)=>this.splitview.isViewVisible(t)?e.minimumOrthogonalSize:0)))}get maximumSize(){return Math.min(...this.children.map(((e,t)=>this.splitview.isViewVisible(t)?e.maximumOrthogonalSize:Number.POSITIVE_INFINITY)))}get minimumOrthogonalSize(){return this.splitview.minimumSize}get maximumOrthogonalSize(){return this.splitview.maximumSize}get orthogonalSize(){return this._orthogonalSize}get size(){return this._size}get minimumWidth(){return this.orientation===ee.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===ee.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===ee.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===ee.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(0===this.children.length)return ie.Normal;const e=this.children.map((e=>void 0===e.priority?ie.Normal:e.priority));return e.some((e=>e===ie.High))?ie.High:e.some((e=>e===ie.Low))?ie.Low:ie.Normal}get disabled(){return this.splitview.disabled}set disabled(e){this.splitview.disabled=e}get margin(){return this.splitview.margin}set margin(e){this.splitview.margin=e,this.children.forEach((t=>{t instanceof de&&(t.margin=e)}))}constructor(e,t,i,n,o,s,r,a){if(super(),this.orientation=e,this.proportionalLayout=t,this.styles=i,this._childrenDisposable=g.NONE,this.children=[],this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new A,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=o,this._size=n,this.element=document.createElement("div"),this.element.className="dv-branch-node",a){const e={views:a.map((e=>({view:e.node,size:e.node.size,visible:!(e.node instanceof ae&&void 0!==e.visible)||e.visible}))),size:this.orthogonalSize};this.children=a.map((e=>e.node)),this.splitview=new oe(this.element,{orientation:this.orientation,descriptor:e,proportionalLayout:t,styles:i,margin:r})}else this.splitview=new oe(this.element,{orientation:this.orientation,proportionalLayout:t,styles:i,margin:r}),this.splitview.layout(this.size,this.orthogonalSize);this.disabled=s,this.addDisposables(this._onDidChange,this._onDidVisibilityChange,this.splitview.onDidSashEnd((()=>{this._onDidChange.fire({})}))),this.setupChildrenEvents()}setVisible(e){}isChildVisible(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.isViewVisible(e)}setChildVisible(e,t){if(e<0||e>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(e)===t)return;const i=0===this.splitview.contentSize;this.splitview.setViewVisible(e,t);const n=0===this.splitview.contentSize;(t&&i||!t&&n)&&this._onDidVisibilityChange.fire({visible:t})}moveChild(e,t){if(e===t)return;if(e<0||e>=this.children.length)throw new Error("Invalid from index");e<t&&t--,this.splitview.moveView(e,t);const i=this._removeChild(e);this._addChild(i,t)}getChildSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(e)}resizeChild(e,t){if(e<0||e>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(e,t)}layout(e,t){this._size=t,this._orthogonalSize=e,this.splitview.layout(t,e)}addChild(e,t,i,n){if(i<0||i>this.children.length)throw new Error("Invalid index");this.splitview.addView(e,t,i,n),this._addChild(e,i)}getChildCachedVisibleSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(e)}removeChild(e,t){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(e,t),this._removeChild(e)}_addChild(e,t){this.children.splice(t,0,e),this.setupChildrenEvents()}_removeChild(e){const[t]=this.children.splice(e,1);return this.setupChildrenEvents(),t}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new P(m.any(...this.children.map((e=>e.onDidChange)))((e=>{this._onDidChange.fire({size:e.orthogonalSize})})),...this.children.map(((e,t)=>e instanceof de?e.onDidVisibilityChange((({visible:e})=>{this.setChildVisible(t,e)})):g.NONE)))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach((e=>e.dispose())),super.dispose()}}function he(e,t){if(e instanceof ae)return e;if(e instanceof de)return he(e.children[t?e.children.length-1:0],t);throw new Error("invalid node")}function le(e,t,i){if(e instanceof de){const n=new de(e.orientation,e.proportionalLayout,e.styles,t,i,e.disabled,e.margin);for(let t=e.children.length-1;t>=0;t--){const i=e.children[t];n.addChild(le(i,i.size,i.orthogonalSize),i.size,0,!0)}return n}return new ae(e.view,e.orientation,i)}function pe(e,t,i){if(e instanceof de){const n=new de(be(e.orientation),e.proportionalLayout,e.styles,t,i,e.disabled,e.margin);let o=0;for(let s=e.children.length-1;s>=0;s--){const r=e.children[s],a=r instanceof de?r.orthogonalSize:r.size;let d=0===e.size?0:Math.round(t*a/e.size);o+=d,0===s&&(d+=t-o),n.addChild(pe(r,i,d),d,0,!0)}return n}return new ae(e.view,be(e.orientation),i)}function ce(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");let i=t.firstElementChild,n=0;for(;i!==e&&i!==t.lastElementChild&&i;)i=i.nextElementSibling,n++;return n}function ve(e){const t=e.parentElement;if(!t)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(t.className))return[];const i=ce(t);return[...ve(t.parentElement.parentElement.parentElement),i]}function ue(e,t,i){if(ge(e,t)===me(i)){const[e,n]=U(t);let o=n;return"right"!==i&&"bottom"!==i||(o+=1),[...e,o]}{const e="right"===i||"bottom"===i?1:0;return[...t,e]}}function me(e){return"top"===e||"bottom"===e?ee.VERTICAL:ee.HORIZONTAL}function ge(e,t){return t.length%2==0?be(e):e}const be=e=>e===ee.HORIZONTAL?ee.VERTICAL:ee.HORIZONTAL;function fe(e){return!!e.children}const we=(e,t)=>{const i=t===ee.VERTICAL?e.box.width:e.box.height;return fe(e)?{type:"branch",data:e.children.map((e=>we(e,be(t)))),size:i}:"number"==typeof e.cachedVisibleSize?{type:"leaf",data:e.view.toJSON(),size:e.cachedVisibleSize,visible:!1}:{type:"leaf",data:e.view.toJSON(),size:i}};class _e{get length(){return this._root?this._root.children.length:0}get orientation(){return this.root.orientation}set orientation(e){if(this.root.orientation===e)return;const{size:t,orthogonalSize:i}=this.root;this.root=pe(this.root,i,t),this.root.layout(t,i)}get width(){return this.root.width}get height(){return this.root.height}get minimumWidth(){return this.root.minimumWidth}get minimumHeight(){return this.root.minimumHeight}get maximumWidth(){return this.root.maximumHeight}get maximumHeight(){return this.root.maximumHeight}get locked(){return this._locked}set locked(e){this._locked=e;const t=[this.root];for(;t.length>0;){const i=t.pop();i instanceof de&&(i.disabled=e,t.push(...i.children))}}get margin(){return this._margin}set margin(e){this._margin=e,this.root.margin=e}maximizedView(){var e;return null===(e=this._maximizedNode)||void 0===e?void 0:e.leaf.view}hasMaximizedView(){return void 0!==this._maximizedNode}maximizeView(e){var t;const i=ve(e.element),[n,o]=this.getNode(i);if(!(o instanceof ae))return;if((null===(t=this._maximizedNode)||void 0===t?void 0:t.leaf)===o)return;this.hasMaximizedView()&&this.exitMaximizedView(),we(this.getView(),this.orientation);const s=[];!function e(t,i){for(let n=0;n<t.children.length;n++){const o=t.children[n];o instanceof ae?o!==i&&(t.isChildVisible(n)?t.setChildVisible(n,!1):s.push(o)):e(o,i)}}(this.root,o),this._maximizedNode={leaf:o,hiddenOnMaximize:s},this._onDidMaximizedNodeChange.fire({view:o.view,isMaximized:!0})}exitMaximizedView(){if(!this._maximizedNode)return;const e=this._maximizedNode.hiddenOnMaximize;!function t(i){for(let n=i.children.length-1;n>=0;n--){const o=i.children[n];o instanceof ae?e.includes(o)||i.setChildVisible(n,!0):t(o)}}(this.root);const t=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:t.view,isMaximized:!1})}serialize(){const e=this.maximizedView();let t;e&&(t=ve(e.element)),this.hasMaximizedView()&&this.exitMaximizedView();const i={root:we(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return t&&(i.maximizedNode={location:t}),e&&this.maximizeView(e),i}dispose(){this.disposable.dispose(),this._onDidChange.dispose(),this._onDidMaximizedNodeChange.dispose(),this._onDidViewVisibilityChange.dispose(),this.root.dispose(),this._maximizedNode=void 0,this.element.remove()}clear(){const e=this.root.orientation;this.root=new de(e,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(e,t){const i=e.orientation,n=i===ee.VERTICAL?e.height:e.width;if(this._deserialize(e.root,i,t,n),this.layout(e.width,e.height),e.maximizedNode){const t=e.maximizedNode.location,[i,n]=this.getNode(t);if(!(n instanceof ae))return;this.maximizeView(n.view)}}_deserialize(e,t,i,n){this.root=this._deserializeNode(e,t,i,n)}_deserializeNode(e,t,i,n){var o;let s;if("branch"===e.type){const o=e.data.map((n=>({node:this._deserializeNode(n,be(t),i,e.size),visible:n.visible})));s=new de(t,this.proportionalLayout,this.styles,e.size,n,this.locked,this.margin,o)}else{const r=i.fromJSON(e);"boolean"==typeof e.visible&&(null===(o=r.setVisible)||void 0===o||o.call(r,e.visible)),s=new ae(r,t,n,e.size)}return s}get root(){return this._root}set root(e){const t=this._root;t&&(t.dispose(),this._maximizedNode=void 0,this.element.removeChild(t.element)),this._root=e,this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}normalize(){if(!this._root)return;if(1!==this._root.children.length)return;const e=this.root,t=e.children[0];if(t instanceof ae)return;e.element.remove();const i=e.removeChild(0);e.dispose(),i.dispose(),this._root=le(t,t.size,t.orthogonalSize),this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const e=this.root;if(e.element.remove(),this._root=new de(be(e.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),0===e.children.length);else if(1===e.children.length){const t=e.children[0];e.removeChild(0).dispose(),e.dispose(),this._root.addChild(pe(t,t.orthogonalSize,t.size),ne.Distribute,0)}else this._root.addChild(e,ne.Distribute,0);this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}next(e){return this.progmaticSelect(e)}previous(e){return this.progmaticSelect(e,!0)}getView(e){const t=e?this.getNode(e)[1]:this.root;return this._getViews(t,this.orientation)}_getViews(e,t,i){const n={height:e.height,width:e.width};if(e instanceof ae)return{box:n,view:e.view,cachedVisibleSize:i};const o=[];for(let i=0;i<e.children.length;i++){const n=e.children[i],s=e.getChildCachedVisibleSize(i);o.push(this._getViews(n,be(t),s))}return{box:n,children:o}}progmaticSelect(e,t=!1){const[i,n]=this.getNode(e);if(!(n instanceof ae))throw new Error("invalid location");for(let n=i.length-1;n>-1;n--){const o=i[n],s=e[n]||0;if(t?s-1>-1:s+1<o.children.length)return he(o.children[t?s-1:s+1],t)}return he(this.root,t)}constructor(e,t,i,n,o){this.proportionalLayout=e,this.styles=t,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new O,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new A,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new A,this.onDidMaximizedNodeChange=this._onDidMaximizedNodeChange.event,this.element=document.createElement("div"),this.element.className="dv-grid-view",this._locked=null!=n&&n,this._margin=null!=o?o:0,this.root=new de(i,e,t,0,0,this.locked,this.margin)}isViewVisible(e){const[t,i]=U(e),[,n]=this.getNode(t);if(!(n instanceof de))throw new Error("Invalid from location");return n.isChildVisible(i)}setViewVisible(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,n]=U(e),[,o]=this.getNode(i);if(!(o instanceof de))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),o.setChildVisible(n,t)}moveView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[,n]=this.getNode(e);if(!(n instanceof de))throw new Error("Invalid location");n.moveChild(t,i)}addView(e,t,i){this.hasMaximizedView()&&this.exitMaximizedView();const[n,o]=U(i),[s,r]=this.getNode(n);if(r instanceof de){const i=new ae(e,be(r.orientation),r.orthogonalSize);r.addChild(i,t,o)}else{const[i,...a]=[...s].reverse(),[d,...h]=[...n].reverse();let l=0;const p=i.getChildCachedVisibleSize(d);"number"==typeof p&&(l=ne.Invisible(p));i.removeChild(d).dispose();const c=new de(r.orientation,this.proportionalLayout,this.styles,r.size,r.orthogonalSize,this.locked,this.margin);i.addChild(c,r.size,d);const v=new ae(r.view,i.orientation,r.size);c.addChild(v,l,0),"number"!=typeof t&&"split"===t.type&&(t={type:"split",index:0});const u=new ae(e,i.orientation,r.size);c.addChild(u,t,o)}}remove(e,t){const i=ve(e.element);return this.removeView(i,t)}removeView(e,t){this.hasMaximizedView()&&this.exitMaximizedView();const[i,n]=U(e),[o,s]=this.getNode(i);if(!(s instanceof de))throw new Error("Invalid location");const r=s.children[n];if(!(r instanceof ae))throw new Error("Invalid location");if(s.removeChild(n,t),r.dispose(),1!==s.children.length)return r.view;const a=s.children[0];if(0===o.length)return a instanceof ae||(s.removeChild(0,t),this.root=a),r.view;const[d,...h]=[...o].reverse(),[l,...p]=[...i].reverse(),c=s.isChildVisible(0);s.removeChild(0,t);const v=d.children.map(((e,t)=>d.getChildSize(t)));if(d.removeChild(l,t).dispose(),a instanceof de){v.splice(l,1,...a.children.map((e=>e.size)));for(let e=0;e<a.children.length;e++){const t=a.children[e];d.addChild(t,t.size,l+e)}for(;a.children.length>0;)a.removeChild(0)}else{const e=new ae(a.view,be(a.orientation),a.size),t=c?a.orthogonalSize:ne.Invisible(a.orthogonalSize);d.addChild(e,t,l)}a.dispose();for(let e=0;e<v.length;e++)d.resizeChild(e,v[e]);return r.view}layout(e,t){const[i,n]=this.root.orientation===ee.HORIZONTAL?[t,e]:[e,t];this.root.layout(i,n)}getNode(e,t=this.root,i=[]){if(0===e.length)return[i,t];if(!(t instanceof de))throw new Error("Invalid location");const[n,...o]=e;if(n<0||n>=t.children.length)throw new Error("Invalid location");const s=t.children[n];return i.push(t),this.getNode(o,s,i)}}const ye=(()=>{const e={disableAutoResizing:void 0,proportionalLayout:void 0,orientation:void 0,hideBorders:void 0,className:void 0};return Object.keys(e)})();class De extends P{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(e){this._disableResizing=e}constructor(e,t=!1){super(),this._disableResizing=t,this._element=e,this.addDisposables(G(this._element,(e=>{if(this.isDisposed)return;if(this.disableResizing)return;if(!this._element.offsetParent)return;if(!function(e){let t=e;for(;null==t?void 0:t.parentNode;){if(t.parentNode===document)return!0;t=t.parentNode instanceof DocumentFragment?t.parentNode.host:t.parentNode}return!1}(this._element))return;const{width:t,height:i}=e.contentRect;this.layout(t,i)})))}}const xe=q();function Ce(e){switch(e){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";default:return"center"}}class ze extends De{get id(){return this._id}get size(){return this._groups.size}get groups(){return Array.from(this._groups.values()).map((e=>e.value))}get width(){return this.gridview.width}get height(){return this.gridview.height}get minimumHeight(){return this.gridview.minimumHeight}get maximumHeight(){return this.gridview.maximumHeight}get minimumWidth(){return this.gridview.minimumWidth}get maximumWidth(){return this.gridview.maximumWidth}get activeGroup(){return this._activeGroup}get locked(){return this.gridview.locked}set locked(e){this.gridview.locked=e}constructor(e,t){var i;super(document.createElement("div"),t.disableAutoResizing),this._id=xe.next(),this._groups=new Map,this._onDidRemove=new A,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new A,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new A,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new A,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new E,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new E,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new B(this.element),this._classNames.setClassNames(null!==(i=t.className)&&void 0!==i?i:""),e.appendChild(this.element),this.gridview=new _e(!!t.proportionalLayout,t.styles,t.orientation,t.locked,t.margin),this.gridview.locked=!!t.locked,this.element.appendChild(this.gridview.element),this.layout(0,0,!0),this.addDisposables(this.gridview.onDidMaximizedNodeChange((e=>{this._onDidMaximizedChange.fire({panel:e.view,isMaximized:e.isMaximized})})),this.gridview.onDidViewVisibilityChange((()=>this._onDidViewVisibilityChangeMicroTaskQueue.fire())),this.onDidViewVisibilityChangeMicroTaskQueue((()=>{this.layout(this.width,this.height,!0)})),g.from((()=>{var e;null===(e=this.element.parentElement)||void 0===e||e.removeChild(this.element)})),this.gridview.onDidChange((()=>{this._bufferOnDidLayoutChange.fire()})),m.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)((()=>{this._bufferOnDidLayoutChange.fire()})),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(e,t){this.gridview.setViewVisible(ve(e.element),t),this._bufferOnDidLayoutChange.fire()}isVisible(e){return this.gridview.isViewVisible(ve(e.element))}updateOptions(e){var t,i,n,o;e.proportionalLayout,e.orientation&&(this.gridview.orientation=e.orientation),"disableResizing"in e&&(this.disableResizing=null!==(t=e.disableAutoResizing)&&void 0!==t&&t),"locked"in e&&(this.locked=null!==(i=e.locked)&&void 0!==i&&i),"margin"in e&&(this.gridview.margin=null!==(n=e.margin)&&void 0!==n?n:0),"className"in e&&this._classNames.setClassNames(null!==(o=e.className)&&void 0!==o?o:"")}maximizeGroup(e){this.gridview.maximizeView(e),this.doSetGroupActive(e)}isMaximizedGroup(e){return this.gridview.maximizedView()===e}exitMaximizedGroup(){this.gridview.exitMaximizedView()}hasMaximizedGroup(){return this.gridview.hasMaximizedView()}doAddGroup(e,t=[0],i){this.gridview.addView(e,null!=i?i:ne.Distribute,t),this._onDidAdd.fire(e)}doRemoveGroup(e,t){if(!this._groups.has(e.id))throw new Error("invalid operation");const i=this._groups.get(e.id),n=this.gridview.remove(e,ne.Distribute);if(i&&!(null==t?void 0:t.skipDispose)&&(i.disposable.dispose(),i.value.dispose(),this._groups.delete(e.id),this._onDidRemove.fire(e)),!(null==t?void 0:t.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupActive(e.length>0?e[0].value:void 0)}return n}getPanel(e){var t;return null===(t=this._groups.get(e))||void 0===t?void 0:t.value}doSetGroupActive(e){this._activeGroup!==e&&(this._activeGroup&&this._activeGroup.setActive(!1),e&&e.setActive(!0),this._activeGroup=e,this._onDidActiveChange.fire(e))}removeGroup(e){this.doRemoveGroup(e)}moveToNext(e){var t;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=ve(e.group.element),n=null===(t=this.gridview.next(i))||void 0===t?void 0:t.view;this.doSetGroupActive(n)}moveToPrevious(e){var t;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const i=ve(e.group.element),n=null===(t=this.gridview.previous(i))||void 0===t?void 0:t.view;this.doSetGroupActive(n)}layout(e,t,i){(i||e!==this.width||t!==this.height)&&(this.gridview.element.style.height=`${t}px`,this.gridview.element.style.width=`${e}px`,this.gridview.layout(e,t))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const e of this.groups)e.dispose();this.gridview.dispose(),super.dispose()}}class Se{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get length(){return this.component.length}get orientation(){return this.component.orientation}get panels(){return this.component.panels}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}constructor(e){this.component=e}removePanel(e,t){this.component.removePanel(e,t)}focus(){this.component.focus()}getPanel(e){return this.component.getPanel(e)}layout(e,t){return this.component.layout(e,t)}addPanel(e){return this.component.addPanel(e)}movePanel(e,t){this.component.movePanel(e,t)}fromJSON(e){this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Ae{get minimumSize(){return this.component.minimumSize}get maximumSize(){return this.component.maximumSize}get width(){return this.component.width}get height(){return this.component.height}get panels(){return this.component.panels}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidAddView(){return this.component.onDidAddView}get onDidRemoveView(){return this.component.onDidRemoveView}get onDidDrop(){return this.component.onDidDrop}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}constructor(e){this.component=e}removePanel(e){this.component.removePanel(e)}getPanel(e){return this.component.getPanel(e)}movePanel(e,t){this.component.movePanel(e,t)}focus(){this.component.focus()}layout(e,t){this.component.layout(e,t)}addPanel(e){return this.component.addPanel(e)}fromJSON(e){this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class ke{get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidAddPanel(){return this.component.onDidAddGroup}get onDidRemovePanel(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActiveGroupChange}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get panels(){return this.component.groups}get orientation(){return this.component.orientation}set orientation(e){this.component.updateOptions({orientation:e})}constructor(e){this.component=e}focus(){this.component.focus()}layout(e,t,i=!1){this.component.layout(e,t,i)}addPanel(e){return this.component.addPanel(e)}removePanel(e,t){this.component.removePanel(e,t)}movePanel(e,t){this.component.movePanel(e,t)}getPanel(e){return this.component.getPanel(e)}fromJSON(e){return this.component.fromJSON(e)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Ee{get id(){return this.component.id}get width(){return this.component.width}get height(){return this.component.height}get minimumHeight(){return this.component.minimumHeight}get maximumHeight(){return this.component.maximumHeight}get minimumWidth(){return this.component.minimumWidth}get maximumWidth(){return this.component.maximumWidth}get size(){return this.component.size}get totalPanels(){return this.component.totalPanels}get onDidActiveGroupChange(){return this.component.onDidActiveGroupChange}get onDidAddGroup(){return this.component.onDidAddGroup}get onDidRemoveGroup(){return this.component.onDidRemoveGroup}get onDidActivePanelChange(){return this.component.onDidActivePanelChange}get onDidAddPanel(){return this.component.onDidAddPanel}get onDidRemovePanel(){return this.component.onDidRemovePanel}get onDidMovePanel(){return this.component.onDidMovePanel}get onDidLayoutFromJSON(){return this.component.onDidLayoutFromJSON}get onDidLayoutChange(){return this.component.onDidLayoutChange}get onDidDrop(){return this.component.onDidDrop}get onWillDrop(){return this.component.onWillDrop}get onWillShowOverlay(){return this.component.onWillShowOverlay}get onWillDragGroup(){return this.component.onWillDragGroup}get onWillDragPanel(){return this.component.onWillDragPanel}get onUnhandledDragOverEvent(){return this.component.onUnhandledDragOverEvent}get onDidPopoutGroupSizeChange(){return this.component.onDidPopoutGroupSizeChange}get onDidPopoutGroupPositionChange(){return this.component.onDidPopoutGroupPositionChange}get onDidOpenPopoutWindowFail(){return this.component.onDidOpenPopoutWindowFail}get panels(){return this.component.panels}get groups(){return this.component.groups}get activePanel(){return this.component.activePanel}get activeGroup(){return this.component.activeGroup}constructor(e){this.component=e}focus(){this.component.focus()}getPanel(e){return this.component.getGroupPanel(e)}layout(e,t,i=!1){this.component.layout(e,t,i)}addPanel(e){return this.component.addPanel(e)}removePanel(e){this.component.removePanel(e)}addGroup(e){return this.component.addGroup(e)}closeAllGroups(){return this.component.closeAllGroups()}removeGroup(e){this.component.removeGroup(e)}getGroup(e){return this.component.getPanel(e)}addFloatingGroup(e,t){return this.component.addFloatingGroup(e,t)}fromJSON(e,t){this.component.fromJSON(e,t)}toJSON(){return this.component.toJSON()}clear(){this.component.clear()}moveToNext(e){this.component.moveToNext(e)}moveToPrevious(e){this.component.moveToPrevious(e)}maximizeGroup(e){this.component.maximizeGroup(e.group)}hasMaximizedGroup(){return this.component.hasMaximizedGroup()}exitMaximizedGroup(){this.component.exitMaximizedGroup()}get onDidMaximizedGroupChange(){return this.component.onDidMaximizedGroupChange}addPopoutGroup(e,t){return this.component.addPopoutGroup(e,t)}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class Pe extends P{constructor(e,t){super(),this.el=e,this.disabled=t,this.dataDisposable=new O,this.pointerEventsDisposable=new O,this._onDragStart=new A,this.onDragStart=this._onDragStart.event,this.addDisposables(this._onDragStart,this.dataDisposable,this.pointerEventsDisposable),this.configure()}setDisabled(e){this.disabled=e}isCancelled(e){return!1}configure(){this.addDisposables(this._onDragStart,k(this.el,"dragstart",(e=>{if(e.defaultPrevented||this.isCancelled(e)||this.disabled)return void e.preventDefault();const t=F();if(this.pointerEventsDisposable.value={dispose:()=>{t.release()}},this.el.classList.add("dv-dragged"),setTimeout((()=>this.el.classList.remove("dv-dragged")),0),this.dataDisposable.value=this.getData(e),this._onDragStart.fire(e),e.dataTransfer){e.dataTransfer.effectAllowed="move";e.dataTransfer.items.length>0||e.dataTransfer.setData("text/plain","")}})),k(this.el,"dragend",(()=>{this.pointerEventsDisposable.dispose(),setTimeout((()=>{this.dataDisposable.dispose()}),0)})))}}class Oe extends P{constructor(e,t){super(),this.element=e,this.callbacks=t,this.target=null,this.registerListeners()}onDragEnter(e){this.target=e.target,this.callbacks.onDragEnter(e)}onDragOver(e){e.preventDefault(),this.callbacks.onDragOver&&this.callbacks.onDragOver(e)}onDragLeave(e){this.target===e.target&&(this.target=null,this.callbacks.onDragLeave(e))}onDragEnd(e){this.target=null,this.callbacks.onDragEnd(e)}onDrop(e){this.callbacks.onDrop(e)}registerListeners(){this.addDisposables(k(this.element,"dragenter",(e=>{this.onDragEnter(e)}),!0)),this.addDisposables(k(this.element,"dragover",(e=>{this.onDragOver(e)}),!0)),this.addDisposables(k(this.element,"dragleave",(e=>{this.onDragLeave(e)}))),this.addDisposables(k(this.element,"dragend",(e=>{this.onDragEnd(e)}))),this.addDisposables(k(this.element,"drop",(e=>{this.onDrop(e)})))}}class Ie extends x{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(e){super(),this.options=e}}function Ge(e){switch(e){case"above":return"top";case"below":return"bottom";case"left":return"left";case"right":return"right";case"within":return"center";default:throw new Error(`invalid direction '${e}'`)}}function Ve(e){switch(e){case"top":return"above";case"bottom":return"below";case"left":return"left";case"right":return"right";case"center":return"within";default:throw new Error(`invalid position '${e}'`)}}const Ne={value:20,type:"percentage"},Te={value:50,type:"percentage"};class Le extends P{get disabled(){return this._disabled}set disabled(e){this._disabled=e}get state(){return this._state}constructor(e,t){super(),this.element=e,this.options=t,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._disabled=!1,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new Oe(this.element,{onDragEnter:()=>{var e,t,i;null===(i=null===(t=(e=this.options).getOverrideTarget)||void 0===t?void 0:t.call(e))||void 0===i||i.getElements()},onDragOver:e=>{var t,i,n,o,s,r,a;Le.ACTUAL_TARGET=this;const d=null===(i=(t=this.options).getOverrideTarget)||void 0===i?void 0:i.call(t);if(0===this._acceptedTargetZonesSet.size){if(d)return;return void this.removeDropTarget()}const h=null!==(s=null===(o=(n=this.options).getOverlayOutline)||void 0===o?void 0:o.call(n))&&void 0!==s?s:this.element,l=h.offsetWidth,p=h.offsetHeight;if(0===l||0===p)return;const c=e.currentTarget.getBoundingClientRect(),v=(null!==(r=e.clientX)&&void 0!==r?r:0)-c.left,u=(null!==(a=e.clientY)&&void 0!==a?a:0)-c.top,m=this.calculateQuadrant(this._acceptedTargetZonesSet,v,u,l,p);if(this.isAlreadyUsed(e)||null===m)return void this.removeDropTarget();if(!this.options.canDisplayOverlay(e,m)){if(d)return;return void this.removeDropTarget()}const g=new Ie({nativeEvent:e,position:m});this._onWillShowOverlay.fire(g),g.defaultPrevented?this.removeDropTarget():(this.markAsUsed(e),d||this.targetElement||(this.targetElement=document.createElement("div"),this.targetElement.className="dv-drop-target-dropzone",this.overlayElement=document.createElement("div"),this.overlayElement.className="dv-drop-target-selection",this._state="center",this.targetElement.appendChild(this.overlayElement),h.classList.add("dv-drop-target"),h.append(this.targetElement)),this.toggleClasses(m,l,p),this._state=m)},onDragLeave:()=>{var e,t;(null===(t=(e=this.options).getOverrideTarget)||void 0===t?void 0:t.call(e))||this.removeDropTarget()},onDragEnd:e=>{var t,i;const n=null===(i=(t=this.options).getOverrideTarget)||void 0===i?void 0:i.call(t);n&&Le.ACTUAL_TARGET===this&&this._state&&(e.stopPropagation(),this._onDrop.fire({position:this._state,nativeEvent:e})),this.removeDropTarget(),null==n||n.clear()},onDrop:e=>{var t,i,n;e.preventDefault();const o=this._state;this.removeDropTarget(),null===(n=null===(i=(t=this.options).getOverrideTarget)||void 0===i?void 0:i.call(t))||void 0===n||n.clear(),o&&(e.stopPropagation(),this._onDrop.fire({position:o,nativeEvent:e}))}}),this.addDisposables(this._onDrop,this._onWillShowOverlay,this.dnd)}setTargetZones(e){this._acceptedTargetZonesSet=new Set(e)}setOverlayModel(e){this.options.overlayModel=e}dispose(){this.removeDropTarget(),super.dispose()}markAsUsed(e){e[Le.USED_EVENT_ID]=!0}isAlreadyUsed(e){const t=e[Le.USED_EVENT_ID];return"boolean"==typeof t&&t}toggleClasses(e,t,i){var n,o,s,r,a,d,h;const l=null===(o=(n=this.options).getOverrideTarget)||void 0===o?void 0:o.call(n);if(!l&&!this.overlayElement)return;const p=t<100,c=i<100,v="left"===e,u="right"===e,m="top"===e,g="bottom"===e,b=!p&&u,f=!p&&v,w=!c&&m,_=!c&&g;let y=1;const D=null!==(r=null===(s=this.options.overlayModel)||void 0===s?void 0:s.size)&&void 0!==r?r:Te;if("percentage"===D.type?y=X(D.value,0,100)/100:((b||f)&&(y=X(0,D.value,t)/t),(w||_)&&(y=X(0,D.value,i)/i)),l){const n=null!==(h=null===(d=(a=this.options).getOverlayOutline)||void 0===d?void 0:d.call(a))&&void 0!==h?h:this.element,o=n.getBoundingClientRect(),s=l.getElements(void 0,n),r=s.root,c=s.overlay,D=r.getBoundingClientRect(),x=o.top-D.top,C=o.left-D.left,z={top:x,left:C,width:t,height:i};if(b?(z.left=C+t*(1-y),z.width=t*y):f?z.width=t*y:w?z.height=i*y:_&&(z.top=x+i*(1-y),z.height=i*y),p&&v&&(z.width=4),p&&u&&(z.left=C+t-4,z.width=4),!function(e,t){const{top:i,left:n,width:o,height:s}=t,r=`${Math.round(i)}px`,a=`${Math.round(n)}px`,d=`${Math.round(o)}px`,h=`${Math.round(s)}px`;return e.style.top!==r||e.style.left!==a||e.style.width!==d||e.style.height!==h}(c,z))return;return function(e,t){const{top:i,left:n,width:o,height:s}=t,r=`${Math.round(i)}px`,a=`${Math.round(n)}px`,d=`${Math.round(o)}px`,h=`${Math.round(s)}px`;e.style.top=r,e.style.left=a,e.style.width=d,e.style.height=h,e.style.visibility="visible",e.style.transform&&""!==e.style.transform||(e.style.transform="translate3d(0, 0, 0)")}(c,z),c.className="dv-drop-target-anchor"+(this.options.className?` ${this.options.className}`:""),T(c,"dv-drop-target-left",v),T(c,"dv-drop-target-right",u),T(c,"dv-drop-target-top",m),T(c,"dv-drop-target-bottom",g),T(c,"dv-drop-target-center","center"===e),void(s.changed&&(T(c,"dv-drop-target-anchor-container-changed",!0),setTimeout((()=>{T(c,"dv-drop-target-anchor-container-changed",!1)}),10)))}if(!this.overlayElement)return;const x={top:"0px",left:"0px",width:"100%",height:"100%"};b?(x.left=100*(1-y)+"%",x.width=100*y+"%"):f?x.width=100*y+"%":w?x.height=100*y+"%":_&&(x.top=100*(1-y)+"%",x.height=100*y+"%"),function(e,t){const{top:i,left:n,width:o,height:s}=t;e.style.top=i,e.style.left=n,e.style.width=o,e.style.height=s,e.style.visibility="visible",e.style.transform&&""!==e.style.transform||(e.style.transform="translate3d(0, 0, 0)")}(this.overlayElement,x),T(this.overlayElement,"dv-drop-target-small-vertical",c),T(this.overlayElement,"dv-drop-target-small-horizontal",p),T(this.overlayElement,"dv-drop-target-left",v),T(this.overlayElement,"dv-drop-target-right",u),T(this.overlayElement,"dv-drop-target-top",m),T(this.overlayElement,"dv-drop-target-bottom",g),T(this.overlayElement,"dv-drop-target-center","center"===e)}calculateQuadrant(e,t,i,n,o){var s,r;const a=null!==(r=null===(s=this.options.overlayModel)||void 0===s?void 0:s.activationSize)&&void 0!==r?r:Ne;return"percentage"===a.type?function(e,t,i,n,o,s){const r=100*t/n,a=100*i/o;if(e.has("left")&&r<s)return"left";if(e.has("right")&&r>100-s)return"right";if(e.has("top")&&a<s)return"top";if(e.has("bottom")&&a>100-s)return"bottom";if(!e.has("center"))return null;return"center"}(e,t,i,n,o,a.value):function(e,t,i,n,o,s){if(e.has("left")&&t<s)return"left";if(e.has("right")&&t>n-s)return"right";if(e.has("top")&&i<s)return"top";if(e.has("bottom")&&i>o-s)return"bottom";if(!e.has("center"))return null;return"center"}(e,t,i,n,o,a.value)}removeDropTarget(){var e;this.targetElement&&(this._state=void 0,null===(e=this.targetElement.parentElement)||void 0===e||e.classList.remove("dv-drop-target"),this.targetElement.remove(),this.targetElement=void 0,this.overlayElement=void 0)}}Le.USED_EVENT_ID="__dockview_droptarget_event_is_used__";const Re=(()=>{const e={disableAutoResizing:void 0,disableDnd:void 0,className:void 0};return Object.keys(e)})();class Me extends C{constructor(e,t,i,n){super(),this.nativeEvent=e,this.position=t,this.getData=i,this.panel=n}}class We extends x{constructor(){super()}}class He extends P{get isFocused(){return this._isFocused}get isActive(){return this._isActive}get isVisible(){return this._isVisible}get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.id=e,this.component=t,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new O,this._onDidDimensionChange=new A,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new A,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new A,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new A,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new A,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new A,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new A,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new A,this.onDidParametersChange=this._onDidParametersChange.event,this.addDisposables(this.onDidFocusChange((e=>{this._isFocused=e.isFocused})),this.onDidActiveChange((e=>{this._isActive=e.isActive})),this.onDidVisibilityChange((e=>{this._isVisible=e.isVisible})),this.onDidDimensionsChange((e=>{this._width=e.width,this._height=e.height})),this.panelUpdatesDisposable,this._onDidDimensionChange,this._onDidChangeFocus,this._onDidVisibilityChange,this._onDidActiveChange,this._onWillFocus,this._onActiveChange,this._onWillFocus,this._onWillVisibilityChange,this._onDidParametersChange)}getParameters(){return this._parameters}initialize(e){this.panelUpdatesDisposable.value=this._onDidParametersChange.event((t=>{this._parameters=t,e.update({params:t})}))}setVisible(e){this._onWillVisibilityChange.fire({isVisible:e})}setActive(){this._onActiveChange.fire()}updateParameters(e){this._onDidParametersChange.fire(e)}}class je extends He{constructor(e,t){super(e,t),this._onDidConstraintsChangeInternal=new A,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new A({replay:!0}),this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new A,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class Fe extends je{set pane(e){this._pane=e}constructor(e,t){super(e,t),this._onDidExpansionChange=new A({replay:!0}),this.onDidExpansionChange=this._onDidExpansionChange.event,this._onMouseEnter=new A({}),this.onMouseEnter=this._onMouseEnter.event,this._onMouseLeave=new A({}),this.onMouseLeave=this._onMouseLeave.event,this.addDisposables(this._onDidExpansionChange,this._onMouseEnter,this._onMouseLeave)}setExpanded(e){var t;null===(t=this._pane)||void 0===t||t.setExpanded(e)}get isExpanded(){var e;return!!(null===(e=this._pane)||void 0===e?void 0:e.isExpanded())}}class Be extends P{get element(){return this._element}get width(){return this._width}get height(){return this._height}get params(){var e;return null===(e=this._params)||void 0===e?void 0:e.params}constructor(e,t,i){super(),this.id=e,this.component=t,this.api=i,this._height=0,this._width=0,this._element=document.createElement("div"),this._element.tabIndex=-1,this._element.style.outline="none",this._element.style.height="100%",this._element.style.width="100%",this._element.style.overflow="hidden";const n=R(this._element);this.addDisposables(this.api,n.onDidFocus((()=>{this.api._onDidChangeFocus.fire({isFocused:!0})})),n.onDidBlur((()=>{this.api._onDidChangeFocus.fire({isFocused:!1})})),n)}focus(){const e=new We;this.api._onWillFocus.fire(e),e.defaultPrevented||this._element.focus()}layout(e,t){this._width=e,this._height=t,this.api._onDidDimensionChange.fire({width:e,height:t}),this.part&&this._params&&this.part.update(this._params.params)}init(e){this._params=e,this.part=this.getComponent()}update(e){var t,i;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},null===(t=this._params)||void 0===t?void 0:t.params),e.params)});for(const t of Object.keys(e.params))void 0===e.params[t]&&delete this._params.params[t];null===(i=this.part)||void 0===i||i.update({params:this._params.params})}toJSON(){var e,t;const i=null!==(t=null===(e=this._params)||void 0===e?void 0:e.params)&&void 0!==t?t:{};return{id:this.id,component:this.component,params:Object.keys(i).length>0?i:void 0}}dispose(){var e;this.api.dispose(),null===(e=this.part)||void 0===e||e.dispose(),super.dispose()}}class Ue extends Be{set orientation(e){this._orientation=e}get orientation(){return this._orientation}get minimumSize(){return this.headerSize+(this.isExpanded()?this._minimumBodySize:0)}get maximumSize(){return this.headerSize+(this.isExpanded()?this._maximumBodySize:0)}get size(){return this._size}get orthogonalSize(){return this._orthogonalSize}set orthogonalSize(e){this._orthogonalSize=e}get minimumBodySize(){return this._minimumBodySize}set minimumBodySize(e){this._minimumBodySize="number"==typeof e?e:0}get maximumBodySize(){return this._maximumBodySize}set maximumBodySize(e){this._maximumBodySize="number"==typeof e?e:Number.POSITIVE_INFINITY}get headerVisible(){return this._headerVisible}set headerVisible(e){this._headerVisible=e,this.header.style.display=e?"":"none"}constructor(e){super(e.id,e.component,new Fe(e.id,e.component)),this._onDidChangeExpansionState=new A({replay:!0}),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._orthogonalSize=0,this._size=0,this._isExpanded=!1,this.api.pane=this,this.api.initialize(this),this.headerSize=e.headerSize,this.headerComponent=e.headerComponent,this._minimumBodySize=e.minimumBodySize,this._maximumBodySize=e.maximumBodySize,this._isExpanded=e.isExpanded,this._headerVisible=e.isHeaderVisible,this._onDidChangeExpansionState.fire(this.isExpanded()),this._orientation=e.orientation,this.element.classList.add("dv-pane"),this.addDisposables(this.api.onWillVisibilityChange((e=>{const{isVisible:t}=e,{accessor:i}=this._params;i.setVisible(this,t)})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({size:e.size})})),k(this.element,"mouseenter",(e=>{this.api._onMouseEnter.fire(e)})),k(this.element,"mouseleave",(e=>{this.api._onMouseLeave.fire(e)}))),this.addDisposables(this._onDidChangeExpansionState,this.onDidChangeExpansionState((e=>{this.api._onDidExpansionChange.fire({isExpanded:e})})),this.api.onDidFocusChange((e=>{this.header&&(e.isFocused?N(this.header,"focused"):V(this.header,"focused"))}))),this.renderOnce()}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}isExpanded(){return this._isExpanded}setExpanded(e){this._isExpanded!==e&&(this._isExpanded=e,e?(this.animationTimer&&clearTimeout(this.animationTimer),this.body&&this.element.appendChild(this.body)):this.animationTimer=setTimeout((()=>{var e;null===(e=this.body)||void 0===e||e.remove()}),200),this._onDidChange.fire(e?{size:this.width}:{}),this._onDidChangeExpansionState.fire(e))}layout(e,t){this._size=e,this._orthogonalSize=t;const[i,n]=this.orientation===ee.HORIZONTAL?[e,t]:[t,e];super.layout(i,n)}init(e){var t,i;super.init(e),"number"==typeof e.minimumBodySize&&(this.minimumBodySize=e.minimumBodySize),"number"==typeof e.maximumBodySize&&(this.maximumBodySize=e.maximumBodySize),this.bodyPart=this.getBodyComponent(),this.headerPart=this.getHeaderComponent(),this.bodyPart.init(Object.assign(Object.assign({},e),{api:this.api})),this.headerPart.init(Object.assign(Object.assign({},e),{api:this.api})),null===(t=this.body)||void 0===t||t.append(this.bodyPart.element),null===(i=this.header)||void 0===i||i.append(this.headerPart.element),"boolean"==typeof e.isExpanded&&this.setExpanded(e.isExpanded)}toJSON(){const e=this._params;return Object.assign(Object.assign({},super.toJSON()),{headerComponent:this.headerComponent,title:e.title})}renderOnce(){this.header=document.createElement("div"),this.header.tabIndex=0,this.header.className="dv-pane-header",this.header.style.height=`${this.headerSize}px`,this.header.style.lineHeight=`${this.headerSize}px`,this.header.style.minHeight=`${this.headerSize}px`,this.header.style.maxHeight=`${this.headerSize}px`,this.element.appendChild(this.header),this.body=document.createElement("div"),this.body.className="dv-pane-body",this.element.appendChild(this.body)}getComponent(){return{update:e=>{var t,i;null===(t=this.bodyPart)||void 0===t||t.update({params:e}),null===(i=this.headerPart)||void 0===i||i.update({params:e})},dispose:()=>{var e,t;null===(e=this.bodyPart)||void 0===e||e.dispose(),null===(t=this.headerPart)||void 0===t||t.dispose()}}}}class $e extends Ue{constructor(e){super({id:e.id,component:e.component,headerComponent:e.headerComponent,orientation:e.orientation,isExpanded:e.isExpanded,isHeaderVisible:!0,headerSize:e.headerSize,minimumBodySize:e.minimumBodySize,maximumBodySize:e.maximumBodySize}),this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.accessor=e.accessor,this.addDisposables(this._onDidDrop,this._onUnhandledDragOverEvent),e.disableDnd||this.initDragFeatures()}initDragFeatures(){if(!this.header)return;const e=this.id,t=this.accessor.id;this.header.draggable=!0,this.handler=new class extends Pe{getData(){return _.getInstance().setData([new w(t,e)],w.prototype),{dispose:()=>{_.getInstance().clearData(w.prototype)}}}}(this.header),this.target=new Le(this.element,{acceptedTargetZones:["top","bottom"],overlayModel:{activationSize:{type:"percentage",value:50}},canDisplayOverlay:(e,t)=>{const i=D();if(i&&i.paneId!==this.id&&i.viewId===this.accessor.id)return!0;const n=new Me(e,t,D,this);return this._onUnhandledDragOverEvent.fire(n),n.isAccepted}}),this.addDisposables(this._onDidDrop,this.handler,this.target,this.target.onDrop((e=>{this.onDrop(e)})))}onDrop(e){const t=D();if(!t||t.viewId!==this.accessor.id)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,api:new Ae(this.accessor),getData:D}));const i=this._params.containerApi,n=t.paneId,o=i.getPanel(n);if(!o)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,getData:D,api:new Ae(this.accessor)}));const s=i.panels,r=s.indexOf(o);let a=i.panels.indexOf(this);"left"!==e.position&&"top"!==e.position||(a=Math.max(0,a-1)),"right"!==e.position&&"bottom"!==e.position||(r>a&&a++,a=Math.min(s.length-1,a)),i.movePanel(r,a)}}class Je extends P{get element(){return this._element}constructor(e,t){super(),this.accessor=e,this.group=t,this.disposable=new O,this._onDidFocus=new A,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new A,this.onDidBlur=this._onDidBlur.event,this._element=document.createElement("div"),this._element.className="dv-content-container",this._element.tabIndex=-1,this.addDisposables(this._onDidFocus,this._onDidBlur);const i=t.dropTargetContainer;this.dropTarget=new Le(this.element,{getOverlayOutline:()=>{var t;return"group"===(null===(t=e.options.theme)||void 0===t?void 0:t.dndPanelOverlay)?this.element.parentElement:null},className:"dv-drop-target-content",acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(e,t)=>{if("no-drop-target"===this.group.locked||this.group.locked&&"center"===t)return!1;const i=y();return!(!i&&e.shiftKey&&"floating"!==this.group.location.type)&&(!(!i||i.viewId!==this.accessor.id)||this.group.canDisplayOverlay(e,t,"content"))},getOverrideTarget:i?()=>i.model:void 0}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(e,t={asActive:!0}){const i=t.asActive||this.panel&&this.group.isPanelActive(this.panel);let n;switch(this.panel&&this.panel.view.content.element.parentElement===this._element&&this._element.removeChild(this.panel.view.content.element),this.panel=e,e.api.renderer){case"onlyWhenVisible":this.group.renderContainer.detatch(e),this.panel&&i&&this._element.appendChild(this.panel.view.content.element),n=this._element;break;case"always":e.view.content.element.parentElement===this._element&&this._element.removeChild(e.view.content.element),n=this.group.renderContainer.attach({panel:e,referenceContainer:this});break;default:throw new Error(`dockview: invalid renderer type '${e.api.renderer}'`)}if(i){const e=R(n);this.focusTracker=e;const t=new P;t.addDisposables(e,e.onDidFocus((()=>this._onDidFocus.fire())),e.onDidBlur((()=>this._onDidBlur.fire()))),this.disposable.value=t}}openPanel(e){this.panel!==e&&this.renderPanel(e)}layout(e,t){}closePanel(){var e;this.panel&&"onlyWhenVisible"===this.panel.api.renderer&&(null===(e=this.panel.view.content.element.parentElement)||void 0===e||e.removeChild(this.panel.view.content.element)),this.panel=void 0}dispose(){this.disposable.dispose(),super.dispose()}refreshFocusState(){var e;(null===(e=this.focusTracker)||void 0===e?void 0:e.refreshState)&&this.focusTracker.refreshState()}}function Ze(e,t,i){var n,o;N(t,"dv-dragged"),t.style.top="-9999px",document.body.appendChild(t),e.setDragImage(t,null!==(n=null==i?void 0:i.x)&&void 0!==n?n:0,null!==(o=null==i?void 0:i.y)&&void 0!==o?o:0),setTimeout((()=>{V(t,"dv-dragged"),t.remove()}),0)}class Ye extends Pe{constructor(e,t,i,n,o){super(e,o),this.accessor=t,this.group=i,this.panel=n,this.panelTransfer=_.getInstance()}getData(e){return this.panelTransfer.setData([new f(this.accessor.id,this.group.id,this.panel.id)],f.prototype),{dispose:()=>{this.panelTransfer.clearData(f.prototype)}}}}class Xe extends P{get element(){return this._element}constructor(e,t,i){super(),this.panel=e,this.accessor=t,this.group=i,this.content=void 0,this._onPointDown=new A,this.onPointerDown=this._onPointDown.event,this._onDropped=new A,this.onDrop=this._onDropped.event,this._onDragStart=new A,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-tab",this._element.tabIndex=0,this._element.draggable=!this.accessor.options.disableDnd,T(this.element,"dv-inactive-tab",!0),this.dragHandler=new Ye(this._element,this.accessor,this.group,this.panel,!!this.accessor.options.disableDnd),this.dropTarget=new Le(this._element,{acceptedTargetZones:["left","right"],overlayModel:{activationSize:{value:50,type:"percentage"}},canDisplayOverlay:(e,t)=>{if(this.group.locked)return!1;const i=y();return!(!i||this.accessor.id!==i.viewId)||this.group.model.canDisplayOverlay(e,t,"tab")},getOverrideTarget:()=>{var e;return null===(e=i.model.dropTargetContainer)||void 0===e?void 0:e.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this._onPointDown,this._onDropped,this._onDragStart,this.dragHandler.onDragStart((e=>{if(e.dataTransfer){const t=getComputedStyle(this.element),i=this.element.cloneNode(!0);Array.from(t).forEach((e=>i.style.setProperty(e,t.getPropertyValue(e),t.getPropertyPriority(e)))),i.style.position="absolute",Ze(e.dataTransfer,i,{y:-10,x:30})}this._onDragStart.fire(e)})),this.dragHandler,k(this._element,"pointerdown",(e=>{this._onPointDown.fire(e)})),this.dropTarget.onDrop((e=>{this._onDropped.fire(e)})),this.dropTarget)}setActive(e){T(this.element,"dv-active-tab",e),T(this.element,"dv-inactive-tab",!e)}setContent(e){this.content&&this._element.removeChild(this.content.element),this.content=e,this._element.appendChild(this.content.element)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,this.dragHandler.setDisabled(!!this.accessor.options.disableDnd)}dispose(){super.dispose()}}class qe{get kind(){return this.options.kind}get nativeEvent(){return this.event.nativeEvent}get position(){return this.event.position}get defaultPrevented(){return this.event.defaultPrevented}get panel(){return this.options.panel}get api(){return this.options.api}get group(){return this.options.group}preventDefault(){this.event.preventDefault()}getData(){return this.options.getData()}constructor(e,t){this.event=e,this.options=t}}class Ke extends Pe{constructor(e,t,i,n){super(e,n),this.accessor=t,this.group=i,this.panelTransfer=_.getInstance(),this.addDisposables(k(e,"pointerdown",(e=>{e.shiftKey&&(e[W]=!0)}),!0))}isCancelled(e){return"floating"===this.group.api.location.type&&!e.shiftKey}getData(e){const t=e.dataTransfer;this.panelTransfer.setData([new f(this.accessor.id,this.group.id,null)],f.prototype);const i=window.getComputedStyle(this.el),n=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),o=i.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(t){const e=document.createElement("div");e.style.backgroundColor=n,e.style.color=o,e.style.padding="2px 8px",e.style.height="24px",e.style.fontSize="11px",e.style.lineHeight="20px",e.style.borderRadius="12px",e.style.position="absolute",e.style.pointerEvents="none",e.style.top="-9999px",e.textContent=`Multiple Panels (${this.group.size})`,Ze(t,e,{y:-10,x:30})}return{dispose:()=>{this.panelTransfer.clearData(f.prototype)}}}}class Qe extends P{get element(){return this._element}constructor(e,t){super(),this.accessor=e,this.group=t,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onDragStart=new A,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!this.accessor.options.disableDnd,T(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.addDisposables(this._onDrop,this._onDragStart,k(this._element,"pointerdown",(()=>{this.accessor.doSetGroupActive(this.group)}))),this.handler=new Ke(this._element,e,t,!!this.accessor.options.disableDnd),this.dropTarget=new Le(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(e,i)=>{const n=y();return!(!n||this.accessor.id!==n.viewId)||t.model.canDisplayOverlay(e,i,"header_space")},getOverrideTarget:()=>{var e;return null===(e=t.model.dropTargetContainer)||void 0===e?void 0:e.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this.handler,this.handler.onDragStart((e=>{this._onDragStart.fire(e)})),this.dropTarget.onDrop((e=>{this._onDrop.fire(e)})),this.dropTarget)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,T(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.handler.setDisabled(!!this.accessor.options.disableDnd)}}class et extends P{get element(){return this._element}constructor(e){super(),this.scrollableElement=e,this._scrollLeft=0,this._element=document.createElement("div"),this._element.className="dv-scrollable",this._horizontalScrollbar=document.createElement("div"),this._horizontalScrollbar.className="dv-scrollbar-horizontal",this.element.appendChild(e),this.element.appendChild(this._horizontalScrollbar),this.addDisposables(k(this.element,"wheel",(e=>{this._scrollLeft+=e.deltaY*et.MouseWheelSpeed,this.calculateScrollbarStyles()})),k(this._horizontalScrollbar,"pointerdown",(e=>{e.preventDefault(),T(this.element,"dv-scrollable-scrolling",!0);const t=e.clientX,i=this._scrollLeft,n=e=>{const n=e.clientX-t,{clientWidth:o}=this.element,{scrollWidth:s}=this.scrollableElement,r=o/s;this._scrollLeft=i+n/r,this.calculateScrollbarStyles()},o=()=>{T(this.element,"dv-scrollable-scrolling",!1),document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",o),document.removeEventListener("pointercancel",o)};document.addEventListener("pointermove",n),document.addEventListener("pointerup",o),document.addEventListener("pointercancel",o)})),k(this.element,"scroll",(()=>{this.calculateScrollbarStyles()})),k(this.scrollableElement,"scroll",(()=>{this._scrollLeft=this.scrollableElement.scrollLeft,this.calculateScrollbarStyles()})),G(this.element,(()=>{T(this.element,"dv-scrollable-resizing",!0),this._animationTimer&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout((()=>{clearTimeout(this._animationTimer),T(this.element,"dv-scrollable-resizing",!1)}),500),this.calculateScrollbarStyles()})))}calculateScrollbarStyles(){const{clientWidth:e}=this.element,{scrollWidth:t}=this.scrollableElement;if(t>e){const i=e*(e/t);this._horizontalScrollbar.style.width=`${i}px`,this._scrollLeft=X(this._scrollLeft,0,this.scrollableElement.scrollWidth-e),this.scrollableElement.scrollLeft=this._scrollLeft;const n=this._scrollLeft/(t-e);this._horizontalScrollbar.style.left=(e-i)*n+"px"}else this._horizontalScrollbar.style.width="0px",this._horizontalScrollbar.style.left="0px",this._scrollLeft=0}}et.MouseWheelSpeed=1;class tt extends P{get showTabsOverflowControl(){return this._showTabsOverflowControl}set showTabsOverflowControl(e){if(this._showTabsOverflowControl!=e&&(this._showTabsOverflowControl=e,e)){const e=new I(this._tabsList);this._observerDisposable.value=new P(e,e.onDidChange((e=>{const t=e.hasScrollX||e.hasScrollY;this.toggleDropdown({reset:!t})})),k(this._tabsList,"scroll",(()=>{this.toggleDropdown({reset:!1})})))}}get element(){return this._element}get panels(){return this._tabs.map((e=>e.value.panel.id))}get size(){return this._tabs.length}get tabs(){return this._tabs.map((e=>e.value))}constructor(e,t,i){if(super(),this.group=e,this.accessor=t,this._observerDisposable=new O,this._tabs=[],this.selectedIndex=-1,this._showTabsOverflowControl=!1,this._onTabDragStart=new A,this.onTabDragStart=this._onTabDragStart.event,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onOverflowTabsChange=new A,this.onOverflowTabsChange=this._onOverflowTabsChange.event,this._tabsList=document.createElement("div"),this._tabsList.className="dv-tabs-container dv-horizontal",this.showTabsOverflowControl=i.showTabsOverflowControl,"native"===t.options.scrollbars)this._element=this._tabsList;else{const e=new et(this._tabsList);this._element=e.element,this.addDisposables(e)}this.addDisposables(this._onOverflowTabsChange,this._observerDisposable,this._onWillShowOverlay,this._onDrop,this._onTabDragStart,k(this.element,"pointerdown",(e=>{if(e.defaultPrevented)return;0===e.button&&this.accessor.doSetGroupActive(this.group)})),g.from((()=>{for(const{value:e,disposable:t}of this._tabs)t.dispose(),e.dispose();this._tabs=[]})))}indexOf(e){return this._tabs.findIndex((t=>t.value.panel.id===e))}isActive(e){return this.selectedIndex>-1&&this._tabs[this.selectedIndex].value===e}setActivePanel(e){let t=0;for(const i of this._tabs){const n=e.id===i.value.panel.id;if(i.value.setActive(n),n){const e=i.value.element,n=e.parentElement;(t<n.scrollLeft||t+e.clientWidth>n.scrollLeft+n.clientWidth)&&(n.scrollLeft=t)}t+=i.value.element.clientWidth}}openPanel(e,t=this._tabs.length){if(this._tabs.find((t=>t.value.panel.id===e.id)))return;const i=new Xe(e,this.accessor,this.group);i.setContent(e.view.tab);const n=new P(i.onDragStart((t=>{this._onTabDragStart.fire({nativeEvent:t,panel:e})})),i.onPointerDown((t=>{if(t.defaultPrevented)return;const n=!this.accessor.options.disableFloatingGroups,o="floating"===this.group.api.location.type&&1===this.size;if(n&&!o&&t.shiftKey){t.preventDefault();const e=this.accessor.getGroupPanel(i.panel.id),{top:n,left:o}=i.element.getBoundingClientRect(),{top:s,left:r}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(e,{x:o-r,y:n-s,inDragMode:!0})}else if(0===t.button)this.group.activePanel!==e&&this.group.model.openPanel(e)})),i.onDrop((e=>{this._onDrop.fire({event:e.nativeEvent,index:this._tabs.findIndex((e=>e.value===i))})})),i.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new qe(e,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:y}))}))),o={value:i,disposable:n};this.addTab(o,t)}delete(e){const t=this.indexOf(e),i=this._tabs.splice(t,1)[0],{value:n,disposable:o}=i;o.dispose(),n.dispose(),n.element.remove()}addTab(e,t=this._tabs.length){if(t<0||t>this._tabs.length)throw new Error("invalid location");this._tabsList.insertBefore(e.value.element,this._tabsList.children[t]),this._tabs=[...this._tabs.slice(0,t),e,...this._tabs.slice(t)],this.selectedIndex<0&&(this.selectedIndex=t)}toggleDropdown(e){const t=e.reset?[]:this._tabs.filter((e=>!function(e,t){const i=j(e),n=j(t);return!(i.left<n.left||i.left+i.width>n.left+n.width)}(e.value.element,this._tabsList))).map((e=>e.value.panel.id));this._onOverflowTabsChange.fire({tabs:t,reset:e.reset})}updateDragAndDropState(){for(const e of this._tabs)e.value.updateDragAndDropState()}}const it=e=>{const t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttributeNS(null,"height",e.height),t.setAttributeNS(null,"width",e.width),t.setAttributeNS(null,"viewBox",e.viewbox),t.setAttributeNS(null,"aria-hidden","false"),t.setAttributeNS(null,"focusable","false"),t.classList.add("dv-svg");const i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttributeNS(null,"d",e.path),t.appendChild(i),t},nt=()=>it({width:"11",height:"11",viewbox:"0 0 15 25",path:"M2.15 24.1L0 21.95L9.9 12.05L0 2.15L2.15 0L14.2 12.05L2.15 24.1Z"});class ot extends P{get onTabDragStart(){return this.tabs.onTabDragStart}get panels(){return this.tabs.panels}get size(){return this.tabs.size}get hidden(){return this._hidden}set hidden(e){this._hidden=e,this.element.style.display=e?"none":""}get element(){return this._element}constructor(e,t){super(),this.accessor=e,this.group=t,this._hidden=!1,this.dropdownPart=null,this._overflowTabs=[],this._dropdownDisposable=new O,this._onDrop=new A,this.onDrop=this._onDrop.event,this._onGroupDragStart=new A,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",T(this._element,"dv-full-width-single-tab","fullwidth"===this.accessor.options.singleTabMode),this.rightActionsContainer=document.createElement("div"),this.rightActionsContainer.className="dv-right-actions-container",this.leftActionsContainer=document.createElement("div"),this.leftActionsContainer.className="dv-left-actions-container",this.preActionsContainer=document.createElement("div"),this.preActionsContainer.className="dv-pre-actions-container",this.tabs=new tt(t,e,{showTabsOverflowControl:!e.options.disableTabsOverflowList}),this.voidContainer=new Qe(this.accessor,this.group),this._element.appendChild(this.preActionsContainer),this._element.appendChild(this.tabs.element),this._element.appendChild(this.leftActionsContainer),this._element.appendChild(this.voidContainer.element),this._element.appendChild(this.rightActionsContainer),this.addDisposables(this.tabs.onDrop((e=>this._onDrop.fire(e))),this.tabs.onWillShowOverlay((e=>this._onWillShowOverlay.fire(e))),e.onDidOptionsChange((()=>{this.tabs.showTabsOverflowControl=!e.options.disableTabsOverflowList})),this.tabs.onOverflowTabsChange((e=>{this.toggleDropdown(e)})),this.tabs,this._onWillShowOverlay,this._onDrop,this._onGroupDragStart,this.voidContainer,this.voidContainer.onDragStart((e=>{this._onGroupDragStart.fire({nativeEvent:e,group:this.group})})),this.voidContainer.onDrop((e=>{this._onDrop.fire({event:e.nativeEvent,index:this.tabs.size})})),this.voidContainer.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new qe(e,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:y}))})),k(this.voidContainer.element,"pointerdown",(e=>{if(e.defaultPrevented)return;if(!this.accessor.options.disableFloatingGroups&&e.shiftKey&&"floating"!==this.group.api.location.type){e.preventDefault();const{top:t,left:i}=this.element.getBoundingClientRect(),{top:n,left:o}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:i-o+20,y:t-n+20,inDragMode:!0})}})))}show(){this.hidden||(this.element.style.display="")}hide(){this._element.style.display="none"}setRightActionsElement(e){this.rightActions!==e&&(this.rightActions&&(this.rightActions.remove(),this.rightActions=void 0),e&&(this.rightActionsContainer.appendChild(e),this.rightActions=e))}setLeftActionsElement(e){this.leftActions!==e&&(this.leftActions&&(this.leftActions.remove(),this.leftActions=void 0),e&&(this.leftActionsContainer.appendChild(e),this.leftActions=e))}setPrefixActionsElement(e){this.preActions!==e&&(this.preActions&&(this.preActions.remove(),this.preActions=void 0),e&&(this.preActionsContainer.appendChild(e),this.preActions=e))}isActive(e){return this.tabs.isActive(e)}indexOf(e){return this.tabs.indexOf(e)}setActive(e){}delete(e){this.tabs.delete(e),this.updateClassnames()}setActivePanel(e){this.tabs.setActivePanel(e)}openPanel(e,t=this.tabs.size){this.tabs.openPanel(e,t),this.updateClassnames()}closePanel(e){this.delete(e.id)}updateClassnames(){T(this._element,"dv-single-tab",1===this.size)}toggleDropdown(e){const t=e.reset?[]:e.tabs;if(this._overflowTabs=t,this._overflowTabs.length>0&&this.dropdownPart)return void this.dropdownPart.update({tabs:t.length});if(0===this._overflowTabs.length)return void this._dropdownDisposable.dispose();const i=document.createElement("div");i.className="dv-tabs-overflow-dropdown-root";const n=function(){const e=document.createElement("div");e.className="dv-tabs-overflow-dropdown-default";const t=document.createElement("span");t.textContent="";const i=nt();return e.appendChild(i),e.appendChild(t),{element:e,update:e=>{t.textContent=`${e.tabs}`}}}();n.update({tabs:t.length}),this.dropdownPart=n,i.appendChild(n.element),this.rightActionsContainer.prepend(i),this._dropdownDisposable.value=new P(g.from((()=>{var e,t;i.remove(),null===(t=null===(e=this.dropdownPart)||void 0===e?void 0:e.dispose)||void 0===t||t.call(e),this.dropdownPart=null})),k(i,"pointerdown",(e=>{e.preventDefault()}),{capture:!0}),k(i,"click",(e=>{const t=document.createElement("div");t.style.overflow="auto",t.className="dv-tabs-overflow-container";for(const e of this.tabs.tabs.filter((e=>this._overflowTabs.includes(e.panel.id)))){const i=this.group.panels.find((t=>t===e.panel)),n=i.view.createTabRenderer("headerOverflow").element,o=document.createElement("div");T(o,"dv-tab",!0),T(o,"dv-active-tab",i.api.isActive),T(o,"dv-inactive-tab",!i.api.isActive),o.addEventListener("click",(t=>{this.accessor.popupService.close(),t.defaultPrevented||(e.element.scrollIntoView(),e.panel.api.setActive())})),o.appendChild(n),t.appendChild(o)}const n=function(e){let t=e;for(;t&&("auto"===t.style.zIndex||""===t.style.zIndex);)t=t.parentElement;return t}(i);this.accessor.popupService.openPopover(t,{x:e.clientX,y:e.clientY,zIndex:(null==n?void 0:n.style.zIndex)?`calc(${n.style.zIndex} * 2)`:void 0})})))}updateDragAndDropState(){this.tabs.updateDragAndDropState(),this.voidContainer.updateDragAndDropState()}}class st extends C{constructor(e,t,i,n,o){super(),this.nativeEvent=e,this.target=t,this.position=i,this.getData=n,this.group=o}}const rt=(()=>{const e={disableAutoResizing:void 0,hideBorders:void 0,singleTabMode:void 0,disableFloatingGroups:void 0,floatingGroupBounds:void 0,popoutUrl:void 0,defaultRenderer:void 0,debug:void 0,rootOverlayModel:void 0,locked:void 0,disableDnd:void 0,className:void 0,noPanelsOverlay:void 0,dndEdges:void 0,theme:void 0,disableTabsOverflowList:void 0,scrollbars:void 0};return Object.keys(e)})();function at(e){return!!e.referencePanel}function dt(e){return!!e.referenceGroup}function ht(e){return!!e.referencePanel}function lt(e){return!!e.referenceGroup}class pt extends x{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}get panel(){return this.options.panel}get group(){return this.options.group}get api(){return this.options.api}constructor(e){super(),this.options=e}getData(){return this.options.getData()}}class ct extends pt{get kind(){return this._kind}constructor(e){super(e),this._kind=e.kind}}class vt extends P{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(e){this._locked=e,T(this.container,"dv-locked-groupview","no-drop-target"===e||e)}get isActive(){return this._isGroupActive}get panels(){return this._panels}get size(){return this._panels.length}get isEmpty(){return 0===this._panels.length}get hasWatermark(){return!(!this.watermark||!this.container.contains(this.watermark.element))}get header(){return this.tabsContainer}get isContentFocused(){return!!document.activeElement&&L(document.activeElement,this.contentContainer.element)}get location(){return this._location}set location(e){switch(this._location=e,T(this.container,"dv-groupview-floating",!1),T(this.container,"dv-groupview-popout",!1),e.type){case"grid":this.contentContainer.dropTarget.setTargetZones(["top","bottom","left","right","center"]);break;case"floating":this.contentContainer.dropTarget.setTargetZones(["center"]),this.contentContainer.dropTarget.setTargetZones(e?["center"]:["top","bottom","left","right","center"]),T(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),T(this.container,"dv-groupview-popout",!0)}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(e,t,i,n,o){var s;super(),this.container=e,this.accessor=t,this.id=i,this.options=n,this.groupPanel=o,this._isGroupActive=!1,this._locked=!1,this._location={type:"grid"},this.mostRecentlyUsed=[],this._overwriteRenderContainer=null,this._overwriteDropTargetContainer=null,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new A,this.onMove=this._onMove.event,this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new A,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new A,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new A,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new A,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new A,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new A,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new A,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new A,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,T(this.container,"dv-groupview",!0),this._api=new Ee(this.accessor),this.tabsContainer=new ot(this.accessor,this.groupPanel),this.contentContainer=new Je(this.accessor,this),e.append(this.tabsContainer.element,this.contentContainer.element),this.header.hidden=!!n.hideHeader,this.locked=null!==(s=n.locked)&&void 0!==s&&s,this.addDisposables(this._onTabDragStart,this._onGroupDragStart,this._onWillShowOverlay,this.tabsContainer.onTabDragStart((e=>{this._onTabDragStart.fire(e)})),this.tabsContainer.onGroupDragStart((e=>{this._onGroupDragStart.fire(e)})),this.tabsContainer.onDrop((e=>{this.handleDropEvent("header",e.event,"center",e.index)})),this.contentContainer.onDidFocus((()=>{this.accessor.doSetGroupActive(this.groupPanel)})),this.contentContainer.onDidBlur((()=>{})),this.contentContainer.dropTarget.onDrop((e=>{this.handleDropEvent("content",e.nativeEvent,e.position)})),this.tabsContainer.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(e)})),this.contentContainer.dropTarget.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new qe(e,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:y}))})),this._onMove,this._onDidChange,this._onDidDrop,this._onWillDrop,this._onDidAddPanel,this._onDidRemovePanel,this._onDidActivePanelChange,this._onUnhandledDragOverEvent,this._onDidPanelTitleChange,this._onDidPanelParametersChange)}focusContent(){this.contentContainer.element.focus()}set renderContainer(e){this.panels.forEach((e=>{this.renderContainer.detatch(e)})),this._overwriteRenderContainer=e,this.panels.forEach((e=>{this.rerender(e)}))}get renderContainer(){var e;return null!==(e=this._overwriteRenderContainer)&&void 0!==e?e:this.accessor.overlayRenderContainer}set dropTargetContainer(e){this._overwriteDropTargetContainer=e}get dropTargetContainer(){var e;return null!==(e=this._overwriteDropTargetContainer)&&void 0!==e?e:this.accessor.rootDropTargetContainer}initialize(){this.options.panels&&this.options.panels.forEach((e=>{this.doAddPanel(e)})),this.options.activePanel&&this.openPanel(this.options.activePanel),this.setActive(this.isActive,!0),this.updateContainer(),this.accessor.options.createRightHeaderActionComponent&&(this._rightHeaderActions=this.accessor.options.createRightHeaderActionComponent(this.groupPanel),this.addDisposables(this._rightHeaderActions),this._rightHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setRightActionsElement(this._rightHeaderActions.element)),this.accessor.options.createLeftHeaderActionComponent&&(this._leftHeaderActions=this.accessor.options.createLeftHeaderActionComponent(this.groupPanel),this.addDisposables(this._leftHeaderActions),this._leftHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setLeftActionsElement(this._leftHeaderActions.element)),this.accessor.options.createPrefixHeaderActionComponent&&(this._prefixHeaderActions=this.accessor.options.createPrefixHeaderActionComponent(this.groupPanel),this.addDisposables(this._prefixHeaderActions),this._prefixHeaderActions.init({containerApi:this._api,api:this.groupPanel.api,group:this.groupPanel}),this.tabsContainer.setPrefixActionsElement(this._prefixHeaderActions.element))}rerender(e){this.contentContainer.renderPanel(e,{asActive:!1})}indexOf(e){return this.tabsContainer.indexOf(e.id)}toJSON(){var e;const t={views:this.tabsContainer.panels,activeView:null===(e=this._activePanel)||void 0===e?void 0:e.id,id:this.id};return!1!==this.locked&&(t.locked=this.locked),this.header.hidden&&(t.hideHeader=!0),t}moveToNext(e){e||(e={}),e.panel||(e.panel=this.activePanel);const t=e.panel?this.panels.indexOf(e.panel):-1;let i;if(t<this.panels.length-1)i=t+1;else{if(e.suppressRoll)return;i=0}this.openPanel(this.panels[i])}moveToPrevious(e){if(e||(e={}),e.panel||(e.panel=this.activePanel),!e.panel)return;const t=this.panels.indexOf(e.panel);let i;if(t>0)i=t-1;else{if(e.suppressRoll)return;i=this.panels.length-1}this.openPanel(this.panels[i])}containsPanel(e){return this.panels.includes(e)}init(e){}update(e){}focus(){var e;null===(e=this._activePanel)||void 0===e||e.focus()}openPanel(e,t={}){("number"!=typeof t.index||t.index>this.panels.length)&&(t.index=this.panels.length);const i=!!t.skipSetActive;e.updateParentGroup(this.groupPanel,{skipSetActive:t.skipSetActive}),this.doAddPanel(e,t.index,{skipSetActive:i}),this._activePanel!==e?(i||this.doSetActivePanel(e),t.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),t.skipSetActive||this.updateContainer()):this.contentContainer.renderPanel(e,{asActive:!0})}removePanel(e,t={skipSetActive:!1}){const i="string"==typeof e?e:e.id,n=this._panels.find((e=>e.id===i));if(!n)throw new Error("invalid operation");return this._removePanel(n,t)}closeAllPanels(){if(this.panels.length>0){const e=[...this.panels];for(const t of e)this.doClose(t)}else this.accessor.removeGroup(this.groupPanel)}closePanel(e){this.doClose(e)}doClose(e){const t=1===this.panels.length&&1===this.accessor.groups.length;this.accessor.removePanel(e,t&&"emptyGroup"===this.accessor.options.noPanelsOverlay?{removeEmptyGroup:!1}:void 0)}isPanelActive(e){return this._activePanel===e}updateActions(e){this.tabsContainer.setRightActionsElement(e)}setActive(e,t=!1){(t||this.isActive!==e)&&(this._isGroupActive=e,T(this.container,"dv-active-group",e),T(this.container,"dv-inactive-group",!e),this.tabsContainer.setActive(this.isActive),!this._activePanel&&this.panels.length>0&&this.doSetActivePanel(this.panels[0]),this.updateContainer())}layout(e,t){var i;this._width=e,this._height=t,this.contentContainer.layout(this._width,this._height),(null===(i=this._activePanel)||void 0===i?void 0:i.layout)&&this._activePanel.layout(this._width,this._height)}_removePanel(e,t){const i=this._activePanel===e;if(this.doRemovePanel(e),i&&this.panels.length>0){const e=this.mostRecentlyUsed[0];this.openPanel(e,{skipSetActive:t.skipSetActive,skipSetGroupActive:t.skipSetActiveGroup})}return this._activePanel&&0===this.panels.length&&this.doSetActivePanel(void 0),t.skipSetActive||this.updateContainer(),e}doRemovePanel(e){const t=this.panels.indexOf(e);if(this._activePanel===e&&this.contentContainer.closePanel(),this.tabsContainer.delete(e.id),this._panels.splice(t,1),this.mostRecentlyUsed.includes(e)){const t=this.mostRecentlyUsed.indexOf(e);this.mostRecentlyUsed.splice(t,1)}const i=this._panelDisposables.get(e.id);i&&(i.dispose(),this._panelDisposables.delete(e.id)),this._onDidRemovePanel.fire({panel:e})}doAddPanel(e,t=this.panels.length,i={skipSetActive:!1}){const n=this._panels.indexOf(e)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(e,t),i.skipSetActive||this.contentContainer.openPanel(e),n||(this.updateMru(e),this.panels.splice(t,0,e),this._panelDisposables.set(e.id,new P(e.api.onDidTitleChange((e=>this._onDidPanelTitleChange.fire(e))),e.api.onDidParametersChange((e=>this._onDidPanelParametersChange.fire(e))))),this._onDidAddPanel.fire({panel:e}))}doSetActivePanel(e){this._activePanel!==e&&(this._activePanel=e,e&&(this.tabsContainer.setActivePanel(e),this.contentContainer.openPanel(e),e.layout(this._width,this._height),this.updateMru(e),this.contentContainer.refreshFocusState(),this._onDidActivePanelChange.fire({panel:e})))}updateMru(e){this.mostRecentlyUsed.includes(e)&&this.mostRecentlyUsed.splice(this.mostRecentlyUsed.indexOf(e),1),this.mostRecentlyUsed=[e,...this.mostRecentlyUsed]}updateContainer(){var e,t;if(this.panels.forEach((e=>e.runEvents())),this.isEmpty&&!this.watermark){const e=this.accessor.createWatermarkComponent();e.init({containerApi:this._api,group:this.groupPanel}),this.watermark=e,k(this.watermark.element,"pointerdown",(()=>{this.isActive||this.accessor.doSetGroupActive(this.groupPanel)})),this.contentContainer.element.appendChild(this.watermark.element)}!this.isEmpty&&this.watermark&&(this.watermark.element.remove(),null===(t=(e=this.watermark).dispose)||void 0===t||t.call(e),this.watermark=void 0)}canDisplayOverlay(e,t,i){const n=new st(e,i,t,y,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(n),n.isAccepted}handleDropEvent(e,t,i,n){if("no-drop-target"===this.locked)return;const o="number"==typeof n?this.panels[n]:void 0,s=new ct({nativeEvent:t,position:i,panel:o,getData:()=>y(),kind:function(){switch(e){case"header":return"number"==typeof n?"tab":"header_space";case"content":return"content"}}(),group:this.groupPanel,api:this._api});if(this._onWillDrop.fire(s),s.defaultPrevented)return;const r=y();if(r&&r.viewId===this.accessor.id){if("content"===e&&r.groupId===this.id){if("center"===i)return;if(null===r.panelId)return}if("header"===e&&r.groupId===this.id&&null===r.panelId)return;if(null===r.panelId){const{groupId:e}=r;return void this._onMove.fire({target:i,groupId:e,index:n})}if(-1!==this.tabsContainer.indexOf(r.panelId)&&1===this.tabsContainer.size)return;const{groupId:t,panelId:o}=r;if(this.id===t&&!i){if(this.tabsContainer.indexOf(o)===n)return}this._onMove.fire({target:i,groupId:r.groupId,itemId:r.panelId,index:n})}else this._onDidDrop.fire(new pt({nativeEvent:t,position:i,panel:o,getData:()=>y(),group:this.groupPanel,api:this._api}))}updateDragAndDropState(){this.tabsContainer.updateDragAndDropState()}dispose(){var e,t,i;super.dispose(),null===(e=this.watermark)||void 0===e||e.element.remove(),null===(i=null===(t=this.watermark)||void 0===t?void 0:t.dispose)||void 0===i||i.call(t),this.watermark=void 0;for(const e of this.panels)e.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class ut extends He{constructor(e,t,i){super(e,t),this._onDidConstraintsChangeInternal=new A,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new A,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new A,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),i&&this.initialize(i)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class mt extends Be{get priority(){return this._priority}get snap(){return this._snap}get minimumWidth(){return this.__minimumWidth()}get minimumHeight(){return this.__minimumHeight()}get maximumHeight(){return this.__maximumHeight()}get maximumWidth(){return this.__maximumWidth()}__minimumWidth(){const e="function"==typeof this._minimumWidth?this._minimumWidth():this._minimumWidth;return e!==this._evaluatedMinimumWidth&&(this._evaluatedMinimumWidth=e,this.updateConstraints()),e}__maximumWidth(){const e="function"==typeof this._maximumWidth?this._maximumWidth():this._maximumWidth;return e!==this._evaluatedMaximumWidth&&(this._evaluatedMaximumWidth=e,this.updateConstraints()),e}__minimumHeight(){const e="function"==typeof this._minimumHeight?this._minimumHeight():this._minimumHeight;return e!==this._evaluatedMinimumHeight&&(this._evaluatedMinimumHeight=e,this.updateConstraints()),e}__maximumHeight(){const e="function"==typeof this._maximumHeight?this._maximumHeight():this._maximumHeight;return e!==this._evaluatedMaximumHeight&&(this._evaluatedMaximumHeight=e,this.updateConstraints()),e}get isActive(){return this.api.isActive}get isVisible(){return this.api.isVisible}constructor(e,t,i,n){super(e,t,null!=n?n:new ut(e,t)),this._evaluatedMinimumWidth=0,this._evaluatedMaximumWidth=Number.MAX_SAFE_INTEGER,this._evaluatedMinimumHeight=0,this._evaluatedMaximumHeight=Number.MAX_SAFE_INTEGER,this._minimumWidth=0,this._minimumHeight=0,this._maximumWidth=Number.MAX_SAFE_INTEGER,this._maximumHeight=Number.MAX_SAFE_INTEGER,this._snap=!1,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,"number"==typeof(null==i?void 0:i.minimumWidth)&&(this._minimumWidth=i.minimumWidth),"number"==typeof(null==i?void 0:i.maximumWidth)&&(this._maximumWidth=i.maximumWidth),"number"==typeof(null==i?void 0:i.minimumHeight)&&(this._minimumHeight=i.minimumHeight),"number"==typeof(null==i?void 0:i.maximumHeight)&&(this._maximumHeight=i.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange((e=>{const{isVisible:t}=e,{accessor:i}=this._params;i.setVisible(this,t)})),this.api.onActiveChange((()=>{const{accessor:e}=this._params;e.doSetGroupActive(this)})),this.api.onDidConstraintsChangeInternal((e=>{"number"!=typeof e.minimumWidth&&"function"!=typeof e.minimumWidth||(this._minimumWidth=e.minimumWidth),"number"!=typeof e.minimumHeight&&"function"!=typeof e.minimumHeight||(this._minimumHeight=e.minimumHeight),"number"!=typeof e.maximumWidth&&"function"!=typeof e.maximumWidth||(this._maximumWidth=e.maximumWidth),"number"!=typeof e.maximumHeight&&"function"!=typeof e.maximumHeight||(this._maximumHeight=e.maximumHeight)})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({height:e.height,width:e.width})})),this._onDidChange)}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}init(e){e.maximumHeight&&(this._maximumHeight=e.maximumHeight),e.minimumHeight&&(this._minimumHeight=e.minimumHeight),e.maximumWidth&&(this._maximumWidth=e.maximumWidth),e.minimumWidth&&(this._minimumWidth=e.minimumWidth),this._priority=e.priority,this._snap=!!e.snap,super.init(e),"boolean"==typeof e.isVisible&&this.setVisible(e.isVisible)}updateConstraints(){this.api._onDidConstraintsChange.fire({minimumWidth:this._evaluatedMinimumWidth,maximumWidth:this._evaluatedMaximumWidth,minimumHeight:this._evaluatedMinimumHeight,maximumHeight:this._evaluatedMaximumHeight})}toJSON(){const e=super.toJSON(),t=e=>e===Number.MAX_SAFE_INTEGER?void 0:e,i=e=>e<=0?void 0:e;return Object.assign(Object.assign({},e),{minimumHeight:i(this.minimumHeight),maximumHeight:t(this.maximumHeight),minimumWidth:i(this.minimumWidth),maximumWidth:t(this.maximumWidth),snap:this.snap,priority:this.priority})}}const gt="dockview: DockviewGroupPanelApiImpl not initialized";class bt extends ut{get location(){if(!this._group)throw new Error(gt);return this._group.model.location}constructor(e,t){super(e,"__dockviewgroup__"),this.accessor=t,this._onDidLocationChange=new A,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new A,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this.addDisposables(this._onDidLocationChange,this._onDidActivePanelChange,this._onDidVisibilityChange.event((e=>{e.isVisible&&this._pendingSize&&(super.setSize(this._pendingSize),this._pendingSize=void 0)})))}setSize(e){this._pendingSize=Object.assign({},e),super.setSize(e)}close(){if(this._group)return this.accessor.removeGroup(this._group)}getWindow(){return"popout"===this.location.type?this.location.getWindow():window}moveTo(e){var t,i,n,o;if(!this._group)throw new Error(gt);const s=null!==(t=e.group)&&void 0!==t?t:this.accessor.addGroup({direction:Ve(null!==(i=e.position)&&void 0!==i?i:"right"),skipSetActive:null!==(n=e.skipSetActive)&&void 0!==n&&n});this.accessor.moveGroupOrPanel({from:{groupId:this._group.id},to:{group:s,position:e.group&&null!==(o=e.position)&&void 0!==o?o:"center",index:e.index},skipSetActive:e.skipSetActive})}maximize(){if(!this._group)throw new Error(gt);"grid"===this.location.type&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(gt);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(gt);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(e){this._group=e}}class ft extends mt{get minimumWidth(){var e;if("number"==typeof this._explicitConstraints.minimumWidth)return this._explicitConstraints.minimumWidth;const t=null===(e=this.activePanel)||void 0===e?void 0:e.minimumWidth;return"number"==typeof t?t:super.__minimumWidth()}get minimumHeight(){var e;if("number"==typeof this._explicitConstraints.minimumHeight)return this._explicitConstraints.minimumHeight;const t=null===(e=this.activePanel)||void 0===e?void 0:e.minimumHeight;return"number"==typeof t?t:super.__minimumHeight()}get maximumWidth(){var e;if("number"==typeof this._explicitConstraints.maximumWidth)return this._explicitConstraints.maximumWidth;const t=null===(e=this.activePanel)||void 0===e?void 0:e.maximumWidth;return"number"==typeof t?t:super.__maximumWidth()}get maximumHeight(){var e;if("number"==typeof this._explicitConstraints.maximumHeight)return this._explicitConstraints.maximumHeight;const t=null===(e=this.activePanel)||void 0===e?void 0:e.maximumHeight;return"number"==typeof t?t:super.__maximumHeight()}get panels(){return this._model.panels}get activePanel(){return this._model.activePanel}get size(){return this._model.size}get model(){return this._model}get locked(){return this._model.locked}set locked(e){this._model.locked=e}get header(){return this._model.header}constructor(e,t,i){var n,o,s,r,a,d;super(t,"groupview_default",{minimumHeight:null!==(o=null===(n=i.constraints)||void 0===n?void 0:n.minimumHeight)&&void 0!==o?o:100,minimumWidth:null!==(r=null===(s=i.constraints)||void 0===s?void 0:s.minimumWidth)&&void 0!==r?r:100,maximumHeight:null===(a=i.constraints)||void 0===a?void 0:a.maximumHeight,maximumWidth:null===(d=i.constraints)||void 0===d?void 0:d.maximumWidth},new bt(t,e)),this._explicitConstraints={},this.api.initialize(this),this._model=new vt(this.element,e,t,i,this),this.addDisposables(this.model.onDidActivePanelChange((e=>{this.api._onDidActivePanelChange.fire(e)})),this.api.onDidConstraintsChangeInternal((e=>{void 0!==e.minimumWidth&&(this._explicitConstraints.minimumWidth="function"==typeof e.minimumWidth?e.minimumWidth():e.minimumWidth),void 0!==e.minimumHeight&&(this._explicitConstraints.minimumHeight="function"==typeof e.minimumHeight?e.minimumHeight():e.minimumHeight),void 0!==e.maximumWidth&&(this._explicitConstraints.maximumWidth="function"==typeof e.maximumWidth?e.maximumWidth():e.maximumWidth),void 0!==e.maximumHeight&&(this._explicitConstraints.maximumHeight="function"==typeof e.maximumHeight?e.maximumHeight():e.maximumHeight)})))}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(e){super.setActive(e),this.model.setActive(e)}layout(e,t){super.layout(e,t),this.model.layout(e,t)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}const wt={name:"dark",className:"dockview-theme-dark"},_t={name:"light",className:"dockview-theme-light"},yt={name:"visualStudio",className:"dockview-theme-vs"},Dt={name:"abyss",className:"dockview-theme-abyss"},xt={name:"dracula",className:"dockview-theme-dracula"},Ct={name:"replit",className:"dockview-theme-replit",gap:10},zt={name:"abyssSpaced",className:"dockview-theme-abyss-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"},St={name:"lightSpaced",className:"dockview-theme-light-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"};class At extends ut{get location(){return this.group.api.location}get title(){return this.panel.title}get isGroupActive(){return this.group.isActive}get renderer(){return this.panel.renderer}set group(e){const t=this._group;this._group!==e&&(this._group=e,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(t),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(e,t,i,n,o){super(e.id,n),this.panel=e,this.accessor=i,this._onDidTitleChange=new A,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new A,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new A,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new A,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new A,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new O,this._tabComponent=o,this.initialize(e),this._group=t,this.setupGroupEventListeners(),this.addDisposables(this.groupEventsDisposable,this._onDidRendererChange,this._onDidTitleChange,this._onDidGroupChange,this._onDidActiveGroupChange,this._onDidLocationChange)}getWindow(){return this.group.api.getWindow()}moveTo(e){var t,i;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:null!==(t=e.group)&&void 0!==t?t:this._group,position:e.group&&null!==(i=e.position)&&void 0!==i?i:"center",index:e.index},skipSetActive:e.skipSetActive})}setTitle(e){this.panel.setTitle(e)}setRenderer(e){this.panel.setRenderer(e)}close(){this.group.model.closePanel(this.panel)}maximize(){this.group.api.maximize()}isMaximized(){return this.group.api.isMaximized()}exitMaximized(){this.group.api.exitMaximized()}setupGroupEventListeners(e){var t;let i=null!==(t=null==e?void 0:e.isActive)&&void 0!==t&&t;this.groupEventsDisposable.value=new P(this.group.api.onDidVisibilityChange((e=>{const t=!e.isVisible&&this.isVisible,i=e.isVisible&&!this.isVisible,n=this.group.model.isPanelActive(this.panel);(t||i&&n)&&this._onDidVisibilityChange.fire(e)})),this.group.api.onDidLocationChange((e=>{this.group===this.panel.group&&this._onDidLocationChange.fire(e)})),this.group.api.onDidActiveChange((()=>{this.group===this.panel.group&&i!==this.isGroupActive&&(i=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))})))}}class kt extends P{get params(){return this._params}get title(){return this._title}get group(){return this._group}get renderer(){var e;return null!==(e=this._renderer)&&void 0!==e?e:this.accessor.renderer}get minimumWidth(){return this._minimumWidth}get minimumHeight(){return this._minimumHeight}get maximumWidth(){return this._maximumWidth}get maximumHeight(){return this._maximumHeight}constructor(e,t,i,n,o,s,r,a){super(),this.id=e,this.accessor=n,this.containerApi=o,this.view=r,this._renderer=a.renderer,this._group=s,this._minimumWidth=a.minimumWidth,this._minimumHeight=a.minimumHeight,this._maximumWidth=a.maximumWidth,this._maximumHeight=a.maximumHeight,this.api=new At(this,this._group,n,t,i),this.addDisposables(this.api.onActiveChange((()=>{n.setActivePanel(this)})),this.api.onDidSizeChange((e=>{this.group.api.setSize(e)})),this.api.onDidRendererChange((()=>{this.group.model.rerender(this)})))}init(e){this._params=e.params,this.view.init(Object.assign(Object.assign({},e),{api:this.api,containerApi:this.containerApi})),this.setTitle(e.title)}focus(){const e=new We;this.api._onWillFocus.fire(e),e.defaultPrevented||this.api.isActive||this.api.setActive()}toJSON(){return{id:this.id,contentComponent:this.view.contentComponent,tabComponent:this.view.tabComponent,params:Object.keys(this._params||{}).length>0?this._params:void 0,title:this.title,renderer:this._renderer,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,minimumWidth:this._minimumWidth,maximumWidth:this._maximumWidth}}setTitle(e){e!==this.title&&(this._title=e,this.api._onDidTitleChange.fire({title:e}))}setRenderer(e){e!==this.renderer&&(this._renderer=e,this.api._onDidRendererChange.fire({renderer:e}))}update(e){var t;this._params=Object.assign(Object.assign({},null!==(t=this._params)&&void 0!==t?t:{}),e.params);for(const t of Object.keys(e.params))void 0===e.params[t]&&delete this._params[t];this.view.update({params:this._params})}updateFromStateModel(e){var t,i,n;this._maximumHeight=e.maximumHeight,this._minimumHeight=e.minimumHeight,this._maximumWidth=e.maximumWidth,this._minimumWidth=e.minimumWidth,this.update({params:null!==(t=e.params)&&void 0!==t?t:{}}),this.setTitle(null!==(i=e.title)&&void 0!==i?i:this.id),this.setRenderer(null!==(n=e.renderer)&&void 0!==n?n:this.accessor.renderer)}updateParentGroup(e,t){this._group=e,this.api.group=this._group;const i=this._group.model.isPanelActive(this),n=this.group.api.isActive&&i;(null==t?void 0:t.skipSetActive)||this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&i}),this.api.isVisible!==i&&this.api._onDidVisibilityChange.fire({isVisible:i})}runEvents(){const e=this._group.model.isPanelActive(this),t=this.group.api.isActive&&e;this.api.isActive!==t&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&e}),this.api.isVisible!==e&&this.api._onDidVisibilityChange.fire({isVisible:e})}layout(e,t){this.api._onDidDimensionChange.fire({width:e,height:t}),this.view.layout(e,t)}dispose(){this.api.dispose(),this.view.dispose()}}class Et extends P{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-default-tab",this._content=document.createElement("div"),this._content.className="dv-default-tab-content",this.action=document.createElement("div"),this.action.className="dv-default-tab-action",this.action.appendChild(it({width:"11",height:"11",viewbox:"0 0 28 28",path:"M2.1 27.3L0 25.2L11.55 13.65L0 2.1L2.1 0L13.65 11.55L25.2 0L27.3 2.1L15.75 13.65L27.3 25.2L25.2 27.3L13.65 15.75L2.1 27.3Z"})),this._element.appendChild(this._content),this._element.appendChild(this.action),this.render()}init(e){this._title=e.title,this.addDisposables(e.api.onDidTitleChange((e=>{this._title=e.title,this.render()})),k(this.action,"pointerdown",(e=>{e.preventDefault()})),k(this.action,"click",(t=>{t.defaultPrevented||(t.preventDefault(),e.api.close())}))),this.render()}render(){var e;this._content.textContent!==this._title&&(this._content.textContent=null!==(e=this._title)&&void 0!==e?e:"")}}class Pt{get content(){return this._content}get tab(){return this._tab}constructor(e,t,i,n){this.accessor=e,this.id=t,this.contentComponent=i,this.tabComponent=n,this._content=this.createContentComponent(this.id,i),this._tab=this.createTabComponent(this.id,n)}createTabRenderer(e){var t;const i=this.createTabComponent(this.id,this.tabComponent);return this._params&&i.init(Object.assign(Object.assign({},this._params),{tabLocation:e})),this._updateEvent&&(null===(t=i.update)||void 0===t||t.call(i,this._updateEvent)),i}init(e){this._params=e,this.content.init(e),this.tab.init(Object.assign(Object.assign({},e),{tabLocation:"header"}))}layout(e,t){var i,n;null===(n=(i=this.content).layout)||void 0===n||n.call(i,e,t)}update(e){var t,i,n,o;this._updateEvent=e,null===(i=(t=this.content).update)||void 0===i||i.call(t,e),null===(o=(n=this.tab).update)||void 0===o||o.call(n,e)}dispose(){var e,t,i,n;null===(t=(e=this.content).dispose)||void 0===t||t.call(e),null===(n=(i=this.tab).dispose)||void 0===n||n.call(i)}createContentComponent(e,t){return this.accessor.options.createComponent({id:e,name:t})}createTabComponent(e,t){const i=null!=t?t:this.accessor.options.defaultTabComponent;if(i){if(this.accessor.options.createTabComponent){const t=this.accessor.options.createTabComponent({id:e,name:i});return t||new Et}console.warn(`dockview: tabComponent '${t}' was not found. falling back to the default tab.`)}return new Et}}class Ot{constructor(e){this.accessor=e}fromJSON(e,t){var i,n;const o=e.id,s=e.params,r=e.title,a=e.view,d=a?a.content.id:null!==(i=e.contentComponent)&&void 0!==i?i:"unknown",h=a?null===(n=a.tab)||void 0===n?void 0:n.id:e.tabComponent,l=new Pt(this.accessor,o,d,h),p=new kt(o,d,h,this.accessor,new Ee(this.accessor),t,l,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return p.init({title:null!=r?r:o,params:null!=s?s:{}}),p}}class It extends P{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(e){}}const Gt=new class{constructor(){this._orderedList=[]}push(e){this._orderedList=[...this._orderedList.filter((t=>t!==e)),e],this.update()}destroy(e){this._orderedList=this._orderedList.filter((t=>t!==e)),this.update()}update(){for(let e=0;e<this._orderedList.length;e++)this._orderedList[e].setAttribute("aria-level",`${e}`),this._orderedList[e].style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${2*e})`}};class Vt extends P{set minimumInViewportWidth(e){this.options.minimumInViewportWidth=e}set minimumInViewportHeight(e){this.options.minimumInViewportHeight=e}get element(){return this._element}get isVisible(){return this._isVisible}constructor(e){super(),this.options=e,this._element=document.createElement("div"),this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new A,this.onDidChangeEnd=this._onDidChangeEnd.event,this.addDisposables(this._onDidChange,this._onDidChangeEnd),this._element.className="dv-resize-container",this._isVisible=!0,this.setupResize("top"),this.setupResize("bottom"),this.setupResize("left"),this.setupResize("right"),this.setupResize("topleft"),this.setupResize("topright"),this.setupResize("bottomleft"),this.setupResize("bottomright"),this._element.appendChild(this.options.content),this.options.container.appendChild(this._element),this.setBounds(Object.assign(Object.assign(Object.assign(Object.assign({height:this.options.height,width:this.options.width},"top"in this.options&&{top:this.options.top}),"bottom"in this.options&&{bottom:this.options.bottom}),"left"in this.options&&{left:this.options.left}),"right"in this.options&&{right:this.options.right})),Gt.push(this._element)}setVisible(e){e!==this.isVisible&&(this._isVisible=e,T(this.element,"dv-hidden",!this.isVisible))}bringToFront(){Gt.push(this._element)}setBounds(e={}){"number"==typeof e.height&&(this._element.style.height=`${e.height}px`),"number"==typeof e.width&&(this._element.style.width=`${e.width}px`),"top"in e&&"number"==typeof e.top&&(this._element.style.top=`${e.top}px`,this._element.style.bottom="auto",this.verticalAlignment="top"),"bottom"in e&&"number"==typeof e.bottom&&(this._element.style.bottom=`${e.bottom}px`,this._element.style.top="auto",this.verticalAlignment="bottom"),"left"in e&&"number"==typeof e.left&&(this._element.style.left=`${e.left}px`,this._element.style.right="auto",this.horiziontalAlignment="left"),"right"in e&&"number"==typeof e.right&&(this._element.style.right=`${e.right}px`,this._element.style.left="auto",this.horiziontalAlignment="right");const t=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),n=Math.max(0,this.getMinimumWidth(i.width)),o=Math.max(0,this.getMinimumHeight(i.height));if("top"===this.verticalAlignment){const e=X(i.top-t.top,-o,Math.max(0,t.height-i.height+o));this._element.style.top=`${e}px`,this._element.style.bottom="auto"}if("bottom"===this.verticalAlignment){const e=X(t.bottom-i.bottom,-o,Math.max(0,t.height-i.height+o));this._element.style.bottom=`${e}px`,this._element.style.top="auto"}if("left"===this.horiziontalAlignment){const e=X(i.left-t.left,-n,Math.max(0,t.width-i.width+n));this._element.style.left=`${e}px`,this._element.style.right="auto"}if("right"===this.horiziontalAlignment){const e=X(t.right-i.right,-n,Math.max(0,t.width-i.width+n));this._element.style.right=`${e}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const e=this.options.container.getBoundingClientRect(),t=this._element.getBoundingClientRect(),i={};return"top"===this.verticalAlignment?i.top=parseFloat(this._element.style.top):"bottom"===this.verticalAlignment?i.bottom=parseFloat(this._element.style.bottom):i.top=t.top-e.top,"left"===this.horiziontalAlignment?i.left=parseFloat(this._element.style.left):"right"===this.horiziontalAlignment?i.right=parseFloat(this._element.style.right):i.left=t.left-e.left,i.width=t.width,i.height=t.height,i}setupDrag(e,t={inDragMode:!1}){const i=new O,n=()=>{let e=null;const t=F();i.value=new P({dispose:()=>{t.release()}},k(window,"pointermove",(t=>{const i=this.options.container.getBoundingClientRect(),n=t.clientX-i.left,o=t.clientY-i.top;T(this._element,"dv-resize-container-dragging",!0);const s=this._element.getBoundingClientRect();null===e&&(e={x:t.clientX-s.left,y:t.clientY-s.top});const r=Math.max(0,this.getMinimumWidth(s.width)),a=Math.max(0,this.getMinimumHeight(s.height)),d=X(o-e.y,-a,Math.max(0,i.height-s.height+a)),h=X(e.y-o+i.height-s.height,-a,Math.max(0,i.height-s.height+a)),l=X(n-e.x,-r,Math.max(0,i.width-s.width+r)),p=X(e.x-n+i.width-s.width,-r,Math.max(0,i.width-s.width+r)),c={};d<=h?c.top=d:c.bottom=h,l<=p?c.left=l:c.right=p,this.setBounds(c)})),k(window,"pointerup",(()=>{T(this._element,"dv-resize-container-dragging",!1),i.dispose(),this._onDidChangeEnd.fire()})))};this.addDisposables(i,k(e,"pointerdown",(e=>{e.defaultPrevented?e.preventDefault():H(e)||n()})),k(this.options.content,"pointerdown",(e=>{e.defaultPrevented||H(e)||e.shiftKey&&n()})),k(this.options.content,"pointerdown",(()=>{Gt.push(this._element)}),!0)),t.inDragMode&&n()}setupResize(e){const t=document.createElement("div");t.className=`dv-resize-handle-${e}`,this._element.appendChild(t);const i=new O;this.addDisposables(i,k(t,"pointerdown",(t=>{t.preventDefault();let n=null;const o=F();i.value=new P(k(window,"pointermove",(t=>{const i=this.options.container.getBoundingClientRect(),o=this._element.getBoundingClientRect(),s=t.clientY-i.top,r=t.clientX-i.left;let a,d,h,l,p,c;null===n&&(n={originalY:s,originalHeight:o.height,originalX:r,originalWidth:o.width});const v=()=>{const e=n.originalY+n.originalHeight>i.height?Math.max(0,i.height-Vt.MINIMUM_HEIGHT):Math.max(0,n.originalY+n.originalHeight-Vt.MINIMUM_HEIGHT);a=X(s,0,e),h=n.originalY+n.originalHeight-a,d=i.height-a-h},u=()=>{a=n.originalY-n.originalHeight;const e=a<0&&"number"==typeof this.options.minimumInViewportHeight?-a+this.options.minimumInViewportHeight:Vt.MINIMUM_HEIGHT,t=i.height-Math.max(0,a);h=X(s-a,e,t),d=i.height-a-h},m=()=>{const e=n.originalX+n.originalWidth>i.width?Math.max(0,i.width-Vt.MINIMUM_WIDTH):Math.max(0,n.originalX+n.originalWidth-Vt.MINIMUM_WIDTH);l=X(r,0,e),c=n.originalX+n.originalWidth-l,p=i.width-l-c},g=()=>{l=n.originalX-n.originalWidth;const e=l<0&&"number"==typeof this.options.minimumInViewportWidth?-l+this.options.minimumInViewportWidth:Vt.MINIMUM_WIDTH,t=i.width-Math.max(0,l);c=X(r-l,e,t),p=i.width-l-c};switch(e){case"top":v();break;case"bottom":u();break;case"left":m();break;case"right":g();break;case"topleft":v(),m();break;case"topright":v(),g();break;case"bottomleft":u(),m();break;case"bottomright":u(),g()}const b={};a<=d?b.top=a:b.bottom=d,l<=p?b.left=l:b.right=p,b.height=h,b.width=c,this.setBounds(b)})),{dispose:()=>{o.release()}},k(window,"pointerup",(()=>{i.dispose(),this._onDidChangeEnd.fire()})))})))}getMinimumWidth(e){return"number"==typeof this.options.minimumInViewportWidth?e-this.options.minimumInViewportWidth:0}getMinimumHeight(e){return"number"==typeof this.options.minimumInViewportHeight?e-this.options.minimumInViewportHeight:0}dispose(){Gt.destroy(this._element),this._element.remove(),super.dispose()}}Vt.MINIMUM_HEIGHT=20,Vt.MINIMUM_WIDTH=20;class Nt extends P{constructor(e,t){super(),this.group=e,this.overlay=t,this.addDisposables(t)}position(e){this.overlay.setBounds(e)}}const Tt=100,Lt=100,Rt=100,Mt=300,Wt=300;class Ht{constructor(){this.cache=new Map,this.currentFrameId=0,this.rafId=null}getPosition(e){const t=this.cache.get(e);if(t&&t.frameId===this.currentFrameId)return t.rect;this.scheduleFrameUpdate();const i=j(e);return this.cache.set(e,{rect:i,frameId:this.currentFrameId}),i}invalidate(){this.currentFrameId++}scheduleFrameUpdate(){this.rafId||(this.rafId=requestAnimationFrame((()=>{this.currentFrameId++,this.rafId=null})))}}class jt extends P{constructor(e,t){super(),this.element=e,this.accessor=t,this.map={},this._disposed=!1,this.positionCache=new Ht,this.pendingUpdates=new Set,this.addDisposables(g.from((()=>{for(const e of Object.values(this.map))e.disposable.dispose(),e.destroy.dispose();this._disposed=!0})))}updateAllPositions(){if(!this._disposed){this.positionCache.invalidate();for(const e of Object.values(this.map))e.panel.api.isVisible&&e.resize&&e.resize()}}detatch(e){if(this.map[e.api.id]){const{disposable:t,destroy:i}=this.map[e.api.id];return t.dispose(),i.dispose(),delete this.map[e.api.id],!0}return!1}attach(e){const{panel:t,referenceContainer:i}=e;if(!this.map[t.api.id]){const e=function(){const e=document.createElement("div");return e.tabIndex=-1,e}();e.className="dv-render-overlay",this.map[t.api.id]={panel:t,disposable:g.NONE,destroy:g.NONE,element:e}}const n=this.map[t.api.id].element;t.view.content.element.parentElement!==n&&n.appendChild(t.view.content.element),n.parentElement!==this.element&&this.element.appendChild(n);const o=()=>{const e=t.api.id;this.pendingUpdates.has(e)||(this.pendingUpdates.add(e),requestAnimationFrame((()=>{if(this.pendingUpdates.delete(e),this.isDisposed||!this.map[e])return;const o=this.positionCache.getPosition(i.element),s=this.positionCache.getPosition(this.element),r=o.left-s.left,a=o.top-s.top,d=o.width,h=o.height;n.style.left=`${r}px`,n.style.top=`${a}px`,n.style.width=`${d}px`,n.style.height=`${h}px`,T(n,"dv-render-overlay-float","floating"===t.group.api.location.type)})))},s=()=>{t.api.isVisible&&(this.positionCache.invalidate(),o()),n.style.display=t.api.isVisible?"":"none"},r=new O,a=()=>{"floating"===t.api.location.type?queueMicrotask((()=>{const e=this.accessor.floatingGroups.find((e=>e.group===t.api.group));if(!e)return;const i=e.overlay.element,o=()=>{const e=Number(i.getAttribute("aria-level"));n.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${2*e+1})`},s=new MutationObserver((()=>{o()}));r.value=g.from((()=>s.disconnect())),s.observe(i,{attributeFilter:["aria-level"],attributes:!0}),o()})):n.style.zIndex=""},d=new P(r,new Oe(n,{onDragEnd:e=>{i.dropTarget.dnd.onDragEnd(e)},onDragEnter:e=>{i.dropTarget.dnd.onDragEnter(e)},onDragLeave:e=>{i.dropTarget.dnd.onDragLeave(e)},onDrop:e=>{i.dropTarget.dnd.onDrop(e)},onDragOver:e=>{i.dropTarget.dnd.onDragOver(e)}}),t.api.onDidVisibilityChange((()=>{s()})),t.api.onDidDimensionsChange((()=>{t.api.isVisible&&o()})),t.api.onDidLocationChange((()=>{a()})));return this.map[t.api.id].destroy=g.from((()=>{var e;t.view.content.element.parentElement===n&&n.removeChild(t.view.content.element),null===(e=n.parentElement)||void 0===e||e.removeChild(n)})),a(),queueMicrotask((()=>{this.isDisposed||s()})),this.map[t.api.id].disposable.dispose(),this.map[t.api.id].disposable=d,this.map[t.api.id].resize=o,n}}var Ft=function(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((n=n.apply(e,t||[])).next())}))};class Bt extends P{get window(){var e,t;return null!==(t=null===(e=this._window)||void 0===e?void 0:e.value)&&void 0!==t?t:null}constructor(e,t,i){super(),this.target=e,this.className=t,this.options=i,this._onWillClose=new A,this.onWillClose=this._onWillClose.event,this._onDidClose=new A,this.onDidClose=this._onDidClose.event,this._window=null,this.addDisposables(this._onWillClose,this._onDidClose,{dispose:()=>{this.close()}})}dimensions(){if(!this._window)return null;const e=this._window.value.screenX;return{top:this._window.value.screenY,left:e,width:this._window.value.innerWidth,height:this._window.value.innerHeight}}close(){var e,t;this._window&&(this._onWillClose.fire(),null===(t=(e=this.options).onWillClose)||void 0===t||t.call(e,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var e,t;return Ft(this,void 0,void 0,(function*(){if(this._window)throw new Error("instance of popout window is already open");const i=`${this.options.url}`,n=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map((([e,t])=>`${e}=${t}`)).join(","),o=window.open(i,this.target,n);if(!o)return null;const s=new P;this._window={value:o,disposable:s},s.addDisposables(g.from((()=>{o.close()})),k(window,"beforeunload",(()=>{this.close()})));const r=this.createPopoutWindowContainer();return this.className&&r.classList.add(this.className),null===(t=(e=this.options).onDidOpen)||void 0===t||t.call(e,{id:this.target,window:o}),new Promise(((e,t)=>{o.addEventListener("unload",(e=>{})),o.addEventListener("load",(()=>{try{const t=o.document;t.title=document.title,t.body.appendChild(r),function(e,t){const i=Array.from(t);for(const t of i){if(t.href){const i=e.createElement("link");i.href=t.href,i.type=t.type,i.rel="stylesheet",e.head.appendChild(i)}let i=[];try{t.cssRules&&(i=Array.from(t.cssRules).map((e=>e.cssText)))}catch(e){}for(const t of i){const i=e.createElement("style");i.appendChild(e.createTextNode(t)),e.head.appendChild(i)}}}(t,window.document.styleSheets),k(o,"beforeunload",(()=>{this.close()})),e(r)}catch(e){t(e)}}))}))}))}createPopoutWindowContainer(){const e=document.createElement("div");return e.classList.add("dv-popout-window"),e.id="dv-popout-window",e.style.position="absolute",e.style.width="100%",e.style.height="100%",e.style.top="0px",e.style.left="0px",e}}class Ut extends P{constructor(e){super(),this.accessor=e,this.init()}init(){const e=new Set,t=new Set;this.addDisposables(this.accessor.onDidAddPanel((t=>{if(e.has(t.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${t.api.id} but panel already exists`);e.add(t.api.id)})),this.accessor.onDidRemovePanel((t=>{if(!e.has(t.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${t.api.id} but panel does not exists`);e.delete(t.api.id)})),this.accessor.onDidAddGroup((e=>{if(t.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${e.api.id} but group already exists`);t.add(e.api.id)})),this.accessor.onDidRemoveGroup((e=>{if(!t.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${e.api.id} but group does not exists`);t.delete(e.api.id)})))}}class $t extends P{constructor(e){super(),this.root=e,this._active=null,this._activeDisposable=new O,this._element=document.createElement("div"),this._element.className="dv-popover-anchor",this._element.style.position="relative",this.root.prepend(this._element),this.addDisposables(g.from((()=>{this.close()})),this._activeDisposable)}openPopover(e,t){var i;this.close();const n=document.createElement("div");n.style.position="absolute",n.style.zIndex=null!==(i=t.zIndex)&&void 0!==i?i:"var(--dv-overlay-z-index)",n.appendChild(e);const o=this._element.getBoundingClientRect(),s=o.left,r=o.top;n.style.top=t.y-r+"px",n.style.left=t.x-s+"px",this._element.appendChild(n),this._active=n,this._activeDisposable.value=new P(k(window,"pointerdown",(e=>{var t;const i=e.target;if(!(i instanceof HTMLElement))return;let o=i;for(;o&&o!==n;)o=null!==(t=null==o?void 0:o.parentElement)&&void 0!==t?t:null;o||this.close()}))),requestAnimationFrame((()=>{!function(e,t,i={buffer:10}){const n=i.buffer,o=e.getBoundingClientRect(),s=t.getBoundingClientRect();let r=0,a=0;const d=o.left-s.left,h=o.top-s.top,l=o.bottom-s.bottom,p=o.right-s.right;d<n?r=n-d:p>n&&(r=-n-p),h<n?a=n-h:l>n&&(a=-l-n),0===r&&0===a||(e.style.transform=`translate(${r}px, ${a}px)`)}(n,this.root)}))}close(){this._active&&(this._active.remove(),this._activeDisposable.dispose(),this._active=null)}}class Jt extends P{get disabled(){return this._disabled}set disabled(e){var t;this.disabled!==e&&(this._disabled=e,e&&(null===(t=this.model)||void 0===t||t.clear()))}get model(){if(!this.disabled)return{clear:()=>{var e;this._model&&(null===(e=this._model.root.parentElement)||void 0===e||e.removeChild(this._model.root)),this._model=void 0},exists:()=>!!this._model,getElements:(e,t)=>{const i=this._outline!==t;if(this._outline=t,this._model)return this._model.changed=i,this._model;const n=this.createContainer(),o=this.createAnchor();if(this._model={root:n,overlay:o,changed:i},n.appendChild(o),this.element.appendChild(n),(null==e?void 0:e.target)instanceof HTMLElement){const t=e.target.getBoundingClientRect(),i=this.element.getBoundingClientRect();o.style.left=t.left-i.left+"px",o.style.top=t.top-i.top+"px"}return this._model}}}constructor(e,t){super(),this.element=e,this._disabled=!1,this._disabled=t.disabled,this.addDisposables(g.from((()=>{var e;null===(e=this.model)||void 0===e||e.clear()})))}createContainer(){const e=document.createElement("div");return e.className="dv-drop-target-container",e}createAnchor(){const e=document.createElement("div");return e.className="dv-drop-target-anchor",e.style.visibility="hidden",e}}const Zt={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function Yt(e){const t=e.from.activePanel;[...e.from.panels].map((t=>{const i=e.from.model.removePanel(t);return e.from.model.renderContainer.detatch(t),i})).forEach((i=>{e.to.model.openPanel(i,{skipSetActive:t!==i,skipSetGroupActive:!0})}))}class Xt extends ze{get orientation(){return this.gridview.orientation}get totalPanels(){return this.panels.length}get panels(){return this.groups.flatMap((e=>e.panels))}get options(){return this._options}get activePanel(){const e=this.activeGroup;if(e)return e.activePanel}get renderer(){var e;return null!==(e=this.options.defaultRenderer)&&void 0!==e?e:"onlyWhenVisible"}get api(){return this._api}get floatingGroups(){return this._floatingGroups}get popoutRestorationPromise(){return this._popoutRestorationPromise}constructor(e,t){var i,n,o;super(e,{proportionalLayout:!0,orientation:ee.HORIZONTAL,styles:t.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:t.disableAutoResizing,locked:t.locked,margin:null!==(n=null===(i=t.theme)||void 0===i?void 0:i.gap)&&void 0!==n?n:0,className:t.className}),this.nextGroupId=q(),this._deserializer=new Ot(this),this._watermark=null,this._onWillDragPanel=new A,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new A,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new A,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new A,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new A,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new A,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPopoutGroupSizeChange=new A,this.onDidPopoutGroupSizeChange=this._onDidPopoutGroupSizeChange.event,this._onDidPopoutGroupPositionChange=new A,this.onDidPopoutGroupPositionChange=this._onDidPopoutGroupPositionChange.event,this._onDidOpenPopoutWindowFail=new A,this.onDidOpenPopoutWindowFail=this._onDidOpenPopoutWindowFail.event,this._onDidLayoutFromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new A({replay:!0}),this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new A,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new A,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._popoutRestorationPromise=Promise.resolve(),this._onDidRemoveGroup=new A,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new A,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidOptionsChange=new A,this.onDidOptionsChange=this._onDidOptionsChange.event,this._onDidActiveGroupChange=new A,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this._options=t,this.popupService=new $t(this.element),this._themeClassnames=new B(this.element),this._api=new Ee(this),this.rootDropTargetContainer=new Jt(this.element,{disabled:!0}),this.overlayRenderContainer=new jt(this.gridview.element,this),this._rootDropTarget=new Le(this.element,{className:"dv-drop-target-edge",canDisplayOverlay:(e,t)=>{const i=y();if(i)return i.viewId===this.id&&("center"!==t||0===this.gridview.length);if("center"===t&&0!==this.gridview.length)return!1;const n=new st(e,"edge",t,y);return this._onUnhandledDragOverEvent.fire(n),n.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:null!==(o=t.rootOverlayModel)&&void 0!==o?o:Zt,getOverrideTarget:()=>{var e;return null===(e=this.rootDropTargetContainer)||void 0===e?void 0:e.model}}),this.updateDropTargetModel(t),T(this.gridview.element,"dv-dockview",!0),T(this.element,"dv-debug",!!t.debug),this.updateTheme(),this.updateWatermark(),t.debug&&this.addDisposables(new Ut(this)),this.addDisposables(this.rootDropTargetContainer,this.overlayRenderContainer,this._onWillDragPanel,this._onWillDragGroup,this._onWillShowOverlay,this._onDidActivePanelChange,this._onDidAddPanel,this._onDidRemovePanel,this._onDidLayoutFromJSON,this._onDidDrop,this._onWillDrop,this._onDidMovePanel,this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this._onUnhandledDragOverEvent,this._onDidMaximizedGroupChange,this._onDidOptionsChange,this._onDidPopoutGroupSizeChange,this._onDidPopoutGroupPositionChange,this._onDidOpenPopoutWindowFail,this.onDidViewVisibilityChangeMicroTaskQueue((()=>{this.updateWatermark()})),this.onDidAdd((e=>{this._moving||this._onDidAddGroup.fire(e)})),this.onDidRemove((e=>{this._moving||this._onDidRemoveGroup.fire(e)})),this.onDidActiveChange((e=>{this._moving||this._onDidActiveGroupChange.fire(e)})),this.onDidMaximizedChange((e=>{this._onDidMaximizedGroupChange.fire({group:e.panel,isMaximized:e.isMaximized})})),m.any(this.onDidAdd,this.onDidRemove)((()=>{this.updateWatermark()})),m.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange,this.onDidPopoutGroupPositionChange,this.onDidPopoutGroupSizeChange)((()=>{this._bufferOnDidLayoutChange.fire()})),g.from((()=>{for(const e of[...this._floatingGroups])e.dispose();for(const e of[...this._popoutGroups])e.disposable.dispose()})),this._rootDropTarget,this._rootDropTarget.onWillShowOverlay((e=>{this.gridview.length>0&&"center"===e.position||this._onWillShowOverlay.fire(new qe(e,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:y}))})),this._rootDropTarget.onDrop((e=>{var t;const i=new ct({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:y,kind:"edge"});if(this._onWillDrop.fire(i),i.defaultPrevented)return;const n=y();n?this.moveGroupOrPanel({from:{groupId:n.groupId,panelId:null!==(t=n.panelId)&&void 0!==t?t:void 0},to:{group:this.orthogonalize(e.position),position:"center"}}):this._onDidDrop.fire(new pt({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:y}))})),this._rootDropTarget)}setVisible(e,t){switch(e.api.location.type){case"grid":super.setVisible(e,t);break;case"floating":{const i=this.floatingGroups.find((t=>t.group===e));i&&(i.overlay.setVisible(t),e.api._onDidVisibilityChange.fire({isVisible:t}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window")}}addPopoutGroup(e,t){var i,n,o,s,r;if(e instanceof kt&&1===e.group.size)return this.addPopoutGroup(e.group,t);const a=function(e){function t(e){const t=[];for(let i=0;i<e.classList.length;i++)t.push(e.classList.item(i));return t}let i,n=e;for(;null!==n&&(i=t(n).find((e=>e.startsWith("dockview-theme-"))),"string"!=typeof i);)n=n.parentElement;return i}(this.gridview.element),d=this.element;const h=(null==t?void 0:t.position)?t.position:e instanceof ft?e.element.getBoundingClientRect():e.group?e.group.element.getBoundingClientRect():d.getBoundingClientRect(),l=null!==(n=null===(i=null==t?void 0:t.overridePopoutGroup)||void 0===i?void 0:i.id)&&void 0!==n?n:this.getNextGroupId(),p=new Bt(`${this.id}-${l}`,null!=a?a:"",{url:null!==(r=null!==(o=null==t?void 0:t.popoutUrl)&&void 0!==o?o:null===(s=this.options)||void 0===s?void 0:s.popoutUrl)&&void 0!==r?r:"/popout.html",left:window.screenX+h.left,top:window.screenY+h.top,width:h.width,height:h.height,onDidOpen:null==t?void 0:t.onDidOpen,onWillClose:null==t?void 0:t.onWillClose}),c=new P(p,p.onDidClose((()=>{c.dispose()})));return p.open().then((i=>{var n;if(p.isDisposed)return!1;const o=(null==t?void 0:t.referenceGroup)?t.referenceGroup:e instanceof kt?e.group:e,s=e.api.location.type,r=null!==o.element.parentElement;let a;if(r?(null==t?void 0:t.overridePopoutGroup)?a=t.overridePopoutGroup:(a=this.createGroup({id:l}),i&&this._onDidAddGroup.fire(a)):a=o,null===i)return console.error("dockview: failed to create popout. perhaps you need to allow pop-ups for this website"),c.dispose(),this._onDidOpenPopoutWindowFail.fire(),this.movingLock((()=>Yt({from:a,to:o}))),o.api.isVisible||o.api.setVisible(!0),!1;const d=document.createElement("div");d.className="dv-overlay-render-container";const h=new jt(d,this);let v;if(a.model.renderContainer=h,a.layout(p.window.innerWidth,p.window.innerHeight),!(null==t?void 0:t.overridePopoutGroup)&&r)if(e instanceof kt)this.movingLock((()=>{const t=o.model.removePanel(e);a.model.openPanel(t)}));else switch(this.movingLock((()=>Yt({from:o,to:a}))),s){case"grid":o.api.setVisible(!1);break;case"floating":case"popout":v=null===(n=this._floatingGroups.find((t=>t.group.api.id===e.api.id)))||void 0===n?void 0:n.overlay.toJSON(),this.removeGroup(o)}i.classList.add("dv-dockview"),i.style.overflow="hidden",i.appendChild(d),i.appendChild(a.element);const u=document.createElement("div"),m=new Jt(u,{disabled:this.rootDropTargetContainer.disabled});let b;i.appendChild(u),a.model.dropTargetContainer=m,a.model.location={type:"popout",getWindow:()=>p.window,popoutUrl:null==t?void 0:t.popoutUrl},r&&"grid"===e.api.location.type&&e.api.setVisible(!1),this.doSetGroupAndPanelActive(a),c.addDisposables(a.api.onDidActiveChange((e=>{var t;e.isActive&&(null===(t=p.window)||void 0===t||t.focus())})),a.api.onWillFocus((()=>{var e;null===(e=p.window)||void 0===e||e.focus()})));const f=r&&o&&this.getPanel(o.id),w={window:p,popoutGroup:a,referenceGroup:f?o.id:void 0,disposable:{dispose:()=>(c.dispose(),b)}},_=function(e){const t=new A;let i,n=e.screenX,o=e.screenY;const s=()=>{if(e.closed)return;const r=e.screenX,a=e.screenY;r===n&&a===o||(clearTimeout(i),i=setTimeout((()=>{t.fire()}),100),n=r,o=a),requestAnimationFrame(s)};return s(),t}(p.window);return c.addDisposables(_,function(e,t){let i;return new P(k(e,"resize",(()=>{clearTimeout(i),i=setTimeout((()=>{t()}),100)})))}(p.window,(()=>{this._onDidPopoutGroupSizeChange.fire({width:p.window.innerWidth,height:p.window.innerHeight,group:a})})),_.event((()=>{this._onDidPopoutGroupPositionChange.fire({screenX:p.window.screenX,screenY:p.window.screenX,group:a})})),k(p.window,"resize",(()=>{a.layout(p.window.innerWidth,p.window.innerHeight)})),h,g.from((()=>{if(!this.isDisposed)if(r&&this.getPanel(o.id))this.movingLock((()=>Yt({from:a,to:o}))),o.api.isVisible||o.api.setVisible(!0),this.getPanel(a.id)&&this.doRemoveGroup(a,{skipPopoutAssociated:!0});else if(this.getPanel(a.id)){a.model.renderContainer=this.overlayRenderContainer,a.model.dropTargetContainer=this.rootDropTargetContainer,b=a;if(!this._popoutGroups.find((e=>e.popoutGroup===a)))return;v?this.addFloatingGroup(a,{height:v.height,width:v.width,position:v}):(this.doRemoveGroup(a,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),a.model.location={type:"grid"},this.movingLock((()=>{this.doAddGroup(a,[0])}))),this.doSetGroupAndPanelActive(a)}}))),this._popoutGroups.push(w),this.updateWatermark(),!0})).catch((e=>(console.error("dockview: failed to create popout.",e),!1)))}addFloatingGroup(e,t){var i,n,o,s,r;let a;if(e instanceof kt)a=this.createGroup(),this._onDidAddGroup.fire(a),this.movingLock((()=>this.removePanel(e,{removeEmptyGroup:!0,skipDispose:!0,skipSetActiveGroup:!0}))),this.movingLock((()=>a.model.openPanel(e,{skipSetGroupActive:!0})));else{a=e;const n=null===(i=this._popoutGroups.find((e=>e.popoutGroup===a)))||void 0===i?void 0:i.referenceGroup,o=n?this.getPanel(n):void 0;"boolean"==typeof(null==t?void 0:t.skipRemoveGroup)&&t.skipRemoveGroup||(o?(this.movingLock((()=>Yt({from:e,to:o}))),this.doRemoveGroup(e,{skipPopoutReturn:!0,skipPopoutAssociated:!0}),this.doRemoveGroup(o,{skipDispose:!0}),a=o):this.doRemoveGroup(e,{skipDispose:!0,skipPopoutReturn:!0,skipPopoutAssociated:!1}))}const d=function(){if(null==t?void 0:t.position){const e={};return"left"in t.position?e.left=Math.max(t.position.left,0):"right"in t.position?e.right=Math.max(t.position.right,0):e.left=Lt,"top"in t.position?e.top=Math.max(t.position.top,0):"bottom"in t.position?e.bottom=Math.max(t.position.bottom,0):e.top=Rt,"number"==typeof t.width?e.width=Math.max(t.width,0):e.width=Mt,"number"==typeof t.height?e.height=Math.max(t.height,0):e.height=Wt,e}return{left:"number"==typeof(null==t?void 0:t.x)?Math.max(t.x,0):Lt,top:"number"==typeof(null==t?void 0:t.y)?Math.max(t.y,0):Rt,width:"number"==typeof(null==t?void 0:t.width)?Math.max(t.width,0):Mt,height:"number"==typeof(null==t?void 0:t.height)?Math.max(t.height,0):Wt}}(),h=new Vt(Object.assign(Object.assign({container:this.gridview.element,content:a.element},d),{minimumInViewportWidth:"boundedWithinViewport"===this.options.floatingGroupBounds?void 0:null!==(o=null===(n=this.options.floatingGroupBounds)||void 0===n?void 0:n.minimumWidthWithinViewport)&&void 0!==o?o:Tt,minimumInViewportHeight:"boundedWithinViewport"===this.options.floatingGroupBounds?void 0:null!==(r=null===(s=this.options.floatingGroupBounds)||void 0===s?void 0:s.minimumHeightWithinViewport)&&void 0!==r?r:Tt})),l=a.element.querySelector(".dv-void-container");if(!l)throw new Error("dockview: failed to find drag handle");h.setupDrag(l,{inDragMode:"boolean"==typeof(null==t?void 0:t.inDragMode)&&t.inDragMode});const p=new Nt(a,h),c=new P(a.api.onDidActiveChange((e=>{e.isActive&&h.bringToFront()})),G(a.element,(e=>{const{width:t,height:i}=e.contentRect;a.layout(t,i)})));p.addDisposables(h.onDidChange((()=>{a.layout(a.width,a.height)})),h.onDidChangeEnd((()=>{this._bufferOnDidLayoutChange.fire()})),a.onDidChange((e=>{h.setBounds({height:null==e?void 0:e.height,width:null==e?void 0:e.width})})),{dispose:()=>{c.dispose(),Y(this._floatingGroups,p),a.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(p),a.model.location={type:"floating"},(null==t?void 0:t.skipActiveGroup)||this.doSetGroupAndPanelActive(a),this.updateWatermark()}orthogonalize(e,t){switch(this.gridview.normalize(),e){case"top":case"bottom":this.gridview.orientation===ee.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===ee.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot()}switch(e){case"top":case"left":case"center":return this.createGroupAtLocation([0],void 0,t);case"bottom":case"right":return this.createGroupAtLocation([this.gridview.length],void 0,t);default:throw new Error(`dockview: unsupported position ${e}`)}}updateOptions(e){var t,i;if(super.updateOptions(e),"floatingGroupBounds"in e)for(const n of this._floatingGroups){switch(e.floatingGroupBounds){case"boundedWithinViewport":n.overlay.minimumInViewportHeight=void 0,n.overlay.minimumInViewportWidth=void 0;break;case void 0:n.overlay.minimumInViewportHeight=Tt,n.overlay.minimumInViewportWidth=Tt;break;default:n.overlay.minimumInViewportHeight=null===(t=e.floatingGroupBounds)||void 0===t?void 0:t.minimumHeightWithinViewport,n.overlay.minimumInViewportWidth=null===(i=e.floatingGroupBounds)||void 0===i?void 0:i.minimumWidthWithinViewport}n.overlay.setBounds()}this.updateDropTargetModel(e);const n=this.options.disableDnd;this._options=Object.assign(Object.assign({},this.options),e);n!==this.options.disableDnd&&this.updateDragAndDropState(),"theme"in e&&this.updateTheme(),this.layout(this.gridview.width,this.gridview.height,!0)}layout(e,t,i){if(super.layout(e,t,i),this._floatingGroups)for(const e of this._floatingGroups)e.overlay.setBounds()}updateDragAndDropState(){for(const e of this.groups)e.model.updateDragAndDropState()}focus(){var e;null===(e=this.activeGroup)||void 0===e||e.focus()}getGroupPanel(e){return this.panels.find((t=>t.id===e))}setActivePanel(e){e.group.model.openPanel(e),this.doSetGroupAndPanelActive(e.group)}moveToNext(e={}){var t;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[e.group.panels.length-1])return void e.group.model.moveToNext({suppressRoll:!0});const i=ve(e.group.element),n=null===(t=this.gridview.next(i))||void 0===t?void 0:t.view;this.doSetGroupAndPanelActive(n)}moveToPrevious(e={}){var t;if(!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}if(e.includePanel&&e.group&&e.group.activePanel!==e.group.panels[0])return void e.group.model.moveToPrevious({suppressRoll:!0});const i=ve(e.group.element),n=null===(t=this.gridview.previous(i))||void 0===t?void 0:t.view;n&&this.doSetGroupAndPanelActive(n)}toJSON(){var e;const t=this.gridview.serialize(),i=this.panels.reduce(((e,t)=>(e[t.id]=t.toJSON(),e)),{}),n=this._floatingGroups.map((e=>({data:e.group.toJSON(),position:e.overlay.toJSON()}))),o=this._popoutGroups.map((e=>({data:e.popoutGroup.toJSON(),gridReferenceGroup:e.referenceGroup,position:e.window.dimensions(),url:"popout"===e.popoutGroup.api.location.type?e.popoutGroup.api.location.popoutUrl:void 0}))),s={grid:t,panels:i,activeGroup:null===(e=this.activeGroup)||void 0===e?void 0:e.id};return n.length>0&&(s.floatingGroups=n),o.length>0&&(s.popoutGroups=o),s}fromJSON(e,t){var i,n;const o=new Map;let s;if(null==t?void 0:t.reuseExistingPanels){s=this.createGroup(),this._groups.delete(s.api.id);const t=Object.keys(e.panels);for(const e of this.panels)t.includes(e.api.id)&&o.set(e.api.id,e);this.movingLock((()=>{Array.from(o.values()).forEach((e=>{this.moveGroupOrPanel({from:{groupId:e.api.group.api.id,panelId:e.api.id},to:{group:s,position:"center"},keepEmptyGroups:!0})}))}))}if(this.clear(),"object"!=typeof e||null===e)throw new Error("dockview: serialized layout must be a non-null object");const{grid:r,panels:a,activeGroup:d}=e;if("branch"!==r.root.type||!Array.isArray(r.root.data))throw new Error("dockview: root must be of type branch");try{const t=this.width,h=this.height,l=e=>{const{id:t,locked:i,hideHeader:n,views:r,activeView:d}=e;if("string"!=typeof t)throw new Error("dockview: group id must be of type string");const h=this.createGroup({id:t,locked:!!i,hideHeader:!!n});this._onDidAddGroup.fire(h);const l=[];for(const e of r){const t=o.get(e);if(s&&t)this.movingLock((()=>{s.model.removePanel(t)})),l.push(t),t.updateFromStateModel(a[e]);else{const t=this._deserializer.fromJSON(a[e],h);l.push(t)}}for(let e=0;e<r.length;e++){const t=l[e],i="string"==typeof d&&d===t.id;o.has(t.api.id)?this.movingLock((()=>{h.model.openPanel(t,{skipSetActive:!i,skipSetGroupActive:!0})})):h.model.openPanel(t,{skipSetActive:!i,skipSetGroupActive:!0})}return!h.activePanel&&h.panels.length>0&&h.model.openPanel(h.panels[h.panels.length-1],{skipSetGroupActive:!0}),h};this.gridview.deserialize(r,{fromJSON:e=>l(e.data)}),this.layout(t,h,!0);const p=null!==(i=e.floatingGroups)&&void 0!==i?i:[];for(const e of p){const{data:t,position:i}=e,n=l(t);this.addFloatingGroup(n,{position:i,width:i.width,height:i.height,skipRemoveGroup:!0,inDragMode:!1})}const c=null!==(n=e.popoutGroups)&&void 0!==n?n:[],v=[];c.forEach(((e,t)=>{const{data:i,position:n,gridReferenceGroup:o,url:s}=e,r=l(i),a=new Promise((e=>{setTimeout((()=>{this.addPopoutGroup(r,{position:null!=n?n:void 0,overridePopoutGroup:o?r:void 0,referenceGroup:o?this.getPanel(o):void 0,popoutUrl:s}),e()}),100*t)}));v.push(a)})),this._popoutRestorationPromise=Promise.all(v).then((()=>{}));for(const e of this._floatingGroups)e.overlay.setBounds();if("string"==typeof d){const e=this.getPanel(d);e&&this.doSetGroupAndPanelActive(e)}}catch(e){console.error("dockview: failed to deserialize layout. Reverting changes",e);for(const e of this.groups)for(const t of e.panels)this.removePanel(t,{removeEmptyGroup:!1,skipDispose:!1});for(const e of this.groups)e.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e);for(const e of[...this._floatingGroups])e.dispose();throw this.clear(),e}this.updateWatermark(),requestAnimationFrame((()=>{this.overlayRenderContainer.updateAllPositions()})),this._onDidLayoutFromJSON.fire()}clear(){const e=Array.from(this._groups.values()).map((e=>e.value)),t=!!this.activeGroup;for(const t of e)this.removeGroup(t,{skipActive:!0});t&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const e of this._groups.entries()){const[t,i]=e;i.value.model.closeAllPanels()}}addPanel(e){var t,i;if(this.panels.find((t=>t.id===e.id)))throw new Error(`dockview: panel with id ${e.id} already exists`);let n;if(e.position&&e.floating)throw new Error("dockview: you can only provide one of: position, floating as arguments to .addPanel(...)");const o={width:e.initialWidth,height:e.initialHeight};let s,r;if(e.position)if(at(e.position)){const t="string"==typeof e.position.referencePanel?this.getGroupPanel(e.position.referencePanel):e.position.referencePanel;if(s=e.position.index,!t)throw new Error(`dockview: referencePanel '${e.position.referencePanel}' does not exist`);n=this.findGroup(t)}else{if(!dt(e.position)){const t=this.orthogonalize(Ge(e.position.direction)),i=this.createPanel(e,t);return t.model.openPanel(i,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),e.inactive||this.doSetGroupAndPanelActive(t),t.api.setSize({height:null==o?void 0:o.height,width:null==o?void 0:o.width}),i}if(n="string"==typeof e.position.referenceGroup?null===(t=this._groups.get(e.position.referenceGroup))||void 0===t?void 0:t.value:e.position.referenceGroup,s=e.position.index,!n)throw new Error(`dockview: referenceGroup '${e.position.referenceGroup}' does not exist`)}else n=this.activeGroup;if(n){const t=Ce((null===(i=e.position)||void 0===i?void 0:i.direction)||"within");if(e.floating){const t=this.createGroup();this._onDidAddGroup.fire(t);const i="object"==typeof e.floating&&null!==e.floating?e.floating:{};this.addFloatingGroup(t,Object.assign(Object.assign({},i),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),r=this.createPanel(e,t),t.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s})}else if("floating"===n.api.location.type||"center"===t)r=this.createPanel(e,n),n.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),n.api.setSize({width:null==o?void 0:o.width,height:null==o?void 0:o.height}),e.inactive||this.doSetGroupAndPanelActive(n);else{const i=ve(n.element),a=ue(this.gridview.orientation,i,t),d=this.createGroupAtLocation(a,this.orientationAtLocation(a)===ee.VERTICAL?null==o?void 0:o.height:null==o?void 0:o.width);r=this.createPanel(e,d),d.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),e.inactive||this.doSetGroupAndPanelActive(d)}}else if(e.floating){const t=this.createGroup();this._onDidAddGroup.fire(t);const i="object"==typeof e.floating&&null!==e.floating?e.floating:{};this.addFloatingGroup(t,Object.assign(Object.assign({},i),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),r=this.createPanel(e,t),t.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s})}else{const t=this.createGroupAtLocation([0],this.gridview.orientation===ee.VERTICAL?null==o?void 0:o.height:null==o?void 0:o.width);r=this.createPanel(e,t),t.model.openPanel(r,{skipSetActive:e.inactive,skipSetGroupActive:e.inactive,index:s}),e.inactive||this.doSetGroupAndPanelActive(t)}return r}removePanel(e,t={removeEmptyGroup:!0}){const i=e.group;if(!i)throw new Error(`dockview: cannot remove panel ${e.id}. it's missing a group.`);i.model.removePanel(e,{skipSetActiveGroup:t.skipSetActiveGroup}),t.skipDispose||(e.group.model.renderContainer.detatch(e),e.dispose()),0===i.size&&t.removeEmptyGroup&&this.removeGroup(i,{skipActive:t.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new It}updateWatermark(){var e,t,i;if(0===this.groups.filter((e=>"grid"===e.api.location.type&&e.api.isVisible)).length){if(!this._watermark){this._watermark=this.createWatermarkComponent(),this._watermark.init({containerApi:new Ee(this)});const e=document.createElement("div");e.className="dv-watermark-container",i="watermark-component",e.setAttribute("data-testid",i),e.appendChild(this._watermark.element),this.gridview.element.appendChild(e)}}else this._watermark&&(this._watermark.element.parentElement.remove(),null===(t=(e=this._watermark).dispose)||void 0===t||t.call(e),this._watermark=null)}addGroup(e){var t;if(e){let i;if(ht(e)){const t="string"==typeof e.referencePanel?this.panels.find((t=>t.id===e.referencePanel)):e.referencePanel;if(!t)throw new Error(`dockview: reference panel ${e.referencePanel} does not exist`);if(i=this.findGroup(t),!i)throw new Error(`dockview: reference group for reference panel ${e.referencePanel} does not exist`)}else{if(!lt(e)){const t=this.orthogonalize(Ge(e.direction),e);return e.skipSetActive||this.doSetGroupAndPanelActive(t),t}if(i="string"==typeof e.referenceGroup?null===(t=this._groups.get(e.referenceGroup))||void 0===t?void 0:t.value:e.referenceGroup,!i)throw new Error(`dockview: reference group ${e.referenceGroup} does not exist`)}const n=Ce(e.direction||"within"),o=ve(i.element),s=ue(this.gridview.orientation,o,n),r=this.createGroup(e),a=this.getLocationOrientation(s)===ee.VERTICAL?e.initialHeight:e.initialWidth;return this.doAddGroup(r,s,a),e.skipSetActive||this.doSetGroupAndPanelActive(r),r}{const t=this.createGroup(e);return this.doAddGroup(t),this.doSetGroupAndPanelActive(t),t}}getLocationOrientation(e){return e.length%2==0&&this.gridview.orientation===ee.HORIZONTAL?ee.HORIZONTAL:ee.VERTICAL}removeGroup(e,t){this.doRemoveGroup(e,t)}doRemoveGroup(e,t){var i;const n=[...e.panels];if(!(null==t?void 0:t.skipDispose))for(const e of n)this.removePanel(e,{removeEmptyGroup:!1,skipDispose:null!==(i=null==t?void 0:t.skipDispose)&&void 0!==i&&i});const o=this.activePanel;if("floating"===e.api.location.type){const i=this._floatingGroups.find((t=>t.group===e));if(i){if((null==t?void 0:t.skipDispose)||(i.group.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)),Y(this._floatingGroups,i),i.dispose(),!(null==t?void 0:t.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return i.group}throw new Error("dockview: failed to find floating group")}if("popout"===e.api.location.type){const i=this._popoutGroups.find((t=>t.popoutGroup===e));if(i){if(!(null==t?void 0:t.skipDispose)){if(!(null==t?void 0:t.skipPopoutAssociated)){const e=i.referenceGroup?this.getPanel(i.referenceGroup):void 0;e&&0===e.panels.length&&this.removeGroup(e)}i.popoutGroup.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)}Y(this._popoutGroups,i);const n=i.disposable.dispose();if(!(null==t?void 0:t.skipPopoutReturn)&&n&&(this.doAddGroup(n,[0]),this.doSetGroupAndPanelActive(n)),!(null==t?void 0:t.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return this.updateWatermark(),i.popoutGroup}throw new Error("dockview: failed to find popout group")}const s=super.doRemoveGroup(e,t);return(null==t?void 0:t.skipActive)||this.activePanel!==o&&this._onDidActivePanelChange.fire(this.activePanel),s}movingLock(e){const t=this._moving;try{return this._moving=!0,e()}finally{this._moving=t}}moveGroupOrPanel(e){var t;const i=e.to.group,n=e.from.groupId,o=e.from.panelId,s=e.to.position,r=e.to.index,a=n?null===(t=this._groups.get(n))||void 0===t?void 0:t.value:void 0;if(!a)throw new Error(`dockview: Failed to find group id ${n}`);if(void 0!==o)if(s&&"center"!==s){const e=ve(i.element),t=ue(this.gridview.orientation,e,s);if(a.size<2){const[e,n]=U(t);if("grid"===a.api.location.type){const t=ve(a.element),[i,s]=U(t);if($(i,e))return this.gridview.moveView(i,s,n),void this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:a})}if("popout"===a.api.location.type){const e=this._popoutGroups.find((e=>e.popoutGroup===a)),i=this.movingLock((()=>e.popoutGroup.model.removePanel(e.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0})));this.doRemoveGroup(a,{skipActive:!0});const n=this.createGroupAtLocation(t);return this.movingLock((()=>n.model.openPanel(i,{skipSetActive:!0}))),this.doSetGroupAndPanelActive(n),void this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:a})}const r=this.movingLock((()=>this.doRemoveGroup(a,{skipActive:!0,skipDispose:!0}))),d=ve(i.element),h=ue(this.gridview.orientation,d,s);this.movingLock((()=>this.doAddGroup(r,h))),this.doSetGroupAndPanelActive(r),this._onDidMovePanel.fire({panel:this.getGroupPanel(o),from:a})}else{const t=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!t)throw new Error(`dockview: No panel with id ${o}`);const i=ue(this.gridview.orientation,e,s),n=this.createGroupAtLocation(i);this.movingLock((()=>n.model.openPanel(t,{skipSetGroupActive:!0}))),this.doSetGroupAndPanelActive(n),this._onDidMovePanel.fire({panel:t,from:a})}}else{const t=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!t)throw new Error(`dockview: No panel with id ${o}`);e.keepEmptyGroups||0!==a.model.size||this.doRemoveGroup(a,{skipActive:!0});const n=0===i.model.size;this.movingLock((()=>{var o;return i.model.openPanel(t,{index:r,skipSetActive:null!==(o=e.skipSetActive)&&void 0!==o&&o&&!n,skipSetGroupActive:!0})})),e.skipSetActive||this.doSetGroupAndPanelActive(i),this._onDidMovePanel.fire({panel:t,from:a}),requestAnimationFrame((()=>{this.overlayRenderContainer.updateAllPositions()}))}else this.moveGroup({from:{group:a},to:{group:i,position:s},skipSetActive:e.skipSetActive})}moveGroup(e){const t=e.from.group,i=e.to.group,n=e.to.position;if("center"===n){const n=t.activePanel,o=this.movingLock((()=>[...t.panels].map((e=>t.model.removePanel(e.id,{skipSetActive:!0})))));0===(null==t?void 0:t.model.size)&&this.doRemoveGroup(t,{skipActive:!0}),this.movingLock((()=>{for(const e of o)i.model.openPanel(e,{skipSetActive:e!==n,skipSetGroupActive:!0})})),!0!==e.skipSetActive?this.doSetGroupAndPanelActive(i):this.activePanel||this.doSetGroupAndPanelActive(i)}else{switch(t.api.location.type){case"grid":this.gridview.removeView(ve(t.element));break;case"floating":{const e=this._floatingGroups.find((e=>e.group===t));if(!e)throw new Error("dockview: failed to find floating group");e.dispose();break}case"popout":{const e=this._popoutGroups.find((e=>e.popoutGroup===t));if(!e)throw new Error("dockview: failed to find popout group");const n=this._popoutGroups.indexOf(e);if(n>=0&&this._popoutGroups.splice(n,1),e.referenceGroup){const t=this.getPanel(e.referenceGroup);t&&!t.api.isVisible&&this.doRemoveGroup(t,{skipActive:!0})}e.window.dispose(),"grid"===i.api.location.type?(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"grid"}):"floating"===i.api.location.type&&(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"floating"});break}}if("grid"===i.api.location.type){const e=ve(i.element),o=ue(this.gridview.orientation,e,n);let s;switch(this.gridview.orientation){case ee.VERTICAL:s=e.length%2==0?t.api.width:t.api.height;break;case ee.HORIZONTAL:s=e.length%2==0?t.api.height:t.api.width}this.gridview.addView(t,s,o)}else if("floating"===i.api.location.type){const e=this._floatingGroups.find((e=>e.group===i));if(e){const i=e.overlay.toJSON();let n,o;n="left"in i?i.left+50:"right"in i?Math.max(0,i.right-i.width-50):50,o="top"in i?i.top+50:"bottom"in i?Math.max(0,i.bottom-i.height-50):50,this.addFloatingGroup(t,{height:i.height,width:i.width,position:{left:n,top:o}})}}}if(t.panels.forEach((e=>{this._onDidMovePanel.fire({panel:e,from:t})})),!1===e.skipSetActive){const e=null!=i?i:t;this.doSetGroupAndPanelActive(e)}}doSetGroupActive(e){super.doSetGroupActive(e);const t=this.activePanel;this._moving||t===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(t)}doSetGroupAndPanelActive(e){super.doSetGroupActive(e);const t=this.activePanel;e&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(e)&&this.exitMaximizedGroup(),this._moving||t===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(t)}getNextGroupId(){let e=this.nextGroupId.next();for(;this._groups.has(e);)e=this.nextGroupId.next();return e}createGroup(e){e||(e={});let t=null==e?void 0:e.id;if(t&&this._groups.has(e.id)&&(console.warn(`dockview: Duplicate group id ${null==e?void 0:e.id}. reassigning group id to avoid errors`),t=void 0),!t)for(t=this.nextGroupId.next();this._groups.has(t);)t=this.nextGroupId.next();const i=new ft(this,t,e);if(i.init({params:{},accessor:this}),!this._groups.has(i.id)){const e=new P(i.model.onTabDragStart((e=>{this._onWillDragPanel.fire(e)})),i.model.onGroupDragStart((e=>{this._onWillDragGroup.fire(e)})),i.model.onMove((e=>{const{groupId:t,itemId:n,target:o,index:s}=e;this.moveGroupOrPanel({from:{groupId:t,panelId:n},to:{group:i,position:o,index:s}})})),i.model.onDidDrop((e=>{this._onDidDrop.fire(e)})),i.model.onWillDrop((e=>{this._onWillDrop.fire(e)})),i.model.onWillShowOverlay((e=>{this.options.disableDnd?e.preventDefault():this._onWillShowOverlay.fire(e)})),i.model.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})),i.model.onDidAddPanel((e=>{this._moving||this._onDidAddPanel.fire(e.panel)})),i.model.onDidRemovePanel((e=>{this._moving||this._onDidRemovePanel.fire(e.panel)})),i.model.onDidActivePanelChange((e=>{this._moving||e.panel===this.activePanel&&this._onDidActivePanelChange.value!==e.panel&&this._onDidActivePanelChange.fire(e.panel)})),m.any(i.model.onDidPanelTitleChange,i.model.onDidPanelParametersChange)((()=>{this._bufferOnDidLayoutChange.fire()})));this._groups.set(i.id,{value:i,disposable:e})}return i.initialize(),i}createPanel(e,t){var i,n,o;const s=e.component,r=null!==(i=e.tabComponent)&&void 0!==i?i:this.options.defaultTabComponent,a=new Pt(this,e.id,s,r),d=new kt(e.id,s,r,this,this._api,t,a,{renderer:e.renderer,minimumWidth:e.minimumWidth,minimumHeight:e.minimumHeight,maximumWidth:e.maximumWidth,maximumHeight:e.maximumHeight});return d.init({title:null!==(n=e.title)&&void 0!==n?n:e.id,params:null!==(o=null==e?void 0:e.params)&&void 0!==o?o:{}}),d}createGroupAtLocation(e,t,i){const n=this.createGroup(i);return this.doAddGroup(n,e,t),n}findGroup(e){var t;return null===(t=Array.from(this._groups.values()).find((t=>t.value.model.containsPanel(e))))||void 0===t?void 0:t.value}orientationAtLocation(e){const t=this.gridview.orientation;return e.length%2==1?t:be(t)}updateDropTargetModel(e){"dndEdges"in e&&(this._rootDropTarget.disabled="boolean"==typeof e.dndEdges&&!1===e.dndEdges,"object"==typeof e.dndEdges&&null!==e.dndEdges?this._rootDropTarget.setOverlayModel(e.dndEdges):this._rootDropTarget.setOverlayModel(Zt)),"rootOverlayModel"in e&&this.updateDropTargetModel({dndEdges:e.dndEdges})}updateTheme(){var e,t;const i=null!==(e=this._options.theme)&&void 0!==e?e:Dt;if(this._themeClassnames.setClassNames(i.className),this.gridview.margin=null!==(t=i.gap)&&void 0!==t?t:0,"absolute"===i.dndOverlayMounting)this.rootDropTargetContainer.disabled=!1;else this.rootDropTargetContainer.disabled=!0}}class qt extends ze{get orientation(){return this.gridview.orientation}set orientation(e){this.gridview.orientation=e}get options(){return this._options}get deserializer(){return this._deserializer}set deserializer(e){this._deserializer=e}constructor(e,t){var i;super(e,{proportionalLayout:null===(i=t.proportionalLayout)||void 0===i||i,orientation:t.orientation,styles:t.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:t.disableAutoResizing,className:t.className}),this._onDidLayoutfromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidRemoveGroup=new A,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new A,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new A,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._options=t,this.addDisposables(this._onDidAddGroup,this._onDidRemoveGroup,this._onDidActiveGroupChange,this.onDidAdd((e=>{this._onDidAddGroup.fire(e)})),this.onDidRemove((e=>{this._onDidRemoveGroup.fire(e)})),this.onDidActiveChange((e=>{this._onDidActiveGroupChange.fire(e)})))}updateOptions(e){super.updateOptions(e);const t="string"==typeof e.orientation&&this.gridview.orientation!==e.orientation;this._options=Object.assign(Object.assign({},this.options),e),t&&(this.gridview.orientation=e.orientation),this.layout(this.gridview.width,this.gridview.height,!0)}removePanel(e){this.removeGroup(e)}toJSON(){var e;return{grid:this.gridview.serialize(),activePanel:null===(e=this.activeGroup)||void 0===e?void 0:e.id}}setVisible(e,t){this.gridview.setViewVisible(ve(e.element),t)}setActive(e){this._groups.forEach(((t,i)=>{t.value.setActive(e===t.value)}))}focus(){var e;null===(e=this.activeGroup)||void 0===e||e.focus()}fromJSON(e){this.clear();const{grid:t,activePanel:i}=e;try{const e=[],n=this.width,o=this.height;if(this.gridview.deserialize(t,{fromJSON:t=>{const{data:i}=t,n=this.options.createComponent({id:i.id,name:i.component});return e.push((()=>n.init({params:i.params,minimumWidth:i.minimumWidth,maximumWidth:i.maximumWidth,minimumHeight:i.minimumHeight,maximumHeight:i.maximumHeight,priority:i.priority,snap:!!i.snap,accessor:this,isVisible:t.visible}))),this._onDidAddGroup.fire(n),this.registerPanel(n),n}}),this.layout(n,o,!0),e.forEach((e=>e())),"string"==typeof i){const e=this.getPanel(i);e&&this.doSetGroupActive(e)}}catch(e){for(const e of this.groups)e.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e);throw this.clear(),e}this._onDidLayoutfromJSON.fire()}clear(){const e=this.activeGroup,t=Array.from(this._groups.values());for(const e of t)e.disposable.dispose(),this.doRemoveGroup(e.value,{skipActive:!0});e&&this.doSetGroupActive(void 0),this.gridview.clear()}movePanel(e,t){var i;let n;const o=this.gridview.remove(e),s=null===(i=this._groups.get(t.reference))||void 0===i?void 0:i.value;if(!s)throw new Error(`reference group ${t.reference} does not exist`);const r=Ce(t.direction);if("center"===r)throw new Error(`${r} not supported as an option`);{const e=ve(s.element);n=ue(this.gridview.orientation,e,r)}this.doAddGroup(o,n,t.size)}addPanel(e){var t,i,n,o;let s=null!==(t=e.location)&&void 0!==t?t:[0];if(null===(i=e.position)||void 0===i?void 0:i.referencePanel){const t=null===(n=this._groups.get(e.position.referencePanel))||void 0===n?void 0:n.value;if(!t)throw new Error(`reference group ${e.position.referencePanel} does not exist`);const i=Ce(e.position.direction);if("center"===i)throw new Error(`${i} not supported as an option`);{const e=ve(t.element);s=ue(this.gridview.orientation,e,i)}}const r=this.options.createComponent({id:e.id,name:e.component});return r.init({params:null!==(o=e.params)&&void 0!==o?o:{},minimumWidth:e.minimumWidth,maximumWidth:e.maximumWidth,minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight,priority:e.priority,snap:!!e.snap,accessor:this,isVisible:!0}),this.doAddGroup(r,s,e.size),this.registerPanel(r),this.doSetGroupActive(r),r}registerPanel(e){const t=new P(e.api.onDidFocusChange((t=>{t.isFocused&&this._groups.forEach((t=>{const i=t.value;i!==e?i.setActive(!1):i.setActive(!0)}))})));this._groups.set(e.id,{value:e,disposable:t})}moveGroup(e,t,i){const n=this.getPanel(t);if(!n)throw new Error("invalid operation");const o=ve(e.element),s=ue(this.gridview.orientation,o,i),[r,a]=U(s),d=ve(n.element),[h,l]=U(d);if($(h,r))return void this.gridview.moveView(h,l,a);const p=this.doRemoveGroup(n,{skipActive:!0,skipDispose:!0}),c=ve(e.element),v=ue(this.gridview.orientation,c,i);this.doAddGroup(p,v)}removeGroup(e){super.removeGroup(e)}dispose(){super.dispose(),this._onDidLayoutfromJSON.dispose()}}class Kt extends De{get panels(){return this.splitview.getViews()}get options(){return this._options}get length(){return this._panels.size}get orientation(){return this.splitview.orientation}get splitview(){return this._splitview}set splitview(e){this._splitview&&this._splitview.dispose(),this._splitview=e,this._splitviewChangeDisposable.value=new P(this._splitview.onDidSashEnd((()=>{this._onDidLayoutChange.fire(void 0)})),this._splitview.onDidAddView((e=>this._onDidAddView.fire(e))),this._splitview.onDidRemoveView((e=>this._onDidRemoveView.fire(e))))}get minimumSize(){return this.splitview.minimumSize}get maximumSize(){return this.splitview.maximumSize}get height(){return this.splitview.orientation===ee.HORIZONTAL?this.splitview.orthogonalSize:this.splitview.size}get width(){return this.splitview.orientation===ee.HORIZONTAL?this.splitview.size:this.splitview.orthogonalSize}constructor(e,t){var i;super(document.createElement("div"),t.disableAutoResizing),this._splitviewChangeDisposable=new O,this._panels=new Map,this._onDidLayoutfromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidAddView=new A,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new A,this.onDidRemoveView=this._onDidRemoveView.event,this._onDidLayoutChange=new A,this.onDidLayoutChange=this._onDidLayoutChange.event,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new B(this.element),this._classNames.setClassNames(null!==(i=t.className)&&void 0!==i?i:""),e.appendChild(this.element),this._options=t,this.splitview=new oe(this.element,t),this.addDisposables(this._onDidAddView,this._onDidLayoutfromJSON,this._onDidRemoveView,this._onDidLayoutChange)}updateOptions(e){var t,i;"className"in e&&this._classNames.setClassNames(null!==(t=e.className)&&void 0!==t?t:""),"disableResizing"in e&&(this.disableResizing=null!==(i=e.disableAutoResizing)&&void 0!==i&&i),"string"==typeof e.orientation&&(this.splitview.orientation=e.orientation),this._options=Object.assign(Object.assign({},this.options),e),this.splitview.layout(this.splitview.size,this.splitview.orthogonalSize)}focus(){var e;null===(e=this._activePanel)||void 0===e||e.focus()}movePanel(e,t){this.splitview.moveView(e,t)}setVisible(e,t){const i=this.panels.indexOf(e);this.splitview.setViewVisible(i,t)}setActive(e,t){this._activePanel=e,this.panels.filter((t=>t!==e)).forEach((e=>{e.api._onDidActiveChange.fire({isActive:!1}),t||e.focus()})),e.api._onDidActiveChange.fire({isActive:!0}),t||e.focus()}removePanel(e,t){const i=this._panels.get(e.id);if(!i)throw new Error(`unknown splitview panel ${e.id}`);i.dispose(),this._panels.delete(e.id);const n=this.panels.findIndex((t=>t===e));this.splitview.removeView(n,t).dispose();const o=this.panels;o.length>0&&this.setActive(o[o.length-1])}getPanel(e){return this.panels.find((t=>t.id===e))}addPanel(e){var t;if(this._panels.has(e.id))throw new Error(`panel ${e.id} already exists`);const i=this.options.createComponent({id:e.id,name:e.component});i.orientation=this.splitview.orientation,i.init({params:null!==(t=e.params)&&void 0!==t?t:{},minimumSize:e.minimumSize,maximumSize:e.maximumSize,snap:e.snap,priority:e.priority,accessor:this});const n="number"==typeof e.size?e.size:ne.Distribute,o="number"==typeof e.index?e.index:void 0;return this.splitview.addView(i,n,o),this.doAddView(i),this.setActive(i),i}layout(e,t){const[i,n]=this.splitview.orientation===ee.HORIZONTAL?[e,t]:[t,e];this.splitview.layout(i,n)}doAddView(e){const t=e.api.onDidFocusChange((t=>{t.isFocused&&this.setActive(e,!0)}));this._panels.set(e.id,t)}toJSON(){var e;return{views:this.splitview.getViews().map(((e,t)=>({size:this.splitview.getViewSize(t),data:e.toJSON(),snap:!!e.snap,priority:e.priority}))),activeView:null===(e=this._activePanel)||void 0===e?void 0:e.id,size:this.splitview.size,orientation:this.splitview.orientation}}fromJSON(e){this.clear();const{views:t,orientation:i,size:n,activeView:o}=e,s=[],r=this.width,a=this.height;if(this.splitview=new oe(this.element,{orientation:i,proportionalLayout:this.options.proportionalLayout,descriptor:{size:n,views:t.map((e=>{const t=e.data;if(this._panels.has(t.id))throw new Error(`panel ${t.id} already exists`);const n=this.options.createComponent({id:t.id,name:t.component});return s.push((()=>{var i;n.init({params:null!==(i=t.params)&&void 0!==i?i:{},minimumSize:t.minimumSize,maximumSize:t.maximumSize,snap:e.snap,priority:e.priority,accessor:this})})),n.orientation=i,this.doAddView(n),setTimeout((()=>{this._onDidAddView.fire(n)}),0),{size:e.size,view:n}}))}}),this.layout(r,a),s.forEach((e=>e())),"string"==typeof o){const e=this.getPanel(o);e&&this.setActive(e)}this._onDidLayoutfromJSON.fire()}clear(){for(const e of this._panels.values())e.dispose();for(this._panels.clear();this.splitview.length>0;){this.splitview.removeView(0,ne.Distribute,!0).dispose()}}dispose(){for(const e of this._panels.values())e.dispose();this._panels.clear();const e=this.splitview.getViews();this._splitviewChangeDisposable.dispose(),this.splitview.dispose();for(const t of e)t.dispose();this.element.remove(),super.dispose()}}class Qt extends P{get element(){return this._element}constructor(){super(),this._expandedIcon=it({width:"11",height:"11",viewbox:"0 0 24 15",path:"M12 14.15L0 2.15L2.15 0L12 9.9L21.85 0.0499992L24 2.2L12 14.15Z"}),this._collapsedIcon=nt(),this.disposable=new O,this.apiRef={api:null},this._element=document.createElement("div"),this.element.className="dv-default-header",this._content=document.createElement("span"),this._expander=document.createElement("div"),this._expander.className="dv-pane-header-icon",this.element.appendChild(this._expander),this.element.appendChild(this._content),this.addDisposables(k(this._element,"click",(()=>{var e;null===(e=this.apiRef.api)||void 0===e||e.setExpanded(!this.apiRef.api.isExpanded)})))}init(e){this.apiRef.api=e.api,this._content.textContent=e.title,this.updateIcon(),this.disposable.value=e.api.onDidExpansionChange((()=>{this.updateIcon()}))}updateIcon(){var e;const t=!!(null===(e=this.apiRef.api)||void 0===e?void 0:e.isExpanded);T(this._expander,"collapsed",!t),t?(this._expander.contains(this._collapsedIcon)&&this._collapsedIcon.remove(),this._expander.contains(this._expandedIcon)||this._expander.appendChild(this._expandedIcon)):(this._expander.contains(this._expandedIcon)&&this._expandedIcon.remove(),this._expander.contains(this._collapsedIcon)||this._expander.appendChild(this._collapsedIcon))}update(e){}dispose(){this.disposable.dispose(),super.dispose()}}const ei=q(),ti=Number.MAX_SAFE_INTEGER;class ii extends $e{constructor(e){super({accessor:e.accessor,id:e.id,component:e.component,headerComponent:e.headerComponent,orientation:e.orientation,isExpanded:e.isExpanded,disableDnd:e.disableDnd,headerSize:e.headerSize,minimumBodySize:e.minimumBodySize,maximumBodySize:e.maximumBodySize}),this.options=e}getBodyComponent(){return this.options.body}getHeaderComponent(){return this.options.header}}class ni extends De{get id(){return this._id}get panels(){return this.paneview.getPanes()}set paneview(e){this._paneview=e,this._disposable.value=new P(this._paneview.onDidChange((()=>{this._onDidLayoutChange.fire(void 0)})),this._paneview.onDidAddView((e=>this._onDidAddView.fire(e))),this._paneview.onDidRemoveView((e=>this._onDidRemoveView.fire(e))))}get paneview(){return this._paneview}get minimumSize(){return this.paneview.minimumSize}get maximumSize(){return this.paneview.maximumSize}get height(){return this.paneview.orientation===ee.HORIZONTAL?this.paneview.orthogonalSize:this.paneview.size}get width(){return this.paneview.orientation===ee.HORIZONTAL?this.paneview.size:this.paneview.orthogonalSize}get options(){return this._options}constructor(e,t){var i;super(document.createElement("div"),t.disableAutoResizing),this._id=ei.next(),this._disposable=new O,this._viewDisposables=new Map,this._onDidLayoutfromJSON=new A,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidLayoutChange=new A,this.onDidLayoutChange=this._onDidLayoutChange.event,this._onDidDrop=new A,this.onDidDrop=this._onDidDrop.event,this._onDidAddView=new A,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new A,this.onDidRemoveView=this._onDidRemoveView.event,this._onUnhandledDragOverEvent=new A,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this.element.style.height="100%",this.element.style.width="100%",this.addDisposables(this._onDidLayoutChange,this._onDidLayoutfromJSON,this._onDidDrop,this._onDidAddView,this._onDidRemoveView,this._onUnhandledDragOverEvent),this._classNames=new B(this.element),this._classNames.setClassNames(null!==(i=t.className)&&void 0!==i?i:""),e.appendChild(this.element),this._options=t,this.paneview=new re(this.element,{orientation:ee.VERTICAL}),this.addDisposables(this._disposable)}setVisible(e,t){const i=this.panels.indexOf(e);this.paneview.setViewVisible(i,t)}focus(){}updateOptions(e){var t,i;"className"in e&&this._classNames.setClassNames(null!==(t=e.className)&&void 0!==t?t:""),"disableResizing"in e&&(this.disableResizing=null!==(i=e.disableAutoResizing)&&void 0!==i&&i),this._options=Object.assign(Object.assign({},this.options),e)}addPanel(e){var t,i;const n=this.options.createComponent({id:e.id,name:e.component});let o;e.headerComponent&&this.options.createHeaderComponent&&(o=this.options.createHeaderComponent({id:e.id,name:e.headerComponent})),o||(o=new Qt);const s=new ii({id:e.id,component:e.component,headerComponent:e.headerComponent,header:o,body:n,orientation:ee.VERTICAL,isExpanded:!!e.isExpanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=e.headerSize)&&void 0!==t?t:22,minimumBodySize:0,maximumBodySize:ti});this.doAddPanel(s);const r="number"==typeof e.size?e.size:ne.Distribute,a="number"==typeof e.index?e.index:void 0;return s.init({params:null!==(i=e.params)&&void 0!==i?i:{},minimumBodySize:e.minimumBodySize,maximumBodySize:e.maximumBodySize,isExpanded:e.isExpanded,title:e.title,containerApi:new Ae(this),accessor:this}),this.paneview.addPane(s,r,a),s.orientation=this.paneview.orientation,s}removePanel(e){const t=this.panels.findIndex((t=>t===e));this.paneview.removePane(t),this.doRemovePanel(e)}movePanel(e,t){this.paneview.moveView(e,t)}getPanel(e){return this.panels.find((t=>t.id===e))}layout(e,t){const[i,n]=this.paneview.orientation===ee.HORIZONTAL?[e,t]:[t,e];this.paneview.layout(i,n)}toJSON(){const e=e=>e===Number.MAX_SAFE_INTEGER||e===Number.POSITIVE_INFINITY?void 0:e;return{views:this.paneview.getPanes().map(((t,i)=>{return{size:this.paneview.getViewSize(i),data:t.toJSON(),minimumSize:(n=t.minimumBodySize,n<=0?void 0:n),maximumSize:e(t.maximumBodySize),headerSize:t.headerSize,expanded:t.isExpanded()};var n})),size:this.paneview.size}}fromJSON(e){this.clear();const{views:t,size:i}=e,n=[],o=this.width,s=this.height;this.paneview=new re(this.element,{orientation:ee.VERTICAL,descriptor:{size:i,views:t.map((e=>{var t,i,o;const s=e.data,r=this.options.createComponent({id:s.id,name:s.component});let a;s.headerComponent&&this.options.createHeaderComponent&&(a=this.options.createHeaderComponent({id:s.id,name:s.headerComponent})),a||(a=new Qt);const d=new ii({id:s.id,component:s.component,headerComponent:s.headerComponent,header:a,body:r,orientation:ee.VERTICAL,isExpanded:!!e.expanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=e.headerSize)&&void 0!==t?t:22,minimumBodySize:null!==(i=e.minimumSize)&&void 0!==i?i:0,maximumBodySize:null!==(o=e.maximumSize)&&void 0!==o?o:ti});return this.doAddPanel(d),n.push((()=>{var t;d.init({params:null!==(t=s.params)&&void 0!==t?t:{},minimumBodySize:e.minimumSize,maximumBodySize:e.maximumSize,title:s.title,isExpanded:!!e.expanded,containerApi:new Ae(this),accessor:this}),d.orientation=this.paneview.orientation})),setTimeout((()=>{this._onDidAddView.fire(d)}),0),{size:e.size,view:d}}))}}),this.layout(o,s),n.forEach((e=>e())),this._onDidLayoutfromJSON.fire()}clear(){for(const[e,t]of this._viewDisposables.entries())t.dispose();this._viewDisposables.clear(),this.paneview.dispose()}doAddPanel(e){const t=new P(e.onDidDrop((e=>{this._onDidDrop.fire(e)})),e.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})));this._viewDisposables.set(e.id,t)}doRemovePanel(e){const t=this._viewDisposables.get(e.id);t&&(t.dispose(),this._viewDisposables.delete(e.id))}dispose(){super.dispose();for(const[e,t]of this._viewDisposables.entries())t.dispose();this._viewDisposables.clear(),this.element.remove(),this.paneview.dispose()}}class oi extends Be{get priority(){return this._priority}set orientation(e){this._orientation=e}get orientation(){return this._orientation}get minimumSize(){const e="function"==typeof this._minimumSize?this._minimumSize():this._minimumSize;return e!==this._evaluatedMinimumSize&&(this._evaluatedMinimumSize=e,this.updateConstraints()),e}get maximumSize(){const e="function"==typeof this._maximumSize?this._maximumSize():this._maximumSize;return e!==this._evaluatedMaximumSize&&(this._evaluatedMaximumSize=e,this.updateConstraints()),e}get snap(){return this._snap}constructor(e,t){super(e,t,new je(e,t)),this._evaluatedMinimumSize=0,this._evaluatedMaximumSize=Number.POSITIVE_INFINITY,this._minimumSize=0,this._maximumSize=Number.POSITIVE_INFINITY,this._snap=!1,this._onDidChange=new A,this.onDidChange=this._onDidChange.event,this.api.initialize(this),this.addDisposables(this._onDidChange,this.api.onWillVisibilityChange((e=>{const{isVisible:t}=e,{accessor:i}=this._params;i.setVisible(this,t)})),this.api.onActiveChange((()=>{const{accessor:e}=this._params;e.setActive(this)})),this.api.onDidConstraintsChangeInternal((e=>{"number"!=typeof e.minimumSize&&"function"!=typeof e.minimumSize||(this._minimumSize=e.minimumSize),"number"!=typeof e.maximumSize&&"function"!=typeof e.maximumSize||(this._maximumSize=e.maximumSize),this.updateConstraints()})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({size:e.size})})))}setVisible(e){this.api._onDidVisibilityChange.fire({isVisible:e})}setActive(e){this.api._onDidActiveChange.fire({isActive:e})}layout(e,t){const[i,n]=this.orientation===ee.HORIZONTAL?[e,t]:[t,e];super.layout(i,n)}init(e){super.init(e),this._priority=e.priority,e.minimumSize&&(this._minimumSize=e.minimumSize),e.maximumSize&&(this._maximumSize=e.maximumSize),e.snap&&(this._snap=e.snap)}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{minimumSize:(e=this.minimumSize,e<=0?void 0:e),maximumSize:(e=>e===Number.MAX_SAFE_INTEGER||e===Number.POSITIVE_INFINITY?void 0:e)(this.maximumSize)});var e}updateConstraints(){this.api._onDidConstraintsChange.fire({maximumSize:this._evaluatedMaximumSize,minimumSize:this._evaluatedMinimumSize})}}function si(e,t){return new Xt(e,t).api}function ri(e,t){const i=new Kt(e,t);return new Se(i)}function ai(e,t){const i=new qt(e,t);return new ke(i)}function di(e,t){const i=new ni(e,t);return new Ae(i)}var hi=function(e,t){return hi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])},hi(e,t)};function li(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}hi(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}function pi(e,t,i,n){var o,s=arguments.length,r=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(r=(s<3?o(r):s>3?o(t,i,r):o(t,i))||r);return s>3&&r&&Object.defineProperty(t,i,r),r}function ci(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function vi(e,t,i,n){return new(i||(i=Promise))((function(o,s){function r(e){try{d(n.next(e))}catch(e){s(e)}}function a(e){try{d(n.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}d((n=n.apply(e,t||[])).next())}))}function ui(e,t){var i,n,o,s,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(d){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(r=0)),r;)try{if(i=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=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++,n=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],n=0}finally{i=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}}function mi(e){var t="function"==typeof Symbol&&Symbol.iterator,i=t&&e[t],n=0;if(i)return i.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function gi(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,o,s=i.call(e),r=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)r.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return r}function bi(e,t,i){if(i||2===arguments.length)for(var n,o=0,s=t.length;o<s;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function fi(e){return this instanceof fi?(this.v=e,this):new fi(e)}function wi(e,t,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=i.apply(e,t||[]),s=[];return n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n;function r(e){o[e]&&(n[e]=function(t){return new Promise((function(i,n){s.push([e,t,i,n])>1||a(e,t)}))})}function a(e,t){try{(i=o[e](t)).value instanceof fi?Promise.resolve(i.value.v).then(d,h):l(s[0][2],i)}catch(e){l(s[0][3],e)}var i}function d(e){a("next",e)}function h(e){a("throw",e)}function l(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function _i(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e=mi(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,o){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,o,(t=e[i](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;class yi{constructor(e){this.options=e,this.componentRef=null,this._element=null}get element(){if(!this._element)throw new Error("Angular renderer not initialized");return this._element}init(e){this.componentRef?this.update(e):this.render(e)}update(e){this.componentRef&&(Object.keys(e).forEach((t=>{t in this.componentRef.instance&&(this.componentRef.instance[t]=e[t])})),this.componentRef.changeDetectorRef.detectChanges())}render(t){try{this.componentRef=e(this.options.component,{environmentInjector:this.options.environmentInjector||this.options.injector,elementInjector:this.options.injector}),Object.keys(t).forEach((e=>{e in this.componentRef.instance&&(this.componentRef.instance[e]=t[e])}));const i=this.componentRef.hostView;this._element=i.rootNodes[0],this.componentRef.changeDetectorRef.detectChanges()}catch(e){throw console.error("Error creating Angular component:",e),e}}dispose(){this.componentRef&&(this.componentRef.destroy(),this.componentRef=null),this._element=null}}class Di extends mt{constructor(e,t,i,n,o){super(e,t),this.angularComponent=i,this.injector=n,this.environmentInjector=o}getComponent(){return new yi({component:this.angularComponent,injector:this.injector,environmentInjector:this.environmentInjector})}}class xi extends oi{constructor(e,t,i,n,o){super(e,t),this.angularComponent=i,this.injector=n,this.environmentInjector=o}getComponent(){return new yi({component:this.angularComponent,injector:this.injector,environmentInjector:this.environmentInjector})}}class Ci{constructor(e,t,i){this.angularComponent=e,this.injector=t,this.environmentInjector=i,this.renderer=new yi({component:this.angularComponent,injector:this.injector,environmentInjector:this.environmentInjector})}get element(){return this.renderer.element}init(e){this.renderer.init(e)}update(e){this.renderer.update(e)}dispose(){this.renderer.dispose()}}class zi{constructor(e,t,i,n,o,s,r){this.components=e,this.injector=t,this.environmentInjector=i,this.tabComponents=n,this.watermarkComponent=o,this.headerActionsComponents=s,this.defaultTabComponent=r}createDockviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);const i=new yi({component:t,injector:this.injector,environmentInjector:this.environmentInjector});return i.init(e),i}createGridviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);return new Di(e.id,e.name,t,this.injector,this.environmentInjector)}createSplitviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);return new xi(e.id,e.name,t,this.injector,this.environmentInjector)}createPaneviewComponent(e){const t=this.components[e.name];if(!t)throw new Error(`Component '${e.name}' not found in component registry`);return new Ci(t,this.injector,this.environmentInjector)}createComponent(e){return this.createDockviewComponent(e)}createTabComponent(e){let t=this.tabComponents?.[e.name];if(!t&&this.defaultTabComponent&&(t=this.defaultTabComponent),!t)return;const i=new yi({component:t,injector:this.injector,environmentInjector:this.environmentInjector});return i.init(e),i}createWatermarkComponent(){if(!this.watermarkComponent)throw new Error("Watermark component not provided");const e=new yi({component:this.watermarkComponent,injector:this.injector,environmentInjector:this.environmentInjector});return e.init({}),e}createHeaderActionsComponent(e){const t=this.headerActionsComponents?.[e];if(!t)return;const i=new yi({component:t,injector:this.injector,environmentInjector:this.environmentInjector});return i.init({}),i}}function Si(e){return"function"==typeof e}function Ai(e){return function(t){if(function(e){return Si(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}var ki=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};var Ei,Pi=((Ei=function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}((function(e){Error.call(e),e.stack=(new Error).stack}))).prototype=Object.create(Error.prototype),Ei.prototype.constructor=Ei,Ei);function Oi(e,t){if(e){var i=e.indexOf(t);0<=i&&e.splice(i,1)}}var Ii=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,i,n,o;if(!this.closed){this.closed=!0;var s=this._parentage;if(s)if(this._parentage=null,Array.isArray(s))try{for(var r=mi(s),a=r.next();!a.done;a=r.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}else s.remove(this);var d=this.initialTeardown;if(Si(d))try{d()}catch(e){o=e instanceof Pi?e.errors:[e]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var l=mi(h),p=l.next();!p.done;p=l.next()){var c=p.value;try{Vi(c)}catch(e){o=null!=o?o:[],e instanceof Pi?o=bi(bi([],gi(o)),gi(e.errors)):o.push(e)}}}catch(e){i={error:e}}finally{try{p&&!p.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}}if(o)throw new Pi(o)}},e.prototype.add=function(t){var i;if(t&&t!==this)if(this.closed)Vi(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Oi(t,e)},e.prototype.remove=function(t){var i=this._finalizers;i&&Oi(i,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();function Gi(e){return e instanceof Ii||e&&"closed"in e&&Si(e.remove)&&Si(e.add)&&Si(e.unsubscribe)}function Vi(e){Si(e)?e():e.unsubscribe()}Ii.EMPTY;var Ni={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ti={setTimeout:function(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];return setTimeout.apply(void 0,bi([e,t],gi(i)))},clearTimeout:function(e){var t=Ti.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function Li(e){Ti.setTimeout((function(){throw e}))}function Ri(){}var Mi=function(e){function t(t){var i=e.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Gi(t)&&t.add(i)):i.destination=Ui,i}return li(t,e),t.create=function(e,t,i){return new Fi(e,t,i)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ii),Wi=Function.prototype.bind;function Hi(e,t){return Wi.call(e,t)}var ji=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Bi(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Bi(e)}else Bi(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Bi(e)}},e}(),Fi=function(e){function t(t,i,n){var o,s,r=e.call(this)||this;Si(t)||!t?o={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=n?n:void 0}:r&&Ni.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return r.unsubscribe()},o={next:t.next&&Hi(t.next,s),error:t.error&&Hi(t.error,s),complete:t.complete&&Hi(t.complete,s)}):o=t;return r.destination=new ji(o),r}return li(t,e),t}(Mi);function Bi(e){Li(e)}var Ui={closed:!0,next:Ri,error:function(e){throw e},complete:Ri},$i="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ji(e){return e}var Zi=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var i=new e;return i.source=this,i.operator=t,i},e.prototype.subscribe=function(e,t,i){var n,o=this,s=(n=e)&&n instanceof Mi||function(e){return e&&Si(e.next)&&Si(e.error)&&Si(e.complete)}(n)&&Gi(n)?e:new Fi(e,t,i);return function(){var e=o,t=e.operator,i=e.source;s.add(t?t.call(s,i):i?o._subscribe(s):o._trySubscribe(s))}(),s},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var i=this;return new(t=Yi(t))((function(t,n){var o=new Fi({next:function(t){try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});i.subscribe(o)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[$i]=function(){return this},e.prototype.pipe=function(){for(var e,t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];return(0===(e=t).length?Ji:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)})(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Yi(e))((function(e,i){var n;t.subscribe((function(e){return n=e}),(function(e){return i(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function Yi(e){var t;return null!==(t=null!=e?e:Ni.Promise)&&void 0!==t?t:Promise}var Xi="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function qi(e){if(e instanceof Zi)return e;if(null!=e){if(function(e){return Si(e[$i])}(e))return s=e,new Zi((function(e){var t=s[$i]();if(Si(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(ki(e))return o=e,new Zi((function(e){for(var t=0;t<o.length&&!e.closed;t++)e.next(o[t]);e.complete()}));if(Si(null==(n=e)?void 0:n.then))return i=e,new Zi((function(e){i.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,Li)}));if(function(e){return Symbol.asyncIterator&&Si(null==e?void 0:e[Symbol.asyncIterator])}(e))return Ki(e);if(function(e){return Si(null==e?void 0:e[Xi])}(e))return t=e,new Zi((function(e){var i,n;try{for(var o=mi(t),s=o.next();!s.done;s=o.next()){var r=s.value;if(e.next(r),e.closed)return}}catch(e){i={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}e.complete()}));if(function(e){return Si(null==e?void 0:e.getReader)}(e))return Ki(function(e){return wi(this,arguments,(function(){var t,i,n;return ui(this,(function(o){switch(o.label){case 0:t=e.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,fi(t.read())];case 3:return i=o.sent(),n=i.value,i.done?[4,fi(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,fi(n)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}(e))}var t,i,n,o,s;throw function(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}(e)}function Ki(e){return new Zi((function(t){(function(e,t){var i,n,o,s;return vi(this,void 0,void 0,(function(){var r,a;return ui(this,(function(d){switch(d.label){case 0:d.trys.push([0,5,6,11]),i=_i(e),d.label=1;case 1:return[4,i.next()];case 2:if((n=d.sent()).done)return[3,4];if(r=n.value,t.next(r),t.closed)return[2];d.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=d.sent(),o={error:a},[3,11];case 6:return d.trys.push([6,,9,10]),n&&!n.done&&(s=i.return)?[4,s.call(i)]:[3,8];case 7:d.sent(),d.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}var Qi=function(e){function t(t,i,n,o,s,r){var a=e.call(this,t)||this;return a.onFinalize=s,a.shouldUnsubscribe=r,a._next=i?function(e){try{i(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=o?function(e){try{o(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return li(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;e.prototype.unsubscribe.call(this),!i&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(Mi);function en(e){return Ai((function(t,i){var n,o;qi(e).subscribe(new Qi(i,(function(){return i.complete()}),Ri,n,o)),!i.closed&&t.subscribe(i)}))}class tn{constructor(){this._isDisposed=!1,this.disposeCallbacks=[]}get isDisposed(){return this._isDisposed}addDisposeCallback(e){this._isDisposed?e():this.disposeCallbacks.push(e)}dispose(){this._isDisposed||(this._isDisposed=!0,this.disposeCallbacks.forEach((e=>{try{e()}catch(e){console.error("Error in dispose callback:",e)}})),this.disposeCallbacks=[])}}class nn{constructor(){this.destroySubject=new u,this.disposables=[]}get destroy$(){return this.destroySubject.asObservable()}addDisposable(e){this.disposables.push(e)}takeUntilDestroy(){return en(this.destroySubject)}destroy(){this.destroySubject.next(),this.destroySubject.complete(),this.disposables.forEach((e=>{try{e.dispose()}catch(e){console.error("Error disposing resource:",e)}})),this.disposables=[]}}function on(e){const t=new tn;return e&&t.addDisposeCallback(e),t}let sn=class{constructor(){this.ready=new r,this.didDrop=new r,this.willDrop=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializeDockview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.dockviewApi&&this.dockviewApi.dispose()}ngOnChanges(e){if(this.dockviewApi){const t={};let i=!1;rt.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.dockviewApi.updateOptions(t)}}getDockviewApi(){return this.dockviewApi}initializeDockview(){if(!this.components)throw new Error("DockviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.dockviewApi=si(this.containerRef.nativeElement,{...e,...t}),this.setupEventListeners(),this.ready.emit({api:this.dockviewApi})}extractCoreOptions(){const e={};return rt.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e={};this.leftHeaderActionsComponent&&(e.left=this.leftHeaderActionsComponent),this.rightHeaderActionsComponent&&(e.right=this.rightHeaderActionsComponent),this.prefixHeaderActionsComponent&&(e.prefix=this.prefixHeaderActionsComponent);const t=new zi(this.components,this.injector,this.environmentInjector,this.tabComponents,this.watermarkComponent,e,this.defaultTabComponent);return{createComponent:e=>t.createDockviewComponent(e),createTabComponent:e=>t.createTabComponent(e),createWatermarkComponent:this.watermarkComponent?()=>t.createWatermarkComponent():void 0,createLeftHeaderActionComponent:this.leftHeaderActionsComponent?e=>t.createHeaderActionsComponent("left"):void 0,createRightHeaderActionComponent:this.rightHeaderActionsComponent?e=>t.createHeaderActionsComponent("right"):void 0,createPrefixHeaderActionComponent:this.prefixHeaderActionsComponent?e=>t.createHeaderActionsComponent("prefix"):void 0}}setupEventListeners(){if(!this.dockviewApi)return;const e=this.dockviewApi;if(this.didDrop.observers.length>0){const t=e.onDidDrop((e=>{this.didDrop.emit(e)}));this.lifecycleManager.addDisposable(t)}if(this.willDrop.observers.length>0){const t=e.onWillDrop((e=>{this.willDrop.emit(e)}));this.lifecycleManager.addDisposable(t)}}};pi([t("dockviewContainer",{static:!0}),ci("design:type",l)],sn.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],sn.prototype,"components",void 0),pi([i(),ci("design:type",Object)],sn.prototype,"tabComponents",void 0),pi([i(),ci("design:type",p)],sn.prototype,"watermarkComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"defaultTabComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"leftHeaderActionsComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"rightHeaderActionsComponent",void 0),pi([i(),ci("design:type",p)],sn.prototype,"prefixHeaderActionsComponent",void 0),pi([i(),ci("design:type",String)],sn.prototype,"className",void 0),pi([i(),ci("design:type",String)],sn.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"hideBorders",void 0),pi([i(),ci("design:type",String)],sn.prototype,"rootOverlayModel",void 0),pi([i(),ci("design:type",String)],sn.prototype,"defaultTabComponent_",void 0),pi([i(),ci("design:type",Number)],sn.prototype,"tabHeight",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"disableFloatingGroups",void 0),pi([i(),ci("design:type",String)],sn.prototype,"floatingGroupBounds",void 0),pi([i(),ci("design:type",String)],sn.prototype,"popoutUrl",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"locked",void 0),pi([i(),ci("design:type",Boolean)],sn.prototype,"disableAutoResizing",void 0),pi([i(),ci("design:type",String)],sn.prototype,"singleTabMode",void 0),pi([n(),ci("design:type",Object)],sn.prototype,"ready",void 0),pi([n(),ci("design:type",Object)],sn.prototype,"didDrop",void 0),pi([n(),ci("design:type",Object)],sn.prototype,"willDrop",void 0),sn=pi([o({selector:"dv-dockview",standalone:!0,template:'<div #dockviewContainer class="dockview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .dockview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],sn);let rn=class{constructor(){this.ready=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializeGridview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.gridviewApi&&this.gridviewApi.dispose()}ngOnChanges(e){if(this.gridviewApi){const t={};let i=!1;ye.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.gridviewApi.updateOptions(t)}}getGridviewApi(){return this.gridviewApi}initializeGridview(){if(!this.components)throw new Error("GridviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.gridviewApi=ai(this.containerRef.nativeElement,{...e,...t}),this.ready.emit({api:this.gridviewApi})}extractCoreOptions(){const e={};return ye.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e=new zi(this.components,this.injector,this.environmentInjector);return{createComponent:t=>e.createGridviewComponent(t)}}};pi([t("gridviewContainer",{static:!0}),ci("design:type",l)],rn.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],rn.prototype,"components",void 0),pi([i(),ci("design:type",String)],rn.prototype,"className",void 0),pi([i(),ci("design:type",String)],rn.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"proportionalLayout",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"hideBorders",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],rn.prototype,"disableAutoResizing",void 0),pi([n(),ci("design:type",Object)],rn.prototype,"ready",void 0),rn=pi([o({selector:"dv-gridview",standalone:!0,template:'<div #gridviewContainer class="gridview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .gridview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],rn);let an=class{constructor(){this.ready=new r,this.drop=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializePaneview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.paneviewApi&&this.paneviewApi.dispose()}ngOnChanges(e){if(this.paneviewApi){const t={};let i=!1;Re.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.paneviewApi.updateOptions(t)}}getPaneviewApi(){return this.paneviewApi}initializePaneview(){if(!this.components)throw new Error("PaneviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.paneviewApi=di(this.containerRef.nativeElement,{...e,...t}),this.setupEventListeners(),this.ready.emit({api:this.paneviewApi})}extractCoreOptions(){const e={};return Re.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e=new zi(this.components,this.injector,this.environmentInjector,this.headerComponents);return{createComponent:t=>e.createPaneviewComponent(t),createHeaderComponent:this.headerComponents?e=>new Ci(this.headerComponents[e.name],this.injector,this.environmentInjector):void 0}}setupEventListeners(){if(!this.paneviewApi)return;const e=this.paneviewApi;if(this.drop.observers.length>0){const t=e.onDidDrop((e=>{this.drop.emit(e)}));this.lifecycleManager.addDisposable(t)}}};pi([t("paneviewContainer",{static:!0}),ci("design:type",l)],an.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],an.prototype,"components",void 0),pi([i(),ci("design:type",Object)],an.prototype,"headerComponents",void 0),pi([i(),ci("design:type",String)],an.prototype,"className",void 0),pi([i(),ci("design:type",String)],an.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],an.prototype,"hideBorders",void 0),pi([i(),ci("design:type",Boolean)],an.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],an.prototype,"disableAutoResizing",void 0),pi([n(),ci("design:type",Object)],an.prototype,"ready",void 0),pi([n(),ci("design:type",Object)],an.prototype,"drop",void 0),an=pi([o({selector:"dv-paneview",standalone:!0,template:'<div #paneviewContainer class="paneview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .paneview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],an);let dn=class{constructor(){this.ready=new r,this.lifecycleManager=new nn,this.injector=a(d),this.environmentInjector=a(h)}ngOnInit(){this.initializeSplitview()}ngOnDestroy(){this.lifecycleManager.destroy(),this.splitviewApi&&this.splitviewApi.dispose()}ngOnChanges(e){if(this.splitviewApi){const t={};let i=!1;se.forEach((n=>{e[n]&&!e[n].isFirstChange()&&(t[n]=e[n].currentValue,i=!0)})),i&&this.splitviewApi.updateOptions(t)}}getSplitviewApi(){return this.splitviewApi}initializeSplitview(){if(!this.components)throw new Error("SplitviewAngularComponent: components input is required");const e=this.extractCoreOptions(),t=this.createFrameworkOptions();this.splitviewApi=ri(this.containerRef.nativeElement,{...e,...t}),this.ready.emit({api:this.splitviewApi})}extractCoreOptions(){const e={};return se.forEach((t=>{const i=this[t];void 0!==i&&(e[t]=i)})),e}createFrameworkOptions(){const e=new zi(this.components,this.injector,this.environmentInjector);return{createComponent:t=>e.createSplitviewComponent(t)}}};pi([t("splitviewContainer",{static:!0}),ci("design:type",l)],dn.prototype,"containerRef",void 0),pi([i(),ci("design:type",Object)],dn.prototype,"components",void 0),pi([i(),ci("design:type",String)],dn.prototype,"className",void 0),pi([i(),ci("design:type",String)],dn.prototype,"orientation",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"proportionalLayout",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"hideBorders",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"debug",void 0),pi([i(),ci("design:type",Boolean)],dn.prototype,"disableAutoResizing",void 0),pi([n(),ci("design:type",Object)],dn.prototype,"ready",void 0),dn=pi([o({selector:"dv-splitview",standalone:!0,template:'<div #splitviewContainer class="splitview-container"></div>',styles:["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n }\n\n .splitview-container {\n width: 100%;\n height: 100%;\n }\n "],changeDetection:s.OnPush})],dn);let hn=class{};hn=pi([c({imports:[v,sn,rn,an,dn],exports:[sn,rn,an,dn]})],hn);export{tn as AngularDisposable,zi as AngularFrameworkComponentFactory,nn as AngularLifecycleManager,yi as AngularRenderer,ze as BaseGrid,Je as ContentContainer,Ot as DefaultDockviewDeserialzier,Et as DefaultTab,sn as DockviewAngularComponent,hn as DockviewAngularModule,Ee as DockviewApi,Xt as DockviewComponent,P as DockviewCompositeDisposable,pt as DockviewDidDropEvent,g as DockviewDisposable,A as DockviewEmitter,m as DockviewEvent,ft as DockviewGroupPanel,vt as DockviewGroupPanelModel,O as DockviewMutableDisposable,kt as DockviewPanel,st as DockviewUnhandledDragOverEvent,ct as DockviewWillDropEvent,qe as DockviewWillShowOverlayLocationEvent,$e as DraggablePaneviewPanel,_e as Gridview,rn as GridviewAngularComponent,ke as GridviewApi,qt as GridviewComponent,mt as GridviewPanel,ie as LayoutPriority,ee as Orientation,rt as PROPERTY_KEYS_DOCKVIEW,ye as PROPERTY_KEYS_GRIDVIEW,Re as PROPERTY_KEYS_PANEVIEW,se as PROPERTY_KEYS_SPLITVIEW,ii as PaneFramework,w as PaneTransfer,f as PanelTransfer,re as Paneview,an as PaneviewAngularComponent,Ae as PaneviewApi,ni as PaneviewComponent,Ue as PaneviewPanel,Me as PaneviewUnhandledDragOverEvent,te as SashState,ne as Sizing,oe as Splitview,dn as SplitviewAngularComponent,Se as SplitviewApi,Kt as SplitviewComponent,oi as SplitviewPanel,Xe as Tab,on as createAngularDisposable,si as createDockview,ai as createGridview,di as createPaneview,ri as createSplitview,Ge as directionToPosition,me as getDirectionOrientation,ve as getGridLocation,ge as getLocationOrientation,D as getPaneData,y as getPanelData,ue as getRelativeLocation,ce as indexInParent,fe as isGridBranchNode,lt as isGroupOptionsWithGroup,ht as isGroupOptionsWithPanel,dt as isPanelOptionsWithGroup,at as isPanelOptionsWithPanel,be as orthogonal,Ve as positionToDirection,Dt as themeAbyss,zt as themeAbyssSpaced,wt as themeDark,xt as themeDracula,_t as themeLight,St as themeLightSpaced,Ct as themeReplit,yt as themeVisualStudio,Ce as toTarget};
|
|
8
8
|
//# sourceMappingURL=dockview-angular.esm.min.js.map
|