dockview-core 4.6.2 → 4.7.1
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/constants.d.ts +1 -0
- package/dist/cjs/constants.js +2 -1
- package/dist/cjs/dnd/abstractDragHandler.d.ts +3 -1
- package/dist/cjs/dnd/abstractDragHandler.js +6 -2
- package/dist/cjs/dnd/droptarget.js +46 -17
- package/dist/cjs/dnd/groupDragHandler.d.ts +1 -1
- package/dist/cjs/dnd/groupDragHandler.js +2 -2
- package/dist/cjs/dockview/components/tab/tab.d.ts +1 -0
- package/dist/cjs/dockview/components/tab/tab.js +6 -5
- package/dist/cjs/dockview/components/titlebar/voidContainer.d.ts +1 -0
- package/dist/cjs/dockview/components/titlebar/voidContainer.js +3 -2
- package/dist/cjs/dockview/dockviewComponent.d.ts +6 -0
- package/dist/cjs/dockview/dockviewComponent.js +115 -86
- package/dist/cjs/gridview/gridview.d.ts +1 -0
- package/dist/cjs/gridview/gridview.js +37 -0
- package/dist/cjs/overlay/overlayRenderContainer.d.ts +3 -0
- package/dist/cjs/overlay/overlayRenderContainer.js +82 -8
- package/dist/dockview-core.amd.js +235 -67
- package/dist/dockview-core.amd.js.map +1 -1
- package/dist/dockview-core.amd.min.js +2 -2
- package/dist/dockview-core.amd.min.js.map +1 -1
- package/dist/dockview-core.amd.min.noStyle.js +2 -2
- package/dist/dockview-core.amd.min.noStyle.js.map +1 -1
- package/dist/dockview-core.amd.noStyle.js +234 -66
- package/dist/dockview-core.amd.noStyle.js.map +1 -1
- package/dist/dockview-core.cjs.js +235 -67
- package/dist/dockview-core.cjs.js.map +1 -1
- package/dist/dockview-core.esm.js +235 -67
- package/dist/dockview-core.esm.js.map +1 -1
- package/dist/dockview-core.esm.min.js +2 -2
- package/dist/dockview-core.esm.min.js.map +1 -1
- package/dist/dockview-core.js +235 -67
- package/dist/dockview-core.js.map +1 -1
- package/dist/dockview-core.min.js +2 -2
- package/dist/dockview-core.min.js.map +1 -1
- package/dist/dockview-core.min.noStyle.js +2 -2
- package/dist/dockview-core.min.noStyle.js.map +1 -1
- package/dist/dockview-core.noStyle.js +234 -66
- package/dist/dockview-core.noStyle.js.map +1 -1
- package/dist/esm/constants.d.ts +1 -0
- package/dist/esm/constants.js +1 -0
- package/dist/esm/dnd/abstractDragHandler.d.ts +3 -1
- package/dist/esm/dnd/abstractDragHandler.js +6 -2
- package/dist/esm/dnd/droptarget.js +46 -17
- package/dist/esm/dnd/groupDragHandler.d.ts +1 -1
- package/dist/esm/dnd/groupDragHandler.js +2 -2
- package/dist/esm/dockview/components/tab/tab.d.ts +1 -0
- package/dist/esm/dockview/components/tab/tab.js +6 -5
- package/dist/esm/dockview/components/titlebar/voidContainer.d.ts +1 -0
- package/dist/esm/dockview/components/titlebar/voidContainer.js +3 -2
- package/dist/esm/dockview/dockviewComponent.d.ts +6 -0
- package/dist/esm/dockview/dockviewComponent.js +65 -30
- package/dist/esm/gridview/gridview.d.ts +1 -0
- package/dist/esm/gridview/gridview.js +36 -0
- package/dist/esm/overlay/overlayRenderContainer.d.ts +3 -0
- package/dist/esm/overlay/overlayRenderContainer.js +69 -8
- package/dist/styles/dockview.css +37 -5
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* dockview-core
|
|
3
|
-
* @version 4.
|
|
3
|
+
* @version 4.7.1
|
|
4
4
|
* @link https://github.com/mathuo/dockview
|
|
5
5
|
* @license MIT
|
|
6
6
|
*/
|
|
7
|
-
define(["exports"],(function(e){"use strict";var i;!function(e,i){void 0===i&&(i={});var t=i.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&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 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 transition: opacity var(--dv-transition-duration) ease-in, 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;\n background-color: var(--dv-drag-over-background-color);\n opacity: 1;\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}\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}\n.dv-resize-container.dv-hidden {\n display: none;\n}\n.dv-resize-container.dv-resize-container-dragging {\n opacity: 0.5;\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 height: 100%;\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 transition-duration: 0.15s;\n transition-timing-function: 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 transition-duration: 0.15s;\n transition-timing-function: 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 /* 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 t{}class n extends t{constructor(e,i,t){super(),this.viewId=e,this.groupId=i,this.panelId=t}}class o extends t{constructor(e,i){super(),this.viewId=e,this.paneId=i}}class s{constructor(){}static getInstance(){return s.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,i){i&&(this.data=e,this.proto=i)}}function r(){const e=s.getInstance();if(e.hasData(n.prototype))return e.getData(n.prototype)[0]}function a(){const e=s.getInstance();if(e.hasData(o.prototype))return e.getData(o.prototype)[0]}s.INSTANCE=new s,e.DockviewEvent=void 0,(e.DockviewEvent||(e.DockviewEvent={})).any=(...e)=>i=>{const t=e.map((e=>e(i)));return{dispose:()=>{t.forEach((e=>{e.dispose()}))}}};class d{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class h{constructor(){this._isAccepted=!1}get isAccepted(){return this._isAccepted}accept(){this._isAccepted=!0}}class l{static create(){var e;return new l(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn("dockview: stacktrace",this.value)}}class p{constructor(e,i){this.callback=e,this.stacktrace=i}}class c{static setLeakageMonitorEnabled(e){e!==c.ENABLE_TRACKING&&c.MEMORY_LEAK_WATCHER.clear(),c.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 i;(null===(i=this.options)||void 0===i?void 0:i.replay)&&void 0!==this._last&&e(this._last);const t=new p(e,c.ENABLE_TRACKING?l.create():void 0);return this._listeners.push(t),{dispose:()=>{const e=this._listeners.indexOf(t);e>-1?this._listeners.splice(e,1):c.ENABLE_TRACKING}}},c.ENABLE_TRACKING&&c.MEMORY_LEAK_WATCHER.add(this._event,l.create())),this._event}fire(e){var i;(null===(i=this.options)||void 0===i?void 0:i.replay)&&(this._last=e);for(const i of this._listeners)i.callback(e)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(c.ENABLE_TRACKING&&queueMicrotask((()=>{var e;for(const i of this._listeners)console.warn("dockview: stacktrace",null===(e=i.stacktrace)||void 0===e?void 0:e.print())})),this._listeners=[]),c.ENABLE_TRACKING&&this._event&&c.MEMORY_LEAK_WATCHER.delete(this._event))}}function v(e,i,t,n){return e.addEventListener(i,t,n),{dispose:()=>{e.removeEventListener(i,t,n)}}}c.ENABLE_TRACKING=!1,c.MEMORY_LEAK_WATCHER=new class{constructor(){this.events=new Map}get size(){return this.events.size}add(e,i){this.events.set(e,i)}delete(e){this.events.delete(e)}clear(){this.events.clear()}};class u{constructor(){this._onFired=new c,this._currentFireCount=0,this._queued=!1,this.onEvent=e=>{const i=this._currentFireCount;return this._onFired.event((()=>{this._currentFireCount>i&&e()}))}}fire(){this._currentFireCount++,this._queued||(this._queued=!0,queueMicrotask((()=>{this._queued=!1,this._onFired.fire()})))}dispose(){this._onFired.dispose()}}e.DockviewDisposable=void 0,(i=e.DockviewDisposable||(e.DockviewDisposable={})).NONE={dispose:()=>{}},i.from=function(e){return{dispose:()=>{e()}}};class m{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 g{constructor(){this._disposable=e.DockviewDisposable.NONE}set value(e){this._disposable&&this._disposable.dispose(),this._disposable=e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=e.DockviewDisposable.NONE)}}class b extends m{constructor(e){super(),this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._value=null,this.addDisposables(this._onDidChange,w(e,(e=>{const i=e.target.scrollWidth>e.target.clientWidth,t=e.target.scrollHeight>e.target.clientHeight;this._value={hasScrollX:i,hasScrollY:t},this._onDidChange.fire(this._value)})))}}function w(e,i){const t=new ResizeObserver((e=>{requestAnimationFrame((()=>{const t=e[0];i(t)}))}));return t.observe(e),{dispose:()=>{t.unobserve(e),t.disconnect()}}}const f=(e,...i)=>{for(const t of i)e.classList.contains(t)&&e.classList.remove(t)},_=(e,...i)=>{for(const t of i)e.classList.contains(t)||e.classList.add(t)},D=(e,i,t)=>{const n=e.classList.contains(i);t&&!n&&e.classList.add(i),!t&&n&&e.classList.remove(i)};function y(e,i){for(;e;){if(e===i)return!0;e=e.parentNode}return!1}function x(e){return new C(e)}class C extends m{constructor(e){super(),this._onDidFocus=new c,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new c,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let i=y(document.activeElement,e),t=!1;const n=()=>{t=!1,i||(i=!0,this._onDidFocus.fire())},o=()=>{i&&(t=!0,window.setTimeout((()=>{t&&(t=!1,i=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{y(document.activeElement,e)!==i&&(i?o():n())},this.addDisposables(v(e,"focus",n,!0)),this.addDisposables(v(e,"blur",o,!0))}refreshState(){this._refreshStateHandler()}}const z="dv-quasiPreventDefault";function S(e){return e[z]}function A(e){const{left:i,top:t,width:n,height:o}=e.getBoundingClientRect();return{left:i+window.scrollX,top:t+window.scrollY,width:n,height:o}}function k(e=document){const i=function(e){const i=[];return function t(n){if(n.nodeType===Node.ELEMENT_NODE){e.includes(n.tagName)&&i.push(n),n.shadowRoot&&t(n.shadowRoot);for(const e of n.children)t(e)}}(document.documentElement),i}(["IFRAME","WEBVIEW"]),t=new WeakMap;for(const e of i)t.set(e,e.style.pointerEvents),e.style.pointerEvents="none";return{release:()=>{var e;for(const n of i)n.style.pointerEvents=null!==(e=t.get(n))&&void 0!==e?e:"auto";i.splice(0,i.length)}}}class E{constructor(e){this.element=e,this._classNames=[]}setClassNames(e){for(const e of this._classNames)D(this.element,e,!1);this._classNames=e.split(" ").filter((e=>e.trim().length>0));for(const e of this._classNames)D(this.element,e,!0)}}function P(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function O(e,i){if(e.length!==i.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==i[t])return!1;return!0}function G(e,i){const t=e.indexOf(i);t>-1&&(e.splice(t,1),e.unshift(i))}function I(e,i){const t=e.indexOf(i);t>-1&&(e.splice(t,1),e.push(i))}function V(e,i){const t=e.findIndex((e=>e===i));return t>-1&&(e.splice(t,1),!0)}const N=(e,i,t)=>i>t?i:Math.min(t,Math.max(e,i)),T=()=>{let e=1;return{next:()=>(e++).toString()}},L=(e,i)=>{const t=[];if("number"!=typeof i&&(i=e,e=0),e<=i)for(let n=e;n<i;n++)t.push(n);else for(let n=e;n>i;n--)t.push(n);return t};class M{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,i,t,n){this.container=e,this.view=i,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof t?(this._size=t,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=t.cachedVisibleSize)}setVisible(e,i){var t;e!==this.visible&&(e?(this.size=N(null!==(t=this._cachedVisibleSize)&&void 0!==t?t:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof i?i: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 R,W,H,B;e.Orientation=void 0,(R=e.Orientation||(e.Orientation={})).HORIZONTAL="HORIZONTAL",R.VERTICAL="VERTICAL",e.SashState=void 0,(W=e.SashState||(e.SashState={}))[W.MAXIMUM=0]="MAXIMUM",W[W.MINIMUM=1]="MINIMUM",W[W.DISABLED=2]="DISABLED",W[W.ENABLED=3]="ENABLED",e.LayoutPriority=void 0,(H=e.LayoutPriority||(e.LayoutPriority={})).Low="low",H.High="high",H.Normal="normal",e.Sizing=void 0,(B=e.Sizing||(e.Sizing={})).Distribute={type:"distribute"},B.Split=function(e){return{type:"split",index:e}},B.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};class F{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(i){this._orientation=i;const t=this.size;this.size=this.orthogonalSize,this.orthogonalSize=t,f(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==e.Orientation.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce(((e,i)=>e+i.minimumSize),0)}get maximumSize(){return 0===this.length?Number.POSITIVE_INFINITY:this.viewItems.reduce(((e,i)=>e+i.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,D(this.element,"dv-splitview-disabled",e)}get margin(){return this._margin}set margin(e){this._margin=e,D(this.element,"dv-splitview-has-margin",0!==e)}constructor(i,t){var n,o;this.container=i,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 c,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new c,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new c,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(e,i,t=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=L(e,-1),l=L(e+1,this.viewItems.length);if(o)for(const e of o)G(h,e),G(l,e);if(n)for(const e of n)I(h,e),I(l,e);const p=h.map((e=>this.viewItems[e])),c=h.map((e=>t[e])),v=l.map((e=>this.viewItems[e])),u=l.map((e=>t[e])),m=h.reduce(((e,i)=>e+this.viewItems[i].minimumSize-t[i]),0),g=h.reduce(((e,i)=>e+this.viewItems[i].maximumSize-t[i]),0),b=0===l.length?Number.POSITIVE_INFINITY:l.reduce(((e,i)=>e+t[i]-this.viewItems[i].minimumSize),0),w=0===l.length?Number.NEGATIVE_INFINITY:l.reduce(((e,i)=>e+t[i]-this.viewItems[i].maximumSize),0),f=Math.max(m,w),_=Math.min(b,g);let D=!1;if(a){const e=this.viewItems[a.index],t=i>=a.limitDelta;D=t!==e.visible,e.setVisible(t,a.size)}if(!D&&d){const e=this.viewItems[d.index],t=i<d.limitDelta;D=t!==e.visible,e.setVisible(t,d.size)}if(D)return this.resize(e,i,t,n,o,s,r);let y=0,x=N(i,f,_);for(let e=0;e<p.length;e++){const i=p[e],t=N(c[e]+x,i.minimumSize,i.maximumSize),n=t-c[e];y+=n,x-=n,i.size=t}let C=y;for(let e=0;e<v.length;e++){const i=v[e],t=N(u[e]-C,i.minimumSize,i.maximumSize);C+=t-u[e],i.size=t}return i},this._orientation=null!==(n=t.orientation)&&void 0!==n?n:e.Orientation.VERTICAL,this.element=this.createContainer(),this.margin=null!==(o=t.margin)&&void 0!==o?o: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,i)=>{const t=void 0===e.visible||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.addView(n,t,i,!0)})),this._contentSize=this.viewItems.reduce(((e,i)=>e+i.size),0),this.saveProportions())}style(e){"transparent"===(null==e?void 0:e.separatorBorder)?(f(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(_(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,i){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");const t=this.viewItems[e];t.setVisible(i,t.size),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}resizeView(i,t){if(i<0||i>=this.viewItems.length)return;const n=L(this.viewItems.length).filter((e=>e!==i)),o=[...n.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),i],s=n.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High)),r=this.viewItems[i];t=Math.round(t),t=N(t,r.minimumSize,Math.min(r.maximumSize,this._size)),r.size=t,this.relayout(o,s)}getViews(){return this.viewItems.map((e=>e.view))}onDidChange(i,t){const n=this.viewItems.indexOf(i);if(n<0||n>=this.viewItems.length)return;t="number"==typeof t?t:i.size,t=N(t,i.minimumSize,i.maximumSize),i.size=t;const o=L(this.viewItems.length).filter((e=>e!==n)),s=[...o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),n],r=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));this.relayout([...s,n],r)}addView(i,t={type:"distribute"},n=this.viewItems.length,o){const s=document.createElement("div");let r;s.className="dv-view",s.appendChild(i.element),r="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:i.minimumSize;const a=i.onDidChange((e=>this.onDidChange(d,e.size))),d=new M(s,i,r,{dispose:()=>{a.dispose(),this.viewContainer.removeChild(s)}});if(n===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(n)),this.viewItems.splice(n,0,d),this.viewItems.length>1){const i=document.createElement("div");i.className="dv-sash";const t=t=>{for(const e of this.viewItems)e.enabled=!1;const n=k(),o=this._orientation===e.Orientation.HORIZONTAL?t.clientX:t.clientY,s=function(e,i){for(let t=0;t<e.length;t++)if(i(e[t]))return t;return-1}(this.sashes,(e=>e.container===i)),r=this.viewItems.map((e=>e.size));let a,d;const h=L(s,-1),l=L(s+1,this.viewItems.length),p=h.reduce(((e,i)=>e+(this.viewItems[i].minimumSize-r[i])),0),c=h.reduce(((e,i)=>e+(this.viewItems[i].viewMaximumSize-r[i])),0),v=0===l.length?Number.POSITIVE_INFINITY:l.reduce(((e,i)=>e+(r[i]-this.viewItems[i].minimumSize)),0),u=0===l.length?Number.NEGATIVE_INFINITY:l.reduce(((e,i)=>e+(r[i]-this.viewItems[i].viewMaximumSize)),0),m=Math.max(p,u),g=Math.min(v,c),b=this.findFirstSnapIndex(h),w=this.findFirstSnapIndex(l);if("number"==typeof b){const e=this.viewItems[b],i=Math.floor(e.viewMinimumSize/2);a={index:b,limitDelta:e.visible?m-i:m+i,size:e.size}}if("number"==typeof w){const e=this.viewItems[w],i=Math.floor(e.viewMinimumSize/2);d={index:w,limitDelta:e.visible?g+i:g-i,size:e.size}}const f=i=>{const t=(this._orientation===e.Orientation.HORIZONTAL?i.clientX:i.clientY)-o;this.resize(s,t,r,void 0,void 0,m,g,a,d),this.distributeEmptySpace(),this.layoutViews()},_=()=>{for(const e of this.viewItems)e.enabled=!0;n.release(),this.saveProportions(),document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",f),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)};i.addEventListener("pointerdown",t);const n={container:i,disposable:()=>{i.removeEventListener("pointerdown",t),this.sashContainer.removeChild(i)}};this.sashContainer.appendChild(i),this.sashes.push(n)}o||this.relayout([n]),o||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes(),this._onDidAddView.fire(i)}distributeViewSizes(){const i=[];let t=0;for(const e of this.viewItems)e.maximumSize-e.minimumSize>0&&(i.push(e),t+=e.size);const n=Math.floor(t/i.length);for(const e of i)e.size=N(n,e.minimumSize,e.maximumSize);const o=L(this.viewItems.length),s=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),r=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));this.relayout(s,r)}removeView(e,i,t=!1){const n=this.viewItems.splice(e,1)[0];if(n.dispose(),this.viewItems.length>=1){const i=Math.max(e-1,0);this.sashes.splice(i,1)[0].disposable()}return t||this.relayout(),i&&"distribute"===i.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(i,t){const n=this.getViewCachedVisibleSize(i),o=void 0===n?this.getViewSize(i):e.Sizing.Invisible(n),s=this.removeView(i,void 0,!0);this.addView(s,o,t)}layout(i,t){const n=Math.max(this.size,this._contentSize);if(this.size=i,this.orthogonalSize=t,this.proportions){let e=0;for(let t=0;t<this.viewItems.length;t++){const n=this.viewItems[t],o=this.proportions[t];"number"==typeof o?e+=o:i-=n.size}for(let t=0;t<this.viewItems.length;t++){const n=this.viewItems[t],o=this.proportions[t];"number"==typeof o&&e>0&&(n.size=N(Math.round(o*i/e),n.minimumSize,n.maximumSize))}}else{const t=L(this.viewItems.length),o=t.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),s=t.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));this.resize(this.viewItems.length-1,i-n,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}relayout(e,i){const t=this.viewItems.reduce(((e,i)=>e+i.size),0);this.resize(this.viewItems.length-1,this._size-t,void 0,e,i),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(i){const t=this.viewItems.reduce(((e,i)=>e+i.size),0);let n=this.size-t;const o=L(this.viewItems.length-1,-1),s=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),r=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));for(const e of r)G(o,e);for(const e of s)I(o,e);"number"==typeof i&&I(o,i);for(let e=0;0!==n&&e<o.length;e++){const i=this.viewItems[o[e]],t=N(i.size+n,i.minimumSize,i.maximumSize);n-=t-i.size,i.size=t}}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,i)=>e+i.size),0),this.updateSashEnablement(),0===this.viewItems.length)return;const i=this.viewItems.filter((e=>e.visible)),t=Math.max(0,i.length-1),n=this.margin*t/Math.max(1,i.length);let o=0;const s=[],r=this.viewItems.reduce(((e,i,t)=>{const n=i.visible?1:0;return 0===t?e.push(n):e.push(e[t-1]+n),e}),[]);this.viewItems.forEach(((i,a)=>{o+=this.viewItems[a].size,s.push(o);const d=i.visible?i.size-n:0,h=Math.max(0,r[a]-1),l=0===a||0===h?0:s[a-1]+h/t*n;if(a<this.viewItems.length-1){const t=i.visible?l+d-2+this.margin/2:l;this._orientation===e.Orientation.HORIZONTAL&&(this.sashes[a].container.style.left=`${t}px`,this.sashes[a].container.style.top="0px"),this._orientation===e.Orientation.VERTICAL&&(this.sashes[a].container.style.left="0px",this.sashes[a].container.style.top=`${t}px`)}this._orientation===e.Orientation.HORIZONTAL&&(i.container.style.width=`${d}px`,i.container.style.left=`${l}px`,i.container.style.top="",i.container.style.height=""),this._orientation===e.Orientation.VERTICAL&&(i.container.style.height=`${d}px`,i.container.style.top=`${l}px`,i.container.style.width="",i.container.style.left=""),i.view.layout(i.size-n,this._orthogonalSize)}))}findFirstSnapIndex(e){for(const i of e){const e=this.viewItems[i];if(e.visible&&e.snap)return i}for(const i of e){const e=this.viewItems[i];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return i}}updateSashEnablement(){let i=!1;const t=this.viewItems.map((e=>i=e.size-e.minimumSize>0||i));i=!1;const n=this.viewItems.map((e=>i=e.maximumSize-e.size>0||i)),o=[...this.viewItems].reverse();i=!1;const s=o.map((e=>i=e.size-e.minimumSize>0||i)).reverse();i=!1;const r=o.map((e=>i=e.maximumSize-e.size>0||i)).reverse();let a=0;for(let i=0;i<this.sashes.length;i++){const o=this.sashes[i];a+=this.viewItems[i].size;const d=!(t[i]&&r[i+1]),h=!(n[i]&&s[i+1]);if(d&&h){const n=L(i,-1),r=L(i+1,this.viewItems.length),d=this.findFirstSnapIndex(n),h=this.findFirstSnapIndex(r),l="number"==typeof d&&!this.viewItems[d].visible,p="number"==typeof h&&!this.viewItems[h].visible;l&&s[i]&&(a>0||this.startSnappingEnabled)?this.updateSash(o,e.SashState.MINIMUM):p&&t[i]&&(a<this._contentSize||this.endSnappingEnabled)?this.updateSash(o,e.SashState.MAXIMUM):this.updateSash(o,e.SashState.DISABLED)}else d&&!h?this.updateSash(o,e.SashState.MINIMUM):!d&&h?this.updateSash(o,e.SashState.MAXIMUM):this.updateSash(o,e.SashState.ENABLED)}}updateSash(i,t){D(i.container,"dv-disabled",t===e.SashState.DISABLED),D(i.container,"dv-enabled",t===e.SashState.ENABLED),D(i.container,"dv-maximum",t===e.SashState.MAXIMUM),D(i.container,"dv-minimum",t===e.SashState.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 i=document.createElement("div"),t=this._orientation===e.Orientation.HORIZONTAL?"dv-horizontal":"dv-vertical";return i.className=`dv-split-view-container ${t}`,i}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 J=(()=>{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 U extends m{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(i,t){var n;super(),this.paneItems=[],this.skipAnimation=!1,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._orientation=null!==(n=t.orientation)&&void 0!==n?n:e.Orientation.VERTICAL,this.element=document.createElement("div"),this.element.className="dv-pane-container",i.appendChild(this.element),this.splitview=new F(this.element,{orientation:this._orientation,proportionalLayout:!1,descriptor:t.descriptor}),this.getPanes().forEach((e=>{const i=new m(e.onDidChangeExpansionState((()=>{this.setupAnimation(),this._onDidChange.fire(void 0)}))),t={pane:e,disposable:{dispose:()=>{i.dispose()}}};this.paneItems.push(t),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,i){this.splitview.setViewVisible(e,i)}addPane(e,i,t=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(t,0,s),e.orthogonalSize=this.splitview.orthogonalSize,this.splitview.addView(e,i,t,n)}getViewSize(e){return this.splitview.getViewSize(e)}getPanes(){return this.splitview.getViews()}removePane(e,i={skipDispose:!1}){const t=this.paneItems.splice(e,1)[0];return this.splitview.removeView(e),i.skipDispose||(t.disposable.dispose(),t.pane.dispose()),t}moveView(e,i){if(e===i)return;const t=this.removePane(e,{skipDispose:!0});this.skipAnimation=!0;try{this.addPane(t.pane,t.pane.size,i,!1)}finally{this.skipAnimation=!1}}layout(e,i){this.splitview.layout(e,i)}setupAnimation(){this.skipAnimation||(this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),_(this.element,"dv-animated"),this.animationTimer=setTimeout((()=>{this.animationTimer=void 0,f(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 ${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===e.Orientation.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===e.Orientation.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===e.Orientation.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===e.Orientation.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===e.Orientation.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===e.Orientation.HORIZONTAL?this.size:this.orthogonalSize}constructor(i,t,n,o=0){this.view=i,this.orientation=t,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._orthogonalSize=n,this._size=o,this._disposable=this.view.onDidChange((i=>{i?this._onDidChange.fire({size:this.orientation===e.Orientation.VERTICAL?i.width:i.height,orthogonalSize:this.orientation===e.Orientation.VERTICAL?i.height:i.width}):this._onDidChange.fire({})}))}setVisible(e){this.view.setVisible&&this.view.setVisible(e)}layout(e,i){this._size=e,this._orthogonalSize=i,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class j extends m{get width(){return this.orientation===e.Orientation.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===e.Orientation.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return 0===this.children.length?0:Math.max(...this.children.map(((e,i)=>this.splitview.isViewVisible(i)?e.minimumOrthogonalSize:0)))}get maximumSize(){return Math.min(...this.children.map(((e,i)=>this.splitview.isViewVisible(i)?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===e.Orientation.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===e.Orientation.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===e.Orientation.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===e.Orientation.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(0===this.children.length)return e.LayoutPriority.Normal;const i=this.children.map((i=>void 0===i.priority?e.LayoutPriority.Normal:i.priority));return i.some((i=>i===e.LayoutPriority.High))?e.LayoutPriority.High:i.some((i=>i===e.LayoutPriority.Low))?e.LayoutPriority.Low:e.LayoutPriority.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((i=>{i instanceof j&&(i.margin=e)}))}constructor(i,t,n,o,s,r,a,d){if(super(),this.orientation=i,this.proportionalLayout=t,this.styles=n,this._childrenDisposable=e.DockviewDisposable.NONE,this.children=[],this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new c,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=s,this._size=o,this.element=document.createElement("div"),this.element.className="dv-branch-node",d){const e={views:d.map((e=>({view:e.node,size:e.node.size,visible:!(e.node instanceof $&&void 0!==e.visible)||e.visible}))),size:this.orthogonalSize};this.children=d.map((e=>e.node)),this.splitview=new F(this.element,{orientation:this.orientation,descriptor:e,proportionalLayout:t,styles:n,margin:a})}else this.splitview=new F(this.element,{orientation:this.orientation,proportionalLayout:t,styles:n,margin:a}),this.splitview.layout(this.size,this.orthogonalSize);this.disabled=r,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,i){if(e<0||e>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(e)===i)return;const t=0===this.splitview.contentSize;this.splitview.setViewVisible(e,i);const n=0===this.splitview.contentSize;(i&&t||!i&&n)&&this._onDidVisibilityChange.fire({visible:i})}moveChild(e,i){if(e===i)return;if(e<0||e>=this.children.length)throw new Error("Invalid from index");e<i&&i--,this.splitview.moveView(e,i);const t=this._removeChild(e);this._addChild(t,i)}getChildSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(e)}resizeChild(e,i){if(e<0||e>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(e,i)}layout(e,i){this._size=i,this._orthogonalSize=e,this.splitview.layout(i,e)}addChild(e,i,t,n){if(t<0||t>this.children.length)throw new Error("Invalid index");this.splitview.addView(e,i,t,n),this._addChild(e,t)}getChildCachedVisibleSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(e)}removeChild(e,i){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(e,i),this._removeChild(e)}_addChild(e,i){this.children.splice(i,0,e),this.setupChildrenEvents()}_removeChild(e){const[i]=this.children.splice(e,1);return this.setupChildrenEvents(),i}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new m(e.DockviewEvent.any(...this.children.map((e=>e.onDidChange)))((e=>{this._onDidChange.fire({size:e.orthogonalSize})})),...this.children.map(((i,t)=>i instanceof j?i.onDidVisibilityChange((({visible:e})=>{this.setChildVisible(t,e)})):e.DockviewDisposable.NONE)))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach((e=>e.dispose())),super.dispose()}}function Z(e,i){if(e instanceof $)return e;if(e instanceof j)return Z(e.children[i?e.children.length-1:0],i);throw new Error("invalid node")}function Y(e,i,t){if(e instanceof j){const n=new j(ie(e.orientation),e.proportionalLayout,e.styles,i,t,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 j?r.orthogonalSize:r.size;let d=0===e.size?0:Math.round(i*a/e.size);o+=d,0===s&&(d+=i-o),n.addChild(Y(r,t,d),d,0,!0)}return n}return new $(e.view,ie(e.orientation),t)}function X(e){const i=e.parentElement;if(!i)throw new Error("Invalid grid element");let t=i.firstElementChild,n=0;for(;t!==e&&t!==i.lastElementChild&&t;)t=t.nextElementSibling,n++;return n}function K(e){const i=e.parentElement;if(!i)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(i.className))return[];const t=X(i);return[...K(i.parentElement.parentElement.parentElement),t]}function q(e,i,t){if(ee(e,i)===Q(t)){const[e,n]=P(i);let o=n;return"right"!==t&&"bottom"!==t||(o+=1),[...e,o]}{const e="right"===t||"bottom"===t?1:0;return[...i,e]}}function Q(i){return"top"===i||"bottom"===i?e.Orientation.VERTICAL:e.Orientation.HORIZONTAL}function ee(e,i){return i.length%2==0?ie(e):e}const ie=i=>i===e.Orientation.HORIZONTAL?e.Orientation.VERTICAL:e.Orientation.HORIZONTAL;function te(e){return!!e.children}const ne=(i,t)=>{const n=t===e.Orientation.VERTICAL?i.box.width:i.box.height;return te(i)?{type:"branch",data:i.children.map((e=>ne(e,ie(t)))),size:n}:"number"==typeof i.cachedVisibleSize?{type:"leaf",data:i.view.toJSON(),size:i.cachedVisibleSize,visible:!1}:{type:"leaf",data:i.view.toJSON(),size:n}};class oe{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:i,orthogonalSize:t}=this.root;this.root=Y(this.root,t,i),this.root.layout(i,t)}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 i=[this.root];for(;i.length>0;){const t=i.pop();t instanceof j&&(t.disabled=e,i.push(...t.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 i;const t=K(e.element),[n,o]=this.getNode(t);if(!(o instanceof $))return;if((null===(i=this._maximizedNode)||void 0===i?void 0:i.leaf)===o)return;this.hasMaximizedView()&&this.exitMaximizedView(),ne(this.getView(),this.orientation);const s=[];!function e(i,t){for(let n=0;n<i.children.length;n++){const o=i.children[n];o instanceof $?o!==t&&(i.isChildVisible(n)?i.setChildVisible(n,!1):s.push(o)):e(o,t)}}(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 i(t){for(let n=t.children.length-1;n>=0;n--){const o=t.children[n];o instanceof $?e.includes(o)||t.setChildVisible(n,!0):i(o)}}(this.root);const i=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:i.view,isMaximized:!1})}serialize(){const e=this.maximizedView();let i;e&&(i=K(e.element)),this.hasMaximizedView()&&this.exitMaximizedView();const t={root:ne(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return i&&(t.maximizedNode={location:i}),e&&this.maximizeView(e),t}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 j(e,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(i,t){const n=i.orientation,o=n===e.Orientation.VERTICAL?i.height:i.width;if(this._deserialize(i.root,n,t,o),this.layout(i.width,i.height),i.maximizedNode){const e=i.maximizedNode.location,[t,n]=this.getNode(e);if(!(n instanceof $))return;this.maximizeView(n.view)}}_deserialize(e,i,t,n){this.root=this._deserializeNode(e,i,t,n)}_deserializeNode(e,i,t,n){var o;let s;if("branch"===e.type){const o=e.data.map((n=>({node:this._deserializeNode(n,ie(i),t,e.size),visible:n.visible})));s=new j(i,this.proportionalLayout,this.styles,e.size,n,this.locked,this.margin,o)}else{const r=t.fromJSON(e);"boolean"==typeof e.visible&&(null===(o=r.setVisible)||void 0===o||o.call(r,e.visible)),s=new $(r,i,n,e.size)}return s}get root(){return this._root}set root(e){const i=this._root;i&&(i.dispose(),this._maximizedNode=void 0,this.element.removeChild(i.element)),this._root=e,this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const i=this.root;if(i.element.remove(),this._root=new j(ie(i.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),0===i.children.length);else if(1===i.children.length){const t=i.children[0];i.removeChild(0).dispose(),i.dispose(),this._root.addChild(Y(t,t.orthogonalSize,t.size),e.Sizing.Distribute,0)}else this._root.addChild(i,e.Sizing.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 i=e?this.getNode(e)[1]:this.root;return this._getViews(i,this.orientation)}_getViews(e,i,t){const n={height:e.height,width:e.width};if(e instanceof $)return{box:n,view:e.view,cachedVisibleSize:t};const o=[];for(let t=0;t<e.children.length;t++){const n=e.children[t],s=e.getChildCachedVisibleSize(t);o.push(this._getViews(n,ie(i),s))}return{box:n,children:o}}progmaticSelect(e,i=!1){const[t,n]=this.getNode(e);if(!(n instanceof $))throw new Error("invalid location");for(let n=t.length-1;n>-1;n--){const o=t[n],s=e[n]||0;if(i?s-1>-1:s+1<o.children.length)return Z(o.children[i?s-1:s+1],i)}return Z(this.root,i)}constructor(e,i,t,n,o){this.proportionalLayout=e,this.styles=i,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new g,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new c,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new c,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 j(t,e,i,0,0,this.locked,this.margin)}isViewVisible(e){const[i,t]=P(e),[,n]=this.getNode(i);if(!(n instanceof j))throw new Error("Invalid from location");return n.isChildVisible(t)}setViewVisible(e,i){this.hasMaximizedView()&&this.exitMaximizedView();const[t,n]=P(e),[,o]=this.getNode(t);if(!(o instanceof j))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),o.setChildVisible(n,i)}moveView(e,i,t){this.hasMaximizedView()&&this.exitMaximizedView();const[,n]=this.getNode(e);if(!(n instanceof j))throw new Error("Invalid location");n.moveChild(i,t)}addView(i,t,n){this.hasMaximizedView()&&this.exitMaximizedView();const[o,s]=P(n),[r,a]=this.getNode(o);if(a instanceof j){const e=new $(i,ie(a.orientation),a.orthogonalSize);a.addChild(e,t,s)}else{const[n,...d]=[...r].reverse(),[h,...l]=[...o].reverse();let p=0;const c=n.getChildCachedVisibleSize(h);"number"==typeof c&&(p=e.Sizing.Invisible(c));n.removeChild(h).dispose();const v=new j(a.orientation,this.proportionalLayout,this.styles,a.size,a.orthogonalSize,this.locked,this.margin);n.addChild(v,a.size,h);const u=new $(a.view,n.orientation,a.size);v.addChild(u,p,0),"number"!=typeof t&&"split"===t.type&&(t={type:"split",index:0});const m=new $(i,n.orientation,a.size);v.addChild(m,t,s)}}remove(e,i){const t=K(e.element);return this.removeView(t,i)}removeView(i,t){this.hasMaximizedView()&&this.exitMaximizedView();const[n,o]=P(i),[s,r]=this.getNode(n);if(!(r instanceof j))throw new Error("Invalid location");const a=r.children[o];if(!(a instanceof $))throw new Error("Invalid location");if(r.removeChild(o,t),a.dispose(),1!==r.children.length)return a.view;const d=r.children[0];if(0===s.length)return d instanceof $||(r.removeChild(0,t),this.root=d),a.view;const[h,...l]=[...s].reverse(),[p,...c]=[...n].reverse(),v=r.isChildVisible(0);r.removeChild(0,t);const u=h.children.map(((e,i)=>h.getChildSize(i)));if(h.removeChild(p,t).dispose(),d instanceof j){u.splice(p,1,...d.children.map((e=>e.size)));for(let e=0;e<d.children.length;e++){const i=d.children[e];h.addChild(i,i.size,p+e)}for(;d.children.length>0;)d.removeChild(0)}else{const i=new $(d.view,ie(d.orientation),d.size),t=v?d.orthogonalSize:e.Sizing.Invisible(d.orthogonalSize);h.addChild(i,t,p)}d.dispose();for(let e=0;e<u.length;e++)h.resizeChild(e,u[e]);return a.view}layout(i,t){const[n,o]=this.root.orientation===e.Orientation.HORIZONTAL?[t,i]:[i,t];this.root.layout(n,o)}getNode(e,i=this.root,t=[]){if(0===e.length)return[t,i];if(!(i instanceof j))throw new Error("Invalid location");const[n,...o]=e;if(n<0||n>=i.children.length)throw new Error("Invalid location");const s=i.children[n];return t.push(i),this.getNode(o,s,t)}}const se=(()=>{const e={disableAutoResizing:void 0,proportionalLayout:void 0,orientation:void 0,hideBorders:void 0,className:void 0};return Object.keys(e)})();class re extends m{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(e){this._disableResizing=e}constructor(e,i=!1){super(),this._disableResizing=i,this._element=e,this.addDisposables(w(this._element,(e=>{if(this.isDisposed)return;if(this.disableResizing)return;if(!this._element.offsetParent)return;if(!function(e){let i=e;for(;null==i?void 0:i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof DocumentFragment?i.parentNode.host:i.parentNode}return!1}(this._element))return;const{width:i,height:t}=e.contentRect;this.layout(i,t)})))}}const ae=T();function de(e){switch(e){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";default:return"center"}}class he extends re{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(i,t){var n;super(document.createElement("div"),t.disableAutoResizing),this._id=ae.next(),this._groups=new Map,this._onDidRemove=new c,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new c,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new c,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new c,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new u,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new u,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new E(this.element),this._classNames.setClassNames(null!==(n=t.className)&&void 0!==n?n:""),i.appendChild(this.element),this.gridview=new oe(!!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)})),e.DockviewDisposable.from((()=>{var e;null===(e=this.element.parentElement)||void 0===e||e.removeChild(this.element)})),this.gridview.onDidChange((()=>{this._bufferOnDidLayoutChange.fire()})),e.DockviewEvent.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)((()=>{this._bufferOnDidLayoutChange.fire()})),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(e,i){this.gridview.setViewVisible(K(e.element),i),this._bufferOnDidLayoutChange.fire()}isVisible(e){return this.gridview.isViewVisible(K(e.element))}updateOptions(e){var i,t,n,o;e.proportionalLayout,e.orientation&&(this.gridview.orientation=e.orientation),"disableResizing"in e&&(this.disableResizing=null!==(i=e.disableAutoResizing)&&void 0!==i&&i),"locked"in e&&(this.locked=null!==(t=e.locked)&&void 0!==t&&t),"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(i,t=[0],n){this.gridview.addView(i,null!=n?n:e.Sizing.Distribute,t),this._onDidAdd.fire(i)}doRemoveGroup(i,t){if(!this._groups.has(i.id))throw new Error("invalid operation");const n=this._groups.get(i.id),o=this.gridview.remove(i,e.Sizing.Distribute);if(n&&!(null==t?void 0:t.skipDispose)&&(n.disposable.dispose(),n.value.dispose(),this._groups.delete(i.id),this._onDidRemove.fire(i)),!(null==t?void 0:t.skipActive)&&this._activeGroup===i){const e=Array.from(this._groups.values());this.doSetGroupActive(e.length>0?e[0].value:void 0)}return o}getPanel(e){var i;return null===(i=this._groups.get(e))||void 0===i?void 0:i.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 i;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const t=K(e.group.element),n=null===(i=this.gridview.next(t))||void 0===i?void 0:i.view;this.doSetGroupActive(n)}moveToPrevious(e){var i;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const t=K(e.group.element),n=null===(i=this.gridview.previous(t))||void 0===i?void 0:i.view;this.doSetGroupActive(n)}layout(e,i,t){(t||e!==this.width||i!==this.height)&&(this.gridview.element.style.height=`${i}px`,this.gridview.element.style.width=`${e}px`,this.gridview.layout(e,i))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const e of this.groups)e.dispose();this.gridview.dispose(),super.dispose()}}class le{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,i){this.component.removePanel(e,i)}focus(){this.component.focus()}getPanel(e){return this.component.getPanel(e)}layout(e,i){return this.component.layout(e,i)}addPanel(e){return this.component.addPanel(e)}movePanel(e,i){this.component.movePanel(e,i)}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 pe{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,i){this.component.movePanel(e,i)}focus(){this.component.focus()}layout(e,i){this.component.layout(e,i)}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 ce{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,i,t=!1){this.component.layout(e,i,t)}addPanel(e){return this.component.addPanel(e)}removePanel(e,i){this.component.removePanel(e,i)}movePanel(e,i){this.component.movePanel(e,i)}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 ve{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,i,t=!1){this.component.layout(e,i,t)}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,i){return this.component.addFloatingGroup(e,i)}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,i){return this.component.addPopoutGroup(e,i)}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class ue extends m{constructor(e){super(),this.el=e,this.dataDisposable=new g,this.pointerEventsDisposable=new g,this._onDragStart=new c,this.onDragStart=this._onDragStart.event,this.addDisposables(this._onDragStart,this.dataDisposable,this.pointerEventsDisposable),this.configure()}isCancelled(e){return!1}configure(){this.addDisposables(this._onDragStart,v(this.el,"dragstart",(e=>{if(e.defaultPrevented||this.isCancelled(e))return void e.preventDefault();const i=k();if(this.pointerEventsDisposable.value={dispose:()=>{i.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","")}})),v(this.el,"dragend",(()=>{this.pointerEventsDisposable.dispose(),setTimeout((()=>{this.dataDisposable.dispose()}),0)})))}}class me extends m{constructor(e,i){super(),this.element=e,this.callbacks=i,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(v(this.element,"dragenter",(e=>{this.onDragEnter(e)}),!0)),this.addDisposables(v(this.element,"dragover",(e=>{this.onDragOver(e)}),!0)),this.addDisposables(v(this.element,"dragleave",(e=>{this.onDragLeave(e)}))),this.addDisposables(v(this.element,"dragend",(e=>{this.onDragEnd(e)}))),this.addDisposables(v(this.element,"drop",(e=>{this.onDrop(e)})))}}class ge extends d{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(e){super(),this.options=e}}function be(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 we(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 fe={value:20,type:"percentage"},_e={value:50,type:"percentage"};class De extends m{get disabled(){return this._disabled}set disabled(e){this._disabled=e}get state(){return this._state}constructor(e,i){super(),this.element=e,this.options=i,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._disabled=!1,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new me(this.element,{onDragEnter:()=>{var e,i,t;null===(t=null===(i=(e=this.options).getOverrideTarget)||void 0===i?void 0:i.call(e))||void 0===t||t.getElements()},onDragOver:e=>{var i,t,n,o,s,r,a;De.ACTUAL_TARGET=this;const d=null===(t=(i=this.options).getOverrideTarget)||void 0===t?void 0:t.call(i);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 ge({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,i;(null===(i=(e=this.options).getOverrideTarget)||void 0===i?void 0:i.call(e))||this.removeDropTarget()},onDragEnd:e=>{var i,t;const n=null===(t=(i=this.options).getOverrideTarget)||void 0===t?void 0:t.call(i);n&&De.ACTUAL_TARGET===this&&this._state&&(e.stopPropagation(),this._onDrop.fire({position:this._state,nativeEvent:e})),this.removeDropTarget(),null==n||n.clear()},onDrop:e=>{var i,t,n;e.preventDefault();const o=this._state;this.removeDropTarget(),null===(n=null===(t=(i=this.options).getOverrideTarget)||void 0===t?void 0:t.call(i))||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[De.USED_EVENT_ID]=!0}isAlreadyUsed(e){const i=e[De.USED_EVENT_ID];return"boolean"==typeof i&&i}toggleClasses(e,i,t){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=i<100,c=t<100,v="left"===e,u="right"===e,m="top"===e,g="bottom"===e,b=!p&&u,w=!p&&v,f=!c&&m,_=!c&&g;let y=1;const x=null!==(r=null===(s=this.options.overlayModel)||void 0===s?void 0:s.size)&&void 0!==r?r:_e;if("percentage"===x.type?y=N(x.value,0,100)/100:((b||w)&&(y=N(0,x.value,i)/i),(f||_)&&(y=N(0,x.value,t)/t)),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,x=r.getBoundingClientRect(),C=o.top-x.top,z=o.left-x.left,S={top:C,left:z,width:i,height:t};b?(S.left=z+i*(1-y),S.width=i*y):w?S.width=i*y:f?S.height=t*y:_&&(S.top=C+t*(1-y),S.height=t*y),p&&v&&(S.width=4),p&&u&&(S.left=z+i-4,S.width=4);const A=`${Math.round(S.top)}px`,k=`${Math.round(S.left)}px`,E=`${Math.round(S.width)}px`,P=`${Math.round(S.height)}px`;if(c.style.top===A&&c.style.left===k&&c.style.width===E&&c.style.height===P)return;return c.style.top=A,c.style.left=k,c.style.width=E,c.style.height=P,c.style.visibility="visible",c.className="dv-drop-target-anchor"+(this.options.className?` ${this.options.className}`:""),D(c,"dv-drop-target-left",v),D(c,"dv-drop-target-right",u),D(c,"dv-drop-target-top",m),D(c,"dv-drop-target-bottom",g),D(c,"dv-drop-target-center","center"===e),void(s.changed&&(D(c,"dv-drop-target-anchor-container-changed",!0),setTimeout((()=>{D(c,"dv-drop-target-anchor-container-changed",!1)}),10)))}if(!this.overlayElement)return;const C={top:"0px",left:"0px",width:"100%",height:"100%"};b?(C.left=100*(1-y)+"%",C.width=100*y+"%"):w?C.width=100*y+"%":f?C.height=100*y+"%":_&&(C.top=100*(1-y)+"%",C.height=100*y+"%"),this.overlayElement.style.top=C.top,this.overlayElement.style.left=C.left,this.overlayElement.style.width=C.width,this.overlayElement.style.height=C.height,D(this.overlayElement,"dv-drop-target-small-vertical",c),D(this.overlayElement,"dv-drop-target-small-horizontal",p),D(this.overlayElement,"dv-drop-target-left",v),D(this.overlayElement,"dv-drop-target-right",u),D(this.overlayElement,"dv-drop-target-top",m),D(this.overlayElement,"dv-drop-target-bottom",g),D(this.overlayElement,"dv-drop-target-center","center"===e)}calculateQuadrant(e,i,t,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:fe;return"percentage"===a.type?function(e,i,t,n,o,s){const r=100*i/n,a=100*t/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,i,t,n,o,a.value):function(e,i,t,n,o,s){if(e.has("left")&&i<s)return"left";if(e.has("right")&&i>n-s)return"right";if(e.has("top")&&t<s)return"top";if(e.has("bottom")&&t>o-s)return"bottom";if(!e.has("center"))return null;return"center"}(e,i,t,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)}}De.USED_EVENT_ID="__dockview_droptarget_event_is_used__";const ye=(()=>{const e={disableAutoResizing:void 0,disableDnd:void 0,className:void 0};return Object.keys(e)})();class xe extends h{constructor(e,i,t,n){super(),this.nativeEvent=e,this.position=i,this.getData=t,this.panel=n}}class Ce extends d{constructor(){super()}}class ze extends m{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,i){super(),this.id=e,this.component=i,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new g,this._onDidDimensionChange=new c,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new c,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new c,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new c,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new c,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new c,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new c,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new c,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((i=>{this._parameters=i,e.update({params:i})}))}setVisible(e){this._onWillVisibilityChange.fire({isVisible:e})}setActive(){this._onActiveChange.fire()}updateParameters(e){this._onDidParametersChange.fire(e)}}class Se extends ze{constructor(e,i){super(e,i),this._onDidConstraintsChangeInternal=new c,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new c({replay:!0}),this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new c,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 Ae extends Se{set pane(e){this._pane=e}constructor(e,i){super(e,i),this._onDidExpansionChange=new c({replay:!0}),this.onDidExpansionChange=this._onDidExpansionChange.event,this._onMouseEnter=new c({}),this.onMouseEnter=this._onMouseEnter.event,this._onMouseLeave=new c({}),this.onMouseLeave=this._onMouseLeave.event,this.addDisposables(this._onDidExpansionChange,this._onMouseEnter,this._onMouseLeave)}setExpanded(e){var i;null===(i=this._pane)||void 0===i||i.setExpanded(e)}get isExpanded(){var e;return!!(null===(e=this._pane)||void 0===e?void 0:e.isExpanded())}}class ke extends m{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,i,t){super(),this.id=e,this.component=i,this.api=t,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=x(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 Ce;this.api._onWillFocus.fire(e),e.defaultPrevented||this._element.focus()}layout(e,i){this._width=e,this._height=i,this.api._onDidDimensionChange.fire({width:e,height:i}),this.part&&this._params&&this.part.update(this._params.params)}init(e){this._params=e,this.part=this.getComponent()}update(e){var i,t;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},null===(i=this._params)||void 0===i?void 0:i.params),e.params)});for(const i of Object.keys(e.params))void 0===e.params[i]&&delete this._params.params[i];null===(t=this.part)||void 0===t||t.update({params:this._params.params})}toJSON(){var e,i;const t=null!==(i=null===(e=this._params)||void 0===e?void 0:e.params)&&void 0!==i?i:{};return{id:this.id,component:this.component,params:Object.keys(t).length>0?t:void 0}}dispose(){var e;this.api.dispose(),null===(e=this.part)||void 0===e||e.dispose(),super.dispose()}}class Ee extends ke{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 Ae(e.id,e.component)),this._onDidChangeExpansionState=new c({replay:!0}),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this._onDidChange=new c,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:i}=e,{accessor:t}=this._params;t.setVisible(this,i)})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({size:e.size})})),v(this.element,"mouseenter",(e=>{this.api._onMouseEnter.fire(e)})),v(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?_(this.header,"focused"):f(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(i,t){this._size=i,this._orthogonalSize=t;const[n,o]=this.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];super.layout(n,o)}init(e){var i,t;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===(i=this.body)||void 0===i||i.append(this.bodyPart.element),null===(t=this.header)||void 0===t||t.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 i,t;null===(i=this.bodyPart)||void 0===i||i.update({params:e}),null===(t=this.headerPart)||void 0===t||t.update({params:e})},dispose:()=>{var e,i;null===(e=this.bodyPart)||void 0===e||e.dispose(),null===(i=this.headerPart)||void 0===i||i.dispose()}}}}class Pe extends Ee{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 c,this.onDidDrop=this._onDidDrop.event,this._onUnhandledDragOverEvent=new c,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,i=this.accessor.id;this.header.draggable=!0,this.handler=new class extends ue{getData(){return s.getInstance().setData([new o(i,e)],o.prototype),{dispose:()=>{s.getInstance().clearData(o.prototype)}}}}(this.header),this.target=new De(this.element,{acceptedTargetZones:["top","bottom"],overlayModel:{activationSize:{type:"percentage",value:50}},canDisplayOverlay:(e,i)=>{const t=a();if(t&&t.paneId!==this.id&&t.viewId===this.accessor.id)return!0;const n=new xe(e,i,a,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 i=a();if(!i||i.viewId!==this.accessor.id)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,api:new pe(this.accessor),getData:a}));const t=this._params.containerApi,n=i.paneId,o=t.getPanel(n);if(!o)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,getData:a,api:new pe(this.accessor)}));const s=t.panels,r=s.indexOf(o);let d=t.panels.indexOf(this);"left"!==e.position&&"top"!==e.position||(d=Math.max(0,d-1)),"right"!==e.position&&"bottom"!==e.position||(r>d&&d++,d=Math.min(s.length-1,d)),t.movePanel(r,d)}}class Oe extends m{get element(){return this._element}constructor(e,i){super(),this.accessor=e,this.group=i,this.disposable=new g,this._onDidFocus=new c,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new c,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 t=i.dropTargetContainer;this.dropTarget=new De(this.element,{getOverlayOutline:()=>{var i;return"group"===(null===(i=e.options.theme)||void 0===i?void 0:i.dndPanelOverlay)?this.element.parentElement:null},className:"dv-drop-target-content",acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(e,i)=>{if("no-drop-target"===this.group.locked||this.group.locked&&"center"===i)return!1;const t=r();return!(!t&&e.shiftKey&&"floating"!==this.group.location.type)&&(!(!t||t.viewId!==this.accessor.id)||this.group.canDisplayOverlay(e,i,"content"))},getOverrideTarget:t?()=>t.model:void 0}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(e,i={asActive:!0}){const t=i.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&&t&&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(t){const e=x(n),i=new m;i.addDisposables(e,e.onDidFocus((()=>this._onDidFocus.fire())),e.onDidBlur((()=>this._onDidBlur.fire()))),this.disposable.value=i}}openPanel(e){this.panel!==e&&this.renderPanel(e)}layout(e,i){}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 Ge(e,i,t){var n,o;_(i,"dv-dragged"),i.style.top="-9999px",document.body.appendChild(i),e.setDragImage(i,null!==(n=null==t?void 0:t.x)&&void 0!==n?n:0,null!==(o=null==t?void 0:t.y)&&void 0!==o?o:0),setTimeout((()=>{f(i,"dv-dragged"),i.remove()}),0)}class Ie extends ue{constructor(e,i,t,n){super(e),this.accessor=i,this.group=t,this.panel=n,this.panelTransfer=s.getInstance()}getData(e){return this.panelTransfer.setData([new n(this.accessor.id,this.group.id,this.panel.id)],n.prototype),{dispose:()=>{this.panelTransfer.clearData(n.prototype)}}}}class Ve extends m{get element(){return this._element}constructor(e,i,t){super(),this.panel=e,this.accessor=i,this.group=t,this.content=void 0,this._onPointDown=new c,this.onPointerDown=this._onPointDown.event,this._onDropped=new c,this.onDrop=this._onDropped.event,this._onDragStart=new c,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,D(this.element,"dv-inactive-tab",!0);const n=new Ie(this._element,this.accessor,this.group,this.panel);this.dropTarget=new De(this._element,{acceptedTargetZones:["left","right"],overlayModel:{activationSize:{value:50,type:"percentage"}},canDisplayOverlay:(e,i)=>{if(this.group.locked)return!1;const t=r();return!(!t||this.accessor.id!==t.viewId)||this.group.model.canDisplayOverlay(e,i,"tab")},getOverrideTarget:()=>{var e;return null===(e=t.model.dropTargetContainer)||void 0===e?void 0:e.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(this._onPointDown,this._onDropped,this._onDragStart,n.onDragStart((e=>{if(e.dataTransfer){const i=getComputedStyle(this.element),t=this.element.cloneNode(!0);Array.from(i).forEach((e=>t.style.setProperty(e,i.getPropertyValue(e),i.getPropertyPriority(e)))),t.style.position="absolute",Ge(e.dataTransfer,t,{y:-10,x:30})}this._onDragStart.fire(e)})),n,v(this._element,"pointerdown",(e=>{this._onPointDown.fire(e)})),this.dropTarget.onDrop((e=>{this._onDropped.fire(e)})),this.dropTarget)}setActive(e){D(this.element,"dv-active-tab",e),D(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}dispose(){super.dispose()}}class Ne{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,i){this.event=e,this.options=i}}class Te extends ue{constructor(e,i,t){super(e),this.accessor=i,this.group=t,this.panelTransfer=s.getInstance(),this.addDisposables(v(e,"pointerdown",(e=>{e.shiftKey&&(e[z]=!0)}),!0))}isCancelled(e){return"floating"===this.group.api.location.type&&!e.shiftKey}getData(e){const i=e.dataTransfer;this.panelTransfer.setData([new n(this.accessor.id,this.group.id,null)],n.prototype);const t=window.getComputedStyle(this.el),o=t.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),s=t.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(i){const e=document.createElement("div");e.style.backgroundColor=o,e.style.color=s,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})`,Ge(i,e,{y:-10,x:30})}return{dispose:()=>{this.panelTransfer.clearData(n.prototype)}}}}class Le extends m{get element(){return this._element}constructor(e,i){super(),this.accessor=e,this.group=i,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onDragStart=new c,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!this.accessor.options.disableDnd,D(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.addDisposables(this._onDrop,this._onDragStart,v(this._element,"pointerdown",(()=>{this.accessor.doSetGroupActive(this.group)})));const t=new Te(this._element,e,i);this.dropTarget=new De(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(e,t)=>{const n=r();return!(!n||this.accessor.id!==n.viewId)||i.model.canDisplayOverlay(e,t,"header_space")},getOverrideTarget:()=>{var e;return null===(e=i.model.dropTargetContainer)||void 0===e?void 0:e.model}}),this.onWillShowOverlay=this.dropTarget.onWillShowOverlay,this.addDisposables(t,t.onDragStart((e=>{this._onDragStart.fire(e)})),this.dropTarget.onDrop((e=>{this._onDrop.fire(e)})),this.dropTarget)}updateDragAndDropState(){this._element.draggable=!this.accessor.options.disableDnd,D(this._element,"dv-draggable",!this.accessor.options.disableDnd)}}class Me extends m{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(v(this.element,"wheel",(e=>{this._scrollLeft+=e.deltaY*Me.MouseWheelSpeed,this.calculateScrollbarStyles()})),v(this._horizontalScrollbar,"pointerdown",(e=>{e.preventDefault(),D(this.element,"dv-scrollable-scrolling",!0);const i=e.clientX,t=this._scrollLeft,n=e=>{const n=e.clientX-i,{clientWidth:o}=this.element,{scrollWidth:s}=this.scrollableElement,r=o/s;this._scrollLeft=t+n/r,this.calculateScrollbarStyles()},o=()=>{D(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)})),v(this.element,"scroll",(()=>{this.calculateScrollbarStyles()})),v(this.scrollableElement,"scroll",(()=>{this._scrollLeft=this.scrollableElement.scrollLeft,this.calculateScrollbarStyles()})),w(this.element,(()=>{D(this.element,"dv-scrollable-resizing",!0),this._animationTimer&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout((()=>{clearTimeout(this._animationTimer),D(this.element,"dv-scrollable-resizing",!1)}),500),this.calculateScrollbarStyles()})))}calculateScrollbarStyles(){const{clientWidth:e}=this.element,{scrollWidth:i}=this.scrollableElement;if(i>e){const t=e*(e/i);this._horizontalScrollbar.style.width=`${t}px`,this._scrollLeft=N(this._scrollLeft,0,this.scrollableElement.scrollWidth-e),this.scrollableElement.scrollLeft=this._scrollLeft;const n=this._scrollLeft/(i-e);this._horizontalScrollbar.style.left=(e-t)*n+"px"}else this._horizontalScrollbar.style.width="0px",this._horizontalScrollbar.style.left="0px",this._scrollLeft=0}}Me.MouseWheelSpeed=1;class Re extends m{get showTabsOverflowControl(){return this._showTabsOverflowControl}set showTabsOverflowControl(e){if(this._showTabsOverflowControl!=e&&(this._showTabsOverflowControl=e,e)){const e=new b(this._tabsList);this._observerDisposable.value=new m(e,e.onDidChange((e=>{const i=e.hasScrollX||e.hasScrollY;this.toggleDropdown({reset:!i})})),v(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(i,t,n){if(super(),this.group=i,this.accessor=t,this._observerDisposable=new g,this._tabs=[],this.selectedIndex=-1,this._showTabsOverflowControl=!1,this._onTabDragStart=new c,this.onTabDragStart=this._onTabDragStart.event,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onOverflowTabsChange=new c,this.onOverflowTabsChange=this._onOverflowTabsChange.event,this._tabsList=document.createElement("div"),this._tabsList.className="dv-tabs-container dv-horizontal",this.showTabsOverflowControl=n.showTabsOverflowControl,"native"===t.options.scrollbars)this._element=this._tabsList;else{const e=new Me(this._tabsList);this._element=e.element,this.addDisposables(e)}this.addDisposables(this._onOverflowTabsChange,this._observerDisposable,this._onWillShowOverlay,this._onDrop,this._onTabDragStart,v(this.element,"pointerdown",(e=>{if(e.defaultPrevented)return;0===e.button&&this.accessor.doSetGroupActive(this.group)})),e.DockviewDisposable.from((()=>{for(const{value:e,disposable:i}of this._tabs)i.dispose(),e.dispose();this._tabs=[]})))}indexOf(e){return this._tabs.findIndex((i=>i.value.panel.id===e))}isActive(e){return this.selectedIndex>-1&&this._tabs[this.selectedIndex].value===e}setActivePanel(e){let i=0;for(const t of this._tabs){const n=e.id===t.value.panel.id;if(t.value.setActive(n),n){const e=t.value.element,n=e.parentElement;(i<n.scrollLeft||i+e.clientWidth>n.scrollLeft+n.clientWidth)&&(n.scrollLeft=i)}i+=t.value.element.clientWidth}}openPanel(e,i=this._tabs.length){if(this._tabs.find((i=>i.value.panel.id===e.id)))return;const t=new Ve(e,this.accessor,this.group);t.setContent(e.view.tab);const n=new m(t.onDragStart((i=>{this._onTabDragStart.fire({nativeEvent:i,panel:e})})),t.onPointerDown((i=>{if(i.defaultPrevented)return;const n=!this.accessor.options.disableFloatingGroups,o="floating"===this.group.api.location.type&&1===this.size;if(n&&!o&&i.shiftKey){i.preventDefault();const e=this.accessor.getGroupPanel(t.panel.id),{top:n,left:o}=t.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===i.button)this.group.activePanel!==e&&this.group.model.openPanel(e)})),t.onDrop((e=>{this._onDrop.fire({event:e.nativeEvent,index:this._tabs.findIndex((e=>e.value===t))})})),t.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new Ne(e,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:r}))}))),o={value:t,disposable:n};this.addTab(o,i)}delete(e){const i=this.indexOf(e),t=this._tabs.splice(i,1)[0],{value:n,disposable:o}=t;o.dispose(),n.dispose(),n.element.remove()}addTab(e,i=this._tabs.length){if(i<0||i>this._tabs.length)throw new Error("invalid location");this._tabsList.insertBefore(e.value.element,this._tabsList.children[i]),this._tabs=[...this._tabs.slice(0,i),e,...this._tabs.slice(i)],this.selectedIndex<0&&(this.selectedIndex=i)}toggleDropdown(e){const i=e.reset?[]:this._tabs.filter((e=>!function(e,i){const t=A(e),n=A(i);return!(t.left<n.left||t.left+t.width>n.left+n.width)}(e.value.element,this._tabsList))).map((e=>e.value.panel.id));this._onOverflowTabsChange.fire({tabs:i,reset:e.reset})}updateDragAndDropState(){for(const e of this._tabs)e.value.updateDragAndDropState()}}const We=e=>{const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"height",e.height),i.setAttributeNS(null,"width",e.width),i.setAttributeNS(null,"viewBox",e.viewbox),i.setAttributeNS(null,"aria-hidden","false"),i.setAttributeNS(null,"focusable","false"),i.classList.add("dv-svg");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttributeNS(null,"d",e.path),i.appendChild(t),i},He=()=>We({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 Be extends m{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,i){super(),this.accessor=e,this.group=i,this._hidden=!1,this.dropdownPart=null,this._overflowTabs=[],this._dropdownDisposable=new g,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onGroupDragStart=new c,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",D(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 Re(i,e,{showTabsOverflowControl:!e.options.disableTabsOverflowList}),this.voidContainer=new Le(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 Ne(e,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:r}))})),v(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:i,left:t}=this.element.getBoundingClientRect(),{top:n,left:o}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:t-o+20,y:i-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,i=this.tabs.size){this.tabs.openPanel(e,i),this.updateClassnames()}closePanel(e){this.delete(e.id)}updateClassnames(){D(this._element,"dv-single-tab",1===this.size)}toggleDropdown(i){const t=i.reset?[]:i.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 n=document.createElement("div");n.className="dv-tabs-overflow-dropdown-root";const o=function(){const e=document.createElement("div");e.className="dv-tabs-overflow-dropdown-default";const i=document.createElement("span");i.textContent="";const t=He();return e.appendChild(t),e.appendChild(i),{element:e,update:e=>{i.textContent=`${e.tabs}`}}}();o.update({tabs:t.length}),this.dropdownPart=o,n.appendChild(o.element),this.rightActionsContainer.prepend(n),this._dropdownDisposable.value=new m(e.DockviewDisposable.from((()=>{var e,i;n.remove(),null===(i=null===(e=this.dropdownPart)||void 0===e?void 0:e.dispose)||void 0===i||i.call(e),this.dropdownPart=null})),v(n,"pointerdown",(e=>{e.preventDefault()}),{capture:!0}),v(n,"click",(e=>{const i=document.createElement("div");i.style.overflow="auto",i.className="dv-tabs-overflow-container";for(const e of this.tabs.tabs.filter((e=>this._overflowTabs.includes(e.panel.id)))){const t=this.group.panels.find((i=>i===e.panel)),n=t.view.createTabRenderer("headerOverflow").element,o=document.createElement("div");D(o,"dv-tab",!0),D(o,"dv-active-tab",t.api.isActive),D(o,"dv-inactive-tab",!t.api.isActive),o.addEventListener("click",(i=>{this.accessor.popupService.close(),i.defaultPrevented||(e.element.scrollIntoView(),e.panel.api.setActive())})),o.appendChild(n),i.appendChild(o)}const t=function(e){let i=e;for(;i&&("auto"===i.style.zIndex||""===i.style.zIndex);)i=i.parentElement;return i}(n);this.accessor.popupService.openPopover(i,{x:e.clientX,y:e.clientY,zIndex:(null==t?void 0:t.style.zIndex)?`calc(${t.style.zIndex} * 2)`:void 0})})))}updateDragAndDropState(){this.tabs.updateDragAndDropState(),this.voidContainer.updateDragAndDropState()}}class Fe extends h{constructor(e,i,t,n,o){super(),this.nativeEvent=e,this.target=i,this.position=t,this.getData=n,this.group=o}}const Je=(()=>{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 Ue(e){return!!e.referencePanel}function $e(e){return!!e.referenceGroup}function je(e){return!!e.referencePanel}function Ze(e){return!!e.referenceGroup}class Ye extends d{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 Xe extends Ye{get kind(){return this._kind}constructor(e){super(e),this._kind=e.kind}}class Ke extends m{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(e){this._locked=e,D(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&&y(document.activeElement,this.contentContainer.element)}get location(){return this._location}set location(e){switch(this._location=e,D(this.container,"dv-groupview-floating",!1),D(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"]),D(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),D(this.container,"dv-groupview-popout",!0)}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(e,i,t,n,o){var s;super(),this.container=e,this.accessor=i,this.id=t,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 c,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new c,this.onMove=this._onMove.event,this._onDidDrop=new c,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new c,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new c,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new c,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new c,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new c,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new c,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new c,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new c,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new c,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,D(this.container,"dv-groupview",!0),this._api=new ve(this.accessor),this.tabsContainer=new Be(this.accessor,this.groupPanel),this.contentContainer=new Oe(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 Ne(e,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:r}))})),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 i={views:this.tabsContainer.panels,activeView:null===(e=this._activePanel)||void 0===e?void 0:e.id,id:this.id};return!1!==this.locked&&(i.locked=this.locked),this.header.hidden&&(i.hideHeader=!0),i}moveToNext(e){e||(e={}),e.panel||(e.panel=this.activePanel);const i=e.panel?this.panels.indexOf(e.panel):-1;let t;if(i<this.panels.length-1)t=i+1;else{if(e.suppressRoll)return;t=0}this.openPanel(this.panels[t])}moveToPrevious(e){if(e||(e={}),e.panel||(e.panel=this.activePanel),!e.panel)return;const i=this.panels.indexOf(e.panel);let t;if(i>0)t=i-1;else{if(e.suppressRoll)return;t=this.panels.length-1}this.openPanel(this.panels[t])}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,i={}){("number"!=typeof i.index||i.index>this.panels.length)&&(i.index=this.panels.length);const t=!!i.skipSetActive;e.updateParentGroup(this.groupPanel,{skipSetActive:i.skipSetActive}),this.doAddPanel(e,i.index,{skipSetActive:t}),this._activePanel!==e?(t||this.doSetActivePanel(e),i.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),i.skipSetActive||this.updateContainer()):this.contentContainer.renderPanel(e,{asActive:!0})}removePanel(e,i={skipSetActive:!1}){const t="string"==typeof e?e:e.id,n=this._panels.find((e=>e.id===t));if(!n)throw new Error("invalid operation");return this._removePanel(n,i)}closeAllPanels(){if(this.panels.length>0){const e=[...this.panels];for(const i of e)this.doClose(i)}else this.accessor.removeGroup(this.groupPanel)}closePanel(e){this.doClose(e)}doClose(e){const i=1===this.panels.length&&1===this.accessor.groups.length;this.accessor.removePanel(e,i&&"emptyGroup"===this.accessor.options.noPanelsOverlay?{removeEmptyGroup:!1}:void 0)}isPanelActive(e){return this._activePanel===e}updateActions(e){this.tabsContainer.setRightActionsElement(e)}setActive(e,i=!1){(i||this.isActive!==e)&&(this._isGroupActive=e,D(this.container,"dv-active-group",e),D(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,i){var t;this._width=e,this._height=i,this.contentContainer.layout(this._width,this._height),(null===(t=this._activePanel)||void 0===t?void 0:t.layout)&&this._activePanel.layout(this._width,this._height)}_removePanel(e,i){const t=this._activePanel===e;if(this.doRemovePanel(e),t&&this.panels.length>0){const e=this.mostRecentlyUsed[0];this.openPanel(e,{skipSetActive:i.skipSetActive,skipSetGroupActive:i.skipSetActiveGroup})}return this._activePanel&&0===this.panels.length&&this.doSetActivePanel(void 0),i.skipSetActive||this.updateContainer(),e}doRemovePanel(e){const i=this.panels.indexOf(e);if(this._activePanel===e&&this.contentContainer.closePanel(),this.tabsContainer.delete(e.id),this._panels.splice(i,1),this.mostRecentlyUsed.includes(e)){const i=this.mostRecentlyUsed.indexOf(e);this.mostRecentlyUsed.splice(i,1)}const t=this._panelDisposables.get(e.id);t&&(t.dispose(),this._panelDisposables.delete(e.id)),this._onDidRemovePanel.fire({panel:e})}doAddPanel(e,i=this.panels.length,t={skipSetActive:!1}){const n=this._panels.indexOf(e)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(e,i),t.skipSetActive||this.contentContainer.openPanel(e),n||(this.updateMru(e),this.panels.splice(i,0,e),this._panelDisposables.set(e.id,new m(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,i;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,v(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===(i=(e=this.watermark).dispose)||void 0===i||i.call(e),this.watermark=void 0)}canDisplayOverlay(e,i,t){const n=new Fe(e,t,i,r,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(n),n.isAccepted}handleDropEvent(e,i,t,n){if("no-drop-target"===this.locked)return;const o="number"==typeof n?this.panels[n]:void 0,s=new Xe({nativeEvent:i,position:t,panel:o,getData:()=>r(),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 a=r();if(a&&a.viewId===this.accessor.id){if("content"===e&&a.groupId===this.id){if("center"===t)return;if(null===a.panelId)return}if("header"===e&&a.groupId===this.id&&null===a.panelId)return;if(null===a.panelId){const{groupId:e}=a;return void this._onMove.fire({target:t,groupId:e,index:n})}if(-1!==this.tabsContainer.indexOf(a.panelId)&&1===this.tabsContainer.size)return;const{groupId:i,panelId:o}=a;if(this.id===i&&!t){if(this.tabsContainer.indexOf(o)===n)return}this._onMove.fire({target:t,groupId:a.groupId,itemId:a.panelId,index:n})}else this._onDidDrop.fire(new Ye({nativeEvent:i,position:t,panel:o,getData:()=>r(),group:this.groupPanel,api:this._api}))}updateDragAndDropState(){this.tabsContainer.updateDragAndDropState()}dispose(){var e,i,t;super.dispose(),null===(e=this.watermark)||void 0===e||e.element.remove(),null===(t=null===(i=this.watermark)||void 0===i?void 0:i.dispose)||void 0===t||t.call(i),this.watermark=void 0;for(const e of this.panels)e.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class qe extends ze{constructor(e,i,t){super(e,i),this._onDidConstraintsChangeInternal=new c,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new c,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new c,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),t&&this.initialize(t)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class Qe extends ke{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,i,t,n){super(e,i,null!=n?n:new qe(e,i)),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 c,this.onDidChange=this._onDidChange.event,"number"==typeof(null==t?void 0:t.minimumWidth)&&(this._minimumWidth=t.minimumWidth),"number"==typeof(null==t?void 0:t.maximumWidth)&&(this._maximumWidth=t.maximumWidth),"number"==typeof(null==t?void 0:t.minimumHeight)&&(this._minimumHeight=t.minimumHeight),"number"==typeof(null==t?void 0:t.maximumHeight)&&(this._maximumHeight=t.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange((e=>{const{isVisible:i}=e,{accessor:t}=this._params;t.setVisible(this,i)})),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(),i=e=>e===Number.MAX_SAFE_INTEGER?void 0:e,t=e=>e<=0?void 0:e;return Object.assign(Object.assign({},e),{minimumHeight:t(this.minimumHeight),maximumHeight:i(this.maximumHeight),minimumWidth:t(this.minimumWidth),maximumWidth:i(this.maximumWidth),snap:this.snap,priority:this.priority})}}const ei="dockview: DockviewGroupPanelApiImpl not initialized";class ii extends qe{get location(){if(!this._group)throw new Error(ei);return this._group.model.location}constructor(e,i){super(e,"__dockviewgroup__"),this.accessor=i,this._onDidLocationChange=new c,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new c,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 i,t,n,o;if(!this._group)throw new Error(ei);const s=null!==(i=e.group)&&void 0!==i?i:this.accessor.addGroup({direction:we(null!==(t=e.position)&&void 0!==t?t:"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(ei);"grid"===this.location.type&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(ei);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(ei);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(e){this._group=e}}class ti extends Qe{get minimumWidth(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.minimumWidth;return"number"==typeof i?i:super.__minimumWidth()}get minimumHeight(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.minimumHeight;return"number"==typeof i?i:super.__minimumHeight()}get maximumWidth(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.maximumWidth;return"number"==typeof i?i:super.__maximumWidth()}get maximumHeight(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.maximumHeight;return"number"==typeof i?i: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,i,t){var n,o,s,r,a,d;super(i,"groupview_default",{minimumHeight:null!==(o=null===(n=t.constraints)||void 0===n?void 0:n.minimumHeight)&&void 0!==o?o:100,minimumWidth:null!==(r=null===(s=t.constraints)||void 0===s?void 0:s.maximumHeight)&&void 0!==r?r:100,maximumHeight:null===(a=t.constraints)||void 0===a?void 0:a.maximumHeight,maximumWidth:null===(d=t.constraints)||void 0===d?void 0:d.maximumWidth},new ii(i,e)),this.api.initialize(this),this._model=new Ke(this.element,e,i,t,this),this.addDisposables(this.model.onDidActivePanelChange((e=>{this.api._onDidActivePanelChange.fire(e)})))}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(e){super.setActive(e),this.model.setActive(e)}layout(e,i){super.layout(e,i),this.model.layout(e,i)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}const ni={name:"abyss",className:"dockview-theme-abyss"};class oi extends qe{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 i=this._group;this._group!==e&&(this._group=e,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(i),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(e,i,t,n,o){super(e.id,n),this.panel=e,this.accessor=t,this._onDidTitleChange=new c,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new c,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new c,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new c,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new c,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new g,this._tabComponent=o,this.initialize(e),this._group=i,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 i,t;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:null!==(i=e.group)&&void 0!==i?i:this._group,position:e.group&&null!==(t=e.position)&&void 0!==t?t:"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 i;let t=null!==(i=null==e?void 0:e.isActive)&&void 0!==i&&i;this.groupEventsDisposable.value=new m(this.group.api.onDidVisibilityChange((e=>{const i=!e.isVisible&&this.isVisible,t=e.isVisible&&!this.isVisible,n=this.group.model.isPanelActive(this.panel);(i||t&&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&&t!==this.isGroupActive&&(t=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))})))}}class si extends m{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,i,t,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 oi(this,this._group,n,i,t),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 Ce;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 i;this._params=Object.assign(Object.assign({},null!==(i=this._params)&&void 0!==i?i:{}),e.params);for(const i of Object.keys(e.params))void 0===e.params[i]&&delete this._params[i];this.view.update({params:this._params})}updateParentGroup(e,i){this._group=e,this.api.group=this._group;const t=this._group.model.isPanelActive(this),n=this.group.api.isActive&&t;(null==i?void 0:i.skipSetActive)||this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&t}),this.api.isVisible!==t&&this.api._onDidVisibilityChange.fire({isVisible:t})}runEvents(){const e=this._group.model.isPanelActive(this),i=this.group.api.isActive&&e;this.api.isActive!==i&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&e}),this.api.isVisible!==e&&this.api._onDidVisibilityChange.fire({isVisible:e})}layout(e,i){this.api._onDidDimensionChange.fire({width:e,height:i}),this.view.layout(e,i)}dispose(){this.api.dispose(),this.view.dispose()}}class ri extends m{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(We({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()})),v(this.action,"pointerdown",(e=>{e.preventDefault()})),v(this.action,"click",(i=>{i.defaultPrevented||(i.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 ai{get content(){return this._content}get tab(){return this._tab}constructor(e,i,t,n){this.accessor=e,this.id=i,this.contentComponent=t,this.tabComponent=n,this._content=this.createContentComponent(this.id,t),this._tab=this.createTabComponent(this.id,n)}createTabRenderer(e){var i;const t=this.createTabComponent(this.id,this.tabComponent);return this._params&&t.init(Object.assign(Object.assign({},this._params),{tabLocation:e})),this._updateEvent&&(null===(i=t.update)||void 0===i||i.call(t,this._updateEvent)),t}init(e){this._params=e,this.content.init(e),this.tab.init(Object.assign(Object.assign({},e),{tabLocation:"header"}))}layout(e,i){var t,n;null===(n=(t=this.content).layout)||void 0===n||n.call(t,e,i)}update(e){var i,t,n,o;this._updateEvent=e,null===(t=(i=this.content).update)||void 0===t||t.call(i,e),null===(o=(n=this.tab).update)||void 0===o||o.call(n,e)}dispose(){var e,i,t,n;null===(i=(e=this.content).dispose)||void 0===i||i.call(e),null===(n=(t=this.tab).dispose)||void 0===n||n.call(t)}createContentComponent(e,i){return this.accessor.options.createComponent({id:e,name:i})}createTabComponent(e,i){const t=null!=i?i:this.accessor.options.defaultTabComponent;if(t){if(this.accessor.options.createTabComponent){const i=this.accessor.options.createTabComponent({id:e,name:t});return i||new ri}console.warn(`dockview: tabComponent '${i}' was not found. falling back to the default tab.`)}return new ri}}class di{constructor(e){this.accessor=e}fromJSON(e,i){var t,n;const o=e.id,s=e.params,r=e.title,a=e.view,d=a?a.content.id:null!==(t=e.contentComponent)&&void 0!==t?t:"unknown",h=a?null===(n=a.tab)||void 0===n?void 0:n.id:e.tabComponent,l=new ai(this.accessor,o,d,h),p=new si(o,d,h,this.accessor,new ve(this.accessor),i,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 hi extends m{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(e){}}const li=new class{constructor(){this._orderedList=[]}push(e){this._orderedList=[...this._orderedList.filter((i=>i!==e)),e],this.update()}destroy(e){this._orderedList=this._orderedList.filter((i=>i!==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 pi extends m{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 c,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new c,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})),li.push(this._element)}setVisible(e){e!==this.isVisible&&(this._isVisible=e,D(this.element,"dv-hidden",!this.isVisible))}bringToFront(){li.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 i=this.options.container.getBoundingClientRect(),t=this._element.getBoundingClientRect(),n=Math.max(0,this.getMinimumWidth(t.width)),o=Math.max(0,this.getMinimumHeight(t.height));if("top"===this.verticalAlignment){const e=N(t.top-i.top,-o,Math.max(0,i.height-t.height+o));this._element.style.top=`${e}px`,this._element.style.bottom="auto"}if("bottom"===this.verticalAlignment){const e=N(i.bottom-t.bottom,-o,Math.max(0,i.height-t.height+o));this._element.style.bottom=`${e}px`,this._element.style.top="auto"}if("left"===this.horiziontalAlignment){const e=N(t.left-i.left,-n,Math.max(0,i.width-t.width+n));this._element.style.left=`${e}px`,this._element.style.right="auto"}if("right"===this.horiziontalAlignment){const e=N(i.right-t.right,-n,Math.max(0,i.width-t.width+n));this._element.style.right=`${e}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const e=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),t={};return"top"===this.verticalAlignment?t.top=parseFloat(this._element.style.top):"bottom"===this.verticalAlignment?t.bottom=parseFloat(this._element.style.bottom):t.top=i.top-e.top,"left"===this.horiziontalAlignment?t.left=parseFloat(this._element.style.left):"right"===this.horiziontalAlignment?t.right=parseFloat(this._element.style.right):t.left=i.left-e.left,t.width=i.width,t.height=i.height,t}setupDrag(e,i={inDragMode:!1}){const t=new g,n=()=>{let e=null;const i=k();t.value=new m({dispose:()=>{i.release()}},v(window,"pointermove",(i=>{const t=this.options.container.getBoundingClientRect(),n=i.clientX-t.left,o=i.clientY-t.top;D(this._element,"dv-resize-container-dragging",!0);const s=this._element.getBoundingClientRect();null===e&&(e={x:i.clientX-s.left,y:i.clientY-s.top});const r=Math.max(0,this.getMinimumWidth(s.width)),a=Math.max(0,this.getMinimumHeight(s.height)),d=N(o-e.y,-a,Math.max(0,t.height-s.height+a)),h=N(e.y-o+t.height-s.height,-a,Math.max(0,t.height-s.height+a)),l=N(n-e.x,-r,Math.max(0,t.width-s.width+r)),p=N(e.x-n+t.width-s.width,-r,Math.max(0,t.width-s.width+r)),c={};d<=h?c.top=d:c.bottom=h,l<=p?c.left=l:c.right=p,this.setBounds(c)})),v(window,"pointerup",(()=>{D(this._element,"dv-resize-container-dragging",!1),t.dispose(),this._onDidChangeEnd.fire()})))};this.addDisposables(t,v(e,"pointerdown",(e=>{e.defaultPrevented?e.preventDefault():S(e)||n()})),v(this.options.content,"pointerdown",(e=>{e.defaultPrevented||S(e)||e.shiftKey&&n()})),v(this.options.content,"pointerdown",(()=>{li.push(this._element)}),!0)),i.inDragMode&&n()}setupResize(e){const i=document.createElement("div");i.className=`dv-resize-handle-${e}`,this._element.appendChild(i);const t=new g;this.addDisposables(t,v(i,"pointerdown",(i=>{i.preventDefault();let n=null;const o=k();t.value=new m(v(window,"pointermove",(i=>{const t=this.options.container.getBoundingClientRect(),o=this._element.getBoundingClientRect(),s=i.clientY-t.top,r=i.clientX-t.left;let a,d,h,l,p,c;null===n&&(n={originalY:s,originalHeight:o.height,originalX:r,originalWidth:o.width});const v=()=>{a=N(s,-Number.MAX_VALUE,n.originalY+n.originalHeight>t.height?this.getMinimumHeight(t.height):Math.max(0,n.originalY+n.originalHeight-pi.MINIMUM_HEIGHT)),h=n.originalY+n.originalHeight-a,d=t.height-a-h},u=()=>{a=n.originalY-n.originalHeight,h=N(s-a,a<0&&"number"==typeof this.options.minimumInViewportHeight?-a+this.options.minimumInViewportHeight:pi.MINIMUM_HEIGHT,Number.MAX_VALUE),d=t.height-a-h},m=()=>{l=N(r,-Number.MAX_VALUE,n.originalX+n.originalWidth>t.width?this.getMinimumWidth(t.width):Math.max(0,n.originalX+n.originalWidth-pi.MINIMUM_WIDTH)),c=n.originalX+n.originalWidth-l,p=t.width-l-c},g=()=>{l=n.originalX-n.originalWidth,c=N(r-l,l<0&&"number"==typeof this.options.minimumInViewportWidth?-l+this.options.minimumInViewportWidth:pi.MINIMUM_WIDTH,Number.MAX_VALUE),p=t.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()}},v(window,"pointerup",(()=>{t.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(){li.destroy(this._element),this._element.remove(),super.dispose()}}pi.MINIMUM_HEIGHT=20,pi.MINIMUM_WIDTH=20;class ci extends m{constructor(e,i){super(),this.group=e,this.overlay=i,this.addDisposables(i)}position(e){this.overlay.setBounds(e)}}const vi=100,ui=100,mi=100,gi=300,bi=300;class wi extends m{constructor(i,t){super(),this.element=i,this.accessor=t,this.map={},this._disposed=!1,this.addDisposables(e.DockviewDisposable.from((()=>{for(const e of Object.values(this.map))e.disposable.dispose(),e.destroy.dispose();this._disposed=!0})))}detatch(e){if(this.map[e.api.id]){const{disposable:i,destroy:t}=this.map[e.api.id];return i.dispose(),t.dispose(),delete this.map[e.api.id],!0}return!1}attach(i){const{panel:t,referenceContainer:n}=i;if(!this.map[t.api.id]){const i=function(){const e=document.createElement("div");return e.tabIndex=-1,e}();i.className="dv-render-overlay",this.map[t.api.id]={panel:t,disposable:e.DockviewDisposable.NONE,destroy:e.DockviewDisposable.NONE,element:i}}const o=this.map[t.api.id].element;t.view.content.element.parentElement!==o&&o.appendChild(t.view.content.element),o.parentElement!==this.element&&this.element.appendChild(o);const s=()=>{const e=A(n.element),i=A(this.element);o.style.left=e.left-i.left+"px",o.style.top=e.top-i.top+"px",o.style.width=`${e.width}px`,o.style.height=`${e.height}px`,D(o,"dv-render-overlay-float","floating"===t.group.api.location.type)},r=()=>{t.api.isVisible&&s(),o.style.display=t.api.isVisible?"":"none"},a=new g,d=()=>{"floating"===t.api.location.type?queueMicrotask((()=>{const i=this.accessor.floatingGroups.find((e=>e.group===t.api.group));if(!i)return;const n=i.overlay.element,s=()=>{const e=Number(n.getAttribute("aria-level"));o.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${2*e+1})`},r=new MutationObserver((()=>{s()}));a.value=e.DockviewDisposable.from((()=>r.disconnect())),r.observe(n,{attributeFilter:["aria-level"],attributes:!0}),s()})):o.style.zIndex=""},h=new m(a,new me(o,{onDragEnd:e=>{n.dropTarget.dnd.onDragEnd(e)},onDragEnter:e=>{n.dropTarget.dnd.onDragEnter(e)},onDragLeave:e=>{n.dropTarget.dnd.onDragLeave(e)},onDrop:e=>{n.dropTarget.dnd.onDrop(e)},onDragOver:e=>{n.dropTarget.dnd.onDragOver(e)}}),t.api.onDidVisibilityChange((()=>{r()})),t.api.onDidDimensionsChange((()=>{t.api.isVisible&&s()})),t.api.onDidLocationChange((()=>{d()})));return this.map[t.api.id].destroy=e.DockviewDisposable.from((()=>{var e;t.view.content.element.parentElement===o&&o.removeChild(t.view.content.element),null===(e=o.parentElement)||void 0===e||e.removeChild(o)})),d(),queueMicrotask((()=>{this.isDisposed||r()})),this.map[t.api.id].disposable.dispose(),this.map[t.api.id].disposable=h,o}}function fi(e,i,t,n){return new(t||(t=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 i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t((function(e){e(i)}))).then(r,a)}d((n=n.apply(e,i||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class _i extends m{get window(){var e,i;return null!==(i=null===(e=this._window)||void 0===e?void 0:e.value)&&void 0!==i?i:null}constructor(e,i,t){super(),this.target=e,this.className=i,this.options=t,this._onWillClose=new c,this.onWillClose=this._onWillClose.event,this._onDidClose=new c,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,i;this._window&&(this._onWillClose.fire(),null===(i=(e=this.options).onWillClose)||void 0===i||i.call(e,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var i,t;return fi(this,void 0,void 0,(function*(){if(this._window)throw new Error("instance of popout window is already open");const n=`${this.options.url}`,o=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map((([e,i])=>`${e}=${i}`)).join(","),s=window.open(n,this.target,o);if(!s)return null;const r=new m;this._window={value:s,disposable:r},r.addDisposables(e.DockviewDisposable.from((()=>{s.close()})),v(window,"beforeunload",(()=>{this.close()})));const a=this.createPopoutWindowContainer();return this.className&&a.classList.add(this.className),null===(t=(i=this.options).onDidOpen)||void 0===t||t.call(i,{id:this.target,window:s}),new Promise(((e,i)=>{s.addEventListener("unload",(e=>{})),s.addEventListener("load",(()=>{try{const i=s.document;i.title=document.title,i.body.appendChild(a),function(e,i){const t=Array.from(i);for(const i of t){if(i.href){const t=e.createElement("link");t.href=i.href,t.type=i.type,t.rel="stylesheet",e.head.appendChild(t)}let t=[];try{i.cssRules&&(t=Array.from(i.cssRules).map((e=>e.cssText)))}catch(e){}for(const i of t){const t=e.createElement("style");t.appendChild(e.createTextNode(i)),e.head.appendChild(t)}}}(i,window.document.styleSheets),v(s,"beforeunload",(()=>{this.close()})),e(a)}catch(e){i(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 Di extends m{constructor(e){super(),this.accessor=e,this.init()}init(){const e=new Set,i=new Set;this.addDisposables(this.accessor.onDidAddPanel((i=>{if(e.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${i.api.id} but panel already exists`);e.add(i.api.id)})),this.accessor.onDidRemovePanel((i=>{if(!e.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${i.api.id} but panel does not exists`);e.delete(i.api.id)})),this.accessor.onDidAddGroup((e=>{if(i.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${e.api.id} but group already exists`);i.add(e.api.id)})),this.accessor.onDidRemoveGroup((e=>{if(!i.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${e.api.id} but group does not exists`);i.delete(e.api.id)})))}}class yi extends m{constructor(i){super(),this.root=i,this._active=null,this._activeDisposable=new g,this._element=document.createElement("div"),this._element.className="dv-popover-anchor",this._element.style.position="relative",this.root.prepend(this._element),this.addDisposables(e.DockviewDisposable.from((()=>{this.close()})),this._activeDisposable)}openPopover(e,i){var t;this.close();const n=document.createElement("div");n.style.position="absolute",n.style.zIndex=null!==(t=i.zIndex)&&void 0!==t?t:"var(--dv-overlay-z-index)",n.appendChild(e);const o=this._element.getBoundingClientRect(),s=o.left,r=o.top;n.style.top=i.y-r+"px",n.style.left=i.x-s+"px",this._element.appendChild(n),this._active=n,this._activeDisposable.value=new m(v(window,"pointerdown",(e=>{var i;const t=e.target;if(!(t instanceof HTMLElement))return;let o=t;for(;o&&o!==n;)o=null!==(i=null==o?void 0:o.parentElement)&&void 0!==i?i:null;o||this.close()}))),requestAnimationFrame((()=>{!function(e,i,t={buffer:10}){const n=t.buffer,o=e.getBoundingClientRect(),s=i.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 xi extends m{get disabled(){return this._disabled}set disabled(e){var i;this.disabled!==e&&(this._disabled=e,e&&(null===(i=this.model)||void 0===i||i.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,i)=>{const t=this._outline!==i;if(this._outline=i,this._model)return this._model.changed=t,this._model;const n=this.createContainer(),o=this.createAnchor();if(this._model={root:n,overlay:o,changed:t},n.appendChild(o),this.element.appendChild(n),(null==e?void 0:e.target)instanceof HTMLElement){const i=e.target.getBoundingClientRect(),t=this.element.getBoundingClientRect();o.style.left=i.left-t.left+"px",o.style.top=i.top-t.top+"px"}return this._model}}}constructor(i,t){super(),this.element=i,this._disabled=!1,this._disabled=t.disabled,this.addDisposables(e.DockviewDisposable.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 Ci={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function zi(e){const i=e.from.activePanel;[...e.from.panels].map((i=>{const t=e.from.model.removePanel(i);return e.from.model.renderContainer.detatch(i),t})).forEach((t=>{e.to.model.openPanel(t,{skipSetActive:i!==t,skipSetGroupActive:!0})}))}class Si extends he{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}constructor(i,t){var n,o,s;super(i,{proportionalLayout:!0,orientation:e.Orientation.HORIZONTAL,styles:t.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:t.disableAutoResizing,locked:t.locked,margin:null!==(o=null===(n=t.theme)||void 0===n?void 0:n.gap)&&void 0!==o?o:0,className:t.className}),this.nextGroupId=T(),this._deserializer=new di(this),this._watermark=null,this._onWillDragPanel=new c,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new c,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new c,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new c,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new c,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new c,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new c,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPopoutGroupSizeChange=new c,this.onDidPopoutGroupSizeChange=this._onDidPopoutGroupSizeChange.event,this._onDidPopoutGroupPositionChange=new c,this.onDidPopoutGroupPositionChange=this._onDidPopoutGroupPositionChange.event,this._onDidOpenPopoutWindowFail=new c,this.onDidOpenPopoutWindowFail=this._onDidOpenPopoutWindowFail.event,this._onDidLayoutFromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new c({replay:!0}),this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new c,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new c,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._onDidRemoveGroup=new c,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new c,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidOptionsChange=new c,this.onDidOptionsChange=this._onDidOptionsChange.event,this._onDidActiveGroupChange=new c,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this._options=t,this.popupService=new yi(this.element),this._themeClassnames=new E(this.element),this._api=new ve(this),this.rootDropTargetContainer=new xi(this.element,{disabled:!0}),this.overlayRenderContainer=new wi(this.gridview.element,this),this._rootDropTarget=new De(this.element,{className:"dv-drop-target-edge",canDisplayOverlay:(e,i)=>{const t=r();if(t)return t.viewId===this.id&&("center"!==i||0===this.gridview.length);if("center"===i&&0!==this.gridview.length)return!1;const n=new Fe(e,"edge",i,r);return this._onUnhandledDragOverEvent.fire(n),n.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:null!==(s=t.rootOverlayModel)&&void 0!==s?s:Ci,getOverrideTarget:()=>{var e;return null===(e=this.rootDropTargetContainer)||void 0===e?void 0:e.model}}),this.updateDropTargetModel(t),D(this.gridview.element,"dv-dockview",!0),D(this.element,"dv-debug",!!t.debug),this.updateTheme(),this.updateWatermark(),t.debug&&this.addDisposables(new Di(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})})),e.DockviewEvent.any(this.onDidAdd,this.onDidRemove)((()=>{this.updateWatermark()})),e.DockviewEvent.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange,this.onDidPopoutGroupPositionChange,this.onDidPopoutGroupSizeChange)((()=>{this._bufferOnDidLayoutChange.fire()})),e.DockviewDisposable.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 Ne(e,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:r}))})),this._rootDropTarget.onDrop((e=>{var i;const t=new Xe({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:r,kind:"edge"});if(this._onWillDrop.fire(t),t.defaultPrevented)return;const n=r();n?this.moveGroupOrPanel({from:{groupId:n.groupId,panelId:null!==(i=n.panelId)&&void 0!==i?i:void 0},to:{group:this.orthogonalize(e.position),position:"center"}}):this._onDidDrop.fire(new Ye({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:r}))})),this._rootDropTarget)}setVisible(e,i){switch(e.api.location.type){case"grid":super.setVisible(e,i);break;case"floating":{const t=this.floatingGroups.find((i=>i.group===e));t&&(t.overlay.setVisible(i),e.api._onDidVisibilityChange.fire({isVisible:i}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window")}}addPopoutGroup(i,t){var n,o,s,r,a;if(i instanceof si&&1===i.group.size)return this.addPopoutGroup(i.group,t);const d=function(e){function i(e){const i=[];for(let t=0;t<e.classList.length;t++)i.push(e.classList.item(t));return i}let t,n=e;for(;null!==n&&(t=i(n).find((e=>e.startsWith("dockview-theme-"))),"string"!=typeof t);)n=n.parentElement;return t}(this.gridview.element),h=this.element;const l=(null==t?void 0:t.position)?t.position:i instanceof ti?i.element.getBoundingClientRect():i.group?i.group.element.getBoundingClientRect():h.getBoundingClientRect(),p=null!==(o=null===(n=null==t?void 0:t.overridePopoutGroup)||void 0===n?void 0:n.id)&&void 0!==o?o:this.getNextGroupId(),u=new _i(`${this.id}-${p}`,null!=d?d:"",{url:null!==(a=null!==(s=null==t?void 0:t.popoutUrl)&&void 0!==s?s:null===(r=this.options)||void 0===r?void 0:r.popoutUrl)&&void 0!==a?a:"/popout.html",left:window.screenX+l.left,top:window.screenY+l.top,width:l.width,height:l.height,onDidOpen:null==t?void 0:t.onDidOpen,onWillClose:null==t?void 0:t.onWillClose}),g=new m(u,u.onDidClose((()=>{g.dispose()})));return u.open().then((n=>{var o;if(u.isDisposed)return!1;const s=(null==t?void 0:t.referenceGroup)?t.referenceGroup:i instanceof si?i.group:i,r=i.api.location.type,a=null!==s.element.parentElement;let d;if(a?(null==t?void 0:t.overridePopoutGroup)?d=t.overridePopoutGroup:(d=this.createGroup({id:p}),n&&this._onDidAddGroup.fire(d)):d=s,null===n)return console.error("dockview: failed to create popout. perhaps you need to allow pop-ups for this website"),g.dispose(),this._onDidOpenPopoutWindowFail.fire(),this.movingLock((()=>zi({from:d,to:s}))),s.api.isVisible||s.api.setVisible(!0),!1;const h=document.createElement("div");h.className="dv-overlay-render-container";const l=new wi(h,this);let b;if(d.model.renderContainer=l,d.layout(u.window.innerWidth,u.window.innerHeight),!(null==t?void 0:t.overridePopoutGroup)&&a)if(i instanceof si)this.movingLock((()=>{const e=s.model.removePanel(i);d.model.openPanel(e)}));else switch(this.movingLock((()=>zi({from:s,to:d}))),r){case"grid":s.api.setVisible(!1);break;case"floating":case"popout":b=null===(o=this._floatingGroups.find((e=>e.group.api.id===i.api.id)))||void 0===o?void 0:o.overlay.toJSON(),this.removeGroup(s)}n.classList.add("dv-dockview"),n.style.overflow="hidden",n.appendChild(h),n.appendChild(d.element);const w=document.createElement("div"),f=new xi(w,{disabled:this.rootDropTargetContainer.disabled});let _;n.appendChild(w),d.model.dropTargetContainer=f,d.model.location={type:"popout",getWindow:()=>u.window,popoutUrl:null==t?void 0:t.popoutUrl},a&&"grid"===i.api.location.type&&i.api.setVisible(!1),this.doSetGroupAndPanelActive(d),g.addDisposables(d.api.onDidActiveChange((e=>{var i;e.isActive&&(null===(i=u.window)||void 0===i||i.focus())})),d.api.onWillFocus((()=>{var e;null===(e=u.window)||void 0===e||e.focus()})));const D=a&&s&&this.getPanel(s.id),y={window:u,popoutGroup:d,referenceGroup:D?s.id:void 0,disposable:{dispose:()=>(g.dispose(),_)}},x=function(e){const i=new c;let t,n=e.screenX,o=e.screenY;const s=()=>{if(e.closed)return;const r=e.screenX,a=e.screenY;r===n&&a===o||(clearTimeout(t),t=setTimeout((()=>{i.fire()}),100),n=r,o=a),requestAnimationFrame(s)};return s(),i}(u.window);return g.addDisposables(x,function(e,i){let t;return new m(v(e,"resize",(()=>{clearTimeout(t),t=setTimeout((()=>{i()}),100)})))}(u.window,(()=>{this._onDidPopoutGroupSizeChange.fire({width:u.window.innerWidth,height:u.window.innerHeight,group:d})})),x.event((()=>{this._onDidPopoutGroupPositionChange.fire({screenX:u.window.screenX,screenY:u.window.screenX,group:d})})),v(u.window,"resize",(()=>{d.layout(u.window.innerWidth,u.window.innerHeight)})),l,e.DockviewDisposable.from((()=>{if(!this.isDisposed)if(a&&this.getPanel(s.id))this.movingLock((()=>zi({from:d,to:s}))),s.api.isVisible||s.api.setVisible(!0),this.getPanel(d.id)&&this.doRemoveGroup(d,{skipPopoutAssociated:!0});else if(this.getPanel(d.id)){d.model.renderContainer=this.overlayRenderContainer,d.model.dropTargetContainer=this.rootDropTargetContainer,_=d;if(!this._popoutGroups.find((e=>e.popoutGroup===d)))return;b?this.addFloatingGroup(d,{height:b.height,width:b.width,position:b}):(this.doRemoveGroup(d,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),d.model.location={type:"grid"},this.movingLock((()=>{this.doAddGroup(d,[0])}))),this.doSetGroupAndPanelActive(d)}}))),this._popoutGroups.push(y),this.updateWatermark(),!0})).catch((e=>(console.error("dockview: failed to create popout.",e),!1)))}addFloatingGroup(e,i){var t,n,o,s,r;let a;if(e instanceof si)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===(t=this._popoutGroups.find((e=>e.popoutGroup===a)))||void 0===t?void 0:t.referenceGroup,o=n?this.getPanel(n):void 0;"boolean"==typeof(null==i?void 0:i.skipRemoveGroup)&&i.skipRemoveGroup||(o?(this.movingLock((()=>zi({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==i?void 0:i.position){const e={};return"left"in i.position?e.left=Math.max(i.position.left,0):"right"in i.position?e.right=Math.max(i.position.right,0):e.left=ui,"top"in i.position?e.top=Math.max(i.position.top,0):"bottom"in i.position?e.bottom=Math.max(i.position.bottom,0):e.top=mi,"number"==typeof i.width?e.width=Math.max(i.width,0):e.width=gi,"number"==typeof i.height?e.height=Math.max(i.height,0):e.height=bi,e}return{left:"number"==typeof(null==i?void 0:i.x)?Math.max(i.x,0):ui,top:"number"==typeof(null==i?void 0:i.y)?Math.max(i.y,0):mi,width:"number"==typeof(null==i?void 0:i.width)?Math.max(i.width,0):gi,height:"number"==typeof(null==i?void 0:i.height)?Math.max(i.height,0):bi}}(),h=new pi(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:vi,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:vi})),l=a.element.querySelector(".dv-void-container");if(!l)throw new Error("failed to find drag handle");h.setupDrag(l,{inDragMode:"boolean"==typeof(null==i?void 0:i.inDragMode)&&i.inDragMode});const p=new ci(a,h),c=new m(a.api.onDidActiveChange((e=>{e.isActive&&h.bringToFront()})),w(a.element,(e=>{const{width:i,height:t}=e.contentRect;a.layout(i,t)})));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(),V(this._floatingGroups,p),a.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(p),a.model.location={type:"floating"},(null==i?void 0:i.skipActiveGroup)||this.doSetGroupAndPanelActive(a),this.updateWatermark()}orthogonalize(i,t){switch(i){case"top":case"bottom":this.gridview.orientation===e.Orientation.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===e.Orientation.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot()}switch(i){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 ${i}`)}}updateOptions(e){var i,t;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=vi,n.overlay.minimumInViewportWidth=vi;break;default:n.overlay.minimumInViewportHeight=null===(i=e.floatingGroupBounds)||void 0===i?void 0:i.minimumHeightWithinViewport,n.overlay.minimumInViewportWidth=null===(t=e.floatingGroupBounds)||void 0===t?void 0:t.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,i,t){if(super.layout(e,i,t),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((i=>i.id===e))}setActivePanel(e){e.group.model.openPanel(e),this.doSetGroupAndPanelActive(e.group)}moveToNext(e={}){var i;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 t=K(e.group.element),n=null===(i=this.gridview.next(t))||void 0===i?void 0:i.view;this.doSetGroupAndPanelActive(n)}moveToPrevious(e={}){var i;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 t=K(e.group.element),n=null===(i=this.gridview.previous(t))||void 0===i?void 0:i.view;n&&this.doSetGroupAndPanelActive(n)}toJSON(){var e;const i=this.gridview.serialize(),t=this.panels.reduce(((e,i)=>(e[i.id]=i.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:i,panels:t,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 i,t;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:i,locked:t,hideHeader:n,views:s,activeView:r}=e;if("string"!=typeof i)throw new Error("group id must be of type string");const a=this.createGroup({id:i,locked:!!t,hideHeader:!!n});this._onDidAddGroup.fire(a);const d=[];for(const e of s){const i=this._deserializer.fromJSON(o[e],a);d.push(i)}for(let e=0;e<s.length;e++){const i=d[e],t="string"==typeof r&&r===i.id;a.model.openPanel(i,{skipSetActive:!t,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!==(i=e.floatingGroups)&&void 0!==i?i:[];for(const e of h){const{data:i,position:t}=e,n=d(i);this.addFloatingGroup(n,{position:t,width:t.width,height:t.height,skipRemoveGroup:!0,inDragMode:!1})}const l=null!==(t=e.popoutGroups)&&void 0!==t?t:[];for(const e of l){const{data:i,position:t,gridReferenceGroup:n,url:o}=e,s=d(i);this.addPopoutGroup(s,{position:null!=t?t:void 0,overridePopoutGroup:n?s:void 0,referenceGroup:n?this.getPanel(n):void 0,popoutUrl:o})}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 i of e.panels)this.removePanel(i,{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(),this._onDidLayoutFromJSON.fire()}clear(){const e=Array.from(this._groups.values()).map((e=>e.value)),i=!!this.activeGroup;for(const i of e)this.removeGroup(i,{skipActive:!0});i&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const e of this._groups.entries()){const[i,t]=e;t.value.model.closeAllPanels()}}addPanel(i){var t,n;if(this.panels.find((e=>e.id===i.id)))throw new Error(`panel with id ${i.id} already exists`);let o;if(i.position&&i.floating)throw new Error("you can only provide one of: position, floating as arguments to .addPanel(...)");const s={width:i.initialWidth,height:i.initialHeight};let r,a;if(i.position)if(Ue(i.position)){const e="string"==typeof i.position.referencePanel?this.getGroupPanel(i.position.referencePanel):i.position.referencePanel;if(r=i.position.index,!e)throw new Error(`referencePanel '${i.position.referencePanel}' does not exist`);o=this.findGroup(e)}else{if(!$e(i.position)){const e=this.orthogonalize(be(i.position.direction)),t=this.createPanel(i,e);return e.model.openPanel(t,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),i.inactive||this.doSetGroupAndPanelActive(e),e.api.setSize({height:null==s?void 0:s.height,width:null==s?void 0:s.width}),t}if(o="string"==typeof i.position.referenceGroup?null===(t=this._groups.get(i.position.referenceGroup))||void 0===t?void 0:t.value:i.position.referenceGroup,r=i.position.index,!o)throw new Error(`referenceGroup '${i.position.referenceGroup}' does not exist`)}else o=this.activeGroup;if(o){const t=de((null===(n=i.position)||void 0===n?void 0:n.direction)||"within");if(i.floating){const e=this.createGroup();this._onDidAddGroup.fire(e);const t="object"==typeof i.floating&&null!==i.floating?i.floating:{};this.addFloatingGroup(e,Object.assign(Object.assign({},t),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(i,e),e.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r})}else if("floating"===o.api.location.type||"center"===t)a=this.createPanel(i,o),o.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),o.api.setSize({width:null==s?void 0:s.width,height:null==s?void 0:s.height}),i.inactive||this.doSetGroupAndPanelActive(o);else{const n=K(o.element),d=q(this.gridview.orientation,n,t),h=this.createGroupAtLocation(d,this.orientationAtLocation(d)===e.Orientation.VERTICAL?null==s?void 0:s.height:null==s?void 0:s.width);a=this.createPanel(i,h),h.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),i.inactive||this.doSetGroupAndPanelActive(h)}}else if(i.floating){const e=this.createGroup();this._onDidAddGroup.fire(e);const t="object"==typeof i.floating&&null!==i.floating?i.floating:{};this.addFloatingGroup(e,Object.assign(Object.assign({},t),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(i,e),e.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r})}else{const t=this.createGroupAtLocation([0],this.gridview.orientation===e.Orientation.VERTICAL?null==s?void 0:s.height:null==s?void 0:s.width);a=this.createPanel(i,t),t.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),i.inactive||this.doSetGroupAndPanelActive(t)}return a}removePanel(e,i={removeEmptyGroup:!0}){const t=e.group;if(!t)throw new Error(`cannot remove panel ${e.id}. it's missing a group.`);t.model.removePanel(e,{skipSetActiveGroup:i.skipSetActiveGroup}),i.skipDispose||(e.group.model.renderContainer.detatch(e),e.dispose()),0===t.size&&i.removeEmptyGroup&&this.removeGroup(t,{skipActive:i.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new hi}updateWatermark(){var e,i,t;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 ve(this)});const e=document.createElement("div");e.className="dv-watermark-container",t="watermark-component",e.setAttribute("data-testid",t),e.appendChild(this._watermark.element),this.gridview.element.appendChild(e)}}else this._watermark&&(this._watermark.element.parentElement.remove(),null===(i=(e=this._watermark).dispose)||void 0===i||i.call(e),this._watermark=null)}addGroup(i){var t;if(i){let n;if(je(i)){const e="string"==typeof i.referencePanel?this.panels.find((e=>e.id===i.referencePanel)):i.referencePanel;if(!e)throw new Error(`reference panel ${i.referencePanel} does not exist`);if(n=this.findGroup(e),!n)throw new Error(`reference group for reference panel ${i.referencePanel} does not exist`)}else{if(!Ze(i)){const e=this.orthogonalize(be(i.direction),i);return i.skipSetActive||this.doSetGroupAndPanelActive(e),e}if(n="string"==typeof i.referenceGroup?null===(t=this._groups.get(i.referenceGroup))||void 0===t?void 0:t.value:i.referenceGroup,!n)throw new Error(`reference group ${i.referenceGroup} does not exist`)}const o=de(i.direction||"within"),s=K(n.element),r=q(this.gridview.orientation,s,o),a=this.createGroup(i),d=this.getLocationOrientation(r)===e.Orientation.VERTICAL?i.initialHeight:i.initialWidth;return this.doAddGroup(a,r,d),i.skipSetActive||this.doSetGroupAndPanelActive(a),a}{const e=this.createGroup(i);return this.doAddGroup(e),this.doSetGroupAndPanelActive(e),e}}getLocationOrientation(i){return i.length%2==0&&this.gridview.orientation===e.Orientation.HORIZONTAL?e.Orientation.HORIZONTAL:e.Orientation.VERTICAL}removeGroup(e,i){this.doRemoveGroup(e,i)}doRemoveGroup(e,i){var t;const n=[...e.panels];if(!(null==i?void 0:i.skipDispose))for(const e of n)this.removePanel(e,{removeEmptyGroup:!1,skipDispose:null!==(t=null==i?void 0:i.skipDispose)&&void 0!==t&&t});const o=this.activePanel;if("floating"===e.api.location.type){const t=this._floatingGroups.find((i=>i.group===e));if(t){if((null==i?void 0:i.skipDispose)||(t.group.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)),V(this._floatingGroups,t),t.dispose(),!(null==i?void 0:i.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return t.group}throw new Error("failed to find floating group")}if("popout"===e.api.location.type){const t=this._popoutGroups.find((i=>i.popoutGroup===e));if(t){if(!(null==i?void 0:i.skipDispose)){if(!(null==i?void 0:i.skipPopoutAssociated)){const e=t.referenceGroup?this.getPanel(t.referenceGroup):void 0;e&&0===e.panels.length&&this.removeGroup(e)}t.popoutGroup.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)}V(this._popoutGroups,t);const n=t.disposable.dispose();if(!(null==i?void 0:i.skipPopoutReturn)&&n&&(this.doAddGroup(n,[0]),this.doSetGroupAndPanelActive(n)),!(null==i?void 0:i.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return this.updateWatermark(),t.popoutGroup}throw new Error("failed to find popout group")}const s=super.doRemoveGroup(e,i);return(null==i?void 0:i.skipActive)||this.activePanel!==o&&this._onDidActivePanelChange.fire(this.activePanel),s}movingLock(e){const i=this._moving;try{return this._moving=!0,e()}finally{this._moving=i}}moveGroupOrPanel(e){var i;const t=e.to.group,n=e.from.groupId,o=e.from.panelId,s=e.to.position,r=e.to.index,a=n?null===(i=this._groups.get(n))||void 0===i?void 0:i.value:void 0;if(!a)throw new Error(`Failed to find group id ${n}`);if(void 0!==o)if(s&&"center"!==s){const e=K(t.element),i=q(this.gridview.orientation,e,s);if(a.size<2){const[e,n]=P(i);if("grid"===a.api.location.type){const i=K(a.element),[t,s]=P(i);if(O(t,e))return this.gridview.moveView(t,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)),t=this.movingLock((()=>e.popoutGroup.model.removePanel(e.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0})));this.doRemoveGroup(a,{skipActive:!0});const n=this.createGroupAtLocation(i);return this.movingLock((()=>n.model.openPanel(t))),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=K(t.element),h=q(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 i=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!i)throw new Error(`No panel with id ${o}`);const t=q(this.gridview.orientation,e,s),n=this.createGroupAtLocation(t);this.movingLock((()=>n.model.openPanel(i,{skipSetGroupActive:!0}))),this.doSetGroupAndPanelActive(n),this._onDidMovePanel.fire({panel:i,from:a})}}else{const i=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!i)throw new Error(`No panel with id ${o}`);0===a.model.size&&this.doRemoveGroup(a,{skipActive:!0}),this.movingLock((()=>{var n;return t.model.openPanel(i,{index:r,skipSetActive:null!==(n=e.skipSetActive)&&void 0!==n&&n,skipSetGroupActive:!0})})),e.skipSetActive||this.doSetGroupAndPanelActive(t),this._onDidMovePanel.fire({panel:i,from:a})}else this.moveGroup({from:{group:a},to:{group:t,position:s},skipSetActive:e.skipSetActive})}moveGroup(i){const t=i.from.group,n=i.to.group,o=i.to.position;if("center"===o){const e=t.activePanel,o=n.activePanel,s=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 s)n.model.openPanel(e,{skipSetActive:!0,skipSetGroupActive:!0})})),i.skipSetActive?o&&n.model.openPanel(o,{skipSetGroupActive:!0}):e&&this.doSetGroupAndPanelActive(n)}else{switch(t.api.location.type){case"grid":this.gridview.removeView(K(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 i=this._popoutGroups.indexOf(e);if(i>=0&&this._popoutGroups.splice(i,1),e.referenceGroup){const i=this.getPanel(e.referenceGroup);i&&!i.api.isVisible&&this.doRemoveGroup(i,{skipActive:!0})}e.window.dispose(),"grid"===n.api.location.type?(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"grid"}):"floating"===n.api.location.type&&(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"floating"});break}}if("grid"===n.api.location.type){const i=K(n.element),s=q(this.gridview.orientation,i,o);let r;switch(this.gridview.orientation){case e.Orientation.VERTICAL:r=i.length%2==0?t.api.width:t.api.height;break;case e.Orientation.HORIZONTAL:r=i.length%2==0?t.api.height:t.api.width}this.gridview.addView(t,r,s)}else if("floating"===n.api.location.type){const e=this._floatingGroups.find((e=>e.group===n));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}})}}}t.panels.forEach((e=>{this._onDidMovePanel.fire({panel:e,from:t})})),i.skipSetActive||this.doSetGroupAndPanelActive(t)}doSetGroupActive(e){super.doSetGroupActive(e);const i=this.activePanel;this._moving||i===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(i)}doSetGroupAndPanelActive(e){super.doSetGroupActive(e);const i=this.activePanel;e&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(e)&&this.exitMaximizedGroup(),this._moving||i===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(i)}getNextGroupId(){let e=this.nextGroupId.next();for(;this._groups.has(e);)e=this.nextGroupId.next();return e}createGroup(i){i||(i={});let t=null==i?void 0:i.id;if(t&&this._groups.has(i.id)&&(console.warn(`dockview: Duplicate group id ${null==i?void 0:i.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 n=new ti(this,t,i);if(n.init({params:{},accessor:this}),!this._groups.has(n.id)){const i=new m(n.model.onTabDragStart((e=>{this._onWillDragPanel.fire(e)})),n.model.onGroupDragStart((e=>{this._onWillDragGroup.fire(e)})),n.model.onMove((e=>{const{groupId:i,itemId:t,target:o,index:s}=e;this.moveGroupOrPanel({from:{groupId:i,panelId:t},to:{group:n,position:o,index:s}})})),n.model.onDidDrop((e=>{this._onDidDrop.fire(e)})),n.model.onWillDrop((e=>{this._onWillDrop.fire(e)})),n.model.onWillShowOverlay((e=>{this.options.disableDnd?e.preventDefault():this._onWillShowOverlay.fire(e)})),n.model.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})),n.model.onDidAddPanel((e=>{this._moving||this._onDidAddPanel.fire(e.panel)})),n.model.onDidRemovePanel((e=>{this._moving||this._onDidRemovePanel.fire(e.panel)})),n.model.onDidActivePanelChange((e=>{this._moving||e.panel===this.activePanel&&this._onDidActivePanelChange.value!==e.panel&&this._onDidActivePanelChange.fire(e.panel)})),e.DockviewEvent.any(n.model.onDidPanelTitleChange,n.model.onDidPanelParametersChange)((()=>{this._bufferOnDidLayoutChange.fire()})));this._groups.set(n.id,{value:n,disposable:i})}return n.initialize(),n}createPanel(e,i){var t,n,o;const s=e.component,r=null!==(t=e.tabComponent)&&void 0!==t?t:this.options.defaultTabComponent,a=new ai(this,e.id,s,r),d=new si(e.id,s,r,this,this._api,i,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,i,t){const n=this.createGroup(t);return this.doAddGroup(n,e,i),n}findGroup(e){var i;return null===(i=Array.from(this._groups.values()).find((i=>i.value.model.containsPanel(e))))||void 0===i?void 0:i.value}orientationAtLocation(e){const i=this.gridview.orientation;return e.length%2==1?i:ie(i)}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(Ci)),"rootOverlayModel"in e&&this.updateDropTargetModel({dndEdges:e.dndEdges})}updateTheme(){var e,i;const t=null!==(e=this._options.theme)&&void 0!==e?e:ni;if(this._themeClassnames.setClassNames(t.className),this.gridview.margin=null!==(i=t.gap)&&void 0!==i?i:0,"absolute"===t.dndOverlayMounting)this.rootDropTargetContainer.disabled=!1;else this.rootDropTargetContainer.disabled=!0}}class Ai extends he{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,i){var t;super(e,{proportionalLayout:null===(t=i.proportionalLayout)||void 0===t||t,orientation:i.orientation,styles:i.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:i.disableAutoResizing,className:i.className}),this._onDidLayoutfromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidRemoveGroup=new c,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new c,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new c,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._options=i,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 i="string"==typeof e.orientation&&this.gridview.orientation!==e.orientation;this._options=Object.assign(Object.assign({},this.options),e),i&&(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,i){this.gridview.setViewVisible(K(e.element),i)}setActive(e){this._groups.forEach(((i,t)=>{i.value.setActive(e===i.value)}))}focus(){var e;null===(e=this.activeGroup)||void 0===e||e.focus()}fromJSON(e){this.clear();const{grid:i,activePanel:t}=e;try{const e=[],n=this.width,o=this.height;if(this.gridview.deserialize(i,{fromJSON:i=>{const{data:t}=i,n=this.options.createComponent({id:t.id,name:t.component});return e.push((()=>n.init({params:t.params,minimumWidth:t.minimumWidth,maximumWidth:t.maximumWidth,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,priority:t.priority,snap:!!t.snap,accessor:this,isVisible:i.visible}))),this._onDidAddGroup.fire(n),this.registerPanel(n),n}}),this.layout(n,o,!0),e.forEach((e=>e())),"string"==typeof t){const e=this.getPanel(t);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,i=Array.from(this._groups.values());for(const e of i)e.disposable.dispose(),this.doRemoveGroup(e.value,{skipActive:!0});e&&this.doSetGroupActive(void 0),this.gridview.clear()}movePanel(e,i){var t;let n;const o=this.gridview.remove(e),s=null===(t=this._groups.get(i.reference))||void 0===t?void 0:t.value;if(!s)throw new Error(`reference group ${i.reference} does not exist`);const r=de(i.direction);if("center"===r)throw new Error(`${r} not supported as an option`);{const e=K(s.element);n=q(this.gridview.orientation,e,r)}this.doAddGroup(o,n,i.size)}addPanel(e){var i,t,n,o;let s=null!==(i=e.location)&&void 0!==i?i:[0];if(null===(t=e.position)||void 0===t?void 0:t.referencePanel){const i=null===(n=this._groups.get(e.position.referencePanel))||void 0===n?void 0:n.value;if(!i)throw new Error(`reference group ${e.position.referencePanel} does not exist`);const t=de(e.position.direction);if("center"===t)throw new Error(`${t} not supported as an option`);{const e=K(i.element);s=q(this.gridview.orientation,e,t)}}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.registerPanel(r),this.doAddGroup(r,s,e.size),this.doSetGroupActive(r),r}registerPanel(e){const i=new m(e.api.onDidFocusChange((i=>{i.isFocused&&this._groups.forEach((i=>{const t=i.value;t!==e?t.setActive(!1):t.setActive(!0)}))})));this._groups.set(e.id,{value:e,disposable:i})}moveGroup(e,i,t){const n=this.getPanel(i);if(!n)throw new Error("invalid operation");const o=K(e.element),s=q(this.gridview.orientation,o,t),[r,a]=P(s),d=K(n.element),[h,l]=P(d);if(O(h,r))return void this.gridview.moveView(h,l,a);const p=this.doRemoveGroup(n,{skipActive:!0,skipDispose:!0}),c=K(e.element),v=q(this.gridview.orientation,c,t);this.doAddGroup(p,v)}removeGroup(e){super.removeGroup(e)}dispose(){super.dispose(),this._onDidLayoutfromJSON.dispose()}}class ki extends re{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 m(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===e.Orientation.HORIZONTAL?this.splitview.orthogonalSize:this.splitview.size}get width(){return this.splitview.orientation===e.Orientation.HORIZONTAL?this.splitview.size:this.splitview.orthogonalSize}constructor(e,i){var t;super(document.createElement("div"),i.disableAutoResizing),this._splitviewChangeDisposable=new g,this._panels=new Map,this._onDidLayoutfromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidAddView=new c,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new c,this.onDidRemoveView=this._onDidRemoveView.event,this._onDidLayoutChange=new c,this.onDidLayoutChange=this._onDidLayoutChange.event,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new E(this.element),this._classNames.setClassNames(null!==(t=i.className)&&void 0!==t?t:""),e.appendChild(this.element),this._options=i,this.splitview=new F(this.element,i),this.addDisposables(this._onDidAddView,this._onDidLayoutfromJSON,this._onDidRemoveView,this._onDidLayoutChange)}updateOptions(e){var i,t;"className"in e&&this._classNames.setClassNames(null!==(i=e.className)&&void 0!==i?i:""),"disableResizing"in e&&(this.disableResizing=null!==(t=e.disableAutoResizing)&&void 0!==t&&t),"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,i){this.splitview.moveView(e,i)}setVisible(e,i){const t=this.panels.indexOf(e);this.splitview.setViewVisible(t,i)}setActive(e,i){this._activePanel=e,this.panels.filter((i=>i!==e)).forEach((e=>{e.api._onDidActiveChange.fire({isActive:!1}),i||e.focus()})),e.api._onDidActiveChange.fire({isActive:!0}),i||e.focus()}removePanel(e,i){const t=this._panels.get(e.id);if(!t)throw new Error(`unknown splitview panel ${e.id}`);t.dispose(),this._panels.delete(e.id);const n=this.panels.findIndex((i=>i===e));this.splitview.removeView(n,i).dispose();const o=this.panels;o.length>0&&this.setActive(o[o.length-1])}getPanel(e){return this.panels.find((i=>i.id===e))}addPanel(i){var t;if(this._panels.has(i.id))throw new Error(`panel ${i.id} already exists`);const n=this.options.createComponent({id:i.id,name:i.component});n.orientation=this.splitview.orientation,n.init({params:null!==(t=i.params)&&void 0!==t?t:{},minimumSize:i.minimumSize,maximumSize:i.maximumSize,snap:i.snap,priority:i.priority,accessor:this});const o="number"==typeof i.size?i.size:e.Sizing.Distribute,s="number"==typeof i.index?i.index:void 0;return this.splitview.addView(n,o,s),this.doAddView(n),this.setActive(n),n}layout(i,t){const[n,o]=this.splitview.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];this.splitview.layout(n,o)}doAddView(e){const i=e.api.onDidFocusChange((i=>{i.isFocused&&this.setActive(e,!0)}));this._panels.set(e.id,i)}toJSON(){var e;return{views:this.splitview.getViews().map(((e,i)=>({size:this.splitview.getViewSize(i),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:i,orientation:t,size:n,activeView:o}=e,s=[],r=this.width,a=this.height;if(this.splitview=new F(this.element,{orientation:t,proportionalLayout:this.options.proportionalLayout,descriptor:{size:n,views:i.map((e=>{const i=e.data;if(this._panels.has(i.id))throw new Error(`panel ${i.id} already exists`);const n=this.options.createComponent({id:i.id,name:i.component});return s.push((()=>{var t;n.init({params:null!==(t=i.params)&&void 0!==t?t:{},minimumSize:i.minimumSize,maximumSize:i.maximumSize,snap:e.snap,priority:e.priority,accessor:this})})),n.orientation=t,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,e.Sizing.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 i of e)i.dispose();this.element.remove(),super.dispose()}}class Ei extends m{get element(){return this._element}constructor(){super(),this._expandedIcon=We({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=He(),this.disposable=new g,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(v(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 i=!!(null===(e=this.apiRef.api)||void 0===e?void 0:e.isExpanded);D(this._expander,"collapsed",!i),i?(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 Pi=T(),Oi=Number.MAX_SAFE_INTEGER;class Gi extends Pe{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 Ii extends re{get id(){return this._id}get panels(){return this.paneview.getPanes()}set paneview(e){this._paneview=e,this._disposable.value=new m(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===e.Orientation.HORIZONTAL?this.paneview.orthogonalSize:this.paneview.size}get width(){return this.paneview.orientation===e.Orientation.HORIZONTAL?this.paneview.size:this.paneview.orthogonalSize}get options(){return this._options}constructor(i,t){var n;super(document.createElement("div"),t.disableAutoResizing),this._id=Pi.next(),this._disposable=new g,this._viewDisposables=new Map,this._onDidLayoutfromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidLayoutChange=new c,this.onDidLayoutChange=this._onDidLayoutChange.event,this._onDidDrop=new c,this.onDidDrop=this._onDidDrop.event,this._onDidAddView=new c,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new c,this.onDidRemoveView=this._onDidRemoveView.event,this._onUnhandledDragOverEvent=new c,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 E(this.element),this._classNames.setClassNames(null!==(n=t.className)&&void 0!==n?n:""),i.appendChild(this.element),this._options=t,this.paneview=new U(this.element,{orientation:e.Orientation.VERTICAL}),this.addDisposables(this._disposable)}setVisible(e,i){const t=this.panels.indexOf(e);this.paneview.setViewVisible(t,i)}focus(){}updateOptions(e){var i,t;"className"in e&&this._classNames.setClassNames(null!==(i=e.className)&&void 0!==i?i:""),"disableResizing"in e&&(this.disableResizing=null!==(t=e.disableAutoResizing)&&void 0!==t&&t),this._options=Object.assign(Object.assign({},this.options),e)}addPanel(i){var t,n;const o=this.options.createComponent({id:i.id,name:i.component});let s;i.headerComponent&&this.options.createHeaderComponent&&(s=this.options.createHeaderComponent({id:i.id,name:i.headerComponent})),s||(s=new Ei);const r=new Gi({id:i.id,component:i.component,headerComponent:i.headerComponent,header:s,body:o,orientation:e.Orientation.VERTICAL,isExpanded:!!i.isExpanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=i.headerSize)&&void 0!==t?t:22,minimumBodySize:0,maximumBodySize:Oi});this.doAddPanel(r);const a="number"==typeof i.size?i.size:e.Sizing.Distribute,d="number"==typeof i.index?i.index:void 0;return r.init({params:null!==(n=i.params)&&void 0!==n?n:{},minimumBodySize:i.minimumBodySize,maximumBodySize:i.maximumBodySize,isExpanded:i.isExpanded,title:i.title,containerApi:new pe(this),accessor:this}),this.paneview.addPane(r,a,d),r.orientation=this.paneview.orientation,r}removePanel(e){const i=this.panels.findIndex((i=>i===e));this.paneview.removePane(i),this.doRemovePanel(e)}movePanel(e,i){this.paneview.moveView(e,i)}getPanel(e){return this.panels.find((i=>i.id===e))}layout(i,t){const[n,o]=this.paneview.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];this.paneview.layout(n,o)}toJSON(){const e=e=>e===Number.MAX_SAFE_INTEGER||e===Number.POSITIVE_INFINITY?void 0:e;return{views:this.paneview.getPanes().map(((i,t)=>{return{size:this.paneview.getViewSize(t),data:i.toJSON(),minimumSize:(n=i.minimumBodySize,n<=0?void 0:n),maximumSize:e(i.maximumBodySize),headerSize:i.headerSize,expanded:i.isExpanded()};var n})),size:this.paneview.size}}fromJSON(i){this.clear();const{views:t,size:n}=i,o=[],s=this.width,r=this.height;this.paneview=new U(this.element,{orientation:e.Orientation.VERTICAL,descriptor:{size:n,views:t.map((i=>{var t,n,s;const r=i.data,a=this.options.createComponent({id:r.id,name:r.component});let d;r.headerComponent&&this.options.createHeaderComponent&&(d=this.options.createHeaderComponent({id:r.id,name:r.headerComponent})),d||(d=new Ei);const h=new Gi({id:r.id,component:r.component,headerComponent:r.headerComponent,header:d,body:a,orientation:e.Orientation.VERTICAL,isExpanded:!!i.expanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=i.headerSize)&&void 0!==t?t:22,minimumBodySize:null!==(n=i.minimumSize)&&void 0!==n?n:0,maximumBodySize:null!==(s=i.maximumSize)&&void 0!==s?s:Oi});return this.doAddPanel(h),o.push((()=>{var e;h.init({params:null!==(e=r.params)&&void 0!==e?e:{},minimumBodySize:i.minimumSize,maximumBodySize:i.maximumSize,title:r.title,isExpanded:!!i.expanded,containerApi:new pe(this),accessor:this}),h.orientation=this.paneview.orientation})),setTimeout((()=>{this._onDidAddView.fire(h)}),0),{size:i.size,view:h}}))}}),this.layout(s,r),o.forEach((e=>e())),this._onDidLayoutfromJSON.fire()}clear(){for(const[e,i]of this._viewDisposables.entries())i.dispose();this._viewDisposables.clear(),this.paneview.dispose()}doAddPanel(e){const i=new m(e.onDidDrop((e=>{this._onDidDrop.fire(e)})),e.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})));this._viewDisposables.set(e.id,i)}doRemovePanel(e){const i=this._viewDisposables.get(e.id);i&&(i.dispose(),this._viewDisposables.delete(e.id))}dispose(){super.dispose();for(const[e,i]of this._viewDisposables.entries())i.dispose();this._viewDisposables.clear(),this.element.remove(),this.paneview.dispose()}}e.BaseGrid=he,e.ContentContainer=Oe,e.DefaultDockviewDeserialzier=di,e.DefaultTab=ri,e.DockviewApi=ve,e.DockviewComponent=Si,e.DockviewCompositeDisposable=m,e.DockviewDidDropEvent=Ye,e.DockviewEmitter=c,e.DockviewGroupPanel=ti,e.DockviewGroupPanelModel=Ke,e.DockviewMutableDisposable=g,e.DockviewPanel=si,e.DockviewUnhandledDragOverEvent=Fe,e.DockviewWillDropEvent=Xe,e.DraggablePaneviewPanel=Pe,e.Gridview=oe,e.GridviewApi=ce,e.GridviewComponent=Ai,e.GridviewPanel=Qe,e.PROPERTY_KEYS_DOCKVIEW=Je,e.PROPERTY_KEYS_GRIDVIEW=se,e.PROPERTY_KEYS_PANEVIEW=ye,e.PROPERTY_KEYS_SPLITVIEW=J,e.PaneFramework=Gi,e.PaneTransfer=o,e.PanelTransfer=n,e.Paneview=U,e.PaneviewApi=pe,e.PaneviewComponent=Ii,e.PaneviewPanel=Ee,e.PaneviewUnhandledDragOverEvent=xe,e.Splitview=F,e.SplitviewApi=le,e.SplitviewComponent=ki,e.SplitviewPanel=class extends ke{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,i){super(e,i,new Se(e,i)),this._evaluatedMinimumSize=0,this._evaluatedMaximumSize=Number.POSITIVE_INFINITY,this._minimumSize=0,this._maximumSize=Number.POSITIVE_INFINITY,this._snap=!1,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this.api.initialize(this),this.addDisposables(this._onDidChange,this.api.onWillVisibilityChange((e=>{const{isVisible:i}=e,{accessor:t}=this._params;t.setVisible(this,i)})),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(i,t){const[n,o]=this.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];super.layout(n,o)}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})}},e.Tab=Ve,e.createDockview=function(e,i){return new Si(e,i).api},e.createGridview=function(e,i){const t=new Ai(e,i);return new ce(t)},e.createPaneview=function(e,i){const t=new Ii(e,i);return new pe(t)},e.createSplitview=function(e,i){const t=new ki(e,i);return new le(t)},e.directionToPosition=be,e.getDirectionOrientation=Q,e.getGridLocation=K,e.getLocationOrientation=ee,e.getPaneData=a,e.getPanelData=r,e.getRelativeLocation=q,e.indexInParent=X,e.isGridBranchNode=te,e.isGroupOptionsWithGroup=Ze,e.isGroupOptionsWithPanel=je,e.isPanelOptionsWithGroup=$e,e.isPanelOptionsWithPanel=Ue,e.orthogonal=ie,e.positionToDirection=we,e.themeAbyss=ni,e.themeAbyssSpaced={name:"abyssSpaced",className:"dockview-theme-abyss-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"},e.themeDark={name:"dark",className:"dockview-theme-dark"},e.themeDracula={name:"dracula",className:"dockview-theme-dracula"},e.themeLight={name:"light",className:"dockview-theme-light"},e.themeLightSpaced={name:"lightSpaced",className:"dockview-theme-light-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"},e.themeReplit={name:"replit",className:"dockview-theme-replit",gap:10},e.themeVisualStudio={name:"visualStudio",className:"dockview-theme-vs"},e.toTarget=de}));
|
|
7
|
+
define(["exports"],(function(e){"use strict";var i;!function(e,i){void 0===i&&(i={});var t=i.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&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 t{}class n extends t{constructor(e,i,t){super(),this.viewId=e,this.groupId=i,this.panelId=t}}class o extends t{constructor(e,i){super(),this.viewId=e,this.paneId=i}}class s{constructor(){}static getInstance(){return s.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,i){i&&(this.data=e,this.proto=i)}}function r(){const e=s.getInstance();if(e.hasData(n.prototype))return e.getData(n.prototype)[0]}function a(){const e=s.getInstance();if(e.hasData(o.prototype))return e.getData(o.prototype)[0]}s.INSTANCE=new s,e.DockviewEvent=void 0,(e.DockviewEvent||(e.DockviewEvent={})).any=(...e)=>i=>{const t=e.map((e=>e(i)));return{dispose:()=>{t.forEach((e=>{e.dispose()}))}}};class d{constructor(){this._defaultPrevented=!1}get defaultPrevented(){return this._defaultPrevented}preventDefault(){this._defaultPrevented=!0}}class h{constructor(){this._isAccepted=!1}get isAccepted(){return this._isAccepted}accept(){this._isAccepted=!0}}class l{static create(){var e;return new l(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn("dockview: stacktrace",this.value)}}class p{constructor(e,i){this.callback=e,this.stacktrace=i}}class c{static setLeakageMonitorEnabled(e){e!==c.ENABLE_TRACKING&&c.MEMORY_LEAK_WATCHER.clear(),c.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 i;(null===(i=this.options)||void 0===i?void 0:i.replay)&&void 0!==this._last&&e(this._last);const t=new p(e,c.ENABLE_TRACKING?l.create():void 0);return this._listeners.push(t),{dispose:()=>{const e=this._listeners.indexOf(t);e>-1?this._listeners.splice(e,1):c.ENABLE_TRACKING}}},c.ENABLE_TRACKING&&c.MEMORY_LEAK_WATCHER.add(this._event,l.create())),this._event}fire(e){var i;(null===(i=this.options)||void 0===i?void 0:i.replay)&&(this._last=e);for(const i of this._listeners)i.callback(e)}dispose(){this._disposed||(this._disposed=!0,this._listeners.length>0&&(c.ENABLE_TRACKING&&queueMicrotask((()=>{var e;for(const i of this._listeners)console.warn("dockview: stacktrace",null===(e=i.stacktrace)||void 0===e?void 0:e.print())})),this._listeners=[]),c.ENABLE_TRACKING&&this._event&&c.MEMORY_LEAK_WATCHER.delete(this._event))}}function v(e,i,t,n){return e.addEventListener(i,t,n),{dispose:()=>{e.removeEventListener(i,t,n)}}}c.ENABLE_TRACKING=!1,c.MEMORY_LEAK_WATCHER=new class{constructor(){this.events=new Map}get size(){return this.events.size}add(e,i){this.events.set(e,i)}delete(e){this.events.delete(e)}clear(){this.events.clear()}};class u{constructor(){this._onFired=new c,this._currentFireCount=0,this._queued=!1,this.onEvent=e=>{const i=this._currentFireCount;return this._onFired.event((()=>{this._currentFireCount>i&&e()}))}}fire(){this._currentFireCount++,this._queued||(this._queued=!0,queueMicrotask((()=>{this._queued=!1,this._onFired.fire()})))}dispose(){this._onFired.dispose()}}e.DockviewDisposable=void 0,(i=e.DockviewDisposable||(e.DockviewDisposable={})).NONE={dispose:()=>{}},i.from=function(e){return{dispose:()=>{e()}}};class m{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 g{constructor(){this._disposable=e.DockviewDisposable.NONE}set value(e){this._disposable&&this._disposable.dispose(),this._disposable=e}dispose(){this._disposable&&(this._disposable.dispose(),this._disposable=e.DockviewDisposable.NONE)}}class b extends m{constructor(e){super(),this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._value=null,this.addDisposables(this._onDidChange,w(e,(e=>{const i=e.target.scrollWidth>e.target.clientWidth,t=e.target.scrollHeight>e.target.clientHeight;this._value={hasScrollX:i,hasScrollY:t},this._onDidChange.fire(this._value)})))}}function w(e,i){const t=new ResizeObserver((e=>{requestAnimationFrame((()=>{const t=e[0];i(t)}))}));return t.observe(e),{dispose:()=>{t.unobserve(e),t.disconnect()}}}const f=(e,...i)=>{for(const t of i)e.classList.contains(t)&&e.classList.remove(t)},_=(e,...i)=>{for(const t of i)e.classList.contains(t)||e.classList.add(t)},D=(e,i,t)=>{const n=e.classList.contains(i);t&&!n&&e.classList.add(i),!t&&n&&e.classList.remove(i)};function y(e,i){for(;e;){if(e===i)return!0;e=e.parentNode}return!1}function x(e){return new z(e)}class z extends m{constructor(e){super(),this._onDidFocus=new c,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new c,this.onDidBlur=this._onDidBlur.event,this.addDisposables(this._onDidFocus,this._onDidBlur);let i=y(document.activeElement,e),t=!1;const n=()=>{t=!1,i||(i=!0,this._onDidFocus.fire())},o=()=>{i&&(t=!0,window.setTimeout((()=>{t&&(t=!1,i=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{y(document.activeElement,e)!==i&&(i?o():n())},this.addDisposables(v(e,"focus",n,!0)),this.addDisposables(v(e,"blur",o,!0))}refreshState(){this._refreshStateHandler()}}const C="dv-quasiPreventDefault";function S(e){return e[C]}function A(e){const{left:i,top:t,width:n,height:o}=e.getBoundingClientRect();return{left:i+window.scrollX,top:t+window.scrollY,width:n,height:o}}function k(e=document){const i=function(e){const i=[];return function t(n){if(n.nodeType===Node.ELEMENT_NODE){e.includes(n.tagName)&&i.push(n),n.shadowRoot&&t(n.shadowRoot);for(const e of n.children)t(e)}}(document.documentElement),i}(["IFRAME","WEBVIEW"]),t=new WeakMap;for(const e of i)t.set(e,e.style.pointerEvents),e.style.pointerEvents="none";return{release:()=>{var e;for(const n of i)n.style.pointerEvents=null!==(e=t.get(n))&&void 0!==e?e:"auto";i.splice(0,i.length)}}}class P{constructor(e){this.element=e,this._classNames=[]}setClassNames(e){for(const e of this._classNames)D(this.element,e,!1);this._classNames=e.split(" ").filter((e=>e.trim().length>0));for(const e of this._classNames)D(this.element,e,!0)}}function E(e){if(0===e.length)throw new Error("Invalid tail call");return[e.slice(0,e.length-1),e[e.length-1]]}function O(e,i){if(e.length!==i.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==i[t])return!1;return!0}function G(e,i){const t=e.indexOf(i);t>-1&&(e.splice(t,1),e.unshift(i))}function I(e,i){const t=e.indexOf(i);t>-1&&(e.splice(t,1),e.push(i))}function V(e,i){const t=e.findIndex((e=>e===i));return t>-1&&(e.splice(t,1),!0)}const N=(e,i,t)=>i>t?i:Math.min(t,Math.max(e,i)),T=()=>{let e=1;return{next:()=>(e++).toString()}},L=(e,i)=>{const t=[];if("number"!=typeof i&&(i=e,e=0),e<=i)for(let n=e;n<i;n++)t.push(n);else for(let n=e;n>i;n--)t.push(n);return t};class M{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,i,t,n){this.container=e,this.view=i,this.disposable=n,this._cachedVisibleSize=void 0,"number"==typeof t?(this._size=t,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=t.cachedVisibleSize)}setVisible(e,i){var t;e!==this.visible&&(e?(this.size=N(null!==(t=this._cachedVisibleSize)&&void 0!==t?t:0,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof i?i: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 R,W,H,F;e.Orientation=void 0,(R=e.Orientation||(e.Orientation={})).HORIZONTAL="HORIZONTAL",R.VERTICAL="VERTICAL",e.SashState=void 0,(W=e.SashState||(e.SashState={}))[W.MAXIMUM=0]="MAXIMUM",W[W.MINIMUM=1]="MINIMUM",W[W.DISABLED=2]="DISABLED",W[W.ENABLED=3]="ENABLED",e.LayoutPriority=void 0,(H=e.LayoutPriority||(e.LayoutPriority={})).Low="low",H.High="high",H.Normal="normal",e.Sizing=void 0,(F=e.Sizing||(e.Sizing={})).Distribute={type:"distribute"},F.Split=function(e){return{type:"split",index:e}},F.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}};class B{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(i){this._orientation=i;const t=this.size;this.size=this.orthogonalSize,this.orthogonalSize=t,f(this.element,"dv-horizontal","dv-vertical"),this.element.classList.add(this.orientation==e.Orientation.HORIZONTAL?"dv-horizontal":"dv-vertical")}get minimumSize(){return this.viewItems.reduce(((e,i)=>e+i.minimumSize),0)}get maximumSize(){return 0===this.length?Number.POSITIVE_INFINITY:this.viewItems.reduce(((e,i)=>e+i.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,D(this.element,"dv-splitview-disabled",e)}get margin(){return this._margin}set margin(e){this._margin=e,D(this.element,"dv-splitview-has-margin",0!==e)}constructor(i,t){var n,o;this.container=i,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 c,this.onDidSashEnd=this._onDidSashEnd.event,this._onDidAddView=new c,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new c,this.onDidRemoveView=this._onDidRemoveView.event,this.resize=(e,i,t=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=L(e,-1),l=L(e+1,this.viewItems.length);if(o)for(const e of o)G(h,e),G(l,e);if(n)for(const e of n)I(h,e),I(l,e);const p=h.map((e=>this.viewItems[e])),c=h.map((e=>t[e])),v=l.map((e=>this.viewItems[e])),u=l.map((e=>t[e])),m=h.reduce(((e,i)=>e+this.viewItems[i].minimumSize-t[i]),0),g=h.reduce(((e,i)=>e+this.viewItems[i].maximumSize-t[i]),0),b=0===l.length?Number.POSITIVE_INFINITY:l.reduce(((e,i)=>e+t[i]-this.viewItems[i].minimumSize),0),w=0===l.length?Number.NEGATIVE_INFINITY:l.reduce(((e,i)=>e+t[i]-this.viewItems[i].maximumSize),0),f=Math.max(m,w),_=Math.min(b,g);let D=!1;if(a){const e=this.viewItems[a.index],t=i>=a.limitDelta;D=t!==e.visible,e.setVisible(t,a.size)}if(!D&&d){const e=this.viewItems[d.index],t=i<d.limitDelta;D=t!==e.visible,e.setVisible(t,d.size)}if(D)return this.resize(e,i,t,n,o,s,r);let y=0,x=N(i,f,_);for(let e=0;e<p.length;e++){const i=p[e],t=N(c[e]+x,i.minimumSize,i.maximumSize),n=t-c[e];y+=n,x-=n,i.size=t}let z=y;for(let e=0;e<v.length;e++){const i=v[e],t=N(u[e]-z,i.minimumSize,i.maximumSize);z+=t-u[e],i.size=t}return i},this._orientation=null!==(n=t.orientation)&&void 0!==n?n:e.Orientation.VERTICAL,this.element=this.createContainer(),this.margin=null!==(o=t.margin)&&void 0!==o?o: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,i)=>{const t=void 0===e.visible||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.addView(n,t,i,!0)})),this._contentSize=this.viewItems.reduce(((e,i)=>e+i.size),0),this.saveProportions())}style(e){"transparent"===(null==e?void 0:e.separatorBorder)?(f(this.element,"dv-separator-border"),this.element.style.removeProperty("--dv-separator-border")):(_(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,i){if(e<0||e>=this.viewItems.length)throw new Error("Index out of bounds");const t=this.viewItems[e];t.setVisible(i,t.size),this.distributeEmptySpace(e),this.layoutViews(),this.saveProportions()}getViewSize(e){return e<0||e>=this.viewItems.length?-1:this.viewItems[e].size}resizeView(i,t){if(i<0||i>=this.viewItems.length)return;const n=L(this.viewItems.length).filter((e=>e!==i)),o=[...n.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),i],s=n.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High)),r=this.viewItems[i];t=Math.round(t),t=N(t,r.minimumSize,Math.min(r.maximumSize,this._size)),r.size=t,this.relayout(o,s)}getViews(){return this.viewItems.map((e=>e.view))}onDidChange(i,t){const n=this.viewItems.indexOf(i);if(n<0||n>=this.viewItems.length)return;t="number"==typeof t?t:i.size,t=N(t,i.minimumSize,i.maximumSize),i.size=t;const o=L(this.viewItems.length).filter((e=>e!==n)),s=[...o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),n],r=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));this.relayout([...s,n],r)}addView(i,t={type:"distribute"},n=this.viewItems.length,o){const s=document.createElement("div");let r;s.className="dv-view",s.appendChild(i.element),r="number"==typeof t?t:"split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:i.minimumSize;const a=i.onDidChange((e=>this.onDidChange(d,e.size))),d=new M(s,i,r,{dispose:()=>{a.dispose(),this.viewContainer.removeChild(s)}});if(n===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(n)),this.viewItems.splice(n,0,d),this.viewItems.length>1){const i=document.createElement("div");i.className="dv-sash";const t=t=>{for(const e of this.viewItems)e.enabled=!1;const n=k(),o=this._orientation===e.Orientation.HORIZONTAL?t.clientX:t.clientY,s=function(e,i){for(let t=0;t<e.length;t++)if(i(e[t]))return t;return-1}(this.sashes,(e=>e.container===i)),r=this.viewItems.map((e=>e.size));let a,d;const h=L(s,-1),l=L(s+1,this.viewItems.length),p=h.reduce(((e,i)=>e+(this.viewItems[i].minimumSize-r[i])),0),c=h.reduce(((e,i)=>e+(this.viewItems[i].viewMaximumSize-r[i])),0),v=0===l.length?Number.POSITIVE_INFINITY:l.reduce(((e,i)=>e+(r[i]-this.viewItems[i].minimumSize)),0),u=0===l.length?Number.NEGATIVE_INFINITY:l.reduce(((e,i)=>e+(r[i]-this.viewItems[i].viewMaximumSize)),0),m=Math.max(p,u),g=Math.min(v,c),b=this.findFirstSnapIndex(h),w=this.findFirstSnapIndex(l);if("number"==typeof b){const e=this.viewItems[b],i=Math.floor(e.viewMinimumSize/2);a={index:b,limitDelta:e.visible?m-i:m+i,size:e.size}}if("number"==typeof w){const e=this.viewItems[w],i=Math.floor(e.viewMinimumSize/2);d={index:w,limitDelta:e.visible?g+i:g-i,size:e.size}}const f=i=>{const t=(this._orientation===e.Orientation.HORIZONTAL?i.clientX:i.clientY)-o;this.resize(s,t,r,void 0,void 0,m,g,a,d),this.distributeEmptySpace(),this.layoutViews()},_=()=>{for(const e of this.viewItems)e.enabled=!0;n.release(),this.saveProportions(),document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",_),document.removeEventListener("pointercancel",_),this._onDidSashEnd.fire(void 0)};document.addEventListener("pointermove",f),document.addEventListener("pointerup",_),document.addEventListener("pointercancel",_)};i.addEventListener("pointerdown",t);const n={container:i,disposable:()=>{i.removeEventListener("pointerdown",t),this.sashContainer.removeChild(i)}};this.sashContainer.appendChild(i),this.sashes.push(n)}o||this.relayout([n]),o||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes(),this._onDidAddView.fire(i)}distributeViewSizes(){const i=[];let t=0;for(const e of this.viewItems)e.maximumSize-e.minimumSize>0&&(i.push(e),t+=e.size);const n=Math.floor(t/i.length);for(const e of i)e.size=N(n,e.minimumSize,e.maximumSize);const o=L(this.viewItems.length),s=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),r=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));this.relayout(s,r)}removeView(e,i,t=!1){const n=this.viewItems.splice(e,1)[0];if(n.dispose(),this.viewItems.length>=1){const i=Math.max(e-1,0);this.sashes.splice(i,1)[0].disposable()}return t||this.relayout(),i&&"distribute"===i.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(i,t){const n=this.getViewCachedVisibleSize(i),o=void 0===n?this.getViewSize(i):e.Sizing.Invisible(n),s=this.removeView(i,void 0,!0);this.addView(s,o,t)}layout(i,t){const n=Math.max(this.size,this._contentSize);if(this.size=i,this.orthogonalSize=t,this.proportions){let e=0;for(let t=0;t<this.viewItems.length;t++){const n=this.viewItems[t],o=this.proportions[t];"number"==typeof o?e+=o:i-=n.size}for(let t=0;t<this.viewItems.length;t++){const n=this.viewItems[t],o=this.proportions[t];"number"==typeof o&&e>0&&(n.size=N(Math.round(o*i/e),n.minimumSize,n.maximumSize))}}else{const t=L(this.viewItems.length),o=t.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),s=t.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));this.resize(this.viewItems.length-1,i-n,void 0,o,s)}this.distributeEmptySpace(),this.layoutViews()}relayout(e,i){const t=this.viewItems.reduce(((e,i)=>e+i.size),0);this.resize(this.viewItems.length-1,this._size-t,void 0,e,i),this.distributeEmptySpace(),this.layoutViews(),this.saveProportions()}distributeEmptySpace(i){const t=this.viewItems.reduce(((e,i)=>e+i.size),0);let n=this.size-t;const o=L(this.viewItems.length-1,-1),s=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.Low)),r=o.filter((i=>this.viewItems[i].priority===e.LayoutPriority.High));for(const e of r)G(o,e);for(const e of s)I(o,e);"number"==typeof i&&I(o,i);for(let e=0;0!==n&&e<o.length;e++){const i=this.viewItems[o[e]],t=N(i.size+n,i.minimumSize,i.maximumSize);n-=t-i.size,i.size=t}}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,i)=>e+i.size),0),this.updateSashEnablement(),0===this.viewItems.length)return;const i=this.viewItems.filter((e=>e.visible)),t=Math.max(0,i.length-1),n=this.margin*t/Math.max(1,i.length);let o=0;const s=[],r=this.viewItems.reduce(((e,i,t)=>{const n=i.visible?1:0;return 0===t?e.push(n):e.push(e[t-1]+n),e}),[]);this.viewItems.forEach(((i,a)=>{o+=this.viewItems[a].size,s.push(o);const d=i.visible?i.size-n:0,h=Math.max(0,r[a]-1),l=0===a||0===h?0:s[a-1]+h/t*n;if(a<this.viewItems.length-1){const t=i.visible?l+d-2+this.margin/2:l;this._orientation===e.Orientation.HORIZONTAL&&(this.sashes[a].container.style.left=`${t}px`,this.sashes[a].container.style.top="0px"),this._orientation===e.Orientation.VERTICAL&&(this.sashes[a].container.style.left="0px",this.sashes[a].container.style.top=`${t}px`)}this._orientation===e.Orientation.HORIZONTAL&&(i.container.style.width=`${d}px`,i.container.style.left=`${l}px`,i.container.style.top="",i.container.style.height=""),this._orientation===e.Orientation.VERTICAL&&(i.container.style.height=`${d}px`,i.container.style.top=`${l}px`,i.container.style.width="",i.container.style.left=""),i.view.layout(i.size-n,this._orthogonalSize)}))}findFirstSnapIndex(e){for(const i of e){const e=this.viewItems[i];if(e.visible&&e.snap)return i}for(const i of e){const e=this.viewItems[i];if(e.visible&&e.maximumSize-e.minimumSize>0)return;if(!e.visible&&e.snap)return i}}updateSashEnablement(){let i=!1;const t=this.viewItems.map((e=>i=e.size-e.minimumSize>0||i));i=!1;const n=this.viewItems.map((e=>i=e.maximumSize-e.size>0||i)),o=[...this.viewItems].reverse();i=!1;const s=o.map((e=>i=e.size-e.minimumSize>0||i)).reverse();i=!1;const r=o.map((e=>i=e.maximumSize-e.size>0||i)).reverse();let a=0;for(let i=0;i<this.sashes.length;i++){const o=this.sashes[i];a+=this.viewItems[i].size;const d=!(t[i]&&r[i+1]),h=!(n[i]&&s[i+1]);if(d&&h){const n=L(i,-1),r=L(i+1,this.viewItems.length),d=this.findFirstSnapIndex(n),h=this.findFirstSnapIndex(r),l="number"==typeof d&&!this.viewItems[d].visible,p="number"==typeof h&&!this.viewItems[h].visible;l&&s[i]&&(a>0||this.startSnappingEnabled)?this.updateSash(o,e.SashState.MINIMUM):p&&t[i]&&(a<this._contentSize||this.endSnappingEnabled)?this.updateSash(o,e.SashState.MAXIMUM):this.updateSash(o,e.SashState.DISABLED)}else d&&!h?this.updateSash(o,e.SashState.MINIMUM):!d&&h?this.updateSash(o,e.SashState.MAXIMUM):this.updateSash(o,e.SashState.ENABLED)}}updateSash(i,t){D(i.container,"dv-disabled",t===e.SashState.DISABLED),D(i.container,"dv-enabled",t===e.SashState.ENABLED),D(i.container,"dv-maximum",t===e.SashState.MAXIMUM),D(i.container,"dv-minimum",t===e.SashState.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 i=document.createElement("div"),t=this._orientation===e.Orientation.HORIZONTAL?"dv-horizontal":"dv-vertical";return i.className=`dv-split-view-container ${t}`,i}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 U=(()=>{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 J extends m{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(i,t){var n;super(),this.paneItems=[],this.skipAnimation=!1,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._orientation=null!==(n=t.orientation)&&void 0!==n?n:e.Orientation.VERTICAL,this.element=document.createElement("div"),this.element.className="dv-pane-container",i.appendChild(this.element),this.splitview=new B(this.element,{orientation:this._orientation,proportionalLayout:!1,descriptor:t.descriptor}),this.getPanes().forEach((e=>{const i=new m(e.onDidChangeExpansionState((()=>{this.setupAnimation(),this._onDidChange.fire(void 0)}))),t={pane:e,disposable:{dispose:()=>{i.dispose()}}};this.paneItems.push(t),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,i){this.splitview.setViewVisible(e,i)}addPane(e,i,t=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(t,0,s),e.orthogonalSize=this.splitview.orthogonalSize,this.splitview.addView(e,i,t,n)}getViewSize(e){return this.splitview.getViewSize(e)}getPanes(){return this.splitview.getViews()}removePane(e,i={skipDispose:!1}){const t=this.paneItems.splice(e,1)[0];return this.splitview.removeView(e),i.skipDispose||(t.disposable.dispose(),t.pane.dispose()),t}moveView(e,i){if(e===i)return;const t=this.removePane(e,{skipDispose:!0});this.skipAnimation=!0;try{this.addPane(t.pane,t.pane.size,i,!1)}finally{this.skipAnimation=!1}}layout(e,i){this.splitview.layout(e,i)}setupAnimation(){this.skipAnimation||(this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=void 0),_(this.element,"dv-animated"),this.animationTimer=setTimeout((()=>{this.animationTimer=void 0,f(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 ${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===e.Orientation.HORIZONTAL?this.minimumHeight:this.minimumWidth}get maximumSize(){return this.orientation===e.Orientation.HORIZONTAL?this.maximumHeight:this.maximumWidth}get minimumOrthogonalSize(){return this.orientation===e.Orientation.HORIZONTAL?this.minimumWidth:this.minimumHeight}get maximumOrthogonalSize(){return this.orientation===e.Orientation.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===e.Orientation.HORIZONTAL?this.orthogonalSize:this.size}get height(){return this.orientation===e.Orientation.HORIZONTAL?this.size:this.orthogonalSize}constructor(i,t,n,o=0){this.view=i,this.orientation=t,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._orthogonalSize=n,this._size=o,this._disposable=this.view.onDidChange((i=>{i?this._onDidChange.fire({size:this.orientation===e.Orientation.VERTICAL?i.width:i.height,orthogonalSize:this.orientation===e.Orientation.VERTICAL?i.height:i.width}):this._onDidChange.fire({})}))}setVisible(e){this.view.setVisible&&this.view.setVisible(e)}layout(e,i){this._size=e,this._orthogonalSize=i,this.view.layout(this.width,this.height)}dispose(){this._onDidChange.dispose(),this._disposable.dispose()}}class j extends m{get width(){return this.orientation===e.Orientation.HORIZONTAL?this.size:this.orthogonalSize}get height(){return this.orientation===e.Orientation.HORIZONTAL?this.orthogonalSize:this.size}get minimumSize(){return 0===this.children.length?0:Math.max(...this.children.map(((e,i)=>this.splitview.isViewVisible(i)?e.minimumOrthogonalSize:0)))}get maximumSize(){return Math.min(...this.children.map(((e,i)=>this.splitview.isViewVisible(i)?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===e.Orientation.HORIZONTAL?this.minimumOrthogonalSize:this.minimumSize}get minimumHeight(){return this.orientation===e.Orientation.HORIZONTAL?this.minimumSize:this.minimumOrthogonalSize}get maximumWidth(){return this.orientation===e.Orientation.HORIZONTAL?this.maximumOrthogonalSize:this.maximumSize}get maximumHeight(){return this.orientation===e.Orientation.HORIZONTAL?this.maximumSize:this.maximumOrthogonalSize}get priority(){if(0===this.children.length)return e.LayoutPriority.Normal;const i=this.children.map((i=>void 0===i.priority?e.LayoutPriority.Normal:i.priority));return i.some((i=>i===e.LayoutPriority.High))?e.LayoutPriority.High:i.some((i=>i===e.LayoutPriority.Low))?e.LayoutPriority.Low:e.LayoutPriority.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((i=>{i instanceof j&&(i.margin=e)}))}constructor(i,t,n,o,s,r,a,d){if(super(),this.orientation=i,this.proportionalLayout=t,this.styles=n,this._childrenDisposable=e.DockviewDisposable.NONE,this.children=[],this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._onDidVisibilityChange=new c,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._orthogonalSize=s,this._size=o,this.element=document.createElement("div"),this.element.className="dv-branch-node",d){const e={views:d.map((e=>({view:e.node,size:e.node.size,visible:!(e.node instanceof $&&void 0!==e.visible)||e.visible}))),size:this.orthogonalSize};this.children=d.map((e=>e.node)),this.splitview=new B(this.element,{orientation:this.orientation,descriptor:e,proportionalLayout:t,styles:n,margin:a})}else this.splitview=new B(this.element,{orientation:this.orientation,proportionalLayout:t,styles:n,margin:a}),this.splitview.layout(this.size,this.orthogonalSize);this.disabled=r,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,i){if(e<0||e>=this.children.length)throw new Error("Invalid index");if(this.splitview.isViewVisible(e)===i)return;const t=0===this.splitview.contentSize;this.splitview.setViewVisible(e,i);const n=0===this.splitview.contentSize;(i&&t||!i&&n)&&this._onDidVisibilityChange.fire({visible:i})}moveChild(e,i){if(e===i)return;if(e<0||e>=this.children.length)throw new Error("Invalid from index");e<i&&i--,this.splitview.moveView(e,i);const t=this._removeChild(e);this._addChild(t,i)}getChildSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewSize(e)}resizeChild(e,i){if(e<0||e>=this.children.length)throw new Error("Invalid index");this.splitview.resizeView(e,i)}layout(e,i){this._size=i,this._orthogonalSize=e,this.splitview.layout(i,e)}addChild(e,i,t,n){if(t<0||t>this.children.length)throw new Error("Invalid index");this.splitview.addView(e,i,t,n),this._addChild(e,t)}getChildCachedVisibleSize(e){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.getViewCachedVisibleSize(e)}removeChild(e,i){if(e<0||e>=this.children.length)throw new Error("Invalid index");return this.splitview.removeView(e,i),this._removeChild(e)}_addChild(e,i){this.children.splice(i,0,e),this.setupChildrenEvents()}_removeChild(e){const[i]=this.children.splice(e,1);return this.setupChildrenEvents(),i}setupChildrenEvents(){this._childrenDisposable.dispose(),this._childrenDisposable=new m(e.DockviewEvent.any(...this.children.map((e=>e.onDidChange)))((e=>{this._onDidChange.fire({size:e.orthogonalSize})})),...this.children.map(((i,t)=>i instanceof j?i.onDidVisibilityChange((({visible:e})=>{this.setChildVisible(t,e)})):e.DockviewDisposable.NONE)))}dispose(){this._childrenDisposable.dispose(),this.splitview.dispose(),this.children.forEach((e=>e.dispose())),super.dispose()}}function Z(e,i){if(e instanceof $)return e;if(e instanceof j)return Z(e.children[i?e.children.length-1:0],i);throw new Error("invalid node")}function Y(e,i,t){if(e instanceof j){const n=new j(e.orientation,e.proportionalLayout,e.styles,i,t,e.disabled,e.margin);for(let i=e.children.length-1;i>=0;i--){const t=e.children[i];n.addChild(Y(t,t.size,t.orthogonalSize),t.size,0,!0)}return n}return new $(e.view,e.orientation,t)}function X(e,i,t){if(e instanceof j){const n=new j(te(e.orientation),e.proportionalLayout,e.styles,i,t,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 j?r.orthogonalSize:r.size;let d=0===e.size?0:Math.round(i*a/e.size);o+=d,0===s&&(d+=i-o),n.addChild(X(r,t,d),d,0,!0)}return n}return new $(e.view,te(e.orientation),t)}function K(e){const i=e.parentElement;if(!i)throw new Error("Invalid grid element");let t=i.firstElementChild,n=0;for(;t!==e&&t!==i.lastElementChild&&t;)t=t.nextElementSibling,n++;return n}function q(e){const i=e.parentElement;if(!i)throw new Error("Invalid grid element");if(/\bdv-grid-view\b/.test(i.className))return[];const t=K(i);return[...q(i.parentElement.parentElement.parentElement),t]}function Q(e,i,t){if(ie(e,i)===ee(t)){const[e,n]=E(i);let o=n;return"right"!==t&&"bottom"!==t||(o+=1),[...e,o]}{const e="right"===t||"bottom"===t?1:0;return[...i,e]}}function ee(i){return"top"===i||"bottom"===i?e.Orientation.VERTICAL:e.Orientation.HORIZONTAL}function ie(e,i){return i.length%2==0?te(e):e}const te=i=>i===e.Orientation.HORIZONTAL?e.Orientation.VERTICAL:e.Orientation.HORIZONTAL;function ne(e){return!!e.children}const oe=(i,t)=>{const n=t===e.Orientation.VERTICAL?i.box.width:i.box.height;return ne(i)?{type:"branch",data:i.children.map((e=>oe(e,te(t)))),size:n}:"number"==typeof i.cachedVisibleSize?{type:"leaf",data:i.view.toJSON(),size:i.cachedVisibleSize,visible:!1}:{type:"leaf",data:i.view.toJSON(),size:n}};class se{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:i,orthogonalSize:t}=this.root;this.root=X(this.root,t,i),this.root.layout(i,t)}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 i=[this.root];for(;i.length>0;){const t=i.pop();t instanceof j&&(t.disabled=e,i.push(...t.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 i;const t=q(e.element),[n,o]=this.getNode(t);if(!(o instanceof $))return;if((null===(i=this._maximizedNode)||void 0===i?void 0:i.leaf)===o)return;this.hasMaximizedView()&&this.exitMaximizedView(),oe(this.getView(),this.orientation);const s=[];!function e(i,t){for(let n=0;n<i.children.length;n++){const o=i.children[n];o instanceof $?o!==t&&(i.isChildVisible(n)?i.setChildVisible(n,!1):s.push(o)):e(o,t)}}(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 i(t){for(let n=t.children.length-1;n>=0;n--){const o=t.children[n];o instanceof $?e.includes(o)||t.setChildVisible(n,!0):i(o)}}(this.root);const i=this._maximizedNode.leaf;this._maximizedNode=void 0,this._onDidMaximizedNodeChange.fire({view:i.view,isMaximized:!1})}serialize(){const e=this.maximizedView();let i;e&&(i=q(e.element)),this.hasMaximizedView()&&this.exitMaximizedView();const t={root:oe(this.getView(),this.orientation),width:this.width,height:this.height,orientation:this.orientation};return i&&(t.maximizedNode={location:i}),e&&this.maximizeView(e),t}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 j(e,this.proportionalLayout,this.styles,this.root.size,this.root.orthogonalSize,this.locked,this.margin)}deserialize(i,t){const n=i.orientation,o=n===e.Orientation.VERTICAL?i.height:i.width;if(this._deserialize(i.root,n,t,o),this.layout(i.width,i.height),i.maximizedNode){const e=i.maximizedNode.location,[t,n]=this.getNode(e);if(!(n instanceof $))return;this.maximizeView(n.view)}}_deserialize(e,i,t,n){this.root=this._deserializeNode(e,i,t,n)}_deserializeNode(e,i,t,n){var o;let s;if("branch"===e.type){const o=e.data.map((n=>({node:this._deserializeNode(n,te(i),t,e.size),visible:n.visible})));s=new j(i,this.proportionalLayout,this.styles,e.size,n,this.locked,this.margin,o)}else{const r=t.fromJSON(e);"boolean"==typeof e.visible&&(null===(o=r.setVisible)||void 0===o||o.call(r,e.visible)),s=new $(r,i,n,e.size)}return s}get root(){return this._root}set root(e){const i=this._root;i&&(i.dispose(),this._maximizedNode=void 0,this.element.removeChild(i.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,i=e.children[0];if(i instanceof $)return;e.element.remove();const t=e.removeChild(0);e.dispose(),t.dispose(),this._root=Y(i,i.size,i.orthogonalSize),this.element.appendChild(this._root.element),this.disposable.value=this._root.onDidChange((e=>{this._onDidChange.fire(e)}))}insertOrthogonalSplitviewAtRoot(){if(!this._root)return;const i=this.root;if(i.element.remove(),this._root=new j(te(i.orientation),this.proportionalLayout,this.styles,this.root.orthogonalSize,this.root.size,this.locked,this.margin),0===i.children.length);else if(1===i.children.length){const t=i.children[0];i.removeChild(0).dispose(),i.dispose(),this._root.addChild(X(t,t.orthogonalSize,t.size),e.Sizing.Distribute,0)}else this._root.addChild(i,e.Sizing.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 i=e?this.getNode(e)[1]:this.root;return this._getViews(i,this.orientation)}_getViews(e,i,t){const n={height:e.height,width:e.width};if(e instanceof $)return{box:n,view:e.view,cachedVisibleSize:t};const o=[];for(let t=0;t<e.children.length;t++){const n=e.children[t],s=e.getChildCachedVisibleSize(t);o.push(this._getViews(n,te(i),s))}return{box:n,children:o}}progmaticSelect(e,i=!1){const[t,n]=this.getNode(e);if(!(n instanceof $))throw new Error("invalid location");for(let n=t.length-1;n>-1;n--){const o=t[n],s=e[n]||0;if(i?s-1>-1:s+1<o.children.length)return Z(o.children[i?s-1:s+1],i)}return Z(this.root,i)}constructor(e,i,t,n,o){this.proportionalLayout=e,this.styles=i,this._locked=!1,this._margin=0,this._maximizedNode=void 0,this.disposable=new g,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this._onDidViewVisibilityChange=new c,this.onDidViewVisibilityChange=this._onDidViewVisibilityChange.event,this._onDidMaximizedNodeChange=new c,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 j(t,e,i,0,0,this.locked,this.margin)}isViewVisible(e){const[i,t]=E(e),[,n]=this.getNode(i);if(!(n instanceof j))throw new Error("Invalid from location");return n.isChildVisible(t)}setViewVisible(e,i){this.hasMaximizedView()&&this.exitMaximizedView();const[t,n]=E(e),[,o]=this.getNode(t);if(!(o instanceof j))throw new Error("Invalid from location");this._onDidViewVisibilityChange.fire(),o.setChildVisible(n,i)}moveView(e,i,t){this.hasMaximizedView()&&this.exitMaximizedView();const[,n]=this.getNode(e);if(!(n instanceof j))throw new Error("Invalid location");n.moveChild(i,t)}addView(i,t,n){this.hasMaximizedView()&&this.exitMaximizedView();const[o,s]=E(n),[r,a]=this.getNode(o);if(a instanceof j){const e=new $(i,te(a.orientation),a.orthogonalSize);a.addChild(e,t,s)}else{const[n,...d]=[...r].reverse(),[h,...l]=[...o].reverse();let p=0;const c=n.getChildCachedVisibleSize(h);"number"==typeof c&&(p=e.Sizing.Invisible(c));n.removeChild(h).dispose();const v=new j(a.orientation,this.proportionalLayout,this.styles,a.size,a.orthogonalSize,this.locked,this.margin);n.addChild(v,a.size,h);const u=new $(a.view,n.orientation,a.size);v.addChild(u,p,0),"number"!=typeof t&&"split"===t.type&&(t={type:"split",index:0});const m=new $(i,n.orientation,a.size);v.addChild(m,t,s)}}remove(e,i){const t=q(e.element);return this.removeView(t,i)}removeView(i,t){this.hasMaximizedView()&&this.exitMaximizedView();const[n,o]=E(i),[s,r]=this.getNode(n);if(!(r instanceof j))throw new Error("Invalid location");const a=r.children[o];if(!(a instanceof $))throw new Error("Invalid location");if(r.removeChild(o,t),a.dispose(),1!==r.children.length)return a.view;const d=r.children[0];if(0===s.length)return d instanceof $||(r.removeChild(0,t),this.root=d),a.view;const[h,...l]=[...s].reverse(),[p,...c]=[...n].reverse(),v=r.isChildVisible(0);r.removeChild(0,t);const u=h.children.map(((e,i)=>h.getChildSize(i)));if(h.removeChild(p,t).dispose(),d instanceof j){u.splice(p,1,...d.children.map((e=>e.size)));for(let e=0;e<d.children.length;e++){const i=d.children[e];h.addChild(i,i.size,p+e)}for(;d.children.length>0;)d.removeChild(0)}else{const i=new $(d.view,te(d.orientation),d.size),t=v?d.orthogonalSize:e.Sizing.Invisible(d.orthogonalSize);h.addChild(i,t,p)}d.dispose();for(let e=0;e<u.length;e++)h.resizeChild(e,u[e]);return a.view}layout(i,t){const[n,o]=this.root.orientation===e.Orientation.HORIZONTAL?[t,i]:[i,t];this.root.layout(n,o)}getNode(e,i=this.root,t=[]){if(0===e.length)return[t,i];if(!(i instanceof j))throw new Error("Invalid location");const[n,...o]=e;if(n<0||n>=i.children.length)throw new Error("Invalid location");const s=i.children[n];return t.push(i),this.getNode(o,s,t)}}const re=(()=>{const e={disableAutoResizing:void 0,proportionalLayout:void 0,orientation:void 0,hideBorders:void 0,className:void 0};return Object.keys(e)})();class ae extends m{get element(){return this._element}get disableResizing(){return this._disableResizing}set disableResizing(e){this._disableResizing=e}constructor(e,i=!1){super(),this._disableResizing=i,this._element=e,this.addDisposables(w(this._element,(e=>{if(this.isDisposed)return;if(this.disableResizing)return;if(!this._element.offsetParent)return;if(!function(e){let i=e;for(;null==i?void 0:i.parentNode;){if(i.parentNode===document)return!0;i=i.parentNode instanceof DocumentFragment?i.parentNode.host:i.parentNode}return!1}(this._element))return;const{width:i,height:t}=e.contentRect;this.layout(i,t)})))}}const de=T();function he(e){switch(e){case"left":return"left";case"right":return"right";case"above":return"top";case"below":return"bottom";default:return"center"}}class le extends ae{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(i,t){var n;super(document.createElement("div"),t.disableAutoResizing),this._id=de.next(),this._groups=new Map,this._onDidRemove=new c,this.onDidRemove=this._onDidRemove.event,this._onDidAdd=new c,this.onDidAdd=this._onDidAdd.event,this._onDidMaximizedChange=new c,this.onDidMaximizedChange=this._onDidMaximizedChange.event,this._onDidActiveChange=new c,this.onDidActiveChange=this._onDidActiveChange.event,this._bufferOnDidLayoutChange=new u,this.onDidLayoutChange=this._bufferOnDidLayoutChange.onEvent,this._onDidViewVisibilityChangeMicroTaskQueue=new u,this.onDidViewVisibilityChangeMicroTaskQueue=this._onDidViewVisibilityChangeMicroTaskQueue.onEvent,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new P(this.element),this._classNames.setClassNames(null!==(n=t.className)&&void 0!==n?n:""),i.appendChild(this.element),this.gridview=new se(!!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)})),e.DockviewDisposable.from((()=>{var e;null===(e=this.element.parentElement)||void 0===e||e.removeChild(this.element)})),this.gridview.onDidChange((()=>{this._bufferOnDidLayoutChange.fire()})),e.DockviewEvent.any(this.onDidAdd,this.onDidRemove,this.onDidActiveChange)((()=>{this._bufferOnDidLayoutChange.fire()})),this._onDidMaximizedChange,this._onDidViewVisibilityChangeMicroTaskQueue,this._bufferOnDidLayoutChange)}setVisible(e,i){this.gridview.setViewVisible(q(e.element),i),this._bufferOnDidLayoutChange.fire()}isVisible(e){return this.gridview.isViewVisible(q(e.element))}updateOptions(e){var i,t,n,o;e.proportionalLayout,e.orientation&&(this.gridview.orientation=e.orientation),"disableResizing"in e&&(this.disableResizing=null!==(i=e.disableAutoResizing)&&void 0!==i&&i),"locked"in e&&(this.locked=null!==(t=e.locked)&&void 0!==t&&t),"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(i,t=[0],n){this.gridview.addView(i,null!=n?n:e.Sizing.Distribute,t),this._onDidAdd.fire(i)}doRemoveGroup(i,t){if(!this._groups.has(i.id))throw new Error("invalid operation");const n=this._groups.get(i.id),o=this.gridview.remove(i,e.Sizing.Distribute);if(n&&!(null==t?void 0:t.skipDispose)&&(n.disposable.dispose(),n.value.dispose(),this._groups.delete(i.id),this._onDidRemove.fire(i)),!(null==t?void 0:t.skipActive)&&this._activeGroup===i){const e=Array.from(this._groups.values());this.doSetGroupActive(e.length>0?e[0].value:void 0)}return o}getPanel(e){var i;return null===(i=this._groups.get(e))||void 0===i?void 0:i.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 i;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const t=q(e.group.element),n=null===(i=this.gridview.next(t))||void 0===i?void 0:i.view;this.doSetGroupActive(n)}moveToPrevious(e){var i;if(e||(e={}),!e.group){if(!this.activeGroup)return;e.group=this.activeGroup}const t=q(e.group.element),n=null===(i=this.gridview.previous(t))||void 0===i?void 0:i.view;this.doSetGroupActive(n)}layout(e,i,t){(t||e!==this.width||i!==this.height)&&(this.gridview.element.style.height=`${i}px`,this.gridview.element.style.width=`${e}px`,this.gridview.layout(e,i))}dispose(){this._onDidActiveChange.dispose(),this._onDidAdd.dispose(),this._onDidRemove.dispose();for(const e of this.groups)e.dispose();this.gridview.dispose(),super.dispose()}}class pe{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,i){this.component.removePanel(e,i)}focus(){this.component.focus()}getPanel(e){return this.component.getPanel(e)}layout(e,i){return this.component.layout(e,i)}addPanel(e){return this.component.addPanel(e)}movePanel(e,i){this.component.movePanel(e,i)}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 ce{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,i){this.component.movePanel(e,i)}focus(){this.component.focus()}layout(e,i){this.component.layout(e,i)}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 ve{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,i,t=!1){this.component.layout(e,i,t)}addPanel(e){return this.component.addPanel(e)}removePanel(e,i){this.component.removePanel(e,i)}movePanel(e,i){this.component.movePanel(e,i)}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 ue{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,i,t=!1){this.component.layout(e,i,t)}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,i){return this.component.addFloatingGroup(e,i)}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,i){return this.component.addPopoutGroup(e,i)}updateOptions(e){this.component.updateOptions(e)}dispose(){this.component.dispose()}}class me extends m{constructor(e,i){super(),this.el=e,this.disabled=i,this.dataDisposable=new g,this.pointerEventsDisposable=new g,this._onDragStart=new c,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,v(this.el,"dragstart",(e=>{if(e.defaultPrevented||this.isCancelled(e)||this.disabled)return void e.preventDefault();const i=k();if(this.pointerEventsDisposable.value={dispose:()=>{i.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","")}})),v(this.el,"dragend",(()=>{this.pointerEventsDisposable.dispose(),setTimeout((()=>{this.dataDisposable.dispose()}),0)})))}}class ge extends m{constructor(e,i){super(),this.element=e,this.callbacks=i,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(v(this.element,"dragenter",(e=>{this.onDragEnter(e)}),!0)),this.addDisposables(v(this.element,"dragover",(e=>{this.onDragOver(e)}),!0)),this.addDisposables(v(this.element,"dragleave",(e=>{this.onDragLeave(e)}))),this.addDisposables(v(this.element,"dragend",(e=>{this.onDragEnd(e)}))),this.addDisposables(v(this.element,"drop",(e=>{this.onDrop(e)})))}}class be extends d{get nativeEvent(){return this.options.nativeEvent}get position(){return this.options.position}constructor(e){super(),this.options=e}}function we(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 fe(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 _e={value:20,type:"percentage"},De={value:50,type:"percentage"};class ye extends m{get disabled(){return this._disabled}set disabled(e){this._disabled=e}get state(){return this._state}constructor(e,i){super(),this.element=e,this.options=i,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._disabled=!1,this._acceptedTargetZonesSet=new Set(this.options.acceptedTargetZones),this.dnd=new ge(this.element,{onDragEnter:()=>{var e,i,t;null===(t=null===(i=(e=this.options).getOverrideTarget)||void 0===i?void 0:i.call(e))||void 0===t||t.getElements()},onDragOver:e=>{var i,t,n,o,s,r,a;ye.ACTUAL_TARGET=this;const d=null===(t=(i=this.options).getOverrideTarget)||void 0===t?void 0:t.call(i);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 be({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,i;(null===(i=(e=this.options).getOverrideTarget)||void 0===i?void 0:i.call(e))||this.removeDropTarget()},onDragEnd:e=>{var i,t;const n=null===(t=(i=this.options).getOverrideTarget)||void 0===t?void 0:t.call(i);n&&ye.ACTUAL_TARGET===this&&this._state&&(e.stopPropagation(),this._onDrop.fire({position:this._state,nativeEvent:e})),this.removeDropTarget(),null==n||n.clear()},onDrop:e=>{var i,t,n;e.preventDefault();const o=this._state;this.removeDropTarget(),null===(n=null===(t=(i=this.options).getOverrideTarget)||void 0===t?void 0:t.call(i))||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[ye.USED_EVENT_ID]=!0}isAlreadyUsed(e){const i=e[ye.USED_EVENT_ID];return"boolean"==typeof i&&i}toggleClasses(e,i,t){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=i<100,c=t<100,v="left"===e,u="right"===e,m="top"===e,g="bottom"===e,b=!p&&u,w=!p&&v,f=!c&&m,_=!c&&g;let y=1;const x=null!==(r=null===(s=this.options.overlayModel)||void 0===s?void 0:s.size)&&void 0!==r?r:De;if("percentage"===x.type?y=N(x.value,0,100)/100:((b||w)&&(y=N(0,x.value,i)/i),(f||_)&&(y=N(0,x.value,t)/t)),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,x=r.getBoundingClientRect(),z=o.top-x.top,C=o.left-x.left,S={top:z,left:C,width:i,height:t};if(b?(S.left=C+i*(1-y),S.width=i*y):w?S.width=i*y:f?S.height=t*y:_&&(S.top=z+t*(1-y),S.height=t*y),p&&v&&(S.width=4),p&&u&&(S.left=C+i-4,S.width=4),!function(e,i){const{top:t,left:n,width:o,height:s}=i,r=`${Math.round(t)}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,S))return;return function(e,i){const{top:t,left:n,width:o,height:s}=i,r=`${Math.round(t)}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,S),c.className="dv-drop-target-anchor"+(this.options.className?` ${this.options.className}`:""),D(c,"dv-drop-target-left",v),D(c,"dv-drop-target-right",u),D(c,"dv-drop-target-top",m),D(c,"dv-drop-target-bottom",g),D(c,"dv-drop-target-center","center"===e),void(s.changed&&(D(c,"dv-drop-target-anchor-container-changed",!0),setTimeout((()=>{D(c,"dv-drop-target-anchor-container-changed",!1)}),10)))}if(!this.overlayElement)return;const z={top:"0px",left:"0px",width:"100%",height:"100%"};b?(z.left=100*(1-y)+"%",z.width=100*y+"%"):w?z.width=100*y+"%":f?z.height=100*y+"%":_&&(z.top=100*(1-y)+"%",z.height=100*y+"%"),function(e,i){const{top:t,left:n,width:o,height:s}=i;e.style.top=t,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,z),D(this.overlayElement,"dv-drop-target-small-vertical",c),D(this.overlayElement,"dv-drop-target-small-horizontal",p),D(this.overlayElement,"dv-drop-target-left",v),D(this.overlayElement,"dv-drop-target-right",u),D(this.overlayElement,"dv-drop-target-top",m),D(this.overlayElement,"dv-drop-target-bottom",g),D(this.overlayElement,"dv-drop-target-center","center"===e)}calculateQuadrant(e,i,t,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:_e;return"percentage"===a.type?function(e,i,t,n,o,s){const r=100*i/n,a=100*t/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,i,t,n,o,a.value):function(e,i,t,n,o,s){if(e.has("left")&&i<s)return"left";if(e.has("right")&&i>n-s)return"right";if(e.has("top")&&t<s)return"top";if(e.has("bottom")&&t>o-s)return"bottom";if(!e.has("center"))return null;return"center"}(e,i,t,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)}}ye.USED_EVENT_ID="__dockview_droptarget_event_is_used__";const xe=(()=>{const e={disableAutoResizing:void 0,disableDnd:void 0,className:void 0};return Object.keys(e)})();class ze extends h{constructor(e,i,t,n){super(),this.nativeEvent=e,this.position=i,this.getData=t,this.panel=n}}class Ce extends d{constructor(){super()}}class Se extends m{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,i){super(),this.id=e,this.component=i,this._isFocused=!1,this._isActive=!1,this._isVisible=!0,this._width=0,this._height=0,this._parameters={},this.panelUpdatesDisposable=new g,this._onDidDimensionChange=new c,this.onDidDimensionsChange=this._onDidDimensionChange.event,this._onDidChangeFocus=new c,this.onDidFocusChange=this._onDidChangeFocus.event,this._onWillFocus=new c,this.onWillFocus=this._onWillFocus.event,this._onDidVisibilityChange=new c,this.onDidVisibilityChange=this._onDidVisibilityChange.event,this._onWillVisibilityChange=new c,this.onWillVisibilityChange=this._onWillVisibilityChange.event,this._onDidActiveChange=new c,this.onDidActiveChange=this._onDidActiveChange.event,this._onActiveChange=new c,this.onActiveChange=this._onActiveChange.event,this._onDidParametersChange=new c,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((i=>{this._parameters=i,e.update({params:i})}))}setVisible(e){this._onWillVisibilityChange.fire({isVisible:e})}setActive(){this._onActiveChange.fire()}updateParameters(e){this._onDidParametersChange.fire(e)}}class Ae extends Se{constructor(e,i){super(e,i),this._onDidConstraintsChangeInternal=new c,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new c({replay:!0}),this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new c,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 ke extends Ae{set pane(e){this._pane=e}constructor(e,i){super(e,i),this._onDidExpansionChange=new c({replay:!0}),this.onDidExpansionChange=this._onDidExpansionChange.event,this._onMouseEnter=new c({}),this.onMouseEnter=this._onMouseEnter.event,this._onMouseLeave=new c({}),this.onMouseLeave=this._onMouseLeave.event,this.addDisposables(this._onDidExpansionChange,this._onMouseEnter,this._onMouseLeave)}setExpanded(e){var i;null===(i=this._pane)||void 0===i||i.setExpanded(e)}get isExpanded(){var e;return!!(null===(e=this._pane)||void 0===e?void 0:e.isExpanded())}}class Pe extends m{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,i,t){super(),this.id=e,this.component=i,this.api=t,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=x(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 Ce;this.api._onWillFocus.fire(e),e.defaultPrevented||this._element.focus()}layout(e,i){this._width=e,this._height=i,this.api._onDidDimensionChange.fire({width:e,height:i}),this.part&&this._params&&this.part.update(this._params.params)}init(e){this._params=e,this.part=this.getComponent()}update(e){var i,t;this._params=Object.assign(Object.assign({},this._params),{params:Object.assign(Object.assign({},null===(i=this._params)||void 0===i?void 0:i.params),e.params)});for(const i of Object.keys(e.params))void 0===e.params[i]&&delete this._params.params[i];null===(t=this.part)||void 0===t||t.update({params:this._params.params})}toJSON(){var e,i;const t=null!==(i=null===(e=this._params)||void 0===e?void 0:e.params)&&void 0!==i?i:{};return{id:this.id,component:this.component,params:Object.keys(t).length>0?t:void 0}}dispose(){var e;this.api.dispose(),null===(e=this.part)||void 0===e||e.dispose(),super.dispose()}}class Ee extends Pe{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 ke(e.id,e.component)),this._onDidChangeExpansionState=new c({replay:!0}),this.onDidChangeExpansionState=this._onDidChangeExpansionState.event,this._onDidChange=new c,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:i}=e,{accessor:t}=this._params;t.setVisible(this,i)})),this.api.onDidSizeChange((e=>{this._onDidChange.fire({size:e.size})})),v(this.element,"mouseenter",(e=>{this.api._onMouseEnter.fire(e)})),v(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?_(this.header,"focused"):f(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(i,t){this._size=i,this._orthogonalSize=t;const[n,o]=this.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];super.layout(n,o)}init(e){var i,t;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===(i=this.body)||void 0===i||i.append(this.bodyPart.element),null===(t=this.header)||void 0===t||t.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 i,t;null===(i=this.bodyPart)||void 0===i||i.update({params:e}),null===(t=this.headerPart)||void 0===t||t.update({params:e})},dispose:()=>{var e,i;null===(e=this.bodyPart)||void 0===e||e.dispose(),null===(i=this.headerPart)||void 0===i||i.dispose()}}}}class Oe extends Ee{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 c,this.onDidDrop=this._onDidDrop.event,this._onUnhandledDragOverEvent=new c,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,i=this.accessor.id;this.header.draggable=!0,this.handler=new class extends me{getData(){return s.getInstance().setData([new o(i,e)],o.prototype),{dispose:()=>{s.getInstance().clearData(o.prototype)}}}}(this.header),this.target=new ye(this.element,{acceptedTargetZones:["top","bottom"],overlayModel:{activationSize:{type:"percentage",value:50}},canDisplayOverlay:(e,i)=>{const t=a();if(t&&t.paneId!==this.id&&t.viewId===this.accessor.id)return!0;const n=new ze(e,i,a,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 i=a();if(!i||i.viewId!==this.accessor.id)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,api:new ce(this.accessor),getData:a}));const t=this._params.containerApi,n=i.paneId,o=t.getPanel(n);if(!o)return void this._onDidDrop.fire(Object.assign(Object.assign({},e),{panel:this,getData:a,api:new ce(this.accessor)}));const s=t.panels,r=s.indexOf(o);let d=t.panels.indexOf(this);"left"!==e.position&&"top"!==e.position||(d=Math.max(0,d-1)),"right"!==e.position&&"bottom"!==e.position||(r>d&&d++,d=Math.min(s.length-1,d)),t.movePanel(r,d)}}class Ge extends m{get element(){return this._element}constructor(e,i){super(),this.accessor=e,this.group=i,this.disposable=new g,this._onDidFocus=new c,this.onDidFocus=this._onDidFocus.event,this._onDidBlur=new c,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 t=i.dropTargetContainer;this.dropTarget=new ye(this.element,{getOverlayOutline:()=>{var i;return"group"===(null===(i=e.options.theme)||void 0===i?void 0:i.dndPanelOverlay)?this.element.parentElement:null},className:"dv-drop-target-content",acceptedTargetZones:["top","bottom","left","right","center"],canDisplayOverlay:(e,i)=>{if("no-drop-target"===this.group.locked||this.group.locked&&"center"===i)return!1;const t=r();return!(!t&&e.shiftKey&&"floating"!==this.group.location.type)&&(!(!t||t.viewId!==this.accessor.id)||this.group.canDisplayOverlay(e,i,"content"))},getOverrideTarget:t?()=>t.model:void 0}),this.addDisposables(this.dropTarget)}show(){this.element.style.display=""}hide(){this.element.style.display="none"}renderPanel(e,i={asActive:!0}){const t=i.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&&t&&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(t){const e=x(n),i=new m;i.addDisposables(e,e.onDidFocus((()=>this._onDidFocus.fire())),e.onDidBlur((()=>this._onDidBlur.fire()))),this.disposable.value=i}}openPanel(e){this.panel!==e&&this.renderPanel(e)}layout(e,i){}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 Ie(e,i,t){var n,o;_(i,"dv-dragged"),i.style.top="-9999px",document.body.appendChild(i),e.setDragImage(i,null!==(n=null==t?void 0:t.x)&&void 0!==n?n:0,null!==(o=null==t?void 0:t.y)&&void 0!==o?o:0),setTimeout((()=>{f(i,"dv-dragged"),i.remove()}),0)}class Ve extends me{constructor(e,i,t,n,o){super(e,o),this.accessor=i,this.group=t,this.panel=n,this.panelTransfer=s.getInstance()}getData(e){return this.panelTransfer.setData([new n(this.accessor.id,this.group.id,this.panel.id)],n.prototype),{dispose:()=>{this.panelTransfer.clearData(n.prototype)}}}}class Ne extends m{get element(){return this._element}constructor(e,i,t){super(),this.panel=e,this.accessor=i,this.group=t,this.content=void 0,this._onPointDown=new c,this.onPointerDown=this._onPointDown.event,this._onDropped=new c,this.onDrop=this._onDropped.event,this._onDragStart=new c,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,D(this.element,"dv-inactive-tab",!0),this.dragHandler=new Ve(this._element,this.accessor,this.group,this.panel,!!this.accessor.options.disableDnd),this.dropTarget=new ye(this._element,{acceptedTargetZones:["left","right"],overlayModel:{activationSize:{value:50,type:"percentage"}},canDisplayOverlay:(e,i)=>{if(this.group.locked)return!1;const t=r();return!(!t||this.accessor.id!==t.viewId)||this.group.model.canDisplayOverlay(e,i,"tab")},getOverrideTarget:()=>{var e;return null===(e=t.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 i=getComputedStyle(this.element),t=this.element.cloneNode(!0);Array.from(i).forEach((e=>t.style.setProperty(e,i.getPropertyValue(e),i.getPropertyPriority(e)))),t.style.position="absolute",Ie(e.dataTransfer,t,{y:-10,x:30})}this._onDragStart.fire(e)})),this.dragHandler,v(this._element,"pointerdown",(e=>{this._onPointDown.fire(e)})),this.dropTarget.onDrop((e=>{this._onDropped.fire(e)})),this.dropTarget)}setActive(e){D(this.element,"dv-active-tab",e),D(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 Te{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,i){this.event=e,this.options=i}}class Le extends me{constructor(e,i,t,n){super(e,n),this.accessor=i,this.group=t,this.panelTransfer=s.getInstance(),this.addDisposables(v(e,"pointerdown",(e=>{e.shiftKey&&(e[C]=!0)}),!0))}isCancelled(e){return"floating"===this.group.api.location.type&&!e.shiftKey}getData(e){const i=e.dataTransfer;this.panelTransfer.setData([new n(this.accessor.id,this.group.id,null)],n.prototype);const t=window.getComputedStyle(this.el),o=t.getPropertyValue("--dv-activegroup-visiblepanel-tab-background-color"),s=t.getPropertyValue("--dv-activegroup-visiblepanel-tab-color");if(i){const e=document.createElement("div");e.style.backgroundColor=o,e.style.color=s,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})`,Ie(i,e,{y:-10,x:30})}return{dispose:()=>{this.panelTransfer.clearData(n.prototype)}}}}class Me extends m{get element(){return this._element}constructor(e,i){super(),this.accessor=e,this.group=i,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onDragStart=new c,this.onDragStart=this._onDragStart.event,this._element=document.createElement("div"),this._element.className="dv-void-container",this._element.draggable=!this.accessor.options.disableDnd,D(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.addDisposables(this._onDrop,this._onDragStart,v(this._element,"pointerdown",(()=>{this.accessor.doSetGroupActive(this.group)}))),this.handler=new Le(this._element,e,i,!!this.accessor.options.disableDnd),this.dropTarget=new ye(this._element,{acceptedTargetZones:["center"],canDisplayOverlay:(e,t)=>{const n=r();return!(!n||this.accessor.id!==n.viewId)||i.model.canDisplayOverlay(e,t,"header_space")},getOverrideTarget:()=>{var e;return null===(e=i.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,D(this._element,"dv-draggable",!this.accessor.options.disableDnd),this.handler.setDisabled(!!this.accessor.options.disableDnd)}}class Re extends m{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(v(this.element,"wheel",(e=>{this._scrollLeft+=e.deltaY*Re.MouseWheelSpeed,this.calculateScrollbarStyles()})),v(this._horizontalScrollbar,"pointerdown",(e=>{e.preventDefault(),D(this.element,"dv-scrollable-scrolling",!0);const i=e.clientX,t=this._scrollLeft,n=e=>{const n=e.clientX-i,{clientWidth:o}=this.element,{scrollWidth:s}=this.scrollableElement,r=o/s;this._scrollLeft=t+n/r,this.calculateScrollbarStyles()},o=()=>{D(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)})),v(this.element,"scroll",(()=>{this.calculateScrollbarStyles()})),v(this.scrollableElement,"scroll",(()=>{this._scrollLeft=this.scrollableElement.scrollLeft,this.calculateScrollbarStyles()})),w(this.element,(()=>{D(this.element,"dv-scrollable-resizing",!0),this._animationTimer&&clearTimeout(this._animationTimer),this._animationTimer=setTimeout((()=>{clearTimeout(this._animationTimer),D(this.element,"dv-scrollable-resizing",!1)}),500),this.calculateScrollbarStyles()})))}calculateScrollbarStyles(){const{clientWidth:e}=this.element,{scrollWidth:i}=this.scrollableElement;if(i>e){const t=e*(e/i);this._horizontalScrollbar.style.width=`${t}px`,this._scrollLeft=N(this._scrollLeft,0,this.scrollableElement.scrollWidth-e),this.scrollableElement.scrollLeft=this._scrollLeft;const n=this._scrollLeft/(i-e);this._horizontalScrollbar.style.left=(e-t)*n+"px"}else this._horizontalScrollbar.style.width="0px",this._horizontalScrollbar.style.left="0px",this._scrollLeft=0}}Re.MouseWheelSpeed=1;class We extends m{get showTabsOverflowControl(){return this._showTabsOverflowControl}set showTabsOverflowControl(e){if(this._showTabsOverflowControl!=e&&(this._showTabsOverflowControl=e,e)){const e=new b(this._tabsList);this._observerDisposable.value=new m(e,e.onDidChange((e=>{const i=e.hasScrollX||e.hasScrollY;this.toggleDropdown({reset:!i})})),v(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(i,t,n){if(super(),this.group=i,this.accessor=t,this._observerDisposable=new g,this._tabs=[],this.selectedIndex=-1,this._showTabsOverflowControl=!1,this._onTabDragStart=new c,this.onTabDragStart=this._onTabDragStart.event,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onOverflowTabsChange=new c,this.onOverflowTabsChange=this._onOverflowTabsChange.event,this._tabsList=document.createElement("div"),this._tabsList.className="dv-tabs-container dv-horizontal",this.showTabsOverflowControl=n.showTabsOverflowControl,"native"===t.options.scrollbars)this._element=this._tabsList;else{const e=new Re(this._tabsList);this._element=e.element,this.addDisposables(e)}this.addDisposables(this._onOverflowTabsChange,this._observerDisposable,this._onWillShowOverlay,this._onDrop,this._onTabDragStart,v(this.element,"pointerdown",(e=>{if(e.defaultPrevented)return;0===e.button&&this.accessor.doSetGroupActive(this.group)})),e.DockviewDisposable.from((()=>{for(const{value:e,disposable:i}of this._tabs)i.dispose(),e.dispose();this._tabs=[]})))}indexOf(e){return this._tabs.findIndex((i=>i.value.panel.id===e))}isActive(e){return this.selectedIndex>-1&&this._tabs[this.selectedIndex].value===e}setActivePanel(e){let i=0;for(const t of this._tabs){const n=e.id===t.value.panel.id;if(t.value.setActive(n),n){const e=t.value.element,n=e.parentElement;(i<n.scrollLeft||i+e.clientWidth>n.scrollLeft+n.clientWidth)&&(n.scrollLeft=i)}i+=t.value.element.clientWidth}}openPanel(e,i=this._tabs.length){if(this._tabs.find((i=>i.value.panel.id===e.id)))return;const t=new Ne(e,this.accessor,this.group);t.setContent(e.view.tab);const n=new m(t.onDragStart((i=>{this._onTabDragStart.fire({nativeEvent:i,panel:e})})),t.onPointerDown((i=>{if(i.defaultPrevented)return;const n=!this.accessor.options.disableFloatingGroups,o="floating"===this.group.api.location.type&&1===this.size;if(n&&!o&&i.shiftKey){i.preventDefault();const e=this.accessor.getGroupPanel(t.panel.id),{top:n,left:o}=t.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===i.button)this.group.activePanel!==e&&this.group.model.openPanel(e)})),t.onDrop((e=>{this._onDrop.fire({event:e.nativeEvent,index:this._tabs.findIndex((e=>e.value===t))})})),t.onWillShowOverlay((e=>{this._onWillShowOverlay.fire(new Te(e,{kind:"tab",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:r}))}))),o={value:t,disposable:n};this.addTab(o,i)}delete(e){const i=this.indexOf(e),t=this._tabs.splice(i,1)[0],{value:n,disposable:o}=t;o.dispose(),n.dispose(),n.element.remove()}addTab(e,i=this._tabs.length){if(i<0||i>this._tabs.length)throw new Error("invalid location");this._tabsList.insertBefore(e.value.element,this._tabsList.children[i]),this._tabs=[...this._tabs.slice(0,i),e,...this._tabs.slice(i)],this.selectedIndex<0&&(this.selectedIndex=i)}toggleDropdown(e){const i=e.reset?[]:this._tabs.filter((e=>!function(e,i){const t=A(e),n=A(i);return!(t.left<n.left||t.left+t.width>n.left+n.width)}(e.value.element,this._tabsList))).map((e=>e.value.panel.id));this._onOverflowTabsChange.fire({tabs:i,reset:e.reset})}updateDragAndDropState(){for(const e of this._tabs)e.value.updateDragAndDropState()}}const He=e=>{const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"height",e.height),i.setAttributeNS(null,"width",e.width),i.setAttributeNS(null,"viewBox",e.viewbox),i.setAttributeNS(null,"aria-hidden","false"),i.setAttributeNS(null,"focusable","false"),i.classList.add("dv-svg");const t=document.createElementNS("http://www.w3.org/2000/svg","path");return t.setAttributeNS(null,"d",e.path),i.appendChild(t),i},Fe=()=>He({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 Be extends m{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,i){super(),this.accessor=e,this.group=i,this._hidden=!1,this.dropdownPart=null,this._overflowTabs=[],this._dropdownDisposable=new g,this._onDrop=new c,this.onDrop=this._onDrop.event,this._onGroupDragStart=new c,this.onGroupDragStart=this._onGroupDragStart.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._element=document.createElement("div"),this._element.className="dv-tabs-and-actions-container",D(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 We(i,e,{showTabsOverflowControl:!e.options.disableTabsOverflowList}),this.voidContainer=new Me(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 Te(e,{kind:"header_space",panel:this.group.activePanel,api:this.accessor.api,group:this.group,getData:r}))})),v(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:i,left:t}=this.element.getBoundingClientRect(),{top:n,left:o}=this.accessor.element.getBoundingClientRect();this.accessor.addFloatingGroup(this.group,{x:t-o+20,y:i-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,i=this.tabs.size){this.tabs.openPanel(e,i),this.updateClassnames()}closePanel(e){this.delete(e.id)}updateClassnames(){D(this._element,"dv-single-tab",1===this.size)}toggleDropdown(i){const t=i.reset?[]:i.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 n=document.createElement("div");n.className="dv-tabs-overflow-dropdown-root";const o=function(){const e=document.createElement("div");e.className="dv-tabs-overflow-dropdown-default";const i=document.createElement("span");i.textContent="";const t=Fe();return e.appendChild(t),e.appendChild(i),{element:e,update:e=>{i.textContent=`${e.tabs}`}}}();o.update({tabs:t.length}),this.dropdownPart=o,n.appendChild(o.element),this.rightActionsContainer.prepend(n),this._dropdownDisposable.value=new m(e.DockviewDisposable.from((()=>{var e,i;n.remove(),null===(i=null===(e=this.dropdownPart)||void 0===e?void 0:e.dispose)||void 0===i||i.call(e),this.dropdownPart=null})),v(n,"pointerdown",(e=>{e.preventDefault()}),{capture:!0}),v(n,"click",(e=>{const i=document.createElement("div");i.style.overflow="auto",i.className="dv-tabs-overflow-container";for(const e of this.tabs.tabs.filter((e=>this._overflowTabs.includes(e.panel.id)))){const t=this.group.panels.find((i=>i===e.panel)),n=t.view.createTabRenderer("headerOverflow").element,o=document.createElement("div");D(o,"dv-tab",!0),D(o,"dv-active-tab",t.api.isActive),D(o,"dv-inactive-tab",!t.api.isActive),o.addEventListener("click",(i=>{this.accessor.popupService.close(),i.defaultPrevented||(e.element.scrollIntoView(),e.panel.api.setActive())})),o.appendChild(n),i.appendChild(o)}const t=function(e){let i=e;for(;i&&("auto"===i.style.zIndex||""===i.style.zIndex);)i=i.parentElement;return i}(n);this.accessor.popupService.openPopover(i,{x:e.clientX,y:e.clientY,zIndex:(null==t?void 0:t.style.zIndex)?`calc(${t.style.zIndex} * 2)`:void 0})})))}updateDragAndDropState(){this.tabs.updateDragAndDropState(),this.voidContainer.updateDragAndDropState()}}class Ue extends h{constructor(e,i,t,n,o){super(),this.nativeEvent=e,this.target=i,this.position=t,this.getData=n,this.group=o}}const Je=(()=>{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 $e(e){return!!e.referencePanel}function je(e){return!!e.referenceGroup}function Ze(e){return!!e.referencePanel}function Ye(e){return!!e.referenceGroup}class Xe extends d{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 Ke extends Xe{get kind(){return this._kind}constructor(e){super(e),this._kind=e.kind}}class qe extends m{get element(){throw new Error("dockview: not supported")}get activePanel(){return this._activePanel}get locked(){return this._locked}set locked(e){this._locked=e,D(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&&y(document.activeElement,this.contentContainer.element)}get location(){return this._location}set location(e){switch(this._location=e,D(this.container,"dv-groupview-floating",!1),D(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"]),D(this.container,"dv-groupview-floating",!0);break;case"popout":this.contentContainer.dropTarget.setTargetZones(["center"]),D(this.container,"dv-groupview-popout",!0)}this.groupPanel.api._onDidLocationChange.fire({location:this.location})}constructor(e,i,t,n,o){var s;super(),this.container=e,this.accessor=i,this.id=t,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 c,this.onDidChange=this._onDidChange.event,this._width=0,this._height=0,this._panels=[],this._panelDisposables=new Map,this._onMove=new c,this.onMove=this._onMove.event,this._onDidDrop=new c,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new c,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onTabDragStart=new c,this.onTabDragStart=this._onTabDragStart.event,this._onGroupDragStart=new c,this.onGroupDragStart=this._onGroupDragStart.event,this._onDidAddPanel=new c,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPanelTitleChange=new c,this.onDidPanelTitleChange=this._onDidPanelTitleChange.event,this._onDidPanelParametersChange=new c,this.onDidPanelParametersChange=this._onDidPanelParametersChange.event,this._onDidRemovePanel=new c,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidActivePanelChange=new c,this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onUnhandledDragOverEvent=new c,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,D(this.container,"dv-groupview",!0),this._api=new ue(this.accessor),this.tabsContainer=new Be(this.accessor,this.groupPanel),this.contentContainer=new Ge(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 Te(e,{kind:"content",panel:this.activePanel,api:this._api,group:this.groupPanel,getData:r}))})),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 i={views:this.tabsContainer.panels,activeView:null===(e=this._activePanel)||void 0===e?void 0:e.id,id:this.id};return!1!==this.locked&&(i.locked=this.locked),this.header.hidden&&(i.hideHeader=!0),i}moveToNext(e){e||(e={}),e.panel||(e.panel=this.activePanel);const i=e.panel?this.panels.indexOf(e.panel):-1;let t;if(i<this.panels.length-1)t=i+1;else{if(e.suppressRoll)return;t=0}this.openPanel(this.panels[t])}moveToPrevious(e){if(e||(e={}),e.panel||(e.panel=this.activePanel),!e.panel)return;const i=this.panels.indexOf(e.panel);let t;if(i>0)t=i-1;else{if(e.suppressRoll)return;t=this.panels.length-1}this.openPanel(this.panels[t])}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,i={}){("number"!=typeof i.index||i.index>this.panels.length)&&(i.index=this.panels.length);const t=!!i.skipSetActive;e.updateParentGroup(this.groupPanel,{skipSetActive:i.skipSetActive}),this.doAddPanel(e,i.index,{skipSetActive:t}),this._activePanel!==e?(t||this.doSetActivePanel(e),i.skipSetGroupActive||this.accessor.doSetGroupActive(this.groupPanel),i.skipSetActive||this.updateContainer()):this.contentContainer.renderPanel(e,{asActive:!0})}removePanel(e,i={skipSetActive:!1}){const t="string"==typeof e?e:e.id,n=this._panels.find((e=>e.id===t));if(!n)throw new Error("invalid operation");return this._removePanel(n,i)}closeAllPanels(){if(this.panels.length>0){const e=[...this.panels];for(const i of e)this.doClose(i)}else this.accessor.removeGroup(this.groupPanel)}closePanel(e){this.doClose(e)}doClose(e){const i=1===this.panels.length&&1===this.accessor.groups.length;this.accessor.removePanel(e,i&&"emptyGroup"===this.accessor.options.noPanelsOverlay?{removeEmptyGroup:!1}:void 0)}isPanelActive(e){return this._activePanel===e}updateActions(e){this.tabsContainer.setRightActionsElement(e)}setActive(e,i=!1){(i||this.isActive!==e)&&(this._isGroupActive=e,D(this.container,"dv-active-group",e),D(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,i){var t;this._width=e,this._height=i,this.contentContainer.layout(this._width,this._height),(null===(t=this._activePanel)||void 0===t?void 0:t.layout)&&this._activePanel.layout(this._width,this._height)}_removePanel(e,i){const t=this._activePanel===e;if(this.doRemovePanel(e),t&&this.panels.length>0){const e=this.mostRecentlyUsed[0];this.openPanel(e,{skipSetActive:i.skipSetActive,skipSetGroupActive:i.skipSetActiveGroup})}return this._activePanel&&0===this.panels.length&&this.doSetActivePanel(void 0),i.skipSetActive||this.updateContainer(),e}doRemovePanel(e){const i=this.panels.indexOf(e);if(this._activePanel===e&&this.contentContainer.closePanel(),this.tabsContainer.delete(e.id),this._panels.splice(i,1),this.mostRecentlyUsed.includes(e)){const i=this.mostRecentlyUsed.indexOf(e);this.mostRecentlyUsed.splice(i,1)}const t=this._panelDisposables.get(e.id);t&&(t.dispose(),this._panelDisposables.delete(e.id)),this._onDidRemovePanel.fire({panel:e})}doAddPanel(e,i=this.panels.length,t={skipSetActive:!1}){const n=this._panels.indexOf(e)>-1;this.tabsContainer.show(),this.contentContainer.show(),this.tabsContainer.openPanel(e,i),t.skipSetActive||this.contentContainer.openPanel(e),n||(this.updateMru(e),this.panels.splice(i,0,e),this._panelDisposables.set(e.id,new m(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,i;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,v(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===(i=(e=this.watermark).dispose)||void 0===i||i.call(e),this.watermark=void 0)}canDisplayOverlay(e,i,t){const n=new Ue(e,t,i,r,this.accessor.getPanel(this.id));return this._onUnhandledDragOverEvent.fire(n),n.isAccepted}handleDropEvent(e,i,t,n){if("no-drop-target"===this.locked)return;const o="number"==typeof n?this.panels[n]:void 0,s=new Ke({nativeEvent:i,position:t,panel:o,getData:()=>r(),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 a=r();if(a&&a.viewId===this.accessor.id){if("content"===e&&a.groupId===this.id){if("center"===t)return;if(null===a.panelId)return}if("header"===e&&a.groupId===this.id&&null===a.panelId)return;if(null===a.panelId){const{groupId:e}=a;return void this._onMove.fire({target:t,groupId:e,index:n})}if(-1!==this.tabsContainer.indexOf(a.panelId)&&1===this.tabsContainer.size)return;const{groupId:i,panelId:o}=a;if(this.id===i&&!t){if(this.tabsContainer.indexOf(o)===n)return}this._onMove.fire({target:t,groupId:a.groupId,itemId:a.panelId,index:n})}else this._onDidDrop.fire(new Xe({nativeEvent:i,position:t,panel:o,getData:()=>r(),group:this.groupPanel,api:this._api}))}updateDragAndDropState(){this.tabsContainer.updateDragAndDropState()}dispose(){var e,i,t;super.dispose(),null===(e=this.watermark)||void 0===e||e.element.remove(),null===(t=null===(i=this.watermark)||void 0===i?void 0:i.dispose)||void 0===t||t.call(i),this.watermark=void 0;for(const e of this.panels)e.dispose();this.tabsContainer.dispose(),this.contentContainer.dispose()}}class Qe extends Se{constructor(e,i,t){super(e,i),this._onDidConstraintsChangeInternal=new c,this.onDidConstraintsChangeInternal=this._onDidConstraintsChangeInternal.event,this._onDidConstraintsChange=new c,this.onDidConstraintsChange=this._onDidConstraintsChange.event,this._onDidSizeChange=new c,this.onDidSizeChange=this._onDidSizeChange.event,this.addDisposables(this._onDidConstraintsChangeInternal,this._onDidConstraintsChange,this._onDidSizeChange),t&&this.initialize(t)}setConstraints(e){this._onDidConstraintsChangeInternal.fire(e)}setSize(e){this._onDidSizeChange.fire(e)}}class ei extends Pe{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,i,t,n){super(e,i,null!=n?n:new Qe(e,i)),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 c,this.onDidChange=this._onDidChange.event,"number"==typeof(null==t?void 0:t.minimumWidth)&&(this._minimumWidth=t.minimumWidth),"number"==typeof(null==t?void 0:t.maximumWidth)&&(this._maximumWidth=t.maximumWidth),"number"==typeof(null==t?void 0:t.minimumHeight)&&(this._minimumHeight=t.minimumHeight),"number"==typeof(null==t?void 0:t.maximumHeight)&&(this._maximumHeight=t.maximumHeight),this.api.initialize(this),this.addDisposables(this.api.onWillVisibilityChange((e=>{const{isVisible:i}=e,{accessor:t}=this._params;t.setVisible(this,i)})),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(),i=e=>e===Number.MAX_SAFE_INTEGER?void 0:e,t=e=>e<=0?void 0:e;return Object.assign(Object.assign({},e),{minimumHeight:t(this.minimumHeight),maximumHeight:i(this.maximumHeight),minimumWidth:t(this.minimumWidth),maximumWidth:i(this.maximumWidth),snap:this.snap,priority:this.priority})}}const ii="dockview: DockviewGroupPanelApiImpl not initialized";class ti extends Qe{get location(){if(!this._group)throw new Error(ii);return this._group.model.location}constructor(e,i){super(e,"__dockviewgroup__"),this.accessor=i,this._onDidLocationChange=new c,this.onDidLocationChange=this._onDidLocationChange.event,this._onDidActivePanelChange=new c,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 i,t,n,o;if(!this._group)throw new Error(ii);const s=null!==(i=e.group)&&void 0!==i?i:this.accessor.addGroup({direction:fe(null!==(t=e.position)&&void 0!==t?t:"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(ii);"grid"===this.location.type&&this.accessor.maximizeGroup(this._group)}isMaximized(){if(!this._group)throw new Error(ii);return this.accessor.isMaximizedGroup(this._group)}exitMaximized(){if(!this._group)throw new Error(ii);this.isMaximized()&&this.accessor.exitMaximizedGroup()}initialize(e){this._group=e}}class ni extends ei{get minimumWidth(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.minimumWidth;return"number"==typeof i?i:super.__minimumWidth()}get minimumHeight(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.minimumHeight;return"number"==typeof i?i:super.__minimumHeight()}get maximumWidth(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.maximumWidth;return"number"==typeof i?i:super.__maximumWidth()}get maximumHeight(){var e;const i=null===(e=this.activePanel)||void 0===e?void 0:e.maximumHeight;return"number"==typeof i?i: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,i,t){var n,o,s,r,a,d;super(i,"groupview_default",{minimumHeight:null!==(o=null===(n=t.constraints)||void 0===n?void 0:n.minimumHeight)&&void 0!==o?o:100,minimumWidth:null!==(r=null===(s=t.constraints)||void 0===s?void 0:s.maximumHeight)&&void 0!==r?r:100,maximumHeight:null===(a=t.constraints)||void 0===a?void 0:a.maximumHeight,maximumWidth:null===(d=t.constraints)||void 0===d?void 0:d.maximumWidth},new ti(i,e)),this.api.initialize(this),this._model=new qe(this.element,e,i,t,this),this.addDisposables(this.model.onDidActivePanelChange((e=>{this.api._onDidActivePanelChange.fire(e)})))}focus(){this.api.isActive||this.api.setActive(),super.focus()}initialize(){this._model.initialize()}setActive(e){super.setActive(e),this.model.setActive(e)}layout(e,i){super.layout(e,i),this.model.layout(e,i)}getComponent(){return this._model}toJSON(){return this.model.toJSON()}}const oi={name:"abyss",className:"dockview-theme-abyss"};class si extends Qe{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 i=this._group;this._group!==e&&(this._group=e,this._onDidGroupChange.fire({}),this.setupGroupEventListeners(i),this._onDidLocationChange.fire({location:this.group.api.location}))}get group(){return this._group}get tabComponent(){return this._tabComponent}constructor(e,i,t,n,o){super(e.id,n),this.panel=e,this.accessor=t,this._onDidTitleChange=new c,this.onDidTitleChange=this._onDidTitleChange.event,this._onDidActiveGroupChange=new c,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._onDidGroupChange=new c,this.onDidGroupChange=this._onDidGroupChange.event,this._onDidRendererChange=new c,this.onDidRendererChange=this._onDidRendererChange.event,this._onDidLocationChange=new c,this.onDidLocationChange=this._onDidLocationChange.event,this.groupEventsDisposable=new g,this._tabComponent=o,this.initialize(e),this._group=i,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 i,t;this.accessor.moveGroupOrPanel({from:{groupId:this._group.id,panelId:this.panel.id},to:{group:null!==(i=e.group)&&void 0!==i?i:this._group,position:e.group&&null!==(t=e.position)&&void 0!==t?t:"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 i;let t=null!==(i=null==e?void 0:e.isActive)&&void 0!==i&&i;this.groupEventsDisposable.value=new m(this.group.api.onDidVisibilityChange((e=>{const i=!e.isVisible&&this.isVisible,t=e.isVisible&&!this.isVisible,n=this.group.model.isPanelActive(this.panel);(i||t&&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&&t!==this.isGroupActive&&(t=this.isGroupActive,this._onDidActiveGroupChange.fire({isActive:this.isGroupActive}))})))}}class ri extends m{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,i,t,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 si(this,this._group,n,i,t),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 Ce;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 i;this._params=Object.assign(Object.assign({},null!==(i=this._params)&&void 0!==i?i:{}),e.params);for(const i of Object.keys(e.params))void 0===e.params[i]&&delete this._params[i];this.view.update({params:this._params})}updateParentGroup(e,i){this._group=e,this.api.group=this._group;const t=this._group.model.isPanelActive(this),n=this.group.api.isActive&&t;(null==i?void 0:i.skipSetActive)||this.api.isActive!==n&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&t}),this.api.isVisible!==t&&this.api._onDidVisibilityChange.fire({isVisible:t})}runEvents(){const e=this._group.model.isPanelActive(this),i=this.group.api.isActive&&e;this.api.isActive!==i&&this.api._onDidActiveChange.fire({isActive:this.group.api.isActive&&e}),this.api.isVisible!==e&&this.api._onDidVisibilityChange.fire({isVisible:e})}layout(e,i){this.api._onDidDimensionChange.fire({width:e,height:i}),this.view.layout(e,i)}dispose(){this.api.dispose(),this.view.dispose()}}class ai extends m{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(He({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()})),v(this.action,"pointerdown",(e=>{e.preventDefault()})),v(this.action,"click",(i=>{i.defaultPrevented||(i.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 di{get content(){return this._content}get tab(){return this._tab}constructor(e,i,t,n){this.accessor=e,this.id=i,this.contentComponent=t,this.tabComponent=n,this._content=this.createContentComponent(this.id,t),this._tab=this.createTabComponent(this.id,n)}createTabRenderer(e){var i;const t=this.createTabComponent(this.id,this.tabComponent);return this._params&&t.init(Object.assign(Object.assign({},this._params),{tabLocation:e})),this._updateEvent&&(null===(i=t.update)||void 0===i||i.call(t,this._updateEvent)),t}init(e){this._params=e,this.content.init(e),this.tab.init(Object.assign(Object.assign({},e),{tabLocation:"header"}))}layout(e,i){var t,n;null===(n=(t=this.content).layout)||void 0===n||n.call(t,e,i)}update(e){var i,t,n,o;this._updateEvent=e,null===(t=(i=this.content).update)||void 0===t||t.call(i,e),null===(o=(n=this.tab).update)||void 0===o||o.call(n,e)}dispose(){var e,i,t,n;null===(i=(e=this.content).dispose)||void 0===i||i.call(e),null===(n=(t=this.tab).dispose)||void 0===n||n.call(t)}createContentComponent(e,i){return this.accessor.options.createComponent({id:e,name:i})}createTabComponent(e,i){const t=null!=i?i:this.accessor.options.defaultTabComponent;if(t){if(this.accessor.options.createTabComponent){const i=this.accessor.options.createTabComponent({id:e,name:t});return i||new ai}console.warn(`dockview: tabComponent '${i}' was not found. falling back to the default tab.`)}return new ai}}class hi{constructor(e){this.accessor=e}fromJSON(e,i){var t,n;const o=e.id,s=e.params,r=e.title,a=e.view,d=a?a.content.id:null!==(t=e.contentComponent)&&void 0!==t?t:"unknown",h=a?null===(n=a.tab)||void 0===n?void 0:n.id:e.tabComponent,l=new di(this.accessor,o,d,h),p=new ri(o,d,h,this.accessor,new ue(this.accessor),i,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 li extends m{get element(){return this._element}constructor(){super(),this._element=document.createElement("div"),this._element.className="dv-watermark"}init(e){}}const pi=new class{constructor(){this._orderedList=[]}push(e){this._orderedList=[...this._orderedList.filter((i=>i!==e)),e],this.update()}destroy(e){this._orderedList=this._orderedList.filter((i=>i!==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 ci extends m{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 c,this.onDidChange=this._onDidChange.event,this._onDidChangeEnd=new c,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})),pi.push(this._element)}setVisible(e){e!==this.isVisible&&(this._isVisible=e,D(this.element,"dv-hidden",!this.isVisible))}bringToFront(){pi.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 i=this.options.container.getBoundingClientRect(),t=this._element.getBoundingClientRect(),n=Math.max(0,this.getMinimumWidth(t.width)),o=Math.max(0,this.getMinimumHeight(t.height));if("top"===this.verticalAlignment){const e=N(t.top-i.top,-o,Math.max(0,i.height-t.height+o));this._element.style.top=`${e}px`,this._element.style.bottom="auto"}if("bottom"===this.verticalAlignment){const e=N(i.bottom-t.bottom,-o,Math.max(0,i.height-t.height+o));this._element.style.bottom=`${e}px`,this._element.style.top="auto"}if("left"===this.horiziontalAlignment){const e=N(t.left-i.left,-n,Math.max(0,i.width-t.width+n));this._element.style.left=`${e}px`,this._element.style.right="auto"}if("right"===this.horiziontalAlignment){const e=N(i.right-t.right,-n,Math.max(0,i.width-t.width+n));this._element.style.right=`${e}px`,this._element.style.left="auto"}this._onDidChange.fire()}toJSON(){const e=this.options.container.getBoundingClientRect(),i=this._element.getBoundingClientRect(),t={};return"top"===this.verticalAlignment?t.top=parseFloat(this._element.style.top):"bottom"===this.verticalAlignment?t.bottom=parseFloat(this._element.style.bottom):t.top=i.top-e.top,"left"===this.horiziontalAlignment?t.left=parseFloat(this._element.style.left):"right"===this.horiziontalAlignment?t.right=parseFloat(this._element.style.right):t.left=i.left-e.left,t.width=i.width,t.height=i.height,t}setupDrag(e,i={inDragMode:!1}){const t=new g,n=()=>{let e=null;const i=k();t.value=new m({dispose:()=>{i.release()}},v(window,"pointermove",(i=>{const t=this.options.container.getBoundingClientRect(),n=i.clientX-t.left,o=i.clientY-t.top;D(this._element,"dv-resize-container-dragging",!0);const s=this._element.getBoundingClientRect();null===e&&(e={x:i.clientX-s.left,y:i.clientY-s.top});const r=Math.max(0,this.getMinimumWidth(s.width)),a=Math.max(0,this.getMinimumHeight(s.height)),d=N(o-e.y,-a,Math.max(0,t.height-s.height+a)),h=N(e.y-o+t.height-s.height,-a,Math.max(0,t.height-s.height+a)),l=N(n-e.x,-r,Math.max(0,t.width-s.width+r)),p=N(e.x-n+t.width-s.width,-r,Math.max(0,t.width-s.width+r)),c={};d<=h?c.top=d:c.bottom=h,l<=p?c.left=l:c.right=p,this.setBounds(c)})),v(window,"pointerup",(()=>{D(this._element,"dv-resize-container-dragging",!1),t.dispose(),this._onDidChangeEnd.fire()})))};this.addDisposables(t,v(e,"pointerdown",(e=>{e.defaultPrevented?e.preventDefault():S(e)||n()})),v(this.options.content,"pointerdown",(e=>{e.defaultPrevented||S(e)||e.shiftKey&&n()})),v(this.options.content,"pointerdown",(()=>{pi.push(this._element)}),!0)),i.inDragMode&&n()}setupResize(e){const i=document.createElement("div");i.className=`dv-resize-handle-${e}`,this._element.appendChild(i);const t=new g;this.addDisposables(t,v(i,"pointerdown",(i=>{i.preventDefault();let n=null;const o=k();t.value=new m(v(window,"pointermove",(i=>{const t=this.options.container.getBoundingClientRect(),o=this._element.getBoundingClientRect(),s=i.clientY-t.top,r=i.clientX-t.left;let a,d,h,l,p,c;null===n&&(n={originalY:s,originalHeight:o.height,originalX:r,originalWidth:o.width});const v=()=>{a=N(s,-Number.MAX_VALUE,n.originalY+n.originalHeight>t.height?this.getMinimumHeight(t.height):Math.max(0,n.originalY+n.originalHeight-ci.MINIMUM_HEIGHT)),h=n.originalY+n.originalHeight-a,d=t.height-a-h},u=()=>{a=n.originalY-n.originalHeight,h=N(s-a,a<0&&"number"==typeof this.options.minimumInViewportHeight?-a+this.options.minimumInViewportHeight:ci.MINIMUM_HEIGHT,Number.MAX_VALUE),d=t.height-a-h},m=()=>{l=N(r,-Number.MAX_VALUE,n.originalX+n.originalWidth>t.width?this.getMinimumWidth(t.width):Math.max(0,n.originalX+n.originalWidth-ci.MINIMUM_WIDTH)),c=n.originalX+n.originalWidth-l,p=t.width-l-c},g=()=>{l=n.originalX-n.originalWidth,c=N(r-l,l<0&&"number"==typeof this.options.minimumInViewportWidth?-l+this.options.minimumInViewportWidth:ci.MINIMUM_WIDTH,Number.MAX_VALUE),p=t.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()}},v(window,"pointerup",(()=>{t.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(){pi.destroy(this._element),this._element.remove(),super.dispose()}}ci.MINIMUM_HEIGHT=20,ci.MINIMUM_WIDTH=20;class vi extends m{constructor(e,i){super(),this.group=e,this.overlay=i,this.addDisposables(i)}position(e){this.overlay.setBounds(e)}}const ui=100,mi=100,gi=100,bi=300,wi=300;class fi{constructor(){this.cache=new Map,this.currentFrameId=0,this.rafId=null}getPosition(e){const i=this.cache.get(e);if(i&&i.frameId===this.currentFrameId)return i.rect;this.scheduleFrameUpdate();const t=A(e);return this.cache.set(e,{rect:t,frameId:this.currentFrameId}),t}invalidate(){this.currentFrameId++}scheduleFrameUpdate(){this.rafId||(this.rafId=requestAnimationFrame((()=>{this.currentFrameId++,this.rafId=null})))}}class _i extends m{constructor(i,t){super(),this.element=i,this.accessor=t,this.map={},this._disposed=!1,this.positionCache=new fi,this.pendingUpdates=new Set,this.addDisposables(e.DockviewDisposable.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:i,destroy:t}=this.map[e.api.id];return i.dispose(),t.dispose(),delete this.map[e.api.id],!0}return!1}attach(i){const{panel:t,referenceContainer:n}=i;if(!this.map[t.api.id]){const i=function(){const e=document.createElement("div");return e.tabIndex=-1,e}();i.className="dv-render-overlay",this.map[t.api.id]={panel:t,disposable:e.DockviewDisposable.NONE,destroy:e.DockviewDisposable.NONE,element:i}}const o=this.map[t.api.id].element;t.view.content.element.parentElement!==o&&o.appendChild(t.view.content.element),o.parentElement!==this.element&&this.element.appendChild(o);const s=()=>{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 i=this.positionCache.getPosition(n.element),s=this.positionCache.getPosition(this.element),r=i.left-s.left,a=i.top-s.top,d=i.width,h=i.height;o.style.left=`${r}px`,o.style.top=`${a}px`,o.style.width=`${d}px`,o.style.height=`${h}px`,D(o,"dv-render-overlay-float","floating"===t.group.api.location.type)})))},r=()=>{t.api.isVisible&&(this.positionCache.invalidate(),s()),o.style.display=t.api.isVisible?"":"none"},a=new g,d=()=>{"floating"===t.api.location.type?queueMicrotask((()=>{const i=this.accessor.floatingGroups.find((e=>e.group===t.api.group));if(!i)return;const n=i.overlay.element,s=()=>{const e=Number(n.getAttribute("aria-level"));o.style.zIndex=`calc(var(--dv-overlay-z-index, 999) + ${2*e+1})`},r=new MutationObserver((()=>{s()}));a.value=e.DockviewDisposable.from((()=>r.disconnect())),r.observe(n,{attributeFilter:["aria-level"],attributes:!0}),s()})):o.style.zIndex=""},h=new m(a,new ge(o,{onDragEnd:e=>{n.dropTarget.dnd.onDragEnd(e)},onDragEnter:e=>{n.dropTarget.dnd.onDragEnter(e)},onDragLeave:e=>{n.dropTarget.dnd.onDragLeave(e)},onDrop:e=>{n.dropTarget.dnd.onDrop(e)},onDragOver:e=>{n.dropTarget.dnd.onDragOver(e)}}),t.api.onDidVisibilityChange((()=>{r()})),t.api.onDidDimensionsChange((()=>{t.api.isVisible&&s()})),t.api.onDidLocationChange((()=>{d()})));return this.map[t.api.id].destroy=e.DockviewDisposable.from((()=>{var e;t.view.content.element.parentElement===o&&o.removeChild(t.view.content.element),null===(e=o.parentElement)||void 0===e||e.removeChild(o)})),d(),queueMicrotask((()=>{this.isDisposed||r()})),this.map[t.api.id].disposable.dispose(),this.map[t.api.id].disposable=h,this.map[t.api.id].resize=s,o}}function Di(e,i,t,n){return new(t||(t=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 i;e.done?o(e.value):(i=e.value,i instanceof t?i:new t((function(e){e(i)}))).then(r,a)}d((n=n.apply(e,i||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class yi extends m{get window(){var e,i;return null!==(i=null===(e=this._window)||void 0===e?void 0:e.value)&&void 0!==i?i:null}constructor(e,i,t){super(),this.target=e,this.className=i,this.options=t,this._onWillClose=new c,this.onWillClose=this._onWillClose.event,this._onDidClose=new c,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,i;this._window&&(this._onWillClose.fire(),null===(i=(e=this.options).onWillClose)||void 0===i||i.call(e,{id:this.target,window:this._window.value}),this._window.disposable.dispose(),this._window=null,this._onDidClose.fire())}open(){var i,t;return Di(this,void 0,void 0,(function*(){if(this._window)throw new Error("instance of popout window is already open");const n=`${this.options.url}`,o=Object.entries({top:this.options.top,left:this.options.left,width:this.options.width,height:this.options.height}).map((([e,i])=>`${e}=${i}`)).join(","),s=window.open(n,this.target,o);if(!s)return null;const r=new m;this._window={value:s,disposable:r},r.addDisposables(e.DockviewDisposable.from((()=>{s.close()})),v(window,"beforeunload",(()=>{this.close()})));const a=this.createPopoutWindowContainer();return this.className&&a.classList.add(this.className),null===(t=(i=this.options).onDidOpen)||void 0===t||t.call(i,{id:this.target,window:s}),new Promise(((e,i)=>{s.addEventListener("unload",(e=>{})),s.addEventListener("load",(()=>{try{const i=s.document;i.title=document.title,i.body.appendChild(a),function(e,i){const t=Array.from(i);for(const i of t){if(i.href){const t=e.createElement("link");t.href=i.href,t.type=i.type,t.rel="stylesheet",e.head.appendChild(t)}let t=[];try{i.cssRules&&(t=Array.from(i.cssRules).map((e=>e.cssText)))}catch(e){}for(const i of t){const t=e.createElement("style");t.appendChild(e.createTextNode(i)),e.head.appendChild(t)}}}(i,window.document.styleSheets),v(s,"beforeunload",(()=>{this.close()})),e(a)}catch(e){i(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 xi extends m{constructor(e){super(),this.accessor=e,this.init()}init(){const e=new Set,i=new Set;this.addDisposables(this.accessor.onDidAddPanel((i=>{if(e.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddPanel] called for panel ${i.api.id} but panel already exists`);e.add(i.api.id)})),this.accessor.onDidRemovePanel((i=>{if(!e.has(i.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemovePanel] called for panel ${i.api.id} but panel does not exists`);e.delete(i.api.id)})),this.accessor.onDidAddGroup((e=>{if(i.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidAddGroup] called for group ${e.api.id} but group already exists`);i.add(e.api.id)})),this.accessor.onDidRemoveGroup((e=>{if(!i.has(e.api.id))throw new Error(`dockview: Invalid event sequence. [onDidRemoveGroup] called for group ${e.api.id} but group does not exists`);i.delete(e.api.id)})))}}class zi extends m{constructor(i){super(),this.root=i,this._active=null,this._activeDisposable=new g,this._element=document.createElement("div"),this._element.className="dv-popover-anchor",this._element.style.position="relative",this.root.prepend(this._element),this.addDisposables(e.DockviewDisposable.from((()=>{this.close()})),this._activeDisposable)}openPopover(e,i){var t;this.close();const n=document.createElement("div");n.style.position="absolute",n.style.zIndex=null!==(t=i.zIndex)&&void 0!==t?t:"var(--dv-overlay-z-index)",n.appendChild(e);const o=this._element.getBoundingClientRect(),s=o.left,r=o.top;n.style.top=i.y-r+"px",n.style.left=i.x-s+"px",this._element.appendChild(n),this._active=n,this._activeDisposable.value=new m(v(window,"pointerdown",(e=>{var i;const t=e.target;if(!(t instanceof HTMLElement))return;let o=t;for(;o&&o!==n;)o=null!==(i=null==o?void 0:o.parentElement)&&void 0!==i?i:null;o||this.close()}))),requestAnimationFrame((()=>{!function(e,i,t={buffer:10}){const n=t.buffer,o=e.getBoundingClientRect(),s=i.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 Ci extends m{get disabled(){return this._disabled}set disabled(e){var i;this.disabled!==e&&(this._disabled=e,e&&(null===(i=this.model)||void 0===i||i.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,i)=>{const t=this._outline!==i;if(this._outline=i,this._model)return this._model.changed=t,this._model;const n=this.createContainer(),o=this.createAnchor();if(this._model={root:n,overlay:o,changed:t},n.appendChild(o),this.element.appendChild(n),(null==e?void 0:e.target)instanceof HTMLElement){const i=e.target.getBoundingClientRect(),t=this.element.getBoundingClientRect();o.style.left=i.left-t.left+"px",o.style.top=i.top-t.top+"px"}return this._model}}}constructor(i,t){super(),this.element=i,this._disabled=!1,this._disabled=t.disabled,this.addDisposables(e.DockviewDisposable.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 Si={activationSize:{type:"pixels",value:10},size:{type:"pixels",value:20}};function Ai(e){const i=e.from.activePanel;[...e.from.panels].map((i=>{const t=e.from.model.removePanel(i);return e.from.model.renderContainer.detatch(i),t})).forEach((t=>{e.to.model.openPanel(t,{skipSetActive:i!==t,skipSetGroupActive:!0})}))}class ki extends le{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(i,t){var n,o,s;super(i,{proportionalLayout:!0,orientation:e.Orientation.HORIZONTAL,styles:t.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:t.disableAutoResizing,locked:t.locked,margin:null!==(o=null===(n=t.theme)||void 0===n?void 0:n.gap)&&void 0!==o?o:0,className:t.className}),this.nextGroupId=T(),this._deserializer=new hi(this),this._watermark=null,this._onWillDragPanel=new c,this.onWillDragPanel=this._onWillDragPanel.event,this._onWillDragGroup=new c,this.onWillDragGroup=this._onWillDragGroup.event,this._onDidDrop=new c,this.onDidDrop=this._onDidDrop.event,this._onWillDrop=new c,this.onWillDrop=this._onWillDrop.event,this._onWillShowOverlay=new c,this.onWillShowOverlay=this._onWillShowOverlay.event,this._onUnhandledDragOverEvent=new c,this.onUnhandledDragOverEvent=this._onUnhandledDragOverEvent.event,this._onDidRemovePanel=new c,this.onDidRemovePanel=this._onDidRemovePanel.event,this._onDidAddPanel=new c,this.onDidAddPanel=this._onDidAddPanel.event,this._onDidPopoutGroupSizeChange=new c,this.onDidPopoutGroupSizeChange=this._onDidPopoutGroupSizeChange.event,this._onDidPopoutGroupPositionChange=new c,this.onDidPopoutGroupPositionChange=this._onDidPopoutGroupPositionChange.event,this._onDidOpenPopoutWindowFail=new c,this.onDidOpenPopoutWindowFail=this._onDidOpenPopoutWindowFail.event,this._onDidLayoutFromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutFromJSON.event,this._onDidActivePanelChange=new c({replay:!0}),this.onDidActivePanelChange=this._onDidActivePanelChange.event,this._onDidMovePanel=new c,this.onDidMovePanel=this._onDidMovePanel.event,this._onDidMaximizedGroupChange=new c,this.onDidMaximizedGroupChange=this._onDidMaximizedGroupChange.event,this._floatingGroups=[],this._popoutGroups=[],this._popoutRestorationPromise=Promise.resolve(),this._onDidRemoveGroup=new c,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new c,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidOptionsChange=new c,this.onDidOptionsChange=this._onDidOptionsChange.event,this._onDidActiveGroupChange=new c,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._moving=!1,this._options=t,this.popupService=new zi(this.element),this._themeClassnames=new P(this.element),this._api=new ue(this),this.rootDropTargetContainer=new Ci(this.element,{disabled:!0}),this.overlayRenderContainer=new _i(this.gridview.element,this),this._rootDropTarget=new ye(this.element,{className:"dv-drop-target-edge",canDisplayOverlay:(e,i)=>{const t=r();if(t)return t.viewId===this.id&&("center"!==i||0===this.gridview.length);if("center"===i&&0!==this.gridview.length)return!1;const n=new Ue(e,"edge",i,r);return this._onUnhandledDragOverEvent.fire(n),n.isAccepted},acceptedTargetZones:["top","bottom","left","right","center"],overlayModel:null!==(s=t.rootOverlayModel)&&void 0!==s?s:Si,getOverrideTarget:()=>{var e;return null===(e=this.rootDropTargetContainer)||void 0===e?void 0:e.model}}),this.updateDropTargetModel(t),D(this.gridview.element,"dv-dockview",!0),D(this.element,"dv-debug",!!t.debug),this.updateTheme(),this.updateWatermark(),t.debug&&this.addDisposables(new xi(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})})),e.DockviewEvent.any(this.onDidAdd,this.onDidRemove)((()=>{this.updateWatermark()})),e.DockviewEvent.any(this.onDidAddPanel,this.onDidRemovePanel,this.onDidAddGroup,this.onDidRemove,this.onDidMovePanel,this.onDidActivePanelChange,this.onDidPopoutGroupPositionChange,this.onDidPopoutGroupSizeChange)((()=>{this._bufferOnDidLayoutChange.fire()})),e.DockviewDisposable.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 Te(e,{kind:"edge",panel:void 0,api:this._api,group:void 0,getData:r}))})),this._rootDropTarget.onDrop((e=>{var i;const t=new Ke({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:r,kind:"edge"});if(this._onWillDrop.fire(t),t.defaultPrevented)return;const n=r();n?this.moveGroupOrPanel({from:{groupId:n.groupId,panelId:null!==(i=n.panelId)&&void 0!==i?i:void 0},to:{group:this.orthogonalize(e.position),position:"center"}}):this._onDidDrop.fire(new Xe({nativeEvent:e.nativeEvent,position:e.position,panel:void 0,api:this._api,group:void 0,getData:r}))})),this._rootDropTarget)}setVisible(e,i){switch(e.api.location.type){case"grid":super.setVisible(e,i);break;case"floating":{const t=this.floatingGroups.find((i=>i.group===e));t&&(t.overlay.setVisible(i),e.api._onDidVisibilityChange.fire({isVisible:i}));break}case"popout":console.warn("dockview: You cannot hide a group that is in a popout window")}}addPopoutGroup(i,t){var n,o,s,r,a;if(i instanceof ri&&1===i.group.size)return this.addPopoutGroup(i.group,t);const d=function(e){function i(e){const i=[];for(let t=0;t<e.classList.length;t++)i.push(e.classList.item(t));return i}let t,n=e;for(;null!==n&&(t=i(n).find((e=>e.startsWith("dockview-theme-"))),"string"!=typeof t);)n=n.parentElement;return t}(this.gridview.element),h=this.element;const l=(null==t?void 0:t.position)?t.position:i instanceof ni?i.element.getBoundingClientRect():i.group?i.group.element.getBoundingClientRect():h.getBoundingClientRect(),p=null!==(o=null===(n=null==t?void 0:t.overridePopoutGroup)||void 0===n?void 0:n.id)&&void 0!==o?o:this.getNextGroupId(),u=new yi(`${this.id}-${p}`,null!=d?d:"",{url:null!==(a=null!==(s=null==t?void 0:t.popoutUrl)&&void 0!==s?s:null===(r=this.options)||void 0===r?void 0:r.popoutUrl)&&void 0!==a?a:"/popout.html",left:window.screenX+l.left,top:window.screenY+l.top,width:l.width,height:l.height,onDidOpen:null==t?void 0:t.onDidOpen,onWillClose:null==t?void 0:t.onWillClose}),g=new m(u,u.onDidClose((()=>{g.dispose()})));return u.open().then((n=>{var o;if(u.isDisposed)return!1;const s=(null==t?void 0:t.referenceGroup)?t.referenceGroup:i instanceof ri?i.group:i,r=i.api.location.type,a=null!==s.element.parentElement;let d;if(a?(null==t?void 0:t.overridePopoutGroup)?d=t.overridePopoutGroup:(d=this.createGroup({id:p}),n&&this._onDidAddGroup.fire(d)):d=s,null===n)return console.error("dockview: failed to create popout. perhaps you need to allow pop-ups for this website"),g.dispose(),this._onDidOpenPopoutWindowFail.fire(),this.movingLock((()=>Ai({from:d,to:s}))),s.api.isVisible||s.api.setVisible(!0),!1;const h=document.createElement("div");h.className="dv-overlay-render-container";const l=new _i(h,this);let b;if(d.model.renderContainer=l,d.layout(u.window.innerWidth,u.window.innerHeight),!(null==t?void 0:t.overridePopoutGroup)&&a)if(i instanceof ri)this.movingLock((()=>{const e=s.model.removePanel(i);d.model.openPanel(e)}));else switch(this.movingLock((()=>Ai({from:s,to:d}))),r){case"grid":s.api.setVisible(!1);break;case"floating":case"popout":b=null===(o=this._floatingGroups.find((e=>e.group.api.id===i.api.id)))||void 0===o?void 0:o.overlay.toJSON(),this.removeGroup(s)}n.classList.add("dv-dockview"),n.style.overflow="hidden",n.appendChild(h),n.appendChild(d.element);const w=document.createElement("div"),f=new Ci(w,{disabled:this.rootDropTargetContainer.disabled});let _;n.appendChild(w),d.model.dropTargetContainer=f,d.model.location={type:"popout",getWindow:()=>u.window,popoutUrl:null==t?void 0:t.popoutUrl},a&&"grid"===i.api.location.type&&i.api.setVisible(!1),this.doSetGroupAndPanelActive(d),g.addDisposables(d.api.onDidActiveChange((e=>{var i;e.isActive&&(null===(i=u.window)||void 0===i||i.focus())})),d.api.onWillFocus((()=>{var e;null===(e=u.window)||void 0===e||e.focus()})));const D=a&&s&&this.getPanel(s.id),y={window:u,popoutGroup:d,referenceGroup:D?s.id:void 0,disposable:{dispose:()=>(g.dispose(),_)}},x=function(e){const i=new c;let t,n=e.screenX,o=e.screenY;const s=()=>{if(e.closed)return;const r=e.screenX,a=e.screenY;r===n&&a===o||(clearTimeout(t),t=setTimeout((()=>{i.fire()}),100),n=r,o=a),requestAnimationFrame(s)};return s(),i}(u.window);return g.addDisposables(x,function(e,i){let t;return new m(v(e,"resize",(()=>{clearTimeout(t),t=setTimeout((()=>{i()}),100)})))}(u.window,(()=>{this._onDidPopoutGroupSizeChange.fire({width:u.window.innerWidth,height:u.window.innerHeight,group:d})})),x.event((()=>{this._onDidPopoutGroupPositionChange.fire({screenX:u.window.screenX,screenY:u.window.screenX,group:d})})),v(u.window,"resize",(()=>{d.layout(u.window.innerWidth,u.window.innerHeight)})),l,e.DockviewDisposable.from((()=>{if(!this.isDisposed)if(a&&this.getPanel(s.id))this.movingLock((()=>Ai({from:d,to:s}))),s.api.isVisible||s.api.setVisible(!0),this.getPanel(d.id)&&this.doRemoveGroup(d,{skipPopoutAssociated:!0});else if(this.getPanel(d.id)){d.model.renderContainer=this.overlayRenderContainer,d.model.dropTargetContainer=this.rootDropTargetContainer,_=d;if(!this._popoutGroups.find((e=>e.popoutGroup===d)))return;b?this.addFloatingGroup(d,{height:b.height,width:b.width,position:b}):(this.doRemoveGroup(d,{skipDispose:!0,skipActive:!0,skipPopoutReturn:!0}),d.model.location={type:"grid"},this.movingLock((()=>{this.doAddGroup(d,[0])}))),this.doSetGroupAndPanelActive(d)}}))),this._popoutGroups.push(y),this.updateWatermark(),!0})).catch((e=>(console.error("dockview: failed to create popout.",e),!1)))}addFloatingGroup(e,i){var t,n,o,s,r;let a;if(e instanceof ri)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===(t=this._popoutGroups.find((e=>e.popoutGroup===a)))||void 0===t?void 0:t.referenceGroup,o=n?this.getPanel(n):void 0;"boolean"==typeof(null==i?void 0:i.skipRemoveGroup)&&i.skipRemoveGroup||(o?(this.movingLock((()=>Ai({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==i?void 0:i.position){const e={};return"left"in i.position?e.left=Math.max(i.position.left,0):"right"in i.position?e.right=Math.max(i.position.right,0):e.left=mi,"top"in i.position?e.top=Math.max(i.position.top,0):"bottom"in i.position?e.bottom=Math.max(i.position.bottom,0):e.top=gi,"number"==typeof i.width?e.width=Math.max(i.width,0):e.width=bi,"number"==typeof i.height?e.height=Math.max(i.height,0):e.height=wi,e}return{left:"number"==typeof(null==i?void 0:i.x)?Math.max(i.x,0):mi,top:"number"==typeof(null==i?void 0:i.y)?Math.max(i.y,0):gi,width:"number"==typeof(null==i?void 0:i.width)?Math.max(i.width,0):bi,height:"number"==typeof(null==i?void 0:i.height)?Math.max(i.height,0):wi}}(),h=new ci(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:ui,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:ui})),l=a.element.querySelector(".dv-void-container");if(!l)throw new Error("failed to find drag handle");h.setupDrag(l,{inDragMode:"boolean"==typeof(null==i?void 0:i.inDragMode)&&i.inDragMode});const p=new vi(a,h),c=new m(a.api.onDidActiveChange((e=>{e.isActive&&h.bringToFront()})),w(a.element,(e=>{const{width:i,height:t}=e.contentRect;a.layout(i,t)})));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(),V(this._floatingGroups,p),a.model.location={type:"grid"},this.updateWatermark()}}),this._floatingGroups.push(p),a.model.location={type:"floating"},(null==i?void 0:i.skipActiveGroup)||this.doSetGroupAndPanelActive(a),this.updateWatermark()}orthogonalize(i,t){switch(this.gridview.normalize(),i){case"top":case"bottom":this.gridview.orientation===e.Orientation.HORIZONTAL&&this.gridview.insertOrthogonalSplitviewAtRoot();break;case"left":case"right":this.gridview.orientation===e.Orientation.VERTICAL&&this.gridview.insertOrthogonalSplitviewAtRoot()}switch(i){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 ${i}`)}}updateOptions(e){var i,t;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=ui,n.overlay.minimumInViewportWidth=ui;break;default:n.overlay.minimumInViewportHeight=null===(i=e.floatingGroupBounds)||void 0===i?void 0:i.minimumHeightWithinViewport,n.overlay.minimumInViewportWidth=null===(t=e.floatingGroupBounds)||void 0===t?void 0:t.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,i,t){if(super.layout(e,i,t),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((i=>i.id===e))}setActivePanel(e){e.group.model.openPanel(e),this.doSetGroupAndPanelActive(e.group)}moveToNext(e={}){var i;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 t=q(e.group.element),n=null===(i=this.gridview.next(t))||void 0===i?void 0:i.view;this.doSetGroupAndPanelActive(n)}moveToPrevious(e={}){var i;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 t=q(e.group.element),n=null===(i=this.gridview.previous(t))||void 0===i?void 0:i.view;n&&this.doSetGroupAndPanelActive(n)}toJSON(){var e;const i=this.gridview.serialize(),t=this.panels.reduce(((e,i)=>(e[i.id]=i.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:i,panels:t,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 i,t;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:i,locked:t,hideHeader:n,views:s,activeView:r}=e;if("string"!=typeof i)throw new Error("group id must be of type string");const a=this.createGroup({id:i,locked:!!t,hideHeader:!!n});this._onDidAddGroup.fire(a);const d=[];for(const e of s){const i=this._deserializer.fromJSON(o[e],a);d.push(i)}for(let e=0;e<s.length;e++){const i=d[e],t="string"==typeof r&&r===i.id;a.model.openPanel(i,{skipSetActive:!t,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!==(i=e.floatingGroups)&&void 0!==i?i:[];for(const e of h){const{data:i,position:t}=e,n=d(i);this.addFloatingGroup(n,{position:t,width:t.width,height:t.height,skipRemoveGroup:!0,inDragMode:!1})}const l=null!==(t=e.popoutGroups)&&void 0!==t?t:[],p=[];l.forEach(((e,i)=>{const{data:t,position:n,gridReferenceGroup:o,url:s}=e,r=d(t),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*i)}));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 i of e.panels)this.removePanel(i,{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)),i=!!this.activeGroup;for(const i of e)this.removeGroup(i,{skipActive:!0});i&&this.doSetGroupAndPanelActive(void 0),this.gridview.clear()}closeAllGroups(){for(const e of this._groups.entries()){const[i,t]=e;t.value.model.closeAllPanels()}}addPanel(i){var t,n;if(this.panels.find((e=>e.id===i.id)))throw new Error(`panel with id ${i.id} already exists`);let o;if(i.position&&i.floating)throw new Error("you can only provide one of: position, floating as arguments to .addPanel(...)");const s={width:i.initialWidth,height:i.initialHeight};let r,a;if(i.position)if($e(i.position)){const e="string"==typeof i.position.referencePanel?this.getGroupPanel(i.position.referencePanel):i.position.referencePanel;if(r=i.position.index,!e)throw new Error(`referencePanel '${i.position.referencePanel}' does not exist`);o=this.findGroup(e)}else{if(!je(i.position)){const e=this.orthogonalize(we(i.position.direction)),t=this.createPanel(i,e);return e.model.openPanel(t,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),i.inactive||this.doSetGroupAndPanelActive(e),e.api.setSize({height:null==s?void 0:s.height,width:null==s?void 0:s.width}),t}if(o="string"==typeof i.position.referenceGroup?null===(t=this._groups.get(i.position.referenceGroup))||void 0===t?void 0:t.value:i.position.referenceGroup,r=i.position.index,!o)throw new Error(`referenceGroup '${i.position.referenceGroup}' does not exist`)}else o=this.activeGroup;if(o){const t=he((null===(n=i.position)||void 0===n?void 0:n.direction)||"within");if(i.floating){const e=this.createGroup();this._onDidAddGroup.fire(e);const t="object"==typeof i.floating&&null!==i.floating?i.floating:{};this.addFloatingGroup(e,Object.assign(Object.assign({},t),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(i,e),e.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r})}else if("floating"===o.api.location.type||"center"===t)a=this.createPanel(i,o),o.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),o.api.setSize({width:null==s?void 0:s.width,height:null==s?void 0:s.height}),i.inactive||this.doSetGroupAndPanelActive(o);else{const n=q(o.element),d=Q(this.gridview.orientation,n,t),h=this.createGroupAtLocation(d,this.orientationAtLocation(d)===e.Orientation.VERTICAL?null==s?void 0:s.height:null==s?void 0:s.width);a=this.createPanel(i,h),h.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),i.inactive||this.doSetGroupAndPanelActive(h)}}else if(i.floating){const e=this.createGroup();this._onDidAddGroup.fire(e);const t="object"==typeof i.floating&&null!==i.floating?i.floating:{};this.addFloatingGroup(e,Object.assign(Object.assign({},t),{inDragMode:!1,skipRemoveGroup:!0,skipActiveGroup:!0})),a=this.createPanel(i,e),e.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r})}else{const t=this.createGroupAtLocation([0],this.gridview.orientation===e.Orientation.VERTICAL?null==s?void 0:s.height:null==s?void 0:s.width);a=this.createPanel(i,t),t.model.openPanel(a,{skipSetActive:i.inactive,skipSetGroupActive:i.inactive,index:r}),i.inactive||this.doSetGroupAndPanelActive(t)}return a}removePanel(e,i={removeEmptyGroup:!0}){const t=e.group;if(!t)throw new Error(`cannot remove panel ${e.id}. it's missing a group.`);t.model.removePanel(e,{skipSetActiveGroup:i.skipSetActiveGroup}),i.skipDispose||(e.group.model.renderContainer.detatch(e),e.dispose()),0===t.size&&i.removeEmptyGroup&&this.removeGroup(t,{skipActive:i.skipSetActiveGroup})}createWatermarkComponent(){return this.options.createWatermarkComponent?this.options.createWatermarkComponent():new li}updateWatermark(){var e,i,t;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 ue(this)});const e=document.createElement("div");e.className="dv-watermark-container",t="watermark-component",e.setAttribute("data-testid",t),e.appendChild(this._watermark.element),this.gridview.element.appendChild(e)}}else this._watermark&&(this._watermark.element.parentElement.remove(),null===(i=(e=this._watermark).dispose)||void 0===i||i.call(e),this._watermark=null)}addGroup(i){var t;if(i){let n;if(Ze(i)){const e="string"==typeof i.referencePanel?this.panels.find((e=>e.id===i.referencePanel)):i.referencePanel;if(!e)throw new Error(`reference panel ${i.referencePanel} does not exist`);if(n=this.findGroup(e),!n)throw new Error(`reference group for reference panel ${i.referencePanel} does not exist`)}else{if(!Ye(i)){const e=this.orthogonalize(we(i.direction),i);return i.skipSetActive||this.doSetGroupAndPanelActive(e),e}if(n="string"==typeof i.referenceGroup?null===(t=this._groups.get(i.referenceGroup))||void 0===t?void 0:t.value:i.referenceGroup,!n)throw new Error(`reference group ${i.referenceGroup} does not exist`)}const o=he(i.direction||"within"),s=q(n.element),r=Q(this.gridview.orientation,s,o),a=this.createGroup(i),d=this.getLocationOrientation(r)===e.Orientation.VERTICAL?i.initialHeight:i.initialWidth;return this.doAddGroup(a,r,d),i.skipSetActive||this.doSetGroupAndPanelActive(a),a}{const e=this.createGroup(i);return this.doAddGroup(e),this.doSetGroupAndPanelActive(e),e}}getLocationOrientation(i){return i.length%2==0&&this.gridview.orientation===e.Orientation.HORIZONTAL?e.Orientation.HORIZONTAL:e.Orientation.VERTICAL}removeGroup(e,i){this.doRemoveGroup(e,i)}doRemoveGroup(e,i){var t;const n=[...e.panels];if(!(null==i?void 0:i.skipDispose))for(const e of n)this.removePanel(e,{removeEmptyGroup:!1,skipDispose:null!==(t=null==i?void 0:i.skipDispose)&&void 0!==t&&t});const o=this.activePanel;if("floating"===e.api.location.type){const t=this._floatingGroups.find((i=>i.group===e));if(t){if((null==i?void 0:i.skipDispose)||(t.group.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)),V(this._floatingGroups,t),t.dispose(),!(null==i?void 0:i.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return t.group}throw new Error("failed to find floating group")}if("popout"===e.api.location.type){const t=this._popoutGroups.find((i=>i.popoutGroup===e));if(t){if(!(null==i?void 0:i.skipDispose)){if(!(null==i?void 0:i.skipPopoutAssociated)){const e=t.referenceGroup?this.getPanel(t.referenceGroup):void 0;e&&0===e.panels.length&&this.removeGroup(e)}t.popoutGroup.dispose(),this._groups.delete(e.id),this._onDidRemoveGroup.fire(e)}V(this._popoutGroups,t);const n=t.disposable.dispose();if(!(null==i?void 0:i.skipPopoutReturn)&&n&&(this.doAddGroup(n,[0]),this.doSetGroupAndPanelActive(n)),!(null==i?void 0:i.skipActive)&&this._activeGroup===e){const e=Array.from(this._groups.values());this.doSetGroupAndPanelActive(e.length>0?e[0].value:void 0)}return this.updateWatermark(),t.popoutGroup}throw new Error("failed to find popout group")}const s=super.doRemoveGroup(e,i);return(null==i?void 0:i.skipActive)||this.activePanel!==o&&this._onDidActivePanelChange.fire(this.activePanel),s}movingLock(e){const i=this._moving;try{return this._moving=!0,e()}finally{this._moving=i}}moveGroupOrPanel(e){var i;const t=e.to.group,n=e.from.groupId,o=e.from.panelId,s=e.to.position,r=e.to.index,a=n?null===(i=this._groups.get(n))||void 0===i?void 0:i.value:void 0;if(!a)throw new Error(`Failed to find group id ${n}`);if(void 0!==o)if(s&&"center"!==s){const e=q(t.element),i=Q(this.gridview.orientation,e,s);if(a.size<2){const[e,n]=E(i);if("grid"===a.api.location.type){const i=q(a.element),[t,s]=E(i);if(O(t,e))return this.gridview.moveView(t,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)),t=this.movingLock((()=>e.popoutGroup.model.removePanel(e.popoutGroup.panels[0],{skipSetActive:!0,skipSetActiveGroup:!0})));this.doRemoveGroup(a,{skipActive:!0});const n=this.createGroupAtLocation(i);return this.movingLock((()=>n.model.openPanel(t))),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=q(t.element),h=Q(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 i=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!i)throw new Error(`No panel with id ${o}`);const t=Q(this.gridview.orientation,e,s),n=this.createGroupAtLocation(t);this.movingLock((()=>n.model.openPanel(i,{skipSetGroupActive:!0}))),this.doSetGroupAndPanelActive(n),this._onDidMovePanel.fire({panel:i,from:a})}}else{const i=this.movingLock((()=>a.model.removePanel(o,{skipSetActive:!1,skipSetActiveGroup:!0})));if(!i)throw new Error(`No panel with id ${o}`);0===a.model.size&&this.doRemoveGroup(a,{skipActive:!0});const n=0===t.model.size;this.movingLock((()=>{var o;return t.model.openPanel(i,{index:r,skipSetActive:null!==(o=e.skipSetActive)&&void 0!==o&&o&&!n,skipSetGroupActive:!0})})),e.skipSetActive||this.doSetGroupAndPanelActive(t),this._onDidMovePanel.fire({panel:i,from:a})}else this.moveGroup({from:{group:a},to:{group:t,position:s},skipSetActive:e.skipSetActive})}moveGroup(i){const t=i.from.group,n=i.to.group,o=i.to.position;if("center"===o){const e=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 i of o)n.model.openPanel(i,{skipSetActive:i!==e,skipSetGroupActive:!0})})),!0!==i.skipSetActive?this.doSetGroupAndPanelActive(n):this.activePanel||this.doSetGroupAndPanelActive(n)}else{switch(t.api.location.type){case"grid":this.gridview.removeView(q(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 i=this._popoutGroups.indexOf(e);if(i>=0&&this._popoutGroups.splice(i,1),e.referenceGroup){const i=this.getPanel(e.referenceGroup);i&&!i.api.isVisible&&this.doRemoveGroup(i,{skipActive:!0})}e.window.dispose(),"grid"===n.api.location.type?(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"grid"}):"floating"===n.api.location.type&&(t.model.renderContainer=this.overlayRenderContainer,t.model.dropTargetContainer=this.rootDropTargetContainer,t.model.location={type:"floating"});break}}if("grid"===n.api.location.type){const i=q(n.element),s=Q(this.gridview.orientation,i,o);let r;switch(this.gridview.orientation){case e.Orientation.VERTICAL:r=i.length%2==0?t.api.width:t.api.height;break;case e.Orientation.HORIZONTAL:r=i.length%2==0?t.api.height:t.api.width}this.gridview.addView(t,r,s)}else if("floating"===n.api.location.type){const e=this._floatingGroups.find((e=>e.group===n));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===i.skipSetActive){const e=null!=n?n:t;this.doSetGroupAndPanelActive(e)}}doSetGroupActive(e){super.doSetGroupActive(e);const i=this.activePanel;this._moving||i===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(i)}doSetGroupAndPanelActive(e){super.doSetGroupActive(e);const i=this.activePanel;e&&this.hasMaximizedGroup()&&!this.isMaximizedGroup(e)&&this.exitMaximizedGroup(),this._moving||i===this._onDidActivePanelChange.value||this._onDidActivePanelChange.fire(i)}getNextGroupId(){let e=this.nextGroupId.next();for(;this._groups.has(e);)e=this.nextGroupId.next();return e}createGroup(i){i||(i={});let t=null==i?void 0:i.id;if(t&&this._groups.has(i.id)&&(console.warn(`dockview: Duplicate group id ${null==i?void 0:i.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 n=new ni(this,t,i);if(n.init({params:{},accessor:this}),!this._groups.has(n.id)){const i=new m(n.model.onTabDragStart((e=>{this._onWillDragPanel.fire(e)})),n.model.onGroupDragStart((e=>{this._onWillDragGroup.fire(e)})),n.model.onMove((e=>{const{groupId:i,itemId:t,target:o,index:s}=e;this.moveGroupOrPanel({from:{groupId:i,panelId:t},to:{group:n,position:o,index:s}})})),n.model.onDidDrop((e=>{this._onDidDrop.fire(e)})),n.model.onWillDrop((e=>{this._onWillDrop.fire(e)})),n.model.onWillShowOverlay((e=>{this.options.disableDnd?e.preventDefault():this._onWillShowOverlay.fire(e)})),n.model.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})),n.model.onDidAddPanel((e=>{this._moving||this._onDidAddPanel.fire(e.panel)})),n.model.onDidRemovePanel((e=>{this._moving||this._onDidRemovePanel.fire(e.panel)})),n.model.onDidActivePanelChange((e=>{this._moving||e.panel===this.activePanel&&this._onDidActivePanelChange.value!==e.panel&&this._onDidActivePanelChange.fire(e.panel)})),e.DockviewEvent.any(n.model.onDidPanelTitleChange,n.model.onDidPanelParametersChange)((()=>{this._bufferOnDidLayoutChange.fire()})));this._groups.set(n.id,{value:n,disposable:i})}return n.initialize(),n}createPanel(e,i){var t,n,o;const s=e.component,r=null!==(t=e.tabComponent)&&void 0!==t?t:this.options.defaultTabComponent,a=new di(this,e.id,s,r),d=new ri(e.id,s,r,this,this._api,i,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,i,t){const n=this.createGroup(t);return this.doAddGroup(n,e,i),n}findGroup(e){var i;return null===(i=Array.from(this._groups.values()).find((i=>i.value.model.containsPanel(e))))||void 0===i?void 0:i.value}orientationAtLocation(e){const i=this.gridview.orientation;return e.length%2==1?i:te(i)}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(Si)),"rootOverlayModel"in e&&this.updateDropTargetModel({dndEdges:e.dndEdges})}updateTheme(){var e,i;const t=null!==(e=this._options.theme)&&void 0!==e?e:oi;if(this._themeClassnames.setClassNames(t.className),this.gridview.margin=null!==(i=t.gap)&&void 0!==i?i:0,"absolute"===t.dndOverlayMounting)this.rootDropTargetContainer.disabled=!1;else this.rootDropTargetContainer.disabled=!0}}class Pi extends le{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,i){var t;super(e,{proportionalLayout:null===(t=i.proportionalLayout)||void 0===t||t,orientation:i.orientation,styles:i.hideBorders?{separatorBorder:"transparent"}:void 0,disableAutoResizing:i.disableAutoResizing,className:i.className}),this._onDidLayoutfromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidRemoveGroup=new c,this.onDidRemoveGroup=this._onDidRemoveGroup.event,this._onDidAddGroup=new c,this.onDidAddGroup=this._onDidAddGroup.event,this._onDidActiveGroupChange=new c,this.onDidActiveGroupChange=this._onDidActiveGroupChange.event,this._options=i,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 i="string"==typeof e.orientation&&this.gridview.orientation!==e.orientation;this._options=Object.assign(Object.assign({},this.options),e),i&&(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,i){this.gridview.setViewVisible(q(e.element),i)}setActive(e){this._groups.forEach(((i,t)=>{i.value.setActive(e===i.value)}))}focus(){var e;null===(e=this.activeGroup)||void 0===e||e.focus()}fromJSON(e){this.clear();const{grid:i,activePanel:t}=e;try{const e=[],n=this.width,o=this.height;if(this.gridview.deserialize(i,{fromJSON:i=>{const{data:t}=i,n=this.options.createComponent({id:t.id,name:t.component});return e.push((()=>n.init({params:t.params,minimumWidth:t.minimumWidth,maximumWidth:t.maximumWidth,minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight,priority:t.priority,snap:!!t.snap,accessor:this,isVisible:i.visible}))),this._onDidAddGroup.fire(n),this.registerPanel(n),n}}),this.layout(n,o,!0),e.forEach((e=>e())),"string"==typeof t){const e=this.getPanel(t);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,i=Array.from(this._groups.values());for(const e of i)e.disposable.dispose(),this.doRemoveGroup(e.value,{skipActive:!0});e&&this.doSetGroupActive(void 0),this.gridview.clear()}movePanel(e,i){var t;let n;const o=this.gridview.remove(e),s=null===(t=this._groups.get(i.reference))||void 0===t?void 0:t.value;if(!s)throw new Error(`reference group ${i.reference} does not exist`);const r=he(i.direction);if("center"===r)throw new Error(`${r} not supported as an option`);{const e=q(s.element);n=Q(this.gridview.orientation,e,r)}this.doAddGroup(o,n,i.size)}addPanel(e){var i,t,n,o;let s=null!==(i=e.location)&&void 0!==i?i:[0];if(null===(t=e.position)||void 0===t?void 0:t.referencePanel){const i=null===(n=this._groups.get(e.position.referencePanel))||void 0===n?void 0:n.value;if(!i)throw new Error(`reference group ${e.position.referencePanel} does not exist`);const t=he(e.position.direction);if("center"===t)throw new Error(`${t} not supported as an option`);{const e=q(i.element);s=Q(this.gridview.orientation,e,t)}}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.registerPanel(r),this.doAddGroup(r,s,e.size),this.doSetGroupActive(r),r}registerPanel(e){const i=new m(e.api.onDidFocusChange((i=>{i.isFocused&&this._groups.forEach((i=>{const t=i.value;t!==e?t.setActive(!1):t.setActive(!0)}))})));this._groups.set(e.id,{value:e,disposable:i})}moveGroup(e,i,t){const n=this.getPanel(i);if(!n)throw new Error("invalid operation");const o=q(e.element),s=Q(this.gridview.orientation,o,t),[r,a]=E(s),d=q(n.element),[h,l]=E(d);if(O(h,r))return void this.gridview.moveView(h,l,a);const p=this.doRemoveGroup(n,{skipActive:!0,skipDispose:!0}),c=q(e.element),v=Q(this.gridview.orientation,c,t);this.doAddGroup(p,v)}removeGroup(e){super.removeGroup(e)}dispose(){super.dispose(),this._onDidLayoutfromJSON.dispose()}}class Ei extends ae{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 m(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===e.Orientation.HORIZONTAL?this.splitview.orthogonalSize:this.splitview.size}get width(){return this.splitview.orientation===e.Orientation.HORIZONTAL?this.splitview.size:this.splitview.orthogonalSize}constructor(e,i){var t;super(document.createElement("div"),i.disableAutoResizing),this._splitviewChangeDisposable=new g,this._panels=new Map,this._onDidLayoutfromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidAddView=new c,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new c,this.onDidRemoveView=this._onDidRemoveView.event,this._onDidLayoutChange=new c,this.onDidLayoutChange=this._onDidLayoutChange.event,this.element.style.height="100%",this.element.style.width="100%",this._classNames=new P(this.element),this._classNames.setClassNames(null!==(t=i.className)&&void 0!==t?t:""),e.appendChild(this.element),this._options=i,this.splitview=new B(this.element,i),this.addDisposables(this._onDidAddView,this._onDidLayoutfromJSON,this._onDidRemoveView,this._onDidLayoutChange)}updateOptions(e){var i,t;"className"in e&&this._classNames.setClassNames(null!==(i=e.className)&&void 0!==i?i:""),"disableResizing"in e&&(this.disableResizing=null!==(t=e.disableAutoResizing)&&void 0!==t&&t),"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,i){this.splitview.moveView(e,i)}setVisible(e,i){const t=this.panels.indexOf(e);this.splitview.setViewVisible(t,i)}setActive(e,i){this._activePanel=e,this.panels.filter((i=>i!==e)).forEach((e=>{e.api._onDidActiveChange.fire({isActive:!1}),i||e.focus()})),e.api._onDidActiveChange.fire({isActive:!0}),i||e.focus()}removePanel(e,i){const t=this._panels.get(e.id);if(!t)throw new Error(`unknown splitview panel ${e.id}`);t.dispose(),this._panels.delete(e.id);const n=this.panels.findIndex((i=>i===e));this.splitview.removeView(n,i).dispose();const o=this.panels;o.length>0&&this.setActive(o[o.length-1])}getPanel(e){return this.panels.find((i=>i.id===e))}addPanel(i){var t;if(this._panels.has(i.id))throw new Error(`panel ${i.id} already exists`);const n=this.options.createComponent({id:i.id,name:i.component});n.orientation=this.splitview.orientation,n.init({params:null!==(t=i.params)&&void 0!==t?t:{},minimumSize:i.minimumSize,maximumSize:i.maximumSize,snap:i.snap,priority:i.priority,accessor:this});const o="number"==typeof i.size?i.size:e.Sizing.Distribute,s="number"==typeof i.index?i.index:void 0;return this.splitview.addView(n,o,s),this.doAddView(n),this.setActive(n),n}layout(i,t){const[n,o]=this.splitview.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];this.splitview.layout(n,o)}doAddView(e){const i=e.api.onDidFocusChange((i=>{i.isFocused&&this.setActive(e,!0)}));this._panels.set(e.id,i)}toJSON(){var e;return{views:this.splitview.getViews().map(((e,i)=>({size:this.splitview.getViewSize(i),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:i,orientation:t,size:n,activeView:o}=e,s=[],r=this.width,a=this.height;if(this.splitview=new B(this.element,{orientation:t,proportionalLayout:this.options.proportionalLayout,descriptor:{size:n,views:i.map((e=>{const i=e.data;if(this._panels.has(i.id))throw new Error(`panel ${i.id} already exists`);const n=this.options.createComponent({id:i.id,name:i.component});return s.push((()=>{var t;n.init({params:null!==(t=i.params)&&void 0!==t?t:{},minimumSize:i.minimumSize,maximumSize:i.maximumSize,snap:e.snap,priority:e.priority,accessor:this})})),n.orientation=t,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,e.Sizing.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 i of e)i.dispose();this.element.remove(),super.dispose()}}class Oi extends m{get element(){return this._element}constructor(){super(),this._expandedIcon=He({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=Fe(),this.disposable=new g,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(v(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 i=!!(null===(e=this.apiRef.api)||void 0===e?void 0:e.isExpanded);D(this._expander,"collapsed",!i),i?(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 Gi=T(),Ii=Number.MAX_SAFE_INTEGER;class Vi extends Oe{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 ae{get id(){return this._id}get panels(){return this.paneview.getPanes()}set paneview(e){this._paneview=e,this._disposable.value=new m(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===e.Orientation.HORIZONTAL?this.paneview.orthogonalSize:this.paneview.size}get width(){return this.paneview.orientation===e.Orientation.HORIZONTAL?this.paneview.size:this.paneview.orthogonalSize}get options(){return this._options}constructor(i,t){var n;super(document.createElement("div"),t.disableAutoResizing),this._id=Gi.next(),this._disposable=new g,this._viewDisposables=new Map,this._onDidLayoutfromJSON=new c,this.onDidLayoutFromJSON=this._onDidLayoutfromJSON.event,this._onDidLayoutChange=new c,this.onDidLayoutChange=this._onDidLayoutChange.event,this._onDidDrop=new c,this.onDidDrop=this._onDidDrop.event,this._onDidAddView=new c,this.onDidAddView=this._onDidAddView.event,this._onDidRemoveView=new c,this.onDidRemoveView=this._onDidRemoveView.event,this._onUnhandledDragOverEvent=new c,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 P(this.element),this._classNames.setClassNames(null!==(n=t.className)&&void 0!==n?n:""),i.appendChild(this.element),this._options=t,this.paneview=new J(this.element,{orientation:e.Orientation.VERTICAL}),this.addDisposables(this._disposable)}setVisible(e,i){const t=this.panels.indexOf(e);this.paneview.setViewVisible(t,i)}focus(){}updateOptions(e){var i,t;"className"in e&&this._classNames.setClassNames(null!==(i=e.className)&&void 0!==i?i:""),"disableResizing"in e&&(this.disableResizing=null!==(t=e.disableAutoResizing)&&void 0!==t&&t),this._options=Object.assign(Object.assign({},this.options),e)}addPanel(i){var t,n;const o=this.options.createComponent({id:i.id,name:i.component});let s;i.headerComponent&&this.options.createHeaderComponent&&(s=this.options.createHeaderComponent({id:i.id,name:i.headerComponent})),s||(s=new Oi);const r=new Vi({id:i.id,component:i.component,headerComponent:i.headerComponent,header:s,body:o,orientation:e.Orientation.VERTICAL,isExpanded:!!i.isExpanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=i.headerSize)&&void 0!==t?t:22,minimumBodySize:0,maximumBodySize:Ii});this.doAddPanel(r);const a="number"==typeof i.size?i.size:e.Sizing.Distribute,d="number"==typeof i.index?i.index:void 0;return r.init({params:null!==(n=i.params)&&void 0!==n?n:{},minimumBodySize:i.minimumBodySize,maximumBodySize:i.maximumBodySize,isExpanded:i.isExpanded,title:i.title,containerApi:new ce(this),accessor:this}),this.paneview.addPane(r,a,d),r.orientation=this.paneview.orientation,r}removePanel(e){const i=this.panels.findIndex((i=>i===e));this.paneview.removePane(i),this.doRemovePanel(e)}movePanel(e,i){this.paneview.moveView(e,i)}getPanel(e){return this.panels.find((i=>i.id===e))}layout(i,t){const[n,o]=this.paneview.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];this.paneview.layout(n,o)}toJSON(){const e=e=>e===Number.MAX_SAFE_INTEGER||e===Number.POSITIVE_INFINITY?void 0:e;return{views:this.paneview.getPanes().map(((i,t)=>{return{size:this.paneview.getViewSize(t),data:i.toJSON(),minimumSize:(n=i.minimumBodySize,n<=0?void 0:n),maximumSize:e(i.maximumBodySize),headerSize:i.headerSize,expanded:i.isExpanded()};var n})),size:this.paneview.size}}fromJSON(i){this.clear();const{views:t,size:n}=i,o=[],s=this.width,r=this.height;this.paneview=new J(this.element,{orientation:e.Orientation.VERTICAL,descriptor:{size:n,views:t.map((i=>{var t,n,s;const r=i.data,a=this.options.createComponent({id:r.id,name:r.component});let d;r.headerComponent&&this.options.createHeaderComponent&&(d=this.options.createHeaderComponent({id:r.id,name:r.headerComponent})),d||(d=new Oi);const h=new Vi({id:r.id,component:r.component,headerComponent:r.headerComponent,header:d,body:a,orientation:e.Orientation.VERTICAL,isExpanded:!!i.expanded,disableDnd:!!this.options.disableDnd,accessor:this,headerSize:null!==(t=i.headerSize)&&void 0!==t?t:22,minimumBodySize:null!==(n=i.minimumSize)&&void 0!==n?n:0,maximumBodySize:null!==(s=i.maximumSize)&&void 0!==s?s:Ii});return this.doAddPanel(h),o.push((()=>{var e;h.init({params:null!==(e=r.params)&&void 0!==e?e:{},minimumBodySize:i.minimumSize,maximumBodySize:i.maximumSize,title:r.title,isExpanded:!!i.expanded,containerApi:new ce(this),accessor:this}),h.orientation=this.paneview.orientation})),setTimeout((()=>{this._onDidAddView.fire(h)}),0),{size:i.size,view:h}}))}}),this.layout(s,r),o.forEach((e=>e())),this._onDidLayoutfromJSON.fire()}clear(){for(const[e,i]of this._viewDisposables.entries())i.dispose();this._viewDisposables.clear(),this.paneview.dispose()}doAddPanel(e){const i=new m(e.onDidDrop((e=>{this._onDidDrop.fire(e)})),e.onUnhandledDragOverEvent((e=>{this._onUnhandledDragOverEvent.fire(e)})));this._viewDisposables.set(e.id,i)}doRemovePanel(e){const i=this._viewDisposables.get(e.id);i&&(i.dispose(),this._viewDisposables.delete(e.id))}dispose(){super.dispose();for(const[e,i]of this._viewDisposables.entries())i.dispose();this._viewDisposables.clear(),this.element.remove(),this.paneview.dispose()}}e.BaseGrid=le,e.ContentContainer=Ge,e.DefaultDockviewDeserialzier=hi,e.DefaultTab=ai,e.DockviewApi=ue,e.DockviewComponent=ki,e.DockviewCompositeDisposable=m,e.DockviewDidDropEvent=Xe,e.DockviewEmitter=c,e.DockviewGroupPanel=ni,e.DockviewGroupPanelModel=qe,e.DockviewMutableDisposable=g,e.DockviewPanel=ri,e.DockviewUnhandledDragOverEvent=Ue,e.DockviewWillDropEvent=Ke,e.DraggablePaneviewPanel=Oe,e.Gridview=se,e.GridviewApi=ve,e.GridviewComponent=Pi,e.GridviewPanel=ei,e.PROPERTY_KEYS_DOCKVIEW=Je,e.PROPERTY_KEYS_GRIDVIEW=re,e.PROPERTY_KEYS_PANEVIEW=xe,e.PROPERTY_KEYS_SPLITVIEW=U,e.PaneFramework=Vi,e.PaneTransfer=o,e.PanelTransfer=n,e.Paneview=J,e.PaneviewApi=ce,e.PaneviewComponent=Ni,e.PaneviewPanel=Ee,e.PaneviewUnhandledDragOverEvent=ze,e.Splitview=B,e.SplitviewApi=pe,e.SplitviewComponent=Ei,e.SplitviewPanel=class extends Pe{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,i){super(e,i,new Ae(e,i)),this._evaluatedMinimumSize=0,this._evaluatedMaximumSize=Number.POSITIVE_INFINITY,this._minimumSize=0,this._maximumSize=Number.POSITIVE_INFINITY,this._snap=!1,this._onDidChange=new c,this.onDidChange=this._onDidChange.event,this.api.initialize(this),this.addDisposables(this._onDidChange,this.api.onWillVisibilityChange((e=>{const{isVisible:i}=e,{accessor:t}=this._params;t.setVisible(this,i)})),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(i,t){const[n,o]=this.orientation===e.Orientation.HORIZONTAL?[i,t]:[t,i];super.layout(n,o)}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})}},e.Tab=Ne,e.createDockview=function(e,i){return new ki(e,i).api},e.createGridview=function(e,i){const t=new Pi(e,i);return new ve(t)},e.createPaneview=function(e,i){const t=new Ni(e,i);return new ce(t)},e.createSplitview=function(e,i){const t=new Ei(e,i);return new pe(t)},e.directionToPosition=we,e.getDirectionOrientation=ee,e.getGridLocation=q,e.getLocationOrientation=ie,e.getPaneData=a,e.getPanelData=r,e.getRelativeLocation=Q,e.indexInParent=K,e.isGridBranchNode=ne,e.isGroupOptionsWithGroup=Ye,e.isGroupOptionsWithPanel=Ze,e.isPanelOptionsWithGroup=je,e.isPanelOptionsWithPanel=$e,e.orthogonal=te,e.positionToDirection=fe,e.themeAbyss=oi,e.themeAbyssSpaced={name:"abyssSpaced",className:"dockview-theme-abyss-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"},e.themeDark={name:"dark",className:"dockview-theme-dark"},e.themeDracula={name:"dracula",className:"dockview-theme-dracula"},e.themeLight={name:"light",className:"dockview-theme-light"},e.themeLightSpaced={name:"lightSpaced",className:"dockview-theme-light-spaced",gap:10,dndOverlayMounting:"absolute",dndPanelOverlay:"group"},e.themeReplit={name:"replit",className:"dockview-theme-replit",gap:10},e.themeVisualStudio={name:"visualStudio",className:"dockview-theme-vs"},e.toTarget=he}));
|
|
8
8
|
//# sourceMappingURL=dockview-core.amd.min.js.map
|