@knime/kds-table 8.2.2 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/dist/index.css +12 -57
- package/dist/index.js +26 -406
- package/dist/index.js.map +1 -1
- package/dist/src/components/TableUI.vue.d.ts +43 -213
- package/dist/src/components/TableUI.vue.d.ts.map +1 -1
- package/dist/src/components/TableUIWithAutoSizeCalculation.vue.d.ts +46 -832
- package/dist/src/components/TableUIWithAutoSizeCalculation.vue.d.ts.map +1 -1
- package/package.json +5 -4
- package/dist/src/components/control/PageControls.vue.d.ts +0 -224
- package/dist/src/components/control/PageControls.vue.d.ts.map +0 -1
- package/dist/src/components/control/PageNavigation.vue.d.ts +0 -14
- package/dist/src/components/control/PageNavigation.vue.d.ts.map +0 -1
- package/dist/src/components/control/PageRowRange.vue.d.ts +0 -11
- package/dist/src/components/control/PageRowRange.vue.d.ts.map +0 -1
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["W","E","s","g","V","D","h","y","K","R","$slots","$slots","$emit","$emit","$el"],"sources":["../src/config/table.config.ts","../../styles/dist/tokens/ts/border.js","../../styles/dist/tokens/ts/dimension.js","../../styles/dist/tokens/ts/spacing.js","../src/constants.ts","../src/types/BackgroundColor.ts","../src/utils/index.ts","../../../node_modules/.pnpm/@vueuse+shared@14.4.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js","../../../node_modules/.pnpm/@vueuse+core@14.4.0_vue@3.5.40_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js","../../../node_modules/.pnpm/@knime+vue-headless-virtual-scroller@0.2.0_vue@3.5.40_typescript@6.0.3_/node_modules/@knime/vue-headless-virtual-scroller/dist/vue-headless-virtual-scrolling.js","../../../node_modules/.pnpm/dompurify@3.4.13/node_modules/dompurify/dist/purify.es.mjs","../../utils/dist/index.js","../src/components/composables/useDataValueViews.ts","../src/components/composables/useStartEditingKeydown.ts","../src/components/TableBodyNavigatable.vue","../src/components/TableBodyNavigatable.vue","../src/components/composables/useHorizontalIndicesAndStyles.ts","../src/components/useColumnSizes.ts","../src/components/ui/EmptyRow.vue","../src/components/ui/EmptyRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/VirtualRow.vue","../src/components/VirtualRow.vue","../src/components/composables/useBodyWidth.ts","../src/components/composables/useCloseSubMenusOnScroll.ts","../src/components/composables/useOverflowStyles.ts","../src/components/composables/useCommonScrollContainerProps.ts","../src/components/composables/useResizeScrollSpacer.ts","../src/components/TableCoreVirtual.vue","../src/components/TableCoreVirtual.vue","../../../node_modules/.pnpm/raf-throttle@2.0.6/node_modules/raf-throttle/lib/rafThrottle.js","../src/components/composables/useAvailableWidth.ts","../src/components/TableCore.vue","../src/components/TableCore.vue","../src/components/composables/useBoolean.ts","../src/components/composables/useCellCopyPaste.ts","../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../src/components/composables/useCellSelection.ts","../src/components/composables/useEditCellKeydown.ts","../src/components/composables/useVisibleAfterAvailableWidth.ts","../src/components/control/PageNavigation.vue","../src/components/control/PageNavigation.vue","../src/components/control/PageRowRange.vue","../src/components/control/PageRowRange.vue","../src/components/control/PageControls.vue","../src/components/control/PageControls.vue","../src/components/control/actionbar/PopoverContainer.vue","../src/components/control/actionbar/useButtonPopoverInteraction.ts","../src/components/control/actionbar/SortControl.vue","../src/components/control/actionbar/SortControl.vue","../src/components/control/TableActionBar.vue","../src/components/control/TableActionBar.vue","../src/utils/columnHeaderActionButtons.ts","../src/components/layout/useAutoScrollOnRightEdge.ts","../src/components/layout/HeaderCell.vue","../src/components/layout/HeaderCell.vue","../src/components/layout/Header.vue","../src/components/layout/Header.vue","../src/components/layout/NewRowButton.vue","../src/components/layout/NewRowButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/Cell.vue","../src/components/layout/Cell.vue","../src/components/layout/Row.vue","../src/components/layout/Row.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/TableUI.vue","../src/components/TableUI.vue","../src/components/composables/useTableReady.ts","../src/components/TableUIWithAutoSizeCalculation.vue","../src/components/TableUIWithAutoSizeCalculation.vue"],"sourcesContent":["export const defaultPageSize = 10;\n\nexport const columnTypes = {\n Nominal: \"Nominal\" as const,\n String: \"String\" as const,\n DateTime: \"DateTime\" as const,\n Duration: \"Duration\" as const,\n Number: \"Number\" as const,\n Boolean: \"Boolean\" as const,\n Array: \"Array\" as const,\n Object: \"Object\" as const,\n Image: \"Image\" as const,\n};\n\ntype ValueOf<T> = T[keyof T];\n\nexport type ColumnType = ValueOf<typeof columnTypes>;\n\nexport const columnSortText = {\n [columnTypes.Nominal]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.String]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.DateTime]: {\n ascending: \"Oldest first\",\n descending: \"Newest first\",\n },\n [columnTypes.Duration]: {\n ascending: \"Shortest first\",\n descending: \"Longest first\",\n },\n [columnTypes.Number]: {\n ascending: \"Smallest first\",\n descending: \"Largest first\",\n },\n [columnTypes.Boolean]: {\n ascending: \"False first\",\n descending: \"True first\",\n },\n [columnTypes.Image]: {\n ascending: \"By filename A to Z\",\n descending: \"By filename Z to A\",\n },\n [columnTypes.Array]: {\n ascending: \"Fewest items first\",\n descending: \"Most items first\",\n },\n [columnTypes.Object]: {\n ascending: \"Fewest keys first\",\n descending: \"Most keys first\",\n },\n default: {\n ascending: \"Ascending\",\n descending: \"Descending\",\n },\n} as Record<ColumnType | \"default\", { ascending: string; descending: string }>;\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const border = {\n action: {\n transparent: {\n color: {\n light: { h: 0, s: 0, l: 11.4, a: 0 },\n dark: { h: 0, s: 0, l: 11.4, a: 0 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(0 0% 11.4% / 0)\",\n variable: \"var(--kds-border-action-transparent)\",\n },\n },\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-default)\",\n },\n },\n disabled: {\n color: {\n light: { h: 0, s: 0, l: 72.5, a: 1 },\n dark: { h: 0, s: 0, l: 48.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 72.5%), hsl(0, 0%, 48.2%))\",\n variable: \"var(--kds-border-action-disabled)\",\n },\n },\n focused: {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-focused)\",\n },\n },\n selected: {\n color: {\n light: { h: 171.8, s: 27, l: 47.8, a: 1 },\n dark: { h: 168, s: 46.7, l: 85.3, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(171.8, 27%, 47.8%), hsl(168, 46.7%, 85.3%))\",\n variable: \"var(--kds-border-action-selected)\",\n },\n },\n \"selected-accent\": {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-selected-accent)\",\n },\n },\n error: {\n color: {\n light: { h: 348.8, s: 90.9, l: 34.5, a: 1 },\n dark: { h: 3.5, s: 100, l: 79.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348.8, 90.9%, 34.5%), hsl(3.5, 100%, 79.6%))\",\n variable: \"var(--kds-border-action-error)\",\n },\n },\n primary: {\n color: {\n light: { h: 176.7, s: 82, l: 17.5, a: 1 },\n dark: { h: 176.7, s: 82, l: 17.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(176.7, 82%, 17.5%)\",\n variable: \"var(--kds-border-action-primary)\",\n },\n },\n input: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-input)\",\n },\n },\n },\n base: {\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-base-default)\",\n },\n },\n muted: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.2 },\n dark: { h: 0, s: 0, l: 99, a: 0.2 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.2), hsl(0 0% 99% / 0.2))\",\n variable: \"var(--kds-border-base-muted)\",\n },\n },\n subtle: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.1 },\n dark: { h: 0, s: 0, l: 99, a: 0.1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.1), hsl(0 0% 99% / 0.1))\",\n variable: \"var(--kds-border-base-subtle)\",\n },\n },\n brand: {\n color: {\n light: { h: 50.8, s: 100, l: 50, a: 1 },\n dark: { h: 50.8, s: 100, l: 50, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(50.8, 100%, 50%)\",\n variable: \"var(--kds-border-base-brand)\",\n },\n },\n danger: {\n color: {\n light: { h: 3.4, s: 100, l: 86.1, a: 1 },\n dark: { h: 348, s: 94.3, l: 20.8, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(3.4, 100%, 86.1%), hsl(348, 94.3%, 20.8%))\",\n variable: \"var(--kds-border-base-danger)\",\n },\n },\n warning: {\n color: {\n light: { h: 30.8, s: 79.3, l: 73.5, a: 1 },\n dark: { h: 13.1, s: 66.1, l: 23.1, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(30.8, 79.3%, 73.5%), hsl(13.1, 66.1%, 23.1%))\",\n variable: \"var(--kds-border-base-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 112, s: 56.5, l: 71.2, a: 1 },\n dark: { h: 123.7, s: 46.7, l: 20.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(112, 56.5%, 71.2%), hsl(123.7, 46.7%, 20.6%))\",\n variable: \"var(--kds-border-base-success)\",\n },\n },\n info: {\n color: {\n light: { h: 214.5, s: 100, l: 84.3, a: 1 },\n dark: { h: 210, s: 50, l: 27.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(214.5, 100%, 84.3%), hsl(210, 50%, 27.5%))\",\n variable: \"var(--kds-border-base-info)\",\n },\n },\n },\n \"node-status\": {\n empty: {\n color: {\n light: { h: 0, s: 0, l: 90.2, a: 1 },\n dark: { h: 0, s: 0, l: 32.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 32.2%))\",\n variable: \"var(--kds-border-node-status-empty)\",\n },\n },\n error: {\n color: {\n light: { h: 348, s: 94.3, l: 20.8, a: 1 },\n dark: { h: 2.6, s: 100, l: 72.4, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348, 94.3%, 20.8%), hsl(2.6, 100%, 72.4%))\",\n variable: \"var(--kds-border-node-status-error)\",\n },\n },\n warning: {\n color: {\n light: { h: 19, s: 63.1, l: 38.2, a: 1 },\n dark: { h: 49.1, s: 99.1, l: 43.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(19, 63.1%, 38.2%), hsl(49.1, 99.1%, 43.7%))\",\n variable: \"var(--kds-border-node-status-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 116.1, s: 46.6, l: 25.7, a: 1 },\n dark: { h: 106.5, s: 42.6, l: 54.9, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(116.1, 46.6%, 25.7%), hsl(106.5, 42.6%, 54.9%))\",\n variable: \"var(--kds-border-node-status-success)\",\n },\n },\n },\n ResizeHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.4 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.4))\",\n variable: \"var(--kds-border-resize-handle-initial)\",\n },\n },\n hover: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.64 },\n dark: { h: 0, s: 0, l: 99, a: 0.58 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.64), hsl(0 0% 99% / 0.58))\",\n variable: \"var(--kds-border-resize-handle-hover)\",\n },\n },\n active: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.74 },\n dark: { h: 0, s: 0, l: 99, a: 0.68 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.74), hsl(0 0% 99% / 0.68))\",\n variable: \"var(--kds-border-resize-handle-active)\",\n },\n },\n },\n ColorPickerHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 99, a: 1 },\n dark: { h: 0, s: 0, l: 99, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid hsl(0, 0%, 99%)\",\n variable: \"var(--kds-border-color-picker-handle-initial)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const dimension = {\n component: {\n height: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-height-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-height-0-25x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-height-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-height-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-height-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-height-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-height-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-height-1-75x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-height-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-height-2-75x)\",\n },\n },\n \"2.5x\": {\n value: 40,\n unit: \"px\",\n css: {\n value: \"40px\",\n variable: \"var(--kds-dimension-component-height-2-5x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-height-4x)\",\n },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: {\n value: \"80px\",\n variable: \"var(--kds-dimension-component-height-5x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-height-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-height-12-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-height-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-height-25x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-height-45x)\",\n },\n },\n },\n width: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-width-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-width-0-25x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-width-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-width-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-width-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-width-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-width-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-width-1-75x)\",\n },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: {\n value: \"32px\",\n variable: \"var(--kds-dimension-component-width-2x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-width-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-width-2-75x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-width-4x)\",\n },\n },\n \"6x\": {\n value: 96,\n unit: \"px\",\n css: {\n value: \"96px\",\n variable: \"var(--kds-dimension-component-width-6x)\",\n },\n },\n \"8x\": {\n value: 128,\n unit: \"px\",\n css: {\n value: \"128px\",\n variable: \"var(--kds-dimension-component-width-8x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-width-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-width-12-5x)\",\n },\n },\n \"16x\": {\n value: 256,\n unit: \"px\",\n css: {\n value: \"256px\",\n variable: \"var(--kds-dimension-component-width-16x)\",\n },\n },\n \"17.5x\": {\n value: 280,\n unit: \"px\",\n css: {\n value: \"280px\",\n variable: \"var(--kds-dimension-component-width-17-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-width-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-width-25x)\",\n },\n },\n \"32x\": {\n value: 512,\n unit: \"px\",\n css: {\n value: \"512px\",\n variable: \"var(--kds-dimension-component-width-32x)\",\n },\n },\n \"35x\": {\n value: 560,\n unit: \"px\",\n css: {\n value: \"560px\",\n variable: \"var(--kds-dimension-component-width-35x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-width-45x)\",\n },\n },\n \"52.5x\": {\n value: 840,\n unit: \"px\",\n css: {\n value: \"840px\",\n variable: \"var(--kds-dimension-component-width-52-5x)\",\n },\n },\n \"61x\": {\n value: 976,\n unit: \"px\",\n css: {\n value: \"976px\",\n variable: \"var(--kds-dimension-component-width-61x)\",\n },\n },\n },\n },\n icon: {\n \"0.56x\": {\n value: 9,\n unit: \"px\",\n css: { value: \"9px\", variable: \"var(--kds-dimension-icon-0-56x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-dimension-icon-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-dimension-icon-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-dimension-icon-1-25x)\" },\n },\n },\n chart: {\n \"line-width\": {\n value: 1.5,\n unit: \"px\",\n css: {\n value: \"1.5px\",\n variable: \"var(--kds-dimension-chart-line-width)\",\n },\n },\n \"segment-gap\": {\n value: 0.75,\n unit: \"px\",\n css: {\n value: \"0.75px\",\n variable: \"var(--kds-dimension-chart-segment-gap)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const spacing = {\n container: {\n negative: {\n \"0.25x\": {\n value: -4,\n unit: \"px\",\n css: {\n value: \"-4px\",\n variable: \"var(--kds-spacing-container-negative-0-25x)\",\n },\n },\n \"0.375x\": {\n value: -6,\n unit: \"px\",\n css: {\n value: \"-6px\",\n variable: \"var(--kds-spacing-container-negative-0-375x)\",\n },\n },\n \"0.5x\": {\n value: -8,\n unit: \"px\",\n css: {\n value: \"-8px\",\n variable: \"var(--kds-spacing-container-negative-0-5x)\",\n },\n },\n },\n none: {\n value: 0,\n unit: \"px\",\n css: { value: \"0\", variable: \"var(--kds-spacing-container-none)\" },\n },\n \"0.10x\": {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-container-0-10x)\" },\n },\n \"0.12x\": {\n value: 2,\n unit: \"px\",\n css: { value: \"2px\", variable: \"var(--kds-spacing-container-0-12x)\" },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: { value: \"4px\", variable: \"var(--kds-spacing-container-0-25x)\" },\n },\n \"0.37x\": {\n value: 6,\n unit: \"px\",\n css: { value: \"6px\", variable: \"var(--kds-spacing-container-0-37x)\" },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: { value: \"8px\", variable: \"var(--kds-spacing-container-0-5x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-spacing-container-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-spacing-container-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-spacing-container-1-25x)\" },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: { value: \"24px\", variable: \"var(--kds-spacing-container-1-5x)\" },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: { value: \"32px\", variable: \"var(--kds-spacing-container-2x)\" },\n },\n \"3x\": {\n value: 48,\n unit: \"px\",\n css: { value: \"48px\", variable: \"var(--kds-spacing-container-3x)\" },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: { value: \"64px\", variable: \"var(--kds-spacing-container-4x)\" },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: { value: \"80px\", variable: \"var(--kds-spacing-container-5x)\" },\n },\n },\n offset: {\n focus: {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-offset-focus)\" },\n },\n },\n inputLabel: {\n \"spacing-bottom\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-input-label-spacing-bottom)\",\n },\n },\n },\n SubText: {\n \"spacing-top\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-sub-text-spacing-top)\",\n },\n },\n },\n};\n","import { border, dimension, spacing } from \"@knime/kds-styles/tokens\";\n\n// The parts a column header's minimum width is made of: its horizontal\n// padding, the action buttons it shows, and the gap between them. See\n// {@link minColumnSize}.\nconst HEADER_HORIZONTAL_PADDING =\n spacing.container[\"0.5x\"].value + spacing.container[\"0.37x\"].value;\nconst HEADER_ACTION_BUTTON_GAP = spacing.container[\"0.12x\"].value;\nconst HEADER_ACTION_BUTTON_WIDTH = dimension.component.width[\"1.5x\"].value;\n// Wider than the others, since it is permanently visible (see HeaderCell.vue).\nconst DELETE_COLUMN_BUTTON_WIDTH = dimension.component.width[\"2x\"].value;\n\n// the min-width of cells in the header and rows, no matter what the header of\n// the column holds\nexport const MIN_COLUMN_SIZE = 50;\n\n/**\n * The min-width of a column whose header shows the given action buttons, i.e.\n * the width at which its name has truncated away entirely but the buttons\n * still fit. Never below {@link MIN_COLUMN_SIZE}. Enforced on the column size\n * shared with the row cells rather than as a header-only CSS min-width, which\n * would desync the header cell's width from its column's and shift later\n * columns out of alignment.\n */\nexport const minColumnSize = ({\n menuButton = false,\n sortButton = false,\n deleteButton = false,\n}: {\n menuButton?: boolean;\n sortButton?: boolean;\n deleteButton?: boolean;\n}) => {\n const buttonWidths = [\n ...(menuButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(sortButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(deleteButton ? [DELETE_COLUMN_BUTTON_WIDTH] : []),\n ];\n const gaps = Math.max(buttonWidths.length - 1, 0) * HEADER_ACTION_BUTTON_GAP;\n return Math.max(\n MIN_COLUMN_SIZE,\n HEADER_HORIZONTAL_PADDING +\n buttonWidths.reduce((total, width) => total + width, 0) +\n gaps,\n );\n};\n\n// the max-width of cells in the header and rows when using fit content column sizing\nexport const MAX_AUTO_COLUMN_SIZE = 960;\n\n// the width of special (collapser, selection, filter) columns in the header and rows\nexport const SPECIAL_COLUMNS_SIZE = dimension.component.width[\"2x\"].value;\n\n// the bottom border width of any given row\nexport const ROW_BORDER_BOTTOM_WIDTH = border.base.subtle.width.value;\n\n// the default height of a row, including its bottom border\nexport const DEFAULT_ROW_HEIGHT =\n dimension.component.height[\"2.5x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the compact height of a row, including its bottom border\nexport const COMPACT_ROW_HEIGHT =\n dimension.component.height[\"1.75x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the default top/bottom padding of a row (kds.spacing.container.0_75x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const DEFAULT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.75x\"].value;\n\n// the compact top/bottom padding of a row (kds.spacing.container.0_37x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const COMPACT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.37x\"].value;\n\n// the default horizontal padding of a table cell (kds.spacing.container.0_5x)\nexport const CELL_PADDING_HORIZONTAL = spacing.container[\"0.5x\"].value;\n\n// the minimum height of a row\nexport const MIN_ROW_HEIGHT = COMPACT_ROW_HEIGHT;\n\n// the height of the table header and group headers\nexport const HEADER_HEIGHT =\n dimension.component.height[\"2.5x\"].value + 2 * ROW_BORDER_BOTTOM_WIDTH;\n\n// the maximum width of the submenu in the header\nexport const MAX_SUB_MENU_WIDTH = 160;\n\n// after resizing rows, scroll is temporarily disabled until the resize is complete to prevent jumps\nexport const ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY = 100;\n\n// the width of the column resize drag handle\nexport const COLUMN_RESIZE_DRAG_HANDLE_WIDTH = 5;\n\n// the width of the cell expand button\nexport const EXPAND_BUTTON_WIDTH = dimension.component.width[\"1x\"].value;\n\nexport default {\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n MIN_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n COMPACT_ROW_HEIGHT,\n CELL_PADDING_HORIZONTAL,\n};\n","import type { PropType } from \"vue\";\n\n/**\n * Background-color tokens the table can be rendered on top of. Used to match\n * the table header's background to the surface surrounding the table.\n */\nexport const BACKGROUND_COLORS = [\n \"page-default\",\n \"surface-default\",\n \"surface-muted\",\n \"surface-subtle\",\n] as const;\n\nexport type BackgroundColor = (typeof BACKGROUND_COLORS)[number];\n\n/**\n * Shared Vue prop options for `renderedOnBackgroundColor`, used by every\n * component that exposes it. The `validator` guards the runtime value for\n * plain-JS callers that bypass the `BackgroundColor` type at compile time.\n */\nexport const renderedOnBackgroundColorProp = {\n type: String as PropType<BackgroundColor>,\n default: \"page-default\" as BackgroundColor,\n validator: (value: string) =>\n (BACKGROUND_COLORS as readonly string[]).includes(value),\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ColumnConfig } from \"..\";\n\nconst isNonEmptyObject = (val: any) =>\n val !== null &&\n typeof val === \"object\" &&\n Object.getOwnPropertyNames(val).length > 0;\n\nconst isObjectRepresentation = (\n val: any,\n): val is { value?: any; color?: string; metadata?: string } => {\n const possibleKeys = [\"value\", \"metadata\", \"color\"];\n return (\n isNonEmptyObject(val) &&\n Object.getOwnPropertyNames(val).every((key) => possibleKeys.includes(key))\n );\n};\n\nexport const unpackObjectRepresentation = (val: any) => {\n if (isObjectRepresentation(val)) {\n if (val.hasOwnProperty(\"metadata\") && !val.hasOwnProperty(\"value\")) {\n return null;\n }\n return val.value;\n }\n return val;\n};\n\nexport const getColor = (val: any) => {\n if (isObjectRepresentation(val) && val.hasOwnProperty(\"color\")) {\n const color = val.color;\n return typeof color === \"undefined\" ? null : color;\n }\n return null;\n};\n\nexport const isMissingValue = (val: any): val is { metadata: string } | null =>\n val === null ||\n (isObjectRepresentation(val) && val?.hasOwnProperty(\"metadata\"));\n\nexport const getMissingValueMessage = (\n cellData: { metadata: string } | null,\n) => {\n const metadata = cellData?.metadata;\n const missingValueMsg = typeof metadata === \"string\" ? ` (${metadata})` : \"\";\n return `Missing Value${missingValueMsg}`;\n};\n\nexport const isEmpty = (val: any): val is { value: undefined } | undefined =>\n typeof unpackObjectRepresentation(val) === \"undefined\";\n\nexport const getPropertiesFromColumns = <T extends keyof ColumnConfig>(\n columnConfigs: ColumnConfig[],\n key: T,\n): Array<ColumnConfig[T]> => columnConfigs.map((colConfig) => colConfig[key]);\n","import { computed, customRef, effectScope, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, isReactive, isRef, nextTick, onBeforeMount, onBeforeUnmount, onMounted, onScopeDispose, onUnmounted, provide, reactive, readonly, ref, shallowReadonly, shallowRef, toRef as toRef$1, toRefs as toRefs$1, toValue, unref, watch, watchEffect } from \"vue\";\n//#region computedEager/index.ts\n/**\n*\n* @deprecated This function will be removed in future version.\n*\n* Note: If you are using Vue 3.4+, you can straight use computed instead.\n* Because in Vue 3.4+, if computed new value does not change,\n* computed, effect, watch, watchEffect, render dependencies will not be triggered.\n* refer: https://github.com/vuejs/core/pull/5912\n*\n* @param fn effect function\n* @param options WatchOptionsBase\n* @returns readonly shallowRef\n*/\nfunction computedEager(fn, options) {\n\tvar _options$flush;\n\tconst result = shallowRef();\n\twatchEffect(() => {\n\t\tresult.value = fn();\n\t}, {\n\t\t...options,\n\t\tflush: (_options$flush = options === null || options === void 0 ? void 0 : options.flush) !== null && _options$flush !== void 0 ? _options$flush : \"sync\"\n\t});\n\treturn readonly(result);\n}\n/** @deprecated use `computedEager` instead */\nconst eagerComputed = computedEager;\n//#endregion\n//#region computedWithControl/index.ts\n/**\n* Explicitly define the deps of computed.\n*\n* @param source\n* @param fn\n*/\nfunction computedWithControl(source, fn, options = {}) {\n\tlet v = void 0;\n\tlet track;\n\tlet trigger;\n\tlet dirty = true;\n\tconst update = () => {\n\t\tdirty = true;\n\t\ttrigger();\n\t};\n\twatch(source, update, {\n\t\tflush: \"sync\",\n\t\t...options\n\t});\n\tconst get = typeof fn === \"function\" ? fn : fn.get;\n\tconst set = typeof fn === \"function\" ? void 0 : fn.set;\n\tconst result = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tif (dirty) {\n\t\t\t\t\tv = get(v);\n\t\t\t\t\tdirty = false;\n\t\t\t\t}\n\t\t\t\ttrack();\n\t\t\t\treturn v;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset === null || set === void 0 || set(v);\n\t\t\t}\n\t\t};\n\t});\n\tresult.trigger = update;\n\treturn result;\n}\n/** @deprecated use `computedWithControl` instead */\nconst controlledComputed = computedWithControl;\n//#endregion\n//#region createDisposableDirective/index.ts\n/**\n* Utility for authoring disposable directives. Reactive effects created within `mounted` directive hook will be tracked and automatically disposed when directive is unmounted.\n*\n* @see https://vueuse.org/createDisposableDirective\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createDisposableDirective(origin = {}) {\n\tfunction isFunc(fn) {\n\t\treturn typeof fn === \"function\";\n\t}\n\tconst normalisedOrigin = isFunc(origin) ? {\n\t\tmounted: origin,\n\t\tupdated: origin\n\t} : origin;\n\tconst { mounted, unmounted } = normalisedOrigin;\n\tif (!isFunc(mounted)) return origin;\n\tconst scopeWeakMap = /* @__PURE__ */ new WeakMap();\n\treturn {\n\t\t...normalisedOrigin,\n\t\tmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get;\n\t\t\tconst scope = (_scopeWeakMap$get = scopeWeakMap.get(el)) !== null && _scopeWeakMap$get !== void 0 ? _scopeWeakMap$get : effectScope();\n\t\t\tscopeWeakMap.set(el, scope);\n\t\t\tscope.run(() => {\n\t\t\t\tmounted === null || mounted === void 0 || mounted(el, binding, vNode, prevNode);\n\t\t\t});\n\t\t},\n\t\tunmounted(el, binding, vNode, prevNode) {\n\t\t\tvar _scopeWeakMap$get2;\n\t\t\t(_scopeWeakMap$get2 = scopeWeakMap.get(el)) === null || _scopeWeakMap$get2 === void 0 || _scopeWeakMap$get2.stop();\n\t\t\tscopeWeakMap.delete(el);\n\t\t\tif (isFunc(unmounted)) unmounted(el, binding, vNode, prevNode);\n\t\t}\n\t};\n}\n//#endregion\n//#region tryOnScopeDispose/index.ts\n/**\n* Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing\n*\n* @param fn\n*/\nfunction tryOnScopeDispose(fn, failSilently) {\n\tif (getCurrentScope()) {\n\t\tonScopeDispose(fn, failSilently);\n\t\treturn true;\n\t}\n\treturn false;\n}\n//#endregion\n//#region createEventHook/index.ts\n/**\n* Utility for creating event hooks\n*\n* @see https://vueuse.org/createEventHook\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createEventHook() {\n\tconst fns = /* @__PURE__ */ new Set();\n\tconst off = (fn) => {\n\t\tfns.delete(fn);\n\t};\n\tconst clear = () => {\n\t\tfns.clear();\n\t};\n\tconst on = (fn) => {\n\t\tfns.add(fn);\n\t\tconst offFn = () => off(fn);\n\t\ttryOnScopeDispose(offFn);\n\t\treturn { off: offFn };\n\t};\n\tconst trigger = (...args) => {\n\t\treturn Promise.all(Array.from(fns).map((fn) => fn(...args)));\n\t};\n\treturn {\n\t\ton,\n\t\toff,\n\t\ttrigger,\n\t\tclear\n\t};\n}\n//#endregion\n//#region createGlobalState/index.ts\n/**\n* Keep states in the global scope to be reusable across Vue instances.\n*\n* @see https://vueuse.org/createGlobalState\n* @param stateFactory A factory function to create the state\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createGlobalState(stateFactory) {\n\tlet initialized = false;\n\tlet state;\n\tconst scope = effectScope(true);\n\treturn ((...args) => {\n\t\tif (!initialized) {\n\t\t\tstate = scope.run(() => stateFactory(...args));\n\t\t\tinitialized = true;\n\t\t}\n\t\treturn state;\n\t});\n}\n//#endregion\n//#region provideLocal/map.ts\nconst localProvidedStateMap = /* @__PURE__ */ new WeakMap();\n//#endregion\n//#region injectLocal/index.ts\n/**\n* On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* injectLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*\n* @__NO_SIDE_EFFECTS__\n*/\nconst injectLocal = (...args) => {\n\tvar _getCurrentInstance;\n\tconst key = args[0];\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null && !hasInjectionContext()) throw new Error(\"injectLocal must be called in setup\");\n\tif (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];\n\treturn inject(...args);\n};\n//#endregion\n//#region provideLocal/index.ts\n/**\n* On the basis of `provide`, it is allowed to directly call inject to obtain the value after call provide in the same component.\n*\n* @example\n* ```ts\n* provideLocal('MyInjectionKey', 1)\n* const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1\n* ```\n*/\nfunction provideLocal(key, value) {\n\tvar _getCurrentInstance;\n\tconst instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;\n\tconst owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();\n\tif (owner == null) throw new Error(\"provideLocal must be called in setup\");\n\tif (!localProvidedStateMap.has(owner)) localProvidedStateMap.set(owner, Object.create(null));\n\tconst localProvidedState = localProvidedStateMap.get(owner);\n\tlocalProvidedState[key] = value;\n\treturn provide(key, value);\n}\n//#endregion\n//#region createInjectionState/index.ts\nfunction createInjectionState(composable, options) {\n\tconst key = (options === null || options === void 0 ? void 0 : options.injectionKey) || Symbol(composable.name || \"InjectionState\");\n\tconst defaultValue = options === null || options === void 0 ? void 0 : options.defaultValue;\n\tconst useProvidingState = (...args) => {\n\t\tconst state = composable(...args);\n\t\tprovideLocal(key, state);\n\t\treturn state;\n\t};\n\tconst useInjectedState = () => injectLocal(key, defaultValue);\n\treturn [useProvidingState, useInjectedState];\n}\n//#endregion\n//#region createRef/index.ts\n/**\n* Returns a `deepRef` or `shallowRef` depending on the `deep` param.\n*\n* @example createRef(1) // ShallowRef<number>\n* @example createRef(1, false) // ShallowRef<number>\n* @example createRef(1, true) // Ref<number>\n* @example createRef(\"string\") // ShallowRef<string>\n* @example createRef<\"A\"|\"B\">(\"A\", true) // Ref<\"A\"|\"B\">\n*\n* @param value\n* @param deep\n* @returns the `deepRef` or `shallowRef`\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createRef(value, deep) {\n\tif (deep === true) return ref(value);\n\telse return shallowRef(value);\n}\n//#endregion\n//#region utils/is.ts\nconst isClient = typeof window !== \"undefined\" && typeof document !== \"undefined\";\nconst isWorker = typeof WorkerGlobalScope !== \"undefined\" && globalThis instanceof WorkerGlobalScope;\nconst isDef = (val) => typeof val !== \"undefined\";\nconst notNullish = (val) => val != null;\nconst assert = (condition, ...infos) => {\n\tif (!condition) console.warn(...infos);\n};\nconst toString = Object.prototype.toString;\nconst isObject = (val) => toString.call(val) === \"[object Object]\";\nconst now = () => Date.now();\nconst timestamp = () => +Date.now();\nconst clamp = (n, min, max) => Math.min(max, Math.max(min, n));\nconst noop = () => {};\nconst rand = (min, max) => {\n\tmin = Math.ceil(min);\n\tmax = Math.floor(max);\n\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n};\nconst hasOwn = (val, key) => Object.hasOwn(val, key);\nconst isIOS = /* #__PURE__ */ getIsIOS();\nfunction getIsIOS() {\n\tvar _window, _window2, _window3;\n\treturn isClient && !!((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_window2 = window) === null || _window2 === void 0 || (_window2 = _window2.navigator) === null || _window2 === void 0 ? void 0 : _window2.maxTouchPoints) > 2 && /iPad|Macintosh/.test((_window3 = window) === null || _window3 === void 0 ? void 0 : _window3.navigator.userAgent));\n}\n//#endregion\n//#region toRef/index.ts\nfunction toRef(...args) {\n\tif (args.length !== 1) return toRef$1(...args);\n\tconst r = args[0];\n\treturn typeof r === \"function\" ? readonly(customRef(() => ({\n\t\tget: r,\n\t\tset: noop\n\t}))) : ref(r);\n}\n//#endregion\n//#region utils/filters.ts\nfunction createFilterWrapper(filter, fn) {\n\tfunction wrapper(...args) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tPromise.resolve(filter(() => fn.apply(this, args), {\n\t\t\t\tfn,\n\t\t\t\tthisArg: this,\n\t\t\t\targs\n\t\t\t})).then(resolve).catch(reject);\n\t\t});\n\t}\n\tif (\"cancel\" in filter) Object.assign(wrapper, {\n\t\tcancel: filter.cancel,\n\t\tflush: filter.flush,\n\t\tisPending: filter.isPending\n\t});\n\treturn wrapper;\n}\nconst bypassFilter = (invoke) => {\n\treturn invoke();\n};\n/**\n* Create an EventFilter that debounce the events\n*/\nfunction debounceFilter(ms, options = {}) {\n\tlet timer;\n\tlet maxTimer;\n\tlet lastRejector = noop;\n\tlet lastResolve = noop;\n\tconst _pending = shallowRef(false);\n\tconst _clearTimeout = (timer) => {\n\t\tclearTimeout(timer);\n\t\tlastRejector();\n\t\tlastRejector = noop;\n\t};\n\tlet lastInvoker;\n\tconst handler = (invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst maxDuration = toValue(options.maxWait);\n\t\tif (timer) _clearTimeout(timer);\n\t\tif (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\treturn Promise.resolve(invoke());\n\t\t}\n\t\t_pending.value = true;\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tlastRejector = options.rejectOnCancel ? reject : resolve;\n\t\t\tlastResolve = resolve;\n\t\t\tlastInvoker = invoke;\n\t\t\tif (maxDuration && !maxTimer) maxTimer = setTimeout(() => {\n\t\t\t\tif (timer) _clearTimeout(timer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}, maxDuration);\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tif (maxTimer) _clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t\t_pending.value = false;\n\t\t\t\tresolve(invoke());\n\t\t\t}, duration);\n\t\t});\n\t};\n\treturn Object.assign(handler, {\n\t\tcancel: () => {\n\t\t\tif (timer) {\n\t\t\t\t_clearTimeout(timer);\n\t\t\t\ttimer = void 0;\n\t\t\t}\n\t\t\tif (maxTimer) {\n\t\t\t\t_clearTimeout(maxTimer);\n\t\t\t\tmaxTimer = void 0;\n\t\t\t}\n\t\t\t_pending.value = false;\n\t\t\tlastResolve = noop;\n\t\t},\n\t\tflush: () => {\n\t\t\tif (_pending.value) {\n\t\t\t\tif (timer) {\n\t\t\t\t\tclearTimeout(timer);\n\t\t\t\t\ttimer = void 0;\n\t\t\t\t}\n\t\t\t\tif (maxTimer) {\n\t\t\t\t\tclearTimeout(maxTimer);\n\t\t\t\t\tmaxTimer = void 0;\n\t\t\t\t}\n\t\t\t\t_pending.value = false;\n\t\t\t\tconst resolve = lastResolve;\n\t\t\t\tlastRejector = noop;\n\t\t\t\tlastResolve = noop;\n\t\t\t\tresolve(lastInvoker());\n\t\t\t}\n\t\t},\n\t\tisPending: shallowReadonly(_pending)\n\t});\n}\nfunction throttleFilter(...args) {\n\tlet lastExec = 0;\n\tlet timer;\n\tlet isLeading = true;\n\tlet lastRejector = noop;\n\tlet lastValue;\n\tlet ms;\n\tlet trailing;\n\tlet leading;\n\tlet rejectOnCancel;\n\tif (!isRef(args[0]) && typeof args[0] === \"object\") ({delay: ms, trailing = true, leading = true, rejectOnCancel = false} = args[0]);\n\telse [ms, trailing = true, leading = true, rejectOnCancel = false] = args;\n\tconst clear = () => {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t\tlastRejector();\n\t\t\tlastRejector = noop;\n\t\t}\n\t};\n\tconst filter = (_invoke) => {\n\t\tconst duration = toValue(ms);\n\t\tconst elapsed = Date.now() - lastExec;\n\t\tconst invoke = () => {\n\t\t\treturn lastValue = _invoke();\n\t\t};\n\t\tclear();\n\t\tif (duration <= 0) {\n\t\t\tlastExec = Date.now();\n\t\t\treturn invoke();\n\t\t}\n\t\tif (elapsed > duration) {\n\t\t\tlastExec = Date.now();\n\t\t\tif (leading || !isLeading) invoke();\n\t\t} else if (trailing) lastValue = new Promise((resolve, reject) => {\n\t\t\tlastRejector = rejectOnCancel ? reject : resolve;\n\t\t\ttimer = setTimeout(() => {\n\t\t\t\tlastExec = Date.now();\n\t\t\t\tisLeading = true;\n\t\t\t\tresolve(invoke());\n\t\t\t\tclear();\n\t\t\t}, Math.max(0, duration - elapsed));\n\t\t});\n\t\tif (!leading && !timer) timer = setTimeout(() => isLeading = true, duration);\n\t\tisLeading = false;\n\t\treturn lastValue;\n\t};\n\treturn filter;\n}\n/**\n* EventFilter that gives extra controls to pause and resume the filter\n*\n* @param extendFilter Extra filter to apply when the PausableFilter is active, default to none\n* @param options Options to configure the filter\n*/\nfunction pausableFilter(extendFilter = bypassFilter, options = {}) {\n\tconst { initialState = \"active\" } = options;\n\tconst isActive = toRef(initialState === \"active\");\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tfunction resume() {\n\t\tisActive.value = true;\n\t}\n\tconst eventFilter = (...args) => {\n\t\tif (isActive.value) extendFilter(...args);\n\t};\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume,\n\t\teventFilter\n\t};\n}\n//#endregion\n//#region utils/general.ts\nfunction promiseTimeout(ms, throwOnTimeout = false, reason = \"Timeout\") {\n\treturn new Promise((resolve, reject) => {\n\t\tif (throwOnTimeout) setTimeout(reject, ms, reason);\n\t\telse setTimeout(resolve, ms);\n\t});\n}\nfunction identity(arg) {\n\treturn arg;\n}\n/**\n* Create singleton promise function\n*\n* @example\n* ```\n* const promise = createSingletonPromise(async () => { ... })\n*\n* await promise()\n* await promise() // all of them will be bind to a single promise instance\n* await promise() // and be resolved together\n* ```\n*/\nfunction createSingletonPromise(fn) {\n\tlet _promise;\n\tfunction wrapper() {\n\t\tif (!_promise) _promise = fn();\n\t\treturn _promise;\n\t}\n\twrapper.reset = async () => {\n\t\tconst _prev = _promise;\n\t\t_promise = void 0;\n\t\tif (_prev) await _prev;\n\t};\n\treturn wrapper;\n}\nfunction invoke(fn) {\n\treturn fn();\n}\nfunction containsProp(obj, ...props) {\n\treturn props.some((k) => k in obj);\n}\nfunction increaseWithUnit(target, delta) {\n\tvar _target$match;\n\tif (typeof target === \"number\") return target + delta;\n\tconst value = ((_target$match = target.match(/^-?\\d+\\.?\\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || \"\";\n\tconst unit = target.slice(value.length);\n\tconst result = Number.parseFloat(value) + delta;\n\tif (Number.isNaN(result)) return target;\n\treturn result + unit;\n}\n/**\n* Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client\n*/\nfunction pxValue(px) {\n\treturn px.endsWith(\"rem\") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);\n}\n/**\n* Create a new subset object by giving keys\n*/\nfunction objectPick(obj, keys, omitUndefined = false) {\n\treturn keys.reduce((n, k) => {\n\t\tif (k in obj) {\n\t\t\tif (!omitUndefined || obj[k] !== void 0) n[k] = obj[k];\n\t\t}\n\t\treturn n;\n\t}, {});\n}\n/**\n* Create a new subset object by omit giving keys\n*/\nfunction objectOmit(obj, keys, omitUndefined = false) {\n\treturn Object.fromEntries(Object.entries(obj).filter(([key, value]) => {\n\t\treturn (!omitUndefined || value !== void 0) && !keys.includes(key);\n\t}));\n}\nfunction objectEntries(obj) {\n\treturn Object.entries(obj);\n}\nfunction toArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\n//#endregion\n//#region utils/port.ts\nfunction cacheStringFunction(fn) {\n\tconst cache = Object.create(null);\n\treturn ((str) => {\n\t\treturn cache[str] || (cache[str] = fn(str));\n\t});\n}\nconst hyphenateRE = /\\B([A-Z])/g;\nconst hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nconst camelizeRE = /-(\\w)/g;\nconst camelize = cacheStringFunction((str) => {\n\treturn str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\n//#endregion\n//#region utils/vue.ts\nfunction getLifeCycleTarget(target) {\n\treturn target || getCurrentInstance();\n}\n//#endregion\n//#region createSharedComposable/index.ts\n/**\n* Make a composable function usable with multiple Vue instances.\n*\n* @see https://vueuse.org/createSharedComposable\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createSharedComposable(composable) {\n\tif (!isClient) return composable;\n\tlet subscribers = 0;\n\tlet state;\n\tlet scope;\n\tconst dispose = () => {\n\t\tsubscribers -= 1;\n\t\tif (scope && subscribers <= 0) {\n\t\t\tscope.stop();\n\t\t\tstate = void 0;\n\t\t\tscope = void 0;\n\t\t}\n\t};\n\treturn ((...args) => {\n\t\tsubscribers += 1;\n\t\tif (!scope) {\n\t\t\tscope = effectScope(true);\n\t\t\tstate = scope.run(() => composable(...args));\n\t\t}\n\t\ttryOnScopeDispose(dispose);\n\t\treturn state;\n\t});\n}\n//#endregion\n//#region extendRef/index.ts\nfunction extendRef(ref, extend, { enumerable = false, unwrap = true } = {}) {\n\tfor (const [key, value] of Object.entries(extend)) {\n\t\tif (key === \"value\") continue;\n\t\tif (isRef(value) && unwrap) Object.defineProperty(ref, key, {\n\t\t\tget() {\n\t\t\t\treturn value.value;\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tvalue.value = v;\n\t\t\t},\n\t\t\tenumerable\n\t\t});\n\t\telse Object.defineProperty(ref, key, {\n\t\t\tvalue,\n\t\t\tenumerable\n\t\t});\n\t}\n\treturn ref;\n}\n//#endregion\n//#region get/index.ts\nfunction get(obj, key) {\n\tif (key == null) return unref(obj);\n\treturn unref(obj)[key];\n}\n//#endregion\n//#region isDefined/index.ts\nfunction isDefined(v) {\n\treturn unref(v) != null;\n}\n//#endregion\n//#region makeDestructurable/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction makeDestructurable(obj, arr) {\n\tif (typeof Symbol !== \"undefined\") {\n\t\tconst clone = { ...obj };\n\t\tObject.defineProperty(clone, Symbol.iterator, {\n\t\t\tenumerable: false,\n\t\t\tvalue() {\n\t\t\t\tlet index = 0;\n\t\t\t\treturn { next: () => ({\n\t\t\t\t\tvalue: arr[index++],\n\t\t\t\t\tdone: index > arr.length\n\t\t\t\t}) };\n\t\t\t}\n\t\t});\n\t\treturn clone;\n\t} else return Object.assign([...arr], obj);\n}\n//#endregion\n//#region reactify/index.ts\n/**\n* Converts plain function into a reactive function.\n* The converted function accepts refs as it's arguments\n* and returns a ComputedRef, with proper typing.\n*\n* @param fn - Source function\n* @param options - Options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactify(fn, options) {\n\tconst unrefFn = (options === null || options === void 0 ? void 0 : options.computedGetter) === false ? unref : toValue;\n\treturn function(...args) {\n\t\treturn computed(() => fn.apply(this, args.map((i) => unrefFn(i))));\n\t};\n}\n/** @deprecated use `reactify` instead */\nconst createReactiveFn = reactify;\n//#endregion\n//#region reactifyObject/index.ts\n/**\n* Apply `reactify` to an object\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction reactifyObject(obj, optionsOrKeys = {}) {\n\tlet keys = [];\n\tlet options;\n\tif (Array.isArray(optionsOrKeys)) keys = optionsOrKeys;\n\telse {\n\t\toptions = optionsOrKeys;\n\t\tconst { includeOwnProperties = true } = optionsOrKeys;\n\t\tkeys.push(...Object.keys(obj));\n\t\tif (includeOwnProperties) keys.push(...Object.getOwnPropertyNames(obj));\n\t}\n\treturn Object.fromEntries(keys.map((key) => {\n\t\tconst value = obj[key];\n\t\treturn [key, typeof value === \"function\" ? reactify(value.bind(obj), options) : value];\n\t}));\n}\n//#endregion\n//#region toReactive/index.ts\n/**\n* Converts ref to reactive.\n*\n* @see https://vueuse.org/toReactive\n* @param objectRef A ref of object\n*/\nfunction toReactive(objectRef) {\n\tif (!isRef(objectRef)) return reactive(objectRef);\n\treturn reactive(new Proxy({}, {\n\t\tget(_, p, receiver) {\n\t\t\treturn unref(Reflect.get(objectRef.value, p, receiver));\n\t\t},\n\t\tset(_, p, value) {\n\t\t\tif (isRef(objectRef.value[p]) && !isRef(value)) objectRef.value[p].value = value;\n\t\t\telse objectRef.value[p] = value;\n\t\t\treturn true;\n\t\t},\n\t\tdeleteProperty(_, p) {\n\t\t\treturn Reflect.deleteProperty(objectRef.value, p);\n\t\t},\n\t\thas(_, p) {\n\t\t\treturn Reflect.has(objectRef.value, p);\n\t\t},\n\t\townKeys() {\n\t\t\treturn Object.keys(objectRef.value);\n\t\t},\n\t\tgetOwnPropertyDescriptor() {\n\t\t\treturn {\n\t\t\t\tenumerable: true,\n\t\t\t\tconfigurable: true\n\t\t\t};\n\t\t}\n\t}));\n}\n//#endregion\n//#region reactiveComputed/index.ts\n/**\n* Computed reactive object.\n*/\nfunction reactiveComputed(fn) {\n\treturn toReactive(computed(fn));\n}\n//#endregion\n//#region reactiveOmit/index.ts\n/**\n* Reactively omit fields from a reactive object\n*\n* @see https://vueuse.org/reactiveOmit\n*/\nfunction reactiveOmit(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => !predicate(toValue(v), k))) : Object.fromEntries(Object.entries(toRefs$1(obj)).filter((e) => !flatKeys.includes(e[0]))));\n}\n//#endregion\n//#region reactivePick/index.ts\n/**\n* Reactively pick fields from a reactive object\n*\n* @see https://vueuse.org/reactivePick\n*/\nfunction reactivePick(obj, ...keys) {\n\tconst flatKeys = keys.flat();\n\tconst predicate = flatKeys[0];\n\treturn reactiveComputed(() => typeof predicate === \"function\" ? Object.fromEntries(Object.entries(toRefs$1(obj)).filter(([k, v]) => predicate(toValue(v), k))) : Object.fromEntries(flatKeys.map((k) => [k, toRef(obj, k)])));\n}\n//#endregion\n//#region refAutoReset/index.ts\n/**\n* Create a ref which will be reset to the default value after some time.\n*\n* @see https://vueuse.org/refAutoReset\n* @param defaultValue The value which will be set.\n* @param afterMs A zero-or-greater delay in milliseconds.\n*/\nfunction refAutoReset(defaultValue, afterMs = 1e4) {\n\treturn customRef((track, trigger) => {\n\t\tlet value = toValue(defaultValue);\n\t\tlet timer;\n\t\tconst resetAfter = () => setTimeout(() => {\n\t\t\tvalue = toValue(defaultValue);\n\t\t\ttrigger();\n\t\t}, toValue(afterMs));\n\t\ttryOnScopeDispose(() => {\n\t\t\tclearTimeout(timer);\n\t\t});\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t\tclearTimeout(timer);\n\t\t\t\ttimer = resetAfter();\n\t\t\t}\n\t\t};\n\t});\n}\n/** @deprecated use `refAutoReset` instead */\nconst autoResetRef = refAutoReset;\n//#endregion\n//#region useDebounceFn/index.ts\n/**\n* Debounce execution of a function.\n*\n* @see https://vueuse.org/useDebounceFn\n* @param fn A function to be executed after delay milliseconds debounced.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param options Options\n*\n* @return A new, debounced, function with isPending, cancel, and flush properties.\n*/\nfunction useDebounceFn(fn, ms = 200, options = {}) {\n\treturn createFilterWrapper(debounceFilter(ms, options), fn);\n}\n//#endregion\n//#region refDebounced/index.ts\n/**\n* Debounce updates of a ref.\n*\n* @return A new debounced ref.\n*/\nfunction refDebounced(value, ms = 200, options = {}) {\n\tconst debounced = ref(toValue(value));\n\tconst updater = useDebounceFn(() => {\n\t\tdebounced.value = value.value;\n\t}, ms, options);\n\twatch(value, () => updater());\n\treturn shallowReadonly(debounced);\n}\n/** @deprecated use `refDebounced` instead */\nconst debouncedRef = refDebounced;\n/** @deprecated use `refDebounced` instead */\nconst useDebounce = refDebounced;\n//#endregion\n//#region refDefault/index.ts\n/**\n* Apply default value to a ref.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refDefault(source, defaultValue) {\n\treturn computed({\n\t\tget() {\n\t\t\tvar _source$value;\n\t\t\treturn (_source$value = source.value) !== null && _source$value !== void 0 ? _source$value : defaultValue;\n\t\t},\n\t\tset(value) {\n\t\t\tsource.value = value;\n\t\t}\n\t});\n}\n//#endregion\n//#region refManualReset/index.ts\n/**\n* Create a ref with manual reset functionality.\n*\n* @see https://vueuse.org/refManualReset\n* @param defaultValue The value which will be set.\n*/\nfunction refManualReset(defaultValue) {\n\tlet value = toValue(defaultValue);\n\tlet trigger;\n\tconst reset = () => {\n\t\tvalue = toValue(defaultValue);\n\t\ttrigger();\n\t};\n\tconst refValue = customRef((track, _trigger) => {\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\ttrack();\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tset(newValue) {\n\t\t\t\tvalue = newValue;\n\t\t\t\ttrigger();\n\t\t\t}\n\t\t};\n\t});\n\trefValue.reset = reset;\n\treturn refValue;\n}\n//#endregion\n//#region useThrottleFn/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,\n* to `callback` when the throttled-function is executed.\n* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* (default value: 200)\n*\n* @param [trailing] if true, call fn again after the time is up (default value: false)\n*\n* @param [leading] if true, call fn on the leading edge of the ms timeout (default value: true)\n*\n* @param [rejectOnCancel] if true, reject the last call if it's been cancel (default value: false)\n*\n* @return A new, throttled, function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useThrottleFn(fn, ms = 200, trailing = false, leading = true, rejectOnCancel = false) {\n\treturn createFilterWrapper(throttleFilter(ms, trailing, leading, rejectOnCancel), fn);\n}\n//#endregion\n//#region refThrottled/index.ts\n/**\n* Throttle execution of a function. Especially useful for rate limiting\n* execution of handlers on events like resize and scroll.\n*\n* @param value Ref value to be watched with throttle effect\n* @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.\n* @param trailing if true, update the value again after the delay time is up\n* @param leading if true, update the value on the leading edge of the ms timeout\n*/\nfunction refThrottled(value, delay = 200, trailing = true, leading = true) {\n\tif (delay <= 0) return value;\n\tconst throttled = ref(toValue(value));\n\tconst updater = useThrottleFn(() => {\n\t\tthrottled.value = value.value;\n\t}, delay, trailing, leading);\n\twatch(value, () => updater());\n\treturn throttled;\n}\n/** @deprecated use `refThrottled` instead */\nconst throttledRef = refThrottled;\n/** @deprecated use `refThrottled` instead */\nconst useThrottle = refThrottled;\n//#endregion\n//#region refWithControl/index.ts\n/**\n* Fine-grained controls over ref and its reactivity.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction refWithControl(initial, options = {}) {\n\tlet source = initial;\n\tlet track;\n\tlet trigger;\n\tconst ref = customRef((_track, _trigger) => {\n\t\ttrack = _track;\n\t\ttrigger = _trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\treturn get();\n\t\t\t},\n\t\t\tset(v) {\n\t\t\t\tset(v);\n\t\t\t}\n\t\t};\n\t});\n\tfunction get(tracking = true) {\n\t\tif (tracking) track();\n\t\treturn source;\n\t}\n\tfunction set(value, triggering = true) {\n\t\tvar _options$onBeforeChan, _options$onChanged;\n\t\tif (value === source) return;\n\t\tconst old = source;\n\t\tif (((_options$onBeforeChan = options.onBeforeChange) === null || _options$onBeforeChan === void 0 ? void 0 : _options$onBeforeChan.call(options, value, old)) === false) return;\n\t\tsource = value;\n\t\t(_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, value, old);\n\t\tif (triggering) trigger();\n\t}\n\t/**\n\t* Get the value without tracked in the reactivity system\n\t*/\n\tconst untrackedGet = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*/\n\tconst silentSet = (v) => set(v, false);\n\t/**\n\t* Get the value without tracked in the reactivity system.\n\t*\n\t* Alias for `untrackedGet()`\n\t*/\n\tconst peek = () => get(false);\n\t/**\n\t* Set the value without triggering the reactivity system\n\t*\n\t* Alias for `silentSet(v)`\n\t*/\n\tconst lay = (v) => set(v, false);\n\treturn extendRef(ref, {\n\t\tget,\n\t\tset,\n\t\tuntrackedGet,\n\t\tsilentSet,\n\t\tpeek,\n\t\tlay\n\t}, { enumerable: true });\n}\n/** @deprecated use `refWithControl` instead */\nconst controlledRef = refWithControl;\n//#endregion\n//#region set/index.ts\n/**\n* Shorthand for `ref.value = x`\n*/\nfunction set(...args) {\n\tif (args.length === 2) {\n\t\tconst [ref, value] = args;\n\t\tref.value = value;\n\t}\n\tif (args.length === 3) {\n\t\tconst [target, key, value] = args;\n\t\ttarget[key] = value;\n\t}\n}\n//#endregion\n//#region watchWithFilter/index.ts\nfunction watchWithFilter(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\treturn watch(source, createFilterWrapper(eventFilter, cb), watchOptions);\n}\n//#endregion\n//#region watchPausable/index.ts\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nfunction watchPausable(source, cb, options = {}) {\n\tconst { eventFilter: filter, initialState = \"active\", ...watchOptions } = options;\n\tconst { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });\n\treturn {\n\t\tstop: watchWithFilter(source, cb, {\n\t\t\t...watchOptions,\n\t\t\teventFilter\n\t\t}),\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n/** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */\nconst pausableWatch = watchPausable;\n//#endregion\n//#region syncRef/index.ts\n/**\n* Two-way refs synchronization.\n* From the set theory perspective to restrict the option's type\n* Check in the following order:\n* 1. L = R\n* 2. L ∩ R ≠ ∅\n* 3. L ⊆ R\n* 4. L ∩ R = ∅\n*/\nfunction syncRef(left, right, ...[options]) {\n\tconst { flush = \"sync\", deep = false, immediate = true, direction = \"both\", transform = {} } = options || {};\n\tconst watchers = [];\n\tconst transformLTR = \"ltr\" in transform && transform.ltr || ((v) => v);\n\tconst transformRTL = \"rtl\" in transform && transform.rtl || ((v) => v);\n\tif (direction === \"both\" || direction === \"ltr\") watchers.push(watchPausable(left, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tright.value = transformLTR(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tif (direction === \"both\" || direction === \"rtl\") watchers.push(watchPausable(right, (newValue) => {\n\t\twatchers.forEach((w) => w.pause());\n\t\tleft.value = transformRTL(newValue);\n\t\twatchers.forEach((w) => w.resume());\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t}));\n\tconst stop = () => {\n\t\twatchers.forEach((w) => w.stop());\n\t};\n\treturn stop;\n}\n//#endregion\n//#region syncRefs/index.ts\n/**\n* Keep target ref(s) in sync with the source ref\n*\n* @param source source ref\n* @param targets\n*/\nfunction syncRefs(source, targets, options = {}) {\n\tconst { flush = \"sync\", deep = false, immediate = true } = options;\n\tconst targetsArray = toArray(targets);\n\treturn watch(source, (newValue) => targetsArray.forEach((target) => target.value = newValue), {\n\t\tflush,\n\t\tdeep,\n\t\timmediate\n\t});\n}\n//#endregion\n//#region toRefs/index.ts\n/**\n* Extended `toRefs` that also accepts refs of an object.\n*\n* @see https://vueuse.org/toRefs\n* @param objectRef A ref or normal object or array.\n* @param options Options\n*/\nfunction toRefs(objectRef, options = {}) {\n\tif (!isRef(objectRef)) return toRefs$1(objectRef);\n\tconst result = Array.isArray(objectRef.value) ? Array.from({ length: objectRef.value.length }) : {};\n\tfor (const key in objectRef.value) result[key] = customRef(() => ({\n\t\tget() {\n\t\t\treturn objectRef.value[key];\n\t\t},\n\t\tset(v) {\n\t\t\tvar _toValue;\n\t\t\tif ((_toValue = toValue(options.replaceRef)) !== null && _toValue !== void 0 ? _toValue : true) if (Array.isArray(objectRef.value)) {\n\t\t\t\tconst copy = [...objectRef.value];\n\t\t\t\tcopy[key] = v;\n\t\t\t\tobjectRef.value = copy;\n\t\t\t} else {\n\t\t\t\tconst newObject = {\n\t\t\t\t\t...objectRef.value,\n\t\t\t\t\t[key]: v\n\t\t\t\t};\n\t\t\t\tObject.setPrototypeOf(newObject, Object.getPrototypeOf(objectRef.value));\n\t\t\t\tobjectRef.value = newObject;\n\t\t\t}\n\t\t\telse objectRef.value[key] = v;\n\t\t}\n\t}));\n\treturn result;\n}\n//#endregion\n//#region tryOnBeforeMount/index.ts\n/**\n* Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnBeforeMount(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onBeforeMount(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n//#endregion\n//#region tryOnBeforeUnmount/index.ts\n/**\n* Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnBeforeUnmount(fn, target) {\n\tif (getLifeCycleTarget(target)) onBeforeUnmount(fn, target);\n}\n//#endregion\n//#region tryOnMounted/index.ts\n/**\n* Call onMounted() if it's inside a component lifecycle, if not, just call the function\n*\n* @param fn\n* @param sync if set to false, it will run in the nextTick() of Vue\n* @param target\n*/\nfunction tryOnMounted(fn, sync = true, target) {\n\tif (getLifeCycleTarget(target)) onMounted(fn, target);\n\telse if (sync) fn();\n\telse nextTick(fn);\n}\n//#endregion\n//#region tryOnUnmounted/index.ts\n/**\n* Call onUnmounted() if it's inside a component lifecycle, if not, do nothing\n*\n* @param fn\n* @param target\n*/\nfunction tryOnUnmounted(fn, target) {\n\tif (getLifeCycleTarget(target)) onUnmounted(fn, target);\n}\n//#endregion\n//#region until/index.ts\nfunction createUntil(r, isNot = false) {\n\tfunction toMatch(condition, { flush = \"sync\", deep = false, timeout, throwOnTimeout } = {}) {\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch(r, (v) => {\n\t\t\t\tif (condition(v) !== isNot) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => stop === null || stop === void 0 ? void 0 : stop()));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBe(value, options) {\n\t\tif (!isRef(value)) return toMatch((v) => v === value, options);\n\t\tconst { flush = \"sync\", deep = false, timeout, throwOnTimeout } = options !== null && options !== void 0 ? options : {};\n\t\tlet stop = null;\n\t\tconst promises = [new Promise((resolve) => {\n\t\t\tstop = watch([r, value], ([v1, v2]) => {\n\t\t\t\tif (isNot !== (v1 === v2)) {\n\t\t\t\t\tif (stop) stop();\n\t\t\t\t\telse nextTick(() => stop === null || stop === void 0 ? void 0 : stop());\n\t\t\t\t\tresolve(v1);\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tflush,\n\t\t\t\tdeep,\n\t\t\t\timmediate: true\n\t\t\t});\n\t\t})];\n\t\tif (timeout != null) promises.push(promiseTimeout(timeout, throwOnTimeout).then(() => toValue(r)).finally(() => {\n\t\t\tstop === null || stop === void 0 || stop();\n\t\t\treturn toValue(r);\n\t\t}));\n\t\treturn Promise.race(promises);\n\t}\n\tfunction toBeTruthy(options) {\n\t\treturn toMatch((v) => Boolean(v), options);\n\t}\n\tfunction toBeNull(options) {\n\t\treturn toBe(null, options);\n\t}\n\tfunction toBeUndefined(options) {\n\t\treturn toBe(void 0, options);\n\t}\n\tfunction toBeNaN(options) {\n\t\treturn toMatch(Number.isNaN, options);\n\t}\n\tfunction toContains(value, options) {\n\t\treturn toMatch((v) => {\n\t\t\tconst array = Array.from(v);\n\t\t\treturn array.includes(value) || array.includes(toValue(value));\n\t\t}, options);\n\t}\n\tfunction changed(options) {\n\t\treturn changedTimes(1, options);\n\t}\n\tfunction changedTimes(n = 1, options) {\n\t\tlet count = -1;\n\t\treturn toMatch(() => {\n\t\t\tcount += 1;\n\t\t\treturn count >= n;\n\t\t}, options);\n\t}\n\tif (Array.isArray(toValue(r))) return {\n\t\ttoMatch,\n\t\ttoContains,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n\telse return {\n\t\ttoMatch,\n\t\ttoBe,\n\t\ttoBeTruthy,\n\t\ttoBeNull,\n\t\ttoBeNaN,\n\t\ttoBeUndefined,\n\t\tchanged,\n\t\tchangedTimes,\n\t\tget not() {\n\t\t\treturn createUntil(r, !isNot);\n\t\t}\n\t};\n}\nfunction until(r) {\n\treturn createUntil(r);\n}\n//#endregion\n//#region useArrayDifference/index.ts\nfunction defaultComparator(value, othVal) {\n\treturn value === othVal;\n}\n/**\n* Reactive get array difference of two array\n* @see https://vueuse.org/useArrayDifference\n* @returns - the difference of two array\n* @param args\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayDifference(...args) {\n\tvar _args$, _args$2;\n\tconst list = args[0];\n\tconst values = args[1];\n\tlet compareFn = (_args$ = args[2]) !== null && _args$ !== void 0 ? _args$ : defaultComparator;\n\tconst { symmetric = false } = (_args$2 = args[3]) !== null && _args$2 !== void 0 ? _args$2 : {};\n\tif (typeof compareFn === \"string\") {\n\t\tconst key = compareFn;\n\t\tcompareFn = (value, othVal) => value[key] === othVal[key];\n\t}\n\tconst diff1 = computed(() => toValue(list).filter((x) => toValue(values).findIndex((y) => compareFn(x, y)) === -1));\n\tif (symmetric) {\n\t\tconst diff2 = computed(() => toValue(values).filter((x) => toValue(list).findIndex((y) => compareFn(x, y)) === -1));\n\t\treturn computed(() => symmetric ? [...toValue(diff1), ...toValue(diff2)] : toValue(diff1));\n\t} else return diff1;\n}\n//#endregion\n//#region useArrayEvery/index.ts\n/**\n* Reactive `Array.every`\n*\n* @see https://vueuse.org/useArrayEvery\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayEvery(list, fn) {\n\treturn computed(() => toValue(list).every((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayFilter/index.ts\n/**\n* Reactive `Array.filter`\n*\n* @see https://vueuse.org/useArrayFilter\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFilter(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).filter(fn));\n}\n//#endregion\n//#region useArrayFind/index.ts\n/**\n* Reactive `Array.find`\n*\n* @see https://vueuse.org/useArrayFind\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFind(list, fn) {\n\treturn computed(() => toValue(toValue(list).find((element, index, array) => fn(toValue(element), index, array))));\n}\n//#endregion\n//#region useArrayFindIndex/index.ts\n/**\n* Reactive `Array.findIndex`\n*\n* @see https://vueuse.org/useArrayFindIndex\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the index of the first element in the array that passes the test. Otherwise, \"-1\".\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindIndex(list, fn) {\n\treturn computed(() => toValue(list).findIndex((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayFindLast/index.ts\nfunction findLast(arr, cb) {\n\tlet index = arr.length;\n\twhile (index-- > 0) if (cb(arr[index], index, arr)) return arr[index];\n}\n/**\n* Reactive `Array.findLast`\n*\n* @see https://vueuse.org/useArrayFindLast\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayFindLast(list, fn) {\n\treturn computed(() => toValue(!Array.prototype.findLast ? findLast(toValue(list), (element, index, array) => fn(toValue(element), index, array)) : toValue(list).findLast((element, index, array) => fn(toValue(element), index, array))));\n}\n//#endregion\n//#region useArrayIncludes/index.ts\nfunction isArrayIncludesOptions(obj) {\n\treturn isObject(obj) && containsProp(obj, \"formIndex\", \"comparator\");\n}\n/**\n* Reactive `Array.includes`\n*\n* @see https://vueuse.org/useArrayIncludes\n*\n* @returns true if the `value` is found in the array. Otherwise, false.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayIncludes(...args) {\n\tvar _comparator;\n\tconst list = args[0];\n\tconst value = args[1];\n\tlet comparator = args[2];\n\tlet formIndex = 0;\n\tif (isArrayIncludesOptions(comparator)) {\n\t\tvar _comparator$fromIndex;\n\t\tformIndex = (_comparator$fromIndex = comparator.fromIndex) !== null && _comparator$fromIndex !== void 0 ? _comparator$fromIndex : 0;\n\t\tcomparator = comparator.comparator;\n\t}\n\tif (typeof comparator === \"string\") {\n\t\tconst key = comparator;\n\t\tcomparator = (element, value) => element[key] === toValue(value);\n\t}\n\tcomparator = (_comparator = comparator) !== null && _comparator !== void 0 ? _comparator : ((element, value) => element === toValue(value));\n\treturn computed(() => toValue(list).slice(formIndex).some((element, index, array) => comparator(toValue(element), toValue(value), index, toValue(array))));\n}\n//#endregion\n//#region useArrayJoin/index.ts\n/**\n* Reactive `Array.join`\n*\n* @see https://vueuse.org/useArrayJoin\n* @param list - the array was called upon.\n* @param separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (\",\").\n*\n* @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayJoin(list, separator) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).join(toValue(separator)));\n}\n//#endregion\n//#region useArrayMap/index.ts\n/**\n* Reactive `Array.map`\n*\n* @see https://vueuse.org/useArrayMap\n* @param list - the array was called upon.\n* @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.\n*\n* @returns a new array with each element being the result of the callback function.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayMap(list, fn) {\n\treturn computed(() => toValue(list).map((i) => toValue(i)).map(fn));\n}\n//#endregion\n//#region useArrayReduce/index.ts\n/**\n* Reactive `Array.reduce`\n*\n* @see https://vueuse.org/useArrayReduce\n* @param list - the array was called upon.\n* @param reducer - a \"reducer\" function.\n* @param args\n*\n* @returns the value that results from running the \"reducer\" callback function to completion over the entire array.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayReduce(list, reducer, ...args) {\n\tconst reduceCallback = (sum, value, index) => reducer(toValue(sum), toValue(value), index);\n\treturn computed(() => {\n\t\tconst resolved = toValue(list);\n\t\treturn args.length ? resolved.reduce(reduceCallback, typeof args[0] === \"function\" ? toValue(args[0]()) : toValue(args[0])) : resolved.reduce(reduceCallback);\n\t});\n}\n//#endregion\n//#region useArraySome/index.ts\n/**\n* Reactive `Array.some`\n*\n* @see https://vueuse.org/useArraySome\n* @param list - the array was called upon.\n* @param fn - a function to test each element.\n*\n* @returns **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArraySome(list, fn) {\n\treturn computed(() => toValue(list).some((element, index, array) => fn(toValue(element), index, array)));\n}\n//#endregion\n//#region useArrayUnique/index.ts\nfunction uniq(array) {\n\treturn Array.from(new Set(array));\n}\nfunction uniqueElementsBy(array, fn) {\n\treturn array.reduce((acc, v) => {\n\t\tif (!acc.some((x) => fn(v, x, array))) acc.push(v);\n\t\treturn acc;\n\t}, []);\n}\n/**\n* reactive unique array\n* @see https://vueuse.org/useArrayUnique\n* @param list - the array was called upon.\n* @param compareFn\n* @returns A computed ref that returns a unique array of items.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useArrayUnique(list, compareFn) {\n\treturn computed(() => {\n\t\tconst resolvedList = toValue(list).map((element) => toValue(element));\n\t\treturn compareFn ? uniqueElementsBy(resolvedList, compareFn) : uniq(resolvedList);\n\t});\n}\n//#endregion\n//#region useCounter/index.ts\n/**\n* Basic counter with utility functions.\n*\n* @see https://vueuse.org/useCounter\n* @param [initialValue]\n* @param options\n*/\nfunction useCounter(initialValue = 0, options = {}) {\n\tlet _initialValue = unref(initialValue);\n\tconst count = shallowRef(initialValue);\n\tconst { max = Number.POSITIVE_INFINITY, min = Number.NEGATIVE_INFINITY } = options;\n\tconst inc = (delta = 1) => count.value = Math.max(Math.min(max, count.value + delta), min);\n\tconst dec = (delta = 1) => count.value = Math.min(Math.max(min, count.value - delta), max);\n\tconst get = () => count.value;\n\tconst set = (val) => count.value = Math.max(min, Math.min(max, val));\n\tconst reset = (val = _initialValue) => {\n\t\t_initialValue = val;\n\t\treturn set(val);\n\t};\n\treturn {\n\t\tcount: shallowReadonly(count),\n\t\tinc,\n\t\tdec,\n\t\tget,\n\t\tset,\n\t\treset\n\t};\n}\n//#endregion\n//#region useDateFormat/index.ts\nconst REGEX_PARSE = /^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[T\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/i;\nconst REGEX_FORMAT = /[YMDHhms]o|\\[([^\\]]+)\\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|SSS/g;\nfunction defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {\n\tlet m = hours < 12 ? \"AM\" : \"PM\";\n\tif (hasPeriod) m = m.split(\"\").reduce((acc, curr) => acc += `${curr}.`, \"\");\n\treturn isLowercase ? m.toLowerCase() : m;\n}\nfunction formatOrdinal(num) {\n\tconst suffixes = [\n\t\t\"th\",\n\t\t\"st\",\n\t\t\"nd\",\n\t\t\"rd\"\n\t];\n\tconst v = num % 100;\n\treturn num + (suffixes[(v - 20) % 10] || suffixes[v] || suffixes[0]);\n}\nfunction formatDate(date, formatStr, options = {}) {\n\tvar _options$customMeridi;\n\tconst years = date.getFullYear();\n\tconst month = date.getMonth();\n\tconst days = date.getDate();\n\tconst hours = date.getHours();\n\tconst minutes = date.getMinutes();\n\tconst seconds = date.getSeconds();\n\tconst milliseconds = date.getMilliseconds();\n\tconst day = date.getDay();\n\tconst meridiem = (_options$customMeridi = options.customMeridiem) !== null && _options$customMeridi !== void 0 ? _options$customMeridi : defaultMeridiem;\n\tconst stripTimeZone = (dateString) => {\n\t\tvar _dateString$split$;\n\t\treturn (_dateString$split$ = dateString.split(\" \")[1]) !== null && _dateString$split$ !== void 0 ? _dateString$split$ : \"\";\n\t};\n\tconst matches = {\n\t\tYo: () => formatOrdinal(years),\n\t\tYY: () => String(years).slice(-2),\n\t\tYYYY: () => years,\n\t\tM: () => month + 1,\n\t\tMo: () => formatOrdinal(month + 1),\n\t\tMM: () => `${month + 1}`.padStart(2, \"0\"),\n\t\tMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"short\" }),\n\t\tMMMM: () => date.toLocaleDateString(toValue(options.locales), { month: \"long\" }),\n\t\tD: () => String(days),\n\t\tDo: () => formatOrdinal(days),\n\t\tDD: () => `${days}`.padStart(2, \"0\"),\n\t\tH: () => String(hours),\n\t\tHo: () => formatOrdinal(hours),\n\t\tHH: () => `${hours}`.padStart(2, \"0\"),\n\t\th: () => `${hours % 12 || 12}`.padStart(1, \"0\"),\n\t\tho: () => formatOrdinal(hours % 12 || 12),\n\t\thh: () => `${hours % 12 || 12}`.padStart(2, \"0\"),\n\t\tm: () => String(minutes),\n\t\tmo: () => formatOrdinal(minutes),\n\t\tmm: () => `${minutes}`.padStart(2, \"0\"),\n\t\ts: () => String(seconds),\n\t\tso: () => formatOrdinal(seconds),\n\t\tss: () => `${seconds}`.padStart(2, \"0\"),\n\t\tSSS: () => `${milliseconds}`.padStart(3, \"0\"),\n\t\td: () => day,\n\t\tdd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"narrow\" }),\n\t\tddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"short\" }),\n\t\tdddd: () => date.toLocaleDateString(toValue(options.locales), { weekday: \"long\" }),\n\t\tA: () => meridiem(hours, minutes),\n\t\tAA: () => meridiem(hours, minutes, false, true),\n\t\ta: () => meridiem(hours, minutes, true),\n\t\taa: () => meridiem(hours, minutes, true, true),\n\t\tz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"shortOffset\" })),\n\t\tzzzz: () => stripTimeZone(date.toLocaleDateString(toValue(options.locales), { timeZoneName: \"longOffset\" }))\n\t};\n\treturn formatStr.replace(REGEX_FORMAT, (match, $1) => {\n\t\tvar _ref, _matches$match;\n\t\treturn (_ref = $1 !== null && $1 !== void 0 ? $1 : (_matches$match = matches[match]) === null || _matches$match === void 0 ? void 0 : _matches$match.call(matches)) !== null && _ref !== void 0 ? _ref : match;\n\t});\n}\nfunction normalizeDate(date) {\n\tif (date === null) return /* @__PURE__ */ new Date(NaN);\n\tif (date === void 0) return /* @__PURE__ */ new Date();\n\tif (date instanceof Date) return new Date(date);\n\tif (typeof date === \"string\" && !/Z$/i.test(date)) {\n\t\tconst d = date.match(REGEX_PARSE);\n\t\tif (d) {\n\t\t\tconst m = d[2] - 1 || 0;\n\t\t\tconst ms = (d[7] || \"0\").substring(0, 3);\n\t\t\treturn new Date(d[1], m, d[3] || 1, d[4] || 0, d[5] || 0, d[6] || 0, ms);\n\t\t}\n\t}\n\treturn new Date(date);\n}\n/**\n* Get the formatted date according to the string of tokens passed in.\n*\n* @see https://vueuse.org/useDateFormat\n* @param date - The date to format, can either be a `Date` object, a timestamp, or a string\n* @param formatStr - The combination of tokens to format the date\n* @param options - UseDateFormatOptions\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDateFormat(date, formatStr = \"HH:mm:ss\", options = {}) {\n\treturn computed(() => formatDate(normalizeDate(toValue(date)), toValue(formatStr), options));\n}\n//#endregion\n//#region useIntervalFn/index.ts\n/**\n* Wrapper for `setInterval` with controls\n*\n* @see https://vueuse.org/useIntervalFn\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useIntervalFn(cb, interval = 1e3, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tlet timer = null;\n\tconst isActive = shallowRef(false);\n\tfunction clean() {\n\t\tif (timer) {\n\t\t\tclearInterval(timer);\n\t\t\ttimer = null;\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tclean();\n\t}\n\tfunction resume() {\n\t\tconst intervalValue = toValue(interval);\n\t\tif (intervalValue <= 0) return;\n\t\tisActive.value = true;\n\t\tif (immediateCallback) cb();\n\t\tclean();\n\t\tif (isActive.value) timer = setInterval(cb, intervalValue);\n\t}\n\tif (immediate && isClient) resume();\n\tif (isRef(interval) || typeof interval === \"function\") tryOnScopeDispose(watch(interval, () => {\n\t\tif (isActive.value && isClient) resume();\n\t}));\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useInterval/index.ts\nfunction useInterval(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, immediate = true, callback } = options;\n\tconst counter = shallowRef(0);\n\tconst update = () => counter.value += 1;\n\tconst reset = () => {\n\t\tcounter.value = 0;\n\t};\n\tconst controls = useIntervalFn(callback ? () => {\n\t\tupdate();\n\t\tcallback(counter.value);\n\t} : update, interval, { immediate });\n\tif (exposeControls) return {\n\t\tcounter: shallowReadonly(counter),\n\t\treset,\n\t\t...controls\n\t};\n\telse return shallowReadonly(counter);\n}\n//#endregion\n//#region useLastChanged/index.ts\nfunction useLastChanged(source, options = {}) {\n\tvar _options$initialValue;\n\tconst ms = shallowRef((_options$initialValue = options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : null);\n\twatch(source, () => ms.value = timestamp(), options);\n\treturn shallowReadonly(ms);\n}\n//#endregion\n//#region useTimeoutFn/index.ts\n/**\n* Wrapper for `setTimeout` with controls.\n*\n* @param cb\n* @param interval\n* @param options\n*/\nfunction useTimeoutFn(cb, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tfunction clear() {\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t}\n\tfunction stop() {\n\t\tisPending.value = false;\n\t\tclear();\n\t}\n\tfunction start(...args) {\n\t\tif (immediateCallback) cb();\n\t\tclear();\n\t\tisPending.value = true;\n\t\ttimer = setTimeout(() => {\n\t\t\tisPending.value = false;\n\t\t\ttimer = void 0;\n\t\t\tcb(...args);\n\t\t}, toValue(interval));\n\t}\n\tif (immediate) {\n\t\tisPending.value = true;\n\t\tif (isClient) start();\n\t}\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisPending: shallowReadonly(isPending),\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useTimeout/index.ts\nfunction useTimeout(interval = 1e3, options = {}) {\n\tconst { controls: exposeControls = false, callback } = options;\n\tconst controls = useTimeoutFn(callback !== null && callback !== void 0 ? callback : noop, interval, options);\n\tconst ready = computed(() => !controls.isPending.value);\n\tif (exposeControls) return {\n\t\tready,\n\t\t...controls\n\t};\n\telse return ready;\n}\n//#endregion\n//#region useToNumber/index.ts\n/**\n* Reactively convert a string ref to number.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToNumber(value, options = {}) {\n\tconst { method = \"parseFloat\", radix, nanToZero } = options;\n\treturn computed(() => {\n\t\tlet resolved = toValue(value);\n\t\tif (typeof method === \"function\") resolved = method(resolved);\n\t\telse if (typeof resolved === \"string\") resolved = Number[method](resolved, radix);\n\t\tif (nanToZero && Number.isNaN(resolved)) resolved = 0;\n\t\treturn resolved;\n\t});\n}\n//#endregion\n//#region useToString/index.ts\n/**\n* Reactively convert a ref to string.\n*\n* @see https://vueuse.org/useToString\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToString(value) {\n\treturn computed(() => `${toValue(value)}`);\n}\n//#endregion\n//#region useToggle/index.ts\n/**\n* A boolean ref with a toggler\n*\n* @see https://vueuse.org/useToggle\n* @param [initialValue]\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useToggle(initialValue = false, options = {}) {\n\tconst { truthyValue = true, falsyValue = false } = options;\n\tconst valueIsRef = isRef(initialValue);\n\tconst _value = shallowRef(initialValue);\n\tfunction toggle(value) {\n\t\tif (arguments.length) {\n\t\t\t_value.value = value;\n\t\t\treturn _value.value;\n\t\t} else {\n\t\t\tconst truthy = toValue(truthyValue);\n\t\t\t_value.value = _value.value === truthy ? toValue(falsyValue) : truthy;\n\t\t\treturn _value.value;\n\t\t}\n\t}\n\tif (valueIsRef) return toggle;\n\telse return [_value, toggle];\n}\n//#endregion\n//#region watchArray/index.ts\n/**\n* Watch for an array with additions and removals.\n*\n* @see https://vueuse.org/watchArray\n*/\nfunction watchArray(source, cb, options) {\n\tlet oldList = (options === null || options === void 0 ? void 0 : options.immediate) ? [] : [...typeof source === \"function\" ? source() : Array.isArray(source) ? source : toValue(source)];\n\treturn watch(source, (newList, _, onCleanup) => {\n\t\tconst oldListRemains = Array.from({ length: oldList.length });\n\t\tconst added = [];\n\t\tfor (const obj of newList) {\n\t\t\tlet found = false;\n\t\t\tfor (let i = 0; i < oldList.length; i++) if (!oldListRemains[i] && obj === oldList[i]) {\n\t\t\t\toldListRemains[i] = true;\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (!found) added.push(obj);\n\t\t}\n\t\tconst removed = oldList.filter((_, i) => !oldListRemains[i]);\n\t\tcb(newList, oldList, added, removed, onCleanup);\n\t\toldList = [...newList];\n\t}, options);\n}\n//#endregion\n//#region watchAtMost/index.ts\nfunction watchAtMost(source, cb, options) {\n\tconst { count, ...watchOptions } = options;\n\tconst current = shallowRef(0);\n\tconst { stop, resume, pause } = watchWithFilter(source, (...args) => {\n\t\tcurrent.value += 1;\n\t\tif (current.value >= toValue(count)) nextTick(() => stop());\n\t\tcb(...args);\n\t}, watchOptions);\n\treturn {\n\t\tcount: current,\n\t\tstop,\n\t\tresume,\n\t\tpause\n\t};\n}\n//#endregion\n//#region watchDebounced/index.ts\nfunction watchDebounced(source, cb, options = {}) {\n\tconst { debounce = 0, maxWait = void 0, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: debounceFilter(debounce, { maxWait })\n\t});\n}\n/** @deprecated use `watchDebounced` instead */\nconst debouncedWatch = watchDebounced;\n//#endregion\n//#region watchDeep/index.ts\n/**\n* Shorthand for watching value with {deep: true}\n*\n* @see https://vueuse.org/watchDeep\n*/\nfunction watchDeep(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tdeep: true\n\t});\n}\n//#endregion\n//#region watchIgnorable/index.ts\nfunction watchIgnorable(source, cb, options = {}) {\n\tconst { eventFilter = bypassFilter, ...watchOptions } = options;\n\tconst filteredCb = createFilterWrapper(eventFilter, cb);\n\tlet ignoreUpdates;\n\tlet ignorePrevAsyncUpdates;\n\tlet stop;\n\tif (watchOptions.flush === \"sync\") {\n\t\tlet ignore = false;\n\t\tignorePrevAsyncUpdates = () => {};\n\t\tignoreUpdates = (updater) => {\n\t\t\tignore = true;\n\t\t\tupdater();\n\t\t\tignore = false;\n\t\t};\n\t\tstop = watch(source, (...args) => {\n\t\t\tif (!ignore) filteredCb(...args);\n\t\t}, watchOptions);\n\t} else {\n\t\tconst disposables = [];\n\t\tlet ignoreCounter = 0;\n\t\tlet syncCounter = 0;\n\t\tignorePrevAsyncUpdates = () => {\n\t\t\tignoreCounter = syncCounter;\n\t\t};\n\t\tdisposables.push(watch(source, () => {\n\t\t\tsyncCounter++;\n\t\t}, {\n\t\t\t...watchOptions,\n\t\t\tflush: \"sync\"\n\t\t}));\n\t\tignoreUpdates = (updater) => {\n\t\t\tconst syncCounterPrev = syncCounter;\n\t\t\tupdater();\n\t\t\tignoreCounter += syncCounter - syncCounterPrev;\n\t\t};\n\t\tdisposables.push(watch(source, (...args) => {\n\t\t\tconst ignore = ignoreCounter > 0 && ignoreCounter === syncCounter;\n\t\t\tignoreCounter = 0;\n\t\t\tsyncCounter = 0;\n\t\t\tif (ignore) return;\n\t\t\tfilteredCb(...args);\n\t\t}, watchOptions));\n\t\tstop = () => {\n\t\t\tdisposables.forEach((fn) => fn());\n\t\t};\n\t}\n\treturn {\n\t\tstop,\n\t\tignoreUpdates,\n\t\tignorePrevAsyncUpdates\n\t};\n}\n/** @deprecated use `watchIgnorable` instead */\nconst ignorableWatch = watchIgnorable;\n//#endregion\n//#region watchImmediate/index.ts\n/**\n* Shorthand for watching value with {immediate: true}\n*\n* @see https://vueuse.org/watchImmediate\n*/\nfunction watchImmediate(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\timmediate: true\n\t});\n}\n//#endregion\n//#region watchOnce/index.ts\n/**\n* Shorthand for watching value with { once: true }\n*\n* @see https://vueuse.org/watchOnce\n*/\nfunction watchOnce(source, cb, options) {\n\treturn watch(source, cb, {\n\t\t...options,\n\t\tonce: true\n\t});\n}\n//#endregion\n//#region watchThrottled/index.ts\nfunction watchThrottled(source, cb, options = {}) {\n\tconst { throttle = 0, trailing = true, leading = true, ...watchOptions } = options;\n\treturn watchWithFilter(source, cb, {\n\t\t...watchOptions,\n\t\teventFilter: throttleFilter(throttle, trailing, leading)\n\t});\n}\n/** @deprecated use `watchThrottled` instead */\nconst throttledWatch = watchThrottled;\n//#endregion\n//#region watchTriggerable/index.ts\nfunction watchTriggerable(source, cb, options = {}) {\n\tlet cleanupFn;\n\tfunction onEffect() {\n\t\tif (!cleanupFn) return;\n\t\tconst fn = cleanupFn;\n\t\tcleanupFn = void 0;\n\t\tfn();\n\t}\n\t/** Register the function `cleanupFn` */\n\tfunction onCleanup(callback) {\n\t\tcleanupFn = callback;\n\t}\n\tconst _cb = (value, oldValue) => {\n\t\tonEffect();\n\t\treturn cb(value, oldValue, onCleanup);\n\t};\n\tconst res = watchIgnorable(source, _cb, options);\n\tconst { ignoreUpdates } = res;\n\tconst trigger = () => {\n\t\tlet res;\n\t\tignoreUpdates(() => {\n\t\t\tres = _cb(getWatchSources(source), getOldValue(source));\n\t\t});\n\t\treturn res;\n\t};\n\treturn {\n\t\t...res,\n\t\ttrigger\n\t};\n}\nfunction getWatchSources(sources) {\n\tif (isReactive(sources)) return sources;\n\tif (Array.isArray(sources)) return sources.map((item) => toValue(item));\n\treturn toValue(sources);\n}\nfunction getOldValue(source) {\n\treturn Array.isArray(source) ? source.map(() => void 0) : void 0;\n}\n//#endregion\n//#region whenever/index.ts\nfunction whenever(source, cb, options) {\n\tconst stop = watch(source, (v, ov, onInvalidate) => {\n\t\tif (v) {\n\t\t\tif (options === null || options === void 0 ? void 0 : options.once) nextTick(() => stop());\n\t\t\tcb(v, ov, onInvalidate);\n\t\t}\n\t}, {\n\t\t...options,\n\t\tonce: false\n\t});\n\treturn stop;\n}\n//#endregion\nexport { assert, autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, debouncedRef, debouncedWatch, eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };\n","import { bypassFilter, camelize, clamp, computedWithControl, containsProp, createEventHook, createFilterWrapper, createRef, createSingletonPromise, debounceFilter, hasOwn, identity, increaseWithUnit, injectLocal, isClient, isDef, isIOS, isObject, isWorker, makeDestructurable, noop, notNullish, objectEntries, objectOmit, objectPick, pausableFilter, promiseTimeout, provideLocal, pxValue, syncRef, throttleFilter, timestamp, toArray, toRef, toRefs, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useDebounceFn, useIntervalFn, useThrottleFn, useTimeoutFn, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchWithFilter, whenever } from \"@vueuse/shared\";\nimport { Fragment, TransitionGroup, computed, customRef, defineComponent, getCurrentInstance, h, hasInjectionContext, inject, isReadonly, isRef, markRaw, nextTick, onBeforeUpdate, onMounted, onUpdated, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, toRaw, toValue, unref, watch, watchEffect } from \"vue\";\nexport * from \"@vueuse/shared\";\n//#region computedAsync/index.ts\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n\tvar _globalThis$reportErr;\n\tlet options;\n\tif (isRef(optionsOrRef)) options = { evaluating: optionsOrRef };\n\telse options = optionsOrRef || {};\n\tconst { lazy = false, flush = \"sync\", evaluating = void 0, shallow = true, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop } = options;\n\tconst started = shallowRef(!lazy);\n\tconst current = shallow ? shallowRef(initialState) : ref(initialState);\n\tlet counter = 0;\n\twatchEffect(async (onInvalidate) => {\n\t\tif (!started.value) return;\n\t\tcounter++;\n\t\tconst counterAtBeginning = counter;\n\t\tlet hasFinished = false;\n\t\tif (evaluating) Promise.resolve().then(() => {\n\t\t\tevaluating.value = true;\n\t\t});\n\t\ttry {\n\t\t\tconst result = await evaluationCallback((cancelCallback) => {\n\t\t\t\tonInvalidate(() => {\n\t\t\t\t\tif (evaluating) evaluating.value = false;\n\t\t\t\t\tif (!hasFinished) cancelCallback();\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (counterAtBeginning === counter) current.value = result;\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (evaluating && counterAtBeginning === counter) evaluating.value = false;\n\t\t\thasFinished = true;\n\t\t}\n\t}, { flush });\n\tif (lazy) return computed(() => {\n\t\tstarted.value = true;\n\t\treturn current.value;\n\t});\n\telse return current;\n}\n/** @deprecated use `computedAsync` instead */\nconst asyncComputed = computedAsync;\n//#endregion\n//#region computedInject/index.ts\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n\tlet source = inject(key);\n\tif (defaultSource) source = inject(key, defaultSource);\n\tif (treatDefaultAsFactory) source = inject(key, defaultSource, treatDefaultAsFactory);\n\tif (typeof options === \"function\") return computed((oldValue) => options(source, oldValue));\n\telse return computed({\n\t\tget: (oldValue) => options.get(source, oldValue),\n\t\tset: options.set\n\t});\n}\n//#endregion\n//#region createReusableTemplate/index.ts\n/**\n* This function creates `define` and `reuse` components in pair,\n* It also allow to pass a generic to bind with type.\n*\n* @see https://vueuse.org/createReusableTemplate\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createReusableTemplate(options = {}) {\n\tconst { inheritAttrs = true, name = \"ReusableTemplate\" } = options;\n\tconst render = shallowRef();\n\tconst define = defineComponent({\n\t\tname: `${name}.define`,\n\t\tsetup(_, { slots }) {\n\t\t\treturn () => {\n\t\t\t\trender.value = slots.default;\n\t\t\t};\n\t\t}\n\t});\n\tconst reuse = defineComponent({\n\t\tinheritAttrs,\n\t\tname: `${name}.reuse`,\n\t\tprops: options.props,\n\t\tsetup(props, { attrs, slots }) {\n\t\t\treturn () => {\n\t\t\t\tvar _render$value;\n\t\t\t\tif (!render.value && true) throw new Error(\"[VueUse] Failed to find the definition of reusable template\");\n\t\t\t\tconst vnode = (_render$value = render.value) === null || _render$value === void 0 ? void 0 : _render$value.call(render, {\n\t\t\t\t\t...options.props == null ? keysToCamelKebabCase(attrs) : props,\n\t\t\t\t\t$slots: slots\n\t\t\t\t});\n\t\t\t\treturn inheritAttrs && (vnode === null || vnode === void 0 ? void 0 : vnode.length) === 1 ? vnode[0] : vnode;\n\t\t\t};\n\t\t}\n\t});\n\treturn makeDestructurable({\n\t\tdefine,\n\t\treuse\n\t}, [define, reuse]);\n}\nfunction keysToCamelKebabCase(obj) {\n\tconst newObj = {};\n\tfor (const key in obj) newObj[camelize(key)] = obj[key];\n\treturn newObj;\n}\n//#endregion\n//#region createTemplatePromise/index.ts\n/**\n* Creates a template promise component.\n*\n* @see https://vueuse.org/createTemplatePromise\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createTemplatePromise(options = {}) {\n\tlet index = 0;\n\tconst instances = ref([]);\n\tfunction create(...args) {\n\t\tconst props = shallowReactive({\n\t\t\tkey: index++,\n\t\t\targs,\n\t\t\tpromise: void 0,\n\t\t\tresolve: () => {},\n\t\t\treject: () => {},\n\t\t\tisResolving: false,\n\t\t\toptions\n\t\t});\n\t\tinstances.value.push(props);\n\t\tprops.promise = new Promise((_resolve, _reject) => {\n\t\t\tprops.resolve = (v) => {\n\t\t\t\tprops.isResolving = true;\n\t\t\t\treturn _resolve(v);\n\t\t\t};\n\t\t\tprops.reject = _reject;\n\t\t}).finally(() => {\n\t\t\tprops.promise = void 0;\n\t\t\tconst index = instances.value.indexOf(props);\n\t\t\tif (index !== -1) instances.value.splice(index, 1);\n\t\t});\n\t\treturn props.promise;\n\t}\n\tfunction start(...args) {\n\t\tif (options.singleton && instances.value.length > 0) return instances.value[0].promise;\n\t\treturn create(...args);\n\t}\n\tconst component = defineComponent((_, { slots }) => {\n\t\tconst renderList = () => instances.value.map((props) => {\n\t\t\tvar _slots$default;\n\t\t\treturn h(Fragment, { key: props.key }, (_slots$default = slots.default) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots, props));\n\t\t});\n\t\tif (options.transition) return () => h(TransitionGroup, options.transition, renderList);\n\t\treturn renderList;\n\t});\n\tcomponent.start = start;\n\treturn component;\n}\n//#endregion\n//#region createUnrefFn/index.ts\n/**\n* Make a plain function accepting ref and raw values as arguments.\n* Returns the same value the unconverted function returns, with proper typing.\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction createUnrefFn(fn) {\n\treturn function(...args) {\n\t\treturn fn.apply(this, args.map((i) => toValue(i)));\n\t};\n}\n//#endregion\n//#region _configurable.ts\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n//#endregion\n//#region unrefElement/index.ts\n/**\n* Get the dom element of a ref of element or Vue component instance\n*\n* @param elRef\n*/\nfunction unrefElement(elRef) {\n\tvar _$el;\n\tconst plain = toValue(elRef);\n\treturn (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;\n}\n//#endregion\n//#region useEventListener/index.ts\nfunction useEventListener(...args) {\n\tconst register = (el, event, listener, options) => {\n\t\tel.addEventListener(event, listener, options);\n\t\treturn () => el.removeEventListener(event, listener, options);\n\t};\n\tconst firstParamTargets = computed(() => {\n\t\tconst test = toArray(toValue(args[0])).filter((e) => e != null);\n\t\treturn test.every((e) => typeof e !== \"string\") ? test : void 0;\n\t});\n\treturn watchImmediate(() => {\n\t\tvar _firstParamTargets$va, _firstParamTargets$va2;\n\t\treturn [\n\t\t\t(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),\n\t\t\ttoArray(toValue(firstParamTargets.value ? args[1] : args[0])),\n\t\t\ttoArray(unref(firstParamTargets.value ? args[2] : args[1])),\n\t\t\ttoValue(firstParamTargets.value ? args[3] : args[2])\n\t\t];\n\t}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {\n\t\tif (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;\n\t\tconst optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;\n\t\tconst cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));\n\t\tonCleanup(() => {\n\t\t\tcleanups.forEach((fn) => fn());\n\t\t});\n\t}, { flush: \"post\" });\n}\n//#endregion\n//#region onClickOutside/index.ts\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n\tconst { window = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;\n\tif (!window) return controls ? {\n\t\tstop: noop,\n\t\tcancel: noop,\n\t\ttrigger: noop\n\t} : noop;\n\tif (isIOS && !_iOSWorkaround) {\n\t\t_iOSWorkaround = true;\n\t\tconst listenerOptions = { passive: true };\n\t\tArray.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop, listenerOptions));\n\t\twindow.document.documentElement.addEventListener(\"click\", noop, listenerOptions);\n\t}\n\tlet shouldListen = true;\n\tconst shouldIgnore = (event) => {\n\t\treturn toValue(ignore).some((target) => {\n\t\t\tif (typeof target === \"string\") return Array.from(window.document.querySelectorAll(target)).some((el) => el === event.target || event.composedPath().includes(el));\n\t\t\telse {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\treturn el && (event.target === el || event.composedPath().includes(el));\n\t\t\t}\n\t\t});\n\t};\n\t/**\n\t* Determines if the given target has multiple root elements.\n\t* Referenced from: https://github.com/vuejs/test-utils/blob/ccb460be55f9f6be05ab708500a41ec8adf6f4bc/src/vue-wrapper.ts#L21\n\t*/\n\tfunction hasMultipleRoots(target) {\n\t\tconst vm = toValue(target);\n\t\treturn vm && vm.$.subTree.shapeFlag === 16;\n\t}\n\tfunction checkMultipleRoots(target, event) {\n\t\tconst vm = toValue(target);\n\t\tconst children = vm.$.subTree && vm.$.subTree.children;\n\t\tif (children == null || !Array.isArray(children)) return false;\n\t\treturn children.some((child) => child.el === event.target || event.composedPath().includes(child.el));\n\t}\n\tconst listener = (event) => {\n\t\tconst el = unrefElement(target);\n\t\tif (event.target == null) return;\n\t\tif (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;\n\t\tif (!el || el === event.target || event.composedPath().includes(el)) return;\n\t\tif (\"detail\" in event && event.detail === 0) shouldListen = !shouldIgnore(event);\n\t\tif (!shouldListen) {\n\t\t\tshouldListen = true;\n\t\t\treturn;\n\t\t}\n\t\thandler(event);\n\t};\n\tlet isProcessingClick = false;\n\tconst cleanup = [\n\t\tuseEventListener(window, \"click\", (event) => {\n\t\t\tif (!isProcessingClick) {\n\t\t\t\tisProcessingClick = true;\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\tisProcessingClick = false;\n\t\t\t\t}, 0);\n\t\t\t\tlistener(event);\n\t\t\t}\n\t\t}, {\n\t\t\tpassive: true,\n\t\t\tcapture\n\t\t}),\n\t\tuseEventListener(window, \"pointerdown\", (e) => {\n\t\t\tconst el = unrefElement(target);\n\t\t\tshouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));\n\t\t}, { passive: true }),\n\t\tdetectIframe && useEventListener(window, \"blur\", (event) => {\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst el = unrefElement(target);\n\t\t\t\tlet activeEl = window.document.activeElement;\n\t\t\t\twhile (activeEl === null || activeEl === void 0 ? void 0 : activeEl.shadowRoot) activeEl = activeEl.shadowRoot.activeElement;\n\t\t\t\tif ((activeEl === null || activeEl === void 0 ? void 0 : activeEl.tagName) === \"IFRAME\" && !(el === null || el === void 0 ? void 0 : el.contains(window.document.activeElement))) handler(event);\n\t\t\t}, 0);\n\t\t}, { passive: true })\n\t].filter(Boolean);\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\tif (controls) return {\n\t\tstop,\n\t\tcancel: () => {\n\t\t\tshouldListen = false;\n\t\t},\n\t\ttrigger: (event) => {\n\t\t\tshouldListen = true;\n\t\t\tlistener(event);\n\t\t\tshouldListen = false;\n\t\t}\n\t};\n\treturn stop;\n}\n//#endregion\n//#region useMounted/index.ts\n/**\n* Mounted state in ref.\n*\n* @see https://vueuse.org/useMounted\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMounted() {\n\tconst isMounted = shallowRef(false);\n\tconst instance = getCurrentInstance();\n\tif (instance) onMounted(() => {\n\t\tisMounted.value = true;\n\t}, instance);\n\treturn isMounted;\n}\n//#endregion\n//#region useSupported/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSupported(callback) {\n\tconst isMounted = useMounted();\n\treturn computed(() => {\n\t\tisMounted.value;\n\t\treturn Boolean(callback());\n\t});\n}\n//#endregion\n//#region useMutationObserver/index.ts\n/**\n* Watch for changes being made to the DOM tree.\n*\n* @see https://vueuse.org/useMutationObserver\n* @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN\n* @param target\n* @param callback\n* @param options\n*/\nfunction useMutationObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...mutationOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"MutationObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst items = toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t\treturn new Set(items);\n\t}), (newTargets) => {\n\t\tcleanup();\n\t\tif (isSupported.value && newTargets.size) {\n\t\t\tobserver = new MutationObserver(callback);\n\t\t\tnewTargets.forEach((el) => observer.observe(el, mutationOptions));\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst takeRecords = () => {\n\t\treturn observer === null || observer === void 0 ? void 0 : observer.takeRecords();\n\t};\n\tconst stop = () => {\n\t\tstopWatch();\n\t\tcleanup();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop,\n\t\ttakeRecords\n\t};\n}\n//#endregion\n//#region onElementRemoval/index.ts\n/**\n* Fires when the element or any element containing it is removed.\n*\n* @param target\n* @param callback\n* @param options\n*/\nfunction onElementRemoval(target, callback, options = {}) {\n\tconst { window = defaultWindow, document = window === null || window === void 0 ? void 0 : window.document, flush = \"sync\" } = options;\n\tif (!window || !document) return noop;\n\tlet stopFn;\n\tconst cleanupAndUpdate = (fn) => {\n\t\tstopFn === null || stopFn === void 0 || stopFn();\n\t\tstopFn = fn;\n\t};\n\tconst stopWatch = watchEffect(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (el) {\n\t\t\tconst { stop } = useMutationObserver(document, (mutationsList) => {\n\t\t\t\tif (mutationsList.map((mutation) => [...mutation.removedNodes]).flat().some((node) => node === el || node.contains(el))) callback(mutationsList);\n\t\t\t}, {\n\t\t\t\twindow,\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true\n\t\t\t});\n\t\t\tcleanupAndUpdate(stop);\n\t\t}\n\t}, { flush });\n\tconst stopHandle = () => {\n\t\tstopWatch();\n\t\tcleanupAndUpdate();\n\t};\n\ttryOnScopeDispose(stopHandle);\n\treturn stopHandle;\n}\n//#endregion\n//#region onKeyStroke/index.ts\nfunction createKeyPredicate(keyFilter) {\n\tif (typeof keyFilter === \"function\") return keyFilter;\n\telse if (typeof keyFilter === \"string\") return (event) => event.key === keyFilter;\n\telse if (Array.isArray(keyFilter)) return (event) => keyFilter.includes(event.key);\n\treturn () => true;\n}\nfunction onKeyStroke(...args) {\n\tlet key;\n\tlet handler;\n\tlet options = {};\n\tif (args.length === 3) {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t\toptions = args[2];\n\t} else if (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tkey = true;\n\t\thandler = args[0];\n\t\toptions = args[1];\n\t} else {\n\t\tkey = args[0];\n\t\thandler = args[1];\n\t}\n\telse {\n\t\tkey = true;\n\t\thandler = args[0];\n\t}\n\tconst { target = defaultWindow, eventName = \"keydown\", passive = false, dedupe = false } = options;\n\tconst predicate = createKeyPredicate(key);\n\tconst listener = (e) => {\n\t\tif (e.repeat && toValue(dedupe)) return;\n\t\tif (predicate(e)) handler(e);\n\t};\n\treturn useEventListener(target, eventName, listener, passive);\n}\n/**\n* Listen to the keydown event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyDown(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keydown\"\n\t});\n}\n/**\n* Listen to the keypress event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyPressed(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keypress\"\n\t});\n}\n/**\n* Listen to the keyup event of the given key.\n*\n* @see https://vueuse.org/onKeyStroke\n* @param key\n* @param handler\n* @param options\n*/\nfunction onKeyUp(key, handler, options = {}) {\n\treturn onKeyStroke(key, handler, {\n\t\t...options,\n\t\teventName: \"keyup\"\n\t});\n}\n//#endregion\n//#region onLongPress/index.ts\nconst DEFAULT_DELAY = 500;\nconst DEFAULT_THRESHOLD = 10;\nfunction onLongPress(target, handler, options) {\n\tvar _options$modifiers10, _options$modifiers11;\n\tconst elementRef = computed(() => unrefElement(target));\n\tlet timeout;\n\tlet posStart;\n\tlet startTimestamp;\n\tlet hasLongPressed = false;\n\tfunction clear() {\n\t\tif (timeout) {\n\t\t\tclearTimeout(timeout);\n\t\t\ttimeout = void 0;\n\t\t}\n\t\tposStart = void 0;\n\t\tstartTimestamp = void 0;\n\t\thasLongPressed = false;\n\t}\n\tfunction getDelay(ev) {\n\t\tconst delay = options === null || options === void 0 ? void 0 : options.delay;\n\t\tif (typeof delay === \"function\") return delay(ev);\n\t\treturn delay !== null && delay !== void 0 ? delay : DEFAULT_DELAY;\n\t}\n\tfunction onRelease(ev) {\n\t\tvar _options$modifiers, _options$modifiers2, _options$modifiers3;\n\t\tconst [_startTimestamp, _posStart, _hasLongPressed] = [\n\t\t\tstartTimestamp,\n\t\t\tposStart,\n\t\t\thasLongPressed\n\t\t];\n\t\tclear();\n\t\tif (!(options === null || options === void 0 ? void 0 : options.onMouseUp) || !_posStart || !_startTimestamp) return;\n\t\tif ((options === null || options === void 0 || (_options$modifiers = options.modifiers) === null || _options$modifiers === void 0 ? void 0 : _options$modifiers.self) && ev.target !== elementRef.value) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers2 = options.modifiers) === null || _options$modifiers2 === void 0 ? void 0 : _options$modifiers2.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers3 = options.modifiers) === null || _options$modifiers3 === void 0 ? void 0 : _options$modifiers3.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - _posStart.x;\n\t\tconst dy = ev.y - _posStart.y;\n\t\tconst distance = Math.sqrt(dx * dx + dy * dy);\n\t\toptions.onMouseUp(ev.timeStamp - _startTimestamp, distance, _hasLongPressed, ev);\n\t}\n\tfunction onDown(ev) {\n\t\tvar _options$modifiers4, _options$modifiers5, _options$modifiers6;\n\t\tif ((options === null || options === void 0 || (_options$modifiers4 = options.modifiers) === null || _options$modifiers4 === void 0 ? void 0 : _options$modifiers4.self) && ev.target !== elementRef.value) return;\n\t\tclear();\n\t\tif (options === null || options === void 0 || (_options$modifiers5 = options.modifiers) === null || _options$modifiers5 === void 0 ? void 0 : _options$modifiers5.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers6 = options.modifiers) === null || _options$modifiers6 === void 0 ? void 0 : _options$modifiers6.stop) ev.stopPropagation();\n\t\tposStart = {\n\t\t\tx: ev.x,\n\t\t\ty: ev.y\n\t\t};\n\t\tstartTimestamp = ev.timeStamp;\n\t\ttimeout = setTimeout(() => {\n\t\t\thasLongPressed = true;\n\t\t\thandler(ev);\n\t\t}, getDelay(ev));\n\t}\n\tfunction onMove(ev) {\n\t\tvar _options$modifiers7, _options$modifiers8, _options$modifiers9, _options$distanceThre;\n\t\tif ((options === null || options === void 0 || (_options$modifiers7 = options.modifiers) === null || _options$modifiers7 === void 0 ? void 0 : _options$modifiers7.self) && ev.target !== elementRef.value) return;\n\t\tif (!posStart || (options === null || options === void 0 ? void 0 : options.distanceThreshold) === false) return;\n\t\tif (options === null || options === void 0 || (_options$modifiers8 = options.modifiers) === null || _options$modifiers8 === void 0 ? void 0 : _options$modifiers8.prevent) ev.preventDefault();\n\t\tif (options === null || options === void 0 || (_options$modifiers9 = options.modifiers) === null || _options$modifiers9 === void 0 ? void 0 : _options$modifiers9.stop) ev.stopPropagation();\n\t\tconst dx = ev.x - posStart.x;\n\t\tconst dy = ev.y - posStart.y;\n\t\tif (Math.sqrt(dx * dx + dy * dy) >= ((_options$distanceThre = options === null || options === void 0 ? void 0 : options.distanceThreshold) !== null && _options$distanceThre !== void 0 ? _options$distanceThre : DEFAULT_THRESHOLD)) clear();\n\t}\n\tconst listenerOptions = {\n\t\tcapture: options === null || options === void 0 || (_options$modifiers10 = options.modifiers) === null || _options$modifiers10 === void 0 ? void 0 : _options$modifiers10.capture,\n\t\tonce: options === null || options === void 0 || (_options$modifiers11 = options.modifiers) === null || _options$modifiers11 === void 0 ? void 0 : _options$modifiers11.once\n\t};\n\tconst cleanup = [\n\t\tuseEventListener(elementRef, \"pointerdown\", onDown, listenerOptions),\n\t\tuseEventListener(elementRef, \"pointermove\", onMove, listenerOptions),\n\t\tuseEventListener(elementRef, [\"pointerup\", \"pointerleave\"], onRelease, listenerOptions)\n\t];\n\tconst stop = () => cleanup.forEach((fn) => fn());\n\treturn stop;\n}\n//#endregion\n//#region onStartTyping/index.ts\nfunction isFocusedElementEditable() {\n\tconst { activeElement, body } = document;\n\tif (!activeElement) return false;\n\tif (activeElement === body) return false;\n\tswitch (activeElement.tagName) {\n\t\tcase \"INPUT\":\n\t\tcase \"TEXTAREA\": return true;\n\t}\n\treturn activeElement.hasAttribute(\"contenteditable\");\n}\nfunction isTypedCharValid({ keyCode, metaKey, ctrlKey, altKey }) {\n\tif (metaKey || ctrlKey || altKey) return false;\n\tif (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105) return true;\n\tif (keyCode >= 65 && keyCode <= 90) return true;\n\treturn false;\n}\n/**\n* Fires when users start typing on non-editable elements.\n*\n* @see https://vueuse.org/onStartTyping\n* @param callback\n* @param options\n*/\nfunction onStartTyping(callback, options = {}) {\n\tconst { document = defaultDocument, isTypedCharValid: isTypedCharValidFn = isTypedCharValid, isFocusedElementEditable: isFocusedElementEditableFn = isFocusedElementEditable } = options;\n\tconst keydown = (event) => {\n\t\tif (!isFocusedElementEditableFn() && isTypedCharValidFn(event)) callback(event);\n\t};\n\tif (document) useEventListener(document, \"keydown\", keydown, { passive: true });\n}\n//#endregion\n//#region templateRef/index.ts\n/**\n* @deprecated Use Vue's built-in `useTemplateRef` instead.\n*\n* Shorthand for binding ref to template element.\n*\n* @see https://vueuse.org/templateRef\n* @param key\n* @param initialValue\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction templateRef(key, initialValue = null) {\n\tconst instance = getCurrentInstance();\n\tlet _trigger = () => {};\n\tconst element = customRef((track, trigger) => {\n\t\t_trigger = trigger;\n\t\treturn {\n\t\t\tget() {\n\t\t\t\tvar _instance$proxy$$refs, _instance$proxy;\n\t\t\t\ttrack();\n\t\t\t\treturn (_instance$proxy$$refs = instance === null || instance === void 0 || (_instance$proxy = instance.proxy) === null || _instance$proxy === void 0 ? void 0 : _instance$proxy.$refs[key]) !== null && _instance$proxy$$refs !== void 0 ? _instance$proxy$$refs : initialValue;\n\t\t\t},\n\t\t\tset() {}\n\t\t};\n\t});\n\ttryOnMounted(_trigger);\n\tonUpdated(_trigger);\n\treturn element;\n}\n//#endregion\n//#region useActiveElement/index.ts\n/**\n* Reactive `document.activeElement`\n*\n* @see https://vueuse.org/useActiveElement\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useActiveElement(options = {}) {\n\tvar _options$document;\n\tconst { window = defaultWindow, deep = true, triggerOnRemoval = false } = options;\n\tconst document = (_options$document = options.document) !== null && _options$document !== void 0 ? _options$document : window === null || window === void 0 ? void 0 : window.document;\n\tconst getDeepActiveElement = () => {\n\t\tlet element = document === null || document === void 0 ? void 0 : document.activeElement;\n\t\tif (deep) {\n\t\t\tvar _element$shadowRoot;\n\t\t\twhile (element === null || element === void 0 ? void 0 : element.shadowRoot) element = element === null || element === void 0 || (_element$shadowRoot = element.shadowRoot) === null || _element$shadowRoot === void 0 ? void 0 : _element$shadowRoot.activeElement;\n\t\t}\n\t\treturn element;\n\t};\n\tconst activeElement = shallowRef();\n\tconst trigger = () => {\n\t\tactiveElement.value = getDeepActiveElement();\n\t};\n\tif (window) {\n\t\tconst listenerOptions = {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t};\n\t\tuseEventListener(window, \"blur\", (event) => {\n\t\t\tif (event.relatedTarget !== null) return;\n\t\t\ttrigger();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"focus\", trigger, listenerOptions);\n\t}\n\tif (triggerOnRemoval) onElementRemoval(activeElement, trigger, { document });\n\ttrigger();\n\treturn activeElement;\n}\n//#endregion\n//#region useRafFn/index.ts\n/**\n* Call function on every `requestAnimationFrame`. With controls of pausing and resuming.\n*\n* @see https://vueuse.org/useRafFn\n* @param fn\n* @param options\n*/\nfunction useRafFn(fn, options = {}) {\n\tconst { immediate = true, fpsLimit = null, window = defaultWindow, once = false } = options;\n\tconst isActive = shallowRef(false);\n\tconst intervalLimit = computed(() => {\n\t\tconst limit = toValue(fpsLimit);\n\t\treturn limit ? 1e3 / limit : null;\n\t});\n\tlet previousFrameTimestamp = 0;\n\tlet rafId = null;\n\tfunction loop(timestamp) {\n\t\tif (!isActive.value || !window) return;\n\t\tif (!previousFrameTimestamp) previousFrameTimestamp = timestamp;\n\t\tconst delta = timestamp - previousFrameTimestamp;\n\t\tif (intervalLimit.value && delta < intervalLimit.value) {\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t\treturn;\n\t\t}\n\t\tpreviousFrameTimestamp = timestamp;\n\t\tfn({\n\t\t\tdelta,\n\t\t\ttimestamp\n\t\t});\n\t\tif (once) {\n\t\t\tisActive.value = false;\n\t\t\trafId = null;\n\t\t\treturn;\n\t\t}\n\t\trafId = window.requestAnimationFrame(loop);\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value && window) {\n\t\t\tisActive.value = true;\n\t\t\tpreviousFrameTimestamp = 0;\n\t\t\trafId = window.requestAnimationFrame(loop);\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t\tif (rafId != null && window) {\n\t\t\twindow.cancelAnimationFrame(rafId);\n\t\t\trafId = null;\n\t\t}\n\t}\n\tif (immediate) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive: shallowReadonly(isActive),\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useAnimate/index.ts\n/**\n* Reactive Web Animations API\n*\n* @see https://vueuse.org/useAnimate\n* @param target\n* @param keyframes\n* @param options\n*/\nfunction useAnimate(target, keyframes, options) {\n\tlet config;\n\tlet animateOptions;\n\tif (isObject(options)) {\n\t\tconfig = options;\n\t\tanimateOptions = objectOmit(options, [\n\t\t\t\"window\",\n\t\t\t\"immediate\",\n\t\t\t\"commitStyles\",\n\t\t\t\"persist\",\n\t\t\t\"onReady\",\n\t\t\t\"onError\"\n\t\t]);\n\t} else {\n\t\tconfig = { duration: options };\n\t\tanimateOptions = options;\n\t}\n\tconst { window = defaultWindow, immediate = true, commitStyles, persist, playbackRate: _playbackRate = 1, onReady, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = config;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && HTMLElement && \"animate\" in HTMLElement.prototype);\n\tconst animate = shallowRef(void 0);\n\tconst store = shallowReactive({\n\t\tstartTime: null,\n\t\tcurrentTime: null,\n\t\ttimeline: null,\n\t\tplaybackRate: _playbackRate,\n\t\tpending: false,\n\t\tplayState: immediate ? \"idle\" : \"paused\",\n\t\treplaceState: \"active\"\n\t});\n\tconst pending = computed(() => store.pending);\n\tconst playState = computed(() => store.playState);\n\tconst replaceState = computed(() => store.replaceState);\n\tconst startTime = computed({\n\t\tget() {\n\t\t\treturn store.startTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.startTime = value;\n\t\t\tif (animate.value) animate.value.startTime = value;\n\t\t}\n\t});\n\tconst currentTime = computed({\n\t\tget() {\n\t\t\treturn store.currentTime;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.currentTime = value;\n\t\t\tif (animate.value) {\n\t\t\t\tanimate.value.currentTime = value;\n\t\t\t\tsyncResume();\n\t\t\t}\n\t\t}\n\t});\n\tconst timeline = computed({\n\t\tget() {\n\t\t\treturn store.timeline;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.timeline = value;\n\t\t\tif (animate.value) animate.value.timeline = value;\n\t\t}\n\t});\n\tconst playbackRate = computed({\n\t\tget() {\n\t\t\treturn store.playbackRate;\n\t\t},\n\t\tset(value) {\n\t\t\tstore.playbackRate = value;\n\t\t\tif (animate.value) animate.value.playbackRate = value;\n\t\t}\n\t});\n\tconst play = () => {\n\t\tif (animate.value) try {\n\t\t\tanimate.value.play();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t\telse update();\n\t};\n\tconst pause = () => {\n\t\ttry {\n\t\t\tvar _animate$value;\n\t\t\t(_animate$value = animate.value) === null || _animate$value === void 0 || _animate$value.pause();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst reverse = () => {\n\t\tif (!animate.value) update();\n\t\ttry {\n\t\t\tvar _animate$value2;\n\t\t\t(_animate$value2 = animate.value) === null || _animate$value2 === void 0 || _animate$value2.reverse();\n\t\t\tsyncResume();\n\t\t} catch (e) {\n\t\t\tsyncPause();\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst finish = () => {\n\t\ttry {\n\t\t\tvar _animate$value3;\n\t\t\t(_animate$value3 = animate.value) === null || _animate$value3 === void 0 || _animate$value3.finish();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\tconst cancel = () => {\n\t\ttry {\n\t\t\tvar _animate$value4;\n\t\t\t(_animate$value4 = animate.value) === null || _animate$value4 === void 0 || _animate$value4.cancel();\n\t\t\tsyncPause();\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t};\n\twatch(() => unrefElement(target), (el) => {\n\t\tif (el) update(true);\n\t\telse animate.value = void 0;\n\t});\n\twatch(() => keyframes, (value) => {\n\t\tif (animate.value) {\n\t\t\tupdate();\n\t\t\tconst targetEl = unrefElement(target);\n\t\t\tif (targetEl) animate.value.effect = new KeyframeEffect(targetEl, toValue(value), animateOptions);\n\t\t}\n\t}, { deep: true });\n\ttryOnMounted(() => update(true), false);\n\ttryOnScopeDispose(cancel);\n\tfunction update(init) {\n\t\tconst el = unrefElement(target);\n\t\tif (!isSupported.value || !el) return;\n\t\tif (!animate.value) animate.value = el.animate(toValue(keyframes), animateOptions);\n\t\tif (persist) animate.value.persist();\n\t\tif (_playbackRate !== 1) animate.value.playbackRate = _playbackRate;\n\t\tif (init && !immediate) animate.value.pause();\n\t\telse syncResume();\n\t\tonReady === null || onReady === void 0 || onReady(animate.value);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(animate, [\n\t\t\"cancel\",\n\t\t\"finish\",\n\t\t\"remove\"\n\t], syncPause, listenerOptions);\n\tuseEventListener(animate, \"finish\", () => {\n\t\tvar _animate$value5;\n\t\tif (commitStyles) (_animate$value5 = animate.value) === null || _animate$value5 === void 0 || _animate$value5.commitStyles();\n\t}, listenerOptions);\n\tconst { resume: resumeRef, pause: pauseRef } = useRafFn(() => {\n\t\tif (!animate.value) return;\n\t\tstore.pending = animate.value.pending;\n\t\tstore.playState = animate.value.playState;\n\t\tstore.replaceState = animate.value.replaceState;\n\t\tstore.startTime = animate.value.startTime;\n\t\tstore.currentTime = animate.value.currentTime;\n\t\tstore.timeline = animate.value.timeline;\n\t\tstore.playbackRate = animate.value.playbackRate;\n\t}, { immediate: false });\n\tfunction syncResume() {\n\t\tif (isSupported.value) resumeRef();\n\t}\n\tfunction syncPause() {\n\t\tif (isSupported.value && window) window.requestAnimationFrame(pauseRef);\n\t}\n\treturn {\n\t\tisSupported,\n\t\tanimate,\n\t\tplay,\n\t\tpause,\n\t\treverse,\n\t\tfinish,\n\t\tcancel,\n\t\tpending,\n\t\tplayState,\n\t\treplaceState,\n\t\tstartTime,\n\t\tcurrentTime,\n\t\ttimeline,\n\t\tplaybackRate\n\t};\n}\n//#endregion\n//#region useAsyncQueue/index.ts\n/**\n* Asynchronous queue task controller.\n*\n* @see https://vueuse.org/useAsyncQueue\n* @param tasks\n* @param options\n*/\nfunction useAsyncQueue(tasks, options) {\n\tconst { interrupt = true, onError = noop, onFinished = noop, signal } = options || {};\n\tconst promiseState = {\n\t\taborted: \"aborted\",\n\t\tfulfilled: \"fulfilled\",\n\t\tpending: \"pending\",\n\t\trejected: \"rejected\"\n\t};\n\tconst result = reactive(Array.from(Array.from({ length: tasks.length }), () => ({\n\t\tstate: promiseState.pending,\n\t\tdata: null\n\t})));\n\tconst activeIndex = shallowRef(-1);\n\tif (!tasks || tasks.length === 0) {\n\t\tonFinished();\n\t\treturn {\n\t\t\tactiveIndex,\n\t\t\tresult\n\t\t};\n\t}\n\tfunction updateResult(state, res) {\n\t\tactiveIndex.value++;\n\t\tresult[activeIndex.value].data = res;\n\t\tresult[activeIndex.value].state = state;\n\t}\n\ttasks.reduce((prev, curr) => {\n\t\treturn prev.then((prevRes) => {\n\t\t\tvar _result$activeIndex$v;\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, /* @__PURE__ */ new Error(\"aborted\"));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (((_result$activeIndex$v = result[activeIndex.value]) === null || _result$activeIndex$v === void 0 ? void 0 : _result$activeIndex$v.state) === promiseState.rejected && interrupt) {\n\t\t\t\tonFinished();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst done = curr(prevRes).then((currentRes) => {\n\t\t\t\tupdateResult(promiseState.fulfilled, currentRes);\n\t\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\t\treturn currentRes;\n\t\t\t});\n\t\t\tif (!signal) return done;\n\t\t\treturn Promise.race([done, whenAborted(signal)]);\n\t\t}).catch((e) => {\n\t\t\tif (signal === null || signal === void 0 ? void 0 : signal.aborted) {\n\t\t\t\tupdateResult(promiseState.aborted, e);\n\t\t\t\treturn e;\n\t\t\t}\n\t\t\tupdateResult(promiseState.rejected, e);\n\t\t\tonError();\n\t\t\tif (activeIndex.value === tasks.length - 1) onFinished();\n\t\t\treturn e;\n\t\t});\n\t}, Promise.resolve());\n\treturn {\n\t\tactiveIndex,\n\t\tresult\n\t};\n}\nfunction whenAborted(signal) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst error = /* @__PURE__ */ new Error(\"aborted\");\n\t\tif (signal.aborted) reject(error);\n\t\telse signal.addEventListener(\"abort\", () => reject(error), { once: true });\n\t});\n}\n//#endregion\n//#region useAsyncState/index.ts\n/**\n* Reactive async state. Will not block your setup function and will trigger changes once\n* the promise is ready.\n*\n* @see https://vueuse.org/useAsyncState\n* @param promise The promise / async function to be resolved\n* @param initialState The initial state, used until the first evaluation finishes\n* @param options\n*/\nfunction useAsyncState(promise, initialState, options) {\n\tvar _globalThis$reportErr;\n\tconst { immediate = true, delay = 0, onError = (_globalThis$reportErr = globalThis.reportError) !== null && _globalThis$reportErr !== void 0 ? _globalThis$reportErr : noop, onSuccess = noop, resetOnExecute = true, shallow = true, throwError } = options !== null && options !== void 0 ? options : {};\n\tconst state = shallow ? shallowRef(initialState) : ref(initialState);\n\tconst isReady = shallowRef(false);\n\tconst isLoading = shallowRef(false);\n\tconst error = shallowRef(void 0);\n\tlet executionsCount = 0;\n\tasync function execute(delay = 0, ...args) {\n\t\tconst executionId = executionsCount += 1;\n\t\tif (resetOnExecute) state.value = toValue(initialState);\n\t\terror.value = void 0;\n\t\tisReady.value = false;\n\t\tisLoading.value = true;\n\t\tif (delay > 0) await promiseTimeout(delay);\n\t\tconst _promise = typeof promise === \"function\" ? promise(...args) : promise;\n\t\ttry {\n\t\t\tconst data = await _promise;\n\t\t\tif (executionId === executionsCount) {\n\t\t\t\tstate.value = data;\n\t\t\t\tisReady.value = true;\n\t\t\t}\n\t\t\tonSuccess(data);\n\t\t\treturn data;\n\t\t} catch (e) {\n\t\t\tif (executionId === executionsCount) error.value = e;\n\t\t\tonError(e);\n\t\t\tif (throwError) throw e;\n\t\t} finally {\n\t\t\tif (executionId === executionsCount) isLoading.value = false;\n\t\t}\n\t}\n\tif (immediate) execute(delay);\n\tconst shell = {\n\t\tstate,\n\t\tisReady,\n\t\tisLoading,\n\t\terror,\n\t\texecute,\n\t\texecuteImmediate: (...args) => execute(0, ...args)\n\t};\n\tfunction waitUntilIsLoaded() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isLoading).toBe(false).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilIsLoaded().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\n//#endregion\n//#region useBase64/serialization.ts\nconst defaults = {\n\tarray: (v) => JSON.stringify(v),\n\tobject: (v) => JSON.stringify(v),\n\tset: (v) => JSON.stringify(Array.from(v)),\n\tmap: (v) => JSON.stringify(Object.fromEntries(v)),\n\tnull: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n\tif (!target) return defaults.null;\n\tif (target instanceof Map) return defaults.map;\n\telse if (target instanceof Set) return defaults.set;\n\telse if (Array.isArray(target)) return defaults.array;\n\telse return defaults.object;\n}\n//#endregion\n//#region useBase64/index.ts\nfunction useBase64(target, options) {\n\tconst base64 = shallowRef(\"\");\n\tconst promise = shallowRef();\n\tfunction execute() {\n\t\tif (!isClient) return;\n\t\tpromise.value = new Promise((resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst _target = toValue(target);\n\t\t\t\tif (_target == null) resolve(\"\");\n\t\t\t\telse if (typeof _target === \"string\") resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n\t\t\t\telse if (_target instanceof Blob) resolve(blobToBase64(_target));\n\t\t\t\telse if (_target instanceof ArrayBuffer) resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n\t\t\t\telse if (_target instanceof HTMLCanvasElement) resolve(_target.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\telse if (_target instanceof HTMLImageElement) {\n\t\t\t\t\tconst img = _target.cloneNode(false);\n\t\t\t\t\timg.crossOrigin = \"Anonymous\";\n\t\t\t\t\timgLoaded(img).then(() => {\n\t\t\t\t\t\tconst canvas = document.createElement(\"canvas\");\n\t\t\t\t\t\tconst ctx = canvas.getContext(\"2d\");\n\t\t\t\t\t\tcanvas.width = img.width;\n\t\t\t\t\t\tcanvas.height = img.height;\n\t\t\t\t\t\tctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n\t\t\t\t\t\tresolve(canvas.toDataURL(options === null || options === void 0 ? void 0 : options.type, options === null || options === void 0 ? void 0 : options.quality));\n\t\t\t\t\t}).catch(reject);\n\t\t\t\t} else if (typeof _target === \"object\") {\n\t\t\t\t\tconst serialized = ((options === null || options === void 0 ? void 0 : options.serializer) || getDefaultSerialization(_target))(_target);\n\t\t\t\t\treturn resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n\t\t\t\t} else reject(/* @__PURE__ */ new Error(\"target is unsupported types\"));\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t\tpromise.value.then((res) => {\n\t\t\tbase64.value = (options === null || options === void 0 ? void 0 : options.dataUrl) === false ? res.replace(/^data:.*?;base64,/, \"\") : res;\n\t\t});\n\t\treturn promise.value;\n\t}\n\tif (isRef(target) || typeof target === \"function\") watch(target, execute, { immediate: true });\n\telse execute();\n\treturn {\n\t\tbase64,\n\t\tpromise,\n\t\texecute\n\t};\n}\nfunction imgLoaded(img) {\n\treturn new Promise((resolve, reject) => {\n\t\tif (!img.complete) {\n\t\t\timg.onload = () => {\n\t\t\t\tresolve();\n\t\t\t};\n\t\t\timg.onerror = reject;\n\t\t} else resolve();\n\t});\n}\nfunction blobToBase64(blob) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst fr = new FileReader();\n\t\tfr.onload = (e) => {\n\t\t\tresolve(e.target.result);\n\t\t};\n\t\tfr.onerror = reject;\n\t\tfr.readAsDataURL(blob);\n\t});\n}\n//#endregion\n//#region useBattery/index.ts\n/**\n* Reactive Battery Status API.\n*\n* @see https://vueuse.org/useBattery\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBattery(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst events = [\n\t\t\"chargingchange\",\n\t\t\"chargingtimechange\",\n\t\t\"dischargingtimechange\",\n\t\t\"levelchange\"\n\t];\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getBattery\" in navigator && typeof navigator.getBattery === \"function\");\n\tconst charging = shallowRef(false);\n\tconst chargingTime = shallowRef(0);\n\tconst dischargingTime = shallowRef(0);\n\tconst level = shallowRef(1);\n\tlet battery;\n\tfunction updateBatteryInfo() {\n\t\tcharging.value = this.charging;\n\t\tchargingTime.value = this.chargingTime || 0;\n\t\tdischargingTime.value = this.dischargingTime || 0;\n\t\tlevel.value = this.level;\n\t}\n\tif (isSupported.value) navigator.getBattery().then((_battery) => {\n\t\tbattery = _battery;\n\t\tupdateBatteryInfo.call(battery);\n\t\tuseEventListener(battery, events, updateBatteryInfo, { passive: true });\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcharging,\n\t\tchargingTime,\n\t\tdischargingTime,\n\t\tlevel\n\t};\n}\n//#endregion\n//#region useBluetooth/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useBluetooth(options) {\n\tlet { acceptAllDevices = false } = options || {};\n\tconst { filters = void 0, optionalServices = void 0, navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"bluetooth\" in navigator);\n\tconst device = shallowRef();\n\tconst error = shallowRef(null);\n\twatch(device, () => {\n\t\tconnectToBluetoothGATTServer();\n\t});\n\tasync function requestDevice() {\n\t\tif (!isSupported.value) return;\n\t\terror.value = null;\n\t\tif (filters && filters.length > 0) acceptAllDevices = false;\n\t\ttry {\n\t\t\tdevice.value = await (navigator === null || navigator === void 0 ? void 0 : navigator.bluetooth.requestDevice({\n\t\t\t\tacceptAllDevices,\n\t\t\t\tfilters,\n\t\t\t\toptionalServices\n\t\t\t}));\n\t\t} catch (err) {\n\t\t\terror.value = err;\n\t\t}\n\t}\n\tconst server = shallowRef();\n\tconst isConnected = shallowRef(false);\n\tfunction reset() {\n\t\tisConnected.value = false;\n\t\tdevice.value = void 0;\n\t\tserver.value = void 0;\n\t}\n\tasync function connectToBluetoothGATTServer() {\n\t\terror.value = null;\n\t\tif (device.value && device.value.gatt) {\n\t\t\tuseEventListener(device, \"gattserverdisconnected\", reset, { passive: true });\n\t\t\ttry {\n\t\t\t\tserver.value = await device.value.gatt.connect();\n\t\t\t\tisConnected.value = server.value.connected;\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t}\n\t}\n\ttryOnMounted(() => {\n\t\tvar _device$value$gatt;\n\t\tif (device.value) (_device$value$gatt = device.value.gatt) === null || _device$value$gatt === void 0 || _device$value$gatt.connect();\n\t});\n\ttryOnScopeDispose(() => {\n\t\tvar _device$value$gatt2;\n\t\tif (device.value) (_device$value$gatt2 = device.value.gatt) === null || _device$value$gatt2 === void 0 || _device$value$gatt2.disconnect();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisConnected: shallowReadonly(isConnected),\n\t\tdevice,\n\t\trequestDevice,\n\t\tserver,\n\t\terror\n\t};\n}\n//#endregion\n//#region useSSRWidth/index.ts\nconst ssrWidthSymbol = Symbol(\"vueuse-ssr-width\");\n/* @__NO_SIDE_EFFECTS__ */\nfunction useSSRWidth() {\n\tconst ssrWidth = hasInjectionContext() ? injectLocal(ssrWidthSymbol, null) : null;\n\treturn typeof ssrWidth === \"number\" ? ssrWidth : void 0;\n}\nfunction provideSSRWidth(width, app) {\n\tif (app !== void 0) app.provide(ssrWidthSymbol, width);\n\telse provideLocal(ssrWidthSymbol, width);\n}\n//#endregion\n//#region useMediaQuery/index.ts\n/**\n* Reactive Media Query.\n*\n* @see https://vueuse.org/useMediaQuery\n* @param query\n* @param options\n*/\nfunction useMediaQuery(query, options = {}) {\n\tconst { window = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n\tconst ssrSupport = shallowRef(typeof ssrWidth === \"number\");\n\tconst mediaQuery = shallowRef();\n\tconst matches = shallowRef(false);\n\tconst handler = (event) => {\n\t\tmatches.value = event.matches;\n\t};\n\twatchEffect(() => {\n\t\tif (ssrSupport.value) {\n\t\t\tssrSupport.value = !isSupported.value;\n\t\t\tconst queryStrings = toValue(query).split(\",\");\n\t\t\tmatches.value = queryStrings.some((queryString) => {\n\t\t\t\tconst not = queryString.includes(\"not all\");\n\t\t\t\tconst minWidth = queryString.match(/\\(\\s*min-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tconst maxWidth = queryString.match(/\\(\\s*max-width:\\s*(-?\\d+(?:\\.\\d*)?[a-z]+\\s*)\\)/);\n\t\t\t\tlet res = Boolean(minWidth || maxWidth);\n\t\t\t\tif (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);\n\t\t\t\tif (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);\n\t\t\t\treturn not ? !res : res;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (!isSupported.value) return;\n\t\tmediaQuery.value = window.matchMedia(toValue(query));\n\t\tmatches.value = mediaQuery.value.matches;\n\t});\n\tuseEventListener(mediaQuery, \"change\", handler, { passive: true });\n\treturn computed(() => matches.value);\n}\n//#endregion\n//#region useBreakpoints/breakpoints.ts\n/**\n* Breakpoints from Tailwind V2\n*\n* @see https://tailwindcss.com/docs/breakpoints\n*/\nconst breakpointsTailwind = {\n\t\"sm\": 640,\n\t\"md\": 768,\n\t\"lg\": 1024,\n\t\"xl\": 1280,\n\t\"2xl\": 1536\n};\n/**\n* Breakpoints from Bootstrap V5\n*\n* @see https://getbootstrap.com/docs/5.0/layout/breakpoints\n*/\nconst breakpointsBootstrapV5 = {\n\txs: 0,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1400\n};\n/**\n* Breakpoints from Vuetify V2\n*\n* @see https://v2.vuetifyjs.com/en/features/breakpoints/\n*/\nconst breakpointsVuetifyV2 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1264,\n\txl: 1904\n};\n/**\n* Breakpoints from Vuetify V3\n*\n* @see https://vuetifyjs.com/en/styles/float/#overview\n*/\nconst breakpointsVuetifyV3 = {\n\txs: 0,\n\tsm: 600,\n\tmd: 960,\n\tlg: 1280,\n\txl: 1920,\n\txxl: 2560\n};\n/**\n* Alias to `breakpointsVuetifyV2`\n*\n* @deprecated explictly use `breakpointsVuetifyV2` or `breakpointsVuetifyV3` instead\n*/\nconst breakpointsVuetify = breakpointsVuetifyV2;\n/**\n* Breakpoints from Ant Design\n*\n* @see https://ant.design/components/layout/#breakpoint-width\n*/\nconst breakpointsAntDesign = {\n\txs: 480,\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200,\n\txxl: 1600\n};\n/**\n* Breakpoints from Quasar V2\n*\n* @see https://quasar.dev/style/breakpoints\n*/\nconst breakpointsQuasar = {\n\txs: 0,\n\tsm: 600,\n\tmd: 1024,\n\tlg: 1440,\n\txl: 1920\n};\n/**\n* Sematic Breakpoints\n*/\nconst breakpointsSematic = {\n\tmobileS: 320,\n\tmobileM: 375,\n\tmobileL: 425,\n\ttablet: 768,\n\tlaptop: 1024,\n\tlaptopL: 1440,\n\tdesktop4K: 2560\n};\n/**\n* Breakpoints from Master CSS\n*\n* @see https://docs.master.co/css/breakpoints\n*/\nconst breakpointsMasterCss = {\n\t\"3xs\": 360,\n\t\"2xs\": 480,\n\t\"xs\": 600,\n\t\"sm\": 768,\n\t\"md\": 1024,\n\t\"lg\": 1280,\n\t\"xl\": 1440,\n\t\"2xl\": 1600,\n\t\"3xl\": 1920,\n\t\"4xl\": 2560\n};\n/**\n* Breakpoints from PrimeFlex\n*\n* @see https://primeflex.org/installation\n*/\nconst breakpointsPrimeFlex = {\n\tsm: 576,\n\tmd: 768,\n\tlg: 992,\n\txl: 1200\n};\n/**\n* Breakpoints from ElementUI/ElementPlus\n*\n* @see https://element.eleme.io/#/en-US/component/layout\n* @see https://element-plus.org/en-US/component/layout.html\n*/\nconst breakpointsElement = {\n\txs: 0,\n\tsm: 768,\n\tmd: 992,\n\tlg: 1200,\n\txl: 1920\n};\n//#endregion\n//#region useBreakpoints/index.ts\n/**\n* Reactively viewport breakpoints\n*\n* @see https://vueuse.org/useBreakpoints\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBreakpoints(breakpoints, options = {}) {\n\tfunction getValue(k, delta) {\n\t\tlet v = toValue(breakpoints[toValue(k)]);\n\t\tif (delta != null) v = increaseWithUnit(v, delta);\n\t\tif (typeof v === \"number\") v = `${v}px`;\n\t\treturn v;\n\t}\n\tconst { window = defaultWindow, strategy = \"min-width\", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;\n\tconst ssrSupport = typeof ssrWidth === \"number\";\n\tconst mounted = ssrSupport ? shallowRef(false) : { value: true };\n\tif (ssrSupport) tryOnMounted(() => mounted.value = !!window);\n\tfunction match(query, size) {\n\t\tif (!mounted.value && ssrSupport) return query === \"min\" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);\n\t\tif (!window) return false;\n\t\treturn window.matchMedia(`(${query}-width: ${size})`).matches;\n\t}\n\tconst greaterOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(min-width: ${getValue(k)})`, options);\n\t};\n\tconst smallerOrEqual = (k) => {\n\t\treturn useMediaQuery(() => `(max-width: ${getValue(k)})`, options);\n\t};\n\tconst shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n\t\tObject.defineProperty(shortcuts, k, {\n\t\t\tget: () => strategy === \"min-width\" ? greaterOrEqual(k) : smallerOrEqual(k),\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t});\n\t\treturn shortcuts;\n\t}, {});\n\tfunction current() {\n\t\tconst points = Object.keys(breakpoints).map((k) => [\n\t\t\tk,\n\t\t\tshortcutMethods[k],\n\t\t\tpxValue(getValue(k))\n\t\t]).sort((a, b) => a[2] - b[2]);\n\t\treturn computed(() => points.filter(([, v]) => v.value).map(([k]) => k));\n\t}\n\treturn Object.assign(shortcutMethods, {\n\t\tgreaterOrEqual,\n\t\tsmallerOrEqual,\n\t\tgreater(k) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(k, .1)})`, options);\n\t\t},\n\t\tsmaller(k) {\n\t\t\treturn useMediaQuery(() => `(max-width: ${getValue(k, -.1)})`, options);\n\t\t},\n\t\tbetween(a, b) {\n\t\t\treturn useMediaQuery(() => `(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -.1)})`, options);\n\t\t},\n\t\tisGreater(k) {\n\t\t\treturn match(\"min\", getValue(k, .1));\n\t\t},\n\t\tisGreaterOrEqual(k) {\n\t\t\treturn match(\"min\", getValue(k));\n\t\t},\n\t\tisSmaller(k) {\n\t\t\treturn match(\"max\", getValue(k, -.1));\n\t\t},\n\t\tisSmallerOrEqual(k) {\n\t\t\treturn match(\"max\", getValue(k));\n\t\t},\n\t\tisInBetween(a, b) {\n\t\t\treturn match(\"min\", getValue(a)) && match(\"max\", getValue(b, -.1));\n\t\t},\n\t\tcurrent,\n\t\tactive() {\n\t\t\tconst bps = current();\n\t\t\treturn computed(() => bps.value.length === 0 ? \"\" : bps.value.at(strategy === \"min-width\" ? -1 : 0));\n\t\t}\n\t});\n}\n//#endregion\n//#region useBroadcastChannel/index.ts\n/**\n* Reactive BroadcastChannel\n*\n* @see https://vueuse.org/useBroadcastChannel\n* @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel\n* @param options\n*\n*/\nfunction useBroadcastChannel(options) {\n\tconst { name, window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"BroadcastChannel\" in window);\n\tconst isClosed = shallowRef(false);\n\tconst channel = shallowRef();\n\tconst data = shallowRef();\n\tconst error = shallowRef(null);\n\tconst post = (data) => {\n\t\tif (channel.value) channel.value.postMessage(data);\n\t};\n\tconst close = () => {\n\t\tif (channel.value) channel.value.close();\n\t\tisClosed.value = true;\n\t};\n\tif (isSupported.value) tryOnMounted(() => {\n\t\terror.value = null;\n\t\tchannel.value = new BroadcastChannel(name);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(channel, \"message\", (e) => {\n\t\t\tdata.value = e.data;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"messageerror\", (e) => {\n\t\t\terror.value = e;\n\t\t}, listenerOptions);\n\t\tuseEventListener(channel, \"close\", () => {\n\t\t\tisClosed.value = true;\n\t\t}, listenerOptions);\n\t});\n\ttryOnScopeDispose(() => {\n\t\tclose();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tchannel,\n\t\tdata,\n\t\tpost,\n\t\tclose,\n\t\terror,\n\t\tisClosed\n\t};\n}\n//#endregion\n//#region useBrowserLocation/index.ts\nconst WRITABLE_PROPERTIES = [\n\t\"hash\",\n\t\"host\",\n\t\"hostname\",\n\t\"href\",\n\t\"pathname\",\n\t\"port\",\n\t\"protocol\",\n\t\"search\"\n];\n/**\n* Reactive browser location.\n*\n* @see https://vueuse.org/useBrowserLocation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useBrowserLocation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst refs = Object.fromEntries(WRITABLE_PROPERTIES.map((key) => [key, ref()]));\n\tconst buildState = (trigger) => {\n\t\tvar _window$location;\n\t\tconst { state, length } = (window === null || window === void 0 ? void 0 : window.history) || {};\n\t\tconst { origin } = (window === null || window === void 0 ? void 0 : window.location) || {};\n\t\tfor (const key of WRITABLE_PROPERTIES) refs[key].value = window === null || window === void 0 || (_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location[key];\n\t\treturn reactive({\n\t\t\ttrigger,\n\t\t\tstate,\n\t\t\tlength,\n\t\t\torigin,\n\t\t\t...refs\n\t\t});\n\t};\n\tconst state = ref(buildState(\"load\"));\n\tfor (const [key, ref] of objectEntries(refs)) watch(ref, (value) => {\n\t\tif (!(window === null || window === void 0 ? void 0 : window.location) || window.location[key] === value) return;\n\t\twindow.location[key] = value;\n\t});\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), listenerOptions);\n\t\tuseEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), listenerOptions);\n\t}\n\treturn state;\n}\n//#endregion\n//#region useCached/index.ts\nfunction useCached(refValue, comparator = (newSourceValue, cachedValue) => newSourceValue === cachedValue, options) {\n\tconst { deepRefs = true, ...watchOptions } = options || {};\n\tconst cachedValue = createRef(refValue.value, deepRefs);\n\twatch(() => refValue.value, (value) => {\n\t\tif (!comparator(value, cachedValue.value)) cachedValue.value = value;\n\t}, watchOptions);\n\treturn cachedValue;\n}\n//#endregion\n//#region usePermission/index.ts\n/**\n* Reactive Permissions API.\n*\n* @see https://vueuse.org/usePermission\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePermission(permissionDesc, options = {}) {\n\tconst { controls = false, navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"permissions\" in navigator);\n\tconst permissionStatus = shallowRef();\n\tconst desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n\tconst state = shallowRef();\n\tconst update = () => {\n\t\tvar _permissionStatus$val, _permissionStatus$val2;\n\t\tstate.value = (_permissionStatus$val = (_permissionStatus$val2 = permissionStatus.value) === null || _permissionStatus$val2 === void 0 ? void 0 : _permissionStatus$val2.state) !== null && _permissionStatus$val !== void 0 ? _permissionStatus$val : \"prompt\";\n\t};\n\tuseEventListener(permissionStatus, \"change\", update, { passive: true });\n\tconst query = createSingletonPromise(async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionStatus.value) try {\n\t\t\tpermissionStatus.value = await navigator.permissions.query(desc);\n\t\t} catch (_unused) {\n\t\t\tpermissionStatus.value = void 0;\n\t\t} finally {\n\t\t\tupdate();\n\t\t}\n\t\tif (controls) return toRaw(permissionStatus.value);\n\t});\n\tquery();\n\tif (controls) return {\n\t\tstate,\n\t\tisSupported,\n\t\tquery\n\t};\n\telse return state;\n}\n//#endregion\n//#region useClipboard/index.ts\nfunction useClipboard(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500, legacy = false } = options;\n\tconst isClipboardApiSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst permissionRead = usePermission(\"clipboard-read\");\n\tconst permissionWrite = usePermission(\"clipboard-write\");\n\tconst isSupported = computed(() => isClipboardApiSupported.value || legacy);\n\tconst text = shallowRef(\"\");\n\tconst copied = shallowRef(false);\n\tconst copyPending = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tlet lastLegacyId = 0;\n\tasync function updateText() {\n\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionRead.value));\n\t\tif (!useLegacy) try {\n\t\t\ttext.value = await navigator.clipboard.readText();\n\t\t} catch (_unused) {\n\t\t\tuseLegacy = true;\n\t\t}\n\t\tif (useLegacy) text.value = legacyRead();\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateText, { passive: true });\n\tasync function copy(value) {\n\t\tconst resolvedValue = value !== null && value !== void 0 ? value : toValue(source);\n\t\tif (isSupported.value && resolvedValue != null) {\n\t\t\tcopyPending.value = true;\n\t\t\tlet useLegacy = !(isClipboardApiSupported.value && isAllowed(permissionWrite.value));\n\t\t\tif (!useLegacy) try {\n\t\t\t\tconst clipboardItem = createClipboardItem(resolvedValue);\n\t\t\t\tawait navigator.clipboard.write([clipboardItem]);\n\t\t\t} catch (_unused2) {\n\t\t\t\tuseLegacy = true;\n\t\t\t}\n\t\t\tif (useLegacy) if (typeof resolvedValue === \"string\") {\n\t\t\t\ttext.value = resolvedValue;\n\t\t\t\tlegacyCopy(resolvedValue);\n\t\t\t} else {\n\t\t\t\tconst currentId = ++lastLegacyId;\n\t\t\t\tconst resolvedText = await resolvedValue();\n\t\t\t\tif (resolvedText != null && currentId === lastLegacyId) {\n\t\t\t\t\ttext.value = resolvedText;\n\t\t\t\t\tlegacyCopy(resolvedText);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t\tcopyPending.value = false;\n\t\t}\n\t}\n\tfunction createClipboardItem(value) {\n\t\tif (typeof value === \"string\") {\n\t\t\ttext.value = value;\n\t\t\treturn new ClipboardItem({ \"text/plain\": value });\n\t\t} else return new ClipboardItem({ \"text/plain\": value().then((resolvedText = \"\") => {\n\t\t\ttext.value = resolvedText;\n\t\t\treturn new Blob([resolvedText], { type: \"text/plain\" });\n\t\t}) });\n\t}\n\tfunction legacyCopy(value) {\n\t\tconst ta = document.createElement(\"textarea\");\n\t\tta.value = value;\n\t\tta.style.position = \"absolute\";\n\t\tta.style.opacity = \"0\";\n\t\tta.setAttribute(\"readonly\", \"\");\n\t\tdocument.body.appendChild(ta);\n\t\tta.select();\n\t\tdocument.execCommand(\"copy\");\n\t\tta.remove();\n\t}\n\tfunction legacyRead() {\n\t\tvar _document$getSelectio, _document, _document$getSelectio2;\n\t\treturn (_document$getSelectio = (_document = document) === null || _document === void 0 || (_document$getSelectio2 = _document.getSelection) === null || _document$getSelectio2 === void 0 || (_document$getSelectio2 = _document$getSelectio2.call(_document)) === null || _document$getSelectio2 === void 0 ? void 0 : _document$getSelectio2.toString()) !== null && _document$getSelectio !== void 0 ? _document$getSelectio : \"\";\n\t}\n\tfunction isAllowed(status) {\n\t\treturn status === \"granted\" || status === \"prompt\";\n\t}\n\treturn {\n\t\tcopyPending: shallowReadonly(copyPending),\n\t\tisSupported,\n\t\ttext: shallowReadonly(text),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy\n\t};\n}\n//#endregion\n//#region useClipboardItems/index.ts\nfunction useClipboardItems(options = {}) {\n\tconst { navigator = defaultNavigator, read = false, source, copiedDuring = 1500 } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"clipboard\" in navigator);\n\tconst content = shallowRef([]);\n\tconst copied = shallowRef(false);\n\tconst timeout = useTimeoutFn(() => copied.value = false, copiedDuring, { immediate: false });\n\tfunction updateContent() {\n\t\tif (isSupported.value) navigator.clipboard.read().then((items) => {\n\t\t\tcontent.value = items;\n\t\t});\n\t}\n\tif (isSupported.value && read) useEventListener([\"copy\", \"cut\"], updateContent, { passive: true });\n\tasync function copy(value = toValue(source)) {\n\t\tif (isSupported.value && value != null) {\n\t\t\tawait navigator.clipboard.write(value);\n\t\t\tcontent.value = value;\n\t\t\tcopied.value = true;\n\t\t\ttimeout.start();\n\t\t}\n\t}\n\treturn {\n\t\tisSupported,\n\t\tcontent: shallowReadonly(content),\n\t\tcopied: shallowReadonly(copied),\n\t\tcopy,\n\t\tread: updateContent\n\t};\n}\n//#endregion\n//#region useCloned/index.ts\nfunction cloneFnJSON(source) {\n\treturn JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n\tconst cloned = ref({});\n\tconst isModified = shallowRef(false);\n\tlet _lastSync = false;\n\tconst { manual, clone = cloneFnJSON, deep = true, immediate = true } = options;\n\twatch(cloned, () => {\n\t\tif (_lastSync) {\n\t\t\t_lastSync = false;\n\t\t\treturn;\n\t\t}\n\t\tisModified.value = true;\n\t}, {\n\t\tdeep: true,\n\t\tflush: \"sync\"\n\t});\n\tfunction sync() {\n\t\t_lastSync = true;\n\t\tisModified.value = false;\n\t\tcloned.value = clone(toValue(source));\n\t}\n\tif (!manual && (isRef(source) || typeof source === \"function\")) watch(source, sync, {\n\t\t...options,\n\t\tdeep,\n\t\timmediate\n\t});\n\telse sync();\n\treturn {\n\t\tcloned,\n\t\tisModified,\n\t\tsync\n\t};\n}\n//#endregion\n//#region ssr-handlers.ts\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\nconst handlers = /* #__PURE__ */ getHandlers();\nfunction getHandlers() {\n\tif (!(globalKey in _global)) _global[globalKey] = _global[globalKey] || {};\n\treturn _global[globalKey];\n}\nfunction getSSRHandler(key, fallback) {\n\treturn handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n\thandlers[key] = fn;\n}\n//#endregion\n//#region usePreferredDark/index.ts\n/**\n* Reactive dark theme preference.\n*\n* @see https://vueuse.org/usePreferredDark\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredDark(options) {\n\treturn useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n//#endregion\n//#region useStorage/guess.ts\nfunction guessSerializerType(rawInit) {\n\treturn rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n//#endregion\n//#region useStorage/index.ts\nconst StorageSerializers = {\n\tboolean: {\n\t\tread: (v) => v === \"true\",\n\t\twrite: (v) => String(v)\n\t},\n\tobject: {\n\t\tread: (v) => JSON.parse(v),\n\t\twrite: (v) => JSON.stringify(v)\n\t},\n\tnumber: {\n\t\tread: (v) => Number.parseFloat(v),\n\t\twrite: (v) => String(v)\n\t},\n\tany: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tstring: {\n\t\tread: (v) => v,\n\t\twrite: (v) => String(v)\n\t},\n\tmap: {\n\t\tread: (v) => new Map(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v.entries()))\n\t},\n\tset: {\n\t\tread: (v) => new Set(JSON.parse(v)),\n\t\twrite: (v) => JSON.stringify(Array.from(v))\n\t},\n\tdate: {\n\t\tread: (v) => new Date(v),\n\t\twrite: (v) => v.toISOString()\n\t}\n};\nconst customStorageEventName = \"vueuse-storage\";\n/**\n* Reactive LocalStorage/SessionStorage.\n*\n* @see https://vueuse.org/useStorage\n*/\nfunction useStorage(key, defaults, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, initOnMounted } = options;\n\tconst data = (shallow ? shallowRef : ref)(typeof defaults === \"function\" ? defaults() : defaults);\n\tconst keyComputed = computed(() => toValue(key));\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorage\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tif (!storage) return data;\n\tconst rawInit = toValue(defaults);\n\tconst type = guessSerializerType(rawInit);\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tconst { pause: pauseWatch, resume: resumeWatch } = watchPausable(data, (newValue) => write(newValue), {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\twatch(keyComputed, () => update(), { flush });\n\tlet firstMounted = false;\n\tconst onStorageEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdate(ev);\n\t};\n\tconst onStorageCustomEvent = (ev) => {\n\t\tif (initOnMounted && !firstMounted) return;\n\t\tupdateFromCustomEvent(ev);\n\t};\n\t/**\n\t* The custom event is needed for same-document syncing when using custom\n\t* storage backends, but it doesn't work across different documents.\n\t*\n\t* TODO: Consider implementing a BroadcastChannel-based solution that fixes this.\n\t*/\n\tif (window && listenToStorageChanges) if (storage instanceof Storage) useEventListener(window, \"storage\", onStorageEvent, { passive: true });\n\telse useEventListener(window, customStorageEventName, onStorageCustomEvent);\n\tif (initOnMounted) tryOnMounted(() => {\n\t\tfirstMounted = true;\n\t\tupdate();\n\t});\n\telse update();\n\tfunction dispatchWriteEvent(oldValue, newValue) {\n\t\tif (window) {\n\t\t\tconst payload = {\n\t\t\t\tkey: keyComputed.value,\n\t\t\t\toldValue,\n\t\t\t\tnewValue,\n\t\t\t\tstorageArea: storage\n\t\t\t};\n\t\t\twindow.dispatchEvent(storage instanceof Storage ? new StorageEvent(\"storage\", payload) : new CustomEvent(customStorageEventName, { detail: payload }));\n\t\t}\n\t}\n\tfunction write(v) {\n\t\ttry {\n\t\t\tconst oldValue = storage.getItem(keyComputed.value);\n\t\t\tif (v == null) {\n\t\t\t\tdispatchWriteEvent(oldValue, null);\n\t\t\t\tstorage.removeItem(keyComputed.value);\n\t\t\t} else {\n\t\t\t\tconst serialized = serializer.write(v);\n\t\t\t\tif (oldValue !== serialized) {\n\t\t\t\t\tstorage.setItem(keyComputed.value, serialized);\n\t\t\t\t\tdispatchWriteEvent(oldValue, serialized);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tfunction read(event) {\n\t\tconst rawValue = event ? event.newValue : storage.getItem(keyComputed.value);\n\t\tif (rawValue == null) {\n\t\t\tif (writeDefaults && rawInit != null) storage.setItem(keyComputed.value, serializer.write(rawInit));\n\t\t\treturn rawInit;\n\t\t} else if (!event && mergeDefaults) {\n\t\t\tconst value = serializer.read(rawValue);\n\t\t\tif (typeof mergeDefaults === \"function\") return mergeDefaults(value, rawInit);\n\t\t\telse if (type === \"object\" && !Array.isArray(value)) return {\n\t\t\t\t...rawInit,\n\t\t\t\t...value\n\t\t\t};\n\t\t\treturn value;\n\t\t} else if (typeof rawValue !== \"string\") return rawValue;\n\t\telse return serializer.read(rawValue);\n\t}\n\tfunction update(event) {\n\t\tif (event && event.storageArea !== storage) return;\n\t\tif (event && event.key == null) {\n\t\t\tdata.value = rawInit;\n\t\t\treturn;\n\t\t}\n\t\tif (event && event.key !== keyComputed.value) return;\n\t\tpauseWatch();\n\t\ttry {\n\t\t\tconst serializedData = serializer.write(data.value);\n\t\t\tif (event === void 0 || (event === null || event === void 0 ? void 0 : event.newValue) !== serializedData) data.value = read(event);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t} finally {\n\t\t\tif (event) nextTick(resumeWatch);\n\t\t\telse resumeWatch();\n\t\t}\n\t}\n\tfunction updateFromCustomEvent(event) {\n\t\tupdate(event.detail);\n\t}\n\treturn data;\n}\n//#endregion\n//#region useColorMode/index.ts\nconst CSS_DISABLE_TRANS = \"*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}\";\n/**\n* Reactive color mode with auto data persistence.\n*\n* @see https://vueuse.org/useColorMode\n* @param options\n*/\nfunction useColorMode(options = {}) {\n\tconst { selector = \"html\", attribute = \"class\", initialValue = \"auto\", window = defaultWindow, storage, storageKey = \"vueuse-color-scheme\", listenToStorageChanges = true, storageRef, emitAuto, disableTransition = true } = options;\n\tconst modes = {\n\t\tauto: \"\",\n\t\tlight: \"light\",\n\t\tdark: \"dark\",\n\t\t...options.modes || {}\n\t};\n\tconst preferredDark = usePreferredDark({ window });\n\tconst system = computed(() => preferredDark.value ? \"dark\" : \"light\");\n\tconst store = storageRef || (storageKey == null ? toRef(initialValue) : useStorage(storageKey, initialValue, storage, {\n\t\twindow,\n\t\tlistenToStorageChanges\n\t}));\n\tconst state = computed(() => store.value === \"auto\" ? system.value : store.value);\n\tconst updateHTMLAttrs = getSSRHandler(\"updateHTMLAttrs\", (selector, attribute, value) => {\n\t\tconst el = typeof selector === \"string\" ? window === null || window === void 0 ? void 0 : window.document.querySelector(selector) : unrefElement(selector);\n\t\tif (!el) return;\n\t\tconst classesToAdd = /* @__PURE__ */ new Set();\n\t\tconst classesToRemove = /* @__PURE__ */ new Set();\n\t\tlet attributeToChange = null;\n\t\tif (attribute === \"class\") {\n\t\t\tconst current = value.split(/\\s/g);\n\t\t\tObject.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n\t\t\t\tif (current.includes(v)) classesToAdd.add(v);\n\t\t\t\telse classesToRemove.add(v);\n\t\t\t});\n\t\t} else attributeToChange = {\n\t\t\tkey: attribute,\n\t\t\tvalue\n\t\t};\n\t\tif (classesToAdd.size === 0 && classesToRemove.size === 0 && attributeToChange === null) return;\n\t\tlet style;\n\t\tif (disableTransition) {\n\t\t\tstyle = window.document.createElement(\"style\");\n\t\t\tstyle.appendChild(document.createTextNode(CSS_DISABLE_TRANS));\n\t\t\twindow.document.head.appendChild(style);\n\t\t}\n\t\tfor (const c of classesToAdd) el.classList.add(c);\n\t\tfor (const c of classesToRemove) el.classList.remove(c);\n\t\tif (attributeToChange) el.setAttribute(attributeToChange.key, attributeToChange.value);\n\t\tif (disableTransition) {\n\t\t\twindow.getComputedStyle(style).opacity;\n\t\t\tdocument.head.removeChild(style);\n\t\t}\n\t});\n\tfunction defaultOnChanged(mode) {\n\t\tvar _modes$mode;\n\t\tupdateHTMLAttrs(selector, attribute, (_modes$mode = modes[mode]) !== null && _modes$mode !== void 0 ? _modes$mode : mode);\n\t}\n\tfunction onChanged(mode) {\n\t\tif (options.onChanged) options.onChanged(mode, defaultOnChanged);\n\t\telse defaultOnChanged(mode);\n\t}\n\twatch(state, onChanged, {\n\t\tflush: \"post\",\n\t\timmediate: true\n\t});\n\ttryOnMounted(() => onChanged(state.value));\n\tconst auto = computed({\n\t\tget() {\n\t\t\treturn emitAuto ? store.value : state.value;\n\t\t},\n\t\tset(v) {\n\t\t\tstore.value = v;\n\t\t}\n\t});\n\treturn Object.assign(auto, {\n\t\tstore,\n\t\tsystem,\n\t\tstate\n\t});\n}\n//#endregion\n//#region useConfirmDialog/index.ts\n/**\n* Hooks for creating confirm dialogs. Useful for modal windows, popups and logins.\n*\n* @see https://vueuse.org/useConfirmDialog/\n* @param revealed `boolean` `ref` that handles a modal window\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useConfirmDialog(revealed = shallowRef(false)) {\n\tconst confirmHook = createEventHook();\n\tconst cancelHook = createEventHook();\n\tconst revealHook = createEventHook();\n\tlet _resolve = noop;\n\tconst reveal = (data) => {\n\t\trevealHook.trigger(data);\n\t\trevealed.value = true;\n\t\treturn new Promise((resolve) => {\n\t\t\t_resolve = resolve;\n\t\t});\n\t};\n\tconst confirm = (data) => {\n\t\trevealed.value = false;\n\t\tconfirmHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: false\n\t\t});\n\t};\n\tconst cancel = (data) => {\n\t\trevealed.value = false;\n\t\tcancelHook.trigger(data);\n\t\t_resolve({\n\t\t\tdata,\n\t\t\tisCanceled: true\n\t\t});\n\t};\n\treturn {\n\t\tisRevealed: computed(() => revealed.value),\n\t\treveal,\n\t\tconfirm,\n\t\tcancel,\n\t\tonReveal: revealHook.on,\n\t\tonConfirm: confirmHook.on,\n\t\tonCancel: cancelHook.on\n\t};\n}\n//#endregion\n//#region useCountdown/index.ts\nfunction getDefaultScheduler$8(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = 1e3, immediate = false } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn (cb) => useIntervalFn(cb, 1e3, { immediate: false });\n}\n/**\n* Reactive countdown timer in seconds.\n*\n* @param initialCountdown\n* @param options\n*\n* @see https://vueuse.org/useCountdown\n*/\nfunction useCountdown(initialCountdown, options = {}) {\n\tconst remaining = shallowRef(toValue(initialCountdown));\n\tconst { scheduler = getDefaultScheduler$8(options), onTick, onComplete } = options;\n\tconst controls = scheduler(() => {\n\t\tconst value = remaining.value - 1;\n\t\tremaining.value = value < 0 ? 0 : value;\n\t\tonTick === null || onTick === void 0 || onTick();\n\t\tif (remaining.value <= 0) {\n\t\t\tcontrols.pause();\n\t\t\tonComplete === null || onComplete === void 0 || onComplete();\n\t\t}\n\t});\n\tconst reset = (countdown) => {\n\t\tvar _toValue;\n\t\tremaining.value = (_toValue = toValue(countdown)) !== null && _toValue !== void 0 ? _toValue : toValue(initialCountdown);\n\t};\n\tconst stop = () => {\n\t\tcontrols.pause();\n\t\treset();\n\t};\n\tconst resume = () => {\n\t\tif (!controls.isActive.value) {\n\t\t\tif (remaining.value > 0) controls.resume();\n\t\t}\n\t};\n\tconst start = (countdown) => {\n\t\treset(countdown);\n\t\tcontrols.resume();\n\t};\n\treturn {\n\t\tremaining,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tpause: controls.pause,\n\t\tresume,\n\t\tisActive: controls.isActive\n\t};\n}\n//#endregion\n//#region useCssSupports/index.ts\nfunction useCssSupports(...args) {\n\tlet options = {};\n\tif (typeof toValue(args.at(-1)) === \"object\") options = args.pop();\n\tconst [prop, value] = args;\n\tconst { window = defaultWindow, ssrValue = false } = options;\n\tconst isMounted = useMounted();\n\treturn { isSupported: computed(() => {\n\t\tif (!isClient || !isMounted.value) return ssrValue;\n\t\treturn args.length === 2 ? window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop), toValue(value)) : window === null || window === void 0 ? void 0 : window.CSS.supports(toValue(prop));\n\t}) };\n}\n//#endregion\n//#region useCssVar/index.ts\n/**\n* Manipulate CSS variables.\n*\n* @see https://vueuse.org/useCssVar\n* @param prop\n* @param target\n* @param options\n*/\nfunction useCssVar(prop, target, options = {}) {\n\tconst { window = defaultWindow, initialValue, observe = false } = options;\n\tconst variable = shallowRef(initialValue);\n\tconst elRef = computed(() => {\n\t\tvar _window$document;\n\t\treturn unrefElement(target) || (window === null || window === void 0 || (_window$document = window.document) === null || _window$document === void 0 ? void 0 : _window$document.documentElement);\n\t});\n\tfunction updateCssVar() {\n\t\tconst key = toValue(prop);\n\t\tconst el = toValue(elRef);\n\t\tif (el && window && key) {\n\t\t\tvar _window$getComputedSt;\n\t\t\tconst value = (_window$getComputedSt = window.getComputedStyle(el).getPropertyValue(key)) === null || _window$getComputedSt === void 0 ? void 0 : _window$getComputedSt.trim();\n\t\t\tvariable.value = value || variable.value || initialValue;\n\t\t}\n\t}\n\tif (observe) useMutationObserver(elRef, updateCssVar, {\n\t\tattributeFilter: [\"style\", \"class\"],\n\t\twindow\n\t});\n\twatch([elRef, () => toValue(prop)], (_, old) => {\n\t\tif (old[0] && old[1]) old[0].style.removeProperty(old[1]);\n\t\tupdateCssVar();\n\t}, { immediate: true });\n\twatch([variable, elRef], ([val, el]) => {\n\t\tconst raw_prop = toValue(prop);\n\t\tif ((el === null || el === void 0 ? void 0 : el.style) && raw_prop) if (val == null) el.style.removeProperty(raw_prop);\n\t\telse el.style.setProperty(raw_prop, val);\n\t}, { immediate: true });\n\treturn variable;\n}\n//#endregion\n//#region useCurrentElement/index.ts\nfunction useCurrentElement(rootComponent) {\n\tconst vm = getCurrentInstance();\n\tconst currentElement = computedWithControl(() => null, () => rootComponent ? unrefElement(rootComponent) : vm.proxy.$el);\n\tonUpdated(currentElement.trigger);\n\tonMounted(currentElement.trigger);\n\treturn currentElement;\n}\n//#endregion\n//#region useCycleList/index.ts\n/**\n* Cycle through a list of items\n*\n* @see https://vueuse.org/useCycleList\n*/\nfunction useCycleList(list, options) {\n\tconst state = shallowRef(getInitialValue());\n\tconst listRef = toRef(list);\n\tconst index = computed({\n\t\tget() {\n\t\t\tvar _options$fallbackInde;\n\t\t\tconst targetList = listRef.value;\n\t\t\tlet index = (options === null || options === void 0 ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, targetList) : targetList.indexOf(state.value);\n\t\t\tif (index < 0) index = (_options$fallbackInde = options === null || options === void 0 ? void 0 : options.fallbackIndex) !== null && _options$fallbackInde !== void 0 ? _options$fallbackInde : 0;\n\t\t\treturn index;\n\t\t},\n\t\tset(v) {\n\t\t\tset(v);\n\t\t}\n\t});\n\tfunction set(i) {\n\t\tconst targetList = listRef.value;\n\t\tconst length = targetList.length;\n\t\tconst value = targetList[(i % length + length) % length];\n\t\tstate.value = value;\n\t\treturn value;\n\t}\n\tfunction shift(delta = 1) {\n\t\treturn set(index.value + delta);\n\t}\n\tfunction next(n = 1) {\n\t\treturn shift(n);\n\t}\n\tfunction prev(n = 1) {\n\t\treturn shift(-n);\n\t}\n\tfunction getInitialValue() {\n\t\tvar _toValue, _options$initialValue;\n\t\treturn (_toValue = toValue((_options$initialValue = options === null || options === void 0 ? void 0 : options.initialValue) !== null && _options$initialValue !== void 0 ? _options$initialValue : toValue(list)[0])) !== null && _toValue !== void 0 ? _toValue : void 0;\n\t}\n\twatch(listRef, () => set(index.value));\n\treturn {\n\t\tstate,\n\t\tindex,\n\t\tnext,\n\t\tprev,\n\t\tgo: set\n\t};\n}\n//#endregion\n//#region useDark/index.ts\n/**\n* Reactive dark mode with auto data persistence.\n*\n* @see https://vueuse.org/useDark\n* @param options\n*/\nfunction useDark(options = {}) {\n\tconst { valueDark = \"dark\", valueLight = \"\" } = options;\n\tconst mode = useColorMode({\n\t\t...options,\n\t\tonChanged: (mode, defaultHandler) => {\n\t\t\tvar _options$onChanged;\n\t\t\tif (options.onChanged) (_options$onChanged = options.onChanged) === null || _options$onChanged === void 0 || _options$onChanged.call(options, mode === \"dark\", defaultHandler, mode);\n\t\t\telse defaultHandler(mode);\n\t\t},\n\t\tmodes: {\n\t\t\tdark: valueDark,\n\t\t\tlight: valueLight\n\t\t}\n\t});\n\tconst system = computed(() => mode.system.value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn mode.value === \"dark\";\n\t\t},\n\t\tset(v) {\n\t\t\tconst modeVal = v ? \"dark\" : \"light\";\n\t\t\tif (system.value === modeVal) mode.value = \"auto\";\n\t\t\telse mode.value = modeVal;\n\t\t}\n\t});\n}\n//#endregion\n//#region useManualRefHistory/index.ts\nfunction fnBypass(v) {\n\treturn v;\n}\nfunction fnSetSource(source, value) {\n\treturn source.value = value;\n}\nfunction defaultDump(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n\treturn clone ? typeof clone === \"function\" ? clone : cloneFnJSON : fnBypass;\n}\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useManualRefHistory\n* @param source\n* @param options\n*/\nfunction useManualRefHistory(source, options = {}) {\n\tconst { clone = false, dump = defaultDump(clone), parse = defaultParse(clone), setSource = fnSetSource } = options;\n\tfunction _createHistoryRecord() {\n\t\treturn markRaw({\n\t\t\tsnapshot: dump(source.value),\n\t\t\ttimestamp: timestamp()\n\t\t});\n\t}\n\tconst last = ref(_createHistoryRecord());\n\tconst undoStack = ref([]);\n\tconst redoStack = ref([]);\n\tconst _setSource = (record) => {\n\t\tsetSource(source, parse(record.snapshot));\n\t\tlast.value = record;\n\t};\n\tconst commit = () => {\n\t\tundoStack.value.unshift(last.value);\n\t\tlast.value = _createHistoryRecord();\n\t\tif (options.capacity && undoStack.value.length > options.capacity) undoStack.value.splice(options.capacity, Number.POSITIVE_INFINITY);\n\t\tif (redoStack.value.length) redoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst clear = () => {\n\t\tundoStack.value.splice(0, undoStack.value.length);\n\t\tredoStack.value.splice(0, redoStack.value.length);\n\t};\n\tconst undo = () => {\n\t\tconst state = undoStack.value.shift();\n\t\tif (state) {\n\t\t\tredoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst redo = () => {\n\t\tconst state = redoStack.value.shift();\n\t\tif (state) {\n\t\t\tundoStack.value.unshift(last.value);\n\t\t\t_setSource(state);\n\t\t}\n\t};\n\tconst reset = () => {\n\t\t_setSource(last.value);\n\t};\n\treturn {\n\t\tsource,\n\t\tundoStack,\n\t\tredoStack,\n\t\tlast,\n\t\thistory: computed(() => [last.value, ...undoStack.value]),\n\t\tcanUndo: computed(() => undoStack.value.length > 0),\n\t\tcanRedo: computed(() => redoStack.value.length > 0),\n\t\tclear,\n\t\tcommit,\n\t\treset,\n\t\tundo,\n\t\tredo\n\t};\n}\n//#endregion\n//#region useRefHistory/index.ts\n/**\n* Track the change history of a ref, also provides undo and redo functionality.\n*\n* @see https://vueuse.org/useRefHistory\n* @param source\n* @param options\n*/\nfunction useRefHistory(source, options = {}) {\n\tconst { deep = false, flush = \"pre\", eventFilter, shouldCommit = () => true } = options;\n\tconst { eventFilter: composedFilter, pause, resume: resumeTracking, isActive: isTracking } = pausableFilter(eventFilter);\n\tlet lastRawValue = source.value;\n\tconst { ignoreUpdates, ignorePrevAsyncUpdates, stop } = watchIgnorable(source, commit, {\n\t\tdeep,\n\t\tflush,\n\t\teventFilter: composedFilter\n\t});\n\tfunction setSource(source, value) {\n\t\tignorePrevAsyncUpdates();\n\t\tignoreUpdates(() => {\n\t\t\tsource.value = value;\n\t\t\tlastRawValue = value;\n\t\t});\n\t}\n\tconst manualHistory = useManualRefHistory(source, {\n\t\t...options,\n\t\tclone: options.clone || deep,\n\t\tsetSource\n\t});\n\tconst { clear, commit: manualCommit } = manualHistory;\n\tfunction commit() {\n\t\tignorePrevAsyncUpdates();\n\t\tif (!shouldCommit(lastRawValue, source.value)) return;\n\t\tlastRawValue = source.value;\n\t\tmanualCommit();\n\t}\n\tfunction resume(commitNow) {\n\t\tresumeTracking();\n\t\tif (commitNow) commit();\n\t}\n\tfunction batch(fn) {\n\t\tlet canceled = false;\n\t\tconst cancel = () => canceled = true;\n\t\tignoreUpdates(() => {\n\t\t\tfn(cancel);\n\t\t});\n\t\tif (!canceled) commit();\n\t}\n\tfunction dispose() {\n\t\tstop();\n\t\tclear();\n\t}\n\treturn {\n\t\t...manualHistory,\n\t\tisTracking,\n\t\tpause,\n\t\tresume,\n\t\tcommit,\n\t\tbatch,\n\t\tdispose\n\t};\n}\n//#endregion\n//#region useDebouncedRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.\n*\n* @see https://vueuse.org/useDebouncedRefHistory\n* @param source\n* @param options\n*/\nfunction useDebouncedRefHistory(source, options = {}) {\n\tconst filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n//#endregion\n//#region useDeviceMotion/index.ts\n/**\n* Reactive DeviceMotionEvent.\n*\n* @see https://vueuse.org/useDeviceMotion\n* @param options\n*/\nfunction useDeviceMotion(options = {}) {\n\tconst { window = defaultWindow, requestPermissions = false, eventFilter = bypassFilter } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof DeviceMotionEvent !== \"undefined\");\n\tconst requirePermissions = /* @__PURE__ */ useSupported(() => isSupported.value && \"requestPermission\" in DeviceMotionEvent && typeof DeviceMotionEvent.requestPermission === \"function\");\n\tconst permissionGranted = shallowRef(false);\n\tconst acceleration = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tconst rotationRate = ref({\n\t\talpha: null,\n\t\tbeta: null,\n\t\tgamma: null\n\t});\n\tconst interval = shallowRef(0);\n\tconst accelerationIncludingGravity = ref({\n\t\tx: null,\n\t\ty: null,\n\t\tz: null\n\t});\n\tfunction init() {\n\t\tif (window) {\n\t\t\tconst onDeviceMotion = createFilterWrapper(eventFilter, (event) => {\n\t\t\t\tvar _event$acceleration, _event$acceleration2, _event$acceleration3, _event$accelerationIn, _event$accelerationIn2, _event$accelerationIn3, _event$rotationRate, _event$rotationRate2, _event$rotationRate3;\n\t\t\t\tacceleration.value = {\n\t\t\t\t\tx: ((_event$acceleration = event.acceleration) === null || _event$acceleration === void 0 ? void 0 : _event$acceleration.x) || null,\n\t\t\t\t\ty: ((_event$acceleration2 = event.acceleration) === null || _event$acceleration2 === void 0 ? void 0 : _event$acceleration2.y) || null,\n\t\t\t\t\tz: ((_event$acceleration3 = event.acceleration) === null || _event$acceleration3 === void 0 ? void 0 : _event$acceleration3.z) || null\n\t\t\t\t};\n\t\t\t\taccelerationIncludingGravity.value = {\n\t\t\t\t\tx: ((_event$accelerationIn = event.accelerationIncludingGravity) === null || _event$accelerationIn === void 0 ? void 0 : _event$accelerationIn.x) || null,\n\t\t\t\t\ty: ((_event$accelerationIn2 = event.accelerationIncludingGravity) === null || _event$accelerationIn2 === void 0 ? void 0 : _event$accelerationIn2.y) || null,\n\t\t\t\t\tz: ((_event$accelerationIn3 = event.accelerationIncludingGravity) === null || _event$accelerationIn3 === void 0 ? void 0 : _event$accelerationIn3.z) || null\n\t\t\t\t};\n\t\t\t\trotationRate.value = {\n\t\t\t\t\talpha: ((_event$rotationRate = event.rotationRate) === null || _event$rotationRate === void 0 ? void 0 : _event$rotationRate.alpha) || null,\n\t\t\t\t\tbeta: ((_event$rotationRate2 = event.rotationRate) === null || _event$rotationRate2 === void 0 ? void 0 : _event$rotationRate2.beta) || null,\n\t\t\t\t\tgamma: ((_event$rotationRate3 = event.rotationRate) === null || _event$rotationRate3 === void 0 ? void 0 : _event$rotationRate3.gamma) || null\n\t\t\t\t};\n\t\t\t\tinterval.value = event.interval;\n\t\t\t});\n\t\t\tuseEventListener(window, \"devicemotion\", onDeviceMotion, { passive: true });\n\t\t}\n\t}\n\tconst ensurePermissions = async () => {\n\t\tif (!requirePermissions.value) permissionGranted.value = true;\n\t\tif (permissionGranted.value) return;\n\t\tif (requirePermissions.value) {\n\t\t\tconst requestPermission = DeviceMotionEvent.requestPermission;\n\t\t\ttry {\n\t\t\t\tif (await requestPermission() === \"granted\") {\n\t\t\t\t\tpermissionGranted.value = true;\n\t\t\t\t\tinit();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t}\n\t};\n\tif (isSupported.value) if (requestPermissions && requirePermissions.value) ensurePermissions().then(() => init());\n\telse init();\n\treturn {\n\t\tacceleration,\n\t\taccelerationIncludingGravity,\n\t\trotationRate,\n\t\tinterval,\n\t\tisSupported,\n\t\trequirePermissions,\n\t\tensurePermissions,\n\t\tpermissionGranted\n\t};\n}\n//#endregion\n//#region useDeviceOrientation/index.ts\n/**\n* Reactive DeviceOrientationEvent.\n*\n* @see https://vueuse.org/useDeviceOrientation\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDeviceOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"DeviceOrientationEvent\" in window);\n\tconst isAbsolute = shallowRef(false);\n\tconst alpha = shallowRef(null);\n\tconst beta = shallowRef(null);\n\tconst gamma = shallowRef(null);\n\tif (window && isSupported.value) useEventListener(window, \"deviceorientation\", (event) => {\n\t\tisAbsolute.value = event.absolute;\n\t\talpha.value = event.alpha;\n\t\tbeta.value = event.beta;\n\t\tgamma.value = event.gamma;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tisAbsolute,\n\t\talpha,\n\t\tbeta,\n\t\tgamma\n\t};\n}\n//#endregion\n//#region useDevicePixelRatio/index.ts\n/**\n* Reactively track `window.devicePixelRatio`.\n*\n* @see https://vueuse.org/useDevicePixelRatio\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDevicePixelRatio(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst pixelRatio = shallowRef(1);\n\tconst query = useMediaQuery(() => `(resolution: ${pixelRatio.value}dppx)`, options);\n\tlet stop = noop;\n\tif (window) stop = watchImmediate(query, () => pixelRatio.value = window.devicePixelRatio);\n\treturn {\n\t\tpixelRatio: shallowReadonly(pixelRatio),\n\t\tstop\n\t};\n}\n//#endregion\n//#region useDevicesList/index.ts\n/**\n* Reactive `enumerateDevices` listing available input/output devices\n*\n* @see https://vueuse.org/useDevicesList\n* @param options\n*/\nfunction useDevicesList(options = {}) {\n\tconst { navigator = defaultNavigator, requestPermissions = false, constraints = {\n\t\taudio: true,\n\t\tvideo: true\n\t}, onUpdated } = options;\n\tconst devices = shallowRef([]);\n\tconst videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n\tconst audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n\tconst audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n\tconst permissionGranted = shallowRef(false);\n\tlet stream;\n\tasync function update() {\n\t\tif (!isSupported.value) return;\n\t\tdevices.value = await navigator.mediaDevices.enumerateDevices();\n\t\tonUpdated === null || onUpdated === void 0 || onUpdated(devices.value);\n\t\tif (stream) {\n\t\t\tstream.getTracks().forEach((t) => t.stop());\n\t\t\tstream = null;\n\t\t}\n\t}\n\tasync function ensurePermissions() {\n\t\tconst deviceName = constraints.video ? \"camera\" : \"microphone\";\n\t\tif (!isSupported.value) return false;\n\t\tif (permissionGranted.value) return true;\n\t\tconst { state, query } = usePermission(deviceName, { controls: true });\n\t\tawait query();\n\t\tif (state.value !== \"granted\") {\n\t\t\tlet granted = true;\n\t\t\ttry {\n\t\t\t\tconst allDevices = await navigator.mediaDevices.enumerateDevices();\n\t\t\t\tconst hasCamera = allDevices.some((device) => device.kind === \"videoinput\");\n\t\t\t\tconst hasMicrophone = allDevices.some((device) => device.kind === \"audioinput\" || device.kind === \"audiooutput\");\n\t\t\t\tconstraints.video = hasCamera ? constraints.video : false;\n\t\t\t\tconstraints.audio = hasMicrophone ? constraints.audio : false;\n\t\t\t\tstream = await navigator.mediaDevices.getUserMedia(constraints);\n\t\t\t} catch (_unused) {\n\t\t\t\tstream = null;\n\t\t\t\tgranted = false;\n\t\t\t}\n\t\t\tupdate();\n\t\t\tpermissionGranted.value = granted;\n\t\t} else permissionGranted.value = true;\n\t\treturn permissionGranted.value;\n\t}\n\tif (isSupported.value) {\n\t\tif (requestPermissions) ensurePermissions();\n\t\tuseEventListener(navigator.mediaDevices, \"devicechange\", update, { passive: true });\n\t\tupdate();\n\t}\n\treturn {\n\t\tdevices,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tvideoInputs,\n\t\taudioInputs,\n\t\taudioOutputs,\n\t\tisSupported\n\t};\n}\n//#endregion\n//#region useDisplayMedia/index.ts\n/**\n* Reactive `mediaDevices.getDisplayMedia` streaming\n*\n* @see https://vueuse.org/useDisplayMedia\n* @param options\n*/\nfunction useDisplayMedia(options = {}) {\n\tvar _options$enabled;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst video = options.video;\n\tconst audio = options.audio;\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getDisplayMedia;\n\t});\n\tconst constraint = {\n\t\taudio,\n\t\tvideo\n\t};\n\tconst stream = shallowRef();\n\tasync function _start() {\n\t\tvar _stream$value;\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => useEventListener(t, \"ended\", stop, { passive: true }));\n\t\treturn stream.value;\n\t}\n\tasync function _stop() {\n\t\tvar _stream$value2;\n\t\t(_stream$value2 = stream.value) === null || _stream$value2 === void 0 || _stream$value2.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\tenabled\n\t};\n}\n//#endregion\n//#region useDocumentVisibility/index.ts\n/**\n* Reactively track `document.visibilityState`.\n*\n* @see https://vueuse.org/useDocumentVisibility\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useDocumentVisibility(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tif (!document) return shallowRef(\"visible\");\n\tconst visibility = shallowRef(document.visibilityState);\n\tuseEventListener(document, \"visibilitychange\", () => {\n\t\tvisibility.value = document.visibilityState;\n\t}, { passive: true });\n\treturn visibility;\n}\n//#endregion\n//#region useDraggable/index.ts\nconst defaultScrollConfig = {\n\tspeed: 2,\n\tmargin: 30,\n\tdirection: \"both\"\n};\nfunction clampContainerScroll(container) {\n\tif (container.scrollLeft > container.scrollWidth - container.clientWidth) container.scrollLeft = Math.max(0, container.scrollWidth - container.clientWidth);\n\tif (container.scrollTop > container.scrollHeight - container.clientHeight) container.scrollTop = Math.max(0, container.scrollHeight - container.clientHeight);\n}\n/**\n* Make elements draggable.\n*\n* @see https://vueuse.org/useDraggable\n* @param target\n* @param options\n*/\nfunction useDraggable(target, options = {}) {\n\tvar _toValue, _toValue2, _toValue3, _scrollConfig$directi;\n\tconst { pointerTypes, preventDefault, stopPropagation, exact, onMove, onEnd, onStart, initialValue, axis = \"both\", draggingElement = defaultWindow, containerElement, handle: draggingHandle = target, buttons = [0], restrictInView, autoScroll = false } = options;\n\tconst position = ref((_toValue = toValue(initialValue)) !== null && _toValue !== void 0 ? _toValue : {\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst pressedDelta = ref();\n\tconst filterEvent = (e) => {\n\t\tif (pointerTypes) return pointerTypes.includes(e.pointerType);\n\t\treturn true;\n\t};\n\tconst handleEvent = (e) => {\n\t\tif (toValue(preventDefault)) e.preventDefault();\n\t\tif (toValue(stopPropagation)) e.stopPropagation();\n\t};\n\tconst scrollConfig = toValue(autoScroll);\n\tconst scrollSettings = typeof scrollConfig === \"object\" ? {\n\t\tspeed: (_toValue2 = toValue(scrollConfig.speed)) !== null && _toValue2 !== void 0 ? _toValue2 : defaultScrollConfig.speed,\n\t\tmargin: (_toValue3 = toValue(scrollConfig.margin)) !== null && _toValue3 !== void 0 ? _toValue3 : defaultScrollConfig.margin,\n\t\tdirection: (_scrollConfig$directi = scrollConfig.direction) !== null && _scrollConfig$directi !== void 0 ? _scrollConfig$directi : defaultScrollConfig.direction\n\t} : defaultScrollConfig;\n\tconst getScrollAxisValues = (value) => typeof value === \"number\" ? [value, value] : [value.x, value.y];\n\tconst handleAutoScroll = (container, targetRect, position) => {\n\t\tconst { clientWidth, clientHeight, scrollLeft, scrollTop, scrollWidth, scrollHeight } = container;\n\t\tconst [marginX, marginY] = getScrollAxisValues(scrollSettings.margin);\n\t\tconst [speedX, speedY] = getScrollAxisValues(scrollSettings.speed);\n\t\tlet deltaX = 0;\n\t\tlet deltaY = 0;\n\t\tif (scrollSettings.direction === \"x\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.x < marginX && scrollLeft > 0) deltaX = -speedX;\n\t\t\telse if (position.x + targetRect.width > clientWidth - marginX && scrollLeft < scrollWidth - clientWidth) deltaX = speedX;\n\t\t}\n\t\tif (scrollSettings.direction === \"y\" || scrollSettings.direction === \"both\") {\n\t\t\tif (position.y < marginY && scrollTop > 0) deltaY = -speedY;\n\t\t\telse if (position.y + targetRect.height > clientHeight - marginY && scrollTop < scrollHeight - clientHeight) deltaY = speedY;\n\t\t}\n\t\tif (deltaX || deltaY) container.scrollBy({\n\t\t\tleft: deltaX,\n\t\t\ttop: deltaY,\n\t\t\tbehavior: \"auto\"\n\t\t});\n\t};\n\tlet autoScrollInterval = null;\n\tconst startAutoScroll = () => {\n\t\tconst container = toValue(containerElement);\n\t\tif (container && !autoScrollInterval) autoScrollInterval = setInterval(() => {\n\t\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\t\tconst { x, y } = position.value;\n\t\t\tconst relativePosition = {\n\t\t\t\tx: x - container.scrollLeft,\n\t\t\t\ty: y - container.scrollTop\n\t\t\t};\n\t\t\tif (relativePosition.x >= 0 && relativePosition.y >= 0) {\n\t\t\t\thandleAutoScroll(container, targetRect, relativePosition);\n\t\t\t\trelativePosition.x += container.scrollLeft;\n\t\t\t\trelativePosition.y += container.scrollTop;\n\t\t\t\tposition.value = relativePosition;\n\t\t\t}\n\t\t}, 1e3 / 60);\n\t};\n\tconst stopAutoScroll = () => {\n\t\tif (autoScrollInterval) {\n\t\t\tclearInterval(autoScrollInterval);\n\t\t\tautoScrollInterval = null;\n\t\t}\n\t};\n\tconst isPointerNearEdge = (pointer, container, margin, targetRect) => {\n\t\tconst [marginX, marginY] = typeof margin === \"number\" ? [margin, margin] : [margin.x, margin.y];\n\t\tconst { clientWidth, clientHeight } = container;\n\t\treturn pointer.x < marginX || pointer.x + targetRect.width > clientWidth - marginX || pointer.y < marginY || pointer.y + targetRect.height > clientHeight - marginY;\n\t};\n\tconst checkAutoScroll = () => {\n\t\tif (toValue(options.disabled) || !pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (!container) return;\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst { x, y } = position.value;\n\t\tconst relativePosition = {\n\t\t\tx: x - container.scrollLeft,\n\t\t\ty: y - container.scrollTop\n\t\t};\n\t\tif (isPointerNearEdge(relativePosition, container, scrollSettings.margin, targetRect)) startAutoScroll();\n\t\telse stopAutoScroll();\n\t};\n\tif (toValue(autoScroll)) watch(position, checkAutoScroll);\n\tconst start = (e) => {\n\t\tvar _container$getBoundin;\n\t\tif (!toValue(buttons).includes(e.button)) return;\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (toValue(exact) && e.target !== toValue(target)) return;\n\t\tconst container = toValue(containerElement);\n\t\tconst containerRect = container === null || container === void 0 || (_container$getBoundin = container.getBoundingClientRect) === null || _container$getBoundin === void 0 ? void 0 : _container$getBoundin.call(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tconst pos = {\n\t\t\tx: e.clientX - (container ? targetRect.left - containerRect.left + (autoScroll ? 0 : container.scrollLeft) : targetRect.left),\n\t\t\ty: e.clientY - (container ? targetRect.top - containerRect.top + (autoScroll ? 0 : container.scrollTop) : targetRect.top)\n\t\t};\n\t\tif ((onStart === null || onStart === void 0 ? void 0 : onStart(pos, e)) === false) return;\n\t\tpressedDelta.value = pos;\n\t\thandleEvent(e);\n\t};\n\tconst move = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tconst container = toValue(containerElement);\n\t\tif (container instanceof HTMLElement) clampContainerScroll(container);\n\t\tconst targetRect = toValue(target).getBoundingClientRect();\n\t\tlet { x, y } = position.value;\n\t\tif (axis === \"x\" || axis === \"both\") {\n\t\t\tx = e.clientX - pressedDelta.value.x;\n\t\t\tif (container) x = Math.min(Math.max(0, x), container.scrollWidth - targetRect.width);\n\t\t}\n\t\tif (axis === \"y\" || axis === \"both\") {\n\t\t\ty = e.clientY - pressedDelta.value.y;\n\t\t\tif (container) y = Math.min(Math.max(0, y), container.scrollHeight - targetRect.height);\n\t\t}\n\t\tif (toValue(autoScroll) && container) {\n\t\t\tif (autoScrollInterval === null) handleAutoScroll(container, targetRect, {\n\t\t\t\tx,\n\t\t\t\ty\n\t\t\t});\n\t\t\tx += container.scrollLeft;\n\t\t\ty += container.scrollTop;\n\t\t}\n\t\tif (container && (restrictInView || autoScroll)) {\n\t\t\tif (axis !== \"y\") {\n\t\t\t\tconst relativeX = x - container.scrollLeft;\n\t\t\t\tif (relativeX < 0) x = container.scrollLeft;\n\t\t\t\telse if (relativeX > container.clientWidth - targetRect.width) x = container.clientWidth - targetRect.width + container.scrollLeft;\n\t\t\t}\n\t\t\tif (axis !== \"x\") {\n\t\t\t\tconst relativeY = y - container.scrollTop;\n\t\t\t\tif (relativeY < 0) y = container.scrollTop;\n\t\t\t\telse if (relativeY > container.clientHeight - targetRect.height) y = container.clientHeight - targetRect.height + container.scrollTop;\n\t\t\t}\n\t\t}\n\t\tposition.value = {\n\t\t\tx,\n\t\t\ty\n\t\t};\n\t\tonMove === null || onMove === void 0 || onMove(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tconst end = (e) => {\n\t\tif (toValue(options.disabled) || !filterEvent(e)) return;\n\t\tif (!pressedDelta.value) return;\n\t\tpressedDelta.value = void 0;\n\t\tif (autoScroll) stopAutoScroll();\n\t\tonEnd === null || onEnd === void 0 || onEnd(position.value, e);\n\t\thandleEvent(e);\n\t};\n\tif (isClient) {\n\t\tconst config = () => {\n\t\t\tvar _options$capture;\n\t\t\treturn {\n\t\t\t\tcapture: (_options$capture = options.capture) !== null && _options$capture !== void 0 ? _options$capture : true,\n\t\t\t\tpassive: !toValue(preventDefault)\n\t\t\t};\n\t\t};\n\t\tuseEventListener(draggingHandle, \"pointerdown\", start, config);\n\t\tuseEventListener(draggingElement, \"pointermove\", move, config);\n\t\tuseEventListener(draggingElement, [\"pointerup\", \"pointercancel\"], end, config);\n\t}\n\treturn {\n\t\t...toRefs(position),\n\t\tposition,\n\t\tisDragging: computed(() => !!pressedDelta.value),\n\t\tstyle: computed(() => `\n left: ${position.value.x}px;\n top: ${position.value.y}px;\n ${autoScroll ? \"text-wrap: nowrap;\" : \"\"}\n `)\n\t};\n}\n//#endregion\n//#region useDropZone/index.ts\nfunction useDropZone(target, options = {}) {\n\tconst isOverDropZone = shallowRef(false);\n\tconst files = shallowRef(null);\n\tlet counter = 0;\n\tlet isValid = true;\n\tif (isClient) {\n\t\tvar _options$multiple, _options$preventDefau;\n\t\tconst _options = typeof options === \"function\" ? { onDrop: options } : options;\n\t\tconst multiple = (_options$multiple = _options.multiple) !== null && _options$multiple !== void 0 ? _options$multiple : true;\n\t\tconst preventDefaultForUnhandled = (_options$preventDefau = _options.preventDefaultForUnhandled) !== null && _options$preventDefau !== void 0 ? _options$preventDefau : false;\n\t\tconst getFiles = (event) => {\n\t\t\tvar _event$dataTransfer$f, _event$dataTransfer;\n\t\t\tconst list = Array.from((_event$dataTransfer$f = (_event$dataTransfer = event.dataTransfer) === null || _event$dataTransfer === void 0 ? void 0 : _event$dataTransfer.files) !== null && _event$dataTransfer$f !== void 0 ? _event$dataTransfer$f : []);\n\t\t\treturn list.length === 0 ? null : multiple ? list : [list[0]];\n\t\t};\n\t\tconst checkDataTypes = (types) => {\n\t\t\tconst dataTypes = unref(_options.dataTypes);\n\t\t\tif (typeof dataTypes === \"function\") return dataTypes(types);\n\t\t\tif (!(dataTypes === null || dataTypes === void 0 ? void 0 : dataTypes.length)) return true;\n\t\t\tif (types.length === 0) return false;\n\t\t\treturn types.every((type) => dataTypes.some((allowedType) => type.includes(allowedType)));\n\t\t};\n\t\tconst checkValidity = (items) => {\n\t\t\tif (_options.checkValidity) return _options.checkValidity(items);\n\t\t\tconst types = Array.from(items !== null && items !== void 0 ? items : []).map((item) => item.type);\n\t\t\tconst dataTypesValid = checkDataTypes(types);\n\t\t\tconst multipleFilesValid = multiple || items.length <= 1;\n\t\t\treturn dataTypesValid && multipleFilesValid;\n\t\t};\n\t\tconst isSafari = () => /^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent) && !(\"chrome\" in window);\n\t\tconst handleDragEvent = (event, eventType) => {\n\t\t\tvar _event$dataTransfer2, _ref;\n\t\t\tconst dataTransferItemList = (_event$dataTransfer2 = event.dataTransfer) === null || _event$dataTransfer2 === void 0 ? void 0 : _event$dataTransfer2.items;\n\t\t\tisValid = (_ref = dataTransferItemList && checkValidity(dataTransferItemList)) !== null && _ref !== void 0 ? _ref : false;\n\t\t\tif (preventDefaultForUnhandled) event.preventDefault();\n\t\t\tif (!isSafari() && !isValid) {\n\t\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"none\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tevent.preventDefault();\n\t\t\tif (event.dataTransfer) event.dataTransfer.dropEffect = \"copy\";\n\t\t\tconst currentFiles = getFiles(event);\n\t\t\tswitch (eventType) {\n\t\t\t\tcase \"enter\":\n\t\t\t\t\tvar _options$onEnter;\n\t\t\t\t\tcounter += 1;\n\t\t\t\t\tisOverDropZone.value = true;\n\t\t\t\t\t(_options$onEnter = _options.onEnter) === null || _options$onEnter === void 0 || _options$onEnter.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"over\":\n\t\t\t\t\tvar _options$onOver;\n\t\t\t\t\t(_options$onOver = _options.onOver) === null || _options$onOver === void 0 || _options$onOver.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"leave\":\n\t\t\t\t\tvar _options$onLeave;\n\t\t\t\t\tcounter -= 1;\n\t\t\t\t\tif (counter === 0) isOverDropZone.value = false;\n\t\t\t\t\t(_options$onLeave = _options.onLeave) === null || _options$onLeave === void 0 || _options$onLeave.call(_options, null, event);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"drop\":\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tisOverDropZone.value = false;\n\t\t\t\t\tif (isValid) {\n\t\t\t\t\t\tvar _options$onDrop;\n\t\t\t\t\t\tfiles.value = currentFiles;\n\t\t\t\t\t\t(_options$onDrop = _options.onDrop) === null || _options$onDrop === void 0 || _options$onDrop.call(_options, currentFiles, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tuseEventListener(target, \"dragenter\", (event) => handleDragEvent(event, \"enter\"));\n\t\tuseEventListener(target, \"dragover\", (event) => handleDragEvent(event, \"over\"));\n\t\tuseEventListener(target, \"dragleave\", (event) => handleDragEvent(event, \"leave\"));\n\t\tuseEventListener(target, \"drop\", (event) => handleDragEvent(event, \"drop\"));\n\t}\n\treturn {\n\t\tfiles,\n\t\tisOverDropZone\n\t};\n}\n//#endregion\n//#region useResizeObserver/index.ts\n/**\n* Reports changes to the dimensions of an Element's content or the border-box\n*\n* @see https://vueuse.org/useResizeObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useResizeObserver(target, callback, options = {}) {\n\tconst { window = defaultWindow, ...observerOptions } = options;\n\tlet observer;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"ResizeObserver\" in window);\n\tconst cleanup = () => {\n\t\tif (observer) {\n\t\t\tobserver.disconnect();\n\t\t\tobserver = void 0;\n\t\t}\n\t};\n\tconst stopWatch = watch(computed(() => {\n\t\tconst _targets = toValue(target);\n\t\treturn Array.isArray(_targets) ? _targets.map((el) => unrefElement(el)) : [unrefElement(_targets)];\n\t}), (els) => {\n\t\tcleanup();\n\t\tif (isSupported.value && window) {\n\t\t\tobserver = new ResizeObserver(callback);\n\t\t\tfor (const _el of els) if (_el) observer.observe(_el, observerOptions);\n\t\t}\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useElementBounding/index.ts\n/**\n* Reactive bounding box of an HTML element.\n*\n* @see https://vueuse.org/useElementBounding\n* @param target\n*/\nfunction useElementBounding(target, options = {}) {\n\tconst { reset = true, windowResize = true, windowScroll = true, immediate = true, updateTiming = \"sync\" } = options;\n\tconst height = shallowRef(0);\n\tconst bottom = shallowRef(0);\n\tconst left = shallowRef(0);\n\tconst right = shallowRef(0);\n\tconst top = shallowRef(0);\n\tconst width = shallowRef(0);\n\tconst x = shallowRef(0);\n\tconst y = shallowRef(0);\n\tfunction recalculate() {\n\t\tconst el = unrefElement(target);\n\t\tif (!el) {\n\t\t\tif (reset) {\n\t\t\t\theight.value = 0;\n\t\t\t\tbottom.value = 0;\n\t\t\t\tleft.value = 0;\n\t\t\t\tright.value = 0;\n\t\t\t\ttop.value = 0;\n\t\t\t\twidth.value = 0;\n\t\t\t\tx.value = 0;\n\t\t\t\ty.value = 0;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tconst rect = el.getBoundingClientRect();\n\t\theight.value = rect.height;\n\t\tbottom.value = rect.bottom;\n\t\tleft.value = rect.left;\n\t\tright.value = rect.right;\n\t\ttop.value = rect.top;\n\t\twidth.value = rect.width;\n\t\tx.value = rect.x;\n\t\ty.value = rect.y;\n\t}\n\tfunction update() {\n\t\tif (updateTiming === \"sync\") recalculate();\n\t\telse if (updateTiming === \"next-frame\") requestAnimationFrame(() => recalculate());\n\t}\n\tuseResizeObserver(target, update);\n\twatch(() => unrefElement(target), (ele) => !ele && update());\n\tuseMutationObserver(target, update, { attributeFilter: [\"style\", \"class\"] });\n\tif (windowScroll) useEventListener(\"scroll\", update, {\n\t\tcapture: true,\n\t\tpassive: true\n\t});\n\tif (windowResize) useEventListener(\"resize\", update, { passive: true });\n\ttryOnMounted(() => {\n\t\tif (immediate) update();\n\t});\n\treturn {\n\t\theight,\n\t\tbottom,\n\t\tleft,\n\t\tright,\n\t\ttop,\n\t\twidth,\n\t\tx,\n\t\ty,\n\t\tupdate\n\t};\n}\n//#endregion\n//#region useElementByPoint/index.ts\nfunction getDefaultScheduler$7(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn useRafFn;\n}\n/**\n* Reactive element by point.\n*\n* @see https://vueuse.org/useElementByPoint\n* @param options - UseElementByPointOptions\n*/\nfunction useElementByPoint(options) {\n\tconst { x, y, document = defaultDocument, multiple, scheduler = getDefaultScheduler$7(options) } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (toValue(multiple)) return document && \"elementsFromPoint\" in document;\n\t\treturn document && \"elementFromPoint\" in document;\n\t});\n\tconst element = shallowRef(null);\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\t...scheduler(() => {\n\t\t\tvar _document$elementsFro, _document$elementFrom;\n\t\t\telement.value = toValue(multiple) ? (_document$elementsFro = document === null || document === void 0 ? void 0 : document.elementsFromPoint(toValue(x), toValue(y))) !== null && _document$elementsFro !== void 0 ? _document$elementsFro : [] : (_document$elementFrom = document === null || document === void 0 ? void 0 : document.elementFromPoint(toValue(x), toValue(y))) !== null && _document$elementFrom !== void 0 ? _document$elementFrom : null;\n\t\t})\n\t};\n}\n//#endregion\n//#region useElementHover/index.ts\nfunction useElementHover(el, options = {}) {\n\tconst { delayEnter = 0, delayLeave = 0, triggerOnRemoval = false, window = defaultWindow } = options;\n\tconst isHovered = shallowRef(false);\n\tlet timer;\n\tconst toggle = (entering) => {\n\t\tconst delay = entering ? delayEnter : delayLeave;\n\t\tif (timer) {\n\t\t\tclearTimeout(timer);\n\t\t\ttimer = void 0;\n\t\t}\n\t\tif (delay) timer = setTimeout(() => isHovered.value = entering, delay);\n\t\telse isHovered.value = entering;\n\t};\n\tif (!window) return isHovered;\n\tuseEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n\tuseEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n\tif (triggerOnRemoval) onElementRemoval(computed(() => unrefElement(el)), () => toggle(false));\n\treturn isHovered;\n}\n//#endregion\n//#region useElementOverflow/index.ts\n/**\n* react a dom's overflow state\n* @see https://vueuse.org/useElementOverflow\n* @param target\n* @param option\n*/\nfunction useElementOverflow(target, option = {}) {\n\tconst { observeMutation = false, onUpdated, window = defaultWindow } = option;\n\tconst isXOverflowed = shallowRef(false);\n\tconst isYOverflowed = shallowRef(false);\n\tfunction update(htmlEl) {\n\t\tisXOverflowed.value = htmlEl.scrollWidth > htmlEl.offsetWidth;\n\t\tisYOverflowed.value = htmlEl.scrollHeight > htmlEl.offsetHeight;\n\t}\n\tconst onResizeUpdated = onUpdated;\n\tconst targetEl = computed(() => {\n\t\tconst el = unrefElement(target);\n\t\tif (!el || el instanceof SVGElement) return void 0;\n\t\treturn el;\n\t});\n\tconst targets = () => {\n\t\tconst el = targetEl.value;\n\t\tif (!el || el instanceof SVGElement) return [];\n\t\treturn [el, ...Array.from(el.children).filter((i) => i instanceof HTMLElement)];\n\t};\n\tuseResizeObserver(targets, (entries, observer) => {\n\t\tconst el = targetEl.value;\n\t\tif (el) update(el);\n\t\tonResizeUpdated === null || onResizeUpdated === void 0 || onResizeUpdated(entries, observer);\n\t}, { window });\n\tif (observeMutation) {\n\t\tconst onMutationUpdated = onUpdated;\n\t\tuseMutationObserver(targets, (entries, observer) => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el) update(el);\n\t\t\tonMutationUpdated === null || onMutationUpdated === void 0 || onMutationUpdated(entries, observer);\n\t\t}, {\n\t\t\twindow,\n\t\t\t...typeof observeMutation === \"object\" ? observeMutation : {\n\t\t\t\tchildList: true,\n\t\t\t\tsubtree: true,\n\t\t\t\tcharacterData: true\n\t\t\t}\n\t\t});\n\t}\n\treturn {\n\t\tisXOverflowed: shallowReadonly(isXOverflowed),\n\t\tisYOverflowed: shallowReadonly(isYOverflowed),\n\t\tstop,\n\t\tupdate: () => {\n\t\t\tconst el = targetEl.value;\n\t\t\tif (el && window) update(el);\n\t\t}\n\t};\n}\n//#endregion\n//#region useElementSize/index.ts\n/**\n* Reactive size of an HTML element.\n*\n* @see https://vueuse.org/useElementSize\n*/\nfunction useElementSize(target, initialSize = {\n\twidth: 0,\n\theight: 0\n}, options = {}) {\n\tconst { window = defaultWindow, box = \"content-box\" } = options;\n\tconst isSVG = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) === null || _unrefElement === void 0 || (_unrefElement = _unrefElement.namespaceURI) === null || _unrefElement === void 0 ? void 0 : _unrefElement.includes(\"svg\");\n\t});\n\tconst width = shallowRef(initialSize.width);\n\tconst height = shallowRef(initialSize.height);\n\tconst { stop: stop1 } = useResizeObserver(target, ([entry]) => {\n\t\tconst boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n\t\tif (window && isSVG.value) {\n\t\t\tconst $elem = unrefElement(target);\n\t\t\tif ($elem) {\n\t\t\t\tconst rect = $elem.getBoundingClientRect();\n\t\t\t\twidth.value = rect.width;\n\t\t\t\theight.value = rect.height;\n\t\t\t}\n\t\t} else if (boxSize) {\n\t\t\tconst formatBoxSize = toArray(boxSize);\n\t\t\twidth.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n\t\t\theight.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n\t\t} else {\n\t\t\twidth.value = entry.contentRect.width;\n\t\t\theight.value = entry.contentRect.height;\n\t\t}\n\t}, options);\n\ttryOnMounted(() => {\n\t\tconst ele = unrefElement(target);\n\t\tif (ele && \"offsetWidth\" in ele) if (box === \"content-box\" && window) {\n\t\t\tconst cs = window.getComputedStyle(ele);\n\t\t\tconst padX = Number.parseFloat(cs.paddingLeft) + Number.parseFloat(cs.paddingRight);\n\t\t\tconst padY = Number.parseFloat(cs.paddingTop) + Number.parseFloat(cs.paddingBottom);\n\t\t\tconst bdX = Number.parseFloat(cs.borderLeftWidth) + Number.parseFloat(cs.borderRightWidth);\n\t\t\tconst bdY = Number.parseFloat(cs.borderTopWidth) + Number.parseFloat(cs.borderBottomWidth);\n\t\t\twidth.value = ele.offsetWidth - padX - bdX;\n\t\t\theight.value = ele.offsetHeight - padY - bdY;\n\t\t} else {\n\t\t\twidth.value = ele.offsetWidth;\n\t\t\theight.value = ele.offsetHeight;\n\t\t}\n\t\telse if (ele) {\n\t\t\twidth.value = initialSize.width;\n\t\t\theight.value = initialSize.height;\n\t\t}\n\t});\n\tconst stop2 = watch(() => unrefElement(target), (ele) => {\n\t\twidth.value = ele ? initialSize.width : 0;\n\t\theight.value = ele ? initialSize.height : 0;\n\t});\n\tfunction stop() {\n\t\tstop1();\n\t\tstop2();\n\t}\n\treturn {\n\t\twidth,\n\t\theight,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useIntersectionObserver/index.ts\n/**\n* Detects changes to a target element's visibility.\n*\n* @see https://vueuse.org/useIntersectionObserver\n* @param target\n* @param callback\n* @param options\n*/\nfunction useIntersectionObserver(target, callback, options = {}) {\n\tconst { root, rootMargin, threshold = 0, window = defaultWindow, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"IntersectionObserver\" in window);\n\tconst targets = computed(() => {\n\t\treturn toArray(toValue(target)).map(unrefElement).filter(notNullish);\n\t});\n\tlet cleanup = noop;\n\tconst isActive = shallowRef(immediate);\n\tconst stopWatch = isSupported.value ? watch(() => [\n\t\ttargets.value,\n\t\tunrefElement(root),\n\t\ttoValue(rootMargin),\n\t\tisActive.value\n\t], ([targets, root, rootMargin]) => {\n\t\tcleanup();\n\t\tif (!isActive.value) return;\n\t\tif (!targets.length) return;\n\t\tconst observer = new IntersectionObserver(callback, {\n\t\t\troot: unrefElement(root),\n\t\t\trootMargin,\n\t\t\tthreshold\n\t\t});\n\t\ttargets.forEach((el) => el && observer.observe(el));\n\t\tcleanup = () => {\n\t\t\tobserver.disconnect();\n\t\t\tcleanup = noop;\n\t\t};\n\t}, {\n\t\timmediate,\n\t\tflush: \"post\"\n\t}) : noop;\n\tconst stop = () => {\n\t\tcleanup();\n\t\tstopWatch();\n\t\tisActive.value = false;\n\t};\n\ttryOnScopeDispose(stop);\n\treturn {\n\t\tisSupported,\n\t\tisActive,\n\t\tpause() {\n\t\t\tcleanup();\n\t\t\tisActive.value = false;\n\t\t},\n\t\tresume() {\n\t\t\tisActive.value = true;\n\t\t},\n\t\tstop\n\t};\n}\n//#endregion\n//#region useElementVisibility/index.ts\nfunction useElementVisibility(element, options = {}) {\n\tconst { window = defaultWindow, scrollTarget, threshold = 0, rootMargin, once = false, initialValue = false } = options;\n\tconst isVisible = shallowRef(initialValue);\n\tconst observerController = useIntersectionObserver(element, (intersectionObserverEntries) => {\n\t\tlet isIntersecting = isVisible.value;\n\t\tlet latestTime = 0;\n\t\tfor (const entry of intersectionObserverEntries) if (entry.time >= latestTime) {\n\t\t\tlatestTime = entry.time;\n\t\t\tisIntersecting = entry.isIntersecting;\n\t\t}\n\t\tisVisible.value = isIntersecting;\n\t\tif (once) watchOnce(isVisible, () => {\n\t\t\tobserverController.stop();\n\t\t});\n\t}, {\n\t\troot: scrollTarget,\n\t\twindow,\n\t\tthreshold,\n\t\trootMargin\n\t});\n\treturn options.controls ? {\n\t\t...observerController,\n\t\tisVisible\n\t} : isVisible;\n}\n//#endregion\n//#region useEventBus/internal.ts\nconst events = /* @__PURE__ */ new Map();\n//#endregion\n//#region useEventBus/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useEventBus(key) {\n\tfunction on(listener) {\n\t\tconst listeners = events.get(key) || /* @__PURE__ */ new Set();\n\t\tlisteners.add(listener);\n\t\tevents.set(key, listeners);\n\t\tconst _off = () => off(listener);\n\t\ttryOnScopeDispose(_off);\n\t\treturn _off;\n\t}\n\tfunction once(listener) {\n\t\tfunction _listener(...args) {\n\t\t\toff(_listener);\n\t\t\tlistener(...args);\n\t\t}\n\t\treturn on(_listener);\n\t}\n\tfunction off(listener) {\n\t\tconst listeners = events.get(key);\n\t\tif (!listeners) return;\n\t\tlisteners.delete(listener);\n\t\tif (!listeners.size) reset();\n\t}\n\tfunction reset() {\n\t\tevents.delete(key);\n\t}\n\tfunction emit(event, payload) {\n\t\tvar _events$get;\n\t\t(_events$get = events.get(key)) === null || _events$get === void 0 || _events$get.forEach((v) => v(event, payload));\n\t}\n\treturn {\n\t\ton,\n\t\tonce,\n\t\toff,\n\t\temit,\n\t\treset\n\t};\n}\n//#endregion\n//#region useEventSource/index.ts\nfunction resolveNestedOptions$1(options) {\n\tif (options === true) return {};\n\treturn options;\n}\n/**\n* Reactive wrapper for EventSource.\n*\n* @see https://vueuse.org/useEventSource\n* @see https://developer.mozilla.org/en-US/docs/Web/API/EventSource/EventSource EventSource\n* @param url\n* @param events\n* @param options\n*/\nfunction useEventSource(url, events = [], options = {}) {\n\tconst event = shallowRef(null);\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CONNECTING\");\n\tconst eventSource = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst urlRef = toRef(url);\n\tconst lastEventId = shallowRef(null);\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tconst { withCredentials = false, immediate = true, autoConnect = true, autoReconnect, serializer = { read: (v) => v } } = options;\n\tconst close = () => {\n\t\tif (isClient && eventSource.value) {\n\t\t\teventSource.value.close();\n\t\t\teventSource.value = null;\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\texplicitlyClosed = true;\n\t\t}\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst es = new EventSource(urlRef.value, { withCredentials });\n\t\tstatus.value = \"CONNECTING\";\n\t\teventSource.value = es;\n\t\tes.onopen = () => {\n\t\t\tstatus.value = \"OPEN\";\n\t\t\terror.value = null;\n\t\t};\n\t\tes.onerror = (e) => {\n\t\t\tstatus.value = \"CLOSED\";\n\t\t\terror.value = e;\n\t\t\tif (es.readyState === 2 && !explicitlyClosed && autoReconnect) {\n\t\t\t\tes.close();\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions$1(autoReconnect);\n\t\t\t\tretried += 1;\n\t\t\t\tif (typeof retries === \"number\" && (retries < 0 || retried < retries)) setTimeout(_init, delay);\n\t\t\t\telse if (typeof retries === \"function\" && retries()) setTimeout(_init, delay);\n\t\t\t\telse onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tes.onmessage = (e) => {\n\t\t\tvar _serializer$read;\n\t\t\tevent.value = null;\n\t\t\tdata.value = (_serializer$read = serializer.read(e.data)) !== null && _serializer$read !== void 0 ? _serializer$read : null;\n\t\t\tlastEventId.value = e.lastEventId;\n\t\t};\n\t\tfor (const event_name of events) useEventListener(es, event_name, (e) => {\n\t\t\tvar _serializer$read2, _e$lastEventId;\n\t\t\tevent.value = event_name;\n\t\t\tdata.value = (_serializer$read2 = serializer.read(e.data)) !== null && _serializer$read2 !== void 0 ? _serializer$read2 : null;\n\t\t\tlastEventId.value = (_e$lastEventId = e.lastEventId) !== null && _e$lastEventId !== void 0 ? _e$lastEventId : null;\n\t\t}, { passive: true });\n\t};\n\tconst open = () => {\n\t\tif (!isClient) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\ttryOnScopeDispose(close);\n\treturn {\n\t\teventSource,\n\t\tevent,\n\t\tdata,\n\t\tstatus,\n\t\terror,\n\t\topen,\n\t\tclose,\n\t\tlastEventId\n\t};\n}\n//#endregion\n//#region useEyeDropper/index.ts\n/**\n* Reactive [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper_API)\n*\n* @see https://vueuse.org/useEyeDropper\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useEyeDropper(options = {}) {\n\tconst { initialValue = \"\" } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n\tconst sRGBHex = shallowRef(initialValue);\n\tasync function open(openOptions) {\n\t\tif (!isSupported.value) return;\n\t\tconst result = await new window.EyeDropper().open(openOptions);\n\t\tsRGBHex.value = result.sRGBHex;\n\t\treturn result;\n\t}\n\treturn {\n\t\tisSupported,\n\t\tsRGBHex,\n\t\topen\n\t};\n}\n//#endregion\n//#region useFavicon/index.ts\nfunction useFavicon(newIcon = null, options = {}) {\n\tconst { baseUrl = \"\", rel = \"icon\", document = defaultDocument } = options;\n\tconst favicon = toRef(newIcon);\n\tconst applyIcon = (icon) => {\n\t\tconst elements = document === null || document === void 0 ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`);\n\t\tif (!elements || elements.length === 0) {\n\t\t\tconst link = document === null || document === void 0 ? void 0 : document.createElement(\"link\");\n\t\t\tif (link) {\n\t\t\t\tlink.rel = rel;\n\t\t\t\tlink.href = `${baseUrl}${icon}`;\n\t\t\t\tlink.type = `image/${icon.split(\".\").pop()}`;\n\t\t\t\tdocument === null || document === void 0 || document.head.append(link);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\telements === null || elements === void 0 || elements.forEach((el) => el.href = `${baseUrl}${icon}`);\n\t};\n\twatch(favicon, (i, o) => {\n\t\tif (typeof i === \"string\" && i !== o) applyIcon(i);\n\t}, { immediate: true });\n\treturn favicon;\n}\n//#endregion\n//#region useFetch/index.ts\nconst payloadMapping = {\n\tjson: \"application/json\",\n\ttext: \"text/plain\"\n};\n/**\n* !!!IMPORTANT!!!\n*\n* If you update the UseFetchOptions interface, be sure to update this object\n* to include the new options\n*/\nfunction isFetchOptions(obj) {\n\treturn obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\", \"updateDataOnError\");\n}\nconst reAbsolute = /^(?:[a-z][a-z\\d+\\-.]*:)?\\/\\//i;\nfunction isAbsoluteURL(url) {\n\treturn reAbsolute.test(url);\n}\nfunction headersToObject(headers) {\n\tif (typeof Headers !== \"undefined\" && headers instanceof Headers) return Object.fromEntries(headers.entries());\n\treturn headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n\tif (combination === \"overwrite\") return async (ctx) => {\n\t\tlet callback;\n\t\tfor (let i = callbacks.length - 1; i >= 0; i--) if (callbacks[i] != null) {\n\t\t\tcallback = callbacks[i];\n\t\t\tbreak;\n\t\t}\n\t\tif (callback) return {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n\telse return async (ctx) => {\n\t\tfor (const callback of callbacks) if (callback) ctx = {\n\t\t\t...ctx,\n\t\t\t...await callback(ctx)\n\t\t};\n\t\treturn ctx;\n\t};\n}\nfunction createFetch(config = {}) {\n\tconst _combination = config.combination || \"chain\";\n\tconst _options = config.options || {};\n\tconst _fetchOptions = config.fetchOptions || {};\n\tfunction useFactoryFetch(url, ...args) {\n\t\tconst computedUrl = computed(() => {\n\t\t\tconst baseUrl = toValue(config.baseUrl);\n\t\t\tconst targetUrl = toValue(url);\n\t\t\treturn baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n\t\t});\n\t\tlet options = _options;\n\t\tlet fetchOptions = _fetchOptions;\n\t\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t\t...options,\n\t\t\t...args[0],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n\t\t};\n\t\telse fetchOptions = {\n\t\t\t...fetchOptions,\n\t\t\t...args[0],\n\t\t\theaders: {\n\t\t\t\t...headersToObject(fetchOptions.headers) || {},\n\t\t\t\t...headersToObject(args[0].headers) || {}\n\t\t\t}\n\t\t};\n\t\tif (args.length > 1 && isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1],\n\t\t\tbeforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n\t\t\tafterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n\t\t\tonFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n\t\t};\n\t\treturn useFetch(computedUrl, fetchOptions, options);\n\t}\n\treturn useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n\tvar _defaultWindow$fetch, _globalThis;\n\tconst supportsAbort = typeof AbortController === \"function\";\n\tlet fetchOptions = {};\n\tlet options = {\n\t\timmediate: true,\n\t\trefetch: false,\n\t\ttimeout: 0,\n\t\tupdateDataOnError: false\n\t};\n\tconst config = {\n\t\tmethod: \"GET\",\n\t\ttype: \"text\",\n\t\tpayload: void 0\n\t};\n\tif (args.length > 0) if (isFetchOptions(args[0])) options = {\n\t\t...options,\n\t\t...args[0]\n\t};\n\telse fetchOptions = args[0];\n\tif (args.length > 1) {\n\t\tif (isFetchOptions(args[1])) options = {\n\t\t\t...options,\n\t\t\t...args[1]\n\t\t};\n\t}\n\tconst { fetch = (_defaultWindow$fetch = defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.fetch) !== null && _defaultWindow$fetch !== void 0 ? _defaultWindow$fetch : (_globalThis = globalThis) === null || _globalThis === void 0 ? void 0 : _globalThis.fetch, initialData, timeout } = options;\n\tconst responseEvent = createEventHook();\n\tconst errorEvent = createEventHook();\n\tconst finallyEvent = createEventHook();\n\tconst isFinished = shallowRef(false);\n\tconst isFetching = shallowRef(false);\n\tconst aborted = shallowRef(false);\n\tconst statusCode = shallowRef(null);\n\tconst response = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst data = shallowRef(initialData || null);\n\tconst canAbort = computed(() => supportsAbort && isFetching.value);\n\tlet controller;\n\tlet timer;\n\tconst abort = (reason) => {\n\t\tif (supportsAbort) {\n\t\t\tcontroller === null || controller === void 0 || controller.abort(reason);\n\t\t\tcontroller = new AbortController();\n\t\t\tcontroller.signal.onabort = () => aborted.value = true;\n\t\t\tfetchOptions = {\n\t\t\t\t...fetchOptions,\n\t\t\t\tsignal: controller.signal\n\t\t\t};\n\t\t}\n\t};\n\tconst loading = (isLoading) => {\n\t\tisFetching.value = isLoading;\n\t\tisFinished.value = !isLoading;\n\t};\n\tif (timeout) timer = useTimeoutFn(abort, timeout, { immediate: false });\n\tlet executeCounter = 0;\n\tconst execute = async (throwOnFailed = false) => {\n\t\tvar _context$options;\n\t\tabort();\n\t\tloading(true);\n\t\terror.value = null;\n\t\tstatusCode.value = null;\n\t\taborted.value = false;\n\t\texecuteCounter += 1;\n\t\tconst currentExecuteCounter = executeCounter;\n\t\tconst defaultFetchOptions = {\n\t\t\tmethod: config.method,\n\t\t\theaders: {}\n\t\t};\n\t\tconst payload = toValue(config.payload);\n\t\tif (payload) {\n\t\t\tvar _payloadMapping$confi;\n\t\t\tconst headers = headersToObject(defaultFetchOptions.headers);\n\t\t\tconst proto = Object.getPrototypeOf(payload);\n\t\t\tif (!config.payloadType && payload && (proto === Object.prototype || Array.isArray(proto)) && !(payload instanceof FormData)) config.payloadType = \"json\";\n\t\t\tif (config.payloadType) headers[\"Content-Type\"] = (_payloadMapping$confi = payloadMapping[config.payloadType]) !== null && _payloadMapping$confi !== void 0 ? _payloadMapping$confi : config.payloadType;\n\t\t\tdefaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n\t\t}\n\t\tlet isCanceled = false;\n\t\tconst context = {\n\t\t\turl: toValue(url),\n\t\t\toptions: {\n\t\t\t\t...defaultFetchOptions,\n\t\t\t\t...fetchOptions\n\t\t\t},\n\t\t\tcancel: () => {\n\t\t\t\tisCanceled = true;\n\t\t\t}\n\t\t};\n\t\tif (options.beforeFetch) Object.assign(context, await options.beforeFetch(context));\n\t\tif (isCanceled || !fetch) {\n\t\t\tloading(false);\n\t\t\treturn Promise.resolve(null);\n\t\t}\n\t\tlet responseData = null;\n\t\tif (timer) timer.start();\n\t\treturn fetch(context.url, {\n\t\t\t...defaultFetchOptions,\n\t\t\t...context.options,\n\t\t\theaders: {\n\t\t\t\t...headersToObject(defaultFetchOptions.headers),\n\t\t\t\t...headersToObject((_context$options = context.options) === null || _context$options === void 0 ? void 0 : _context$options.headers)\n\t\t\t}\n\t\t}).then(async (fetchResponse) => {\n\t\t\tresponse.value = fetchResponse;\n\t\t\tstatusCode.value = fetchResponse.status;\n\t\t\tresponseData = await fetchResponse.clone()[config.type]();\n\t\t\tif (!fetchResponse.ok) {\n\t\t\t\tdata.value = initialData || null;\n\t\t\t\tthrow new Error(fetchResponse.statusText);\n\t\t\t}\n\t\t\tif (options.afterFetch) ({data: responseData} = await options.afterFetch({\n\t\t\t\tdata: responseData,\n\t\t\t\tresponse: fetchResponse,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tdata.value = responseData;\n\t\t\tresponseEvent.trigger(fetchResponse);\n\t\t\treturn fetchResponse;\n\t\t}).catch(async (fetchError) => {\n\t\t\tlet errorData = fetchError.message || fetchError.name;\n\t\t\tif (options.onFetchError) ({error: errorData, data: responseData} = await options.onFetchError({\n\t\t\t\tdata: responseData,\n\t\t\t\terror: fetchError,\n\t\t\t\tresponse: response.value,\n\t\t\t\tcontext,\n\t\t\t\texecute\n\t\t\t}));\n\t\t\tif (currentExecuteCounter === executeCounter) {\n\t\t\t\terror.value = errorData;\n\t\t\t\tif (options.updateDataOnError) data.value = responseData;\n\t\t\t}\n\t\t\terrorEvent.trigger(fetchError);\n\t\t\tif (throwOnFailed) throw fetchError;\n\t\t\treturn null;\n\t\t}).finally(() => {\n\t\t\tif (currentExecuteCounter === executeCounter) loading(false);\n\t\t\tif (timer) timer.stop();\n\t\t\tfinallyEvent.trigger(null);\n\t\t});\n\t};\n\tconst refetch = toRef(options.refetch);\n\twatch([refetch, toRef(url)], ([refetch]) => refetch && execute(), { deep: true });\n\tconst shell = {\n\t\tisFinished: shallowReadonly(isFinished),\n\t\tisFetching: shallowReadonly(isFetching),\n\t\tstatusCode,\n\t\tresponse,\n\t\terror,\n\t\tdata,\n\t\tcanAbort,\n\t\taborted,\n\t\tabort,\n\t\texecute,\n\t\tonFetchResponse: responseEvent.on,\n\t\tonFetchError: errorEvent.on,\n\t\tonFetchFinally: finallyEvent.on,\n\t\tget: setMethod(\"GET\"),\n\t\tput: setMethod(\"PUT\"),\n\t\tpost: setMethod(\"POST\"),\n\t\tdelete: setMethod(\"DELETE\"),\n\t\tpatch: setMethod(\"PATCH\"),\n\t\thead: setMethod(\"HEAD\"),\n\t\toptions: setMethod(\"OPTIONS\"),\n\t\tjson: setType(\"json\"),\n\t\ttext: setType(\"text\"),\n\t\tblob: setType(\"blob\"),\n\t\tarrayBuffer: setType(\"arrayBuffer\"),\n\t\tformData: setType(\"formData\")\n\t};\n\tfunction setMethod(method) {\n\t\treturn (payload, payloadType) => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.method = method;\n\t\t\t\tconfig.payload = payload;\n\t\t\t\tconfig.payloadType = payloadType;\n\t\t\t\tif (isRef(config.payload)) watch([refetch, toRef(config.payload)], ([refetch]) => refetch && execute(), { deep: true });\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tfunction waitUntilFinished() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tuntil(isFinished).toBe(true).then(() => resolve(shell)).catch(reject);\n\t\t});\n\t}\n\tfunction setType(type) {\n\t\treturn () => {\n\t\t\tif (!isFetching.value) {\n\t\t\t\tconfig.type = type;\n\t\t\t\treturn {\n\t\t\t\t\t...shell,\n\t\t\t\t\tthen(onFulfilled, onRejected) {\n\t\t\t\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t};\n\t}\n\tif (options.immediate) Promise.resolve().then(() => execute());\n\treturn {\n\t\t...shell,\n\t\tthen(onFulfilled, onRejected) {\n\t\t\treturn waitUntilFinished().then(onFulfilled, onRejected);\n\t\t}\n\t};\n}\nfunction joinPaths(start, end) {\n\tif (!start.endsWith(\"/\") && !end.startsWith(\"/\")) return `${start}/${end}`;\n\tif (start.endsWith(\"/\") && end.startsWith(\"/\")) return `${start.slice(0, -1)}${end}`;\n\treturn `${start}${end}`;\n}\n//#endregion\n//#region useFileDialog/index.ts\nconst DEFAULT_OPTIONS = {\n\tmultiple: true,\n\taccept: \"*\",\n\treset: false,\n\tdirectory: false\n};\nfunction prepareInitialFiles(files) {\n\tif (!files) return null;\n\tif (files instanceof FileList) return files;\n\tconst dt = new DataTransfer();\n\tfor (const file of files) dt.items.add(file);\n\treturn dt.files;\n}\n/**\n* Open file dialog with ease.\n*\n* @see https://vueuse.org/useFileDialog\n* @param options\n*/\nfunction useFileDialog(options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst files = ref(prepareInitialFiles(options.initialFiles));\n\tconst { on: onChange, trigger: changeTrigger } = createEventHook();\n\tconst { on: onCancel, trigger: cancelTrigger } = createEventHook();\n\tconst inputRef = computed(() => {\n\t\tvar _unrefElement;\n\t\tconst input = (_unrefElement = unrefElement(options.input)) !== null && _unrefElement !== void 0 ? _unrefElement : document ? document.createElement(\"input\") : void 0;\n\t\tif (input) {\n\t\t\tinput.type = \"file\";\n\t\t\tinput.onchange = (event) => {\n\t\t\t\tconst result = event.target;\n\t\t\t\tfiles.value = result.files;\n\t\t\t\tchangeTrigger(files.value);\n\t\t\t};\n\t\t\tinput.oncancel = () => {\n\t\t\t\tcancelTrigger();\n\t\t\t};\n\t\t}\n\t\treturn input;\n\t});\n\tconst reset = () => {\n\t\tfiles.value = null;\n\t\tif (inputRef.value && inputRef.value.value) {\n\t\t\tinputRef.value.value = \"\";\n\t\t\tchangeTrigger(null);\n\t\t}\n\t};\n\tconst applyOptions = (options) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tel.multiple = toValue(options.multiple);\n\t\tel.accept = toValue(options.accept);\n\t\tel.webkitdirectory = toValue(options.directory);\n\t\tif (hasOwn(options, \"capture\")) el.capture = toValue(options.capture);\n\t};\n\tconst open = (localOptions) => {\n\t\tconst el = inputRef.value;\n\t\tif (!el) return;\n\t\tconst mergedOptions = {\n\t\t\t...DEFAULT_OPTIONS,\n\t\t\t...options,\n\t\t\t...localOptions\n\t\t};\n\t\tapplyOptions(mergedOptions);\n\t\tif (toValue(mergedOptions.reset)) reset();\n\t\tel.click();\n\t};\n\twatchEffect(() => {\n\t\tapplyOptions(options);\n\t});\n\treturn {\n\t\tfiles: readonly(files),\n\t\topen,\n\t\treset,\n\t\tonCancel,\n\t\tonChange\n\t};\n}\n//#endregion\n//#region useFileSystemAccess/index.ts\nfunction useFileSystemAccess(options = {}) {\n\tconst { window: _window = defaultWindow, dataType = \"Text\" } = options;\n\tconst window = _window;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n\tconst fileHandle = shallowRef();\n\tconst data = shallowRef();\n\tconst file = shallowRef();\n\tconst fileName = computed(() => {\n\t\tvar _file$value$name, _file$value;\n\t\treturn (_file$value$name = (_file$value = file.value) === null || _file$value === void 0 ? void 0 : _file$value.name) !== null && _file$value$name !== void 0 ? _file$value$name : \"\";\n\t});\n\tconst fileMIME = computed(() => {\n\t\tvar _file$value$type, _file$value2;\n\t\treturn (_file$value$type = (_file$value2 = file.value) === null || _file$value2 === void 0 ? void 0 : _file$value2.type) !== null && _file$value$type !== void 0 ? _file$value$type : \"\";\n\t});\n\tconst fileSize = computed(() => {\n\t\tvar _file$value$size, _file$value3;\n\t\treturn (_file$value$size = (_file$value3 = file.value) === null || _file$value3 === void 0 ? void 0 : _file$value3.size) !== null && _file$value$size !== void 0 ? _file$value$size : 0;\n\t});\n\tconst fileLastModified = computed(() => {\n\t\tvar _file$value$lastModif, _file$value4;\n\t\treturn (_file$value$lastModif = (_file$value4 = file.value) === null || _file$value4 === void 0 ? void 0 : _file$value4.lastModified) !== null && _file$value$lastModif !== void 0 ? _file$value$lastModif : 0;\n\t});\n\tasync function open(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tconst [handle] = await window.showOpenFilePicker({\n\t\t\t...toValue(options),\n\t\t\t..._options\n\t\t});\n\t\tfileHandle.value = handle;\n\t\tawait updateData();\n\t}\n\tasync function create(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tdata.value = void 0;\n\t\tawait updateData();\n\t}\n\tasync function save(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tif (!fileHandle.value) return saveAs(_options);\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function saveAs(_options = {}) {\n\t\tif (!isSupported.value) return;\n\t\tfileHandle.value = await window.showSaveFilePicker({\n\t\t\t...options,\n\t\t\t..._options\n\t\t});\n\t\tif (data.value) {\n\t\t\tconst writableStream = await fileHandle.value.createWritable();\n\t\t\tawait writableStream.write(data.value);\n\t\t\tawait writableStream.close();\n\t\t}\n\t\tawait updateFile();\n\t}\n\tasync function updateFile() {\n\t\tvar _fileHandle$value;\n\t\tfile.value = await ((_fileHandle$value = fileHandle.value) === null || _fileHandle$value === void 0 ? void 0 : _fileHandle$value.getFile());\n\t}\n\tasync function updateData() {\n\t\tvar _file$value5, _file$value6;\n\t\tawait updateFile();\n\t\tconst type = toValue(dataType);\n\t\tif (type === \"Text\") data.value = await ((_file$value5 = file.value) === null || _file$value5 === void 0 ? void 0 : _file$value5.text());\n\t\telse if (type === \"ArrayBuffer\") data.value = await ((_file$value6 = file.value) === null || _file$value6 === void 0 ? void 0 : _file$value6.arrayBuffer());\n\t\telse if (type === \"Blob\") data.value = file.value;\n\t}\n\twatch(() => toValue(dataType), updateData);\n\treturn {\n\t\tisSupported,\n\t\tdata,\n\t\tfile,\n\t\tfileName,\n\t\tfileMIME,\n\t\tfileSize,\n\t\tfileLastModified,\n\t\topen,\n\t\tcreate,\n\t\tsave,\n\t\tsaveAs,\n\t\tupdateData\n\t};\n}\n//#endregion\n//#region useFocus/index.ts\n/**\n* Track or set the focus state of a DOM element.\n*\n* @see https://vueuse.org/useFocus\n* @param target The target element for the focus and blur events.\n* @param options\n*/\nfunction useFocus(target, options = {}) {\n\tconst { initialValue = false, focusVisible = false, preventScroll = false } = options;\n\tconst innerFocused = shallowRef(false);\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, \"focus\", (event) => {\n\t\tvar _matches, _ref;\n\t\tif (!focusVisible || ((_matches = (_ref = event.target).matches) === null || _matches === void 0 ? void 0 : _matches.call(_ref, \":focus-visible\"))) innerFocused.value = true;\n\t}, listenerOptions);\n\tuseEventListener(targetElement, \"blur\", () => innerFocused.value = false, listenerOptions);\n\tconst focused = computed({\n\t\tget: () => innerFocused.value,\n\t\tset(value) {\n\t\t\tvar _targetElement$value, _targetElement$value2;\n\t\t\tif (!value && innerFocused.value) (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || _targetElement$value.blur();\n\t\t\telse if (value && !innerFocused.value) (_targetElement$value2 = targetElement.value) === null || _targetElement$value2 === void 0 || _targetElement$value2.focus({ preventScroll });\n\t\t}\n\t});\n\twatch(targetElement, () => {\n\t\tfocused.value = initialValue;\n\t}, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t});\n\treturn { focused };\n}\n//#endregion\n//#region useFocusWithin/index.ts\nconst EVENT_FOCUS_IN = \"focusin\";\nconst EVENT_FOCUS_OUT = \"focusout\";\nconst PSEUDO_CLASS_FOCUS_WITHIN = \":focus-within\";\n/**\n* Track if focus is contained within the target element\n*\n* @see https://vueuse.org/useFocusWithin\n* @param target The target element to track\n* @param options Focus within options\n*/\nfunction useFocusWithin(target, options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst targetElement = computed(() => unrefElement(target));\n\tconst _focused = shallowRef(false);\n\tconst focused = computed(() => _focused.value);\n\tconst activeElement = useActiveElement(options);\n\tif (!window || !activeElement.value) return { focused };\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(targetElement, EVENT_FOCUS_IN, () => _focused.value = true, listenerOptions);\n\tuseEventListener(targetElement, EVENT_FOCUS_OUT, () => {\n\t\tvar _targetElement$value$, _targetElement$value, _targetElement$value$2;\n\t\treturn _focused.value = (_targetElement$value$ = (_targetElement$value = targetElement.value) === null || _targetElement$value === void 0 || (_targetElement$value$2 = _targetElement$value.matches) === null || _targetElement$value$2 === void 0 ? void 0 : _targetElement$value$2.call(_targetElement$value, PSEUDO_CLASS_FOCUS_WITHIN)) !== null && _targetElement$value$ !== void 0 ? _targetElement$value$ : false;\n\t}, listenerOptions);\n\treturn { focused };\n}\n//#endregion\n//#region useFps/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useFps(options) {\n\tvar _options$every;\n\tconst fps = shallowRef(0);\n\tif (typeof performance === \"undefined\") return fps;\n\tconst every = (_options$every = options === null || options === void 0 ? void 0 : options.every) !== null && _options$every !== void 0 ? _options$every : 10;\n\tlet last = performance.now();\n\tlet ticks = 0;\n\tuseRafFn(() => {\n\t\tticks += 1;\n\t\tif (ticks >= every) {\n\t\t\tconst now = performance.now();\n\t\t\tconst diff = now - last;\n\t\t\tfps.value = Math.round(1e3 / (diff / ticks));\n\t\t\tlast = now;\n\t\t\tticks = 0;\n\t\t}\n\t});\n\treturn fps;\n}\n//#endregion\n//#region useFullscreen/index.ts\nconst eventHandlers = [\n\t\"fullscreenchange\",\n\t\"webkitfullscreenchange\",\n\t\"webkitendfullscreen\",\n\t\"mozfullscreenchange\",\n\t\"MSFullscreenChange\"\n];\n/**\n* Reactive Fullscreen API.\n*\n* @see https://vueuse.org/useFullscreen\n* @param target\n* @param options\n*/\nfunction useFullscreen(target, options = {}) {\n\tconst { document = defaultDocument, autoExit = false } = options;\n\tconst targetRef = computed(() => {\n\t\tvar _unrefElement;\n\t\treturn (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : document === null || document === void 0 ? void 0 : document.documentElement;\n\t});\n\tconst isFullscreen = shallowRef(false);\n\tconst requestMethod = computed(() => {\n\t\treturn [\n\t\t\t\"requestFullscreen\",\n\t\t\t\"webkitRequestFullscreen\",\n\t\t\t\"webkitEnterFullscreen\",\n\t\t\t\"webkitEnterFullScreen\",\n\t\t\t\"webkitRequestFullScreen\",\n\t\t\t\"mozRequestFullScreen\",\n\t\t\t\"msRequestFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst exitMethod = computed(() => {\n\t\treturn [\n\t\t\t\"exitFullscreen\",\n\t\t\t\"webkitExitFullscreen\",\n\t\t\t\"webkitExitFullScreen\",\n\t\t\t\"webkitCancelFullScreen\",\n\t\t\t\"mozCancelFullScreen\",\n\t\t\t\"msExitFullscreen\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenEnabled = computed(() => {\n\t\treturn [\n\t\t\t\"fullScreen\",\n\t\t\t\"webkitIsFullScreen\",\n\t\t\t\"webkitDisplayingFullscreen\",\n\t\t\t\"mozFullScreen\",\n\t\t\t\"msFullscreenElement\"\n\t\t].find((m) => document && m in document || targetRef.value && m in targetRef.value);\n\t});\n\tconst fullscreenElementMethod = [\n\t\t\"fullscreenElement\",\n\t\t\"webkitFullscreenElement\",\n\t\t\"mozFullScreenElement\",\n\t\t\"msFullscreenElement\"\n\t].find((m) => document && m in document);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => targetRef.value && document && requestMethod.value !== void 0 && exitMethod.value !== void 0 && fullscreenEnabled.value !== void 0);\n\tconst isCurrentElementFullScreen = () => {\n\t\tif (fullscreenElementMethod) return (document === null || document === void 0 ? void 0 : document[fullscreenElementMethod]) === targetRef.value;\n\t\treturn false;\n\t};\n\tconst isElementFullScreen = () => {\n\t\tif (fullscreenEnabled.value) if (document && document[fullscreenEnabled.value] != null) return document[fullscreenEnabled.value];\n\t\telse {\n\t\t\tconst target = targetRef.value;\n\t\t\tif ((target === null || target === void 0 ? void 0 : target[fullscreenEnabled.value]) != null) return Boolean(target[fullscreenEnabled.value]);\n\t\t}\n\t\treturn false;\n\t};\n\tasync function exit() {\n\t\tif (!isSupported.value || !isFullscreen.value) return;\n\t\tif (exitMethod.value) if ((document === null || document === void 0 ? void 0 : document[exitMethod.value]) != null) await document[exitMethod.value]();\n\t\telse {\n\t\t\tconst target = targetRef.value;\n\t\t\tif ((target === null || target === void 0 ? void 0 : target[exitMethod.value]) != null) await target[exitMethod.value]();\n\t\t}\n\t\tisFullscreen.value = false;\n\t}\n\tasync function enter() {\n\t\tif (!isSupported.value || isFullscreen.value) return;\n\t\tif (isElementFullScreen()) await exit();\n\t\tconst target = targetRef.value;\n\t\tif (requestMethod.value && (target === null || target === void 0 ? void 0 : target[requestMethod.value]) != null) {\n\t\t\tawait target[requestMethod.value]();\n\t\t\tisFullscreen.value = true;\n\t\t}\n\t}\n\tasync function toggle() {\n\t\tawait (isFullscreen.value ? exit() : enter());\n\t}\n\tconst handlerCallback = () => {\n\t\tconst isElementFullScreenValue = isElementFullScreen();\n\t\tif (!isElementFullScreenValue || isElementFullScreenValue && isCurrentElementFullScreen()) isFullscreen.value = isElementFullScreenValue;\n\t};\n\tconst listenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t};\n\tuseEventListener(document, eventHandlers, handlerCallback, listenerOptions);\n\tuseEventListener(() => unrefElement(targetRef), eventHandlers, handlerCallback, listenerOptions);\n\ttryOnMounted(handlerCallback, false);\n\tif (autoExit) tryOnScopeDispose(exit);\n\treturn {\n\t\tisSupported,\n\t\tisFullscreen,\n\t\tenter,\n\t\texit,\n\t\ttoggle\n\t};\n}\n//#endregion\n//#region useGamepad/index.ts\n/**\n* Maps a standard standard gamepad to an Xbox 360 Controller.\n*/\nfunction mapGamepadToXbox360Controller(gamepad) {\n\treturn computed(() => {\n\t\tif (gamepad.value) return {\n\t\t\tbuttons: {\n\t\t\t\ta: gamepad.value.buttons[0],\n\t\t\t\tb: gamepad.value.buttons[1],\n\t\t\t\tx: gamepad.value.buttons[2],\n\t\t\t\ty: gamepad.value.buttons[3]\n\t\t\t},\n\t\t\tbumper: {\n\t\t\t\tleft: gamepad.value.buttons[4],\n\t\t\t\tright: gamepad.value.buttons[5]\n\t\t\t},\n\t\t\ttriggers: {\n\t\t\t\tleft: gamepad.value.buttons[6],\n\t\t\t\tright: gamepad.value.buttons[7]\n\t\t\t},\n\t\t\tstick: {\n\t\t\t\tleft: {\n\t\t\t\t\thorizontal: gamepad.value.axes[0],\n\t\t\t\t\tvertical: gamepad.value.axes[1],\n\t\t\t\t\tbutton: gamepad.value.buttons[10]\n\t\t\t\t},\n\t\t\t\tright: {\n\t\t\t\t\thorizontal: gamepad.value.axes[2],\n\t\t\t\t\tvertical: gamepad.value.axes[3],\n\t\t\t\t\tbutton: gamepad.value.buttons[11]\n\t\t\t\t}\n\t\t\t},\n\t\t\tdpad: {\n\t\t\t\tup: gamepad.value.buttons[12],\n\t\t\t\tdown: gamepad.value.buttons[13],\n\t\t\t\tleft: gamepad.value.buttons[14],\n\t\t\t\tright: gamepad.value.buttons[15]\n\t\t\t},\n\t\t\tback: gamepad.value.buttons[8],\n\t\t\tstart: gamepad.value.buttons[9]\n\t\t};\n\t\treturn null;\n\t});\n}\n/* @__NO_SIDE_EFFECTS__ */\nfunction useGamepad(options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"getGamepads\" in navigator);\n\tconst gamepads = ref([]);\n\tconst onConnectedHook = createEventHook();\n\tconst onDisconnectedHook = createEventHook();\n\tconst stateFromGamepad = (gamepad) => {\n\t\tconst hapticActuators = [];\n\t\tconst vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n\t\tif (vibrationActuator) hapticActuators.push(vibrationActuator);\n\t\tif (gamepad.hapticActuators) hapticActuators.push(...gamepad.hapticActuators);\n\t\treturn {\n\t\t\tid: gamepad.id,\n\t\t\tindex: gamepad.index,\n\t\t\tconnected: gamepad.connected,\n\t\t\tmapping: gamepad.mapping,\n\t\t\ttimestamp: gamepad.timestamp,\n\t\t\tvibrationActuator: gamepad.vibrationActuator,\n\t\t\thapticActuators,\n\t\t\taxes: gamepad.axes.map((axes) => axes),\n\t\t\tbuttons: gamepad.buttons.map((button) => ({\n\t\t\t\tpressed: button.pressed,\n\t\t\t\ttouched: button.touched,\n\t\t\t\tvalue: button.value\n\t\t\t}))\n\t\t};\n\t};\n\tconst updateGamepadState = () => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) {\n\t\t\tif (!gamepad) continue;\n\t\t\tconst index = gamepads.value.findIndex((x) => x.index === gamepad.index);\n\t\t\tif (index > -1) gamepads.value[index] = stateFromGamepad(gamepad);\n\t\t}\n\t};\n\tconst { isActive, pause, resume } = useRafFn(updateGamepadState);\n\tconst onGamepadConnected = (gamepad) => {\n\t\tif (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n\t\t\tgamepads.value.push(stateFromGamepad(gamepad));\n\t\t\tonConnectedHook.trigger(gamepad.index);\n\t\t}\n\t\tresume();\n\t};\n\tconst onGamepadDisconnected = (gamepad) => {\n\t\tgamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n\t\tonDisconnectedHook.trigger(gamepad.index);\n\t};\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad), listenerOptions);\n\tuseEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad), listenerOptions);\n\ttryOnMounted(() => {\n\t\tconst _gamepads = (navigator === null || navigator === void 0 ? void 0 : navigator.getGamepads()) || [];\n\t\tfor (const gamepad of _gamepads) if (gamepad && gamepads.value[gamepad.index]) onGamepadConnected(gamepad);\n\t});\n\tpause();\n\treturn {\n\t\tisSupported,\n\t\tonConnected: onConnectedHook.on,\n\t\tonDisconnected: onDisconnectedHook.on,\n\t\tgamepads,\n\t\tpause,\n\t\tresume,\n\t\tisActive\n\t};\n}\n//#endregion\n//#region useGeolocation/index.ts\n/**\n* Reactive Geolocation API.\n*\n* @see https://vueuse.org/useGeolocation\n* @param options\n*/\nfunction useGeolocation(options = {}) {\n\tconst { enableHighAccuracy = true, maximumAge = 3e4, timeout = 27e3, navigator = defaultNavigator, immediate = true } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"geolocation\" in navigator);\n\tconst locatedAt = shallowRef(null);\n\tconst error = shallowRef(null);\n\tconst coords = shallowRef({\n\t\taccuracy: 0,\n\t\tlatitude: Number.POSITIVE_INFINITY,\n\t\tlongitude: Number.POSITIVE_INFINITY,\n\t\taltitude: null,\n\t\taltitudeAccuracy: null,\n\t\theading: null,\n\t\tspeed: null\n\t});\n\tfunction updatePosition(position) {\n\t\tlocatedAt.value = position.timestamp;\n\t\tcoords.value = position.coords;\n\t\terror.value = null;\n\t}\n\tlet watcher;\n\tfunction resume() {\n\t\tif (isSupported.value) watcher = navigator.geolocation.watchPosition(updatePosition, (err) => error.value = err, {\n\t\t\tenableHighAccuracy,\n\t\t\tmaximumAge,\n\t\t\ttimeout\n\t\t});\n\t}\n\tif (immediate) resume();\n\tfunction pause() {\n\t\tif (watcher && navigator) navigator.geolocation.clearWatch(watcher);\n\t}\n\ttryOnScopeDispose(() => {\n\t\tpause();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tcoords,\n\t\tlocatedAt,\n\t\terror,\n\t\tresume,\n\t\tpause\n\t};\n}\n//#endregion\n//#region useIdle/index.ts\nconst defaultEvents$1 = [\n\t\"mousemove\",\n\t\"mousedown\",\n\t\"resize\",\n\t\"keydown\",\n\t\"touchstart\",\n\t\"wheel\"\n];\nconst oneMinute = 6e4;\n/**\n* Tracks whether the user is being inactive.\n*\n* @see https://vueuse.org/useIdle\n* @param timeout default to 1 minute\n* @param options IdleOptions\n*/\nfunction useIdle(timeout = oneMinute, options = {}) {\n\tconst { initialState = false, listenForVisibilityChange = true, events = defaultEvents$1, window = defaultWindow, eventFilter = throttleFilter(50) } = options;\n\tconst idle = shallowRef(initialState);\n\tconst lastActive = shallowRef(timestamp());\n\tconst isPending = shallowRef(false);\n\tlet timer;\n\tconst reset = () => {\n\t\tidle.value = false;\n\t\tclearTimeout(timer);\n\t\ttimer = setTimeout(() => idle.value = true, timeout);\n\t};\n\tconst onEvent = createFilterWrapper(eventFilter, () => {\n\t\tlastActive.value = timestamp();\n\t\treset();\n\t});\n\tif (window) {\n\t\tconst document = window.document;\n\t\tconst listenerOptions = { passive: true };\n\t\tfor (const event of events) useEventListener(window, event, () => {\n\t\t\tif (!isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tif (listenForVisibilityChange) useEventListener(document, \"visibilitychange\", () => {\n\t\t\tif (document.hidden || !isPending.value) return;\n\t\t\tonEvent();\n\t\t}, listenerOptions);\n\t\tstart();\n\t}\n\tfunction start() {\n\t\tif (isPending.value) return;\n\t\tisPending.value = true;\n\t\tif (!initialState) reset();\n\t}\n\tfunction stop() {\n\t\tidle.value = initialState;\n\t\tclearTimeout(timer);\n\t\tisPending.value = false;\n\t}\n\treturn {\n\t\tidle,\n\t\tlastActive,\n\t\treset,\n\t\tstop,\n\t\tstart,\n\t\tisPending: shallowReadonly(isPending)\n\t};\n}\n//#endregion\n//#region useImage/index.ts\nasync function loadImage(options) {\n\treturn new Promise((resolve, reject) => {\n\t\tconst img = new Image();\n\t\tconst { src, srcset, sizes, class: clazz, loading, crossorigin, referrerPolicy, width, height, decoding, fetchPriority, ismap, usemap } = options;\n\t\timg.src = src;\n\t\tif (srcset != null) img.srcset = srcset;\n\t\tif (sizes != null) img.sizes = sizes;\n\t\tif (clazz != null) img.className = clazz;\n\t\tif (loading != null) img.loading = loading;\n\t\tif (crossorigin != null) img.crossOrigin = crossorigin;\n\t\tif (referrerPolicy != null) img.referrerPolicy = referrerPolicy;\n\t\tif (width != null) img.width = width;\n\t\tif (height != null) img.height = height;\n\t\tif (decoding != null) img.decoding = decoding;\n\t\tif (fetchPriority != null) img.fetchPriority = fetchPriority;\n\t\tif (ismap != null) img.isMap = ismap;\n\t\tif (usemap != null) img.useMap = usemap;\n\t\timg.onload = () => resolve(img);\n\t\timg.onerror = reject;\n\t});\n}\n/**\n* Reactive load an image in the browser, you can wait the result to display it or show a fallback.\n*\n* @see https://vueuse.org/useImage\n* @param options Image attributes, as used in the <img> tag\n* @param asyncStateOptions\n*/\nfunction useImage(options, asyncStateOptions = {}) {\n\tconst state = useAsyncState(() => loadImage(toValue(options)), void 0, {\n\t\tresetOnExecute: true,\n\t\t...asyncStateOptions\n\t});\n\twatch(() => toValue(options), () => state.execute(asyncStateOptions.delay), { deep: true });\n\treturn state;\n}\n//#endregion\n//#region _resolve-element.ts\n/**\n* Resolves an element from a given element, window, or document.\n*\n* @internal\n*/\nfunction resolveElement(el) {\n\tif (typeof Window !== \"undefined\" && el instanceof Window) return el.document.documentElement;\n\tif (typeof Document !== \"undefined\" && el instanceof Document) return el.documentElement;\n\treturn el;\n}\n//#endregion\n//#region useScroll/index.ts\n/**\n* We have to check if the scroll amount is close enough to some threshold in order to\n* more accurately calculate arrivedState. This is because scrollTop/scrollLeft are non-rounded\n* numbers, while scrollHeight/scrollWidth and clientHeight/clientWidth are rounded.\n* https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollHeight#determine_if_an_element_has_been_totally_scrolled\n*/\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\n/**\n* Reactive scroll.\n*\n* @see https://vueuse.org/useScroll\n* @param element\n* @param options\n*/\nfunction useScroll(element, options = {}) {\n\tconst { throttle = 0, idle = 200, onStop = noop, onScroll = noop, offset = {\n\t\tleft: 0,\n\t\tright: 0,\n\t\ttop: 0,\n\t\tbottom: 0\n\t}, observe: _observe = { mutation: false }, eventListenerOptions = {\n\t\tcapture: false,\n\t\tpassive: true\n\t}, behavior = \"auto\", window = defaultWindow, onError = (e) => {\n\t\tconsole.error(e);\n\t} } = options;\n\tconst observe = typeof _observe === \"boolean\" ? { mutation: _observe } : _observe;\n\tconst internalX = shallowRef(0);\n\tconst internalY = shallowRef(0);\n\tconst x = computed({\n\t\tget() {\n\t\t\treturn internalX.value;\n\t\t},\n\t\tset(x) {\n\t\t\tscrollTo(x, void 0);\n\t\t}\n\t});\n\tconst y = computed({\n\t\tget() {\n\t\t\treturn internalY.value;\n\t\t},\n\t\tset(y) {\n\t\t\tscrollTo(void 0, y);\n\t\t}\n\t});\n\tfunction scrollTo(_x, _y) {\n\t\tvar _ref, _toValue, _toValue2, _document;\n\t\tif (!window) return;\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\t(_ref = _element instanceof Document ? window.document.body : _element) === null || _ref === void 0 || _ref.scrollTo({\n\t\t\ttop: (_toValue = toValue(_y)) !== null && _toValue !== void 0 ? _toValue : y.value,\n\t\t\tleft: (_toValue2 = toValue(_x)) !== null && _toValue2 !== void 0 ? _toValue2 : x.value,\n\t\t\tbehavior: toValue(behavior)\n\t\t});\n\t\tconst scrollContainer = (_element === null || _element === void 0 || (_document = _element.document) === null || _document === void 0 ? void 0 : _document.documentElement) || (_element === null || _element === void 0 ? void 0 : _element.documentElement) || _element;\n\t\tif (x != null) internalX.value = scrollContainer.scrollLeft;\n\t\tif (y != null) internalY.value = scrollContainer.scrollTop;\n\t}\n\tconst isScrolling = shallowRef(false);\n\tconst arrivedState = reactive({\n\t\tleft: true,\n\t\tright: false,\n\t\ttop: true,\n\t\tbottom: false\n\t});\n\tconst directions = reactive({\n\t\tleft: false,\n\t\tright: false,\n\t\ttop: false,\n\t\tbottom: false\n\t});\n\tconst onScrollEnd = (e) => {\n\t\tif (!isScrolling.value) return;\n\t\tisScrolling.value = false;\n\t\tdirections.left = false;\n\t\tdirections.right = false;\n\t\tdirections.top = false;\n\t\tdirections.bottom = false;\n\t\tonStop(e);\n\t};\n\tconst onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n\tconst setArrivedState = (target) => {\n\t\tvar _document2;\n\t\tif (!window) return;\n\t\tconst el = (target === null || target === void 0 || (_document2 = target.document) === null || _document2 === void 0 ? void 0 : _document2.documentElement) || (target === null || target === void 0 ? void 0 : target.documentElement) || unrefElement(target);\n\t\tconst { display, flexDirection, direction } = window.getComputedStyle(el);\n\t\tconst directionMultipler = direction === \"rtl\" ? -1 : 1;\n\t\tconst scrollLeft = el.scrollLeft;\n\t\tdirections.left = scrollLeft < internalX.value;\n\t\tdirections.right = scrollLeft > internalX.value;\n\t\tconst left = Math.abs(scrollLeft * directionMultipler) <= (offset.left || 0);\n\t\tconst right = Math.abs(scrollLeft * directionMultipler) + el.clientWidth >= el.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\tif (display === \"flex\" && flexDirection === \"row-reverse\") {\n\t\t\tarrivedState.left = right;\n\t\t\tarrivedState.right = left;\n\t\t} else {\n\t\t\tarrivedState.left = left;\n\t\t\tarrivedState.right = right;\n\t\t}\n\t\tinternalX.value = scrollLeft;\n\t\tlet scrollTop = el.scrollTop;\n\t\tif (target === window.document && !scrollTop) scrollTop = window.document.body.scrollTop;\n\t\tdirections.top = scrollTop < internalY.value;\n\t\tdirections.bottom = scrollTop > internalY.value;\n\t\tconst top = Math.abs(scrollTop) <= (offset.top || 0);\n\t\tconst bottom = Math.abs(scrollTop) + el.clientHeight >= el.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n\t\t/**\n\t\t* reverse columns and rows behave exactly the other way around,\n\t\t* bottom is treated as top and top is treated as the negative version of bottom\n\t\t*/\n\t\tif (display === \"flex\" && flexDirection === \"column-reverse\") {\n\t\t\tarrivedState.top = bottom;\n\t\t\tarrivedState.bottom = top;\n\t\t} else {\n\t\t\tarrivedState.top = top;\n\t\t\tarrivedState.bottom = bottom;\n\t\t}\n\t\tinternalY.value = scrollTop;\n\t};\n\tconst onScrollHandler = (e) => {\n\t\tvar _documentElement;\n\t\tif (!window) return;\n\t\tconst eventTarget = (_documentElement = e.target.documentElement) !== null && _documentElement !== void 0 ? _documentElement : e.target;\n\t\tsetArrivedState(eventTarget);\n\t\tisScrolling.value = true;\n\t\tonScrollEndDebounced(e);\n\t\tonScroll(e);\n\t};\n\tuseEventListener(element, \"scroll\", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);\n\ttryOnMounted(() => {\n\t\ttry {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (!_element) return;\n\t\t\tsetArrivedState(_element);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t});\n\tif ((observe === null || observe === void 0 ? void 0 : observe.mutation) && element != null && element !== window && element !== document) useMutationObserver(element, () => {\n\t\tconst _element = toValue(element);\n\t\tif (!_element) return;\n\t\tsetArrivedState(_element);\n\t}, {\n\t\tattributes: true,\n\t\tchildList: true,\n\t\tsubtree: true\n\t});\n\tuseEventListener(element, \"scrollend\", onScrollEnd, eventListenerOptions);\n\treturn {\n\t\tx,\n\t\ty,\n\t\tisScrolling,\n\t\tarrivedState,\n\t\tdirections,\n\t\tmeasure() {\n\t\t\tconst _element = toValue(element);\n\t\t\tif (window && _element) setArrivedState(_element);\n\t\t}\n\t};\n}\n//#endregion\n//#region useInfiniteScroll/index.ts\n/**\n* Reactive infinite scroll.\n*\n* @see https://vueuse.org/useInfiniteScroll\n*/\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n\tvar _options$distance;\n\tconst { direction = \"bottom\", interval = 100, canLoadMore = () => true } = options;\n\tconst state = reactive(useScroll(element, {\n\t\t...options,\n\t\toffset: {\n\t\t\t[direction]: (_options$distance = options.distance) !== null && _options$distance !== void 0 ? _options$distance : 0,\n\t\t\t...options.offset\n\t\t}\n\t}));\n\tconst promise = shallowRef();\n\tconst isLoading = computed(() => !!promise.value);\n\tconst observedElement = computed(() => {\n\t\treturn resolveElement(toValue(element));\n\t});\n\tconst isElementVisible = useElementVisibility(observedElement);\n\tconst canLoad = computed(() => {\n\t\tif (!observedElement.value) return false;\n\t\treturn canLoadMore(observedElement.value);\n\t});\n\tfunction checkAndLoad() {\n\t\tstate.measure();\n\t\tif (!observedElement.value || !isElementVisible.value || !canLoad.value || promise.value) return;\n\t\tconst { scrollHeight, clientHeight, scrollWidth, clientWidth } = observedElement.value;\n\t\tconst isNarrower = direction === \"bottom\" || direction === \"top\" ? scrollHeight <= clientHeight : scrollWidth <= clientWidth;\n\t\tif (state.arrivedState[direction] || isNarrower) promise.value = Promise.all([onLoadMore(state), new Promise((resolve) => setTimeout(resolve, interval))]).finally(() => {\n\t\t\tpromise.value = null;\n\t\t\tnextTick(() => checkAndLoad());\n\t\t});\n\t}\n\ttryOnUnmounted(watch(() => [\n\t\tstate.arrivedState[direction],\n\t\tisElementVisible.value,\n\t\tcanLoad.value\n\t], checkAndLoad, {\n\t\timmediate: true,\n\t\tflush: \"post\"\n\t}));\n\treturn {\n\t\tisLoading,\n\t\treset() {\n\t\t\tnextTick(() => checkAndLoad());\n\t\t}\n\t};\n}\n//#endregion\n//#region useKeyModifier/index.ts\nconst defaultEvents = [\n\t\"mousedown\",\n\t\"mouseup\",\n\t\"keydown\",\n\t\"keyup\"\n];\n/* @__NO_SIDE_EFFECTS__ */\nfunction useKeyModifier(modifier, options = {}) {\n\tconst { events = defaultEvents, document = defaultDocument, initial = null } = options;\n\tconst state = shallowRef(initial);\n\tif (document) events.forEach((listenerEvent) => {\n\t\tuseEventListener(document, listenerEvent, (evt) => {\n\t\t\tif (typeof evt.getModifierState === \"function\") state.value = evt.getModifierState(modifier);\n\t\t}, { passive: true });\n\t});\n\treturn state;\n}\n//#endregion\n//#region useLocalStorage/index.ts\n/**\n* Reactive LocalStorage.\n*\n* @see https://vueuse.org/useLocalStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useLocalStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.localStorage, options);\n}\n//#endregion\n//#region useMagicKeys/aliasMap.ts\nconst DefaultMagicKeysAliasMap = {\n\tctrl: \"control\",\n\tcommand: \"meta\",\n\tcmd: \"meta\",\n\toption: \"alt\",\n\tup: \"arrowup\",\n\tdown: \"arrowdown\",\n\tleft: \"arrowleft\",\n\tright: \"arrowright\"\n};\n//#endregion\n//#region useMagicKeys/index.ts\n/**\n* Reactive keys pressed state, with magical keys combination support.\n*\n* @see https://vueuse.org/useMagicKeys\n*/\nfunction useMagicKeys(options = {}) {\n\tconst { reactive: useReactive = false, target = defaultWindow, aliasMap = DefaultMagicKeysAliasMap, passive = true, onEventFired = noop } = options;\n\tconst current = reactive(/* @__PURE__ */ new Set());\n\tconst obj = {\n\t\ttoJSON() {\n\t\t\treturn {};\n\t\t},\n\t\tcurrent\n\t};\n\tconst refs = useReactive ? reactive(obj) : obj;\n\tconst metaDeps = /* @__PURE__ */ new Set();\n\tconst depsMap = /* @__PURE__ */ new Map([\n\t\t[\"Meta\", metaDeps],\n\t\t[\"Shift\", /* @__PURE__ */ new Set()],\n\t\t[\"Alt\", /* @__PURE__ */ new Set()]\n\t]);\n\tconst usedKeys = /* @__PURE__ */ new Set();\n\tfunction setRefs(key, value) {\n\t\tif (key in refs) if (useReactive) refs[key] = value;\n\t\telse refs[key].value = value;\n\t}\n\tfunction reset() {\n\t\tcurrent.clear();\n\t\tfor (const key of usedKeys) setRefs(key, false);\n\t}\n\tfunction updateDeps(value, e, keys) {\n\t\tif (!value || typeof e.getModifierState !== \"function\") return;\n\t\tfor (const [modifier, depsSet] of depsMap) if (e.getModifierState(modifier)) {\n\t\t\tkeys.forEach((key) => depsSet.add(key));\n\t\t\tbreak;\n\t\t}\n\t}\n\tfunction clearDeps(value, key) {\n\t\tif (value) return;\n\t\tconst depsMapKey = `${key[0].toUpperCase()}${key.slice(1)}`;\n\t\tconst deps = depsMap.get(depsMapKey);\n\t\tif (![\"shift\", \"alt\"].includes(key) || !deps) return;\n\t\tconst depsArray = Array.from(deps);\n\t\tconst depsIndex = depsArray.indexOf(key);\n\t\tdepsArray.forEach((key, index) => {\n\t\t\tif (index >= depsIndex) {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t}\n\t\t});\n\t\tdeps.clear();\n\t}\n\tfunction updateRefs(e, value) {\n\t\tvar _e$key, _e$code;\n\t\tconst key = (_e$key = e.key) === null || _e$key === void 0 ? void 0 : _e$key.toLowerCase();\n\t\tconst values = [(_e$code = e.code) === null || _e$code === void 0 ? void 0 : _e$code.toLowerCase(), key].filter(Boolean);\n\t\tif (!key) return;\n\t\tif (key) if (value) current.add(key);\n\t\telse current.delete(key);\n\t\tfor (const key of values) {\n\t\t\tusedKeys.add(key);\n\t\t\tsetRefs(key, value);\n\t\t}\n\t\tupdateDeps(value, e, [...current, ...values]);\n\t\tclearDeps(value, key);\n\t\tif (key === \"meta\" && !value) {\n\t\t\tmetaDeps.forEach((key) => {\n\t\t\t\tcurrent.delete(key);\n\t\t\t\tsetRefs(key, false);\n\t\t\t});\n\t\t\tmetaDeps.clear();\n\t\t}\n\t}\n\tuseEventListener(target, \"keydown\", (e) => {\n\t\tupdateRefs(e, true);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(target, \"keyup\", (e) => {\n\t\tupdateRefs(e, false);\n\t\treturn onEventFired(e);\n\t}, { passive });\n\tuseEventListener(\"blur\", reset, { passive });\n\tuseEventListener(\"focus\", reset, { passive });\n\tconst proxy = new Proxy(refs, { get(target, prop, rec) {\n\t\tif (typeof prop !== \"string\") return Reflect.get(target, prop, rec);\n\t\tprop = prop.toLowerCase();\n\t\tif (prop in aliasMap) prop = aliasMap[prop];\n\t\tif (!(prop in refs)) if (/[+_-]/.test(prop)) {\n\t\t\tconst keys = prop.split(/[+_-]/g).map((i) => i.trim());\n\t\t\trefs[prop] = computed(() => keys.map((key) => toValue(proxy[key])).every(Boolean));\n\t\t} else refs[prop] = shallowRef(false);\n\t\tconst r = Reflect.get(target, prop, rec);\n\t\treturn useReactive ? toValue(r) : r;\n\t} });\n\treturn proxy;\n}\n//#endregion\n//#region useMediaControls/index.ts\n/**\n* Automatically check if the ref exists and if it does run the cb fn\n*/\nfunction usingElRef(source, cb) {\n\tif (toValue(source)) cb(toValue(source));\n}\n/**\n* Converts a TimeRange object to an array\n*/\nfunction timeRangeToArray(timeRanges) {\n\tlet ranges = [];\n\tfor (let i = 0; i < timeRanges.length; ++i) ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n\treturn ranges;\n}\n/**\n* Converts a TextTrackList object to an array of `UseMediaTextTrack`\n*/\nfunction tracksToArray(tracks) {\n\treturn Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({\n\t\tid,\n\t\tlabel,\n\t\tkind,\n\t\tlanguage,\n\t\tmode,\n\t\tactiveCues,\n\t\tcues,\n\t\tinBandMetadataTrackDispatchType\n\t}));\n}\nconst defaultOptions = {\n\tsrc: \"\",\n\ttracks: []\n};\nfunction useMediaControls(target, options = {}) {\n\ttarget = toRef(target);\n\toptions = {\n\t\t...defaultOptions,\n\t\t...options\n\t};\n\tconst { document = defaultDocument } = options;\n\tconst listenerOptions = { passive: true };\n\tconst currentTime = shallowRef(0);\n\tconst duration = shallowRef(0);\n\tconst seeking = shallowRef(false);\n\tconst volume = shallowRef(1);\n\tconst waiting = shallowRef(false);\n\tconst ended = shallowRef(false);\n\tconst playing = shallowRef(false);\n\tconst rate = shallowRef(1);\n\tconst stalled = shallowRef(false);\n\tconst buffered = shallowRef([]);\n\tconst tracks = shallowRef([]);\n\tconst selectedTrack = shallowRef(-1);\n\tconst isPictureInPicture = shallowRef(false);\n\tconst muted = shallowRef(false);\n\tconst supportsPictureInPicture = Boolean(document && \"pictureInPictureEnabled\" in document);\n\tconst sourceErrorEvent = createEventHook();\n\tconst playbackErrorEvent = createEventHook();\n\t/**\n\t* Disables the specified track. If no track is specified then\n\t* all tracks will be disabled\n\t*\n\t* @param track The id of the track to disable\n\t*/\n\tconst disableTrack = (track) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tif (track) {\n\t\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\t\tel.textTracks[id].mode = \"disabled\";\n\t\t\t} else for (let i = 0; i < el.textTracks.length; ++i) el.textTracks[i].mode = \"disabled\";\n\t\t\tselectedTrack.value = -1;\n\t\t});\n\t};\n\t/**\n\t* Enables the specified track and disables the\n\t* other tracks unless otherwise specified\n\t*\n\t* @param track The track of the id of the track to enable\n\t* @param disableTracks Disable all other tracks\n\t*/\n\tconst enableTrack = (track, disableTracks = true) => {\n\t\tusingElRef(target, (el) => {\n\t\t\tconst id = typeof track === \"number\" ? track : track.id;\n\t\t\tif (disableTracks) disableTrack();\n\t\t\tel.textTracks[id].mode = \"showing\";\n\t\t\tselectedTrack.value = id;\n\t\t});\n\t};\n\t/**\n\t* Toggle picture in picture mode for the player.\n\t*/\n\tconst togglePictureInPicture = () => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tusingElRef(target, async (el) => {\n\t\t\t\tif (supportsPictureInPicture) if (!isPictureInPicture.value) el.requestPictureInPicture().then(resolve).catch(reject);\n\t\t\t\telse document.exitPictureInPicture().then(resolve).catch(reject);\n\t\t\t});\n\t\t});\n\t};\n\t/**\n\t* This will automatically inject sources to the media element. The sources will be\n\t* appended as children to the media element as `<source>` elements.\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tconst src = toValue(options.src);\n\t\tlet sources = [];\n\t\tif (!src) return;\n\t\tif (typeof src === \"string\") sources = [{ src }];\n\t\telse if (Array.isArray(src)) sources = src;\n\t\telse if (isObject(src)) sources = [src];\n\t\tel.querySelectorAll(\"source\").forEach((e) => {\n\t\t\te.remove();\n\t\t});\n\t\tsources.forEach(({ src, type, media }) => {\n\t\t\tconst source = document.createElement(\"source\");\n\t\t\tsource.setAttribute(\"src\", src);\n\t\t\tsource.setAttribute(\"type\", type || \"\");\n\t\t\tsource.setAttribute(\"media\", media || \"\");\n\t\t\tuseEventListener(source, \"error\", sourceErrorEvent.trigger, listenerOptions);\n\t\t\tel.appendChild(source);\n\t\t});\n\t\tel.load();\n\t});\n\t/**\n\t* Apply composable state to the element, also when element is changed\n\t*/\n\twatch([target, volume], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.volume = volume.value;\n\t});\n\twatch([target, muted], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.muted = muted.value;\n\t});\n\twatch([target, rate], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.playbackRate = rate.value;\n\t});\n\t/**\n\t* Load Tracks\n\t*/\n\twatchEffect(() => {\n\t\tif (!document) return;\n\t\tconst textTracks = toValue(options.tracks);\n\t\tconst el = toValue(target);\n\t\tif (!textTracks || !textTracks.length || !el) return;\n\t\t/**\n\t\t* The MediaAPI provides an API for adding text tracks, but they don't currently\n\t\t* have an API for removing text tracks, so instead we will just create and remove\n\t\t* the tracks manually using the HTML api.\n\t\t*/\n\t\tel.querySelectorAll(\"track\").forEach((e) => e.remove());\n\t\ttextTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n\t\t\tconst track = document.createElement(\"track\");\n\t\t\ttrack.default = isDefault || false;\n\t\t\ttrack.kind = kind;\n\t\t\ttrack.label = label;\n\t\t\ttrack.src = src;\n\t\t\ttrack.srclang = srcLang;\n\t\t\tif (track.default) selectedTrack.value = i;\n\t\t\tel.appendChild(track);\n\t\t});\n\t});\n\t/**\n\t* This will allow us to update the current time from the timeupdate event\n\t* without setting the medias current position, but if the user changes the\n\t* current time via the ref, then the media will seek.\n\t*\n\t* If we did not use an ignorable watch, then the current time update from\n\t* the timeupdate event would cause the media to stutter.\n\t*/\n\tconst { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tel.currentTime = time;\n\t});\n\t/**\n\t* Using an ignorable watch so we can control the play state using a ref and not\n\t* a function\n\t*/\n\tconst { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tif (isPlaying) el.play().catch((e) => {\n\t\t\tplaybackErrorEvent.trigger(e);\n\t\t\tthrow e;\n\t\t});\n\t\telse el.pause();\n\t});\n\tuseEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = toValue(target).currentTime), listenerOptions);\n\tuseEventListener(target, \"durationchange\", () => duration.value = toValue(target).duration, listenerOptions);\n\tuseEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(toValue(target).buffered), listenerOptions);\n\tuseEventListener(target, \"seeking\", () => seeking.value = true, listenerOptions);\n\tuseEventListener(target, \"seeked\", () => seeking.value = false, listenerOptions);\n\tuseEventListener(target, [\"waiting\", \"loadstart\"], () => {\n\t\twaiting.value = true;\n\t\tignorePlayingUpdates(() => playing.value = false);\n\t}, listenerOptions);\n\tuseEventListener(target, \"loadeddata\", () => waiting.value = false, listenerOptions);\n\tuseEventListener(target, \"playing\", () => {\n\t\twaiting.value = false;\n\t\tended.value = false;\n\t\tignorePlayingUpdates(() => playing.value = true);\n\t}, listenerOptions);\n\tuseEventListener(target, \"ratechange\", () => rate.value = toValue(target).playbackRate, listenerOptions);\n\tuseEventListener(target, \"stalled\", () => stalled.value = true, listenerOptions);\n\tuseEventListener(target, \"ended\", () => ended.value = true, listenerOptions);\n\tuseEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false), listenerOptions);\n\tuseEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true), listenerOptions);\n\tuseEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true, listenerOptions);\n\tuseEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false, listenerOptions);\n\tuseEventListener(target, \"volumechange\", () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tvolume.value = el.volume;\n\t\tmuted.value = el.muted;\n\t}, listenerOptions);\n\t/**\n\t* The following listeners need to listen to a nested\n\t* object on the target, so we will have to use a nested\n\t* watch and manually remove the listeners\n\t*/\n\tconst listeners = [];\n\tconst stop = watch([target], () => {\n\t\tconst el = toValue(target);\n\t\tif (!el) return;\n\t\tstop();\n\t\tlisteners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t\tlisteners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks), listenerOptions);\n\t});\n\ttryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n\treturn {\n\t\tcurrentTime,\n\t\tduration,\n\t\twaiting,\n\t\tseeking,\n\t\tended,\n\t\tstalled,\n\t\tbuffered,\n\t\tplaying,\n\t\trate,\n\t\tvolume,\n\t\tmuted,\n\t\ttracks,\n\t\tselectedTrack,\n\t\tenableTrack,\n\t\tdisableTrack,\n\t\tsupportsPictureInPicture,\n\t\ttogglePictureInPicture,\n\t\tisPictureInPicture,\n\t\tonSourceError: sourceErrorEvent.on,\n\t\tonPlaybackError: playbackErrorEvent.on\n\t};\n}\n//#endregion\n//#region useMemoize/index.ts\n/**\n* Reactive function result cache based on arguments\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemoize(resolver, options) {\n\tconst initCache = () => {\n\t\tif (options === null || options === void 0 ? void 0 : options.cache) return shallowReactive(options.cache);\n\t\treturn shallowReactive(/* @__PURE__ */ new Map());\n\t};\n\tconst cache = initCache();\n\t/**\n\t* Generate key from args\n\t*/\n\tconst generateKey = (...args) => (options === null || options === void 0 ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n\t/**\n\t* Load data and save in cache\n\t*/\n\tconst _loadData = (key, ...args) => {\n\t\tcache.set(key, resolver(...args));\n\t\treturn cache.get(key);\n\t};\n\tconst loadData = (...args) => _loadData(generateKey(...args), ...args);\n\t/**\n\t* Delete key from cache\n\t*/\n\tconst deleteData = (...args) => {\n\t\tcache.delete(generateKey(...args));\n\t};\n\t/**\n\t* Clear cached data\n\t*/\n\tconst clearData = () => {\n\t\tcache.clear();\n\t};\n\tconst memoized = (...args) => {\n\t\tconst key = generateKey(...args);\n\t\tif (cache.has(key)) return cache.get(key);\n\t\treturn _loadData(key, ...args);\n\t};\n\tmemoized.load = loadData;\n\tmemoized.delete = deleteData;\n\tmemoized.clear = clearData;\n\tmemoized.generateKey = generateKey;\n\tmemoized.cache = cache;\n\treturn memoized;\n}\n//#endregion\n//#region useMemory/index.ts\nfunction getDefaultScheduler$6(options) {\n\tif (\"interval\" in options || \"immediate\" in options || \"immediateCallback\" in options) {\n\t\tconst { interval = 1e3, immediate, immediateCallback } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, {\n\t\t\timmediate,\n\t\t\timmediateCallback\n\t\t});\n\t}\n\treturn useIntervalFn;\n}\n/**\n* Reactive Memory Info.\n*\n* @see https://vueuse.org/useMemory\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useMemory(options = {}) {\n\tconst memory = shallowRef();\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n\tif (isSupported.value) {\n\t\tconst { scheduler = getDefaultScheduler$6 } = options;\n\t\tscheduler(() => {\n\t\t\tmemory.value = performance.memory;\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tmemory\n\t};\n}\n//#endregion\n//#region useMouse/index.ts\nconst UseMouseBuiltinExtractors = {\n\tpage: (event) => [event.pageX, event.pageY],\n\tclient: (event) => [event.clientX, event.clientY],\n\tscreen: (event) => [event.screenX, event.screenY],\n\tmovement: (event) => event instanceof MouseEvent ? [event.movementX, event.movementY] : null\n};\n/**\n* Reactive mouse position.\n*\n* @see https://vueuse.org/useMouse\n* @param options\n*/\nfunction useMouse(options = {}) {\n\tconst { type = \"page\", touch = true, resetOnTouchEnds = false, initialValue = {\n\t\tx: 0,\n\t\ty: 0\n\t}, window = defaultWindow, target = window, scroll = true, eventFilter } = options;\n\tlet _prevMouseEvent = null;\n\tlet _prevScrollX = 0;\n\tlet _prevScrollY = 0;\n\tconst x = shallowRef(initialValue.x);\n\tconst y = shallowRef(initialValue.y);\n\tconst sourceType = shallowRef(null);\n\tconst extractor = typeof type === \"function\" ? type : UseMouseBuiltinExtractors[type];\n\tconst mouseHandler = (event) => {\n\t\tconst result = extractor(event);\n\t\t_prevMouseEvent = event;\n\t\tif (result) {\n\t\t\t[x.value, y.value] = result;\n\t\t\tsourceType.value = \"mouse\";\n\t\t}\n\t\tif (window) {\n\t\t\t_prevScrollX = window.scrollX;\n\t\t\t_prevScrollY = window.scrollY;\n\t\t}\n\t};\n\tconst touchHandler = (event) => {\n\t\tif (event.touches.length > 0) {\n\t\t\tconst result = extractor(event.touches[0]);\n\t\t\tif (result) {\n\t\t\t\t[x.value, y.value] = result;\n\t\t\t\tsourceType.value = \"touch\";\n\t\t\t}\n\t\t}\n\t};\n\tconst scrollHandler = () => {\n\t\tif (!_prevMouseEvent || !window) return;\n\t\tconst pos = extractor(_prevMouseEvent);\n\t\tif (_prevMouseEvent instanceof MouseEvent && pos) {\n\t\t\tx.value = pos[0] + window.scrollX - _prevScrollX;\n\t\t\ty.value = pos[1] + window.scrollY - _prevScrollY;\n\t\t}\n\t};\n\tconst reset = () => {\n\t\tx.value = initialValue.x;\n\t\ty.value = initialValue.y;\n\t};\n\tconst mouseHandlerWrapper = eventFilter ? (event) => eventFilter(() => mouseHandler(event), {}) : (event) => mouseHandler(event);\n\tconst touchHandlerWrapper = eventFilter ? (event) => eventFilter(() => touchHandler(event), {}) : (event) => touchHandler(event);\n\tconst scrollHandlerWrapper = eventFilter ? () => eventFilter(() => scrollHandler(), {}) : () => scrollHandler();\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\"mousemove\", \"dragover\"], mouseHandlerWrapper, listenerOptions);\n\t\tif (touch && type !== \"movement\") {\n\t\t\tuseEventListener(target, [\"touchstart\", \"touchmove\"], touchHandlerWrapper, listenerOptions);\n\t\t\tif (resetOnTouchEnds) useEventListener(target, \"touchend\", reset, listenerOptions);\n\t\t}\n\t\tif (scroll && type === \"page\") useEventListener(window, \"scroll\", scrollHandlerWrapper, listenerOptions);\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType\n\t};\n}\n//#endregion\n//#region useMouseInElement/index.ts\n/**\n* Reactive mouse position related to an element.\n*\n* @see https://vueuse.org/useMouseInElement\n* @param target\n* @param options\n*/\nfunction useMouseInElement(target, options = {}) {\n\tconst { windowResize = true, windowScroll = true, handleOutside = true, window = defaultWindow } = options;\n\tconst type = options.type || \"page\";\n\tconst { x, y, sourceType } = useMouse(options);\n\tconst targetRef = shallowRef(target !== null && target !== void 0 ? target : window === null || window === void 0 ? void 0 : window.document.body);\n\tconst elementX = shallowRef(0);\n\tconst elementY = shallowRef(0);\n\tconst elementPositionX = shallowRef(0);\n\tconst elementPositionY = shallowRef(0);\n\tconst elementHeight = shallowRef(0);\n\tconst elementWidth = shallowRef(0);\n\tconst isOutside = shallowRef(true);\n\tfunction update() {\n\t\tif (!window) return;\n\t\tconst el = unrefElement(targetRef);\n\t\tif (!el || !(el instanceof Element)) return;\n\t\tfor (const rect of el.getClientRects()) {\n\t\t\tconst { left, top, width, height } = rect;\n\t\t\telementPositionX.value = left + (type === \"page\" ? window.pageXOffset : 0);\n\t\t\telementPositionY.value = top + (type === \"page\" ? window.pageYOffset : 0);\n\t\t\telementHeight.value = height;\n\t\t\telementWidth.value = width;\n\t\t\tconst elX = x.value - elementPositionX.value;\n\t\t\tconst elY = y.value - elementPositionY.value;\n\t\t\tisOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n\t\t\tif (handleOutside || !isOutside.value) {\n\t\t\t\telementX.value = elX;\n\t\t\t\telementY.value = elY;\n\t\t\t}\n\t\t\tif (!isOutside.value) break;\n\t\t}\n\t}\n\tconst stopFnList = [];\n\tfunction stop() {\n\t\tstopFnList.forEach((fn) => fn());\n\t\tstopFnList.length = 0;\n\t}\n\ttryOnMounted(() => {\n\t\tupdate();\n\t});\n\tif (window) {\n\t\tconst { stop: stopResizeObserver } = useResizeObserver(targetRef, update);\n\t\tconst { stop: stopMutationObserver } = useMutationObserver(targetRef, update, { attributeFilter: [\"style\", \"class\"] });\n\t\tconst stopWatch = watch([\n\t\t\ttargetRef,\n\t\t\tx,\n\t\t\ty\n\t\t], update);\n\t\tstopFnList.push(stopResizeObserver, stopMutationObserver, stopWatch);\n\t\tuseEventListener(document, \"mouseleave\", () => isOutside.value = true, { passive: true });\n\t\tif (windowScroll) stopFnList.push(useEventListener(\"scroll\", update, {\n\t\t\tcapture: true,\n\t\t\tpassive: true\n\t\t}));\n\t\tif (windowResize) stopFnList.push(useEventListener(\"resize\", update, { passive: true }));\n\t}\n\treturn {\n\t\tx,\n\t\ty,\n\t\tsourceType,\n\t\telementX,\n\t\telementY,\n\t\telementPositionX,\n\t\telementPositionY,\n\t\telementHeight,\n\t\telementWidth,\n\t\tisOutside,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useMousePressed/index.ts\n/**\n* Reactive mouse pressing state.\n*\n* @see https://vueuse.org/useMousePressed\n* @param options\n*/\nfunction useMousePressed(options = {}) {\n\tconst { touch = true, drag = true, capture = false, initialValue = false, window = defaultWindow } = options;\n\tconst pressed = shallowRef(initialValue);\n\tconst sourceType = shallowRef(null);\n\tif (!window) return {\n\t\tpressed,\n\t\tsourceType\n\t};\n\tconst onPressed = (srcType) => (event) => {\n\t\tvar _options$onPressed;\n\t\tpressed.value = true;\n\t\tsourceType.value = srcType;\n\t\t(_options$onPressed = options.onPressed) === null || _options$onPressed === void 0 || _options$onPressed.call(options, event);\n\t};\n\tconst onReleased = (event) => {\n\t\tvar _options$onReleased;\n\t\tpressed.value = false;\n\t\tsourceType.value = null;\n\t\t(_options$onReleased = options.onReleased) === null || _options$onReleased === void 0 || _options$onReleased.call(options, event);\n\t};\n\tconst target = computed(() => unrefElement(options.target) || window);\n\tconst listenerOptions = {\n\t\tpassive: true,\n\t\tcapture\n\t};\n\tuseEventListener(target, \"mousedown\", onPressed(\"mouse\"), listenerOptions);\n\tuseEventListener(window, \"mouseleave\", onReleased, listenerOptions);\n\tuseEventListener(window, \"mouseup\", onReleased, listenerOptions);\n\tif (drag) {\n\t\tuseEventListener(target, \"dragstart\", onPressed(\"mouse\"), listenerOptions);\n\t\tuseEventListener(window, \"drop\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"dragend\", onReleased, listenerOptions);\n\t}\n\tif (touch) {\n\t\tuseEventListener(target, \"touchstart\", onPressed(\"touch\"), listenerOptions);\n\t\tuseEventListener(window, \"touchend\", onReleased, listenerOptions);\n\t\tuseEventListener(window, \"touchcancel\", onReleased, listenerOptions);\n\t}\n\treturn {\n\t\tpressed,\n\t\tsourceType\n\t};\n}\n//#endregion\n//#region useNavigatorLanguage/index.ts\n/**\n*\n* Reactive useNavigatorLanguage\n*\n* Detects the currently selected user language and returns a reactive language\n* @see https://vueuse.org/useNavigatorLanguage\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNavigatorLanguage(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"language\" in navigator);\n\tconst language = shallowRef(navigator === null || navigator === void 0 ? void 0 : navigator.language);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tif (navigator) language.value = navigator.language;\n\t}, { passive: true });\n\treturn {\n\t\tisSupported,\n\t\tlanguage\n\t};\n}\n//#endregion\n//#region useNetwork/index.ts\n/**\n* Reactive Network status.\n*\n* @see https://vueuse.org/useNetwork\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNetwork(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst navigator = window === null || window === void 0 ? void 0 : window.navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"connection\" in navigator);\n\tconst isOnline = shallowRef(true);\n\tconst saveData = shallowRef(false);\n\tconst offlineAt = shallowRef(void 0);\n\tconst onlineAt = shallowRef(void 0);\n\tconst downlink = shallowRef(void 0);\n\tconst downlinkMax = shallowRef(void 0);\n\tconst rtt = shallowRef(void 0);\n\tconst effectiveType = shallowRef(void 0);\n\tconst type = shallowRef(\"unknown\");\n\tconst connection = isSupported.value && navigator.connection;\n\tfunction updateNetworkInformation() {\n\t\tif (!navigator) return;\n\t\tisOnline.value = navigator.onLine;\n\t\tofflineAt.value = isOnline.value ? void 0 : Date.now();\n\t\tonlineAt.value = isOnline.value ? Date.now() : void 0;\n\t\tif (connection) {\n\t\t\tdownlink.value = connection.downlink;\n\t\t\tdownlinkMax.value = connection.downlinkMax;\n\t\t\teffectiveType.value = connection.effectiveType;\n\t\t\trtt.value = connection.rtt;\n\t\t\tsaveData.value = connection.saveData;\n\t\t\ttype.value = connection.type;\n\t\t}\n\t}\n\tconst listenerOptions = { passive: true };\n\tif (window) {\n\t\tuseEventListener(window, \"offline\", () => {\n\t\t\tisOnline.value = false;\n\t\t\tofflineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t\tuseEventListener(window, \"online\", () => {\n\t\t\tisOnline.value = true;\n\t\t\tonlineAt.value = Date.now();\n\t\t}, listenerOptions);\n\t}\n\tif (connection) useEventListener(connection, \"change\", updateNetworkInformation, listenerOptions);\n\tupdateNetworkInformation();\n\treturn {\n\t\tisSupported,\n\t\tisOnline: shallowReadonly(isOnline),\n\t\tsaveData: shallowReadonly(saveData),\n\t\tofflineAt: shallowReadonly(offlineAt),\n\t\tonlineAt: shallowReadonly(onlineAt),\n\t\tdownlink: shallowReadonly(downlink),\n\t\tdownlinkMax: shallowReadonly(downlinkMax),\n\t\teffectiveType: shallowReadonly(effectiveType),\n\t\trtt: shallowReadonly(rtt),\n\t\ttype: shallowReadonly(type)\n\t};\n}\n//#endregion\n//#region useNow/index.ts\nfunction getDefaultScheduler$5(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (fn) => useRafFn(fn, { immediate }) : (fn) => useIntervalFn(fn, interval, options);\n\t}\n\treturn useRafFn;\n}\n/**\n* Reactive current Date instance.\n*\n* @see https://vueuse.org/useNow\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useNow(options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$5(options) } = options;\n\tconst now = shallowRef(/* @__PURE__ */ new Date());\n\tconst update = () => now.value = /* @__PURE__ */ new Date();\n\tconst controls = scheduler(update);\n\tif (exposeControls) return {\n\t\tnow,\n\t\t...controls\n\t};\n\telse return now;\n}\n//#endregion\n//#region useObjectUrl/index.ts\n/**\n* Reactive URL representing an object.\n*\n* @see https://vueuse.org/useObjectUrl\n* @param object\n*/\nfunction useObjectUrl(object) {\n\tconst url = shallowRef();\n\tconst release = () => {\n\t\tif (url.value) URL.revokeObjectURL(url.value);\n\t\turl.value = void 0;\n\t};\n\twatch(() => toValue(object), (newObject) => {\n\t\trelease();\n\t\tif (newObject) url.value = URL.createObjectURL(newObject);\n\t}, { immediate: true });\n\ttryOnScopeDispose(release);\n\treturn shallowReadonly(url);\n}\n//#endregion\n//#region ../math/useClamp/index.ts\n/**\n* Reactively clamp a value between two other values.\n*\n* @see https://vueuse.org/useClamp\n* @param value number\n* @param min\n* @param max\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useClamp(value, min, max) {\n\tif (typeof value === \"function\" || isReadonly(value)) return computed(() => clamp(toValue(value), toValue(min), toValue(max)));\n\tconst _value = ref(value);\n\treturn computed({\n\t\tget() {\n\t\t\treturn _value.value = clamp(_value.value, toValue(min), toValue(max));\n\t\t},\n\t\tset(value) {\n\t\t\t_value.value = clamp(value, toValue(min), toValue(max));\n\t\t}\n\t});\n}\n//#endregion\n//#region useOffsetPagination/index.ts\nfunction useOffsetPagination(options) {\n\tconst { total = Number.POSITIVE_INFINITY, pageSize = 10, page = 1, onPageChange = noop, onPageSizeChange = noop, onPageCountChange = noop } = options;\n\tconst currentPageSize = useClamp(pageSize, 1, Number.POSITIVE_INFINITY);\n\tconst pageCount = computed(() => Math.max(1, Math.ceil(toValue(total) / toValue(currentPageSize))));\n\tconst currentPage = useClamp(page, 1, pageCount);\n\tconst isFirstPage = computed(() => currentPage.value === 1);\n\tconst isLastPage = computed(() => currentPage.value === pageCount.value);\n\tif (isRef(page)) syncRef(page, currentPage, { direction: isReadonly(page) ? \"ltr\" : \"both\" });\n\tif (isRef(pageSize)) syncRef(pageSize, currentPageSize, { direction: isReadonly(pageSize) ? \"ltr\" : \"both\" });\n\tfunction prev() {\n\t\tcurrentPage.value--;\n\t}\n\tfunction next() {\n\t\tcurrentPage.value++;\n\t}\n\tconst returnValue = {\n\t\tcurrentPage,\n\t\tcurrentPageSize,\n\t\tpageCount,\n\t\tisFirstPage,\n\t\tisLastPage,\n\t\tprev,\n\t\tnext\n\t};\n\twatch(currentPage, () => {\n\t\tonPageChange(reactive(returnValue));\n\t});\n\twatch(currentPageSize, () => {\n\t\tonPageSizeChange(reactive(returnValue));\n\t});\n\twatch(pageCount, () => {\n\t\tonPageCountChange(reactive(returnValue));\n\t});\n\treturn returnValue;\n}\n//#endregion\n//#region useOnline/index.ts\n/**\n* Reactive online state.\n*\n* @see https://vueuse.org/useOnline\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useOnline(options = {}) {\n\tconst { isOnline } = useNetwork(options);\n\treturn isOnline;\n}\n//#endregion\n//#region usePageLeave/index.ts\n/**\n* Reactive state to show whether mouse leaves the page.\n*\n* @see https://vueuse.org/usePageLeave\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePageLeave(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isLeft = shallowRef(false);\n\tconst handler = (event) => {\n\t\tif (!window) return;\n\t\tevent = event || window.event;\n\t\tconst from = event.relatedTarget || event.toElement;\n\t\tisLeft.value = !from;\n\t};\n\tif (window) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(window, \"mouseout\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseleave\", handler, listenerOptions);\n\t\tuseEventListener(window.document, \"mouseenter\", handler, listenerOptions);\n\t}\n\treturn isLeft;\n}\n//#endregion\n//#region useScreenOrientation/index.ts\n/**\n* Reactive screen orientation\n*\n* @see https://vueuse.org/useScreenOrientation\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useScreenOrientation(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n\tconst screenOrientation = isSupported.value ? window.screen.orientation : {};\n\tconst orientation = shallowRef(screenOrientation.type);\n\tconst angle = shallowRef(screenOrientation.angle || 0);\n\tif (isSupported.value) useEventListener(window, \"orientationchange\", () => {\n\t\torientation.value = screenOrientation.type;\n\t\tangle.value = screenOrientation.angle;\n\t}, { passive: true });\n\tconst lockOrientation = (type) => {\n\t\tif (isSupported.value && typeof screenOrientation.lock === \"function\") return screenOrientation.lock(type);\n\t\treturn Promise.reject(/* @__PURE__ */ new Error(\"Not supported\"));\n\t};\n\tconst unlockOrientation = () => {\n\t\tif (isSupported.value && typeof screenOrientation.unlock === \"function\") screenOrientation.unlock();\n\t};\n\treturn {\n\t\tisSupported,\n\t\torientation,\n\t\tangle,\n\t\tlockOrientation,\n\t\tunlockOrientation\n\t};\n}\n//#endregion\n//#region useParallax/index.ts\n/**\n* Create parallax effect easily. It uses `useDeviceOrientation` and fallback to `useMouse`\n* if orientation is not supported.\n*\n* @param target\n* @param options\n*/\nfunction useParallax(target, options = {}) {\n\tconst { deviceOrientationTiltAdjust = (i) => i, deviceOrientationRollAdjust = (i) => i, mouseTiltAdjust = (i) => i, mouseRollAdjust = (i) => i, window = defaultWindow } = options;\n\tconst orientation = reactive(useDeviceOrientation({ window }));\n\tconst screenOrientation = reactive(useScreenOrientation({ window }));\n\tconst { elementX: x, elementY: y, elementWidth: width, elementHeight: height } = useMouseInElement(target, {\n\t\thandleOutside: false,\n\t\twindow\n\t});\n\tconst source = computed(() => {\n\t\tif (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0)) return \"deviceOrientation\";\n\t\treturn \"mouse\";\n\t});\n\treturn {\n\t\troll: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = -orientation.beta / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationRollAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = -(y.value - height.value / 2) / height.value;\n\t\t\t\treturn mouseRollAdjust(value);\n\t\t\t}\n\t\t}),\n\t\ttilt: computed(() => {\n\t\t\tif (source.value === \"deviceOrientation\") {\n\t\t\t\tlet value;\n\t\t\t\tswitch (screenOrientation.orientation) {\n\t\t\t\t\tcase \"landscape-primary\":\n\t\t\t\t\t\tvalue = orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"landscape-secondary\":\n\t\t\t\t\t\tvalue = -orientation.beta / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-primary\":\n\t\t\t\t\t\tvalue = orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"portrait-secondary\":\n\t\t\t\t\t\tvalue = -orientation.gamma / 90;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault: value = orientation.gamma / 90;\n\t\t\t\t}\n\t\t\t\treturn deviceOrientationTiltAdjust(value);\n\t\t\t} else {\n\t\t\t\tconst value = (x.value - width.value / 2) / width.value;\n\t\t\t\treturn mouseTiltAdjust(value);\n\t\t\t}\n\t\t}),\n\t\tsource\n\t};\n}\n//#endregion\n//#region useParentElement/index.ts\nfunction useParentElement(element = useCurrentElement()) {\n\tconst parentElement = shallowRef();\n\tconst update = () => {\n\t\tconst el = unrefElement(element);\n\t\tif (el) parentElement.value = el.parentElement;\n\t};\n\ttryOnMounted(update);\n\twatch(() => toValue(element), update);\n\treturn parentElement;\n}\n//#endregion\n//#region usePerformanceObserver/index.ts\n/**\n* Observe performance metrics.\n*\n* @see https://vueuse.org/usePerformanceObserver\n* @param options\n*/\nfunction usePerformanceObserver(options, callback) {\n\tconst { window = defaultWindow, immediate = true, ...performanceOptions } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => window && \"PerformanceObserver\" in window);\n\tlet observer;\n\tconst stop = () => {\n\t\tobserver === null || observer === void 0 || observer.disconnect();\n\t};\n\tconst start = () => {\n\t\tif (isSupported.value) {\n\t\t\tstop();\n\t\t\tobserver = new PerformanceObserver(callback);\n\t\t\tobserver.observe(performanceOptions);\n\t\t}\n\t};\n\ttryOnScopeDispose(stop);\n\tif (immediate) start();\n\treturn {\n\t\tisSupported,\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region usePointer/index.ts\nconst defaultState = {\n\tx: 0,\n\ty: 0,\n\tpointerId: 0,\n\tpressure: 0,\n\ttiltX: 0,\n\ttiltY: 0,\n\twidth: 0,\n\theight: 0,\n\ttwist: 0,\n\tpointerType: null\n};\nconst keys = /* #__PURE__ */ Object.keys(defaultState);\n/**\n* Reactive pointer state.\n*\n* @see https://vueuse.org/usePointer\n* @param options\n*/\nfunction usePointer(options = {}) {\n\tconst { target = defaultWindow } = options;\n\tconst isInside = shallowRef(false);\n\tconst state = shallowRef(options.initialValue || {});\n\tObject.assign(state.value, defaultState, state.value);\n\tconst handler = (event) => {\n\t\tisInside.value = true;\n\t\tif (options.pointerTypes && !options.pointerTypes.includes(event.pointerType)) return;\n\t\tstate.value = objectPick(event, keys, false);\n\t};\n\tif (target) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(target, [\n\t\t\t\"pointerdown\",\n\t\t\t\"pointermove\",\n\t\t\t\"pointerup\"\n\t\t], handler, listenerOptions);\n\t\tuseEventListener(target, \"pointerleave\", () => isInside.value = false, listenerOptions);\n\t}\n\treturn {\n\t\t...toRefs(state),\n\t\tisInside\n\t};\n}\n//#endregion\n//#region usePointerLock/index.ts\n/**\n* Reactive pointer lock.\n*\n* @see https://vueuse.org/usePointerLock\n* @param target\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePointerLock(target, options = {}) {\n\tconst { document = defaultDocument } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => document && \"pointerLockElement\" in document);\n\tconst element = shallowRef();\n\tconst triggerElement = shallowRef();\n\tlet targetElement;\n\tif (isSupported.value) {\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(document, \"pointerlockchange\", () => {\n\t\t\tvar _pointerLockElement;\n\t\t\tconst currentElement = (_pointerLockElement = document.pointerLockElement) !== null && _pointerLockElement !== void 0 ? _pointerLockElement : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\telement.value = document.pointerLockElement;\n\t\t\t\tif (!element.value) targetElement = triggerElement.value = null;\n\t\t\t}\n\t\t}, listenerOptions);\n\t\tuseEventListener(document, \"pointerlockerror\", () => {\n\t\t\tvar _pointerLockElement2;\n\t\t\tconst currentElement = (_pointerLockElement2 = document.pointerLockElement) !== null && _pointerLockElement2 !== void 0 ? _pointerLockElement2 : element.value;\n\t\t\tif (targetElement && currentElement === targetElement) {\n\t\t\t\tconst action = document.pointerLockElement ? \"release\" : \"acquire\";\n\t\t\t\tthrow new Error(`Failed to ${action} pointer lock.`);\n\t\t\t}\n\t\t}, listenerOptions);\n\t}\n\tasync function lock(e) {\n\t\tvar _unrefElement;\n\t\tif (!isSupported.value) throw new Error(\"Pointer Lock API is not supported by your browser.\");\n\t\ttriggerElement.value = e instanceof Event ? e.currentTarget : null;\n\t\ttargetElement = e instanceof Event ? (_unrefElement = unrefElement(target)) !== null && _unrefElement !== void 0 ? _unrefElement : triggerElement.value : unrefElement(e);\n\t\tif (!targetElement) throw new Error(\"Target element undefined.\");\n\t\ttargetElement.requestPointerLock();\n\t\treturn await until(element).toBe(targetElement);\n\t}\n\tasync function unlock() {\n\t\tif (!element.value) return false;\n\t\tdocument.exitPointerLock();\n\t\tawait until(element).toBeNull();\n\t\treturn true;\n\t}\n\treturn {\n\t\tisSupported,\n\t\telement,\n\t\ttriggerElement,\n\t\tlock,\n\t\tunlock\n\t};\n}\n//#endregion\n//#region usePointerSwipe/index.ts\n/**\n* Reactive swipe detection based on PointerEvents.\n*\n* @see https://vueuse.org/usePointerSwipe\n* @param target\n* @param options\n*/\nfunction usePointerSwipe(target, options = {}) {\n\tconst targetRef = toRef(target);\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, disableTextSelect = false } = options;\n\tconst posStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosStart = (x, y) => {\n\t\tposStart.x = x;\n\t\tposStart.y = y;\n\t};\n\tconst posEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst updatePosEnd = (x, y) => {\n\t\tposEnd.x = x;\n\t\tposEnd.y = y;\n\t};\n\tconst distanceX = computed(() => posStart.x - posEnd.x);\n\tconst distanceY = computed(() => posStart.y - posEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst isPointerDown = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(distanceX.value) > abs(distanceY.value)) return distanceX.value > 0 ? \"left\" : \"right\";\n\t\telse return distanceY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst eventIsAllowed = (e) => {\n\t\tvar _ref, _options$pointerTypes, _options$pointerTypes2;\n\t\tconst isReleasingButton = e.buttons === 0;\n\t\tconst isPrimaryButton = e.buttons === 1;\n\t\treturn (_ref = (_options$pointerTypes = (_options$pointerTypes2 = options.pointerTypes) === null || _options$pointerTypes2 === void 0 ? void 0 : _options$pointerTypes2.includes(e.pointerType)) !== null && _options$pointerTypes !== void 0 ? _options$pointerTypes : isReleasingButton || isPrimaryButton) !== null && _ref !== void 0 ? _ref : true;\n\t};\n\tconst listenerOptions = { passive: true };\n\tconst stops = [\n\t\tuseEventListener(target, \"pointerdown\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tisPointerDown.value = true;\n\t\t\tconst eventTarget = e.target;\n\t\t\teventTarget === null || eventTarget === void 0 || eventTarget.setPointerCapture(e.pointerId);\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosStart(x, y);\n\t\t\tupdatePosEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"pointermove\", (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (!isPointerDown.value) return;\n\t\t\tconst { clientX: x, clientY: y } = e;\n\t\t\tupdatePosEnd(x, y);\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"pointerup\", \"pointercancel\"], (e) => {\n\t\t\tif (!eventIsAllowed(e)) return;\n\t\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\t\tisPointerDown.value = false;\n\t\t\tisSwiping.value = false;\n\t\t}, listenerOptions)\n\t];\n\ttryOnMounted(() => {\n\t\tvar _targetRef$value;\n\t\t(_targetRef$value = targetRef.value) === null || _targetRef$value === void 0 || (_targetRef$value = _targetRef$value.style) === null || _targetRef$value === void 0 || _targetRef$value.setProperty(\"touch-action\", \"pan-y\");\n\t\tif (disableTextSelect) {\n\t\t\tvar _targetRef$value2, _targetRef$value3, _targetRef$value4;\n\t\t\t(_targetRef$value2 = targetRef.value) === null || _targetRef$value2 === void 0 || (_targetRef$value2 = _targetRef$value2.style) === null || _targetRef$value2 === void 0 || _targetRef$value2.setProperty(\"-webkit-user-select\", \"none\");\n\t\t\t(_targetRef$value3 = targetRef.value) === null || _targetRef$value3 === void 0 || (_targetRef$value3 = _targetRef$value3.style) === null || _targetRef$value3 === void 0 || _targetRef$value3.setProperty(\"-ms-user-select\", \"none\");\n\t\t\t(_targetRef$value4 = targetRef.value) === null || _targetRef$value4 === void 0 || (_targetRef$value4 = _targetRef$value4.style) === null || _targetRef$value4 === void 0 || _targetRef$value4.setProperty(\"user-select\", \"none\");\n\t\t}\n\t});\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping: shallowReadonly(isSwiping),\n\t\tdirection: shallowReadonly(direction),\n\t\tposStart: readonly(posStart),\n\t\tposEnd: readonly(posEnd),\n\t\tdistanceX,\n\t\tdistanceY,\n\t\tstop\n\t};\n}\n//#endregion\n//#region usePreferredColorScheme/index.ts\n/**\n* Reactive prefers-color-scheme media query.\n*\n* @see https://vueuse.org/usePreferredColorScheme\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredColorScheme(options) {\n\tconst isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n\tconst isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n\treturn computed(() => {\n\t\tif (isDark.value) return \"dark\";\n\t\tif (isLight.value) return \"light\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredContrast/index.ts\n/**\n* Reactive prefers-contrast media query.\n*\n* @see https://vueuse.org/usePreferredContrast\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredContrast(options) {\n\tconst isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n\tconst isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n\tconst isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n\treturn computed(() => {\n\t\tif (isMore.value) return \"more\";\n\t\tif (isLess.value) return \"less\";\n\t\tif (isCustom.value) return \"custom\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredLanguages/index.ts\n/**\n* Reactive Navigator Languages.\n*\n* @see https://vueuse.org/usePreferredLanguages\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredLanguages(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef([\"en\"]);\n\tconst navigator = window.navigator;\n\tconst value = shallowRef(navigator.languages);\n\tuseEventListener(window, \"languagechange\", () => {\n\t\tvalue.value = navigator.languages;\n\t}, { passive: true });\n\treturn value;\n}\n//#endregion\n//#region usePreferredReducedMotion/index.ts\n/**\n* Reactive prefers-reduced-motion media query.\n*\n* @see https://vueuse.org/usePreferredReducedMotion\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedMotion(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePreferredReducedTransparency/index.ts\n/**\n* Reactive prefers-reduced-transparency media query.\n*\n* @see https://vueuse.org/usePreferredReducedTransparency\n* @param [options]\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction usePreferredReducedTransparency(options) {\n\tconst isReduced = useMediaQuery(\"(prefers-reduced-transparency: reduce)\", options);\n\treturn computed(() => {\n\t\tif (isReduced.value) return \"reduce\";\n\t\treturn \"no-preference\";\n\t});\n}\n//#endregion\n//#region usePrevious/index.ts\nfunction usePrevious(value, initialValue) {\n\tconst previous = shallowRef(initialValue);\n\twatch(toRef(value), (_, oldValue) => {\n\t\tprevious.value = oldValue;\n\t}, { flush: \"sync\" });\n\treturn readonly(previous);\n}\n//#endregion\n//#region useScreenSafeArea/index.ts\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\n/**\n* Reactive `env(safe-area-inset-*)`\n*\n* @see https://vueuse.org/useScreenSafeArea\n*/\nfunction useScreenSafeArea() {\n\tconst top = shallowRef(\"\");\n\tconst right = shallowRef(\"\");\n\tconst bottom = shallowRef(\"\");\n\tconst left = shallowRef(\"\");\n\tif (isClient) {\n\t\tconst topCssVar = useCssVar(topVarName);\n\t\tconst rightCssVar = useCssVar(rightVarName);\n\t\tconst bottomCssVar = useCssVar(bottomVarName);\n\t\tconst leftCssVar = useCssVar(leftVarName);\n\t\ttopCssVar.value = \"env(safe-area-inset-top, 0px)\";\n\t\trightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n\t\tbottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n\t\tleftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n\t\ttryOnMounted(update);\n\t\tuseEventListener(\"resize\", useDebounceFn(update), { passive: true });\n\t}\n\tfunction update() {\n\t\ttop.value = getValue(topVarName);\n\t\tright.value = getValue(rightVarName);\n\t\tbottom.value = getValue(bottomVarName);\n\t\tleft.value = getValue(leftVarName);\n\t}\n\treturn {\n\t\ttop,\n\t\tright,\n\t\tbottom,\n\t\tleft,\n\t\tupdate\n\t};\n}\nfunction getValue(position) {\n\treturn getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n//#endregion\n//#region useScriptTag/index.ts\n/**\n* Async script tag loading.\n*\n* @see https://vueuse.org/useScriptTag\n* @param src\n* @param onLoaded\n* @param options\n*/\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n\tconst { immediate = true, manual = false, type = \"text/javascript\", async = true, crossOrigin, referrerPolicy, noModule, defer, document = defaultDocument, attrs = {}, nonce = void 0 } = options;\n\tconst scriptTag = shallowRef(null);\n\tlet _promise = null;\n\t/**\n\t* Load the script specified via `src`.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n\t\tconst resolveWithElement = (el) => {\n\t\t\tscriptTag.value = el;\n\t\t\tresolve(el);\n\t\t\treturn el;\n\t\t};\n\t\tif (!document) {\n\t\t\tresolve(false);\n\t\t\treturn;\n\t\t}\n\t\tlet shouldAppend = false;\n\t\tlet el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (!el) {\n\t\t\tel = document.createElement(\"script\");\n\t\t\tel.type = type;\n\t\t\tel.async = async;\n\t\t\tel.src = toValue(src);\n\t\t\tif (defer) el.defer = defer;\n\t\t\tif (crossOrigin) el.crossOrigin = crossOrigin;\n\t\t\tif (noModule) el.noModule = noModule;\n\t\t\tif (referrerPolicy) el.referrerPolicy = referrerPolicy;\n\t\t\tif (nonce) el.nonce = nonce;\n\t\t\tObject.entries(attrs).forEach(([name, value]) => el === null || el === void 0 ? void 0 : el.setAttribute(name, value));\n\t\t\tshouldAppend = true;\n\t\t} else if (el.hasAttribute(\"data-loaded\")) resolveWithElement(el);\n\t\tconst listenerOptions = { passive: true };\n\t\tuseEventListener(el, \"error\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"abort\", (event) => reject(event), listenerOptions);\n\t\tuseEventListener(el, \"load\", () => {\n\t\t\tel.setAttribute(\"data-loaded\", \"true\");\n\t\t\tonLoaded(el);\n\t\t\tresolveWithElement(el);\n\t\t}, listenerOptions);\n\t\tif (shouldAppend) el = document.head.appendChild(el);\n\t\tif (!waitForScriptLoad) resolveWithElement(el);\n\t});\n\t/**\n\t* Exposed singleton wrapper for `loadScript`, avoiding calling it twice.\n\t*\n\t* @param waitForScriptLoad Whether if the Promise should resolve once the \"load\" event is emitted by the <script> attribute, or right after appending it to the DOM.\n\t* @returns Promise<HTMLScriptElement>\n\t*/\n\tconst load = (waitForScriptLoad = true) => {\n\t\tif (!_promise) _promise = loadScript(waitForScriptLoad);\n\t\treturn _promise;\n\t};\n\t/**\n\t* Unload the script specified by `src`.\n\t*/\n\tconst unload = () => {\n\t\tif (!document) return;\n\t\t_promise = null;\n\t\tif (scriptTag.value) scriptTag.value = null;\n\t\tconst el = document.querySelector(`script[src=\"${toValue(src)}\"]`);\n\t\tif (el) document.head.removeChild(el);\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnUnmounted(unload);\n\treturn {\n\t\tscriptTag,\n\t\tload,\n\t\tunload\n\t};\n}\n//#endregion\n//#region useScrollLock/index.ts\nfunction checkOverflowScroll(ele) {\n\tconst style = window.getComputedStyle(ele);\n\tif (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientWidth < ele.scrollWidth || style.overflowY === \"auto\" && ele.clientHeight < ele.scrollHeight) return true;\n\telse {\n\t\tconst parent = ele.parentNode;\n\t\tif (!parent || parent.tagName === \"BODY\") return false;\n\t\treturn checkOverflowScroll(parent);\n\t}\n}\nfunction preventDefault(rawEvent) {\n\tconst e = rawEvent || window.event;\n\tconst _target = e.target;\n\tif (checkOverflowScroll(_target)) return false;\n\tif (e.touches.length > 1) return true;\n\tif (e.preventDefault) e.preventDefault();\n\treturn false;\n}\nconst elInitialOverflow = /* @__PURE__ */ new WeakMap();\n/**\n* Lock scrolling of the element.\n*\n* @see https://vueuse.org/useScrollLock\n* @param element\n*/\nfunction useScrollLock(element, initialState = false) {\n\tconst isLocked = shallowRef(initialState);\n\tlet stopTouchMoveListener = null;\n\tlet initialOverflow = \"\";\n\twatch(toRef(element), (el) => {\n\t\tconst target = resolveElement(toValue(el));\n\t\tif (target) {\n\t\t\tconst ele = target;\n\t\t\tif (!elInitialOverflow.get(ele)) elInitialOverflow.set(ele, ele.style.overflow);\n\t\t\tif (ele.style.overflow !== \"hidden\") initialOverflow = ele.style.overflow;\n\t\t\tif (ele.style.overflow === \"hidden\") return isLocked.value = true;\n\t\t\tif (isLocked.value) return ele.style.overflow = \"hidden\";\n\t\t}\n\t}, { immediate: true });\n\tconst lock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener = useEventListener(el, \"touchmove\", (e) => {\n\t\t\tpreventDefault(e);\n\t\t}, { passive: false });\n\t\tel.style.overflow = \"hidden\";\n\t\tisLocked.value = true;\n\t};\n\tconst unlock = () => {\n\t\tconst el = resolveElement(toValue(element));\n\t\tif (!el || !isLocked.value) return;\n\t\tif (isIOS) stopTouchMoveListener === null || stopTouchMoveListener === void 0 || stopTouchMoveListener();\n\t\tel.style.overflow = initialOverflow;\n\t\telInitialOverflow.delete(el);\n\t\tisLocked.value = false;\n\t};\n\ttryOnScopeDispose(unlock);\n\treturn computed({\n\t\tget() {\n\t\t\treturn isLocked.value;\n\t\t},\n\t\tset(v) {\n\t\t\tif (v) lock();\n\t\t\telse unlock();\n\t\t}\n\t});\n}\n//#endregion\n//#region useSessionStorage/index.ts\n/**\n* Reactive SessionStorage.\n*\n* @see https://vueuse.org/useSessionStorage\n* @param key\n* @param initialValue\n* @param options\n*/\nfunction useSessionStorage(key, initialValue, options = {}) {\n\tconst { window = defaultWindow } = options;\n\treturn useStorage(key, initialValue, window === null || window === void 0 ? void 0 : window.sessionStorage, options);\n}\n//#endregion\n//#region useShare/index.ts\n/**\n* Reactive Web Share API.\n*\n* @see https://vueuse.org/useShare\n* @param shareOptions\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useShare(shareOptions = {}, options = {}) {\n\tconst { navigator = defaultNavigator } = options;\n\tconst _navigator = navigator;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => _navigator && \"canShare\" in _navigator);\n\tconst share = async (overrideOptions = {}) => {\n\t\tif (isSupported.value) {\n\t\t\tconst data = {\n\t\t\t\t...toValue(shareOptions),\n\t\t\t\t...toValue(overrideOptions)\n\t\t\t};\n\t\t\tlet granted = false;\n\t\t\tif (_navigator.canShare) granted = _navigator.canShare(data);\n\t\t\tif (granted) return _navigator.share(data);\n\t\t}\n\t};\n\treturn {\n\t\tisSupported,\n\t\tshare\n\t};\n}\n//#endregion\n//#region useSorted/index.ts\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n\tconst [source] = args;\n\tlet compareFn = defaultCompare;\n\tlet options = {};\n\tif (args.length === 2) if (typeof args[1] === \"object\") {\n\t\tvar _options$compareFn;\n\t\toptions = args[1];\n\t\tcompareFn = (_options$compareFn = options.compareFn) !== null && _options$compareFn !== void 0 ? _options$compareFn : defaultCompare;\n\t} else {\n\t\tvar _args$;\n\t\tcompareFn = (_args$ = args[1]) !== null && _args$ !== void 0 ? _args$ : defaultCompare;\n\t}\n\telse if (args.length > 2) {\n\t\tvar _args$2, _args$3;\n\t\tcompareFn = (_args$2 = args[1]) !== null && _args$2 !== void 0 ? _args$2 : defaultCompare;\n\t\toptions = (_args$3 = args[2]) !== null && _args$3 !== void 0 ? _args$3 : {};\n\t}\n\tconst { dirty = false, sortFn = defaultSortFn } = options;\n\tif (!dirty) return computed(() => sortFn([...toValue(source)], compareFn));\n\twatchEffect(() => {\n\t\tconst result = sortFn(toValue(source), compareFn);\n\t\tif (isRef(source)) source.value = result;\n\t\telse source.splice(0, source.length, ...result);\n\t});\n\treturn source;\n}\n//#endregion\n//#region useSpeechRecognition/index.ts\n/**\n* Reactive SpeechRecognition.\n*\n* @see https://vueuse.org/useSpeechRecognition\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition SpeechRecognition\n* @param options\n*/\nfunction useSpeechRecognition(options = {}) {\n\tconst { interimResults = true, continuous = true, maxAlternatives = 1, window = defaultWindow } = options;\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst isListening = shallowRef(false);\n\tconst isFinal = shallowRef(false);\n\tconst result = shallowRef(\"\");\n\tconst confidence = shallowRef(0);\n\tconst error = shallowRef(void 0);\n\tlet recognition;\n\tconst start = () => {\n\t\tisListening.value = true;\n\t};\n\tconst stop = () => {\n\t\tisListening.value = false;\n\t};\n\tconst toggle = (value = !isListening.value) => {\n\t\tif (value) start();\n\t\telse stop();\n\t};\n\tconst SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n\tconst isSupported = /* @__PURE__ */ useSupported(() => SpeechRecognition);\n\tif (isSupported.value) {\n\t\trecognition = new SpeechRecognition();\n\t\trecognition.continuous = continuous;\n\t\trecognition.interimResults = interimResults;\n\t\trecognition.lang = toValue(lang);\n\t\trecognition.maxAlternatives = maxAlternatives;\n\t\trecognition.onstart = () => {\n\t\t\tisListening.value = true;\n\t\t\tisFinal.value = false;\n\t\t};\n\t\twatch(lang, (lang) => {\n\t\t\tif (recognition && !isListening.value) recognition.lang = lang;\n\t\t});\n\t\trecognition.onresult = (event) => {\n\t\t\tconst currentResult = event.results[event.resultIndex];\n\t\t\tconst { transcript, confidence: alternativeConfidence } = currentResult[0];\n\t\t\tisFinal.value = currentResult.isFinal;\n\t\t\tresult.value = transcript;\n\t\t\tconfidence.value = alternativeConfidence;\n\t\t\terror.value = void 0;\n\t\t};\n\t\trecognition.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\trecognition.onend = () => {\n\t\t\tisListening.value = false;\n\t\t\trecognition.lang = toValue(lang);\n\t\t};\n\t\twatch(isListening, (newValue, oldValue) => {\n\t\t\tif (newValue === oldValue) return;\n\t\t\ttry {\n\t\t\t\tif (newValue) recognition.start();\n\t\t\t\telse recognition.stop();\n\t\t\t} catch (err) {\n\t\t\t\terror.value = err;\n\t\t\t}\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisListening,\n\t\tisFinal: shallowReadonly(isFinal),\n\t\trecognition,\n\t\tresult: shallowReadonly(result),\n\t\tconfidence: shallowReadonly(confidence),\n\t\terror,\n\t\ttoggle,\n\t\tstart,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useSpeechSynthesis/index.ts\n/**\n* Reactive SpeechSynthesis.\n*\n* @see https://vueuse.org/useSpeechSynthesis\n* @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis SpeechSynthesis\n*/\nfunction useSpeechSynthesis(text, options = {}) {\n\tconst { pitch = 1, rate = 1, volume = 1, window = defaultWindow, onBoundary } = options;\n\tconst synth = window && window.speechSynthesis;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => synth);\n\tconst isPlaying = shallowRef(false);\n\tconst status = shallowRef(\"init\");\n\tconst spokenText = toRef(text || \"\");\n\tconst lang = toRef(options.lang || \"en-US\");\n\tconst error = shallowRef(void 0);\n\tconst toggle = (value = !isPlaying.value) => {\n\t\tisPlaying.value = value;\n\t};\n\tconst bindEventsForUtterance = (utterance) => {\n\t\tutterance.lang = toValue(lang);\n\t\tutterance.voice = toValue(options.voice) || null;\n\t\tutterance.pitch = toValue(pitch);\n\t\tutterance.rate = toValue(rate);\n\t\tutterance.volume = toValue(volume);\n\t\tutterance.onstart = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onpause = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"pause\";\n\t\t};\n\t\tutterance.onresume = () => {\n\t\t\tisPlaying.value = true;\n\t\t\tstatus.value = \"play\";\n\t\t};\n\t\tutterance.onend = () => {\n\t\t\tisPlaying.value = false;\n\t\t\tstatus.value = \"end\";\n\t\t};\n\t\tutterance.onerror = (event) => {\n\t\t\terror.value = event;\n\t\t};\n\t\tutterance.onboundary = (event) => {\n\t\t\tonBoundary === null || onBoundary === void 0 || onBoundary(event);\n\t\t};\n\t};\n\tconst utterance = computed(() => {\n\t\tisPlaying.value = false;\n\t\tstatus.value = \"init\";\n\t\tconst newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n\t\tbindEventsForUtterance(newUtterance);\n\t\treturn newUtterance;\n\t});\n\tconst speak = () => {\n\t\tsynth.cancel();\n\t\tif (utterance) synth.speak(utterance.value);\n\t};\n\tconst stop = () => {\n\t\tsynth.cancel();\n\t\tisPlaying.value = false;\n\t};\n\tif (isSupported.value) {\n\t\tbindEventsForUtterance(utterance.value);\n\t\twatch(lang, (lang) => {\n\t\t\tif (utterance.value && !isPlaying.value) utterance.value.lang = lang;\n\t\t});\n\t\tif (options.voice) watch(options.voice, () => {\n\t\t\tsynth.cancel();\n\t\t});\n\t\twatch(isPlaying, () => {\n\t\t\tif (isPlaying.value) synth.resume();\n\t\t\telse synth.pause();\n\t\t});\n\t}\n\ttryOnScopeDispose(() => {\n\t\tisPlaying.value = false;\n\t});\n\treturn {\n\t\tisSupported,\n\t\tisPlaying,\n\t\tstatus,\n\t\tutterance,\n\t\terror,\n\t\tstop,\n\t\ttoggle,\n\t\tspeak\n\t};\n}\n//#endregion\n//#region useStepper/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useStepper(steps, initialStep) {\n\tconst stepsRef = ref(steps);\n\tconst stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n\tconst index = ref(stepNames.value.indexOf(initialStep !== null && initialStep !== void 0 ? initialStep : stepNames.value[0]));\n\tconst current = computed(() => at(index.value));\n\tconst isFirst = computed(() => index.value === 0);\n\tconst isLast = computed(() => index.value === stepNames.value.length - 1);\n\tconst next = computed(() => stepNames.value[index.value + 1]);\n\tconst previous = computed(() => stepNames.value[index.value - 1]);\n\tfunction at(index) {\n\t\tif (Array.isArray(stepsRef.value)) return stepsRef.value[index];\n\t\treturn stepsRef.value[stepNames.value[index]];\n\t}\n\tfunction get(step) {\n\t\tif (!stepNames.value.includes(step)) return;\n\t\treturn at(stepNames.value.indexOf(step));\n\t}\n\tfunction goTo(step) {\n\t\tif (stepNames.value.includes(step)) index.value = stepNames.value.indexOf(step);\n\t}\n\tfunction goToNext() {\n\t\tif (isLast.value) return;\n\t\tindex.value++;\n\t}\n\tfunction goToPrevious() {\n\t\tif (isFirst.value) return;\n\t\tindex.value--;\n\t}\n\tfunction goBackTo(step) {\n\t\tif (isAfter(step)) goTo(step);\n\t}\n\tfunction isNext(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value + 1;\n\t}\n\tfunction isPrevious(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value - 1;\n\t}\n\tfunction isCurrent(step) {\n\t\treturn stepNames.value.indexOf(step) === index.value;\n\t}\n\tfunction isBefore(step) {\n\t\treturn index.value < stepNames.value.indexOf(step);\n\t}\n\tfunction isAfter(step) {\n\t\treturn index.value > stepNames.value.indexOf(step);\n\t}\n\treturn {\n\t\tsteps: stepsRef,\n\t\tstepNames,\n\t\tindex,\n\t\tcurrent,\n\t\tnext,\n\t\tprevious,\n\t\tisFirst,\n\t\tisLast,\n\t\tat,\n\t\tget,\n\t\tgoTo,\n\t\tgoToNext,\n\t\tgoToPrevious,\n\t\tgoBackTo,\n\t\tisNext,\n\t\tisPrevious,\n\t\tisCurrent,\n\t\tisBefore,\n\t\tisAfter\n\t};\n}\n//#endregion\n//#region useStorageAsync/index.ts\n/**\n* Reactive Storage with async support.\n*\n* @see https://vueuse.org/useStorageAsync\n* @param key\n* @param initialValue\n* @param storage\n* @param options\n*/\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n\tvar _options$serializer;\n\tconst { flush = \"pre\", deep = true, listenToStorageChanges = true, writeDefaults = true, mergeDefaults = false, shallow, window = defaultWindow, eventFilter, onError = (e) => {\n\t\tconsole.error(e);\n\t}, onReady } = options;\n\tconst rawInit = toValue(initialValue);\n\tconst type = guessSerializerType(rawInit);\n\tconst data = (shallow ? shallowRef : ref)(toValue(initialValue));\n\tconst serializer = (_options$serializer = options.serializer) !== null && _options$serializer !== void 0 ? _options$serializer : StorageSerializers[type];\n\tif (!storage) try {\n\t\tstorage = getSSRHandler(\"getDefaultStorageAsync\", () => defaultWindow === null || defaultWindow === void 0 ? void 0 : defaultWindow.localStorage)();\n\t} catch (e) {\n\t\tonError(e);\n\t}\n\tasync function read(event) {\n\t\tif (!storage || event && event.key !== key) return;\n\t\ttry {\n\t\t\tconst rawValue = event ? event.newValue : await storage.getItem(key);\n\t\t\tif (rawValue == null) {\n\t\t\t\tdata.value = rawInit;\n\t\t\t\tif (writeDefaults && rawInit !== null) await storage.setItem(key, await serializer.write(rawInit));\n\t\t\t} else if (mergeDefaults) {\n\t\t\t\tconst value = await serializer.read(rawValue);\n\t\t\t\tif (typeof mergeDefaults === \"function\") data.value = mergeDefaults(value, rawInit);\n\t\t\t\telse if (type === \"object\" && !Array.isArray(value)) data.value = {\n\t\t\t\t\t...rawInit,\n\t\t\t\t\t...value\n\t\t\t\t};\n\t\t\t\telse data.value = value;\n\t\t\t} else data.value = await serializer.read(rawValue);\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}\n\tconst promise = new Promise((resolve) => {\n\t\tread().then(() => {\n\t\t\tonReady === null || onReady === void 0 || onReady(data.value);\n\t\t\tresolve(data);\n\t\t});\n\t});\n\tif (window && listenToStorageChanges) useEventListener(window, \"storage\", (e) => Promise.resolve().then(() => read(e)), { passive: true });\n\tif (storage) watchWithFilter(data, async () => {\n\t\ttry {\n\t\t\tif (data.value == null) await storage.removeItem(key);\n\t\t\telse await storage.setItem(key, await serializer.write(data.value));\n\t\t} catch (e) {\n\t\t\tonError(e);\n\t\t}\n\t}, {\n\t\tflush,\n\t\tdeep,\n\t\teventFilter\n\t});\n\tObject.assign(data, {\n\t\tthen: promise.then.bind(promise),\n\t\tcatch: promise.catch.bind(promise)\n\t});\n\treturn data;\n}\n//#endregion\n//#region useStyleTag/index.ts\nlet _id = 0;\nconst _refCount = /* @__PURE__ */ new WeakMap();\n/**\n* Inject <style> element in head.\n*\n* Overload: Omitted id\n*\n* @see https://vueuse.org/useStyleTag\n* @param css\n* @param options\n*/\nfunction useStyleTag(css, options = {}) {\n\tconst isLoaded = shallowRef(false);\n\tconst { document = defaultDocument, immediate = true, manual = false, id = `vueuse_styletag_${++_id}` } = options;\n\tconst cssRef = shallowRef(css);\n\tlet stop = () => {};\n\tconst load = () => {\n\t\tvar _refCount$get;\n\t\tif (!document) return;\n\t\tconst el = document.getElementById(id) || document.createElement(\"style\");\n\t\tif (!el.isConnected) {\n\t\t\tel.id = id;\n\t\t\tif (options.nonce) el.nonce = options.nonce;\n\t\t\tif (options.media) el.media = options.media;\n\t\t\tdocument.head.appendChild(el);\n\t\t}\n\t\tif (isLoaded.value) return;\n\t\t_refCount.set(el, ((_refCount$get = _refCount.get(el)) !== null && _refCount$get !== void 0 ? _refCount$get : 0) + 1);\n\t\tstop = watch(cssRef, (value) => {\n\t\t\tel.textContent = value;\n\t\t}, { immediate: true });\n\t\tisLoaded.value = true;\n\t};\n\tconst unload = () => {\n\t\tif (!document || !isLoaded.value) return;\n\t\tstop();\n\t\tconst el = document.getElementById(id);\n\t\tif (el) {\n\t\t\tvar _refCount$get2;\n\t\t\tconst count = ((_refCount$get2 = _refCount.get(el)) !== null && _refCount$get2 !== void 0 ? _refCount$get2 : 1) - 1;\n\t\t\tif (count <= 0) {\n\t\t\t\t_refCount.delete(el);\n\t\t\t\tdocument.head.removeChild(el);\n\t\t\t} else _refCount.set(el, count);\n\t\t}\n\t\tisLoaded.value = false;\n\t};\n\tif (immediate && !manual) tryOnMounted(load);\n\tif (!manual) tryOnScopeDispose(unload);\n\treturn {\n\t\tid,\n\t\tcss: cssRef,\n\t\tunload,\n\t\tload,\n\t\tisLoaded: shallowReadonly(isLoaded)\n\t};\n}\n//#endregion\n//#region useSwipe/index.ts\n/**\n* Reactive swipe detection.\n*\n* @see https://vueuse.org/useSwipe\n* @param target\n* @param options\n*/\nfunction useSwipe(target, options = {}) {\n\tconst { threshold = 50, onSwipe, onSwipeEnd, onSwipeStart, passive = true } = options;\n\tconst coordsStart = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst coordsEnd = reactive({\n\t\tx: 0,\n\t\ty: 0\n\t});\n\tconst diffX = computed(() => coordsStart.x - coordsEnd.x);\n\tconst diffY = computed(() => coordsStart.y - coordsEnd.y);\n\tconst { max, abs } = Math;\n\tconst isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n\tconst isSwiping = shallowRef(false);\n\tconst direction = computed(() => {\n\t\tif (!isThresholdExceeded.value) return \"none\";\n\t\tif (abs(diffX.value) > abs(diffY.value)) return diffX.value > 0 ? \"left\" : \"right\";\n\t\telse return diffY.value > 0 ? \"up\" : \"down\";\n\t});\n\tconst getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n\tconst updateCoordsStart = (x, y) => {\n\t\tcoordsStart.x = x;\n\t\tcoordsStart.y = y;\n\t};\n\tconst updateCoordsEnd = (x, y) => {\n\t\tcoordsEnd.x = x;\n\t\tcoordsEnd.y = y;\n\t};\n\tconst listenerOptions = {\n\t\tpassive,\n\t\tcapture: !passive\n\t};\n\tconst onTouchEnd = (e) => {\n\t\tif (isSwiping.value) onSwipeEnd === null || onSwipeEnd === void 0 || onSwipeEnd(e, direction.value);\n\t\tisSwiping.value = false;\n\t};\n\tconst stops = [\n\t\tuseEventListener(target, \"touchstart\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsStart(x, y);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tonSwipeStart === null || onSwipeStart === void 0 || onSwipeStart(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, \"touchmove\", (e) => {\n\t\t\tif (e.touches.length !== 1) return;\n\t\t\tconst [x, y] = getTouchEventCoords(e);\n\t\t\tupdateCoordsEnd(x, y);\n\t\t\tif (listenerOptions.capture && !listenerOptions.passive && Math.abs(diffX.value) > Math.abs(diffY.value)) e.preventDefault();\n\t\t\tif (!isSwiping.value && isThresholdExceeded.value) isSwiping.value = true;\n\t\t\tif (isSwiping.value) onSwipe === null || onSwipe === void 0 || onSwipe(e);\n\t\t}, listenerOptions),\n\t\tuseEventListener(target, [\"touchend\", \"touchcancel\"], onTouchEnd, listenerOptions)\n\t];\n\tconst stop = () => stops.forEach((s) => s());\n\treturn {\n\t\tisSwiping,\n\t\tdirection,\n\t\tcoordsStart,\n\t\tcoordsEnd,\n\t\tlengthX: diffX,\n\t\tlengthY: diffY,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useTemplateRefsList/index.ts\n/* @__NO_SIDE_EFFECTS__ */\nfunction useTemplateRefsList() {\n\tconst refs = ref([]);\n\trefs.value.set = (el) => {\n\t\tif (el) refs.value.push(el);\n\t};\n\tonBeforeUpdate(() => {\n\t\trefs.value.length = 0;\n\t});\n\treturn refs;\n}\n//#endregion\n//#region useTextDirection/index.ts\n/**\n* Reactive dir of the element's text.\n*\n* @see https://vueuse.org/useTextDirection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextDirection(options = {}) {\n\tconst { document = defaultDocument, selector = \"html\", observe = false, initialValue = \"ltr\" } = options;\n\tfunction getValue() {\n\t\tvar _ref, _document$querySelect;\n\t\treturn (_ref = document === null || document === void 0 || (_document$querySelect = document.querySelector(selector)) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.getAttribute(\"dir\")) !== null && _ref !== void 0 ? _ref : initialValue;\n\t}\n\tconst dir = shallowRef(getValue());\n\ttryOnMounted(() => dir.value = getValue());\n\tif (observe && document) useMutationObserver(document.querySelector(selector), () => dir.value = getValue(), { attributes: true });\n\treturn computed({\n\t\tget() {\n\t\t\treturn dir.value;\n\t\t},\n\t\tset(v) {\n\t\t\tvar _document$querySelect2, _document$querySelect3;\n\t\t\tdir.value = v;\n\t\t\tif (!document) return;\n\t\t\tif (dir.value) (_document$querySelect2 = document.querySelector(selector)) === null || _document$querySelect2 === void 0 || _document$querySelect2.setAttribute(\"dir\", dir.value);\n\t\t\telse (_document$querySelect3 = document.querySelector(selector)) === null || _document$querySelect3 === void 0 || _document$querySelect3.removeAttribute(\"dir\");\n\t\t}\n\t});\n}\n//#endregion\n//#region useTextSelection/index.ts\nfunction getRangesFromSelection(selection) {\n\tvar _selection$rangeCount;\n\tconst rangeCount = (_selection$rangeCount = selection.rangeCount) !== null && _selection$rangeCount !== void 0 ? _selection$rangeCount : 0;\n\treturn Array.from({ length: rangeCount }, (_, i) => selection.getRangeAt(i));\n}\n/**\n* Reactively track user text selection based on [`Window.getSelection`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection).\n*\n* @see https://vueuse.org/useTextSelection\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTextSelection(options = {}) {\n\tvar _window$getSelection;\n\tconst { window = defaultWindow } = options;\n\tconst selection = shallowRef((_window$getSelection = window === null || window === void 0 ? void 0 : window.getSelection()) !== null && _window$getSelection !== void 0 ? _window$getSelection : null);\n\tconst text = computed(() => {\n\t\tvar _selection$value$toSt, _selection$value;\n\t\treturn (_selection$value$toSt = (_selection$value = selection.value) === null || _selection$value === void 0 ? void 0 : _selection$value.toString()) !== null && _selection$value$toSt !== void 0 ? _selection$value$toSt : \"\";\n\t});\n\tconst ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n\tconst rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n\tfunction onSelectionChange() {\n\t\tselection.value = null;\n\t\tif (window) selection.value = window.getSelection();\n\t}\n\tif (window) useEventListener(window.document, \"selectionchange\", onSelectionChange, { passive: true });\n\treturn {\n\t\ttext,\n\t\trects,\n\t\tranges,\n\t\tselection\n\t};\n}\n//#endregion\n//#region useTextareaAutosize/index.ts\n/**\n* Call window.requestAnimationFrame(), if not available, just call the function\n*\n* @param window\n* @param fn\n*/\nfunction tryRequestAnimationFrame(window = defaultWindow, fn) {\n\tif (window && typeof window.requestAnimationFrame === \"function\") window.requestAnimationFrame(fn);\n\telse fn();\n}\nfunction useTextareaAutosize(options = {}) {\n\tvar _options$input, _options$styleProp;\n\tconst { window = defaultWindow } = options;\n\tconst textarea = toRef(options === null || options === void 0 ? void 0 : options.element);\n\tconst input = toRef((_options$input = options === null || options === void 0 ? void 0 : options.input) !== null && _options$input !== void 0 ? _options$input : \"\");\n\tconst styleProp = (_options$styleProp = options === null || options === void 0 ? void 0 : options.styleProp) !== null && _options$styleProp !== void 0 ? _options$styleProp : \"height\";\n\tconst textareaScrollHeight = shallowRef(1);\n\tconst textareaOldWidth = shallowRef(0);\n\tfunction triggerResize() {\n\t\tvar _textarea$value;\n\t\tif (!textarea.value) return;\n\t\tlet height = \"\";\n\t\tconst maxHeight = options === null || options === void 0 ? void 0 : options.maxHeight;\n\t\ttextarea.value.style[styleProp] = \"1px\";\n\t\ttextareaScrollHeight.value = (_textarea$value = textarea.value) === null || _textarea$value === void 0 ? void 0 : _textarea$value.scrollHeight;\n\t\tconst _styleTarget = toValue(options === null || options === void 0 ? void 0 : options.styleTarget);\n\t\tconst styleHeight = maxHeight != null ? `${Math.min(textareaScrollHeight.value, maxHeight)}px` : `${textareaScrollHeight.value}px`;\n\t\tif (_styleTarget) _styleTarget.style[styleProp] = styleHeight;\n\t\telse height = styleHeight;\n\t\ttextarea.value.style[styleProp] = height;\n\t}\n\twatch([input, textarea], () => nextTick(triggerResize), { immediate: true });\n\twatch(textareaScrollHeight, () => {\n\t\tvar _options$onResize;\n\t\treturn options === null || options === void 0 || (_options$onResize = options.onResize) === null || _options$onResize === void 0 ? void 0 : _options$onResize.call(options);\n\t});\n\tuseResizeObserver(textarea, ([{ contentRect }]) => {\n\t\tif (textareaOldWidth.value === contentRect.width) return;\n\t\ttryRequestAnimationFrame(window, () => {\n\t\t\ttextareaOldWidth.value = contentRect.width;\n\t\t\ttriggerResize();\n\t\t});\n\t});\n\tif (options === null || options === void 0 ? void 0 : options.watch) watch(options.watch, triggerResize, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\treturn {\n\t\ttextarea,\n\t\tinput,\n\t\ttriggerResize\n\t};\n}\n//#endregion\n//#region useThrottledRefHistory/index.ts\n/**\n* Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with throttled filter.\n*\n* @see https://vueuse.org/useThrottledRefHistory\n* @param source\n* @param options\n*/\nfunction useThrottledRefHistory(source, options = {}) {\n\tconst { throttle = 200, trailing = true } = options;\n\tconst filter = throttleFilter(throttle, trailing);\n\treturn { ...useRefHistory(source, {\n\t\t...options,\n\t\teventFilter: filter\n\t}) };\n}\n//#endregion\n//#region useTimeAgo/index.ts\nconst DEFAULT_UNITS = [\n\t{\n\t\tmax: 6e4,\n\t\tvalue: 1e3,\n\t\tname: \"second\"\n\t},\n\t{\n\t\tmax: 276e4,\n\t\tvalue: 6e4,\n\t\tname: \"minute\"\n\t},\n\t{\n\t\tmax: 72e6,\n\t\tvalue: 36e5,\n\t\tname: \"hour\"\n\t},\n\t{\n\t\tmax: 5184e5,\n\t\tvalue: 864e5,\n\t\tname: \"day\"\n\t},\n\t{\n\t\tmax: 24192e5,\n\t\tvalue: 6048e5,\n\t\tname: \"week\"\n\t},\n\t{\n\t\tmax: 28512e6,\n\t\tvalue: 2592e6,\n\t\tname: \"month\"\n\t},\n\t{\n\t\tmax: Number.POSITIVE_INFINITY,\n\t\tvalue: 31536e6,\n\t\tname: \"year\"\n\t}\n];\nconst DEFAULT_MESSAGES = {\n\tjustNow: \"just now\",\n\tpast: (n) => /\\d/.test(n) ? `${n} ago` : n,\n\tfuture: (n) => /\\d/.test(n) ? `in ${n}` : n,\n\tmonth: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n\tyear: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n\tday: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n\tweek: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n\thour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n\tminute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n\tsecond: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n\tinvalid: \"\"\n};\nfunction DEFAULT_FORMATTER(date) {\n\treturn date.toISOString().slice(0, 10);\n}\nfunction getDefaultScheduler$4(options) {\n\tif (\"updateInterval\" in options) {\n\t\tconst { updateInterval = 3e4 } = options;\n\t\treturn (cb) => useIntervalFn(cb, updateInterval);\n\t}\n\treturn (cb) => useIntervalFn(cb, 3e4);\n}\n/**\n* Reactive time ago formatter.\n*\n* @see https://vueuse.org/useTimeAgo\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useTimeAgo(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$4(options) } = options;\n\tconst { now, ...controls } = useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst timeAgo = computed(() => formatTimeAgo(new Date(toValue(time)), options, toValue(now)));\n\tif (exposeControls) return {\n\t\ttimeAgo,\n\t\t...controls\n\t};\n\telse return timeAgo;\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n\tconst { max, messages = DEFAULT_MESSAGES, fullDateFormatter = DEFAULT_FORMATTER, units = DEFAULT_UNITS, showSecond = false, rounding = \"round\" } = options;\n\tconst roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n\tconst diff = +now - +from;\n\tconst absDiff = Math.abs(diff);\n\tfunction getValue(diff, unit) {\n\t\treturn roundFn(Math.abs(diff) / unit.value);\n\t}\n\tfunction format(diff, unit) {\n\t\tconst val = getValue(diff, unit);\n\t\tconst past = diff > 0;\n\t\tconst str = applyFormat(unit.name, val, past);\n\t\treturn applyFormat(past ? \"past\" : \"future\", str, past);\n\t}\n\tfunction applyFormat(name, val, isPast) {\n\t\tconst formatter = messages[name];\n\t\tif (typeof formatter === \"function\") return formatter(val, isPast);\n\t\treturn formatter.replace(\"{0}\", val.toString());\n\t}\n\tif (absDiff < 6e4 && !showSecond) return messages.justNow;\n\tif (typeof max === \"number\" && absDiff > max) return fullDateFormatter(new Date(from));\n\tif (typeof max === \"string\") {\n\t\tvar _units$find;\n\t\tconst unitMax = (_units$find = units.find((i) => i.name === max)) === null || _units$find === void 0 ? void 0 : _units$find.max;\n\t\tif (unitMax && absDiff > unitMax) return fullDateFormatter(new Date(from));\n\t}\n\tfor (const [idx, unit] of units.entries()) {\n\t\tif (getValue(diff, unit) <= 0 && units[idx - 1]) return format(diff, units[idx - 1]);\n\t\tif (absDiff < unit.max) return format(diff, unit);\n\t}\n\treturn messages.invalid;\n}\n//#endregion\n//#region useTimeAgoIntl/index.ts\nconst UNITS = [\n\t{\n\t\tname: \"year\",\n\t\tms: 31536e6\n\t},\n\t{\n\t\tname: \"month\",\n\t\tms: 2592e6\n\t},\n\t{\n\t\tname: \"week\",\n\t\tms: 6048e5\n\t},\n\t{\n\t\tname: \"day\",\n\t\tms: 864e5\n\t},\n\t{\n\t\tname: \"hour\",\n\t\tms: 36e5\n\t},\n\t{\n\t\tname: \"minute\",\n\t\tms: 6e4\n\t},\n\t{\n\t\tname: \"second\",\n\t\tms: 1e3\n\t}\n];\nfunction getDefaultScheduler$3(options) {\n\tif (\"updateInterval\" in options) {\n\t\tconst { updateInterval = 3e4 } = options;\n\t\treturn (cb) => useIntervalFn(cb, updateInterval);\n\t}\n\treturn (cb) => useIntervalFn(cb, 3e4);\n}\nfunction useTimeAgoIntl(time, options = {}) {\n\tconst { controls: exposeControls = false, scheduler = getDefaultScheduler$3(options) } = options;\n\tconst { now, ...controls } = useNow({\n\t\tscheduler,\n\t\tcontrols: true\n\t});\n\tconst result = computed(() => getTimeAgoIntlResult(new Date(toValue(time)), options, toValue(now)));\n\tconst parts = computed(() => result.value.parts);\n\tconst timeAgoIntl = computed(() => formatTimeAgoIntlParts(parts.value, {\n\t\t...options,\n\t\tlocale: result.value.resolvedLocale\n\t}));\n\treturn exposeControls ? {\n\t\ttimeAgoIntl,\n\t\tparts,\n\t\t...controls\n\t} : timeAgoIntl;\n}\n/**\n* Non-reactive version of useTimeAgoIntl\n*/\nfunction formatTimeAgoIntl(from, options = {}, now = Date.now()) {\n\tconst { parts, resolvedLocale } = getTimeAgoIntlResult(from, options, now);\n\treturn formatTimeAgoIntlParts(parts, {\n\t\t...options,\n\t\tlocale: resolvedLocale\n\t});\n}\n/**\n* Get parts from `Intl.RelativeTimeFormat.formatToParts`.\n*/\nfunction getTimeAgoIntlResult(from, options = {}, now = Date.now()) {\n\tvar _options$units;\n\tconst { locale, relativeTimeFormatOptions = { numeric: \"auto\" } } = options;\n\tconst rtf = new Intl.RelativeTimeFormat(locale, relativeTimeFormatOptions);\n\tconst { locale: resolvedLocale } = rtf.resolvedOptions();\n\tconst diff = +from - +now;\n\tconst absDiff = Math.abs(diff);\n\tconst units = (_options$units = options.units) !== null && _options$units !== void 0 ? _options$units : UNITS;\n\tfor (const { name, ms } of units) if (absDiff >= ms) return {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(Math.round(diff / ms), name)\n\t};\n\treturn {\n\t\tresolvedLocale,\n\t\tparts: rtf.formatToParts(0, units[units.length - 1].name)\n\t};\n}\n/**\n* Format parts into a string\n*/\nfunction formatTimeAgoIntlParts(parts, options = {}) {\n\tconst { insertSpace = true, joinParts, locale } = options;\n\tif (typeof joinParts === \"function\") return joinParts(parts, locale);\n\tif (!insertSpace) return parts.map((part) => part.value).join(\"\");\n\treturn parts.map((part) => part.value.trim()).join(\" \");\n}\n//#endregion\n//#region useTimeoutPoll/index.ts\nfunction useTimeoutPoll(fn, interval, options = {}) {\n\tconst { immediate = true, immediateCallback = false } = options;\n\tconst { start } = useTimeoutFn(loop, interval, { immediate });\n\tconst isActive = shallowRef(false);\n\tasync function loop() {\n\t\tif (!isActive.value) return;\n\t\tawait fn();\n\t\tstart();\n\t}\n\tfunction resume() {\n\t\tif (!isActive.value) {\n\t\t\tisActive.value = true;\n\t\t\tif (immediateCallback) fn();\n\t\t\tstart();\n\t\t}\n\t}\n\tfunction pause() {\n\t\tisActive.value = false;\n\t}\n\tif (immediate && isClient) resume();\n\ttryOnScopeDispose(pause);\n\treturn {\n\t\tisActive,\n\t\tpause,\n\t\tresume\n\t};\n}\n//#endregion\n//#region useTimestamp/index.ts\nfunction getDefaultScheduler$2(options) {\n\tif (\"interval\" in options || \"immediate\" in options) {\n\t\tconst { interval = \"requestAnimationFrame\", immediate = true } = options;\n\t\treturn interval === \"requestAnimationFrame\" ? (cb) => useRafFn(cb, { immediate }) : (cb) => useIntervalFn(cb, interval, { immediate });\n\t}\n\treturn useRafFn;\n}\nfunction useTimestamp(options = {}) {\n\tconst { controls: exposeControls = false, offset = 0, scheduler = getDefaultScheduler$2(options), callback } = options;\n\tconst ts = shallowRef(timestamp() + offset);\n\tconst update = () => ts.value = timestamp() + offset;\n\tconst controls = scheduler(callback ? () => {\n\t\tupdate();\n\t\tcallback(ts.value);\n\t} : update);\n\tif (exposeControls) return {\n\t\ttimestamp: ts,\n\t\t...controls\n\t};\n\telse return ts;\n}\n//#endregion\n//#region useTitle/index.ts\nfunction useTitle(newTitle = null, options = {}) {\n\tvar _document$title, _ref;\n\tconst { document = defaultDocument, restoreOnUnmount = (t) => t } = options;\n\tconst originalTitle = (_document$title = document === null || document === void 0 ? void 0 : document.title) !== null && _document$title !== void 0 ? _document$title : \"\";\n\tconst title = toRef((_ref = newTitle !== null && newTitle !== void 0 ? newTitle : document === null || document === void 0 ? void 0 : document.title) !== null && _ref !== void 0 ? _ref : null);\n\tconst isReadonly = !!(newTitle && typeof newTitle === \"function\");\n\tfunction format(t) {\n\t\tif (!(\"titleTemplate\" in options)) return t;\n\t\tconst template = options.titleTemplate || \"%s\";\n\t\treturn typeof template === \"function\" ? template(t) : toValue(template).replace(/%s/g, t);\n\t}\n\twatch(title, (newValue, oldValue) => {\n\t\tif (newValue !== oldValue && document) document.title = format(newValue !== null && newValue !== void 0 ? newValue : \"\");\n\t}, { immediate: true });\n\tif (options.observe && !options.titleTemplate && document && !isReadonly) {\n\t\tvar _document$head;\n\t\tuseMutationObserver((_document$head = document.head) === null || _document$head === void 0 ? void 0 : _document$head.querySelector(\"title\"), () => {\n\t\t\tif (document && document.title !== title.value) title.value = format(document.title);\n\t\t}, { childList: true });\n\t}\n\ttryOnScopeDispose(() => {\n\t\tif (restoreOnUnmount) {\n\t\t\tconst restoredTitle = restoreOnUnmount(originalTitle, title.value || \"\");\n\t\t\tif (restoredTitle != null && document) document.title = restoredTitle;\n\t\t}\n\t});\n\treturn title;\n}\n/**\n* Common transitions\n*\n* @see https://easings.net\n*/\nconst TransitionPresets = /* #__PURE__ */ Object.assign({}, { linear: identity }, {\n\teaseInSine: [\n\t\t.12,\n\t\t0,\n\t\t.39,\n\t\t0\n\t],\n\teaseOutSine: [\n\t\t.61,\n\t\t1,\n\t\t.88,\n\t\t1\n\t],\n\teaseInOutSine: [\n\t\t.37,\n\t\t0,\n\t\t.63,\n\t\t1\n\t],\n\teaseInQuad: [\n\t\t.11,\n\t\t0,\n\t\t.5,\n\t\t0\n\t],\n\teaseOutQuad: [\n\t\t.5,\n\t\t1,\n\t\t.89,\n\t\t1\n\t],\n\teaseInOutQuad: [\n\t\t.45,\n\t\t0,\n\t\t.55,\n\t\t1\n\t],\n\teaseInCubic: [\n\t\t.32,\n\t\t0,\n\t\t.67,\n\t\t0\n\t],\n\teaseOutCubic: [\n\t\t.33,\n\t\t1,\n\t\t.68,\n\t\t1\n\t],\n\teaseInOutCubic: [\n\t\t.65,\n\t\t0,\n\t\t.35,\n\t\t1\n\t],\n\teaseInQuart: [\n\t\t.5,\n\t\t0,\n\t\t.75,\n\t\t0\n\t],\n\teaseOutQuart: [\n\t\t.25,\n\t\t1,\n\t\t.5,\n\t\t1\n\t],\n\teaseInOutQuart: [\n\t\t.76,\n\t\t0,\n\t\t.24,\n\t\t1\n\t],\n\teaseInQuint: [\n\t\t.64,\n\t\t0,\n\t\t.78,\n\t\t0\n\t],\n\teaseOutQuint: [\n\t\t.22,\n\t\t1,\n\t\t.36,\n\t\t1\n\t],\n\teaseInOutQuint: [\n\t\t.83,\n\t\t0,\n\t\t.17,\n\t\t1\n\t],\n\teaseInExpo: [\n\t\t.7,\n\t\t0,\n\t\t.84,\n\t\t0\n\t],\n\teaseOutExpo: [\n\t\t.16,\n\t\t1,\n\t\t.3,\n\t\t1\n\t],\n\teaseInOutExpo: [\n\t\t.87,\n\t\t0,\n\t\t.13,\n\t\t1\n\t],\n\teaseInCirc: [\n\t\t.55,\n\t\t0,\n\t\t1,\n\t\t.45\n\t],\n\teaseOutCirc: [\n\t\t0,\n\t\t.55,\n\t\t.45,\n\t\t1\n\t],\n\teaseInOutCirc: [\n\t\t.85,\n\t\t0,\n\t\t.15,\n\t\t1\n\t],\n\teaseInBack: [\n\t\t.36,\n\t\t0,\n\t\t.66,\n\t\t-.56\n\t],\n\teaseOutBack: [\n\t\t.34,\n\t\t1.56,\n\t\t.64,\n\t\t1\n\t],\n\teaseInOutBack: [\n\t\t.68,\n\t\t-.6,\n\t\t.32,\n\t\t1.6\n\t]\n});\n/**\n* Create an easing function from cubic bezier points.\n*/\nfunction createEasingFunction([p0, p1, p2, p3]) {\n\tconst a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n\tconst b = (a1, a2) => 3 * a2 - 6 * a1;\n\tconst c = (a1) => 3 * a1;\n\tconst calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n\tconst getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n\tconst getTforX = (x) => {\n\t\tlet aGuessT = x;\n\t\tfor (let i = 0; i < 4; ++i) {\n\t\t\tconst currentSlope = getSlope(aGuessT, p0, p2);\n\t\t\tif (currentSlope === 0) return aGuessT;\n\t\t\tconst currentX = calcBezier(aGuessT, p0, p2) - x;\n\t\t\taGuessT -= currentX / currentSlope;\n\t\t}\n\t\treturn aGuessT;\n\t};\n\treturn (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction lerp(a, b, alpha) {\n\treturn a + alpha * (b - a);\n}\nfunction defaultInterpolation(a, b, t) {\n\tconst aVal = toValue(a);\n\tconst bVal = toValue(b);\n\tif (typeof aVal === \"number\" && typeof bVal === \"number\") return lerp(aVal, bVal, t);\n\tif (Array.isArray(aVal) && Array.isArray(bVal)) return aVal.map((v, i) => lerp(v, toValue(bVal[i]), t));\n\tthrow new TypeError(\"Unknown transition type, specify an interpolation function.\");\n}\nfunction normalizeEasing(easing) {\n\tvar _toValue;\n\treturn typeof easing === \"function\" ? easing : (_toValue = toValue(easing)) !== null && _toValue !== void 0 ? _toValue : identity;\n}\n/**\n* Transition from one value to another.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction transition(source, from, to, options = {}) {\n\tvar _toValue2;\n\tconst { window = defaultWindow } = options;\n\tconst fromVal = toValue(from);\n\tconst toVal = toValue(to);\n\tconst duration = (_toValue2 = toValue(options.duration)) !== null && _toValue2 !== void 0 ? _toValue2 : 1e3;\n\tconst startedAt = Date.now();\n\tconst endAt = Date.now() + duration;\n\tconst interpolation = typeof options.interpolation === \"function\" ? options.interpolation : defaultInterpolation;\n\tconst trans = typeof options.easing !== \"undefined\" ? normalizeEasing(options.easing) : normalizeEasing(options.transition);\n\tconst ease = typeof trans === \"function\" ? trans : createEasingFunction(trans);\n\treturn new Promise((resolve) => {\n\t\tsource.value = fromVal;\n\t\tconst tick = () => {\n\t\t\tvar _options$abort;\n\t\t\tif ((_options$abort = options.abort) === null || _options$abort === void 0 ? void 0 : _options$abort.call(options)) {\n\t\t\t\tresolve();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst now = Date.now();\n\t\t\tconst alpha = ease((now - startedAt) / duration);\n\t\t\tsource.value = interpolation(fromVal, toVal, alpha);\n\t\t\tif (now < endAt) window === null || window === void 0 || window.requestAnimationFrame(tick);\n\t\t\telse {\n\t\t\t\tsource.value = toVal;\n\t\t\t\tresolve();\n\t\t\t}\n\t\t};\n\t\ttick();\n\t});\n}\n/**\n* Transition from one value to another.\n* @deprecated The `executeTransition` function is deprecated, use `transition` instead.\n*\n* @param source\n* @param from\n* @param to\n* @param options\n*/\nfunction executeTransition(source, from, to, options = {}) {\n\treturn transition(source, from, to, options);\n}\n/**\n* Follow value with a transition.\n*\n* @see https://vueuse.org/useTransition\n* @param source\n* @param options\n*/\nfunction useTransition(source, options = {}) {\n\tlet currentId = 0;\n\tconst sourceVal = () => {\n\t\tconst v = toValue(source);\n\t\treturn typeof options.interpolation === \"undefined\" && Array.isArray(v) ? v.map(toValue) : v;\n\t};\n\tconst outputRef = shallowRef(sourceVal());\n\twatch(sourceVal, async (to) => {\n\t\tvar _options$onStarted, _options$onFinished;\n\t\tif (toValue(options.disabled)) return;\n\t\tconst id = ++currentId;\n\t\tif (options.delay) await promiseTimeout(toValue(options.delay));\n\t\tif (id !== currentId) return;\n\t\t(_options$onStarted = options.onStarted) === null || _options$onStarted === void 0 || _options$onStarted.call(options);\n\t\tawait transition(outputRef, outputRef.value, to, {\n\t\t\t...options,\n\t\t\tabort: () => {\n\t\t\t\tvar _options$abort2;\n\t\t\t\treturn id !== currentId || ((_options$abort2 = options.abort) === null || _options$abort2 === void 0 ? void 0 : _options$abort2.call(options));\n\t\t\t}\n\t\t});\n\t\t(_options$onFinished = options.onFinished) === null || _options$onFinished === void 0 || _options$onFinished.call(options);\n\t}, { deep: true });\n\twatch(() => toValue(options.disabled), (disabled) => {\n\t\tif (disabled) {\n\t\t\tcurrentId++;\n\t\t\toutputRef.value = sourceVal();\n\t\t}\n\t});\n\ttryOnScopeDispose(() => {\n\t\tcurrentId++;\n\t});\n\treturn computed(() => toValue(options.disabled) ? sourceVal() : outputRef.value);\n}\n//#endregion\n//#region useUrlSearchParams/index.ts\n/**\n* Reactive URLSearchParams\n*\n* @see https://vueuse.org/useUrlSearchParams\n* @param mode\n* @param options\n*/\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n\tconst { initialValue = {}, removeNullishValues = true, removeFalsyValues = false, write: enableWrite = true, writeMode = \"replace\", window = defaultWindow, stringify = (params) => params.toString() } = options;\n\tif (!window) return reactive(initialValue);\n\tconst state = reactive({});\n\tfunction getRawParams() {\n\t\tif (mode === \"history\") return window.location.search || \"\";\n\t\telse if (mode === \"hash\") {\n\t\t\tconst hash = window.location.hash || \"\";\n\t\t\tconst index = hash.indexOf(\"?\");\n\t\t\treturn index > 0 ? hash.slice(index) : \"\";\n\t\t} else return (window.location.hash || \"\").replace(/^#/, \"\");\n\t}\n\tfunction constructQuery(params) {\n\t\tconst stringified = stringify(params);\n\t\tif (mode === \"history\") return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n\t\tif (mode === \"hash-params\") return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n\t\tconst hash = window.location.hash || \"#\";\n\t\tconst index = hash.indexOf(\"?\");\n\t\tif (index > 0) return `${window.location.search || \"\"}${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n\t\treturn `${window.location.search || \"\"}${hash}${stringified ? `?${stringified}` : \"\"}`;\n\t}\n\tfunction read() {\n\t\treturn new URLSearchParams(getRawParams());\n\t}\n\tfunction updateState(params) {\n\t\tconst unusedKeys = new Set(Object.keys(state));\n\t\tfor (const key of params.keys()) {\n\t\t\tconst paramsForKey = params.getAll(key);\n\t\t\tstate[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n\t\t\tunusedKeys.delete(key);\n\t\t}\n\t\tArray.from(unusedKeys).forEach((key) => delete state[key]);\n\t}\n\tconst { pause, resume } = watchPausable(state, () => {\n\t\tconst params = new URLSearchParams(\"\");\n\t\tObject.keys(state).forEach((key) => {\n\t\t\tconst mapEntry = state[key];\n\t\t\tif (Array.isArray(mapEntry)) mapEntry.forEach((value) => params.append(key, value));\n\t\t\telse if (removeNullishValues && mapEntry == null) params.delete(key);\n\t\t\telse if (removeFalsyValues && !mapEntry) params.delete(key);\n\t\t\telse params.set(key, mapEntry);\n\t\t});\n\t\twrite(params, false);\n\t}, { deep: true });\n\tfunction write(params, shouldUpdate, shouldWriteHistory = true) {\n\t\tpause();\n\t\tif (shouldUpdate) updateState(params);\n\t\tif (writeMode === \"replace\") window.history.replaceState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\telse if (shouldWriteHistory) window.history.pushState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n\t\tnextTick(() => resume());\n\t}\n\tfunction onChanged() {\n\t\tif (!enableWrite) return;\n\t\twrite(read(), true, false);\n\t}\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"popstate\", onChanged, listenerOptions);\n\tif (mode !== \"history\") useEventListener(window, \"hashchange\", onChanged, listenerOptions);\n\tconst initial = read();\n\tif (initial.keys().next().value) updateState(initial);\n\telse Object.assign(state, initialValue);\n\treturn state;\n}\n//#endregion\n//#region useUserMedia/index.ts\n/**\n* Reactive `mediaDevices.getUserMedia` streaming\n*\n* @see https://vueuse.org/useUserMedia\n* @param options\n*/\nfunction useUserMedia(options = {}) {\n\tvar _options$enabled, _options$autoSwitch;\n\tconst enabled = shallowRef((_options$enabled = options.enabled) !== null && _options$enabled !== void 0 ? _options$enabled : false);\n\tconst autoSwitch = shallowRef((_options$autoSwitch = options.autoSwitch) !== null && _options$autoSwitch !== void 0 ? _options$autoSwitch : true);\n\tconst constraints = ref(options.constraints);\n\tconst { navigator = defaultNavigator } = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tvar _navigator$mediaDevic;\n\t\treturn navigator === null || navigator === void 0 || (_navigator$mediaDevic = navigator.mediaDevices) === null || _navigator$mediaDevic === void 0 ? void 0 : _navigator$mediaDevic.getUserMedia;\n\t});\n\tconst stream = shallowRef();\n\tfunction getDeviceOptions(type) {\n\t\tswitch (type) {\n\t\t\tcase \"video\":\n\t\t\t\tif (constraints.value) return constraints.value.video || false;\n\t\t\t\tbreak;\n\t\t\tcase \"audio\":\n\t\t\t\tif (constraints.value) return constraints.value.audio || false;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tasync function _start() {\n\t\tif (!isSupported.value || stream.value) return;\n\t\tstream.value = await navigator.mediaDevices.getUserMedia({\n\t\t\tvideo: getDeviceOptions(\"video\"),\n\t\t\taudio: getDeviceOptions(\"audio\")\n\t\t});\n\t\treturn stream.value;\n\t}\n\tfunction _stop() {\n\t\tvar _stream$value;\n\t\t(_stream$value = stream.value) === null || _stream$value === void 0 || _stream$value.getTracks().forEach((t) => t.stop());\n\t\tstream.value = void 0;\n\t}\n\tfunction stop() {\n\t\t_stop();\n\t\tenabled.value = false;\n\t}\n\tasync function start() {\n\t\tawait _start();\n\t\tif (stream.value) enabled.value = true;\n\t\treturn stream.value;\n\t}\n\tasync function restart() {\n\t\t_stop();\n\t\treturn await start();\n\t}\n\twatch(enabled, (v) => {\n\t\tif (v) _start();\n\t\telse _stop();\n\t}, { immediate: true });\n\twatch(constraints, () => {\n\t\tif (autoSwitch.value && stream.value) restart();\n\t}, {\n\t\timmediate: true,\n\t\tdeep: true\n\t});\n\ttryOnScopeDispose(() => {\n\t\tstop();\n\t});\n\treturn {\n\t\tisSupported,\n\t\tstream,\n\t\tstart,\n\t\tstop,\n\t\trestart,\n\t\tconstraints,\n\t\tenabled,\n\t\tautoSwitch\n\t};\n}\n//#endregion\n//#region useVModel/index.ts\n/**\n* Shorthand for v-model binding, props + emit -> ref\n*\n* @see https://vueuse.org/useVModel\n* @param props\n* @param key (default 'modelValue')\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModel(props, key, emit, options = {}) {\n\tvar _vm$$emit, _vm$proxy;\n\tconst { clone = false, passive = false, eventName, deep = false, defaultValue, shouldEmit } = options;\n\tconst vm = getCurrentInstance();\n\tconst _emit = emit || (vm === null || vm === void 0 ? void 0 : vm.emit) || (vm === null || vm === void 0 || (_vm$$emit = vm.$emit) === null || _vm$$emit === void 0 ? void 0 : _vm$$emit.bind(vm)) || (vm === null || vm === void 0 || (_vm$proxy = vm.proxy) === null || _vm$proxy === void 0 || (_vm$proxy = _vm$proxy.$emit) === null || _vm$proxy === void 0 ? void 0 : _vm$proxy.bind(vm === null || vm === void 0 ? void 0 : vm.proxy));\n\tlet event = eventName;\n\tif (!key) key = \"modelValue\";\n\tevent = event || `update:${key.toString()}`;\n\tconst cloneFn = (val) => !clone ? val : typeof clone === \"function\" ? clone(val) : cloneFnJSON(val);\n\tconst getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n\tconst triggerEmit = (value) => {\n\t\tif (shouldEmit) {\n\t\t\tif (shouldEmit(value)) _emit(event, value);\n\t\t} else _emit(event, value);\n\t};\n\tif (passive) {\n\t\tconst proxy = ref(getValue());\n\t\tlet isUpdating = false;\n\t\twatch(() => props[key], (v) => {\n\t\t\tif (!isUpdating) {\n\t\t\t\tisUpdating = true;\n\t\t\t\tproxy.value = cloneFn(v);\n\t\t\t\tnextTick(() => isUpdating = false);\n\t\t\t}\n\t\t});\n\t\twatch(proxy, (v) => {\n\t\t\tif (!isUpdating && (v !== props[key] || deep)) triggerEmit(v);\n\t\t}, { deep });\n\t\treturn proxy;\n\t} else return computed({\n\t\tget() {\n\t\t\treturn getValue();\n\t\t},\n\t\tset(value) {\n\t\t\ttriggerEmit(value);\n\t\t}\n\t});\n}\n//#endregion\n//#region useVModels/index.ts\n/**\n* Shorthand for props v-model binding. Think like `toRefs(props)` but changes will also emit out.\n*\n* @see https://vueuse.org/useVModels\n* @param props\n* @param emit\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVModels(props, emit, options = {}) {\n\tconst ret = {};\n\tfor (const key in props) ret[key] = useVModel(props, key, emit, options);\n\treturn ret;\n}\n//#endregion\n//#region useVibrate/index.ts\nfunction getDefaultScheduler$1(options = {}) {\n\tconst { interval = 0 } = options;\n\tif (interval === 0) return;\n\treturn (fn) => useIntervalFn(fn, interval, {\n\t\timmediate: false,\n\t\timmediateCallback: false\n\t});\n}\n/**\n* Reactive vibrate\n*\n* @see https://vueuse.org/useVibrate\n* @see https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useVibrate(options) {\n\tconst { pattern = [], scheduler = getDefaultScheduler$1(options), navigator = defaultNavigator } = options || {};\n\tconst isSupported = /* @__PURE__ */ useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n\tconst patternRef = toRef(pattern);\n\tconst vibrate = (pattern = patternRef.value) => {\n\t\tif (isSupported.value) navigator.vibrate(pattern);\n\t};\n\tconst intervalControls = scheduler === null || scheduler === void 0 ? void 0 : scheduler(vibrate);\n\tconst stop = () => {\n\t\tif (isSupported.value) navigator.vibrate(0);\n\t\tintervalControls === null || intervalControls === void 0 || intervalControls.pause();\n\t};\n\treturn {\n\t\tisSupported,\n\t\tpattern,\n\t\tintervalControls,\n\t\tvibrate,\n\t\tstop\n\t};\n}\n//#endregion\n//#region useVirtualList/index.ts\n/**\n* Please consider using [`vue-virtual-scroller`](https://github.com/Akryum/vue-virtual-scroller) if you are looking for more features.\n*/\nfunction useVirtualList(list, options) {\n\tconst { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n\treturn {\n\t\tlist: currentList,\n\t\tscrollTo,\n\t\tcontainerProps: {\n\t\t\tref: containerRef,\n\t\t\tonScroll: () => {\n\t\t\t\tcalculateRange();\n\t\t\t},\n\t\t\tstyle: containerStyle\n\t\t},\n\t\twrapperProps\n\t};\n}\nfunction useVirtualListResources(list) {\n\tconst containerRef = shallowRef(null);\n\tconst size = useElementSize(containerRef);\n\tconst currentList = ref([]);\n\tconst source = shallowRef(list);\n\treturn {\n\t\tstate: ref({\n\t\t\tstart: 0,\n\t\t\tend: 10\n\t\t}),\n\t\tsource,\n\t\tcurrentList,\n\t\tsize,\n\t\tcontainerRef\n\t};\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n\treturn (containerSize) => {\n\t\tif (typeof itemSize === \"number\") return Math.ceil(containerSize / itemSize);\n\t\tconst { start = 0 } = state.value;\n\t\tlet sum = 0;\n\t\tlet capacity = 0;\n\t\tfor (let i = start; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tcapacity = i;\n\t\t\tif (sum > containerSize) break;\n\t\t}\n\t\treturn capacity - start;\n\t};\n}\nfunction createGetOffset(source, itemSize) {\n\treturn (scrollDirection) => {\n\t\tif (typeof itemSize === \"number\") return Math.floor(scrollDirection / itemSize) + 1;\n\t\tlet sum = 0;\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < source.value.length; i++) {\n\t\t\tconst size = itemSize(i);\n\t\t\tsum += size;\n\t\t\tif (sum >= scrollDirection) {\n\t\t\t\toffset = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn offset + 1;\n\t};\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n\treturn () => {\n\t\tconst element = containerRef.value;\n\t\tif (element) {\n\t\t\tconst offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n\t\t\tconst viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n\t\t\tconst from = offset - overscan;\n\t\t\tconst to = offset + viewCapacity + overscan;\n\t\t\tstate.value = {\n\t\t\t\tstart: from < 0 ? 0 : from,\n\t\t\t\tend: to > source.value.length ? source.value.length : to\n\t\t\t};\n\t\t\tcurrentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n\t\t\t\tdata: ele,\n\t\t\t\tindex: index + state.value.start\n\t\t\t}));\n\t\t}\n\t};\n}\nfunction createGetDistance(itemSize, source) {\n\treturn (index) => {\n\t\tif (typeof itemSize === \"number\") return index * itemSize;\n\t\treturn source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n\t};\n}\nfunction useWatchForSizes(size, listRef, totalSize, containerRef, calculateRange) {\n\twatch([\n\t\tsize.width,\n\t\tsize.height,\n\t\tlistRef,\n\t\ttotalSize,\n\t\tcontainerRef\n\t], () => {\n\t\tcalculateRange();\n\t});\n}\nfunction createComputedTotalSize(itemSize, source) {\n\treturn computed(() => {\n\t\tif (typeof itemSize === \"number\") return source.value.length * itemSize;\n\t\treturn source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n\t});\n}\nconst scrollToDictionaryForElementScrollKey = {\n\thorizontal: \"scrollLeft\",\n\tvertical: \"scrollTop\"\n};\nconst scrollToDictionaryForElementScrollToKey = {\n\thorizontal: \"left\",\n\tvertical: \"top\"\n};\nconst defaultScrollToOptions = {\n\tbehavior: \"auto\",\n\tblock: \"start\",\n\tinline: \"nearest\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef, itemSize) {\n\treturn (index, options = defaultScrollToOptions) => {\n\t\tif (!containerRef.value) return;\n\t\toptions = {\n\t\t\t...defaultScrollToOptions,\n\t\t\t...options\n\t\t};\n\t\tlet offset = 0;\n\t\tconst axisToCheck = options[type === \"horizontal\" ? \"inline\" : \"block\"];\n\t\tif (axisToCheck) {\n\t\t\tconst containerSize = type === \"horizontal\" ? containerRef.value.clientWidth : containerRef.value.clientHeight;\n\t\t\tconst fullItemSize = typeof itemSize === \"number\" ? itemSize : itemSize(index);\n\t\t\tif (axisToCheck === \"center\") offset = containerSize / 2 - fullItemSize / 2;\n\t\t\telse if (axisToCheck === \"end\") offset = containerSize - fullItemSize;\n\t\t\telse if (axisToCheck === \"nearest\") {\n\t\t\t\tconst containerScrollPosition = containerRef.value[scrollToDictionaryForElementScrollKey[type]];\n\t\t\t\tif (getDistance(index) > containerScrollPosition + containerSize / 2) offset = containerSize - fullItemSize;\n\t\t\t}\n\t\t}\n\t\tcontainerRef.value.scrollTo({\n\t\t\t[scrollToDictionaryForElementScrollToKey[type]]: getDistance(index) - offset,\n\t\t\tbehavior: options.behavior\n\t\t});\n\t\tcalculateRange();\n\t};\n}\nfunction useHorizontalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowX: \"auto\" };\n\tconst { itemWidth, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n\tconst calculateRange = createCalculateRange(\"horizontal\", overscan, createGetOffset(source, itemWidth), getViewCapacity, resources);\n\tconst getDistanceLeft = createGetDistance(itemWidth, source);\n\tconst offsetLeft = computed(() => getDistanceLeft(state.value.start));\n\tconst totalWidth = createComputedTotalSize(itemWidth, source);\n\tuseWatchForSizes(size, source, totalWidth, containerRef, calculateRange);\n\treturn {\n\t\tscrollTo: createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef, itemWidth),\n\t\tcalculateRange,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\theight: \"100%\",\n\t\t\t\twidth: `${totalWidth.value - offsetLeft.value}px`,\n\t\t\t\tmarginLeft: `${offsetLeft.value}px`,\n\t\t\t\tdisplay: \"flex\"\n\t\t\t} };\n\t\t}),\n\t\tcontainerStyle,\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\nfunction useVerticalVirtualList(options, list) {\n\tconst resources = useVirtualListResources(list);\n\tconst { state, source, currentList, size, containerRef } = resources;\n\tconst containerStyle = { overflowY: \"auto\" };\n\tconst { itemHeight, overscan = 5 } = options;\n\tconst getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n\tconst calculateRange = createCalculateRange(\"vertical\", overscan, createGetOffset(source, itemHeight), getViewCapacity, resources);\n\tconst getDistanceTop = createGetDistance(itemHeight, source);\n\tconst offsetTop = computed(() => getDistanceTop(state.value.start));\n\tconst totalHeight = createComputedTotalSize(itemHeight, source);\n\tuseWatchForSizes(size, source, totalHeight, containerRef, calculateRange);\n\treturn {\n\t\tcalculateRange,\n\t\tscrollTo: createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef, itemHeight),\n\t\tcontainerStyle,\n\t\twrapperProps: computed(() => {\n\t\t\treturn { style: {\n\t\t\t\twidth: \"100%\",\n\t\t\t\theight: `${totalHeight.value - offsetTop.value}px`,\n\t\t\t\tmarginTop: `${offsetTop.value}px`\n\t\t\t} };\n\t\t}),\n\t\tcurrentList,\n\t\tcontainerRef\n\t};\n}\n//#endregion\n//#region useWakeLock/index.ts\n/**\n* Reactive Screen Wake Lock API.\n*\n* @see https://vueuse.org/useWakeLock\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWakeLock(options = {}) {\n\tconst { navigator = defaultNavigator, document = defaultDocument } = options;\n\tconst requestedType = shallowRef(false);\n\tconst sentinel = shallowRef(null);\n\tconst documentVisibility = useDocumentVisibility({ document });\n\tconst isSupported = /* @__PURE__ */ useSupported(() => navigator && \"wakeLock\" in navigator);\n\tconst isActive = computed(() => !!sentinel.value && documentVisibility.value === \"visible\");\n\tif (isSupported.value) {\n\t\tuseEventListener(sentinel, \"release\", () => {\n\t\t\tvar _sentinel$value$type, _sentinel$value;\n\t\t\trequestedType.value = (_sentinel$value$type = (_sentinel$value = sentinel.value) === null || _sentinel$value === void 0 ? void 0 : _sentinel$value.type) !== null && _sentinel$value$type !== void 0 ? _sentinel$value$type : false;\n\t\t}, { passive: true });\n\t\twhenever(() => documentVisibility.value === \"visible\" && (document === null || document === void 0 ? void 0 : document.visibilityState) === \"visible\" && requestedType.value, (type) => {\n\t\t\trequestedType.value = false;\n\t\t\tforceRequest(type);\n\t\t});\n\t}\n\tasync function forceRequest(type) {\n\t\tvar _sentinel$value2;\n\t\tawait ((_sentinel$value2 = sentinel.value) === null || _sentinel$value2 === void 0 ? void 0 : _sentinel$value2.release());\n\t\tsentinel.value = isSupported.value ? await navigator.wakeLock.request(type) : null;\n\t}\n\tasync function request(type) {\n\t\tif (documentVisibility.value === \"visible\") await forceRequest(type);\n\t\telse requestedType.value = type;\n\t}\n\tasync function release() {\n\t\trequestedType.value = false;\n\t\tconst s = sentinel.value;\n\t\tsentinel.value = null;\n\t\tawait (s === null || s === void 0 ? void 0 : s.release());\n\t}\n\ttryOnScopeDispose(() => {\n\t\trelease();\n\t});\n\treturn {\n\t\tsentinel,\n\t\tisSupported,\n\t\tisActive,\n\t\trequest,\n\t\tforceRequest,\n\t\trelease\n\t};\n}\n//#endregion\n//#region useWebNotification/index.ts\n/**\n* Reactive useWebNotification\n*\n* @see https://vueuse.org/useWebNotification\n* @see https://developer.mozilla.org/en-US/docs/Web/API/notification\n*/\nfunction useWebNotification(options = {}) {\n\tconst { window = defaultWindow, requestPermissions: _requestForPermissions = true } = options;\n\tconst defaultWebNotificationOptions = options;\n\tconst isSupported = /* @__PURE__ */ useSupported(() => {\n\t\tif (!window || !(\"Notification\" in window)) return false;\n\t\tif (Notification.permission === \"granted\") return true;\n\t\ttry {\n\t\t\tconst notification = new Notification(\"\");\n\t\t\tnotification.onshow = () => {\n\t\t\t\tnotification.close();\n\t\t\t};\n\t\t} catch (e) {\n\t\t\tif (e.name === \"TypeError\") return false;\n\t\t}\n\t\treturn true;\n\t});\n\tconst permissionGranted = shallowRef(isSupported.value && \"permission\" in Notification && Notification.permission === \"granted\");\n\tconst notification = shallowRef(null);\n\tconst ensurePermissions = async () => {\n\t\tif (!isSupported.value) return;\n\t\tif (!permissionGranted.value && Notification.permission !== \"denied\") {\n\t\t\tif (await Notification.requestPermission() === \"granted\") permissionGranted.value = true;\n\t\t}\n\t\treturn permissionGranted.value;\n\t};\n\tconst { on: onClick, trigger: clickTrigger } = createEventHook();\n\tconst { on: onShow, trigger: showTrigger } = createEventHook();\n\tconst { on: onError, trigger: errorTrigger } = createEventHook();\n\tconst { on: onClose, trigger: closeTrigger } = createEventHook();\n\tconst show = async (overrides) => {\n\t\tif (!isSupported.value || !permissionGranted.value) return;\n\t\tconst options = Object.assign({}, defaultWebNotificationOptions, overrides);\n\t\tnotification.value = new Notification(options.title || \"\", options);\n\t\tnotification.value.onclick = clickTrigger;\n\t\tnotification.value.onshow = showTrigger;\n\t\tnotification.value.onerror = errorTrigger;\n\t\tnotification.value.onclose = closeTrigger;\n\t\treturn notification.value;\n\t};\n\tconst close = () => {\n\t\tif (notification.value) notification.value.close();\n\t\tnotification.value = null;\n\t};\n\tif (_requestForPermissions) tryOnMounted(ensurePermissions);\n\ttryOnScopeDispose(close);\n\tif (isSupported.value && window) {\n\t\tconst document = window.document;\n\t\tuseEventListener(document, \"visibilitychange\", (e) => {\n\t\t\te.preventDefault();\n\t\t\tif (document.visibilityState === \"visible\") close();\n\t\t});\n\t}\n\treturn {\n\t\tisSupported,\n\t\tnotification,\n\t\tensurePermissions,\n\t\tpermissionGranted,\n\t\tshow,\n\t\tclose,\n\t\tonClick,\n\t\tonShow,\n\t\tonError,\n\t\tonClose\n\t};\n}\n//#endregion\n//#region useWebSocket/index.ts\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n\tif (options === true) return {};\n\treturn options;\n}\nfunction getDefaultScheduler(options) {\n\tif (\"interval\" in options) {\n\t\tconst { interval = 1e3 } = options;\n\t\treturn (cb) => useIntervalFn(cb, interval, { immediate: false });\n\t}\n\treturn (cb) => useIntervalFn(cb, 1e3, { immediate: false });\n}\n/**\n* Reactive WebSocket client.\n*\n* @see https://vueuse.org/useWebSocket\n* @param url\n*/\nfunction useWebSocket(url, options = {}) {\n\tconst { onConnected, onDisconnected, onError, onMessage, immediate = true, autoConnect = true, autoClose = true, protocols = [] } = options;\n\tconst data = shallowRef(null);\n\tconst status = shallowRef(\"CLOSED\");\n\tconst wsRef = shallowRef();\n\tconst urlRef = toRef(url);\n\tlet heartbeatPause;\n\tlet heartbeatResume;\n\tlet explicitlyClosed = false;\n\tlet retried = 0;\n\tlet bufferedData = [];\n\tlet retryTimeout;\n\tlet pongTimeoutWait;\n\tconst _sendBuffer = () => {\n\t\tif (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n\t\t\tfor (const buffer of bufferedData) wsRef.value.send(buffer);\n\t\t\tbufferedData = [];\n\t\t}\n\t};\n\tconst resetRetry = () => {\n\t\tif (retryTimeout != null) {\n\t\t\tclearTimeout(retryTimeout);\n\t\t\tretryTimeout = void 0;\n\t\t}\n\t};\n\tconst resetHeartbeat = () => {\n\t\tclearTimeout(pongTimeoutWait);\n\t\tpongTimeoutWait = void 0;\n\t};\n\tconst close = (code = 1e3, reason) => {\n\t\tresetRetry();\n\t\tif (!isClient && !isWorker || !wsRef.value) return;\n\t\texplicitlyClosed = true;\n\t\tresetHeartbeat();\n\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\twsRef.value.close(code, reason);\n\t\twsRef.value = void 0;\n\t\tstatus.value = \"CLOSED\";\n\t};\n\tconst send = (data, useBuffer = true) => {\n\t\tif (!wsRef.value || status.value !== \"OPEN\") {\n\t\t\tif (useBuffer) bufferedData.push(data);\n\t\t\treturn false;\n\t\t}\n\t\t_sendBuffer();\n\t\twsRef.value.send(data);\n\t\treturn true;\n\t};\n\tconst _init = () => {\n\t\tif (explicitlyClosed || typeof urlRef.value === \"undefined\") return;\n\t\tconst ws = new WebSocket(urlRef.value, protocols);\n\t\twsRef.value = ws;\n\t\tstatus.value = \"CONNECTING\";\n\t\tws.onopen = () => {\n\t\t\tif (wsRef.value !== ws) return;\n\t\t\tstatus.value = \"OPEN\";\n\t\t\tretried = 0;\n\t\t\tonConnected === null || onConnected === void 0 || onConnected(ws);\n\t\t\theartbeatResume === null || heartbeatResume === void 0 || heartbeatResume();\n\t\t\t_sendBuffer();\n\t\t};\n\t\tws.onclose = (ev) => {\n\t\t\tif (wsRef.value === ws) status.value = \"CLOSED\";\n\t\t\tresetHeartbeat();\n\t\t\theartbeatPause === null || heartbeatPause === void 0 || heartbeatPause();\n\t\t\tonDisconnected === null || onDisconnected === void 0 || onDisconnected(ws, ev);\n\t\t\tif (!explicitlyClosed && options.autoReconnect && (wsRef.value == null || ws === wsRef.value)) {\n\t\t\t\tconst { retries = -1, delay = 1e3, onFailed } = resolveNestedOptions(options.autoReconnect);\n\t\t\t\tif ((typeof retries === \"function\" ? retries : () => typeof retries === \"number\" && (retries < 0 || retried < retries))(retried)) {\n\t\t\t\t\tretried += 1;\n\t\t\t\t\tconst delayTime = typeof delay === \"function\" ? delay(retried) : delay;\n\t\t\t\t\tretryTimeout = setTimeout(_init, delayTime);\n\t\t\t\t} else onFailed === null || onFailed === void 0 || onFailed();\n\t\t\t}\n\t\t};\n\t\tws.onerror = (e) => {\n\t\t\tonError === null || onError === void 0 || onError(ws, e);\n\t\t};\n\t\tws.onmessage = (e) => {\n\t\t\tif (options.heartbeat) {\n\t\t\t\tresetHeartbeat();\n\t\t\t\tconst { message = DEFAULT_PING_MESSAGE, responseMessage = message } = resolveNestedOptions(options.heartbeat);\n\t\t\t\tif (e.data === toValue(responseMessage)) return;\n\t\t\t}\n\t\t\tdata.value = e.data;\n\t\t\tonMessage === null || onMessage === void 0 || onMessage(ws, e);\n\t\t};\n\t};\n\tif (options.heartbeat) {\n\t\tconst { message = DEFAULT_PING_MESSAGE, scheduler = getDefaultScheduler(resolveNestedOptions(options.heartbeat)), pongTimeout = 1e3 } = resolveNestedOptions(options.heartbeat);\n\t\tconst { pause, resume } = scheduler(() => {\n\t\t\tsend(toValue(message), false);\n\t\t\tif (pongTimeoutWait != null) return;\n\t\t\tpongTimeoutWait = setTimeout(() => {\n\t\t\t\tclose();\n\t\t\t\texplicitlyClosed = false;\n\t\t\t}, pongTimeout);\n\t\t});\n\t\theartbeatPause = pause;\n\t\theartbeatResume = resume;\n\t}\n\tif (autoClose) {\n\t\tif (isClient) useEventListener(\"beforeunload\", () => close(), { passive: true });\n\t\ttryOnScopeDispose(close);\n\t}\n\tconst open = () => {\n\t\tif (!isClient && !isWorker) return;\n\t\tclose();\n\t\texplicitlyClosed = false;\n\t\tretried = 0;\n\t\t_init();\n\t};\n\tif (immediate) open();\n\tif (autoConnect) watch(urlRef, open);\n\treturn {\n\t\tdata,\n\t\tstatus,\n\t\tclose,\n\t\tsend,\n\t\topen,\n\t\tws: wsRef\n\t};\n}\n//#endregion\n//#region useWebWorker/index.ts\nfunction useWebWorker(arg0, workerOptions, options) {\n\tconst { window = defaultWindow } = options !== null && options !== void 0 ? options : {};\n\tconst data = shallowRef(null);\n\tconst worker = shallowRef();\n\tconst post = (...args) => {\n\t\tif (!worker.value) return;\n\t\tworker.value.postMessage(...args);\n\t};\n\tconst terminate = function terminate() {\n\t\tif (!worker.value) return;\n\t\tworker.value.terminate();\n\t};\n\tif (window) {\n\t\tif (typeof arg0 === \"string\") worker.value = new Worker(arg0, workerOptions);\n\t\telse if (typeof arg0 === \"function\") worker.value = arg0();\n\t\telse worker.value = arg0;\n\t\tworker.value.onmessage = (e) => {\n\t\t\tdata.value = e.data;\n\t\t};\n\t\ttryOnScopeDispose(() => {\n\t\t\tif (worker.value) worker.value.terminate();\n\t\t});\n\t}\n\treturn {\n\t\tdata,\n\t\tpost,\n\t\tterminate,\n\t\tworker\n\t};\n}\n//#endregion\n//#region useWebWorkerFn/lib/depsParser.ts\n/**\n*\n* Concatenates the dependencies into a comma separated string.\n* this string will then be passed as an argument to the \"importScripts\" function\n*\n* @param deps array of string\n* @param localDeps array of function\n* @returns a string composed by the concatenation of the array\n* elements \"deps\" and \"importScripts\".\n*\n* @example\n* depsParser(['demo1', 'demo2']) // return importScripts('demo1', 'demo2')\n*/\nfunction depsParser(deps, localDeps) {\n\tif (deps.length === 0 && localDeps.length === 0) return \"\";\n\tconst depsString = deps.map((dep) => `'${dep}'`).toString();\n\tconst depsFunctionString = localDeps.filter((dep) => typeof dep === \"function\").map((fn) => {\n\t\tconst str = fn.toString();\n\t\tif (str.trim().startsWith(\"function\")) return str;\n\t\telse return `const ${fn.name} = ${str}`;\n\t}).join(\";\");\n\tconst importString = `importScripts(${depsString});`;\n\treturn `${depsString.trim() === \"\" ? \"\" : importString} ${depsFunctionString}`;\n}\n//#endregion\n//#region useWebWorkerFn/lib/jobRunner.ts\n/**\n* This function accepts as a parameter a function \"userFunc\"\n* And as a result returns an anonymous function.\n* This anonymous function, accepts as arguments,\n* the parameters to pass to the function \"useArgs\" and returns a Promise\n* This function can be used as a wrapper, only inside a Worker\n* because it depends by \"postMessage\".\n*\n* @param userFunc {Function} fn the function to run with web worker\n*\n* @returns returns a function that accepts the parameters\n* to be passed to the \"userFunc\" function\n*/\nfunction jobRunner(userFunc) {\n\treturn (e) => {\n\t\tconst userFuncArgs = e.data[0];\n\t\treturn Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n\t\t\tpostMessage([\"SUCCESS\", result]);\n\t\t}).catch((error) => {\n\t\t\tpostMessage([\"ERROR\", error]);\n\t\t});\n\t};\n}\n//#endregion\n//#region useWebWorkerFn/lib/createWorkerBlobUrl.ts\n/**\n* Converts the \"fn\" function into the syntax needed to be executed within a web worker\n*\n* @param fn the function to run with web worker\n* @param deps array of strings, imported into the worker through \"importScripts\"\n* @param localDeps array of function, local dependencies\n*\n* @returns a blob url, containing the code of \"fn\" as a string\n*\n* @example\n* createWorkerBlobUrl((a,b) => a+b, [])\n* // return \"onmessage=return Promise.resolve((a,b) => a + b)\n* .then(postMessage(['SUCCESS', result]))\n* .catch(postMessage(['ERROR', error])\"\n*/\nfunction createWorkerBlobUrl(fn, deps, localDeps) {\n\tconst blobCode = `${depsParser(deps, localDeps)}; onmessage=(${jobRunner})(${fn})`;\n\tconst blob = new Blob([blobCode], { type: \"text/javascript\" });\n\treturn URL.createObjectURL(blob);\n}\n//#endregion\n//#region useWebWorkerFn/index.ts\n/**\n* Run expensive function without blocking the UI, using a simple syntax that makes use of Promise.\n*\n* @see https://vueuse.org/useWebWorkerFn\n* @param fn\n* @param options\n*/\nfunction useWebWorkerFn(fn, options = {}) {\n\tconst { dependencies = [], localDependencies = [], timeout, window = defaultWindow } = options;\n\tlet worker;\n\tconst workerStatus = shallowRef(\"PENDING\");\n\tconst promise = shallowRef({});\n\tconst timeoutId = shallowRef();\n\tconst workerTerminate = (status = \"PENDING\") => {\n\t\tif (worker && worker._url && window) {\n\t\t\tworker.terminate();\n\t\t\tURL.revokeObjectURL(worker._url);\n\t\t\tpromise.value = {};\n\t\t\tworker = void 0;\n\t\t\twindow.clearTimeout(timeoutId.value);\n\t\t\tworkerStatus.value = status;\n\t\t}\n\t};\n\tworkerTerminate();\n\ttryOnScopeDispose(workerTerminate);\n\tconst generateWorker = () => {\n\t\tconst blobUrl = createWorkerBlobUrl(fn, dependencies, localDependencies);\n\t\tconst newWorker = new Worker(blobUrl);\n\t\tnewWorker._url = blobUrl;\n\t\tnewWorker.onmessage = (e) => {\n\t\t\tconst { resolve = () => {}, reject = () => {} } = promise.value;\n\t\t\tconst [status, result] = e.data;\n\t\t\tswitch (status) {\n\t\t\t\tcase \"SUCCESS\":\n\t\t\t\t\tresolve(result);\n\t\t\t\t\tworkerTerminate(status);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treject(result);\n\t\t\t\t\tworkerTerminate(\"ERROR\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\t\tnewWorker.onerror = (e) => {\n\t\t\tconst { reject = () => {} } = promise.value;\n\t\t\te.preventDefault();\n\t\t\treject(e);\n\t\t\tworkerTerminate(\"ERROR\");\n\t\t};\n\t\tif (timeout) timeoutId.value = setTimeout(workerTerminate, timeout, \"TIMEOUT_EXPIRED\");\n\t\treturn newWorker;\n\t};\n\tconst callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n\t\tpromise.value = {\n\t\t\tresolve,\n\t\t\treject\n\t\t};\n\t\tworker === null || worker === void 0 || worker.postMessage([[...fnArgs]]);\n\t\tworkerStatus.value = \"RUNNING\";\n\t});\n\tconst workerFn = (...fnArgs) => {\n\t\tif (workerStatus.value === \"RUNNING\") {\n\t\t\tconsole.error(\"[useWebWorkerFn] You can only run one instance of the worker at a time.\");\n\t\t\treturn Promise.reject();\n\t\t}\n\t\tworker = generateWorker();\n\t\treturn callWorker(...fnArgs);\n\t};\n\treturn {\n\t\tworkerFn,\n\t\tworkerStatus,\n\t\tworkerTerminate\n\t};\n}\n//#endregion\n//#region useWindowFocus/index.ts\n/**\n* Reactively track window focus with `window.onfocus` and `window.onblur`.\n*\n* @see https://vueuse.org/useWindowFocus\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowFocus(options = {}) {\n\tconst { window = defaultWindow } = options;\n\tif (!window) return shallowRef(false);\n\tconst focused = shallowRef(window.document.hasFocus());\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(window, \"blur\", () => {\n\t\tfocused.value = false;\n\t}, listenerOptions);\n\tuseEventListener(window, \"focus\", () => {\n\t\tfocused.value = true;\n\t}, listenerOptions);\n\treturn focused;\n}\n//#endregion\n//#region useWindowScroll/index.ts\n/**\n* Reactive window scroll.\n*\n* @see https://vueuse.org/useWindowScroll\n* @param options\n*/\nfunction useWindowScroll(options = {}) {\n\tconst { window = defaultWindow, ...rest } = options;\n\treturn useScroll(window, rest);\n}\n//#endregion\n//#region useWindowSize/index.ts\n/**\n* Reactive window size.\n*\n* @see https://vueuse.org/useWindowSize\n* @param options\n*\n* @__NO_SIDE_EFFECTS__\n*/\nfunction useWindowSize(options = {}) {\n\tconst { window = defaultWindow, initialWidth = Number.POSITIVE_INFINITY, initialHeight = Number.POSITIVE_INFINITY, listenOrientation = true, includeScrollbar = true, type = \"inner\" } = options;\n\tconst width = shallowRef(initialWidth);\n\tconst height = shallowRef(initialHeight);\n\tconst update = () => {\n\t\tif (window) if (type === \"outer\") {\n\t\t\twidth.value = window.outerWidth;\n\t\t\theight.value = window.outerHeight;\n\t\t} else if (type === \"visual\" && window.visualViewport) {\n\t\t\tconst { width: visualViewportWidth, height: visualViewportHeight, scale } = window.visualViewport;\n\t\t\twidth.value = Math.round(visualViewportWidth * scale);\n\t\t\theight.value = Math.round(visualViewportHeight * scale);\n\t\t} else if (includeScrollbar) {\n\t\t\twidth.value = window.innerWidth;\n\t\t\theight.value = window.innerHeight;\n\t\t} else {\n\t\t\twidth.value = window.document.documentElement.clientWidth;\n\t\t\theight.value = window.document.documentElement.clientHeight;\n\t\t}\n\t};\n\tupdate();\n\ttryOnMounted(update);\n\tconst listenerOptions = { passive: true };\n\tuseEventListener(\"resize\", update, listenerOptions);\n\tif (window && type === \"visual\" && window.visualViewport) useEventListener(window.visualViewport, \"resize\", update, listenerOptions);\n\tif (listenOrientation) watch(useMediaQuery(\"(orientation: portrait)\"), () => update());\n\treturn {\n\t\twidth,\n\t\theight\n\t};\n}\n//#endregion\nexport { DefaultMagicKeysAliasMap, StorageSerializers, TransitionPresets, asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsElement, breakpointsMasterCss, breakpointsPrimeFlex, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, breakpointsVuetifyV2, breakpointsVuetifyV3, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, formatTimeAgoIntl, formatTimeAgoIntlParts, getSSRHandler, isFocusedElementEditable, isTypedCharValid, mapGamepadToXbox360Controller, onClickOutside, onElementRemoval, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, provideSSRWidth, setSSRHandler, templateRef, transition, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useClipboardItems, useCloned, useColorMode, useConfirmDialog, useCountdown, useCssSupports, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementOverflow, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePreferredReducedTransparency, usePrevious, useRafFn, useRefHistory, useResizeObserver, useSSRWidth, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeAgoIntl, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","var $ = Object.defineProperty;\nvar P = (t, e, r) => e in t ? $(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;\nvar u = (t, e, r) => P(t, typeof e != \"symbol\" ? e + \"\" : e, r);\nimport { getCurrentScope as W, onScopeDispose as E, unref as s, computed as h, watch as y, ref as g, getCurrentInstance as V, onMounted as D, watchEffect as N, isRef as R } from \"vue\";\nfunction C(t) {\n return W() ? (E(t), !0) : !1;\n}\nfunction F(t) {\n return typeof t == \"function\" ? t() : s(t);\n}\nconst G = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nfunction T(t) {\n var e;\n const r = F(t);\n return (e = r == null ? void 0 : r.$el) != null ? e : r;\n}\nconst j = G ? window : void 0;\nfunction q() {\n const t = g(!1);\n return V() && D(() => {\n t.value = !0;\n }), t;\n}\nfunction _(t) {\n const e = q();\n return h(() => (e.value, !!t()));\n}\nfunction B(t, e, r = {}) {\n const { window: n = j, ...c } = r;\n let o;\n const f = _(() => n && \"ResizeObserver\" in n), i = () => {\n o && (o.disconnect(), o = void 0);\n }, d = h(() => Array.isArray(t) ? t.map((m) => T(m)) : [T(t)]), l = y(\n d,\n (m) => {\n if (i(), f.value && n) {\n o = new ResizeObserver(e);\n for (const v of m)\n v && o.observe(v, c);\n }\n },\n { immediate: !0, flush: \"post\", deep: !0 }\n ), p = () => {\n i(), l();\n };\n return C(p), {\n isSupported: f,\n stop: p\n };\n}\nfunction H(t) {\n return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, \"default\") ? t.default : t;\n}\nvar J = function(e) {\n var r = null, n, c = function(i) {\n return function() {\n r = null, e.apply(i, n);\n };\n }, o = function() {\n for (var i = arguments.length, d = new Array(i), l = 0; l < i; l++)\n d[l] = arguments[l];\n n = d, r === null && (r = requestAnimationFrame(c(this)));\n };\n return o.cancel = function() {\n cancelAnimationFrame(r), r = null;\n }, o;\n}, K = J;\nconst Q = /* @__PURE__ */ H(K), X = 500, L = ({\n sizeManager: t,\n buffer: e = X\n}, r = \"vertical\", n = null) => {\n const o = g({ scrollStart: 0, scrollEnd: 0 }), f = r === \"vertical\", i = n ?? g(null), d = Q(() => {\n if (!i.value)\n return;\n const { scrollTop: a, scrollLeft: S, offsetHeight: w, offsetWidth: O } = i.value, I = f ? a : S, U = f ? w : O;\n o.value = { scrollStart: I, scrollEnd: I + U };\n });\n t.onUpdate(d), n || B(i, d);\n let l = null;\n const p = h(() => {\n const a = t.toIndex(o.value.scrollStart - e), S = Math.min(\n t.toIndex(o.value.scrollEnd + e) + 1,\n t.getNumItems()\n );\n return l && l.startIndex === a && l.endIndex === S || (l = { startIndex: a, endIndex: S, toArray: () => Array.from({ length: S - a }, (O, I) => a + I) }), l;\n }), m = h(() => t.toOffset(p.value.startIndex)), v = h(() => t.getTotalSize()), x = `--virtual-scroller-${r}-offset`, A = `--virtual-scroller-${r}-total-size`;\n N(() => {\n const a = i.value;\n a && (a.style.setProperty(x, `${m.value}px`), a.style.setProperty(A, `${v.value}px`));\n });\n const M = {\n [`padding${f ? \"Top\" : \"Left\"}`]: `var(${x})`,\n [f ? \"height\" : \"width\"]: `var(${A})`,\n /**\n * Since the height of the element should not be influenced by its padding.\n * An alternative without box-sizing: \"border-box\" would be to use margins instead\n * paddings, but then it is no longer easily possible to absolutely position\n * other elements (e.g. a cell selection overlay) inside this element.\n */\n boxSizing: \"border-box\"\n };\n return {\n containerProps: {\n ref: i,\n onScroll: d\n },\n indices: p,\n scrolledAreaStyles: M\n };\n}, te = (t) => {\n const e = g(null), r = L(t.rows, \"vertical\", e), n = L(t.columns, \"horizontal\", e), c = () => {\n r.containerProps.onScroll(), n.containerProps.onScroll();\n };\n return B(e, c), {\n containerProps: {\n ref: e,\n onScroll: c\n },\n scrolledAreaStyles: {\n vertical: r.scrolledAreaStyles,\n horizontal: n.scrolledAreaStyles\n },\n indices: {\n vertical: r.indices,\n horizontal: n.indices\n }\n };\n}, z = (t, e) => R(t) && y(() => t.value, e), Y = (t, e) => Math.floor(t / e);\nclass re {\n constructor(e, r) {\n u(this, \"numItems\");\n u(this, \"size\");\n this.numItems = e, this.size = r;\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n z(this.numItems, e), z(this.size, e);\n }\n toOffset(e) {\n return e * s(this.size);\n }\n getTotalSize() {\n return s(this.numItems) * s(this.size);\n }\n toIndex(e) {\n return Math.max(\n Math.min(\n Y(e, s(this.size)),\n s(this.numItems) - 1\n ),\n 0\n );\n }\n}\nclass Z {\n constructor(e) {\n u(this, \"isLeft\");\n this.isLeft = e;\n }\n getLastLeftIndex(e, r = 0) {\n if (e - r <= 1)\n return this.isLeft(e) ? e : r;\n const n = Math.floor((e + r) / 2);\n return this.isLeft(n) ? this.getLastLeftIndex(e, n) : this.getLastLeftIndex(n, r);\n }\n}\nclass ne {\n constructor(e) {\n u(this, \"numItems\");\n u(this, \"accumulatedSizes\");\n this.numItems = h(() => s(e).length), this.accumulatedSizes = h(() => {\n const r = [0];\n for (let n = 0; n < s(e).length; n++)\n r.push(r[n] + s(e)[n]);\n return r;\n });\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n y([this.accumulatedSizes], e);\n }\n toOffset(e) {\n return this.accumulatedSizes.value[e];\n }\n getTotalSize() {\n return this.accumulatedSizes.value[s(this.numItems)];\n }\n toIndex(e) {\n return e < 0 ? 0 : new Z((n) => this.toOffset(n) <= e).getLastLeftIndex(s(this.numItems) - 1);\n }\n}\nclass b {\n constructor(e) {\n u(this, \"delegate\");\n this.delegate = e;\n }\n getTotalSize() {\n return this.delegate.getTotalSize();\n }\n toIndex(e) {\n return this.delegate.toIndex(e);\n }\n getNumItems() {\n return this.delegate.getNumItems();\n }\n toOffset(e) {\n return this.delegate.toOffset(e);\n }\n onUpdate(e) {\n this.delegate.onUpdate(e);\n }\n}\nclass se extends b {\n constructor({\n spaceBefore: r,\n spaceBeforeIsOffset: n\n }, c) {\n super(c);\n u(this, \"spaceBefore\");\n u(this, \"spaceBeforeIsOffset\");\n this.spaceBefore = r, this.spaceBeforeIsOffset = n;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceBefore, r);\n }\n toOffset(r) {\n return (this.spaceBeforeIsOffset ? s(this.spaceBefore) : 0) + super.toOffset(r);\n }\n getTotalSize() {\n return s(this.spaceBefore) + super.getTotalSize();\n }\n toIndex(r) {\n return super.toIndex(r - s(this.spaceBefore));\n }\n}\nclass oe extends b {\n constructor(r, n) {\n super(n);\n u(this, \"spaceAfter\");\n this.spaceAfter = r;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceAfter, r);\n }\n getTotalSize() {\n return super.getTotalSize() + s(this.spaceAfter);\n }\n}\nexport {\n ne as ArraySizeManager,\n re as SameSizeManager,\n oe as WithSpaceAfter,\n se as WithSpaceBefore,\n te as useVirtualGrid,\n L as useVirtualLine\n};\n","/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */\n\nfunction _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nfunction _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nfunction _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = true,\n o = false;\n try {\n if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = true, n = r;\n } finally {\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _slicedToArray(r, e) {\n return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n }\n}\n\nconst entries = Object.entries,\n setPrototypeOf = Object.setPrototypeOf,\n isFrozen = Object.isFrozen,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nlet freeze = Object.freeze,\n seal = Object.seal,\n create = Object.create; // eslint-disable-line import/no-mutable-exports\nlet _ref = typeof Reflect !== 'undefined' && Reflect,\n apply = _ref.apply,\n construct = _ref.construct;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(func, thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n return func.apply(thisArg, args);\n };\n}\nif (!construct) {\n construct = function construct(Func) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString = typeof BigInt === 'undefined' ? null : unapply(BigInt.prototype.toString);\nconst symbolToString = typeof Symbol === 'undefined' ? null : unapply(Symbol.prototype.toString);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n if (thisArg instanceof RegExp) {\n thisArg.lastIndex = 0;\n }\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return apply(func, thisArg, args);\n };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(Func) {\n return function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n return construct(Func, args);\n };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n if (!arrayIsArray(array)) {\n return set;\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const _ref2 of entries(object)) {\n var _ref3 = _slicedToArray(_ref2, 2);\n const property = _ref3[0];\n const value = _ref3[1];\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (arrayIsArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n/**\n * Convert non-node values into strings without depending on direct property access.\n *\n * @param value - The value to stringify.\n * @returns A string representation of the provided value.\n */\nfunction stringifyValue(value) {\n switch (typeof value) {\n case 'string':\n {\n return value;\n }\n case 'number':\n {\n return numberToString(value);\n }\n case 'boolean':\n {\n return booleanToString(value);\n }\n case 'bigint':\n {\n return bigintToString ? bigintToString(value) : '0';\n }\n case 'symbol':\n {\n return symbolToString ? symbolToString(value) : 'Symbol()';\n }\n case 'undefined':\n {\n return objectToString(value);\n }\n case 'function':\n case 'object':\n {\n if (value === null) {\n return objectToString(value);\n }\n const valueAsRecord = value;\n const valueToString = lookupGetter(valueAsRecord, 'toString');\n if (typeof valueToString === 'function') {\n const stringified = valueToString(valueAsRecord);\n return typeof stringified === 'string' ? stringified : objectToString(stringified);\n }\n return objectToString(value);\n }\n default:\n {\n return objectToString(value);\n }\n }\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\nfunction isRegex(value) {\n try {\n regExpTest(value, '');\n return true;\n } catch (_unused) {\n return false;\n }\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'command', 'commandfor', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-orientation', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\nconst MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nconst ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n// Markup-significant character probes used by _sanitizeElements.\n// Shared module-level instances are safe despite the sticky /g flags:\n// unapply() resets lastIndex for RegExp receivers before every call.\nconst ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nconst COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nconst FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nconst SELF_CLOSING_TAG = seal(/\\/>/i);\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n processingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nconst _createHooksMap = function _createHooksMap() {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: []\n };\n};\n/**\n * Resolve a set-valued configuration option: a fresh set built from\n * cfg[key] when it is an own array property (seeded with a clone of\n * options.base when given, case-normalized via options.transform),\n * the fallback set otherwise.\n *\n * @param cfg the cloned, prototype-free configuration object\n * @param key the configuration property to read\n * @param fallback the set to use when the option is absent or not an array\n * @param options transform and optional base set to merge into\n * @returns the resolved set\n */\nconst _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {\n return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n DOMPurify.version = '3.4.13';\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let document = window.document;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n window.DocumentFragment;\n const HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n Element = window.Element,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap;\n _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap;\n window.HTMLFormElement;\n const DOMParser = window.DOMParser,\n trustedTypes = window.trustedTypes;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');\n const getAttributes = lookupGetter(ElementPrototype, 'attributes');\n const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;\n const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;\n const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, 'ownerDocument') : null;\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n // The instance's own internal Trusted Types policy. Unlike a caller-supplied\n // `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws\n // on duplicate policy names — and is the only policy allowed to persist\n // across configurations and survive `clearConfig()`.\n let defaultTrustedTypesPolicy;\n let defaultTrustedTypesPolicyResolved = false;\n // Tracks whether we are already inside a call to the configured Trusted Types\n // policy (`createHTML` or `createScriptURL`). If a supplied policy callback\n // itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would\n // re-enter the policy and recurse until the stack overflows. We detect that\n // re-entry and throw a clear, actionable error instead. The guard is shared\n // across both callbacks, because either one re-entering `sanitize` triggers\n // the same unbounded recursion.\n let IN_TRUSTED_TYPES_POLICY = 0;\n const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {\n if (IN_TRUSTED_TYPES_POLICY > 0) {\n throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + 'infinite recursion. Do not pass a policy whose callbacks wrap ' + 'DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted ' + 'Types\" section of the README.');\n }\n };\n const _createTrustedHTML = function _createTrustedHTML(html) {\n _assertNotInTrustedTypesPolicy();\n IN_TRUSTED_TYPES_POLICY++;\n try {\n return trustedTypesPolicy.createHTML(html);\n } finally {\n IN_TRUSTED_TYPES_POLICY--;\n }\n };\n const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {\n _assertNotInTrustedTypesPolicy();\n IN_TRUSTED_TYPES_POLICY++;\n try {\n return trustedTypesPolicy.createScriptURL(scriptUrl);\n } finally {\n IN_TRUSTED_TYPES_POLICY--;\n }\n };\n // Lazily resolve (and cache) the instance's internal default policy.\n // Resolution is attempted at most once: a successful `createPolicy` cannot be\n // repeated (Trusted Types throws on duplicate names), and a failed or\n // unsupported attempt must not be retried on every parse.\n const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {\n if (!defaultTrustedTypesPolicyResolved) {\n defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n defaultTrustedTypesPolicyResolved = true;\n }\n return defaultTrustedTypesPolicy;\n };\n const _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n createDocumentFragment = _document.createDocumentFragment,\n getElementsByTagName = _document.getElementsByTagName;\n const importNode = originalDocument.importNode;\n let hooks = _createHooksMap();\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const MUSTACHE_EXPR$1 = MUSTACHE_EXPR,\n ERB_EXPR$1 = ERB_EXPR,\n TMPLIT_EXPR$1 = TMPLIT_EXPR,\n DATA_ATTR$1 = DATA_ATTR,\n ARIA_ATTR$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$1 = ATTR_WHITESPACE,\n CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;\n let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */\n const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {\n tagCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n }\n }));\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n /* Pristine allowlist bindings captured at setConfig() time. On the\n * persistent-config path sanitize() restores the sets from these before\n * the per-walk hook clone-guard, so a hook's in-call widening cannot\n * carry across calls. Null until setConfig() is called; reset by\n * clearConfig(). */\n let SET_CONFIG_ALLOWED_TAGS = null;\n let SET_CONFIG_ALLOWED_ATTR = null;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',\n // <selectedcontent> mirrors the selected <option>'s subtree, cloned by\n // the UA (customizable <select>) — including any on* handlers — and the\n // engine re-mirrors synchronously whenever a removal changes which\n // option/selectedcontent is current, even inside DOMPurify's inert\n // DOMParser document. Hoisting its children on removal re-inserts a fresh\n // mirror target ahead of the walk, which the engine refills, looping\n // forever (DoS) and amplifying output. Dropping its content on removal\n // (rather than hoisting) breaks that cascade; the content is a duplicate\n // of the option, which is sanitized on its own. See campaign-3 F1/F6.\n 'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);\n const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);\n let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {\n transform: transformCaseFunc\n });\n ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {\n transform: transformCaseFunc\n });\n ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {\n transform: stringToString\n });\n URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {\n transform: transformCaseFunc,\n base: DEFAULT_URI_SAFE_ATTRIBUTES\n });\n DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {\n transform: transformCaseFunc,\n base: DEFAULT_DATA_URI_TAGS\n });\n FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {\n transform: transformCaseFunc\n });\n FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {\n transform: transformCaseFunc\n });\n FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {\n transform: transformCaseFunc\n });\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp\n NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace\n MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); // Default built-in map\n HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); // Default built-in map\n const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);\n CUSTOM_ELEMENT_HANDLING = create(null);\n if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; // Default undefined\n }\n if (objectHasOwnProperty(customElementHandling, 'attributeNameCheck') && isRegexOrFunction(customElementHandling.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; // Default undefined\n }\n if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined\n }\n seal(CUSTOM_ELEMENT_HANDLING);\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = create(null);\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Always reset function-based ADD_TAGS / ADD_ATTR checks to prevent\n * leaking across calls when switching from function to array config */\n EXTRA_ELEMENT_HANDLING.tagCheck = null;\n EXTRA_ELEMENT_HANDLING.attributeCheck = null;\n /* Merge configuration parameters */\n if (objectHasOwnProperty(cfg, 'ADD_TAGS')) {\n if (typeof cfg.ADD_TAGS === 'function') {\n EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n } else if (arrayIsArray(cfg.ADD_TAGS)) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n }\n if (objectHasOwnProperty(cfg, 'ADD_ATTR')) {\n if (typeof cfg.ADD_ATTR === 'function') {\n EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n } else if (arrayIsArray(cfg.ADD_ATTR)) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n }\n if (objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (objectHasOwnProperty(cfg, 'FORBID_CONTENTS') && arrayIsArray(cfg.FORBID_CONTENTS)) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n if (objectHasOwnProperty(cfg, 'ADD_FORBID_CONTENTS') && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n // Re-derive the active Trusted Types policy from this configuration on\n // every parse. The active policy must never be sticky closure state that\n // outlives the config that set it: a caller-supplied policy left in place\n // after `clearConfig()` — or after a later call that supplied none, or\n // `TRUSTED_TYPES_POLICY: null` — could sign a subsequent \"default\"\n // `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.\n // See GHSA-vxr8-fq34-vvx9.\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n // A caller-supplied policy applies to this configuration only.\n const previousTrustedTypesPolicy = trustedTypesPolicy;\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n // Sign local variables required by `sanitize`. If the supplied policy's\n // `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this\n // throws via the re-entrancy guard. Restore the previous policy first so\n // the instance is not left in a poisoned state. See #1422.\n try {\n emptyHTML = _createTrustedHTML('');\n } catch (error) {\n trustedTypesPolicy = previousTrustedTypesPolicy;\n throw error;\n }\n } else if (cfg.TRUSTED_TYPES_POLICY === null) {\n // Explicit opt-out for this call: perform no Trusted Types signing and\n // create nothing (so a strict `trusted-types` CSP that disallows a\n // `dompurify` policy can still call `sanitize` from inside its own\n // policy — see #1422). Resetting to `undefined` rather than a sticky\n // `null` also drops any previously retained caller policy, so it cannot\n // resurface on a later call, while still allowing the next config-less\n // call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.\n trustedTypesPolicy = undefined;\n emptyHTML = '';\n } else {\n // No policy supplied: keep the currently active policy if one is set — a\n // previously supplied policy is intentionally sticky across config-less\n // calls — otherwise fall back to the instance's own internal policy,\n // created at most once. (A policy supplied for a *single* call still\n // lingers by design; what must not linger is a policy whose configuration\n // has been torn down via `clearConfig()`, which restores the default.)\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n }\n // Sign internal variables only when a policy is active. A falsy policy\n // (Trusted Types unsupported, creation failed, or an explicit opt-out)\n // leaves `emptyHTML` as a plain string, so we never call `.createHTML` on\n // a non-policy and throw. See #1422.\n if (trustedTypesPolicy && typeof emptyHTML === 'string') {\n emptyHTML = _createTrustedHTML('');\n }\n }\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n /**\n * Namespace rules for an element in the SVG namespace.\n *\n * @param tagName the element's lowercase tag name\n * @param parent the (possibly simulated) parent node\n * @param parentTagName the parent's lowercase tag name\n * @returns true if a spec-compliant parser could produce this element\n */\n const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n // The only way to switch from MathML to SVG is via <svg>\n // if the parent is either <annotation-xml> or a MathML\n // text integration point.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n };\n /**\n * Namespace rules for an element in the MathML namespace.\n *\n * @param tagName the element's lowercase tag name\n * @param parent the (possibly simulated) parent node\n * @param parentTagName the parent's lowercase tag name\n * @returns true if a spec-compliant parser could produce this element\n */\n const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n };\n /**\n * Namespace rules for an element in the HTML namespace.\n *\n * @param tagName the element's lowercase tag name\n * @param parent the (possibly simulated) parent node\n * @param parentTagName the parent's lowercase tag name\n * @returns true if a spec-compliant parser could produce this element\n */\n const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n };\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n return _checkSvgNamespace(tagName, parent, parentTagName);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n return _checkMathMlNamespace(tagName, parent, parentTagName);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n return _checkHtmlNamespace(tagName, parent, parentTagName);\n }\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n /* The normal detach failed — this is reached for a parentless node\n (getParentNode() is null, so .removeChild throws). Element.prototype\n .remove() is itself a spec no-op on a parentless node, so a recorded\n \"removal\" would otherwise hand the caller back an intact,\n payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or\n the style-with-element-child rule decided to kill). Fail closed by\n throwing — exactly as a clobbered root does at the IN_PLACE entry —\n rather than trying to \"neutralize\" the node via its own methods.\n Neutralizing would mean calling getAttributeNames()/removeAttribute()\n on the node, both of which a <form> root can clobber via a named child\n (and _isClobbered does not even probe getAttributeNames), so the\n neutralize step could itself be silently defeated, leaving the payload\n intact. A throw touches only the cached, clobber-safe remove() and\n getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)\n to every root-kill reason. REPORT-3.\n This lives inside the catch, so it never fires for a normally-removed\n in-tree node: those have a parent, removeChild() succeeds, and the\n catch is not entered. Only a kept (parentless) root reaches here. */\n remove(node);\n if (!getParentNode(node)) {\n throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');\n }\n }\n };\n /**\n * _neutralizeRoot\n *\n * Fail-closed teardown of an in-place root after the sanitize walk aborts\n * (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered\n * custom element's reaction detaches a node so `_forceRemove`'s deliberate\n * parentless guard throws, or any other re-entrant engine mutation — would\n * otherwise leave the caller's *live* tree half-sanitized, with everything\n * after the abort point still carrying its handlers. There is no safe way\n * to resume the walk (the tree mutated under us), so we strip the root bare:\n * remove every child and every attribute, then let the caller's catch see\n * the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`\n * getters; the root was already clobber-pre-flighted at the IN_PLACE entry).\n *\n * @param root the in-place root to empty\n */\n const _neutralizeRoot = function _neutralizeRoot(root) {\n /* Strip every disallowed attribute (on* handlers included) off the whole\n subtree BEFORE detaching anything. Detaching first would hand back\n handler-bearing originals (e.g. an already-loading `<img onerror>`)\n whose queued resource event still fires in page scope after we throw.\n Clobber-safe reads; a doomed clobbered node's own attributes are\n irrelevant while its non-clobbered descendants are reached and scrubbed. */\n _neutralizeSubtree(root);\n const childNodes = getChildNodes(root);\n if (childNodes) {\n const snapshot = [];\n arrayForEach(childNodes, child => {\n arrayPush(snapshot, child);\n });\n arrayForEach(snapshot, child => {\n try {\n remove(child);\n } catch (_) {\n /* Best-effort teardown; a still-attached child is handled below */\n }\n });\n }\n const attributes = getAttributes(root);\n if (attributes) {\n for (let i = attributes.length - 1; i >= 0; --i) {\n const attribute = attributes[i];\n const name = attribute && attribute.name;\n if (typeof name === 'string') {\n try {\n root.removeAttribute(name);\n } catch (_) {\n /* Clobbered removeAttribute — ignore (fail-closed best effort) */\n }\n }\n }\n }\n };\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, element) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element\n });\n }\n element.removeAttribute(name);\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _stripDisallowedAttributes\n *\n * Removes every attribute the active configuration does not allow from a\n * single element, using the same allowlist as the main attribute pass (so\n * `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to\n * neutralise nodes that are being discarded from an in-place tree.\n *\n * @param element the element to strip\n */\n const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {\n const attributes = getAttributes(element);\n if (!attributes) {\n return;\n }\n for (let i = attributes.length - 1; i >= 0; --i) {\n const attribute = attributes[i];\n const name = attribute && attribute.name;\n if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {\n continue;\n }\n try {\n element.removeAttribute(name);\n } catch (_) {\n /* Clobbered removeAttribute on a doomed node — ignore */\n }\n }\n };\n /**\n * _neutralizeSubtree\n *\n * Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT\n * move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,\n * namespace, comment, processing-instruction and KEEP_CONTENT:false removals\n * all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path\n * those dropped nodes are detached from the caller's LIVE tree but a\n * handler-bearing original among them (an `<img onerror>`/`<video>` that was\n * loading) keeps its queued resource event, which fires in page scope after\n * sanitize returns. This walks a removed subtree and strips every attribute\n * the active configuration does not allow — so `on*` handlers are cancelled\n * through the SAME allowlist that governs kept nodes, not a separate `/^on/`\n * blocklist. Run synchronously before sanitize returns, i.e. before any\n * queued event can fire. Hook-free by design: these nodes leave the output,\n * so firing attribute hooks for them would be surprising. Clobber-safe reads;\n * a doomed clobbered node may shadow `removeAttribute` (its own attributes are\n * irrelevant — it is discarded — while its non-clobbered descendants, e.g.\n * the `<img>`, are reached and scrubbed).\n *\n * @param root the root of a removed subtree to neutralise\n */\n const _neutralizeSubtree = function _neutralizeSubtree(root) {\n const stack = [root];\n while (stack.length > 0) {\n const node = stack.pop();\n const nodeType = getNodeType ? getNodeType(node) : node.nodeType;\n if (nodeType === NODE_TYPE.element) {\n _stripDisallowedAttributes(node);\n }\n const childNodes = getChildNodes(node);\n if (childNodes) {\n for (let i = childNodes.length - 1; i >= 0; --i) {\n stack.push(childNodes[i]);\n }\n }\n }\n };\n /**\n * _neutralizePatchLinkage\n *\n * IN_PLACE entry pre-pass (declarative-partial-updates / streaming\n * hardening, https://github.com/WICG/declarative-partial-updates).\n *\n * The main walk strips patch linkage (`for`/`patchsrc`) and removes range\n * markers (PIs / markup comments) node-by-node, in document order, AS it\n * reaches each node. On a live in-place root that leaves a window: from the\n * moment the root is connected until the walk arrives at a given node, that\n * node's linkage is live. A patch applied on connection/stream can fire as\n * a microtask during the walk and inject or teleport an unsanitized DOM\n * range into a region the iterator has already passed and will not revisit,\n * so the post-return \"tree is sanitized\" contract is violated. Sweep the\n * whole tree once up front and sever every linkage before the walk begins,\n * closing that window.\n *\n * This CANNOT undo a patch that already fired before sanitize ran — that is\n * the irreducible \"do not IN_PLACE a live-connected attacker tree\" caveat —\n * but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML\n * to group with the rest of the declarative-partial-updates handling and\n * stay overridable, consistent with the codebase.\n *\n * Clobber-safe traversal (cached childNodes getter); per-node try/catch so a\n * clobbered root cannot defeat the sweep of its non-clobbered descendants.\n *\n * NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe\n * .html Q1): this mirrors the existing policy of keeping `for` on\n * <label>/<output>. If the shipping feature can drive a patch through a\n * surviving `for`-on-label/output + `id` pair, this pre-pass and the\n * attribute check at _isBasicCustomElement's caller must additionally drop\n * that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.\n *\n * @param root the in-place root to sweep\n */\n const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {\n if (!SAFE_FOR_XML) {\n return;\n }\n const stack = [root];\n while (stack.length > 0) {\n const node = stack.pop();\n const nodeType = getNodeType ? getNodeType(node) : node.nodeType;\n /* Remove range markers (the target side of a patch linkage): every\n processing instruction, and any markup-bearing comment. */\n if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {\n try {\n remove(node);\n } catch (_) {\n /* Best-effort */\n }\n continue;\n }\n /* Strip patch-source attributes (the source side) off elements. */\n if (nodeType === NODE_TYPE.element) {\n const element = node;\n const lcTag = transformCaseFunc(getNodeName ? getNodeName(node) : node.nodeName);\n try {\n if (element.hasAttribute && element.hasAttribute('patchsrc')) {\n element.removeAttribute('patchsrc');\n }\n if (element.hasAttribute && element.hasAttribute('for') && lcTag !== 'label' && lcTag !== 'output') {\n element.removeAttribute('for');\n }\n } catch (_) {\n /* Clobbered removeAttribute/hasAttribute on a doomed node — ignore */\n }\n }\n const childNodes = getChildNodes(node);\n if (childNodes) {\n for (let i = childNodes.length - 1; i >= 0; --i) {\n stack.push(childNodes[i]);\n }\n }\n }\n };\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n /* Read ownerDocument through the cached Node.prototype getter, never the\n direct property. HTMLFormElement has [LegacyOverrideBuiltIns], so a\n clobbering child (<input name=\"ownerDocument\"> or a form-associated\n external input) shadows the prototype getter and makes a direct read\n return that <input>. createNodeIterator.call(<input>, ...) then throws\n \"Illegal invocation\", and on the IN_PLACE path that throw lands before\n the walk's fail-closed barrier - leaving the caller's live tree, with\n any already-armed handler in it, un-neutralized. The cached getter\n returns the real Document regardless of the clobber. */\n const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n return createNodeIterator.call(doc || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n /**\n * Replace template expression syntax (mustache, ERB, template\n * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n * sites. Order matters: mustache, then ERB, then template literal.\n *\n * @param value the string to scrub\n * @returns the scrubbed string\n */\n const _stripTemplateExpressions = function _stripTemplateExpressions(value) {\n value = stringReplace(value, MUSTACHE_EXPR$1, ' ');\n value = stringReplace(value, ERB_EXPR$1, ' ');\n value = stringReplace(value, TMPLIT_EXPR$1, ' ');\n return value;\n };\n /**\n * Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n * character data of an element subtree. Used as the final safety net for\n * SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n * which only form after text-node normalization (e.g. fragments split across\n * stripped elements) cannot survive into a template-evaluating framework.\n *\n * Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n * in place rather than round-tripping through innerHTML. This preserves\n * descendant node references (important for IN_PLACE callers), avoids a\n * serialize/reparse cycle, and reads literal character data — which means\n * `<%...%>` in text content matches the ERB regex against its real bytes\n * instead of the HTML-entity-escaped form innerHTML would produce.\n *\n * Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n * attributes is performed during the per-node `_sanitizeAttributes` pass.\n *\n * @param node The root element whose character data should be scrubbed.\n */\n const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {\n var _node$querySelectorAl;\n node.normalize();\n /* Clobber-safe ownerDocument read, same reasoning as _createNodeIterator:\n under SAFE_FOR_TEMPLATES this runs on the live IN_PLACE root, which may\n carry a form-named-getter override of ownerDocument. */\n const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n const walker = createNodeIterator.call(doc || node, node,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);\n let currentNode = walker.nextNode();\n while (currentNode) {\n currentNode.data = _stripTemplateExpressions(currentNode.data);\n currentNode = walker.nextNode();\n }\n // NodeIterator does not descend into <template>.content per the DOM spec,\n // so we must explicitly recurse into each template's content fragment,\n // mirroring the approach used by _sanitizeShadowDOM.\n const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');\n if (templates) {\n arrayForEach(templates, tmpl => {\n if (_isDocumentFragment(tmpl.content)) {\n _scrubTemplateExpressions2(tmpl.content);\n }\n });\n }\n };\n /**\n * _isClobbered\n *\n * Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n * interface with [LegacyOverrideBuiltIns]; a descendant element with a\n * `name` attribute matching a prototype property shadows that property\n * on direct reads. We use this check at the IN_PLACE entry-point and\n * during attribute sanitization to refuse clobbered forms.\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(element) {\n // Realm-independent tag-name probe. If we can't determine the tag\n // name at all, we can't reason about clobbering — return false\n // (the caller's other defences still apply).\n const realTagName = getNodeName ? getNodeName(element) : null;\n if (typeof realTagName !== 'string') {\n return false;\n }\n if (transformCaseFunc(realTagName) !== 'form') {\n return false;\n }\n return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||\n // Realm-safe NamedNodeMap detection: equality against the cached\n // prototype getter. Clobbered .attributes (e.g. <input name=\"attributes\">)\n // makes the direct read diverge from the cached read; a clean form\n // (same-realm OR foreign-realm) has both reads pointing at the same\n // canonical NamedNodeMap.\n element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||\n // NodeType clobbering probe. Cached Node.prototype.nodeType getter\n // returns the integer 1 for any Element regardless of realm; direct\n // read on a clobbered form (e.g. <input name=\"nodeType\">) returns\n // the named child element. Cheap addition — nodeType is read from\n // an internal slot, no serialization cost — and removes a residual\n // clobbering surface used by several mXSS / PI / comment branches\n // in _sanitizeElements that compare currentNode.nodeType directly.\n element.nodeType !== getNodeType(element) ||\n // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named\n // \"childNodes\" shadows the prototype getter. Direct reads of\n // form.childNodes from a clobbered form return the named child\n // instead of the real NodeList, so any walk that reads it directly\n // skips the form's real children. Compare the direct read to the\n // cached Node.prototype getter — when the form's named-property\n // getter intercepts the read, the two values differ and we flag\n // the form. This catches every clobbering child type (input,\n // select, etc.) regardless of whether the named child happens to\n // carry a numeric .length, which a typeof-based probe would miss\n // (e.g. HTMLSelectElement.length is a defined unsigned-long).\n element.childNodes !== getChildNodes(element);\n };\n /**\n * Checks whether the given value is a DocumentFragment from any realm.\n *\n * The realm-independent replacement reads `nodeType` through the cached\n * Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n * constant (11). nodeType is a numeric value resolved from the node's\n * internal slot, identical across realms for the same kind of node.\n *\n * @param value object to check\n * @return true if value is a DocumentFragment-shaped node from any realm\n */\n const _isDocumentFragment = function _isDocumentFragment(value) {\n if (!getNodeType || typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return getNodeType(value) === NODE_TYPE.documentFragment;\n } catch (_) {\n return false;\n }\n };\n /**\n * Checks whether the given object is a DOM node, including nodes that\n * originate from a different window/realm (e.g. an iframe's\n * contentDocument). The previous `value instanceof Node` check was\n * realm-bound: nodes from a different window failed it, causing\n * sanitize() to silently stringify them and reset IN_PLACE to false,\n * returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n *\n * @param value object to check whether it's a DOM node\n * @return true if value is a DOM node from any realm\n */\n const _isNode = function _isNode(value) {\n if (!getNodeType || typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof getNodeType(value) === 'number';\n } catch (_) {\n return false;\n }\n };\n function _executeHooks(hooks, currentNode, data) {\n if (hooks.length === 0) {\n return;\n }\n arrayForEach(hooks, hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n /**\n * Structural-threat checks that condemn a node regardless of the\n * allowlists: mXSS via namespace confusion, risky CSS construction,\n * processing instructions, markup-bearing comments. Pure predicate;\n * the caller removes. Check order is load-bearing.\n *\n * @param currentNode the node to inspect\n * @param tagName the node's transformCaseFunc'd tag name\n * @return true if the node must be removed\n */\n const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {\n /* Detect mXSS attempts abusing namespace confusion */\n if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {\n return true;\n }\n /* Remove risky CSS construction leading to mXSS */\n if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {\n return true;\n }\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.processingInstruction) {\n return true;\n }\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {\n return true;\n }\n return false;\n };\n /**\n * Handle a node whose tag is forbidden or not allowlisted: keep\n * allowed custom elements (false return exits _sanitizeElements\n * early - the namespace and fallback-tag removal checks are\n * intentionally skipped for kept custom elements), else hoist\n * content per KEEP_CONTENT and remove.\n *\n * A kept custom element is the ONLY case in which this function\n * returns false, so the caller uses that return value to run the\n * afterSanitizeElements hook on the kept element and keep the\n * element-hook lifecycle consistent with normal allowlisted\n * elements (GHSA-c2j3-45gr-mqc4).\n *\n * @param currentNode the disallowed node\n * @param tagName the node's transformCaseFunc'd tag name\n * @return true if the node was removed, false if kept\n */\n const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n /* Keep content except for bad-listed elements.\n Use the cached prototype getters exclusively — the previous code\n had `|| currentNode.parentNode` / `|| currentNode.childNodes`\n fallbacks, but the cached getters always return the canonical\n value (or null for a real parent-less node), so the fallback\n path was dead in safe cases and a clobbering surface in unsafe\n ones. Falsy cached results stay falsy; the `if (childNodes &&\n parentNode)` check already gates correctly. */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode);\n const childNodes = getChildNodes(currentNode);\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n /* Hoist by moving each child up one level rather than deep-cloning\n it. Moving transfers every descendant exactly once, so a chain of\n nested disallowed elements costs O(n) instead of the O(n^2) that\n re-cloning the shrinking subtree at each level produced; it also\n empties the removed original, so `DOMPurify.removed` no longer\n pins whole subtrees. Moving preserves the in-place guarantee too:\n an original carrying already-queued resource events (`<img\n onerror>`, `<video>`/`<audio>` error, lazy/`onload`, …) is\n relocated and sanitised rather than left detached but still armed.\n The sole case that must clone is removing the walk root itself.\n The result is serialised from the root's subtree, so a restrictive\n ALLOWED_TAGS that strips the root (`body` on the string path) must\n leave the content inside it, which only cloning does. In IN_PLACE\n the root is pre-validated as an allowed tag and so is never removed\n here, so that path always takes the move branch.\n `childNodes` is live; a tail-to-head walk keeps `childNodes[i]`\n valid whether we move (drops the trailing entry) or clone (leaves\n the list intact). */\n for (let i = childCount - 1; i >= 0; --i) {\n const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];\n parentNode.insertBefore(hoisted, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n };\n /**\n * Fork a hook-mutable allowlist off its shared binding the first time a\n * (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n * hook cannot widen the per-instance default or the setConfig binding by\n * reference and leak past the call. Returns the set unchanged once it is\n * already call-local, so repeated calls across elements are idempotent.\n *\n * @param hookList the uponSanitize* hook array for this event\n * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n * @param setConfigSet the captured setConfig() binding, or null\n * @return a call-local clone if a hook is present and set is still shared,\n * else set unchanged\n */\n const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {\n if (hookList.length === 0) {\n return set;\n }\n return set === defaultSet || set === setConfigSet ? clone(set) : set;\n };\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n // eslint-disable-next-line complexity\n const _sanitizeElements = function _sanitizeElements(currentNode, root) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n /* A hook may have detached the node - treat it as removed (see the\n detached-node comment after the uponSanitizeElement hook below). On\n the IN_PLACE path, neutralize the detached subtree first so a queued\n resource handler on it cannot fire in page scope after we return. */\n if (currentNode !== root && getParentNode(currentNode) === null) {\n if (IN_PLACE) {\n _neutralizeSubtree(currentNode);\n }\n return true;\n }\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);\n /* Close the pre-walk clone-guard's timing gap: an uponSanitizeElement\n hook may have been installed after that guard sampled the hook arrays\n (e.g. lazily from beforeSanitizeElements), leaving ALLOWED_TAGS still\n aliasing a shared binding that a widening hook would mutate by\n reference. Fork it before exposing it to the hook. */\n ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* A hook may have detached the node from the tree — a long-standing\n user pattern (issue #469; draw.io-style foreignObject filtering).\n Per the cached, unclobberable parentNode getter the node is\n genuinely out of the tree, so it can reach neither the serialized\n output nor an IN_PLACE live tree; treat it as removed and stop\n processing it. Without this guard, the unsafe-node / namespace\n checks below would call _forceRemove on a parentless node and hit\n the REPORT-3 fail-closed throw — which exists for nodes DOMPurify\n wants gone but *cannot* detach (clobbered / parentless roots), the\n opposite of a node that is already safely gone. The walk root is\n exempt: a detached IN_PLACE root is legitimate input and must still\n be fully sanitized, and a kill-decision on it must keep hitting the\n REPORT-3 throw. Nodes detached by hooks stay the hook's\n responsibility for placement: they are not recorded in\n DOMPurify.removed, so the post-walk IN_PLACE pass (which iterates\n DOMPurify.removed) does not reach them. But a hook-detached subtree\n can still hold a queued resource-event handler - e.g. an <img onload>\n that began loading when the caller built the live tree - which fires\n in page scope after sanitize returns even though the handler never\n reached the returned tree. That is the audit-5 F1 hazard, and the\n documented node.remove() hook pattern walks straight into it. So on\n the IN_PLACE path we neutralize the detached subtree inline here,\n stripping its non-allow-listed attributes before returning, exactly\n as the post-walk pass does for _forceRemove'd subtrees. */\n if (currentNode !== root && getParentNode(currentNode) === null) {\n if (IN_PLACE) {\n _neutralizeSubtree(currentNode);\n }\n return true;\n }\n /* Remove mXSS vectors, processing instructions and risky comments */\n if (_isUnsafeNode(currentNode, tagName)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove element if anything forbids its presence */\n if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {\n const removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n /* A false return means the node is a custom element kept via\n CUSTOM_ELEMENT_HANDLING - the only keep path through\n _sanitizeDisallowedNode. Run afterSanitizeElements on it so the\n element-hook lifecycle matches normal allowlisted elements: a\n security policy applied in this hook (e.g. stripping an attribute\n from every surviving element) must not silently skip kept custom\n elements (GHSA-c2j3-45gr-mqc4). This mirrors the normal-element\n tail below - the hook runs, then the walker's subsequent\n _sanitizeAttributes pass sanitizes the element's attributes. The\n deliberately skipped namespace and fallback-tag removal checks stay\n skipped; they are removal decisions, not the hook contract. */\n if (removed === false) {\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n }\n return removed;\n }\n /* Check whether element has a valid namespace.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype\n nodeType getter rather than `instanceof Element`, which is realm-\n bound and short-circuits to false for any node minted in a different\n realm — letting a foreign-realm element with a forbidden namespace\n slip past the namespace check entirely. */\n const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;\n if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n const content = _stripTemplateExpressions(currentNode.textContent);\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */\n if (FORBID_ATTR[lcName]) {\n return false;\n }\n /* Reject declarative-partial-updates patch-linkage attributes\n (https://github.com/WICG/declarative-partial-updates).\n Empirical note (Chrome 150, verified — see\n test/declarative-patch-probe-v3.html): expansion is NOT applied after\n sanitization. For the string path it fires during sanitize()'s own\n parse, so the walk sees and sanitizes the fully materialized expanded\n tree — teleports into MathML/SVG integration points included; a\n weaponized `<template for>`->`<img onerror>` comes back with the handler\n stripped. For the IN_PLACE path it fires on connection, before the walk.\n Either way DOMPurify is NOT blind to the patch.\n This removal is therefore defense-in-depth rather than the sole barrier:\n it prevents live linkage from surviving into the OUTPUT and re-expanding\n in the caller's context, and keeps behaviour deterministic if a future\n engine defers expansion. `for` is legitimate only on <label>/<output>;\n anywhere else (notably <template for>) it links the element to a patch\n target and teleports or removes an arbitrary DOM range by id/marker name.\n `patchsrc` fetches remote markup and is treated as a script-loading\n mechanism (CSP). Gated on SAFE_FOR_XML so the removal groups with the\n other structural-threat checks and stays overridable, consistent with\n the rest of the codebase. PI range markers are already removed by\n _isUnsafeNode. */\n if (SAFE_FOR_XML && lcName === 'patchsrc') {\n return false;\n }\n if (SAFE_FOR_XML && lcName === 'for' && lcTag !== 'label' && lcTag !== 'output') {\n return false;\n }\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n /* Names the HTML spec reserves from valid-custom-element-name; these must\n * never be treated as basic custom elements even when a permissive\n * CUSTOM_ELEMENT_HANDLING.tagNameCheck is configured. */\n const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ['annotation-xml', 'color-profile', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'missing-glyph']);\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);\n };\n /**\n * Wrap an attribute value in the matching Trusted Types object when\n * the active policy requires it. Namespaced attributes pass through\n * unchanged (no TT support yet, see\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n *\n * @param lcTag lowercase tag name of the containing element\n * @param lcName lowercase attribute name\n * @param namespaceURI the attribute's namespace, if any\n * @param value the attribute value to wrap\n * @return the value, wrapped when Trusted Types demand it\n */\n const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n return _createTrustedHTML(value);\n }\n case 'TrustedScriptURL':\n {\n return _createTrustedScriptURL(value);\n }\n }\n }\n return value;\n };\n /**\n * Write a modified attribute value back onto the element. On\n * success, re-probe for clobbering introduced by the new value and\n * remove the element when found; otherwise pop the removal entry\n * recorded by the earlier _removeAttribute (long-standing pairing\n * with the SANITIZE_NAMED_PROPS path - do not \"fix\" casually). On\n * failure, remove the attribute instead.\n *\n * @param currentNode the element carrying the attribute\n * @param name the attribute name as present on the element\n * @param namespaceURI the attribute's namespace, if any\n * @param value the new attribute value\n */\n const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {\n _removeAttribute(name, currentNode);\n }\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n const attributes = currentNode.attributes;\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n /* Same lazy-install guard as uponSanitizeElement (see there): fork the\n attribute allowlist off its shared binding before a hook can see it. */\n ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined\n };\n let l = attributes.length;\n const lcTag = transformCaseFunc(currentNode.nodeName);\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const name = attr.name,\n namespaceURI = attr.namespaceURI,\n attrValue = attr.value;\n const lcName = transformCaseFunc(name);\n const initValue = attrValue;\n let value = name === 'value' ? initValue : stringTrim(initValue);\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name') && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n // Else: already prefixed, leave the attribute alone — the prefix is\n // itself the clobbering protection, and re-applying it is incorrect.\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Make sure we cannot easily use animated hrefs, even if animations are allowed */\n if (lcName === 'attributename' && stringMatch(value, 'href')) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Did the hooks force-keep the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = _stripTemplateExpressions(value);\n }\n /* Is `value` valid for this attribute? */\n if (!_isValidAttribute(lcTag, lcName, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Handle attributes that require Trusted Types */\n value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n /* Handle invalid data-* attribute set by try-catching it */\n if (value !== initValue) {\n _setAttributeValue(currentNode, name, namespaceURI, value);\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode, fragment);\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the\n DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we\n recurse into <template>.content from foreign realms too. */\n if (_isDocumentFragment(shadowNode.content)) {\n _sanitizeShadowDOM2(shadowNode.content);\n }\n /* An element iterated here may itself host an attached\n shadow root. The default NodeIterator does not enter shadow\n trees, so a shadow root nested inside template.content was\n previously reached by no walk at all (the pre-pass at\n _sanitizeAttachedShadowRoots descends via childNodes, which\n doesn't enter template.content; the template-content recursion\n above iterates the content but never inspected shadowRoot).\n Walk it explicitly. The nodeType guard avoids reading\n shadowRoot off text / comment / CDATA / PI nodes that the\n iterator also surfaces. */\n const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;\n if (shadowNodeType === NODE_TYPE.element) {\n const innerSr = getShadowRoot(shadowNode);\n if (_isDocumentFragment(innerSr)) {\n _sanitizeAttachedShadowRoots(innerSr);\n _sanitizeShadowDOM2(innerSr);\n }\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n /**\n * _sanitizeAttachedShadowRoots\n *\n * Walks `root` and feeds every attached shadow root we encounter into\n * the existing _sanitizeShadowDOM pipeline. The default node iterator\n * does not descend into shadow trees, so nodes inside an attached\n * shadow root would otherwise be skipped entirely.\n *\n * Two real input paths put attached shadow roots in front of us:\n * 1. IN_PLACE on a DOM node that already has shadow roots attached.\n * 2. DOM-node input where importNode(dirty, true) deep-clones the\n * shadow root because it was created with `clonable: true`.\n *\n * This pass runs once, up front, so the main iteration loop (and the\n * existing _sanitizeShadowDOM template-content recursion) stay\n * untouched — string-input paths are not affected.\n *\n * @param root the subtree root to walk for attached shadow roots\n */\n const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {\n /* Iterative (explicit stack) rather than per-child recursion. DOM APIs\n impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data\n built straight into the DOM — the IN_PLACE surface) deeper than the JS\n call-stack budget would otherwise overflow native recursion here and\n throw at the IN_PLACE entry pre-pass, before a single node is\n sanitized, leaving the caller's live tree untouched (fail-open). See\n campaign-3 F4. A heap stack keeps depth off the call stack.\n Each work item is either a node to descend into, or a deferred\n `_sanitizeShadowDOM` for an already-walked shadow root. The deferred\n form preserves the original post-order discipline: a shadow root's\n nested shadow roots are discovered before the outer shadow is\n sanitized (which may remove hosts). Pushes are in reverse of the\n desired processing order (LIFO): template content, then children, then\n the shadow-sanitize, then the shadow walk — so the order matches the\n previous recursion exactly. */\n const stack = [{\n node: root,\n shadow: null\n }];\n while (stack.length > 0) {\n const item = stack.pop();\n /* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */\n if (item.shadow) {\n _sanitizeShadowDOM2(item.shadow);\n continue;\n }\n const node = item.node;\n const nodeType = getNodeType ? getNodeType(node) : node.nodeType;\n const isElement = nodeType === NODE_TYPE.element;\n /* (pushed last → processed first) Children, snapshotted in reverse so\n the first child is processed first. Snapshotting matters because a\n hook may detach siblings mid-walk. */\n const childNodes = getChildNodes(node);\n if (childNodes) {\n for (let i = childNodes.length - 1; i >= 0; --i) {\n stack.push({\n node: childNodes[i],\n shadow: null\n });\n }\n }\n /* (pushed before children → processed after them, matching the old\n \"template content last\" order) When the node is a <template>,\n descend into its content. */\n if (isElement) {\n const rootName = getNodeName ? getNodeName(node) : null;\n if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {\n const content = node.content;\n if (_isDocumentFragment(content)) {\n stack.push({\n node: content,\n shadow: null\n });\n }\n }\n }\n /* Shadow root (processed first): walk its subtree, then sanitise it.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection\n rather than `instanceof DocumentFragment`, which is realm-bound and\n silently skipped foreign-realm shadow roots (e.g.\n iframe.contentDocument attachShadow). */\n if (isElement) {\n const sr = getShadowRoot(node);\n if (_isDocumentFragment(sr)) {\n /* Push the deferred sanitise first so it pops after the shadow\n walk we push next, i.e. nested shadow roots are discovered\n before this one is sanitised. */\n stack.push({\n node: null,\n shadow: sr\n }, {\n node: sr,\n shadow: null\n });\n }\n }\n }\n };\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n dirty = stringifyValue(dirty);\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n if (SET_CONFIG) {\n /* Persistent setConfig() path: _parseConfig is skipped, so the sets are\n * not re-derived per call. Restore them from the pristine bindings\n * captured at setConfig() time so a previous call's hook clone (mutated\n * below) does not carry over. */\n ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n } else {\n _parseConfig(cfg);\n }\n /* Clone the hook-mutable allowlists before the walk whenever an\n * uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS\n * and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so\n * a hook that widens them would otherwise mutate the shared set\n * permanently: across later calls and across every element. Cloning per\n * walk keeps documented in-call widening working while scoping it to the\n * call. A single guard for both config paths - the per-call path rebinds\n * the sets in _parseConfig each call, the persistent path restores them\n * from the captured bindings just above - so the two cannot diverge. */\n if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n if (hooks.uponSanitizeAttribute.length > 0) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n /* Clean up removed elements */\n DOMPurify.removed = [];\n /* Resolve IN_PLACE for this call without mutating persistent config.\n Writing the IN_PLACE closure variable here leaks under setConfig(),\n where _parseConfig is skipped on later calls: a single string call would\n disable in-place mode for every subsequent node call, returning a\n sanitized copy while leaving the caller's node — which in-place callers\n keep using and whose return value they ignore — unsanitized. REPORT-2. */\n const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);\n if (inPlace) {\n /* Declarative-partial-updates / streaming pre-pass: sever every patch\n linkage across the live tree BEFORE the walk, so no patch can fire\n mid-walk and inject into an already-processed region. Runs first, so\n it also covers the forbidden/clobbered roots that throw below. */\n _neutralizePatchLinkage(dirty);\n /* Do some early pre-sanitization to avoid unsafe root nodes.\n Read nodeName through the cached prototype getter — a clobbering\n child named \"nodeName\" on the form root would otherwise shadow\n the property and let this check skip the root-allowlist\n validation entirely. */\n const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;\n if (typeof nn === 'string') {\n const tagName = transformCaseFunc(nn);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Fail closed on a live root: neutralize handlers/children before\n throwing, exactly as the mid-walk abort path does. */\n _neutralizeRoot(dirty);\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n /* Pre-flight the root through _isClobbered. The iterator-driven\n removal path can not detach a parent-less root: _forceRemove\n falls through to Element.prototype.remove(), which per spec\n is a no-op on a node with no parent. A clobbered root would\n then survive the main loop with its attributes uninspected,\n because _sanitizeAttributes early-returns on _isClobbered. The\n result would be an attacker-controlled form, complete with any\n event-handler attributes the caller passed in, handed back to\n the application unsanitized. Refuse to sanitize such a root\n the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */\n if (_isClobbered(dirty)) {\n /* Fail closed on a live clobbered root before throwing.\n _neutralizeRoot's reads are clobber-safe (cached getters); the\n form's non-clobbered descendants, e.g. an armed <img>, are scrubbed. */\n _neutralizeRoot(dirty);\n throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');\n }\n /* Sanitize attached shadow roots before the main iterator runs.\n The iterator does not descend into shadow trees. Same fail-closed\n barrier as the main walk (campaign-3 F2): a custom-element reaction\n inside a shadow root could abort this pre-pass before the walk runs,\n which would otherwise leave the entire live tree unsanitized. */\n try {\n _sanitizeAttachedShadowRoots(dirty);\n } catch (error) {\n _neutralizeRoot(dirty);\n throw error;\n }\n } else if (_isNode(dirty)) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n /* Clonable shadow roots are deep-cloned by importNode(); sanitize\n them before the main iterator runs, since the iterator does not\n descend into shadow trees. The walk routes every read through a\n cached prototype getter so clobbering descendants on a form root\n cannot hide a shadow host from this pass. */\n _sanitizeAttachedShadowRoots(importedNode);\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n const walkRoot = inPlace ? dirty : body;\n /* Now start iterating over the created document.\n The walk runs inside an exception barrier (campaign-3 F2): a re-entrant\n engine/custom-element mutation can detach a node mid-walk so\n `_forceRemove`'s parentless guard throws, aborting the loop. Without the\n barrier the caller's in-place tree would be left half-sanitized with the\n unvisited tail still armed. _createNodeIterator itself is inside the\n barrier too: constructing the iterator dereferences the root's document,\n and any failure there (e.g. an exotic/clobbered root) must still fail\n closed rather than skip the neutralize. On any throw we fail closed -\n strip the in-place root bare - then rethrow so the existing throw\n contract is preserved. (String/DOM-copy paths never return the partial\n body, so the propagating throw is already fail-closed there.) */\n try {\n const nodeIterator = _createNodeIterator(walkRoot);\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode, walkRoot);\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n /* Shadow DOM detected, sanitize it.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection\n instead of instanceof, so foreign-realm <template>.content is\n walked correctly. */\n if (_isDocumentFragment(currentNode.content)) {\n _sanitizeShadowDOM2(currentNode.content);\n }\n }\n } catch (error) {\n if (inPlace) {\n _neutralizeRoot(dirty);\n /* Nodes _forceRemove'd earlier in the aborted walk are already\n detached from the root, so _neutralizeRoot's subtree pass does not\n reach them. Defuse them too, mirroring the success-path loop below. */\n arrayForEach(DOMPurify.removed, entry => {\n if (entry.element) {\n _neutralizeSubtree(entry.element);\n }\n });\n }\n throw error;\n }\n /* If we sanitized `dirty` in-place, return it. */\n if (inPlace) {\n /* Fail-closed completion of the audit-5 F1 fix: every node removed from\n the caller's live tree is detached but may still hold a queued\n resource-event handler that fires in page scope after we return. The\n move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the\n non-allow-listed attributes off every other removed subtree (clobber,\n mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are\n cancelled before any event can fire. Runs synchronously, pre-return. */\n arrayForEach(DOMPurify.removed, entry => {\n if (entry.element) {\n _neutralizeSubtree(entry.element);\n }\n });\n if (SAFE_FOR_TEMPLATES) {\n _scrubTemplateExpressions2(dirty);\n }\n return dirty;\n }\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (SAFE_FOR_TEMPLATES) {\n _scrubTemplateExpressions2(body);\n }\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = _stripTemplateExpressions(serializedHTML);\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;\n };\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n };\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n SET_CONFIG_ALLOWED_TAGS = null;\n SET_CONFIG_ALLOWED_ATTR = null;\n // Drop any caller-supplied Trusted Types policy so it cannot poison later\n // `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and\n // never recreated — Trusted Types throws on duplicate names) is restored by\n // the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.\n trustedTypesPolicy = defaultTrustedTypesPolicy;\n emptyHTML = '';\n };\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n /* Reject unknown entry points. Without this, a non-hook key (e.g.\n * '__proto__') indexes off the prototype chain rather than a real\n * hook array, and arrayPush then writes to Object.prototype. Guard\n * with an own-property check against the known hook names. */\n if (!objectHasOwnProperty(hooks, entryPoint)) {\n return;\n }\n arrayPush(hooks[entryPoint], hookFunction);\n };\n DOMPurify.removeHook = function (entryPoint, hookFunction) {\n if (!objectHasOwnProperty(hooks, entryPoint)) {\n return undefined;\n }\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n return arrayPop(hooks[entryPoint]);\n };\n DOMPurify.removeHooks = function (entryPoint) {\n if (!objectHasOwnProperty(hooks, entryPoint)) {\n return;\n }\n hooks[entryPoint] = [];\n };\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","import { getDate, getMonth, getYear, isAfter, isBefore, isValid, set } from \"date-fns\";\nimport prettyBytes from \"pretty-bytes\";\nimport DomPurify from \"dompurify\";\n//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\n//#region src/capitalize.ts\n/**\n* Uppercases first letter of string\n* @param string to be capitalized first string, e.g. \"workflow\"\n* @return Capitalized String, e.g. \"Workflow\"\n*/\nvar capitalize = (input) => input.charAt(0).toUpperCase() + input.substring(1);\nvar formats = {\n\tcustomFormat: (input, delimiter) => capitalize(input.replace(delimiter, \" \").toLowerCase()),\n\tkebabFormat: (input) => formats.customFormat(input, \"-\"),\n\tsnakeFormat: (input) => formats.customFormat(input, \"_\"),\n\tcamelPascalCase: (input) => capitalize((input.match(/([A-Z]?[^A-Z]*)/g) ?? []).slice(0, -1).join(\" \").toLowerCase())\n};\nvar caseFormatter = ({ string, delimiter, format }) => {\n\tif (delimiter) return formats.customFormat(string, delimiter);\n\tif (format) return formats[format](string, delimiter ?? \"\");\n\treturn capitalize(string);\n};\n//#endregion\n//#region src/updateDate.ts\n/**\n* Updates the date part (year, day and month) of a date object (base)\n* time, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract day, month and year from this date object.\n* @returns Copy of base with day, month and year of date.\n*/\nvar updateDate_default = (base, date) => {\n\tif (date) {\n\t\tbase = isValid(base) ? base : new Date(Date.UTC(0, 0));\n\t\treturn set(base, {\n\t\t\tyear: getYear(date),\n\t\t\tmonth: getMonth(date),\n\t\t\tdate: getDate(date)\n\t\t});\n\t}\n\treturn base;\n};\n//#endregion\n//#region src/updateTime.ts\n/**\n* Updates the time part (hour, minute, second and millisecond) of a date object (base)\n* date, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract hour, minute, second and millisecond from this date object.\n* @returns Copy of base with hour, minute, second and millisecond changed.\n*/\nvar updateTime_default = (base, date) => {\n\tconst d = new Date(base);\n\tif (date) {\n\t\td.setHours(date.getHours());\n\t\td.setMinutes(date.getMinutes());\n\t\td.setSeconds(date.getSeconds());\n\t\td.setMilliseconds(date.getMilliseconds());\n\t}\n\treturn d;\n};\n//#endregion\n//#region src/dateMinMaxCheck.ts\n/**\n* Check if date is before min.\n* @param date\n* @param min\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isBeforeMinDate = (date, min, checkDate, checkTime) => {\n\tif (min) {\n\t\tif (checkTime && checkDate) return isBefore(date, min);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateTime_default(base, date), updateTime_default(base, min));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateDate_default(base, date), updateDate_default(base, min));\n\t\t}\n\t}\n\treturn false;\n};\n/**\n* Check\n* @param date - date to check.\n* @param max - maximum date.\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isAfterMaxDate = (date, max, checkDate, checkTime) => {\n\tif (max) {\n\t\tif (checkTime && checkDate) return isAfter(date, max);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateTime_default(base, date), updateTime_default(base, max));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateDate_default(base, date), updateDate_default(base, max));\n\t\t}\n\t}\n\treturn false;\n};\n//#endregion\n//#region src/debounce.ts\nvar debounce = (callback, wait) => {\n\tlet timer;\n\tlet lastCall = 0;\n\treturn (...args) => {\n\t\tconst [value, index] = args;\n\t\tclearTimeout(timer);\n\t\tconst now = Date.now();\n\t\tif (now - lastCall > wait) {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t} else timer = setTimeout(() => {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t}, wait);\n\t};\n};\nvar filters = Object.assign({}, ...[\n\t{\n\t\tid: \"search\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\treturn caseSensitiveSearch ? searchTerm : searchTerm.toLowerCase();\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = (caseSensitiveSearch ? text : text.toLowerCase()).includes(normalizedSearchTerm);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"wildcard\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\tif (searchTerm.length > 0) searchTerm = `^${searchTerm.replace(/[-[\\]{}()+.,\\\\^$|#\\s]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/\\?/g, \".?\")}$`;\n\t\t\telse return { test: () => false };\n\t\t\ttry {\n\t\t\t\treturn new RegExp(searchTerm, caseSensitiveSearch ? \"\" : \"i\");\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"regex\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\ttry {\n\t\t\t\tconst flags = caseSensitiveSearch ? \"\" : \"i\";\n\t\t\t\treturn new RegExp(`^(${searchTerm})$`, flags);\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"type\",\n\t\tnormalize(selectedTypes) {\n\t\t\treturn { test: (type) => selectedTypes.includes(type) };\n\t\t},\n\t\ttest(type, normalizedSearchTerm) {\n\t\t\tif (typeof type === \"undefined\") return false;\n\t\t\treturn normalizedSearchTerm.test(type);\n\t\t}\n\t}\n].map((obj) => ({ [obj.id]: obj })));\n//#endregion\n//#region src/localTimezone.ts\n/**\n* Get the users local timezone.\n*\n* @returns current users timezone (browser based) tz db string (e. g. Europe/Berlin).\n*/\nvar localTimezone_default = () => Intl.DateTimeFormat().resolvedOptions().timeZone;\n//#endregion\n//#region src/format.ts\n/**\n* Converts the specified date String to human readable text containing the day, month, and year.\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018'\n*\n* @param dateString String representation of the Date to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date String\n*/\nvar formatDateString = (dateString, useTimeZone = false) => {\n\tconst date = new Date(dateString);\n\tif (isNaN(date)) throw Error(\"Invalid Date format\");\n\tconst baseDateOptions = {\n\t\tday: \"numeric\",\n\t\tmonth: \"short\",\n\t\tyear: \"numeric\"\n\t};\n\tconst dateOptions = useTimeZone ? {\n\t\t...baseDateOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseDateOptions;\n\treturn date.toLocaleDateString(\"en-US\", dateOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the hour (12-hour) and minute.\n* Example: '2018-07-31T09:44:31+00:00' => '9:44 AM'\n*\n* @param timeString String representation of the Date (including time) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable time String\n*/\nvar formatTimeString = (timeString, useTimeZone = false) => {\n\tconst time = new Date(timeString);\n\tif (isNaN(time)) throw Error(\"Invalid Date format\");\n\tconst baseTimeOptions = {\n\t\thour: \"numeric\",\n\t\tminute: \"2-digit\"\n\t};\n\tconst timeOptions = useTimeZone ? {\n\t\t...baseTimeOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseTimeOptions;\n\treturn time.toLocaleTimeString(\"en-US\", timeOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the date (day, month, year) and time (hour,\n* minute; 12-hour).\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018 9:44 AM'\n*\n* @param dateTimeString String representation of the Date (including time and date) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date/time String\n*/\nvar formatDateTimeString = (dateTimeString, useTimeZone = false) => {\n\treturn `${formatDateString(dateTimeString, useTimeZone)} ${formatTimeString(dateTimeString, useTimeZone)}`;\n};\n/**\n* Converts the specified date and time to the user time zone with option to display (day, month, year) only or with time (hour,\n* minute; 12-hour).\n*\n* @param showTime String representation of the Date to convert and format\n* @param String | number} date String representation of the Date to convert and format\n* @returns human readable date/time String converted to user time zone\n*/\nvar formatLocalDateTimeString = (date, showTime) => showTime ? formatDateTimeString(date, true) : formatDateString(date, true);\nvar formatFileSize = (bytes) => {\n\treturn prettyBytes(Number.isFinite(bytes) && bytes >= 0 ? bytes : 0);\n};\n//#endregion\n//#region src/getDeepActiveElement.ts\nvar getDeepActiveElement = () => {\n\tlet element = document?.activeElement;\n\twhile (element?.shadowRoot) element = element?.shadowRoot?.activeElement;\n\treturn element;\n};\n//#endregion\n//#region src/getWrappedAroundIndex.ts\n/**\n* Since (a % b) yields a negative outcome for negative a, we need this method in order\n* to correctly compute wrapped around indices in lists\n* @param {number} index an arbitrary integer\n* @param {number} length a positive integer\n* @returns {number} the non-negative modulo outcome\n*/\nvar getWrappedAroundIndex_default = (index, length) => (index % length + length) % length;\n//#endregion\n//#region src/intervalUtils.ts\nvar intervalUtils_exports = /* @__PURE__ */ __exportAll({\n\tformatIntervalToHumanReadableIntervalString: () => formatIntervalToHumanReadableIntervalString,\n\tformatIntervalToISOIntervalString: () => formatIntervalToISOIntervalString,\n\tisValidHumanReadableIntervalString: () => isValidHumanReadableIntervalString,\n\tisValidISOIntervalString: () => isValidISOIntervalString,\n\tisValidIntervalString: () => isValidIntervalString,\n\tisZero: () => isZero,\n\tparseGenericIntervalString: () => parseGenericIntervalString,\n\tparseHumanReadableIntervalString: () => parseHumanReadableIntervalString,\n\tparseISOIntervalString: () => parseISOIntervalString\n});\nvar extractPeriodFromRegexMatch = (negative, match) => {\n\treturn {\n\t\tnegative,\n\t\tyears: parseInt(match[1] ?? \"0\", 10),\n\t\tmonths: parseInt(match[2] ?? \"0\", 10),\n\t\tweeks: parseInt(match[3] ?? \"0\", 10),\n\t\tdays: parseInt(match[4] ?? \"0\", 10)\n\t};\n};\nvar extractDurationFromRegexMatch = (negative, match) => {\n\tconst milliseconds = parseInt(match[4]?.padEnd(3, \"0\") ?? \"0\", 10);\n\treturn {\n\t\tnegative,\n\t\thours: parseInt(match[1] ?? \"0\", 10),\n\t\tminutes: parseInt(match[2] ?? \"0\", 10),\n\t\tseconds: parseInt(match[3] ?? \"0\", 10),\n\t\tmilliseconds\n\t};\n};\nvar isZero = (interval) => {\n\tif (interval.type === \"DATE\") return interval.interval.years === 0 && interval.interval.months === 0 && interval.interval.weeks === 0 && interval.interval.days === 0;\n\telse return interval.interval.hours === 0 && interval.interval.minutes === 0 && interval.interval.seconds === 0 && interval.interval.milliseconds === 0;\n};\n/**\n* Take an interval object and convert it to an ISO duration or period string. All parts of the\n* relevant part of the Interval object are included in the output, even if they are zero.\n*\n* Technically the ISO standard allows to mix period and duration parts, but we don't support that\n* here because it's incredibly hard to deal with all the edge cases. Maybe in a future ticket.\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output.\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToISOIntervalString = (toFormat) => {\n\tlet output = \"P\";\n\tif (toFormat.type === \"DATE\") output += `${toFormat.interval.years}Y${toFormat.interval.months}M${toFormat.interval.weeks}W${toFormat.interval.days}D`;\n\telse output += `T${toFormat.interval.hours}H${toFormat.interval.minutes}M${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")}S`;\n\tif (toFormat.interval.negative) output = `-${output}`;\n\treturn output;\n};\n/**\n* Take an interval object and convert it to a human readable string. Only non-zero parts are\n* included in the output (unless all parts are 0).\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output and we wrap the whole thing in brackets e.g. -(1 year 2 days).\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToHumanReadableIntervalString = (toFormat) => {\n\tconst formatPart = (value, unit) => {\n\t\tif (value === 0) return \"\";\n\t\telse if (value === 1) return `${value} ${unit} `;\n\t\telse return `${value} ${unit}s `;\n\t};\n\tlet output = \"\";\n\tif (toFormat.type === \"DATE\") {\n\t\tif (isZero(toFormat)) return \"0 days\";\n\t\toutput += formatPart(toFormat.interval.years, \"year\");\n\t\toutput += formatPart(toFormat.interval.months, \"month\");\n\t\toutput += formatPart(toFormat.interval.weeks, \"week\");\n\t\toutput += formatPart(toFormat.interval.days, \"day\");\n\t} else {\n\t\tif (isZero(toFormat)) return \"0 seconds\";\n\t\toutput += formatPart(toFormat.interval.hours, \"hour\");\n\t\toutput += formatPart(toFormat.interval.minutes, \"minute\");\n\t\tconst milliSecondsZero = toFormat.interval.milliseconds === 0;\n\t\tif (toFormat.interval.seconds !== 0 || !milliSecondsZero) if (milliSecondsZero) output += formatPart(toFormat.interval.seconds, \"second\");\n\t\telse output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")} seconds `;\n\t}\n\tif (toFormat.interval.negative) output = `-(${output.trim()})`;\n\treturn output.trim();\n};\nvar yearsPart = \"(\\\\d+)\\\\s*y(?:ears?)?\";\nvar monthsPart = \"(\\\\d+)\\\\s*m(?:o(?:nths?)?)?\";\nvar weeksPart = \"(\\\\d+)\\\\s*w(?:eeks?)?\";\nvar daysPart = \"(\\\\d+)\\\\s*d(?:ays?)?\";\nvar hoursPart = \"(\\\\d+)\\\\s*h(?:ours?)?\";\nvar minutesPart = \"(\\\\d+)\\\\s*m(?:in(?:s|utes?)?)?\";\nvar secondsPart = \"(\\\\d+)(?:[,.](\\\\d{1,3}))?\\\\s*s(?:ec(?:s|onds?)?)?\";\n/**\n* Matches a human readable period string, e.g. \"1y 2mo 3weeks 4day\" (each part is optional)\n*/\nvar humanReadablePeriodRegex = new RegExp(`^(?:${yearsPart})?\\\\s*(?:${monthsPart})?\\\\s*(?:${weeksPart})?\\\\s*(?:${daysPart})?\\\\s*$`, \"i\");\n/**\n* Matches a human readable duration string, e.g. \"1h 2m 3.456s\" (each part is optional)\n*/\nvar humanReadableDurationRegex = new RegExp(`^(?:${hoursPart})?\\\\s*(?:${minutesPart})?\\\\s*(?:${secondsPart})?$`, \"i\");\n/**\n* Matches a negative human readable period string, e.g. \"-(1y 2mo 3weeks 4day)\" (each part is optional)\n*/\nvar negativeHumanReadablePeriodRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadablePeriodRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable period string with one field like \"-1y\" or \"-1w\"\n*/\nvar negativeHumanReadablePeriodRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${yearsPart}|${monthsPart}|${weeksPart}|${daysPart})\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string, e.g. \"-(1h 2m 3.456s)\" (each part is optional)\n*/\nvar negativeHumanReadableDurationRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadableDurationRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string with one field like \"-1h\" or \"-1.5s\"\n*/\nvar negativeHumanReadableDurationRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${hoursPart}|${minutesPart}|${secondsPart})\\\\s*$`, \"i\");\n/**\n* Try to parse a human readable interval string into an Interval object. Any parts not specified\n* are assumed to be zero. Note that the string must be either a period or a duration, not a mix of\n* both. So for example, \"1y 2mo 3weeks 4day\" is fine, as is \"1h 2m 3.456s\". However, \"1y 2mo 1sec\"\n* is not, since it's a mix of both.\n*\n* Negative intervals are allowed, although if multiple fields are provided the string must include\n* brackets, so \"-(1y 2mo)\" is also valid, as is \"-5 seconds\".\n*\n* The string is required to have at least some content, any string that is blank will throw an error.\n*\n* @param intervalString The human readable time string\n*/\nvar parseHumanReadableIntervalString = (intervalString) => {\n\tintervalString = intervalString?.trim();\n\tif (!intervalString) throw new Error(\"Empty interval string\");\n\tconst matchPositivePeriod = humanReadablePeriodRegex.exec(intervalString);\n\tconst matchNegativePeriod = negativeHumanReadablePeriodRegex.exec(intervalString) ?? negativeHumanReadablePeriodRegexWithSingleField.exec(intervalString);\n\tconst matchPositiveDuration = humanReadableDurationRegex.exec(intervalString);\n\tconst matchNegativeDuration = negativeHumanReadableDurationRegex.exec(intervalString) ?? negativeHumanReadableDurationRegexWithSingleField.exec(intervalString);\n\tconst matchPeriod = matchPositivePeriod ?? matchNegativePeriod;\n\tconst matchDuration = matchPositiveDuration ?? matchNegativeDuration;\n\tconst negative = (matchNegativePeriod ?? matchNegativeDuration) !== null;\n\tif (matchDuration && matchPeriod) throw new Error(\"Ambiguous time format\");\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(negative, matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(negative, matchDuration)\n\t};\n\telse throw new Error(`Invalid human readable time: ${intervalString}`);\n};\n/**\n* Check if the given string can be understood as a human readable duration or period string. The\n* type parameter specifies whether the string should be a date, time, or either.\n*\n* @param time the string to check\n* @param expectedType the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidHumanReadableIntervalString = (time, expectedType) => {\n\ttry {\n\t\tconst validationResult = parseHumanReadableIntervalString(time);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === expectedType || expectedType === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Convert an ISO duration OR period string to an Interval object. So for example,\n* \"P1Y2M3W4D\" is fine, as is \"PT1H2M3.456S\". However, \"P1Y2M3W4D1H2M3.456S\" is not, since\n* it's a mix of both. We're more forgiving than the ISO standard, so we allow for missing parts.\n* Also, the string is allowed to be negative, so \"-P1Y2M3W4D\" is also valid.\n*\n* The string is required to have at least some content, so the strings \"\", \"P\", and \"PT\" are\n* considered invalid (also if they start with a -).\n*\n* @param isoString The ISO duration or period string.\n*/\nvar parseISOIntervalString = (isoString) => {\n\tisoString = isoString?.trim();\n\tif ([\n\t\t\"\",\n\t\t\"P\",\n\t\t\"PT\",\n\t\t\"-\",\n\t\t\"-P\",\n\t\t\"-PT\"\n\t].includes(isoString)) throw new Error(\"Empty ISO duration\");\n\tconst periodRegex = /^-?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?$/;\n\tconst durationRegex = /^-?PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:[,.](\\d{1,3}))?S)?$/;\n\tconst matchPeriod = periodRegex.exec(isoString);\n\tconst matchDuration = durationRegex.exec(isoString);\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(isoString.startsWith(\"-\"), matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(isoString.startsWith(\"-\"), matchDuration)\n\t};\n\telse throw new Error(`Invalid ISO duration: ${isoString}`);\n};\n/**\n* Check if the given string is a valid duration or period ISO string. The type parameter\n* specifies whether the string should be a date, time, or either.\n*\n* @param isoString the string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidISOIntervalString = (isoString, type) => {\n\ttry {\n\t\tconst validationResult = parseISOIntervalString(isoString);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === type || type === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Try to convert an interval string to an Interval object. The string can be either an ISO\n* duration/period string or a human readable string. If the string is not valid, an error is\n* thrown.\n*\n* @param time the time string, either ISO or human readable\n*/\nvar parseGenericIntervalString = (time) => {\n\tconst validISO = isValidISOIntervalString(time, \"DATE_OR_TIME\");\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, \"DATE_OR_TIME\");\n\tif (validISO.valid) return parseISOIntervalString(time);\n\telse if (validHumanReadable.valid) return parseHumanReadableIntervalString(time);\n\telse throw new Error(`Invalid interval string: ${time}`);\n};\n/**\n* Check if the given string is a valid interval string, either human readable or ISO. The type parameter\n* specifies whether the string should be a period, duration, or either.\n*\n* @param time the time string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidIntervalString = (time, type) => {\n\tconst validISO = isValidISOIntervalString(time, type);\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, type);\n\tif (validISO.valid) return validISO;\n\telse if (validHumanReadable.valid) return validHumanReadable;\n\telse return { valid: false };\n};\n//#endregion\n//#region src/numIntegerDigits.ts\n/**\n* Count the number of integer digits for a given number.\n*\n* @param input number.\n* @returns number of integer digits x has. 1234 = 4 but 1234.44 is also 4.\n*/\nvar numIntegerDigits_default = (input) => Math.max(Math.floor(Math.log10(Math.abs(input))), 0) + 1;\n//#endregion\n//#region src/promise/createAbortablePromise.ts\nvar AbortError = class extends Error {};\n/**\n* Helper to create an abortable promise. Returns an AbortController and a Function\n* that you can pass your async handler to. Whenever the AbortController signal is\n* aborted then the async handler's promise will reject with an AbortError\n*\n* Example:\n* ```\n* import { abortUtils } from \"@knime/utils\"\n* const myFetchCall = async (params...) => {...};\n*\n* try {\n* const { runAbortablePromise, abortController } = createAbortablePromise(() =>\n* myFetchCall(params...),\n* );\n* } catch (e) {\n* if (e instanceof abortUtils.AbortError) {\n* console.info('ignore due to abort');\n* return;\n* }\n* }\n*\n* // somewhere else (while request is in-flight)\n* abortController.abort(new abortUtils.AbortError('reason here'))\n* ```\n*/\nvar createAbortablePromise = () => {\n\tconst abortController = new AbortController();\n\tconst runAbortablePromise = (request) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst abortListener = ({ target }) => {\n\t\t\t\tabortController.signal.removeEventListener(\"abort\", abortListener);\n\t\t\t\tconst reason = target.reason;\n\t\t\t\treject(reason instanceof AbortError ? reason : new AbortError(reason));\n\t\t\t};\n\t\t\trequest().then(resolve).catch((error) => {\n\t\t\t\tif (error instanceof AbortError) return;\n\t\t\t\treject(error);\n\t\t\t});\n\t\t\tabortController.signal.addEventListener(\"abort\", abortListener);\n\t\t});\n\t};\n\treturn {\n\t\tabortController,\n\t\trunAbortablePromise\n\t};\n};\n//#endregion\n//#region src/promise/createUnwrappedPromise.ts\nvar createUnwrappedPromise = () => {\n\tlet resolve = () => {};\n\tlet reject = () => {};\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\treturn {\n\t\tresolve,\n\t\treject,\n\t\tpromise\n\t};\n};\n//#endregion\n//#region src/sleep.ts\n/**\n* Returns promise that resolves after ms.\n*/\nfunction sleep(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n/**\n* Helper to add retry capability to an async function\n* @param fn async function\n* @param retryCount max number of retries. defaults to 5\n* @param retryDelayMS delay in-between retries in millisecs. defaults to 0\n* @param excludeError predicate fn to exclude specific errors from causing a retry\n*/\nasync function retryPromise({ fn, retryCount = 5, retryDelayMS = 0, excludeError }) {\n\ttry {\n\t\treturn await fn();\n\t} catch (error) {\n\t\tif (excludeError?.(error)) throw error;\n\t\tif (retryCount > 0) {\n\t\t\tawait sleep(retryDelayMS);\n\t\t\treturn await retryPromise({\n\t\t\t\tfn,\n\t\t\t\tretryCount: retryCount - 1,\n\t\t\t\tretryDelayMS,\n\t\t\t\texcludeError\n\t\t\t});\n\t\t}\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/promise/index.ts\nvar promise_exports = /* @__PURE__ */ __exportAll({\n\tAbortError: () => AbortError,\n\tDEFAULT_RETRY_COUNT: () => 5,\n\tDEFAULT_RETRY_DELAY_MS: () => 0,\n\tcreateAbortablePromise: () => createAbortablePromise,\n\tcreateUnwrappedPromise: () => createUnwrappedPromise,\n\tretryPromise: () => retryPromise\n});\n//#endregion\n//#region src/sanitization.ts\nvar ALLOWED_TAGS = [\n\t\"p\",\n\t\"div\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"ul\",\n\t\"ol\",\n\t\"li\",\n\t\"blockquote\",\n\t\"b\",\n\t\"i\",\n\t\"s\",\n\t\"u\",\n\t\"sup\",\n\t\"sub\",\n\t\"ins\",\n\t\"del\",\n\t\"strong\",\n\t\"strike\",\n\t\"tt\",\n\t\"code\",\n\t\"big\",\n\t\"small\",\n\t\"br\",\n\t\"span\",\n\t\"em\"\n];\n/**\n* Sanitizes Raw HTML and only allow specific tags to be used, as per OWASP standards.\n* @param rawHTML\n* @param options.allowStyleAttribute - Allow the style attribute on elements\n* @param options.allowHyperlinks - Allow anchor tags with href attribute\n* @returns sanitized html\n*/\nvar sanitizeHTML = (rawHTML, options = {\n\tallowStyleAttribute: false,\n\tallowHyperlinks: false\n}) => {\n\tconst { allowStyleAttribute, allowHyperlinks } = options;\n\tconst ALLOWED_ATTR = [...allowStyleAttribute ? [\"style\"] : [], ...allowHyperlinks ? [\"href\"] : []];\n\tconst allowedTags = allowHyperlinks ? [...ALLOWED_TAGS, \"a\"] : ALLOWED_TAGS;\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: allowedTags,\n\t\tALLOWED_ATTR\n\t});\n};\n/**\n* Removes any HTML tag from the input string. Keeps HTML entities\n* (e.g because these can be considered plain text)\n* @param rawHTML\n* @returns plain text\n*/\nvar stripHTML = (rawHTML) => {\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: [],\n\t\tALLOWED_ATTR: []\n\t});\n};\nvar sanitization = {\n\tsanitizeHTML,\n\tstripHTML\n};\n//#endregion\n//#region src/truncateString.ts\nvar defaultMaxLength = 160;\nvar truncateString_default = (string = \"\", maxLength = defaultMaxLength) => {\n\tconst dots = string.length > maxLength ? \"…\" : \"\";\n\treturn `${string.substring(0, maxLength - 1)}${dots}`;\n};\n//#endregion\n//#region src/fileExtensions.ts\n/**\n* Gets the file extension\n* @param nameOrPath can take a full file name (e.g \"file.txt\") or a path to a file\n* (e.g \"file://path/to/file.txt\" OR \"/path/to/file.txt\")\n* @returns just the file extension (e.g \"txt\")\n*/\nvar getFileExtension = (nameOrPath) => {\n\tconst basename = nameOrPath.split(/[\\\\/]/).pop() ?? \"\";\n\tconst parts = basename.split(\".\");\n\tif (basename === \"\" || parts.length === 1) return \"\";\n\treturn parts.at(-1) ?? \"\";\n};\n/**\n* Metadata for .knar files, which corresponds to exported KNIME Workflow Groups\n* or Components\n*/\nvar KNAR = Object.freeze({\n\textension: \"knar\",\n\tmimeType: \"application/vnd.knime.workflow-group+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t}\n});\n/**\n* Metadata for .knwf files, which corresponds to exported KNIME Workflows\n*/\nvar KNWF = Object.freeze({\n\textension: \"knwf\",\n\tmimeType: \"application/vnd.knime.workflow+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t},\n\t/**\n\t* Gets the name of a .knwf file without the extension. If the file is not\n\t* matched as a .knwf file then this function will return the default value,\n\t* which is empty string (\"\") if param is not provided\n\t*/\n\tgetNameOrDefault(file, defaultValue = \"\") {\n\t\tif (!this.matches(file)) return defaultValue;\n\t\treturn file.name.replace(`.${this.extension}`, \"\");\n\t}\n});\nvar knimeFileFormats = {\n\tKNAR,\n\tKNWF\n};\n/**\n* Gets the mime type from a given file. Defaults to `application/octet-stream`\n* if mimeType cannot be detected\n* @param file File\n* @returns mimeType\n*/\nvar getFileMimeType = (file) => {\n\tconst DEFAULT_MIMETYPE = \"application/octet-stream\";\n\tif (!getFileExtension(file.name)) return DEFAULT_MIMETYPE;\n\tif (KNWF.matches(file)) return KNWF.mimeType;\n\tif (KNAR.matches(file)) return KNAR.mimeType;\n\tif (!file.type) return DEFAULT_MIMETYPE;\n\treturn file.type;\n};\n//#endregion\n//#region src/hotkeys/enums.ts\n/**\n* Platforms that influence how modifier keys are rendered. macOS substitutes\n* dedicated glyphs (`⌘`, `⌥`, `⇧`, …), every other platform uses the textual\n* rendering (`Ctrl`, `Alt`, `Shift`, …).\n*/\nvar hotkeyPlatform = {\n\tMAC_OS: \"macOS\",\n\tOTHER: \"other\"\n};\nObject.values(hotkeyPlatform);\n//#endregion\n//#region src/platform/navigator.ts\nvar navigator_exports = /* @__PURE__ */ __exportAll({\n\tisMac: () => isMac,\n\tisWindows: () => isWindows\n});\n/**\n*\n* @returns true if the platform of the user is Mac\n*/\nvar isMac = () => navigator?.userAgent?.toLowerCase()?.includes(\"mac\");\n/**\n*\n* @returns true if the platform of the user is Windows\n*/\nvar isWindows = () => navigator?.userAgent?.toLowerCase()?.includes(\"windows\");\n//#endregion\n//#region src/hotkeys/format.ts\nvar globalKeyMap = {\n\tArrowUp: \"↑\",\n\tArrowDown: \"↓\",\n\tArrowLeft: \"←\",\n\tArrowRight: \"→\",\n\tEnter: \"↵\",\n\t\" \": \"Space\",\n\tCtrlOrCmd: \"Ctrl\"\n};\nvar MacOSkeyMap = {\n\tShift: \"⇧\",\n\tDelete: \"⌫\",\n\tCtrlOrCmd: \"⌘\",\n\tCtrl: \"⌃\",\n\tAlt: \"⌥\",\n\tEnter: \"↩\"\n};\n/**\n* Returns a string representation of a single hotkey. Replaces some special key names with symbols.\n*\n* By default the platform is auto-detected from the user agent via `isMac()`.\n* Pass `platform` to force a specific platform's glyphs — useful for SSR,\n* tests, or rendering multiple platforms on the same page.\n*/\nvar formatHotkey = (hotkey, platform) => {\n\t/**\n\t* Returns the symbol corresponding to the `key` based on the given\n\t* `formatMap`. Otherwise, if not found, returns the same `key` value given\n\t*/\n\tconst mapSymbols = (formatMap) => (key) => formatMap[key] ?? key;\n\t/**\n\t* Pipe function implementation. Receives a list of functions to execute in order\n\t* and will pipe the parameter passed at the end to each function returning the final output\n\t*/\n\tconst pipe = (...fns) => fns.reduce((f, g) => (arg) => g(f(arg)), (arg) => arg);\n\tconst macKeyFormatter = pipe(mapSymbols(MacOSkeyMap), mapSymbols(globalKeyMap));\n\tconst generalKeyFormatter = mapSymbols(globalKeyMap);\n\treturn (platform === void 0 ? isMac() : platform === hotkeyPlatform.MAC_OS) ? macKeyFormatter(hotkey) : generalKeyFormatter(hotkey);\n};\nvar getDefaultSeparator = () => isMac() ? \" \" : \"+\";\n/**\n* Returns a string representation of a list of hotkeys. Replaces some special key names with symbols\n*/\nvar formatHotkeys = (hotkeys, getSeparator = getDefaultSeparator) => hotkeys.map((hotkey) => formatHotkey(hotkey)).join(getSeparator());\n/**\n* Appends a formatted hotkey shortcut to the given string. Useful for tooltips\n*/\nvar textWithHotkeys = (text, hotkeys) => {\n\treturn `${text} – ${formatHotkeys(hotkeys)}`;\n};\n//#endregion\n//#region src/hotkeys/match.ts\n/**\n* Checks whether a pressed `Digit` key falls within a numeric hotkey range such\n* as `1-9`.\n* @param keyCode - The `KeyboardEvent.code` to check (e.g. `Digit5`).\n* @param hotkey - The hotkey token, expected to be a single-digit range like `1-9`.\n* @returns True if the pressed digit lies within the inclusive range.\n*/\nvar isDigitKeyInRange = (keyCode, hotkey) => {\n\tif (hotkey.length !== 3 || !keyCode?.startsWith(\"Digit\")) return false;\n\tconst keyNumber = Number(keyCode.slice(5));\n\tconst [lower, upper] = hotkey.split(\"-\");\n\treturn Boolean(lower) && Boolean(upper) && Number.parseInt(lower, 10) <= keyNumber && keyNumber <= Number.parseInt(upper, 10);\n};\n/**\n* Checks whether a keyboard event matches a hotkey definition. The last token is\n* treated as the character; any preceding tokens are modifiers. The special\n* `CtrlOrCmd` modifier resolves to the platform's primary modifier (Meta/`⌘` on\n* macOS, Ctrl elsewhere).\n* @param event - The keyboard event to check.\n* @param hotkeys - The ordered hotkey tokens (modifiers followed by the character).\n* @returns True if the event matches the given hotkey, otherwise false.\n*/\nvar match = (event, hotkeys) => {\n\tconst { key, code, metaKey, ctrlKey, shiftKey, altKey } = event;\n\tconst modifiers = hotkeys.slice();\n\tconst character = modifiers.pop() ?? \"\";\n\tconst ctrlOrMeta = isMac() ? \"Meta\" : \"Ctrl\";\n\tconst platformModifiers = new Set(modifiers.map((modifier) => modifier === \"CtrlOrCmd\" ? ctrlOrMeta : modifier));\n\tconst metaMatches = Boolean(metaKey) === platformModifiers.has(\"Meta\");\n\tconst ctrlMatches = Boolean(ctrlKey) === platformModifiers.has(\"Ctrl\");\n\tconst shiftMatches = Boolean(shiftKey) === platformModifiers.has(\"Shift\");\n\tconst altMatches = Boolean(altKey) === platformModifiers.has(\"Alt\");\n\tconst keysMatch = key.toUpperCase() === character.toUpperCase() || character.includes(\"-\") && isDigitKeyInRange(code, character) || isMac() && character === \"Delete\" && key === \"Backspace\";\n\treturn metaMatches && ctrlMatches && shiftMatches && altMatches && keysMatch;\n};\n//#endregion\n//#region src/hotkeys/modifiers.ts\n/**\n* Checks if any modifier key (Ctrl, Meta, Alt, or Shift) is pressed.\n* @param event - The keyboard event to check.\n* @returns True if a modifier key is pressed, otherwise false.\n*/\nvar isModifierKeyPressed = (event) => {\n\treturn event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n};\n/**\n* Checks if a specific key (or keys) were pressed without any modifier keys.\n* @param event - The keyboard event to check.\n* @param keys - The key or keys to check for.\n* @returns True if the specified key(s) were pressed without modifiers, otherwise false.\n*/\nvar isKeyWithoutModifiers = (event, keys) => {\n\treturn (Array.isArray(keys) ? keys : [keys]).includes(event.key) && !isModifierKeyPressed(event);\n};\n/**\n* Returns the name of the primary modifier key for the current platform.\n*/\nvar getMetaOrCtrlKey = () => {\n\treturn isMac() ? \"metaKey\" : \"ctrlKey\";\n};\n//#endregion\n//#region src/hotkeys/index.ts\n/**\n* Grouped keyboard-shortcut helpers, exposed as a single namespace for\n* ergonomic access (e.g. `hotkeys.formatHotkey`).\n*/\nvar hotkeys = {\n\tformatHotkeys,\n\tformatHotkey,\n\tgetDefaultSeparator,\n\thotkeyPlatform,\n\ttextWithHotkeys,\n\tmatch\n};\n//#endregion\nexport { capitalize, caseFormatter, debounce, filters, formatDateString, formatDateTimeString, formatFileSize, formatLocalDateTimeString, formatTimeString, getDeepActiveElement, getFileExtension, getFileMimeType, localTimezone_default as getLocalTimeZone, getMetaOrCtrlKey, getWrappedAroundIndex_default as getWrappedAroundIndex, hotkeys, intervalUtils_exports as intervalUtils, isAfterMaxDate, isBeforeMinDate, isKeyWithoutModifiers, isModifierKeyPressed, knimeFileFormats, match, navigator_exports as navigatorUtils, numIntegerDigits_default as numIntegerDigits, promise_exports as promise, sanitization, sleep, truncateString_default as truncateString, updateDate_default as updateDate, updateTime_default as updateTime };\n\n//# sourceMappingURL=index.js.map","import { type InjectionKey, type Ref, computed, inject, provide } from \"vue\";\n\nimport type { TableState } from \"../../types/TableConfig\";\n\n/**\n * Exported for testing purposes\n */\nexport const injectionKey: InjectionKey<{\n isShown: Ref<boolean>;\n close: () => void;\n}> = Symbol(\"dataValueViewsIsShown\");\n\nexport const useDataValueViews = () => inject(injectionKey)!;\n\nexport const provideDataValueViewsIsShown = (\n tableState: Ref<TableState>,\n closeDataValueView: () => void,\n) =>\n provide(injectionKey, {\n isShown: computed(() => Boolean(tableState.value.dataValueViewIsShown)),\n close: closeDataValueView,\n });\n","import { getMetaOrCtrlKey } from \"@knime/utils\";\n\nconst isNavigationKey = (event: KeyboardEvent) =>\n event.key.includes(\"Arrow\") || event.key === \"Tab\" || event.key === \"Escape\";\n\n/**\n * Creates a keydown handler that detects editing-trigger keys and calls the\n * appropriate callback:\n * - Enter (without Shift) / Space → `onExpandAndStartEditing`\n * - Backspace / printable characters (key.length === 1, no Ctrl/Cmd, no Alt)\n * → `onStartEditing`\n *\n * Navigation keys (Arrow, Tab, Escape) and modifier combos (Ctrl/Cmd, Alt)\n * are ignored and left for other handlers.\n */\nexport const useStartEditingKeydown = ({\n onExpandAndStartEditing,\n onStartEditing,\n}: {\n onExpandAndStartEditing: (initialValue?: string) => void;\n onStartEditing: (initialValue?: string) => void;\n}) => {\n const onKeydown = (event: KeyboardEvent) => {\n if (isNavigationKey(event) || event[getMetaOrCtrlKey()]) {\n return;\n }\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n onExpandAndStartEditing();\n } else if (event.key === \" \") {\n event.preventDefault();\n onExpandAndStartEditing(\" \");\n } else if (event.key === \"Backspace\") {\n onStartEditing(\"\");\n } else if (!event.altKey && event.key.length === 1) {\n event.preventDefault();\n onStartEditing(event.key);\n }\n };\n\n return { onKeydown };\n};\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","import {\n type CSSProperties,\n type InjectionKey,\n type MaybeRef,\n type Ref,\n computed,\n inject,\n provide,\n} from \"vue\";\n\nimport type { IndexStartEnd } from \"@knime/vue-headless-virtual-scroller\";\n\nexport interface Payload {\n horizontal: Ref<IndexStartEnd>;\n horizontalStyles: CSSProperties;\n}\n\nconst injectionKey: InjectionKey<Payload> = Symbol(\n \"useHorizontalIndicesAndStyles.ts\",\n);\n\nexport const provideForHorizontalVirtualScrolling = (payload: Payload) =>\n provide(injectionKey, payload);\n\n/**\n * The horizontal column indices to render plus the style positioning the\n * horizontally virtualized window. While horizontal virtual scrolling is\n * provided the indices are the currently visible column range; otherwise\n * `fallbackIndices` (e.g. all columns) is used.\n */\nconst useHorizontalIndices = (\n fallbackIndices: () => number[],\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const providedForVirtualScrolling = inject(injectionKey, null);\n if (providedForVirtualScrolling) {\n return {\n indices: computed(() =>\n providedForVirtualScrolling.horizontal.value.toArray(),\n ),\n style: providedForVirtualScrolling.horizontalStyles,\n };\n }\n return {\n indices: computed(fallbackIndices),\n style: {},\n };\n};\n\nexport const useIndicesAndStylesFor = <T>(\n data: Ref<T[]>,\n): {\n indexedData: Ref<[T, number][]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const { indices, style } = useHorizontalIndices(() =>\n data.value.map((_, index) => index),\n );\n return {\n indexedData: computed(() =>\n indices.value.map((index) => [data.value[index], index]),\n ),\n style,\n };\n};\n\n/**\n * Like {@link useIndicesAndStylesFor} but for consumers that only need the\n * column indices (not per-column data), e.g. {@link EmptyRow} whose skeleton\n * cells read their width from the `--col-size-<index>` CSS variable rather than\n * from a render-time read of the numeric column sizes. The fallback renders all\n * `numColumns` columns when horizontal virtual scrolling is not provided.\n */\nexport const useColumnIndicesFor = (\n numColumns: Ref<number>,\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} =>\n useHorizontalIndices(() =>\n Array.from({ length: numColumns.value }, (_, index) => index),\n );\n","import {\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\nexport const getColSizeCSSVar = (index: number) => `--col-size-${index}`;\n\ninterface ColumnSizesContext {\n /**\n * The live numeric column sizes, updated per drag frame during a column\n * resize. Only consume them where this update frequency is wanted (e.g.\n * imperative CSS variable writes), not at render time above the cell tree.\n */\n colSizes: Ref<number[]>;\n /**\n * The column sizes captured at drag start while a column resize is active,\n * identical to the live sizes otherwise. Consumers whose render output must\n * not update per drag frame (e.g. Row's slotted cell width,\n * TableCoreVirtual's column window) read these instead of freezing the live\n * sizes themselves.\n */\n colSizesFrozenWhenResizing: Ref<number[]>;\n /**\n * Whether a column resize drag is currently active. Set by TableUI (the\n * owner of the column resize events); drives the freezing above.\n */\n columnResizeActive: Ref<boolean>;\n}\n\nexport const columnSizesInjectionKey: InjectionKey<ColumnSizesContext> =\n Symbol(\"columnSizes\");\n\n/**\n * Non-reactive override for the injected column sizes. While its `value` is a\n * sizes array, {@link injectColumnSizes} returns those sizes instead of the\n * live ones. Used by the hidden auto-size calculation table so it can render at\n * its own (e.g. maximum) widths without affecting the visible table. It does\n * not need to be reactive: each consumer reads the sizes once when it is set\n * up, and the calculation table is (re)mounted for every calculation, so the\n * override only needs to be set before it mounts and reset to `null` after.\n */\ninterface AutoSizeColumnSizes {\n value: number[] | null;\n}\n\nconst autoSizeColumnSizesInjectionKey: InjectionKey<AutoSizeColumnSizes> =\n Symbol(\"autoSizeColumnSizes\");\n\n/**\n * Provides the {@link AutoSizeColumnSizes} override to descendants and returns\n * methods to set/unset it around an auto-size calculation. Has to be called\n * above the components whose injected sizes should be overridden (i.e. the\n * auto-size calculation table).\n */\nexport const provideAutoSizeColumnSizes = () => {\n const holder: AutoSizeColumnSizes = { value: null };\n provide(autoSizeColumnSizesInjectionKey, holder);\n return {\n setAutoSizeColumnSizes: (sizes: number[]) => {\n holder.value = sizes;\n },\n unsetAutoSizeColumnSizes: () => {\n holder.value = null;\n },\n };\n};\n\n/**\n * Owns the column-size handling for the table. Using a provide/inject pattern to share\n * live sizes with descendants instead of a property, we avoid memory issues arising\n * on column resizing.\n * When switching to @vue/vapor virtualizer, we can remove this again.\n */\nexport const useColumnSizes = (\n colSizes: Ref<number[]>,\n /**\n * An element reference that is either the root of the table or a parent.\n * This element will be used to define the global css variables controlling\n * column widths.\n */\n element: Ref<HTMLElement | null>,\n) => {\n let previousColumnCount = 0;\n watch(\n [colSizes, element],\n ([sizes]) => {\n const el = element.value;\n if (!el) {\n return;\n }\n sizes.forEach((size, index) => {\n el.style.setProperty(getColSizeCSSVar(index), `${size}px`);\n });\n // Remove the CSS variables of columns that no longer exist so they do not\n // linger on the element after the column count shrinks.\n for (let index = sizes.length; index < previousColumnCount; index++) {\n el.style.removeProperty(getColSizeCSSVar(index));\n }\n previousColumnCount = sizes.length;\n },\n { immediate: true },\n );\n\n const columnResizeActive = ref(false);\n const colSizesOnStartColResize = ref<number[] | null>(null);\n watch(columnResizeActive, (active) => {\n colSizesOnStartColResize.value = active ? [...colSizes.value] : null;\n });\n const colSizesFrozenWhenResizing = computed(\n () => colSizesOnStartColResize.value ?? colSizes.value,\n );\n\n const context: ColumnSizesContext = {\n colSizes,\n colSizesFrozenWhenResizing,\n columnResizeActive,\n };\n provide(columnSizesInjectionKey, context);\n return context;\n};\n\nexport const injectColumnSizes = (): ColumnSizesContext => {\n const context = inject(columnSizesInjectionKey);\n if (!context) {\n throw new Error(\n \"No column-size context found. Components from @knime/kds-table must be \" +\n \"rendered below a useColumnSizes provider (see useColumnSizes). Without \" +\n \"it the column-width CSS variables are never set and columns collapse.\",\n );\n }\n // If an auto-size calculation is in progress, transparently override the\n // injected sizes with the ones it wants to render at.\n const autoSizeColumnSizes = inject(autoSizeColumnSizesInjectionKey, null);\n if (autoSizeColumnSizes && autoSizeColumnSizes.value !== null) {\n const sizes = ref(autoSizeColumnSizes.value);\n return {\n ...context,\n colSizes: sizes,\n colSizesFrozenWhenResizing: sizes,\n };\n }\n return context;\n};\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","import {\n type InjectionKey,\n type Ref,\n inject,\n provide,\n ref,\n watchEffect,\n} from \"vue\";\n\n/**\n * CSS variable holding the current table body width (in px). It is written\n * imperatively to the scroll container by {@link useBodyWidth} so that style\n * consumers (the sticky header, the resize scroll spacer) can read the body\n * width via `var(...)` instead of via a render-time read of the live\n * column-size array.\n */\nexport const BODY_WIDTH_CSS_VAR = \"--current-body-width\";\n\nconst bodyWidthInjectionKey: InjectionKey<Ref<number>> = Symbol(\"bodyWidth\");\n\n/**\n * Owns the table body width. Given the live numeric body width and the scroll\n * container element, it\n * - writes the width to {@link BODY_WIDTH_CSS_VAR} on the element (the single\n * source the sticky header and the resize scroll spacer read their width\n * from), and\n * - provides the live numeric body width for the few descendants that genuinely\n * need a number in JS but must not read it every frame (they inject via\n * {@link injectBodyWidth}).\n */\nexport const useBodyWidth = (\n bodyWidth: Ref<number>,\n element: Ref<HTMLElement | null>,\n) => {\n watchEffect(() => {\n element.value?.style.setProperty(\n BODY_WIDTH_CSS_VAR,\n `${bodyWidth.value}px`,\n );\n });\n\n provide(bodyWidthInjectionKey, bodyWidth);\n};\n\nexport const injectBodyWidth = () => inject(bodyWidthInjectionKey, ref(0));\n","import { type InjectionKey, inject, provide, ref } from \"vue\";\n\nconst setup = () => {\n const currentCallback = ref<(() => void) | null>(null);\n\n const registerExpandedSubMenu = (callback: () => void) => {\n // Timeout to prevent the sub menu to be closed due to scroll event triggered by clicking a row/group\n setTimeout(() => {\n currentCallback.value = () => {\n callback();\n currentCallback.value = null;\n };\n }, 100);\n };\n return {\n closeExpandedSubMenu: () => currentCallback.value?.(),\n registerExpandedSubMenu,\n };\n};\n\ntype Provided = ReturnType<typeof setup>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useCloseSubMenusOnScroll.ts\",\n);\n\nexport const provideForCloseSubMenusOnScroll = () =>\n provide(injectionKey, setup());\n\nexport const injectCloseExpandedSubMenu = () =>\n inject(injectionKey)!.closeExpandedSubMenu;\nexport const injectRegisterExpandedSubMenu = () =>\n inject(injectionKey)!.registerExpandedSubMenu;\n","import {\n type CSSProperties,\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\ntype Provided = Ref<CSSProperties>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useOverflowStyles.ts\",\n);\n\nconst elIsPresent = (el: HTMLElement | null): el is HTMLElement => Boolean(el);\n\nexport const provideOverflowStyles = ({\n columnResizeActive,\n fitsWithoutHorizontalScrollbar,\n scrolledElement,\n}: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n scrolledElement: Ref<HTMLElement | null>;\n}) => {\n // Captured at the moment column resize starts: was a vertical scrollbar\n // visible at that instant? If yes, we keep it as `overflow-y: scroll` during\n // the resize so that toggling the horizontal scrollbar cannot make the\n // vertical scrollbar appear/disappear (which would cause flickering).\n const verticalScrollbarVisibleAtResizeStart = ref(false);\n // flush: 'sync' so we read scrollHeight/clientHeight the instant\n // columnResizeActive flips true — before any other reactive consumer\n // (notably our own overflow computed) can mutate the DOM and thereby\n // change which scrollbars are visible.\n watch(\n columnResizeActive,\n (active) => {\n if (active) {\n const el = scrolledElement.value;\n verticalScrollbarVisibleAtResizeStart.value =\n elIsPresent(el) && el.scrollHeight > el.clientHeight;\n }\n },\n { flush: \"sync\" },\n );\n\n provide(\n injectionKey,\n computed(() => ({\n overflowX:\n !columnResizeActive.value && !fitsWithoutHorizontalScrollbar.value\n ? \"auto\"\n : \"hidden\",\n overflowY:\n columnResizeActive.value && verticalScrollbarVisibleAtResizeStart.value\n ? \"scroll\"\n : \"auto\",\n })),\n );\n};\n\nexport const useOverflowStyles = () => inject(injectionKey)!;\n","import { type InjectionKey, type Ref, inject, provide, ref } from \"vue\";\n\nimport {\n injectCloseExpandedSubMenu,\n provideForCloseSubMenusOnScroll,\n} from \"./useCloseSubMenusOnScroll\";\nimport { provideOverflowStyles, useOverflowStyles } from \"./useOverflowStyles\";\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Ref<HTMLElement | null>> =\n Symbol(\"scrollContainerRed\");\n\nexport const provideCommonScrollContainerProps = (\n containerRef: Ref<HTMLElement | null>,\n params: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n },\n) => {\n provideOverflowStyles({ ...params, scrolledElement: containerRef });\n provideForCloseSubMenusOnScroll();\n provide(injectionKey, containerRef);\n};\n\n/**\n * Thin helper that injects only the scroll container ref provided by\n * {@link provideCommonScrollContainerProps}, without pulling in the overflow\n * and sub-menu providers that {@link useCommonScrollContainerProps} requires.\n * Falls back to a null ref when no provider is present (e.g. in isolated tests).\n */\nexport const useScrollContainer = () => inject(injectionKey, ref(null));\n\nexport const useCommonScrollContainerProps = () => {\n const closeExpandedSubMenu = injectCloseExpandedSubMenu();\n const overflowStyles = useOverflowStyles();\n return {\n overflowStyles,\n closeExpandedSubMenu,\n containerRef: useScrollContainer(),\n };\n};\n","import { type Ref, nextTick, ref, watch } from \"vue\";\n\n/**\n * While a column resize is active a screen-wide spacer is rendered to the right of the\n * table content, guaranteeing there is always horizontal scroll room so the edge\n * auto-scroll (see Header.vue) can keep growing a column past the current table width.\n *\n * This composable owns the spacer's lifecycle: when the resize ends it only animates the\n * spacer's width back down to the current body width if the extra scroll room is actually\n * on screen (the container is scrolled past the body's right edge) - otherwise there is\n * nothing to see and the spacer is dropped immediately. Once the collapse animation has\n * finished, `onResizeScrollSpacerTransitionEnd` unmounts it.\n */\nexport const useResizeScrollSpacer = ({\n columnResizeActive,\n currentBodyWidth,\n scrollContainer,\n}: {\n columnResizeActive: Ref<boolean>;\n currentBodyWidth: Ref<number>;\n scrollContainer: Ref<HTMLElement | null>;\n}) => {\n const showResizeScrollSpacer = ref(false);\n const collapseResizeScrollSpacer = ref(false);\n const additionalSpacerWidth = ref(\"0px\");\n\n // True when the area beyond the body's right edge (i.e. part of the spacer) is within\n // the currently visible viewport of the scroll container.\n const getVisibleWidthBeyondBody = () => {\n const container = scrollContainer.value;\n if (container === null) {\n return 0;\n }\n return Math.max(\n 0,\n container.scrollLeft + container.clientWidth - currentBodyWidth.value,\n );\n };\n\n watch(columnResizeActive, (active) => {\n if (active) {\n collapseResizeScrollSpacer.value = false;\n showResizeScrollSpacer.value = true;\n additionalSpacerWidth.value = \"100vw\";\n } else if (showResizeScrollSpacer.value) {\n const visibleWidthBeyondBody = getVisibleWidthBeyondBody();\n if (visibleWidthBeyondBody > 0) {\n additionalSpacerWidth.value = `${visibleWidthBeyondBody}px`;\n nextTick(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n scrollContainer.value?.offsetWidth; // force layout so the width change above is registered before we collapse\n additionalSpacerWidth.value = \"0px\";\n collapseResizeScrollSpacer.value = true;\n });\n } else {\n // the spacer is scrolled out of view, so just drop it without animating\n showResizeScrollSpacer.value = false;\n additionalSpacerWidth.value = \"0px\";\n }\n }\n });\n\n const onResizeScrollSpacerTransitionEnd = () => {\n if (collapseResizeScrollSpacer.value) {\n showResizeScrollSpacer.value = false;\n collapseResizeScrollSpacer.value = false;\n }\n };\n\n return {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n };\n};\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","'use strict';\n\nvar rafThrottle = function rafThrottle(callback) {\n var requestId = null;\n var lastArgs;\n var later = function later(context) {\n return function () {\n requestId = null;\n callback.apply(context, lastArgs);\n };\n };\n var throttled = function throttled() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n lastArgs = args;\n if (requestId === null) {\n requestId = requestAnimationFrame(later(this));\n }\n };\n throttled.cancel = function () {\n cancelAnimationFrame(requestId);\n requestId = null;\n };\n return throttled;\n};\n\nmodule.exports = rafThrottle;\n","// a vue composable for the capability of the the TableUI to detect the available width for all columns.\nimport {\n type Ref,\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport throttle from \"raf-throttle\";\n\nexport const useTotalWidth = (root: Ref<null | HTMLElement>) => {\n const totalWidth: Ref<null | number> = ref(null);\n\n const rootResizeCallback = throttle((entries) => {\n const rect = entries[0].contentRect;\n totalWidth.value = rect.width;\n });\n const rootResizeObserver = new ResizeObserver(rootResizeCallback);\n\n onMounted(() => {\n if (root.value) {\n rootResizeObserver.observe(root.value);\n }\n });\n\n onBeforeUnmount(() => {\n if (root.value) {\n rootResizeObserver.unobserve(root.value);\n }\n });\n\n return totalWidth;\n};\n\nconst useScrollbarSizes = (scrolledElement: Ref<null | HTMLElement>) => {\n const currentScrollBarWidth = ref<null | number>(null);\n const currentScrollBarHeight = ref<null | number>(null);\n\n const scrollbarWidthCallback = throttle((entries) => {\n const totalWidth = entries[0].borderBoxSize[0].inlineSize;\n const innerWidth = entries[0].contentRect.width;\n const totalHeight = entries[0].borderBoxSize[0].blockSize;\n const innerHeight = entries[0].contentRect.height;\n currentScrollBarHeight.value = Math.ceil(totalHeight - innerHeight);\n currentScrollBarWidth.value = Math.ceil(totalWidth - innerWidth);\n });\n const scrollbarWidthObserver = new ResizeObserver(scrollbarWidthCallback);\n\n onMounted(() => {\n // next tick necessary for the virtual scroller to be rendered\n nextTick(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.observe(scrolledElement.value);\n }\n });\n });\n\n /**\n * If the scroller is refreshed, the scrollbar width observer needs to be updated.\n */\n watch(\n () => scrolledElement.value,\n (newEl, oldEl) => {\n if (oldEl !== null) {\n scrollbarWidthObserver.unobserve(oldEl);\n }\n if (newEl !== null) {\n scrollbarWidthObserver.observe(newEl);\n }\n },\n );\n\n onBeforeUnmount(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.unobserve(scrolledElement.value);\n }\n });\n\n return { currentScrollBarWidth, currentScrollBarHeight };\n};\n\nexport const useAvailableWidth = ({\n emitAvailableWidth,\n specialColumnsSizeTotal,\n refs: { scrolledElement },\n totalWidth,\n}: {\n emitAvailableWidth: (availableWidth: number) => void;\n specialColumnsSizeTotal: Ref<number>;\n refs: {\n scrolledElement: Ref<null | HTMLElement>;\n };\n totalWidth: Ref<null | number>;\n}) => {\n const { currentScrollBarWidth, currentScrollBarHeight } =\n useScrollbarSizes(scrolledElement);\n\n const totalWidthWithoutSpecialColumns = computed(() => {\n if (totalWidth.value === null) {\n return null;\n }\n return totalWidth.value - specialColumnsSizeTotal.value;\n });\n const currentDataWidth = computed(() => {\n if (\n totalWidthWithoutSpecialColumns.value === null ||\n currentScrollBarWidth.value === null\n ) {\n return null;\n }\n return totalWidthWithoutSpecialColumns.value - currentScrollBarWidth.value;\n });\n\n const innerWidthToBodyWidth = (columnsWidth: number) => {\n return columnsWidth + specialColumnsSizeTotal.value;\n };\n\n const fitsInsideTotalWidth = (bodyWidth: number) => {\n let width = totalWidth.value ?? 0;\n if (currentScrollBarWidth.value) {\n width -= currentScrollBarWidth.value;\n }\n return Math.floor(bodyWidth) <= width;\n };\n\n const allSizes = computed(() => ({\n currentDataWidth: currentDataWidth.value,\n totalWidthWithoutSpecialColumns: totalWidthWithoutSpecialColumns.value,\n }));\n\n watch(\n allSizes,\n (\n {\n currentDataWidth: newCurrentDataWidth,\n totalWidthWithoutSpecialColumns: newTotalWidthWithoutSpecialColumns,\n },\n {\n currentDataWidth: oldCurrentDataWidth,\n totalWidthWithoutSpecialColumns: oldTotalWidthWithoutSpecialColumns,\n },\n ) => {\n if (newCurrentDataWidth !== null) {\n const changeIsInducedByAppearingScrollbar =\n oldTotalWidthWithoutSpecialColumns ===\n newTotalWidthWithoutSpecialColumns &&\n oldCurrentDataWidth !== null &&\n oldCurrentDataWidth > newCurrentDataWidth;\n const yScrollBarExistsBecauseOfXScrollBar =\n currentScrollBarHeight.value &&\n scrolledElement.value!.scrollHeight <=\n scrolledElement.value!.clientHeight + currentScrollBarHeight.value;\n if (\n changeIsInducedByAppearingScrollbar &&\n yScrollBarExistsBecauseOfXScrollBar\n ) {\n /**\n * Updating the available width in this case can lead to an endless flicker loop:\n * 1. An x-scrollbar appears, because the content is too wide\n * 2. A y-scrollbar appears, because the x-scrollbar appeared\n * 3. The available width is updated, because the y-scrollbar appeared\n * 4. The content is scaled accordingly\n * 5. The x-scrollbar disappears, because the content is now smaller\n * 6. The y-scrollbar disappears, because the x-scrollbar disappeared\n * 7. The available width is updated, because the y-scrollbar disappeared\n * 8. The content is scaled accordingly\n * 9. Go to 1.\n *\n * To prevent this, we do not update the available width, if the y-scrollbar only exists because of the x-scrollbar.\n */\n return;\n }\n emitAvailableWidth(newCurrentDataWidth);\n }\n },\n );\n\n return { innerWidthToBodyWidth, fitsInsideTotalWidth };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","import { reactive, ref } from \"vue\";\n\nexport const useBoolean = (initialValue = false) => {\n const state = ref(initialValue);\n const setTrue = () => {\n state.value = true;\n };\n const setFalse = () => {\n state.value = false;\n };\n return reactive({ state, setTrue, setFalse });\n};\n","import { type ComputedRef, type Ref, onMounted, onUnmounted } from \"vue\";\n\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport type CellSelectionOverlay from \"../ui/CellSelectionOverlay.vue\";\n\nimport type { CellPosition } from \"./useCellSelection\";\n\nexport const useCellCopyPaste = ({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy,\n onPaste,\n onDelete,\n onCut,\n}: {\n focusWithin: Ref<boolean>;\n isEditingCell: Ref<boolean>;\n selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n >;\n selectedCell: ComputedRef<CellPosition | undefined>;\n isEditingEnabled: ComputedRef<boolean>;\n onCopy: ({ withHeaders }: { withHeaders: boolean }) => void;\n onPaste?: () => void;\n onCut?: () => void;\n onDelete?: () => void;\n}) => {\n const isHeaderCellSelected = () => selectedCell.value?.y === -1;\n\n const triggerCopyAnimation = () => {\n if (Array.isArray(selectionOverlay.value)) {\n selectionOverlay.value[0]?.triggerCopied();\n } else if (selectionOverlay.value) {\n selectionOverlay.value.triggerCopied();\n }\n };\n\n const isBodySelected = () => {\n return focusWithin.value && !isHeaderCellSelected() && !isEditingCell.value;\n };\n\n const primaryModifierKey = getMetaOrCtrlKey();\n\n const onCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (!isBodySelected()) {\n return;\n }\n triggerCopyAnimation();\n onCopy({ withHeaders });\n };\n\n const onCutSelection = () => {\n if (isEditingEnabled.value && onCut && isBodySelected()) {\n triggerCopyAnimation();\n onCut();\n }\n };\n\n const onDeleteSelection = () => {\n if (isEditingEnabled.value && onDelete && isBodySelected()) {\n onDelete();\n }\n };\n\n const onPasteSelection = () => {\n if (isEditingEnabled.value && onPaste && isBodySelected()) {\n onPaste();\n }\n };\n\n const handleDefaultCopyEvent = () => {\n onCopySelection({ withHeaders: false });\n };\n\n const handleCopyOnKeydown = (e: KeyboardEvent) => {\n if (e[primaryModifierKey]) {\n onCopySelection({ withHeaders: true });\n }\n };\n\n onMounted(() => {\n globalThis.addEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.addEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.addEventListener(\"cut\", onCutSelection);\n }\n });\n\n onUnmounted(() => {\n globalThis.removeEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.removeEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.removeEventListener(\"cut\", onCutSelection);\n }\n });\n\n return { handleCopyOnKeydown, handleDeleteSelection: onDeleteSelection };\n};\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { type Ref, computed, ref, watch } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nexport type CellPosition = {\n x: number;\n y: number;\n};\n\nclass CellRect {\n anchor: CellPosition;\n opposite: CellPosition;\n\n constructor(anchorPosition: CellPosition) {\n this.anchor = this.opposite = anchorPosition;\n }\n\n setCorner(cellPos: CellPosition) {\n if (isEqual(this.opposite, cellPos)) {\n return;\n }\n this.opposite = cellPos;\n }\n\n getMinMax(coord: keyof CellPosition) {\n const coords = [this.anchor[coord], this.opposite[coord]];\n return { min: Math.min(...coords), max: Math.max(...coords) };\n }\n}\n\nexport type MinMax = { min: number; max: number };\n\nexport type Rect = { x: MinMax; y: MinMax };\n\nexport type RectId = number;\n\nexport const useCellSelection = (enableCellSelection: Ref<boolean>) => {\n const cellRect = ref<CellRect | null>(null);\n const currentRectId: Ref<RectId | null> = ref(null);\n\n const rectMinMax = computed<Rect | null>(() => {\n const rectValue = cellRect.value;\n if (rectValue === null) {\n return null;\n }\n return {\n x: rectValue.getMinMax(\"x\"),\n y: rectValue.getMinMax(\"y\"),\n };\n });\n\n const selectedCell = computed(() => cellRect.value?.opposite);\n\n const isSingleSelectedCell = (cellPosition: CellPosition) => {\n return (\n cellRect.value !== null &&\n isEqual(cellRect.value.anchor, cellRect.value.opposite) &&\n isEqual(cellRect.value.anchor, cellPosition)\n );\n };\n\n const clearCellSelection = () => {\n cellRect.value = null;\n currentRectId.value = null;\n };\n\n watch(\n () => enableCellSelection.value,\n (isEnabled) => {\n if (!isEnabled) {\n clearCellSelection();\n }\n },\n );\n\n const selectCell = (\n cellPosition: CellPosition,\n rectId: RectId,\n ignoreIfSelected: boolean = false,\n ) => {\n if (\n rectId === currentRectId.value &&\n isSingleSelectedCell(cellPosition) &&\n !ignoreIfSelected\n ) {\n clearCellSelection();\n return;\n }\n cellRect.value = new CellRect(cellPosition);\n currentRectId.value = rectId;\n };\n\n const expandCellSelection = (cellPosition: CellPosition, rectId: RectId) => {\n if (cellRect.value === null || currentRectId.value !== rectId) {\n selectCell(cellPosition, rectId);\n return;\n }\n cellRect.value.setCorner(cellPosition);\n };\n\n const applyIfEnabled = (method: (...args: any[]) => void) => {\n return (...args: any[]) => {\n if (enableCellSelection.value) {\n method(...args);\n }\n };\n };\n\n return {\n selectCell: applyIfEnabled(selectCell),\n expandCellSelection: applyIfEnabled(expandCellSelection),\n clearCellSelection,\n rectMinMax,\n selectedCell,\n currentRectId,\n isSingleSelectedCell,\n };\n};\n","/**\n * This method returns true if we should stop processing the key event since it is\n * to be ignored outside of the editing context.\n */\nconst isToBeIgnoredKeyEvent = (keyEvent: KeyboardEvent) => {\n // Ignore backspace and delete to prevent clearing the cell value while editing\n return keyEvent.key === \"Backspace\" || keyEvent.key === \"Delete\";\n};\n\nexport const createEditingCellKeydownHandler = ({\n moveSelection,\n}: {\n moveSelection: (\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) => void;\n}) => {\n return (event: KeyboardEvent) => {\n if (isToBeIgnoredKeyEvent(event)) {\n event.stopPropagation();\n return;\n }\n if (event.key === \"Tab\") {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n moveSelection(horizontalMove, 0, false);\n } else if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n moveSelection(0, 1, false);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n // Select the underlying cell again to stop editing\n moveSelection(0, 0, false);\n }\n };\n};\n","import { nextTick, ref } from \"vue\";\n\n/**\n * Keeps the table hidden until one tick after the available width has been\n * reported for the first time.\n *\n * Column sizes that are derived from the available width (see the\n * `update:available-width` emit) can only be applied once that width is known,\n * i.e. anything rendered before that is rendered at sizes which are about to\n * change — a visible jump on every initial load. Waiting one tick after the\n * report lets the reaction to it (and with it the column-size CSS variables)\n * reach the DOM first, so the first frame the user sees is the final one.\n */\nexport const useVisibleAfterAvailableWidth = () => {\n const isVisible = ref(false);\n\n const onAvailableWidthReported = async () => {\n if (isVisible.value) {\n return;\n }\n await nextTick();\n isVisible.value = true;\n };\n\n return { isVisible, onAvailableWidthReported };\n};\n","<script setup lang=\"ts\">\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst {\n currentPage = 1,\n totalPages = 0,\n hasNextPage = false,\n hasPreviousPage = false,\n} = defineProps<{\n currentPage?: number;\n totalPages?: number;\n hasNextPage?: boolean;\n hasPreviousPage?: boolean;\n}>();\n\nconst emit = defineEmits<{\n pageChange: [newPageNumber: number];\n}>();\n\nconst onPageChange = (newPageNumber: number) => {\n consola.debug(\"Page change\", newPageNumber);\n emit(\"pageChange\", newPageNumber);\n};\n</script>\n\n<template>\n <div class=\"page-navigation\">\n <div class=\"navigation-buttons\">\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-left-double\"\n ariaLabel=\"First page\"\n :disabled=\"!hasPreviousPage\"\n @click=\"onPageChange(1)\"\n />\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-left\"\n ariaLabel=\"Previous page\"\n :disabled=\"!hasPreviousPage\"\n @click=\"onPageChange(currentPage - 1)\"\n />\n </div>\n <span class=\"page-count\">{{ currentPage }} of {{ totalPages }}</span>\n <div class=\"navigation-buttons\">\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-right\"\n ariaLabel=\"Next page\"\n :disabled=\"!hasNextPage\"\n @click=\"onPageChange(currentPage + 1)\"\n />\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-right-double\"\n ariaLabel=\"Last page\"\n :disabled=\"!hasNextPage\"\n @click=\"onPageChange(totalPages)\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.page-navigation {\n display: flex;\n gap: var(--kds-spacing-container-0-5x);\n align-items: center;\n\n & .navigation-buttons {\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-items: center;\n }\n\n & .page-count {\n font: var(--kds-font-base-title-small);\n color: var(--kds-color-text-and-icon-subtle);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst {\n currentPage = 1,\n totalPages = 0,\n hasNextPage = false,\n hasPreviousPage = false,\n} = defineProps<{\n currentPage?: number;\n totalPages?: number;\n hasNextPage?: boolean;\n hasPreviousPage?: boolean;\n}>();\n\nconst emit = defineEmits<{\n pageChange: [newPageNumber: number];\n}>();\n\nconst onPageChange = (newPageNumber: number) => {\n consola.debug(\"Page change\", newPageNumber);\n emit(\"pageChange\", newPageNumber);\n};\n</script>\n\n<template>\n <div class=\"page-navigation\">\n <div class=\"navigation-buttons\">\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-left-double\"\n ariaLabel=\"First page\"\n :disabled=\"!hasPreviousPage\"\n @click=\"onPageChange(1)\"\n />\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-left\"\n ariaLabel=\"Previous page\"\n :disabled=\"!hasPreviousPage\"\n @click=\"onPageChange(currentPage - 1)\"\n />\n </div>\n <span class=\"page-count\">{{ currentPage }} of {{ totalPages }}</span>\n <div class=\"navigation-buttons\">\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-right\"\n ariaLabel=\"Next page\"\n :disabled=\"!hasNextPage\"\n @click=\"onPageChange(currentPage + 1)\"\n />\n <KdsButton\n variant=\"transparent\"\n size=\"small\"\n leading-icon=\"chevron-right-double\"\n ariaLabel=\"Last page\"\n :disabled=\"!hasNextPage\"\n @click=\"onPageChange(totalPages)\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.page-navigation {\n display: flex;\n gap: var(--kds-spacing-container-0-5x);\n align-items: center;\n\n & .navigation-buttons {\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-items: center;\n }\n\n & .page-count {\n font: var(--kds-font-base-title-small);\n color: var(--kds-color-text-and-icon-subtle);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nconst {\n currentItems = 0,\n pageSize = 0,\n currentPage = 1,\n showTableSize = true,\n rowLabel = \"Rows\",\n} = defineProps<{\n currentItems?: number;\n pageSize?: number;\n currentPage?: number;\n showTableSize?: boolean;\n rowLabel?: string;\n}>();\n\nconst totalPages = computed(() =>\n !pageSize || currentItems <= 0 ? 0 : Math.ceil(currentItems / pageSize),\n);\n\nconst hasMultiplePages = computed(() => totalPages.value > 1);\nconst pageRangeStart = computed(() => currentPage * pageSize - pageSize + 1);\nconst pageRangeEnd = computed(() =>\n Math.min(currentPage * pageSize, currentItems),\n);\nconst rowCountText = computed(() =>\n hasMultiplePages.value && currentItems ? `of ${currentItems}` : currentItems,\n);\n</script>\n\n<template>\n <span v-if=\"showTableSize && currentItems === 0\" class=\"subtle\">No data</span>\n <div v-else class=\"row-range-container\">\n <span class=\"subtle\">{{ rowLabel }}:</span>\n <span v-if=\"hasMultiplePages && currentItems\" class=\"muted\">\n {{ pageRangeStart }}–{{ pageRangeEnd }}\n </span>\n <span class=\"subtle\">{{ rowCountText }}</span>\n </div>\n</template>\n\n<style scoped>\n.subtle {\n font: var(--kds-font-base-title-small);\n color: var(--kds-color-text-and-icon-subtle);\n}\n\n.muted {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-muted);\n}\n\n.row-range-container {\n display: flex;\n flex: 1 0 0;\n gap: var(--kds-spacing-container-0-25x);\n align-items: center;\n align-self: stretch;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\nconst {\n currentItems = 0,\n pageSize = 0,\n currentPage = 1,\n showTableSize = true,\n rowLabel = \"Rows\",\n} = defineProps<{\n currentItems?: number;\n pageSize?: number;\n currentPage?: number;\n showTableSize?: boolean;\n rowLabel?: string;\n}>();\n\nconst totalPages = computed(() =>\n !pageSize || currentItems <= 0 ? 0 : Math.ceil(currentItems / pageSize),\n);\n\nconst hasMultiplePages = computed(() => totalPages.value > 1);\nconst pageRangeStart = computed(() => currentPage * pageSize - pageSize + 1);\nconst pageRangeEnd = computed(() =>\n Math.min(currentPage * pageSize, currentItems),\n);\nconst rowCountText = computed(() =>\n hasMultiplePages.value && currentItems ? `of ${currentItems}` : currentItems,\n);\n</script>\n\n<template>\n <span v-if=\"showTableSize && currentItems === 0\" class=\"subtle\">No data</span>\n <div v-else class=\"row-range-container\">\n <span class=\"subtle\">{{ rowLabel }}:</span>\n <span v-if=\"hasMultiplePages && currentItems\" class=\"muted\">\n {{ pageRangeStart }}–{{ pageRangeEnd }}\n </span>\n <span class=\"subtle\">{{ rowCountText }}</span>\n </div>\n</template>\n\n<style scoped>\n.subtle {\n font: var(--kds-font-base-title-small);\n color: var(--kds-color-text-and-icon-subtle);\n}\n\n.muted {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-muted);\n}\n\n.row-range-container {\n display: flex;\n flex: 1 0 0;\n gap: var(--kds-spacing-container-0-25x);\n align-items: center;\n align-self: stretch;\n}\n</style>\n","<script lang=\"ts\">\nimport type { PropType } from \"vue\";\n\nimport { KdsMenuButton } from \"@knime/kds-components\";\n\nimport type { PageConfig, PageState } from \"../../types/PageConfig\";\nimport type { TableConfig, TableState } from \"../../types/TableConfig\";\n\nimport PageNavigation from \"./PageNavigation.vue\";\nimport PageRowRange from \"./PageRowRange.vue\";\n\n/**\n * Table controls for the bottom of the table, showing the current row range,\n * page navigation, and a page-size menu.\n *\n * @emits pageChange when navigating to a different page.\n * @emits pageSizeUpdate when the page size is updated.\n */\nexport default {\n components: {\n PageNavigation,\n PageRowRange,\n KdsMenuButton,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n required: true,\n },\n pageConfig: {\n type: Object as PropType<PageConfig>,\n required: true,\n },\n tableState: {\n type: Object as PropType<TableState>,\n required: true,\n },\n pageState: {\n type: Object as PropType<PageState>,\n required: true,\n },\n },\n emits: [\"pageSizeUpdate\", \"pageChange\"],\n computed: {\n pageSizeItems() {\n return (this.pageConfig.possiblePageSizes ?? []).map((pageSize) => ({\n id: pageSize.toString(),\n text: this.createText(pageSize),\n }));\n },\n currentItems(): number {\n return this.tableState.tableSizes?.currentNumRows ?? 0;\n },\n totalPages(): number {\n if (!this.pageConfig.pageSize || this.currentItems <= 0) {\n return 0;\n }\n return Math.ceil(this.currentItems / this.pageConfig.pageSize);\n },\n hasNextPage(): boolean {\n return this.pageState.currentPage < this.totalPages;\n },\n hasPreviousPage(): boolean {\n return this.pageState.currentPage > 1;\n },\n showPageNavigation(): boolean {\n return this.hasNextPage || this.hasPreviousPage;\n },\n },\n methods: {\n createText(size: number) {\n return `${size.toString()} per page`;\n },\n onPageSizeSelect(newPageSize: string) {\n consola.debug(\"Updated table page size: \", newPageSize);\n this.$emit(\"pageSizeUpdate\", Number.parseInt(newPageSize, 10));\n },\n },\n};\n</script>\n\n<template>\n <div v-if=\"showPageNavigation || pageSizeItems.length\" class=\"page-controls\">\n <PageRowRange\n class=\"page-row-range\"\n :current-items=\"tableState.tableSizes?.currentNumRows\"\n :page-size=\"pageConfig.pageSize\"\n :current-page=\"pageState.currentPage\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n />\n <PageNavigation\n v-if=\"showPageNavigation\"\n :current-page=\"pageState.currentPage\"\n :total-pages=\"totalPages\"\n :has-next-page=\"hasNextPage\"\n :has-previous-page=\"hasPreviousPage\"\n @page-change=\"$emit('pageChange', $event)\"\n />\n <div class=\"page-size-menu\">\n <KdsMenuButton\n v-if=\"pageSizeItems.length\"\n :items=\"pageSizeItems\"\n :label=\"createText(pageConfig.pageSize)\"\n size=\"small\"\n trailing-icon=\"chevron-down\"\n variant=\"transparent\"\n @item-click=\"onPageSizeSelect\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.page-controls {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--kds-spacing-container-0-25x) var(--kds-spacing-container-0-75x);\n background: var(--kds-color-surface-default);\n\n & .page-row-range,\n & .page-size-menu {\n flex-grow: 1;\n flex-basis: 0;\n }\n\n .page-size-menu {\n display: flex;\n justify-content: flex-end;\n }\n}\n</style>\n","<script lang=\"ts\">\nimport type { PropType } from \"vue\";\n\nimport { KdsMenuButton } from \"@knime/kds-components\";\n\nimport type { PageConfig, PageState } from \"../../types/PageConfig\";\nimport type { TableConfig, TableState } from \"../../types/TableConfig\";\n\nimport PageNavigation from \"./PageNavigation.vue\";\nimport PageRowRange from \"./PageRowRange.vue\";\n\n/**\n * Table controls for the bottom of the table, showing the current row range,\n * page navigation, and a page-size menu.\n *\n * @emits pageChange when navigating to a different page.\n * @emits pageSizeUpdate when the page size is updated.\n */\nexport default {\n components: {\n PageNavigation,\n PageRowRange,\n KdsMenuButton,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n required: true,\n },\n pageConfig: {\n type: Object as PropType<PageConfig>,\n required: true,\n },\n tableState: {\n type: Object as PropType<TableState>,\n required: true,\n },\n pageState: {\n type: Object as PropType<PageState>,\n required: true,\n },\n },\n emits: [\"pageSizeUpdate\", \"pageChange\"],\n computed: {\n pageSizeItems() {\n return (this.pageConfig.possiblePageSizes ?? []).map((pageSize) => ({\n id: pageSize.toString(),\n text: this.createText(pageSize),\n }));\n },\n currentItems(): number {\n return this.tableState.tableSizes?.currentNumRows ?? 0;\n },\n totalPages(): number {\n if (!this.pageConfig.pageSize || this.currentItems <= 0) {\n return 0;\n }\n return Math.ceil(this.currentItems / this.pageConfig.pageSize);\n },\n hasNextPage(): boolean {\n return this.pageState.currentPage < this.totalPages;\n },\n hasPreviousPage(): boolean {\n return this.pageState.currentPage > 1;\n },\n showPageNavigation(): boolean {\n return this.hasNextPage || this.hasPreviousPage;\n },\n },\n methods: {\n createText(size: number) {\n return `${size.toString()} per page`;\n },\n onPageSizeSelect(newPageSize: string) {\n consola.debug(\"Updated table page size: \", newPageSize);\n this.$emit(\"pageSizeUpdate\", Number.parseInt(newPageSize, 10));\n },\n },\n};\n</script>\n\n<template>\n <div v-if=\"showPageNavigation || pageSizeItems.length\" class=\"page-controls\">\n <PageRowRange\n class=\"page-row-range\"\n :current-items=\"tableState.tableSizes?.currentNumRows\"\n :page-size=\"pageConfig.pageSize\"\n :current-page=\"pageState.currentPage\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n />\n <PageNavigation\n v-if=\"showPageNavigation\"\n :current-page=\"pageState.currentPage\"\n :total-pages=\"totalPages\"\n :has-next-page=\"hasNextPage\"\n :has-previous-page=\"hasPreviousPage\"\n @page-change=\"$emit('pageChange', $event)\"\n />\n <div class=\"page-size-menu\">\n <KdsMenuButton\n v-if=\"pageSizeItems.length\"\n :items=\"pageSizeItems\"\n :label=\"createText(pageConfig.pageSize)\"\n size=\"small\"\n trailing-icon=\"chevron-down\"\n variant=\"transparent\"\n @item-click=\"onPageSizeSelect\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.page-controls {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--kds-spacing-container-0-25x) var(--kds-spacing-container-0-75x);\n background: var(--kds-color-surface-default);\n\n & .page-row-range,\n & .page-size-menu {\n flex-grow: 1;\n flex-basis: 0;\n }\n\n .page-size-menu {\n display: flex;\n justify-content: flex-end;\n }\n}\n</style>\n","<template>\n <div class=\"popover\">\n <span class=\"header\">\n <slot name=\"header\" />\n </span>\n <div class=\"body\">\n <slot name=\"body\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.popover {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-5x);\n align-items: flex-start;\n max-height: var(--kds-dimension-component-height-25x);\n padding: var(--kds-spacing-container-0-75x);\n background-color: var(--kds-color-surface-default);\n border-radius: var(--kds-border-radius-container-0-50x);\n box-shadow: var(--kds-elevation-level-3);\n\n & .header {\n font: var(--kds-font-base-title-xsmall);\n color: var(--kds-color-text-and-icon-muted);\n }\n\n & .body {\n width: 100%;\n }\n}\n</style>\n","import { type Ref, ref, watch } from \"vue\";\n\nexport const useButtonPopoverInteraction = ({\n keepButtonActive,\n}: {\n keepButtonActive: Ref<boolean>;\n}) => {\n const buttonIsActive = ref(keepButtonActive.value);\n const showPopover = ref(false);\n\n watch(keepButtonActive, (newValue) => {\n buttonIsActive.value = newValue || showPopover.value;\n });\n\n const onButtonClick = (isActive: boolean) => {\n showPopover.value = !showPopover.value;\n buttonIsActive.value = keepButtonActive.value || isActive;\n };\n\n const onPopoverToggle = (isOpen: boolean) => {\n buttonIsActive.value = keepButtonActive.value || isOpen;\n showPopover.value = isOpen;\n };\n\n const openPopover = () => {\n showPopover.value = true;\n buttonIsActive.value = true;\n };\n\n return {\n onButtonClick,\n onPopoverToggle,\n buttonIsActive,\n showPopover,\n openPopover,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :style=\"sortPopoverRef?.anchorStyle\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :style=\"sortPopoverRef?.anchorStyle\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","import type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport { minColumnSize } from \"../constants\";\nimport type { ActionConfig } from \"../types/ActionConfig\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\n\n/**\n * Which action buttons the header of the given column shows. Mirrors the\n * conditions HeaderCell.vue renders them under, for the places that need to\n * know a column's buttons without rendering its header — namely the minimum\n * width the column needs (see {@link minColumnSize}).\n */\nexport const columnHeaderActionButtons = ({\n column,\n actionConfig,\n additionalMenuItems,\n}: {\n column: ColumnConfig;\n actionConfig?: ActionConfig;\n additionalMenuItems?: KdsMenuItem[];\n}) => ({\n menuButton: Boolean(additionalMenuItems?.length),\n sortButton: Boolean(actionConfig?.enableSorting) && !column.isNotSortable,\n deleteButton: Boolean(column.deletable),\n});\n\n/** The minimum width the given column needs for its header action buttons. */\nexport const minSizeOfColumn = (\n params: Parameters<typeof columnHeaderActionButtons>[0],\n) => minColumnSize(columnHeaderActionButtons(params));\n","import { type Ref, nextTick } from \"vue\";\nimport { useRafFn } from \"@vueuse/core\";\n\n// while resizing a column, auto-scroll engages when the pointer is within this many\n// px inward of the scroll container's right edge (or anywhere past it)\nexport const AUTO_SCROLL_EDGE_SIZE = 20;\n\n// the speed (in px/s) at which the column grows and the container scrolls while\n// auto-scrolling during a column resize drag\nexport const AUTO_SCROLL_SPEED = 250;\n\n/**\n * While a column is being resized, this composable grows the dragged column and scrolls\n * the container to the right in lockstep whenever the pointer is near (or past) the\n * container's right edge. This lets the last column be widened beyond the visible area\n * without having to release and re-grab the handle.\n *\n * The accumulated px gained via auto-scrolling is added to the caller-owned\n * `autoScrollOffset` ref (and reset to 0 on pointer-up); the caller must include it in the\n * emitted column width. `onAutoScroll` is invoked on every animation frame so the caller\n * can re-emit the (now wider) column width.\n */\nexport const useAutoScrollOnRightEdge = ({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll,\n}: {\n scrollContainer: Ref<HTMLElement | null>;\n autoScrollOffset: Ref<number>;\n onAutoScroll: () => void;\n}) => {\n let pointerClientX = 0;\n // target scroll position is `scrollLeftBase + autoScrollOffset` (see below).\n let scrollLeftBase = 0;\n\n const isInTriggerZone = () => {\n const container = scrollContainer.value;\n if (!container) {\n return false;\n }\n const { right } = container.getBoundingClientRect();\n return pointerClientX >= right - AUTO_SCROLL_EDGE_SIZE;\n };\n\n // `delta` is the ms since the previous frame, so the speed is time-based and thus\n // identical across e.g. 60Hz / 120Hz displays. The loop steps unconditionally.\n const { pause, resume } = useRafFn(\n ({ delta }) => {\n const deltaPx = (AUTO_SCROLL_SPEED * delta) / 1000;\n autoScrollOffset.value += deltaPx;\n const container = scrollContainer.value;\n onAutoScroll();\n // We wait one tick assuming that the wider width is applied then\n // Otherwise we cannot scroll further right when resizing the last column\n // which leads to a flickering since the scroll is lagging behind one frame\n nextTick(() => {\n if (container) {\n container.scrollLeft = scrollLeftBase + autoScrollOffset.value;\n }\n });\n },\n { immediate: false },\n );\n\n const updateZone = (clientX: number) => {\n pointerClientX = clientX;\n if (isInTriggerZone()) {\n resume();\n } else {\n pause();\n }\n };\n\n const onPointerDown = (clientX: number) => {\n scrollLeftBase = scrollContainer.value?.scrollLeft ?? 0;\n updateZone(clientX);\n };\n\n const onPointerMove = (clientX: number) => {\n updateZone(clientX);\n };\n\n const onPointerUp = () => {\n pause();\n autoScrollOffset.value = 0;\n };\n\n return { onPointerDown, onPointerMove, onPointerUp };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport PageControls from \"./control/PageControls.vue\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n PageControls,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.ctrl.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.meta.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <PageControls\n v-if=\"pageConfig && pageState\"\n :page-config\n :table-config\n :page-state\n :table-state\n @page-change=\"onPageChange\"\n @page-size-update=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport PageControls from \"./control/PageControls.vue\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n PageControls,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.ctrl.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.meta.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <PageControls\n v-if=\"pageConfig && pageState\"\n :page-config\n :table-config\n :page-state\n :table-state\n @page-change=\"onPageChange\"\n @page-size-update=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","import { computed, nextTick, ref, watchEffect } from \"vue\";\n\nexport const useTableReady = ({ onReady }: { onReady: () => void }) => {\n const autoSizesInitialized = ref(false);\n const availableWidthInitialized = ref(false);\n\n const tableIsVisible = computed(\n () => autoSizesInitialized.value && availableWidthInitialized.value,\n );\n\n const setAutoSizesInitialized = () => {\n autoSizesInitialized.value = true;\n };\n const setAvailableWidthInitialized = () => {\n availableWidthInitialized.value = true;\n };\n\n const waitUntilVisibleInDOMAndCallOnReady = async () => {\n await nextTick();\n onReady();\n };\n\n watchEffect(() => {\n if (tableIsVisible.value) {\n waitUntilVisibleInDOMAndCallOnReady();\n }\n });\n\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n };\n};\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n"],"x_google_ignoreList":[7,8,9,10,31,37],"mappings":";;;;;;;;;;;;;;;;;;;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S;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;EACJ;EACA,OAAO;GACH,UAAU;IACN,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;I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AAiB,mBAAmB;EAClD;CACF;AACF;;;;;yDCIE,YAgCU,oBAhCV,WAgCU;EA/BR,KAAI;EACH,OAAK,EAAA,YAAgB,OAAA,iBAAiB,KAAA,IAAS,SAAA;IACxC,KAAA,QAAM;EACb,MAAM,OAAA;EACN,qBAAmB,OAAA;EACnB,4BAA0B,OAAA;EAC1B,SAAS,OAAA;EACT,gCAAA,OAAA;EACA,mBAAiB,OAAA;EACjB,kBAAgB,OAAA;EAChB,kBAAgB,OAAA;EAChB,eAAa,OAAA;EACb,cAAY,OAAA;EACZ,gCAA8B,OAAA;EAC9B,gBAAc,OAAA;EACd,eAAa,OAAA;EACb,eAAa,OAAA;EACb,cAAY,OAAA;EACZ,iBAAe,OAAA;EACf,gBAAc,OAAA;EACd,mBAAiB,OAAA;EACjB,iCAA+B,MAAA;EAC/B,2BAAwB,SAAA;uCAGF,SAAA,uBAAoB,CAAjC,cAAQ;;SAEf;gBAEiD,cAF5B,CAEtB,WAAkD,KAAA,QAArC,UAAQ,eAAA,mBAAU,aAAS,CAAA,CAAA,CAAA,GAAA,KAAA,GAAA,IAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;KAIpC,SAAA,sCAAA,UAAA,GADR,YAkBU,oBAAA;;EAhBR,KAAI;EACJ,OAAM;EACL,MAAM,SAAA;EACN,qBAAmB,OAAA;EACnB,SAAS,OAAA;EACT,cAAY,OAAA;EACZ,gBAAc,SAAA;EACd,gBAAa,SAAA;sCAGS,SAAA,uBAAoB,CAAjC,cAAQ;;SAEf;gBAEiD,cAF5B,CAEtB,WAAkD,KAAA,QAArC,UAAQ,eAAA,mBAAU,aAAS,CAAA,CAAA,CAAA,GAAA,KAAA,GAAA,IAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["W","E","s","g","V","D","h","y","K","R","$slots","$slots","$emit","$emit","$el"],"sources":["../src/config/table.config.ts","../../styles/dist/tokens/ts/border.js","../../styles/dist/tokens/ts/dimension.js","../../styles/dist/tokens/ts/spacing.js","../src/constants.ts","../src/types/BackgroundColor.ts","../src/utils/index.ts","../../../node_modules/.pnpm/@knime+vue-headless-virtual-scroller@0.2.0_vue@3.5.40_typescript@6.0.3_/node_modules/@knime/vue-headless-virtual-scroller/dist/vue-headless-virtual-scrolling.js","../../../node_modules/.pnpm/dompurify@3.4.13/node_modules/dompurify/dist/purify.es.mjs","../../utils/dist/index.js","../src/components/composables/useDataValueViews.ts","../src/components/composables/useStartEditingKeydown.ts","../src/components/TableBodyNavigatable.vue","../src/components/TableBodyNavigatable.vue","../src/components/composables/useHorizontalIndicesAndStyles.ts","../src/components/useColumnSizes.ts","../src/components/ui/EmptyRow.vue","../src/components/ui/EmptyRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/ui/PlaceholderRow.vue","../src/components/VirtualRow.vue","../src/components/VirtualRow.vue","../src/components/composables/useBodyWidth.ts","../src/components/composables/useCloseSubMenusOnScroll.ts","../src/components/composables/useOverflowStyles.ts","../src/components/composables/useCommonScrollContainerProps.ts","../src/components/composables/useResizeScrollSpacer.ts","../src/components/TableCoreVirtual.vue","../src/components/TableCoreVirtual.vue","../../../node_modules/.pnpm/raf-throttle@2.0.6/node_modules/raf-throttle/lib/rafThrottle.js","../src/components/composables/useAvailableWidth.ts","../src/components/TableCore.vue","../src/components/TableCore.vue","../src/components/composables/useBoolean.ts","../src/components/composables/useCellCopyPaste.ts","../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js","../src/components/composables/useCellSelection.ts","../src/components/composables/useEditCellKeydown.ts","../src/components/composables/useVisibleAfterAvailableWidth.ts","../src/components/control/actionbar/PopoverContainer.vue","../src/components/control/actionbar/useButtonPopoverInteraction.ts","../src/components/control/actionbar/SortControl.vue","../src/components/control/actionbar/SortControl.vue","../src/components/control/TableActionBar.vue","../src/components/control/TableActionBar.vue","../src/utils/columnHeaderActionButtons.ts","../src/components/layout/useAutoScrollOnRightEdge.ts","../src/components/layout/HeaderCell.vue","../src/components/layout/HeaderCell.vue","../src/components/layout/Header.vue","../src/components/layout/Header.vue","../src/components/layout/NewRowButton.vue","../src/components/layout/NewRowButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/ui/CellExpandButton.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/CellRenderer.vue","../src/components/layout/Cell.vue","../src/components/layout/Cell.vue","../src/components/layout/Row.vue","../src/components/layout/Row.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/ui/CellSelectionOverlay.vue","../src/components/TableUI.vue","../src/components/TableUI.vue","../src/components/composables/useTableReady.ts","../src/components/TableUIWithAutoSizeCalculation.vue","../src/components/TableUIWithAutoSizeCalculation.vue"],"sourcesContent":["export const defaultPageSize = 10;\n\nexport const columnTypes = {\n Nominal: \"Nominal\" as const,\n String: \"String\" as const,\n DateTime: \"DateTime\" as const,\n Duration: \"Duration\" as const,\n Number: \"Number\" as const,\n Boolean: \"Boolean\" as const,\n Array: \"Array\" as const,\n Object: \"Object\" as const,\n Image: \"Image\" as const,\n};\n\ntype ValueOf<T> = T[keyof T];\n\nexport type ColumnType = ValueOf<typeof columnTypes>;\n\nexport const columnSortText = {\n [columnTypes.Nominal]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.String]: {\n ascending: \"A to Z\",\n descending: \"Z to A\",\n },\n [columnTypes.DateTime]: {\n ascending: \"Oldest first\",\n descending: \"Newest first\",\n },\n [columnTypes.Duration]: {\n ascending: \"Shortest first\",\n descending: \"Longest first\",\n },\n [columnTypes.Number]: {\n ascending: \"Smallest first\",\n descending: \"Largest first\",\n },\n [columnTypes.Boolean]: {\n ascending: \"False first\",\n descending: \"True first\",\n },\n [columnTypes.Image]: {\n ascending: \"By filename A to Z\",\n descending: \"By filename Z to A\",\n },\n [columnTypes.Array]: {\n ascending: \"Fewest items first\",\n descending: \"Most items first\",\n },\n [columnTypes.Object]: {\n ascending: \"Fewest keys first\",\n descending: \"Most keys first\",\n },\n default: {\n ascending: \"Ascending\",\n descending: \"Descending\",\n },\n} as Record<ColumnType | \"default\", { ascending: string; descending: string }>;\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const border = {\n action: {\n transparent: {\n color: {\n light: { h: 0, s: 0, l: 11.4, a: 0 },\n dark: { h: 0, s: 0, l: 11.4, a: 0 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(0 0% 11.4% / 0)\",\n variable: \"var(--kds-border-action-transparent)\",\n },\n },\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-default)\",\n },\n },\n disabled: {\n color: {\n light: { h: 0, s: 0, l: 72.5, a: 1 },\n dark: { h: 0, s: 0, l: 48.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 72.5%), hsl(0, 0%, 48.2%))\",\n variable: \"var(--kds-border-action-disabled)\",\n },\n },\n focused: {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-focused)\",\n },\n },\n selected: {\n color: {\n light: { h: 171.8, s: 27, l: 47.8, a: 1 },\n dark: { h: 168, s: 46.7, l: 85.3, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(171.8, 27%, 47.8%), hsl(168, 46.7%, 85.3%))\",\n variable: \"var(--kds-border-action-selected)\",\n },\n },\n \"selected-accent\": {\n color: {\n light: { h: 209.4, s: 57.3, l: 49.6, a: 1 },\n dark: { h: 213.6, s: 91.6, l: 76.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(209.4, 57.3%, 49.6%), hsl(213.6, 91.6%, 76.7%))\",\n variable: \"var(--kds-border-action-selected-accent)\",\n },\n },\n error: {\n color: {\n light: { h: 348.8, s: 90.9, l: 34.5, a: 1 },\n dark: { h: 3.5, s: 100, l: 79.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348.8, 90.9%, 34.5%), hsl(3.5, 100%, 79.6%))\",\n variable: \"var(--kds-border-action-error)\",\n },\n },\n primary: {\n color: {\n light: { h: 176.7, s: 82, l: 17.5, a: 1 },\n dark: { h: 176.7, s: 82, l: 17.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(176.7, 82%, 17.5%)\",\n variable: \"var(--kds-border-action-primary)\",\n },\n },\n input: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-action-input)\",\n },\n },\n },\n base: {\n default: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.5 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.5))\",\n variable: \"var(--kds-border-base-default)\",\n },\n },\n muted: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.2 },\n dark: { h: 0, s: 0, l: 99, a: 0.2 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.2), hsl(0 0% 99% / 0.2))\",\n variable: \"var(--kds-border-base-muted)\",\n },\n },\n subtle: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.1 },\n dark: { h: 0, s: 0, l: 99, a: 0.1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0 0% 10.2% / 0.1), hsl(0 0% 99% / 0.1))\",\n variable: \"var(--kds-border-base-subtle)\",\n },\n },\n brand: {\n color: {\n light: { h: 50.8, s: 100, l: 50, a: 1 },\n dark: { h: 50.8, s: 100, l: 50, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid hsl(50.8, 100%, 50%)\",\n variable: \"var(--kds-border-base-brand)\",\n },\n },\n danger: {\n color: {\n light: { h: 3.4, s: 100, l: 86.1, a: 1 },\n dark: { h: 348, s: 94.3, l: 20.8, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(3.4, 100%, 86.1%), hsl(348, 94.3%, 20.8%))\",\n variable: \"var(--kds-border-base-danger)\",\n },\n },\n warning: {\n color: {\n light: { h: 30.8, s: 79.3, l: 73.5, a: 1 },\n dark: { h: 13.1, s: 66.1, l: 23.1, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(30.8, 79.3%, 73.5%), hsl(13.1, 66.1%, 23.1%))\",\n variable: \"var(--kds-border-base-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 112, s: 56.5, l: 71.2, a: 1 },\n dark: { h: 123.7, s: 46.7, l: 20.6, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(112, 56.5%, 71.2%), hsl(123.7, 46.7%, 20.6%))\",\n variable: \"var(--kds-border-base-success)\",\n },\n },\n info: {\n color: {\n light: { h: 214.5, s: 100, l: 84.3, a: 1 },\n dark: { h: 210, s: 50, l: 27.5, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(214.5, 100%, 84.3%), hsl(210, 50%, 27.5%))\",\n variable: \"var(--kds-border-base-info)\",\n },\n },\n },\n \"node-status\": {\n empty: {\n color: {\n light: { h: 0, s: 0, l: 90.2, a: 1 },\n dark: { h: 0, s: 0, l: 32.2, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(0, 0%, 90.2%), hsl(0, 0%, 32.2%))\",\n variable: \"var(--kds-border-node-status-empty)\",\n },\n },\n error: {\n color: {\n light: { h: 348, s: 94.3, l: 20.8, a: 1 },\n dark: { h: 2.6, s: 100, l: 72.4, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(348, 94.3%, 20.8%), hsl(2.6, 100%, 72.4%))\",\n variable: \"var(--kds-border-node-status-error)\",\n },\n },\n warning: {\n color: {\n light: { h: 19, s: 63.1, l: 38.2, a: 1 },\n dark: { h: 49.1, s: 99.1, l: 43.7, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(19, 63.1%, 38.2%), hsl(49.1, 99.1%, 43.7%))\",\n variable: \"var(--kds-border-node-status-warning)\",\n },\n },\n success: {\n color: {\n light: { h: 116.1, s: 46.6, l: 25.7, a: 1 },\n dark: { h: 106.5, s: 42.6, l: 54.9, a: 1 },\n },\n width: { value: 1, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"1px solid light-dark(hsl(116.1, 46.6%, 25.7%), hsl(106.5, 42.6%, 54.9%))\",\n variable: \"var(--kds-border-node-status-success)\",\n },\n },\n },\n ResizeHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.4 },\n dark: { h: 0, s: 0, l: 99, a: 0.4 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.4), hsl(0 0% 99% / 0.4))\",\n variable: \"var(--kds-border-resize-handle-initial)\",\n },\n },\n hover: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.64 },\n dark: { h: 0, s: 0, l: 99, a: 0.58 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.64), hsl(0 0% 99% / 0.58))\",\n variable: \"var(--kds-border-resize-handle-hover)\",\n },\n },\n active: {\n color: {\n light: { h: 0, s: 0, l: 10.2, a: 0.74 },\n dark: { h: 0, s: 0, l: 99, a: 0.68 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid light-dark(hsl(0 0% 10.2% / 0.74), hsl(0 0% 99% / 0.68))\",\n variable: \"var(--kds-border-resize-handle-active)\",\n },\n },\n },\n ColorPickerHandle: {\n initial: {\n color: {\n light: { h: 0, s: 0, l: 99, a: 1 },\n dark: { h: 0, s: 0, l: 99, a: 1 },\n },\n width: { value: 2, unit: \"px\" },\n style: \"solid\",\n css: {\n value: \"2px solid hsl(0, 0%, 99%)\",\n variable: \"var(--kds-border-color-picker-handle-initial)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const dimension = {\n component: {\n height: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-height-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-height-0-25x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-height-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-height-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-height-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-height-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-height-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-height-1-75x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-height-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-height-2-75x)\",\n },\n },\n \"2.5x\": {\n value: 40,\n unit: \"px\",\n css: {\n value: \"40px\",\n variable: \"var(--kds-dimension-component-height-2-5x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-height-4x)\",\n },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: {\n value: \"80px\",\n variable: \"var(--kds-dimension-component-height-5x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-height-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-height-12-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-height-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-height-25x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-height-45x)\",\n },\n },\n },\n width: {\n \"0.125x\": {\n value: 2,\n unit: \"px\",\n css: {\n value: \"2px\",\n variable: \"var(--kds-dimension-component-width-0-125x)\",\n },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-dimension-component-width-0-25x)\",\n },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: {\n value: \"12px\",\n variable: \"var(--kds-dimension-component-width-0-75x)\",\n },\n },\n \"0.88x\": {\n value: 14,\n unit: \"px\",\n css: {\n value: \"14px\",\n variable: \"var(--kds-dimension-component-width-0-88x)\",\n },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: {\n value: \"16px\",\n variable: \"var(--kds-dimension-component-width-1x)\",\n },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: {\n value: \"20px\",\n variable: \"var(--kds-dimension-component-width-1-25x)\",\n },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: {\n value: \"24px\",\n variable: \"var(--kds-dimension-component-width-1-5x)\",\n },\n },\n \"1.75x\": {\n value: 28,\n unit: \"px\",\n css: {\n value: \"28px\",\n variable: \"var(--kds-dimension-component-width-1-75x)\",\n },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: {\n value: \"32px\",\n variable: \"var(--kds-dimension-component-width-2x)\",\n },\n },\n \"2.25x\": {\n value: 36,\n unit: \"px\",\n css: {\n value: \"36px\",\n variable: \"var(--kds-dimension-component-width-2-25x)\",\n },\n },\n \"2.75x\": {\n value: 44,\n unit: \"px\",\n css: {\n value: \"44px\",\n variable: \"var(--kds-dimension-component-width-2-75x)\",\n },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: {\n value: \"64px\",\n variable: \"var(--kds-dimension-component-width-4x)\",\n },\n },\n \"6x\": {\n value: 96,\n unit: \"px\",\n css: {\n value: \"96px\",\n variable: \"var(--kds-dimension-component-width-6x)\",\n },\n },\n \"8x\": {\n value: 128,\n unit: \"px\",\n css: {\n value: \"128px\",\n variable: \"var(--kds-dimension-component-width-8x)\",\n },\n },\n \"12x\": {\n value: 192,\n unit: \"px\",\n css: {\n value: \"192px\",\n variable: \"var(--kds-dimension-component-width-12x)\",\n },\n },\n \"12.5x\": {\n value: 200,\n unit: \"px\",\n css: {\n value: \"200px\",\n variable: \"var(--kds-dimension-component-width-12-5x)\",\n },\n },\n \"16x\": {\n value: 256,\n unit: \"px\",\n css: {\n value: \"256px\",\n variable: \"var(--kds-dimension-component-width-16x)\",\n },\n },\n \"17.5x\": {\n value: 280,\n unit: \"px\",\n css: {\n value: \"280px\",\n variable: \"var(--kds-dimension-component-width-17-5x)\",\n },\n },\n \"20x\": {\n value: 320,\n unit: \"px\",\n css: {\n value: \"320px\",\n variable: \"var(--kds-dimension-component-width-20x)\",\n },\n },\n \"25x\": {\n value: 400,\n unit: \"px\",\n css: {\n value: \"400px\",\n variable: \"var(--kds-dimension-component-width-25x)\",\n },\n },\n \"32x\": {\n value: 512,\n unit: \"px\",\n css: {\n value: \"512px\",\n variable: \"var(--kds-dimension-component-width-32x)\",\n },\n },\n \"35x\": {\n value: 560,\n unit: \"px\",\n css: {\n value: \"560px\",\n variable: \"var(--kds-dimension-component-width-35x)\",\n },\n },\n \"45x\": {\n value: 720,\n unit: \"px\",\n css: {\n value: \"720px\",\n variable: \"var(--kds-dimension-component-width-45x)\",\n },\n },\n \"52.5x\": {\n value: 840,\n unit: \"px\",\n css: {\n value: \"840px\",\n variable: \"var(--kds-dimension-component-width-52-5x)\",\n },\n },\n \"61x\": {\n value: 976,\n unit: \"px\",\n css: {\n value: \"976px\",\n variable: \"var(--kds-dimension-component-width-61x)\",\n },\n },\n },\n },\n icon: {\n \"0.56x\": {\n value: 9,\n unit: \"px\",\n css: { value: \"9px\", variable: \"var(--kds-dimension-icon-0-56x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-dimension-icon-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-dimension-icon-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-dimension-icon-1-25x)\" },\n },\n },\n chart: {\n \"line-width\": {\n value: 1.5,\n unit: \"px\",\n css: {\n value: \"1.5px\",\n variable: \"var(--kds-dimension-chart-line-width)\",\n },\n },\n \"segment-gap\": {\n value: 0.75,\n unit: \"px\",\n css: {\n value: \"0.75px\",\n variable: \"var(--kds-dimension-chart-segment-gap)\",\n },\n },\n },\n};\n","/**\n * Do not edit directly, this file was auto-generated\n * from the design token sources in src/tokens.\n */\nexport const spacing = {\n container: {\n negative: {\n \"0.25x\": {\n value: -4,\n unit: \"px\",\n css: {\n value: \"-4px\",\n variable: \"var(--kds-spacing-container-negative-0-25x)\",\n },\n },\n \"0.375x\": {\n value: -6,\n unit: \"px\",\n css: {\n value: \"-6px\",\n variable: \"var(--kds-spacing-container-negative-0-375x)\",\n },\n },\n \"0.5x\": {\n value: -8,\n unit: \"px\",\n css: {\n value: \"-8px\",\n variable: \"var(--kds-spacing-container-negative-0-5x)\",\n },\n },\n },\n none: {\n value: 0,\n unit: \"px\",\n css: { value: \"0\", variable: \"var(--kds-spacing-container-none)\" },\n },\n \"0.10x\": {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-container-0-10x)\" },\n },\n \"0.12x\": {\n value: 2,\n unit: \"px\",\n css: { value: \"2px\", variable: \"var(--kds-spacing-container-0-12x)\" },\n },\n \"0.25x\": {\n value: 4,\n unit: \"px\",\n css: { value: \"4px\", variable: \"var(--kds-spacing-container-0-25x)\" },\n },\n \"0.37x\": {\n value: 6,\n unit: \"px\",\n css: { value: \"6px\", variable: \"var(--kds-spacing-container-0-37x)\" },\n },\n \"0.5x\": {\n value: 8,\n unit: \"px\",\n css: { value: \"8px\", variable: \"var(--kds-spacing-container-0-5x)\" },\n },\n \"0.75x\": {\n value: 12,\n unit: \"px\",\n css: { value: \"12px\", variable: \"var(--kds-spacing-container-0-75x)\" },\n },\n \"1x\": {\n value: 16,\n unit: \"px\",\n css: { value: \"16px\", variable: \"var(--kds-spacing-container-1x)\" },\n },\n \"1.25x\": {\n value: 20,\n unit: \"px\",\n css: { value: \"20px\", variable: \"var(--kds-spacing-container-1-25x)\" },\n },\n \"1.5x\": {\n value: 24,\n unit: \"px\",\n css: { value: \"24px\", variable: \"var(--kds-spacing-container-1-5x)\" },\n },\n \"2x\": {\n value: 32,\n unit: \"px\",\n css: { value: \"32px\", variable: \"var(--kds-spacing-container-2x)\" },\n },\n \"3x\": {\n value: 48,\n unit: \"px\",\n css: { value: \"48px\", variable: \"var(--kds-spacing-container-3x)\" },\n },\n \"4x\": {\n value: 64,\n unit: \"px\",\n css: { value: \"64px\", variable: \"var(--kds-spacing-container-4x)\" },\n },\n \"5x\": {\n value: 80,\n unit: \"px\",\n css: { value: \"80px\", variable: \"var(--kds-spacing-container-5x)\" },\n },\n },\n offset: {\n focus: {\n value: 1,\n unit: \"px\",\n css: { value: \"1px\", variable: \"var(--kds-spacing-offset-focus)\" },\n },\n },\n inputLabel: {\n \"spacing-bottom\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-input-label-spacing-bottom)\",\n },\n },\n },\n SubText: {\n \"spacing-top\": {\n value: 4,\n unit: \"px\",\n css: {\n value: \"4px\",\n variable: \"var(--kds-spacing-sub-text-spacing-top)\",\n },\n },\n },\n};\n","import { border, dimension, spacing } from \"@knime/kds-styles/tokens\";\n\n// The parts a column header's minimum width is made of: its horizontal\n// padding, the action buttons it shows, and the gap between them. See\n// {@link minColumnSize}.\nconst HEADER_HORIZONTAL_PADDING =\n spacing.container[\"0.5x\"].value + spacing.container[\"0.37x\"].value;\nconst HEADER_ACTION_BUTTON_GAP = spacing.container[\"0.12x\"].value;\nconst HEADER_ACTION_BUTTON_WIDTH = dimension.component.width[\"1.5x\"].value;\n// Wider than the others, since it is permanently visible (see HeaderCell.vue).\nconst DELETE_COLUMN_BUTTON_WIDTH = dimension.component.width[\"2x\"].value;\n\n// the min-width of cells in the header and rows, no matter what the header of\n// the column holds\nexport const MIN_COLUMN_SIZE = 50;\n\n/**\n * The min-width of a column whose header shows the given action buttons, i.e.\n * the width at which its name has truncated away entirely but the buttons\n * still fit. Never below {@link MIN_COLUMN_SIZE}. Enforced on the column size\n * shared with the row cells rather than as a header-only CSS min-width, which\n * would desync the header cell's width from its column's and shift later\n * columns out of alignment.\n */\nexport const minColumnSize = ({\n menuButton = false,\n sortButton = false,\n deleteButton = false,\n}: {\n menuButton?: boolean;\n sortButton?: boolean;\n deleteButton?: boolean;\n}) => {\n const buttonWidths = [\n ...(menuButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(sortButton ? [HEADER_ACTION_BUTTON_WIDTH] : []),\n ...(deleteButton ? [DELETE_COLUMN_BUTTON_WIDTH] : []),\n ];\n const gaps = Math.max(buttonWidths.length - 1, 0) * HEADER_ACTION_BUTTON_GAP;\n return Math.max(\n MIN_COLUMN_SIZE,\n HEADER_HORIZONTAL_PADDING +\n buttonWidths.reduce((total, width) => total + width, 0) +\n gaps,\n );\n};\n\n// the max-width of cells in the header and rows when using fit content column sizing\nexport const MAX_AUTO_COLUMN_SIZE = 960;\n\n// the width of special (collapser, selection, filter) columns in the header and rows\nexport const SPECIAL_COLUMNS_SIZE = dimension.component.width[\"2x\"].value;\n\n// the bottom border width of any given row\nexport const ROW_BORDER_BOTTOM_WIDTH = border.base.subtle.width.value;\n\n// the default height of a row, including its bottom border\nexport const DEFAULT_ROW_HEIGHT =\n dimension.component.height[\"2.5x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the compact height of a row, including its bottom border\nexport const COMPACT_ROW_HEIGHT =\n dimension.component.height[\"1.75x\"].value + ROW_BORDER_BOTTOM_WIDTH;\n\n// the default top/bottom padding of a row (kds.spacing.container.0_75x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const DEFAULT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.75x\"].value;\n\n// the compact top/bottom padding of a row (kds.spacing.container.0_37x)\n// Note that this is not arbitrary, but leads to remaining space of 1x which aligns with\n// the typography which uses 0.75x font size and 130% line height\n// (so we are just off by 0.025x which we accept since all of this is only important for\n// the centered-ness of content in the cell and not for exact measurements)\nexport const COMPACT_ROW_PADDING_TOP_BOTTOM = spacing.container[\"0.37x\"].value;\n\n// the default horizontal padding of a table cell (kds.spacing.container.0_5x)\nexport const CELL_PADDING_HORIZONTAL = spacing.container[\"0.5x\"].value;\n\n// the minimum height of a row\nexport const MIN_ROW_HEIGHT = COMPACT_ROW_HEIGHT;\n\n// the height of the table header and group headers\nexport const HEADER_HEIGHT =\n dimension.component.height[\"2.5x\"].value + 2 * ROW_BORDER_BOTTOM_WIDTH;\n\n// the maximum width of the submenu in the header\nexport const MAX_SUB_MENU_WIDTH = 160;\n\n// after resizing rows, scroll is temporarily disabled until the resize is complete to prevent jumps\nexport const ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY = 100;\n\n// the width of the column resize drag handle\nexport const COLUMN_RESIZE_DRAG_HANDLE_WIDTH = 5;\n\n// the width of the cell expand button\nexport const EXPAND_BUTTON_WIDTH = dimension.component.width[\"1x\"].value;\n\nexport default {\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n MIN_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n COMPACT_ROW_HEIGHT,\n CELL_PADDING_HORIZONTAL,\n};\n","import type { PropType } from \"vue\";\n\n/**\n * Background-color tokens the table can be rendered on top of. Used to match\n * the table header's background to the surface surrounding the table.\n */\nexport const BACKGROUND_COLORS = [\n \"page-default\",\n \"surface-default\",\n \"surface-muted\",\n \"surface-subtle\",\n] as const;\n\nexport type BackgroundColor = (typeof BACKGROUND_COLORS)[number];\n\n/**\n * Shared Vue prop options for `renderedOnBackgroundColor`, used by every\n * component that exposes it. The `validator` guards the runtime value for\n * plain-JS callers that bypass the `BackgroundColor` type at compile time.\n */\nexport const renderedOnBackgroundColorProp = {\n type: String as PropType<BackgroundColor>,\n default: \"page-default\" as BackgroundColor,\n validator: (value: string) =>\n (BACKGROUND_COLORS as readonly string[]).includes(value),\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { ColumnConfig } from \"..\";\n\nconst isNonEmptyObject = (val: any) =>\n val !== null &&\n typeof val === \"object\" &&\n Object.getOwnPropertyNames(val).length > 0;\n\nconst isObjectRepresentation = (\n val: any,\n): val is { value?: any; color?: string; metadata?: string } => {\n const possibleKeys = [\"value\", \"metadata\", \"color\"];\n return (\n isNonEmptyObject(val) &&\n Object.getOwnPropertyNames(val).every((key) => possibleKeys.includes(key))\n );\n};\n\nexport const unpackObjectRepresentation = (val: any) => {\n if (isObjectRepresentation(val)) {\n if (val.hasOwnProperty(\"metadata\") && !val.hasOwnProperty(\"value\")) {\n return null;\n }\n return val.value;\n }\n return val;\n};\n\nexport const getColor = (val: any) => {\n if (isObjectRepresentation(val) && val.hasOwnProperty(\"color\")) {\n const color = val.color;\n return typeof color === \"undefined\" ? null : color;\n }\n return null;\n};\n\nexport const isMissingValue = (val: any): val is { metadata: string } | null =>\n val === null ||\n (isObjectRepresentation(val) && val?.hasOwnProperty(\"metadata\"));\n\nexport const getMissingValueMessage = (\n cellData: { metadata: string } | null,\n) => {\n const metadata = cellData?.metadata;\n const missingValueMsg = typeof metadata === \"string\" ? ` (${metadata})` : \"\";\n return `Missing Value${missingValueMsg}`;\n};\n\nexport const isEmpty = (val: any): val is { value: undefined } | undefined =>\n typeof unpackObjectRepresentation(val) === \"undefined\";\n\nexport const getPropertiesFromColumns = <T extends keyof ColumnConfig>(\n columnConfigs: ColumnConfig[],\n key: T,\n): Array<ColumnConfig[T]> => columnConfigs.map((colConfig) => colConfig[key]);\n","var $ = Object.defineProperty;\nvar P = (t, e, r) => e in t ? $(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;\nvar u = (t, e, r) => P(t, typeof e != \"symbol\" ? e + \"\" : e, r);\nimport { getCurrentScope as W, onScopeDispose as E, unref as s, computed as h, watch as y, ref as g, getCurrentInstance as V, onMounted as D, watchEffect as N, isRef as R } from \"vue\";\nfunction C(t) {\n return W() ? (E(t), !0) : !1;\n}\nfunction F(t) {\n return typeof t == \"function\" ? t() : s(t);\n}\nconst G = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nfunction T(t) {\n var e;\n const r = F(t);\n return (e = r == null ? void 0 : r.$el) != null ? e : r;\n}\nconst j = G ? window : void 0;\nfunction q() {\n const t = g(!1);\n return V() && D(() => {\n t.value = !0;\n }), t;\n}\nfunction _(t) {\n const e = q();\n return h(() => (e.value, !!t()));\n}\nfunction B(t, e, r = {}) {\n const { window: n = j, ...c } = r;\n let o;\n const f = _(() => n && \"ResizeObserver\" in n), i = () => {\n o && (o.disconnect(), o = void 0);\n }, d = h(() => Array.isArray(t) ? t.map((m) => T(m)) : [T(t)]), l = y(\n d,\n (m) => {\n if (i(), f.value && n) {\n o = new ResizeObserver(e);\n for (const v of m)\n v && o.observe(v, c);\n }\n },\n { immediate: !0, flush: \"post\", deep: !0 }\n ), p = () => {\n i(), l();\n };\n return C(p), {\n isSupported: f,\n stop: p\n };\n}\nfunction H(t) {\n return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, \"default\") ? t.default : t;\n}\nvar J = function(e) {\n var r = null, n, c = function(i) {\n return function() {\n r = null, e.apply(i, n);\n };\n }, o = function() {\n for (var i = arguments.length, d = new Array(i), l = 0; l < i; l++)\n d[l] = arguments[l];\n n = d, r === null && (r = requestAnimationFrame(c(this)));\n };\n return o.cancel = function() {\n cancelAnimationFrame(r), r = null;\n }, o;\n}, K = J;\nconst Q = /* @__PURE__ */ H(K), X = 500, L = ({\n sizeManager: t,\n buffer: e = X\n}, r = \"vertical\", n = null) => {\n const o = g({ scrollStart: 0, scrollEnd: 0 }), f = r === \"vertical\", i = n ?? g(null), d = Q(() => {\n if (!i.value)\n return;\n const { scrollTop: a, scrollLeft: S, offsetHeight: w, offsetWidth: O } = i.value, I = f ? a : S, U = f ? w : O;\n o.value = { scrollStart: I, scrollEnd: I + U };\n });\n t.onUpdate(d), n || B(i, d);\n let l = null;\n const p = h(() => {\n const a = t.toIndex(o.value.scrollStart - e), S = Math.min(\n t.toIndex(o.value.scrollEnd + e) + 1,\n t.getNumItems()\n );\n return l && l.startIndex === a && l.endIndex === S || (l = { startIndex: a, endIndex: S, toArray: () => Array.from({ length: S - a }, (O, I) => a + I) }), l;\n }), m = h(() => t.toOffset(p.value.startIndex)), v = h(() => t.getTotalSize()), x = `--virtual-scroller-${r}-offset`, A = `--virtual-scroller-${r}-total-size`;\n N(() => {\n const a = i.value;\n a && (a.style.setProperty(x, `${m.value}px`), a.style.setProperty(A, `${v.value}px`));\n });\n const M = {\n [`padding${f ? \"Top\" : \"Left\"}`]: `var(${x})`,\n [f ? \"height\" : \"width\"]: `var(${A})`,\n /**\n * Since the height of the element should not be influenced by its padding.\n * An alternative without box-sizing: \"border-box\" would be to use margins instead\n * paddings, but then it is no longer easily possible to absolutely position\n * other elements (e.g. a cell selection overlay) inside this element.\n */\n boxSizing: \"border-box\"\n };\n return {\n containerProps: {\n ref: i,\n onScroll: d\n },\n indices: p,\n scrolledAreaStyles: M\n };\n}, te = (t) => {\n const e = g(null), r = L(t.rows, \"vertical\", e), n = L(t.columns, \"horizontal\", e), c = () => {\n r.containerProps.onScroll(), n.containerProps.onScroll();\n };\n return B(e, c), {\n containerProps: {\n ref: e,\n onScroll: c\n },\n scrolledAreaStyles: {\n vertical: r.scrolledAreaStyles,\n horizontal: n.scrolledAreaStyles\n },\n indices: {\n vertical: r.indices,\n horizontal: n.indices\n }\n };\n}, z = (t, e) => R(t) && y(() => t.value, e), Y = (t, e) => Math.floor(t / e);\nclass re {\n constructor(e, r) {\n u(this, \"numItems\");\n u(this, \"size\");\n this.numItems = e, this.size = r;\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n z(this.numItems, e), z(this.size, e);\n }\n toOffset(e) {\n return e * s(this.size);\n }\n getTotalSize() {\n return s(this.numItems) * s(this.size);\n }\n toIndex(e) {\n return Math.max(\n Math.min(\n Y(e, s(this.size)),\n s(this.numItems) - 1\n ),\n 0\n );\n }\n}\nclass Z {\n constructor(e) {\n u(this, \"isLeft\");\n this.isLeft = e;\n }\n getLastLeftIndex(e, r = 0) {\n if (e - r <= 1)\n return this.isLeft(e) ? e : r;\n const n = Math.floor((e + r) / 2);\n return this.isLeft(n) ? this.getLastLeftIndex(e, n) : this.getLastLeftIndex(n, r);\n }\n}\nclass ne {\n constructor(e) {\n u(this, \"numItems\");\n u(this, \"accumulatedSizes\");\n this.numItems = h(() => s(e).length), this.accumulatedSizes = h(() => {\n const r = [0];\n for (let n = 0; n < s(e).length; n++)\n r.push(r[n] + s(e)[n]);\n return r;\n });\n }\n getNumItems() {\n return s(this.numItems);\n }\n onUpdate(e) {\n y([this.accumulatedSizes], e);\n }\n toOffset(e) {\n return this.accumulatedSizes.value[e];\n }\n getTotalSize() {\n return this.accumulatedSizes.value[s(this.numItems)];\n }\n toIndex(e) {\n return e < 0 ? 0 : new Z((n) => this.toOffset(n) <= e).getLastLeftIndex(s(this.numItems) - 1);\n }\n}\nclass b {\n constructor(e) {\n u(this, \"delegate\");\n this.delegate = e;\n }\n getTotalSize() {\n return this.delegate.getTotalSize();\n }\n toIndex(e) {\n return this.delegate.toIndex(e);\n }\n getNumItems() {\n return this.delegate.getNumItems();\n }\n toOffset(e) {\n return this.delegate.toOffset(e);\n }\n onUpdate(e) {\n this.delegate.onUpdate(e);\n }\n}\nclass se extends b {\n constructor({\n spaceBefore: r,\n spaceBeforeIsOffset: n\n }, c) {\n super(c);\n u(this, \"spaceBefore\");\n u(this, \"spaceBeforeIsOffset\");\n this.spaceBefore = r, this.spaceBeforeIsOffset = n;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceBefore, r);\n }\n toOffset(r) {\n return (this.spaceBeforeIsOffset ? s(this.spaceBefore) : 0) + super.toOffset(r);\n }\n getTotalSize() {\n return s(this.spaceBefore) + super.getTotalSize();\n }\n toIndex(r) {\n return super.toIndex(r - s(this.spaceBefore));\n }\n}\nclass oe extends b {\n constructor(r, n) {\n super(n);\n u(this, \"spaceAfter\");\n this.spaceAfter = r;\n }\n onUpdate(r) {\n super.onUpdate(r), z(this.spaceAfter, r);\n }\n getTotalSize() {\n return super.getTotalSize() + s(this.spaceAfter);\n }\n}\nexport {\n ne as ArraySizeManager,\n re as SameSizeManager,\n oe as WithSpaceAfter,\n se as WithSpaceBefore,\n te as useVirtualGrid,\n L as useVirtualLine\n};\n","/*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */\n\nfunction _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nfunction _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nfunction _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = true,\n o = false;\n try {\n if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = true, n = r;\n } finally {\n try {\n if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nfunction _slicedToArray(r, e) {\n return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();\n}\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return _arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;\n }\n}\n\nconst entries = Object.entries,\n setPrototypeOf = Object.setPrototypeOf,\n isFrozen = Object.isFrozen,\n getPrototypeOf = Object.getPrototypeOf,\n getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nlet freeze = Object.freeze,\n seal = Object.seal,\n create = Object.create; // eslint-disable-line import/no-mutable-exports\nlet _ref = typeof Reflect !== 'undefined' && Reflect,\n apply = _ref.apply,\n construct = _ref.construct;\nif (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n}\nif (!seal) {\n seal = function seal(x) {\n return x;\n };\n}\nif (!apply) {\n apply = function apply(func, thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n return func.apply(thisArg, args);\n };\n}\nif (!construct) {\n construct = function construct(Func) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n return new Func(...args);\n };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst arraySplice = unapply(Array.prototype.splice);\nconst arrayIsArray = Array.isArray;\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst numberToString = unapply(Number.prototype.toString);\nconst booleanToString = unapply(Boolean.prototype.toString);\nconst bigintToString = typeof BigInt === 'undefined' ? null : unapply(BigInt.prototype.toString);\nconst symbolToString = typeof Symbol === 'undefined' ? null : unapply(Symbol.prototype.toString);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst objectToString = unapply(Object.prototype.toString);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n return function (thisArg) {\n if (thisArg instanceof RegExp) {\n thisArg.lastIndex = 0;\n }\n for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n args[_key3 - 1] = arguments[_key3];\n }\n return apply(func, thisArg, args);\n };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(Func) {\n return function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n return construct(Func, args);\n };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n if (!arrayIsArray(array)) {\n return set;\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n const newObject = create(null);\n for (const _ref2 of entries(object)) {\n var _ref3 = _slicedToArray(_ref2, 2);\n const property = _ref3[0];\n const value = _ref3[1];\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (arrayIsArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n}\n/**\n * Convert non-node values into strings without depending on direct property access.\n *\n * @param value - The value to stringify.\n * @returns A string representation of the provided value.\n */\nfunction stringifyValue(value) {\n switch (typeof value) {\n case 'string':\n {\n return value;\n }\n case 'number':\n {\n return numberToString(value);\n }\n case 'boolean':\n {\n return booleanToString(value);\n }\n case 'bigint':\n {\n return bigintToString ? bigintToString(value) : '0';\n }\n case 'symbol':\n {\n return symbolToString ? symbolToString(value) : 'Symbol()';\n }\n case 'undefined':\n {\n return objectToString(value);\n }\n case 'function':\n case 'object':\n {\n if (value === null) {\n return objectToString(value);\n }\n const valueAsRecord = value;\n const valueToString = lookupGetter(valueAsRecord, 'toString');\n if (typeof valueToString === 'function') {\n const stringified = valueToString(valueAsRecord);\n return typeof stringified === 'string' ? stringified : objectToString(stringified);\n }\n return objectToString(value);\n }\n default:\n {\n return objectToString(value);\n }\n }\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n}\nfunction isRegex(value) {\n try {\n regExpTest(value, '');\n return true;\n } catch (_unused) {\n return false;\n }\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'search', 'section', 'select', 'shadow', 'slot', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'enterkeyhint', 'exportparts', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'inputmode', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'part', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'command', 'commandfor', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'exportparts', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inert', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'part', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dominant-baseline', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'mask-type', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-orientation', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lquote', 'lspace', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\nconst MUSTACHE_EXPR = seal(/{{[\\w\\W]*|^[\\w\\W]*}}/g);\nconst ERB_EXPR = seal(/<%[\\w\\W]*|^[\\w\\W]*%>/g);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*/g);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]+$/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n// Markup-significant character probes used by _sanitizeElements.\n// Shared module-level instances are safe despite the sticky /g flags:\n// unapply() resets lastIndex for RegExp receivers before every call.\nconst ELEMENT_MARKUP_PROBE = seal(/<[/\\w!]/g);\nconst COMMENT_MARKUP_PROBE = seal(/<[/\\w]/g);\nconst FALLBACK_TAG_CLOSE = seal(/<\\/no(script|embed|frames)/i);\nconst SELF_CLOSING_TAG = seal(/\\/>/i);\n\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n processingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n};\nconst _createHooksMap = function _createHooksMap() {\n return {\n afterSanitizeAttributes: [],\n afterSanitizeElements: [],\n afterSanitizeShadowDOM: [],\n beforeSanitizeAttributes: [],\n beforeSanitizeElements: [],\n beforeSanitizeShadowDOM: [],\n uponSanitizeAttribute: [],\n uponSanitizeElement: [],\n uponSanitizeShadowNode: []\n };\n};\n/**\n * Resolve a set-valued configuration option: a fresh set built from\n * cfg[key] when it is an own array property (seeded with a clone of\n * options.base when given, case-normalized via options.transform),\n * the fallback set otherwise.\n *\n * @param cfg the cloned, prototype-free configuration object\n * @param key the configuration property to read\n * @param fallback the set to use when the option is absent or not an array\n * @param options transform and optional base set to merge into\n * @returns the resolved set\n */\nconst _resolveSetOption = function _resolveSetOption(cfg, key, fallback, options) {\n return objectHasOwnProperty(cfg, key) && arrayIsArray(cfg[key]) ? addToSet(options.base ? clone(options.base) : {}, cfg[key], options.transform) : fallback;\n};\nfunction createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n DOMPurify.version = '3.4.13';\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let document = window.document;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n window.DocumentFragment;\n const HTMLTemplateElement = window.HTMLTemplateElement,\n Node = window.Node,\n Element = window.Element,\n NodeFilter = window.NodeFilter,\n _window$NamedNodeMap = window.NamedNodeMap;\n _window$NamedNodeMap === void 0 ? window.NamedNodeMap || window.MozNamedAttrMap : _window$NamedNodeMap;\n window.HTMLFormElement;\n const DOMParser = window.DOMParser,\n trustedTypes = window.trustedTypes;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const remove = lookupGetter(ElementPrototype, 'remove');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n const getShadowRoot = lookupGetter(ElementPrototype, 'shadowRoot');\n const getAttributes = lookupGetter(ElementPrototype, 'attributes');\n const getNodeType = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeType') : null;\n const getNodeName = Node && Node.prototype ? lookupGetter(Node.prototype, 'nodeName') : null;\n const getOwnerDocument = Node && Node.prototype ? lookupGetter(Node.prototype, 'ownerDocument') : null;\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n // The instance's own internal Trusted Types policy. Unlike a caller-supplied\n // `TRUSTED_TYPES_POLICY`, this is created at most once — Trusted Types throws\n // on duplicate policy names — and is the only policy allowed to persist\n // across configurations and survive `clearConfig()`.\n let defaultTrustedTypesPolicy;\n let defaultTrustedTypesPolicyResolved = false;\n // Tracks whether we are already inside a call to the configured Trusted Types\n // policy (`createHTML` or `createScriptURL`). If a supplied policy callback\n // itself calls `DOMPurify.sanitize` (the cause of #1422), `sanitize` would\n // re-enter the policy and recurse until the stack overflows. We detect that\n // re-entry and throw a clear, actionable error instead. The guard is shared\n // across both callbacks, because either one re-entering `sanitize` triggers\n // the same unbounded recursion.\n let IN_TRUSTED_TYPES_POLICY = 0;\n const _assertNotInTrustedTypesPolicy = function _assertNotInTrustedTypesPolicy() {\n if (IN_TRUSTED_TYPES_POLICY > 0) {\n throw typeErrorCreate('A configured TRUSTED_TYPES_POLICY callback (createHTML or ' + 'createScriptURL) must not call DOMPurify.sanitize, as that causes ' + 'infinite recursion. Do not pass a policy whose callbacks wrap ' + 'DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted ' + 'Types\" section of the README.');\n }\n };\n const _createTrustedHTML = function _createTrustedHTML(html) {\n _assertNotInTrustedTypesPolicy();\n IN_TRUSTED_TYPES_POLICY++;\n try {\n return trustedTypesPolicy.createHTML(html);\n } finally {\n IN_TRUSTED_TYPES_POLICY--;\n }\n };\n const _createTrustedScriptURL = function _createTrustedScriptURL(scriptUrl) {\n _assertNotInTrustedTypesPolicy();\n IN_TRUSTED_TYPES_POLICY++;\n try {\n return trustedTypesPolicy.createScriptURL(scriptUrl);\n } finally {\n IN_TRUSTED_TYPES_POLICY--;\n }\n };\n // Lazily resolve (and cache) the instance's internal default policy.\n // Resolution is attempted at most once: a successful `createPolicy` cannot be\n // repeated (Trusted Types throws on duplicate names), and a failed or\n // unsupported attempt must not be retried on every parse.\n const _getDefaultTrustedTypesPolicy = function _getDefaultTrustedTypesPolicy() {\n if (!defaultTrustedTypesPolicyResolved) {\n defaultTrustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n defaultTrustedTypesPolicyResolved = true;\n }\n return defaultTrustedTypesPolicy;\n };\n const _document = document,\n implementation = _document.implementation,\n createNodeIterator = _document.createNodeIterator,\n createDocumentFragment = _document.createDocumentFragment,\n getElementsByTagName = _document.getElementsByTagName;\n const importNode = originalDocument.importNode;\n let hooks = _createHooksMap();\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const MUSTACHE_EXPR$1 = MUSTACHE_EXPR,\n ERB_EXPR$1 = ERB_EXPR,\n TMPLIT_EXPR$1 = TMPLIT_EXPR,\n DATA_ATTR$1 = DATA_ATTR,\n ARIA_ATTR$1 = ARIA_ATTR,\n IS_SCRIPT_OR_DATA$1 = IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE$1 = ATTR_WHITESPACE,\n CUSTOM_ELEMENT$1 = CUSTOM_ELEMENT;\n let IS_ALLOWED_URI$1 = IS_ALLOWED_URI;\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n /*\n * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n /* Config object to store ADD_TAGS/ADD_ATTR functions (when used as functions) */\n const EXTRA_ELEMENT_HANDLING = Object.seal(create(null, {\n tagCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n }\n }));\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n /* Pristine allowlist bindings captured at setConfig() time. On the\n * persistent-config path sanitize() restores the sets from these before\n * the per-walk hook clone-guard, so a hook's in-call widening cannot\n * carry across calls. Null until setConfig() is called; reset by\n * clearConfig(). */\n let SET_CONFIG_ALLOWED_TAGS = null;\n let SET_CONFIG_ALLOWED_ATTR = null;\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script',\n // <selectedcontent> mirrors the selected <option>'s subtree, cloned by\n // the UA (customizable <select>) — including any on* handlers — and the\n // engine re-mirrors synchronously whenever a removal changes which\n // option/selectedcontent is current, even inside DOMPurify's inert\n // DOMParser document. Hoisting its children on removal re-inserts a fresh\n // mirror target ahead of the walk, which the engine refills, looping\n // forever (DoS) and amplifying output. Dropping its content on removal\n // (rather than hoisting) breaks that cascade; the content is a duplicate\n // of the option, which is sanitized on its own. See campaign-3 F1/F6.\n 'selectedcontent', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n const DEFAULT_MATHML_TEXT_INTEGRATION_POINTS = freeze(['mi', 'mo', 'mn', 'ms', 'mtext']);\n let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS);\n const DEFAULT_HTML_INTEGRATION_POINTS = freeze(['annotation-xml']);\n let HTML_INTEGRATION_POINTS = addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS);\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n /**\n * _parseConfig\n *\n * @param cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n /* Set configuration parameters */\n ALLOWED_TAGS = _resolveSetOption(cfg, 'ALLOWED_TAGS', DEFAULT_ALLOWED_TAGS, {\n transform: transformCaseFunc\n });\n ALLOWED_ATTR = _resolveSetOption(cfg, 'ALLOWED_ATTR', DEFAULT_ALLOWED_ATTR, {\n transform: transformCaseFunc\n });\n ALLOWED_NAMESPACES = _resolveSetOption(cfg, 'ALLOWED_NAMESPACES', DEFAULT_ALLOWED_NAMESPACES, {\n transform: stringToString\n });\n URI_SAFE_ATTRIBUTES = _resolveSetOption(cfg, 'ADD_URI_SAFE_ATTR', DEFAULT_URI_SAFE_ATTRIBUTES, {\n transform: transformCaseFunc,\n base: DEFAULT_URI_SAFE_ATTRIBUTES\n });\n DATA_URI_TAGS = _resolveSetOption(cfg, 'ADD_DATA_URI_TAGS', DEFAULT_DATA_URI_TAGS, {\n transform: transformCaseFunc,\n base: DEFAULT_DATA_URI_TAGS\n });\n FORBID_CONTENTS = _resolveSetOption(cfg, 'FORBID_CONTENTS', DEFAULT_FORBID_CONTENTS, {\n transform: transformCaseFunc\n });\n FORBID_TAGS = _resolveSetOption(cfg, 'FORBID_TAGS', clone({}), {\n transform: transformCaseFunc\n });\n FORBID_ATTR = _resolveSetOption(cfg, 'FORBID_ATTR', clone({}), {\n transform: transformCaseFunc\n });\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES && typeof cfg.USE_PROFILES === 'object' ? clone(cfg.USE_PROFILES) : cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = isRegex(cfg.ALLOWED_URI_REGEXP) ? cfg.ALLOWED_URI_REGEXP : IS_ALLOWED_URI; // Default regexp\n NAMESPACE = typeof cfg.NAMESPACE === 'string' ? cfg.NAMESPACE : HTML_NAMESPACE; // Default HTML namespace\n MATHML_TEXT_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'MATHML_TEXT_INTEGRATION_POINTS') && cfg.MATHML_TEXT_INTEGRATION_POINTS && typeof cfg.MATHML_TEXT_INTEGRATION_POINTS === 'object' ? clone(cfg.MATHML_TEXT_INTEGRATION_POINTS) : addToSet({}, DEFAULT_MATHML_TEXT_INTEGRATION_POINTS); // Default built-in map\n HTML_INTEGRATION_POINTS = objectHasOwnProperty(cfg, 'HTML_INTEGRATION_POINTS') && cfg.HTML_INTEGRATION_POINTS && typeof cfg.HTML_INTEGRATION_POINTS === 'object' ? clone(cfg.HTML_INTEGRATION_POINTS) : addToSet({}, DEFAULT_HTML_INTEGRATION_POINTS); // Default built-in map\n const customElementHandling = objectHasOwnProperty(cfg, 'CUSTOM_ELEMENT_HANDLING') && cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING === 'object' ? clone(cfg.CUSTOM_ELEMENT_HANDLING) : create(null);\n CUSTOM_ELEMENT_HANDLING = create(null);\n if (objectHasOwnProperty(customElementHandling, 'tagNameCheck') && isRegexOrFunction(customElementHandling.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = customElementHandling.tagNameCheck; // Default undefined\n }\n if (objectHasOwnProperty(customElementHandling, 'attributeNameCheck') && isRegexOrFunction(customElementHandling.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = customElementHandling.attributeNameCheck; // Default undefined\n }\n if (objectHasOwnProperty(customElementHandling, 'allowCustomizedBuiltInElements') && typeof customElementHandling.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = customElementHandling.allowCustomizedBuiltInElements; // Default undefined\n }\n seal(CUSTOM_ELEMENT_HANDLING);\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = create(null);\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n /* Always reset function-based ADD_TAGS / ADD_ATTR checks to prevent\n * leaking across calls when switching from function to array config */\n EXTRA_ELEMENT_HANDLING.tagCheck = null;\n EXTRA_ELEMENT_HANDLING.attributeCheck = null;\n /* Merge configuration parameters */\n if (objectHasOwnProperty(cfg, 'ADD_TAGS')) {\n if (typeof cfg.ADD_TAGS === 'function') {\n EXTRA_ELEMENT_HANDLING.tagCheck = cfg.ADD_TAGS;\n } else if (arrayIsArray(cfg.ADD_TAGS)) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n }\n if (objectHasOwnProperty(cfg, 'ADD_ATTR')) {\n if (typeof cfg.ADD_ATTR === 'function') {\n EXTRA_ELEMENT_HANDLING.attributeCheck = cfg.ADD_ATTR;\n } else if (arrayIsArray(cfg.ADD_ATTR)) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n }\n if (objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') && arrayIsArray(cfg.ADD_URI_SAFE_ATTR)) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (objectHasOwnProperty(cfg, 'FORBID_CONTENTS') && arrayIsArray(cfg.FORBID_CONTENTS)) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n if (objectHasOwnProperty(cfg, 'ADD_FORBID_CONTENTS') && arrayIsArray(cfg.ADD_FORBID_CONTENTS)) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.ADD_FORBID_CONTENTS, transformCaseFunc);\n }\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n // Re-derive the active Trusted Types policy from this configuration on\n // every parse. The active policy must never be sticky closure state that\n // outlives the config that set it: a caller-supplied policy left in place\n // after `clearConfig()` — or after a later call that supplied none, or\n // `TRUSTED_TYPES_POLICY: null` — could sign a subsequent \"default\"\n // `RETURN_TRUSTED_TYPE` result with a foreign, possibly unsafe policy.\n // See GHSA-vxr8-fq34-vvx9.\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n // A caller-supplied policy applies to this configuration only.\n const previousTrustedTypesPolicy = trustedTypesPolicy;\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n // Sign local variables required by `sanitize`. If the supplied policy's\n // `createHTML` is circular (i.e. it calls `DOMPurify.sanitize`), this\n // throws via the re-entrancy guard. Restore the previous policy first so\n // the instance is not left in a poisoned state. See #1422.\n try {\n emptyHTML = _createTrustedHTML('');\n } catch (error) {\n trustedTypesPolicy = previousTrustedTypesPolicy;\n throw error;\n }\n } else if (cfg.TRUSTED_TYPES_POLICY === null) {\n // Explicit opt-out for this call: perform no Trusted Types signing and\n // create nothing (so a strict `trusted-types` CSP that disallows a\n // `dompurify` policy can still call `sanitize` from inside its own\n // policy — see #1422). Resetting to `undefined` rather than a sticky\n // `null` also drops any previously retained caller policy, so it cannot\n // resurface on a later call, while still allowing the next config-less\n // call to restore the internal default policy. See GHSA-vxr8-fq34-vvx9.\n trustedTypesPolicy = undefined;\n emptyHTML = '';\n } else {\n // No policy supplied: keep the currently active policy if one is set — a\n // previously supplied policy is intentionally sticky across config-less\n // calls — otherwise fall back to the instance's own internal policy,\n // created at most once. (A policy supplied for a *single* call still\n // lingers by design; what must not linger is a policy whose configuration\n // has been torn down via `clearConfig()`, which restores the default.)\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _getDefaultTrustedTypesPolicy();\n }\n // Sign internal variables only when a policy is active. A falsy policy\n // (Trusted Types unsupported, creation failed, or an explicit opt-out)\n // leaves `emptyHTML` as a plain string, so we never call `.createHTML` on\n // a non-policy and throw. See #1422.\n if (trustedTypesPolicy && typeof emptyHTML === 'string') {\n emptyHTML = _createTrustedHTML('');\n }\n }\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n /**\n * Namespace rules for an element in the SVG namespace.\n *\n * @param tagName the element's lowercase tag name\n * @param parent the (possibly simulated) parent node\n * @param parentTagName the parent's lowercase tag name\n * @returns true if a spec-compliant parser could produce this element\n */\n const _checkSvgNamespace = function _checkSvgNamespace(tagName, parent, parentTagName) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n // The only way to switch from MathML to SVG is via <svg>\n // if the parent is either <annotation-xml> or a MathML\n // text integration point.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n };\n /**\n * Namespace rules for an element in the MathML namespace.\n *\n * @param tagName the element's lowercase tag name\n * @param parent the (possibly simulated) parent node\n * @param parentTagName the parent's lowercase tag name\n * @returns true if a spec-compliant parser could produce this element\n */\n const _checkMathMlNamespace = function _checkMathMlNamespace(tagName, parent, parentTagName) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n };\n /**\n * Namespace rules for an element in the HTML namespace.\n *\n * @param tagName the element's lowercase tag name\n * @param parent the (possibly simulated) parent node\n * @param parentTagName the parent's lowercase tag name\n * @returns true if a spec-compliant parser could produce this element\n */\n const _checkHtmlNamespace = function _checkHtmlNamespace(tagName, parent, parentTagName) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n };\n /**\n * @param element a DOM element whose namespace is being checked\n * @returns Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n return _checkSvgNamespace(tagName, parent, parentTagName);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n return _checkMathMlNamespace(tagName, parent, parentTagName);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n return _checkHtmlNamespace(tagName, parent, parentTagName);\n }\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n /**\n * _forceRemove\n *\n * @param node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n getParentNode(node).removeChild(node);\n } catch (_) {\n /* The normal detach failed — this is reached for a parentless node\n (getParentNode() is null, so .removeChild throws). Element.prototype\n .remove() is itself a spec no-op on a parentless node, so a recorded\n \"removal\" would otherwise hand the caller back an intact,\n payload-bearing node (e.g. a detached IN_PLACE root the mXSS canary or\n the style-with-element-child rule decided to kill). Fail closed by\n throwing — exactly as a clobbered root does at the IN_PLACE entry —\n rather than trying to \"neutralize\" the node via its own methods.\n Neutralizing would mean calling getAttributeNames()/removeAttribute()\n on the node, both of which a <form> root can clobber via a named child\n (and _isClobbered does not even probe getAttributeNames), so the\n neutralize step could itself be silently defeated, leaving the payload\n intact. A throw touches only the cached, clobber-safe remove() and\n getParentNode(). Generalizes GHSA-r47g-fvhr-h676 (clobbered-form root)\n to every root-kill reason. REPORT-3.\n This lives inside the catch, so it never fires for a normally-removed\n in-tree node: those have a parent, removeChild() succeeds, and the\n catch is not entered. Only a kept (parentless) root reaches here. */\n remove(node);\n if (!getParentNode(node)) {\n throw typeErrorCreate('a node selected for removal could not be detached from its tree ' + 'and cannot be safely returned; refusing to sanitize in place');\n }\n }\n };\n /**\n * _neutralizeRoot\n *\n * Fail-closed teardown of an in-place root after the sanitize walk aborts\n * (campaign-3 F2). An internal throw mid-walk — e.g. a page-registered\n * custom element's reaction detaches a node so `_forceRemove`'s deliberate\n * parentless guard throws, or any other re-entrant engine mutation — would\n * otherwise leave the caller's *live* tree half-sanitized, with everything\n * after the abort point still carrying its handlers. There is no safe way\n * to resume the walk (the tree mutated under us), so we strip the root bare:\n * remove every child and every attribute, then let the caller's catch see\n * the original error. Clobber-safe (cached `remove`/`childNodes`/`attributes`\n * getters; the root was already clobber-pre-flighted at the IN_PLACE entry).\n *\n * @param root the in-place root to empty\n */\n const _neutralizeRoot = function _neutralizeRoot(root) {\n /* Strip every disallowed attribute (on* handlers included) off the whole\n subtree BEFORE detaching anything. Detaching first would hand back\n handler-bearing originals (e.g. an already-loading `<img onerror>`)\n whose queued resource event still fires in page scope after we throw.\n Clobber-safe reads; a doomed clobbered node's own attributes are\n irrelevant while its non-clobbered descendants are reached and scrubbed. */\n _neutralizeSubtree(root);\n const childNodes = getChildNodes(root);\n if (childNodes) {\n const snapshot = [];\n arrayForEach(childNodes, child => {\n arrayPush(snapshot, child);\n });\n arrayForEach(snapshot, child => {\n try {\n remove(child);\n } catch (_) {\n /* Best-effort teardown; a still-attached child is handled below */\n }\n });\n }\n const attributes = getAttributes(root);\n if (attributes) {\n for (let i = attributes.length - 1; i >= 0; --i) {\n const attribute = attributes[i];\n const name = attribute && attribute.name;\n if (typeof name === 'string') {\n try {\n root.removeAttribute(name);\n } catch (_) {\n /* Clobbered removeAttribute — ignore (fail-closed best effort) */\n }\n }\n }\n }\n };\n /**\n * _removeAttribute\n *\n * @param name an Attribute name\n * @param element a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, element) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: element.getAttributeNode(name),\n from: element\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: element\n });\n }\n element.removeAttribute(name);\n // We void attribute values for unremovable \"is\" attributes\n if (name === 'is') {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(element);\n } catch (_) {}\n } else {\n try {\n element.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n /**\n * _stripDisallowedAttributes\n *\n * Removes every attribute the active configuration does not allow from a\n * single element, using the same allowlist as the main attribute pass (so\n * `on*` handlers go, but no `/^on/` blocklist is introduced). Used only to\n * neutralise nodes that are being discarded from an in-place tree.\n *\n * @param element the element to strip\n */\n const _stripDisallowedAttributes = function _stripDisallowedAttributes(element) {\n const attributes = getAttributes(element);\n if (!attributes) {\n return;\n }\n for (let i = attributes.length - 1; i >= 0; --i) {\n const attribute = attributes[i];\n const name = attribute && attribute.name;\n if (typeof name !== 'string' || ALLOWED_ATTR[transformCaseFunc(name)]) {\n continue;\n }\n try {\n element.removeAttribute(name);\n } catch (_) {\n /* Clobbered removeAttribute on a doomed node — ignore */\n }\n }\n };\n /**\n * _neutralizeSubtree\n *\n * Completes the audit-5 F1 fix across every removal path. The KEEP_CONTENT\n * move-hoist neutralises only disallowed-tag removals; clobber, mXSS-canary,\n * namespace, comment, processing-instruction and KEEP_CONTENT:false removals\n * all drop their subtree wholesale via `_forceRemove`. On the IN_PLACE path\n * those dropped nodes are detached from the caller's LIVE tree but a\n * handler-bearing original among them (an `<img onerror>`/`<video>` that was\n * loading) keeps its queued resource event, which fires in page scope after\n * sanitize returns. This walks a removed subtree and strips every attribute\n * the active configuration does not allow — so `on*` handlers are cancelled\n * through the SAME allowlist that governs kept nodes, not a separate `/^on/`\n * blocklist. Run synchronously before sanitize returns, i.e. before any\n * queued event can fire. Hook-free by design: these nodes leave the output,\n * so firing attribute hooks for them would be surprising. Clobber-safe reads;\n * a doomed clobbered node may shadow `removeAttribute` (its own attributes are\n * irrelevant — it is discarded — while its non-clobbered descendants, e.g.\n * the `<img>`, are reached and scrubbed).\n *\n * @param root the root of a removed subtree to neutralise\n */\n const _neutralizeSubtree = function _neutralizeSubtree(root) {\n const stack = [root];\n while (stack.length > 0) {\n const node = stack.pop();\n const nodeType = getNodeType ? getNodeType(node) : node.nodeType;\n if (nodeType === NODE_TYPE.element) {\n _stripDisallowedAttributes(node);\n }\n const childNodes = getChildNodes(node);\n if (childNodes) {\n for (let i = childNodes.length - 1; i >= 0; --i) {\n stack.push(childNodes[i]);\n }\n }\n }\n };\n /**\n * _neutralizePatchLinkage\n *\n * IN_PLACE entry pre-pass (declarative-partial-updates / streaming\n * hardening, https://github.com/WICG/declarative-partial-updates).\n *\n * The main walk strips patch linkage (`for`/`patchsrc`) and removes range\n * markers (PIs / markup comments) node-by-node, in document order, AS it\n * reaches each node. On a live in-place root that leaves a window: from the\n * moment the root is connected until the walk arrives at a given node, that\n * node's linkage is live. A patch applied on connection/stream can fire as\n * a microtask during the walk and inject or teleport an unsanitized DOM\n * range into a region the iterator has already passed and will not revisit,\n * so the post-return \"tree is sanitized\" contract is violated. Sweep the\n * whole tree once up front and sever every linkage before the walk begins,\n * closing that window.\n *\n * This CANNOT undo a patch that already fired before sanitize ran — that is\n * the irreducible \"do not IN_PLACE a live-connected attacker tree\" caveat —\n * but it closes everything from sanitize-start onward. Gated on SAFE_FOR_XML\n * to group with the rest of the declarative-partial-updates handling and\n * stay overridable, consistent with the codebase.\n *\n * Clobber-safe traversal (cached childNodes getter); per-node try/catch so a\n * clobbered root cannot defeat the sweep of its non-clobbered descendants.\n *\n * NOTE (pending real-Chrome confirmation, see test/declarative-patch-probe\n * .html Q1): this mirrors the existing policy of keeping `for` on\n * <label>/<output>. If the shipping feature can drive a patch through a\n * surviving `for`-on-label/output + `id` pair, this pre-pass and the\n * attribute check at _isBasicCustomElement's caller must additionally drop\n * that pair on the IN_PLACE path. Left as-is until the taxonomy is verified.\n *\n * @param root the in-place root to sweep\n */\n const _neutralizePatchLinkage = function _neutralizePatchLinkage(root) {\n if (!SAFE_FOR_XML) {\n return;\n }\n const stack = [root];\n while (stack.length > 0) {\n const node = stack.pop();\n const nodeType = getNodeType ? getNodeType(node) : node.nodeType;\n /* Remove range markers (the target side of a patch linkage): every\n processing instruction, and any markup-bearing comment. */\n if (nodeType === NODE_TYPE.processingInstruction || nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, node.data)) {\n try {\n remove(node);\n } catch (_) {\n /* Best-effort */\n }\n continue;\n }\n /* Strip patch-source attributes (the source side) off elements. */\n if (nodeType === NODE_TYPE.element) {\n const element = node;\n const lcTag = transformCaseFunc(getNodeName ? getNodeName(node) : node.nodeName);\n try {\n if (element.hasAttribute && element.hasAttribute('patchsrc')) {\n element.removeAttribute('patchsrc');\n }\n if (element.hasAttribute && element.hasAttribute('for') && lcTag !== 'label' && lcTag !== 'output') {\n element.removeAttribute('for');\n }\n } catch (_) {\n /* Clobbered removeAttribute/hasAttribute on a doomed node — ignore */\n }\n }\n const childNodes = getChildNodes(node);\n if (childNodes) {\n for (let i = childNodes.length - 1; i >= 0; --i) {\n stack.push(childNodes[i]);\n }\n }\n }\n };\n /**\n * _initDocument\n *\n * @param dirty - a string of dirty markup\n * @return a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? _createTrustedHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param root The root element or node to start traversing on.\n * @return The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n /* Read ownerDocument through the cached Node.prototype getter, never the\n direct property. HTMLFormElement has [LegacyOverrideBuiltIns], so a\n clobbering child (<input name=\"ownerDocument\"> or a form-associated\n external input) shadows the prototype getter and makes a direct read\n return that <input>. createNodeIterator.call(<input>, ...) then throws\n \"Illegal invocation\", and on the IN_PLACE path that throw lands before\n the walk's fail-closed barrier - leaving the caller's live tree, with\n any already-armed handler in it, un-neutralized. The cached getter\n returns the real Document regardless of the clobber. */\n const doc = getOwnerDocument ? getOwnerDocument(root) : root.ownerDocument;\n return createNodeIterator.call(doc || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n /**\n * Replace template expression syntax (mustache, ERB, template\n * literal) with a space; shared by all SAFE_FOR_TEMPLATES scrub\n * sites. Order matters: mustache, then ERB, then template literal.\n *\n * @param value the string to scrub\n * @returns the scrubbed string\n */\n const _stripTemplateExpressions = function _stripTemplateExpressions(value) {\n value = stringReplace(value, MUSTACHE_EXPR$1, ' ');\n value = stringReplace(value, ERB_EXPR$1, ' ');\n value = stringReplace(value, TMPLIT_EXPR$1, ' ');\n return value;\n };\n /**\n * Strip template-engine expressions ({{...}}, ${...}, <%...%>) from the\n * character data of an element subtree. Used as the final safety net for\n * SAFE_FOR_TEMPLATES on every DOM-returning code path so that expressions\n * which only form after text-node normalization (e.g. fragments split across\n * stripped elements) cannot survive into a template-evaluating framework.\n *\n * Walks text/comment/CDATA/processing-instruction nodes and mutates `.data`\n * in place rather than round-tripping through innerHTML. This preserves\n * descendant node references (important for IN_PLACE callers), avoids a\n * serialize/reparse cycle, and reads literal character data — which means\n * `<%...%>` in text content matches the ERB regex against its real bytes\n * instead of the HTML-entity-escaped form innerHTML would produce.\n *\n * Attribute values are not visited here; SAFE_FOR_TEMPLATES handling for\n * attributes is performed during the per-node `_sanitizeAttributes` pass.\n *\n * @param node The root element whose character data should be scrubbed.\n */\n const _scrubTemplateExpressions2 = function _scrubTemplateExpressions(node) {\n var _node$querySelectorAl;\n node.normalize();\n /* Clobber-safe ownerDocument read, same reasoning as _createNodeIterator:\n under SAFE_FOR_TEMPLATES this runs on the live IN_PLACE root, which may\n carry a form-named-getter override of ownerDocument. */\n const doc = getOwnerDocument ? getOwnerDocument(node) : node.ownerDocument;\n const walker = createNodeIterator.call(doc || node, node,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_TEXT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_CDATA_SECTION | NodeFilter.SHOW_PROCESSING_INSTRUCTION, null);\n let currentNode = walker.nextNode();\n while (currentNode) {\n currentNode.data = _stripTemplateExpressions(currentNode.data);\n currentNode = walker.nextNode();\n }\n // NodeIterator does not descend into <template>.content per the DOM spec,\n // so we must explicitly recurse into each template's content fragment,\n // mirroring the approach used by _sanitizeShadowDOM.\n const templates = (_node$querySelectorAl = node.querySelectorAll) === null || _node$querySelectorAl === void 0 ? void 0 : _node$querySelectorAl.call(node, 'template');\n if (templates) {\n arrayForEach(templates, tmpl => {\n if (_isDocumentFragment(tmpl.content)) {\n _scrubTemplateExpressions2(tmpl.content);\n }\n });\n }\n };\n /**\n * _isClobbered\n *\n * Detect DOM-clobbering on HTMLFormElement nodes. Form is the only HTML\n * interface with [LegacyOverrideBuiltIns]; a descendant element with a\n * `name` attribute matching a prototype property shadows that property\n * on direct reads. We use this check at the IN_PLACE entry-point and\n * during attribute sanitization to refuse clobbered forms.\n *\n * @param element element to check for clobbering attacks\n * @return true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(element) {\n // Realm-independent tag-name probe. If we can't determine the tag\n // name at all, we can't reason about clobbering — return false\n // (the caller's other defences still apply).\n const realTagName = getNodeName ? getNodeName(element) : null;\n if (typeof realTagName !== 'string') {\n return false;\n }\n if (transformCaseFunc(realTagName) !== 'form') {\n return false;\n }\n return typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' ||\n // Realm-safe NamedNodeMap detection: equality against the cached\n // prototype getter. Clobbered .attributes (e.g. <input name=\"attributes\">)\n // makes the direct read diverge from the cached read; a clean form\n // (same-realm OR foreign-realm) has both reads pointing at the same\n // canonical NamedNodeMap.\n element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||\n // NodeType clobbering probe. Cached Node.prototype.nodeType getter\n // returns the integer 1 for any Element regardless of realm; direct\n // read on a clobbered form (e.g. <input name=\"nodeType\">) returns\n // the named child element. Cheap addition — nodeType is read from\n // an internal slot, no serialization cost — and removes a residual\n // clobbering surface used by several mXSS / PI / comment branches\n // in _sanitizeElements that compare currentNode.nodeType directly.\n element.nodeType !== getNodeType(element) ||\n // HTMLFormElement has [LegacyOverrideBuiltIns]: a descendant named\n // \"childNodes\" shadows the prototype getter. Direct reads of\n // form.childNodes from a clobbered form return the named child\n // instead of the real NodeList, so any walk that reads it directly\n // skips the form's real children. Compare the direct read to the\n // cached Node.prototype getter — when the form's named-property\n // getter intercepts the read, the two values differ and we flag\n // the form. This catches every clobbering child type (input,\n // select, etc.) regardless of whether the named child happens to\n // carry a numeric .length, which a typeof-based probe would miss\n // (e.g. HTMLSelectElement.length is a defined unsigned-long).\n element.childNodes !== getChildNodes(element);\n };\n /**\n * Checks whether the given value is a DocumentFragment from any realm.\n *\n * The realm-independent replacement reads `nodeType` through the cached\n * Node.prototype getter and compares to the DOCUMENT_FRAGMENT_NODE\n * constant (11). nodeType is a numeric value resolved from the node's\n * internal slot, identical across realms for the same kind of node.\n *\n * @param value object to check\n * @return true if value is a DocumentFragment-shaped node from any realm\n */\n const _isDocumentFragment = function _isDocumentFragment(value) {\n if (!getNodeType || typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return getNodeType(value) === NODE_TYPE.documentFragment;\n } catch (_) {\n return false;\n }\n };\n /**\n * Checks whether the given object is a DOM node, including nodes that\n * originate from a different window/realm (e.g. an iframe's\n * contentDocument). The previous `value instanceof Node` check was\n * realm-bound: nodes from a different window failed it, causing\n * sanitize() to silently stringify them and reset IN_PLACE to false,\n * returning the original node unsanitized. See GHSA-4w3q-35jp-p934.\n *\n * @param value object to check whether it's a DOM node\n * @return true if value is a DOM node from any realm\n */\n const _isNode = function _isNode(value) {\n if (!getNodeType || typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n return typeof getNodeType(value) === 'number';\n } catch (_) {\n return false;\n }\n };\n function _executeHooks(hooks, currentNode, data) {\n if (hooks.length === 0) {\n return;\n }\n arrayForEach(hooks, hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n }\n /**\n * Structural-threat checks that condemn a node regardless of the\n * allowlists: mXSS via namespace confusion, risky CSS construction,\n * processing instructions, markup-bearing comments. Pure predicate;\n * the caller removes. Check order is load-bearing.\n *\n * @param currentNode the node to inspect\n * @param tagName the node's transformCaseFunc'd tag name\n * @return true if the node must be removed\n */\n const _isUnsafeNode = function _isUnsafeNode(currentNode, tagName) {\n /* Detect mXSS attempts abusing namespace confusion */\n if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.textContent) && regExpTest(ELEMENT_MARKUP_PROBE, currentNode.innerHTML)) {\n return true;\n }\n /* Remove risky CSS construction leading to mXSS */\n if (SAFE_FOR_XML && currentNode.namespaceURI === HTML_NAMESPACE && tagName === 'style' && _isNode(currentNode.firstElementChild)) {\n return true;\n }\n /* Remove any occurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.processingInstruction) {\n return true;\n }\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(COMMENT_MARKUP_PROBE, currentNode.data)) {\n return true;\n }\n return false;\n };\n /**\n * Handle a node whose tag is forbidden or not allowlisted: keep\n * allowed custom elements (false return exits _sanitizeElements\n * early - the namespace and fallback-tag removal checks are\n * intentionally skipped for kept custom elements), else hoist\n * content per KEEP_CONTENT and remove.\n *\n * A kept custom element is the ONLY case in which this function\n * returns false, so the caller uses that return value to run the\n * afterSanitizeElements hook on the kept element and keep the\n * element-hook lifecycle consistent with normal allowlisted\n * elements (GHSA-c2j3-45gr-mqc4).\n *\n * @param currentNode the disallowed node\n * @param tagName the node's transformCaseFunc'd tag name\n * @return true if the node was removed, false if kept\n */\n const _sanitizeDisallowedNode = function _sanitizeDisallowedNode(currentNode, tagName, root) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n /* Keep content except for bad-listed elements.\n Use the cached prototype getters exclusively — the previous code\n had `|| currentNode.parentNode` / `|| currentNode.childNodes`\n fallbacks, but the cached getters always return the canonical\n value (or null for a real parent-less node), so the fallback\n path was dead in safe cases and a clobbering surface in unsafe\n ones. Falsy cached results stay falsy; the `if (childNodes &&\n parentNode)` check already gates correctly. */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode);\n const childNodes = getChildNodes(currentNode);\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n /* Hoist by moving each child up one level rather than deep-cloning\n it. Moving transfers every descendant exactly once, so a chain of\n nested disallowed elements costs O(n) instead of the O(n^2) that\n re-cloning the shrinking subtree at each level produced; it also\n empties the removed original, so `DOMPurify.removed` no longer\n pins whole subtrees. Moving preserves the in-place guarantee too:\n an original carrying already-queued resource events (`<img\n onerror>`, `<video>`/`<audio>` error, lazy/`onload`, …) is\n relocated and sanitised rather than left detached but still armed.\n The sole case that must clone is removing the walk root itself.\n The result is serialised from the root's subtree, so a restrictive\n ALLOWED_TAGS that strips the root (`body` on the string path) must\n leave the content inside it, which only cloning does. In IN_PLACE\n the root is pre-validated as an allowed tag and so is never removed\n here, so that path always takes the move branch.\n `childNodes` is live; a tail-to-head walk keeps `childNodes[i]`\n valid whether we move (drops the trailing entry) or clone (leaves\n the list intact). */\n for (let i = childCount - 1; i >= 0; --i) {\n const hoisted = currentNode === root ? cloneNode(childNodes[i], true) : childNodes[i];\n parentNode.insertBefore(hoisted, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n };\n /**\n * Fork a hook-mutable allowlist off its shared binding the first time a\n * (possibly lazily-installed) uponSanitize* hook is about to see it, so the\n * hook cannot widen the per-instance default or the setConfig binding by\n * reference and leak past the call. Returns the set unchanged once it is\n * already call-local, so repeated calls across elements are idempotent.\n *\n * @param hookList the uponSanitize* hook array for this event\n * @param set the current ALLOWED_TAGS / ALLOWED_ATTR binding\n * @param defaultSet the per-instance DEFAULT_ALLOWED_* constant\n * @param setConfigSet the captured setConfig() binding, or null\n * @return a call-local clone if a hook is present and set is still shared,\n * else set unchanged\n */\n const _forkSharedAllowlist = function _forkSharedAllowlist(hookList, set, defaultSet, setConfigSet) {\n if (hookList.length === 0) {\n return set;\n }\n return set === defaultSet || set === setConfigSet ? clone(set) : set;\n };\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n * @param currentNode to check for permission to exist\n * @return true if node was killed, false if left alive\n */\n // eslint-disable-next-line complexity\n const _sanitizeElements = function _sanitizeElements(currentNode, root) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n /* A hook may have detached the node - treat it as removed (see the\n detached-node comment after the uponSanitizeElement hook below). On\n the IN_PLACE path, neutralize the detached subtree first so a queued\n resource handler on it cannot fire in page scope after we return. */\n if (currentNode !== root && getParentNode(currentNode) === null) {\n if (IN_PLACE) {\n _neutralizeSubtree(currentNode);\n }\n return true;\n }\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(getNodeName ? getNodeName(currentNode) : currentNode.nodeName);\n /* Close the pre-walk clone-guard's timing gap: an uponSanitizeElement\n hook may have been installed after that guard sampled the hook arrays\n (e.g. lazily from beforeSanitizeElements), leaving ALLOWED_TAGS still\n aliasing a shared binding that a widening hook would mutate by\n reference. Fork it before exposing it to the hook. */\n ALLOWED_TAGS = _forkSharedAllowlist(hooks.uponSanitizeElement, ALLOWED_TAGS, DEFAULT_ALLOWED_TAGS, SET_CONFIG_ALLOWED_TAGS);\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeElement, currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n /* A hook may have detached the node from the tree — a long-standing\n user pattern (issue #469; draw.io-style foreignObject filtering).\n Per the cached, unclobberable parentNode getter the node is\n genuinely out of the tree, so it can reach neither the serialized\n output nor an IN_PLACE live tree; treat it as removed and stop\n processing it. Without this guard, the unsafe-node / namespace\n checks below would call _forceRemove on a parentless node and hit\n the REPORT-3 fail-closed throw — which exists for nodes DOMPurify\n wants gone but *cannot* detach (clobbered / parentless roots), the\n opposite of a node that is already safely gone. The walk root is\n exempt: a detached IN_PLACE root is legitimate input and must still\n be fully sanitized, and a kill-decision on it must keep hitting the\n REPORT-3 throw. Nodes detached by hooks stay the hook's\n responsibility for placement: they are not recorded in\n DOMPurify.removed, so the post-walk IN_PLACE pass (which iterates\n DOMPurify.removed) does not reach them. But a hook-detached subtree\n can still hold a queued resource-event handler - e.g. an <img onload>\n that began loading when the caller built the live tree - which fires\n in page scope after sanitize returns even though the handler never\n reached the returned tree. That is the audit-5 F1 hazard, and the\n documented node.remove() hook pattern walks straight into it. So on\n the IN_PLACE path we neutralize the detached subtree inline here,\n stripping its non-allow-listed attributes before returning, exactly\n as the post-walk pass does for _forceRemove'd subtrees. */\n if (currentNode !== root && getParentNode(currentNode) === null) {\n if (IN_PLACE) {\n _neutralizeSubtree(currentNode);\n }\n return true;\n }\n /* Remove mXSS vectors, processing instructions and risky comments */\n if (_isUnsafeNode(currentNode, tagName)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Remove element if anything forbids its presence */\n if (FORBID_TAGS[tagName] || !(EXTRA_ELEMENT_HANDLING.tagCheck instanceof Function && EXTRA_ELEMENT_HANDLING.tagCheck(tagName)) && !ALLOWED_TAGS[tagName]) {\n const removed = _sanitizeDisallowedNode(currentNode, tagName, root);\n /* A false return means the node is a custom element kept via\n CUSTOM_ELEMENT_HANDLING - the only keep path through\n _sanitizeDisallowedNode. Run afterSanitizeElements on it so the\n element-hook lifecycle matches normal allowlisted elements: a\n security policy applied in this hook (e.g. stripping an attribute\n from every surviving element) must not silently skip kept custom\n elements (GHSA-c2j3-45gr-mqc4). This mirrors the normal-element\n tail below - the hook runs, then the walker's subsequent\n _sanitizeAttributes pass sanitizes the element's attributes. The\n deliberately skipped namespace and fallback-tag removal checks stay\n skipped; they are removal decisions, not the hook contract. */\n if (removed === false) {\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n }\n return removed;\n }\n /* Check whether element has a valid namespace.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): use the cached Node.prototype\n nodeType getter rather than `instanceof Element`, which is realm-\n bound and short-circuits to false for any node minted in a different\n realm — letting a foreign-realm element with a forbidden namespace\n slip past the namespace check entirely. */\n const nt = getNodeType ? getNodeType(currentNode) : currentNode.nodeType;\n if (nt === NODE_TYPE.element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(FALLBACK_TAG_CLOSE, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n const content = _stripTemplateExpressions(currentNode.textContent);\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n return false;\n };\n /**\n * _isValidAttribute\n *\n * @param lcTag Lowercase tag name of containing element.\n * @param lcName Lowercase attribute name.\n * @param value Attribute value.\n * @return Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* FORBID_ATTR must always win, even if ADD_ATTR predicate would allow it */\n if (FORBID_ATTR[lcName]) {\n return false;\n }\n /* Reject declarative-partial-updates patch-linkage attributes\n (https://github.com/WICG/declarative-partial-updates).\n Empirical note (Chrome 150, verified — see\n test/declarative-patch-probe-v3.html): expansion is NOT applied after\n sanitization. For the string path it fires during sanitize()'s own\n parse, so the walk sees and sanitizes the fully materialized expanded\n tree — teleports into MathML/SVG integration points included; a\n weaponized `<template for>`->`<img onerror>` comes back with the handler\n stripped. For the IN_PLACE path it fires on connection, before the walk.\n Either way DOMPurify is NOT blind to the patch.\n This removal is therefore defense-in-depth rather than the sole barrier:\n it prevents live linkage from surviving into the OUTPUT and re-expanding\n in the caller's context, and keeps behaviour deterministic if a future\n engine defers expansion. `for` is legitimate only on <label>/<output>;\n anywhere else (notably <template for>) it links the element to a patch\n target and teleports or removes an arbitrary DOM range by id/marker name.\n `patchsrc` fetches remote markup and is treated as a script-loading\n mechanism (CSP). Gated on SAFE_FOR_XML so the removal groups with the\n other structural-threat checks and stays overridable, consistent with\n the rest of the codebase. PI range markers are already removed by\n _isUnsafeNode. */\n if (SAFE_FOR_XML && lcName === 'patchsrc') {\n return false;\n }\n if (SAFE_FOR_XML && lcName === 'for' && lcTag !== 'label' && lcTag !== 'output') {\n return false;\n }\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n const nameIsPermitted = ALLOWED_ATTR[lcName] || EXTRA_ELEMENT_HANDLING.attributeCheck instanceof Function && EXTRA_ELEMENT_HANDLING.attributeCheck(lcName, lcTag);\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && regExpTest(DATA_ATTR$1, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR$1, lcName)) ; else if (!nameIsPermitted) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName, lcTag)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA$1, stringReplace(value, ATTR_WHITESPACE$1, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n /* Names the HTML spec reserves from valid-custom-element-name; these must\n * never be treated as basic custom elements even when a permissive\n * CUSTOM_ELEMENT_HANDLING.tagNameCheck is configured. */\n const RESERVED_CUSTOM_ELEMENT_NAMES = addToSet({}, ['annotation-xml', 'color-profile', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'missing-glyph']);\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param tagName name of the tag of the node to sanitize\n * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return !RESERVED_CUSTOM_ELEMENT_NAMES[stringToLowerCase(tagName)] && regExpTest(CUSTOM_ELEMENT$1, tagName);\n };\n /**\n * Wrap an attribute value in the matching Trusted Types object when\n * the active policy requires it. Namespaced attributes pass through\n * unchanged (no TT support yet, see\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1305293).\n *\n * @param lcTag lowercase tag name of the containing element\n * @param lcName lowercase attribute name\n * @param namespaceURI the attribute's namespace, if any\n * @param value the attribute value to wrap\n * @return the value, wrapped when Trusted Types demand it\n */\n const _applyTrustedTypesToAttribute = function _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value) {\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function' && !namespaceURI) {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n return _createTrustedHTML(value);\n }\n case 'TrustedScriptURL':\n {\n return _createTrustedScriptURL(value);\n }\n }\n }\n return value;\n };\n /**\n * Write a modified attribute value back onto the element. On\n * success, re-probe for clobbering introduced by the new value and\n * remove the element when found; otherwise pop the removal entry\n * recorded by the earlier _removeAttribute (long-standing pairing\n * with the SANITIZE_NAMED_PROPS path - do not \"fix\" casually). On\n * failure, remove the attribute instead.\n *\n * @param currentNode the element carrying the attribute\n * @param name the attribute name as present on the element\n * @param namespaceURI the attribute's namespace, if any\n * @param value the new attribute value\n */\n const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {\n _removeAttribute(name, currentNode);\n }\n };\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n const attributes = currentNode.attributes;\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes || _isClobbered(currentNode)) {\n return;\n }\n /* Same lazy-install guard as uponSanitizeElement (see there): fork the\n attribute allowlist off its shared binding before a hook can see it. */\n ALLOWED_ATTR = _forkSharedAllowlist(hooks.uponSanitizeAttribute, ALLOWED_ATTR, DEFAULT_ALLOWED_ATTR, SET_CONFIG_ALLOWED_ATTR);\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR,\n forceKeepAttr: undefined\n };\n let l = attributes.length;\n const lcTag = transformCaseFunc(currentNode.nodeName);\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const name = attr.name,\n namespaceURI = attr.namespaceURI,\n attrValue = attr.value;\n const lcName = transformCaseFunc(name);\n const initValue = attrValue;\n let value = name === 'value' ? initValue : stringTrim(initValue);\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name') && stringIndexOf(value, SANITIZE_NAMED_PROPS_PREFIX) !== 0) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n // Else: already prefixed, leave the attribute alone — the prefix is\n // itself the clobbering protection, and re-applying it is incorrect.\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Make sure we cannot easily use animated hrefs, even if animations are allowed */\n if (lcName === 'attributename' && stringMatch(value, 'href')) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Did the hooks force-keep the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(SELF_CLOSING_TAG, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n value = _stripTemplateExpressions(value);\n }\n /* Is `value` valid for this attribute? */\n if (!_isValidAttribute(lcTag, lcName, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n /* Handle attributes that require Trusted Types */\n value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);\n /* Handle invalid data-* attribute set by try-catching it */\n if (value !== initValue) {\n _setAttributeValue(currentNode, name, namespaceURI, value);\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n };\n /**\n * _sanitizeShadowDOM\n *\n * @param fragment to iterate over recursively\n */\n const _sanitizeShadowDOM2 = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n /* Execute a hook if present */\n _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n /* Sanitize tags and elements */\n _sanitizeElements(shadowNode, fragment);\n /* Check attributes next */\n _sanitizeAttributes(shadowNode);\n /* Deep shadow DOM detected.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): use nodeType against the\n DOCUMENT_FRAGMENT_NODE constant rather than instanceof, so we\n recurse into <template>.content from foreign realms too. */\n if (_isDocumentFragment(shadowNode.content)) {\n _sanitizeShadowDOM2(shadowNode.content);\n }\n /* An element iterated here may itself host an attached\n shadow root. The default NodeIterator does not enter shadow\n trees, so a shadow root nested inside template.content was\n previously reached by no walk at all (the pre-pass at\n _sanitizeAttachedShadowRoots descends via childNodes, which\n doesn't enter template.content; the template-content recursion\n above iterates the content but never inspected shadowRoot).\n Walk it explicitly. The nodeType guard avoids reading\n shadowRoot off text / comment / CDATA / PI nodes that the\n iterator also surfaces. */\n const shadowNodeType = getNodeType ? getNodeType(shadowNode) : shadowNode.nodeType;\n if (shadowNodeType === NODE_TYPE.element) {\n const innerSr = getShadowRoot(shadowNode);\n if (_isDocumentFragment(innerSr)) {\n _sanitizeAttachedShadowRoots(innerSr);\n _sanitizeShadowDOM2(innerSr);\n }\n }\n }\n /* Execute a hook if present */\n _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n };\n /**\n * _sanitizeAttachedShadowRoots\n *\n * Walks `root` and feeds every attached shadow root we encounter into\n * the existing _sanitizeShadowDOM pipeline. The default node iterator\n * does not descend into shadow trees, so nodes inside an attached\n * shadow root would otherwise be skipped entirely.\n *\n * Two real input paths put attached shadow roots in front of us:\n * 1. IN_PLACE on a DOM node that already has shadow roots attached.\n * 2. DOM-node input where importNode(dirty, true) deep-clones the\n * shadow root because it was created with `clonable: true`.\n *\n * This pass runs once, up front, so the main iteration loop (and the\n * existing _sanitizeShadowDOM template-content recursion) stay\n * untouched — string-input paths are not affected.\n *\n * @param root the subtree root to walk for attached shadow roots\n */\n const _sanitizeAttachedShadowRoots = function _sanitizeAttachedShadowRoots(root) {\n /* Iterative (explicit stack) rather than per-child recursion. DOM APIs\n impose no depth cap, so an attacker-shaped tree (JSON/CRDT/editor data\n built straight into the DOM — the IN_PLACE surface) deeper than the JS\n call-stack budget would otherwise overflow native recursion here and\n throw at the IN_PLACE entry pre-pass, before a single node is\n sanitized, leaving the caller's live tree untouched (fail-open). See\n campaign-3 F4. A heap stack keeps depth off the call stack.\n Each work item is either a node to descend into, or a deferred\n `_sanitizeShadowDOM` for an already-walked shadow root. The deferred\n form preserves the original post-order discipline: a shadow root's\n nested shadow roots are discovered before the outer shadow is\n sanitized (which may remove hosts). Pushes are in reverse of the\n desired processing order (LIFO): template content, then children, then\n the shadow-sanitize, then the shadow walk — so the order matches the\n previous recursion exactly. */\n const stack = [{\n node: root,\n shadow: null\n }];\n while (stack.length > 0) {\n const item = stack.pop();\n /* Deferred shadow-DOM sanitisation: runs after its subtree was walked. */\n if (item.shadow) {\n _sanitizeShadowDOM2(item.shadow);\n continue;\n }\n const node = item.node;\n const nodeType = getNodeType ? getNodeType(node) : node.nodeType;\n const isElement = nodeType === NODE_TYPE.element;\n /* (pushed last → processed first) Children, snapshotted in reverse so\n the first child is processed first. Snapshotting matters because a\n hook may detach siblings mid-walk. */\n const childNodes = getChildNodes(node);\n if (childNodes) {\n for (let i = childNodes.length - 1; i >= 0; --i) {\n stack.push({\n node: childNodes[i],\n shadow: null\n });\n }\n }\n /* (pushed before children → processed after them, matching the old\n \"template content last\" order) When the node is a <template>,\n descend into its content. */\n if (isElement) {\n const rootName = getNodeName ? getNodeName(node) : null;\n if (typeof rootName === 'string' && transformCaseFunc(rootName) === 'template') {\n const content = node.content;\n if (_isDocumentFragment(content)) {\n stack.push({\n node: content,\n shadow: null\n });\n }\n }\n }\n /* Shadow root (processed first): walk its subtree, then sanitise it.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection\n rather than `instanceof DocumentFragment`, which is realm-bound and\n silently skipped foreign-realm shadow roots (e.g.\n iframe.contentDocument attachShadow). */\n if (isElement) {\n const sr = getShadowRoot(node);\n if (_isDocumentFragment(sr)) {\n /* Push the deferred sanitise first so it pops after the shadow\n walk we push next, i.e. nested shadow roots are discovered\n before this one is sanitised. */\n stack.push({\n node: null,\n shadow: sr\n }, {\n node: sr,\n shadow: null\n });\n }\n }\n }\n };\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n dirty = stringifyValue(dirty);\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n }\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n /* Assign config vars */\n if (SET_CONFIG) {\n /* Persistent setConfig() path: _parseConfig is skipped, so the sets are\n * not re-derived per call. Restore them from the pristine bindings\n * captured at setConfig() time so a previous call's hook clone (mutated\n * below) does not carry over. */\n ALLOWED_TAGS = SET_CONFIG_ALLOWED_TAGS;\n ALLOWED_ATTR = SET_CONFIG_ALLOWED_ATTR;\n } else {\n _parseConfig(cfg);\n }\n /* Clone the hook-mutable allowlists before the walk whenever an\n * uponSanitize* hook is registered. The hook event exposes ALLOWED_TAGS\n * and ALLOWED_ATTR by reference (as allowedTags / allowedAttributes), so\n * a hook that widens them would otherwise mutate the shared set\n * permanently: across later calls and across every element. Cloning per\n * walk keeps documented in-call widening working while scoping it to the\n * call. A single guard for both config paths - the per-call path rebinds\n * the sets in _parseConfig each call, the persistent path restores them\n * from the captured bindings just above - so the two cannot diverge. */\n if (hooks.uponSanitizeElement.length > 0 || hooks.uponSanitizeAttribute.length > 0) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n if (hooks.uponSanitizeAttribute.length > 0) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n /* Clean up removed elements */\n DOMPurify.removed = [];\n /* Resolve IN_PLACE for this call without mutating persistent config.\n Writing the IN_PLACE closure variable here leaks under setConfig(),\n where _parseConfig is skipped on later calls: a single string call would\n disable in-place mode for every subsequent node call, returning a\n sanitized copy while leaving the caller's node — which in-place callers\n keep using and whose return value they ignore — unsanitized. REPORT-2. */\n const inPlace = IN_PLACE && typeof dirty !== 'string' && _isNode(dirty);\n if (inPlace) {\n /* Declarative-partial-updates / streaming pre-pass: sever every patch\n linkage across the live tree BEFORE the walk, so no patch can fire\n mid-walk and inject into an already-processed region. Runs first, so\n it also covers the forbidden/clobbered roots that throw below. */\n _neutralizePatchLinkage(dirty);\n /* Do some early pre-sanitization to avoid unsafe root nodes.\n Read nodeName through the cached prototype getter — a clobbering\n child named \"nodeName\" on the form root would otherwise shadow\n the property and let this check skip the root-allowlist\n validation entirely. */\n const nn = getNodeName ? getNodeName(dirty) : dirty.nodeName;\n if (typeof nn === 'string') {\n const tagName = transformCaseFunc(nn);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Fail closed on a live root: neutralize handlers/children before\n throwing, exactly as the mid-walk abort path does. */\n _neutralizeRoot(dirty);\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n /* Pre-flight the root through _isClobbered. The iterator-driven\n removal path can not detach a parent-less root: _forceRemove\n falls through to Element.prototype.remove(), which per spec\n is a no-op on a node with no parent. A clobbered root would\n then survive the main loop with its attributes uninspected,\n because _sanitizeAttributes early-returns on _isClobbered. The\n result would be an attacker-controlled form, complete with any\n event-handler attributes the caller passed in, handed back to\n the application unsanitized. Refuse to sanitize such a root\n the same way we refuse a forbidden tag. GHSA-r47g-fvhr-h676. */\n if (_isClobbered(dirty)) {\n /* Fail closed on a live clobbered root before throwing.\n _neutralizeRoot's reads are clobber-safe (cached getters); the\n form's non-clobbered descendants, e.g. an armed <img>, are scrubbed. */\n _neutralizeRoot(dirty);\n throw typeErrorCreate('root node is clobbered and cannot be sanitized in-place');\n }\n /* Sanitize attached shadow roots before the main iterator runs.\n The iterator does not descend into shadow trees. Same fail-closed\n barrier as the main walk (campaign-3 F2): a custom-element reaction\n inside a shadow root could abort this pre-pass before the walk runs,\n which would otherwise leave the entire live tree unsanitized. */\n try {\n _sanitizeAttachedShadowRoots(dirty);\n } catch (error) {\n _neutralizeRoot(dirty);\n throw error;\n }\n } else if (_isNode(dirty)) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n /* Clonable shadow roots are deep-cloned by importNode(); sanitize\n them before the main iterator runs, since the iterator does not\n descend into shadow trees. The walk routes every read through a\n cached prototype getter so clobbering descendants on a form root\n cannot hide a shadow host from this pass. */\n _sanitizeAttachedShadowRoots(importedNode);\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(dirty) : dirty;\n }\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n /* Get node iterator */\n const walkRoot = inPlace ? dirty : body;\n /* Now start iterating over the created document.\n The walk runs inside an exception barrier (campaign-3 F2): a re-entrant\n engine/custom-element mutation can detach a node mid-walk so\n `_forceRemove`'s parentless guard throws, aborting the loop. Without the\n barrier the caller's in-place tree would be left half-sanitized with the\n unvisited tail still armed. _createNodeIterator itself is inside the\n barrier too: constructing the iterator dereferences the root's document,\n and any failure there (e.g. an exotic/clobbered root) must still fail\n closed rather than skip the neutralize. On any throw we fail closed -\n strip the in-place root bare - then rethrow so the existing throw\n contract is preserved. (String/DOM-copy paths never return the partial\n body, so the propagating throw is already fail-closed there.) */\n try {\n const nodeIterator = _createNodeIterator(walkRoot);\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n _sanitizeElements(currentNode, walkRoot);\n /* Check attributes next */\n _sanitizeAttributes(currentNode);\n /* Shadow DOM detected, sanitize it.\n Realm-safe check (GHSA-hpcv-96wg-7vj8): nodeType-based detection\n instead of instanceof, so foreign-realm <template>.content is\n walked correctly. */\n if (_isDocumentFragment(currentNode.content)) {\n _sanitizeShadowDOM2(currentNode.content);\n }\n }\n } catch (error) {\n if (inPlace) {\n _neutralizeRoot(dirty);\n /* Nodes _forceRemove'd earlier in the aborted walk are already\n detached from the root, so _neutralizeRoot's subtree pass does not\n reach them. Defuse them too, mirroring the success-path loop below. */\n arrayForEach(DOMPurify.removed, entry => {\n if (entry.element) {\n _neutralizeSubtree(entry.element);\n }\n });\n }\n throw error;\n }\n /* If we sanitized `dirty` in-place, return it. */\n if (inPlace) {\n /* Fail-closed completion of the audit-5 F1 fix: every node removed from\n the caller's live tree is detached but may still hold a queued\n resource-event handler that fires in page scope after we return. The\n move-hoist covers only disallowed-tag KEEP_CONTENT removals; strip the\n non-allow-listed attributes off every other removed subtree (clobber,\n mXSS, namespace, comments, KEEP_CONTENT:false, …) so those handlers are\n cancelled before any event can fire. Runs synchronously, pre-return. */\n arrayForEach(DOMPurify.removed, entry => {\n if (entry.element) {\n _neutralizeSubtree(entry.element);\n }\n });\n if (SAFE_FOR_TEMPLATES) {\n _scrubTemplateExpressions2(dirty);\n }\n return dirty;\n }\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (SAFE_FOR_TEMPLATES) {\n _scrubTemplateExpressions2(body);\n }\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n serializedHTML = _stripTemplateExpressions(serializedHTML);\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? _createTrustedHTML(serializedHTML) : serializedHTML;\n };\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n SET_CONFIG_ALLOWED_TAGS = ALLOWED_TAGS;\n SET_CONFIG_ALLOWED_ATTR = ALLOWED_ATTR;\n };\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n SET_CONFIG_ALLOWED_TAGS = null;\n SET_CONFIG_ALLOWED_ATTR = null;\n // Drop any caller-supplied Trusted Types policy so it cannot poison later\n // `RETURN_TRUSTED_TYPE` output. The internal default policy (cached, and\n // never recreated — Trusted Types throws on duplicate names) is restored by\n // the next `_parseConfig`. See GHSA-vxr8-fq34-vvx9.\n trustedTypesPolicy = defaultTrustedTypesPolicy;\n emptyHTML = '';\n };\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n /* Reject unknown entry points. Without this, a non-hook key (e.g.\n * '__proto__') indexes off the prototype chain rather than a real\n * hook array, and arrayPush then writes to Object.prototype. Guard\n * with an own-property check against the known hook names. */\n if (!objectHasOwnProperty(hooks, entryPoint)) {\n return;\n }\n arrayPush(hooks[entryPoint], hookFunction);\n };\n DOMPurify.removeHook = function (entryPoint, hookFunction) {\n if (!objectHasOwnProperty(hooks, entryPoint)) {\n return undefined;\n }\n if (hookFunction !== undefined) {\n const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);\n return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];\n }\n return arrayPop(hooks[entryPoint]);\n };\n DOMPurify.removeHooks = function (entryPoint) {\n if (!objectHasOwnProperty(hooks, entryPoint)) {\n return;\n }\n hooks[entryPoint] = [];\n };\n DOMPurify.removeAllHooks = function () {\n hooks = _createHooksMap();\n };\n return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","import { getDate, getMonth, getYear, isAfter, isBefore, isValid, set } from \"date-fns\";\nimport prettyBytes from \"pretty-bytes\";\nimport DomPurify from \"dompurify\";\n//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\n//#region src/capitalize.ts\n/**\n* Uppercases first letter of string\n* @param string to be capitalized first string, e.g. \"workflow\"\n* @return Capitalized String, e.g. \"Workflow\"\n*/\nvar capitalize = (input) => input.charAt(0).toUpperCase() + input.substring(1);\nvar formats = {\n\tcustomFormat: (input, delimiter) => capitalize(input.replace(delimiter, \" \").toLowerCase()),\n\tkebabFormat: (input) => formats.customFormat(input, \"-\"),\n\tsnakeFormat: (input) => formats.customFormat(input, \"_\"),\n\tcamelPascalCase: (input) => capitalize((input.match(/([A-Z]?[^A-Z]*)/g) ?? []).slice(0, -1).join(\" \").toLowerCase())\n};\nvar caseFormatter = ({ string, delimiter, format }) => {\n\tif (delimiter) return formats.customFormat(string, delimiter);\n\tif (format) return formats[format](string, delimiter ?? \"\");\n\treturn capitalize(string);\n};\n//#endregion\n//#region src/updateDate.ts\n/**\n* Updates the date part (year, day and month) of a date object (base)\n* time, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract day, month and year from this date object.\n* @returns Copy of base with day, month and year of date.\n*/\nvar updateDate_default = (base, date) => {\n\tif (date) {\n\t\tbase = isValid(base) ? base : new Date(Date.UTC(0, 0));\n\t\treturn set(base, {\n\t\t\tyear: getYear(date),\n\t\t\tmonth: getMonth(date),\n\t\t\tdate: getDate(date)\n\t\t});\n\t}\n\treturn base;\n};\n//#endregion\n//#region src/updateTime.ts\n/**\n* Updates the time part (hour, minute, second and millisecond) of a date object (base)\n* date, offset (timezone) and so on will be left untouched.\n*\n* @param base - Date which will be used (copied) to set day, month and year.\n* @param date - Extract hour, minute, second and millisecond from this date object.\n* @returns Copy of base with hour, minute, second and millisecond changed.\n*/\nvar updateTime_default = (base, date) => {\n\tconst d = new Date(base);\n\tif (date) {\n\t\td.setHours(date.getHours());\n\t\td.setMinutes(date.getMinutes());\n\t\td.setSeconds(date.getSeconds());\n\t\td.setMilliseconds(date.getMilliseconds());\n\t}\n\treturn d;\n};\n//#endregion\n//#region src/dateMinMaxCheck.ts\n/**\n* Check if date is before min.\n* @param date\n* @param min\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isBeforeMinDate = (date, min, checkDate, checkTime) => {\n\tif (min) {\n\t\tif (checkTime && checkDate) return isBefore(date, min);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateTime_default(base, date), updateTime_default(base, min));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isBefore(updateDate_default(base, date), updateDate_default(base, min));\n\t\t}\n\t}\n\treturn false;\n};\n/**\n* Check\n* @param date - date to check.\n* @param max - maximum date.\n* @param checkDate - check date part (year, day, month).\n* @param checkTime - check time part (hour, minutes etc.).\n* @returns whether limit is kept or not.\n*/\nvar isAfterMaxDate = (date, max, checkDate, checkTime) => {\n\tif (max) {\n\t\tif (checkTime && checkDate) return isAfter(date, max);\n\t\tif (checkTime) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateTime_default(base, date), updateTime_default(base, max));\n\t\t}\n\t\tif (checkDate) {\n\t\t\tconst base = /* @__PURE__ */ new Date(0);\n\t\t\treturn isAfter(updateDate_default(base, date), updateDate_default(base, max));\n\t\t}\n\t}\n\treturn false;\n};\n//#endregion\n//#region src/debounce.ts\nvar debounce = (callback, wait) => {\n\tlet timer;\n\tlet lastCall = 0;\n\treturn (...args) => {\n\t\tconst [value, index] = args;\n\t\tclearTimeout(timer);\n\t\tconst now = Date.now();\n\t\tif (now - lastCall > wait) {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t} else timer = setTimeout(() => {\n\t\t\tlastCall = now;\n\t\t\tcallback(value, index);\n\t\t}, wait);\n\t};\n};\nvar filters = Object.assign({}, ...[\n\t{\n\t\tid: \"search\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\treturn caseSensitiveSearch ? searchTerm : searchTerm.toLowerCase();\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = (caseSensitiveSearch ? text : text.toLowerCase()).includes(normalizedSearchTerm);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"wildcard\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\tif (searchTerm.length > 0) searchTerm = `^${searchTerm.replace(/[-[\\]{}()+.,\\\\^$|#\\s]/g, \"\\\\$&\").replace(/\\*/g, \".*\").replace(/\\?/g, \".?\")}$`;\n\t\t\telse return { test: () => false };\n\t\t\ttry {\n\t\t\t\treturn new RegExp(searchTerm, caseSensitiveSearch ? \"\" : \"i\");\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"regex\",\n\t\tnormalize(searchTerm, caseSensitiveSearch) {\n\t\t\ttry {\n\t\t\t\tconst flags = caseSensitiveSearch ? \"\" : \"i\";\n\t\t\t\treturn new RegExp(`^(${searchTerm})$`, flags);\n\t\t\t} catch (_error) {\n\t\t\t\treturn /$^/;\n\t\t\t}\n\t\t},\n\t\ttest(text, normalizedSearchTerm, caseSensitiveSearch, inverseSearch) {\n\t\t\tconst matches = normalizedSearchTerm.test(text);\n\t\t\treturn inverseSearch ? !matches : matches;\n\t\t}\n\t},\n\t{\n\t\tid: \"type\",\n\t\tnormalize(selectedTypes) {\n\t\t\treturn { test: (type) => selectedTypes.includes(type) };\n\t\t},\n\t\ttest(type, normalizedSearchTerm) {\n\t\t\tif (typeof type === \"undefined\") return false;\n\t\t\treturn normalizedSearchTerm.test(type);\n\t\t}\n\t}\n].map((obj) => ({ [obj.id]: obj })));\n//#endregion\n//#region src/localTimezone.ts\n/**\n* Get the users local timezone.\n*\n* @returns current users timezone (browser based) tz db string (e. g. Europe/Berlin).\n*/\nvar localTimezone_default = () => Intl.DateTimeFormat().resolvedOptions().timeZone;\n//#endregion\n//#region src/format.ts\n/**\n* Converts the specified date String to human readable text containing the day, month, and year.\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018'\n*\n* @param dateString String representation of the Date to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date String\n*/\nvar formatDateString = (dateString, useTimeZone = false) => {\n\tconst date = new Date(dateString);\n\tif (isNaN(date)) throw Error(\"Invalid Date format\");\n\tconst baseDateOptions = {\n\t\tday: \"numeric\",\n\t\tmonth: \"short\",\n\t\tyear: \"numeric\"\n\t};\n\tconst dateOptions = useTimeZone ? {\n\t\t...baseDateOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseDateOptions;\n\treturn date.toLocaleDateString(\"en-US\", dateOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the hour (12-hour) and minute.\n* Example: '2018-07-31T09:44:31+00:00' => '9:44 AM'\n*\n* @param timeString String representation of the Date (including time) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable time String\n*/\nvar formatTimeString = (timeString, useTimeZone = false) => {\n\tconst time = new Date(timeString);\n\tif (isNaN(time)) throw Error(\"Invalid Date format\");\n\tconst baseTimeOptions = {\n\t\thour: \"numeric\",\n\t\tminute: \"2-digit\"\n\t};\n\tconst timeOptions = useTimeZone ? {\n\t\t...baseTimeOptions,\n\t\ttimeZone: localTimezone_default()\n\t} : baseTimeOptions;\n\treturn time.toLocaleTimeString(\"en-US\", timeOptions);\n};\n/**\n* Converts the specified time String to human readable text containing the date (day, month, year) and time (hour,\n* minute; 12-hour).\n* Example: '2018-07-31T09:44:31+00:00' => 'Jul 31, 2018 9:44 AM'\n*\n* @param dateTimeString String representation of the Date (including time and date) to format\n* @param useTimeZone to set the timeZone where the user is located, and display local date and time\n* @returns human readable date/time String\n*/\nvar formatDateTimeString = (dateTimeString, useTimeZone = false) => {\n\treturn `${formatDateString(dateTimeString, useTimeZone)} ${formatTimeString(dateTimeString, useTimeZone)}`;\n};\n/**\n* Converts the specified date and time to the user time zone with option to display (day, month, year) only or with time (hour,\n* minute; 12-hour).\n*\n* @param showTime String representation of the Date to convert and format\n* @param String | number} date String representation of the Date to convert and format\n* @returns human readable date/time String converted to user time zone\n*/\nvar formatLocalDateTimeString = (date, showTime) => showTime ? formatDateTimeString(date, true) : formatDateString(date, true);\nvar formatFileSize = (bytes) => {\n\treturn prettyBytes(Number.isFinite(bytes) && bytes >= 0 ? bytes : 0);\n};\n//#endregion\n//#region src/getDeepActiveElement.ts\nvar getDeepActiveElement = () => {\n\tlet element = document?.activeElement;\n\twhile (element?.shadowRoot) element = element?.shadowRoot?.activeElement;\n\treturn element;\n};\n//#endregion\n//#region src/getWrappedAroundIndex.ts\n/**\n* Since (a % b) yields a negative outcome for negative a, we need this method in order\n* to correctly compute wrapped around indices in lists\n* @param {number} index an arbitrary integer\n* @param {number} length a positive integer\n* @returns {number} the non-negative modulo outcome\n*/\nvar getWrappedAroundIndex_default = (index, length) => (index % length + length) % length;\n//#endregion\n//#region src/intervalUtils.ts\nvar intervalUtils_exports = /* @__PURE__ */ __exportAll({\n\tformatIntervalToHumanReadableIntervalString: () => formatIntervalToHumanReadableIntervalString,\n\tformatIntervalToISOIntervalString: () => formatIntervalToISOIntervalString,\n\tisValidHumanReadableIntervalString: () => isValidHumanReadableIntervalString,\n\tisValidISOIntervalString: () => isValidISOIntervalString,\n\tisValidIntervalString: () => isValidIntervalString,\n\tisZero: () => isZero,\n\tparseGenericIntervalString: () => parseGenericIntervalString,\n\tparseHumanReadableIntervalString: () => parseHumanReadableIntervalString,\n\tparseISOIntervalString: () => parseISOIntervalString\n});\nvar extractPeriodFromRegexMatch = (negative, match) => {\n\treturn {\n\t\tnegative,\n\t\tyears: parseInt(match[1] ?? \"0\", 10),\n\t\tmonths: parseInt(match[2] ?? \"0\", 10),\n\t\tweeks: parseInt(match[3] ?? \"0\", 10),\n\t\tdays: parseInt(match[4] ?? \"0\", 10)\n\t};\n};\nvar extractDurationFromRegexMatch = (negative, match) => {\n\tconst milliseconds = parseInt(match[4]?.padEnd(3, \"0\") ?? \"0\", 10);\n\treturn {\n\t\tnegative,\n\t\thours: parseInt(match[1] ?? \"0\", 10),\n\t\tminutes: parseInt(match[2] ?? \"0\", 10),\n\t\tseconds: parseInt(match[3] ?? \"0\", 10),\n\t\tmilliseconds\n\t};\n};\nvar isZero = (interval) => {\n\tif (interval.type === \"DATE\") return interval.interval.years === 0 && interval.interval.months === 0 && interval.interval.weeks === 0 && interval.interval.days === 0;\n\telse return interval.interval.hours === 0 && interval.interval.minutes === 0 && interval.interval.seconds === 0 && interval.interval.milliseconds === 0;\n};\n/**\n* Take an interval object and convert it to an ISO duration or period string. All parts of the\n* relevant part of the Interval object are included in the output, even if they are zero.\n*\n* Technically the ISO standard allows to mix period and duration parts, but we don't support that\n* here because it's incredibly hard to deal with all the edge cases. Maybe in a future ticket.\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output.\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToISOIntervalString = (toFormat) => {\n\tlet output = \"P\";\n\tif (toFormat.type === \"DATE\") output += `${toFormat.interval.years}Y${toFormat.interval.months}M${toFormat.interval.weeks}W${toFormat.interval.days}D`;\n\telse output += `T${toFormat.interval.hours}H${toFormat.interval.minutes}M${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")}S`;\n\tif (toFormat.interval.negative) output = `-${output}`;\n\treturn output;\n};\n/**\n* Take an interval object and convert it to a human readable string. Only non-zero parts are\n* included in the output (unless all parts are 0).\n*\n* The output here is allowed to be negative, in which case the minus sign is prepended to the\n* output and we wrap the whole thing in brackets e.g. -(1 year 2 days).\n*\n* @param toFormat The PeriodOrDuration object to format\n*/\nvar formatIntervalToHumanReadableIntervalString = (toFormat) => {\n\tconst formatPart = (value, unit) => {\n\t\tif (value === 0) return \"\";\n\t\telse if (value === 1) return `${value} ${unit} `;\n\t\telse return `${value} ${unit}s `;\n\t};\n\tlet output = \"\";\n\tif (toFormat.type === \"DATE\") {\n\t\tif (isZero(toFormat)) return \"0 days\";\n\t\toutput += formatPart(toFormat.interval.years, \"year\");\n\t\toutput += formatPart(toFormat.interval.months, \"month\");\n\t\toutput += formatPart(toFormat.interval.weeks, \"week\");\n\t\toutput += formatPart(toFormat.interval.days, \"day\");\n\t} else {\n\t\tif (isZero(toFormat)) return \"0 seconds\";\n\t\toutput += formatPart(toFormat.interval.hours, \"hour\");\n\t\toutput += formatPart(toFormat.interval.minutes, \"minute\");\n\t\tconst milliSecondsZero = toFormat.interval.milliseconds === 0;\n\t\tif (toFormat.interval.seconds !== 0 || !milliSecondsZero) if (milliSecondsZero) output += formatPart(toFormat.interval.seconds, \"second\");\n\t\telse output += `${toFormat.interval.seconds}.${toFormat.interval.milliseconds.toString().padStart(3, \"0\")} seconds `;\n\t}\n\tif (toFormat.interval.negative) output = `-(${output.trim()})`;\n\treturn output.trim();\n};\nvar yearsPart = \"(\\\\d+)\\\\s*y(?:ears?)?\";\nvar monthsPart = \"(\\\\d+)\\\\s*m(?:o(?:nths?)?)?\";\nvar weeksPart = \"(\\\\d+)\\\\s*w(?:eeks?)?\";\nvar daysPart = \"(\\\\d+)\\\\s*d(?:ays?)?\";\nvar hoursPart = \"(\\\\d+)\\\\s*h(?:ours?)?\";\nvar minutesPart = \"(\\\\d+)\\\\s*m(?:in(?:s|utes?)?)?\";\nvar secondsPart = \"(\\\\d+)(?:[,.](\\\\d{1,3}))?\\\\s*s(?:ec(?:s|onds?)?)?\";\n/**\n* Matches a human readable period string, e.g. \"1y 2mo 3weeks 4day\" (each part is optional)\n*/\nvar humanReadablePeriodRegex = new RegExp(`^(?:${yearsPart})?\\\\s*(?:${monthsPart})?\\\\s*(?:${weeksPart})?\\\\s*(?:${daysPart})?\\\\s*$`, \"i\");\n/**\n* Matches a human readable duration string, e.g. \"1h 2m 3.456s\" (each part is optional)\n*/\nvar humanReadableDurationRegex = new RegExp(`^(?:${hoursPart})?\\\\s*(?:${minutesPart})?\\\\s*(?:${secondsPart})?$`, \"i\");\n/**\n* Matches a negative human readable period string, e.g. \"-(1y 2mo 3weeks 4day)\" (each part is optional)\n*/\nvar negativeHumanReadablePeriodRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadablePeriodRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable period string with one field like \"-1y\" or \"-1w\"\n*/\nvar negativeHumanReadablePeriodRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${yearsPart}|${monthsPart}|${weeksPart}|${daysPart})\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string, e.g. \"-(1h 2m 3.456s)\" (each part is optional)\n*/\nvar negativeHumanReadableDurationRegex = new RegExp(`^\\\\s*-\\\\s*\\\\(\\\\s*${humanReadableDurationRegex.source.replace(/[$^]/g, \"\")}\\\\s*\\\\)\\\\s*$`, \"i\");\n/**\n* Matches a negative human readable duration string with one field like \"-1h\" or \"-1.5s\"\n*/\nvar negativeHumanReadableDurationRegexWithSingleField = new RegExp(`^\\\\s*-\\\\s*(?:\\\\s*${hoursPart}|${minutesPart}|${secondsPart})\\\\s*$`, \"i\");\n/**\n* Try to parse a human readable interval string into an Interval object. Any parts not specified\n* are assumed to be zero. Note that the string must be either a period or a duration, not a mix of\n* both. So for example, \"1y 2mo 3weeks 4day\" is fine, as is \"1h 2m 3.456s\". However, \"1y 2mo 1sec\"\n* is not, since it's a mix of both.\n*\n* Negative intervals are allowed, although if multiple fields are provided the string must include\n* brackets, so \"-(1y 2mo)\" is also valid, as is \"-5 seconds\".\n*\n* The string is required to have at least some content, any string that is blank will throw an error.\n*\n* @param intervalString The human readable time string\n*/\nvar parseHumanReadableIntervalString = (intervalString) => {\n\tintervalString = intervalString?.trim();\n\tif (!intervalString) throw new Error(\"Empty interval string\");\n\tconst matchPositivePeriod = humanReadablePeriodRegex.exec(intervalString);\n\tconst matchNegativePeriod = negativeHumanReadablePeriodRegex.exec(intervalString) ?? negativeHumanReadablePeriodRegexWithSingleField.exec(intervalString);\n\tconst matchPositiveDuration = humanReadableDurationRegex.exec(intervalString);\n\tconst matchNegativeDuration = negativeHumanReadableDurationRegex.exec(intervalString) ?? negativeHumanReadableDurationRegexWithSingleField.exec(intervalString);\n\tconst matchPeriod = matchPositivePeriod ?? matchNegativePeriod;\n\tconst matchDuration = matchPositiveDuration ?? matchNegativeDuration;\n\tconst negative = (matchNegativePeriod ?? matchNegativeDuration) !== null;\n\tif (matchDuration && matchPeriod) throw new Error(\"Ambiguous time format\");\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(negative, matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(negative, matchDuration)\n\t};\n\telse throw new Error(`Invalid human readable time: ${intervalString}`);\n};\n/**\n* Check if the given string can be understood as a human readable duration or period string. The\n* type parameter specifies whether the string should be a date, time, or either.\n*\n* @param time the string to check\n* @param expectedType the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidHumanReadableIntervalString = (time, expectedType) => {\n\ttry {\n\t\tconst validationResult = parseHumanReadableIntervalString(time);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === expectedType || expectedType === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Convert an ISO duration OR period string to an Interval object. So for example,\n* \"P1Y2M3W4D\" is fine, as is \"PT1H2M3.456S\". However, \"P1Y2M3W4D1H2M3.456S\" is not, since\n* it's a mix of both. We're more forgiving than the ISO standard, so we allow for missing parts.\n* Also, the string is allowed to be negative, so \"-P1Y2M3W4D\" is also valid.\n*\n* The string is required to have at least some content, so the strings \"\", \"P\", and \"PT\" are\n* considered invalid (also if they start with a -).\n*\n* @param isoString The ISO duration or period string.\n*/\nvar parseISOIntervalString = (isoString) => {\n\tisoString = isoString?.trim();\n\tif ([\n\t\t\"\",\n\t\t\"P\",\n\t\t\"PT\",\n\t\t\"-\",\n\t\t\"-P\",\n\t\t\"-PT\"\n\t].includes(isoString)) throw new Error(\"Empty ISO duration\");\n\tconst periodRegex = /^-?P(?:(\\d+)Y)?(?:(\\d+)M)?(?:(\\d+)W)?(?:(\\d+)D)?$/;\n\tconst durationRegex = /^-?PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)(?:[,.](\\d{1,3}))?S)?$/;\n\tconst matchPeriod = periodRegex.exec(isoString);\n\tconst matchDuration = durationRegex.exec(isoString);\n\tif (matchPeriod) return {\n\t\ttype: \"DATE\",\n\t\tinterval: extractPeriodFromRegexMatch(isoString.startsWith(\"-\"), matchPeriod)\n\t};\n\telse if (matchDuration) return {\n\t\ttype: \"TIME\",\n\t\tinterval: extractDurationFromRegexMatch(isoString.startsWith(\"-\"), matchDuration)\n\t};\n\telse throw new Error(`Invalid ISO duration: ${isoString}`);\n};\n/**\n* Check if the given string is a valid duration or period ISO string. The type parameter\n* specifies whether the string should be a date, time, or either.\n*\n* @param isoString the string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidISOIntervalString = (isoString, type) => {\n\ttry {\n\t\tconst validationResult = parseISOIntervalString(isoString);\n\t\tconst actualType = validationResult.type;\n\t\tconst negative = validationResult.interval.negative;\n\t\tif (actualType === type || type === \"DATE_OR_TIME\") return {\n\t\t\tvalid: true,\n\t\t\ttype: actualType,\n\t\t\tnegative\n\t\t};\n\t\telse return { valid: false };\n\t} catch (_e) {\n\t\treturn { valid: false };\n\t}\n};\n/**\n* Try to convert an interval string to an Interval object. The string can be either an ISO\n* duration/period string or a human readable string. If the string is not valid, an error is\n* thrown.\n*\n* @param time the time string, either ISO or human readable\n*/\nvar parseGenericIntervalString = (time) => {\n\tconst validISO = isValidISOIntervalString(time, \"DATE_OR_TIME\");\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, \"DATE_OR_TIME\");\n\tif (validISO.valid) return parseISOIntervalString(time);\n\telse if (validHumanReadable.valid) return parseHumanReadableIntervalString(time);\n\telse throw new Error(`Invalid interval string: ${time}`);\n};\n/**\n* Check if the given string is a valid interval string, either human readable or ISO. The type parameter\n* specifies whether the string should be a period, duration, or either.\n*\n* @param time the time string to check\n* @param type the type of the string - either \"DATE\", \"TIME\", or \"ANY\"\n*/\nvar isValidIntervalString = (time, type) => {\n\tconst validISO = isValidISOIntervalString(time, type);\n\tconst validHumanReadable = isValidHumanReadableIntervalString(time, type);\n\tif (validISO.valid) return validISO;\n\telse if (validHumanReadable.valid) return validHumanReadable;\n\telse return { valid: false };\n};\n//#endregion\n//#region src/numIntegerDigits.ts\n/**\n* Count the number of integer digits for a given number.\n*\n* @param input number.\n* @returns number of integer digits x has. 1234 = 4 but 1234.44 is also 4.\n*/\nvar numIntegerDigits_default = (input) => Math.max(Math.floor(Math.log10(Math.abs(input))), 0) + 1;\n//#endregion\n//#region src/promise/createAbortablePromise.ts\nvar AbortError = class extends Error {};\n/**\n* Helper to create an abortable promise. Returns an AbortController and a Function\n* that you can pass your async handler to. Whenever the AbortController signal is\n* aborted then the async handler's promise will reject with an AbortError\n*\n* Example:\n* ```\n* import { abortUtils } from \"@knime/utils\"\n* const myFetchCall = async (params...) => {...};\n*\n* try {\n* const { runAbortablePromise, abortController } = createAbortablePromise(() =>\n* myFetchCall(params...),\n* );\n* } catch (e) {\n* if (e instanceof abortUtils.AbortError) {\n* console.info('ignore due to abort');\n* return;\n* }\n* }\n*\n* // somewhere else (while request is in-flight)\n* abortController.abort(new abortUtils.AbortError('reason here'))\n* ```\n*/\nvar createAbortablePromise = () => {\n\tconst abortController = new AbortController();\n\tconst runAbortablePromise = (request) => {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst abortListener = ({ target }) => {\n\t\t\t\tabortController.signal.removeEventListener(\"abort\", abortListener);\n\t\t\t\tconst reason = target.reason;\n\t\t\t\treject(reason instanceof AbortError ? reason : new AbortError(reason));\n\t\t\t};\n\t\t\trequest().then(resolve).catch((error) => {\n\t\t\t\tif (error instanceof AbortError) return;\n\t\t\t\treject(error);\n\t\t\t});\n\t\t\tabortController.signal.addEventListener(\"abort\", abortListener);\n\t\t});\n\t};\n\treturn {\n\t\tabortController,\n\t\trunAbortablePromise\n\t};\n};\n//#endregion\n//#region src/promise/createUnwrappedPromise.ts\nvar createUnwrappedPromise = () => {\n\tlet resolve = () => {};\n\tlet reject = () => {};\n\tconst promise = new Promise((res, rej) => {\n\t\tresolve = res;\n\t\treject = rej;\n\t});\n\treturn {\n\t\tresolve,\n\t\treject,\n\t\tpromise\n\t};\n};\n//#endregion\n//#region src/sleep.ts\n/**\n* Returns promise that resolves after ms.\n*/\nfunction sleep(ms) {\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\n}\n/**\n* Helper to add retry capability to an async function\n* @param fn async function\n* @param retryCount max number of retries. defaults to 5\n* @param retryDelayMS delay in-between retries in millisecs. defaults to 0\n* @param excludeError predicate fn to exclude specific errors from causing a retry\n*/\nasync function retryPromise({ fn, retryCount = 5, retryDelayMS = 0, excludeError }) {\n\ttry {\n\t\treturn await fn();\n\t} catch (error) {\n\t\tif (excludeError?.(error)) throw error;\n\t\tif (retryCount > 0) {\n\t\t\tawait sleep(retryDelayMS);\n\t\t\treturn await retryPromise({\n\t\t\t\tfn,\n\t\t\t\tretryCount: retryCount - 1,\n\t\t\t\tretryDelayMS,\n\t\t\t\texcludeError\n\t\t\t});\n\t\t}\n\t\tthrow error;\n\t}\n}\n//#endregion\n//#region src/promise/index.ts\nvar promise_exports = /* @__PURE__ */ __exportAll({\n\tAbortError: () => AbortError,\n\tDEFAULT_RETRY_COUNT: () => 5,\n\tDEFAULT_RETRY_DELAY_MS: () => 0,\n\tcreateAbortablePromise: () => createAbortablePromise,\n\tcreateUnwrappedPromise: () => createUnwrappedPromise,\n\tretryPromise: () => retryPromise\n});\n//#endregion\n//#region src/sanitization.ts\nvar ALLOWED_TAGS = [\n\t\"p\",\n\t\"div\",\n\t\"h1\",\n\t\"h2\",\n\t\"h3\",\n\t\"h4\",\n\t\"h5\",\n\t\"h6\",\n\t\"ul\",\n\t\"ol\",\n\t\"li\",\n\t\"blockquote\",\n\t\"b\",\n\t\"i\",\n\t\"s\",\n\t\"u\",\n\t\"sup\",\n\t\"sub\",\n\t\"ins\",\n\t\"del\",\n\t\"strong\",\n\t\"strike\",\n\t\"tt\",\n\t\"code\",\n\t\"big\",\n\t\"small\",\n\t\"br\",\n\t\"span\",\n\t\"em\"\n];\n/**\n* Sanitizes Raw HTML and only allow specific tags to be used, as per OWASP standards.\n* @param rawHTML\n* @param options.allowStyleAttribute - Allow the style attribute on elements\n* @param options.allowHyperlinks - Allow anchor tags with href attribute\n* @returns sanitized html\n*/\nvar sanitizeHTML = (rawHTML, options = {\n\tallowStyleAttribute: false,\n\tallowHyperlinks: false\n}) => {\n\tconst { allowStyleAttribute, allowHyperlinks } = options;\n\tconst ALLOWED_ATTR = [...allowStyleAttribute ? [\"style\"] : [], ...allowHyperlinks ? [\"href\"] : []];\n\tconst allowedTags = allowHyperlinks ? [...ALLOWED_TAGS, \"a\"] : ALLOWED_TAGS;\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: allowedTags,\n\t\tALLOWED_ATTR\n\t});\n};\n/**\n* Removes any HTML tag from the input string. Keeps HTML entities\n* (e.g because these can be considered plain text)\n* @param rawHTML\n* @returns plain text\n*/\nvar stripHTML = (rawHTML) => {\n\treturn DomPurify.sanitize(rawHTML, {\n\t\tALLOWED_TAGS: [],\n\t\tALLOWED_ATTR: []\n\t});\n};\nvar sanitization = {\n\tsanitizeHTML,\n\tstripHTML\n};\n//#endregion\n//#region src/truncateString.ts\nvar defaultMaxLength = 160;\nvar truncateString_default = (string = \"\", maxLength = defaultMaxLength) => {\n\tconst dots = string.length > maxLength ? \"…\" : \"\";\n\treturn `${string.substring(0, maxLength - 1)}${dots}`;\n};\n//#endregion\n//#region src/fileExtensions.ts\n/**\n* Gets the file extension\n* @param nameOrPath can take a full file name (e.g \"file.txt\") or a path to a file\n* (e.g \"file://path/to/file.txt\" OR \"/path/to/file.txt\")\n* @returns just the file extension (e.g \"txt\")\n*/\nvar getFileExtension = (nameOrPath) => {\n\tconst basename = nameOrPath.split(/[\\\\/]/).pop() ?? \"\";\n\tconst parts = basename.split(\".\");\n\tif (basename === \"\" || parts.length === 1) return \"\";\n\treturn parts.at(-1) ?? \"\";\n};\n/**\n* Metadata for .knar files, which corresponds to exported KNIME Workflow Groups\n* or Components\n*/\nvar KNAR = Object.freeze({\n\textension: \"knar\",\n\tmimeType: \"application/vnd.knime.workflow-group+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t}\n});\n/**\n* Metadata for .knwf files, which corresponds to exported KNIME Workflows\n*/\nvar KNWF = Object.freeze({\n\textension: \"knwf\",\n\tmimeType: \"application/vnd.knime.workflow+zip\",\n\tmatches(file) {\n\t\treturn getFileExtension(file.name) === this.extension;\n\t},\n\t/**\n\t* Gets the name of a .knwf file without the extension. If the file is not\n\t* matched as a .knwf file then this function will return the default value,\n\t* which is empty string (\"\") if param is not provided\n\t*/\n\tgetNameOrDefault(file, defaultValue = \"\") {\n\t\tif (!this.matches(file)) return defaultValue;\n\t\treturn file.name.replace(`.${this.extension}`, \"\");\n\t}\n});\nvar knimeFileFormats = {\n\tKNAR,\n\tKNWF\n};\n/**\n* Gets the mime type from a given file. Defaults to `application/octet-stream`\n* if mimeType cannot be detected\n* @param file File\n* @returns mimeType\n*/\nvar getFileMimeType = (file) => {\n\tconst DEFAULT_MIMETYPE = \"application/octet-stream\";\n\tif (!getFileExtension(file.name)) return DEFAULT_MIMETYPE;\n\tif (KNWF.matches(file)) return KNWF.mimeType;\n\tif (KNAR.matches(file)) return KNAR.mimeType;\n\tif (!file.type) return DEFAULT_MIMETYPE;\n\treturn file.type;\n};\n//#endregion\n//#region src/hotkeys/enums.ts\n/**\n* Platforms that influence how modifier keys are rendered. macOS substitutes\n* dedicated glyphs (`⌘`, `⌥`, `⇧`, …), every other platform uses the textual\n* rendering (`Ctrl`, `Alt`, `Shift`, …).\n*/\nvar hotkeyPlatform = {\n\tMAC_OS: \"macOS\",\n\tOTHER: \"other\"\n};\nObject.values(hotkeyPlatform);\n//#endregion\n//#region src/platform/navigator.ts\nvar navigator_exports = /* @__PURE__ */ __exportAll({\n\tisMac: () => isMac,\n\tisWindows: () => isWindows\n});\n/**\n*\n* @returns true if the platform of the user is Mac\n*/\nvar isMac = () => navigator?.userAgent?.toLowerCase()?.includes(\"mac\");\n/**\n*\n* @returns true if the platform of the user is Windows\n*/\nvar isWindows = () => navigator?.userAgent?.toLowerCase()?.includes(\"windows\");\n//#endregion\n//#region src/hotkeys/format.ts\nvar globalKeyMap = {\n\tArrowUp: \"↑\",\n\tArrowDown: \"↓\",\n\tArrowLeft: \"←\",\n\tArrowRight: \"→\",\n\tEnter: \"↵\",\n\t\" \": \"Space\",\n\tCtrlOrCmd: \"Ctrl\"\n};\nvar MacOSkeyMap = {\n\tShift: \"⇧\",\n\tDelete: \"⌫\",\n\tCtrlOrCmd: \"⌘\",\n\tCtrl: \"⌃\",\n\tAlt: \"⌥\",\n\tEnter: \"↩\"\n};\n/**\n* Returns a string representation of a single hotkey. Replaces some special key names with symbols.\n*\n* By default the platform is auto-detected from the user agent via `isMac()`.\n* Pass `platform` to force a specific platform's glyphs — useful for SSR,\n* tests, or rendering multiple platforms on the same page.\n*/\nvar formatHotkey = (hotkey, platform) => {\n\t/**\n\t* Returns the symbol corresponding to the `key` based on the given\n\t* `formatMap`. Otherwise, if not found, returns the same `key` value given\n\t*/\n\tconst mapSymbols = (formatMap) => (key) => formatMap[key] ?? key;\n\t/**\n\t* Pipe function implementation. Receives a list of functions to execute in order\n\t* and will pipe the parameter passed at the end to each function returning the final output\n\t*/\n\tconst pipe = (...fns) => fns.reduce((f, g) => (arg) => g(f(arg)), (arg) => arg);\n\tconst macKeyFormatter = pipe(mapSymbols(MacOSkeyMap), mapSymbols(globalKeyMap));\n\tconst generalKeyFormatter = mapSymbols(globalKeyMap);\n\treturn (platform === void 0 ? isMac() : platform === hotkeyPlatform.MAC_OS) ? macKeyFormatter(hotkey) : generalKeyFormatter(hotkey);\n};\nvar getDefaultSeparator = () => isMac() ? \" \" : \"+\";\n/**\n* Returns a string representation of a list of hotkeys. Replaces some special key names with symbols\n*/\nvar formatHotkeys = (hotkeys, getSeparator = getDefaultSeparator) => hotkeys.map((hotkey) => formatHotkey(hotkey)).join(getSeparator());\n/**\n* Appends a formatted hotkey shortcut to the given string. Useful for tooltips\n*/\nvar textWithHotkeys = (text, hotkeys) => {\n\treturn `${text} – ${formatHotkeys(hotkeys)}`;\n};\n//#endregion\n//#region src/hotkeys/match.ts\n/**\n* Checks whether a pressed `Digit` key falls within a numeric hotkey range such\n* as `1-9`.\n* @param keyCode - The `KeyboardEvent.code` to check (e.g. `Digit5`).\n* @param hotkey - The hotkey token, expected to be a single-digit range like `1-9`.\n* @returns True if the pressed digit lies within the inclusive range.\n*/\nvar isDigitKeyInRange = (keyCode, hotkey) => {\n\tif (hotkey.length !== 3 || !keyCode?.startsWith(\"Digit\")) return false;\n\tconst keyNumber = Number(keyCode.slice(5));\n\tconst [lower, upper] = hotkey.split(\"-\");\n\treturn Boolean(lower) && Boolean(upper) && Number.parseInt(lower, 10) <= keyNumber && keyNumber <= Number.parseInt(upper, 10);\n};\n/**\n* Checks whether a keyboard event matches a hotkey definition. The last token is\n* treated as the character; any preceding tokens are modifiers. The special\n* `CtrlOrCmd` modifier resolves to the platform's primary modifier (Meta/`⌘` on\n* macOS, Ctrl elsewhere).\n* @param event - The keyboard event to check.\n* @param hotkeys - The ordered hotkey tokens (modifiers followed by the character).\n* @returns True if the event matches the given hotkey, otherwise false.\n*/\nvar match = (event, hotkeys) => {\n\tconst { key, code, metaKey, ctrlKey, shiftKey, altKey } = event;\n\tconst modifiers = hotkeys.slice();\n\tconst character = modifiers.pop() ?? \"\";\n\tconst ctrlOrMeta = isMac() ? \"Meta\" : \"Ctrl\";\n\tconst platformModifiers = new Set(modifiers.map((modifier) => modifier === \"CtrlOrCmd\" ? ctrlOrMeta : modifier));\n\tconst metaMatches = Boolean(metaKey) === platformModifiers.has(\"Meta\");\n\tconst ctrlMatches = Boolean(ctrlKey) === platformModifiers.has(\"Ctrl\");\n\tconst shiftMatches = Boolean(shiftKey) === platformModifiers.has(\"Shift\");\n\tconst altMatches = Boolean(altKey) === platformModifiers.has(\"Alt\");\n\tconst keysMatch = key.toUpperCase() === character.toUpperCase() || character.includes(\"-\") && isDigitKeyInRange(code, character) || isMac() && character === \"Delete\" && key === \"Backspace\";\n\treturn metaMatches && ctrlMatches && shiftMatches && altMatches && keysMatch;\n};\n//#endregion\n//#region src/hotkeys/modifiers.ts\n/**\n* Checks if any modifier key (Ctrl, Meta, Alt, or Shift) is pressed.\n* @param event - The keyboard event to check.\n* @returns True if a modifier key is pressed, otherwise false.\n*/\nvar isModifierKeyPressed = (event) => {\n\treturn event.ctrlKey || event.metaKey || event.altKey || event.shiftKey;\n};\n/**\n* Checks if a specific key (or keys) were pressed without any modifier keys.\n* @param event - The keyboard event to check.\n* @param keys - The key or keys to check for.\n* @returns True if the specified key(s) were pressed without modifiers, otherwise false.\n*/\nvar isKeyWithoutModifiers = (event, keys) => {\n\treturn (Array.isArray(keys) ? keys : [keys]).includes(event.key) && !isModifierKeyPressed(event);\n};\n/**\n* Returns the name of the primary modifier key for the current platform.\n*/\nvar getMetaOrCtrlKey = () => {\n\treturn isMac() ? \"metaKey\" : \"ctrlKey\";\n};\n//#endregion\n//#region src/hotkeys/index.ts\n/**\n* Grouped keyboard-shortcut helpers, exposed as a single namespace for\n* ergonomic access (e.g. `hotkeys.formatHotkey`).\n*/\nvar hotkeys = {\n\tformatHotkeys,\n\tformatHotkey,\n\tgetDefaultSeparator,\n\thotkeyPlatform,\n\ttextWithHotkeys,\n\tmatch\n};\n//#endregion\nexport { capitalize, caseFormatter, debounce, filters, formatDateString, formatDateTimeString, formatFileSize, formatLocalDateTimeString, formatTimeString, getDeepActiveElement, getFileExtension, getFileMimeType, localTimezone_default as getLocalTimeZone, getMetaOrCtrlKey, getWrappedAroundIndex_default as getWrappedAroundIndex, hotkeys, intervalUtils_exports as intervalUtils, isAfterMaxDate, isBeforeMinDate, isKeyWithoutModifiers, isModifierKeyPressed, knimeFileFormats, match, navigator_exports as navigatorUtils, numIntegerDigits_default as numIntegerDigits, promise_exports as promise, sanitization, sleep, truncateString_default as truncateString, updateDate_default as updateDate, updateTime_default as updateTime };\n\n//# sourceMappingURL=index.js.map","import { type InjectionKey, type Ref, computed, inject, provide } from \"vue\";\n\nimport type { TableState } from \"../../types/TableConfig\";\n\n/**\n * Exported for testing purposes\n */\nexport const injectionKey: InjectionKey<{\n isShown: Ref<boolean>;\n close: () => void;\n}> = Symbol(\"dataValueViewsIsShown\");\n\nexport const useDataValueViews = () => inject(injectionKey)!;\n\nexport const provideDataValueViewsIsShown = (\n tableState: Ref<TableState>,\n closeDataValueView: () => void,\n) =>\n provide(injectionKey, {\n isShown: computed(() => Boolean(tableState.value.dataValueViewIsShown)),\n close: closeDataValueView,\n });\n","import { getMetaOrCtrlKey } from \"@knime/utils\";\n\nconst isNavigationKey = (event: KeyboardEvent) =>\n event.key.includes(\"Arrow\") || event.key === \"Tab\" || event.key === \"Escape\";\n\n/**\n * Creates a keydown handler that detects editing-trigger keys and calls the\n * appropriate callback:\n * - Enter (without Shift) / Space → `onExpandAndStartEditing`\n * - Backspace / printable characters (key.length === 1, no Ctrl/Cmd, no Alt)\n * → `onStartEditing`\n *\n * Navigation keys (Arrow, Tab, Escape) and modifier combos (Ctrl/Cmd, Alt)\n * are ignored and left for other handlers.\n */\nexport const useStartEditingKeydown = ({\n onExpandAndStartEditing,\n onStartEditing,\n}: {\n onExpandAndStartEditing: (initialValue?: string) => void;\n onStartEditing: (initialValue?: string) => void;\n}) => {\n const onKeydown = (event: KeyboardEvent) => {\n if (isNavigationKey(event) || event[getMetaOrCtrlKey()]) {\n return;\n }\n if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n onExpandAndStartEditing();\n } else if (event.key === \" \") {\n event.preventDefault();\n onExpandAndStartEditing(\" \");\n } else if (event.key === \"Backspace\") {\n onStartEditing(\"\");\n } else if (!event.altKey && event.key.length === 1) {\n event.preventDefault();\n onStartEditing(event.key);\n }\n };\n\n return { onKeydown };\n};\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport { useDataValueViews } from \"./composables/useDataValueViews\";\nimport { useStartEditingKeydown } from \"./composables/useStartEditingKeydown\";\n\nconst emit = defineEmits<{\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst onArrowKeyDown = (event: KeyboardEvent) => {\n let horizontal = 0;\n let vertical = 0;\n switch (event.key) {\n case \"ArrowLeft\":\n horizontal = -1;\n break;\n case \"ArrowRight\":\n horizontal = 1;\n break;\n case \"ArrowUp\":\n vertical = -1;\n break;\n case \"ArrowDown\":\n vertical = 1;\n break;\n }\n if (horizontal || vertical) {\n event.preventDefault();\n emit(\"moveSelection\", horizontal, vertical, event.shiftKey);\n }\n};\n\nconst { isShown: selectedCellIsExpanded, close: closeExpandedSelectedCell } =\n useDataValueViews();\n\nconst onEscape = (event: KeyboardEvent) => {\n if (selectedCellIsExpanded.value) {\n event.preventDefault();\n event.stopPropagation();\n closeExpandedSelectedCell();\n }\n};\n\nconst onTab = (event: KeyboardEvent) => {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n emit(\"moveSelection\", horizontalMove, 0, false);\n};\n\nconst { onKeydown: onStartEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: (initialValue?: string) => {\n emit(\"expandSelectedCell\");\n emit(\"startEditing\", initialValue);\n },\n onStartEditing: (initialValue?: string) => {\n emit(\"startEditing\", initialValue);\n },\n});\n\nconst onKeyDown = (event: KeyboardEvent) => {\n if (!event[getMetaOrCtrlKey()] && event.key.includes(\"Arrow\")) {\n onArrowKeyDown(event);\n } else if (event.key === \"Tab\") {\n onTab(event);\n } else if (event.key === \"Escape\") {\n onEscape(event);\n } else {\n onStartEditingKeydown(event);\n }\n};\n</script>\n\n<template>\n <tbody\n :tabindex=\"-1\"\n @keydown.self=\"onKeyDown\"\n @focusin=\"emit('bodyFocusin')\"\n @focusout=\"emit('bodyFocusout')\"\n >\n <slot name=\"bodyContent\" />\n <slot name=\"belowBody\" />\n </tbody>\n</template>\n\n<style scoped>\ntbody {\n outline: none;\n}\n</style>\n","import {\n type CSSProperties,\n type InjectionKey,\n type MaybeRef,\n type Ref,\n computed,\n inject,\n provide,\n} from \"vue\";\n\nimport type { IndexStartEnd } from \"@knime/vue-headless-virtual-scroller\";\n\nexport interface Payload {\n horizontal: Ref<IndexStartEnd>;\n horizontalStyles: CSSProperties;\n}\n\nconst injectionKey: InjectionKey<Payload> = Symbol(\n \"useHorizontalIndicesAndStyles.ts\",\n);\n\nexport const provideForHorizontalVirtualScrolling = (payload: Payload) =>\n provide(injectionKey, payload);\n\n/**\n * The horizontal column indices to render plus the style positioning the\n * horizontally virtualized window. While horizontal virtual scrolling is\n * provided the indices are the currently visible column range; otherwise\n * `fallbackIndices` (e.g. all columns) is used.\n */\nconst useHorizontalIndices = (\n fallbackIndices: () => number[],\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const providedForVirtualScrolling = inject(injectionKey, null);\n if (providedForVirtualScrolling) {\n return {\n indices: computed(() =>\n providedForVirtualScrolling.horizontal.value.toArray(),\n ),\n style: providedForVirtualScrolling.horizontalStyles,\n };\n }\n return {\n indices: computed(fallbackIndices),\n style: {},\n };\n};\n\nexport const useIndicesAndStylesFor = <T>(\n data: Ref<T[]>,\n): {\n indexedData: Ref<[T, number][]>;\n style: MaybeRef<CSSProperties>;\n} => {\n const { indices, style } = useHorizontalIndices(() =>\n data.value.map((_, index) => index),\n );\n return {\n indexedData: computed(() =>\n indices.value.map((index) => [data.value[index], index]),\n ),\n style,\n };\n};\n\n/**\n * Like {@link useIndicesAndStylesFor} but for consumers that only need the\n * column indices (not per-column data), e.g. {@link EmptyRow} whose skeleton\n * cells read their width from the `--col-size-<index>` CSS variable rather than\n * from a render-time read of the numeric column sizes. The fallback renders all\n * `numColumns` columns when horizontal virtual scrolling is not provided.\n */\nexport const useColumnIndicesFor = (\n numColumns: Ref<number>,\n): {\n indices: Ref<number[]>;\n style: MaybeRef<CSSProperties>;\n} =>\n useHorizontalIndices(() =>\n Array.from({ length: numColumns.value }, (_, index) => index),\n );\n","import {\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\nexport const getColSizeCSSVar = (index: number) => `--col-size-${index}`;\n\ninterface ColumnSizesContext {\n /**\n * The live numeric column sizes, updated per drag frame during a column\n * resize. Only consume them where this update frequency is wanted (e.g.\n * imperative CSS variable writes), not at render time above the cell tree.\n */\n colSizes: Ref<number[]>;\n /**\n * The column sizes captured at drag start while a column resize is active,\n * identical to the live sizes otherwise. Consumers whose render output must\n * not update per drag frame (e.g. Row's slotted cell width,\n * TableCoreVirtual's column window) read these instead of freezing the live\n * sizes themselves.\n */\n colSizesFrozenWhenResizing: Ref<number[]>;\n /**\n * Whether a column resize drag is currently active. Set by TableUI (the\n * owner of the column resize events); drives the freezing above.\n */\n columnResizeActive: Ref<boolean>;\n}\n\nexport const columnSizesInjectionKey: InjectionKey<ColumnSizesContext> =\n Symbol(\"columnSizes\");\n\n/**\n * Non-reactive override for the injected column sizes. While its `value` is a\n * sizes array, {@link injectColumnSizes} returns those sizes instead of the\n * live ones. Used by the hidden auto-size calculation table so it can render at\n * its own (e.g. maximum) widths without affecting the visible table. It does\n * not need to be reactive: each consumer reads the sizes once when it is set\n * up, and the calculation table is (re)mounted for every calculation, so the\n * override only needs to be set before it mounts and reset to `null` after.\n */\ninterface AutoSizeColumnSizes {\n value: number[] | null;\n}\n\nconst autoSizeColumnSizesInjectionKey: InjectionKey<AutoSizeColumnSizes> =\n Symbol(\"autoSizeColumnSizes\");\n\n/**\n * Provides the {@link AutoSizeColumnSizes} override to descendants and returns\n * methods to set/unset it around an auto-size calculation. Has to be called\n * above the components whose injected sizes should be overridden (i.e. the\n * auto-size calculation table).\n */\nexport const provideAutoSizeColumnSizes = () => {\n const holder: AutoSizeColumnSizes = { value: null };\n provide(autoSizeColumnSizesInjectionKey, holder);\n return {\n setAutoSizeColumnSizes: (sizes: number[]) => {\n holder.value = sizes;\n },\n unsetAutoSizeColumnSizes: () => {\n holder.value = null;\n },\n };\n};\n\n/**\n * Owns the column-size handling for the table. Using a provide/inject pattern to share\n * live sizes with descendants instead of a property, we avoid memory issues arising\n * on column resizing.\n * When switching to @vue/vapor virtualizer, we can remove this again.\n */\nexport const useColumnSizes = (\n colSizes: Ref<number[]>,\n /**\n * An element reference that is either the root of the table or a parent.\n * This element will be used to define the global css variables controlling\n * column widths.\n */\n element: Ref<HTMLElement | null>,\n) => {\n let previousColumnCount = 0;\n watch(\n [colSizes, element],\n ([sizes]) => {\n const el = element.value;\n if (!el) {\n return;\n }\n sizes.forEach((size, index) => {\n el.style.setProperty(getColSizeCSSVar(index), `${size}px`);\n });\n // Remove the CSS variables of columns that no longer exist so they do not\n // linger on the element after the column count shrinks.\n for (let index = sizes.length; index < previousColumnCount; index++) {\n el.style.removeProperty(getColSizeCSSVar(index));\n }\n previousColumnCount = sizes.length;\n },\n { immediate: true },\n );\n\n const columnResizeActive = ref(false);\n const colSizesOnStartColResize = ref<number[] | null>(null);\n watch(columnResizeActive, (active) => {\n colSizesOnStartColResize.value = active ? [...colSizes.value] : null;\n });\n const colSizesFrozenWhenResizing = computed(\n () => colSizesOnStartColResize.value ?? colSizes.value,\n );\n\n const context: ColumnSizesContext = {\n colSizes,\n colSizesFrozenWhenResizing,\n columnResizeActive,\n };\n provide(columnSizesInjectionKey, context);\n return context;\n};\n\nexport const injectColumnSizes = (): ColumnSizesContext => {\n const context = inject(columnSizesInjectionKey);\n if (!context) {\n throw new Error(\n \"No column-size context found. Components from @knime/kds-table must be \" +\n \"rendered below a useColumnSizes provider (see useColumnSizes). Without \" +\n \"it the column-width CSS variables are never set and columns collapse.\",\n );\n }\n // If an auto-size calculation is in progress, transparently override the\n // injected sizes with the ones it wants to render at.\n const autoSizeColumnSizes = inject(autoSizeColumnSizesInjectionKey, null);\n if (autoSizeColumnSizes && autoSizeColumnSizes.value !== null) {\n const sizes = ref(autoSizeColumnSizes.value);\n return {\n ...context,\n colSizes: sizes,\n colSizesFrozenWhenResizing: sizes,\n };\n }\n return context;\n};\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, toRef } from \"vue\";\n\nimport { KdsCheckbox, KdsLoadingSkeleton } from \"@knime/kds-components\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useColumnIndicesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar } from \"../useColumnSizes\";\n\nconst props = defineProps<{\n height: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n\nconst { indices: columnIndices, style: rowStyles } = useColumnIndicesFor(\n toRef(props, \"numColumns\"),\n);\n\nconst paddingTopBottom = computed(() =>\n props.compact\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\n</script>\n\n<template>\n <!--class \"row\" required for deep selector from knime-core-ui-->\n <tr\n :class=\"`row${compact ? ' compact-mode' : ''}`\"\n :style=\"{\n ...rowStyles,\n height: `${height}px`,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell-spacer\" />\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox tooltip=\"Selection\" disabled class=\"select-checkbox\" />\n </td>\n <td\n v-for=\"cellIndex of columnIndices\"\n :key=\"cellIndex\"\n :style=\"{\n width: `var(${getColSizeCSSVar(cellIndex)})`,\n padding: `${paddingTopBottom}px ${CELL_PADDING_HORIZONTAL}px`,\n }\"\n >\n <KdsLoadingSkeleton loading class=\"skeleton\" />\n </td>\n </tr>\n</template>\n\n<style scoped>\ntr {\n display: flex;\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n\n & .skeleton {\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\ndefineProps<{ height: number }>();\n</script>\n\n<template>\n <div class=\"dots\" :style=\"{ height: `${height}px` }\">\n <span> ⋮ </span>\n </div>\n</template>\n\n<style scoped>\n.dots {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n font: var(--kds-font-base-interactive-large);\n color: var(--kds-color-text-and-icon-neutral);\n border-bottom: var(--kds-border-base-subtle);\n\n & span {\n text-align: center;\n pointer-events: none;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport type { DataItem } from \"./TableUI.vue\";\nimport EmptyRow from \"./ui/EmptyRow.vue\";\nimport PlaceholderRow from \"./ui/PlaceholderRow.vue\";\n\ndefineProps<{\n dataItem?: DataItem;\n rowHeight: number;\n compact: boolean;\n numColumns: number;\n tableConfig: TableConfig;\n}>();\n</script>\n\n<template>\n <template v-if=\"dataItem\">\n <template v-if=\"dataItem.dots\">\n <PlaceholderRow :height=\"rowHeight\" />\n </template>\n <slot v-else :row=\"dataItem.data\" />\n </template>\n <EmptyRow\n v-else\n :height=\"rowHeight\"\n :compact=\"compact\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n />\n</template>\n","import {\n type InjectionKey,\n type Ref,\n inject,\n provide,\n ref,\n watchEffect,\n} from \"vue\";\n\n/**\n * CSS variable holding the current table body width (in px). It is written\n * imperatively to the scroll container by {@link useBodyWidth} so that style\n * consumers (the sticky header, the resize scroll spacer) can read the body\n * width via `var(...)` instead of via a render-time read of the live\n * column-size array.\n */\nexport const BODY_WIDTH_CSS_VAR = \"--current-body-width\";\n\nconst bodyWidthInjectionKey: InjectionKey<Ref<number>> = Symbol(\"bodyWidth\");\n\n/**\n * Owns the table body width. Given the live numeric body width and the scroll\n * container element, it\n * - writes the width to {@link BODY_WIDTH_CSS_VAR} on the element (the single\n * source the sticky header and the resize scroll spacer read their width\n * from), and\n * - provides the live numeric body width for the few descendants that genuinely\n * need a number in JS but must not read it every frame (they inject via\n * {@link injectBodyWidth}).\n */\nexport const useBodyWidth = (\n bodyWidth: Ref<number>,\n element: Ref<HTMLElement | null>,\n) => {\n watchEffect(() => {\n element.value?.style.setProperty(\n BODY_WIDTH_CSS_VAR,\n `${bodyWidth.value}px`,\n );\n });\n\n provide(bodyWidthInjectionKey, bodyWidth);\n};\n\nexport const injectBodyWidth = () => inject(bodyWidthInjectionKey, ref(0));\n","import { type InjectionKey, inject, provide, ref } from \"vue\";\n\nconst setup = () => {\n const currentCallback = ref<(() => void) | null>(null);\n\n const registerExpandedSubMenu = (callback: () => void) => {\n // Timeout to prevent the sub menu to be closed due to scroll event triggered by clicking a row/group\n setTimeout(() => {\n currentCallback.value = () => {\n callback();\n currentCallback.value = null;\n };\n }, 100);\n };\n return {\n closeExpandedSubMenu: () => currentCallback.value?.(),\n registerExpandedSubMenu,\n };\n};\n\ntype Provided = ReturnType<typeof setup>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useCloseSubMenusOnScroll.ts\",\n);\n\nexport const provideForCloseSubMenusOnScroll = () =>\n provide(injectionKey, setup());\n\nexport const injectCloseExpandedSubMenu = () =>\n inject(injectionKey)!.closeExpandedSubMenu;\nexport const injectRegisterExpandedSubMenu = () =>\n inject(injectionKey)!.registerExpandedSubMenu;\n","import {\n type CSSProperties,\n type InjectionKey,\n type Ref,\n computed,\n inject,\n provide,\n ref,\n watch,\n} from \"vue\";\n\ntype Provided = Ref<CSSProperties>;\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Provided> = Symbol(\n \"useOverflowStyles.ts\",\n);\n\nconst elIsPresent = (el: HTMLElement | null): el is HTMLElement => Boolean(el);\n\nexport const provideOverflowStyles = ({\n columnResizeActive,\n fitsWithoutHorizontalScrollbar,\n scrolledElement,\n}: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n scrolledElement: Ref<HTMLElement | null>;\n}) => {\n // Captured at the moment column resize starts: was a vertical scrollbar\n // visible at that instant? If yes, we keep it as `overflow-y: scroll` during\n // the resize so that toggling the horizontal scrollbar cannot make the\n // vertical scrollbar appear/disappear (which would cause flickering).\n const verticalScrollbarVisibleAtResizeStart = ref(false);\n // flush: 'sync' so we read scrollHeight/clientHeight the instant\n // columnResizeActive flips true — before any other reactive consumer\n // (notably our own overflow computed) can mutate the DOM and thereby\n // change which scrollbars are visible.\n watch(\n columnResizeActive,\n (active) => {\n if (active) {\n const el = scrolledElement.value;\n verticalScrollbarVisibleAtResizeStart.value =\n elIsPresent(el) && el.scrollHeight > el.clientHeight;\n }\n },\n { flush: \"sync\" },\n );\n\n provide(\n injectionKey,\n computed(() => ({\n overflowX:\n !columnResizeActive.value && !fitsWithoutHorizontalScrollbar.value\n ? \"auto\"\n : \"hidden\",\n overflowY:\n columnResizeActive.value && verticalScrollbarVisibleAtResizeStart.value\n ? \"scroll\"\n : \"auto\",\n })),\n );\n};\n\nexport const useOverflowStyles = () => inject(injectionKey)!;\n","import { type InjectionKey, type Ref, inject, provide, ref } from \"vue\";\n\nimport {\n injectCloseExpandedSubMenu,\n provideForCloseSubMenusOnScroll,\n} from \"./useCloseSubMenusOnScroll\";\nimport { provideOverflowStyles, useOverflowStyles } from \"./useOverflowStyles\";\n\n// Exported for tests\nexport const injectionKey: InjectionKey<Ref<HTMLElement | null>> =\n Symbol(\"scrollContainerRed\");\n\nexport const provideCommonScrollContainerProps = (\n containerRef: Ref<HTMLElement | null>,\n params: {\n fitsWithoutHorizontalScrollbar: Ref<boolean>;\n columnResizeActive: Ref<boolean>;\n },\n) => {\n provideOverflowStyles({ ...params, scrolledElement: containerRef });\n provideForCloseSubMenusOnScroll();\n provide(injectionKey, containerRef);\n};\n\n/**\n * Thin helper that injects only the scroll container ref provided by\n * {@link provideCommonScrollContainerProps}, without pulling in the overflow\n * and sub-menu providers that {@link useCommonScrollContainerProps} requires.\n * Falls back to a null ref when no provider is present (e.g. in isolated tests).\n */\nexport const useScrollContainer = () => inject(injectionKey, ref(null));\n\nexport const useCommonScrollContainerProps = () => {\n const closeExpandedSubMenu = injectCloseExpandedSubMenu();\n const overflowStyles = useOverflowStyles();\n return {\n overflowStyles,\n closeExpandedSubMenu,\n containerRef: useScrollContainer(),\n };\n};\n","import { type Ref, nextTick, ref, watch } from \"vue\";\n\n/**\n * While a column resize is active a screen-wide spacer is rendered to the right of the\n * table content, guaranteeing there is always horizontal scroll room so the edge\n * auto-scroll (see Header.vue) can keep growing a column past the current table width.\n *\n * This composable owns the spacer's lifecycle: when the resize ends it only animates the\n * spacer's width back down to the current body width if the extra scroll room is actually\n * on screen (the container is scrolled past the body's right edge) - otherwise there is\n * nothing to see and the spacer is dropped immediately. Once the collapse animation has\n * finished, `onResizeScrollSpacerTransitionEnd` unmounts it.\n */\nexport const useResizeScrollSpacer = ({\n columnResizeActive,\n currentBodyWidth,\n scrollContainer,\n}: {\n columnResizeActive: Ref<boolean>;\n currentBodyWidth: Ref<number>;\n scrollContainer: Ref<HTMLElement | null>;\n}) => {\n const showResizeScrollSpacer = ref(false);\n const collapseResizeScrollSpacer = ref(false);\n const additionalSpacerWidth = ref(\"0px\");\n\n // True when the area beyond the body's right edge (i.e. part of the spacer) is within\n // the currently visible viewport of the scroll container.\n const getVisibleWidthBeyondBody = () => {\n const container = scrollContainer.value;\n if (container === null) {\n return 0;\n }\n return Math.max(\n 0,\n container.scrollLeft + container.clientWidth - currentBodyWidth.value,\n );\n };\n\n watch(columnResizeActive, (active) => {\n if (active) {\n collapseResizeScrollSpacer.value = false;\n showResizeScrollSpacer.value = true;\n additionalSpacerWidth.value = \"100vw\";\n } else if (showResizeScrollSpacer.value) {\n const visibleWidthBeyondBody = getVisibleWidthBeyondBody();\n if (visibleWidthBeyondBody > 0) {\n additionalSpacerWidth.value = `${visibleWidthBeyondBody}px`;\n nextTick(() => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n scrollContainer.value?.offsetWidth; // force layout so the width change above is registered before we collapse\n additionalSpacerWidth.value = \"0px\";\n collapseResizeScrollSpacer.value = true;\n });\n } else {\n // the spacer is scrolled out of view, so just drop it without animating\n showResizeScrollSpacer.value = false;\n additionalSpacerWidth.value = \"0px\";\n }\n }\n });\n\n const onResizeScrollSpacerTransitionEnd = () => {\n if (collapseResizeScrollSpacer.value) {\n showResizeScrollSpacer.value = false;\n collapseResizeScrollSpacer.value = false;\n }\n };\n\n return {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n };\n};\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, toRef, watch } from \"vue\";\nimport { useResizeObserver } from \"@vueuse/core\";\nimport \"../assets/global-z-indices.css\";\n\nimport {\n ArraySizeManager,\n SameSizeManager,\n type SizeManager,\n WithSpaceAfter,\n WithSpaceBefore,\n useVirtualGrid,\n} from \"@knime/vue-headless-virtual-scroller\";\n\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableBodyNavigatable from \"./TableBodyNavigatable.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport VirtualRow from \"./VirtualRow.vue\";\nimport {\n BODY_WIDTH_CSS_VAR,\n injectBodyWidth,\n} from \"./composables/useBodyWidth\";\nimport { useCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { provideForHorizontalVirtualScrolling } from \"./composables/useHorizontalIndicesAndStyles\";\nimport { useResizeScrollSpacer } from \"./composables/useResizeScrollSpacer\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport interface Props {\n scrollData: DataItem[];\n scrollConfig: {\n numRowsAbove: number;\n numRowsBelow: number;\n itemSize: number;\n compact: boolean;\n };\n specialColumnSizes: {\n selectionSize: number;\n deletionSize: number;\n rightSideSize: number;\n };\n tableConfig: TableConfig;\n columnResizeActive: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n expandSelectedCell: [];\n startEditing: [initialValue?: string];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst withLeftSideSize = (sizeManager: SizeManager) =>\n new WithSpaceBefore(\n {\n spaceBefore: computed(\n () =>\n props.specialColumnSizes.selectionSize +\n props.specialColumnSizes.deletionSize,\n ),\n spaceBeforeIsOffset: false,\n },\n sizeManager,\n );\nconst withRightSideSize = (sizeManager: SizeManager) =>\n new WithSpaceAfter(\n computed(() => props.specialColumnSizes.rightSideSize),\n sizeManager,\n );\n\n/**\n * The size manager input is split by output:\n * - `toOffset`/`getTotalSize` are applied imperatively (as CSS variables, see\n * useVirtualLine) and never read at render time, so they track the live\n * (per-frame) column sizes during a resize drag — the scrolled-area width and\n * offset stay correct while dragging without causing any re-render.\n * - `toIndex` determines the rendered column window (`indices`), which every\n * row and the header consume at render time. With live sizes the window\n * shifts whenever a column boundary crosses the buffered viewport edge\n * mid-drag, re-rendering all visible cells each time. It therefore uses the\n * resize-frozen sizes of the column-size context (frozen at drag start);\n * the window is corrected once when the resize ends.\n */\nconst { colSizes: liveColSizes, colSizesFrozenWhenResizing: indexColSizes } =\n injectColumnSizes();\n\nconst decorateWithSideSizes = (sizeManager: SizeManager) =>\n withLeftSideSize(withRightSideSize(sizeManager));\nconst liveSizeManager = decorateWithSideSizes(\n new ArraySizeManager(liveColSizes),\n);\nconst indexSizeManager = decorateWithSideSizes(\n new ArraySizeManager(indexColSizes),\n);\nconst columnSizeManager: SizeManager = {\n toIndex: (position) => indexSizeManager.toIndex(position),\n toOffset: (index) => liveSizeManager.toOffset(index),\n getTotalSize: () => liveSizeManager.getTotalSize(),\n getNumItems: () => liveSizeManager.getNumItems(),\n onUpdate: (callback) => liveSizeManager.onUpdate(callback),\n};\n\n/**\n * The number of columns is passed to the (empty) rows instead of the live\n * numeric `colSizes`: the rows read each cell width from the `--col-size-<index>`\n * CSS variable, so they only need the column count. Deriving it as a computed\n * means a per-frame `colSizes` change during a resize does not re-render this\n * component (and therefore does not re-invoke the forwarded row slot) as long as\n * the count is unchanged.\n */\nconst numColumns = computed(() => liveColSizes.value.length);\n\n/**\n * Buffer (in px) of additionally rendered columns on each side of the visible\n * viewport, larger than the scroller's 500px default: the rendered column\n * window is frozen while a column resize drag is active (see above), so when a\n * column is shrunk, the columns sliding in from the right are only those\n * already rendered into this buffer. Up to this many pixels of net shrink no\n * white space appears before the resize ends; the price is rendering the extra\n * buffered columns at all times.\n */\nconst HORIZONTAL_BUFFER_PX = 1000;\n\nconst numRows: Ref<number> = computed(\n () =>\n props.scrollData.length +\n props.scrollConfig.numRowsAbove +\n props.scrollConfig.numRowsBelow,\n);\nconst rowHeight = computed(() => props.scrollConfig.itemSize);\nconst rowSizeManager = new SameSizeManager(numRows, rowHeight);\n\nconst {\n containerProps,\n indices: { vertical, horizontal },\n scrolledAreaStyles: {\n vertical: verticalStyles,\n horizontal: horizontalStyles,\n },\n} = useVirtualGrid({\n rows: { sizeManager: rowSizeManager },\n columns: { sizeManager: columnSizeManager, buffer: HORIZONTAL_BUFFER_PX },\n});\n\nwatch(\n () => vertical.value,\n ({ endIndex, startIndex }) => {\n if (Number.isNaN(endIndex) || Number.isNaN(startIndex)) {\n return;\n }\n emit(\"scrollerUpdate\", startIndex, endIndex);\n },\n { immediate: true },\n);\n\nif (!props.tableConfig.forceRenderAll) {\n provideForHorizontalVirtualScrolling({\n horizontal,\n horizontalStyles,\n });\n}\n\nconst renderedRowIndices = computed(() =>\n props.tableConfig.forceRenderAll\n ? Array.from({ length: numRows.value }, (_, i) => i)\n : vertical.value.toArray(),\n);\n\n// DRAG HANDLE\n\nconst headerContainer: Ref<null | HTMLElement> = ref(null);\nconst getHeaderHeight = () => {\n return headerContainer.value?.offsetHeight ?? 0;\n};\n\nconst getBody = () => containerProps.ref.value?.querySelector(\"tbody\");\n\nconst getDragHandleHeight = () => {\n const scrollContainer = containerProps.ref.value;\n if (scrollContainer === null) {\n return 0;\n }\n const headerHeight = getHeaderHeight();\n /**\n * If the second argument is the smaller one, this means that the scroller is\n * not scrollable at the moment, i.e. adding the header height to the body height\n * is the desired height, as they cannot overlap.\n */\n return Math.min(\n scrollContainer.offsetHeight,\n Math.floor(getBody()!.offsetHeight + headerHeight),\n );\n};\n\nconst headerHeight = ref(0);\nconst updateHeaderHeight = () => {\n headerHeight.value = getHeaderHeight();\n};\nonMounted(updateHeaderHeight);\nuseResizeObserver(headerContainer, updateHeaderHeight);\n\nconst emptyStateStyle = computed(() => ({\n height: `calc(100% - ${headerHeight.value}px)`,\n}));\n\nconst isEmpty = computed(() => numRows.value === 0);\n\n/**\n * With all rows rendered there is nothing to scroll, so the container only takes\n * the space it needs. Without any rows it keeps the full height nonetheless: the\n * empty state fills the space the rows would have occupied, and the container's\n * horizontal scrollbar belongs at the bottom of the table rather than directly\n * below the header.\n */\nconst fitContent = computed(\n () => props.tableConfig.forceRenderAll && !isEmpty.value,\n);\n\nconst {\n closeExpandedSubMenu,\n containerRef: injectedContainerRef,\n overflowStyles,\n} = useCommonScrollContainerProps();\n\nconst {\n showResizeScrollSpacer,\n collapseResizeScrollSpacer,\n additionalSpacerWidth,\n onResizeScrollSpacerTransitionEnd,\n} = useResizeScrollSpacer({\n columnResizeActive: toRef(props, \"columnResizeActive\"),\n currentBodyWidth: injectBodyWidth(),\n scrollContainer: containerProps.ref,\n});\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n scrollToPosition: ({ top, left }: { top?: number; left?: number }) => {\n if (top !== undefined) {\n containerProps.ref.value!.scrollTop = top;\n }\n if (left !== undefined) {\n containerProps.ref.value!.scrollLeft = left;\n }\n containerProps.onScroll();\n },\n getScrollStart: () => containerProps.ref.value!.scrollTop,\n getBody,\n getContainer: () => containerProps.ref.value,\n});\n</script>\n\n<template>\n <div\n v-if=\"containerProps\"\n :ref=\"\n (element) => {\n containerProps.ref.value = injectedContainerRef =\n element as HTMLElement | null;\n }\n \"\n :style=\"overflowStyles\"\n :class=\"['container', { 'fit-content': fitContent }]\"\n @scroll=\"() => [containerProps.onScroll(), closeExpandedSubMenu()]\"\n >\n <div ref=\"headerContainer\" class=\"header-container\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </div>\n <TableBodyNavigatable\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @expand-selected-cell=\"emit('expandSelectedCell')\"\n @start-editing=\"(initialValue) => emit('startEditing', initialValue)\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #bodyContent>\n <slot name=\"cell-selection-overlay\" />\n <div :style=\"tableConfig.forceRenderAll ? {} : verticalStyles\">\n <VirtualRow\n v-for=\"rowInd in renderedRowIndices\"\n :key=\"rowInd\"\n #default=\"{ row }\"\n :row-height=\"scrollConfig.itemSize\"\n :compact=\"scrollConfig.compact\"\n :data-item=\"scrollData[rowInd - scrollConfig.numRowsAbove]\"\n :num-columns=\"numColumns\"\n :table-config=\"tableConfig\"\n >\n <slot name=\"row\" :row-ind=\"rowInd\" :row=\"row\" />\n </VirtualRow>\n </div>\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n </TableBodyNavigatable>\n <!--\n The empty state takes over the space left over by the empty body. It is\n sticky rather than part of the scrolled content, so that it stays put while\n scrolling horizontally through the (row-less) columns.\n -->\n <div\n v-if=\"isEmpty && $slots['empty-state']\"\n class=\"empty-state-container\"\n :style=\"emptyStateStyle\"\n >\n <slot name=\"empty-state\" />\n </div>\n <!--\n While a column is being resized we add a screen-wide spacer to the right of\n the table content. This guarantees there is always horizontal scroll room\n so the edge auto-scroll (see Header.vue) can keep growing a column - in\n particular the last one - past the current table width. When the resize ends\n we animate its width back down to the current body width so the extra scroll\n room collapses smoothly, then unmount it (see onResizeScrollSpacerTransitionEnd).\n -->\n <div\n v-if=\"showResizeScrollSpacer\"\n :class=\"[\n 'resize-scroll-spacer',\n { collapsing: collapseResizeScrollSpacer },\n ]\"\n aria-hidden=\"true\"\n :style=\"{\n width: `calc(var(${BODY_WIDTH_CSS_VAR}) + ${additionalSpacerWidth})`,\n }\"\n @transitionend=\"onResizeScrollSpacerTransitionEnd\"\n />\n </div>\n</template>\n\n<style scoped>\n.container {\n flex: 1 1 0;\n\n &.fit-content {\n flex: 0 0 auto;\n }\n\n & .header-container {\n position: sticky;\n top: 0;\n z-index: var(--z-index-sticky-header);\n display: flex;\n flex: 1;\n flex-direction: column;\n }\n\n & tbody {\n /**\n * Necessary for the absolutely placed elements inside of it (e.g. cell selection overlay)\n * to scroll with the body.\n */\n position: relative;\n\n /**\n * Otherwise there is a small margin from the left that leads to an unnecessary scrollbar\n */\n display: block;\n\n /**\n * Necessary so that non-virtual elements (like drag handles) are wide enough\n */\n width: fit-content;\n }\n}\n\n.empty-state-container {\n position: sticky;\n left: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n\n /*\n The two spacers share the space around the empty state equally, i.e. they\n center it - but the upper one is capped, so with plenty of space the message\n stays close to the header instead of drifting into the middle of the table.\n */\n &::before,\n &::after {\n flex: 1 1 0;\n content: \"\";\n }\n\n &::before {\n max-height: var(--kds-spacing-container-5x);\n }\n\n /* Rather overflow than squeeze the message when the space gets tight. */\n & > * {\n flex: 0 0 auto;\n }\n}\n\n.resize-scroll-spacer {\n /* Only animate when collapsing back after a resize ends; while resizing the width\n tracks the growing column and must update instantly. */\n &.collapsing {\n transition: width 0.2s ease;\n }\n}\n</style>\n","'use strict';\n\nvar rafThrottle = function rafThrottle(callback) {\n var requestId = null;\n var lastArgs;\n var later = function later(context) {\n return function () {\n requestId = null;\n callback.apply(context, lastArgs);\n };\n };\n var throttled = function throttled() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n lastArgs = args;\n if (requestId === null) {\n requestId = requestAnimationFrame(later(this));\n }\n };\n throttled.cancel = function () {\n cancelAnimationFrame(requestId);\n requestId = null;\n };\n return throttled;\n};\n\nmodule.exports = rafThrottle;\n","// a vue composable for the capability of the the TableUI to detect the available width for all columns.\nimport {\n type Ref,\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport throttle from \"raf-throttle\";\n\nexport const useTotalWidth = (root: Ref<null | HTMLElement>) => {\n const totalWidth: Ref<null | number> = ref(null);\n\n const rootResizeCallback = throttle((entries) => {\n const rect = entries[0].contentRect;\n totalWidth.value = rect.width;\n });\n const rootResizeObserver = new ResizeObserver(rootResizeCallback);\n\n onMounted(() => {\n if (root.value) {\n rootResizeObserver.observe(root.value);\n }\n });\n\n onBeforeUnmount(() => {\n if (root.value) {\n rootResizeObserver.unobserve(root.value);\n }\n });\n\n return totalWidth;\n};\n\nconst useScrollbarSizes = (scrolledElement: Ref<null | HTMLElement>) => {\n const currentScrollBarWidth = ref<null | number>(null);\n const currentScrollBarHeight = ref<null | number>(null);\n\n const scrollbarWidthCallback = throttle((entries) => {\n const totalWidth = entries[0].borderBoxSize[0].inlineSize;\n const innerWidth = entries[0].contentRect.width;\n const totalHeight = entries[0].borderBoxSize[0].blockSize;\n const innerHeight = entries[0].contentRect.height;\n currentScrollBarHeight.value = Math.ceil(totalHeight - innerHeight);\n currentScrollBarWidth.value = Math.ceil(totalWidth - innerWidth);\n });\n const scrollbarWidthObserver = new ResizeObserver(scrollbarWidthCallback);\n\n onMounted(() => {\n // next tick necessary for the virtual scroller to be rendered\n nextTick(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.observe(scrolledElement.value);\n }\n });\n });\n\n /**\n * If the scroller is refreshed, the scrollbar width observer needs to be updated.\n */\n watch(\n () => scrolledElement.value,\n (newEl, oldEl) => {\n if (oldEl !== null) {\n scrollbarWidthObserver.unobserve(oldEl);\n }\n if (newEl !== null) {\n scrollbarWidthObserver.observe(newEl);\n }\n },\n );\n\n onBeforeUnmount(() => {\n if (scrolledElement.value) {\n scrollbarWidthObserver.unobserve(scrolledElement.value);\n }\n });\n\n return { currentScrollBarWidth, currentScrollBarHeight };\n};\n\nexport const useAvailableWidth = ({\n emitAvailableWidth,\n specialColumnsSizeTotal,\n refs: { scrolledElement },\n totalWidth,\n}: {\n emitAvailableWidth: (availableWidth: number) => void;\n specialColumnsSizeTotal: Ref<number>;\n refs: {\n scrolledElement: Ref<null | HTMLElement>;\n };\n totalWidth: Ref<null | number>;\n}) => {\n const { currentScrollBarWidth, currentScrollBarHeight } =\n useScrollbarSizes(scrolledElement);\n\n const totalWidthWithoutSpecialColumns = computed(() => {\n if (totalWidth.value === null) {\n return null;\n }\n return totalWidth.value - specialColumnsSizeTotal.value;\n });\n const currentDataWidth = computed(() => {\n if (\n totalWidthWithoutSpecialColumns.value === null ||\n currentScrollBarWidth.value === null\n ) {\n return null;\n }\n return totalWidthWithoutSpecialColumns.value - currentScrollBarWidth.value;\n });\n\n const innerWidthToBodyWidth = (columnsWidth: number) => {\n return columnsWidth + specialColumnsSizeTotal.value;\n };\n\n const fitsInsideTotalWidth = (bodyWidth: number) => {\n let width = totalWidth.value ?? 0;\n if (currentScrollBarWidth.value) {\n width -= currentScrollBarWidth.value;\n }\n return Math.floor(bodyWidth) <= width;\n };\n\n const allSizes = computed(() => ({\n currentDataWidth: currentDataWidth.value,\n totalWidthWithoutSpecialColumns: totalWidthWithoutSpecialColumns.value,\n }));\n\n watch(\n allSizes,\n (\n {\n currentDataWidth: newCurrentDataWidth,\n totalWidthWithoutSpecialColumns: newTotalWidthWithoutSpecialColumns,\n },\n {\n currentDataWidth: oldCurrentDataWidth,\n totalWidthWithoutSpecialColumns: oldTotalWidthWithoutSpecialColumns,\n },\n ) => {\n if (newCurrentDataWidth !== null) {\n const changeIsInducedByAppearingScrollbar =\n oldTotalWidthWithoutSpecialColumns ===\n newTotalWidthWithoutSpecialColumns &&\n oldCurrentDataWidth !== null &&\n oldCurrentDataWidth > newCurrentDataWidth;\n const yScrollBarExistsBecauseOfXScrollBar =\n currentScrollBarHeight.value &&\n scrolledElement.value!.scrollHeight <=\n scrolledElement.value!.clientHeight + currentScrollBarHeight.value;\n if (\n changeIsInducedByAppearingScrollbar &&\n yScrollBarExistsBecauseOfXScrollBar\n ) {\n /**\n * Updating the available width in this case can lead to an endless flicker loop:\n * 1. An x-scrollbar appears, because the content is too wide\n * 2. A y-scrollbar appears, because the x-scrollbar appeared\n * 3. The available width is updated, because the y-scrollbar appeared\n * 4. The content is scaled accordingly\n * 5. The x-scrollbar disappears, because the content is now smaller\n * 6. The y-scrollbar disappears, because the x-scrollbar disappeared\n * 7. The available width is updated, because the y-scrollbar disappeared\n * 8. The content is scaled accordingly\n * 9. Go to 1.\n *\n * To prevent this, we do not update the available width, if the y-scrollbar only exists because of the x-scrollbar.\n */\n return;\n }\n emitAvailableWidth(newCurrentDataWidth);\n }\n },\n );\n\n return { innerWidthToBodyWidth, fitsInsideTotalWidth };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, toRef } from \"vue\";\n\nimport \"../assets/global-z-indices.css\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../constants\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig } from \"../types/TableConfig\";\n\nimport TableCoreVirtual from \"./TableCoreVirtual.vue\";\nimport type { DataItem } from \"./TableUI.vue\";\nimport { useAvailableWidth } from \"./composables/useAvailableWidth\";\nimport { useBodyWidth } from \"./composables/useBodyWidth\";\nimport { provideCommonScrollContainerProps } from \"./composables/useCommonScrollContainerProps\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nconst props = defineProps<{\n scrollData: DataItem[][];\n scrollConfig: {\n itemSize: number;\n numRowsAbove: number;\n numRowsBelow: number;\n compact: boolean;\n };\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n totalWidth: null | number;\n currentRowHeight: number | \"dynamic\";\n columnResize: {\n active: boolean;\n };\n newColumnButtonWidth: number;\n}>();\n\nconst emit = defineEmits<{\n scrollerUpdate: [startIndex: number, endIndex: number];\n \"update:available-width\": [newAvailableWidth: number];\n moveSelection: [\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ];\n clearSelection: [];\n bodyFocusin: [];\n bodyFocusout: [];\n}>();\n\nconst tableCoreVirtual = ref<InstanceType<typeof TableCoreVirtual> | null>(\n null,\n);\n\n/**\n * We expose some internals of the virtual scroller for enabling keeping the.\n */\ndefineExpose({\n virtualScrollToPosition: (position: { top?: number; left?: number }) =>\n tableCoreVirtual.value?.scrollToPosition(position),\n getVirtualScrollStart: () => tableCoreVirtual.value?.getScrollStart(),\n getVirtualBody: () => tableCoreVirtual.value?.getBody(),\n getVirtualContainer: () => tableCoreVirtual.value?.getContainer(),\n});\n\nconst selectionSize = computed(() =>\n props.tableConfig.showSelection ? SPECIAL_COLUMNS_SIZE : 0,\n);\nconst deletionSize = computed(() =>\n props.tableConfig.enableRowDeletion ? SPECIAL_COLUMNS_SIZE : 0,\n);\n\nconst rightSideSize = computed(() => {\n const rowSubMenuSpace =\n (props.subMenuConfig.subMenuItems ?? []).length > 0 ||\n props.subMenuConfig.reserveSpaceForSubMenu === \"always\"\n ? SPECIAL_COLUMNS_SIZE\n : 0;\n return rowSubMenuSpace + props.newColumnButtonWidth;\n});\n\nconst scrolledElement = ref<HTMLElement | null>(null);\nconst { fitsInsideTotalWidth, innerWidthToBodyWidth } = useAvailableWidth({\n emitAvailableWidth: (newWidth) => emit(\"update:available-width\", newWidth),\n specialColumnsSizeTotal: computed(\n () => selectionSize.value + deletionSize.value + rightSideSize.value,\n ),\n refs: { scrolledElement },\n totalWidth: toRef(props, \"totalWidth\"),\n});\n\nconst { colSizes } = injectColumnSizes();\n\n/**\n * Note that this currentBodyWidth is currently smaller than the actual content width of the scrolled container\n * in case column resizing is active, since the resize handle area does not fit within a headers cell completely.\n *\n * It is intentionally not read in this component's template: instead it is written to a CSS variable on the\n * scroll container by {@link useBodyWidth} (consumed by the sticky header and the resize scroll spacer) and\n * provided as a numeric ref for the few JS-only consumers. This keeps TableCore from re-rendering whenever the\n * live column sizes change (e.g. per frame during a column resize).\n */\nconst currentBodyWidth = computed(() => {\n const widthContentColumns = colSizes.value.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (prev: any, curr: any) => prev + curr,\n 0,\n );\n return innerWidthToBodyWidth(widthContentColumns);\n});\nuseBodyWidth(currentBodyWidth, scrolledElement);\n\nconst fitsWithoutHorizontalScrollbar = computed(() =>\n fitsInsideTotalWidth(currentBodyWidth.value),\n);\n\nprovideCommonScrollContainerProps(scrolledElement, {\n fitsWithoutHorizontalScrollbar,\n columnResizeActive: computed(() => props.columnResize.active),\n});\n</script>\n\n<template>\n <TableCoreVirtual\n ref=\"tableCoreVirtual\"\n :scroll-data=\"scrollData[0]\"\n :scroll-config=\"scrollConfig\"\n :special-column-sizes=\"{\n selectionSize,\n deletionSize,\n rightSideSize,\n }\"\n :table-config=\"tableConfig\"\n :column-resize-active=\"columnResize.active\"\n @scroller-update=\"\n (startIndex, endIndex) => emit('scrollerUpdate', startIndex, endIndex)\n \"\n @move-selection=\"\n (...args: [number, number, boolean]) => emit('moveSelection', ...args)\n \"\n @clear-selection=\"emit('clearSelection')\"\n @body-focusin=\"emit('bodyFocusin')\"\n @body-focusout=\"emit('bodyFocusout')\"\n >\n <template #header=\"{ getDragHandleHeight }\">\n <slot name=\"header\" :get-drag-handle-height=\"getDragHandleHeight\" />\n </template>\n <template #row=\"{ row, rowInd }\">\n <slot name=\"row\" :row=\"row\" :row-ind=\"rowInd\" :group-ind=\"null\" />\n </template>\n <template #cell-selection-overlay>\n <slot name=\"cell-selection-overlay\" />\n </template>\n <template #belowBody><slot name=\"belowBody\" /></template>\n <template v-if=\"$slots['empty-state']\" #empty-state>\n <slot name=\"empty-state\" />\n </template>\n </TableCoreVirtual>\n</template>\n","import { reactive, ref } from \"vue\";\n\nexport const useBoolean = (initialValue = false) => {\n const state = ref(initialValue);\n const setTrue = () => {\n state.value = true;\n };\n const setFalse = () => {\n state.value = false;\n };\n return reactive({ state, setTrue, setFalse });\n};\n","import { type ComputedRef, type Ref, onMounted, onUnmounted } from \"vue\";\n\nimport { getMetaOrCtrlKey } from \"@knime/utils\";\n\nimport type CellSelectionOverlay from \"../ui/CellSelectionOverlay.vue\";\n\nimport type { CellPosition } from \"./useCellSelection\";\n\nexport const useCellCopyPaste = ({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy,\n onPaste,\n onDelete,\n onCut,\n}: {\n focusWithin: Ref<boolean>;\n isEditingCell: Ref<boolean>;\n selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n >;\n selectedCell: ComputedRef<CellPosition | undefined>;\n isEditingEnabled: ComputedRef<boolean>;\n onCopy: ({ withHeaders }: { withHeaders: boolean }) => void;\n onPaste?: () => void;\n onCut?: () => void;\n onDelete?: () => void;\n}) => {\n const isHeaderCellSelected = () => selectedCell.value?.y === -1;\n\n const triggerCopyAnimation = () => {\n if (Array.isArray(selectionOverlay.value)) {\n selectionOverlay.value[0]?.triggerCopied();\n } else if (selectionOverlay.value) {\n selectionOverlay.value.triggerCopied();\n }\n };\n\n const isBodySelected = () => {\n return focusWithin.value && !isHeaderCellSelected() && !isEditingCell.value;\n };\n\n const primaryModifierKey = getMetaOrCtrlKey();\n\n const onCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (!isBodySelected()) {\n return;\n }\n triggerCopyAnimation();\n onCopy({ withHeaders });\n };\n\n const onCutSelection = () => {\n if (isEditingEnabled.value && onCut && isBodySelected()) {\n triggerCopyAnimation();\n onCut();\n }\n };\n\n const onDeleteSelection = () => {\n if (isEditingEnabled.value && onDelete && isBodySelected()) {\n onDelete();\n }\n };\n\n const onPasteSelection = () => {\n if (isEditingEnabled.value && onPaste && isBodySelected()) {\n onPaste();\n }\n };\n\n const handleDefaultCopyEvent = () => {\n onCopySelection({ withHeaders: false });\n };\n\n const handleCopyOnKeydown = (e: KeyboardEvent) => {\n if (e[primaryModifierKey]) {\n onCopySelection({ withHeaders: true });\n }\n };\n\n onMounted(() => {\n globalThis.addEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.addEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.addEventListener(\"cut\", onCutSelection);\n }\n });\n\n onUnmounted(() => {\n globalThis.removeEventListener(\"copy\", handleDefaultCopyEvent);\n if (onPaste) {\n globalThis.removeEventListener(\"paste\", onPasteSelection);\n }\n if (onCut) {\n globalThis.removeEventListener(\"cut\", onCutSelection);\n }\n });\n\n return { handleCopyOnKeydown, handleDeleteSelection: onDeleteSelection };\n};\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { type Ref, computed, ref, watch } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nexport type CellPosition = {\n x: number;\n y: number;\n};\n\nclass CellRect {\n anchor: CellPosition;\n opposite: CellPosition;\n\n constructor(anchorPosition: CellPosition) {\n this.anchor = this.opposite = anchorPosition;\n }\n\n setCorner(cellPos: CellPosition) {\n if (isEqual(this.opposite, cellPos)) {\n return;\n }\n this.opposite = cellPos;\n }\n\n getMinMax(coord: keyof CellPosition) {\n const coords = [this.anchor[coord], this.opposite[coord]];\n return { min: Math.min(...coords), max: Math.max(...coords) };\n }\n}\n\nexport type MinMax = { min: number; max: number };\n\nexport type Rect = { x: MinMax; y: MinMax };\n\nexport type RectId = number;\n\nexport const useCellSelection = (enableCellSelection: Ref<boolean>) => {\n const cellRect = ref<CellRect | null>(null);\n const currentRectId: Ref<RectId | null> = ref(null);\n\n const rectMinMax = computed<Rect | null>(() => {\n const rectValue = cellRect.value;\n if (rectValue === null) {\n return null;\n }\n return {\n x: rectValue.getMinMax(\"x\"),\n y: rectValue.getMinMax(\"y\"),\n };\n });\n\n const selectedCell = computed(() => cellRect.value?.opposite);\n\n const isSingleSelectedCell = (cellPosition: CellPosition) => {\n return (\n cellRect.value !== null &&\n isEqual(cellRect.value.anchor, cellRect.value.opposite) &&\n isEqual(cellRect.value.anchor, cellPosition)\n );\n };\n\n const clearCellSelection = () => {\n cellRect.value = null;\n currentRectId.value = null;\n };\n\n watch(\n () => enableCellSelection.value,\n (isEnabled) => {\n if (!isEnabled) {\n clearCellSelection();\n }\n },\n );\n\n const selectCell = (\n cellPosition: CellPosition,\n rectId: RectId,\n ignoreIfSelected: boolean = false,\n ) => {\n if (\n rectId === currentRectId.value &&\n isSingleSelectedCell(cellPosition) &&\n !ignoreIfSelected\n ) {\n clearCellSelection();\n return;\n }\n cellRect.value = new CellRect(cellPosition);\n currentRectId.value = rectId;\n };\n\n const expandCellSelection = (cellPosition: CellPosition, rectId: RectId) => {\n if (cellRect.value === null || currentRectId.value !== rectId) {\n selectCell(cellPosition, rectId);\n return;\n }\n cellRect.value.setCorner(cellPosition);\n };\n\n const applyIfEnabled = (method: (...args: any[]) => void) => {\n return (...args: any[]) => {\n if (enableCellSelection.value) {\n method(...args);\n }\n };\n };\n\n return {\n selectCell: applyIfEnabled(selectCell),\n expandCellSelection: applyIfEnabled(expandCellSelection),\n clearCellSelection,\n rectMinMax,\n selectedCell,\n currentRectId,\n isSingleSelectedCell,\n };\n};\n","/**\n * This method returns true if we should stop processing the key event since it is\n * to be ignored outside of the editing context.\n */\nconst isToBeIgnoredKeyEvent = (keyEvent: KeyboardEvent) => {\n // Ignore backspace and delete to prevent clearing the cell value while editing\n return keyEvent.key === \"Backspace\" || keyEvent.key === \"Delete\";\n};\n\nexport const createEditingCellKeydownHandler = ({\n moveSelection,\n}: {\n moveSelection: (\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) => void;\n}) => {\n return (event: KeyboardEvent) => {\n if (isToBeIgnoredKeyEvent(event)) {\n event.stopPropagation();\n return;\n }\n if (event.key === \"Tab\") {\n event.preventDefault();\n event.stopPropagation();\n const horizontalMove = event.shiftKey ? -1 : 1;\n moveSelection(horizontalMove, 0, false);\n } else if (event.key === \"Enter\" && !event.shiftKey) {\n event.preventDefault();\n event.stopPropagation();\n moveSelection(0, 1, false);\n } else if (event.key === \"Escape\") {\n event.preventDefault();\n event.stopPropagation();\n // Select the underlying cell again to stop editing\n moveSelection(0, 0, false);\n }\n };\n};\n","import { nextTick, ref } from \"vue\";\n\n/**\n * Keeps the table hidden until one tick after the available width has been\n * reported for the first time.\n *\n * Column sizes that are derived from the available width (see the\n * `update:available-width` emit) can only be applied once that width is known,\n * i.e. anything rendered before that is rendered at sizes which are about to\n * change — a visible jump on every initial load. Waiting one tick after the\n * report lets the reaction to it (and with it the column-size CSS variables)\n * reach the DOM first, so the first frame the user sees is the final one.\n */\nexport const useVisibleAfterAvailableWidth = () => {\n const isVisible = ref(false);\n\n const onAvailableWidthReported = async () => {\n if (isVisible.value) {\n return;\n }\n await nextTick();\n isVisible.value = true;\n };\n\n return { isVisible, onAvailableWidthReported };\n};\n","<template>\n <div class=\"popover\">\n <span class=\"header\">\n <slot name=\"header\" />\n </span>\n <div class=\"body\">\n <slot name=\"body\" />\n </div>\n </div>\n</template>\n\n<style scoped>\n.popover {\n display: flex;\n flex-direction: column;\n gap: var(--kds-spacing-container-0-5x);\n align-items: flex-start;\n max-height: var(--kds-dimension-component-height-25x);\n padding: var(--kds-spacing-container-0-75x);\n background-color: var(--kds-color-surface-default);\n border-radius: var(--kds-border-radius-container-0-50x);\n box-shadow: var(--kds-elevation-level-3);\n\n & .header {\n font: var(--kds-font-base-title-xsmall);\n color: var(--kds-color-text-and-icon-muted);\n }\n\n & .body {\n width: 100%;\n }\n}\n</style>\n","import { type Ref, ref, watch } from \"vue\";\n\nexport const useButtonPopoverInteraction = ({\n keepButtonActive,\n}: {\n keepButtonActive: Ref<boolean>;\n}) => {\n const buttonIsActive = ref(keepButtonActive.value);\n const showPopover = ref(false);\n\n watch(keepButtonActive, (newValue) => {\n buttonIsActive.value = newValue || showPopover.value;\n });\n\n const onButtonClick = (isActive: boolean) => {\n showPopover.value = !showPopover.value;\n buttonIsActive.value = keepButtonActive.value || isActive;\n };\n\n const onPopoverToggle = (isOpen: boolean) => {\n buttonIsActive.value = keepButtonActive.value || isOpen;\n showPopover.value = isOpen;\n };\n\n const openPopover = () => {\n showPopover.value = true;\n buttonIsActive.value = true;\n };\n\n return {\n onButtonClick,\n onPopoverToggle,\n buttonIsActive,\n showPopover,\n openPopover,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :style=\"sortPopoverRef?.anchorStyle\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef, watch } from \"vue\";\n\nimport {\n KdsDropdown,\n type KdsDropdownOption,\n KdsIcon,\n KdsPopover,\n KdsToggleButton,\n} from \"@knime/kds-components\";\nimport { dimension } from \"@knime/kds-styles/tokens\";\n\nimport type { ColSortValue } from \"../../..\";\n\nimport PopoverContainer from \"./PopoverContainer.vue\";\nimport { useButtonPopoverInteraction } from \"./useButtonPopoverInteraction\";\n\nconst POPOVER_MAX_INLINE_SIZE = dimension.component.width[\"20x\"].css.variable;\n\nexport type SortControlOptions = {\n selectableColumns: KdsDropdownOption[];\n selectableDirections: Record<string, KdsDropdownOption[]>;\n};\n\nconst NONE_COLUMN_VALUE = \"None\";\n\nconst props = defineProps<{\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst emit = defineEmits<{\n columnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n}>();\n\nconst sortPopoverRef = useTemplateRef(\"sortPopoverRef\");\n\n// Local column selection: tracks the user's in-progress pick independently of\n// whether a sort has been emitted yet. Synced from props when external state\n// changes (e.g. sort triggered from column header).\nconst selectedColumn = ref(\n props.colSortValues?.[0]?.id?.toString() ?? NONE_COLUMN_VALUE,\n);\nwatch(\n () => props.colSortValues?.[0]?.id,\n (val) => {\n if (val === undefined && selectedColumn.value !== undefined) {\n return;\n }\n selectedColumn.value = val?.toString() ?? NONE_COLUMN_VALUE;\n },\n);\n\nconst hasSortConfig = computed(\n () =>\n props.colSortValues !== undefined &&\n props.colSortValues[0]?.id !== undefined &&\n props.colSortValues[0]?.direction !== undefined,\n);\n\nconst possibleColumns = computed(() => [\n { id: NONE_COLUMN_VALUE, text: NONE_COLUMN_VALUE },\n ...props.sortControlOptions.selectableColumns,\n]);\n\nconst possibleDirections = computed(() =>\n selectedColumn.value === NONE_COLUMN_VALUE\n ? []\n : (props.sortControlOptions.selectableDirections[selectedColumn.value] ??\n []),\n);\n\nconst selectedSortDirection = computed(\n () => props.colSortValues?.[0]?.direction?.toString() ?? \"\",\n);\n\nconst { buttonIsActive, showPopover, onButtonClick, onPopoverToggle } =\n useButtonPopoverInteraction({ keepButtonActive: hasSortConfig });\n\nconst onSortColumnChange = (columnId: string) => {\n selectedColumn.value = columnId;\n if (columnId === NONE_COLUMN_VALUE) {\n emit(\"columnSort\", undefined, 0);\n return;\n }\n emit(\n \"columnSort\",\n columnId,\n (props.colSortValues?.[0]?.direction || 1) as 1 | -1,\n );\n};\n\nconst onSortDirectionChange = (direction: string) => {\n emit(\n \"columnSort\",\n selectedColumn.value,\n Number.parseInt(direction, 10) as 0 | 1 | -1,\n );\n};\n</script>\n\n<template>\n <KdsToggleButton\n :model-value=\"buttonIsActive\"\n label=\"Sorting\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"sort-ascending\"\n :style=\"sortPopoverRef?.anchorStyle\"\n :aria-controls=\"sortPopoverRef?.popoverId\"\n :aria-expanded=\"showPopover\"\n aria-haspopup=\"dialog\"\n @update:model-value=\"onButtonClick\"\n />\n\n <KdsPopover\n ref=\"sortPopoverRef\"\n :model-value=\"showPopover\"\n aria-label=\"Sort\"\n popover-type=\"auto\"\n role=\"dialog\"\n class=\"sort-popover\"\n stretch-inline\n :max-inline-size=\"POPOVER_MAX_INLINE_SIZE\"\n @update:model-value=\"onPopoverToggle\"\n >\n <PopoverContainer class=\"popover-container\">\n <template #header>\n <KdsIcon name=\"sort-ascending\" size=\"small\" /> Sorting\n </template>\n <template #body>\n <div class=\"body\">\n <KdsDropdown\n :model-value=\"selectedColumn\"\n :possible-values=\"possibleColumns\"\n ariaLabel=\"Column to sort by\"\n @update:model-value=\"onSortColumnChange\"\n />\n <KdsDropdown\n :model-value=\"selectedSortDirection\"\n :possible-values=\"possibleDirections\"\n ariaLabel=\"Sort direction\"\n :disabled=\"selectedColumn === NONE_COLUMN_VALUE\"\n placeholder=\"No sorting\"\n @update:model-value=\"onSortDirectionChange\"\n />\n </div>\n </template>\n </PopoverContainer>\n </KdsPopover>\n</template>\n\n<style scoped>\n.sort-popover {\n position-try-order: most-inline-size;\n}\n\n.popover-container {\n .body {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: var(--kds-spacing-container-0-5x);\n\n & > * {\n min-width: 0;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, useSlots } from \"vue\";\n\nimport {\n KdsButton,\n KdsInfoToggleButton,\n KdsMenuButton,\n KdsSearchInput,\n} from \"@knime/kds-components\";\n\nimport type { ActionConfig, ActionState, ColSortValue } from \"../../\";\nimport type { TableState } from \"../../types/TableConfig\";\n\nimport SortControl, {\n type SortControlOptions,\n} from \"./actionbar/SortControl.vue\";\n\nconst {\n tableSizes,\n rowLabel = \"Rows\",\n actionState,\n showTableSize = true,\n colSortValues = [],\n actionConfig,\n} = defineProps<{\n tableSizes?: TableState[\"tableSizes\"];\n rowLabel?: string;\n actionState?: ActionState;\n showTableSize?: boolean;\n actionConfig: ActionConfig;\n colSortValues?: ColSortValue[];\n sortControlOptions: SortControlOptions;\n}>();\n\nconst slots = useSlots();\n\nconst viewType = computed(() => actionState?.viewType ?? \"DEFAULT\");\n\nconst isTemporaryView = computed(\n () => viewType.value === \"TEMP_VIEW\" || viewType.value === \"PREVIEW\",\n);\nconst isPreview = computed(() => viewType.value === \"PREVIEW\");\nconst showResetButton = computed(() => viewType.value === \"TEMP_VIEW\");\n\nconst hasContent = computed(\n () =>\n isTemporaryView.value ||\n showTableSize ||\n (actionConfig.enableSorting && !actionConfig.hideSortingButton) ||\n actionConfig.enableSearch ||\n actionConfig.forceShow ||\n Boolean(slots[\"action-bar-left\"]),\n);\n\n/**\n * Renders \"total\" by default, and \"current of total\" only when `current` is\n * given and strictly below `total`. The `current >= total` guard prevents an\n * inconsistent \"m of n\" where m would not be smaller than n. An unknown total\n * (`null`) renders as \"-\".\n */\nconst formatCount = (label: string, total: number | null, current?: number) => {\n if (total === null) {\n return `${label}: -`;\n }\n const appendTotal = current !== undefined && current < total;\n return `${label}: ${appendTotal ? `${current} of ${total}` : total}`;\n};\n\nconst rowText = computed(() =>\n formatCount(\n rowLabel,\n tableSizes ? tableSizes.totalNumRows : 0,\n tableSizes?.currentNumRows,\n ),\n);\n\nconst columnText = computed(() => {\n const totalNumColumns = tableSizes?.totalNumColumns ?? 0;\n if (totalNumColumns < 2) {\n return undefined;\n }\n return formatCount(\"Cols\", totalNumColumns, tableSizes?.currentNumColumns);\n});\n\nconst dimensionText = computed(() => {\n if (columnText.value === undefined) {\n return rowText.value;\n }\n return `${rowText.value} | ${columnText.value}`;\n});\n\nconst showRowCountDropdown = computed(() =>\n Boolean(actionConfig.rowCountItems?.length),\n);\n\nconst emit = defineEmits<{\n resetTemporaryView: [];\n onColumnSort: [columnId: string | undefined, direction: 0 | 1 | -1];\n \"update:searchTerm\": [newSearchTerm: string];\n}>();\n</script>\n\n<template>\n <div\n v-if=\"hasContent\"\n :class=\"['kds-table-action-bar', { 'temporary-view': isTemporaryView }]\"\n >\n <div class=\"left\">\n <SortControl\n v-if=\"actionConfig.enableSorting && !actionConfig.hideSortingButton\"\n :col-sort-values\n :sort-control-options\n @column-sort=\"\n (columnId, colDir) => emit('onColumnSort', columnId, colDir)\n \"\n />\n <slot name=\"action-bar-left\" />\n </div>\n <div class=\"center\">\n <div v-if=\"isPreview\" class=\"preview\">\n <span class=\"preview-label\">Preview</span>\n <KdsInfoToggleButton\n v-if=\"actionState?.previewDescription\"\n :content=\"actionState.previewDescription\"\n />\n </div>\n <span\n v-if=\"showTableSize && showRowCountDropdown\"\n class=\"dimension with-row-count-dropdown\"\n >\n <KdsMenuButton\n class=\"row-count-menu-button\"\n :label=\"rowText\"\n size=\"small\"\n variant=\"transparent\"\n trailing-icon=\"chevron-down\"\n :items=\"actionConfig.rowCountItems ?? []\"\n /><template v-if=\"columnText\">{{ ` | ${columnText}` }}</template>\n </span>\n <span v-else-if=\"showTableSize\" class=\"dimension\">\n {{ dimensionText }}\n </span>\n </div>\n <div class=\"right\">\n <KdsSearchInput\n v-if=\"actionConfig.enableSearch\"\n ariaLabel=\"Search table\"\n size=\"small\"\n :model-value=\"actionState?.searchTerm ?? ''\"\n @update:model-value=\"$emit('update:searchTerm', $event)\"\n />\n <KdsMenuButton\n v-if=\"actionConfig.settingsItems?.length\"\n ariaLabel=\"Table settings\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"parameter\"\n :items=\"actionConfig.settingsItems\"\n />\n <KdsButton\n v-if=\"showResetButton\"\n ariaLabel=\"Reset table\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"x-close\"\n @click=\"emit('resetTemporaryView')\"\n />\n </div>\n </div>\n</template>\n\n<style scoped>\n.kds-table-action-bar {\n display: grid;\n grid-template-columns: 1fr 1fr 1fr;\n min-height: var(--kds-dimension-component-height-2-5x);\n padding-right: var(--kds-spacing-container-0-25x);\n padding-left: var(--kds-spacing-container-0-5x);\n border-bottom: var(--kds-border-base-subtle);\n\n &.temporary-view {\n background-color: var(--kds-color-background-static-info-muted);\n }\n\n & .dimension {\n --dimension-font: var(--kds-font-base-title-small);\n --dimension-color: var(--kds-color-text-and-icon-muted);\n\n font: var(--dimension-font);\n color: var(--dimension-color);\n white-space: pre;\n\n &.with-row-count-dropdown {\n display: inline-flex;\n align-items: center;\n }\n\n /*\n * Match the row-count dropdown trigger's label to the dimension text.\n * :deep() is needed since KdsMenuButton is a multi-root component, so the\n * scope id is not inherited by the button element the class lands on.\n */\n & :deep(.row-count-menu-button) {\n font: var(--dimension-font);\n color: var(--dimension-color);\n }\n }\n\n & .preview {\n display: flex;\n gap: var(--kds-spacing-container-0-12x);\n align-items: center;\n\n & .preview-label {\n font: var(--kds-font-base-title-small-strong);\n color: var(--kds-color-text-and-icon-neutral);\n }\n }\n\n & .left,\n & .center,\n & .right {\n display: flex;\n flex: 1;\n align-items: center;\n min-width: 0;\n padding: var(--kds-spacing-container-0-12x) 0;\n }\n\n & .left,\n & .center {\n gap: var(--kds-spacing-container-0-5x);\n }\n\n & .center {\n justify-content: center;\n }\n\n & .right {\n gap: var(--kds-spacing-container-0-25x);\n justify-content: flex-end;\n }\n}\n</style>\n","import type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport { minColumnSize } from \"../constants\";\nimport type { ActionConfig } from \"../types/ActionConfig\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\n\n/**\n * Which action buttons the header of the given column shows. Mirrors the\n * conditions HeaderCell.vue renders them under, for the places that need to\n * know a column's buttons without rendering its header — namely the minimum\n * width the column needs (see {@link minColumnSize}).\n */\nexport const columnHeaderActionButtons = ({\n column,\n actionConfig,\n additionalMenuItems,\n}: {\n column: ColumnConfig;\n actionConfig?: ActionConfig;\n additionalMenuItems?: KdsMenuItem[];\n}) => ({\n menuButton: Boolean(additionalMenuItems?.length),\n sortButton: Boolean(actionConfig?.enableSorting) && !column.isNotSortable,\n deleteButton: Boolean(column.deletable),\n});\n\n/** The minimum width the given column needs for its header action buttons. */\nexport const minSizeOfColumn = (\n params: Parameters<typeof columnHeaderActionButtons>[0],\n) => minColumnSize(columnHeaderActionButtons(params));\n","import { type Ref, nextTick } from \"vue\";\nimport { useRafFn } from \"@vueuse/core\";\n\n// while resizing a column, auto-scroll engages when the pointer is within this many\n// px inward of the scroll container's right edge (or anywhere past it)\nexport const AUTO_SCROLL_EDGE_SIZE = 20;\n\n// the speed (in px/s) at which the column grows and the container scrolls while\n// auto-scrolling during a column resize drag\nexport const AUTO_SCROLL_SPEED = 250;\n\n/**\n * While a column is being resized, this composable grows the dragged column and scrolls\n * the container to the right in lockstep whenever the pointer is near (or past) the\n * container's right edge. This lets the last column be widened beyond the visible area\n * without having to release and re-grab the handle.\n *\n * The accumulated px gained via auto-scrolling is added to the caller-owned\n * `autoScrollOffset` ref (and reset to 0 on pointer-up); the caller must include it in the\n * emitted column width. `onAutoScroll` is invoked on every animation frame so the caller\n * can re-emit the (now wider) column width.\n */\nexport const useAutoScrollOnRightEdge = ({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll,\n}: {\n scrollContainer: Ref<HTMLElement | null>;\n autoScrollOffset: Ref<number>;\n onAutoScroll: () => void;\n}) => {\n let pointerClientX = 0;\n // target scroll position is `scrollLeftBase + autoScrollOffset` (see below).\n let scrollLeftBase = 0;\n\n const isInTriggerZone = () => {\n const container = scrollContainer.value;\n if (!container) {\n return false;\n }\n const { right } = container.getBoundingClientRect();\n return pointerClientX >= right - AUTO_SCROLL_EDGE_SIZE;\n };\n\n // `delta` is the ms since the previous frame, so the speed is time-based and thus\n // identical across e.g. 60Hz / 120Hz displays. The loop steps unconditionally.\n const { pause, resume } = useRafFn(\n ({ delta }) => {\n const deltaPx = (AUTO_SCROLL_SPEED * delta) / 1000;\n autoScrollOffset.value += deltaPx;\n const container = scrollContainer.value;\n onAutoScroll();\n // We wait one tick assuming that the wider width is applied then\n // Otherwise we cannot scroll further right when resizing the last column\n // which leads to a flickering since the scroll is lagging behind one frame\n nextTick(() => {\n if (container) {\n container.scrollLeft = scrollLeftBase + autoScrollOffset.value;\n }\n });\n },\n { immediate: false },\n );\n\n const updateZone = (clientX: number) => {\n pointerClientX = clientX;\n if (isInTriggerZone()) {\n resume();\n } else {\n pause();\n }\n };\n\n const onPointerDown = (clientX: number) => {\n scrollLeftBase = scrollContainer.value?.scrollLeft ?? 0;\n updateZone(clientX);\n };\n\n const onPointerMove = (clientX: number) => {\n updateZone(clientX);\n };\n\n const onPointerUp = () => {\n pause();\n autoScrollOffset.value = 0;\n };\n\n return { onPointerDown, onPointerMove, onPointerUp };\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, useTemplateRef } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsMenuButton,\n KdsToggleButton,\n vKdsTooltip,\n} from \"@knime/kds-components\";\nimport type { KdsMenuItem } from \"@knime/kds-components\";\n\nimport {\n COLUMN_RESIZE_DRAG_HANDLE_WIDTH,\n HEADER_HEIGHT,\n minColumnSize,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { useScrollContainer } from \"../composables/useCommonScrollContainerProps\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport { useAutoScrollOnRightEdge } from \"./useAutoScrollOnRightEdge\";\n\nconst props = defineProps<{\n column: ColumnConfig;\n additionalMenuItems?: KdsMenuItem[];\n tableConfig: TableConfig;\n actionConfig: ActionConfig;\n sortDirection: -1 | 0 | 1;\n index: number;\n focused: boolean;\n selected: boolean;\n otherColumnResizing: boolean;\n /** Returns the height the drag handle should span while resizing. */\n getDragHandleHeight: () => number;\n}>();\n\n/**\n * The cell reads its width from this CSS variable (the single source of truth\n * for column widths), so the header subtree does not re-render when the numeric\n * `colSizes` change.\n */\nconst colSizeCSSVar = computed(() => getColSizeCSSVar(props.index));\n\n/**\n * Live numeric column sizes, needed only imperatively at drag start (see\n * {@link onPointerDown}). Injected rather than passed as a prop so that reading\n * it does not create a render-time dependency on `colSizes`.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst emit = defineEmits<{\n onColumnSort: [direction: -1 | 0 | 1];\n onHeaderCellFocus: [];\n onHeaderCellBlur: [];\n onHeaderClick: [];\n onKeydownTab: [];\n onKeydownLeft: [];\n onKeydownRight: [];\n onKeydownDown: [];\n onHeaderCellKeydown: [event: KeyboardEvent];\n onDeleteColumn: [];\n columnResizeStart: [];\n columnResizeEnd: [];\n columnResize: [newSize: number];\n allColumnsResize: [newSize: number];\n}>();\n\nconst columnHeader = useTemplateRef<HTMLTableCellElement>(\"columnHeader\");\nconst content = useTemplateRef<HTMLDivElement>(\"content\");\nconst mainHeader = useTemplateRef<HTMLDivElement>(\"mainHeader\");\nconst headerText = useTemplateRef<HTMLSpanElement>(\"headerText\");\nconst columnDeleteButton =\n useTemplateRef<InstanceType<typeof KdsButton>>(\"columnDeleteButton\");\nconst sortButton =\n useTemplateRef<InstanceType<typeof KdsToggleButton>>(\"sortButton\");\nconst columnMenuButtonRef = \"columnMenuButton\";\nconst columnMenuButton =\n useTemplateRef<InstanceType<typeof KdsMenuButton>>(columnMenuButtonRef);\n\n/**\n * Every sortable column of a table with sorting enabled offers the sort button;\n * there is no separate opt-in for it.\n */\nconst showSortButton = computed(\n () =>\n Boolean(props.actionConfig.enableSorting) && !props.column.isNotSortable,\n);\n\nconst isSorted = computed(() => props.sortDirection !== 0);\n\nconst SORT_NEXT_DIRECTION = { 0: 1, 1: -1, [-1]: 0 } as const;\n\n/** Cycles unsorted -> ascending -> descending -> unsorted on each click. */\nconst sortNextDirection = computed<-1 | 0 | 1>(\n () => SORT_NEXT_DIRECTION[props.sortDirection],\n);\n\nconst onSortToggle = () => emit(\"onColumnSort\", sortNextDirection.value);\n\n/** The width below which this header's action buttons would not fit. */\nconst minSize = computed(() =>\n minColumnSize({\n menuButton: Boolean(props.additionalMenuItems?.length),\n sortButton: showSortButton.value,\n deleteButton: Boolean(props.column.deletable),\n }),\n);\n\nconst resizeHandleHovered = ref(false);\nconst headerHovered = ref(false);\nconst menuOpen = ref(false);\nconst nativeFocusInsideHeader = ref(false);\nconst onThFocusOut = (event: FocusEvent) => {\n if (!columnHeader.value?.contains(event.relatedTarget as Node)) {\n nativeFocusInsideHeader.value = false;\n }\n};\nconst onThFocusIn = (event: FocusEvent) => {\n if ((event.target as HTMLElement).matches(\":focus-visible\")) {\n nativeFocusInsideHeader.value = true;\n }\n};\n\n/* Column-resize-via-drag state, local to this header cell. */\nconst dragging = ref(false);\nlet columnSizeOnDragStart = 0; // the original width of the column when the resize drag started\nlet pageXOnDragStart = 0; // the x coordinate at which the pointer was pressed when starting the resize drag\nlet currentPageX = 0; // latest pointer pageX during the drag\nlet currentDragHandlerHeight = 0; // the height the drag handle spans while resizing\n\nconst scrollContainer = useScrollContainer();\nconst autoScrollOffset = ref(0); // px gained via auto-scrolling during the drag\n\n/**\n * Emits the new width of the dragged column. Called both on pointermove and on every\n * auto-scroll frame, so it derives the width from stored state (latest pointer position\n * plus accumulated auto-scroll offset) rather than from an event.\n */\nconst emitColumnResize = () => {\n if (!dragging.value) {\n return;\n }\n const newColumnSize =\n columnSizeOnDragStart +\n (currentPageX - pageXOnDragStart) +\n autoScrollOffset.value;\n emit(\"columnResize\", Math.max(newColumnSize, minSize.value));\n};\n\nconst {\n onPointerDown: startAutoScroll,\n onPointerMove: updateAutoScroll,\n onPointerUp: stopAutoScroll,\n} = useAutoScrollOnRightEdge({\n scrollContainer,\n autoScrollOffset,\n onAutoScroll: emitColumnResize,\n});\n\nconst currentResizeDragHandleWidth = computed(() =>\n props.tableConfig.enableColumnResizing ? COLUMN_RESIZE_DRAG_HANDLE_WIDTH : 0,\n);\n\nconst dragHandleHeight = (isDragging: boolean) =>\n isDragging ? currentDragHandlerHeight : HEADER_HEIGHT;\n\nconst onPointerDown = (event: PointerEvent & { target: HTMLElement }) => {\n menuOpen.value = false;\n consola.debug(\"Resize via drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n event.target.setPointerCapture(event.pointerId);\n dragging.value = true;\n currentDragHandlerHeight = props.getDragHandleHeight();\n columnSizeOnDragStart = colSizes.value[props.index] ?? minSize.value;\n pageXOnDragStart = event.pageX;\n currentPageX = event.pageX;\n emit(\"columnResizeStart\");\n // Engage auto-scroll right away if the handle already sits in the trigger zone\n // (notably the last column, whose handle is at the container's right edge), so it\n // does not wait for a pointermove that the OS edge-clamp would never deliver.\n startAutoScroll(event.clientX);\n};\n\nconst onPointerUp = (event: PointerEvent) => {\n emit(\"columnResizeEnd\");\n if (event.shiftKey) {\n const newColumnSize =\n columnSizeOnDragStart +\n event.pageX -\n pageXOnDragStart +\n autoScrollOffset.value;\n emit(\"allColumnsResize\", newColumnSize);\n }\n // Read the offset above before this zeroes it.\n stopAutoScroll();\n};\n\nconst unthrottledOnPointerMove = (event: PointerEvent) => {\n if (dragging.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n currentPageX = event.pageX;\n emitColumnResize();\n updateAutoScroll(event.clientX);\n }\n};\n\nconst onPointerMove = throttle((event: PointerEvent) => {\n unthrottledOnPointerMove(event);\n});\n\n/* The lostpointercapture event is triggered if the pointer capture is lost for any reason, including its\n orderly release via a pointerup event. Because the onPointerMove function is throttled we also need to throttle\n the onLostPointerCapture function to guarantee order of event handling. */\nconst onLostPointerCapture = throttle((event: PointerEvent) => {\n consola.debug(\"Resize via drag finished: \", event);\n stopAutoScroll();\n dragging.value = false;\n /* Also have to reset resizeHandleHovered since we might no longer be hovering over the drag handle */\n resizeHandleHovered.value = false;\n});\n\nconst getHeaderCellWidth = () => {\n const widthCompleteHeader = Math.ceil(\n columnHeader.value!.getBoundingClientRect().width,\n );\n const widthMainHeader = Math.ceil(\n mainHeader.value!.getBoundingClientRect().width,\n );\n const widthHeaderText = headerText.value!.getBoundingClientRect().width;\n return (\n widthCompleteHeader -\n widthMainHeader +\n widthHeaderText +\n currentResizeDragHandleWidth.value\n );\n};\n\nconst focus = () => {\n if (props.tableConfig.enableHeaderCellSelection || props.column.editable) {\n content.value?.focus();\n } else if (props.additionalMenuItems?.length) {\n nativeFocusInsideHeader.value = true;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (columnMenuButton.value as any)?.menuButtonEl?.$el?.focus();\n } else if (props.column.deletable) {\n columnDeleteButton.value?.$el?.focus();\n } else if (showSortButton.value) {\n sortButton.value?.$el?.focus();\n }\n};\n\nconst isFocusable = () =>\n Boolean(\n props.tableConfig.enableHeaderCellSelection ||\n props.column.editable ||\n props.additionalMenuItems?.length ||\n props.column.deletable ||\n showSortButton.value,\n );\n\nconst showMenuButton = computed(() => {\n return (\n props.additionalMenuItems?.length &&\n (headerHovered.value || menuOpen.value || nativeFocusInsideHeader.value) &&\n !dragging.value\n );\n});\n\nconst sortButtonVisible = computed(\n () =>\n showSortButton.value &&\n (headerHovered.value || nativeFocusInsideHeader.value || isSorted.value) &&\n !dragging.value,\n);\n\ndefineExpose({ getHeaderCellWidth, focus, isFocusable });\n</script>\n\n<template>\n <th\n ref=\"columnHeader\"\n scope=\"col\"\n :style=\"{\n width: `var(${colSizeCSSVar})`,\n ...(column.headerColor\n ? { '--data-cell-color': column.headerColor }\n : {}),\n }\"\n :class=\"[\n 'column-header',\n {\n 'colored-header': column.headerColor,\n 'header-focused': focused || selected,\n },\n ]\"\n @pointerenter=\"headerHovered = true\"\n @pointerleave=\"headerHovered = false\"\n @focusin=\"onThFocusIn\"\n @focusout=\"onThFocusOut\"\n >\n <div\n ref=\"content\"\n :class=\"[\n 'column-header-content',\n {\n 'with-button-in-header':\n showMenuButton || column.deletable || sortButtonVisible,\n },\n ]\"\n :tabindex=\"\n tableConfig.enableHeaderCellSelection || column.editable ? 0 : -1\n \"\n @focus=\"emit('onHeaderCellFocus')\"\n @blur=\"emit('onHeaderCellBlur')\"\n @click=\"emit('onHeaderClick')\"\n @keydown.space=\"emit('onHeaderClick')\"\n @keydown.tab=\"emit('onKeydownTab')\"\n @keydown.left.prevent=\"emit('onKeydownLeft')\"\n @keydown.right.prevent=\"emit('onKeydownRight')\"\n @keydown.down.self.prevent=\"emit('onKeydownDown')\"\n @keydown=\"emit('onHeaderCellKeydown', $event)\"\n >\n <div ref=\"mainHeader\" class=\"main-header\">\n <div\n v-kds-tooltip:truncated=\"column.header\"\n class=\"header-text-container\"\n >\n <span ref=\"headerText\">{{ column.header }}</span>\n </div>\n </div>\n <div v-if=\"column.subHeader\" class=\"sub-header-text-container\">\n <slot name=\"subHeader\" :sub-header=\"column.subHeader\">{{\n column.subHeader\n }}</slot>\n </div>\n </div>\n <div\n v-if=\"additionalMenuItems?.length\"\n :class=\"[\n 'header-action-button',\n 'menu-button',\n { 'action-button-hidden': !showMenuButton },\n ]\"\n >\n <KdsMenuButton\n :ref=\"columnMenuButtonRef\"\n v-model=\"menuOpen\"\n ariaLabel=\"Table column options\"\n :items=\"additionalMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"showSortButton\"\n :class=\"[\n 'header-action-button',\n 'sort-button',\n { 'action-button-hidden': !sortButtonVisible },\n ]\"\n >\n <KdsToggleButton\n ref=\"sortButton\"\n :model-value=\"isSorted\"\n variant=\"transparent\"\n size=\"small\"\n :leading-icon=\"\n sortDirection === -1 ? 'sort-descending' : 'sort-ascending'\n \"\n ariaLabel=\"Sort\"\n tooltip=\"Sort\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n @update:model-value=\"onSortToggle\"\n />\n </div>\n <!-- Rightmost, since unlike the other two it is permanently visible. -->\n <div\n v-if=\"column.deletable\"\n class=\"header-action-button delete-column-button\"\n >\n <KdsButton\n ref=\"columnDeleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n ariaLabel=\"Delete column\"\n @click.stop=\"emit('onDeleteColumn')\"\n @keydown.down.prevent.stop=\"emit('onKeydownDown')\"\n />\n </div>\n <div\n v-if=\"tableConfig.enableColumnResizing\"\n :class=\"[\n 'resize-handle-area',\n { hover: resizeHandleHovered && !otherColumnResizing, drag: dragging },\n ]\"\n :style=\"{\n height: `${dragHandleHeight(dragging)}px`,\n }\"\n @pointerover=\"resizeHandleHovered = true\"\n @pointerleave=\"resizeHandleHovered = false\"\n @pointerdown.passive=\"onPointerDown($event as any)\"\n @pointerup.passive=\"onPointerUp($event)\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n >\n <span class=\"resize-handle\" />\n </div>\n </th>\n</template>\n\n<style scoped>\n.column-header {\n /* Need to set position relative here to position the resize handle absolutely within the header cell */\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n padding-right: var(--kds-spacing-container-0-37x);\n padding-left: var(--kds-spacing-container-0-5x);\n color: var(--kds-color-text-and-icon-neutral);\n text-align: left;\n white-space: nowrap;\n\n &.header-focused {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-header {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .column-header-content {\n display: flex;\n flex-shrink: 1;\n flex-direction: column;\n justify-content: center;\n width: 100%;\n\n /* Allows this flex item to shrink below its content's width, so the\n column name truncates (and, if there is no room left at all,\n disappears) instead of pushing the header-action buttons outside. */\n min-width: 0;\n\n &:focus {\n outline: none;\n }\n\n &.with-button-in-header {\n width: calc(\n 100% - var(--kds-dimension-component-width-1-5x)\n ); /* due to .sub-menu-select-header / .delete-column-button: width */\n }\n\n & .main-header {\n display: flex;\n min-width: 0;\n\n & .header-text-container {\n min-width: 0;\n max-width: 100%;\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-title-medium-strong);\n }\n }\n\n & .sub-header-text-container {\n overflow: hidden;\n text-overflow: ellipsis;\n font: var(--kds-font-base-subtext-small);\n }\n }\n\n & .header-action-button {\n flex-shrink: 0;\n\n & + .header-action-button {\n margin-left: var(--kds-spacing-container-0-12x);\n }\n\n /* Collapsed to zero width by default so it reserves no space in the\n header; it only claims room once hovered/focused (or sorted), at\n which point the column name shrinks/truncates to make room for it. */\n &.action-button-hidden {\n width: 0;\n overflow: hidden;\n pointer-events: none;\n opacity: 0;\n }\n }\n\n & .delete-column-button {\n display: flex;\n align-items: center;\n width: var(--kds-dimension-component-width-2x);\n }\n\n & .resize-handle-area {\n position: absolute;\n\n /* resize handle should range into top border */\n top: calc(-1 * var(--kds-core-border-width-xs));\n\n /* resize handle should be at the very right of the header cell, but not range into the next cell, which is\n why we need to remove half of the .resize-handles' border */\n right: calc(\n -1 *\n (\n var(--kds-spacing-container-0-25x) - var(--kds-core-border-width-l) /\n 2\n )\n );\n\n /* otherwise the handle will be behind rows when virtual scrolling */\n z-index: var(--z-index-column-resize-drag-handle);\n display: flex;\n justify-content: center;\n width: 0;\n height: 100%;\n padding-inline: var(--kds-spacing-container-0-25x);\n cursor: col-resize;\n opacity: 0;\n\n & .resize-handle {\n border-right: var(--kds-border-resize-handle-hover);\n border-radius: var(--kds-border-radius-container-0-25x);\n }\n\n &.hover {\n opacity: 1;\n }\n\n &.drag {\n opacity: 1;\n }\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<!-- eslint-disable max-lines -->\n<script lang=\"ts\">\nimport { type PropType, toRef } from \"vue\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport {\n HEADER_HEIGHT,\n MIN_COLUMN_SIZE,\n SPECIAL_COLUMNS_SIZE,\n} from \"../../constants\";\nimport type { ActionConfig } from \"../../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../../types/ColumnConfig\";\nimport type { ColSortValue } from \"../../types/ColumnState\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport { minSizeOfColumn } from \"../../utils/columnHeaderActionButtons\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { useStartEditingKeydown } from \"../composables/useStartEditingKeydown\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport HeaderCell from \"./HeaderCell.vue\";\n\n/**\n * A table header element for displaying the column names in a table. This component\n * has a checkbox for selecting all rows in the table.\n *\n * @emits headerSelect event when the checkbox is selected for table-wide toggling of selection.\n * @emits subMenuItemSelection event when the selection of a submenu item is changed\n */\nexport default {\n components: {\n KdsCheckbox,\n KdsButton,\n HeaderCell,\n },\n props: {\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n actionConfig: {\n type: Object as PropType<ActionConfig>,\n default: () => ({}),\n },\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n isSelected: {\n type: Boolean,\n default: false,\n },\n getDragHandleHeight: {\n type: Function as PropType<() => number>,\n default: () => HEADER_HEIGHT,\n },\n showNewColumnButton: {\n type: Boolean,\n default: false,\n },\n selectedHeaderIndex: {\n type: Number as PropType<number | null>,\n default: null,\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n headerSelect: (selected: boolean) => true,\n showColumnBorder: () => true,\n columnResize: (index: number, newSize: number) => true,\n hideColumnBorder: () => true,\n columnResizeEnd: () => true,\n columnResizeStart: () => true,\n allColumnsResize: (newSize: number) => true,\n columnSort: (index: number, direction: -1 | 0 | 1) => true,\n moveDownFromHeaderCell: (index: number) => true,\n headerCellSelect: (index: number) => true,\n \"update:newColumnButtonWidth\": (width: number) => true,\n newColumnButtonClick: (event: MouseEvent) => true,\n newColumnButtonKeydownLeft: (event: KeyboardEvent) => true,\n selectionKeydownDown: () => true,\n headerCellDeselect: () => true,\n headerCellStartEditing: (index: number, initialValue?: string) => true,\n deleteColumn: (index: number) => true,\n },\n setup(props, { emit }) {\n const { indexedData: indexedColumns, style: headerStyles } =\n useIndicesAndStylesFor(toRef(props, \"columns\"));\n\n let currentColumnIndex = 0;\n const onStartEditing = (initialValue?: string) => {\n emit(\"headerCellStartEditing\", currentColumnIndex, initialValue);\n };\n const { onKeydown: startEditingKeydown } = useStartEditingKeydown({\n onExpandAndStartEditing: onStartEditing,\n onStartEditing,\n });\n\n const onHeaderCellKeydown = (event: KeyboardEvent, columnIndex: number) => {\n currentColumnIndex = columnIndex;\n startEditingKeydown(event);\n };\n\n const { colSizesFrozenWhenResizing } = injectColumnSizes();\n\n return {\n indexedColumns,\n headerStyles,\n onHeaderCellKeydown,\n colSizesFrozenWhenResizing,\n };\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n data() {\n return {\n minimumColumnWidth: MIN_COLUMN_SIZE, // need to add this here since it is referenced in the template\n resizingColumnIndex: null as null | number, // the index of the column that is currently being resized; null otherwise\n focusedHeaderIndex: null as null | number, // the index of the currently focused header cell\n };\n },\n computed: {\n headerBackgroundColor(): string {\n return `var(--kds-color-${this.renderedOnBackgroundColor}, var(--kds-color-page-default))`;\n },\n /**\n * The smallest size that can be given to all columns at once, i.e. the\n * largest of their individual minimums (see {@link minSizeOfColumn}).\n */\n minSizeForAllColumns(): number {\n return this.columns.reduce(\n (max, column, index) =>\n Math.max(\n max,\n minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n }),\n ),\n MIN_COLUMN_SIZE,\n );\n },\n headerSelectionOverlayStyle(): Record<string, string> | null {\n const columnIndex = this.selectedHeaderIndex;\n if (\n columnIndex === null ||\n !this.tableConfig.enableHeaderCellSelection ||\n // Positioned from the sizes frozen at drag start, so it would lag\n // behind the live column widths while a column is being resized.\n this.resizingColumnIndex !== null\n ) {\n return null;\n }\n let left = 0;\n if (this.tableConfig.showSelection) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n if (this.tableConfig.enableRowDeletion) {\n left += SPECIAL_COLUMNS_SIZE;\n }\n for (let i = 0; i < columnIndex; i++) {\n left += this.columnSize(i);\n }\n const width = this.columnSize(columnIndex);\n return {\n left: `${left}px`,\n width: `${width}px`,\n };\n },\n },\n methods: {\n columnSize(columnIndex: number): number {\n return (\n this.colSizesFrozenWhenResizing[columnIndex] ?? this.minimumColumnWidth\n );\n },\n sortDirection(columnIndex: number): -1 | 0 | 1 {\n const columnId = this.columns[columnIndex].id;\n return (\n this.colSortValues.find(({ id }) => id === columnId)?.direction ?? 0\n );\n },\n onHeaderCellFocus(columnIndex: number) {\n if (\n !this.tableConfig.enableHeaderCellSelection &&\n !this.columns[columnIndex].editable\n ) {\n return;\n }\n this.focusedHeaderIndex = columnIndex;\n this.$emit(\"headerCellSelect\", columnIndex);\n },\n onHeaderCellBlur(columnIndex: number) {\n this.focusedHeaderIndex = null;\n if (!this.columns[columnIndex].editable) {\n this.$emit(\"headerCellDeselect\");\n }\n },\n emitNewColumnButtonWidth() {\n const newColumnButtonHead = this.$refs[\n \"new-column-button-head\"\n ] as HTMLElement;\n this.$emit(\n \"update:newColumnButtonWidth\",\n newColumnButtonHead.getBoundingClientRect().width ?? 0,\n );\n },\n onSelect() {\n this.$emit(\"headerSelect\", !this.isSelected);\n },\n onHeaderClick(ind: number) {\n if (\n this.tableConfig.enableHeaderCellSelection &&\n this.selectedHeaderIndex !== ind\n ) {\n this.$emit(\"headerCellSelect\", ind);\n }\n if (this.columns[ind].editable) {\n this.$emit(\"headerCellStartEditing\", ind);\n }\n },\n onColumnResizeStart(columnIndex: number) {\n this.resizingColumnIndex = columnIndex;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.resizingColumnIndex = null;\n this.$emit(\"columnResizeEnd\");\n },\n onColumnResize(columnIndex: number, newSize: number) {\n this.$emit(\"columnResize\", columnIndex, newSize);\n },\n onAllColumnsResize(newSize: number) {\n // One size for every column, so it has to clear the largest of their\n // minimums; the dragged cell cannot clamp this on its own.\n this.$emit(\n \"allColumnsResize\",\n Math.max(newSize, this.minSizeForAllColumns),\n );\n },\n onColumnSort(columnIndex: number, direction: -1 | 0 | 1) {\n this.$emit(\"columnSort\", columnIndex, direction);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n this.$emit(\"newColumnButtonClick\", event);\n },\n onNewColumnButtonKeydownLeft(event: KeyboardEvent) {\n this.$emit(\"newColumnButtonKeydownLeft\", event);\n },\n onDeleteColumn(ind: number) {\n this.$emit(\"deleteColumn\", ind);\n },\n getHeaderCellWidths() {\n return this.columns.map((_column, columnIndex) =>\n (\n this.$refs[`headerCell-${columnIndex}`] as InstanceType<\n typeof HeaderCell\n >[]\n )[0].getHeaderCellWidth(),\n );\n },\n /**\n * We deliberately only react on Tab and not on blur since we do\n * want to keep the header in a selected yet unfocused state when\n * the user clicks outside the table.\n */\n onKeydownTab() {\n this.$emit(\"headerCellDeselect\");\n },\n onKeydownLeft(columnIndex: number) {\n if (columnIndex > 0) {\n this.focusHeaderCell(columnIndex - 1);\n }\n },\n onKeydownRight(columnIndex: number) {\n if (columnIndex < this.columns.length - 1) {\n this.focusHeaderCell(columnIndex + 1);\n } else if (this.showNewColumnButton) {\n if (this.tableConfig.enableHeaderCellSelection) {\n this.$emit(\"headerCellDeselect\");\n }\n this.focusNewColumnButton();\n }\n },\n onKeydownDown(columnIndex: number) {\n if (this.tableConfig.enableCellSelection) {\n this.$emit(\"moveDownFromHeaderCell\", columnIndex);\n }\n },\n focusHeaderCell(cellInd: number) {\n (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].focus();\n },\n isColumnHeaderFocusable(cellInd: number): boolean {\n return (\n this.$refs[`headerCell-${cellInd}`] as InstanceType<typeof HeaderCell>[]\n )[0].isFocusable();\n },\n focusNewColumnButton() {\n (\n this.$refs[\"new-column-button\"] as InstanceType<typeof KdsButton>\n )?.$el.focus();\n },\n focusSelectionCheckbox() {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (this.$refs[\"selection-checkbox\"] as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n },\n },\n};\n</script>\n\n<template>\n <thead>\n <tr :style=\"{ ...headerStyles }\">\n <th\n v-if=\"tableConfig.enableRowDeletion\"\n scope=\"col\"\n class=\"deletion-cell-spacer\"\n aria-label=\"Delete row\"\n />\n <th\n v-if=\"tableConfig.showSelection\"\n scope=\"col\"\n class=\"select-cell\"\n @keydown.down.prevent.stop=\"$emit('selectionKeydownDown')\"\n >\n <KdsCheckbox\n ref=\"selection-checkbox\"\n class=\"select-checkbox\"\n tooltip=\"Select all rows\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n />\n </th>\n <HeaderCell\n v-for=\"[column, ind] in indexedColumns\"\n :key=\"ind\"\n :ref=\"`headerCell-${ind}`\"\n :column\n :additional-menu-items=\"additionalHeaderMenuItems[ind] ?? []\"\n :table-config\n :action-config\n :sort-direction=\"sortDirection(ind)\"\n :index=\"ind\"\n :focused=\"focusedHeaderIndex === ind\"\n :selected=\"selectedHeaderIndex === ind\"\n :other-column-resizing=\"\n resizingColumnIndex !== null && resizingColumnIndex !== ind\n \"\n :get-drag-handle-height=\"getDragHandleHeight\"\n @on-header-cell-focus=\"onHeaderCellFocus(ind)\"\n @on-header-cell-blur=\"onHeaderCellBlur(ind)\"\n @on-header-click=\"onHeaderClick(ind)\"\n @on-keydown-tab=\"onKeydownTab\"\n @on-keydown-left=\"onKeydownLeft(ind)\"\n @on-keydown-right=\"onKeydownRight(ind)\"\n @on-keydown-down=\"onKeydownDown(ind)\"\n @on-header-cell-keydown=\"onHeaderCellKeydown($event, ind)\"\n @on-delete-column=\"onDeleteColumn(ind)\"\n @on-column-sort=\"onColumnSort(ind, $event)\"\n @column-resize-start=\"onColumnResizeStart(ind)\"\n @column-resize-end=\"onColumnResizeEnd\"\n @column-resize=\"onColumnResize(ind, $event)\"\n @all-columns-resize=\"onAllColumnsResize\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" :column-index=\"ind\" />\n </template>\n </HeaderCell>\n <th\n v-if=\"showNewColumnButton\"\n ref=\"new-column-button-head\"\n scope=\"col\"\n class=\"new-column-head\"\n aria-label=\"Add column\"\n @vue:mounted=\"emitNewColumnButtonWidth\"\n >\n <KdsButton\n ref=\"new-column-button\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n @click=\"onNewColumnButtonClick\"\n @keydown.left.prevent.stop=\"onNewColumnButtonKeydownLeft\"\n />\n </th>\n </tr>\n <div\n v-if=\"headerSelectionOverlayStyle\"\n :class=\"[\n 'header-selection-overlay',\n { 'header-focused': focusedHeaderIndex !== null },\n ]\"\n :style=\"headerSelectionOverlayStyle\"\n />\n </thead>\n</template>\n\n<style scoped>\nthead {\n background-color: v-bind(headerBackgroundColor);\n border-bottom: var(--kds-border-base-subtle);\n\n & tr {\n display: flex;\n height: 100%;\n transition:\n height 0.3s,\n box-shadow 0.15s;\n\n & th {\n min-height: var(--kds-dimension-component-height-2-5x);\n max-height: var(--kds-dimension-component-height-5x);\n text-align: left;\n white-space: nowrap;\n\n &.deletion-cell-spacer {\n width: var(--kds-dimension-component-width-2x);\n }\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n padding: var(--kds-spacing-container-0-75x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.new-column-head {\n display: flex;\n flex-direction: column;\n justify-content: center;\n padding: var(--kds-spacing-container-0-5x);\n }\n }\n\n &:hover {\n outline: none;\n }\n }\n\n &.sub-menu-active tr {\n padding-right: var(--kds-dimension-component-width-2x);\n }\n}\n\n.header-selection-overlay {\n position: absolute;\n top: 0;\n height: 100%;\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.header-focused {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { useTemplateRef } from \"vue\";\n\nimport { KdsButton } from \"@knime/kds-components\";\n\nconst emit = defineEmits<{\n click: [event: MouseEvent];\n \"keydown-up\": [event: KeyboardEvent];\n}>();\n\nconst buttonRef = \"button\";\nconst button = useTemplateRef<InstanceType<typeof KdsButton>>(buttonRef);\ndefineExpose({\n focus: () => {\n button.value?.$el.focus();\n },\n});\n</script>\n\n<template>\n <div class=\"sticky-container\">\n <KdsButton\n :ref=\"buttonRef\"\n label=\"Add\"\n leading-icon=\"plus\"\n size=\"small\"\n class=\"add-button\"\n @click=\"emit('click', $event)\"\n @keydown.up.prevent.stop=\"emit('keydown-up', $event)\"\n />\n </div>\n</template>\n\n<style scoped>\n.sticky-container {\n position: sticky;\n left: 0;\n width: fit-content;\n\n & .add-button {\n margin: var(--kds-spacing-container-0-25x);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { KdsIcon } from \"@knime/kds-components\";\n\ndefineProps<{\n toggled?: boolean;\n}>();\n\ndefineEmits<{\n click: [event: MouseEvent];\n}>();\n</script>\n\n<template>\n <div\n role=\"button\"\n tabindex=\"-1\"\n :class=\"['expand-button', { toggled }]\"\n aria-label=\"Open data value view\"\n @click=\"$emit('click', $event)\"\n >\n <KdsIcon name=\"data-value-view\" size=\"small\" />\n </div>\n</template>\n\n<style scoped>\n.expand-button {\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-1x);\n height: var(--kds-dimension-component-height-1x);\n padding: 0;\n color: var(--kds-color-text-and-icon-info);\n cursor: pointer;\n background-color: var(--kds-color-background-neutral-initial);\n border: none;\n border-radius: var(--kds-border-radius-container-0-12x);\n\n &:hover {\n background-color: var(--kds-color-background-neutral-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-neutral-active);\n }\n\n &.toggled {\n color: var(--kds-color-text-and-icon-neutral-inverted);\n background-color: var(--kds-color-background-info-bold-initial);\n border: var(--kds-border-action-transparent);\n\n &:hover {\n background-color: var(--kds-color-background-info-bold-hover);\n }\n\n &:active {\n background-color: var(--kds-color-background-info-bold-active);\n }\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, computed, onMounted, ref, useTemplateRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport { KdsMissingValueIcon, vKdsTooltip } from \"@knime/kds-components\";\n\nimport { EXPAND_BUTTON_WIDTH } from \"../../constants\";\nimport { useDataValueViews } from \"../composables/useDataValueViews\";\nimport CellExpandButton from \"../ui/CellExpandButton.vue\";\n\nimport type { CellRendererProps } from \"./CellRendererProps\";\n\nconst emit = defineEmits([\"click\", \"expand\", \"input\", \"select\"]);\nconst props = defineProps<CellRendererProps>();\n\nconst dataCellColorStyle = computed(() => {\n const { color } = props;\n return color === null\n ? {}\n : {\n \"--data-cell-color\": color,\n };\n});\n\nconst hasPaddingTopBottom = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingTopBottom));\n});\n\nconst hasPaddingLeftRight = computed(() => {\n if (props.isEditing) {\n return false;\n }\n if (props.isMissing) {\n return true;\n }\n return !(props.isSlotted && Boolean(props.noPaddingLeftRight));\n});\n\nconst paddingTopBottom = computed(() => {\n if (!hasPaddingTopBottom.value) {\n return {};\n }\n\n let paddingTopBottom = props.defaultTopBottomPadding;\n if (props.isMissing) {\n // height of text is 16px, height of missing value icon is 14px => padding needs to be increased by 1px\n paddingTopBottom += 1;\n }\n\n return {\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n };\n});\n\nconst cellContent: Ref<HTMLElement | null> = useTemplateRef(\"cell-content\");\nconst getCellContentDimensions = () => {\n const firstElementChild = cellContent.value?.firstElementChild;\n let widthDataCellFirstChild = 0;\n let heightDataCellFirstChild = 0;\n if (firstElementChild) {\n widthDataCellFirstChild = Math.ceil(firstElementChild.scrollWidth);\n heightDataCellFirstChild = Math.ceil(firstElementChild.scrollHeight);\n }\n return {\n width: props.defaultLeftRightPadding * 2 + widthDataCellFirstChild,\n height:\n heightDataCellFirstChild +\n (hasPaddingTopBottom.value ? props.defaultTopBottomPadding * 2 : 0),\n };\n};\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst onPointerMove = throttle(() => {\n if (props.selectOnMove) {\n emit(\"select\", { expandSelection: true });\n }\n});\n\nconst onPointerDown = (event: MouseEvent) => {\n if (event.button === 0) {\n emit(\"select\", { expandSelection: event.shiftKey });\n }\n};\n\nconst { close: closeExpandedSelectedCell, isShown: isExpandedIfSelected } =\n useDataValueViews();\n\nconst expand = () => emit(\"expand\");\nconst expandAndSelect = (event: MouseEvent) => {\n expand();\n\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n};\n\nconst isExpanded = computed(\n () => props.isSelected && isExpandedIfSelected.value,\n);\nconst isHovered = ref(false);\nconst showCellExpandButton = computed(\n () => props.enableExpand && (isHovered.value || isExpanded.value),\n);\n\n// Snapshot taken on pointerdown — by the time `click` fires, selecting this\n// cell may have already auto-expanded it (when another cell's view was open),\n// flipping `props.isExpanded` to true and making us wrongly close.\nconst wasExpandedAtPointerDown = ref(false);\nconst onExpandButtonPointerDown = () => {\n wasExpandedAtPointerDown.value = isExpanded.value;\n};\nconst onExpandButtonClick = (event: MouseEvent) => {\n if (wasExpandedAtPointerDown.value) {\n closeExpandedSelectedCell();\n emit(\"select\", { expandSelection: event.shiftKey, ignoreIfSelected: true });\n event.preventDefault();\n event.stopPropagation();\n event.stopImmediatePropagation();\n } else {\n expandAndSelect(event);\n }\n};\n\nconst changeExpandedCellViewIfNecessary = () => {\n if (props.isToBeExpanded) {\n if (props.enableExpand) {\n expand();\n } else {\n closeExpandedSelectedCell();\n }\n }\n};\n\nwatch(() => props.isToBeExpanded, changeExpandedCellViewIfNecessary);\nonMounted(changeExpandedCellViewIfNecessary);\n</script>\n\n<template>\n <td\n v-kds-tooltip=\"isMissing ? props.tooltip : undefined\"\n :class=\"[\n 'data-cell',\n {\n 'colored-cell': color,\n 'in-cell-selection': isInCellSelection,\n },\n ]\"\n :style=\"{\n width: `var(${colSizeCssVar})`,\n ...(hasPaddingLeftRight\n ? {\n paddingLeft: `${props.defaultLeftRightPadding}px`,\n paddingRight: `${props.defaultLeftRightPadding}px`,\n }\n : {}),\n ...paddingTopBottom,\n ...dataCellColorStyle,\n }\"\n @dblclick=\"(event: MouseEvent) => enableExpand && expandAndSelect(event)\"\n @pointerenter=\"isHovered = true\"\n @pointerleave=\"isHovered = false\"\n @pointermove=\"onPointerMove\"\n @pointerdown=\"onPointerDown\"\n @input=\"(val: any) => emit('input', { value: val, cell: $el })\"\n >\n <div ref=\"cell-content\" class=\"cell-content\">\n <slot v-if=\"isEditing\" name=\"editable-cell\" :cell-element=\"$el\" />\n <KdsMissingValueIcon v-else-if=\"isMissing\" size=\"small\" />\n <slot\n v-else-if=\"isSlotted\"\n :width=\"\n size -\n props.defaultLeftRightPadding * 2 -\n (showCellExpandButton && !overlayExpandButton\n ? EXPAND_BUTTON_WIDTH\n : 0)\n \"\n />\n <span v-else v-kds-tooltip:truncated=\"props.tooltip\" class=\"cell-text\">\n {{ text }}\n </span>\n <CellExpandButton\n v-if=\"showCellExpandButton\"\n :class=\"{ overlaid: overlayExpandButton }\"\n :toggled=\"isExpanded\"\n @pointerdown=\"onExpandButtonPointerDown\"\n @click=\"onExpandButtonClick\"\n />\n </div>\n </td>\n</template>\n\n<style scoped>\n.data-cell {\n display: flex;\n font: var(--kds-font-base-interactive-small);\n color: var(--kds-color-text-and-icon-neutral);\n white-space: nowrap;\n user-select: none;\n background-clip: border-box;\n\n &.in-cell-selection {\n background-color: var(--kds-color-focus-background);\n }\n\n &.colored-cell {\n /* stylelint-disable no-unknown-custom-properties -- runtime variable set via inline :style */\n background-image: linear-gradient(\n 90deg,\n var(--data-cell-color),\n var(--data-cell-color)\n );\n /* stylelint-enable no-unknown-custom-properties */\n background-repeat: no-repeat;\n background-size: var(--kds-spacing-container-0-25x);\n }\n\n & .cell-content {\n position: relative;\n display: flex;\n gap: var(--kds-spacing-container-0-25x);\n align-self: flex-start;\n justify-content: space-between;\n width: 100%;\n\n /* Anchored at the same height as the buttons of padded (non-slotted)\n cells, so it lines up with the other columns' buttons in the row. */\n & > .overlaid {\n position: absolute;\n top: v-bind(\"`${defaultTopBottomPadding}px`\");\n right: 0;\n }\n }\n\n & .cell-content .cell-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: pre;\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\nimport { type Ref, type Slot, computed, ref } from \"vue\";\n\nimport {\n getColor,\n getMissingValueMessage,\n isMissingValue,\n unpackObjectRepresentation,\n} from \"../../utils\";\n\nimport type { CellProps } from \"./CellProps\";\nimport CellRenderer from \"./CellRenderer.vue\";\n\nconst emit = defineEmits([\"click\", \"input\", \"select\", \"dataValueView\"]);\nconst props = defineProps<CellProps>();\n\nconst color = computed(() => getColor(props.cellData));\n\n/* const isClickable = computed(() => {\n const { cellData, isClickableByConfig } = props;\n return isClickableByConfig && Boolean(cellData) && cellData !== \"-\";\n}); */\n\nconst isMissing = computed(() => isMissingValue(props.cellData));\n\nconst unpackedValue = computed(() =>\n unpackObjectRepresentation(props.cellData),\n);\n\nconst tooltip = computed(() => {\n const { cellData } = props;\n if (isMissingValue(cellData)) {\n return getMissingValueMessage(cellData);\n }\n if (unpackedValue.value === undefined) {\n return null;\n } else {\n return String(unpackedValue.value);\n }\n});\n\nconst cellRenderer: Ref<InstanceType<typeof CellRenderer> | null> = ref(null);\nconst getCellContentDimensions = () =>\n cellRenderer.value?.getCellContentDimensions();\n\ndefineExpose({\n getCellContentDimensions,\n});\n\nconst slots = defineSlots<Record<string, Slot>>();\n\nconst forwardedSlotEntries = Object.entries(slots) as Array<[string, Slot]>;\n</script>\n\n<template>\n <CellRenderer\n ref=\"cellRenderer\"\n :is-missing\n :is-slotted=\"column.hasSlotContent ?? false\"\n :text=\"unpackedValue\"\n :tooltip=\"tooltip\"\n :color\n :select-on-move\n :default-top-bottom-padding\n :default-left-right-padding\n :no-padding-left-right=\"column.noPaddingLeftRight\"\n :no-padding-top-bottom=\"column.noPaddingTopBottom\"\n :col-size-css-var\n :size\n :enable-expand=\"\n !isMissing && enableDataValueView && column.hasDataValueView\n \"\n :overlay-expand-button=\"column.overlayDataValueViewButton\"\n :is-selected\n :is-in-cell-selection\n :is-to-be-expanded\n :is-editing\n @click=\"(value) => emit('click', value)\"\n @expand=\"() => emit('dataValueView')\"\n @select=\"(value) => emit('select', value)\"\n @input=\"(value) => emit('input', value)\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </CellRenderer>\n</template>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * A table row element which is used for displaying data in the table body. It offers a\n * wide range of functionality which is described in the following sections:\n *\n * Collapsible content:\n * This component can be optionally collapsible for showing row-specific details/content.\n * This expand capability is slotted for flexibility.\n *\n * Selection:\n * Each row can also be selectable- with a checkbox in the first position of the row.\n *\n * SubMenu:\n * A row can display a SubMenu in the last position of the row with row-specific actions\n * configured via props.\n *\n * Editable rows:\n * A cell in the row can be editable and render an input field or other component to allow\n * real time interactions and events.\n *\n * Cell events:\n * DOM events are triggered on a cell-by-cell basis for both clicking and hovering. These events\n * emit information about the data of the cell and the index of the column in the row.\n *\n * Dynamic cell content:\n * Specific columns can be slotted for dynamic rendering methods or configured to use a pre-determined\n * rendering component with the Vue Component/v-is API.\n *\n * @emits rowSelect event when selection is enabled and a row checkbox is toggled.\n * @emits rowInput event when table cells are clicked, cell input is triggered or a hover event is\n * detected.\n * @emits rowSubMenuClick event when a row SubMenu action is triggered.\n */\n\nimport { type Ref, computed, ref, toRef, watch } from \"vue\";\nimport throttle from \"raf-throttle\";\n\nimport {\n KdsButton,\n KdsCheckbox,\n KdsMenuButton,\n type KdsMenuItem,\n} from \"@knime/kds-components\";\n\nimport type { ColumnConfig, RowConfig, SubMenuConfig } from \"../..\";\nimport {\n CELL_PADDING_HORIZONTAL,\n COMPACT_ROW_PADDING_TOP_BOTTOM,\n DEFAULT_ROW_HEIGHT,\n DEFAULT_ROW_PADDING_TOP_BOTTOM,\n} from \"../../constants\";\nimport type { VirtualElementAnchor } from \"../../types/DataValueView\";\nimport type { TableConfig } from \"../../types/TableConfig\";\nimport {\n getPropertiesFromColumns,\n unpackObjectRepresentation,\n} from \"../../utils\";\nimport { injectRegisterExpandedSubMenu } from \"../composables/useCloseSubMenusOnScroll\";\nimport { useIndicesAndStylesFor } from \"../composables/useHorizontalIndicesAndStyles\";\nimport { getColSizeCSSVar, injectColumnSizes } from \"../useColumnSizes\";\n\nimport Cell from \"./Cell.vue\";\n\nexport interface RowProps {\n rowData?: { subMenuItemsForRow?: KdsMenuItem[] };\n row?: any[];\n tableConfig: TableConfig;\n subMenuConfig: SubMenuConfig;\n columns: ColumnConfig[];\n rowConfig?: RowConfig;\n rowHeight?: number | \"dynamic\";\n isSelected?: boolean;\n minRowHeight?: number;\n showDragHandle?: boolean;\n selectCellsOnMove?: boolean;\n disableRowHeightTransition?: boolean;\n selectedCellIndex?: number | null;\n cellSelectionRange?: { min: number; max: number } | null;\n toBeExpandedCellIndex?: number | null;\n toBeEditedCellIndex?: number | null;\n newColumnButtonWidth?: number;\n}\n\nconst props = withDefaults(defineProps<RowProps>(), {\n rowData: () => ({}),\n rowConfig: () => ({}),\n row: () => [],\n rowHeight: DEFAULT_ROW_HEIGHT,\n minRowHeight: 0,\n isSelected: false,\n selectCellsOnMove: false,\n showDragHandle: false,\n disableRowHeightTransition: false,\n selectedCellIndex: null,\n cellSelectionRange: null,\n toBeExpandedCellIndex: null,\n toBeEditedCellIndex: null,\n newColumnButtonWidth: 0,\n});\n\nconst { indexedData: indexedRow, style: rowStyles } = useIndicesAndStylesFor(\n toRef(props, \"row\"),\n);\n\nconst emit = defineEmits<{\n rowSelect: [value: any];\n rowInput: [event: any];\n rowSubMenuClick: [item: any];\n resizeAllRows: [size: number, rowElement: HTMLElement];\n resizeRow: [size: number];\n cellSelect: [index: number, ignoreIfSelected: boolean];\n expandCellSelect: [index: number];\n dataValueView: [index: number, anchor: VirtualElementAnchor];\n deleteRow: [];\n virtualColumnNav: [\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n ];\n}>();\n\nconst showContent = ref(false);\nconst currentRowHeight = ref(props.rowHeight);\nconst paddingTopBottom = computed(() =>\n props.rowConfig.compactMode\n ? COMPACT_ROW_PADDING_TOP_BOTTOM\n : DEFAULT_ROW_PADDING_TOP_BOTTOM,\n);\nconst paddingLeftRight = CELL_PADDING_HORIZONTAL;\n\nwatch(\n () => props.rowHeight,\n (newRowHeight) => {\n currentRowHeight.value = newRowHeight;\n },\n);\nconst activeDrag = ref(false);\nconst rowHeightOnDragStart = ref(0);\n\nconst columnKeys = computed(() =>\n getPropertiesFromColumns(props.columns, \"key\"),\n);\n\nconst DEFAULT_COLUMN_SIZE = 100;\n// The resize-frozen sizes are used so the slotted cell content does not\n// re-render on every drag frame of a column resize; while not resizing they\n// are identical to the live sizes.\nconst { colSizesFrozenWhenResizing } = injectColumnSizes();\nconst getCellSize = (index: number) =>\n colSizesFrozenWhenResizing.value[index] ?? DEFAULT_COLUMN_SIZE;\n\n// const clickableColumns = computed(() =>\n// getPropertiesFromColumns(props.columnConfigs, \"popoverRenderer\").map(\n// (config) => Boolean(config),\n// ),\n// );\nconst filteredSubMenuItems = computed(() => {\n if (\n !props.subMenuConfig.subMenuItems?.length &&\n !props.rowData?.subMenuItemsForRow?.length\n ) {\n return [];\n }\n\n return props.rowData?.subMenuItemsForRow?.length\n ? props.rowData?.subMenuItemsForRow\n : props.subMenuConfig.subMenuItems;\n});\nconst onDeleteRow = () => {\n emit(\"deleteRow\");\n};\nconst onRowExpand = () => {\n showContent.value = !showContent.value;\n};\nconst onSelect = (value: any) => {\n emit(\"rowSelect\", value);\n};\nconst onCellClick = (event: any, colInd: number, data: any) => {\n emit(\"rowInput\", {\n ...event,\n type: \"click\",\n value: null,\n colInd,\n data,\n });\n};\nconst onInput = (event: any) => {\n emit(\"rowInput\", { type: \"input\", ...event });\n};\nconst registerExpandedSubMenu = injectRegisterExpandedSubMenu();\nconst isMenuOpen = ref(false);\nwatch(isMenuOpen, (open) => {\n if (open) {\n registerExpandedSubMenu(() => {\n isMenuOpen.value = false;\n });\n }\n});\n// const isClickableByConfig = (ind: number) => {\n// return Boolean(props.tableConfig.showPopovers) && clickableColumns.value[ind];\n// };\nconst getCellContentSlotName = (columnKeys: any, columnId: any) => {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columnKeys[columnId]}`;\n};\nconst onPointerDown = (event: PointerEvent) => {\n if (currentRowHeight.value === \"dynamic\") {\n return;\n }\n consola.debug(\"Resize via row drag triggered: \", event);\n // stop the event from propagating up the DOM tree\n event.stopPropagation();\n // capture move events until the pointer is released\n (event.target as Element).setPointerCapture(event.pointerId);\n activeDrag.value = true;\n rowHeightOnDragStart.value = currentRowHeight.value;\n};\n\nconst rowElement: Ref<null | HTMLElement> = ref(null);\nconst onPointerUp = (event: PointerEvent) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via row drag ended: \", event);\n activeDrag.value = false;\n emit(\"resizeAllRows\", currentRowHeight.value as number, rowElement.value!);\n }\n};\nconst onPointerMove = throttle((event) => {\n if (activeDrag.value) {\n consola.debug(\"Resize via drag ongoing: \", event);\n const newRowHeight =\n event.clientY - rowElement.value!.getBoundingClientRect().top;\n currentRowHeight.value = Math.max(newRowHeight, props.minRowHeight);\n emit(\"resizeRow\", currentRowHeight.value - rowHeightOnDragStart.value);\n }\n});\nconst onLostPointerCapture = throttle(() => {\n activeDrag.value = false;\n});\nconst cells: Ref<Record<number, any>> = ref({});\nconst getCellComponents = () => {\n return props.row.map((_, columnIndex) => cells.value[columnIndex]);\n};\nconst onCellSelect = ({\n expandSelection,\n ind,\n ignoreIfSelected = false,\n}: {\n expandSelection: boolean;\n ind: number;\n ignoreIfSelected?: boolean;\n}) => {\n if (expandSelection) {\n emit(\"expandCellSelect\", ind);\n } else {\n emit(\"cellSelect\", ind, ignoreIfSelected);\n }\n};\n\nconst onDataValueView = (index: number) => {\n const anchor = cells.value[index].$el.getBoundingClientRect();\n emit(\"dataValueView\", index, anchor);\n};\n\nconst selectionCheckbox = ref<InstanceType<typeof KdsCheckbox> | null>(null);\nconst deleteButton = ref<InstanceType<typeof KdsButton> | null>(null);\nconst onVirtualColumnKeydown = (\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n) => {\n emit(\"virtualColumnNav\", type, direction);\n};\n\nconst focusDeleteButton = () => {\n deleteButton.value?.$el?.focus();\n};\nconst focusSelectionCheckbox = () => {\n (selectionCheckbox.value as any)?.$el\n ?.querySelector('button[role=\"checkbox\"]')\n ?.focus();\n};\n\nconst rowHeightStyle = computed(() =>\n currentRowHeight.value === \"dynamic\"\n ? {}\n : { height: `${currentRowHeight.value}px` },\n);\n\nconst transitionInactiveDrag = computed(() => {\n const rowHeightTransition = props.disableRowHeightTransition\n ? \"\"\n : \"height 0.3s, \";\n return { transition: `${rowHeightTransition}box-shadow 0.15s` };\n});\n\nconst transition = computed(() =>\n activeDrag.value ? {} : transitionInactiveDrag.value,\n);\n\ndefineExpose({\n getCellComponents,\n focusDeleteButton,\n focusSelectionCheckbox,\n /**\n * For TableUI test purposes only\n */\n onRowExpand,\n});\n</script>\n\n<template>\n <tr\n ref=\"rowElement\"\n :class=\"[\n 'row',\n {\n 'no-sub-menu': !filteredSubMenuItems?.length,\n 'compact-mode': rowConfig.compactMode,\n },\n ]\"\n :style=\"{\n ...rowStyles,\n ...transition,\n ...rowHeightStyle,\n }\"\n >\n <td v-if=\"tableConfig.enableRowDeletion\" class=\"deletion-cell\">\n <KdsButton\n ref=\"deleteButton\"\n variant=\"transparent\"\n leading-icon=\"trash\"\n size=\"small\"\n destructive\n ariaLabel=\"Delete row\"\n @click.stop=\"onDeleteRow\"\n @keydown.left.prevent.stop\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('delete', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('delete', 'down')\"\n @keydown.right.prevent.stop=\"onVirtualColumnKeydown('delete', 'right')\"\n />\n </td>\n <td\n v-if=\"tableConfig.showSelection\"\n class=\"select-cell\"\n :style=\"{\n paddingTop: `${paddingTopBottom}px`,\n paddingBottom: `${paddingTopBottom}px`,\n }\"\n >\n <KdsCheckbox\n ref=\"selectionCheckbox\"\n tooltip=\"Select row\"\n class=\"select-checkbox\"\n :model-value=\"isSelected\"\n :disabled=\"tableConfig.disableSelection\"\n @update:model-value=\"onSelect\"\n @keydown.up.prevent.stop=\"onVirtualColumnKeydown('selection', 'up')\"\n @keydown.down.prevent.stop=\"onVirtualColumnKeydown('selection', 'down')\"\n @keydown.left.prevent.stop=\"onVirtualColumnKeydown('selection', 'left')\"\n @keydown.right.prevent.stop=\"\n onVirtualColumnKeydown('selection', 'right')\n \"\n @focusout.stop\n />\n </td>\n <Cell\n v-for=\"[cell, ind] of indexedRow\"\n :ref=\"\n (el) => {\n cells[ind] = el;\n }\n \"\n :key=\"ind\"\n :column=\"columns[ind]\"\n :cell-data=\"cell\"\n :select-on-move=\"selectCellsOnMove\"\n :is-selected=\"selectedCellIndex === ind\"\n :is-in-cell-selection=\"\n cellSelectionRange !== null &&\n ind >= cellSelectionRange.min &&\n ind <= cellSelectionRange.max\n \"\n :is-to-be-expanded=\"toBeExpandedCellIndex === ind\"\n :enable-data-value-view=\"tableConfig.enableDataValueViews\"\n :is-editing=\"toBeEditedCellIndex === ind\"\n :col-size-css-var=\"getColSizeCSSVar(ind)\"\n :size=\"getCellSize(ind)\"\n :default-top-bottom-padding=\"paddingTopBottom\"\n :default-left-right-padding=\"paddingLeftRight\"\n @click=\"onCellClick($event, ind, cell)\"\n @select=\"onCellSelect({ ...$event, ind })\"\n @data-value-view=\"onDataValueView(ind)\"\n @input=\"onInput\"\n >\n <template #default=\"{ width }\">\n <slot\n :name=\"getCellContentSlotName(columnKeys, ind)\"\n :row=\"row\"\n :cell=\"unpackObjectRepresentation(cell)\"\n :height=\"rowHeight\"\n :width=\"width\"\n :ind=\"ind\"\n />\n </template>\n <template #editable-cell=\"{ cellElement }\">\n <slot name=\"editable-cell\" :cell-element=\"cellElement\" :ind=\"ind\" />\n </template>\n </Cell>\n <td v-if=\"filteredSubMenuItems?.length\" class=\"action\">\n <KdsMenuButton\n v-model=\"isMenuOpen\"\n ariaLabel=\"More actions\"\n :items=\"filteredSubMenuItems\"\n size=\"small\"\n variant=\"transparent\"\n leading-icon=\"more-actions\"\n @item-click=\"emit('rowSubMenuClick', $event)\"\n />\n </td>\n <td\n v-if=\"newColumnButtonWidth\"\n :style=\"{ minWidth: `${newColumnButtonWidth}px` }\"\n />\n </tr>\n <div\n v-if=\"showDragHandle && !selectCellsOnMove\"\n class=\"row-drag-handle\"\n @pointerdown.passive=\"onPointerDown\"\n @pointerup.passive=\"onPointerUp\"\n @pointermove=\"onPointerMove\"\n @lostpointercapture=\"onLostPointerCapture\"\n />\n</template>\n\n<style scoped>\ntr {\n display: flex;\n}\n\ntr.row {\n border-bottom: var(--kds-border-base-subtle);\n\n & td {\n padding: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n\n &.select-cell {\n display: flex;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n\n & .select-checkbox {\n /* With this added padding the checkbox appears centered initially */\n padding: var(--kds-spacing-container-0-10x);\n }\n }\n\n &.deletion-cell {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n overflow: visible;\n opacity: 0;\n\n &:focus-within {\n opacity: 1;\n }\n }\n\n &.action {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--kds-dimension-component-width-2x);\n min-width: var(--kds-dimension-component-width-2x);\n }\n }\n\n &:hover {\n outline: none;\n background-color: var(--kds-color-background-neutral-hover);\n\n /* stylelint-disable-next-line no-descending-specificity -- hover needs lower specificity but must come after base rule */\n & .deletion-cell {\n opacity: 1;\n }\n }\n\n & a {\n outline: none;\n }\n}\n\n.row-drag-handle {\n height: var(--kds-spacing-container-0-37x);\n margin-top: calc(-1 * var(--kds-spacing-container-0-37x));\n cursor: row-resize;\n opacity: 0;\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref } from \"vue\";\n\nimport { SPECIAL_COLUMNS_SIZE } from \"../../constants\";\nimport { injectColumnSizes } from \"../useColumnSizes\";\n\nimport type { CellSelectionOverlayProps } from \"./CellSelectionOverlayProps\";\n\nconst props = defineProps<CellSelectionOverlayProps>();\n\n/**\n * Live numeric column sizes, injected rather than received as a prop. The\n * overlay is rendered as a sibling of the row/cell tree (in the\n * `cell-selection-overlay` slot), so re-rendering it when the sizes change\n * during a resize does not cascade to the cells. Reading the live sizes at\n * render time is therefore safe here and keeps the selection rectangle correct\n * while a column is being resized.\n */\nconst { colSizes } = injectColumnSizes();\n\nconst getRowResizeOffset = computed(() => {\n const rowResizeIndex = props.rowResizeIndex;\n const rowResizeDelta = props.rowResizeDelta;\n if (rowResizeIndex === null || rowResizeDelta === null) {\n return () => 0;\n } else {\n return (index: number) => (index > rowResizeIndex ? rowResizeDelta : 0);\n }\n});\n\nconst top = computed(() => {\n const { min } = props.rect.y;\n return min * props.rowHeight + getRowResizeOffset.value(min);\n});\n\nconst bottom = computed(() => {\n const { max } = props.rect.y;\n return (max + 1) * props.rowHeight + getRowResizeOffset.value(max + 1);\n});\n\nconst columnOffsets = computed(() => {\n let currentOffset = 0;\n if (props.tableConfig.showSelection) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n if (props.tableConfig.enableRowDeletion) {\n currentOffset += SPECIAL_COLUMNS_SIZE;\n }\n const offsets: number[] = [];\n colSizes.value.forEach((size) => {\n offsets.push(currentOffset);\n currentOffset += size;\n });\n offsets.push(currentOffset);\n return offsets;\n});\n\nconst left = computed(() => {\n const { min } = props.rect.x;\n return columnOffsets.value[min];\n});\n\nconst right = computed(() => {\n const { max } = props.rect.x;\n return columnOffsets.value[max + 1];\n});\n\nconst height = computed(() => {\n return bottom.value - top.value;\n});\n\nconst width = computed(() => {\n return right.value - left.value;\n});\n\nconst copied = ref(false);\nconst triggerCopied = () => {\n copied.value = true;\n};\n\nconst virtualFocusOverlay = ref<null | HTMLDivElement>(null);\nconst virtualFocusOverlayCoordinates = computed(() => {\n if (!props.cellSelectionRectFocusCorner) {\n return null;\n }\n const { x: left, y: top } = props.cellSelectionRectFocusCorner;\n const right = left + 1;\n const bottom = top + 1;\n return {\n left: columnOffsets.value[left],\n right: columnOffsets.value[right],\n top: top * props.rowHeight + getRowResizeOffset.value(top),\n bottom: bottom * props.rowHeight + getRowResizeOffset.value(bottom),\n };\n});\n\nconst virtualFocusOverlayHeight = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.bottom -\n virtualFocusOverlayCoordinates.value!.top\n );\n});\n\nconst virtualFocusOverlayWidth = computed(() => {\n return (\n virtualFocusOverlayCoordinates.value!.right -\n virtualFocusOverlayCoordinates.value!.left\n );\n});\n\nconst isVirtualFocusOverlayInsideViewportOfBody = (\n containerBCR: DOMRect,\n focusOverlay: HTMLDivElement,\n headerHeight: number,\n) => {\n const virtualFocusOverlayBCR = focusOverlay.getBoundingClientRect();\n const bodyTop = containerBCR.top + headerHeight;\n\n return {\n verticalInside:\n bodyTop <= virtualFocusOverlayBCR.top &&\n virtualFocusOverlayBCR.bottom <= containerBCR.bottom,\n horizontalInside:\n containerBCR.left <= virtualFocusOverlayBCR.left &&\n virtualFocusOverlayBCR.right <= containerBCR.right,\n };\n};\n\nconst scrollFocusOverlayIntoView = async (\n params: null | {\n containerBCR: DOMRect | null;\n headerHeight: number;\n scrollTo: (scrollToValues: {\n top?: number;\n left?: number;\n }) => void | undefined;\n },\n) => {\n // wait for focusOverlay to render at new position to calculate bounding client rect\n await nextTick();\n if (params) {\n const { containerBCR, headerHeight, scrollTo } = params;\n if (\n containerBCR &&\n virtualFocusOverlay.value &&\n virtualFocusOverlayCoordinates.value\n ) {\n const { verticalInside, horizontalInside } =\n isVirtualFocusOverlayInsideViewportOfBody(\n containerBCR,\n virtualFocusOverlay.value,\n headerHeight,\n );\n\n if (!verticalInside) {\n scrollTo({\n top:\n virtualFocusOverlayCoordinates.value.top -\n containerBCR.height / 2 +\n virtualFocusOverlayHeight.value,\n });\n } else if (!horizontalInside) {\n scrollTo({\n left:\n virtualFocusOverlayCoordinates.value.left -\n containerBCR.width / 2 +\n virtualFocusOverlayWidth.value / 2,\n });\n }\n }\n } else {\n virtualFocusOverlay.value?.scrollIntoView?.({\n block: \"center\",\n inline: \"center\",\n });\n }\n};\n\nconst getFocusOverlayBoundingClientRect = () =>\n virtualFocusOverlay.value?.getBoundingClientRect();\n\ndefineExpose({\n triggerCopied,\n focus,\n scrollFocusOverlayIntoView,\n getFocusOverlayBoundingClientRect,\n});\n</script>\n\n<template>\n <div\n class=\"overlay\"\n :class=\"{ copied: copied }\"\n :style=\"{\n transform: `translateY(${top}px) translateX(${left}px)`,\n width: `${width}px`,\n height: `${height}px`,\n }\"\n @animationend=\"copied = false\"\n />\n <div\n v-if=\"virtualFocusOverlayCoordinates\"\n ref=\"virtualFocusOverlay\"\n class=\"overlay virtual-focus\"\n :style=\"{\n transform: `translateY(${virtualFocusOverlayCoordinates.top}px) translateX(${virtualFocusOverlayCoordinates.left}px)`,\n width: `${virtualFocusOverlayWidth}px`,\n height: `${virtualFocusOverlayHeight}px`,\n }\"\n />\n</template>\n\n<style scoped>\n.overlay {\n position: absolute;\n z-index: var(--z-index-cell-selection-overlay);\n pointer-events: none;\n border: var(--kds-border-action-selected-accent);\n\n &.virtual-focus {\n border: var(--kds-border-action-focused);\n }\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n KdsPagination,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n KdsPagination,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.ctrl.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.meta.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <KdsPagination\n v-if=\"pageConfig && pageState\"\n class=\"pagination\"\n :current-page=\"pageState.currentPage\"\n :page-size=\"pageConfig.pageSize\"\n :possible-page-sizes=\"pageConfig.possiblePageSizes\"\n :total-rows=\"tableState.tableSizes?.currentNumRows ?? 0\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n @update:current-page=\"onPageChange\"\n @update:page-size=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n\n /* The table inherits its parent's background; the pagination footer is the\n one place Figma sets a surface token for (SLEEK-297). KdsPagination stays\n transparent so it can sit on any surface. */\n & .pagination {\n background: var(--kds-color-surface-default);\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable max-lines */\nimport {\n type PropType,\n type Ref,\n computed,\n nextTick,\n ref,\n toRef,\n watch,\n watchEffect,\n} from \"vue\";\n\nimport {\n KdsEmptyState,\n type KdsEmptyStateProps,\n type KdsMenuItem,\n KdsPagination,\n} from \"@knime/kds-components\";\n\nimport { columnSortText } from \"../config/table.config\";\nimport {\n COMPACT_ROW_HEIGHT,\n DEFAULT_ROW_HEIGHT,\n ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY,\n SPECIAL_COLUMNS_SIZE,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { VirtualElementAnchor } from \"../types/DataValueView\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\n\nimport TableCore from \"./TableCore.vue\";\nimport { useTotalWidth } from \"./composables/useAvailableWidth\";\nimport { BODY_WIDTH_CSS_VAR } from \"./composables/useBodyWidth\";\nimport { useBoolean } from \"./composables/useBoolean\";\nimport { useCellCopyPaste } from \"./composables/useCellCopyPaste\";\nimport {\n type CellPosition,\n type Rect,\n type RectId,\n useCellSelection,\n} from \"./composables/useCellSelection\";\nimport { provideDataValueViewsIsShown } from \"./composables/useDataValueViews\";\nimport { createEditingCellKeydownHandler } from \"./composables/useEditCellKeydown\";\nimport { useVisibleAfterAvailableWidth } from \"./composables/useVisibleAfterAvailableWidth\";\nimport TableActionBar from \"./control/TableActionBar.vue\";\nimport Header from \"./layout/Header.vue\";\nimport NewRowButton from \"./layout/NewRowButton.vue\";\nimport Row from \"./layout/Row.vue\";\nimport CellSelectionOverlay from \"./ui/CellSelectionOverlay.vue\";\nimport { injectColumnSizes } from \"./useColumnSizes\";\n\nexport type DataItem =\n | {\n data: any;\n dots?: false;\n }\n | {\n dots: true;\n };\n\n/**\n * @see README.md\n */\nexport default {\n components: {\n KdsPagination,\n Header,\n Row,\n // TablePopover,\n CellSelectionOverlay,\n TableCore,\n NewRowButton,\n TableActionBar,\n KdsEmptyState,\n },\n props: {\n /**\n * Data props.\n */\n data: {\n type: Array as PropType<Array<Array<any>>>,\n required: true,\n },\n /**\n * It specifies how many (empty) rows should be simultated above the given rows in this.data[0]\n */\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n /**\n * It specifies how many (empty) rows should be simultated below the given rows in this.data[0]\n */\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n /**\n * Data displayed when scrolling to the bottom of the table. Currently only supproted together\n * with virtual scrolling enabled.\n */\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /**\n * analogous to currentSelection but for the bottomData\n */\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n /** Stable per-column definitions. */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n required: true,\n },\n /** Additional per-column header menu items (index-aligned with columns), appended after sort items. */\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n /** Active sorts, ordered by sort priority. */\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n /** Feature switches for the table. */\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n /** Runtime totals and flags for the table. */\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n /** Pagination config; its presence enables pagination. */\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n /** Runtime pagination state. */\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n /** Action-bar config; its presence enables the action bar. */\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n /** Runtime state of the action bar. */\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n required: false,\n },\n /** Per-row and per-group submenu config. */\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** Appearance of the table's rows. */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on; sets the header's background. */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n disableRowHeightTransition: {\n type: Boolean,\n default: false,\n },\n emptyState: {\n type: Object as PropType<KdsEmptyStateProps>,\n default: undefined,\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n resizeActive: (isActive: boolean) => true,\n columnUpdate: (newColumnList: string[]) => true,\n columnReorder: (colInd: number, newColInd: number) => true,\n pageChange: (newPageNumber: number) => true,\n pageSizeUpdate: (newPageSize: number) => true,\n columnSort: (colInd: number | undefined, sortDirection: -1 | 0 | 1) => true,\n selectAll: (selected: boolean) => true,\n rowSelect: (\n selected: boolean,\n rowInd: number,\n groupInd: number,\n isTop: boolean,\n ) => true,\n tableInput: (event: any) => true,\n columnResize: (columnIndex: number, newColumnSize: number) => true,\n lazyload: (lazyloadParams: {\n direction: 1 | -1;\n startIndex: number;\n endIndex: number;\n }) => true,\n allColumnsResize: (newColumnSize: number) => true,\n columnResizeStart: () => true,\n columnResizeEnd: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n \"update:searchTerm\": (newSearchTerm: string /** Might be empty */) => true,\n rowHeightUpdate: (newRowHeight: number | null | \"dynamic\") => true,\n copySelection: (copySelectionParams: {\n rect: Rect;\n id: RectId | null;\n withHeaders: boolean;\n }) => true,\n pasteSelection: (pasteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n updateSelection: (newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n }) => void;\n }) => true,\n cutSelection: (cutSelectionParams: { rect: Rect; id: RectId | null }) =>\n true,\n deleteSelection: (deleteSelectionParams: {\n rect: Rect;\n id: RectId | null;\n }) => true,\n cellSelectionChange: (cellPosition: CellPosition | null) => true,\n dataValueView: (\n row: { indexInInput: number; isTop: boolean },\n columnIndex: number,\n rect: VirtualElementAnchor,\n ) => true,\n closeDataValueView: () => true,\n newColumnButtonClick: () => true,\n newRowButtonClick: (\n lastPosition: {\n columnInd: number;\n rectId: number | null;\n } | null,\n ) => true,\n headerCellStartEditing: (columnIndex: number, initialValue?: string) =>\n true,\n deleteColumn: (colInd: number) => true,\n deleteRow: (rowInd: number) => true,\n resetTemporaryView: () => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(props, { emit }) {\n const wrapper: Ref<any> = ref(null);\n const tableCore: Ref<InstanceType<typeof TableCore> | null> = ref(null);\n const header: Ref<InstanceType<typeof Header> | null> = ref(null);\n const selectionOverlay: Ref<\n null | typeof CellSelectionOverlay | (typeof CellSelectionOverlay)[]\n > = ref([]);\n const totalWidth = useTotalWidth(wrapper);\n const { isVisible: tableIsVisible, onAvailableWidthReported } =\n useVisibleAfterAvailableWidth();\n const onUpdateAvailableWidth = (newAvailableWidth: number) => {\n emit(\"update:available-width\", newAvailableWidth);\n onAvailableWidthReported();\n };\n const enableCellSelection = computed(() =>\n Boolean(props.tableConfig.enableCellSelection),\n );\n // cell selection\n const {\n selectCell,\n expandCellSelection,\n clearCellSelection,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n } = useCellSelection(enableCellSelection);\n\n watch(selectedCell, (newCell) =>\n emit(\"cellSelectionChange\", newCell ?? null),\n );\n\n const selectCellsOnMove = useBoolean(false);\n // cell copying\n const emitCopySelection = ({ withHeaders }: { withHeaders: boolean }) => {\n if (rectMinMax.value) {\n emit(\"copySelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n withHeaders,\n });\n }\n };\n\n const scrollToCellSelectionOverlay = async () => {\n const tableCoreRef = tableCore.value;\n if (tableCoreRef === null) {\n return;\n }\n const scrollToViewParams = {\n containerBCR:\n tableCoreRef.getVirtualContainer()?.getBoundingClientRect() || null,\n headerHeight: header.value?.$el.clientHeight || 0,\n scrollTo: (position: { left?: number; top?: number }) =>\n tableCoreRef.virtualScrollToPosition(position),\n };\n\n if (Array.isArray(selectionOverlay.value)) {\n await selectionOverlay.value[0]?.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n } else if (selectionOverlay.value) {\n await selectionOverlay.value.scrollFocusOverlayIntoView(\n scrollToViewParams,\n );\n }\n };\n\n const updateCellSelection = (\n newRect: {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n },\n newRectId: RectId | null = null,\n ) => {\n const rectId = newRectId ?? currentRectId.value ?? 0;\n selectCell({ x: newRect.maxX, y: newRect.maxY }, rectId, true);\n if (newRect.minX !== newRect.maxX || newRect.minY !== newRect.maxY) {\n expandCellSelection({ x: newRect.minX, y: newRect.minY }, rectId);\n }\n tableCore.value?.getVirtualBody()?.focus({ preventScroll: true });\n nextTick().then(scrollToCellSelectionOverlay);\n };\n\n const emitPasteSelection = () => {\n if (rectMinMax.value) {\n emit(\"pasteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n updateSelection: updateCellSelection,\n });\n }\n };\n const emitCutSelection = () => {\n if (rectMinMax.value) {\n emit(\"cutSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n const emitDeleteSelection = () => {\n if (rectMinMax.value) {\n emit(\"deleteSelection\", {\n rect: rectMinMax.value,\n id: currentRectId.value,\n });\n }\n };\n\n const focusWithin = ref(false);\n const changeFocus = (newFocus: boolean) => {\n focusWithin.value = newFocus;\n };\n\n const toBeEditedCell = ref<null | CellPosition>(null);\n const editingCellInitialValue = ref<null | string>(null);\n const editingCell = computed(() =>\n selectCellsOnMove.state ? null : toBeEditedCell.value,\n );\n const isEditingCell = computed(() => editingCell.value !== null);\n\n const setToBeEditedCell = (\n cellPosition: CellPosition | null,\n initialValue?: string,\n ) => {\n toBeEditedCell.value = cellPosition;\n editingCellInitialValue.value = initialValue ?? null;\n };\n const isEditingEnabled = computed(() =>\n getPropertiesFromColumns(props.columns, \"editable\").some(Boolean),\n );\n const { handleCopyOnKeydown, handleDeleteSelection } = useCellCopyPaste({\n focusWithin,\n isEditingCell,\n selectionOverlay,\n selectedCell,\n isEditingEnabled,\n onCopy: emitCopySelection,\n onPaste: emitPasteSelection,\n onCut: emitCutSelection,\n onDelete: emitDeleteSelection,\n });\n\n const stopEditingCell = (rowInd?: number, colInd?: number) => {\n const toBeEditedCellValue = toBeEditedCell.value;\n if (\n rowInd !== undefined &&\n colInd !== undefined &&\n toBeEditedCellValue &&\n (toBeEditedCellValue.x !== colInd || toBeEditedCellValue.y !== rowInd)\n ) {\n return;\n }\n setToBeEditedCell(null);\n };\n\n const toBeShownCell = ref<null | CellPosition>(null);\n\n const closeDataValueView = () => {\n if (props.tableState.dataValueViewIsShown) {\n emit(\"closeDataValueView\");\n }\n toBeShownCell.value = null;\n };\n\n provideDataValueViewsIsShown(\n toRef(props, \"tableState\"),\n closeDataValueView,\n );\n\n const { columnResizeActive } = injectColumnSizes();\n watchEffect(() => emit(\"resizeActive\", columnResizeActive.value));\n\n const showNewColumnAndRowButton = computed(() =>\n Boolean(props.tableConfig.showNewColumnAndRowButton),\n );\n const newColumnButtonWidth = ref(0);\n\n return {\n wrapper,\n totalWidth,\n tableIsVisible,\n onUpdateAvailableWidth,\n tableCore,\n header,\n selectionOverlay,\n scrollToCellSelectionOverlay,\n selectCellsOnMove,\n currentRectId,\n rectMinMax,\n selectedCell,\n isSingleSelectedCell,\n selectCell,\n expandCellSelection,\n clearCellSelection: () => {\n clearCellSelection();\n closeDataValueView();\n },\n clearCellSelectionAndStopPropagation: (event: Event) => {\n if (rectMinMax.value === null) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n clearCellSelection();\n },\n setToBeEditedCell,\n editingCellInitialValue,\n stopEditingCell,\n updateCellSelection,\n changeFocus,\n focusWithin,\n handleCopyOnKeydown,\n handleDeleteSelection,\n toBeShownCell,\n toBeEditedCell,\n editingCell,\n isEditingCell,\n createEditingCellKeydownHandler,\n columnResizeActive,\n showNewColumnAndRowButton,\n newColumnButtonWidth,\n BODY_WIDTH_CSS_VAR,\n };\n },\n data() {\n return {\n popoverColumn: null as null | string | number | symbol,\n lastScrollIndex: 0,\n newVal: null,\n resizeCount: 0,\n updatedBefore: false,\n wrapperWidth: 0,\n closeExpandedSubMenu: () => {},\n scrollerId: \"scroller\",\n resizedRowHeight: null as null | number,\n currentResizedScrollIndex: null as null | number,\n currentRowSizeDelta: null as null | number,\n SPECIAL_COLUMNS_SIZE,\n lastRowAndRectIdBeforeMovingToNewColumnButton: null as null | {\n rowInd: number;\n rectId: RectId | null;\n },\n lastColumnAndRectIdBeforeMovingToNewRowButton: null as\n | null\n | {\n columnInd: number;\n rectId: RectId | null;\n }\n | {\n virtualColumn: \"delete\" | \"selection\";\n rectId: RectId | null;\n },\n };\n },\n computed: {\n showActionBar() {\n const viewType = this.actionState?.viewType;\n // A temporary view is highlighted via the action bar, so the bar must\n // render even when no action bar feature is enabled via actionConfig\n return (\n Boolean(this.actionConfig) ||\n viewType === \"TEMP_VIEW\" ||\n viewType === \"PREVIEW\"\n );\n },\n minRowHeight() {\n return this.rowConfig.compactMode\n ? COMPACT_ROW_HEIGHT\n : DEFAULT_ROW_HEIGHT;\n },\n initialRowHeight() {\n return this.rowConfig?.rowHeight || this.minRowHeight;\n },\n currentRowHeight() {\n return this.resizedRowHeight ?? this.initialRowHeight;\n },\n selectedHeaderIndex(): number | null {\n return this.selectedCell?.y === -1 ? this.selectedCell.x : null;\n },\n slottedColumns() {\n return getPropertiesFromColumns(this.columns, \"hasSlotContent\")\n .map((hasSlotContent: any, colInd: any) =>\n hasSlotContent ? colInd : null,\n )\n .filter((colInd: any) => colInd !== null);\n },\n topDataLength() {\n if (this.data === null || this.data.length === 0) {\n return 0;\n }\n return this.data[0].length;\n },\n totalTableLength() {\n return this.scrollData[0].length + this.numRowsAbove;\n },\n numPlaceholderRows() {\n return this.topDataLength ? 1 : 0;\n },\n placeholderRowRowIndex() {\n return this.data[0].length + this.numRowsAbove;\n },\n scrollData() {\n if (this.data === null || this.data.length === 0) {\n return [[]];\n }\n const dataItems: DataItem[][] = this.data?.map((groupData) =>\n groupData.map((data) => ({ data })),\n );\n if (this.bottomData.length > 0) {\n if (this.numPlaceholderRows) {\n dataItems[0].push({ dots: true });\n }\n dataItems[0].push(...this.bottomData.map((data) => ({ data })));\n }\n return dataItems;\n },\n currentSelectionMap() {\n if (!this.tableConfig.showSelection) {\n return () => false;\n }\n return (rowInd: number, groupInd: number) => {\n const { isTop, indexInInput } = this.resolveRowIndex(rowInd);\n return isTop\n ? this.currentSelection[groupInd][indexInInput]\n : this.currentBottomSelection[indexInInput];\n };\n },\n scrollerItemSize() {\n if (this.currentRowHeight === \"dynamic\") {\n return this.minRowHeight;\n }\n return this.currentRowHeight;\n },\n sortControlOptions() {\n const selectableColumns: { id: string; text: string }[] = [];\n const selectableDirections: Record<\n string,\n { id: string; text: string }[]\n > = {};\n this.columns.forEach((column) => {\n if (column.isNotSortable) {\n return;\n }\n selectableColumns.push({\n id: column.id as string,\n text: column.header,\n });\n const sortTexts = columnSortText[column.type ?? \"default\"];\n selectableDirections[column.id as string] = [\n { id: \"1\", text: sortTexts.ascending },\n { id: \"-1\", text: sortTexts.descending },\n ];\n });\n return { selectableColumns, selectableDirections };\n },\n },\n watch: {\n \"rowConfig.compactMode\": {\n handler() {\n this.resetRowHeight();\n },\n },\n \"rowConfig.rowHeight\": {\n handler() {\n this.resetRowHeight();\n },\n },\n currentRowHeight(newRowHeight) {\n this.$emit(\"rowHeightUpdate\", newRowHeight);\n },\n },\n methods: {\n // Utilities\n refreshScroller() {\n this.tableCore?.virtualScrollToPosition({ top: 0 });\n },\n resetRowHeight() {\n this.resizedRowHeight = null;\n },\n isTop(index: number) {\n return index < this.topDataLength + this.numRowsAbove;\n },\n resolveRowIndex(index: number) {\n if (index < this.numRowsAbove) {\n throw new Error(`Accessing invalid row index: ${index}`);\n }\n if (this.isTop(index)) {\n return {\n isTop: true,\n indexInInput: index - this.numRowsAbove,\n };\n }\n return {\n isTop: false,\n indexInInput:\n index -\n this.numRowsAbove -\n this.numPlaceholderRows -\n this.topDataLength,\n };\n },\n // Event handling\n onScroll(startIndex: number, endIndex: number) {\n if (\n this.lastScrollIndex === endIndex ||\n this.currentResizedScrollIndex !== null\n ) {\n return;\n }\n const direction: 1 | -1 = this.lastScrollIndex < endIndex ? 1 : -1;\n this.lastScrollIndex = endIndex;\n this.$emit(\"lazyload\", { direction, startIndex, endIndex });\n },\n onColumnUpdate(newColumnList: any) {\n consola.debug(`TableUI emitting: columnUpdate ${newColumnList}`);\n this.clearCellSelection();\n this.$emit(\"columnUpdate\", newColumnList);\n },\n onColumnReorder(colInd: number, newColInd: number) {\n consola.debug(`TableUI emitting: columnReorder ${colInd} ${newColInd}`);\n this.clearCellSelection();\n this.$emit(\"columnReorder\", colInd, newColInd);\n },\n onPageChange(newPageNumber: number) {\n consola.debug(`TableUI emitting: pageChange ${newPageNumber}`);\n this.clearCellSelection();\n this.$emit(\"pageChange\", newPageNumber);\n },\n onPageSizeUpdate(newPageSize: number) {\n consola.debug(`TableUI emitting: pageSizeUpdate ${newPageSize}`);\n this.clearCellSelection();\n this.$emit(\"pageSizeUpdate\", newPageSize);\n },\n clearAllCellInteractions() {\n this.clearCellSelection();\n this.stopEditingCell();\n },\n onDeleteColumn(colInd: number) {\n this.clearAllCellInteractions();\n this.$emit(\"deleteColumn\", colInd);\n },\n onDeleteRow(rowInd: number) {\n this.clearAllCellInteractions();\n const { indexInInput } = this.resolveRowIndex(rowInd);\n this.$emit(\"deleteRow\", indexInInput);\n },\n onColumnSort(colInd: number | undefined, sortDirection: -1 | 0 | 1) {\n consola.debug(`TableUI emitting: columnSort ${colInd} ${sortDirection}`);\n this.clearCellSelection();\n this.$emit(\"columnSort\", colInd, sortDirection);\n },\n onActionBarColumnSort(\n columnId: string | undefined,\n sortDirection: -1 | 0 | 1,\n ) {\n // The action bar's SortControl identifies columns by their stable id,\n // but the columnSort event is positional. Translate the id back to the\n // column's index before delegating to the shared handler.\n const colInd =\n columnId === undefined\n ? undefined\n : this.columns.findIndex((column) => column.id === columnId);\n this.onColumnSort(colInd, sortDirection);\n },\n onSelectAll(selected: boolean) {\n consola.debug(`TableUI emitting: selectAll ${selected}`);\n this.$emit(\"selectAll\", selected);\n },\n onDataValueView(\n cellInd: number,\n rowInd: number,\n anchor: VirtualElementAnchor,\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n this.toBeShownCell = null;\n this.$emit(\"dataValueView\", { indexInInput, isTop }, cellInd, anchor);\n },\n onRowSelect(selected: boolean, rowInd: number, groupInd: number) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n consola.debug(\n `TableUI emitting: rowSelect ${selected} ${indexInInput} ${groupInd} ${isTop}`,\n );\n this.$emit(\"rowSelect\", selected, indexInInput, groupInd, isTop);\n },\n onCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n const isTop = this.isTop(rowInd);\n this.selectCell(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n ignoreIfSelected || Boolean(this.columns[cellInd]?.editable),\n );\n this.stopEditingCell();\n },\n onCellSelectRowEvent(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ignoreIfSelected: boolean = false,\n ) {\n if (\n this.toBeEditedCell &&\n this.toBeEditedCell.x === cellInd &&\n this.toBeEditedCell.y === rowInd\n ) {\n // If the cell to be edited is clicked again, do not interrupt editing\n return;\n }\n const isEditable = Boolean(this.columns[cellInd]?.editable);\n if (isEditable && this.isSingleSelectedCell({ x: cellInd, y: rowInd })) {\n this.onStartEditingCell();\n } else {\n this.onCellSelect(cellInd, rowInd, groupInd, ignoreIfSelected);\n }\n },\n onExpandCellSelect(\n cellInd: number,\n rowInd: number,\n groupInd: null | number,\n ) {\n const isTop = this.isTop(rowInd);\n this.expandCellSelection(\n { x: cellInd, y: rowInd },\n groupInd === null ? isTop : groupInd,\n );\n this.stopEditingCell();\n },\n focusBody() {\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n this.focusWithin = true;\n },\n onTableBodyFocusOut() {\n this.changeFocus(false);\n if (this.selectedCell) {\n if (this.columns[this.selectedCell.x]?.editable) {\n this.selectCell(this.selectedCell, this.currentRectId ?? 0, true);\n } else if (!this.tableState.dataValueViewIsShown) {\n this.clearCellSelection();\n }\n }\n },\n onHeaderCellSelect(columnIndex: number) {\n this.stopEditingCell();\n this.selectCell({ x: columnIndex, y: -1 }, 0, true);\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onHeaderCellDeselect() {\n if (this.selectedCell?.y === -1) {\n this.clearCellSelection();\n }\n },\n onMoveDownFromHeaderCell(columnIndex: number) {\n if (this.totalTableLength === 0) {\n if (this.showNewColumnAndRowButton) {\n this.clearCellSelection();\n this.focusNewRowButton();\n }\n return;\n }\n this.onCellSelect(columnIndex, 0, null);\n const tableCoreRef = this.getTableCoreComponent();\n tableCoreRef.getVirtualBody()?.focus({ preventScroll: true });\n tableCoreRef.virtualScrollToPosition({ top: 0 });\n },\n onUpdateNewColumnButtonWidth(width: number) {\n this.newColumnButtonWidth = width;\n },\n onKeyboardMoveSelectionVirtual(\n columnInd: number,\n rowInd: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n let adaptedRowInd = rowInd;\n if (rowInd === this.totalTableLength) {\n this.onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === this.placeholderRowRowIndex) {\n adaptedRowInd += verticalMove;\n }\n this[expandSelection ? \"onExpandCellSelect\" : \"onCellSelect\"](\n columnInd,\n adaptedRowInd,\n null,\n );\n },\n async onKeyboardMoveSelectionFromEditingCell(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n await this.onKeyboardMoveSelection(\n horizontalMove,\n verticalMove,\n expandSelection,\n );\n if (this.selectedCell) {\n this.focusBody();\n }\n this.stopEditingCell();\n },\n onMoveSelectionOutOfBodyUp({ columnInd }: { columnInd: number }) {\n if (!this.header?.isColumnHeaderFocusable(columnInd)) {\n return;\n }\n this.clearCellSelection();\n this.focusHeaderCell(columnInd);\n },\n focusNewRowButton() {\n (\n this.$refs[\"new-row-button\"] as InstanceType<typeof NewRowButton>\n )?.focus();\n },\n onMoveSelectionOutOfBodyDown({\n columnInd,\n rectId,\n }: {\n columnInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.clearCellSelection();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n columnInd,\n rectId,\n };\n }\n },\n onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.showNewColumnAndRowButton) {\n this.getHeaderComponent().focusNewColumnButton();\n this.clearCellSelection();\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = { rowInd, rectId };\n }\n },\n onMoveIntoBodyFromRight() {\n const lastColumnInd = this.columns.length - 1;\n const lastRowAndRectId = this\n .lastRowAndRectIdBeforeMovingToNewColumnButton ?? {\n rowInd: -1,\n rectId: null,\n };\n if (lastRowAndRectId.rowInd === -1) {\n this.focusHeaderCell(lastColumnInd);\n } else {\n this.updateCellSelection(\n {\n minX: lastColumnInd,\n minY: lastRowAndRectId.rowInd,\n maxX: lastColumnInd,\n maxY: lastRowAndRectId.rowInd,\n },\n lastRowAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastRowAndRectIdBeforeMovingToNewColumnButton = null;\n },\n onMoveIntoBodyFromBottom() {\n const lastRowInd = this.totalTableLength - 1;\n const lastColumnAndRectId = this\n .lastColumnAndRectIdBeforeMovingToNewRowButton ?? {\n columnInd: 0,\n rectId: null,\n };\n if (\"virtualColumn\" in lastColumnAndRectId) {\n this.focusRowVirtualColumn(\n lastColumnAndRectId.virtualColumn,\n lastRowInd,\n lastColumnAndRectId.rectId,\n );\n } else {\n if (this.totalTableLength === 0) {\n this.focusHeaderCell(0);\n return;\n }\n this.updateCellSelection(\n {\n minX: lastColumnAndRectId.columnInd,\n minY: lastRowInd,\n maxX: lastColumnAndRectId.columnInd,\n maxY: lastRowInd,\n },\n lastColumnAndRectId.rectId,\n );\n this.focusBody();\n }\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = null;\n },\n onMoveSelectionOutOfBodyLeft({\n rowInd,\n rectId,\n }: {\n rowInd: number;\n rectId: RectId | null;\n }) {\n if (this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n this.clearCellSelection();\n } else if (this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n this.clearCellSelection();\n }\n },\n onMoveIntoBodyFromLeft(rowInd: number, groupInd: RectId | null) {\n this.updateCellSelection(\n {\n minX: 0,\n minY: rowInd,\n maxX: 0,\n maxY: rowInd,\n },\n groupInd,\n );\n this.focusBody();\n },\n focusRowVirtualColumn(\n type: \"delete\" | \"selection\",\n rowInd: number,\n _groupInd: RectId | null,\n ) {\n const refName = this.getRowRefName(null, rowInd);\n const rowComponent = this.$refs[refName] as InstanceType<typeof Row>;\n if (type === \"delete\") {\n rowComponent?.focusDeleteButton();\n } else {\n rowComponent?.focusSelectionCheckbox();\n }\n },\n onVirtualColumnNav(\n type: \"delete\" | \"selection\",\n direction: \"up\" | \"down\" | \"left\" | \"right\",\n rowInd: number,\n groupInd: null | number,\n ) {\n const rectId = groupInd ?? null;\n if (direction === \"right\") {\n if (type === \"delete\" && this.tableConfig.showSelection) {\n this.focusRowVirtualColumn(\"selection\", rowInd, rectId);\n } else if (this.columns.length > 0) {\n this.onMoveIntoBodyFromLeft(rowInd, rectId);\n }\n } else if (direction === \"left\") {\n if (type === \"selection\" && this.tableConfig.enableRowDeletion) {\n this.focusRowVirtualColumn(\"delete\", rowInd, rectId);\n }\n } else if (direction === \"up\") {\n if (rowInd > 0) {\n this.focusRowVirtualColumn(type, rowInd - 1, rectId);\n } else if (type === \"selection\") {\n this.getHeaderComponent().focusSelectionCheckbox();\n }\n } else if (direction === \"down\") {\n if (rowInd < this.totalTableLength - 1) {\n this.focusRowVirtualColumn(type, rowInd + 1, rectId);\n } else if (this.showNewColumnAndRowButton) {\n this.focusNewRowButton();\n this.lastColumnAndRectIdBeforeMovingToNewRowButton = {\n virtualColumn: type,\n rectId,\n };\n }\n }\n },\n onHeaderSelectionKeydownDown() {\n this.focusRowVirtualColumn(\"selection\", 0, null);\n },\n async onKeyboardMoveSelection(\n horizontalMove: number,\n verticalMove: number,\n expandSelection: boolean,\n ) {\n if (!this.selectedCell) {\n return;\n }\n const columnInd = this.selectedCell.x + horizontalMove;\n const rowInd = this.selectedCell.y + verticalMove;\n if (columnInd === -1) {\n this.onMoveSelectionOutOfBodyLeft({\n rowInd: this.selectedCell!.y,\n rectId: this.currentRectId,\n });\n return;\n }\n if (columnInd === this.columns.length) {\n this.onMoveSelectionOutOfBodyRight({\n rowInd,\n rectId: this.currentRectId,\n });\n return;\n }\n if (rowInd === -1) {\n this.onMoveSelectionOutOfBodyUp({ columnInd });\n return;\n }\n\n this.onKeyboardMoveSelectionVirtual(\n columnInd,\n rowInd,\n verticalMove,\n expandSelection,\n );\n\n await this.scrollToCellSelectionOverlay();\n\n this.toBeShownCell = this.tableState.dataValueViewIsShown\n ? this.selectedCell\n : null;\n },\n async expandSelectedCell() {\n if (this.selectedCell && this.tableConfig.enableDataValueViews) {\n // scroll current selection into view\n await this.onKeyboardMoveSelection(0, 0, true);\n this.toBeShownCell = this.selectedCell;\n }\n },\n\n onStartEditingCell(initialValue?: string) {\n if (this.selectedCell && this.columns[this.selectedCell.x]?.editable) {\n this.setToBeEditedCell(this.selectedCell, initialValue);\n }\n },\n onResizeRow(rowSizeDelta: number, scrollIndex: number) {\n this.currentRowSizeDelta = rowSizeDelta;\n this.currentResizedScrollIndex = scrollIndex;\n },\n onResizeAllRows(currentSize: number, row: HTMLElement, rowInd: number) {\n if (this.currentRowHeight === \"dynamic\") {\n return;\n }\n this.currentRowSizeDelta = 0;\n const previousScrollTop = this.tableCore?.getVirtualScrollStart();\n if (previousScrollTop === undefined) {\n return;\n }\n const heightAboveCurrentRow = rowInd * this.currentRowHeight;\n const offset = heightAboveCurrentRow - previousScrollTop;\n this.resizedRowHeight = currentSize;\n const scrollPosition = rowInd * this.currentRowHeight - offset;\n this.keepScrollerPositionOnRowResize(scrollPosition);\n },\n keepScrollerPositionOnRowResize(scrollPosition: number) {\n const resizeObserver = new ResizeObserver(() => {\n setTimeout(() => {\n // scroll was temporarily disabled to avoid sending scroll events during resize\n this.currentResizedScrollIndex = null;\n }, ENABLE_SCROLL_AFTER_ROW_RESIZE_DELAY);\n this.tableCore?.virtualScrollToPosition({ top: scrollPosition });\n resizeObserver.disconnect();\n });\n const virtualBody = this.tableCore?.getVirtualBody();\n if (virtualBody) {\n resizeObserver.observe(virtualBody);\n }\n },\n onRowInput(\n _event: any,\n rowInd: number,\n groupInd: number,\n row: { id: string },\n ) {\n const { indexInInput, isTop } = this.resolveRowIndex(rowInd);\n const event = {\n ..._event,\n rowInd: indexInInput,\n id: row.id,\n groupInd,\n isTop,\n };\n consola.debug(`TableUI emitting: tableInput ${event}`);\n this.$emit(\"tableInput\", event);\n },\n onRowSubMenuClick(event: any, row: any) {\n consola.debug(`TableUI row submenu clicked ${event} ${row}`);\n if (event.callback) {\n event.callback(row, this);\n }\n },\n onColumnResize(columnIndex: number, newColumnSize: number) {\n this.$emit(\"columnResize\", columnIndex, newColumnSize);\n },\n onAllColumnsResize(newColumnSize: number) {\n this.$emit(\"allColumnsResize\", newColumnSize);\n },\n onColumnResizeStart() {\n this.columnResizeActive = true;\n this.$emit(\"columnResizeStart\");\n },\n onColumnResizeEnd() {\n this.columnResizeActive = false;\n this.$emit(\"columnResizeEnd\");\n },\n getCellContentSlotName(columns: ColumnConfig[], columnId: number) {\n // see https://vuejs.org/guide/essentials/template-syntax.html#dynamic-argument-syntax-constraints\n return `cellContent-${columns[columnId].key as unknown as string}`;\n },\n getHeaderComponent() {\n return this.$refs.header as InstanceType<typeof Header>;\n },\n getTableCoreComponent() {\n return this.$refs.tableCore as InstanceType<typeof TableCore>;\n },\n getSelectionOverlayComponent() {\n return this.$refs.selectionOverlay as InstanceType<\n typeof CellSelectionOverlay\n >;\n },\n focusHeaderCell(cellInd: number) {\n this.getHeaderComponent().focusHeaderCell(cellInd);\n },\n refocusSelection() {\n if (this.selectedHeaderIndex === null) {\n this.focusBody();\n } else {\n this.focusHeaderCell(this.selectedHeaderIndex);\n }\n },\n getRowComponents() {\n const rowComponents: any[] = [];\n this.data.forEach((group: any) => {\n group.forEach((_: any, rowIndex: number) =>\n rowComponents.push(this.$refs[this.getRowRefName(null, rowIndex)]),\n );\n });\n return rowComponents;\n },\n getRowData(row: Record<string, unknown> | Array<unknown>) {\n const isEmptyArray = Array.isArray(row) && row.length === 0;\n return isEmptyArray\n ? row\n : this.columns.map(\n (column) =>\n (row as Record<string, unknown>)[column.key as unknown as string],\n );\n },\n getRowRefName(groupInd: null | number, rowInd: number) {\n if (groupInd === null) {\n return `row-${rowInd}`;\n }\n return `group-${groupInd}-row-${rowInd}`;\n },\n getCellIndex(cell: CellPosition | null | undefined, rowInd: number) {\n if (cell && cell.y === rowInd) {\n return cell.x;\n }\n return null;\n },\n getCellSelectionRange(rowInd: number) {\n const rect = this.rectMinMax;\n if (!rect || rowInd < rect.y.min || rowInd > rect.y.max) {\n return null;\n }\n return { min: rect.x.min, max: rect.x.max };\n },\n onNewRowButtonClick(event: MouseEvent) {\n event.stopPropagation();\n const lastCellOrLastVirtualCell =\n this.lastColumnAndRectIdBeforeMovingToNewRowButton;\n const lastCellWasVirtualColumn =\n lastCellOrLastVirtualCell &&\n \"virtualColumn\" in lastCellOrLastVirtualCell;\n const lastCell = lastCellWasVirtualColumn\n ? null\n : lastCellOrLastVirtualCell;\n\n this.$emit(\"newRowButtonClick\", lastCell);\n },\n onNewColumnButtonClick(event: MouseEvent) {\n event.stopPropagation();\n this.$emit(\"newColumnButtonClick\");\n },\n },\n};\n</script>\n\n<template>\n <div\n class=\"wrapper\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n >\n <TableActionBar\n v-if=\"showActionBar\"\n :table-sizes=\"tableState.tableSizes\"\n :action-state\n :row-label=\"tableConfig.rowLabel\"\n :show-table-size=\"tableConfig.showTableSize\"\n :action-config=\"actionConfig ?? {}\"\n :col-sort-values\n :sort-control-options\n @reset-temporary-view=\"$emit('resetTemporaryView')\"\n @on-column-sort=\"onActionBarColumnSort\"\n @update:search-term=\"$emit('update:searchTerm', $event)\"\n >\n <template v-if=\"$slots['action-bar-left']\" #action-bar-left>\n <slot name=\"action-bar-left\" />\n </template>\n </TableActionBar>\n <table\n ref=\"wrapper\"\n :tabindex=\"-1\"\n @pointerleave=\"selectCellsOnMove.setFalse\"\n @pointerdown.passive.stop=\"\n $event.button === 0 && selectCellsOnMove.setTrue()\n \"\n @pointerup.passive=\"$event.button === 0 && selectCellsOnMove.setFalse()\"\n @keydown.ctrl.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.meta.shift.c.exact=\"handleCopyOnKeydown\"\n @keydown.delete.exact=\"handleDeleteSelection\"\n @keydown.escape.exact=\"clearCellSelectionAndStopPropagation\"\n >\n <TableCore\n ref=\"tableCore\"\n :scroll-data=\"scrollData\"\n :total-width=\"totalWidth\"\n :column-resize=\"{ active: columnResizeActive }\"\n :table-config\n :sub-menu-config\n :scroll-config=\"{\n itemSize: scrollerItemSize,\n numRowsAbove,\n numRowsBelow,\n compact: Boolean(rowConfig.compactMode),\n }\"\n :current-row-height=\"currentRowHeight\"\n :new-column-button-width\n @scroller-update=\"onScroll\"\n @update:available-width=\"onUpdateAvailableWidth\"\n @move-selection=\"onKeyboardMoveSelection\"\n @clear-selection=\"clearCellSelection\"\n @expand-selected-cell=\"expandSelectedCell\"\n @start-editing=\"onStartEditingCell\"\n @body-focusin=\"changeFocus(true)\"\n @body-focusout=\"onTableBodyFocusOut()\"\n >\n <template #row=\"{ row, groupInd, rowInd }\">\n <Row\n :ref=\"getRowRefName(groupInd, rowInd)\"\n :row-data=\"row\"\n :row=\"getRowData(row)\"\n :table-config\n :sub-menu-config\n :show-drag-handle=\"tableConfig.enableRowResizing\"\n :columns\n :row-config=\"rowConfig\"\n :row-height=\"currentRowHeight\"\n :min-row-height=\"minRowHeight\"\n :is-selected=\"currentSelectionMap(rowInd, groupInd || 0)\"\n :select-cells-on-move=\"selectCellsOnMove.state\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n :selected-cell-index=\"getCellIndex(selectedCell, rowInd)\"\n :cell-selection-range=\"getCellSelectionRange(rowInd)\"\n :to-be-expanded-cell-index=\"getCellIndex(toBeShownCell, rowInd)\"\n :to-be-edited-cell-index=\"getCellIndex(editingCell, rowInd)\"\n :new-column-button-width\n @delete-row=\"() => onDeleteRow(rowInd)\"\n @row-select=\"onRowSelect($event, rowInd, groupInd || 0)\"\n @cell-select=\"\n (cellInd, ignoreIfSelected) =>\n onCellSelectRowEvent(\n cellInd,\n rowInd,\n groupInd,\n ignoreIfSelected,\n )\n \"\n @data-value-view=\"\n (cellInd, anchor) => onDataValueView(cellInd, rowInd, anchor)\n \"\n @expand-cell-select=\"\n (cellInd) => onExpandCellSelect(cellInd, rowInd, groupInd)\n \"\n @row-input=\"\n (event) => onRowInput(event, rowInd, groupInd ?? 0, row)\n \"\n @row-sub-menu-click=\"onRowSubMenuClick($event, row)\"\n @resize-all-rows=\"\n (currentSize, row) => onResizeAllRows(currentSize, row, rowInd)\n \"\n @resize-row=\"(rowSizeDelta) => onResizeRow(rowSizeDelta, rowInd)\"\n @virtual-column-nav=\"\n (type, direction) =>\n onVirtualColumnNav(type, direction, rowInd, groupInd)\n \"\n >\n <!-- Vue requires named slots on \"custom\" elements (i.e. template). -->\n <!-- eslint-disable vue/valid-v-slot -->\n <template\n v-for=\"colInd in slottedColumns\"\n #[getCellContentSlotName(columns,colInd)]=\"cellData\"\n :key=\"rowInd + '_' + colInd\"\n >\n <!-- \n TODO: UIEXT-1753:\n not yet working properly with empty and bottom rows, \n since rowInd is the actual scroll index and not the input in the input data\n in this case\n -->\n <slot\n :name=\"`cellContent-${columns[colInd].key as unknown as string}`\"\n :data=\"{\n ...cellData,\n key: columns[colInd].key,\n rowInd,\n colInd,\n }\"\n />\n </template>\n <template #editable-cell=\"{ ind, cellElement }\">\n <slot\n name=\"editable-cell\"\n :row-ind=\"rowInd\"\n :col-ind=\"ind\"\n :initial-value=\"editingCellInitialValue\"\n :cell-element=\"cellElement\"\n @keydown=\"\n (event: KeyboardEvent) =>\n createEditingCellKeydownHandler({\n moveSelection: onKeyboardMoveSelectionFromEditingCell,\n })(event)\n \"\n @click-away=\"stopEditingCell\"\n />\n </template>\n </Row>\n </template>\n <template #header=\"{ getDragHandleHeight }\">\n <Header\n ref=\"header\"\n :style=\"{ width: `var(${BODY_WIDTH_CSS_VAR})` }\"\n :table-config\n :action-config\n :columns\n :additional-header-menu-items\n :col-sort-values\n :is-selected=\"Boolean(tableState.totalSelected)\"\n :get-drag-handle-height=\"getDragHandleHeight\"\n :class=\"[\n 'table-header',\n {\n 'sub-menu-active': subMenuConfig.subMenuItems?.length,\n },\n ]\"\n :show-new-column-button=\"showNewColumnAndRowButton\"\n :selected-header-index=\"selectedHeaderIndex\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n @header-select=\"onSelectAll\"\n @column-sort=\"onColumnSort\"\n @delete-column=\"onDeleteColumn\"\n @column-resize=\"onColumnResize\"\n @all-columns-resize=\"onAllColumnsResize\"\n @column-resize-start=\"onColumnResizeStart\"\n @column-resize-end=\"onColumnResizeEnd\"\n @move-down-from-header-cell=\"onMoveDownFromHeaderCell\"\n @header-cell-select=\"onHeaderCellSelect\"\n @header-cell-deselect=\"onHeaderCellDeselect\"\n @header-cell-start-editing=\"\n (columnIndex: number, initialValue?: string) =>\n $emit('headerCellStartEditing', columnIndex, initialValue)\n \"\n @update:new-column-button-width=\"onUpdateNewColumnButtonWidth\"\n @new-column-button-click=\"onNewColumnButtonClick\"\n @selection-keydown-down=\"onHeaderSelectionKeydownDown()\"\n @new-column-button-keydown-left=\"onMoveIntoBodyFromRight()\"\n >\n <template #subHeader=\"slotProps\">\n <slot name=\"subHeader\" v-bind=\"slotProps\" />\n </template>\n </Header>\n </template>\n <template #cell-selection-overlay>\n <CellSelectionOverlay\n v-if=\"rectMinMax && !isEditingCell && selectedHeaderIndex === null\"\n ref=\"selectionOverlay\"\n :rect=\"rectMinMax\"\n :row-height=\"scrollerItemSize\"\n :table-config=\"tableConfig\"\n :row-resize-index=\"currentResizedScrollIndex\"\n :row-resize-delta=\"currentRowSizeDelta\"\n :cell-selection-rect-focus-corner=\"\n focusWithin ? selectedCell : undefined\n \"\n />\n </template>\n <template #belowBody>\n <NewRowButton\n v-if=\"showNewColumnAndRowButton\"\n ref=\"new-row-button\"\n @click=\"onNewRowButtonClick\"\n @pointerdown.stop\n @keydown-up=\"onMoveIntoBodyFromBottom\"\n />\n </template>\n <template v-if=\"emptyState\" #empty-state>\n <KdsEmptyState class=\"empty-state\" v-bind=\"emptyState\" />\n </template>\n </TableCore>\n <KdsPagination\n v-if=\"pageConfig && pageState\"\n class=\"pagination\"\n :current-page=\"pageState.currentPage\"\n :page-size=\"pageConfig.pageSize\"\n :possible-page-sizes=\"pageConfig.possiblePageSizes\"\n :total-rows=\"tableState.tableSizes?.currentNumRows ?? 0\"\n :show-table-size=\"tableConfig.showTableSize\"\n :row-label=\"tableConfig.rowLabel\"\n @update:current-page=\"onPageChange\"\n @update:page-size=\"onPageSizeUpdate\"\n />\n </table>\n </div>\n</template>\n\n<style scoped>\n.wrapper {\n display: flex;\n flex-direction: column;\n width: 100%;\n\n @media screen {\n /* height 100% does not mix well with flex-box on print (https://issues.chromium.org/issues/365922171) */\n height: 100%;\n }\n}\n\ntable {\n position: relative;\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n width: 100%;\n min-height: 0;\n\n &:focus {\n outline: none;\n }\n\n & .new-row-footer {\n width: 100%;\n }\n\n /* The table inherits its parent's background; the pagination footer is the\n one place Figma sets a surface token for (SLEEK-297). KdsPagination stays\n transparent so it can sit on any surface. */\n & .pagination {\n background: var(--kds-color-surface-default);\n }\n}\n\n/* The empty state is placed into the rows' area by TableCoreVirtual. */\n.empty-state {\n max-width: 100%;\n}\n</style>\n","import { computed, nextTick, ref, watchEffect } from \"vue\";\n\nexport const useTableReady = ({ onReady }: { onReady: () => void }) => {\n const autoSizesInitialized = ref(false);\n const availableWidthInitialized = ref(false);\n\n const tableIsVisible = computed(\n () => autoSizesInitialized.value && availableWidthInitialized.value,\n );\n\n const setAutoSizesInitialized = () => {\n autoSizesInitialized.value = true;\n };\n const setAvailableWidthInitialized = () => {\n availableWidthInitialized.value = true;\n };\n\n const waitUntilVisibleInDOMAndCallOnReady = async () => {\n await nextTick();\n onReady();\n };\n\n watchEffect(() => {\n if (tableIsVisible.value) {\n waitUntilVisibleInDOMAndCallOnReady();\n }\n });\n\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n };\n};\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n","<script lang=\"ts\">\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/**\n * This component contains the ability to size the columns in the tableUI according to the width of their content by\n * enforcing a maximum size of MAX_AUTO_COLUMN_SIZE. It takes the same props as the TableUI.vue and one additional prop,\n * the options for the calculation. The automatic row height relies on the column sizes and enforces a maximum\n * height given by the auto row height options.\n * To trigger the calculation of the auto sizes, the corresponding trigger method can be called from the parent. The\n * method is automatically called from within this component when:\n * - the component is mounted\n * - one property of the autoColumnSizesOptions changes\n * - one property of the autoRowHeightOptions changes\n * - columns were removed, added, or replaced\n * - the compact mode is toggled\n */\n\nimport type { PropType, Slot } from \"vue\";\nimport isEqual from \"fast-deep-equal\";\n\nimport type { KdsMenuItem } from \"@knime/kds-components\";\nimport { sleep } from \"@knime/utils\";\n\nimport {\n CELL_PADDING_HORIZONTAL,\n MAX_AUTO_COLUMN_SIZE,\n MIN_COLUMN_SIZE,\n MIN_ROW_HEIGHT,\n ROW_BORDER_BOTTOM_WIDTH,\n} from \"../constants\";\nimport type { ActionConfig, ActionState } from \"../types/ActionConfig\";\nimport { renderedOnBackgroundColorProp } from \"../types/BackgroundColor\";\nimport type { ColumnConfig, ColumnId } from \"../types/ColumnConfig\";\nimport type { ColSortValue } from \"../types/ColumnState\";\nimport type { PageConfig, PageState } from \"../types/PageConfig\";\nimport type { RowConfig } from \"../types/RowConfig\";\nimport type { SubMenuConfig } from \"../types/SubMenuConfig\";\nimport type { TableConfig, TableState } from \"../types/TableConfig\";\nimport { getPropertiesFromColumns } from \"../utils\";\nimport { minSizeOfColumn } from \"../utils/columnHeaderActionButtons\";\n\nimport TableUI from \"./TableUI.vue\";\nimport { useTableReady } from \"./composables/useTableReady\";\nimport { provideAutoSizeColumnSizes } from \"./useColumnSizes\";\n\ntype SizeByColumn = Record<string | symbol, number>;\n\n/**\n * In a lot of cases, the row ids are Row0, Row1, ....\n * With 11 rows taken into account, we respect \"Row10\".\n */\nconst DEFAULT_NUM_ROWS = 11;\n\nexport default {\n components: { TableUI },\n inheritAttrs: false,\n props: {\n data: { type: Array as PropType<Array<Array<any>>>, default: () => [] },\n currentSelection: {\n type: Array as PropType<Array<Array<boolean>>>,\n default: () => [],\n },\n /** Stable per-column definitions (forwarded to TableUI). */\n columns: {\n type: Array as PropType<ColumnConfig[]>,\n default: () => [],\n },\n /** Appearance of the table's rows (forwarded to TableUI). */\n rowConfig: {\n type: Object as PropType<RowConfig>,\n default: () => ({}),\n },\n /** Background-color token matching the surface the table is rendered on (forwarded to TableUI). */\n renderedOnBackgroundColor: renderedOnBackgroundColorProp,\n tableConfig: {\n type: Object as PropType<TableConfig>,\n default: () => ({}),\n },\n tableState: {\n type: Object as PropType<TableState>,\n default: () => ({}),\n },\n pageConfig: {\n type: Object as PropType<PageConfig | undefined>,\n default: undefined,\n },\n pageState: {\n type: Object as PropType<PageState | undefined>,\n default: undefined,\n },\n actionConfig: {\n type: Object as PropType<ActionConfig | undefined>,\n default: undefined,\n },\n actionState: {\n type: Object as PropType<ActionState | undefined>,\n default: undefined,\n },\n additionalHeaderMenuItems: {\n type: Array as PropType<KdsMenuItem[][]>,\n default: () => [],\n },\n colSortValues: {\n type: Array as PropType<ColSortValue[]>,\n default: () => [],\n },\n numRowsAbove: {\n type: Number,\n default: 0,\n },\n numRowsBelow: {\n type: Number,\n default: 0,\n },\n bottomData: {\n type: Array,\n default: () => [],\n },\n currentBottomSelection: {\n type: Array as PropType<boolean[]>,\n default: () => [],\n },\n subMenuConfig: {\n type: Object as PropType<SubMenuConfig>,\n default: () => ({}),\n },\n /** This object contains all the options necessary to calculate the sizes based on the\n * content. In case only one of calculateForBody/calculateForHeader is true, the emitted object contains auto\n * sizes according to body/header. In case both are true, the maximum of both values is used. For fixedSizes only\n * header sizes are calculated and the body sizes will be increased by the horizontal cell padding.\n */\n autoColumnSizesOptions: {\n type: Object as PropType<{\n calculateForBody: boolean;\n calculateForHeader: boolean;\n fixedSizes: SizeByColumn;\n }>,\n default: () => ({}),\n },\n autoRowHeightOptions: {\n type: Object as PropType<{\n calculate: boolean;\n fixedHeights: SizeByColumn;\n maxHeight: number;\n }>,\n default: () => ({}),\n },\n },\n /* eslint-disable @typescript-eslint/no-unused-vars */\n emits: {\n autoColumnSizesUpdate: (sizes: SizeByColumn) => true,\n autoRowHeightUpdate: (height: number | null) => true,\n ready: () => true,\n \"update:available-width\": (newAvailableWidth: number) => true,\n },\n /* eslint-enable @typescript-eslint/no-unused-vars */\n setup(_props, { emit }) {\n // The hidden auto-size calculation table renders below the same\n // useColumnSizes provider (mounted by the embedding app) as the visible\n // table, so by default it is injected the actual column sizes — which is\n // what we want when only the row heights are calculated. When the column\n // sizes themselves are calculated, setAutoSizeColumnSizes overrides them\n // with the maximum width while the calculation table is mounted (see\n // triggerCalculationOfAutoSizes and calculateAutoSizes).\n const {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n } = useTableReady({ onReady: () => emit(\"ready\") });\n const { setAutoSizeColumnSizes, unsetAutoSizeColumnSizes } =\n provideAutoSizeColumnSizes();\n return {\n tableIsVisible,\n setAutoSizesInitialized,\n setAvailableWidthInitialized,\n setAutoSizeColumnSizes,\n unsetAutoSizeColumnSizes,\n };\n },\n data() {\n return {\n currentColumnSizes: {} as SizeByColumn,\n currentHeightsByColumn: {} as SizeByColumn,\n calculateSizes: false,\n useSavedColumnSizes: false,\n disableRowHeightTransition: true,\n };\n },\n computed: {\n /**\n * Needed for a combined watcher for changes in case we change both\n * option parts at the same time.\n */\n combinedOptions() {\n return {\n columns: this.autoColumnSizesOptions,\n rows: this.autoRowHeightOptions,\n };\n },\n mountTableUIForAutoSizeCalculation() {\n return this.data !== null && this.calculateSizes;\n },\n columnIds() {\n return getPropertiesFromColumns(this.columns, \"id\");\n },\n /**\n * The width each column needs at the very least, i.e. the one at which the\n * action buttons of its header still fit (see {@link minSizeOfColumn}).\n */\n minColumnSizes(): Record<ColumnId, number> {\n return this.columns.reduce(\n (minSizes, column, index) => {\n minSizes[column.id] = minSizeOfColumn({\n column,\n actionConfig: this.actionConfig,\n additionalMenuItems: this.additionalHeaderMenuItems[index],\n });\n return minSizes;\n },\n {} as Record<ColumnId, number>,\n );\n },\n currentColumnsWithAutoSize() {\n return new Set<ColumnId>([\n ...Reflect.ownKeys(this.currentColumnSizes),\n ...Reflect.ownKeys(this.currentHeightsByColumn),\n ]);\n },\n removedColumnIds() {\n const removedColumnIds = new Set<ColumnId>();\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (!this.columnIds.includes(columnId)) {\n removedColumnIds.add(columnId);\n }\n });\n return removedColumnIds;\n },\n addedColumnIds() {\n const addedColumnIds = new Set<ColumnId>();\n this.columnIds.forEach((columnId) => {\n if (!this.currentColumnsWithAutoSize.has(columnId)) {\n addedColumnIds.add(columnId);\n }\n });\n return addedColumnIds;\n },\n columnsWereOnlyRemoved() {\n return this.addedColumnIds.size === 0 && this.removedColumnIds.size > 0;\n },\n paginatedDataForAutoColumnSizesCalculation() {\n return [this.data.flat().slice(0, DEFAULT_NUM_ROWS)];\n },\n colSizesForCalculationWithAutoColumnSizes() {\n return this.columnIds.map(() => MAX_AUTO_COLUMN_SIZE);\n },\n tableConfigForAutoSizesCalculation() {\n return {\n ...this.tableConfig,\n forceRenderAll: true,\n };\n },\n autoColumnSizingActive() {\n return (\n this.autoColumnSizesOptions.calculateForBody ||\n this.autoColumnSizesOptions.calculateForHeader\n );\n },\n autoRowHeightSizingActive() {\n return this.autoRowHeightOptions.calculate;\n },\n autoColumnSizeCalculationRequired() {\n return this.autoColumnSizingActive && !this.useSavedColumnSizes;\n },\n columnPaddingsHorizontal() {\n return this.columnIds.reduce(\n (paddings, columnId) => {\n paddings[columnId] = CELL_PADDING_HORIZONTAL * 2;\n return paddings;\n },\n {} as Record<string | symbol | number, number>,\n );\n },\n currentRowHeight() {\n const rowHeights = Reflect.ownKeys(this.currentHeightsByColumn).map(\n (columnId) => this.currentHeightsByColumn[columnId],\n );\n return rowHeights.length === 0\n ? null\n : Math.min(\n Math.max(...rowHeights),\n this.autoRowHeightOptions.maxHeight,\n );\n },\n forwardedSlotEntries(): Array<[string, Slot]> {\n return Object.entries(this.$slots) as Array<[string, Slot]>;\n },\n },\n watch: {\n combinedOptions: {\n handler(newVal, oldVal) {\n const columnsIsEqual = isEqual(newVal.columns, oldVal.columns);\n const rowsIsEqual = isEqual(newVal.rows, oldVal.rows);\n if (!rowsIsEqual && columnsIsEqual) {\n this.useSavedColumnSizes = true;\n }\n if (!rowsIsEqual || !columnsIsEqual) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n deep: true,\n },\n columnIds(newIds, oldIds) {\n if (\n newIds.length !== oldIds.length ||\n !newIds.every((el: any, index: number) => el === oldIds[index])\n ) {\n this.triggerCalculationOfAutoSizes();\n }\n },\n \"rowConfig.compactMode\": {\n handler() {\n if (this.autoRowHeightOptions.calculate) {\n this.useSavedColumnSizes = true;\n this.triggerCalculationOfAutoSizes();\n }\n },\n },\n },\n mounted() {\n if (this.autoRowHeightSizingActive) {\n const unwatchRowHeight = this.$watch(\n () => this.rowConfig.rowHeight,\n async () => {\n // wait until the DOM changes regarding the newRowHeight are completely rendered and enable the transition\n // otherwise, a table with auto row height calculation performs row height animations when being first mounted\n await sleep(0);\n this.disableRowHeightTransition = false;\n unwatchRowHeight();\n },\n );\n } else {\n this.disableRowHeightTransition = false;\n }\n this.triggerCalculationOfAutoSizes();\n },\n methods: {\n emitNewAutoSizes() {\n this.$emit(\"autoColumnSizesUpdate\", { ...this.currentColumnSizes });\n this.$emit(\"autoRowHeightUpdate\", this.currentRowHeight);\n this.useSavedColumnSizes = false;\n this.setAutoSizesInitialized();\n },\n triggerCalculationOfAutoSizes() {\n if (this.autoColumnSizingActive && this.columnsWereOnlyRemoved) {\n this.currentColumnsWithAutoSize.forEach((columnId) => {\n if (this.removedColumnIds.has(columnId)) {\n delete this.currentColumnSizes[columnId];\n delete this.currentHeightsByColumn[columnId];\n }\n });\n this.emitNewAutoSizes();\n return;\n }\n\n if (!this.autoColumnSizingActive) {\n this.currentColumnSizes = {};\n }\n if (!this.autoRowHeightSizingActive) {\n this.currentHeightsByColumn = {};\n }\n\n const autoSizingRequired =\n this.autoRowHeightSizingActive ||\n this.autoColumnSizeCalculationRequired;\n if (autoSizingRequired) {\n if (this.autoColumnSizingActive) {\n // Override the injected sizes with the maximum width before the\n // calculation table mounts, so its content is measured untruncated\n // (unset again in calculateAutoSizes). When only the row heights are\n // calculated we keep the actual column sizes from the provider.\n this.setAutoSizeColumnSizes(\n this.colSizesForCalculationWithAutoColumnSizes,\n );\n }\n this.calculateSizes = true;\n } else {\n this.emitNewAutoSizes();\n }\n },\n setAutoColumnSizes(autoColumnSizes: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentColumnSizes,\n autoSizesByRow: autoColumnSizes,\n fixedSizes: this.autoColumnSizesOptions.fixedSizes,\n minSize: (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n paddings: this.columnPaddingsHorizontal,\n });\n },\n setAutoRowHeights(autoRowHeights: SizeByColumn[]) {\n this.addFixedAndAutoSizes({\n sizesToUpdate: this.currentHeightsByColumn,\n autoSizesByRow: autoRowHeights,\n fixedSizes: this.autoRowHeightOptions.fixedHeights,\n minSize: () => MIN_ROW_HEIGHT,\n });\n },\n async calculateAutoSizes() {\n // Wait for the fonts to be loaded before calculating the column sizes based on the rendered table\n await Promise.all([\n document.fonts.load(\"400 1em Roboto\"),\n document.fonts.load(\"700 1em Roboto\"),\n ]);\n\n const bodyComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForBody;\n const headerComputesColumns =\n this.autoColumnSizeCalculationRequired &&\n this.autoColumnSizesOptions.calculateForHeader;\n const bodyComputesRows = this.autoRowHeightSizingActive;\n const computeColumns = this.autoColumnSizeCalculationRequired;\n\n if (computeColumns) {\n this.currentColumnSizes = this.initializeSizesWithMinSize(\n (columnId) => this.minColumnSizes[columnId] ?? MIN_COLUMN_SIZE,\n );\n }\n if (bodyComputesRows) {\n this.currentHeightsByColumn = this.initializeSizesWithMinSize(\n () => MIN_ROW_HEIGHT,\n );\n }\n\n if (bodyComputesColumns || bodyComputesRows) {\n const { autoColumnSizes, autoRowHeights } =\n this.calculateAutoSizesBody();\n\n if (bodyComputesRows) {\n this.setAutoRowHeights(autoRowHeights);\n }\n\n if (bodyComputesColumns) {\n this.setAutoColumnSizes(autoColumnSizes);\n }\n }\n\n if (headerComputesColumns) {\n this.calculateAndSetAutoColumnSizesHeader();\n }\n if (computeColumns) {\n this.enforceMaxColSize();\n }\n\n this.calculateSizes = false;\n this.unsetAutoSizeColumnSizes();\n this.emitNewAutoSizes();\n },\n initializeSizesWithMinSize(minSize: (columnId: ColumnId) => number) {\n return this.columnIds.reduce(\n (sizes, columnId) => ({\n ...sizes,\n [columnId]: minSize(columnId),\n }),\n {},\n );\n },\n addFixedAndAutoSizes({\n sizesToUpdate,\n autoSizesByRow,\n fixedSizes,\n minSize,\n paddings = null,\n }: {\n sizesToUpdate: SizeByColumn;\n autoSizesByRow: SizeByColumn[];\n fixedSizes: SizeByColumn;\n minSize: (columnId: ColumnId) => number;\n paddings?: SizeByColumn | null;\n }) {\n Reflect.ownKeys(fixedSizes).forEach((columnId) => {\n if (sizesToUpdate.hasOwnProperty(columnId)) {\n sizesToUpdate[columnId] = Math.max(\n minSize(columnId),\n fixedSizes[columnId] + (paddings?.[columnId] || 0),\n );\n }\n });\n\n autoSizesByRow.forEach((autoSizes) => {\n Reflect.ownKeys(autoSizes).forEach((columnId) => {\n sizesToUpdate[columnId] = Math.max(\n sizesToUpdate[columnId],\n autoSizes[columnId],\n );\n });\n });\n },\n calculateAutoSizesBody() {\n const rowComponents = (\n this.$refs.tableUIForAutoSize as any\n ).getRowComponents();\n\n const { fixedSizes } = this.autoColumnSizesOptions;\n\n const autoColumnSizes: SizeByColumn[] = [];\n const autoRowHeights: SizeByColumn[] = [];\n\n rowComponents.forEach((rowComponent: any) => {\n const sizesByColumn: SizeByColumn = {};\n const heightsByColumn: SizeByColumn = {};\n const cellComponents = rowComponent.getCellComponents();\n this.columnIds.forEach((columnId, columnIndex) => {\n if (!fixedSizes.hasOwnProperty(columnId)) {\n const { width, height } =\n cellComponents[columnIndex].getCellContentDimensions();\n sizesByColumn[columnId] = width;\n heightsByColumn[columnId] = height + ROW_BORDER_BOTTOM_WIDTH;\n }\n });\n autoColumnSizes.push(sizesByColumn);\n autoRowHeights.push(heightsByColumn);\n });\n return { autoColumnSizes, autoRowHeights };\n },\n calculateAndSetAutoColumnSizesHeader() {\n const headerCellSizes = (this.$refs.tableUIForAutoSize as any)\n .getHeaderComponent()\n .getHeaderCellWidths();\n this.columnIds.forEach((columnId, columnIndex) => {\n const headerWidth = headerCellSizes[columnIndex];\n if (this.currentColumnSizes[columnId] < headerWidth) {\n this.currentColumnSizes[columnId] = headerWidth;\n }\n });\n },\n enforceMaxColSize() {\n this.currentColumnSizes = Reflect.ownKeys(this.currentColumnSizes).reduce(\n (enforcedColSizes, columnId) => ({\n ...enforcedColSizes,\n [columnId]: Math.min(\n this.currentColumnSizes[columnId],\n MAX_AUTO_COLUMN_SIZE,\n ),\n }),\n {},\n );\n },\n onUpdateAvailableWidth(newAvailableWidth: number) {\n this.$emit(\"update:available-width\", newAvailableWidth);\n this.setAvailableWidthInitialized();\n },\n getTableUIElement() {\n return (this.$refs.tableUI as any).$el;\n },\n refreshScroller() {\n (this.$refs.tableUI as any)?.refreshScroller();\n },\n clearCellSelection() {\n (this.$refs.tableUI as any)?.clearCellSelection();\n },\n },\n};\n</script>\n\n<template>\n <TableUI\n ref=\"tableUI\"\n :style=\"{ visibility: tableIsVisible ? undefined : 'hidden' }\"\n v-bind=\"$attrs\"\n :data=\"data\"\n :current-selection=\"currentSelection\"\n :current-bottom-selection=\"currentBottomSelection\"\n :columns=\"columns\"\n :additional-header-menu-items\n :col-sort-values=\"colSortValues\"\n :num-rows-above=\"numRowsAbove\"\n :num-rows-below=\"numRowsBelow\"\n :bottom-data=\"bottomData\"\n :row-config=\"rowConfig\"\n :rendered-on-background-color=\"renderedOnBackgroundColor\"\n :table-config=\"tableConfig\"\n :table-state=\"tableState\"\n :page-config=\"pageConfig\"\n :page-state=\"pageState\"\n :action-config=\"actionConfig\"\n :action-state=\"actionState\"\n :sub-menu-config=\"subMenuConfig\"\n :disable-row-height-transition=\"disableRowHeightTransition\"\n @update:available-width=\"onUpdateAvailableWidth\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n <TableUI\n v-if=\"mountTableUIForAutoSizeCalculation\"\n ref=\"tableUIForAutoSize\"\n class=\"table-column-size-calculation\"\n :data=\"paginatedDataForAutoColumnSizesCalculation\"\n :current-selection=\"currentSelection\"\n :columns=\"columns\"\n :row-config=\"rowConfig\"\n :table-config=\"tableConfigForAutoSizesCalculation\"\n @vue:mounted=\"calculateAutoSizes\"\n >\n <template\n v-for=\"[slotName] in forwardedSlotEntries\"\n :key=\"slotName\"\n #[slotName]=\"slotProps\"\n >\n <slot :name=\"slotName\" v-bind=\"slotProps ?? {}\" />\n </template>\n </TableUI>\n</template>\n\n<style scoped>\n.table-column-size-calculation {\n position: absolute;\n top: -9999px;\n left: -9999px;\n visibility: hidden;\n}\n</style>\n"],"x_google_ignoreList":[7,8,29,35],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAa,kBAAkB;AAE/B,IAAa,cAAc;CACzB,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,QAAQ;CACR,SAAS;CACT,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AAMA,IAAa,iBAAiB;EAC3B,YAAY,UAAU;EACrB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;EACC,YAAY,WAAW;EACtB,WAAW;EACX,YAAY;CACd;EACC,YAAY,WAAW;EACtB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;EACC,YAAY,UAAU;EACrB,WAAW;EACX,YAAY;CACd;EACC,YAAY,QAAQ;EACnB,WAAW;EACX,YAAY;CACd;EACC,YAAY,QAAQ;EACnB,WAAW;EACX,YAAY;CACd;EACC,YAAY,SAAS;EACpB,WAAW;EACX,YAAY;CACd;CACA,SAAS;EACP,WAAW;EACX,YAAY;CACd;AACF;;;;;;;ACvDA,IAAa,SAAS;CAClB,QAAQ;EACJ,aAAa;GACT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GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;EACJ;EACA,OAAO;GACH,UAAU;IACN,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,QAAQ;IACJ,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,MAAM;IACF,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,SAAS;IACL,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;GACA,OAAO;IACH,OAAO;IACP,MAAM;IACN,KAAK;KACD,OAAO;KACP,UAAU;IACd;GACJ;EACJ;CACJ;CACA,MA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