@vanduo-oss/vue 0.1.0 → 0.2.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 +17 -1
- package/dist/composables/useTheme.d.ts +21 -11
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +849 -852
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +13 -3
- package/package.json +2 -2
- package/dist/config/themeDefaults.d.ts +0 -10
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["$slots","$props","$slots","$slots","$slots"],"sources":["../src/plugin.ts","../src/components/VdAccordion.vue","../src/components/VdAccordion.vue","../src/components/VdIcon.vue","../src/components/VdIcon.vue","../src/components/VdAlert.vue","../src/components/VdAlert.vue","../src/components/VdAvatar.vue","../src/components/VdAvatar.vue","../src/components/VdBadge.vue","../src/components/VdBadge.vue","../src/components/VdButton.vue","../src/components/VdButton.vue","../src/components/VdButtonGroup.vue","../src/components/VdButtonGroup.vue","../src/components/VdCard.vue","../src/components/VdCard.vue","../src/components/VdCheckboxGroup.vue","../src/components/VdCheckboxGroup.vue","../src/components/VdChip.vue","../src/components/VdChip.vue","../src/components/VdCodeSnippet.vue","../src/components/VdCodeSnippet.vue","../src/components/VdCollection.vue","../src/components/VdCollection.vue","../src/components/VdCustomSelect.vue","../src/components/VdCustomSelect.vue","../src/components/VdFlow.vue","../src/components/VdFlow.vue","../src/components/VdInput.vue","../src/components/VdInput.vue","../src/components/VdModal.vue","../src/components/VdModal.vue","../src/components/VdOffcanvas.vue","../src/components/VdOffcanvas.vue","../src/components/VdPagination.vue","../src/components/VdPagination.vue","../src/components/VdPreloader.vue","../src/components/VdPreloader.vue","../src/components/VdProgress.vue","../src/components/VdProgress.vue","../src/components/VdRadioGroup.vue","../src/components/VdRadioGroup.vue","../src/components/VdRating.vue","../src/components/VdRating.vue","../src/components/VdSelect.vue","../src/components/VdSelect.vue","../src/components/VdSidenav.vue","../src/components/VdSidenav.vue","../src/components/VdSkeleton.vue","../src/components/VdSkeleton.vue","../src/components/VdSpinner.vue","../src/components/VdSpinner.vue","../src/components/VdTable.vue","../src/components/VdTable.vue","../src/components/VdTabs.vue","../src/components/VdTabs.vue","../src/components/VdToast.vue","../src/components/VdToast.vue","../src/composables/useToast.ts","../src/components/VdToastContainer.vue","../src/components/VdToastContainer.vue","../src/components/VdTooltip.vue","../src/components/VdTooltip.vue","../src/components/VdTransfer.vue","../src/components/VdTransfer.vue","../src/components/VdTreeNode.vue","../src/components/VdTreeNode.vue","../src/components/VdTree.vue","../src/components/VdTree.vue","../src/components/primitives/VdBox.vue","../src/components/primitives/VdBox.vue","../src/components/primitives/VdCenter.vue","../src/components/primitives/VdCenter.vue","../src/components/primitives/VdCover.vue","../src/components/primitives/VdCover.vue","../src/components/primitives/VdFrame.vue","../src/components/primitives/VdFrame.vue","../src/components/primitives/VdInline.vue","../src/components/primitives/VdInline.vue","../src/components/primitives/VdStack.vue","../src/components/primitives/VdStack.vue","../src/components/primitives/VdSwitcher.vue","../src/components/primitives/VdSwitcher.vue","../src/composables/useAffix.ts","../src/composables/useDatepicker.ts","../src/composables/useDraggable.ts","../src/composables/useDropdown.ts","../src/composables/useExpandingCards.ts","../src/composables/useFlow.ts","../src/composables/useFocusTrap.ts","../src/composables/useGlass.ts","../src/composables/useImageBox.ts","../src/composables/useKeyboardNav.ts","../src/composables/useMorph.ts","../src/composables/useMorphBadges.ts","../src/composables/useNavbarGlassScroll.ts","../src/composables/useParallax.ts","../src/composables/usePopover.ts","../src/composables/useRipple.ts","../src/composables/useScrollspy.ts","../src/composables/useSearch.ts","../src/composables/useSidenav.ts","../src/composables/useSpotlight.ts","../src/composables/useStepper.ts","../src/composables/useSuggest.ts","../src/composables/useTabs.ts","../src/config/themeDefaults.ts","../src/composables/useTheme.ts","../src/composables/useTimeline.ts","../src/composables/useTimepicker.ts","../src/utils/sanitizeHtml.ts","../src/composables/useTooltips.ts","../src/composables/useValidate.ts","../src/composables/useWaypoint.ts"],"sourcesContent":["import type { App, Plugin } from \"vue\";\n\n/**\n * The Vanilla engine's JavaScript (the `window.Vanduo*` globals that the\n * behaviour composables — dropdown, tooltip, draggable, … — delegate to) ships\n * as an IIFE bundle in `@vanduo-oss/framework`. It touches `window`/`document`,\n * so it must only run on the client.\n *\n * `loadVanduoRuntime()` loads it exactly once. Apps that need the globals to\n * exist *before* first mount (e.g. SSG hydration) should `await` it in their\n * bootstrap; `VanduoVue` also kicks it off on `app.use(...)` for the common case.\n */\nlet runtimePromise: Promise<unknown> | null = null;\n\nexport function loadVanduoRuntime(): Promise<unknown> {\n if (typeof window === \"undefined\") return Promise.resolve();\n if (!runtimePromise) {\n runtimePromise = import(\"@vanduo-oss/framework/iife\");\n }\n return runtimePromise;\n}\n\n/**\n * Vue plugin: `app.use(VanduoVue)`. Triggers the client-only runtime load so\n * the framework's JS components initialise once the app mounts.\n */\nexport const VanduoVue: Plugin = {\n install(_app: App) {\n void loadVanduoRuntime();\n },\n};\n\nexport default VanduoVue;\n","<script setup lang=\"ts\">\ninterface Item {\n id: string;\n title: string;\n content?: string;\n}\n\ninterface Props {\n items: Item[];\n modelValue: string | string[];\n exclusive?: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string | string[]] }>();\n\nconst isOpen = (id: string): boolean => {\n if (props.exclusive) {\n return props.modelValue === id;\n }\n return Array.isArray(props.modelValue) && props.modelValue.includes(id);\n};\n\nconst toggle = (id: string): void => {\n if (props.exclusive) {\n emit(\"update:modelValue\", props.modelValue === id ? \"\" : id);\n return;\n }\n const current = Array.isArray(props.modelValue) ? [...props.modelValue] : [];\n const idx = current.indexOf(id);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(id);\n emit(\"update:modelValue\", current);\n};\n</script>\n\n<template>\n <ul class=\"vd-accordion\">\n <li\n v-for=\"item in items\"\n :key=\"item.id\"\n :class=\"['vd-accordion-item', isOpen(item.id) ? 'is-open' : null]\"\n >\n <button\n type=\"button\"\n class=\"vd-accordion-header\"\n :aria-expanded=\"isOpen(item.id)\"\n :aria-controls=\"`vd-accordion-panel-${item.id}`\"\n @click=\"toggle(item.id)\"\n >\n <span>{{ item.title }}</span>\n <span class=\"vd-accordion-icon\" aria-hidden=\"true\">{{\n isOpen(item.id) ? \"−\" : \"+\"\n }}</span>\n </button>\n <div\n v-show=\"isOpen(item.id)\"\n :id=\"`vd-accordion-panel-${item.id}`\"\n class=\"vd-accordion-panel\"\n role=\"region\"\n >\n <slot :name=\"item.id\" :item=\"item\">\n {{ item.content }}\n </slot>\n </div>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\ninterface Item {\n id: string;\n title: string;\n content?: string;\n}\n\ninterface Props {\n items: Item[];\n modelValue: string | string[];\n exclusive?: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string | string[]] }>();\n\nconst isOpen = (id: string): boolean => {\n if (props.exclusive) {\n return props.modelValue === id;\n }\n return Array.isArray(props.modelValue) && props.modelValue.includes(id);\n};\n\nconst toggle = (id: string): void => {\n if (props.exclusive) {\n emit(\"update:modelValue\", props.modelValue === id ? \"\" : id);\n return;\n }\n const current = Array.isArray(props.modelValue) ? [...props.modelValue] : [];\n const idx = current.indexOf(id);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(id);\n emit(\"update:modelValue\", current);\n};\n</script>\n\n<template>\n <ul class=\"vd-accordion\">\n <li\n v-for=\"item in items\"\n :key=\"item.id\"\n :class=\"['vd-accordion-item', isOpen(item.id) ? 'is-open' : null]\"\n >\n <button\n type=\"button\"\n class=\"vd-accordion-header\"\n :aria-expanded=\"isOpen(item.id)\"\n :aria-controls=\"`vd-accordion-panel-${item.id}`\"\n @click=\"toggle(item.id)\"\n >\n <span>{{ item.title }}</span>\n <span class=\"vd-accordion-icon\" aria-hidden=\"true\">{{\n isOpen(item.id) ? \"−\" : \"+\"\n }}</span>\n </button>\n <div\n v-show=\"isOpen(item.id)\"\n :id=\"`vd-accordion-panel-${item.id}`\"\n class=\"vd-accordion-panel\"\n role=\"region\"\n >\n <slot :name=\"item.id\" :item=\"item\">\n {{ item.content }}\n </slot>\n </div>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n name: string;\n filled?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n filled: false,\n size: \"md\",\n});\n\nconst sizeClass = (): string => {\n switch (props.size) {\n case \"sm\":\n return \"vd-text-base\";\n case \"lg\":\n return \"vd-text-2xl\";\n default:\n return \"vd-text-xl\";\n }\n};\n</script>\n\n<template>\n <i\n :class=\"[props.filled ? 'ph-fill' : 'ph', `ph-${props.name}`, sizeClass()]\"\n aria-hidden=\"true\"\n />\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n name: string;\n filled?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n filled: false,\n size: \"md\",\n});\n\nconst sizeClass = (): string => {\n switch (props.size) {\n case \"sm\":\n return \"vd-text-base\";\n case \"lg\":\n return \"vd-text-2xl\";\n default:\n return \"vd-text-xl\";\n }\n};\n</script>\n\n<template>\n <i\n :class=\"[props.filled ? 'ph-fill' : 'ph', `ph-${props.name}`, sizeClass()]\"\n aria-hidden=\"true\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Variant = \"info\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n dismissible?: boolean;\n title?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"info\",\n dismissible: false,\n title: \"\",\n});\n\nconst emit = defineEmits<{ dismiss: [] }>();\n\nconst onDismiss = (): void => {\n emit(\"dismiss\");\n};\n\nconst iconName = (): string => {\n switch (props.variant) {\n case \"success\":\n return \"check-circle\";\n case \"warning\":\n return \"warning\";\n case \"danger\":\n return \"x-circle\";\n default:\n return \"info\";\n }\n};\n</script>\n\n<template>\n <div :class=\"['vd-alert', `vd-alert-${variant}`]\" role=\"alert\">\n <VdIcon :name=\"iconName()\" class=\"vd-alert-icon\" />\n <div class=\"vd-alert-body\">\n <p v-if=\"title\" class=\"vd-alert-title\">\n {{ title }}\n </p>\n <div class=\"vd-alert-content\">\n <slot />\n </div>\n </div>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-alert-dismiss\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n <VdIcon name=\"x\" />\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Variant = \"info\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n dismissible?: boolean;\n title?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"info\",\n dismissible: false,\n title: \"\",\n});\n\nconst emit = defineEmits<{ dismiss: [] }>();\n\nconst onDismiss = (): void => {\n emit(\"dismiss\");\n};\n\nconst iconName = (): string => {\n switch (props.variant) {\n case \"success\":\n return \"check-circle\";\n case \"warning\":\n return \"warning\";\n case \"danger\":\n return \"x-circle\";\n default:\n return \"info\";\n }\n};\n</script>\n\n<template>\n <div :class=\"['vd-alert', `vd-alert-${variant}`]\" role=\"alert\">\n <VdIcon :name=\"iconName()\" class=\"vd-alert-icon\" />\n <div class=\"vd-alert-body\">\n <p v-if=\"title\" class=\"vd-alert-title\">\n {{ title }}\n </p>\n <div class=\"vd-alert-content\">\n <slot />\n </div>\n </div>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-alert-dismiss\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n <VdIcon name=\"x\" />\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Shape = \"circle\" | \"rounded\" | \"square\";\n\ninterface Props {\n src?: string;\n alt?: string;\n initials?: string;\n size?: Size;\n variant?: Variant;\n shape?: Shape;\n status?: \"online\" | \"offline\" | \"away\" | \"busy\";\n}\n\nwithDefaults(defineProps<Props>(), {\n src: \"\",\n alt: \"\",\n initials: \"\",\n size: \"md\",\n variant: \"primary\",\n shape: \"circle\",\n status: undefined,\n});\n</script>\n\n<template>\n <div\n class=\"vd-avatar\"\n :class=\"[`vd-avatar-${size}`, `vd-avatar-${variant}`, `vd-avatar-${shape}`]\"\n :aria-label=\"alt || initials || 'Avatar'\"\n >\n <img v-if=\"src\" :src=\"src\" :alt=\"alt\" class=\"vd-avatar-img\" />\n <span v-else-if=\"initials\" class=\"vd-avatar-initials\">\n {{ initials }}\n </span>\n <span v-else class=\"vd-avatar-initials\" aria-hidden=\"true\"> ? </span>\n <span\n v-if=\"status\"\n class=\"vd-avatar-status\"\n :class=\"`vd-avatar-status-${status}`\"\n :aria-label=\"`Status: ${status}`\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Shape = \"circle\" | \"rounded\" | \"square\";\n\ninterface Props {\n src?: string;\n alt?: string;\n initials?: string;\n size?: Size;\n variant?: Variant;\n shape?: Shape;\n status?: \"online\" | \"offline\" | \"away\" | \"busy\";\n}\n\nwithDefaults(defineProps<Props>(), {\n src: \"\",\n alt: \"\",\n initials: \"\",\n size: \"md\",\n variant: \"primary\",\n shape: \"circle\",\n status: undefined,\n});\n</script>\n\n<template>\n <div\n class=\"vd-avatar\"\n :class=\"[`vd-avatar-${size}`, `vd-avatar-${variant}`, `vd-avatar-${shape}`]\"\n :aria-label=\"alt || initials || 'Avatar'\"\n >\n <img v-if=\"src\" :src=\"src\" :alt=\"alt\" class=\"vd-avatar-img\" />\n <span v-else-if=\"initials\" class=\"vd-avatar-initials\">\n {{ initials }}\n </span>\n <span v-else class=\"vd-avatar-initials\" aria-hidden=\"true\"> ? </span>\n <span\n v-if=\"status\"\n class=\"vd-avatar-status\"\n :class=\"`vd-avatar-status-${status}`\"\n :aria-label=\"`Status: ${status}`\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"default\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n pill?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"default\",\n pill: false,\n});\n</script>\n\n<template>\n <span\n class=\"vd-badge\"\n :class=\"[\n variant !== 'default' ? `vd-badge-${variant}` : null,\n pill ? 'vd-badge-pill' : null,\n ]\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"default\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n pill?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"default\",\n pill: false,\n});\n</script>\n\n<template>\n <span\n class=\"vd-badge\"\n :class=\"[\n variant !== 'default' ? `vd-badge-${variant}` : null,\n pill ? 'vd-badge-pill' : null,\n ]\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n loading?: boolean;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n loading: false,\n disabled: false,\n type: \"button\",\n});\n\nconst emit = defineEmits<{ click: [event: MouseEvent] }>();\n\nconst onClick = (event: MouseEvent): void => {\n if (props.disabled || props.loading) {\n event.preventDefault();\n return;\n }\n emit(\"click\", event);\n};\n</script>\n\n<template>\n <button\n :type=\"type\"\n :disabled=\"disabled || loading\"\n :class=\"[\n 'vd-btn',\n `vd-btn-${variant}`,\n size !== 'md' ? `vd-btn-${size}` : null,\n loading ? 'is-loading' : null,\n ]\"\n @click=\"onClick\"\n >\n <span v-if=\"loading\" class=\"vd-btn-spinner\" aria-hidden=\"true\" />\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n loading?: boolean;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n loading: false,\n disabled: false,\n type: \"button\",\n});\n\nconst emit = defineEmits<{ click: [event: MouseEvent] }>();\n\nconst onClick = (event: MouseEvent): void => {\n if (props.disabled || props.loading) {\n event.preventDefault();\n return;\n }\n emit(\"click\", event);\n};\n</script>\n\n<template>\n <button\n :type=\"type\"\n :disabled=\"disabled || loading\"\n :class=\"[\n 'vd-btn',\n `vd-btn-${variant}`,\n size !== 'md' ? `vd-btn-${size}` : null,\n loading ? 'is-loading' : null,\n ]\"\n @click=\"onClick\"\n >\n <span v-if=\"loading\" class=\"vd-btn-spinner\" aria-hidden=\"true\" />\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n vertical?: boolean;\n fullWidth?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n vertical: false,\n fullWidth: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-btn-group\"\n :class=\"[\n `vd-btn-group-${size}`,\n { 'vd-btn-group-vertical': vertical, 'vd-btn-group-full': fullWidth },\n ]\"\n role=\"group\"\n >\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n vertical?: boolean;\n fullWidth?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n vertical: false,\n fullWidth: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-btn-group\"\n :class=\"[\n `vd-btn-group-${size}`,\n { 'vd-btn-group-vertical': vertical, 'vd-btn-group-full': fullWidth },\n ]\"\n role=\"group\"\n >\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n elevated?: boolean;\n interactive?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n elevated: false,\n interactive: false,\n});\n</script>\n\n<template>\n <section\n class=\"vd-card\"\n :class=\"[\n elevated ? 'vd-card-elevated' : null,\n interactive ? 'vd-card-interactive' : null,\n ]\"\n >\n <header v-if=\"$slots.header\" class=\"vd-card-header\">\n <slot name=\"header\" />\n </header>\n <div class=\"vd-card-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-card-footer\">\n <slot name=\"footer\" />\n </footer>\n </section>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n elevated?: boolean;\n interactive?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n elevated: false,\n interactive: false,\n});\n</script>\n\n<template>\n <section\n class=\"vd-card\"\n :class=\"[\n elevated ? 'vd-card-elevated' : null,\n interactive ? 'vd-card-interactive' : null,\n ]\"\n >\n <header v-if=\"$slots.header\" class=\"vd-card-header\">\n <slot name=\"header\" />\n </header>\n <div class=\"vd-card-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-card-footer\">\n <slot name=\"footer\" />\n </footer>\n </section>\n</template>\n","<script setup lang=\"ts\">\ninterface CheckOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly CheckOption[];\n modelValue: readonly string[];\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string[]] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n\nconst isChecked = (options: readonly string[], value: string): boolean =>\n options.includes(value);\n\nconst toggle = (current: readonly string[], value: string): string[] => {\n const next = [...current];\n const idx = next.indexOf(value);\n if (idx === -1) next.push(value);\n else next.splice(idx, 1);\n return next;\n};\n\nconst onChange = (props: Props, value: string): void => {\n emit(\"update:modelValue\", toggle(props.modelValue, value));\n};\n</script>\n\n<template>\n <div\n class=\"vd-form-check-group\"\n :class=\"{ 'vd-form-check-group-inline': inline }\"\n role=\"group\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-check\"\n :class=\"[`vd-form-check-${size}`, { 'vd-form-check-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"checkbox\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"isChecked(modelValue, opt.value)\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-check-input\"\n @change=\"onChange($props, opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-check-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface CheckOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly CheckOption[];\n modelValue: readonly string[];\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string[]] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n\nconst isChecked = (options: readonly string[], value: string): boolean =>\n options.includes(value);\n\nconst toggle = (current: readonly string[], value: string): string[] => {\n const next = [...current];\n const idx = next.indexOf(value);\n if (idx === -1) next.push(value);\n else next.splice(idx, 1);\n return next;\n};\n\nconst onChange = (props: Props, value: string): void => {\n emit(\"update:modelValue\", toggle(props.modelValue, value));\n};\n</script>\n\n<template>\n <div\n class=\"vd-form-check-group\"\n :class=\"{ 'vd-form-check-group-inline': inline }\"\n role=\"group\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-check\"\n :class=\"[`vd-form-check-${size}`, { 'vd-form-check-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"checkbox\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"isChecked(modelValue, opt.value)\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-check-input\"\n @change=\"onChange($props, opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-check-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n outline?: boolean;\n dismissible?: boolean;\n avatar?: string;\n clickable?: boolean;\n}\n\nconst emit = defineEmits<{\n dismiss: [];\n click: [event: MouseEvent];\n}>();\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n outline: false,\n dismissible: false,\n avatar: \"\",\n clickable: false,\n});\n\nconst onDismiss = (event: MouseEvent): void => {\n event.stopPropagation();\n emit(\"dismiss\");\n};\n</script>\n\n<template>\n <span\n class=\"vd-chip\"\n :class=\"[\n `vd-chip-${variant}`,\n `vd-chip-${size}`,\n {\n 'vd-chip-outline': outline,\n 'vd-chip-dismissible': dismissible,\n 'vd-chip-clickable': clickable,\n },\n ]\"\n role=\"status\"\n @click=\"clickable && emit('click', $event)\"\n >\n <img v-if=\"avatar\" :src=\"avatar\" class=\"vd-chip-avatar\" alt=\"\" />\n <slot />\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-chip-close\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n ×\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n outline?: boolean;\n dismissible?: boolean;\n avatar?: string;\n clickable?: boolean;\n}\n\nconst emit = defineEmits<{\n dismiss: [];\n click: [event: MouseEvent];\n}>();\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n outline: false,\n dismissible: false,\n avatar: \"\",\n clickable: false,\n});\n\nconst onDismiss = (event: MouseEvent): void => {\n event.stopPropagation();\n emit(\"dismiss\");\n};\n</script>\n\n<template>\n <span\n class=\"vd-chip\"\n :class=\"[\n `vd-chip-${variant}`,\n `vd-chip-${size}`,\n {\n 'vd-chip-outline': outline,\n 'vd-chip-dismissible': dismissible,\n 'vd-chip-clickable': clickable,\n },\n ]\"\n role=\"status\"\n @click=\"clickable && emit('click', $event)\"\n >\n <img v-if=\"avatar\" :src=\"avatar\" class=\"vd-chip-avatar\" alt=\"\" />\n <slot />\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-chip-close\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n ×\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n code: string;\n language?: string;\n copyable?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n language: \"html\",\n copyable: true,\n});\n\nconst copied = ref(false);\n\nconst onCopy = async (code: string): Promise<void> => {\n if (typeof navigator === \"undefined\" || !navigator.clipboard) return;\n try {\n await navigator.clipboard.writeText(code);\n copied.value = true;\n setTimeout(() => {\n copied.value = false;\n }, 1500);\n } catch {\n /* clipboard may be blocked */\n }\n};\n</script>\n\n<template>\n <figure class=\"vd-code-snippet\">\n <pre\n :class=\"['vd-code-snippet-pre', `language-${language}`]\"\n :data-language=\"language\"\n ><code>{{ code }}</code></pre>\n <button\n v-if=\"copyable\"\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-sm vd-code-snippet-copy\"\n :aria-label=\"copied ? 'Copied' : 'Copy code'\"\n @click=\"onCopy(code)\"\n >\n <VdIcon :name=\"copied ? 'check' : 'copy'\" />\n <span>{{ copied ? \"Copied\" : \"Copy\" }}</span>\n </button>\n </figure>\n</template>\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n code: string;\n language?: string;\n copyable?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n language: \"html\",\n copyable: true,\n});\n\nconst copied = ref(false);\n\nconst onCopy = async (code: string): Promise<void> => {\n if (typeof navigator === \"undefined\" || !navigator.clipboard) return;\n try {\n await navigator.clipboard.writeText(code);\n copied.value = true;\n setTimeout(() => {\n copied.value = false;\n }, 1500);\n } catch {\n /* clipboard may be blocked */\n }\n};\n</script>\n\n<template>\n <figure class=\"vd-code-snippet\">\n <pre\n :class=\"['vd-code-snippet-pre', `language-${language}`]\"\n :data-language=\"language\"\n ><code>{{ code }}</code></pre>\n <button\n v-if=\"copyable\"\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-sm vd-code-snippet-copy\"\n :aria-label=\"copied ? 'Copied' : 'Copy code'\"\n @click=\"onCopy(code)\"\n >\n <VdIcon :name=\"copied ? 'check' : 'copy'\" />\n <span>{{ copied ? \"Copied\" : \"Copy\" }}</span>\n </button>\n </figure>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface CollectionItem {\n id: string | number;\n avatar?: string;\n title: string;\n subtitle?: string;\n action?: string;\n}\n\ninterface Props {\n items: readonly CollectionItem[];\n header?: string;\n hoverable?: boolean;\n bordered?: boolean;\n size?: Size;\n}\n\nwithDefaults(defineProps<Props>(), {\n header: \"\",\n hoverable: false,\n bordered: false,\n size: \"md\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-collection\"\n :class=\"[\n `vd-collection-${size}`,\n {\n 'vd-collection-hoverable': hoverable,\n 'vd-collection-bordered': bordered,\n },\n ]\"\n >\n <div v-if=\"header\" class=\"vd-collection-header\">\n <h3 class=\"vd-collection-title\">\n {{ header }}\n </h3>\n </div>\n <ul class=\"vd-collection-list\">\n <li v-for=\"item in items\" :key=\"item.id\" class=\"vd-collection-item\">\n <div v-if=\"item.avatar\" class=\"vd-collection-avatar\">\n <img :src=\"item.avatar\" :alt=\"item.subtitle || item.title\" />\n </div>\n <div class=\"vd-collection-content\">\n <div class=\"vd-collection-text\">\n <strong class=\"vd-collection-title\">{{ item.title }}</strong>\n <span v-if=\"item.subtitle\" class=\"vd-collection-text-secondary\">{{\n item.subtitle\n }}</span>\n </div>\n </div>\n <div v-if=\"item.action\" class=\"vd-collection-action\">\n {{ item.action }}\n </div>\n </li>\n </ul>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface CollectionItem {\n id: string | number;\n avatar?: string;\n title: string;\n subtitle?: string;\n action?: string;\n}\n\ninterface Props {\n items: readonly CollectionItem[];\n header?: string;\n hoverable?: boolean;\n bordered?: boolean;\n size?: Size;\n}\n\nwithDefaults(defineProps<Props>(), {\n header: \"\",\n hoverable: false,\n bordered: false,\n size: \"md\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-collection\"\n :class=\"[\n `vd-collection-${size}`,\n {\n 'vd-collection-hoverable': hoverable,\n 'vd-collection-bordered': bordered,\n },\n ]\"\n >\n <div v-if=\"header\" class=\"vd-collection-header\">\n <h3 class=\"vd-collection-title\">\n {{ header }}\n </h3>\n </div>\n <ul class=\"vd-collection-list\">\n <li v-for=\"item in items\" :key=\"item.id\" class=\"vd-collection-item\">\n <div v-if=\"item.avatar\" class=\"vd-collection-avatar\">\n <img :src=\"item.avatar\" :alt=\"item.subtitle || item.title\" />\n </div>\n <div class=\"vd-collection-content\">\n <div class=\"vd-collection-text\">\n <strong class=\"vd-collection-title\">{{ item.title }}</strong>\n <span v-if=\"item.subtitle\" class=\"vd-collection-text-secondary\">{{\n item.subtitle\n }}</span>\n </div>\n </div>\n <div v-if=\"item.action\" class=\"vd-collection-action\">\n {{ item.action }}\n </div>\n </li>\n </ul>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref } from \"vue\";\n\ninterface CustomSelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly CustomSelectOption[];\n id?: string;\n name?: string;\n placeholder?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n id: \"\",\n name: \"\",\n placeholder: \"Select...\",\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst open = ref(false);\nconst activeIndex = ref(-1);\nconst wrapper = ref<HTMLElement | null>(null);\nconst buttonId = computed(() => props.id || props.name || \"custom-select\");\n\nconst selectableIndexes = computed(() =>\n props.options.flatMap((o, i) => (o.disabled ? [] : [i])),\n);\n\nconst buttonText = computed(() => {\n const match = props.options.find((o) => o.value === props.modelValue);\n return match ? match.label : props.placeholder;\n});\n\nconst openDropdown = (): void => {\n open.value = true;\n const selectedIdx = props.options.findIndex(\n (o) => o.value === props.modelValue,\n );\n activeIndex.value =\n selectedIdx >= 0 && !props.options[selectedIdx]?.disabled\n ? selectedIdx\n : (selectableIndexes.value[0] ?? -1);\n};\n\nconst closeDropdown = (): void => {\n open.value = false;\n};\n\nconst toggle = (): void => {\n if (open.value) closeDropdown();\n else openDropdown();\n};\n\nconst selectOption = (option: CustomSelectOption): void => {\n if (option.disabled) return;\n emit(\"update:modelValue\", option.value);\n closeDropdown();\n};\n\nconst moveActive = (delta: number): void => {\n const list = selectableIndexes.value;\n if (list.length === 0) return;\n const pos = list.indexOf(activeIndex.value);\n const nextPos = pos < 0 ? 0 : (pos + delta + list.length) % list.length;\n activeIndex.value = list[nextPos] ?? -1;\n};\n\n// Per-instance typeahead, mirroring select.js\nlet typeaheadBuffer = \"\";\nlet typeaheadTimer: number | null = null;\n\nconst onKeydown = (e: KeyboardEvent): void => {\n switch (e.key) {\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (open.value && activeIndex.value >= 0) {\n const opt = props.options[activeIndex.value];\n if (opt) selectOption(opt);\n } else {\n openDropdown();\n }\n break;\n case \"Escape\":\n if (open.value) {\n e.preventDefault();\n closeDropdown();\n }\n break;\n case \"ArrowDown\":\n e.preventDefault();\n if (!open.value) openDropdown();\n else moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (open.value) moveActive(-1);\n break;\n case \"Home\":\n if (open.value) {\n e.preventDefault();\n activeIndex.value = selectableIndexes.value[0] ?? -1;\n }\n break;\n case \"End\":\n if (open.value) {\n e.preventDefault();\n const list = selectableIndexes.value;\n activeIndex.value = list[list.length - 1] ?? -1;\n }\n break;\n default:\n if (\n open.value &&\n e.key.length === 1 &&\n !e.ctrlKey &&\n !e.metaKey &&\n !e.altKey\n ) {\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n typeaheadBuffer += e.key.toLowerCase();\n const match = props.options.findIndex(\n (o) =>\n !o.disabled && o.label.toLowerCase().startsWith(typeaheadBuffer),\n );\n if (match >= 0) activeIndex.value = match;\n typeaheadTimer = window.setTimeout(() => {\n typeaheadBuffer = \"\";\n }, 500);\n }\n }\n};\n\nconst onDocumentClick = (e: MouseEvent): void => {\n if (\n open.value &&\n wrapper.value &&\n !wrapper.value.contains(e.target as Node)\n ) {\n closeDropdown();\n }\n};\n\nonMounted(() => document.addEventListener(\"click\", onDocumentClick));\nonBeforeUnmount(() => {\n document.removeEventListener(\"click\", onDocumentClick);\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n});\n</script>\n\n<template>\n <div ref=\"wrapper\" class=\"custom-select-wrapper\">\n <select\n :id=\"id || undefined\"\n :name=\"name || undefined\"\n :value=\"modelValue\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n >\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <button\n type=\"button\"\n class=\"custom-select-button\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"open ? 'true' : 'false'\"\n :aria-labelledby=\"buttonId\"\n @click.stop=\"toggle\"\n @keydown=\"onKeydown\"\n >\n {{ buttonText }}\n </button>\n <div\n class=\"custom-select-dropdown\"\n :class=\"{ 'is-open': open }\"\n role=\"listbox\"\n >\n <div\n v-for=\"(opt, i) in options\"\n :key=\"opt.value\"\n class=\"custom-select-option\"\n :class=\"{\n 'is-selected': opt.value === modelValue,\n 'is-disabled': opt.disabled,\n 'is-active': i === activeIndex,\n }\"\n role=\"option\"\n :data-value=\"opt.value\"\n :aria-selected=\"opt.value === modelValue ? 'true' : 'false'\"\n :aria-disabled=\"opt.disabled ? 'true' : undefined\"\n @click=\"selectOption(opt)\"\n @mouseenter=\"activeIndex = i\"\n >\n {{ opt.label }}\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref } from \"vue\";\n\ninterface CustomSelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly CustomSelectOption[];\n id?: string;\n name?: string;\n placeholder?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n id: \"\",\n name: \"\",\n placeholder: \"Select...\",\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst open = ref(false);\nconst activeIndex = ref(-1);\nconst wrapper = ref<HTMLElement | null>(null);\nconst buttonId = computed(() => props.id || props.name || \"custom-select\");\n\nconst selectableIndexes = computed(() =>\n props.options.flatMap((o, i) => (o.disabled ? [] : [i])),\n);\n\nconst buttonText = computed(() => {\n const match = props.options.find((o) => o.value === props.modelValue);\n return match ? match.label : props.placeholder;\n});\n\nconst openDropdown = (): void => {\n open.value = true;\n const selectedIdx = props.options.findIndex(\n (o) => o.value === props.modelValue,\n );\n activeIndex.value =\n selectedIdx >= 0 && !props.options[selectedIdx]?.disabled\n ? selectedIdx\n : (selectableIndexes.value[0] ?? -1);\n};\n\nconst closeDropdown = (): void => {\n open.value = false;\n};\n\nconst toggle = (): void => {\n if (open.value) closeDropdown();\n else openDropdown();\n};\n\nconst selectOption = (option: CustomSelectOption): void => {\n if (option.disabled) return;\n emit(\"update:modelValue\", option.value);\n closeDropdown();\n};\n\nconst moveActive = (delta: number): void => {\n const list = selectableIndexes.value;\n if (list.length === 0) return;\n const pos = list.indexOf(activeIndex.value);\n const nextPos = pos < 0 ? 0 : (pos + delta + list.length) % list.length;\n activeIndex.value = list[nextPos] ?? -1;\n};\n\n// Per-instance typeahead, mirroring select.js\nlet typeaheadBuffer = \"\";\nlet typeaheadTimer: number | null = null;\n\nconst onKeydown = (e: KeyboardEvent): void => {\n switch (e.key) {\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (open.value && activeIndex.value >= 0) {\n const opt = props.options[activeIndex.value];\n if (opt) selectOption(opt);\n } else {\n openDropdown();\n }\n break;\n case \"Escape\":\n if (open.value) {\n e.preventDefault();\n closeDropdown();\n }\n break;\n case \"ArrowDown\":\n e.preventDefault();\n if (!open.value) openDropdown();\n else moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (open.value) moveActive(-1);\n break;\n case \"Home\":\n if (open.value) {\n e.preventDefault();\n activeIndex.value = selectableIndexes.value[0] ?? -1;\n }\n break;\n case \"End\":\n if (open.value) {\n e.preventDefault();\n const list = selectableIndexes.value;\n activeIndex.value = list[list.length - 1] ?? -1;\n }\n break;\n default:\n if (\n open.value &&\n e.key.length === 1 &&\n !e.ctrlKey &&\n !e.metaKey &&\n !e.altKey\n ) {\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n typeaheadBuffer += e.key.toLowerCase();\n const match = props.options.findIndex(\n (o) =>\n !o.disabled && o.label.toLowerCase().startsWith(typeaheadBuffer),\n );\n if (match >= 0) activeIndex.value = match;\n typeaheadTimer = window.setTimeout(() => {\n typeaheadBuffer = \"\";\n }, 500);\n }\n }\n};\n\nconst onDocumentClick = (e: MouseEvent): void => {\n if (\n open.value &&\n wrapper.value &&\n !wrapper.value.contains(e.target as Node)\n ) {\n closeDropdown();\n }\n};\n\nonMounted(() => document.addEventListener(\"click\", onDocumentClick));\nonBeforeUnmount(() => {\n document.removeEventListener(\"click\", onDocumentClick);\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n});\n</script>\n\n<template>\n <div ref=\"wrapper\" class=\"custom-select-wrapper\">\n <select\n :id=\"id || undefined\"\n :name=\"name || undefined\"\n :value=\"modelValue\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n >\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <button\n type=\"button\"\n class=\"custom-select-button\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"open ? 'true' : 'false'\"\n :aria-labelledby=\"buttonId\"\n @click.stop=\"toggle\"\n @keydown=\"onKeydown\"\n >\n {{ buttonText }}\n </button>\n <div\n class=\"custom-select-dropdown\"\n :class=\"{ 'is-open': open }\"\n role=\"listbox\"\n >\n <div\n v-for=\"(opt, i) in options\"\n :key=\"opt.value\"\n class=\"custom-select-option\"\n :class=\"{\n 'is-selected': opt.value === modelValue,\n 'is-disabled': opt.disabled,\n 'is-active': i === activeIndex,\n }\"\n role=\"option\"\n :data-value=\"opt.value\"\n :aria-selected=\"opt.value === modelValue ? 'true' : 'false'\"\n :aria-disabled=\"opt.disabled ? 'true' : undefined\"\n @click=\"selectOption(opt)\"\n @mouseenter=\"activeIndex = i\"\n >\n {{ opt.label }}\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\ninterface Props {\n modelValue: number;\n total: number;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst index = ref(props.modelValue);\n\nconst go = (next: number): void => {\n const clamped = Math.max(0, Math.min(props.total - 1, next));\n if (clamped !== index.value) {\n index.value = clamped;\n emit(\"update:modelValue\", clamped);\n }\n};\n\nconst prev = (): void => go(index.value - 1);\nconst next = (): void => go(index.value + 1);\n\ndefineExpose({ go, prev, next, index });\n\nconst slides = computed(() => Array.from({ length: props.total }, (_, i) => i));\n</script>\n\n<template>\n <div class=\"vd-flow\" role=\"region\" aria-roledescription=\"carousel\">\n <div\n class=\"vd-flow-track\"\n :style=\"{ transform: `translateX(-${index * 100}%)` }\"\n >\n <div\n v-for=\"i in slides\"\n :key=\"i\"\n class=\"vd-flow-slide\"\n :aria-hidden=\"i !== index\"\n >\n <slot :name=\"`slide-${i}`\" :index=\"i\" />\n </div>\n </div>\n <div v-if=\"total > 1\" class=\"vd-flow-controls\">\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Previous slide\"\n :disabled=\"index === 0\"\n @click=\"prev\"\n >\n ‹\n </button>\n <span class=\"vd-flow-position\">{{ index + 1 }} / {{ total }}</span>\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Next slide\"\n :disabled=\"index === total - 1\"\n @click=\"next\"\n >\n ›\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\ninterface Props {\n modelValue: number;\n total: number;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst index = ref(props.modelValue);\n\nconst go = (next: number): void => {\n const clamped = Math.max(0, Math.min(props.total - 1, next));\n if (clamped !== index.value) {\n index.value = clamped;\n emit(\"update:modelValue\", clamped);\n }\n};\n\nconst prev = (): void => go(index.value - 1);\nconst next = (): void => go(index.value + 1);\n\ndefineExpose({ go, prev, next, index });\n\nconst slides = computed(() => Array.from({ length: props.total }, (_, i) => i));\n</script>\n\n<template>\n <div class=\"vd-flow\" role=\"region\" aria-roledescription=\"carousel\">\n <div\n class=\"vd-flow-track\"\n :style=\"{ transform: `translateX(-${index * 100}%)` }\"\n >\n <div\n v-for=\"i in slides\"\n :key=\"i\"\n class=\"vd-flow-slide\"\n :aria-hidden=\"i !== index\"\n >\n <slot :name=\"`slide-${i}`\" :index=\"i\" />\n </div>\n </div>\n <div v-if=\"total > 1\" class=\"vd-flow-controls\">\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Previous slide\"\n :disabled=\"index === 0\"\n @click=\"prev\"\n >\n ‹\n </button>\n <span class=\"vd-flow-position\">{{ index + 1 }} / {{ total }}</span>\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Next slide\"\n :disabled=\"index === total - 1\"\n @click=\"next\"\n >\n ›\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant = \"default\" | \"error\" | \"success\";\n\ninterface Props {\n modelValue: string;\n type?: string;\n placeholder?: string;\n size?: Size;\n variant?: Variant;\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n minlength?: number;\n maxlength?: number;\n pattern?: string;\n autocomplete?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n type: \"text\",\n placeholder: \"\",\n size: \"md\",\n variant: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n name: \"\",\n id: \"\",\n minlength: undefined,\n maxlength: undefined,\n pattern: \"\",\n autocomplete: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n blur: [event: FocusEvent];\n focus: [event: FocusEvent];\n}>();\n\nconst onInput = (event: Event): void => {\n const target = event.target as HTMLInputElement;\n emit(\"update:modelValue\", target.value);\n};\n\n// Workaround for typed optional number props\nconst numberOrUndefined = (n: number | undefined): number | undefined => n;\nvoid numberOrUndefined(props.minlength);\nvoid numberOrUndefined(props.maxlength);\n</script>\n\n<template>\n <input\n :id=\"id || name\"\n :type=\"type\"\n :name=\"name\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :minlength=\"minlength\"\n :maxlength=\"maxlength\"\n :pattern=\"pattern\"\n :autocomplete=\"autocomplete\"\n class=\"vd-input\"\n :class=\"[\n `vd-input-${size}`,\n variant !== 'default' ? `vd-input-${variant}` : null,\n ]\"\n @input=\"onInput\"\n @blur=\"(e) => emit('blur', e)\"\n @focus=\"(e) => emit('focus', e)\"\n />\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant = \"default\" | \"error\" | \"success\";\n\ninterface Props {\n modelValue: string;\n type?: string;\n placeholder?: string;\n size?: Size;\n variant?: Variant;\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n minlength?: number;\n maxlength?: number;\n pattern?: string;\n autocomplete?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n type: \"text\",\n placeholder: \"\",\n size: \"md\",\n variant: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n name: \"\",\n id: \"\",\n minlength: undefined,\n maxlength: undefined,\n pattern: \"\",\n autocomplete: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n blur: [event: FocusEvent];\n focus: [event: FocusEvent];\n}>();\n\nconst onInput = (event: Event): void => {\n const target = event.target as HTMLInputElement;\n emit(\"update:modelValue\", target.value);\n};\n\n// Workaround for typed optional number props\nconst numberOrUndefined = (n: number | undefined): number | undefined => n;\nvoid numberOrUndefined(props.minlength);\nvoid numberOrUndefined(props.maxlength);\n</script>\n\n<template>\n <input\n :id=\"id || name\"\n :type=\"type\"\n :name=\"name\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :minlength=\"minlength\"\n :maxlength=\"maxlength\"\n :pattern=\"pattern\"\n :autocomplete=\"autocomplete\"\n class=\"vd-input\"\n :class=\"[\n `vd-input-${size}`,\n variant !== 'default' ? `vd-input-${variant}` : null,\n ]\"\n @input=\"onInput\"\n @blur=\"(e) => emit('blur', e)\"\n @focus=\"(e) => emit('focus', e)\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n open: boolean;\n title?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n closeOnBackdrop?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n title: \"\",\n size: \"md\",\n closeOnBackdrop: true,\n});\n\nconst emit = defineEmits<{\n \"update:open\": [value: boolean];\n close: [];\n}>();\n\nconst panel = ref<HTMLElement | null>(null);\n\nconst sizeClass = computed(() => `vd-modal-panel-${props.size}`);\n\nconst close = (): void => {\n emit(\"update:open\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.open) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n }\n};\n\nwatch(\n () => props.open,\n async (open) => {\n if (typeof window === \"undefined\") return;\n if (open) {\n window.addEventListener(\"keydown\", onKeydown);\n await nextTick();\n panel.value?.focus();\n } else {\n window.removeEventListener(\"keydown\", onKeydown);\n }\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"open\"\n class=\"vd-modal vd-modal-open\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || 'Dialog'\"\n data-vd-modal\n >\n <div class=\"vd-modal-backdrop\" @click=\"onBackdrop\" />\n <div ref=\"panel\" :class=\"['vd-modal-panel', sizeClass]\" tabindex=\"-1\">\n <header v-if=\"title || $slots.header\" class=\"vd-modal-header\">\n <h2 v-if=\"title\" class=\"vd-modal-title\">\n {{ title }}\n </h2>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n <VdIcon name=\"x\" />\n </button>\n </header>\n <div class=\"vd-modal-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-modal-footer\">\n <slot name=\"footer\" />\n </footer>\n </div>\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n open: boolean;\n title?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n closeOnBackdrop?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n title: \"\",\n size: \"md\",\n closeOnBackdrop: true,\n});\n\nconst emit = defineEmits<{\n \"update:open\": [value: boolean];\n close: [];\n}>();\n\nconst panel = ref<HTMLElement | null>(null);\n\nconst sizeClass = computed(() => `vd-modal-panel-${props.size}`);\n\nconst close = (): void => {\n emit(\"update:open\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.open) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n }\n};\n\nwatch(\n () => props.open,\n async (open) => {\n if (typeof window === \"undefined\") return;\n if (open) {\n window.addEventListener(\"keydown\", onKeydown);\n await nextTick();\n panel.value?.focus();\n } else {\n window.removeEventListener(\"keydown\", onKeydown);\n }\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"open\"\n class=\"vd-modal vd-modal-open\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || 'Dialog'\"\n data-vd-modal\n >\n <div class=\"vd-modal-backdrop\" @click=\"onBackdrop\" />\n <div ref=\"panel\" :class=\"['vd-modal-panel', sizeClass]\" tabindex=\"-1\">\n <header v-if=\"title || $slots.header\" class=\"vd-modal-header\">\n <h2 v-if=\"title\" class=\"vd-modal-title\">\n {{ title }}\n </h2>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n <VdIcon name=\"x\" />\n </button>\n </header>\n <div class=\"vd-modal-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-modal-footer\">\n <slot name=\"footer\" />\n </footer>\n </div>\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"right\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-offcanvas\"\n :class=\"[`vd-offcanvas-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Off-canvas panel'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"right\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-offcanvas\"\n :class=\"[`vd-offcanvas-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Off-canvas panel'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/pagination.js. Reproduces\n * the framework's DOM contract — `.vd-pagination` list of\n * `.vd-pagination-item` (`<a class=\"vd-pagination-link\">`), `.active` /\n * `.disabled` states, prev/next, and ellipses via the framework's exact\n * `calculatePages` algorithm — with a clean `v-model` API. Dispatches a native\n * `pagination:change` ({ page, totalPages }) alongside `update:modelValue`.\n */\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n modelValue: number;\n total: number;\n maxVisible?: number;\n size?: Size;\n align?: \"left\" | \"center\" | \"right\";\n disabled?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n maxVisible: 7,\n size: \"md\",\n align: \"left\",\n disabled: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst calculatePages = (\n currentPage: number,\n totalPages: number,\n maxVisible: number,\n): (number | \"ellipsis\")[] => {\n const pages: (number | \"ellipsis\")[] = [];\n const half = Math.floor(maxVisible / 2);\n\n if (totalPages <= maxVisible) {\n for (let i = 1; i <= totalPages; i++) pages.push(i);\n return pages;\n }\n\n pages.push(1);\n let start = Math.max(2, currentPage - half);\n let end = Math.min(totalPages - 1, currentPage + half);\n if (currentPage <= half + 1) end = Math.min(totalPages - 1, maxVisible - 1);\n if (currentPage >= totalPages - half)\n start = Math.max(2, totalPages - maxVisible + 2);\n\n if (start > 2) pages.push(\"ellipsis\");\n for (let i = start; i <= end; i++) pages.push(i);\n if (end < totalPages - 1) pages.push(\"ellipsis\");\n if (totalPages > 1) pages.push(totalPages);\n return pages;\n};\n\nconst pages = computed(() =>\n calculatePages(props.modelValue, props.total, props.maxVisible),\n);\n\nconst go = (page: number): void => {\n if (props.disabled) return;\n if (page < 1 || page > props.total || page === props.modelValue) return;\n emit(\"update:modelValue\", page);\n root.value?.dispatchEvent(\n new CustomEvent(\"pagination:change\", {\n bubbles: true,\n detail: { page, totalPages: props.total },\n }),\n );\n};\n</script>\n\n<template>\n <nav ref=\"root\" aria-label=\"Pagination\">\n <ul\n class=\"vd-pagination\"\n :class=\"[`vd-pagination-${size}`, `vd-pagination-${align}`]\"\n >\n <li\n class=\"vd-pagination-item vd-pagination-prev\"\n :class=\"{ disabled: disabled || modelValue <= 1 }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Previous\"\n @click.prevent=\"go(modelValue - 1)\"\n >Previous</a\n >\n </li>\n\n <template v-for=\"(item, idx) in pages\" :key=\"idx\">\n <li v-if=\"item === 'ellipsis'\" class=\"vd-pagination-item\">\n <span class=\"vd-pagination-ellipsis\" aria-hidden=\"true\">…</span>\n </li>\n <li\n v-else\n class=\"vd-pagination-item\"\n :class=\"{ active: item === modelValue }\"\n :data-page=\"item\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n :aria-label=\"`Page ${item}`\"\n :aria-current=\"item === modelValue ? 'page' : undefined\"\n @click.prevent=\"go(item)\"\n >{{ item }}</a\n >\n </li>\n </template>\n\n <li\n class=\"vd-pagination-item vd-pagination-next\"\n :class=\"{ disabled: disabled || modelValue >= total }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Next\"\n @click.prevent=\"go(modelValue + 1)\"\n >Next</a\n >\n </li>\n </ul>\n </nav>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/pagination.js. Reproduces\n * the framework's DOM contract — `.vd-pagination` list of\n * `.vd-pagination-item` (`<a class=\"vd-pagination-link\">`), `.active` /\n * `.disabled` states, prev/next, and ellipses via the framework's exact\n * `calculatePages` algorithm — with a clean `v-model` API. Dispatches a native\n * `pagination:change` ({ page, totalPages }) alongside `update:modelValue`.\n */\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n modelValue: number;\n total: number;\n maxVisible?: number;\n size?: Size;\n align?: \"left\" | \"center\" | \"right\";\n disabled?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n maxVisible: 7,\n size: \"md\",\n align: \"left\",\n disabled: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst calculatePages = (\n currentPage: number,\n totalPages: number,\n maxVisible: number,\n): (number | \"ellipsis\")[] => {\n const pages: (number | \"ellipsis\")[] = [];\n const half = Math.floor(maxVisible / 2);\n\n if (totalPages <= maxVisible) {\n for (let i = 1; i <= totalPages; i++) pages.push(i);\n return pages;\n }\n\n pages.push(1);\n let start = Math.max(2, currentPage - half);\n let end = Math.min(totalPages - 1, currentPage + half);\n if (currentPage <= half + 1) end = Math.min(totalPages - 1, maxVisible - 1);\n if (currentPage >= totalPages - half)\n start = Math.max(2, totalPages - maxVisible + 2);\n\n if (start > 2) pages.push(\"ellipsis\");\n for (let i = start; i <= end; i++) pages.push(i);\n if (end < totalPages - 1) pages.push(\"ellipsis\");\n if (totalPages > 1) pages.push(totalPages);\n return pages;\n};\n\nconst pages = computed(() =>\n calculatePages(props.modelValue, props.total, props.maxVisible),\n);\n\nconst go = (page: number): void => {\n if (props.disabled) return;\n if (page < 1 || page > props.total || page === props.modelValue) return;\n emit(\"update:modelValue\", page);\n root.value?.dispatchEvent(\n new CustomEvent(\"pagination:change\", {\n bubbles: true,\n detail: { page, totalPages: props.total },\n }),\n );\n};\n</script>\n\n<template>\n <nav ref=\"root\" aria-label=\"Pagination\">\n <ul\n class=\"vd-pagination\"\n :class=\"[`vd-pagination-${size}`, `vd-pagination-${align}`]\"\n >\n <li\n class=\"vd-pagination-item vd-pagination-prev\"\n :class=\"{ disabled: disabled || modelValue <= 1 }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Previous\"\n @click.prevent=\"go(modelValue - 1)\"\n >Previous</a\n >\n </li>\n\n <template v-for=\"(item, idx) in pages\" :key=\"idx\">\n <li v-if=\"item === 'ellipsis'\" class=\"vd-pagination-item\">\n <span class=\"vd-pagination-ellipsis\" aria-hidden=\"true\">…</span>\n </li>\n <li\n v-else\n class=\"vd-pagination-item\"\n :class=\"{ active: item === modelValue }\"\n :data-page=\"item\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n :aria-label=\"`Page ${item}`\"\n :aria-current=\"item === modelValue ? 'page' : undefined\"\n @click.prevent=\"go(item)\"\n >{{ item }}</a\n >\n </li>\n </template>\n\n <li\n class=\"vd-pagination-item vd-pagination-next\"\n :class=\"{ disabled: disabled || modelValue >= total }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Next\"\n @click.prevent=\"go(modelValue + 1)\"\n >Next</a\n >\n </li>\n </ul>\n </nav>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\ntype Theme = \"light\" | \"dark\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n theme?: Theme;\n text?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n theme: \"light\",\n text: \"\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-preloader-container\"\n :class=\"[`vd-preloader-${theme}`]\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <div\n class=\"vd-preloader\"\n :class=\"[`vd-preloader-${variant}`, `vd-preloader-${size}`]\"\n >\n <div class=\"vd-preloader-spinner\" />\n </div>\n <span v-if=\"text\" class=\"vd-preloader-text\">{{ text }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\ntype Theme = \"light\" | \"dark\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n theme?: Theme;\n text?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n theme: \"light\",\n text: \"\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-preloader-container\"\n :class=\"[`vd-preloader-${theme}`]\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <div\n class=\"vd-preloader\"\n :class=\"[`vd-preloader-${variant}`, `vd-preloader-${size}`]\"\n >\n <div class=\"vd-preloader-spinner\" />\n </div>\n <span v-if=\"text\" class=\"vd-preloader-text\">{{ text }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n value?: number;\n max?: number;\n indeterminate?: boolean;\n label?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n value: 0,\n max: 100,\n indeterminate: false,\n label: \"\",\n});\n\nconst pct = (): number => {\n if (props.indeterminate) return 0;\n const m = props.max || 100;\n return Math.max(0, Math.min(100, (props.value / m) * 100));\n};\n</script>\n\n<template>\n <div\n class=\"vd-progress\"\n :class=\"[indeterminate ? 'is-indeterminate' : null]\"\n role=\"progressbar\"\n :aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"indeterminate ? undefined : value\"\n :aria-label=\"label || 'Progress'\"\n >\n <div class=\"vd-progress-track\">\n <div\n class=\"vd-progress-fill\"\n :style=\"indeterminate ? undefined : { width: `${pct()}%` }\"\n />\n </div>\n <span\n v-if=\"!indeterminate && label\"\n class=\"vd-progress-label vd-text-sm vd-muted\"\n >\n {{ label }} — {{ Math.round(pct()) }}%\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n value?: number;\n max?: number;\n indeterminate?: boolean;\n label?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n value: 0,\n max: 100,\n indeterminate: false,\n label: \"\",\n});\n\nconst pct = (): number => {\n if (props.indeterminate) return 0;\n const m = props.max || 100;\n return Math.max(0, Math.min(100, (props.value / m) * 100));\n};\n</script>\n\n<template>\n <div\n class=\"vd-progress\"\n :class=\"[indeterminate ? 'is-indeterminate' : null]\"\n role=\"progressbar\"\n :aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"indeterminate ? undefined : value\"\n :aria-label=\"label || 'Progress'\"\n >\n <div class=\"vd-progress-track\">\n <div\n class=\"vd-progress-fill\"\n :style=\"indeterminate ? undefined : { width: `${pct()}%` }\"\n />\n </div>\n <span\n v-if=\"!indeterminate && label\"\n class=\"vd-progress-label vd-text-sm vd-muted\"\n >\n {{ label }} — {{ Math.round(pct()) }}%\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface RadioOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly RadioOption[];\n modelValue: string;\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-form-radio-group\"\n :class=\"{ 'vd-form-radio-group-inline': inline }\"\n role=\"radiogroup\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-radio\"\n :class=\"[`vd-form-radio-${size}`, { 'vd-form-radio-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"modelValue === opt.value\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-radio-input\"\n @change=\"emit('update:modelValue', opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-radio-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface RadioOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly RadioOption[];\n modelValue: string;\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-form-radio-group\"\n :class=\"{ 'vd-form-radio-group-inline': inline }\"\n role=\"radiogroup\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-radio\"\n :class=\"[`vd-form-radio-${size}`, { 'vd-form-radio-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"modelValue === opt.value\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-radio-input\"\n @change=\"emit('update:modelValue', opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-radio-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface Props {\n modelValue: number;\n max?: number;\n size?: \"sm\" | \"lg\";\n readonly?: boolean;\n name?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n max: 5,\n size: undefined,\n readonly: false,\n name: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: number];\n change: [value: number];\n}>();\n\nconst current = ref(props.modelValue);\nconst hovered = ref(-1);\n\nwatch(\n () => props.modelValue,\n (v) => {\n current.value = v;\n },\n);\n\nconst stars = computed(() =>\n Array.from({ length: props.max }, (_, i) => i + 1),\n);\n\n// Mirrors rating.js updateStars: empty buttons styled via CSS ::before; the\n// fill state is conveyed entirely by is-active / is-half / is-hovered.\nconst starClass = (starNum: number): Record<string, boolean> => ({\n \"is-active\": starNum <= Math.floor(current.value),\n \"is-half\":\n starNum > Math.floor(current.value) && starNum - 0.5 <= current.value,\n \"is-hovered\": hovered.value >= 0 && starNum <= hovered.value,\n});\n\nconst select = (starNum: number): void => {\n if (props.readonly) return;\n current.value = starNum;\n emit(\"update:modelValue\", starNum);\n emit(\"change\", starNum);\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n if (props.readonly) return;\n if (\n (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") &&\n current.value < props.max\n ) {\n e.preventDefault();\n select(current.value + 1);\n } else if (\n (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") &&\n current.value > 1\n ) {\n e.preventDefault();\n select(current.value - 1);\n }\n};\n</script>\n\n<template>\n <div\n class=\"vd-rating\"\n :class=\"[\n size ? `vd-rating-${size}` : null,\n { 'vd-rating-readonly': readonly },\n ]\"\n role=\"radiogroup\"\n aria-label=\"Rating\"\n @keydown=\"onKeydown\"\n @mouseleave=\"hovered = -1\"\n >\n <button\n v-for=\"starNum in stars\"\n :key=\"starNum\"\n type=\"button\"\n class=\"vd-rating-star\"\n :class=\"starClass(starNum)\"\n role=\"radio\"\n :aria-checked=\"starNum <= current ? 'true' : 'false'\"\n :aria-label=\"`${starNum} star${starNum > 1 ? 's' : ''}`\"\n :tabindex=\"readonly ? -1 : 0\"\n @mouseenter=\"readonly ? null : (hovered = starNum)\"\n @click=\"select(starNum)\"\n />\n <span class=\"vd-rating-value\">{{ current > 0 ? current : \"\" }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface Props {\n modelValue: number;\n max?: number;\n size?: \"sm\" | \"lg\";\n readonly?: boolean;\n name?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n max: 5,\n size: undefined,\n readonly: false,\n name: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: number];\n change: [value: number];\n}>();\n\nconst current = ref(props.modelValue);\nconst hovered = ref(-1);\n\nwatch(\n () => props.modelValue,\n (v) => {\n current.value = v;\n },\n);\n\nconst stars = computed(() =>\n Array.from({ length: props.max }, (_, i) => i + 1),\n);\n\n// Mirrors rating.js updateStars: empty buttons styled via CSS ::before; the\n// fill state is conveyed entirely by is-active / is-half / is-hovered.\nconst starClass = (starNum: number): Record<string, boolean> => ({\n \"is-active\": starNum <= Math.floor(current.value),\n \"is-half\":\n starNum > Math.floor(current.value) && starNum - 0.5 <= current.value,\n \"is-hovered\": hovered.value >= 0 && starNum <= hovered.value,\n});\n\nconst select = (starNum: number): void => {\n if (props.readonly) return;\n current.value = starNum;\n emit(\"update:modelValue\", starNum);\n emit(\"change\", starNum);\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n if (props.readonly) return;\n if (\n (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") &&\n current.value < props.max\n ) {\n e.preventDefault();\n select(current.value + 1);\n } else if (\n (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") &&\n current.value > 1\n ) {\n e.preventDefault();\n select(current.value - 1);\n }\n};\n</script>\n\n<template>\n <div\n class=\"vd-rating\"\n :class=\"[\n size ? `vd-rating-${size}` : null,\n { 'vd-rating-readonly': readonly },\n ]\"\n role=\"radiogroup\"\n aria-label=\"Rating\"\n @keydown=\"onKeydown\"\n @mouseleave=\"hovered = -1\"\n >\n <button\n v-for=\"starNum in stars\"\n :key=\"starNum\"\n type=\"button\"\n class=\"vd-rating-star\"\n :class=\"starClass(starNum)\"\n role=\"radio\"\n :aria-checked=\"starNum <= current ? 'true' : 'false'\"\n :aria-label=\"`${starNum} star${starNum > 1 ? 's' : ''}`\"\n :tabindex=\"readonly ? -1 : 0\"\n @mouseenter=\"readonly ? null : (hovered = starNum)\"\n @click=\"select(starNum)\"\n />\n <span class=\"vd-rating-value\">{{ current > 0 ? current : \"\" }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly SelectOption[];\n name?: string;\n id?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n name: \"\",\n id: \"\",\n placeholder: \"\",\n disabled: false,\n required: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst internal = ref(props.modelValue);\n\nwatch(\n () => props.modelValue,\n (v) => {\n internal.value = v;\n },\n);\n\nconst currentLabel = computed(\n () => props.options.find((o) => o.value === internal.value)?.label ?? \"\",\n);\n</script>\n\n<template>\n <select\n :id=\"id || name\"\n :name=\"name\"\n :value=\"internal\"\n :disabled=\"disabled\"\n :required=\"required\"\n class=\"vd-input\"\n @change=\"\n (e) => {\n const v = (e.target as HTMLSelectElement).value;\n internal = v;\n emit('update:modelValue', v);\n }\n \"\n >\n <option v-if=\"placeholder\" value=\"\" disabled>\n {{ placeholder }}\n </option>\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <span class=\"vd-visually-hidden\">{{ currentLabel }}</span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly SelectOption[];\n name?: string;\n id?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n name: \"\",\n id: \"\",\n placeholder: \"\",\n disabled: false,\n required: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst internal = ref(props.modelValue);\n\nwatch(\n () => props.modelValue,\n (v) => {\n internal.value = v;\n },\n);\n\nconst currentLabel = computed(\n () => props.options.find((o) => o.value === internal.value)?.label ?? \"\",\n);\n</script>\n\n<template>\n <select\n :id=\"id || name\"\n :name=\"name\"\n :value=\"internal\"\n :disabled=\"disabled\"\n :required=\"required\"\n class=\"vd-input\"\n @change=\"\n (e) => {\n const v = (e.target as HTMLSelectElement).value;\n internal = v;\n emit('update:modelValue', v);\n }\n \"\n >\n <option v-if=\"placeholder\" value=\"\" disabled>\n {{ placeholder }}\n </option>\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <span class=\"vd-visually-hidden\">{{ currentLabel }}</span>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"left\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-sidenav\"\n :class=\"[`vd-sidenav-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Side navigation'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-sidenav-footer\">\n <slot name=\"footer\" />\n </footer>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"left\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-sidenav\"\n :class=\"[`vd-sidenav-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Side navigation'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-sidenav-footer\">\n <slot name=\"footer\" />\n </footer>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\ntype Shape = \"text\" | \"circle\" | \"rect\" | \"card\" | \"button\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ninterface Props {\n shape?: Shape;\n size?: Size;\n width?: string;\n lines?: number;\n}\n\nwithDefaults(defineProps<Props>(), {\n shape: \"text\",\n size: \"md\",\n width: \"\",\n lines: 1,\n});\n</script>\n\n<template>\n <div\n v-if=\"shape === 'card'\"\n class=\"vd-skeleton-card\"\n :class=\"`vd-skeleton-card-${size}`\"\n >\n <div class=\"vd-skeleton vd-skeleton-card-header\" />\n <div class=\"vd-skeleton-card-body\">\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text vd-skeleton-text-short\" />\n </div>\n </div>\n <div\n v-else-if=\"shape === 'button'\"\n class=\"vd-skeleton vd-skeleton-button\"\n :class=\"`vd-skeleton-button-${size}`\"\n />\n <div\n v-else-if=\"shape === 'circle'\"\n class=\"vd-skeleton vd-skeleton-circle\"\n :class=\"`vd-skeleton-circle-${size}`\"\n />\n <div v-else-if=\"lines > 1\" class=\"vd-skeleton-lines\">\n <div\n v-for=\"n in lines\"\n :key=\"n\"\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"n === lines ? 'vd-skeleton-text-short' : ''\"\n />\n </div>\n <div\n v-else\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"`vd-skeleton-text-${size}`\"\n :style=\"width ? `width: ${width}` : ''\"\n />\n</template>\n","<script setup lang=\"ts\">\ntype Shape = \"text\" | \"circle\" | \"rect\" | \"card\" | \"button\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ninterface Props {\n shape?: Shape;\n size?: Size;\n width?: string;\n lines?: number;\n}\n\nwithDefaults(defineProps<Props>(), {\n shape: \"text\",\n size: \"md\",\n width: \"\",\n lines: 1,\n});\n</script>\n\n<template>\n <div\n v-if=\"shape === 'card'\"\n class=\"vd-skeleton-card\"\n :class=\"`vd-skeleton-card-${size}`\"\n >\n <div class=\"vd-skeleton vd-skeleton-card-header\" />\n <div class=\"vd-skeleton-card-body\">\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text vd-skeleton-text-short\" />\n </div>\n </div>\n <div\n v-else-if=\"shape === 'button'\"\n class=\"vd-skeleton vd-skeleton-button\"\n :class=\"`vd-skeleton-button-${size}`\"\n />\n <div\n v-else-if=\"shape === 'circle'\"\n class=\"vd-skeleton vd-skeleton-circle\"\n :class=\"`vd-skeleton-circle-${size}`\"\n />\n <div v-else-if=\"lines > 1\" class=\"vd-skeleton-lines\">\n <div\n v-for=\"n in lines\"\n :key=\"n\"\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"n === lines ? 'vd-skeleton-text-short' : ''\"\n />\n </div>\n <div\n v-else\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"`vd-skeleton-text-${size}`\"\n :style=\"width ? `width: ${width}` : ''\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n label?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n label: \"\",\n});\n</script>\n\n<template>\n <span\n :class=\"['vd-spinner', `vd-spinner-${size}`]\"\n role=\"status\"\n :aria-label=\"label || 'Loading'\"\n >\n <VdIcon name=\"circle-notch\" />\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n label?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n label: \"\",\n});\n</script>\n\n<template>\n <span\n :class=\"['vd-spinner', `vd-spinner-${size}`]\"\n role=\"status\"\n :aria-label=\"label || 'Loading'\"\n >\n <VdIcon name=\"circle-notch\" />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Column {\n key: string;\n label: string;\n variant?: Variant;\n}\n\ninterface Props {\n columns: readonly Column[];\n rows: readonly Record<string, string | number>[];\n striped?: boolean;\n bordered?: boolean;\n hover?: boolean;\n caption?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n striped: false,\n bordered: false,\n hover: false,\n caption: \"\",\n});\n</script>\n\n<template>\n <div class=\"vd-table-responsive\">\n <table\n class=\"vd-table\"\n :class=\"{\n 'vd-table-striped': striped,\n 'vd-table-bordered': bordered,\n 'vd-table-hover': hover,\n }\"\n >\n <caption v-if=\"caption\" class=\"vd-table-caption\">\n {{\n caption\n }}\n </caption>\n <thead class=\"vd-table-header\">\n <tr>\n <th v-for=\"col in columns\" :key=\"col.key\" scope=\"col\">\n {{ col.label }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, rowIdx) in rows\" :key=\"rowIdx\">\n <td v-for=\"col in columns\" :key=\"col.key\">\n {{ row[col.key] }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Column {\n key: string;\n label: string;\n variant?: Variant;\n}\n\ninterface Props {\n columns: readonly Column[];\n rows: readonly Record<string, string | number>[];\n striped?: boolean;\n bordered?: boolean;\n hover?: boolean;\n caption?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n striped: false,\n bordered: false,\n hover: false,\n caption: \"\",\n});\n</script>\n\n<template>\n <div class=\"vd-table-responsive\">\n <table\n class=\"vd-table\"\n :class=\"{\n 'vd-table-striped': striped,\n 'vd-table-bordered': bordered,\n 'vd-table-hover': hover,\n }\"\n >\n <caption v-if=\"caption\" class=\"vd-table-caption\">\n {{\n caption\n }}\n </caption>\n <thead class=\"vd-table-header\">\n <tr>\n <th v-for=\"col in columns\" :key=\"col.key\" scope=\"col\">\n {{ col.label }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, rowIdx) in rows\" :key=\"rowIdx\">\n <td v-for=\"col in columns\" :key=\"col.key\">\n {{ row[col.key] }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Tab {\n id: string;\n label: string;\n}\n\ninterface Props {\n tabs: Tab[];\n modelValue: string;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst select = (id: string): void => {\n if (id !== props.modelValue) emit(\"update:modelValue\", id);\n};\n</script>\n\n<template>\n <div class=\"vd-tabs\" role=\"tablist\">\n <div class=\"vd-tab-list\" role=\"presentation\">\n <button\n v-for=\"tab in tabs\"\n :key=\"tab.id\"\n type=\"button\"\n role=\"tab\"\n :aria-selected=\"tab.id === modelValue\"\n :class=\"['vd-tab', tab.id === modelValue ? 'is-active' : null]\"\n @click=\"select(tab.id)\"\n >\n {{ tab.label }}\n </button>\n </div>\n <div class=\"vd-tab-panels\">\n <slot />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Tab {\n id: string;\n label: string;\n}\n\ninterface Props {\n tabs: Tab[];\n modelValue: string;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst select = (id: string): void => {\n if (id !== props.modelValue) emit(\"update:modelValue\", id);\n};\n</script>\n\n<template>\n <div class=\"vd-tabs\" role=\"tablist\">\n <div class=\"vd-tab-list\" role=\"presentation\">\n <button\n v-for=\"tab in tabs\"\n :key=\"tab.id\"\n type=\"button\"\n role=\"tab\"\n :aria-selected=\"tab.id === modelValue\"\n :class=\"['vd-tab', tab.id === modelValue ? 'is-active' : null]\"\n @click=\"select(tab.id)\"\n >\n {{ tab.label }}\n </button>\n </div>\n <div class=\"vd-tab-panels\">\n <slot />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref } from \"vue\";\nimport type { ToastEntry, ToastType } from \"../composables/useToast\";\n\nconst props = defineProps<{ toast: ToastEntry }>();\nconst emit = defineEmits<{ dismiss: [id: string] }>();\n\n/** Default type icons, copied verbatim from `Toast.getDefaultIcon()`. */\nconst ICONS: Record<ToastType, string> = {\n success:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"></path><polyline points=\"22 4 12 14.01 9 11.01\"></polyline></svg>',\n error:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>',\n warning:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>',\n info: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line></svg>',\n};\n\nconst visible = ref(false);\nconst exiting = ref(false);\nconst progressPaused = ref(false);\n\nlet timeoutId: number | null = null;\nlet fallbackId: number | null = null;\nlet startTime = 0;\nlet remaining = props.toast.duration;\n\nconst clearTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n }\n};\n\nconst startTimer = (): void => {\n progressPaused.value = false;\n if (props.toast.duration > 0 && typeof window !== \"undefined\") {\n startTime = Date.now();\n timeoutId = window.setTimeout(beginDismiss, remaining);\n }\n};\n\nconst pauseTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n remaining -= Date.now() - startTime;\n progressPaused.value = true;\n }\n};\n\nconst beginDismiss = (): void => {\n if (exiting.value) return;\n clearTimer();\n visible.value = false;\n exiting.value = true;\n // Fallback removal if the transition never fires (matches framework).\n fallbackId = window.setTimeout(() => emit(\"dismiss\", props.toast.id), 400);\n};\n\nconst onTransitionEnd = (): void => {\n if (exiting.value) emit(\"dismiss\", props.toast.id);\n};\n\nonMounted(() => {\n // Enter on the next frame so the `.is-visible` transition runs.\n requestAnimationFrame(() => {\n visible.value = true;\n startTimer();\n });\n});\n\nonBeforeUnmount(() => {\n clearTimer();\n if (fallbackId != null) window.clearTimeout(fallbackId);\n});\n</script>\n\n<template>\n <div\n :class=\"[\n 'vd-toast',\n toast.type ? `vd-toast-${toast.type}` : null,\n toast.solid ? 'vd-toast-solid' : null,\n toast.showProgress && toast.duration > 0\n ? 'vd-toast-with-progress'\n : null,\n { 'is-visible': visible, 'is-exiting': exiting },\n ]\"\n role=\"status\"\n aria-live=\"polite\"\n @mouseenter=\"pauseTimer\"\n @mouseleave=\"startTimer\"\n @transitionend=\"onTransitionEnd\"\n >\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-if=\"toast.type\" class=\"vd-toast-icon\" v-html=\"ICONS[toast.type]\" />\n <div class=\"vd-toast-content\">\n <div v-if=\"toast.title\" class=\"vd-toast-title\">{{ toast.title }}</div>\n <div class=\"vd-toast-message\">{{ toast.message }}</div>\n </div>\n <button\n v-if=\"toast.dismissible\"\n type=\"button\"\n class=\"vd-toast-close\"\n aria-label=\"Close\"\n @click=\"beginDismiss\"\n />\n <div\n v-if=\"toast.showProgress && toast.duration > 0\"\n class=\"vd-toast-progress\"\n :style=\"{\n animationDuration: `${toast.duration}ms`,\n animationPlayState: progressPaused ? 'paused' : 'running',\n }\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref } from \"vue\";\nimport type { ToastEntry, ToastType } from \"../composables/useToast\";\n\nconst props = defineProps<{ toast: ToastEntry }>();\nconst emit = defineEmits<{ dismiss: [id: string] }>();\n\n/** Default type icons, copied verbatim from `Toast.getDefaultIcon()`. */\nconst ICONS: Record<ToastType, string> = {\n success:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"></path><polyline points=\"22 4 12 14.01 9 11.01\"></polyline></svg>',\n error:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>',\n warning:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>',\n info: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line></svg>',\n};\n\nconst visible = ref(false);\nconst exiting = ref(false);\nconst progressPaused = ref(false);\n\nlet timeoutId: number | null = null;\nlet fallbackId: number | null = null;\nlet startTime = 0;\nlet remaining = props.toast.duration;\n\nconst clearTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n }\n};\n\nconst startTimer = (): void => {\n progressPaused.value = false;\n if (props.toast.duration > 0 && typeof window !== \"undefined\") {\n startTime = Date.now();\n timeoutId = window.setTimeout(beginDismiss, remaining);\n }\n};\n\nconst pauseTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n remaining -= Date.now() - startTime;\n progressPaused.value = true;\n }\n};\n\nconst beginDismiss = (): void => {\n if (exiting.value) return;\n clearTimer();\n visible.value = false;\n exiting.value = true;\n // Fallback removal if the transition never fires (matches framework).\n fallbackId = window.setTimeout(() => emit(\"dismiss\", props.toast.id), 400);\n};\n\nconst onTransitionEnd = (): void => {\n if (exiting.value) emit(\"dismiss\", props.toast.id);\n};\n\nonMounted(() => {\n // Enter on the next frame so the `.is-visible` transition runs.\n requestAnimationFrame(() => {\n visible.value = true;\n startTimer();\n });\n});\n\nonBeforeUnmount(() => {\n clearTimer();\n if (fallbackId != null) window.clearTimeout(fallbackId);\n});\n</script>\n\n<template>\n <div\n :class=\"[\n 'vd-toast',\n toast.type ? `vd-toast-${toast.type}` : null,\n toast.solid ? 'vd-toast-solid' : null,\n toast.showProgress && toast.duration > 0\n ? 'vd-toast-with-progress'\n : null,\n { 'is-visible': visible, 'is-exiting': exiting },\n ]\"\n role=\"status\"\n aria-live=\"polite\"\n @mouseenter=\"pauseTimer\"\n @mouseleave=\"startTimer\"\n @transitionend=\"onTransitionEnd\"\n >\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-if=\"toast.type\" class=\"vd-toast-icon\" v-html=\"ICONS[toast.type]\" />\n <div class=\"vd-toast-content\">\n <div v-if=\"toast.title\" class=\"vd-toast-title\">{{ toast.title }}</div>\n <div class=\"vd-toast-message\">{{ toast.message }}</div>\n </div>\n <button\n v-if=\"toast.dismissible\"\n type=\"button\"\n class=\"vd-toast-close\"\n aria-label=\"Close\"\n @click=\"beginDismiss\"\n />\n <div\n v-if=\"toast.showProgress && toast.duration > 0\"\n class=\"vd-toast-progress\"\n :style=\"{\n animationDuration: `${toast.duration}ms`,\n animationPlayState: progressPaused ? 'paused' : 'running',\n }\"\n />\n </div>\n</template>\n","import { ref } from \"vue\";\nimport { defineStore } from \"pinia\";\n\nexport type ToastType = \"success\" | \"error\" | \"warning\" | \"info\";\n\nexport type ToastPosition =\n | \"top-right\"\n | \"top-left\"\n | \"top-center\"\n | \"bottom-right\"\n | \"bottom-left\"\n | \"bottom-center\";\n\nexport interface ToastEntry {\n id: string;\n message: string;\n title?: string;\n type?: ToastType;\n duration: number;\n position: ToastPosition;\n dismissible: boolean;\n showProgress: boolean;\n solid: boolean;\n}\n\nexport interface ToastOptions {\n message?: string;\n title?: string;\n type?: ToastType;\n duration?: number;\n position?: ToastPosition;\n dismissible?: boolean;\n showProgress?: boolean;\n solid?: boolean;\n}\n\n/** Mirrors `Toast.defaults` in `framework/js/components/toast.js`. */\nconst DEFAULTS = {\n duration: 5000,\n position: \"top-right\" as ToastPosition,\n dismissible: true,\n showProgress: true,\n solid: false,\n};\n\nlet counter = 0;\nconst nextId = (): string => {\n counter += 1;\n return `toast-${Date.now().toString(36)}-${counter}`;\n};\n\nexport const useToastStore = defineStore(\"toast\", () => {\n const queue = ref<ToastEntry[]>([]);\n\n /**\n * Reproduces `Toast.show()` — supports the framework's flexible signature:\n * `show('msg')`, `show('msg', 'success', 3000)`, `show('msg', { … })`,\n * and `show({ message, type, … })`.\n */\n const show = (\n options: ToastOptions | string,\n type?: ToastType | ToastOptions,\n duration?: number,\n ): string => {\n let opts: ToastOptions;\n if (typeof options === \"string\") {\n if (type && typeof type === \"object\") {\n opts = { ...type, message: options };\n } else {\n opts = {\n message: options,\n type: type as ToastType | undefined,\n duration,\n };\n }\n } else {\n opts = { ...options };\n }\n\n const id = nextId();\n const entry: ToastEntry = {\n id,\n message: opts.message ?? \"\",\n title: opts.title,\n type: opts.type,\n duration: opts.duration ?? DEFAULTS.duration,\n position: opts.position ?? DEFAULTS.position,\n dismissible: opts.dismissible ?? DEFAULTS.dismissible,\n showProgress: opts.showProgress ?? DEFAULTS.showProgress,\n solid: opts.solid ?? DEFAULTS.solid,\n };\n queue.value.push(entry);\n return id;\n };\n\n const dismiss = (id: string): void => {\n queue.value = queue.value.filter((t) => t.id !== id);\n };\n\n const success = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"success\" });\n const error = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"error\" });\n const warning = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"warning\" });\n const info = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"info\" });\n\n return { queue, show, dismiss, success, error, warning, info };\n});\n\nexport const useToast = () => {\n const store = useToastStore();\n return {\n show: store.show,\n dismiss: store.dismiss,\n success: store.success,\n error: store.error,\n warning: store.warning,\n info: store.info,\n queue: store.queue,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useToastStore, type ToastPosition } from \"../composables/useToast\";\nimport VdToast from \"./VdToast.vue\";\n\nconst store = useToastStore();\n\nconst POSITIONS: ToastPosition[] = [\n \"top-right\",\n \"top-left\",\n \"top-center\",\n \"bottom-right\",\n \"bottom-left\",\n \"bottom-center\",\n];\n\n// One `.vd-toast-container` per position that currently has toasts, mirroring\n// `Toast.getContainer()` which lazily creates a positioned container per group.\nconst groups = computed(() =>\n POSITIONS.map((position) => ({\n position,\n toasts: store.queue.filter((t) => t.position === position),\n })).filter((group) => group.toasts.length > 0),\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-for=\"group in groups\"\n :key=\"group.position\"\n :class=\"['vd-toast-container', `vd-toast-container-${group.position}`]\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"false\"\n >\n <VdToast\n v-for=\"toast in group.toasts\"\n :key=\"toast.id\"\n :toast=\"toast\"\n @dismiss=\"store.dismiss\"\n />\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useToastStore, type ToastPosition } from \"../composables/useToast\";\nimport VdToast from \"./VdToast.vue\";\n\nconst store = useToastStore();\n\nconst POSITIONS: ToastPosition[] = [\n \"top-right\",\n \"top-left\",\n \"top-center\",\n \"bottom-right\",\n \"bottom-left\",\n \"bottom-center\",\n];\n\n// One `.vd-toast-container` per position that currently has toasts, mirroring\n// `Toast.getContainer()` which lazily creates a positioned container per group.\nconst groups = computed(() =>\n POSITIONS.map((position) => ({\n position,\n toasts: store.queue.filter((t) => t.position === position),\n })).filter((group) => group.toasts.length > 0),\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-for=\"group in groups\"\n :key=\"group.position\"\n :class=\"['vd-toast-container', `vd-toast-container-${group.position}`]\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"false\"\n >\n <VdToast\n v-for=\"toast in group.toasts\"\n :key=\"toast.id\"\n :toast=\"toast\"\n @dismiss=\"store.dismiss\"\n />\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\ntype Position = \"top\" | \"bottom\" | \"left\" | \"right\";\n\ninterface Props {\n text: string;\n position?: Position;\n}\n\nwithDefaults(defineProps<Props>(), {\n position: \"top\",\n});\n</script>\n\n<template>\n <span\n class=\"vd-tooltip\"\n :data-tooltip-position=\"position\"\n :data-tooltip=\"text\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Position = \"top\" | \"bottom\" | \"left\" | \"right\";\n\ninterface Props {\n text: string;\n position?: Position;\n}\n\nwithDefaults(defineProps<Props>(), {\n position: \"top\",\n});\n</script>\n\n<template>\n <span\n class=\"vd-tooltip\"\n :data-tooltip-position=\"position\"\n :data-tooltip=\"text\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/transfer.js — a dual-list\n * picker generated from a `data-vd-transfer` JSON array. Reproduces the\n * framework's generated DOM (`.vd-transfer` → panels + actions), per-panel\n * search, checkbox selection, and the move buttons. Dispatches a native\n * `transfer:change` CustomEvent so the documented\n * `el.addEventListener('transfer:change', ...)` API works.\n *\n * Two fixes-to-documented-intent vs the Vanilla JS:\n * - items use `.is-selected` (what transfer.css actually styles); the docs API\n * table's `.is-checked` is a stale typo.\n * - the event detail is `{ selected, available }` (the documented shape used by\n * the demo snippet's `e.detail.selected`); the Vanilla JS fired the wrong\n * `{ source, target }`, so the documented `e.detail.selected` was undefined.\n */\ninterface TransferItem {\n id: string;\n label: string;\n}\n\nconst props = defineProps<{ items: TransferItem[] }>();\n\nconst root = ref<HTMLElement | null>(null);\nconst sourceData = ref<TransferItem[]>(props.items.map((i) => ({ ...i })));\nconst targetData = ref<TransferItem[]>([]);\nconst sourceSelected = ref<Set<string>>(new Set());\nconst targetSelected = ref<Set<string>>(new Set());\nconst sourceFilter = ref(\"\");\nconst targetFilter = ref(\"\");\n\nconst filterItems = (data: TransferItem[], filter: string): TransferItem[] => {\n if (!filter) return data;\n const f = filter.toLowerCase();\n return data.filter((d) => d.label.toLowerCase().includes(f));\n};\n\nconst filteredSource = computed(() =>\n filterItems(sourceData.value, sourceFilter.value),\n);\nconst filteredTarget = computed(() =>\n filterItems(targetData.value, targetFilter.value),\n);\n\nconst toggle = (which: \"source\" | \"target\", id: string): void => {\n const sel = which === \"source\" ? sourceSelected : targetSelected;\n const next = new Set(sel.value);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n sel.value = next;\n};\n\nconst fireChange = (): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"transfer:change\", {\n bubbles: true,\n detail: {\n selected: targetData.value.map((d) => d.id),\n available: sourceData.value.map((d) => d.id),\n },\n }),\n );\n};\n\nconst moveRight = (): void => {\n if (sourceSelected.value.size === 0) return;\n const move = sourceData.value.filter((d) => sourceSelected.value.has(d.id));\n sourceData.value = sourceData.value.filter(\n (d) => !sourceSelected.value.has(d.id),\n );\n targetData.value = [...targetData.value, ...move];\n sourceSelected.value = new Set();\n fireChange();\n};\n\nconst moveLeft = (): void => {\n if (targetSelected.value.size === 0) return;\n const move = targetData.value.filter((d) => targetSelected.value.has(d.id));\n targetData.value = targetData.value.filter(\n (d) => !targetSelected.value.has(d.id),\n );\n sourceData.value = [...sourceData.value, ...move];\n targetSelected.value = new Set();\n fireChange();\n};\n\ndefineExpose({\n getSelected: () => targetData.value.map((d) => d.id),\n});\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-transfer\">\n <!-- Source panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Source</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ sourceSelected.size }}/{{ sourceData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"sourceFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search source\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredSource\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': sourceSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"sourceSelected.has(item.id)\"\n @click=\"toggle('source', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"sourceSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n\n <!-- Actions -->\n <div class=\"vd-transfer-actions\">\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to target\"\n :disabled=\"sourceSelected.size === 0\"\n @click=\"moveRight\"\n >\n ›\n </button>\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to source\"\n :disabled=\"targetSelected.size === 0\"\n @click=\"moveLeft\"\n >\n ‹\n </button>\n </div>\n\n <!-- Target panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Target</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ targetSelected.size }}/{{ targetData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"targetFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search target\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredTarget\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': targetSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"targetSelected.has(item.id)\"\n @click=\"toggle('target', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"targetSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/transfer.js — a dual-list\n * picker generated from a `data-vd-transfer` JSON array. Reproduces the\n * framework's generated DOM (`.vd-transfer` → panels + actions), per-panel\n * search, checkbox selection, and the move buttons. Dispatches a native\n * `transfer:change` CustomEvent so the documented\n * `el.addEventListener('transfer:change', ...)` API works.\n *\n * Two fixes-to-documented-intent vs the Vanilla JS:\n * - items use `.is-selected` (what transfer.css actually styles); the docs API\n * table's `.is-checked` is a stale typo.\n * - the event detail is `{ selected, available }` (the documented shape used by\n * the demo snippet's `e.detail.selected`); the Vanilla JS fired the wrong\n * `{ source, target }`, so the documented `e.detail.selected` was undefined.\n */\ninterface TransferItem {\n id: string;\n label: string;\n}\n\nconst props = defineProps<{ items: TransferItem[] }>();\n\nconst root = ref<HTMLElement | null>(null);\nconst sourceData = ref<TransferItem[]>(props.items.map((i) => ({ ...i })));\nconst targetData = ref<TransferItem[]>([]);\nconst sourceSelected = ref<Set<string>>(new Set());\nconst targetSelected = ref<Set<string>>(new Set());\nconst sourceFilter = ref(\"\");\nconst targetFilter = ref(\"\");\n\nconst filterItems = (data: TransferItem[], filter: string): TransferItem[] => {\n if (!filter) return data;\n const f = filter.toLowerCase();\n return data.filter((d) => d.label.toLowerCase().includes(f));\n};\n\nconst filteredSource = computed(() =>\n filterItems(sourceData.value, sourceFilter.value),\n);\nconst filteredTarget = computed(() =>\n filterItems(targetData.value, targetFilter.value),\n);\n\nconst toggle = (which: \"source\" | \"target\", id: string): void => {\n const sel = which === \"source\" ? sourceSelected : targetSelected;\n const next = new Set(sel.value);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n sel.value = next;\n};\n\nconst fireChange = (): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"transfer:change\", {\n bubbles: true,\n detail: {\n selected: targetData.value.map((d) => d.id),\n available: sourceData.value.map((d) => d.id),\n },\n }),\n );\n};\n\nconst moveRight = (): void => {\n if (sourceSelected.value.size === 0) return;\n const move = sourceData.value.filter((d) => sourceSelected.value.has(d.id));\n sourceData.value = sourceData.value.filter(\n (d) => !sourceSelected.value.has(d.id),\n );\n targetData.value = [...targetData.value, ...move];\n sourceSelected.value = new Set();\n fireChange();\n};\n\nconst moveLeft = (): void => {\n if (targetSelected.value.size === 0) return;\n const move = targetData.value.filter((d) => targetSelected.value.has(d.id));\n targetData.value = targetData.value.filter(\n (d) => !targetSelected.value.has(d.id),\n );\n sourceData.value = [...sourceData.value, ...move];\n targetSelected.value = new Set();\n fireChange();\n};\n\ndefineExpose({\n getSelected: () => targetData.value.map((d) => d.id),\n});\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-transfer\">\n <!-- Source panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Source</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ sourceSelected.size }}/{{ sourceData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"sourceFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search source\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredSource\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': sourceSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"sourceSelected.has(item.id)\"\n @click=\"toggle('source', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"sourceSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n\n <!-- Actions -->\n <div class=\"vd-transfer-actions\">\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to target\"\n :disabled=\"sourceSelected.size === 0\"\n @click=\"moveRight\"\n >\n ›\n </button>\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to source\"\n :disabled=\"targetSelected.size === 0\"\n @click=\"moveLeft\"\n >\n ‹\n </button>\n </div>\n\n <!-- Target panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Target</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ targetSelected.size }}/{{ targetData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"targetFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search target\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredTarget\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': targetSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"targetSelected.has(item.id)\"\n @click=\"toggle('target', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"targetSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\n/** A single recursive tree node — see VdTree.vue for the data model and events. */\nexport interface TreeNode {\n id?: string;\n label?: string;\n icon?: string;\n open?: boolean;\n checked?: boolean;\n children?: TreeNode[];\n}\n\nconst props = defineProps<{ node: TreeNode; checkbox: boolean }>();\nconst emit = defineEmits<{\n (e: \"toggle\", node: TreeNode): void;\n (e: \"check\", node: TreeNode, checked: boolean): void;\n}>();\n\nconst hasChildren = computed(\n () => !!props.node.children && props.node.children.length > 0,\n);\n\nconst onToggle = (): void => {\n // The tree mutates its shared, reactive node model in place by design — the\n // parent VdTree owns the node objects and reacts to the change.\n // eslint-disable-next-line vue/no-mutating-props\n props.node.open = !props.node.open;\n emit(\"toggle\", props.node);\n};\n\nconst onCheck = (e: Event): void => {\n emit(\"check\", props.node, (e.target as HTMLInputElement).checked);\n};\n</script>\n\n<template>\n <li\n class=\"vd-tree-node\"\n role=\"treeitem\"\n :class=\"{ 'is-open': node.open }\"\n :aria-expanded=\"hasChildren ? (node.open ? 'true' : 'false') : undefined\"\n >\n <div class=\"vd-tree-node-content\">\n <button\n v-if=\"hasChildren\"\n type=\"button\"\n class=\"vd-tree-toggle\"\n aria-label=\"Toggle\"\n @click.stop=\"onToggle\"\n ></button>\n <span v-else class=\"vd-tree-toggle-placeholder\"></span>\n\n <input\n v-if=\"checkbox\"\n type=\"checkbox\"\n class=\"vd-tree-checkbox\"\n :checked=\"node.checked\"\n :aria-label=\"node.label\"\n @change.stop=\"onCheck\"\n @click.stop\n />\n\n <span v-if=\"node.icon\" class=\"vd-tree-icon\" :class=\"node.icon\"></span>\n <span class=\"vd-tree-label\" tabindex=\"-1\">{{ node.label }}</span>\n </div>\n\n <ul v-if=\"hasChildren\" class=\"vd-tree-children\" role=\"group\">\n <VdTreeNode\n v-for=\"(child, i) in node.children\"\n :key=\"child.id ?? i\"\n :node=\"child\"\n :checkbox=\"checkbox\"\n @toggle=\"(n) => emit('toggle', n)\"\n @check=\"(n, c) => emit('check', n, c)\"\n />\n </ul>\n </li>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\n/** A single recursive tree node — see VdTree.vue for the data model and events. */\nexport interface TreeNode {\n id?: string;\n label?: string;\n icon?: string;\n open?: boolean;\n checked?: boolean;\n children?: TreeNode[];\n}\n\nconst props = defineProps<{ node: TreeNode; checkbox: boolean }>();\nconst emit = defineEmits<{\n (e: \"toggle\", node: TreeNode): void;\n (e: \"check\", node: TreeNode, checked: boolean): void;\n}>();\n\nconst hasChildren = computed(\n () => !!props.node.children && props.node.children.length > 0,\n);\n\nconst onToggle = (): void => {\n // The tree mutates its shared, reactive node model in place by design — the\n // parent VdTree owns the node objects and reacts to the change.\n // eslint-disable-next-line vue/no-mutating-props\n props.node.open = !props.node.open;\n emit(\"toggle\", props.node);\n};\n\nconst onCheck = (e: Event): void => {\n emit(\"check\", props.node, (e.target as HTMLInputElement).checked);\n};\n</script>\n\n<template>\n <li\n class=\"vd-tree-node\"\n role=\"treeitem\"\n :class=\"{ 'is-open': node.open }\"\n :aria-expanded=\"hasChildren ? (node.open ? 'true' : 'false') : undefined\"\n >\n <div class=\"vd-tree-node-content\">\n <button\n v-if=\"hasChildren\"\n type=\"button\"\n class=\"vd-tree-toggle\"\n aria-label=\"Toggle\"\n @click.stop=\"onToggle\"\n ></button>\n <span v-else class=\"vd-tree-toggle-placeholder\"></span>\n\n <input\n v-if=\"checkbox\"\n type=\"checkbox\"\n class=\"vd-tree-checkbox\"\n :checked=\"node.checked\"\n :aria-label=\"node.label\"\n @change.stop=\"onCheck\"\n @click.stop\n />\n\n <span v-if=\"node.icon\" class=\"vd-tree-icon\" :class=\"node.icon\"></span>\n <span class=\"vd-tree-label\" tabindex=\"-1\">{{ node.label }}</span>\n </div>\n\n <ul v-if=\"hasChildren\" class=\"vd-tree-children\" role=\"group\">\n <VdTreeNode\n v-for=\"(child, i) in node.children\"\n :key=\"child.id ?? i\"\n :node=\"child\"\n :checkbox=\"checkbox\"\n @toggle=\"(n) => emit('toggle', n)\"\n @check=\"(n, c) => emit('check', n, c)\"\n />\n </ul>\n </li>\n</template>\n","<script setup lang=\"ts\">\nimport { reactive, ref } from \"vue\";\nimport VdTreeNode, { type TreeNode } from \"./VdTreeNode.vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/tree.js — renders\n * hierarchical `data-vd-tree` JSON as an expand/collapse tree with optional\n * checkbox selection and parent→child cascade. Reproduces the framework's\n * generated DOM (`.vd-tree[role=tree]` → `.vd-tree-node` → `.vd-tree-node-content`\n * → `.vd-tree-children`), `getChecked()`, and keyboard navigation.\n *\n * Fixes-to-documented-intent vs the Vanilla JS:\n * - fires `tree:toggle` with `{ id, open }` (listed in the docs API table but\n * never dispatched by the Vanilla JS) and `tree:check` with the documented\n * `{ checked: string[], node: string }` shape (Vanilla fired a single\n * `{ id, checked: boolean, label }`).\n * - Arrow Left/Right collapse/expand the focused branch (documented keyboard\n * support the Vanilla JS omitted; it only handled Up/Down).\n */\nconst props = defineProps<{\n nodes: TreeNode[];\n checkbox?: boolean;\n cascade?: boolean;\n}>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst clone = (nodes: TreeNode[]): TreeNode[] =>\n nodes.map((n) => ({\n ...n,\n children: n.children ? clone(n.children) : undefined,\n }));\n\nconst tree = reactive(clone(props.nodes));\n\nconst setChildChecked = (items: TreeNode[], checked: boolean): void => {\n items.forEach((item) => {\n item.checked = checked;\n if (item.children) setChildChecked(item.children, checked);\n });\n};\n\nconst collectChecked = (items: TreeNode[], acc: string[] = []): string[] => {\n items.forEach((i) => {\n if (i.checked) acc.push(i.id ?? i.label ?? \"\");\n if (i.children) collectChecked(i.children, acc);\n });\n return acc;\n};\n\nconst onCheck = (node: TreeNode, checked: boolean): void => {\n node.checked = checked;\n if ((props.cascade ?? true) && node.children) {\n setChildChecked(node.children, checked);\n }\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:check\", {\n bubbles: true,\n detail: { checked: collectChecked(tree), node: node.id },\n }),\n );\n};\n\nconst onToggle = (node: TreeNode): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:toggle\", {\n bubbles: true,\n detail: { id: node.id, open: !!node.open },\n }),\n );\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n const host = root.value;\n const active = document.activeElement;\n if (!host || !active || !host.contains(active)) return;\n const contents = Array.from(\n host.querySelectorAll<HTMLElement>(\".vd-tree-node-content\"),\n );\n const current = active.closest(\".vd-tree-node-content\") as HTMLElement | null;\n const idx = current ? contents.indexOf(current) : -1;\n if (idx === -1) return;\n\n const focusAt = (i: number): void => {\n contents[i]\n ?.querySelector<HTMLElement>(\".vd-tree-toggle, .vd-tree-label\")\n ?.focus();\n };\n\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (idx < contents.length - 1) focusAt(idx + 1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (idx > 0) focusAt(idx - 1);\n break;\n case \"ArrowRight\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && !node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n case \"ArrowLeft\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n }\n};\n\ndefineExpose({ getChecked: () => collectChecked(tree) });\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-tree\" role=\"tree\" @keydown=\"onKeydown\">\n <VdTreeNode\n v-for=\"(node, i) in tree\"\n :key=\"node.id ?? i\"\n :node=\"node\"\n :checkbox=\"!!checkbox\"\n @toggle=\"onToggle\"\n @check=\"onCheck\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { reactive, ref } from \"vue\";\nimport VdTreeNode, { type TreeNode } from \"./VdTreeNode.vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/tree.js — renders\n * hierarchical `data-vd-tree` JSON as an expand/collapse tree with optional\n * checkbox selection and parent→child cascade. Reproduces the framework's\n * generated DOM (`.vd-tree[role=tree]` → `.vd-tree-node` → `.vd-tree-node-content`\n * → `.vd-tree-children`), `getChecked()`, and keyboard navigation.\n *\n * Fixes-to-documented-intent vs the Vanilla JS:\n * - fires `tree:toggle` with `{ id, open }` (listed in the docs API table but\n * never dispatched by the Vanilla JS) and `tree:check` with the documented\n * `{ checked: string[], node: string }` shape (Vanilla fired a single\n * `{ id, checked: boolean, label }`).\n * - Arrow Left/Right collapse/expand the focused branch (documented keyboard\n * support the Vanilla JS omitted; it only handled Up/Down).\n */\nconst props = defineProps<{\n nodes: TreeNode[];\n checkbox?: boolean;\n cascade?: boolean;\n}>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst clone = (nodes: TreeNode[]): TreeNode[] =>\n nodes.map((n) => ({\n ...n,\n children: n.children ? clone(n.children) : undefined,\n }));\n\nconst tree = reactive(clone(props.nodes));\n\nconst setChildChecked = (items: TreeNode[], checked: boolean): void => {\n items.forEach((item) => {\n item.checked = checked;\n if (item.children) setChildChecked(item.children, checked);\n });\n};\n\nconst collectChecked = (items: TreeNode[], acc: string[] = []): string[] => {\n items.forEach((i) => {\n if (i.checked) acc.push(i.id ?? i.label ?? \"\");\n if (i.children) collectChecked(i.children, acc);\n });\n return acc;\n};\n\nconst onCheck = (node: TreeNode, checked: boolean): void => {\n node.checked = checked;\n if ((props.cascade ?? true) && node.children) {\n setChildChecked(node.children, checked);\n }\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:check\", {\n bubbles: true,\n detail: { checked: collectChecked(tree), node: node.id },\n }),\n );\n};\n\nconst onToggle = (node: TreeNode): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:toggle\", {\n bubbles: true,\n detail: { id: node.id, open: !!node.open },\n }),\n );\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n const host = root.value;\n const active = document.activeElement;\n if (!host || !active || !host.contains(active)) return;\n const contents = Array.from(\n host.querySelectorAll<HTMLElement>(\".vd-tree-node-content\"),\n );\n const current = active.closest(\".vd-tree-node-content\") as HTMLElement | null;\n const idx = current ? contents.indexOf(current) : -1;\n if (idx === -1) return;\n\n const focusAt = (i: number): void => {\n contents[i]\n ?.querySelector<HTMLElement>(\".vd-tree-toggle, .vd-tree-label\")\n ?.focus();\n };\n\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (idx < contents.length - 1) focusAt(idx + 1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (idx > 0) focusAt(idx - 1);\n break;\n case \"ArrowRight\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && !node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n case \"ArrowLeft\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n }\n};\n\ndefineExpose({ getChecked: () => collectChecked(tree) });\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-tree\" role=\"tree\" @keydown=\"onKeydown\">\n <VdTreeNode\n v-for=\"(node, i) in tree\"\n :key=\"node.id ?? i\"\n :node=\"node\"\n :checkbox=\"!!checkbox\"\n @toggle=\"onToggle\"\n @check=\"onCheck\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Fibonacci padding step (maps to `data-pad`). */\n pad?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", pad: \"fib-8\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-box\" :data-pad=\"pad\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Fibonacci padding step (maps to `data-pad`). */\n pad?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", pad: \"fib-8\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-box\" :data-pad=\"pad\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Max = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Axis = \"both\" | \"horizontal\" | \"vertical\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Max content width (maps to `data-max`). */\n max?: Max;\n /** Also center children along an axis (maps to `data-axis`). */\n axis?: Axis;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", max: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-center\" :data-max=\"max\" :data-axis=\"axis\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Max = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Axis = \"both\" | \"horizontal\" | \"vertical\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Max content width (maps to `data-max`). */\n max?: Max;\n /** Also center children along an axis (maps to `data-axis`). */\n axis?: Axis;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", max: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-center\" :data-max=\"max\" :data-axis=\"axis\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Min = \"screen\" | \"half\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Minimum height (maps to `data-min`). */\n min?: Min;\n /** Gap between centered children (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", min: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-cover\" :data-min=\"min\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Min = \"screen\" | \"half\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Minimum height (maps to `data-min`). */\n min?: Min;\n /** Gap between centered children (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", min: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-cover\" :data-min=\"min\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Ratio = \"golden\" | \"golden-portrait\" | \"square\" | \"16-9\" | \"4-3\" | \"3-2\";\n\ninterface Props {\n /** Aspect ratio (maps to `data-ratio`). */\n ratio?: Ratio;\n}\n\nwithDefaults(defineProps<Props>(), { ratio: \"golden\" });\n</script>\n\n<template>\n <div class=\"vd-frame\" :data-ratio=\"ratio\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Ratio = \"golden\" | \"golden-portrait\" | \"square\" | \"16-9\" | \"4-3\" | \"3-2\";\n\ninterface Props {\n /** Aspect ratio (maps to `data-ratio`). */\n ratio?: Ratio;\n}\n\nwithDefaults(defineProps<Props>(), { ratio: \"golden\" });\n</script>\n\n<template>\n <div class=\"vd-frame\" :data-ratio=\"ratio\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between wrapped inline items (maps to `data-gap`). */\n gap?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-inline\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between wrapped inline items (maps to `data-gap`). */\n gap?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-inline\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between stacked children (maps to `data-gap`). */\n gap?: Space;\n as?: \"div\" | \"section\" | \"ul\" | \"ol\";\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-8\", as: \"div\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-stack\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between stacked children (maps to `data-gap`). */\n gap?: Space;\n as?: \"div\" | \"section\" | \"ul\" | \"ol\";\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-8\", as: \"div\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-stack\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Threshold = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n /** Width below which children stack (maps to `data-threshold`). */\n threshold?: Threshold;\n /** Gap between items (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { threshold: \"fib-610\", gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-switcher\" :data-threshold=\"threshold\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Threshold = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n /** Width below which children stack (maps to `data-threshold`). */\n threshold?: Threshold;\n /** Gap between items (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { threshold: \"fib-610\", gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-switcher\" :data-threshold=\"threshold\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/affix.js — scans `root` for\n * `.vd-affix` / `.vd-sticky` / `[data-vd-affix]` elements, finds the nearest\n * scrollable parent, inserts a sentinel before each element, and toggles\n * `.is-stuck` via IntersectionObserver while the element is pinned. Falls back\n * to the viewport when there is no scrollable parent. Emits `affix:stuck` /\n * `affix:unstuck` with `{ offset, root }`.\n */\nfunction isScrollable(el: Element | null): boolean {\n if (!el || el === document.body) return false;\n const style = window.getComputedStyle(el);\n const canY =\n /(auto|scroll|overlay)/.test(style.overflowY) &&\n el.scrollHeight > el.clientHeight;\n const canX =\n /(auto|scroll|overlay)/.test(style.overflowX) &&\n el.scrollWidth > el.clientWidth;\n return canY || canX;\n}\n\nfunction getScrollParent(el: Element): Element | null {\n let parent = el.parentElement;\n while (\n parent &&\n parent !== document.body &&\n parent !== document.documentElement\n ) {\n if (isScrollable(parent)) return parent;\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function useAffix(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n const els = host.querySelectorAll<HTMLElement>(\n \".vd-affix, .vd-sticky, [data-vd-affix]\",\n );\n\n els.forEach((el) => {\n const parsed = parseInt(\n el.getAttribute(\"data-vd-affix-offset\") || \"0\",\n 10,\n );\n const offset = Number.isNaN(parsed) ? 0 : parsed;\n const scrollParent = getScrollParent(el);\n let isStuck = false;\n\n const sentinel = document.createElement(\"div\");\n sentinel.style.cssText =\n \"display:block;height:1px;margin-bottom:-1px;visibility:hidden;pointer-events:none;\";\n el.parentNode?.insertBefore(sentinel, el);\n el.style.setProperty(\"--vd-affix-top-offset\", offset + \"px\");\n\n const stick = (): void => {\n if (isStuck) return;\n isStuck = true;\n el.classList.add(\"is-stuck\");\n el.dispatchEvent(\n new CustomEvent(\"affix:stuck\", {\n bubbles: true,\n detail: { offset, root: scrollParent || window },\n }),\n );\n };\n\n const unstick = (): void => {\n if (!isStuck) return;\n isStuck = false;\n el.classList.remove(\"is-stuck\");\n el.dispatchEvent(\n new CustomEvent(\"affix:unstuck\", {\n bubbles: true,\n detail: { offset, root: scrollParent || window },\n }),\n );\n };\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) stick();\n else unstick();\n });\n },\n {\n root: scrollParent,\n rootMargin: \"-\" + offset + \"px 0px 0px 0px\",\n threshold: 0,\n },\n );\n observer.observe(sentinel);\n\n cleanups.push(\n () => observer.disconnect(),\n () => {\n if (sentinel.parentNode) sentinel.parentNode.removeChild(sentinel);\n },\n () => {\n el.classList.remove(\"is-stuck\");\n el.style.removeProperty(\"--vd-affix-top-offset\");\n },\n );\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/datepicker.js — scans `root` for\n * `[data-vd-datepicker]` inputs and attaches a calendar popup (appended to\n * `document.body`, position:fixed, anchored under the input). Supports custom\n * `YYYY/MM/DD` format tokens, min/max constraints, day → month → year (decade)\n * view switching, and full keyboard grid navigation. Fires `datepicker:select`\n * with `{ date, formatted }`.\n *\n * The page renders the `.vd-suggest-wrapper` around the input so no Vue-managed\n * node is relocated (the Vanilla JS created the wrapper itself).\n */\nconst DAYS = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\nconst MONTHS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst escapeRegexChar = (c: string): string =>\n c.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\nfunction buildParseFormat(format: string): { regex: RegExp; order: string[] } {\n let regex = \"^\";\n const order: string[] = [];\n let i = 0;\n while (i < format.length) {\n const slice = format.slice(i);\n if (slice.toLowerCase().startsWith(\"yyyy\")) {\n regex += \"(\\\\d{4})\";\n order.push(\"y\");\n i += 4;\n } else if (slice.toLowerCase().startsWith(\"mm\")) {\n regex += \"(\\\\d{2})\";\n order.push(\"m\");\n i += 2;\n } else if (slice.toLowerCase().startsWith(\"dd\")) {\n regex += \"(\\\\d{2})\";\n order.push(\"d\");\n i += 2;\n } else {\n regex += escapeRegexChar(format[i]);\n i++;\n }\n }\n regex += \"$\";\n return { regex: new RegExp(regex), order };\n}\n\nfunction parseDateFromFormat(value: string, format: string): Date | null {\n if (!value || !format) return null;\n const { regex, order } = buildParseFormat(format);\n const m = value.trim().match(regex);\n if (!m) return null;\n let y: number | undefined;\n let mo: number | undefined;\n let d: number | undefined;\n let ci = 1;\n for (const part of order) {\n const v = parseInt(m[ci++], 10);\n if (Number.isNaN(v)) return null;\n if (part === \"y\") y = v;\n else if (part === \"m\") mo = v - 1;\n else if (part === \"d\") d = v;\n }\n if (y === undefined || mo === undefined || d === undefined) return null;\n const dt = new Date(y, mo, d);\n if (dt.getFullYear() !== y || dt.getMonth() !== mo || dt.getDate() !== d)\n return null;\n return dt;\n}\n\nfunction formatDate(d: Date, format: string): string {\n const yyyy = String(d.getFullYear());\n const mm = String(d.getMonth() + 1).padStart(2, \"0\");\n const dd = String(d.getDate()).padStart(2, \"0\");\n let out = \"\";\n let i = 0;\n while (i < format.length) {\n const slice = format.slice(i);\n if (slice.toLowerCase().startsWith(\"yyyy\")) {\n out += yyyy;\n i += 4;\n } else if (slice.toLowerCase().startsWith(\"mm\")) {\n out += mm;\n i += 2;\n } else if (slice.toLowerCase().startsWith(\"dd\")) {\n out += dd;\n i += 2;\n } else {\n out += format[i];\n i++;\n }\n }\n return out;\n}\n\nconst dateKey = (d: Date): string =>\n d.getFullYear() +\n \"-\" +\n String(d.getMonth() + 1).padStart(2, \"0\") +\n \"-\" +\n String(d.getDate()).padStart(2, \"0\");\n\nfunction addDays(d: Date, n: number): Date {\n const x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n x.setDate(x.getDate() + n);\n return x;\n}\n\nconst addMonthsClamped = (d: Date, n: number): Date =>\n new Date(d.getFullYear(), d.getMonth() + n, d.getDate());\n\nfunction parseYmdLocal(ymd: string | null): Date | null {\n if (!ymd || typeof ymd !== \"string\") return null;\n const m = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(ymd.trim());\n if (!m) return null;\n const y = +m[1];\n const mo = +m[2] - 1;\n const day = +m[3];\n const dt = new Date(y, mo, day);\n if (dt.getFullYear() !== y || dt.getMonth() !== mo || dt.getDate() !== day)\n return null;\n return dt;\n}\n\nfunction startOfWeekSunday(d: Date): Date {\n const x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n x.setDate(x.getDate() - x.getDay());\n return x;\n}\n\nfunction endOfWeekSunday(d: Date): Date {\n const x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n x.setDate(x.getDate() + (6 - x.getDay()));\n return x;\n}\n\nfunction positionAnchoredPopup(\n anchor: HTMLElement,\n popup: HTMLElement,\n gap = 4,\n): void {\n const padding = 8;\n const rect = anchor.getBoundingClientRect();\n popup.style.minWidth = Math.max(rect.width, 0) + \"px\";\n\n let top = rect.bottom + gap;\n let left = rect.left;\n popup.style.top = top + \"px\";\n popup.style.left = left + \"px\";\n\n const popRect = popup.getBoundingClientRect();\n if (\n popRect.bottom > window.innerHeight - padding &&\n rect.top - popRect.height > padding\n ) {\n top = rect.top - popRect.height - gap;\n popup.style.top = top + \"px\";\n }\n\n const alignedRect = popup.getBoundingClientRect();\n left = rect.left;\n if (left + alignedRect.width > window.innerWidth - padding) {\n left = window.innerWidth - alignedRect.width - padding;\n }\n popup.style.left = Math.max(padding, left) + \"px\";\n}\n\nexport function useDatepicker(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n host\n .querySelectorAll<HTMLInputElement>(\"[data-vd-datepicker]\")\n .forEach((input) => initInstance(input, cleanups));\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n\nfunction initInstance(\n input: HTMLInputElement,\n cleanups: Array<() => void>,\n): void {\n const format =\n input.getAttribute(\"data-vd-datepicker-format\") || \"YYYY-MM-DD\";\n const minDate = parseYmdLocal(input.getAttribute(\"data-vd-datepicker-min\"));\n const maxDate = parseYmdLocal(input.getAttribute(\"data-vd-datepicker-max\"));\n\n const today = new Date();\n let viewYear = today.getFullYear();\n let viewMonth = today.getMonth();\n let selectedDate: Date | null = null;\n let viewMode: \"days\" | \"months\" | \"years\" = \"days\";\n let focusedDate: Date | null = null;\n let skipNextFocusOpen = false;\n let ignoreOutsideUntil = 0;\n\n const isDisabled = (d: Date): boolean => {\n const t = new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();\n if (minDate && t < minDate.getTime()) return true;\n if (maxDate && t > maxDate.getTime()) return true;\n return false;\n };\n\n const ensureMonthInRange = (\n y: number,\n m: number,\n ): { y: number; m: number } => {\n if (!minDate && !maxDate) return { y, m };\n const first = new Date(y, m, 1);\n const last = new Date(y, m + 1, 0);\n if (minDate && last.getTime() < minDate.getTime()) {\n return { y: minDate.getFullYear(), m: minDate.getMonth() };\n }\n if (maxDate && first.getTime() > maxDate.getTime()) {\n return { y: maxDate.getFullYear(), m: maxDate.getMonth() };\n }\n return { y, m };\n };\n\n const firstSelectableInMonth = (y: number, m: number): Date => {\n const last = new Date(y, m + 1, 0).getDate();\n for (let day = 1; day <= last; day++) {\n const dt = new Date(y, m, day);\n if (!isDisabled(dt)) return dt;\n }\n return new Date(y, m, 1);\n };\n\n if (input.value) {\n const trimmed = input.value.trim();\n let parsed = parseDateFromFormat(trimmed, format);\n if (!parsed) {\n const fallback = new Date(trimmed);\n if (!isNaN(fallback.getTime())) parsed = fallback;\n }\n if (parsed) {\n selectedDate = parsed;\n viewYear = parsed.getFullYear();\n viewMonth = parsed.getMonth();\n }\n }\n\n const clampedInit = ensureMonthInRange(viewYear, viewMonth);\n viewYear = clampedInit.y;\n viewMonth = clampedInit.m;\n\n const popup = document.createElement(\"div\");\n popup.className = \"vd-datepicker-popup\";\n popup.setAttribute(\"role\", \"dialog\");\n popup.setAttribute(\"aria-label\", \"Choose date\");\n popup.tabIndex = -1;\n\n let wrapper = input.closest(\".vd-suggest-wrapper\") as HTMLElement | null;\n if (!wrapper) {\n wrapper = document.createElement(\"div\");\n wrapper.className = \"vd-suggest-wrapper\";\n wrapper.style.position = \"relative\";\n wrapper.style.display = \"inline-block\";\n input.parentNode?.insertBefore(wrapper, input);\n wrapper.appendChild(input);\n }\n document.body.appendChild(popup);\n\n const isSameDay = (a: Date | null, b: Date | null): boolean =>\n !!a &&\n !!b &&\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate();\n\n const selectDate = (date: Date): void => {\n selectedDate = date;\n viewYear = date.getFullYear();\n viewMonth = date.getMonth();\n input.value = formatDate(date, format);\n skipNextFocusOpen = true;\n close();\n input.dispatchEvent(\n new CustomEvent(\"datepicker:select\", {\n bubbles: true,\n detail: { date, formatted: input.value },\n }),\n );\n input.dispatchEvent(new Event(\"change\", { bubbles: true }));\n input.focus();\n };\n\n const focusFocusedDay = (): void => {\n if (viewMode !== \"days\" || !focusedDate) return;\n const btn = popup.querySelector<HTMLElement>(\n '[data-vd-date=\"' + dateKey(focusedDate) + '\"]',\n );\n if (\n btn &&\n !btn.classList.contains(\"is-outside\") &&\n btn.getAttribute(\"aria-disabled\") !== \"true\"\n ) {\n btn.focus();\n }\n };\n\n const skipDisabled = (d: Date, stepDir: number, maxSteps: number): Date => {\n let x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n const step = stepDir > 0 ? 1 : -1;\n for (let i = 0; i < maxSteps; i++) {\n if (!isDisabled(x)) return x;\n x = addDays(x, step);\n }\n return d;\n };\n\n const createDayBtn = (\n day: number,\n outside: boolean,\n date: Date,\n ): HTMLButtonElement => {\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.className = \"vd-datepicker-day\";\n btn.textContent = String(day);\n btn.setAttribute(\"role\", \"gridcell\");\n\n if (outside) {\n btn.classList.add(\"is-outside\");\n btn.tabIndex = -1;\n btn.setAttribute(\"aria-disabled\", \"true\");\n return btn;\n }\n\n btn.setAttribute(\"data-vd-date\", dateKey(date));\n\n if (isSameDay(date, today)) btn.classList.add(\"is-today\");\n if (isSameDay(date, selectedDate)) btn.classList.add(\"is-selected\");\n if (isDisabled(date)) {\n btn.classList.add(\"is-disabled\");\n btn.setAttribute(\"aria-disabled\", \"true\");\n btn.tabIndex = -1;\n return btn;\n }\n\n const isFocused = focusedDate && isSameDay(date, focusedDate);\n btn.tabIndex = isFocused ? 0 : -1;\n btn.addEventListener(\"click\", () => {\n focusedDate = new Date(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n );\n selectDate(date);\n });\n\n return btn;\n };\n\n const render = (): void => {\n popup.innerHTML = \"\";\n\n const header = document.createElement(\"div\");\n header.className = \"vd-datepicker-header\";\n\n const prevBtn = document.createElement(\"button\");\n prevBtn.type = \"button\";\n prevBtn.className = \"vd-datepicker-prev\";\n prevBtn.innerHTML = \"‹\";\n prevBtn.setAttribute(\"aria-label\", \"Previous\");\n\n const nextBtn = document.createElement(\"button\");\n nextBtn.type = \"button\";\n nextBtn.className = \"vd-datepicker-next\";\n nextBtn.innerHTML = \"›\";\n nextBtn.setAttribute(\"aria-label\", \"Next\");\n\n const title = document.createElement(\"span\");\n title.className = \"vd-datepicker-title\";\n\n if (viewMode === \"days\") {\n title.textContent = MONTHS[viewMonth] + \" \" + viewYear;\n title.addEventListener(\"click\", () => {\n viewMode = \"months\";\n render();\n });\n prevBtn.addEventListener(\"click\", () => {\n viewMonth--;\n if (viewMonth < 0) {\n viewMonth = 11;\n viewYear--;\n }\n render();\n });\n nextBtn.addEventListener(\"click\", () => {\n viewMonth++;\n if (viewMonth > 11) {\n viewMonth = 0;\n viewYear++;\n }\n render();\n });\n } else if (viewMode === \"months\") {\n title.textContent = String(viewYear);\n title.addEventListener(\"click\", () => {\n viewMode = \"years\";\n render();\n });\n prevBtn.addEventListener(\"click\", () => {\n viewYear--;\n render();\n });\n nextBtn.addEventListener(\"click\", () => {\n viewYear++;\n render();\n });\n } else {\n const decadeStart = Math.floor(viewYear / 10) * 10;\n title.textContent = decadeStart + \" - \" + (decadeStart + 9);\n prevBtn.addEventListener(\"click\", () => {\n viewYear -= 10;\n render();\n });\n nextBtn.addEventListener(\"click\", () => {\n viewYear += 10;\n render();\n });\n }\n\n header.appendChild(prevBtn);\n header.appendChild(title);\n header.appendChild(nextBtn);\n popup.appendChild(header);\n\n if (viewMode === \"days\") {\n const gridWrap = document.createElement(\"div\");\n gridWrap.className = \"vd-datepicker-grid\";\n gridWrap.setAttribute(\"role\", \"grid\");\n gridWrap.setAttribute(\"aria-label\", \"Calendar\");\n\n const weekdays = document.createElement(\"div\");\n weekdays.className = \"vd-datepicker-weekdays\";\n weekdays.setAttribute(\"role\", \"row\");\n DAYS.forEach((d) => {\n const span = document.createElement(\"span\");\n span.setAttribute(\"role\", \"columnheader\");\n span.setAttribute(\"aria-label\", d);\n span.textContent = d;\n weekdays.appendChild(span);\n });\n gridWrap.appendChild(weekdays);\n\n const firstDay = new Date(viewYear, viewMonth, 1).getDay();\n const daysInMonth = new Date(viewYear, viewMonth + 1, 0).getDate();\n const daysInPrev = new Date(viewYear, viewMonth, 0).getDate();\n\n const cells: { day: number; outside: boolean; date: Date }[] = [];\n\n for (let i = firstDay - 1; i >= 0; i--) {\n const dayNum = daysInPrev - i;\n const prevMonth = viewMonth === 0 ? 11 : viewMonth - 1;\n const prevYear = viewMonth === 0 ? viewYear - 1 : viewYear;\n cells.push({\n day: dayNum,\n outside: true,\n date: new Date(prevYear, prevMonth, dayNum),\n });\n }\n for (let d = 1; d <= daysInMonth; d++) {\n cells.push({\n day: d,\n outside: false,\n date: new Date(viewYear, viewMonth, d),\n });\n }\n const totalCells = firstDay + daysInMonth;\n const remaining = totalCells % 7 === 0 ? 0 : 7 - (totalCells % 7);\n for (let i = 1; i <= remaining; i++) {\n cells.push({\n day: i,\n outside: true,\n date: new Date(viewYear, viewMonth + 1, i),\n });\n }\n\n for (let r = 0; r < cells.length; r += 7) {\n const row = document.createElement(\"div\");\n row.className = \"vd-datepicker-row\";\n row.setAttribute(\"role\", \"row\");\n for (let c = 0; c < 7; c++) {\n const cell = cells[r + c];\n row.appendChild(createDayBtn(cell.day, cell.outside, cell.date));\n }\n gridWrap.appendChild(row);\n }\n popup.appendChild(gridWrap);\n } else if (viewMode === \"months\") {\n const grid = document.createElement(\"div\");\n grid.className = \"vd-datepicker-months\";\n MONTHS.forEach((name, i) => {\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.className = \"vd-datepicker-month-btn\";\n btn.textContent = name.slice(0, 3);\n if (\n selectedDate &&\n selectedDate.getFullYear() === viewYear &&\n selectedDate.getMonth() === i\n ) {\n btn.classList.add(\"is-selected\");\n }\n btn.addEventListener(\"click\", () => {\n viewMonth = i;\n viewMode = \"days\";\n render();\n });\n grid.appendChild(btn);\n });\n popup.appendChild(grid);\n } else {\n const grid = document.createElement(\"div\");\n grid.className = \"vd-datepicker-years\";\n const decadeStart = Math.floor(viewYear / 10) * 10;\n for (let y = decadeStart - 1; y <= decadeStart + 10; y++) {\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.className = \"vd-datepicker-year-btn\";\n btn.textContent = String(y);\n if (selectedDate && selectedDate.getFullYear() === y)\n btn.classList.add(\"is-selected\");\n if (y < decadeStart || y > decadeStart + 9) btn.style.opacity = \"0.4\";\n btn.addEventListener(\"click\", () => {\n viewYear = y;\n viewMode = \"months\";\n render();\n });\n grid.appendChild(btn);\n }\n popup.appendChild(grid);\n }\n\n if (popup.classList.contains(\"is-open\")) {\n requestAnimationFrame(positionPopup);\n }\n };\n\n const handleGridKeydown = (e: KeyboardEvent): void => {\n if (!popup.classList.contains(\"is-open\") || viewMode !== \"days\") return;\n const grid = popup.querySelector(\".vd-datepicker-grid\");\n if (!grid || !grid.contains(e.target as Node)) return;\n\n const key = e.key;\n const handled = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"PageUp\",\n \"PageDown\",\n \"Enter\",\n \" \",\n \"Escape\",\n ];\n if (!handled.includes(key)) return;\n\n if (key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n skipNextFocusOpen = true;\n close();\n input.focus();\n return;\n }\n\n if (!focusedDate) focusedDate = firstSelectableInMonth(viewYear, viewMonth);\n\n if (key === \"Enter\" || key === \" \") {\n e.preventDefault();\n if (focusedDate && !isDisabled(focusedDate)) {\n selectDate(\n new Date(\n focusedDate.getFullYear(),\n focusedDate.getMonth(),\n focusedDate.getDate(),\n ),\n );\n }\n return;\n }\n\n e.preventDefault();\n\n let next = new Date(\n focusedDate.getFullYear(),\n focusedDate.getMonth(),\n focusedDate.getDate(),\n );\n let skipDir = 1;\n\n if (key === \"ArrowLeft\") {\n next = addDays(next, -1);\n skipDir = -1;\n } else if (key === \"ArrowRight\") {\n next = addDays(next, 1);\n skipDir = 1;\n } else if (key === \"ArrowUp\") {\n next = addDays(next, -7);\n skipDir = -1;\n } else if (key === \"ArrowDown\") {\n next = addDays(next, 7);\n skipDir = 1;\n } else if (key === \"Home\") {\n next = startOfWeekSunday(next);\n skipDir = 1;\n } else if (key === \"End\") {\n next = endOfWeekSunday(next);\n skipDir = -1;\n } else if (key === \"PageUp\") {\n next = addMonthsClamped(next, -1);\n skipDir = -1;\n } else if (key === \"PageDown\") {\n next = addMonthsClamped(next, 1);\n skipDir = 1;\n }\n\n next = skipDisabled(next, skipDir, 400);\n\n if (next.getMonth() !== viewMonth || next.getFullYear() !== viewYear) {\n viewYear = next.getFullYear();\n viewMonth = next.getMonth();\n const cl = ensureMonthInRange(viewYear, viewMonth);\n viewYear = cl.y;\n viewMonth = cl.m;\n }\n\n focusedDate = next;\n render();\n requestAnimationFrame(focusFocusedDay);\n };\n\n const positionPopup = (): void => {\n if (!popup.classList.contains(\"is-open\")) return;\n positionAnchoredPopup(input, popup);\n };\n const repositionHandler = (): void => positionPopup();\n const markIgnoreOutside = (): void => {\n ignoreOutsideUntil = Date.now() + 100;\n };\n\n const open = (): void => {\n markIgnoreOutside();\n viewMode = \"days\";\n if (selectedDate) {\n viewYear = selectedDate.getFullYear();\n viewMonth = selectedDate.getMonth();\n }\n const cl = ensureMonthInRange(viewYear, viewMonth);\n viewYear = cl.y;\n viewMonth = cl.m;\n\n focusedDate = selectedDate\n ? new Date(\n selectedDate.getFullYear(),\n selectedDate.getMonth(),\n selectedDate.getDate(),\n )\n : firstSelectableInMonth(viewYear, viewMonth);\n\n render();\n popup.classList.add(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"true\");\n requestAnimationFrame(() => {\n positionPopup();\n focusFocusedDay();\n });\n };\n\n const close = (): void => {\n popup.classList.remove(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"false\");\n viewMode = \"days\";\n };\n\n const focusHandler = (): void => {\n if (skipNextFocusOpen) {\n skipNextFocusOpen = false;\n return;\n }\n open();\n };\n const clickHandler = (): void => {\n if (!popup.classList.contains(\"is-open\")) open();\n };\n\n const isOpenAnchorTarget = (target: EventTarget | null): boolean => {\n if (!target || !(target instanceof Node)) return false;\n if (target === input || input.contains(target) || popup.contains(target))\n return true;\n const inputId = input.id;\n if (inputId) {\n const label = document.querySelector(\n 'label[for=\"' + inputId.replace(/\"/g, '\\\\\"') + '\"]',\n );\n if (label && (target === label || label.contains(target))) return true;\n }\n return false;\n };\n\n const outsideHandler = (e: Event): void => {\n if (Date.now() < ignoreOutsideUntil) return;\n if (!isOpenAnchorTarget(e.target)) close();\n };\n const escHandler = (e: KeyboardEvent): void => {\n if (e.key === \"Escape\" && popup.classList.contains(\"is-open\")) {\n skipNextFocusOpen = true;\n close();\n input.focus();\n }\n };\n\n input.addEventListener(\"focus\", focusHandler);\n input.addEventListener(\"click\", clickHandler);\n document.addEventListener(\"click\", outsideHandler, true);\n document.addEventListener(\"keydown\", escHandler);\n popup.addEventListener(\"keydown\", handleGridKeydown);\n window.addEventListener(\"resize\", repositionHandler);\n window.addEventListener(\"scroll\", repositionHandler, true);\n\n input.setAttribute(\"aria-haspopup\", \"dialog\");\n input.setAttribute(\"aria-expanded\", \"false\");\n input.setAttribute(\"autocomplete\", \"off\");\n\n cleanups.push(\n () => input.removeEventListener(\"focus\", focusHandler),\n () => input.removeEventListener(\"click\", clickHandler),\n () => document.removeEventListener(\"click\", outsideHandler, true),\n () => document.removeEventListener(\"keydown\", escHandler),\n () => popup.removeEventListener(\"keydown\", handleGridKeydown),\n () => window.removeEventListener(\"resize\", repositionHandler),\n () => window.removeEventListener(\"scroll\", repositionHandler, true),\n () => popup.remove(),\n );\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoDraggable.init(root)` from\n * `framework/js/components/draggable.js`: scans `root` for `.vd-draggable`\n * elements (or with attribute `data-vd-draggable`) and wires pointer drag\n * + drop-target detection. The framework global handles per-instance state;\n * this composable wires on mount and tears down on unmount via `destroyAll()`.\n */\nexport function useDraggable(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoDraggable?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoDraggable && typeof w.VanduoDraggable.init === \"function\") {\n w.VanduoDraggable.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoDraggable?: { destroyAll: () => void };\n };\n if (\n w.VanduoDraggable &&\n typeof w.VanduoDraggable.destroyAll === \"function\"\n ) {\n w.VanduoDraggable.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoDropdown.init(root)` from `framework/js/components/dropdown.js`:\n * scans `root` for `.vd-dropdown` containers, wires toggle / menu / keyboard /\n * outside-click / typeahead, and tears down on unmount.\n *\n * The framework JS already exposes a global, so we do NOT re-implement the\n * logic. Instead, `init(root)` is called once on mount; the framework's own\n * lifecycle (registered via `Vanduo.register('dropdown', …)`) handles each\n * dropdown's per-instance wiring, and `VanduoDropdown.destroyAll()` runs on\n * unmount so Vue's patch-driven DOM doesn't leave stale listeners behind.\n *\n * Notes:\n * - The framework tracks instances in a Map keyed by the `.vd-dropdown`\n * element. Vue's diffing may re-use the same element across re-renders,\n * so calling `init` twice is safe (the Map dedupes).\n * - `VanduoDropdown.destroyAll()` is the canonical teardown path called from\n * `Vanduo.destroy(root)`.\n */\nexport function useDropdown(root: Ref<HTMLElement | null>): void {\n let mountedRoot: HTMLElement | null = null;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const scope = r as unknown as HTMLElement;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoDropdown?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mountedRoot = scope;\n if (w.VanduoDropdown && typeof w.VanduoDropdown.init === \"function\") {\n w.VanduoDropdown.init(scope);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(scope);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\") return;\n const w = window as unknown as {\n VanduoDropdown?: { destroyAll: () => void };\n };\n if (w.VanduoDropdown && typeof w.VanduoDropdown.destroyAll === \"function\") {\n w.VanduoDropdown.destroyAll();\n }\n mountedRoot = null;\n void mountedRoot;\n };\n\n onMounted(() => {\n init();\n });\n\n onUnmounted(() => {\n teardown();\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoExpandingCards.init(root)` from\n * `framework/js/components/expanding-cards.js`: scans `root` for\n * `.vd-expanding-cards` containers and wires the click-to-expand behaviour\n * (one card expands to fill, others shrink to a thumbnail strip). The framework\n * global handles per-container state; this composable wires on mount and tears\n * down on unmount via `destroyAll()`.\n */\nexport function useExpandingCards(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoExpandingCards?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (\n w.VanduoExpandingCards &&\n typeof w.VanduoExpandingCards.init === \"function\"\n ) {\n w.VanduoExpandingCards.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoExpandingCards?: { destroyAll: () => void };\n };\n if (\n w.VanduoExpandingCards &&\n typeof w.VanduoExpandingCards.destroyAll === \"function\"\n ) {\n w.VanduoExpandingCards.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoFlow.init()` from `framework/js/components/flow.js`:\n * scans `root` for `.vd-flow` / `.vd-carousel` carousels and wires slide\n * transitions (slide + fade), prev/next controls, dot indicators, keyboard\n * arrows, pointer/touch swipe, and autoplay (pause on hover/focus).\n *\n * Indicator bridge: the docs markup places bare `<button>`s inside\n * `.vd-flow-indicators`, but the framework CSS/JS target `.vd-flow-indicator`.\n * We add that class here so indicators render as dots and become interactive —\n * matching the component's clear design intent.\n */\nexport function useFlow(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const initInstance = (el: HTMLElement): void => {\n const track = el.querySelector<HTMLElement>(\".vd-flow-track\");\n if (!track) return;\n\n const slides = Array.from(\n track.querySelectorAll<HTMLElement>(\".vd-flow-slide\"),\n );\n if (slides.length === 0) return;\n\n const isFade = el.classList.contains(\"vd-flow-fade\");\n const autoplay = el.hasAttribute(\"data-vd-autoplay\");\n const interval =\n parseInt(el.getAttribute(\"data-vd-interval\") ?? \"\", 10) || 5000;\n const loop = el.getAttribute(\"data-vd-loop\") !== \"false\";\n\n const state = { current: 0, total: slides.length };\n let autoplayTimer: number | null = null;\n let isDragging = false;\n let startX = 0;\n let currentX = 0;\n const threshold = 50;\n\n slides.forEach((slide, i) => {\n slide.setAttribute(\"role\", \"group\");\n slide.setAttribute(\"aria-roledescription\", \"slide\");\n slide.setAttribute(\"aria-label\", `Slide ${i + 1} of ${slides.length}`);\n if (i === 0) slide.classList.add(\"is-active\");\n });\n\n el.setAttribute(\"role\", \"region\");\n el.setAttribute(\"aria-roledescription\", \"carousel\");\n if (!el.getAttribute(\"aria-label\"))\n el.setAttribute(\"aria-label\", \"Carousel\");\n\n const liveRegion = document.createElement(\"div\");\n liveRegion.setAttribute(\"aria-live\", \"polite\");\n liveRegion.setAttribute(\"aria-atomic\", \"true\");\n liveRegion.className = \"sr-only\";\n liveRegion.style.cssText =\n \"position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);\";\n el.appendChild(liveRegion);\n\n // Bridge bare indicator buttons → styled, interactive dots.\n const indicators = Array.from(\n el.querySelectorAll<HTMLElement>(\n \".vd-flow-indicators button, .vd-flow-indicator\",\n ),\n );\n indicators.forEach((ind, i) => {\n ind.classList.add(\"vd-flow-indicator\");\n ind.setAttribute(\"role\", \"tab\");\n ind.setAttribute(\"aria-selected\", i === 0 ? \"true\" : \"false\");\n if (!ind.getAttribute(\"aria-label\"))\n ind.setAttribute(\"aria-label\", `Go to slide ${i + 1}`);\n });\n\n const goTo = (index: number, announce = true): void => {\n const target = loop\n ? ((index % state.total) + state.total) % state.total\n : Math.max(0, Math.min(index, state.total - 1));\n\n const prevIndex = state.current;\n state.current = target;\n\n if (isFade) {\n slides.forEach((s, i) => s.classList.toggle(\"is-active\", i === target));\n } else {\n track.style.transform = `translateX(-${target * 100}%)`;\n }\n\n indicators.forEach((ind, i) => {\n ind.classList.toggle(\"is-active\", i === target);\n ind.setAttribute(\"aria-selected\", i === target ? \"true\" : \"false\");\n ind.setAttribute(\"aria-current\", i === target ? \"true\" : \"false\");\n });\n\n slides.forEach((s, i) => {\n s.setAttribute(\"aria-hidden\", i !== target ? \"true\" : \"false\");\n });\n\n if (announce)\n liveRegion.textContent = `Slide ${target + 1} of ${state.total}`;\n\n el.dispatchEvent(\n new CustomEvent(\"flow:change\", {\n detail: { current: target, previous: prevIndex, total: state.total },\n }),\n );\n };\n\n const next = (): void => goTo(state.current + 1);\n const prev = (): void => goTo(state.current - 1);\n\n const prevBtn = el.querySelector<HTMLElement>(\".vd-flow-prev\");\n const nextBtn = el.querySelector<HTMLElement>(\".vd-flow-next\");\n if (prevBtn) {\n prevBtn.addEventListener(\"click\", prev);\n cleanups.push(() => prevBtn.removeEventListener(\"click\", prev));\n }\n if (nextBtn) {\n nextBtn.addEventListener(\"click\", next);\n cleanups.push(() => nextBtn.removeEventListener(\"click\", next));\n }\n\n indicators.forEach((ind, i) => {\n const h = (): void => goTo(i);\n ind.addEventListener(\"click\", h);\n cleanups.push(() => ind.removeEventListener(\"click\", h));\n });\n\n const keyHandler = (e: KeyboardEvent): void => {\n if (e.key === \"ArrowLeft\") {\n prev();\n e.preventDefault();\n }\n if (e.key === \"ArrowRight\") {\n next();\n e.preventDefault();\n }\n };\n el.setAttribute(\"tabindex\", \"0\");\n el.addEventListener(\"keydown\", keyHandler);\n cleanups.push(() => el.removeEventListener(\"keydown\", keyHandler));\n\n const pointerDown = (e: MouseEvent | TouchEvent): void => {\n isDragging = true;\n startX =\n (e as MouseEvent).clientX ||\n ((e as TouchEvent).touches && (e as TouchEvent).touches[0]?.clientX) ||\n 0;\n currentX = startX;\n el.classList.add(\"is-dragging\");\n };\n const pointerMove = (e: MouseEvent | TouchEvent): void => {\n if (!isDragging) return;\n currentX =\n (e as MouseEvent).clientX ||\n ((e as TouchEvent).touches && (e as TouchEvent).touches[0]?.clientX) ||\n 0;\n };\n const pointerUp = (): void => {\n if (!isDragging) return;\n isDragging = false;\n el.classList.remove(\"is-dragging\");\n const diff = startX - currentX;\n if (Math.abs(diff) > threshold) {\n if (diff > 0) next();\n else prev();\n }\n };\n\n el.addEventListener(\"mousedown\", pointerDown);\n el.addEventListener(\"mousemove\", pointerMove);\n el.addEventListener(\"mouseup\", pointerUp);\n el.addEventListener(\"mouseleave\", pointerUp);\n el.addEventListener(\"touchstart\", pointerDown, { passive: true });\n el.addEventListener(\"touchmove\", pointerMove, { passive: true });\n el.addEventListener(\"touchend\", pointerUp);\n cleanups.push(\n () => el.removeEventListener(\"mousedown\", pointerDown),\n () => el.removeEventListener(\"mousemove\", pointerMove),\n () => el.removeEventListener(\"mouseup\", pointerUp),\n () => el.removeEventListener(\"mouseleave\", pointerUp),\n () => el.removeEventListener(\"touchstart\", pointerDown),\n () => el.removeEventListener(\"touchmove\", pointerMove),\n () => el.removeEventListener(\"touchend\", pointerUp),\n );\n\n const startAutoplay = (): void => {\n stopAutoplay();\n autoplayTimer = window.setInterval(next, interval);\n };\n const stopAutoplay = (): void => {\n if (autoplayTimer != null) {\n window.clearInterval(autoplayTimer);\n autoplayTimer = null;\n }\n };\n if (autoplay) {\n startAutoplay();\n el.addEventListener(\"mouseenter\", stopAutoplay);\n el.addEventListener(\"mouseleave\", startAutoplay);\n el.addEventListener(\"focusin\", stopAutoplay);\n el.addEventListener(\"focusout\", startAutoplay);\n cleanups.push(\n () => el.removeEventListener(\"mouseenter\", stopAutoplay),\n () => el.removeEventListener(\"mouseleave\", startAutoplay),\n () => el.removeEventListener(\"focusin\", stopAutoplay),\n () => el.removeEventListener(\"focusout\", startAutoplay),\n () => stopAutoplay(),\n );\n }\n\n goTo(0, false);\n };\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n el.querySelectorAll<HTMLElement>(\".vd-flow, .vd-carousel\").forEach(\n initInstance,\n );\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, ref, type Ref } from \"vue\";\n\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(\",\");\n\nexport const useFocusTrap = (\n container: Ref<HTMLElement | null>,\n): {\n active: Ref<boolean>;\n activate: () => void;\n deactivate: () => void;\n} => {\n const active = ref(false);\n\n const onKeydown = (event: KeyboardEvent): void => {\n if (!active.value || event.key !== \"Tab\" || !container.value) return;\n const focusables = Array.from(\n container.value.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((el) => !el.hasAttribute(\"disabled\") && el.tabIndex !== -1);\n if (focusables.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusables[0]!;\n const last = focusables[focusables.length - 1]!;\n const current = document.activeElement as HTMLElement | null;\n if (event.shiftKey && current === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && current === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n const activate = (): void => {\n active.value = true;\n if (container.value) {\n const first =\n container.value.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n first?.focus();\n }\n };\n\n const deactivate = (): void => {\n active.value = false;\n };\n\n onMounted(() => {\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"keydown\", onKeydown);\n }\n });\n\n onUnmounted(() => {\n if (typeof window !== \"undefined\") {\n window.removeEventListener(\"keydown\", onKeydown);\n }\n });\n\n return { active, activate, deactivate };\n};\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `framework/js/components/glass.js`: scroll-aware glass activation.\n * For each `[data-glass-scroll]` element, observes a sentinel (the\n * `data-glass-sentinel` selector, else the previous sibling) and toggles\n * `.is-glass-active` when that sentinel scrolls out of / back into view.\n */\nexport function useGlass(root: Ref<HTMLElement | null>): void {\n const observers: IntersectionObserver[] = [];\n\n onMounted(() => {\n const scope = root.value;\n if (!scope || typeof IntersectionObserver === \"undefined\") return;\n\n scope.querySelectorAll<HTMLElement>(\"[data-glass-scroll]\").forEach((el) => {\n const selector = el.dataset.glassSentinel;\n let sentinel: Element | null = selector\n ? document.querySelector(selector)\n : null;\n if (!sentinel) sentinel = el.previousElementSibling;\n\n if (!sentinel) {\n el.classList.add(\"is-glass-active\");\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n el.classList.toggle(\"is-glass-active\", !entry.isIntersecting);\n });\n },\n { threshold: 0, rootMargin: \"0px\" },\n );\n observer.observe(sentinel);\n observers.push(observer);\n });\n });\n\n onUnmounted(() => {\n observers.forEach((o) => o.disconnect());\n observers.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoImageBox.init(root)` from\n * `framework/js/components/image-box.js`: scans `root` for `.vd-image-box`\n * elements and wires hover-reveal caption + click-to-zoom behaviour. The\n * framework global handles per-instance state; this composable wires on mount\n * and tears down on unmount via `destroyAll()`.\n */\nexport function useImageBox(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoImageBox?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoImageBox && typeof w.VanduoImageBox.init === \"function\") {\n w.VanduoImageBox.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoImageBox?: { destroyAll: () => void };\n };\n if (w.VanduoImageBox && typeof w.VanduoImageBox.destroyAll === \"function\") {\n w.VanduoImageBox.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { ref, type Ref } from \"vue\";\n\nexport interface UseKeyboardNavOptions {\n itemSelector: string;\n onSelect?: (index: number) => void;\n onEscape?: () => void;\n}\n\nexport const useKeyboardNav = (\n container: Ref<HTMLElement | null>,\n options: UseKeyboardNavOptions,\n): { activeIndex: Ref<number>; setItems: (count: number) => void } => {\n const activeIndex = ref(0);\n let count = 0;\n\n const items = (): HTMLElement[] => {\n if (!container.value) return [];\n return Array.from(\n container.value.querySelectorAll<HTMLElement>(options.itemSelector),\n );\n };\n\n const focusItem = (index: number): void => {\n const list = items();\n const target = list[index];\n if (target) {\n target.focus();\n activeIndex.value = index;\n }\n };\n\n const onKeydown = (event: KeyboardEvent): void => {\n const list = items();\n if (list.length === 0) return;\n const max = list.length - 1;\n let next = activeIndex.value;\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n next = Math.min(max, activeIndex.value + 1);\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n next = Math.max(0, activeIndex.value - 1);\n break;\n case \"Home\":\n next = 0;\n break;\n case \"End\":\n next = max;\n break;\n case \"Enter\":\n options.onSelect?.(activeIndex.value);\n return;\n case \"Escape\":\n options.onEscape?.();\n return;\n default:\n return;\n }\n event.preventDefault();\n focusItem(next);\n };\n\n if (typeof window !== \"undefined\" && container.value) {\n container.value.addEventListener(\"keydown\", onKeydown);\n }\n\n const setItems = (next: number): void => {\n count = next;\n if (activeIndex.value >= count) activeIndex.value = Math.max(0, count - 1);\n };\n\n return { activeIndex, setItems };\n};\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\nconst MORPH_DURATION_MS = 750;\n\n/**\n * Reproduces `framework/js/components/morph.js`: a liquid wave content-swap on\n * click for `.vd-morph` / `[data-vd-morph]` elements. Auto-creates the\n * `.vd-morph-wave` / `.vd-morph-shine` layers, originates the wave at the\n * pointer, adds `.is-morphing` for the animation window, then swaps\n * `.vd-morph-current` ⇄ `.vd-morph-next`. `[data-vd-morph=\"manual\"]` opts out\n * of the click handler.\n */\nexport function useMorph(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const ensureLayers = (el: HTMLElement): void => {\n if (!el.querySelector(\".vd-morph-wave\")) {\n const wave = document.createElement(\"span\");\n wave.className = \"vd-morph-wave\";\n wave.setAttribute(\"aria-hidden\", \"true\");\n el.insertBefore(wave, el.firstChild);\n }\n if (!el.querySelector(\".vd-morph-shine\")) {\n const shine = document.createElement(\"span\");\n shine.className = \"vd-morph-shine\";\n shine.setAttribute(\"aria-hidden\", \"true\");\n const waveEl = el.querySelector(\".vd-morph-wave\");\n if (waveEl?.nextSibling) el.insertBefore(shine, waveEl.nextSibling);\n else el.insertBefore(shine, el.firstChild);\n }\n };\n\n const runMorph = (\n el: HTMLElement,\n e: MouseEvent | null,\n done: () => void,\n ): void => {\n const wave = el.querySelector<HTMLElement>(\".vd-morph-wave\");\n if (wave) {\n const rect = el.getBoundingClientRect();\n const cx = rect.left + rect.width / 2;\n const cy = rect.top + rect.height / 2;\n const px = e ? e.clientX || cx : cx;\n const py = e ? e.clientY || cy : cy;\n wave.style.left = `${px - rect.left}px`;\n wave.style.top = `${py - rect.top}px`;\n }\n\n el.classList.add(\"is-morphing\");\n\n let duration = MORPH_DURATION_MS;\n const custom = getComputedStyle(el).getPropertyValue(\"--vd-morph-duration\");\n if (custom) {\n const parsed = parseFloat(custom);\n if (!isNaN(parsed))\n duration = parsed * (custom.includes(\"ms\") ? 1 : 1000);\n }\n\n window.setTimeout(() => {\n el.classList.remove(\"is-morphing\");\n const current = el.querySelector(\".vd-morph-current\");\n const next = el.querySelector(\".vd-morph-next\");\n if (current && next) {\n current.classList.replace(\"vd-morph-current\", \"vd-morph-next\");\n next.classList.replace(\"vd-morph-next\", \"vd-morph-current\");\n }\n done();\n }, duration);\n };\n\n onMounted(() => {\n const scope = root.value;\n if (!scope) return;\n scope\n .querySelectorAll<HTMLElement>(\".vd-morph, [data-vd-morph]\")\n .forEach((el) => {\n if (el.getAttribute(\"data-vd-morph\") === \"manual\") return;\n ensureLayers(el);\n let morphing = false;\n const onClick = (e: MouseEvent): void => {\n if (morphing) return;\n morphing = true;\n runMorph(el, e, () => (morphing = false));\n };\n el.addEventListener(\"click\", onClick);\n cleanups.push(() => el.removeEventListener(\"click\", onClick));\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports the docs-only multi-state morph badge cycling from\n * `docs/js/modules/demos.js` (`initSectionDemos`). Wires\n * `[data-vd-morph=\"manual\"][data-morph-states]` badges to cycle through\n * `data-morph-states` / `-classes` / `-icons` on click, swapping the badge\n * variant class and the current/next content with the morph wave.\n */\nexport function useMorphBadges(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const setContent = (\n target: Element | null,\n icon: string,\n label: string,\n ): void => {\n if (!target) return;\n const safeIcon = String(icon || \"\")\n .replace(/[^a-z0-9-\\s]/gi, \"\")\n .trim();\n while (target.firstChild) target.removeChild(target.firstChild);\n if (safeIcon) {\n const i = document.createElement(\"i\");\n i.className = `ph ${safeIcon}`;\n i.style.marginRight = \"0.35rem\";\n target.appendChild(i);\n }\n target.appendChild(\n document.createTextNode(label == null ? \"\" : String(label)),\n );\n };\n\n onMounted(() => {\n const scope = root.value;\n if (!scope) return;\n\n scope\n .querySelectorAll<HTMLElement>(\n '[data-vd-morph=\"manual\"][data-morph-states]',\n )\n .forEach((badge) => {\n const states: string[] = JSON.parse(\n badge.getAttribute(\"data-morph-states\") || \"[]\",\n );\n const classes: string[] = JSON.parse(\n badge.getAttribute(\"data-morph-classes\") || \"[]\",\n );\n const icons: string[] = JSON.parse(\n badge.getAttribute(\"data-morph-icons\") || \"[]\",\n );\n let idx = 0;\n let morphing = false;\n\n let morphMs = 750;\n const d = getComputedStyle(badge)\n .getPropertyValue(\"--vd-morph-duration\")\n .trim();\n if (d) {\n const parsed = parseFloat(d);\n if (!isNaN(parsed)) morphMs = parsed * (d.includes(\"ms\") ? 1 : 1000);\n }\n\n const onClick = (e: MouseEvent): void => {\n if (morphing || states.length === 0) return;\n morphing = true;\n const nextIdx = (idx + 1) % states.length;\n const afterIdx = (nextIdx + 1) % states.length;\n\n const next = badge.querySelector(\".vd-morph-next\");\n if (next)\n setContent(next, icons[nextIdx] ?? \"\", states[nextIdx] ?? \"\");\n\n const wave = badge.querySelector<HTMLElement>(\".vd-morph-wave\");\n if (wave) {\n const rect = badge.getBoundingClientRect();\n wave.style.left = `${(e.clientX || rect.left + rect.width / 2) - rect.left}px`;\n wave.style.top = `${(e.clientY || rect.top + rect.height / 2) - rect.top}px`;\n }\n\n badge.classList.add(\"is-morphing\");\n window.setTimeout(() => {\n badge.classList.remove(\"is-morphing\");\n classes.forEach((c) => badge.classList.remove(c));\n if (classes[nextIdx]) badge.classList.add(classes[nextIdx]);\n const current = badge.querySelector(\".vd-morph-current\");\n const nextEl = badge.querySelector(\".vd-morph-next\");\n if (current)\n setContent(current, icons[nextIdx] ?? \"\", states[nextIdx] ?? \"\");\n if (nextEl)\n setContent(nextEl, icons[afterIdx] ?? \"\", states[afterIdx] ?? \"\");\n idx = nextIdx;\n morphing = false;\n }, morphMs);\n };\n\n badge.addEventListener(\"click\", onClick);\n cleanups.push(() => badge.removeEventListener(\"click\", onClick));\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, ref, type Ref } from \"vue\";\n\n/**\n * Reproduces `framework/js/components/navbar.js` initScrollWatcher:\n * toggles scroll-aware glass/transparent behaviour for a navbar element.\n * Threshold: `data-scroll-threshold` attribute (px) or the navbar's own height.\n */\nexport function useNavbarGlassScroll(\n navbarRef: Ref<HTMLElement | null>,\n): Ref<boolean> {\n const isScrolled = ref(false);\n let onScroll: (() => void) | null = null;\n\n onMounted(() => {\n const navbar = navbarRef.value;\n if (!navbar) return;\n\n const isGlass = navbar.classList.contains(\"vd-navbar-glass\");\n const isTransparent = navbar.classList.contains(\"vd-navbar-transparent\");\n if (!isGlass && !isTransparent) return;\n\n const getThreshold = (): number => {\n const attr = parseInt(navbar.dataset.scrollThreshold ?? \"\", 10);\n return Number.isNaN(attr) ? navbar.offsetHeight || 60 : attr;\n };\n\n onScroll = (): void => {\n isScrolled.value = window.scrollY > getThreshold();\n };\n\n onScroll();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n });\n\n onUnmounted(() => {\n if (onScroll) {\n window.removeEventListener(\"scroll\", onScroll);\n onScroll = null;\n }\n });\n\n return isScrolled;\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\ninterface ParallaxConfig {\n layers: HTMLElement[];\n speed: number;\n direction: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Reproduces `framework/js/components/parallax.js`: layers inside a\n * `.vd-parallax` container translate at speed-scaled rates on a\n * rAF-throttled scroll listener. Container speed comes from\n * `.vd-parallax-slow|medium|fast` (0.5 / 1 / 1.5); per-layer rate from\n * `data-parallax-speed`. Disabled entirely under prefers-reduced-motion.\n */\nexport function useParallax(root: Ref<HTMLElement | null>): void {\n const elements = new Map<HTMLElement, ParallaxConfig>();\n let ticking = false;\n let onScroll: (() => void) | null = null;\n\n const getSpeed = (el: HTMLElement): number => {\n if (el.classList.contains(\"vd-parallax-slow\")) return 0.5;\n if (el.classList.contains(\"vd-parallax-fast\")) return 1.5;\n return 1;\n };\n\n const updateOne = (el: HTMLElement): void => {\n const config = elements.get(el);\n if (!config) return;\n const rect = el.getBoundingClientRect();\n const winH = window.innerHeight;\n const scrollProgress = Math.max(\n 0,\n Math.min(1, (winH - rect.top) / (winH + rect.height)),\n );\n const offset = (scrollProgress - 0.5) * config.speed * 100;\n config.layers.forEach((layer) => {\n const attr = layer.dataset.parallaxSpeed ?? layer.dataset.speed;\n const layerSpeed = attr ? parseFloat(attr) : 1;\n const layerOffset = offset * layerSpeed;\n layer.style.transform =\n config.direction === \"horizontal\"\n ? `translateX(${layerOffset}px)`\n : `translateY(${layerOffset}px)`;\n });\n };\n\n const updateAll = (): void => elements.forEach((_c, el) => updateOne(el));\n\n const handleScroll = (): void => {\n if (!ticking) {\n window.requestAnimationFrame(() => {\n updateAll();\n ticking = false;\n });\n ticking = true;\n }\n };\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n if (window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return;\n\n const scope = root.value;\n if (!scope) return;\n\n scope.querySelectorAll<HTMLElement>(\".vd-parallax\").forEach((el) => {\n const layers = Array.from(\n el.querySelectorAll<HTMLElement>(\".vd-parallax-layer, .vd-parallax-bg\"),\n );\n const direction = el.classList.contains(\"vd-parallax-horizontal\")\n ? \"horizontal\"\n : \"vertical\";\n elements.set(el, { layers, speed: getSpeed(el), direction });\n updateOne(el);\n });\n\n onScroll = () => handleScroll();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n handleScroll();\n });\n\n onUnmounted(() => {\n if (onScroll) window.removeEventListener(\"scroll\", onScroll);\n onScroll = null;\n elements.forEach((config) => {\n config.layers.forEach((l) => (l.style.transform = \"\"));\n });\n elements.clear();\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Wires the framework's bubble/popover component over `root`. The shipped\n * framework registers this as `bubble` (`window.VanduoBubble`) and scans for\n * `[data-vd-bubble]` / `[data-vd-popover]` triggers — building the panel from\n * attributes (`data-vd-bubble`, `-title`, `-placement`). This composable calls\n * `init(root)` on mount and tears down on unmount via `destroyAll()`.\n */\nexport function usePopover(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoBubble?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoBubble && typeof w.VanduoBubble.init === \"function\") {\n w.VanduoBubble.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoBubble?: { destroyAll: () => void };\n };\n if (w.VanduoBubble && typeof w.VanduoBubble.destroyAll === \"function\") {\n w.VanduoBubble.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoRipple.init(root)` from `framework/js/components/ripple.js`:\n * adds a click-spawned ripple element to any element matching `.vd-ripple`\n * (or with the attribute `data-vd-ripple`). The framework global owns the\n * per-element state and cleanup, so this composable simply wires the root on\n * mount and lets the framework tear down on unmount via `destroyAll(root)`.\n */\nexport function useRipple(root: Ref<HTMLElement | null>): void {\n let mountedRoot: HTMLElement | null = null;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoRipple?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mountedRoot = r;\n if (w.VanduoRipple && typeof w.VanduoRipple.init === \"function\") {\n w.VanduoRipple.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\") return;\n const w = window as unknown as {\n VanduoRipple?: { destroyAll: () => void };\n };\n if (w.VanduoRipple && typeof w.VanduoRipple.destroyAll === \"function\") {\n w.VanduoRipple.destroyAll();\n }\n mountedRoot = null;\n void mountedRoot;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, ref, type Ref } from \"vue\";\n\nexport const useScrollspy = (\n ids: string[],\n options: { offset?: number; rootMargin?: string } = {},\n): { activeId: Ref<string | null> } => {\n const activeId = ref<string | null>(ids[0] ?? null);\n const offset = options.offset ?? 96;\n\n let observer: IntersectionObserver | null = null;\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n if (!(\"IntersectionObserver\" in window)) return;\n\n const visible = new Set<string>();\n\n observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) visible.add(entry.target.id);\n else visible.delete(entry.target.id);\n }\n const firstVisible = ids.find((id) => visible.has(id));\n if (firstVisible) activeId.value = firstVisible;\n },\n {\n rootMargin: options.rootMargin ?? `-${offset}px 0px -60% 0px`,\n threshold: 0,\n },\n );\n\n for (const id of ids) {\n const el = document.getElementById(id);\n if (el) observer.observe(el);\n }\n });\n\n onUnmounted(() => {\n observer?.disconnect();\n observer = null;\n });\n\n return { activeId };\n};\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Wires the framework search helper against `root`. Sources registered with\n * `VanduoSearch.register()` are independent of mounting; the composable is a\n * thin lifecycle hook so vd2 consumers can mount sources alongside a search\n * overlay container.\n *\n * Per-source `fetch` functions are defined by the caller (see\n * `src/stores/search.ts` for the default vd2 sources). This composable does\n * NOT manage source registration — that happens in app-level code so the\n * registry outlives any single component instance.\n */\nexport function useSearch(root: Ref<HTMLElement | null>): void {\n const init = (): void => {\n if (typeof window === \"undefined\") return;\n const w = window as unknown as {\n VanduoSearch?: { list: () => ReadonlyArray<unknown> };\n };\n if (w.VanduoSearch) {\n // Touch list() to ensure the global exists; no DOM wiring needed at the\n // root level — the overlay (GlobalSearchModal) reads from the registry.\n w.VanduoSearch.list();\n }\n // Suppress unused-arg lint: the root ref is part of the public contract so\n // future versions can scope registration if needed.\n void root;\n };\n\n const teardown = (): void => {\n // No-op: registry is process-global. See note above.\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces the open/close behavior of\n * `framework/js/components/sidenav.js` for `.vd-sidenav` and `.vd-offcanvas`\n * drawers: `[data-sidenav-toggle=\"#id\"]` triggers, a body-level overlay,\n * close button, overlay-click (unless `data-backdrop=\"static\"`), Escape\n * (unless `data-keyboard=\"false\"`), body scroll-lock, `data-vd-position`\n * direction class, and `sidenav:open` / `sidenav:close` events.\n *\n * The Vanilla portal-to-body + push/fixed/resize handling is omitted: the demo\n * drawers are `position: fixed`, so they overlay the viewport without moving in\n * the DOM, which keeps this from fighting Vue's ownership of the elements.\n */\nexport function useSidenav(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n const overlays: HTMLElement[] = [];\n\n const open = (el: HTMLElement, overlay: HTMLElement): void => {\n if (\n !el.classList.contains(\"vd-sidenav-fixed\") &&\n !el.classList.contains(\"vd-offcanvas-fixed\")\n ) {\n overlay.classList.add(\"is-visible\");\n }\n el.classList.add(\"is-open\");\n el.setAttribute(\"aria-hidden\", \"false\");\n document.body.classList.add(\"body-sidenav-open\");\n el.dispatchEvent(new CustomEvent(\"sidenav:open\", { bubbles: true }));\n };\n\n const close = (el: HTMLElement, overlay: HTMLElement): void => {\n overlay.classList.remove(\"is-visible\");\n el.classList.remove(\"is-open\");\n el.setAttribute(\"aria-hidden\", \"true\");\n document.body.classList.remove(\"body-sidenav-open\");\n el.dispatchEvent(new CustomEvent(\"sidenav:close\", { bubbles: true }));\n };\n\n const toggle = (el: HTMLElement, overlay: HTMLElement): void => {\n if (el.classList.contains(\"is-open\")) close(el, overlay);\n else open(el, overlay);\n };\n\n onMounted(() => {\n const scope = root.value;\n if (!scope) return;\n\n const overlayFor = new Map<HTMLElement, HTMLElement>();\n\n scope\n .querySelectorAll<HTMLElement>(\".vd-sidenav, .vd-offcanvas\")\n .forEach((el) => {\n const position = el.getAttribute(\"data-vd-position\");\n if (position) {\n const prefix = el.classList.contains(\"vd-offcanvas\")\n ? \"vd-offcanvas\"\n : \"vd-sidenav\";\n el.classList.add(`${prefix}-${position}`);\n }\n\n const overlay = document.createElement(\"div\");\n overlay.className = \"vd-sidenav-overlay\";\n document.body.appendChild(overlay);\n overlays.push(overlay);\n overlayFor.set(el, overlay);\n\n el.setAttribute(\"role\", \"navigation\");\n el.setAttribute(\"aria-hidden\", \"true\");\n\n const closeBtn = el.querySelector<HTMLElement>(\n \".vd-sidenav-close, .vd-offcanvas-close\",\n );\n if (closeBtn) {\n const h = (): void => close(el, overlay);\n closeBtn.addEventListener(\"click\", h);\n cleanups.push(() => closeBtn.removeEventListener(\"click\", h));\n }\n\n const onOverlay = (): void => {\n if (el.dataset.backdrop !== \"static\") close(el, overlay);\n };\n overlay.addEventListener(\"click\", onOverlay);\n cleanups.push(() => overlay.removeEventListener(\"click\", onOverlay));\n\n const onEsc = (e: KeyboardEvent): void => {\n if (\n e.key === \"Escape\" &&\n el.classList.contains(\"is-open\") &&\n el.dataset.keyboard !== \"false\"\n ) {\n close(el, overlay);\n }\n };\n document.addEventListener(\"keydown\", onEsc);\n cleanups.push(() => document.removeEventListener(\"keydown\", onEsc));\n });\n\n scope\n .querySelectorAll<HTMLElement>(\"[data-sidenav-toggle]\")\n .forEach((btn) => {\n const onClick = (e: Event): void => {\n e.preventDefault();\n const targetId = btn.dataset.sidenavToggle;\n if (!targetId) return;\n const el = document.querySelector<HTMLElement>(targetId);\n const overlay = el ? overlayFor.get(el) : undefined;\n if (el && overlay) toggle(el, overlay);\n };\n btn.addEventListener(\"click\", onClick);\n cleanups.push(() => btn.removeEventListener(\"click\", onClick));\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n overlays.forEach((o) => o.remove());\n overlays.length = 0;\n document.body.classList.remove(\"body-sidenav-open\");\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoSpotlight.init(root)` from\n * `framework/js/components/spotlight.js`: scans `root` for `.vd-spotlight`\n * containers and wires the click-to-spotlight / dismiss behaviour. The\n * framework global handles per-instance state; this composable wires on mount\n * and tears down on unmount via `destroyAll()`.\n */\nexport function useSpotlight(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoSpotlight?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoSpotlight && typeof w.VanduoSpotlight.init === \"function\") {\n w.VanduoSpotlight.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoSpotlight?: { destroyAll: () => void };\n };\n if (\n w.VanduoSpotlight &&\n typeof w.VanduoSpotlight.destroyAll === \"function\"\n ) {\n w.VanduoSpotlight.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\nexport interface StepperApi {\n /** Advance the given stepper element to the next step. */\n next(el: Element | null): void;\n /** Return the given stepper element to the previous step. */\n prev(el: Element | null): void;\n /** Set the active step of the given stepper element (zero-based). */\n setStep(el: Element | null, index: number): void;\n}\n\ninterface Instance {\n setStep(index: number): void;\n next(): void;\n prev(): void;\n}\n\n/**\n * Ports framework/js/components/stepper.js — scans `root` for `.vd-stepper`\n * containers and manages step state. The active index is derived from the\n * initial `.is-active` item; `setStep` marks earlier items `.is-completed`,\n * the target `.is-active`, and dispatches `stepper:change` with\n * `{ current, previous, total }`. `.vd-stepper-clickable` steppers navigate on\n * item click. The returned imperative API lets the page wire the docs\n * `data-stepper-demo-control` Prev/Next buttons.\n */\nexport function useStepper(root: Ref<HTMLElement | null>): StepperApi {\n const instances = new Map<Element, Instance>();\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n const host = root.value;\n if (!host) return;\n\n host.querySelectorAll<HTMLElement>(\".vd-stepper\").forEach((el) => {\n const items = Array.from(\n el.querySelectorAll<HTMLElement>(\".vd-stepper-item\"),\n );\n const isClickable = el.classList.contains(\"vd-stepper-clickable\");\n let currentIndex = items.findIndex((i) =>\n i.classList.contains(\"is-active\"),\n );\n if (currentIndex === -1) currentIndex = 0;\n\n const setStep = (index: number): void => {\n if (index < 0 || index >= items.length) return;\n const prev = currentIndex;\n currentIndex = index;\n items.forEach((item, i) => {\n item.classList.remove(\"is-active\", \"is-completed\");\n item.removeAttribute(\"aria-current\");\n if (i < index) item.classList.add(\"is-completed\");\n else if (i === index) {\n item.classList.add(\"is-active\");\n item.setAttribute(\"aria-current\", \"step\");\n }\n });\n el.dispatchEvent(\n new CustomEvent(\"stepper:change\", {\n detail: { current: index, previous: prev, total: items.length },\n bubbles: true,\n }),\n );\n };\n\n if (isClickable) {\n items.forEach((item, i) => {\n const handler = (): void => setStep(i);\n item.addEventListener(\"click\", handler);\n const keyHandler = (e: KeyboardEvent): void => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setStep(i);\n }\n };\n item.addEventListener(\"keydown\", keyHandler);\n cleanups.push(() => item.removeEventListener(\"click\", handler));\n cleanups.push(() => item.removeEventListener(\"keydown\", keyHandler));\n });\n }\n\n setStep(currentIndex);\n\n instances.set(el, {\n setStep,\n next: () => setStep(currentIndex + 1),\n prev: () => setStep(currentIndex - 1),\n });\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n instances.clear();\n });\n\n return {\n next: (el) => {\n if (el) instances.get(el)?.next();\n },\n prev: (el) => {\n if (el) instances.get(el)?.prev();\n },\n setStep: (el, index) => {\n if (el) instances.get(el)?.setStep(index);\n },\n };\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/suggest.js — scans `root` for\n * `[data-vd-suggest]` / `[data-vd-autocomplete]` inputs and attaches a\n * type-ahead suggestion dropdown. Supports an inline JSON array or a remote\n * JSON endpoint (`data-vd-suggest-url`, same-origin / allowlisted), a minimum\n * character threshold, debounced search, match highlighting, full keyboard\n * navigation, and ARIA combobox wiring. Fires `suggest:select` with\n * `{ value, item, index }`.\n *\n * The list is appended to the input's `.vd-suggest-wrapper`; the page renders\n * that wrapper so no Vue-managed node is moved (the Vanilla JS created the\n * wrapper itself by relocating the input).\n */\ntype SuggestItem = string | { label?: string; text?: string; value?: string };\n\nfunction isSafeUrl(url: string, allowlist: string[]): boolean {\n try {\n const resolved = new URL(url, window.location.href);\n if (resolved.origin === window.location.origin) return true;\n return allowlist.includes(resolved.origin);\n } catch {\n return false;\n }\n}\n\nconst itemText = (item: SuggestItem): string =>\n typeof item === \"object\"\n ? item.label || item.text || String(item)\n : String(item);\n\nexport function useSuggest(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n host\n .querySelectorAll<HTMLInputElement>(\n \"[data-vd-suggest], [data-vd-autocomplete]\",\n )\n .forEach((input) => {\n const minChars = parseInt(\n input.getAttribute(\"data-vd-suggest-min-chars\") || \"1\",\n 10,\n );\n const url = input.getAttribute(\"data-vd-suggest-url\") || \"\";\n const allowlist = (\n input.getAttribute(\"data-vd-suggest-allowlist\") || \"\"\n )\n .split(\",\")\n .map((v) => v.trim())\n .filter(Boolean);\n const staticData =\n input.getAttribute(\"data-vd-suggest\") ||\n input.getAttribute(\"data-vd-autocomplete\") ||\n \"\";\n\n let items: SuggestItem[] = [];\n try {\n items = JSON.parse(staticData);\n } catch {\n items = staticData\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n }\n\n let wrapper = input.closest(\n \".vd-suggest-wrapper, .vd-autocomplete-wrapper\",\n ) as HTMLElement | null;\n if (!wrapper) {\n wrapper = document.createElement(\"div\");\n wrapper.className = \"vd-suggest-wrapper\";\n input.parentNode?.insertBefore(wrapper, input);\n wrapper.appendChild(input);\n }\n\n const list = document.createElement(\"ul\");\n list.className = \"vd-suggest-list\";\n list.setAttribute(\"role\", \"listbox\");\n const listId = \"vd-suggest-\" + Math.random().toString(36).slice(2, 9);\n list.id = listId;\n wrapper.appendChild(list);\n\n input.setAttribute(\"role\", \"combobox\");\n input.setAttribute(\"aria-autocomplete\", \"list\");\n input.setAttribute(\"aria-expanded\", \"false\");\n input.setAttribute(\"aria-controls\", listId);\n input.setAttribute(\"autocomplete\", \"off\");\n\n let highlighted = -1;\n let currentItems: SuggestItem[] = [];\n let debounceTimer: ReturnType<typeof setTimeout> | null = null;\n\n const renderItems = (filtered: SuggestItem[], query: string): void => {\n list.innerHTML = \"\";\n currentItems = filtered;\n highlighted = -1;\n\n if (filtered.length === 0) {\n const empty = document.createElement(\"li\");\n empty.className = \"vd-suggest-empty\";\n empty.textContent = \"No results\";\n list.appendChild(empty);\n return;\n }\n\n filtered.forEach((item, i) => {\n const li = document.createElement(\"li\");\n li.className = \"vd-suggest-item\";\n li.setAttribute(\"role\", \"option\");\n li.id = listId + \"-item-\" + i;\n\n const text = itemText(item);\n if (query) {\n const lowerText = text.toLowerCase();\n const lowerQuery = query.toLowerCase();\n let start = 0;\n let matchIndex = lowerText.indexOf(lowerQuery, start);\n while (matchIndex !== -1) {\n if (matchIndex > start) {\n li.appendChild(\n document.createTextNode(text.slice(start, matchIndex)),\n );\n }\n const matchSpan = document.createElement(\"span\");\n matchSpan.className = \"vd-suggest-match\";\n matchSpan.textContent = text.slice(\n matchIndex,\n matchIndex + query.length,\n );\n li.appendChild(matchSpan);\n start = matchIndex + query.length;\n matchIndex = lowerText.indexOf(lowerQuery, start);\n }\n if (start < text.length) {\n li.appendChild(document.createTextNode(text.slice(start)));\n }\n } else {\n li.textContent = text;\n }\n\n li.addEventListener(\"click\", () => selectItem(i));\n list.appendChild(li);\n });\n };\n\n const open = (): void => {\n list.classList.add(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"true\");\n };\n\n const close = (): void => {\n list.classList.remove(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"false\");\n highlighted = -1;\n input.removeAttribute(\"aria-activedescendant\");\n };\n\n const selectItem = (index: number): void => {\n const item = currentItems[index];\n const value =\n typeof item === \"object\"\n ? item.value || item.label || String(item)\n : String(item);\n input.value = value;\n close();\n input.dispatchEvent(\n new CustomEvent(\"suggest:select\", {\n bubbles: true,\n detail: { value, item, index },\n }),\n );\n };\n\n const highlight = (index: number): void => {\n const listItems =\n list.querySelectorAll<HTMLElement>(\".vd-suggest-item\");\n listItems.forEach((li) => li.classList.remove(\"is-highlighted\"));\n if (index >= 0 && index < listItems.length) {\n highlighted = index;\n listItems[index].classList.add(\"is-highlighted\");\n input.setAttribute(\"aria-activedescendant\", listItems[index].id);\n listItems[index].scrollIntoView({ block: \"nearest\" });\n }\n };\n\n const doSearch = async (query: string): Promise<void> => {\n if (query.length < minChars) {\n close();\n return;\n }\n let filtered: SuggestItem[];\n if (url) {\n try {\n if (!isSafeUrl(url, allowlist)) {\n filtered = [];\n } else {\n const sep = url.includes(\"?\") ? \"&\" : \"?\";\n const res = await window.fetch(\n url + sep + \"q=\" + encodeURIComponent(query),\n );\n filtered = await res.json();\n }\n } catch {\n filtered = [];\n }\n } else {\n const lower = query.toLowerCase();\n filtered = items.filter((item) =>\n itemText(item).toLowerCase().includes(lower),\n );\n }\n renderItems(filtered, query);\n open();\n };\n\n const inputHandler = (): void => {\n if (debounceTimer) clearTimeout(debounceTimer);\n debounceTimer = setTimeout(() => void doSearch(input.value), 200);\n };\n\n const keyHandler = (e: KeyboardEvent): void => {\n if (!list.classList.contains(\"is-open\")) {\n if (e.key === \"ArrowDown\") {\n void doSearch(input.value);\n e.preventDefault();\n }\n return;\n }\n const total = currentItems.length;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n highlight(highlighted < total - 1 ? highlighted + 1 : 0);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n highlight(highlighted > 0 ? highlighted - 1 : total - 1);\n break;\n case \"Enter\":\n e.preventDefault();\n if (highlighted >= 0) selectItem(highlighted);\n break;\n case \"Escape\":\n close();\n break;\n }\n };\n\n const blurHandler = (): void => {\n setTimeout(close, 200);\n };\n const focusHandler = (): void => {\n if (input.value.length >= minChars) void doSearch(input.value);\n };\n\n input.addEventListener(\"input\", inputHandler);\n input.addEventListener(\"keydown\", keyHandler);\n input.addEventListener(\"blur\", blurHandler);\n input.addEventListener(\"focus\", focusHandler);\n\n cleanups.push(\n () => input.removeEventListener(\"input\", inputHandler),\n () => input.removeEventListener(\"keydown\", keyHandler),\n () => input.removeEventListener(\"blur\", blurHandler),\n () => input.removeEventListener(\"focus\", focusHandler),\n () => {\n if (debounceTimer) clearTimeout(debounceTimer);\n },\n () => {\n if (list.parentNode) list.parentNode.removeChild(list);\n },\n );\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces the framework's `VanduoTabs.init()` in Vue: wires\n * `[data-tab-target]` tab links inside each `.vd-tabs` container to toggle\n * `.is-active` on the clicked link and its matching `.vd-tab-pane`.\n */\nexport function useTabs(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n el.querySelectorAll<HTMLElement>(\".vd-tabs\").forEach((tabs) => {\n const links = tabs.querySelectorAll<HTMLElement>(\n \".vd-tab-link[data-tab-target]\",\n );\n links.forEach((link) => {\n const onClick = (): void => {\n if (link.classList.contains(\"disabled\")) return;\n const targetId = link.getAttribute(\"data-tab-target\");\n if (!targetId) return;\n tabs.querySelectorAll(\".vd-tab-link\").forEach((l) => {\n l.classList.remove(\"is-active\");\n l.setAttribute(\"aria-selected\", \"false\");\n });\n tabs\n .querySelectorAll(\".vd-tab-pane\")\n .forEach((p) => p.classList.remove(\"is-active\"));\n link.classList.add(\"is-active\");\n link.setAttribute(\"aria-selected\", \"true\");\n tabs\n .querySelector(`#${CSS.escape(targetId)}`)\n ?.classList.add(\"is-active\");\n };\n link.addEventListener(\"click\", onClick);\n cleanups.push(() => link.removeEventListener(\"click\", onClick));\n });\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { DEFAULTS as CORE_DEFAULTS } from \"@vanduo-oss/core\";\n\n/** vd2 docs site overrides — core remains the generic Vanduo baseline. */\nexport const SITE_THEME_DEFAULTS = {\n ...CORE_DEFAULTS,\n PRIMARY_DARK: \"blue\",\n} as const;\n","/**\n * Theme model for the Vue engine. Token *data* (palette/neutral/radius/font\n * options + defaults) is owned by @vanduo-oss/core — the design-system source of\n * truth shared with the Vanilla framework. This file keeps only the Vue-side\n * application logic that drives the same `data-*` attributes the framework CSS\n * reads. Re-exports core's data so vd2 consumers keep a single import surface.\n */\nimport {\n FONT_OPTIONS,\n NEUTRAL_COLORS,\n PALETTE_OPTIONS,\n PRIMARY_COLORS,\n RADIUS_OPTIONS,\n THEME_MODES,\n type ColorDef,\n type FontDef,\n type Palette,\n type PaletteDef,\n type RadiusOption,\n type ThemeMode,\n} from \"@vanduo-oss/core\";\nimport { SITE_THEME_DEFAULTS } from \"../config/themeDefaults\";\n\nexport type { ColorDef, FontDef, Palette, PaletteDef, RadiusOption, ThemeMode };\nexport const DEFAULTS = SITE_THEME_DEFAULTS;\nexport {\n FONT_OPTIONS,\n NEUTRAL_COLORS,\n PALETTE_OPTIONS,\n PRIMARY_COLORS,\n RADIUS_OPTIONS,\n THEME_MODES,\n};\n\nconst PALETTE_KEYS = PALETTE_OPTIONS.map((p) => p.key);\nconst isPalette = (value: string): value is Palette =>\n (PALETTE_KEYS as readonly string[]).includes(value);\n\nexport interface ThemePreference {\n palette: Palette;\n theme: ThemeMode;\n primary: string;\n neutral: string;\n radius: RadiusOption;\n font: string;\n}\n\nconst STORAGE_KEYS = {\n PALETTE: \"vanduo-palette\",\n PRIMARY: \"vanduo-primary-color\",\n NEUTRAL: \"vanduo-neutral-color\",\n RADIUS: \"vanduo-radius\",\n FONT: \"vanduo-font-preference\",\n THEME: \"vanduo-theme-preference\",\n} as const;\n\nconst isClient = (): boolean => typeof window !== \"undefined\";\n\nconst prefersDark = (): boolean => {\n if (!isClient() || typeof window.matchMedia !== \"function\") return false;\n const mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n return !!mq && mq.matches;\n};\n\n/** Default primary depends on the effective light/dark scheme. */\nexport const defaultPrimary = (theme: ThemeMode): string => {\n if (theme === \"system\") {\n return prefersDark() ? DEFAULTS.PRIMARY_DARK : DEFAULTS.PRIMARY_LIGHT;\n }\n return theme === \"dark\" ? DEFAULTS.PRIMARY_DARK : DEFAULTS.PRIMARY_LIGHT;\n};\n\nconst read = (key: string, fallback: string): string => {\n if (!isClient()) return fallback;\n try {\n return window.localStorage.getItem(key) ?? fallback;\n } catch {\n return fallback;\n }\n};\n\nconst write = (key: string, value: string): void => {\n if (!isClient()) return;\n try {\n window.localStorage.setItem(key, value);\n } catch {\n /* storage may be unavailable (private mode, quota) */\n }\n};\n\nexport const defaultPreference = (): ThemePreference => ({\n palette: DEFAULTS.PALETTE,\n theme: DEFAULTS.THEME,\n primary: defaultPrimary(DEFAULTS.THEME),\n neutral: DEFAULTS.NEUTRAL,\n radius: DEFAULTS.RADIUS,\n font: DEFAULTS.FONT,\n});\n\nexport const loadPreference = (): ThemePreference => {\n const theme = read(STORAGE_KEYS.THEME, DEFAULTS.THEME) as ThemeMode;\n const radius = read(STORAGE_KEYS.RADIUS, DEFAULTS.RADIUS) as RadiusOption;\n const palette = read(STORAGE_KEYS.PALETTE, DEFAULTS.PALETTE);\n return {\n palette: isPalette(palette) ? palette : DEFAULTS.PALETTE,\n theme: THEME_MODES.includes(theme) ? theme : DEFAULTS.THEME,\n primary: read(STORAGE_KEYS.PRIMARY, defaultPrimary(theme)),\n neutral: read(STORAGE_KEYS.NEUTRAL, DEFAULTS.NEUTRAL),\n radius: RADIUS_OPTIONS.includes(radius) ? radius : DEFAULTS.RADIUS,\n font: read(STORAGE_KEYS.FONT, DEFAULTS.FONT),\n };\n};\n\nconst isDefaultPrimary = (primary: string): boolean =>\n primary === DEFAULTS.PRIMARY_LIGHT || primary === DEFAULTS.PRIMARY_DARK;\n\n/** Apply a full preference set to <html>, mirroring framework attribute logic. */\nexport const applyPreference = (prefs: ThemePreference): void => {\n if (!isClient()) return;\n const root = document.documentElement;\n\n // Keep auto-default primary aligned with the active scheme (black <-> blue).\n if (isDefaultPrimary(prefs.primary)) {\n prefs.primary = defaultPrimary(prefs.theme);\n }\n\n root.setAttribute(\"data-palette\", prefs.palette);\n root.setAttribute(\"data-primary\", prefs.primary);\n root.setAttribute(\"data-neutral\", prefs.neutral);\n root.setAttribute(\"data-radius\", prefs.radius);\n root.style.setProperty(\"--vd-radius-scale\", prefs.radius);\n\n if (prefs.font === \"system\") {\n root.removeAttribute(\"data-font\");\n } else {\n root.setAttribute(\"data-font\", prefs.font);\n }\n\n if (prefs.theme === \"system\") {\n root.removeAttribute(\"data-theme\");\n } else {\n root.setAttribute(\"data-theme\", prefs.theme);\n }\n};\n\nexport const persistPreference = (prefs: ThemePreference): void => {\n write(STORAGE_KEYS.PALETTE, prefs.palette);\n write(STORAGE_KEYS.THEME, prefs.theme);\n write(STORAGE_KEYS.PRIMARY, prefs.primary);\n write(STORAGE_KEYS.NEUTRAL, prefs.neutral);\n write(STORAGE_KEYS.RADIUS, prefs.radius);\n write(STORAGE_KEYS.FONT, prefs.font);\n};\n\nexport { isDefaultPrimary };\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoTimeline.init(root)` from\n * `framework/js/components/timeline.js`: scans `root` for `.vd-timeline`\n * containers and wires scroll-driven reveal animations. The framework global\n * handles per-instance state; this composable wires on mount and tears down on\n * unmount via `destroyAll()`.\n */\nexport function useTimeline(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoTimeline?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoTimeline && typeof w.VanduoTimeline.init === \"function\") {\n w.VanduoTimeline.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoTimeline?: { destroyAll: () => void };\n };\n if (w.VanduoTimeline && typeof w.VanduoTimeline.destroyAll === \"function\") {\n w.VanduoTimeline.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/timepicker.js — scans `root` for\n * `[data-vd-timepicker]` inputs and attaches a scrollable time-selection\n * dropdown (12h/24h format, configurable minute step). The popup is appended to\n * `document.body` (position:fixed) and anchored under the input; opens on focus,\n * selects on click, closes on outside-click / Escape, repositions on\n * scroll/resize.\n *\n * Fix-to-documented-intent: `timepicker:select` fires the documented\n * `{ time, hours, minutes }` detail (the Vanilla JS fired `{ display, value }`,\n * so the documented `event.detail.time/hours/minutes` were undefined).\n */\nfunction positionAnchoredPopup(\n anchor: HTMLElement,\n popup: HTMLElement,\n gap = 4,\n): void {\n const padding = 8;\n const rect = anchor.getBoundingClientRect();\n popup.style.minWidth = Math.max(rect.width, 0) + \"px\";\n\n let top = rect.bottom + gap;\n let left = rect.left;\n popup.style.top = top + \"px\";\n popup.style.left = left + \"px\";\n\n const popRect = popup.getBoundingClientRect();\n if (\n popRect.bottom > window.innerHeight - padding &&\n rect.top - popRect.height > padding\n ) {\n top = rect.top - popRect.height - gap;\n popup.style.top = top + \"px\";\n }\n\n const alignedRect = popup.getBoundingClientRect();\n left = rect.left;\n if (left + alignedRect.width > window.innerWidth - padding) {\n left = window.innerWidth - alignedRect.width - padding;\n }\n popup.style.left = Math.max(padding, left) + \"px\";\n}\n\nexport function useTimepicker(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n host\n .querySelectorAll<HTMLInputElement>(\"[data-vd-timepicker]\")\n .forEach((input) => {\n const is24h = input.getAttribute(\"data-vd-timepicker-format\") === \"24h\";\n const step = parseInt(\n input.getAttribute(\"data-vd-timepicker-step\") || \"30\",\n 10,\n );\n\n const popup = document.createElement(\"div\");\n popup.className = \"vd-timepicker-popup\";\n popup.setAttribute(\"role\", \"listbox\");\n document.body.appendChild(popup);\n\n const times: { display: string; value: string }[] = [];\n for (let h = 0; h < 24; h++) {\n for (let m = 0; m < 60; m += step) {\n const hh24 = String(h).padStart(2, \"0\");\n const mm = String(m).padStart(2, \"0\");\n if (is24h) {\n times.push({ display: hh24 + \":\" + mm, value: hh24 + \":\" + mm });\n } else {\n const period = h < 12 ? \"AM\" : \"PM\";\n const h12 = h === 0 ? 12 : h > 12 ? h - 12 : h;\n times.push({\n display: h12 + \":\" + mm + \" \" + period,\n value: hh24 + \":\" + mm,\n });\n }\n }\n }\n\n const render = (): void => {\n popup.innerHTML = \"\";\n times.forEach((t) => {\n const item = document.createElement(\"div\");\n item.className = \"vd-timepicker-item\";\n item.setAttribute(\"role\", \"option\");\n item.textContent = t.display;\n if (input.value === t.value || input.value === t.display) {\n item.classList.add(\"is-selected\");\n item.setAttribute(\"aria-selected\", \"true\");\n }\n item.addEventListener(\"click\", () => {\n input.value = t.display;\n popup.querySelectorAll(\".vd-timepicker-item\").forEach((i) => {\n i.classList.remove(\"is-selected\");\n i.removeAttribute(\"aria-selected\");\n });\n item.classList.add(\"is-selected\");\n item.setAttribute(\"aria-selected\", \"true\");\n close();\n const [hh, mm] = t.value.split(\":\");\n input.dispatchEvent(\n new CustomEvent(\"timepicker:select\", {\n bubbles: true,\n detail: {\n time: t.display,\n hours: parseInt(hh, 10),\n minutes: parseInt(mm, 10),\n },\n }),\n );\n input.dispatchEvent(new Event(\"change\", { bubbles: true }));\n });\n popup.appendChild(item);\n });\n };\n\n const positionPopup = (): void => {\n if (!popup.classList.contains(\"is-open\")) return;\n positionAnchoredPopup(input, popup);\n };\n\n const open = (): void => {\n render();\n popup.classList.add(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"true\");\n requestAnimationFrame(() => {\n positionPopup();\n const selected = popup.querySelector(\".is-selected\");\n if (selected) selected.scrollIntoView({ block: \"center\" });\n });\n };\n\n const close = (): void => {\n popup.classList.remove(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"false\");\n };\n\n const focusHandler = (): void => open();\n const outsideHandler = (e: Event): void => {\n const target = e.target as Node;\n if (!input.contains(target) && !popup.contains(target)) close();\n };\n const escHandler = (e: KeyboardEvent): void => {\n if (e.key === \"Escape\") close();\n };\n const repositionHandler = (): void => positionPopup();\n\n input.addEventListener(\"focus\", focusHandler);\n document.addEventListener(\"click\", outsideHandler, true);\n document.addEventListener(\"keydown\", escHandler);\n window.addEventListener(\"resize\", repositionHandler);\n window.addEventListener(\"scroll\", repositionHandler, true);\n input.setAttribute(\"aria-haspopup\", \"listbox\");\n input.setAttribute(\"aria-expanded\", \"false\");\n input.setAttribute(\"autocomplete\", \"off\");\n input.readOnly = true;\n\n cleanups.push(\n () => input.removeEventListener(\"focus\", focusHandler),\n () => document.removeEventListener(\"click\", outsideHandler, true),\n () => document.removeEventListener(\"keydown\", escHandler),\n () => window.removeEventListener(\"resize\", repositionHandler),\n () => window.removeEventListener(\"scroll\", repositionHandler, true),\n () => popup.remove(),\n );\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","/**\n * Whitelist HTML sanitizer — dependency-free TS port of the framework's\n * `helpers.js` sanitizeHtml. Used wherever vd2 must mirror the framework's\n * raw-HTML behaviour (e.g. `data-tooltip-html`) without inheriting an XSS sink.\n *\n * Keeps a small set of inline tags, drops everything else to text, and only\n * permits http/https/mailto on `<a href>`. Event-handler attributes and unknown\n * attributes are removed. For stronger guarantees prefer DOMPurify / server-side\n * sanitization; this is a client-side guard.\n *\n * Differs from the framework on one intentional point: `style` is DENIED by\n * default here (the framework defaults it on). Opt in with `allowStyle: true`.\n */\nexport interface SanitizeOptions {\n allowSvg?: boolean;\n /** Permit the inline `style` attribute on kept elements. Default: false. */\n allowStyle?: boolean;\n}\n\nconst BASE_ALLOWED = [\n \"B\",\n \"STRONG\",\n \"I\",\n \"EM\",\n \"BR\",\n \"A\",\n \"SPAN\",\n \"U\",\n \"DIV\",\n \"P\",\n \"KBD\",\n \"CODE\",\n \"SMALL\",\n \"MARK\",\n];\nconst SVG_ALLOWED = [\"SVG\", \"PATH\", \"LINE\", \"CIRCLE\", \"POLYLINE\", \"RECT\", \"G\"];\nconst SAFE_SVG_ATTRS = new Set([\n \"xmlns\",\n \"width\",\n \"height\",\n \"viewBox\",\n \"fill\",\n \"stroke\",\n \"stroke-width\",\n \"stroke-linecap\",\n \"stroke-linejoin\",\n \"d\",\n \"cx\",\n \"cy\",\n \"r\",\n \"x1\",\n \"y1\",\n \"x2\",\n \"y2\",\n \"points\",\n \"transform\",\n \"class\",\n]);\n\n/** Attribute-safe text escape — used as the SSR / no-DOMParser fallback. */\nfunction escapeText(input: string): string {\n return input\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n\nexport function sanitizeHtml(\n input: string,\n options: SanitizeOptions = {},\n): string {\n if (!input) return \"\";\n // SSR / non-DOM environments: fail closed to escaped text.\n if (typeof DOMParser === \"undefined\") return escapeText(input);\n\n const allowSvg = options.allowSvg === true;\n const allowStyle = options.allowStyle === true;\n const allowed = allowSvg ? BASE_ALLOWED.concat(SVG_ALLOWED) : BASE_ALLOWED;\n\n let doc: Document;\n try {\n doc = new DOMParser().parseFromString(input, \"text/html\");\n } catch {\n return escapeText(input);\n }\n\n const sanitizeNode = (node: Node): void => {\n Array.from(node.childNodes).forEach((child) => {\n if (child.nodeType === Node.TEXT_NODE) return;\n const el = child as Element;\n\n if (!allowed.includes(el.nodeName)) {\n node.replaceChild(document.createTextNode(el.textContent ?? \"\"), child);\n return;\n }\n\n if (el.nodeName === \"A\") {\n const href = el.getAttribute(\"href\") ?? \"\";\n try {\n const url = new URL(href, location.href);\n if (![\"http:\", \"https:\", \"mailto:\"].includes(url.protocol)) {\n el.removeAttribute(\"href\");\n }\n } catch {\n el.removeAttribute(\"href\");\n }\n el.removeAttribute(\"target\");\n el.removeAttribute(\"rel\");\n } else if (allowSvg && (el.nodeName === \"SVG\" || el.closest?.(\"svg\"))) {\n Array.from(el.attributes).forEach((a) => {\n if (!SAFE_SVG_ATTRS.has(a.name)) el.removeAttribute(a.name);\n });\n } else {\n const safe = new Set([\"class\"]);\n if (allowStyle) safe.add(\"style\");\n Array.from(el.attributes).forEach((a) => {\n if (!safe.has(a.name)) el.removeAttribute(a.name);\n });\n }\n\n sanitizeNode(el);\n });\n };\n\n sanitizeNode(doc.body);\n return doc.body.innerHTML;\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\nimport { sanitizeHtml } from \"../utils/sanitizeHtml\";\n\n/**\n * Reproduces the framework's `Vanduo.init()` tooltip wiring in Vue: scans a root\n * element for `[data-tooltip]` / `[data-tooltip-html]` triggers and shows a\n * `.vd-tooltip` (styled by the framework CSS) on hover/focus.\n *\n * `data-tooltip-html` is run through the whitelist sanitizer before insertion —\n * mirroring the framework's tooltips.js, which sanitizes too. (`data-tooltip`\n * stays plain text via textContent.)\n */\nexport function useTooltips(root: Ref<HTMLElement | null>): void {\n let current: HTMLElement | null = null;\n const cleanups: Array<() => void> = [];\n\n const hide = (): void => {\n if (current) {\n current.remove();\n current = null;\n }\n };\n\n const place = (\n trigger: HTMLElement,\n tip: HTMLElement,\n placement: string,\n ): void => {\n const r = trigger.getBoundingClientRect();\n const t = tip.getBoundingClientRect();\n const gap = 8;\n let top: number;\n let left: number;\n switch (placement) {\n case \"bottom\":\n top = r.bottom + gap;\n left = r.left + r.width / 2 - t.width / 2;\n break;\n case \"left\":\n top = r.top + r.height / 2 - t.height / 2;\n left = r.left - t.width - gap;\n break;\n case \"right\":\n top = r.top + r.height / 2 - t.height / 2;\n left = r.right + gap;\n break;\n default:\n top = r.top - t.height - gap;\n left = r.left + r.width / 2 - t.width / 2;\n }\n tip.style.top = `${Math.max(4, top)}px`;\n tip.style.left = `${Math.max(4, left)}px`;\n };\n\n const show = (trigger: HTMLElement): void => {\n hide();\n const text = trigger.getAttribute(\"data-tooltip\");\n const html = trigger.getAttribute(\"data-tooltip-html\");\n if (!text && !html) return;\n const placement = trigger.getAttribute(\"data-tooltip-placement\") ?? \"top\";\n const variant = trigger.getAttribute(\"data-tooltip-variant\");\n const size = trigger.getAttribute(\"data-tooltip-size\");\n\n const tip = document.createElement(\"div\");\n tip.className =\n \"vd-tooltip vd-tooltip-\" +\n placement +\n (variant ? \" vd-tooltip-\" + variant : \"\") +\n (size ? \" vd-tooltip-\" + size : \"\") +\n (html ? \" vd-tooltip-html\" : \"\");\n tip.setAttribute(\"data-placement\", placement);\n tip.style.position = \"fixed\";\n if (html) tip.innerHTML = sanitizeHtml(html, { allowStyle: false });\n else tip.textContent = text;\n\n document.body.appendChild(tip);\n place(trigger, tip, placement);\n requestAnimationFrame(() => tip.classList.add(\"is-visible\"));\n current = tip;\n };\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n const triggers = el.querySelectorAll<HTMLElement>(\n \"[data-tooltip],[data-tooltip-html]\",\n );\n triggers.forEach((trigger) => {\n const onEnter = (): void => show(trigger);\n const onLeave = (): void => hide();\n trigger.addEventListener(\"mouseenter\", onEnter);\n trigger.addEventListener(\"mouseleave\", onLeave);\n trigger.addEventListener(\"focus\", onEnter);\n trigger.addEventListener(\"blur\", onLeave);\n cleanups.push(() => {\n trigger.removeEventListener(\"mouseenter\", onEnter);\n trigger.removeEventListener(\"mouseleave\", onLeave);\n trigger.removeEventListener(\"focus\", onEnter);\n trigger.removeEventListener(\"blur\", onLeave);\n });\n });\n });\n\n onUnmounted(() => {\n hide();\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\ntype Validator = (value: string, param: string) => boolean;\n\n/** Rule validators — ported verbatim from `framework/js/components/validate.js`. */\nconst rules: Record<string, Validator> = {\n required: (v) => v.trim().length > 0,\n email: (v) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(v),\n url: (v) => {\n try {\n new URL(v);\n return true;\n } catch {\n return false;\n }\n },\n number: (v) => !isNaN(parseFloat(v)) && isFinite(Number(v)),\n min: (v, p) => v.length >= parseInt(p, 10),\n max: (v, p) => v.length <= parseInt(p, 10),\n minVal: (v, p) => parseFloat(v) >= parseFloat(p),\n maxVal: (v, p) => parseFloat(v) <= parseFloat(p),\n pattern: (v, p) => {\n try {\n if (p.length > 100) return false;\n return new RegExp(p).test(v);\n } catch {\n return false;\n }\n },\n // Vanilla validate.js looks up by [name]; the docs API + demo reference an\n // element id (`match:val-pass`). Honor both so the demo actually works.\n match: (v, p) => {\n try {\n const esc = typeof CSS !== \"undefined\" && CSS.escape ? CSS.escape(p) : p;\n const other =\n document.getElementById(p) ??\n document.querySelector<HTMLInputElement>(`[name=\"${esc}\"]`);\n return other ? v === (other as HTMLInputElement).value : false;\n } catch {\n return false;\n }\n },\n};\n\nconst messages: Record<string, string> = {\n required: \"This field is required\",\n email: \"Please enter a valid email address\",\n url: \"Please enter a valid URL\",\n number: \"Please enter a valid number\",\n min: \"Minimum {0} characters required\",\n max: \"Maximum {0} characters allowed\",\n minVal: \"Value must be at least {0}\",\n maxVal: \"Value must be at most {0}\",\n pattern: \"Invalid format\",\n match: \"Fields do not match\",\n};\n\nlet errSeq = 0;\n\nfunction setFieldState(field: HTMLInputElement, errors: string[]): void {\n const wrapper = field.closest(\".vd-form-group\") ?? field.parentElement;\n if (!wrapper) return;\n let errorEl = wrapper.querySelector<HTMLElement>(\".vd-validate-error\");\n\n field.classList.remove(\"is-valid\", \"is-invalid\");\n\n if (errors.length > 0) {\n field.classList.add(\"is-invalid\");\n field.setAttribute(\"aria-invalid\", \"true\");\n if (!errorEl) {\n errorEl = document.createElement(\"div\");\n errorEl.className = \"vd-validate-error\";\n errSeq += 1;\n errorEl.id = `vd-err-${errSeq}`;\n errorEl.setAttribute(\"role\", \"alert\");\n wrapper.appendChild(errorEl);\n }\n errorEl.textContent = errors[0] ?? \"\";\n errorEl.style.display = \"\";\n field.setAttribute(\"aria-describedby\", errorEl.id);\n } else if (field.value.trim()) {\n field.classList.add(\"is-valid\");\n field.removeAttribute(\"aria-invalid\");\n if (errorEl) errorEl.style.display = \"none\";\n } else {\n field.removeAttribute(\"aria-invalid\");\n if (errorEl) errorEl.style.display = \"none\";\n }\n}\n\n/**\n * Reproduces `VanduoValidate.init()`: scans `root` for `[data-vd-validate]` /\n * `.vd-validate` forms and wires declarative, attribute-driven validation\n * (rules piped on `data-vd-rules`, modes blur/input/submit, custom\n * `data-vd-msg-*` messages, `.is-valid`/`.is-invalid` + `.vd-validate-error`).\n * Honors per-field `data-vd-validate-mode` overrides, as the docs document.\n */\nexport function useValidate(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const validateField = (field: HTMLInputElement): boolean => {\n const rulesStr = field.getAttribute(\"data-vd-rules\") ?? \"\";\n const fieldRules = rulesStr\n .split(\"|\")\n .map((r) => r.trim())\n .filter(Boolean);\n const value = field.value;\n const errors: string[] = [];\n\n for (const rule of fieldRules) {\n const [name, ...params] = rule.split(\":\");\n const param = params.join(\":\");\n const validator = name ? rules[name] : undefined;\n if (validator && !validator(value, param)) {\n const customMsg = name\n ? field.getAttribute(`data-vd-msg-${name}`)\n : null;\n let msg = customMsg ?? (name ? messages[name] : undefined) ?? \"Invalid\";\n if (param) msg = msg.replace(\"{0}\", param);\n errors.push(msg);\n break;\n }\n }\n\n setFieldState(field, errors);\n return errors.length === 0;\n };\n\n const initForm = (form: HTMLFormElement): void => {\n const formMode = form.getAttribute(\"data-vd-validate-mode\") ?? \"blur\";\n const fields = Array.from(\n form.querySelectorAll<HTMLInputElement>(\"[data-vd-rules]\"),\n );\n\n const validateAll = (): boolean => {\n let valid = true;\n fields.forEach((f) => {\n if (!validateField(f)) valid = false;\n });\n return valid;\n };\n\n fields.forEach((field) => {\n const mode = field.getAttribute(\"data-vd-validate-mode\") ?? formMode;\n if (mode === \"input\" || mode === \"blur\") {\n const eventType = mode === \"input\" ? \"input\" : \"blur\";\n const handler = (): boolean => validateField(field);\n field.addEventListener(eventType, handler);\n cleanups.push(() => field.removeEventListener(eventType, handler));\n\n if (mode === \"blur\") {\n const inputClear = (): void => {\n if (\n field.classList.contains(\"is-invalid\") ||\n field.classList.contains(\"is-valid\")\n ) {\n validateField(field);\n }\n };\n field.addEventListener(\"input\", inputClear);\n cleanups.push(() => field.removeEventListener(\"input\", inputClear));\n }\n }\n });\n\n const submitHandler = (e: Event): void => {\n const valid = validateAll();\n if (!valid) {\n e.preventDefault();\n e.stopPropagation();\n form.querySelector<HTMLElement>(\".is-invalid\")?.focus();\n }\n form.dispatchEvent(\n new CustomEvent(\"validate:submit\", {\n detail: { valid },\n bubbles: true,\n }),\n );\n };\n form.addEventListener(\"submit\", submitHandler);\n cleanups.push(() => form.removeEventListener(\"submit\", submitHandler));\n };\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n el.querySelectorAll<HTMLFormElement>(\n \"[data-vd-validate], .vd-validate\",\n ).forEach(initForm);\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/waypoint.js — scans `root` for\n * `[data-vd-waypoint-nav]` / `[data-vd-scrollspy-nav]` navs and highlights the\n * link of the topmost visible section as the user scrolls (IntersectionObserver,\n * topmost-wins, smooth-scroll on click, `waypoint:change` event).\n *\n * Two fixes-to-documented-intent vs the Vanilla JS:\n * - The Vanilla observer always ran against the viewport and ignored the\n * attribute value, so a nav pointed at an overflow container (the docs'\n * sidebar demo) never updated. Here the attribute value is resolved to an\n * element and used as the IntersectionObserver `root` — the documented\n * behaviour (\"selector for the scrollable container to observe\") — so\n * overflow-container scrollspy actually works.\n * - The active link also receives `aria-current=\"true\"`, which the docs\n * accessibility notes promise but the Vanilla JS never set.\n */\nexport function useWaypoint(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n const navs = host.querySelectorAll<HTMLElement>(\n \"[data-vd-waypoint-nav], [data-vd-scrollspy-nav]\",\n );\n\n navs.forEach((nav) => {\n const links = Array.from(\n nav.querySelectorAll<HTMLAnchorElement>('a[href^=\"#\"]'),\n );\n if (links.length === 0) return;\n\n const offset = parseInt(\n nav.getAttribute(\"data-vd-waypoint-offset\") || \"80\",\n 10,\n );\n\n const selector =\n nav.getAttribute(\"data-vd-waypoint-nav\") ||\n nav.getAttribute(\"data-vd-scrollspy-nav\") ||\n \"\";\n let scrollRoot: Element | null = null;\n if (selector && selector !== \"window\") {\n scrollRoot = document.querySelector(selector);\n }\n\n const sections: {\n id: string;\n link: HTMLAnchorElement;\n section: HTMLElement;\n }[] = [];\n links.forEach((link) => {\n const id = (link.getAttribute(\"href\") || \"\").slice(1);\n const section = id ? document.getElementById(id) : null;\n if (section) {\n section.setAttribute(\"data-vd-waypoint-section\", \"\");\n sections.push({ id, link, section });\n }\n });\n if (sections.length === 0) return;\n\n const visible = new Set<string>();\n\n const setActive = (id: string): void => {\n links.forEach((l) => {\n l.classList.remove(\"is-active\");\n l.removeAttribute(\"aria-current\");\n });\n const target = links.find((l) => l.getAttribute(\"href\") === \"#\" + id);\n if (target) {\n target.classList.add(\"is-active\");\n target.setAttribute(\"aria-current\", \"true\");\n nav.dispatchEvent(\n new CustomEvent(\"waypoint:change\", {\n detail: { activeId: id, link: target },\n }),\n );\n }\n };\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) visible.add(entry.target.id);\n else visible.delete(entry.target.id);\n });\n for (const s of sections) {\n if (visible.has(s.id)) {\n setActive(s.id);\n return;\n }\n }\n },\n {\n root: scrollRoot,\n rootMargin: \"-\" + offset + \"px 0px -40% 0px\",\n threshold: 0,\n },\n );\n\n sections.forEach((s) => observer.observe(s.section));\n\n links.forEach((link) => {\n const onClick = (e: Event): void => {\n e.preventDefault();\n const id = (link.getAttribute(\"href\") || \"\").slice(1);\n const section = id ? document.getElementById(id) : null;\n if (section) {\n section.scrollIntoView({ behavior: \"smooth\" });\n setActive(id);\n }\n };\n link.addEventListener(\"click\", onClick);\n cleanups.push(() => link.removeEventListener(\"click\", onClick));\n });\n\n cleanups.push(() => observer.disconnect());\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n"],"mappings":";;;;AAYA,IAAI,IAA0C;AAE9C,SAAgB,KAAsC;CAKpD,OAJI,OAAO,SAAW,MAAoB,QAAQ,QAAQ,KAC1D,AACE,MAAiB,OAAO,+BAEnB;AACT;AAMA,IAAa,KAAoB,EAC/B,QAAQ,GAAW;CACjB,GAAuB;AACzB,EACF;;;;;;;;;;;;;;;;ECjBA,IAAM,IAAQ,GAER,IAAO,GAEP,KAAU,MACV,EAAM,YACD,EAAM,eAAe,IAEvB,MAAM,QAAQ,EAAM,UAAU,KAAK,EAAM,WAAW,SAAS,CAAE,GAGlE,KAAU,MAAqB;GACnC,IAAI,EAAM,WAAW;IACnB,EAAK,qBAAqB,EAAM,eAAe,IAAK,KAAK,CAAE;IAC3D;GACF;GACA,IAAM,IAAU,MAAM,QAAQ,EAAM,UAAU,IAAI,CAAC,GAAG,EAAM,UAAU,IAAI,CAAC,GACrE,IAAM,EAAQ,QAAQ,CAAE;GAG9B,AAFI,KAAO,IAAG,EAAQ,OAAO,GAAK,CAAC,IAC9B,EAAQ,KAAK,CAAE,GACpB,EAAK,qBAAqB,CAAO;EACnC;yBAIE,EA6BK,MA7BL,IA6BK,EAAA,EAAA,EAAA,GA5BH,EA2BK,GAAA,MAAA,EA1BY,EAAA,QAAR,YADT,EA2BK,MAAA;GAzBF,KAAK,EAAK;GACV,OAAK,EAAA,CAAA,qBAAwB,EAAO,EAAK,EAAE,IAAA,YAAA,IAAA,CAAA;MAE5C,EAWS,UAAA;GAVP,MAAK;GACL,OAAM;GACL,iBAAe,EAAO,EAAK,EAAE;GAC7B,iBAAa,sBAAwB,EAAK;GAC1C,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B,WAAW;GACb,CACF;GAkBA,AAhBA,EAAS,SAAS,MAAM,EAAS,QAAQ,EAAE,OAAO,CAAC,GAEnD,EAAM,SAAS,MAAS;IACtB,IAAM,KAAW,MAAmB;KAClC,EAAE,eAAe;KACjB,IAAM,KAAM,EAAK,aAAa,MAAM,KAAK,GAAA,CAAI,MAAM,CAAC,GAC9C,IAAU,IAAK,SAAS,eAAe,CAAE,IAAI;KACnD,AAAI,MACF,EAAQ,eAAe,EAAE,UAAU,SAAS,CAAC,GAC7C,EAAU,CAAE;IAEhB;IAEA,AADA,EAAK,iBAAiB,SAAS,CAAO,GACtC,EAAS,WAAW,EAAK,oBAAoB,SAAS,CAAO,CAAC;GAChE,CAAC,GAED,EAAS,WAAW,EAAS,WAAW,CAAC;EAC3C,CAAC;CACH,CAAC,GAED,QAAkB;EAEhB,AADA,EAAS,SAAS,MAAO,EAAG,CAAC,GAC7B,EAAS,SAAS;CACpB,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["$slots","$props","$slots","$slots","$slots"],"sources":["../src/composables/useTheme.ts","../src/plugin.ts","../src/components/VdAccordion.vue","../src/components/VdAccordion.vue","../src/components/VdIcon.vue","../src/components/VdIcon.vue","../src/components/VdAlert.vue","../src/components/VdAlert.vue","../src/components/VdAvatar.vue","../src/components/VdAvatar.vue","../src/components/VdBadge.vue","../src/components/VdBadge.vue","../src/components/VdButton.vue","../src/components/VdButton.vue","../src/components/VdButtonGroup.vue","../src/components/VdButtonGroup.vue","../src/components/VdCard.vue","../src/components/VdCard.vue","../src/components/VdCheckboxGroup.vue","../src/components/VdCheckboxGroup.vue","../src/components/VdChip.vue","../src/components/VdChip.vue","../src/components/VdCodeSnippet.vue","../src/components/VdCodeSnippet.vue","../src/components/VdCollection.vue","../src/components/VdCollection.vue","../src/components/VdCustomSelect.vue","../src/components/VdCustomSelect.vue","../src/components/VdFlow.vue","../src/components/VdFlow.vue","../src/components/VdInput.vue","../src/components/VdInput.vue","../src/components/VdModal.vue","../src/components/VdModal.vue","../src/components/VdOffcanvas.vue","../src/components/VdOffcanvas.vue","../src/components/VdPagination.vue","../src/components/VdPagination.vue","../src/components/VdPreloader.vue","../src/components/VdPreloader.vue","../src/components/VdProgress.vue","../src/components/VdProgress.vue","../src/components/VdRadioGroup.vue","../src/components/VdRadioGroup.vue","../src/components/VdRating.vue","../src/components/VdRating.vue","../src/components/VdSelect.vue","../src/components/VdSelect.vue","../src/components/VdSidenav.vue","../src/components/VdSidenav.vue","../src/components/VdSkeleton.vue","../src/components/VdSkeleton.vue","../src/components/VdSpinner.vue","../src/components/VdSpinner.vue","../src/components/VdTable.vue","../src/components/VdTable.vue","../src/components/VdTabs.vue","../src/components/VdTabs.vue","../src/components/VdToast.vue","../src/components/VdToast.vue","../src/composables/useToast.ts","../src/components/VdToastContainer.vue","../src/components/VdToastContainer.vue","../src/components/VdTooltip.vue","../src/components/VdTooltip.vue","../src/components/VdTransfer.vue","../src/components/VdTransfer.vue","../src/components/VdTreeNode.vue","../src/components/VdTreeNode.vue","../src/components/VdTree.vue","../src/components/VdTree.vue","../src/components/primitives/VdBox.vue","../src/components/primitives/VdBox.vue","../src/components/primitives/VdCenter.vue","../src/components/primitives/VdCenter.vue","../src/components/primitives/VdCover.vue","../src/components/primitives/VdCover.vue","../src/components/primitives/VdFrame.vue","../src/components/primitives/VdFrame.vue","../src/components/primitives/VdInline.vue","../src/components/primitives/VdInline.vue","../src/components/primitives/VdStack.vue","../src/components/primitives/VdStack.vue","../src/components/primitives/VdSwitcher.vue","../src/components/primitives/VdSwitcher.vue","../src/composables/useAffix.ts","../src/composables/useDatepicker.ts","../src/composables/useDraggable.ts","../src/composables/useDropdown.ts","../src/composables/useExpandingCards.ts","../src/composables/useFlow.ts","../src/composables/useFocusTrap.ts","../src/composables/useGlass.ts","../src/composables/useImageBox.ts","../src/composables/useKeyboardNav.ts","../src/composables/useMorph.ts","../src/composables/useMorphBadges.ts","../src/composables/useNavbarGlassScroll.ts","../src/composables/useParallax.ts","../src/composables/usePopover.ts","../src/composables/useRipple.ts","../src/composables/useScrollspy.ts","../src/composables/useSearch.ts","../src/composables/useSidenav.ts","../src/composables/useSpotlight.ts","../src/composables/useStepper.ts","../src/composables/useSuggest.ts","../src/composables/useTabs.ts","../src/composables/useTimeline.ts","../src/composables/useTimepicker.ts","../src/utils/sanitizeHtml.ts","../src/composables/useTooltips.ts","../src/composables/useValidate.ts","../src/composables/useWaypoint.ts"],"sourcesContent":["/**\n * Theme model for the Vue engine. Token *data* (palette/neutral/radius/font\n * options + defaults) is owned by @vanduo-oss/core — the design-system source of\n * truth shared with the Vanilla framework. This file keeps only the Vue-side\n * application logic that drives the same `data-*` attributes the framework CSS\n * reads. Re-exports core's data so vd2 consumers keep a single import surface.\n *\n * Defaults are the generic Vanduo baseline from core. Applications that need\n * site-specific defaults (e.g. a different default dark primary) override them\n * with `setThemeDefaults()` — typically via\n * `app.use(VanduoVue, { themeDefaults })` — before the theme model first reads\n * them.\n */\nimport {\n DEFAULTS as CORE_DEFAULTS,\n FONT_OPTIONS,\n NEUTRAL_COLORS,\n PALETTE_OPTIONS,\n PRIMARY_COLORS,\n RADIUS_OPTIONS,\n THEME_MODES,\n type ColorDef,\n type FontDef,\n type Palette,\n type PaletteDef,\n type RadiusOption,\n type ThemeDefaults,\n type ThemeMode,\n} from \"@vanduo-oss/core\";\n\nexport type {\n ColorDef,\n FontDef,\n Palette,\n PaletteDef,\n RadiusOption,\n ThemeDefaults,\n ThemeMode,\n};\nexport {\n FONT_OPTIONS,\n NEUTRAL_COLORS,\n PALETTE_OPTIONS,\n PRIMARY_COLORS,\n RADIUS_OPTIONS,\n THEME_MODES,\n};\n\n/**\n * Effective theme defaults: the generic core baseline, plus any site overrides\n * applied via `setThemeDefaults()`. Read lazily by the helpers below so a single\n * bootstrap-time override is reflected everywhere.\n */\nlet activeDefaults: ThemeDefaults = { ...CORE_DEFAULTS };\n\n/**\n * The defaults currently in effect (core baseline merged with overrides).\n * Returns a shallow copy so `setThemeDefaults()` stays the only mutation path —\n * callers can't accidentally corrupt the shared state via the returned object.\n */\nexport const getThemeDefaults = (): ThemeDefaults => ({ ...activeDefaults });\n\n/**\n * Override site-specific theme defaults. Shallow-merges over the current\n * defaults and returns the result. Call once during app bootstrap, before the\n * theme store first reads defaults (e.g.\n * `app.use(VanduoVue, { themeDefaults })`).\n */\nexport const setThemeDefaults = (\n overrides: Partial<ThemeDefaults>,\n): ThemeDefaults => {\n activeDefaults = { ...activeDefaults, ...overrides };\n return activeDefaults;\n};\n\nconst PALETTE_KEYS = PALETTE_OPTIONS.map((p) => p.key);\nconst isPalette = (value: string): value is Palette =>\n (PALETTE_KEYS as readonly string[]).includes(value);\n\nexport interface ThemePreference {\n palette: Palette;\n theme: ThemeMode;\n primary: string;\n neutral: string;\n radius: RadiusOption;\n font: string;\n}\n\nconst STORAGE_KEYS = {\n PALETTE: \"vanduo-palette\",\n PRIMARY: \"vanduo-primary-color\",\n NEUTRAL: \"vanduo-neutral-color\",\n RADIUS: \"vanduo-radius\",\n FONT: \"vanduo-font-preference\",\n THEME: \"vanduo-theme-preference\",\n} as const;\n\nconst isClient = (): boolean => typeof window !== \"undefined\";\n\nconst prefersDark = (): boolean => {\n if (!isClient() || typeof window.matchMedia !== \"function\") return false;\n const mq = window.matchMedia(\"(prefers-color-scheme: dark)\");\n return !!mq && mq.matches;\n};\n\n/** Default primary depends on the effective light/dark scheme. */\nexport const defaultPrimary = (theme: ThemeMode): string => {\n if (theme === \"system\") {\n return prefersDark()\n ? activeDefaults.PRIMARY_DARK\n : activeDefaults.PRIMARY_LIGHT;\n }\n return theme === \"dark\"\n ? activeDefaults.PRIMARY_DARK\n : activeDefaults.PRIMARY_LIGHT;\n};\n\nconst read = (key: string, fallback: string): string => {\n if (!isClient()) return fallback;\n try {\n return window.localStorage.getItem(key) ?? fallback;\n } catch {\n return fallback;\n }\n};\n\nconst write = (key: string, value: string): void => {\n if (!isClient()) return;\n try {\n window.localStorage.setItem(key, value);\n } catch {\n /* storage may be unavailable (private mode, quota) */\n }\n};\n\nexport const defaultPreference = (): ThemePreference => ({\n palette: activeDefaults.PALETTE,\n theme: activeDefaults.THEME,\n primary: defaultPrimary(activeDefaults.THEME),\n neutral: activeDefaults.NEUTRAL,\n radius: activeDefaults.RADIUS,\n font: activeDefaults.FONT,\n});\n\nexport const loadPreference = (): ThemePreference => {\n const theme = read(STORAGE_KEYS.THEME, activeDefaults.THEME) as ThemeMode;\n const radius = read(\n STORAGE_KEYS.RADIUS,\n activeDefaults.RADIUS,\n ) as RadiusOption;\n const palette = read(STORAGE_KEYS.PALETTE, activeDefaults.PALETTE);\n return {\n palette: isPalette(palette) ? palette : activeDefaults.PALETTE,\n theme: THEME_MODES.includes(theme) ? theme : activeDefaults.THEME,\n primary: read(STORAGE_KEYS.PRIMARY, defaultPrimary(theme)),\n neutral: read(STORAGE_KEYS.NEUTRAL, activeDefaults.NEUTRAL),\n radius: RADIUS_OPTIONS.includes(radius) ? radius : activeDefaults.RADIUS,\n font: read(STORAGE_KEYS.FONT, activeDefaults.FONT),\n };\n};\n\nconst isDefaultPrimary = (primary: string): boolean =>\n primary === activeDefaults.PRIMARY_LIGHT ||\n primary === activeDefaults.PRIMARY_DARK;\n\n/** Apply a full preference set to <html>, mirroring framework attribute logic. */\nexport const applyPreference = (prefs: ThemePreference): void => {\n if (!isClient()) return;\n const root = document.documentElement;\n\n // Keep auto-default primary aligned with the active scheme (black <-> blue).\n if (isDefaultPrimary(prefs.primary)) {\n prefs.primary = defaultPrimary(prefs.theme);\n }\n\n root.setAttribute(\"data-palette\", prefs.palette);\n root.setAttribute(\"data-primary\", prefs.primary);\n root.setAttribute(\"data-neutral\", prefs.neutral);\n root.setAttribute(\"data-radius\", prefs.radius);\n root.style.setProperty(\"--vd-radius-scale\", prefs.radius);\n\n if (prefs.font === \"system\") {\n root.removeAttribute(\"data-font\");\n } else {\n root.setAttribute(\"data-font\", prefs.font);\n }\n\n if (prefs.theme === \"system\") {\n root.removeAttribute(\"data-theme\");\n } else {\n root.setAttribute(\"data-theme\", prefs.theme);\n }\n};\n\nexport const persistPreference = (prefs: ThemePreference): void => {\n write(STORAGE_KEYS.PALETTE, prefs.palette);\n write(STORAGE_KEYS.THEME, prefs.theme);\n write(STORAGE_KEYS.PRIMARY, prefs.primary);\n write(STORAGE_KEYS.NEUTRAL, prefs.neutral);\n write(STORAGE_KEYS.RADIUS, prefs.radius);\n write(STORAGE_KEYS.FONT, prefs.font);\n};\n\nexport { isDefaultPrimary };\n","import type { App, Plugin } from \"vue\";\nimport type { ThemeDefaults } from \"@vanduo-oss/core\";\nimport { setThemeDefaults } from \"./composables/useTheme\";\n\n/**\n * The Vanilla engine's JavaScript (the `window.Vanduo*` globals that the\n * behaviour composables — dropdown, tooltip, draggable, … — delegate to) ships\n * as an IIFE bundle in `@vanduo-oss/framework`. It touches `window`/`document`,\n * so it must only run on the client.\n *\n * `loadVanduoRuntime()` loads it exactly once. Apps that need the globals to\n * exist *before* first mount (e.g. SSG hydration) should `await` it in their\n * bootstrap; `VanduoVue` also kicks it off on `app.use(...)` for the common case.\n */\nlet runtimePromise: Promise<unknown> | null = null;\n\nexport function loadVanduoRuntime(): Promise<unknown> {\n if (typeof window === \"undefined\") return Promise.resolve();\n if (!runtimePromise) {\n runtimePromise = import(\"@vanduo-oss/framework/iife\");\n }\n return runtimePromise;\n}\n\nexport interface VanduoVueOptions {\n /**\n * Site-specific theme default overrides, shallow-merged over the generic\n * core baseline (e.g. `{ PRIMARY_DARK: \"blue\" }`). Applied synchronously on\n * install, before the theme model first reads defaults.\n */\n themeDefaults?: Partial<ThemeDefaults>;\n}\n\n/**\n * Vue plugin: `app.use(VanduoVue, options?)`. Applies any `themeDefaults`\n * overrides, then triggers the client-only runtime load so the framework's JS\n * components initialise once the app mounts.\n */\nexport const VanduoVue: Plugin<VanduoVueOptions> = {\n install(_app: App, options: VanduoVueOptions = {}) {\n if (options.themeDefaults) {\n setThemeDefaults(options.themeDefaults);\n }\n void loadVanduoRuntime();\n },\n};\n\nexport default VanduoVue;\n","<script setup lang=\"ts\">\ninterface Item {\n id: string;\n title: string;\n content?: string;\n}\n\ninterface Props {\n items: Item[];\n modelValue: string | string[];\n exclusive?: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string | string[]] }>();\n\nconst isOpen = (id: string): boolean => {\n if (props.exclusive) {\n return props.modelValue === id;\n }\n return Array.isArray(props.modelValue) && props.modelValue.includes(id);\n};\n\nconst toggle = (id: string): void => {\n if (props.exclusive) {\n emit(\"update:modelValue\", props.modelValue === id ? \"\" : id);\n return;\n }\n const current = Array.isArray(props.modelValue) ? [...props.modelValue] : [];\n const idx = current.indexOf(id);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(id);\n emit(\"update:modelValue\", current);\n};\n</script>\n\n<template>\n <ul class=\"vd-accordion\">\n <li\n v-for=\"item in items\"\n :key=\"item.id\"\n :class=\"['vd-accordion-item', isOpen(item.id) ? 'is-open' : null]\"\n >\n <button\n type=\"button\"\n class=\"vd-accordion-header\"\n :aria-expanded=\"isOpen(item.id)\"\n :aria-controls=\"`vd-accordion-panel-${item.id}`\"\n @click=\"toggle(item.id)\"\n >\n <span>{{ item.title }}</span>\n <span class=\"vd-accordion-icon\" aria-hidden=\"true\">{{\n isOpen(item.id) ? \"−\" : \"+\"\n }}</span>\n </button>\n <div\n v-show=\"isOpen(item.id)\"\n :id=\"`vd-accordion-panel-${item.id}`\"\n class=\"vd-accordion-panel\"\n role=\"region\"\n >\n <slot :name=\"item.id\" :item=\"item\">\n {{ item.content }}\n </slot>\n </div>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\ninterface Item {\n id: string;\n title: string;\n content?: string;\n}\n\ninterface Props {\n items: Item[];\n modelValue: string | string[];\n exclusive?: boolean;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string | string[]] }>();\n\nconst isOpen = (id: string): boolean => {\n if (props.exclusive) {\n return props.modelValue === id;\n }\n return Array.isArray(props.modelValue) && props.modelValue.includes(id);\n};\n\nconst toggle = (id: string): void => {\n if (props.exclusive) {\n emit(\"update:modelValue\", props.modelValue === id ? \"\" : id);\n return;\n }\n const current = Array.isArray(props.modelValue) ? [...props.modelValue] : [];\n const idx = current.indexOf(id);\n if (idx >= 0) current.splice(idx, 1);\n else current.push(id);\n emit(\"update:modelValue\", current);\n};\n</script>\n\n<template>\n <ul class=\"vd-accordion\">\n <li\n v-for=\"item in items\"\n :key=\"item.id\"\n :class=\"['vd-accordion-item', isOpen(item.id) ? 'is-open' : null]\"\n >\n <button\n type=\"button\"\n class=\"vd-accordion-header\"\n :aria-expanded=\"isOpen(item.id)\"\n :aria-controls=\"`vd-accordion-panel-${item.id}`\"\n @click=\"toggle(item.id)\"\n >\n <span>{{ item.title }}</span>\n <span class=\"vd-accordion-icon\" aria-hidden=\"true\">{{\n isOpen(item.id) ? \"−\" : \"+\"\n }}</span>\n </button>\n <div\n v-show=\"isOpen(item.id)\"\n :id=\"`vd-accordion-panel-${item.id}`\"\n class=\"vd-accordion-panel\"\n role=\"region\"\n >\n <slot :name=\"item.id\" :item=\"item\">\n {{ item.content }}\n </slot>\n </div>\n </li>\n </ul>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n name: string;\n filled?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n filled: false,\n size: \"md\",\n});\n\nconst sizeClass = (): string => {\n switch (props.size) {\n case \"sm\":\n return \"vd-text-base\";\n case \"lg\":\n return \"vd-text-2xl\";\n default:\n return \"vd-text-xl\";\n }\n};\n</script>\n\n<template>\n <i\n :class=\"[props.filled ? 'ph-fill' : 'ph', `ph-${props.name}`, sizeClass()]\"\n aria-hidden=\"true\"\n />\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n name: string;\n filled?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n filled: false,\n size: \"md\",\n});\n\nconst sizeClass = (): string => {\n switch (props.size) {\n case \"sm\":\n return \"vd-text-base\";\n case \"lg\":\n return \"vd-text-2xl\";\n default:\n return \"vd-text-xl\";\n }\n};\n</script>\n\n<template>\n <i\n :class=\"[props.filled ? 'ph-fill' : 'ph', `ph-${props.name}`, sizeClass()]\"\n aria-hidden=\"true\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Variant = \"info\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n dismissible?: boolean;\n title?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"info\",\n dismissible: false,\n title: \"\",\n});\n\nconst emit = defineEmits<{ dismiss: [] }>();\n\nconst onDismiss = (): void => {\n emit(\"dismiss\");\n};\n\nconst iconName = (): string => {\n switch (props.variant) {\n case \"success\":\n return \"check-circle\";\n case \"warning\":\n return \"warning\";\n case \"danger\":\n return \"x-circle\";\n default:\n return \"info\";\n }\n};\n</script>\n\n<template>\n <div :class=\"['vd-alert', `vd-alert-${variant}`]\" role=\"alert\">\n <VdIcon :name=\"iconName()\" class=\"vd-alert-icon\" />\n <div class=\"vd-alert-body\">\n <p v-if=\"title\" class=\"vd-alert-title\">\n {{ title }}\n </p>\n <div class=\"vd-alert-content\">\n <slot />\n </div>\n </div>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-alert-dismiss\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n <VdIcon name=\"x\" />\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Variant = \"info\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n dismissible?: boolean;\n title?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"info\",\n dismissible: false,\n title: \"\",\n});\n\nconst emit = defineEmits<{ dismiss: [] }>();\n\nconst onDismiss = (): void => {\n emit(\"dismiss\");\n};\n\nconst iconName = (): string => {\n switch (props.variant) {\n case \"success\":\n return \"check-circle\";\n case \"warning\":\n return \"warning\";\n case \"danger\":\n return \"x-circle\";\n default:\n return \"info\";\n }\n};\n</script>\n\n<template>\n <div :class=\"['vd-alert', `vd-alert-${variant}`]\" role=\"alert\">\n <VdIcon :name=\"iconName()\" class=\"vd-alert-icon\" />\n <div class=\"vd-alert-body\">\n <p v-if=\"title\" class=\"vd-alert-title\">\n {{ title }}\n </p>\n <div class=\"vd-alert-content\">\n <slot />\n </div>\n </div>\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-alert-dismiss\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n <VdIcon name=\"x\" />\n </button>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Shape = \"circle\" | \"rounded\" | \"square\";\n\ninterface Props {\n src?: string;\n alt?: string;\n initials?: string;\n size?: Size;\n variant?: Variant;\n shape?: Shape;\n status?: \"online\" | \"offline\" | \"away\" | \"busy\";\n}\n\nwithDefaults(defineProps<Props>(), {\n src: \"\",\n alt: \"\",\n initials: \"\",\n size: \"md\",\n variant: \"primary\",\n shape: \"circle\",\n status: undefined,\n});\n</script>\n\n<template>\n <div\n class=\"vd-avatar\"\n :class=\"[`vd-avatar-${size}`, `vd-avatar-${variant}`, `vd-avatar-${shape}`]\"\n :aria-label=\"alt || initials || 'Avatar'\"\n >\n <img v-if=\"src\" :src=\"src\" :alt=\"alt\" class=\"vd-avatar-img\" />\n <span v-else-if=\"initials\" class=\"vd-avatar-initials\">\n {{ initials }}\n </span>\n <span v-else class=\"vd-avatar-initials\" aria-hidden=\"true\"> ? </span>\n <span\n v-if=\"status\"\n class=\"vd-avatar-status\"\n :class=\"`vd-avatar-status-${status}`\"\n :aria-label=\"`Status: ${status}`\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Shape = \"circle\" | \"rounded\" | \"square\";\n\ninterface Props {\n src?: string;\n alt?: string;\n initials?: string;\n size?: Size;\n variant?: Variant;\n shape?: Shape;\n status?: \"online\" | \"offline\" | \"away\" | \"busy\";\n}\n\nwithDefaults(defineProps<Props>(), {\n src: \"\",\n alt: \"\",\n initials: \"\",\n size: \"md\",\n variant: \"primary\",\n shape: \"circle\",\n status: undefined,\n});\n</script>\n\n<template>\n <div\n class=\"vd-avatar\"\n :class=\"[`vd-avatar-${size}`, `vd-avatar-${variant}`, `vd-avatar-${shape}`]\"\n :aria-label=\"alt || initials || 'Avatar'\"\n >\n <img v-if=\"src\" :src=\"src\" :alt=\"alt\" class=\"vd-avatar-img\" />\n <span v-else-if=\"initials\" class=\"vd-avatar-initials\">\n {{ initials }}\n </span>\n <span v-else class=\"vd-avatar-initials\" aria-hidden=\"true\"> ? </span>\n <span\n v-if=\"status\"\n class=\"vd-avatar-status\"\n :class=\"`vd-avatar-status-${status}`\"\n :aria-label=\"`Status: ${status}`\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"default\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n pill?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"default\",\n pill: false,\n});\n</script>\n\n<template>\n <span\n class=\"vd-badge\"\n :class=\"[\n variant !== 'default' ? `vd-badge-${variant}` : null,\n pill ? 'vd-badge-pill' : null,\n ]\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"default\" | \"success\" | \"warning\" | \"danger\";\n\ninterface Props {\n variant?: Variant;\n pill?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"default\",\n pill: false,\n});\n</script>\n\n<template>\n <span\n class=\"vd-badge\"\n :class=\"[\n variant !== 'default' ? `vd-badge-${variant}` : null,\n pill ? 'vd-badge-pill' : null,\n ]\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n loading?: boolean;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n loading: false,\n disabled: false,\n type: \"button\",\n});\n\nconst emit = defineEmits<{ click: [event: MouseEvent] }>();\n\nconst onClick = (event: MouseEvent): void => {\n if (props.disabled || props.loading) {\n event.preventDefault();\n return;\n }\n emit(\"click\", event);\n};\n</script>\n\n<template>\n <button\n :type=\"type\"\n :disabled=\"disabled || loading\"\n :class=\"[\n 'vd-btn',\n `vd-btn-${variant}`,\n size !== 'md' ? `vd-btn-${size}` : null,\n loading ? 'is-loading' : null,\n ]\"\n @click=\"onClick\"\n >\n <span v-if=\"loading\" class=\"vd-btn-spinner\" aria-hidden=\"true\" />\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\ntype Variant = \"primary\" | \"secondary\" | \"ghost\" | \"danger\";\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n loading?: boolean;\n disabled?: boolean;\n type?: \"button\" | \"submit\" | \"reset\";\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n loading: false,\n disabled: false,\n type: \"button\",\n});\n\nconst emit = defineEmits<{ click: [event: MouseEvent] }>();\n\nconst onClick = (event: MouseEvent): void => {\n if (props.disabled || props.loading) {\n event.preventDefault();\n return;\n }\n emit(\"click\", event);\n};\n</script>\n\n<template>\n <button\n :type=\"type\"\n :disabled=\"disabled || loading\"\n :class=\"[\n 'vd-btn',\n `vd-btn-${variant}`,\n size !== 'md' ? `vd-btn-${size}` : null,\n loading ? 'is-loading' : null,\n ]\"\n @click=\"onClick\"\n >\n <span v-if=\"loading\" class=\"vd-btn-spinner\" aria-hidden=\"true\" />\n <slot />\n </button>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n vertical?: boolean;\n fullWidth?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n vertical: false,\n fullWidth: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-btn-group\"\n :class=\"[\n `vd-btn-group-${size}`,\n { 'vd-btn-group-vertical': vertical, 'vd-btn-group-full': fullWidth },\n ]\"\n role=\"group\"\n >\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n vertical?: boolean;\n fullWidth?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n vertical: false,\n fullWidth: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-btn-group\"\n :class=\"[\n `vd-btn-group-${size}`,\n { 'vd-btn-group-vertical': vertical, 'vd-btn-group-full': fullWidth },\n ]\"\n role=\"group\"\n >\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n elevated?: boolean;\n interactive?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n elevated: false,\n interactive: false,\n});\n</script>\n\n<template>\n <section\n class=\"vd-card\"\n :class=\"[\n elevated ? 'vd-card-elevated' : null,\n interactive ? 'vd-card-interactive' : null,\n ]\"\n >\n <header v-if=\"$slots.header\" class=\"vd-card-header\">\n <slot name=\"header\" />\n </header>\n <div class=\"vd-card-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-card-footer\">\n <slot name=\"footer\" />\n </footer>\n </section>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n elevated?: boolean;\n interactive?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n elevated: false,\n interactive: false,\n});\n</script>\n\n<template>\n <section\n class=\"vd-card\"\n :class=\"[\n elevated ? 'vd-card-elevated' : null,\n interactive ? 'vd-card-interactive' : null,\n ]\"\n >\n <header v-if=\"$slots.header\" class=\"vd-card-header\">\n <slot name=\"header\" />\n </header>\n <div class=\"vd-card-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-card-footer\">\n <slot name=\"footer\" />\n </footer>\n </section>\n</template>\n","<script setup lang=\"ts\">\ninterface CheckOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly CheckOption[];\n modelValue: readonly string[];\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string[]] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n\nconst isChecked = (options: readonly string[], value: string): boolean =>\n options.includes(value);\n\nconst toggle = (current: readonly string[], value: string): string[] => {\n const next = [...current];\n const idx = next.indexOf(value);\n if (idx === -1) next.push(value);\n else next.splice(idx, 1);\n return next;\n};\n\nconst onChange = (props: Props, value: string): void => {\n emit(\"update:modelValue\", toggle(props.modelValue, value));\n};\n</script>\n\n<template>\n <div\n class=\"vd-form-check-group\"\n :class=\"{ 'vd-form-check-group-inline': inline }\"\n role=\"group\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-check\"\n :class=\"[`vd-form-check-${size}`, { 'vd-form-check-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"checkbox\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"isChecked(modelValue, opt.value)\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-check-input\"\n @change=\"onChange($props, opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-check-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface CheckOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly CheckOption[];\n modelValue: readonly string[];\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string[]] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n\nconst isChecked = (options: readonly string[], value: string): boolean =>\n options.includes(value);\n\nconst toggle = (current: readonly string[], value: string): string[] => {\n const next = [...current];\n const idx = next.indexOf(value);\n if (idx === -1) next.push(value);\n else next.splice(idx, 1);\n return next;\n};\n\nconst onChange = (props: Props, value: string): void => {\n emit(\"update:modelValue\", toggle(props.modelValue, value));\n};\n</script>\n\n<template>\n <div\n class=\"vd-form-check-group\"\n :class=\"{ 'vd-form-check-group-inline': inline }\"\n role=\"group\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-check\"\n :class=\"[`vd-form-check-${size}`, { 'vd-form-check-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"checkbox\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"isChecked(modelValue, opt.value)\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-check-input\"\n @change=\"onChange($props, opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-check-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n outline?: boolean;\n dismissible?: boolean;\n avatar?: string;\n clickable?: boolean;\n}\n\nconst emit = defineEmits<{\n dismiss: [];\n click: [event: MouseEvent];\n}>();\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n outline: false,\n dismissible: false,\n avatar: \"\",\n clickable: false,\n});\n\nconst onDismiss = (event: MouseEvent): void => {\n event.stopPropagation();\n emit(\"dismiss\");\n};\n</script>\n\n<template>\n <span\n class=\"vd-chip\"\n :class=\"[\n `vd-chip-${variant}`,\n `vd-chip-${size}`,\n {\n 'vd-chip-outline': outline,\n 'vd-chip-dismissible': dismissible,\n 'vd-chip-clickable': clickable,\n },\n ]\"\n role=\"status\"\n @click=\"clickable && emit('click', $event)\"\n >\n <img v-if=\"avatar\" :src=\"avatar\" class=\"vd-chip-avatar\" alt=\"\" />\n <slot />\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-chip-close\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n ×\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n outline?: boolean;\n dismissible?: boolean;\n avatar?: string;\n clickable?: boolean;\n}\n\nconst emit = defineEmits<{\n dismiss: [];\n click: [event: MouseEvent];\n}>();\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n outline: false,\n dismissible: false,\n avatar: \"\",\n clickable: false,\n});\n\nconst onDismiss = (event: MouseEvent): void => {\n event.stopPropagation();\n emit(\"dismiss\");\n};\n</script>\n\n<template>\n <span\n class=\"vd-chip\"\n :class=\"[\n `vd-chip-${variant}`,\n `vd-chip-${size}`,\n {\n 'vd-chip-outline': outline,\n 'vd-chip-dismissible': dismissible,\n 'vd-chip-clickable': clickable,\n },\n ]\"\n role=\"status\"\n @click=\"clickable && emit('click', $event)\"\n >\n <img v-if=\"avatar\" :src=\"avatar\" class=\"vd-chip-avatar\" alt=\"\" />\n <slot />\n <button\n v-if=\"dismissible\"\n type=\"button\"\n class=\"vd-chip-close\"\n aria-label=\"Dismiss\"\n @click=\"onDismiss\"\n >\n ×\n </button>\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n code: string;\n language?: string;\n copyable?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n language: \"html\",\n copyable: true,\n});\n\nconst copied = ref(false);\n\nconst onCopy = async (code: string): Promise<void> => {\n if (typeof navigator === \"undefined\" || !navigator.clipboard) return;\n try {\n await navigator.clipboard.writeText(code);\n copied.value = true;\n setTimeout(() => {\n copied.value = false;\n }, 1500);\n } catch {\n /* clipboard may be blocked */\n }\n};\n</script>\n\n<template>\n <figure class=\"vd-code-snippet\">\n <pre\n :class=\"['vd-code-snippet-pre', `language-${language}`]\"\n :data-language=\"language\"\n ><code>{{ code }}</code></pre>\n <button\n v-if=\"copyable\"\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-sm vd-code-snippet-copy\"\n :aria-label=\"copied ? 'Copied' : 'Copy code'\"\n @click=\"onCopy(code)\"\n >\n <VdIcon :name=\"copied ? 'check' : 'copy'\" />\n <span>{{ copied ? \"Copied\" : \"Copy\" }}</span>\n </button>\n </figure>\n</template>\n","<script setup lang=\"ts\">\nimport { ref } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n code: string;\n language?: string;\n copyable?: boolean;\n}\n\nwithDefaults(defineProps<Props>(), {\n language: \"html\",\n copyable: true,\n});\n\nconst copied = ref(false);\n\nconst onCopy = async (code: string): Promise<void> => {\n if (typeof navigator === \"undefined\" || !navigator.clipboard) return;\n try {\n await navigator.clipboard.writeText(code);\n copied.value = true;\n setTimeout(() => {\n copied.value = false;\n }, 1500);\n } catch {\n /* clipboard may be blocked */\n }\n};\n</script>\n\n<template>\n <figure class=\"vd-code-snippet\">\n <pre\n :class=\"['vd-code-snippet-pre', `language-${language}`]\"\n :data-language=\"language\"\n ><code>{{ code }}</code></pre>\n <button\n v-if=\"copyable\"\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-sm vd-code-snippet-copy\"\n :aria-label=\"copied ? 'Copied' : 'Copy code'\"\n @click=\"onCopy(code)\"\n >\n <VdIcon :name=\"copied ? 'check' : 'copy'\" />\n <span>{{ copied ? \"Copied\" : \"Copy\" }}</span>\n </button>\n </figure>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface CollectionItem {\n id: string | number;\n avatar?: string;\n title: string;\n subtitle?: string;\n action?: string;\n}\n\ninterface Props {\n items: readonly CollectionItem[];\n header?: string;\n hoverable?: boolean;\n bordered?: boolean;\n size?: Size;\n}\n\nwithDefaults(defineProps<Props>(), {\n header: \"\",\n hoverable: false,\n bordered: false,\n size: \"md\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-collection\"\n :class=\"[\n `vd-collection-${size}`,\n {\n 'vd-collection-hoverable': hoverable,\n 'vd-collection-bordered': bordered,\n },\n ]\"\n >\n <div v-if=\"header\" class=\"vd-collection-header\">\n <h3 class=\"vd-collection-title\">\n {{ header }}\n </h3>\n </div>\n <ul class=\"vd-collection-list\">\n <li v-for=\"item in items\" :key=\"item.id\" class=\"vd-collection-item\">\n <div v-if=\"item.avatar\" class=\"vd-collection-avatar\">\n <img :src=\"item.avatar\" :alt=\"item.subtitle || item.title\" />\n </div>\n <div class=\"vd-collection-content\">\n <div class=\"vd-collection-text\">\n <strong class=\"vd-collection-title\">{{ item.title }}</strong>\n <span v-if=\"item.subtitle\" class=\"vd-collection-text-secondary\">{{\n item.subtitle\n }}</span>\n </div>\n </div>\n <div v-if=\"item.action\" class=\"vd-collection-action\">\n {{ item.action }}\n </div>\n </li>\n </ul>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface CollectionItem {\n id: string | number;\n avatar?: string;\n title: string;\n subtitle?: string;\n action?: string;\n}\n\ninterface Props {\n items: readonly CollectionItem[];\n header?: string;\n hoverable?: boolean;\n bordered?: boolean;\n size?: Size;\n}\n\nwithDefaults(defineProps<Props>(), {\n header: \"\",\n hoverable: false,\n bordered: false,\n size: \"md\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-collection\"\n :class=\"[\n `vd-collection-${size}`,\n {\n 'vd-collection-hoverable': hoverable,\n 'vd-collection-bordered': bordered,\n },\n ]\"\n >\n <div v-if=\"header\" class=\"vd-collection-header\">\n <h3 class=\"vd-collection-title\">\n {{ header }}\n </h3>\n </div>\n <ul class=\"vd-collection-list\">\n <li v-for=\"item in items\" :key=\"item.id\" class=\"vd-collection-item\">\n <div v-if=\"item.avatar\" class=\"vd-collection-avatar\">\n <img :src=\"item.avatar\" :alt=\"item.subtitle || item.title\" />\n </div>\n <div class=\"vd-collection-content\">\n <div class=\"vd-collection-text\">\n <strong class=\"vd-collection-title\">{{ item.title }}</strong>\n <span v-if=\"item.subtitle\" class=\"vd-collection-text-secondary\">{{\n item.subtitle\n }}</span>\n </div>\n </div>\n <div v-if=\"item.action\" class=\"vd-collection-action\">\n {{ item.action }}\n </div>\n </li>\n </ul>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref } from \"vue\";\n\ninterface CustomSelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly CustomSelectOption[];\n id?: string;\n name?: string;\n placeholder?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n id: \"\",\n name: \"\",\n placeholder: \"Select...\",\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst open = ref(false);\nconst activeIndex = ref(-1);\nconst wrapper = ref<HTMLElement | null>(null);\nconst buttonId = computed(() => props.id || props.name || \"custom-select\");\n\nconst selectableIndexes = computed(() =>\n props.options.flatMap((o, i) => (o.disabled ? [] : [i])),\n);\n\nconst buttonText = computed(() => {\n const match = props.options.find((o) => o.value === props.modelValue);\n return match ? match.label : props.placeholder;\n});\n\nconst openDropdown = (): void => {\n open.value = true;\n const selectedIdx = props.options.findIndex(\n (o) => o.value === props.modelValue,\n );\n activeIndex.value =\n selectedIdx >= 0 && !props.options[selectedIdx]?.disabled\n ? selectedIdx\n : (selectableIndexes.value[0] ?? -1);\n};\n\nconst closeDropdown = (): void => {\n open.value = false;\n};\n\nconst toggle = (): void => {\n if (open.value) closeDropdown();\n else openDropdown();\n};\n\nconst selectOption = (option: CustomSelectOption): void => {\n if (option.disabled) return;\n emit(\"update:modelValue\", option.value);\n closeDropdown();\n};\n\nconst moveActive = (delta: number): void => {\n const list = selectableIndexes.value;\n if (list.length === 0) return;\n const pos = list.indexOf(activeIndex.value);\n const nextPos = pos < 0 ? 0 : (pos + delta + list.length) % list.length;\n activeIndex.value = list[nextPos] ?? -1;\n};\n\n// Per-instance typeahead, mirroring select.js\nlet typeaheadBuffer = \"\";\nlet typeaheadTimer: number | null = null;\n\nconst onKeydown = (e: KeyboardEvent): void => {\n switch (e.key) {\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (open.value && activeIndex.value >= 0) {\n const opt = props.options[activeIndex.value];\n if (opt) selectOption(opt);\n } else {\n openDropdown();\n }\n break;\n case \"Escape\":\n if (open.value) {\n e.preventDefault();\n closeDropdown();\n }\n break;\n case \"ArrowDown\":\n e.preventDefault();\n if (!open.value) openDropdown();\n else moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (open.value) moveActive(-1);\n break;\n case \"Home\":\n if (open.value) {\n e.preventDefault();\n activeIndex.value = selectableIndexes.value[0] ?? -1;\n }\n break;\n case \"End\":\n if (open.value) {\n e.preventDefault();\n const list = selectableIndexes.value;\n activeIndex.value = list[list.length - 1] ?? -1;\n }\n break;\n default:\n if (\n open.value &&\n e.key.length === 1 &&\n !e.ctrlKey &&\n !e.metaKey &&\n !e.altKey\n ) {\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n typeaheadBuffer += e.key.toLowerCase();\n const match = props.options.findIndex(\n (o) =>\n !o.disabled && o.label.toLowerCase().startsWith(typeaheadBuffer),\n );\n if (match >= 0) activeIndex.value = match;\n typeaheadTimer = window.setTimeout(() => {\n typeaheadBuffer = \"\";\n }, 500);\n }\n }\n};\n\nconst onDocumentClick = (e: MouseEvent): void => {\n if (\n open.value &&\n wrapper.value &&\n !wrapper.value.contains(e.target as Node)\n ) {\n closeDropdown();\n }\n};\n\nonMounted(() => document.addEventListener(\"click\", onDocumentClick));\nonBeforeUnmount(() => {\n document.removeEventListener(\"click\", onDocumentClick);\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n});\n</script>\n\n<template>\n <div ref=\"wrapper\" class=\"custom-select-wrapper\">\n <select\n :id=\"id || undefined\"\n :name=\"name || undefined\"\n :value=\"modelValue\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n >\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <button\n type=\"button\"\n class=\"custom-select-button\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"open ? 'true' : 'false'\"\n :aria-labelledby=\"buttonId\"\n @click.stop=\"toggle\"\n @keydown=\"onKeydown\"\n >\n {{ buttonText }}\n </button>\n <div\n class=\"custom-select-dropdown\"\n :class=\"{ 'is-open': open }\"\n role=\"listbox\"\n >\n <div\n v-for=\"(opt, i) in options\"\n :key=\"opt.value\"\n class=\"custom-select-option\"\n :class=\"{\n 'is-selected': opt.value === modelValue,\n 'is-disabled': opt.disabled,\n 'is-active': i === activeIndex,\n }\"\n role=\"option\"\n :data-value=\"opt.value\"\n :aria-selected=\"opt.value === modelValue ? 'true' : 'false'\"\n :aria-disabled=\"opt.disabled ? 'true' : undefined\"\n @click=\"selectOption(opt)\"\n @mouseenter=\"activeIndex = i\"\n >\n {{ opt.label }}\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, ref } from \"vue\";\n\ninterface CustomSelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly CustomSelectOption[];\n id?: string;\n name?: string;\n placeholder?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n id: \"\",\n name: \"\",\n placeholder: \"Select...\",\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst open = ref(false);\nconst activeIndex = ref(-1);\nconst wrapper = ref<HTMLElement | null>(null);\nconst buttonId = computed(() => props.id || props.name || \"custom-select\");\n\nconst selectableIndexes = computed(() =>\n props.options.flatMap((o, i) => (o.disabled ? [] : [i])),\n);\n\nconst buttonText = computed(() => {\n const match = props.options.find((o) => o.value === props.modelValue);\n return match ? match.label : props.placeholder;\n});\n\nconst openDropdown = (): void => {\n open.value = true;\n const selectedIdx = props.options.findIndex(\n (o) => o.value === props.modelValue,\n );\n activeIndex.value =\n selectedIdx >= 0 && !props.options[selectedIdx]?.disabled\n ? selectedIdx\n : (selectableIndexes.value[0] ?? -1);\n};\n\nconst closeDropdown = (): void => {\n open.value = false;\n};\n\nconst toggle = (): void => {\n if (open.value) closeDropdown();\n else openDropdown();\n};\n\nconst selectOption = (option: CustomSelectOption): void => {\n if (option.disabled) return;\n emit(\"update:modelValue\", option.value);\n closeDropdown();\n};\n\nconst moveActive = (delta: number): void => {\n const list = selectableIndexes.value;\n if (list.length === 0) return;\n const pos = list.indexOf(activeIndex.value);\n const nextPos = pos < 0 ? 0 : (pos + delta + list.length) % list.length;\n activeIndex.value = list[nextPos] ?? -1;\n};\n\n// Per-instance typeahead, mirroring select.js\nlet typeaheadBuffer = \"\";\nlet typeaheadTimer: number | null = null;\n\nconst onKeydown = (e: KeyboardEvent): void => {\n switch (e.key) {\n case \"Enter\":\n case \" \":\n e.preventDefault();\n if (open.value && activeIndex.value >= 0) {\n const opt = props.options[activeIndex.value];\n if (opt) selectOption(opt);\n } else {\n openDropdown();\n }\n break;\n case \"Escape\":\n if (open.value) {\n e.preventDefault();\n closeDropdown();\n }\n break;\n case \"ArrowDown\":\n e.preventDefault();\n if (!open.value) openDropdown();\n else moveActive(1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (open.value) moveActive(-1);\n break;\n case \"Home\":\n if (open.value) {\n e.preventDefault();\n activeIndex.value = selectableIndexes.value[0] ?? -1;\n }\n break;\n case \"End\":\n if (open.value) {\n e.preventDefault();\n const list = selectableIndexes.value;\n activeIndex.value = list[list.length - 1] ?? -1;\n }\n break;\n default:\n if (\n open.value &&\n e.key.length === 1 &&\n !e.ctrlKey &&\n !e.metaKey &&\n !e.altKey\n ) {\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n typeaheadBuffer += e.key.toLowerCase();\n const match = props.options.findIndex(\n (o) =>\n !o.disabled && o.label.toLowerCase().startsWith(typeaheadBuffer),\n );\n if (match >= 0) activeIndex.value = match;\n typeaheadTimer = window.setTimeout(() => {\n typeaheadBuffer = \"\";\n }, 500);\n }\n }\n};\n\nconst onDocumentClick = (e: MouseEvent): void => {\n if (\n open.value &&\n wrapper.value &&\n !wrapper.value.contains(e.target as Node)\n ) {\n closeDropdown();\n }\n};\n\nonMounted(() => document.addEventListener(\"click\", onDocumentClick));\nonBeforeUnmount(() => {\n document.removeEventListener(\"click\", onDocumentClick);\n if (typeaheadTimer != null) window.clearTimeout(typeaheadTimer);\n});\n</script>\n\n<template>\n <div ref=\"wrapper\" class=\"custom-select-wrapper\">\n <select\n :id=\"id || undefined\"\n :name=\"name || undefined\"\n :value=\"modelValue\"\n tabindex=\"-1\"\n aria-hidden=\"true\"\n >\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <button\n type=\"button\"\n class=\"custom-select-button\"\n aria-haspopup=\"listbox\"\n :aria-expanded=\"open ? 'true' : 'false'\"\n :aria-labelledby=\"buttonId\"\n @click.stop=\"toggle\"\n @keydown=\"onKeydown\"\n >\n {{ buttonText }}\n </button>\n <div\n class=\"custom-select-dropdown\"\n :class=\"{ 'is-open': open }\"\n role=\"listbox\"\n >\n <div\n v-for=\"(opt, i) in options\"\n :key=\"opt.value\"\n class=\"custom-select-option\"\n :class=\"{\n 'is-selected': opt.value === modelValue,\n 'is-disabled': opt.disabled,\n 'is-active': i === activeIndex,\n }\"\n role=\"option\"\n :data-value=\"opt.value\"\n :aria-selected=\"opt.value === modelValue ? 'true' : 'false'\"\n :aria-disabled=\"opt.disabled ? 'true' : undefined\"\n @click=\"selectOption(opt)\"\n @mouseenter=\"activeIndex = i\"\n >\n {{ opt.label }}\n </div>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\ninterface Props {\n modelValue: number;\n total: number;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst index = ref(props.modelValue);\n\nconst go = (next: number): void => {\n const clamped = Math.max(0, Math.min(props.total - 1, next));\n if (clamped !== index.value) {\n index.value = clamped;\n emit(\"update:modelValue\", clamped);\n }\n};\n\nconst prev = (): void => go(index.value - 1);\nconst next = (): void => go(index.value + 1);\n\ndefineExpose({ go, prev, next, index });\n\nconst slides = computed(() => Array.from({ length: props.total }, (_, i) => i));\n</script>\n\n<template>\n <div class=\"vd-flow\" role=\"region\" aria-roledescription=\"carousel\">\n <div\n class=\"vd-flow-track\"\n :style=\"{ transform: `translateX(-${index * 100}%)` }\"\n >\n <div\n v-for=\"i in slides\"\n :key=\"i\"\n class=\"vd-flow-slide\"\n :aria-hidden=\"i !== index\"\n >\n <slot :name=\"`slide-${i}`\" :index=\"i\" />\n </div>\n </div>\n <div v-if=\"total > 1\" class=\"vd-flow-controls\">\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Previous slide\"\n :disabled=\"index === 0\"\n @click=\"prev\"\n >\n ‹\n </button>\n <span class=\"vd-flow-position\">{{ index + 1 }} / {{ total }}</span>\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Next slide\"\n :disabled=\"index === total - 1\"\n @click=\"next\"\n >\n ›\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\ninterface Props {\n modelValue: number;\n total: number;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst index = ref(props.modelValue);\n\nconst go = (next: number): void => {\n const clamped = Math.max(0, Math.min(props.total - 1, next));\n if (clamped !== index.value) {\n index.value = clamped;\n emit(\"update:modelValue\", clamped);\n }\n};\n\nconst prev = (): void => go(index.value - 1);\nconst next = (): void => go(index.value + 1);\n\ndefineExpose({ go, prev, next, index });\n\nconst slides = computed(() => Array.from({ length: props.total }, (_, i) => i));\n</script>\n\n<template>\n <div class=\"vd-flow\" role=\"region\" aria-roledescription=\"carousel\">\n <div\n class=\"vd-flow-track\"\n :style=\"{ transform: `translateX(-${index * 100}%)` }\"\n >\n <div\n v-for=\"i in slides\"\n :key=\"i\"\n class=\"vd-flow-slide\"\n :aria-hidden=\"i !== index\"\n >\n <slot :name=\"`slide-${i}`\" :index=\"i\" />\n </div>\n </div>\n <div v-if=\"total > 1\" class=\"vd-flow-controls\">\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Previous slide\"\n :disabled=\"index === 0\"\n @click=\"prev\"\n >\n ‹\n </button>\n <span class=\"vd-flow-position\">{{ index + 1 }} / {{ total }}</span>\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Next slide\"\n :disabled=\"index === total - 1\"\n @click=\"next\"\n >\n ›\n </button>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant = \"default\" | \"error\" | \"success\";\n\ninterface Props {\n modelValue: string;\n type?: string;\n placeholder?: string;\n size?: Size;\n variant?: Variant;\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n minlength?: number;\n maxlength?: number;\n pattern?: string;\n autocomplete?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n type: \"text\",\n placeholder: \"\",\n size: \"md\",\n variant: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n name: \"\",\n id: \"\",\n minlength: undefined,\n maxlength: undefined,\n pattern: \"\",\n autocomplete: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n blur: [event: FocusEvent];\n focus: [event: FocusEvent];\n}>();\n\nconst onInput = (event: Event): void => {\n const target = event.target as HTMLInputElement;\n emit(\"update:modelValue\", target.value);\n};\n\n// Workaround for typed optional number props\nconst numberOrUndefined = (n: number | undefined): number | undefined => n;\nvoid numberOrUndefined(props.minlength);\nvoid numberOrUndefined(props.maxlength);\n</script>\n\n<template>\n <input\n :id=\"id || name\"\n :type=\"type\"\n :name=\"name\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :minlength=\"minlength\"\n :maxlength=\"maxlength\"\n :pattern=\"pattern\"\n :autocomplete=\"autocomplete\"\n class=\"vd-input\"\n :class=\"[\n `vd-input-${size}`,\n variant !== 'default' ? `vd-input-${variant}` : null,\n ]\"\n @input=\"onInput\"\n @blur=\"(e) => emit('blur', e)\"\n @focus=\"(e) => emit('focus', e)\"\n />\n</template>\n","<script setup lang=\"ts\">\ntype Size = \"sm\" | \"md\" | \"lg\";\ntype Variant = \"default\" | \"error\" | \"success\";\n\ninterface Props {\n modelValue: string;\n type?: string;\n placeholder?: string;\n size?: Size;\n variant?: Variant;\n disabled?: boolean;\n readonly?: boolean;\n required?: boolean;\n name?: string;\n id?: string;\n minlength?: number;\n maxlength?: number;\n pattern?: string;\n autocomplete?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n type: \"text\",\n placeholder: \"\",\n size: \"md\",\n variant: \"default\",\n disabled: false,\n readonly: false,\n required: false,\n name: \"\",\n id: \"\",\n minlength: undefined,\n maxlength: undefined,\n pattern: \"\",\n autocomplete: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: string];\n blur: [event: FocusEvent];\n focus: [event: FocusEvent];\n}>();\n\nconst onInput = (event: Event): void => {\n const target = event.target as HTMLInputElement;\n emit(\"update:modelValue\", target.value);\n};\n\n// Workaround for typed optional number props\nconst numberOrUndefined = (n: number | undefined): number | undefined => n;\nvoid numberOrUndefined(props.minlength);\nvoid numberOrUndefined(props.maxlength);\n</script>\n\n<template>\n <input\n :id=\"id || name\"\n :type=\"type\"\n :name=\"name\"\n :value=\"modelValue\"\n :placeholder=\"placeholder\"\n :disabled=\"disabled\"\n :readonly=\"readonly\"\n :required=\"required\"\n :minlength=\"minlength\"\n :maxlength=\"maxlength\"\n :pattern=\"pattern\"\n :autocomplete=\"autocomplete\"\n class=\"vd-input\"\n :class=\"[\n `vd-input-${size}`,\n variant !== 'default' ? `vd-input-${variant}` : null,\n ]\"\n @input=\"onInput\"\n @blur=\"(e) => emit('blur', e)\"\n @focus=\"(e) => emit('focus', e)\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n open: boolean;\n title?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n closeOnBackdrop?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n title: \"\",\n size: \"md\",\n closeOnBackdrop: true,\n});\n\nconst emit = defineEmits<{\n \"update:open\": [value: boolean];\n close: [];\n}>();\n\nconst panel = ref<HTMLElement | null>(null);\n\nconst sizeClass = computed(() => `vd-modal-panel-${props.size}`);\n\nconst close = (): void => {\n emit(\"update:open\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.open) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n }\n};\n\nwatch(\n () => props.open,\n async (open) => {\n if (typeof window === \"undefined\") return;\n if (open) {\n window.addEventListener(\"keydown\", onKeydown);\n await nextTick();\n panel.value?.focus();\n } else {\n window.removeEventListener(\"keydown\", onKeydown);\n }\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"open\"\n class=\"vd-modal vd-modal-open\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || 'Dialog'\"\n data-vd-modal\n >\n <div class=\"vd-modal-backdrop\" @click=\"onBackdrop\" />\n <div ref=\"panel\" :class=\"['vd-modal-panel', sizeClass]\" tabindex=\"-1\">\n <header v-if=\"title || $slots.header\" class=\"vd-modal-header\">\n <h2 v-if=\"title\" class=\"vd-modal-title\">\n {{ title }}\n </h2>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n <VdIcon name=\"x\" />\n </button>\n </header>\n <div class=\"vd-modal-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-modal-footer\">\n <slot name=\"footer\" />\n </footer>\n </div>\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, nextTick, ref, watch } from \"vue\";\nimport VdIcon from \"./VdIcon.vue\";\n\ninterface Props {\n open: boolean;\n title?: string;\n size?: \"sm\" | \"md\" | \"lg\";\n closeOnBackdrop?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n title: \"\",\n size: \"md\",\n closeOnBackdrop: true,\n});\n\nconst emit = defineEmits<{\n \"update:open\": [value: boolean];\n close: [];\n}>();\n\nconst panel = ref<HTMLElement | null>(null);\n\nconst sizeClass = computed(() => `vd-modal-panel-${props.size}`);\n\nconst close = (): void => {\n emit(\"update:open\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.open) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n }\n};\n\nwatch(\n () => props.open,\n async (open) => {\n if (typeof window === \"undefined\") return;\n if (open) {\n window.addEventListener(\"keydown\", onKeydown);\n await nextTick();\n panel.value?.focus();\n } else {\n window.removeEventListener(\"keydown\", onKeydown);\n }\n },\n { immediate: true },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"open\"\n class=\"vd-modal vd-modal-open\"\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || 'Dialog'\"\n data-vd-modal\n >\n <div class=\"vd-modal-backdrop\" @click=\"onBackdrop\" />\n <div ref=\"panel\" :class=\"['vd-modal-panel', sizeClass]\" tabindex=\"-1\">\n <header v-if=\"title || $slots.header\" class=\"vd-modal-header\">\n <h2 v-if=\"title\" class=\"vd-modal-title\">\n {{ title }}\n </h2>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-btn vd-btn-ghost vd-btn-icon\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n <VdIcon name=\"x\" />\n </button>\n </header>\n <div class=\"vd-modal-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-modal-footer\">\n <slot name=\"footer\" />\n </footer>\n </div>\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"right\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-offcanvas\"\n :class=\"[`vd-offcanvas-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Off-canvas panel'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"right\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-offcanvas\"\n :class=\"[`vd-offcanvas-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Off-canvas panel'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/pagination.js. Reproduces\n * the framework's DOM contract — `.vd-pagination` list of\n * `.vd-pagination-item` (`<a class=\"vd-pagination-link\">`), `.active` /\n * `.disabled` states, prev/next, and ellipses via the framework's exact\n * `calculatePages` algorithm — with a clean `v-model` API. Dispatches a native\n * `pagination:change` ({ page, totalPages }) alongside `update:modelValue`.\n */\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n modelValue: number;\n total: number;\n maxVisible?: number;\n size?: Size;\n align?: \"left\" | \"center\" | \"right\";\n disabled?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n maxVisible: 7,\n size: \"md\",\n align: \"left\",\n disabled: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst calculatePages = (\n currentPage: number,\n totalPages: number,\n maxVisible: number,\n): (number | \"ellipsis\")[] => {\n const pages: (number | \"ellipsis\")[] = [];\n const half = Math.floor(maxVisible / 2);\n\n if (totalPages <= maxVisible) {\n for (let i = 1; i <= totalPages; i++) pages.push(i);\n return pages;\n }\n\n pages.push(1);\n let start = Math.max(2, currentPage - half);\n let end = Math.min(totalPages - 1, currentPage + half);\n if (currentPage <= half + 1) end = Math.min(totalPages - 1, maxVisible - 1);\n if (currentPage >= totalPages - half)\n start = Math.max(2, totalPages - maxVisible + 2);\n\n if (start > 2) pages.push(\"ellipsis\");\n for (let i = start; i <= end; i++) pages.push(i);\n if (end < totalPages - 1) pages.push(\"ellipsis\");\n if (totalPages > 1) pages.push(totalPages);\n return pages;\n};\n\nconst pages = computed(() =>\n calculatePages(props.modelValue, props.total, props.maxVisible),\n);\n\nconst go = (page: number): void => {\n if (props.disabled) return;\n if (page < 1 || page > props.total || page === props.modelValue) return;\n emit(\"update:modelValue\", page);\n root.value?.dispatchEvent(\n new CustomEvent(\"pagination:change\", {\n bubbles: true,\n detail: { page, totalPages: props.total },\n }),\n );\n};\n</script>\n\n<template>\n <nav ref=\"root\" aria-label=\"Pagination\">\n <ul\n class=\"vd-pagination\"\n :class=\"[`vd-pagination-${size}`, `vd-pagination-${align}`]\"\n >\n <li\n class=\"vd-pagination-item vd-pagination-prev\"\n :class=\"{ disabled: disabled || modelValue <= 1 }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Previous\"\n @click.prevent=\"go(modelValue - 1)\"\n >Previous</a\n >\n </li>\n\n <template v-for=\"(item, idx) in pages\" :key=\"idx\">\n <li v-if=\"item === 'ellipsis'\" class=\"vd-pagination-item\">\n <span class=\"vd-pagination-ellipsis\" aria-hidden=\"true\">…</span>\n </li>\n <li\n v-else\n class=\"vd-pagination-item\"\n :class=\"{ active: item === modelValue }\"\n :data-page=\"item\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n :aria-label=\"`Page ${item}`\"\n :aria-current=\"item === modelValue ? 'page' : undefined\"\n @click.prevent=\"go(item)\"\n >{{ item }}</a\n >\n </li>\n </template>\n\n <li\n class=\"vd-pagination-item vd-pagination-next\"\n :class=\"{ disabled: disabled || modelValue >= total }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Next\"\n @click.prevent=\"go(modelValue + 1)\"\n >Next</a\n >\n </li>\n </ul>\n </nav>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/pagination.js. Reproduces\n * the framework's DOM contract — `.vd-pagination` list of\n * `.vd-pagination-item` (`<a class=\"vd-pagination-link\">`), `.active` /\n * `.disabled` states, prev/next, and ellipses via the framework's exact\n * `calculatePages` algorithm — with a clean `v-model` API. Dispatches a native\n * `pagination:change` ({ page, totalPages }) alongside `update:modelValue`.\n */\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n modelValue: number;\n total: number;\n maxVisible?: number;\n size?: Size;\n align?: \"left\" | \"center\" | \"right\";\n disabled?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n maxVisible: 7,\n size: \"md\",\n align: \"left\",\n disabled: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: number] }>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst calculatePages = (\n currentPage: number,\n totalPages: number,\n maxVisible: number,\n): (number | \"ellipsis\")[] => {\n const pages: (number | \"ellipsis\")[] = [];\n const half = Math.floor(maxVisible / 2);\n\n if (totalPages <= maxVisible) {\n for (let i = 1; i <= totalPages; i++) pages.push(i);\n return pages;\n }\n\n pages.push(1);\n let start = Math.max(2, currentPage - half);\n let end = Math.min(totalPages - 1, currentPage + half);\n if (currentPage <= half + 1) end = Math.min(totalPages - 1, maxVisible - 1);\n if (currentPage >= totalPages - half)\n start = Math.max(2, totalPages - maxVisible + 2);\n\n if (start > 2) pages.push(\"ellipsis\");\n for (let i = start; i <= end; i++) pages.push(i);\n if (end < totalPages - 1) pages.push(\"ellipsis\");\n if (totalPages > 1) pages.push(totalPages);\n return pages;\n};\n\nconst pages = computed(() =>\n calculatePages(props.modelValue, props.total, props.maxVisible),\n);\n\nconst go = (page: number): void => {\n if (props.disabled) return;\n if (page < 1 || page > props.total || page === props.modelValue) return;\n emit(\"update:modelValue\", page);\n root.value?.dispatchEvent(\n new CustomEvent(\"pagination:change\", {\n bubbles: true,\n detail: { page, totalPages: props.total },\n }),\n );\n};\n</script>\n\n<template>\n <nav ref=\"root\" aria-label=\"Pagination\">\n <ul\n class=\"vd-pagination\"\n :class=\"[`vd-pagination-${size}`, `vd-pagination-${align}`]\"\n >\n <li\n class=\"vd-pagination-item vd-pagination-prev\"\n :class=\"{ disabled: disabled || modelValue <= 1 }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Previous\"\n @click.prevent=\"go(modelValue - 1)\"\n >Previous</a\n >\n </li>\n\n <template v-for=\"(item, idx) in pages\" :key=\"idx\">\n <li v-if=\"item === 'ellipsis'\" class=\"vd-pagination-item\">\n <span class=\"vd-pagination-ellipsis\" aria-hidden=\"true\">…</span>\n </li>\n <li\n v-else\n class=\"vd-pagination-item\"\n :class=\"{ active: item === modelValue }\"\n :data-page=\"item\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n :aria-label=\"`Page ${item}`\"\n :aria-current=\"item === modelValue ? 'page' : undefined\"\n @click.prevent=\"go(item)\"\n >{{ item }}</a\n >\n </li>\n </template>\n\n <li\n class=\"vd-pagination-item vd-pagination-next\"\n :class=\"{ disabled: disabled || modelValue >= total }\"\n >\n <a\n class=\"vd-pagination-link\"\n href=\"#\"\n aria-label=\"Next\"\n @click.prevent=\"go(modelValue + 1)\"\n >Next</a\n >\n </li>\n </ul>\n </nav>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\ntype Theme = \"light\" | \"dark\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n theme?: Theme;\n text?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n theme: \"light\",\n text: \"\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-preloader-container\"\n :class=\"[`vd-preloader-${theme}`]\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <div\n class=\"vd-preloader\"\n :class=\"[`vd-preloader-${variant}`, `vd-preloader-${size}`]\"\n >\n <div class=\"vd-preloader-spinner\" />\n </div>\n <span v-if=\"text\" class=\"vd-preloader-text\">{{ text }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\ntype Theme = \"light\" | \"dark\";\n\ninterface Props {\n variant?: Variant;\n size?: Size;\n theme?: Theme;\n text?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n variant: \"primary\",\n size: \"md\",\n theme: \"light\",\n text: \"\",\n});\n</script>\n\n<template>\n <div\n class=\"vd-preloader-container\"\n :class=\"[`vd-preloader-${theme}`]\"\n role=\"status\"\n aria-live=\"polite\"\n >\n <div\n class=\"vd-preloader\"\n :class=\"[`vd-preloader-${variant}`, `vd-preloader-${size}`]\"\n >\n <div class=\"vd-preloader-spinner\" />\n </div>\n <span v-if=\"text\" class=\"vd-preloader-text\">{{ text }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n value?: number;\n max?: number;\n indeterminate?: boolean;\n label?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n value: 0,\n max: 100,\n indeterminate: false,\n label: \"\",\n});\n\nconst pct = (): number => {\n if (props.indeterminate) return 0;\n const m = props.max || 100;\n return Math.max(0, Math.min(100, (props.value / m) * 100));\n};\n</script>\n\n<template>\n <div\n class=\"vd-progress\"\n :class=\"[indeterminate ? 'is-indeterminate' : null]\"\n role=\"progressbar\"\n :aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"indeterminate ? undefined : value\"\n :aria-label=\"label || 'Progress'\"\n >\n <div class=\"vd-progress-track\">\n <div\n class=\"vd-progress-fill\"\n :style=\"indeterminate ? undefined : { width: `${pct()}%` }\"\n />\n </div>\n <span\n v-if=\"!indeterminate && label\"\n class=\"vd-progress-label vd-text-sm vd-muted\"\n >\n {{ label }} — {{ Math.round(pct()) }}%\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Props {\n value?: number;\n max?: number;\n indeterminate?: boolean;\n label?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n value: 0,\n max: 100,\n indeterminate: false,\n label: \"\",\n});\n\nconst pct = (): number => {\n if (props.indeterminate) return 0;\n const m = props.max || 100;\n return Math.max(0, Math.min(100, (props.value / m) * 100));\n};\n</script>\n\n<template>\n <div\n class=\"vd-progress\"\n :class=\"[indeterminate ? 'is-indeterminate' : null]\"\n role=\"progressbar\"\n :aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n :aria-valuenow=\"indeterminate ? undefined : value\"\n :aria-label=\"label || 'Progress'\"\n >\n <div class=\"vd-progress-track\">\n <div\n class=\"vd-progress-fill\"\n :style=\"indeterminate ? undefined : { width: `${pct()}%` }\"\n />\n </div>\n <span\n v-if=\"!indeterminate && label\"\n class=\"vd-progress-label vd-text-sm vd-muted\"\n >\n {{ label }} — {{ Math.round(pct()) }}%\n </span>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface RadioOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly RadioOption[];\n modelValue: string;\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-form-radio-group\"\n :class=\"{ 'vd-form-radio-group-inline': inline }\"\n role=\"radiogroup\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-radio\"\n :class=\"[`vd-form-radio-${size}`, { 'vd-form-radio-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"modelValue === opt.value\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-radio-input\"\n @change=\"emit('update:modelValue', opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-radio-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface RadioOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n options: readonly RadioOption[];\n modelValue: string;\n name: string;\n inline?: boolean;\n size?: \"sm\" | \"md\" | \"lg\";\n disabled?: boolean;\n}\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nwithDefaults(defineProps<Props>(), {\n inline: false,\n size: \"md\",\n disabled: false,\n});\n</script>\n\n<template>\n <div\n class=\"vd-form-radio-group\"\n :class=\"{ 'vd-form-radio-group-inline': inline }\"\n role=\"radiogroup\"\n >\n <div\n v-for=\"opt in options\"\n :key=\"opt.value\"\n class=\"vd-form-radio\"\n :class=\"[`vd-form-radio-${size}`, { 'vd-form-radio-inline': inline }]\"\n >\n <input\n :id=\"`${name}-${opt.value}`\"\n type=\"radio\"\n :name=\"name\"\n :value=\"opt.value\"\n :checked=\"modelValue === opt.value\"\n :disabled=\"disabled || opt.disabled\"\n class=\"vd-form-radio-input\"\n @change=\"emit('update:modelValue', opt.value)\"\n />\n <label :for=\"`${name}-${opt.value}`\" class=\"vd-form-radio-label\">\n {{ opt.label }}\n </label>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface Props {\n modelValue: number;\n max?: number;\n size?: \"sm\" | \"lg\";\n readonly?: boolean;\n name?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n max: 5,\n size: undefined,\n readonly: false,\n name: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: number];\n change: [value: number];\n}>();\n\nconst current = ref(props.modelValue);\nconst hovered = ref(-1);\n\nwatch(\n () => props.modelValue,\n (v) => {\n current.value = v;\n },\n);\n\nconst stars = computed(() =>\n Array.from({ length: props.max }, (_, i) => i + 1),\n);\n\n// Mirrors rating.js updateStars: empty buttons styled via CSS ::before; the\n// fill state is conveyed entirely by is-active / is-half / is-hovered.\nconst starClass = (starNum: number): Record<string, boolean> => ({\n \"is-active\": starNum <= Math.floor(current.value),\n \"is-half\":\n starNum > Math.floor(current.value) && starNum - 0.5 <= current.value,\n \"is-hovered\": hovered.value >= 0 && starNum <= hovered.value,\n});\n\nconst select = (starNum: number): void => {\n if (props.readonly) return;\n current.value = starNum;\n emit(\"update:modelValue\", starNum);\n emit(\"change\", starNum);\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n if (props.readonly) return;\n if (\n (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") &&\n current.value < props.max\n ) {\n e.preventDefault();\n select(current.value + 1);\n } else if (\n (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") &&\n current.value > 1\n ) {\n e.preventDefault();\n select(current.value - 1);\n }\n};\n</script>\n\n<template>\n <div\n class=\"vd-rating\"\n :class=\"[\n size ? `vd-rating-${size}` : null,\n { 'vd-rating-readonly': readonly },\n ]\"\n role=\"radiogroup\"\n aria-label=\"Rating\"\n @keydown=\"onKeydown\"\n @mouseleave=\"hovered = -1\"\n >\n <button\n v-for=\"starNum in stars\"\n :key=\"starNum\"\n type=\"button\"\n class=\"vd-rating-star\"\n :class=\"starClass(starNum)\"\n role=\"radio\"\n :aria-checked=\"starNum <= current ? 'true' : 'false'\"\n :aria-label=\"`${starNum} star${starNum > 1 ? 's' : ''}`\"\n :tabindex=\"readonly ? -1 : 0\"\n @mouseenter=\"readonly ? null : (hovered = starNum)\"\n @click=\"select(starNum)\"\n />\n <span class=\"vd-rating-value\">{{ current > 0 ? current : \"\" }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface Props {\n modelValue: number;\n max?: number;\n size?: \"sm\" | \"lg\";\n readonly?: boolean;\n name?: string;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n max: 5,\n size: undefined,\n readonly: false,\n name: \"\",\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: number];\n change: [value: number];\n}>();\n\nconst current = ref(props.modelValue);\nconst hovered = ref(-1);\n\nwatch(\n () => props.modelValue,\n (v) => {\n current.value = v;\n },\n);\n\nconst stars = computed(() =>\n Array.from({ length: props.max }, (_, i) => i + 1),\n);\n\n// Mirrors rating.js updateStars: empty buttons styled via CSS ::before; the\n// fill state is conveyed entirely by is-active / is-half / is-hovered.\nconst starClass = (starNum: number): Record<string, boolean> => ({\n \"is-active\": starNum <= Math.floor(current.value),\n \"is-half\":\n starNum > Math.floor(current.value) && starNum - 0.5 <= current.value,\n \"is-hovered\": hovered.value >= 0 && starNum <= hovered.value,\n});\n\nconst select = (starNum: number): void => {\n if (props.readonly) return;\n current.value = starNum;\n emit(\"update:modelValue\", starNum);\n emit(\"change\", starNum);\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n if (props.readonly) return;\n if (\n (e.key === \"ArrowRight\" || e.key === \"ArrowUp\") &&\n current.value < props.max\n ) {\n e.preventDefault();\n select(current.value + 1);\n } else if (\n (e.key === \"ArrowLeft\" || e.key === \"ArrowDown\") &&\n current.value > 1\n ) {\n e.preventDefault();\n select(current.value - 1);\n }\n};\n</script>\n\n<template>\n <div\n class=\"vd-rating\"\n :class=\"[\n size ? `vd-rating-${size}` : null,\n { 'vd-rating-readonly': readonly },\n ]\"\n role=\"radiogroup\"\n aria-label=\"Rating\"\n @keydown=\"onKeydown\"\n @mouseleave=\"hovered = -1\"\n >\n <button\n v-for=\"starNum in stars\"\n :key=\"starNum\"\n type=\"button\"\n class=\"vd-rating-star\"\n :class=\"starClass(starNum)\"\n role=\"radio\"\n :aria-checked=\"starNum <= current ? 'true' : 'false'\"\n :aria-label=\"`${starNum} star${starNum > 1 ? 's' : ''}`\"\n :tabindex=\"readonly ? -1 : 0\"\n @mouseenter=\"readonly ? null : (hovered = starNum)\"\n @click=\"select(starNum)\"\n />\n <span class=\"vd-rating-value\">{{ current > 0 ? current : \"\" }}</span>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly SelectOption[];\n name?: string;\n id?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n name: \"\",\n id: \"\",\n placeholder: \"\",\n disabled: false,\n required: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst internal = ref(props.modelValue);\n\nwatch(\n () => props.modelValue,\n (v) => {\n internal.value = v;\n },\n);\n\nconst currentLabel = computed(\n () => props.options.find((o) => o.value === internal.value)?.label ?? \"\",\n);\n</script>\n\n<template>\n <select\n :id=\"id || name\"\n :name=\"name\"\n :value=\"internal\"\n :disabled=\"disabled\"\n :required=\"required\"\n class=\"vd-input\"\n @change=\"\n (e) => {\n const v = (e.target as HTMLSelectElement).value;\n internal = v;\n emit('update:modelValue', v);\n }\n \"\n >\n <option v-if=\"placeholder\" value=\"\" disabled>\n {{ placeholder }}\n </option>\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <span class=\"vd-visually-hidden\">{{ currentLabel }}</span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref, watch } from \"vue\";\n\ninterface SelectOption {\n value: string;\n label: string;\n disabled?: boolean;\n}\n\ninterface Props {\n modelValue: string;\n options: readonly SelectOption[];\n name?: string;\n id?: string;\n placeholder?: string;\n disabled?: boolean;\n required?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n name: \"\",\n id: \"\",\n placeholder: \"\",\n disabled: false,\n required: false,\n});\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst internal = ref(props.modelValue);\n\nwatch(\n () => props.modelValue,\n (v) => {\n internal.value = v;\n },\n);\n\nconst currentLabel = computed(\n () => props.options.find((o) => o.value === internal.value)?.label ?? \"\",\n);\n</script>\n\n<template>\n <select\n :id=\"id || name\"\n :name=\"name\"\n :value=\"internal\"\n :disabled=\"disabled\"\n :required=\"required\"\n class=\"vd-input\"\n @change=\"\n (e) => {\n const v = (e.target as HTMLSelectElement).value;\n internal = v;\n emit('update:modelValue', v);\n }\n \"\n >\n <option v-if=\"placeholder\" value=\"\" disabled>\n {{ placeholder }}\n </option>\n <option\n v-for=\"opt in options\"\n :key=\"opt.value\"\n :value=\"opt.value\"\n :disabled=\"opt.disabled\"\n >\n {{ opt.label }}\n </option>\n </select>\n <span class=\"vd-visually-hidden\">{{ currentLabel }}</span>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"left\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-sidenav\"\n :class=\"[`vd-sidenav-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Side navigation'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-sidenav-footer\">\n <slot name=\"footer\" />\n </footer>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, watch } from \"vue\";\n\ninterface Props {\n modelValue: boolean;\n placement?: \"left\" | \"right\" | \"top\" | \"bottom\";\n title?: string;\n closeOnBackdrop?: boolean;\n closeOnEsc?: boolean;\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n placement: \"left\",\n title: \"\",\n closeOnBackdrop: true,\n closeOnEsc: true,\n});\n\nconst emit = defineEmits<{\n \"update:modelValue\": [value: boolean];\n close: [];\n}>();\n\nconst close = (): void => {\n emit(\"update:modelValue\", false);\n emit(\"close\");\n};\n\nconst onBackdrop = (): void => {\n if (props.closeOnBackdrop) close();\n};\n\nconst onKeydown = (event: KeyboardEvent): void => {\n if (!props.modelValue) return;\n if (event.key === \"Escape\" && props.closeOnEsc) {\n event.preventDefault();\n close();\n }\n};\n\nonMounted(() => {\n if (typeof window === \"undefined\") return;\n window.addEventListener(\"keydown\", onKeydown);\n});\n\nonBeforeUnmount(() => {\n if (typeof window === \"undefined\") return;\n window.removeEventListener(\"keydown\", onKeydown);\n});\n\nwatch(\n () => props.modelValue,\n (open) => {\n if (typeof document === \"undefined\") return;\n document.body.style.overflow = open ? \"hidden\" : \"\";\n },\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-if=\"modelValue\"\n class=\"vd-sidenav-overlay is-visible\"\n @click=\"onBackdrop\"\n />\n <aside\n v-if=\"modelValue\"\n class=\"vd-sidenav\"\n :class=\"[`vd-sidenav-${placement}`, 'is-open']\"\n :aria-label=\"title || 'Side navigation'\"\n >\n <header v-if=\"title || $slots.header\" class=\"vd-sidenav-header\">\n <h3 v-if=\"title\" class=\"vd-sidenav-title\">\n {{ title }}\n </h3>\n <slot name=\"header\" />\n <button\n type=\"button\"\n class=\"vd-sidenav-close\"\n aria-label=\"Close\"\n @click=\"close\"\n >\n ×\n </button>\n </header>\n <div class=\"vd-sidenav-body\">\n <slot />\n </div>\n <footer v-if=\"$slots.footer\" class=\"vd-sidenav-footer\">\n <slot name=\"footer\" />\n </footer>\n </aside>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\ntype Shape = \"text\" | \"circle\" | \"rect\" | \"card\" | \"button\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ninterface Props {\n shape?: Shape;\n size?: Size;\n width?: string;\n lines?: number;\n}\n\nwithDefaults(defineProps<Props>(), {\n shape: \"text\",\n size: \"md\",\n width: \"\",\n lines: 1,\n});\n</script>\n\n<template>\n <div\n v-if=\"shape === 'card'\"\n class=\"vd-skeleton-card\"\n :class=\"`vd-skeleton-card-${size}`\"\n >\n <div class=\"vd-skeleton vd-skeleton-card-header\" />\n <div class=\"vd-skeleton-card-body\">\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text vd-skeleton-text-short\" />\n </div>\n </div>\n <div\n v-else-if=\"shape === 'button'\"\n class=\"vd-skeleton vd-skeleton-button\"\n :class=\"`vd-skeleton-button-${size}`\"\n />\n <div\n v-else-if=\"shape === 'circle'\"\n class=\"vd-skeleton vd-skeleton-circle\"\n :class=\"`vd-skeleton-circle-${size}`\"\n />\n <div v-else-if=\"lines > 1\" class=\"vd-skeleton-lines\">\n <div\n v-for=\"n in lines\"\n :key=\"n\"\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"n === lines ? 'vd-skeleton-text-short' : ''\"\n />\n </div>\n <div\n v-else\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"`vd-skeleton-text-${size}`\"\n :style=\"width ? `width: ${width}` : ''\"\n />\n</template>\n","<script setup lang=\"ts\">\ntype Shape = \"text\" | \"circle\" | \"rect\" | \"card\" | \"button\";\ntype Size = \"sm\" | \"md\" | \"lg\" | \"xl\";\n\ninterface Props {\n shape?: Shape;\n size?: Size;\n width?: string;\n lines?: number;\n}\n\nwithDefaults(defineProps<Props>(), {\n shape: \"text\",\n size: \"md\",\n width: \"\",\n lines: 1,\n});\n</script>\n\n<template>\n <div\n v-if=\"shape === 'card'\"\n class=\"vd-skeleton-card\"\n :class=\"`vd-skeleton-card-${size}`\"\n >\n <div class=\"vd-skeleton vd-skeleton-card-header\" />\n <div class=\"vd-skeleton-card-body\">\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text\" />\n <div class=\"vd-skeleton vd-skeleton-text vd-skeleton-text-short\" />\n </div>\n </div>\n <div\n v-else-if=\"shape === 'button'\"\n class=\"vd-skeleton vd-skeleton-button\"\n :class=\"`vd-skeleton-button-${size}`\"\n />\n <div\n v-else-if=\"shape === 'circle'\"\n class=\"vd-skeleton vd-skeleton-circle\"\n :class=\"`vd-skeleton-circle-${size}`\"\n />\n <div v-else-if=\"lines > 1\" class=\"vd-skeleton-lines\">\n <div\n v-for=\"n in lines\"\n :key=\"n\"\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"n === lines ? 'vd-skeleton-text-short' : ''\"\n />\n </div>\n <div\n v-else\n class=\"vd-skeleton vd-skeleton-text\"\n :class=\"`vd-skeleton-text-${size}`\"\n :style=\"width ? `width: ${width}` : ''\"\n />\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n label?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n label: \"\",\n});\n</script>\n\n<template>\n <span\n :class=\"['vd-spinner', `vd-spinner-${size}`]\"\n role=\"status\"\n :aria-label=\"label || 'Loading'\"\n >\n <VdIcon name=\"circle-notch\" />\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport VdIcon from \"./VdIcon.vue\";\n\ntype Size = \"sm\" | \"md\" | \"lg\";\n\ninterface Props {\n size?: Size;\n label?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n size: \"md\",\n label: \"\",\n});\n</script>\n\n<template>\n <span\n :class=\"['vd-spinner', `vd-spinner-${size}`]\"\n role=\"status\"\n :aria-label=\"label || 'Loading'\"\n >\n <VdIcon name=\"circle-notch\" />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Column {\n key: string;\n label: string;\n variant?: Variant;\n}\n\ninterface Props {\n columns: readonly Column[];\n rows: readonly Record<string, string | number>[];\n striped?: boolean;\n bordered?: boolean;\n hover?: boolean;\n caption?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n striped: false,\n bordered: false,\n hover: false,\n caption: \"\",\n});\n</script>\n\n<template>\n <div class=\"vd-table-responsive\">\n <table\n class=\"vd-table\"\n :class=\"{\n 'vd-table-striped': striped,\n 'vd-table-bordered': bordered,\n 'vd-table-hover': hover,\n }\"\n >\n <caption v-if=\"caption\" class=\"vd-table-caption\">\n {{\n caption\n }}\n </caption>\n <thead class=\"vd-table-header\">\n <tr>\n <th v-for=\"col in columns\" :key=\"col.key\" scope=\"col\">\n {{ col.label }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, rowIdx) in rows\" :key=\"rowIdx\">\n <td v-for=\"col in columns\" :key=\"col.key\">\n {{ row[col.key] }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Variant =\n | \"primary\"\n | \"secondary\"\n | \"success\"\n | \"warning\"\n | \"error\"\n | \"info\";\n\ninterface Column {\n key: string;\n label: string;\n variant?: Variant;\n}\n\ninterface Props {\n columns: readonly Column[];\n rows: readonly Record<string, string | number>[];\n striped?: boolean;\n bordered?: boolean;\n hover?: boolean;\n caption?: string;\n}\n\nwithDefaults(defineProps<Props>(), {\n striped: false,\n bordered: false,\n hover: false,\n caption: \"\",\n});\n</script>\n\n<template>\n <div class=\"vd-table-responsive\">\n <table\n class=\"vd-table\"\n :class=\"{\n 'vd-table-striped': striped,\n 'vd-table-bordered': bordered,\n 'vd-table-hover': hover,\n }\"\n >\n <caption v-if=\"caption\" class=\"vd-table-caption\">\n {{\n caption\n }}\n </caption>\n <thead class=\"vd-table-header\">\n <tr>\n <th v-for=\"col in columns\" :key=\"col.key\" scope=\"col\">\n {{ col.label }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"(row, rowIdx) in rows\" :key=\"rowIdx\">\n <td v-for=\"col in columns\" :key=\"col.key\">\n {{ row[col.key] }}\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Tab {\n id: string;\n label: string;\n}\n\ninterface Props {\n tabs: Tab[];\n modelValue: string;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst select = (id: string): void => {\n if (id !== props.modelValue) emit(\"update:modelValue\", id);\n};\n</script>\n\n<template>\n <div class=\"vd-tabs\" role=\"tablist\">\n <div class=\"vd-tab-list\" role=\"presentation\">\n <button\n v-for=\"tab in tabs\"\n :key=\"tab.id\"\n type=\"button\"\n role=\"tab\"\n :aria-selected=\"tab.id === modelValue\"\n :class=\"['vd-tab', tab.id === modelValue ? 'is-active' : null]\"\n @click=\"select(tab.id)\"\n >\n {{ tab.label }}\n </button>\n </div>\n <div class=\"vd-tab-panels\">\n <slot />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\ninterface Tab {\n id: string;\n label: string;\n}\n\ninterface Props {\n tabs: Tab[];\n modelValue: string;\n}\n\nconst props = defineProps<Props>();\n\nconst emit = defineEmits<{ \"update:modelValue\": [value: string] }>();\n\nconst select = (id: string): void => {\n if (id !== props.modelValue) emit(\"update:modelValue\", id);\n};\n</script>\n\n<template>\n <div class=\"vd-tabs\" role=\"tablist\">\n <div class=\"vd-tab-list\" role=\"presentation\">\n <button\n v-for=\"tab in tabs\"\n :key=\"tab.id\"\n type=\"button\"\n role=\"tab\"\n :aria-selected=\"tab.id === modelValue\"\n :class=\"['vd-tab', tab.id === modelValue ? 'is-active' : null]\"\n @click=\"select(tab.id)\"\n >\n {{ tab.label }}\n </button>\n </div>\n <div class=\"vd-tab-panels\">\n <slot />\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref } from \"vue\";\nimport type { ToastEntry, ToastType } from \"../composables/useToast\";\n\nconst props = defineProps<{ toast: ToastEntry }>();\nconst emit = defineEmits<{ dismiss: [id: string] }>();\n\n/** Default type icons, copied verbatim from `Toast.getDefaultIcon()`. */\nconst ICONS: Record<ToastType, string> = {\n success:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"></path><polyline points=\"22 4 12 14.01 9 11.01\"></polyline></svg>',\n error:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>',\n warning:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>',\n info: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line></svg>',\n};\n\nconst visible = ref(false);\nconst exiting = ref(false);\nconst progressPaused = ref(false);\n\nlet timeoutId: number | null = null;\nlet fallbackId: number | null = null;\nlet startTime = 0;\nlet remaining = props.toast.duration;\n\nconst clearTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n }\n};\n\nconst startTimer = (): void => {\n progressPaused.value = false;\n if (props.toast.duration > 0 && typeof window !== \"undefined\") {\n startTime = Date.now();\n timeoutId = window.setTimeout(beginDismiss, remaining);\n }\n};\n\nconst pauseTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n remaining -= Date.now() - startTime;\n progressPaused.value = true;\n }\n};\n\nconst beginDismiss = (): void => {\n if (exiting.value) return;\n clearTimer();\n visible.value = false;\n exiting.value = true;\n // Fallback removal if the transition never fires (matches framework).\n fallbackId = window.setTimeout(() => emit(\"dismiss\", props.toast.id), 400);\n};\n\nconst onTransitionEnd = (): void => {\n if (exiting.value) emit(\"dismiss\", props.toast.id);\n};\n\nonMounted(() => {\n // Enter on the next frame so the `.is-visible` transition runs.\n requestAnimationFrame(() => {\n visible.value = true;\n startTimer();\n });\n});\n\nonBeforeUnmount(() => {\n clearTimer();\n if (fallbackId != null) window.clearTimeout(fallbackId);\n});\n</script>\n\n<template>\n <div\n :class=\"[\n 'vd-toast',\n toast.type ? `vd-toast-${toast.type}` : null,\n toast.solid ? 'vd-toast-solid' : null,\n toast.showProgress && toast.duration > 0\n ? 'vd-toast-with-progress'\n : null,\n { 'is-visible': visible, 'is-exiting': exiting },\n ]\"\n role=\"status\"\n aria-live=\"polite\"\n @mouseenter=\"pauseTimer\"\n @mouseleave=\"startTimer\"\n @transitionend=\"onTransitionEnd\"\n >\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-if=\"toast.type\" class=\"vd-toast-icon\" v-html=\"ICONS[toast.type]\" />\n <div class=\"vd-toast-content\">\n <div v-if=\"toast.title\" class=\"vd-toast-title\">{{ toast.title }}</div>\n <div class=\"vd-toast-message\">{{ toast.message }}</div>\n </div>\n <button\n v-if=\"toast.dismissible\"\n type=\"button\"\n class=\"vd-toast-close\"\n aria-label=\"Close\"\n @click=\"beginDismiss\"\n />\n <div\n v-if=\"toast.showProgress && toast.duration > 0\"\n class=\"vd-toast-progress\"\n :style=\"{\n animationDuration: `${toast.duration}ms`,\n animationPlayState: progressPaused ? 'paused' : 'running',\n }\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { onBeforeUnmount, onMounted, ref } from \"vue\";\nimport type { ToastEntry, ToastType } from \"../composables/useToast\";\n\nconst props = defineProps<{ toast: ToastEntry }>();\nconst emit = defineEmits<{ dismiss: [id: string] }>();\n\n/** Default type icons, copied verbatim from `Toast.getDefaultIcon()`. */\nconst ICONS: Record<ToastType, string> = {\n success:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"></path><polyline points=\"22 4 12 14.01 9 11.01\"></polyline></svg>',\n error:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"></line><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"></line></svg>',\n warning:\n '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>',\n info: '<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line></svg>',\n};\n\nconst visible = ref(false);\nconst exiting = ref(false);\nconst progressPaused = ref(false);\n\nlet timeoutId: number | null = null;\nlet fallbackId: number | null = null;\nlet startTime = 0;\nlet remaining = props.toast.duration;\n\nconst clearTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n }\n};\n\nconst startTimer = (): void => {\n progressPaused.value = false;\n if (props.toast.duration > 0 && typeof window !== \"undefined\") {\n startTime = Date.now();\n timeoutId = window.setTimeout(beginDismiss, remaining);\n }\n};\n\nconst pauseTimer = (): void => {\n if (timeoutId != null) {\n window.clearTimeout(timeoutId);\n timeoutId = null;\n remaining -= Date.now() - startTime;\n progressPaused.value = true;\n }\n};\n\nconst beginDismiss = (): void => {\n if (exiting.value) return;\n clearTimer();\n visible.value = false;\n exiting.value = true;\n // Fallback removal if the transition never fires (matches framework).\n fallbackId = window.setTimeout(() => emit(\"dismiss\", props.toast.id), 400);\n};\n\nconst onTransitionEnd = (): void => {\n if (exiting.value) emit(\"dismiss\", props.toast.id);\n};\n\nonMounted(() => {\n // Enter on the next frame so the `.is-visible` transition runs.\n requestAnimationFrame(() => {\n visible.value = true;\n startTimer();\n });\n});\n\nonBeforeUnmount(() => {\n clearTimer();\n if (fallbackId != null) window.clearTimeout(fallbackId);\n});\n</script>\n\n<template>\n <div\n :class=\"[\n 'vd-toast',\n toast.type ? `vd-toast-${toast.type}` : null,\n toast.solid ? 'vd-toast-solid' : null,\n toast.showProgress && toast.duration > 0\n ? 'vd-toast-with-progress'\n : null,\n { 'is-visible': visible, 'is-exiting': exiting },\n ]\"\n role=\"status\"\n aria-live=\"polite\"\n @mouseenter=\"pauseTimer\"\n @mouseleave=\"startTimer\"\n @transitionend=\"onTransitionEnd\"\n >\n <!-- eslint-disable-next-line vue/no-v-html -->\n <span v-if=\"toast.type\" class=\"vd-toast-icon\" v-html=\"ICONS[toast.type]\" />\n <div class=\"vd-toast-content\">\n <div v-if=\"toast.title\" class=\"vd-toast-title\">{{ toast.title }}</div>\n <div class=\"vd-toast-message\">{{ toast.message }}</div>\n </div>\n <button\n v-if=\"toast.dismissible\"\n type=\"button\"\n class=\"vd-toast-close\"\n aria-label=\"Close\"\n @click=\"beginDismiss\"\n />\n <div\n v-if=\"toast.showProgress && toast.duration > 0\"\n class=\"vd-toast-progress\"\n :style=\"{\n animationDuration: `${toast.duration}ms`,\n animationPlayState: progressPaused ? 'paused' : 'running',\n }\"\n />\n </div>\n</template>\n","import { ref } from \"vue\";\nimport { defineStore } from \"pinia\";\n\nexport type ToastType = \"success\" | \"error\" | \"warning\" | \"info\";\n\nexport type ToastPosition =\n | \"top-right\"\n | \"top-left\"\n | \"top-center\"\n | \"bottom-right\"\n | \"bottom-left\"\n | \"bottom-center\";\n\nexport interface ToastEntry {\n id: string;\n message: string;\n title?: string;\n type?: ToastType;\n duration: number;\n position: ToastPosition;\n dismissible: boolean;\n showProgress: boolean;\n solid: boolean;\n}\n\nexport interface ToastOptions {\n message?: string;\n title?: string;\n type?: ToastType;\n duration?: number;\n position?: ToastPosition;\n dismissible?: boolean;\n showProgress?: boolean;\n solid?: boolean;\n}\n\n/** Mirrors `Toast.defaults` in `framework/js/components/toast.js`. */\nconst DEFAULTS = {\n duration: 5000,\n position: \"top-right\" as ToastPosition,\n dismissible: true,\n showProgress: true,\n solid: false,\n};\n\nlet counter = 0;\nconst nextId = (): string => {\n counter += 1;\n return `toast-${Date.now().toString(36)}-${counter}`;\n};\n\nexport const useToastStore = defineStore(\"toast\", () => {\n const queue = ref<ToastEntry[]>([]);\n\n /**\n * Reproduces `Toast.show()` — supports the framework's flexible signature:\n * `show('msg')`, `show('msg', 'success', 3000)`, `show('msg', { … })`,\n * and `show({ message, type, … })`.\n */\n const show = (\n options: ToastOptions | string,\n type?: ToastType | ToastOptions,\n duration?: number,\n ): string => {\n let opts: ToastOptions;\n if (typeof options === \"string\") {\n if (type && typeof type === \"object\") {\n opts = { ...type, message: options };\n } else {\n opts = {\n message: options,\n type: type as ToastType | undefined,\n duration,\n };\n }\n } else {\n opts = { ...options };\n }\n\n const id = nextId();\n const entry: ToastEntry = {\n id,\n message: opts.message ?? \"\",\n title: opts.title,\n type: opts.type,\n duration: opts.duration ?? DEFAULTS.duration,\n position: opts.position ?? DEFAULTS.position,\n dismissible: opts.dismissible ?? DEFAULTS.dismissible,\n showProgress: opts.showProgress ?? DEFAULTS.showProgress,\n solid: opts.solid ?? DEFAULTS.solid,\n };\n queue.value.push(entry);\n return id;\n };\n\n const dismiss = (id: string): void => {\n queue.value = queue.value.filter((t) => t.id !== id);\n };\n\n const success = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"success\" });\n const error = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"error\" });\n const warning = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"warning\" });\n const info = (message: string, opts: ToastOptions = {}): string =>\n show({ ...opts, message, type: \"info\" });\n\n return { queue, show, dismiss, success, error, warning, info };\n});\n\nexport const useToast = () => {\n const store = useToastStore();\n return {\n show: store.show,\n dismiss: store.dismiss,\n success: store.success,\n error: store.error,\n warning: store.warning,\n info: store.info,\n queue: store.queue,\n };\n};\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useToastStore, type ToastPosition } from \"../composables/useToast\";\nimport VdToast from \"./VdToast.vue\";\n\nconst store = useToastStore();\n\nconst POSITIONS: ToastPosition[] = [\n \"top-right\",\n \"top-left\",\n \"top-center\",\n \"bottom-right\",\n \"bottom-left\",\n \"bottom-center\",\n];\n\n// One `.vd-toast-container` per position that currently has toasts, mirroring\n// `Toast.getContainer()` which lazily creates a positioned container per group.\nconst groups = computed(() =>\n POSITIONS.map((position) => ({\n position,\n toasts: store.queue.filter((t) => t.position === position),\n })).filter((group) => group.toasts.length > 0),\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-for=\"group in groups\"\n :key=\"group.position\"\n :class=\"['vd-toast-container', `vd-toast-container-${group.position}`]\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"false\"\n >\n <VdToast\n v-for=\"toast in group.toasts\"\n :key=\"toast.id\"\n :toast=\"toast\"\n @dismiss=\"store.dismiss\"\n />\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\nimport { useToastStore, type ToastPosition } from \"../composables/useToast\";\nimport VdToast from \"./VdToast.vue\";\n\nconst store = useToastStore();\n\nconst POSITIONS: ToastPosition[] = [\n \"top-right\",\n \"top-left\",\n \"top-center\",\n \"bottom-right\",\n \"bottom-left\",\n \"bottom-center\",\n];\n\n// One `.vd-toast-container` per position that currently has toasts, mirroring\n// `Toast.getContainer()` which lazily creates a positioned container per group.\nconst groups = computed(() =>\n POSITIONS.map((position) => ({\n position,\n toasts: store.queue.filter((t) => t.position === position),\n })).filter((group) => group.toasts.length > 0),\n);\n</script>\n\n<template>\n <Teleport to=\"body\">\n <div\n v-for=\"group in groups\"\n :key=\"group.position\"\n :class=\"['vd-toast-container', `vd-toast-container-${group.position}`]\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"false\"\n >\n <VdToast\n v-for=\"toast in group.toasts\"\n :key=\"toast.id\"\n :toast=\"toast\"\n @dismiss=\"store.dismiss\"\n />\n </div>\n </Teleport>\n</template>\n","<script setup lang=\"ts\">\ntype Position = \"top\" | \"bottom\" | \"left\" | \"right\";\n\ninterface Props {\n text: string;\n position?: Position;\n}\n\nwithDefaults(defineProps<Props>(), {\n position: \"top\",\n});\n</script>\n\n<template>\n <span\n class=\"vd-tooltip\"\n :data-tooltip-position=\"position\"\n :data-tooltip=\"text\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\ntype Position = \"top\" | \"bottom\" | \"left\" | \"right\";\n\ninterface Props {\n text: string;\n position?: Position;\n}\n\nwithDefaults(defineProps<Props>(), {\n position: \"top\",\n});\n</script>\n\n<template>\n <span\n class=\"vd-tooltip\"\n :data-tooltip-position=\"position\"\n :data-tooltip=\"text\"\n >\n <slot />\n </span>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/transfer.js — a dual-list\n * picker generated from a `data-vd-transfer` JSON array. Reproduces the\n * framework's generated DOM (`.vd-transfer` → panels + actions), per-panel\n * search, checkbox selection, and the move buttons. Dispatches a native\n * `transfer:change` CustomEvent so the documented\n * `el.addEventListener('transfer:change', ...)` API works.\n *\n * Two fixes-to-documented-intent vs the Vanilla JS:\n * - items use `.is-selected` (what transfer.css actually styles); the docs API\n * table's `.is-checked` is a stale typo.\n * - the event detail is `{ selected, available }` (the documented shape used by\n * the demo snippet's `e.detail.selected`); the Vanilla JS fired the wrong\n * `{ source, target }`, so the documented `e.detail.selected` was undefined.\n */\ninterface TransferItem {\n id: string;\n label: string;\n}\n\nconst props = defineProps<{ items: TransferItem[] }>();\n\nconst root = ref<HTMLElement | null>(null);\nconst sourceData = ref<TransferItem[]>(props.items.map((i) => ({ ...i })));\nconst targetData = ref<TransferItem[]>([]);\nconst sourceSelected = ref<Set<string>>(new Set());\nconst targetSelected = ref<Set<string>>(new Set());\nconst sourceFilter = ref(\"\");\nconst targetFilter = ref(\"\");\n\nconst filterItems = (data: TransferItem[], filter: string): TransferItem[] => {\n if (!filter) return data;\n const f = filter.toLowerCase();\n return data.filter((d) => d.label.toLowerCase().includes(f));\n};\n\nconst filteredSource = computed(() =>\n filterItems(sourceData.value, sourceFilter.value),\n);\nconst filteredTarget = computed(() =>\n filterItems(targetData.value, targetFilter.value),\n);\n\nconst toggle = (which: \"source\" | \"target\", id: string): void => {\n const sel = which === \"source\" ? sourceSelected : targetSelected;\n const next = new Set(sel.value);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n sel.value = next;\n};\n\nconst fireChange = (): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"transfer:change\", {\n bubbles: true,\n detail: {\n selected: targetData.value.map((d) => d.id),\n available: sourceData.value.map((d) => d.id),\n },\n }),\n );\n};\n\nconst moveRight = (): void => {\n if (sourceSelected.value.size === 0) return;\n const move = sourceData.value.filter((d) => sourceSelected.value.has(d.id));\n sourceData.value = sourceData.value.filter(\n (d) => !sourceSelected.value.has(d.id),\n );\n targetData.value = [...targetData.value, ...move];\n sourceSelected.value = new Set();\n fireChange();\n};\n\nconst moveLeft = (): void => {\n if (targetSelected.value.size === 0) return;\n const move = targetData.value.filter((d) => targetSelected.value.has(d.id));\n targetData.value = targetData.value.filter(\n (d) => !targetSelected.value.has(d.id),\n );\n sourceData.value = [...sourceData.value, ...move];\n targetSelected.value = new Set();\n fireChange();\n};\n\ndefineExpose({\n getSelected: () => targetData.value.map((d) => d.id),\n});\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-transfer\">\n <!-- Source panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Source</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ sourceSelected.size }}/{{ sourceData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"sourceFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search source\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredSource\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': sourceSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"sourceSelected.has(item.id)\"\n @click=\"toggle('source', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"sourceSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n\n <!-- Actions -->\n <div class=\"vd-transfer-actions\">\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to target\"\n :disabled=\"sourceSelected.size === 0\"\n @click=\"moveRight\"\n >\n ›\n </button>\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to source\"\n :disabled=\"targetSelected.size === 0\"\n @click=\"moveLeft\"\n >\n ‹\n </button>\n </div>\n\n <!-- Target panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Target</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ targetSelected.size }}/{{ targetData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"targetFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search target\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredTarget\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': targetSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"targetSelected.has(item.id)\"\n @click=\"toggle('target', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"targetSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed, ref } from \"vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/transfer.js — a dual-list\n * picker generated from a `data-vd-transfer` JSON array. Reproduces the\n * framework's generated DOM (`.vd-transfer` → panels + actions), per-panel\n * search, checkbox selection, and the move buttons. Dispatches a native\n * `transfer:change` CustomEvent so the documented\n * `el.addEventListener('transfer:change', ...)` API works.\n *\n * Two fixes-to-documented-intent vs the Vanilla JS:\n * - items use `.is-selected` (what transfer.css actually styles); the docs API\n * table's `.is-checked` is a stale typo.\n * - the event detail is `{ selected, available }` (the documented shape used by\n * the demo snippet's `e.detail.selected`); the Vanilla JS fired the wrong\n * `{ source, target }`, so the documented `e.detail.selected` was undefined.\n */\ninterface TransferItem {\n id: string;\n label: string;\n}\n\nconst props = defineProps<{ items: TransferItem[] }>();\n\nconst root = ref<HTMLElement | null>(null);\nconst sourceData = ref<TransferItem[]>(props.items.map((i) => ({ ...i })));\nconst targetData = ref<TransferItem[]>([]);\nconst sourceSelected = ref<Set<string>>(new Set());\nconst targetSelected = ref<Set<string>>(new Set());\nconst sourceFilter = ref(\"\");\nconst targetFilter = ref(\"\");\n\nconst filterItems = (data: TransferItem[], filter: string): TransferItem[] => {\n if (!filter) return data;\n const f = filter.toLowerCase();\n return data.filter((d) => d.label.toLowerCase().includes(f));\n};\n\nconst filteredSource = computed(() =>\n filterItems(sourceData.value, sourceFilter.value),\n);\nconst filteredTarget = computed(() =>\n filterItems(targetData.value, targetFilter.value),\n);\n\nconst toggle = (which: \"source\" | \"target\", id: string): void => {\n const sel = which === \"source\" ? sourceSelected : targetSelected;\n const next = new Set(sel.value);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n sel.value = next;\n};\n\nconst fireChange = (): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"transfer:change\", {\n bubbles: true,\n detail: {\n selected: targetData.value.map((d) => d.id),\n available: sourceData.value.map((d) => d.id),\n },\n }),\n );\n};\n\nconst moveRight = (): void => {\n if (sourceSelected.value.size === 0) return;\n const move = sourceData.value.filter((d) => sourceSelected.value.has(d.id));\n sourceData.value = sourceData.value.filter(\n (d) => !sourceSelected.value.has(d.id),\n );\n targetData.value = [...targetData.value, ...move];\n sourceSelected.value = new Set();\n fireChange();\n};\n\nconst moveLeft = (): void => {\n if (targetSelected.value.size === 0) return;\n const move = targetData.value.filter((d) => targetSelected.value.has(d.id));\n targetData.value = targetData.value.filter(\n (d) => !targetSelected.value.has(d.id),\n );\n sourceData.value = [...sourceData.value, ...move];\n targetSelected.value = new Set();\n fireChange();\n};\n\ndefineExpose({\n getSelected: () => targetData.value.map((d) => d.id),\n});\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-transfer\">\n <!-- Source panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Source</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ sourceSelected.size }}/{{ sourceData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"sourceFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search source\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredSource\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': sourceSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"sourceSelected.has(item.id)\"\n @click=\"toggle('source', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"sourceSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n\n <!-- Actions -->\n <div class=\"vd-transfer-actions\">\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to target\"\n :disabled=\"sourceSelected.size === 0\"\n @click=\"moveRight\"\n >\n ›\n </button>\n <button\n type=\"button\"\n class=\"vd-transfer-btn\"\n aria-label=\"Move to source\"\n :disabled=\"targetSelected.size === 0\"\n @click=\"moveLeft\"\n >\n ‹\n </button>\n </div>\n\n <!-- Target panel -->\n <div class=\"vd-transfer-panel\">\n <div class=\"vd-transfer-header\">\n <span>Target</span>\n <span class=\"vd-transfer-count\" aria-live=\"polite\">\n {{ targetSelected.size }}/{{ targetData.length }}\n </span>\n </div>\n <div class=\"vd-transfer-search\">\n <input\n v-model=\"targetFilter\"\n type=\"text\"\n placeholder=\"Search...\"\n aria-label=\"Search target\"\n />\n </div>\n <ul class=\"vd-transfer-list\" role=\"listbox\" aria-multiselectable=\"true\">\n <li\n v-for=\"item in filteredTarget\"\n :key=\"item.id\"\n class=\"vd-transfer-item\"\n :class=\"{ 'is-selected': targetSelected.has(item.id) }\"\n role=\"option\"\n :aria-selected=\"targetSelected.has(item.id)\"\n @click=\"toggle('target', item.id)\"\n >\n <input\n type=\"checkbox\"\n :checked=\"targetSelected.has(item.id)\"\n :aria-label=\"item.label\"\n tabindex=\"-1\"\n />\n <span>{{ item.label }}</span>\n </li>\n </ul>\n </div>\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\n/** A single recursive tree node — see VdTree.vue for the data model and events. */\nexport interface TreeNode {\n id?: string;\n label?: string;\n icon?: string;\n open?: boolean;\n checked?: boolean;\n children?: TreeNode[];\n}\n\nconst props = defineProps<{ node: TreeNode; checkbox: boolean }>();\nconst emit = defineEmits<{\n (e: \"toggle\", node: TreeNode): void;\n (e: \"check\", node: TreeNode, checked: boolean): void;\n}>();\n\nconst hasChildren = computed(\n () => !!props.node.children && props.node.children.length > 0,\n);\n\nconst onToggle = (): void => {\n // The tree mutates its shared, reactive node model in place by design — the\n // parent VdTree owns the node objects and reacts to the change.\n // eslint-disable-next-line vue/no-mutating-props\n props.node.open = !props.node.open;\n emit(\"toggle\", props.node);\n};\n\nconst onCheck = (e: Event): void => {\n emit(\"check\", props.node, (e.target as HTMLInputElement).checked);\n};\n</script>\n\n<template>\n <li\n class=\"vd-tree-node\"\n role=\"treeitem\"\n :class=\"{ 'is-open': node.open }\"\n :aria-expanded=\"hasChildren ? (node.open ? 'true' : 'false') : undefined\"\n >\n <div class=\"vd-tree-node-content\">\n <button\n v-if=\"hasChildren\"\n type=\"button\"\n class=\"vd-tree-toggle\"\n aria-label=\"Toggle\"\n @click.stop=\"onToggle\"\n ></button>\n <span v-else class=\"vd-tree-toggle-placeholder\"></span>\n\n <input\n v-if=\"checkbox\"\n type=\"checkbox\"\n class=\"vd-tree-checkbox\"\n :checked=\"node.checked\"\n :aria-label=\"node.label\"\n @change.stop=\"onCheck\"\n @click.stop\n />\n\n <span v-if=\"node.icon\" class=\"vd-tree-icon\" :class=\"node.icon\"></span>\n <span class=\"vd-tree-label\" tabindex=\"-1\">{{ node.label }}</span>\n </div>\n\n <ul v-if=\"hasChildren\" class=\"vd-tree-children\" role=\"group\">\n <VdTreeNode\n v-for=\"(child, i) in node.children\"\n :key=\"child.id ?? i\"\n :node=\"child\"\n :checkbox=\"checkbox\"\n @toggle=\"(n) => emit('toggle', n)\"\n @check=\"(n, c) => emit('check', n, c)\"\n />\n </ul>\n </li>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from \"vue\";\n\n/** A single recursive tree node — see VdTree.vue for the data model and events. */\nexport interface TreeNode {\n id?: string;\n label?: string;\n icon?: string;\n open?: boolean;\n checked?: boolean;\n children?: TreeNode[];\n}\n\nconst props = defineProps<{ node: TreeNode; checkbox: boolean }>();\nconst emit = defineEmits<{\n (e: \"toggle\", node: TreeNode): void;\n (e: \"check\", node: TreeNode, checked: boolean): void;\n}>();\n\nconst hasChildren = computed(\n () => !!props.node.children && props.node.children.length > 0,\n);\n\nconst onToggle = (): void => {\n // The tree mutates its shared, reactive node model in place by design — the\n // parent VdTree owns the node objects and reacts to the change.\n // eslint-disable-next-line vue/no-mutating-props\n props.node.open = !props.node.open;\n emit(\"toggle\", props.node);\n};\n\nconst onCheck = (e: Event): void => {\n emit(\"check\", props.node, (e.target as HTMLInputElement).checked);\n};\n</script>\n\n<template>\n <li\n class=\"vd-tree-node\"\n role=\"treeitem\"\n :class=\"{ 'is-open': node.open }\"\n :aria-expanded=\"hasChildren ? (node.open ? 'true' : 'false') : undefined\"\n >\n <div class=\"vd-tree-node-content\">\n <button\n v-if=\"hasChildren\"\n type=\"button\"\n class=\"vd-tree-toggle\"\n aria-label=\"Toggle\"\n @click.stop=\"onToggle\"\n ></button>\n <span v-else class=\"vd-tree-toggle-placeholder\"></span>\n\n <input\n v-if=\"checkbox\"\n type=\"checkbox\"\n class=\"vd-tree-checkbox\"\n :checked=\"node.checked\"\n :aria-label=\"node.label\"\n @change.stop=\"onCheck\"\n @click.stop\n />\n\n <span v-if=\"node.icon\" class=\"vd-tree-icon\" :class=\"node.icon\"></span>\n <span class=\"vd-tree-label\" tabindex=\"-1\">{{ node.label }}</span>\n </div>\n\n <ul v-if=\"hasChildren\" class=\"vd-tree-children\" role=\"group\">\n <VdTreeNode\n v-for=\"(child, i) in node.children\"\n :key=\"child.id ?? i\"\n :node=\"child\"\n :checkbox=\"checkbox\"\n @toggle=\"(n) => emit('toggle', n)\"\n @check=\"(n, c) => emit('check', n, c)\"\n />\n </ul>\n </li>\n</template>\n","<script setup lang=\"ts\">\nimport { reactive, ref } from \"vue\";\nimport VdTreeNode, { type TreeNode } from \"./VdTreeNode.vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/tree.js — renders\n * hierarchical `data-vd-tree` JSON as an expand/collapse tree with optional\n * checkbox selection and parent→child cascade. Reproduces the framework's\n * generated DOM (`.vd-tree[role=tree]` → `.vd-tree-node` → `.vd-tree-node-content`\n * → `.vd-tree-children`), `getChecked()`, and keyboard navigation.\n *\n * Fixes-to-documented-intent vs the Vanilla JS:\n * - fires `tree:toggle` with `{ id, open }` (listed in the docs API table but\n * never dispatched by the Vanilla JS) and `tree:check` with the documented\n * `{ checked: string[], node: string }` shape (Vanilla fired a single\n * `{ id, checked: boolean, label }`).\n * - Arrow Left/Right collapse/expand the focused branch (documented keyboard\n * support the Vanilla JS omitted; it only handled Up/Down).\n */\nconst props = defineProps<{\n nodes: TreeNode[];\n checkbox?: boolean;\n cascade?: boolean;\n}>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst clone = (nodes: TreeNode[]): TreeNode[] =>\n nodes.map((n) => ({\n ...n,\n children: n.children ? clone(n.children) : undefined,\n }));\n\nconst tree = reactive(clone(props.nodes));\n\nconst setChildChecked = (items: TreeNode[], checked: boolean): void => {\n items.forEach((item) => {\n item.checked = checked;\n if (item.children) setChildChecked(item.children, checked);\n });\n};\n\nconst collectChecked = (items: TreeNode[], acc: string[] = []): string[] => {\n items.forEach((i) => {\n if (i.checked) acc.push(i.id ?? i.label ?? \"\");\n if (i.children) collectChecked(i.children, acc);\n });\n return acc;\n};\n\nconst onCheck = (node: TreeNode, checked: boolean): void => {\n node.checked = checked;\n if ((props.cascade ?? true) && node.children) {\n setChildChecked(node.children, checked);\n }\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:check\", {\n bubbles: true,\n detail: { checked: collectChecked(tree), node: node.id },\n }),\n );\n};\n\nconst onToggle = (node: TreeNode): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:toggle\", {\n bubbles: true,\n detail: { id: node.id, open: !!node.open },\n }),\n );\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n const host = root.value;\n const active = document.activeElement;\n if (!host || !active || !host.contains(active)) return;\n const contents = Array.from(\n host.querySelectorAll<HTMLElement>(\".vd-tree-node-content\"),\n );\n const current = active.closest(\".vd-tree-node-content\") as HTMLElement | null;\n const idx = current ? contents.indexOf(current) : -1;\n if (idx === -1) return;\n\n const focusAt = (i: number): void => {\n contents[i]\n ?.querySelector<HTMLElement>(\".vd-tree-toggle, .vd-tree-label\")\n ?.focus();\n };\n\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (idx < contents.length - 1) focusAt(idx + 1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (idx > 0) focusAt(idx - 1);\n break;\n case \"ArrowRight\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && !node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n case \"ArrowLeft\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n }\n};\n\ndefineExpose({ getChecked: () => collectChecked(tree) });\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-tree\" role=\"tree\" @keydown=\"onKeydown\">\n <VdTreeNode\n v-for=\"(node, i) in tree\"\n :key=\"node.id ?? i\"\n :node=\"node\"\n :checkbox=\"!!checkbox\"\n @toggle=\"onToggle\"\n @check=\"onCheck\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\nimport { reactive, ref } from \"vue\";\nimport VdTreeNode, { type TreeNode } from \"./VdTreeNode.vue\";\n\n/**\n * Reactive reimplementation of framework/js/components/tree.js — renders\n * hierarchical `data-vd-tree` JSON as an expand/collapse tree with optional\n * checkbox selection and parent→child cascade. Reproduces the framework's\n * generated DOM (`.vd-tree[role=tree]` → `.vd-tree-node` → `.vd-tree-node-content`\n * → `.vd-tree-children`), `getChecked()`, and keyboard navigation.\n *\n * Fixes-to-documented-intent vs the Vanilla JS:\n * - fires `tree:toggle` with `{ id, open }` (listed in the docs API table but\n * never dispatched by the Vanilla JS) and `tree:check` with the documented\n * `{ checked: string[], node: string }` shape (Vanilla fired a single\n * `{ id, checked: boolean, label }`).\n * - Arrow Left/Right collapse/expand the focused branch (documented keyboard\n * support the Vanilla JS omitted; it only handled Up/Down).\n */\nconst props = defineProps<{\n nodes: TreeNode[];\n checkbox?: boolean;\n cascade?: boolean;\n}>();\n\nconst root = ref<HTMLElement | null>(null);\n\nconst clone = (nodes: TreeNode[]): TreeNode[] =>\n nodes.map((n) => ({\n ...n,\n children: n.children ? clone(n.children) : undefined,\n }));\n\nconst tree = reactive(clone(props.nodes));\n\nconst setChildChecked = (items: TreeNode[], checked: boolean): void => {\n items.forEach((item) => {\n item.checked = checked;\n if (item.children) setChildChecked(item.children, checked);\n });\n};\n\nconst collectChecked = (items: TreeNode[], acc: string[] = []): string[] => {\n items.forEach((i) => {\n if (i.checked) acc.push(i.id ?? i.label ?? \"\");\n if (i.children) collectChecked(i.children, acc);\n });\n return acc;\n};\n\nconst onCheck = (node: TreeNode, checked: boolean): void => {\n node.checked = checked;\n if ((props.cascade ?? true) && node.children) {\n setChildChecked(node.children, checked);\n }\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:check\", {\n bubbles: true,\n detail: { checked: collectChecked(tree), node: node.id },\n }),\n );\n};\n\nconst onToggle = (node: TreeNode): void => {\n root.value?.dispatchEvent(\n new CustomEvent(\"tree:toggle\", {\n bubbles: true,\n detail: { id: node.id, open: !!node.open },\n }),\n );\n};\n\nconst onKeydown = (e: KeyboardEvent): void => {\n const host = root.value;\n const active = document.activeElement;\n if (!host || !active || !host.contains(active)) return;\n const contents = Array.from(\n host.querySelectorAll<HTMLElement>(\".vd-tree-node-content\"),\n );\n const current = active.closest(\".vd-tree-node-content\") as HTMLElement | null;\n const idx = current ? contents.indexOf(current) : -1;\n if (idx === -1) return;\n\n const focusAt = (i: number): void => {\n contents[i]\n ?.querySelector<HTMLElement>(\".vd-tree-toggle, .vd-tree-label\")\n ?.focus();\n };\n\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n if (idx < contents.length - 1) focusAt(idx + 1);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n if (idx > 0) focusAt(idx - 1);\n break;\n case \"ArrowRight\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && !node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n case \"ArrowLeft\": {\n e.preventDefault();\n const node = current?.closest(\".vd-tree-node\");\n const toggle =\n current?.querySelector<HTMLButtonElement>(\".vd-tree-toggle\");\n if (toggle && node?.classList.contains(\"is-open\")) toggle.click();\n break;\n }\n }\n};\n\ndefineExpose({ getChecked: () => collectChecked(tree) });\n</script>\n\n<template>\n <div ref=\"root\" class=\"vd-tree\" role=\"tree\" @keydown=\"onKeydown\">\n <VdTreeNode\n v-for=\"(node, i) in tree\"\n :key=\"node.id ?? i\"\n :node=\"node\"\n :checkbox=\"!!checkbox\"\n @toggle=\"onToggle\"\n @check=\"onCheck\"\n />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Fibonacci padding step (maps to `data-pad`). */\n pad?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", pad: \"fib-8\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-box\" :data-pad=\"pad\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Fibonacci padding step (maps to `data-pad`). */\n pad?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", pad: \"fib-8\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-box\" :data-pad=\"pad\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Max = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Axis = \"both\" | \"horizontal\" | \"vertical\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Max content width (maps to `data-max`). */\n max?: Max;\n /** Also center children along an axis (maps to `data-axis`). */\n axis?: Axis;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", max: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-center\" :data-max=\"max\" :data-axis=\"axis\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Max = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Axis = \"both\" | \"horizontal\" | \"vertical\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Max content width (maps to `data-max`). */\n max?: Max;\n /** Also center children along an axis (maps to `data-axis`). */\n axis?: Axis;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", max: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-center\" :data-max=\"max\" :data-axis=\"axis\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Min = \"screen\" | \"half\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Minimum height (maps to `data-min`). */\n min?: Min;\n /** Gap between centered children (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", min: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-cover\" :data-min=\"min\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Min = \"screen\" | \"half\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n as?: keyof HTMLElementTagNameMap;\n /** Minimum height (maps to `data-min`). */\n min?: Min;\n /** Gap between centered children (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { as: \"div\", min: \"fib-610\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-cover\" :data-min=\"min\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Ratio = \"golden\" | \"golden-portrait\" | \"square\" | \"16-9\" | \"4-3\" | \"3-2\";\n\ninterface Props {\n /** Aspect ratio (maps to `data-ratio`). */\n ratio?: Ratio;\n}\n\nwithDefaults(defineProps<Props>(), { ratio: \"golden\" });\n</script>\n\n<template>\n <div class=\"vd-frame\" :data-ratio=\"ratio\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Ratio = \"golden\" | \"golden-portrait\" | \"square\" | \"16-9\" | \"4-3\" | \"3-2\";\n\ninterface Props {\n /** Aspect ratio (maps to `data-ratio`). */\n ratio?: Ratio;\n}\n\nwithDefaults(defineProps<Props>(), { ratio: \"golden\" });\n</script>\n\n<template>\n <div class=\"vd-frame\" :data-ratio=\"ratio\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between wrapped inline items (maps to `data-gap`). */\n gap?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-inline\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between wrapped inline items (maps to `data-gap`). */\n gap?: Space;\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-inline\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between stacked children (maps to `data-gap`). */\n gap?: Space;\n as?: \"div\" | \"section\" | \"ul\" | \"ol\";\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-8\", as: \"div\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-stack\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Space =\n | \"0\"\n | \"fib-1\"\n | \"fib-2\"\n | \"fib-3\"\n | \"fib-5\"\n | \"fib-8\"\n | \"fib-13\"\n | \"fib-21\"\n | \"fib-34\"\n | \"fib-55\";\n\ninterface Props {\n /** Fibonacci gap between stacked children (maps to `data-gap`). */\n gap?: Space;\n as?: \"div\" | \"section\" | \"ul\" | \"ol\";\n}\n\nwithDefaults(defineProps<Props>(), { gap: \"fib-8\", as: \"div\" });\n</script>\n\n<template>\n <component :is=\"as\" class=\"vd-stack\" :data-gap=\"gap\">\n <slot />\n </component>\n</template>\n","<script setup lang=\"ts\">\ntype Threshold = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n /** Width below which children stack (maps to `data-threshold`). */\n threshold?: Threshold;\n /** Gap between items (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { threshold: \"fib-610\", gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-switcher\" :data-threshold=\"threshold\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","<script setup lang=\"ts\">\ntype Threshold = \"fib-377\" | \"fib-610\" | \"fib-987\";\ntype Gap = \"fib-3\" | \"fib-5\" | \"fib-8\";\n\ninterface Props {\n /** Width below which children stack (maps to `data-threshold`). */\n threshold?: Threshold;\n /** Gap between items (maps to `data-gap`). */\n gap?: Gap;\n}\n\nwithDefaults(defineProps<Props>(), { threshold: \"fib-610\", gap: \"fib-5\" });\n</script>\n\n<template>\n <div class=\"vd-switcher\" :data-threshold=\"threshold\" :data-gap=\"gap\">\n <slot />\n </div>\n</template>\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/affix.js — scans `root` for\n * `.vd-affix` / `.vd-sticky` / `[data-vd-affix]` elements, finds the nearest\n * scrollable parent, inserts a sentinel before each element, and toggles\n * `.is-stuck` via IntersectionObserver while the element is pinned. Falls back\n * to the viewport when there is no scrollable parent. Emits `affix:stuck` /\n * `affix:unstuck` with `{ offset, root }`.\n */\nfunction isScrollable(el: Element | null): boolean {\n if (!el || el === document.body) return false;\n const style = window.getComputedStyle(el);\n const canY =\n /(auto|scroll|overlay)/.test(style.overflowY) &&\n el.scrollHeight > el.clientHeight;\n const canX =\n /(auto|scroll|overlay)/.test(style.overflowX) &&\n el.scrollWidth > el.clientWidth;\n return canY || canX;\n}\n\nfunction getScrollParent(el: Element): Element | null {\n let parent = el.parentElement;\n while (\n parent &&\n parent !== document.body &&\n parent !== document.documentElement\n ) {\n if (isScrollable(parent)) return parent;\n parent = parent.parentElement;\n }\n return null;\n}\n\nexport function useAffix(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n const els = host.querySelectorAll<HTMLElement>(\n \".vd-affix, .vd-sticky, [data-vd-affix]\",\n );\n\n els.forEach((el) => {\n const parsed = parseInt(\n el.getAttribute(\"data-vd-affix-offset\") || \"0\",\n 10,\n );\n const offset = Number.isNaN(parsed) ? 0 : parsed;\n const scrollParent = getScrollParent(el);\n let isStuck = false;\n\n const sentinel = document.createElement(\"div\");\n sentinel.style.cssText =\n \"display:block;height:1px;margin-bottom:-1px;visibility:hidden;pointer-events:none;\";\n el.parentNode?.insertBefore(sentinel, el);\n el.style.setProperty(\"--vd-affix-top-offset\", offset + \"px\");\n\n const stick = (): void => {\n if (isStuck) return;\n isStuck = true;\n el.classList.add(\"is-stuck\");\n el.dispatchEvent(\n new CustomEvent(\"affix:stuck\", {\n bubbles: true,\n detail: { offset, root: scrollParent || window },\n }),\n );\n };\n\n const unstick = (): void => {\n if (!isStuck) return;\n isStuck = false;\n el.classList.remove(\"is-stuck\");\n el.dispatchEvent(\n new CustomEvent(\"affix:unstuck\", {\n bubbles: true,\n detail: { offset, root: scrollParent || window },\n }),\n );\n };\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) stick();\n else unstick();\n });\n },\n {\n root: scrollParent,\n rootMargin: \"-\" + offset + \"px 0px 0px 0px\",\n threshold: 0,\n },\n );\n observer.observe(sentinel);\n\n cleanups.push(\n () => observer.disconnect(),\n () => {\n if (sentinel.parentNode) sentinel.parentNode.removeChild(sentinel);\n },\n () => {\n el.classList.remove(\"is-stuck\");\n el.style.removeProperty(\"--vd-affix-top-offset\");\n },\n );\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/datepicker.js — scans `root` for\n * `[data-vd-datepicker]` inputs and attaches a calendar popup (appended to\n * `document.body`, position:fixed, anchored under the input). Supports custom\n * `YYYY/MM/DD` format tokens, min/max constraints, day → month → year (decade)\n * view switching, and full keyboard grid navigation. Fires `datepicker:select`\n * with `{ date, formatted }`.\n *\n * The page renders the `.vd-suggest-wrapper` around the input so no Vue-managed\n * node is relocated (the Vanilla JS created the wrapper itself).\n */\nconst DAYS = [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"];\nconst MONTHS = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\",\n];\n\nconst escapeRegexChar = (c: string): string =>\n c.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n\nfunction buildParseFormat(format: string): { regex: RegExp; order: string[] } {\n let regex = \"^\";\n const order: string[] = [];\n let i = 0;\n while (i < format.length) {\n const slice = format.slice(i);\n if (slice.toLowerCase().startsWith(\"yyyy\")) {\n regex += \"(\\\\d{4})\";\n order.push(\"y\");\n i += 4;\n } else if (slice.toLowerCase().startsWith(\"mm\")) {\n regex += \"(\\\\d{2})\";\n order.push(\"m\");\n i += 2;\n } else if (slice.toLowerCase().startsWith(\"dd\")) {\n regex += \"(\\\\d{2})\";\n order.push(\"d\");\n i += 2;\n } else {\n regex += escapeRegexChar(format[i]);\n i++;\n }\n }\n regex += \"$\";\n return { regex: new RegExp(regex), order };\n}\n\nfunction parseDateFromFormat(value: string, format: string): Date | null {\n if (!value || !format) return null;\n const { regex, order } = buildParseFormat(format);\n const m = value.trim().match(regex);\n if (!m) return null;\n let y: number | undefined;\n let mo: number | undefined;\n let d: number | undefined;\n let ci = 1;\n for (const part of order) {\n const v = parseInt(m[ci++], 10);\n if (Number.isNaN(v)) return null;\n if (part === \"y\") y = v;\n else if (part === \"m\") mo = v - 1;\n else if (part === \"d\") d = v;\n }\n if (y === undefined || mo === undefined || d === undefined) return null;\n const dt = new Date(y, mo, d);\n if (dt.getFullYear() !== y || dt.getMonth() !== mo || dt.getDate() !== d)\n return null;\n return dt;\n}\n\nfunction formatDate(d: Date, format: string): string {\n const yyyy = String(d.getFullYear());\n const mm = String(d.getMonth() + 1).padStart(2, \"0\");\n const dd = String(d.getDate()).padStart(2, \"0\");\n let out = \"\";\n let i = 0;\n while (i < format.length) {\n const slice = format.slice(i);\n if (slice.toLowerCase().startsWith(\"yyyy\")) {\n out += yyyy;\n i += 4;\n } else if (slice.toLowerCase().startsWith(\"mm\")) {\n out += mm;\n i += 2;\n } else if (slice.toLowerCase().startsWith(\"dd\")) {\n out += dd;\n i += 2;\n } else {\n out += format[i];\n i++;\n }\n }\n return out;\n}\n\nconst dateKey = (d: Date): string =>\n d.getFullYear() +\n \"-\" +\n String(d.getMonth() + 1).padStart(2, \"0\") +\n \"-\" +\n String(d.getDate()).padStart(2, \"0\");\n\nfunction addDays(d: Date, n: number): Date {\n const x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n x.setDate(x.getDate() + n);\n return x;\n}\n\nconst addMonthsClamped = (d: Date, n: number): Date =>\n new Date(d.getFullYear(), d.getMonth() + n, d.getDate());\n\nfunction parseYmdLocal(ymd: string | null): Date | null {\n if (!ymd || typeof ymd !== \"string\") return null;\n const m = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(ymd.trim());\n if (!m) return null;\n const y = +m[1];\n const mo = +m[2] - 1;\n const day = +m[3];\n const dt = new Date(y, mo, day);\n if (dt.getFullYear() !== y || dt.getMonth() !== mo || dt.getDate() !== day)\n return null;\n return dt;\n}\n\nfunction startOfWeekSunday(d: Date): Date {\n const x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n x.setDate(x.getDate() - x.getDay());\n return x;\n}\n\nfunction endOfWeekSunday(d: Date): Date {\n const x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n x.setDate(x.getDate() + (6 - x.getDay()));\n return x;\n}\n\nfunction positionAnchoredPopup(\n anchor: HTMLElement,\n popup: HTMLElement,\n gap = 4,\n): void {\n const padding = 8;\n const rect = anchor.getBoundingClientRect();\n popup.style.minWidth = Math.max(rect.width, 0) + \"px\";\n\n let top = rect.bottom + gap;\n let left = rect.left;\n popup.style.top = top + \"px\";\n popup.style.left = left + \"px\";\n\n const popRect = popup.getBoundingClientRect();\n if (\n popRect.bottom > window.innerHeight - padding &&\n rect.top - popRect.height > padding\n ) {\n top = rect.top - popRect.height - gap;\n popup.style.top = top + \"px\";\n }\n\n const alignedRect = popup.getBoundingClientRect();\n left = rect.left;\n if (left + alignedRect.width > window.innerWidth - padding) {\n left = window.innerWidth - alignedRect.width - padding;\n }\n popup.style.left = Math.max(padding, left) + \"px\";\n}\n\nexport function useDatepicker(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n host\n .querySelectorAll<HTMLInputElement>(\"[data-vd-datepicker]\")\n .forEach((input) => initInstance(input, cleanups));\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n\nfunction initInstance(\n input: HTMLInputElement,\n cleanups: Array<() => void>,\n): void {\n const format =\n input.getAttribute(\"data-vd-datepicker-format\") || \"YYYY-MM-DD\";\n const minDate = parseYmdLocal(input.getAttribute(\"data-vd-datepicker-min\"));\n const maxDate = parseYmdLocal(input.getAttribute(\"data-vd-datepicker-max\"));\n\n const today = new Date();\n let viewYear = today.getFullYear();\n let viewMonth = today.getMonth();\n let selectedDate: Date | null = null;\n let viewMode: \"days\" | \"months\" | \"years\" = \"days\";\n let focusedDate: Date | null = null;\n let skipNextFocusOpen = false;\n let ignoreOutsideUntil = 0;\n\n const isDisabled = (d: Date): boolean => {\n const t = new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();\n if (minDate && t < minDate.getTime()) return true;\n if (maxDate && t > maxDate.getTime()) return true;\n return false;\n };\n\n const ensureMonthInRange = (\n y: number,\n m: number,\n ): { y: number; m: number } => {\n if (!minDate && !maxDate) return { y, m };\n const first = new Date(y, m, 1);\n const last = new Date(y, m + 1, 0);\n if (minDate && last.getTime() < minDate.getTime()) {\n return { y: minDate.getFullYear(), m: minDate.getMonth() };\n }\n if (maxDate && first.getTime() > maxDate.getTime()) {\n return { y: maxDate.getFullYear(), m: maxDate.getMonth() };\n }\n return { y, m };\n };\n\n const firstSelectableInMonth = (y: number, m: number): Date => {\n const last = new Date(y, m + 1, 0).getDate();\n for (let day = 1; day <= last; day++) {\n const dt = new Date(y, m, day);\n if (!isDisabled(dt)) return dt;\n }\n return new Date(y, m, 1);\n };\n\n if (input.value) {\n const trimmed = input.value.trim();\n let parsed = parseDateFromFormat(trimmed, format);\n if (!parsed) {\n const fallback = new Date(trimmed);\n if (!isNaN(fallback.getTime())) parsed = fallback;\n }\n if (parsed) {\n selectedDate = parsed;\n viewYear = parsed.getFullYear();\n viewMonth = parsed.getMonth();\n }\n }\n\n const clampedInit = ensureMonthInRange(viewYear, viewMonth);\n viewYear = clampedInit.y;\n viewMonth = clampedInit.m;\n\n const popup = document.createElement(\"div\");\n popup.className = \"vd-datepicker-popup\";\n popup.setAttribute(\"role\", \"dialog\");\n popup.setAttribute(\"aria-label\", \"Choose date\");\n popup.tabIndex = -1;\n\n let wrapper = input.closest(\".vd-suggest-wrapper\") as HTMLElement | null;\n if (!wrapper) {\n wrapper = document.createElement(\"div\");\n wrapper.className = \"vd-suggest-wrapper\";\n wrapper.style.position = \"relative\";\n wrapper.style.display = \"inline-block\";\n input.parentNode?.insertBefore(wrapper, input);\n wrapper.appendChild(input);\n }\n document.body.appendChild(popup);\n\n const isSameDay = (a: Date | null, b: Date | null): boolean =>\n !!a &&\n !!b &&\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate();\n\n const selectDate = (date: Date): void => {\n selectedDate = date;\n viewYear = date.getFullYear();\n viewMonth = date.getMonth();\n input.value = formatDate(date, format);\n skipNextFocusOpen = true;\n close();\n input.dispatchEvent(\n new CustomEvent(\"datepicker:select\", {\n bubbles: true,\n detail: { date, formatted: input.value },\n }),\n );\n input.dispatchEvent(new Event(\"change\", { bubbles: true }));\n input.focus();\n };\n\n const focusFocusedDay = (): void => {\n if (viewMode !== \"days\" || !focusedDate) return;\n const btn = popup.querySelector<HTMLElement>(\n '[data-vd-date=\"' + dateKey(focusedDate) + '\"]',\n );\n if (\n btn &&\n !btn.classList.contains(\"is-outside\") &&\n btn.getAttribute(\"aria-disabled\") !== \"true\"\n ) {\n btn.focus();\n }\n };\n\n const skipDisabled = (d: Date, stepDir: number, maxSteps: number): Date => {\n let x = new Date(d.getFullYear(), d.getMonth(), d.getDate());\n const step = stepDir > 0 ? 1 : -1;\n for (let i = 0; i < maxSteps; i++) {\n if (!isDisabled(x)) return x;\n x = addDays(x, step);\n }\n return d;\n };\n\n const createDayBtn = (\n day: number,\n outside: boolean,\n date: Date,\n ): HTMLButtonElement => {\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.className = \"vd-datepicker-day\";\n btn.textContent = String(day);\n btn.setAttribute(\"role\", \"gridcell\");\n\n if (outside) {\n btn.classList.add(\"is-outside\");\n btn.tabIndex = -1;\n btn.setAttribute(\"aria-disabled\", \"true\");\n return btn;\n }\n\n btn.setAttribute(\"data-vd-date\", dateKey(date));\n\n if (isSameDay(date, today)) btn.classList.add(\"is-today\");\n if (isSameDay(date, selectedDate)) btn.classList.add(\"is-selected\");\n if (isDisabled(date)) {\n btn.classList.add(\"is-disabled\");\n btn.setAttribute(\"aria-disabled\", \"true\");\n btn.tabIndex = -1;\n return btn;\n }\n\n const isFocused = focusedDate && isSameDay(date, focusedDate);\n btn.tabIndex = isFocused ? 0 : -1;\n btn.addEventListener(\"click\", () => {\n focusedDate = new Date(\n date.getFullYear(),\n date.getMonth(),\n date.getDate(),\n );\n selectDate(date);\n });\n\n return btn;\n };\n\n const render = (): void => {\n popup.innerHTML = \"\";\n\n const header = document.createElement(\"div\");\n header.className = \"vd-datepicker-header\";\n\n const prevBtn = document.createElement(\"button\");\n prevBtn.type = \"button\";\n prevBtn.className = \"vd-datepicker-prev\";\n prevBtn.innerHTML = \"‹\";\n prevBtn.setAttribute(\"aria-label\", \"Previous\");\n\n const nextBtn = document.createElement(\"button\");\n nextBtn.type = \"button\";\n nextBtn.className = \"vd-datepicker-next\";\n nextBtn.innerHTML = \"›\";\n nextBtn.setAttribute(\"aria-label\", \"Next\");\n\n const title = document.createElement(\"span\");\n title.className = \"vd-datepicker-title\";\n\n if (viewMode === \"days\") {\n title.textContent = MONTHS[viewMonth] + \" \" + viewYear;\n title.addEventListener(\"click\", () => {\n viewMode = \"months\";\n render();\n });\n prevBtn.addEventListener(\"click\", () => {\n viewMonth--;\n if (viewMonth < 0) {\n viewMonth = 11;\n viewYear--;\n }\n render();\n });\n nextBtn.addEventListener(\"click\", () => {\n viewMonth++;\n if (viewMonth > 11) {\n viewMonth = 0;\n viewYear++;\n }\n render();\n });\n } else if (viewMode === \"months\") {\n title.textContent = String(viewYear);\n title.addEventListener(\"click\", () => {\n viewMode = \"years\";\n render();\n });\n prevBtn.addEventListener(\"click\", () => {\n viewYear--;\n render();\n });\n nextBtn.addEventListener(\"click\", () => {\n viewYear++;\n render();\n });\n } else {\n const decadeStart = Math.floor(viewYear / 10) * 10;\n title.textContent = decadeStart + \" - \" + (decadeStart + 9);\n prevBtn.addEventListener(\"click\", () => {\n viewYear -= 10;\n render();\n });\n nextBtn.addEventListener(\"click\", () => {\n viewYear += 10;\n render();\n });\n }\n\n header.appendChild(prevBtn);\n header.appendChild(title);\n header.appendChild(nextBtn);\n popup.appendChild(header);\n\n if (viewMode === \"days\") {\n const gridWrap = document.createElement(\"div\");\n gridWrap.className = \"vd-datepicker-grid\";\n gridWrap.setAttribute(\"role\", \"grid\");\n gridWrap.setAttribute(\"aria-label\", \"Calendar\");\n\n const weekdays = document.createElement(\"div\");\n weekdays.className = \"vd-datepicker-weekdays\";\n weekdays.setAttribute(\"role\", \"row\");\n DAYS.forEach((d) => {\n const span = document.createElement(\"span\");\n span.setAttribute(\"role\", \"columnheader\");\n span.setAttribute(\"aria-label\", d);\n span.textContent = d;\n weekdays.appendChild(span);\n });\n gridWrap.appendChild(weekdays);\n\n const firstDay = new Date(viewYear, viewMonth, 1).getDay();\n const daysInMonth = new Date(viewYear, viewMonth + 1, 0).getDate();\n const daysInPrev = new Date(viewYear, viewMonth, 0).getDate();\n\n const cells: { day: number; outside: boolean; date: Date }[] = [];\n\n for (let i = firstDay - 1; i >= 0; i--) {\n const dayNum = daysInPrev - i;\n const prevMonth = viewMonth === 0 ? 11 : viewMonth - 1;\n const prevYear = viewMonth === 0 ? viewYear - 1 : viewYear;\n cells.push({\n day: dayNum,\n outside: true,\n date: new Date(prevYear, prevMonth, dayNum),\n });\n }\n for (let d = 1; d <= daysInMonth; d++) {\n cells.push({\n day: d,\n outside: false,\n date: new Date(viewYear, viewMonth, d),\n });\n }\n const totalCells = firstDay + daysInMonth;\n const remaining = totalCells % 7 === 0 ? 0 : 7 - (totalCells % 7);\n for (let i = 1; i <= remaining; i++) {\n cells.push({\n day: i,\n outside: true,\n date: new Date(viewYear, viewMonth + 1, i),\n });\n }\n\n for (let r = 0; r < cells.length; r += 7) {\n const row = document.createElement(\"div\");\n row.className = \"vd-datepicker-row\";\n row.setAttribute(\"role\", \"row\");\n for (let c = 0; c < 7; c++) {\n const cell = cells[r + c];\n row.appendChild(createDayBtn(cell.day, cell.outside, cell.date));\n }\n gridWrap.appendChild(row);\n }\n popup.appendChild(gridWrap);\n } else if (viewMode === \"months\") {\n const grid = document.createElement(\"div\");\n grid.className = \"vd-datepicker-months\";\n MONTHS.forEach((name, i) => {\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.className = \"vd-datepicker-month-btn\";\n btn.textContent = name.slice(0, 3);\n if (\n selectedDate &&\n selectedDate.getFullYear() === viewYear &&\n selectedDate.getMonth() === i\n ) {\n btn.classList.add(\"is-selected\");\n }\n btn.addEventListener(\"click\", () => {\n viewMonth = i;\n viewMode = \"days\";\n render();\n });\n grid.appendChild(btn);\n });\n popup.appendChild(grid);\n } else {\n const grid = document.createElement(\"div\");\n grid.className = \"vd-datepicker-years\";\n const decadeStart = Math.floor(viewYear / 10) * 10;\n for (let y = decadeStart - 1; y <= decadeStart + 10; y++) {\n const btn = document.createElement(\"button\");\n btn.type = \"button\";\n btn.className = \"vd-datepicker-year-btn\";\n btn.textContent = String(y);\n if (selectedDate && selectedDate.getFullYear() === y)\n btn.classList.add(\"is-selected\");\n if (y < decadeStart || y > decadeStart + 9) btn.style.opacity = \"0.4\";\n btn.addEventListener(\"click\", () => {\n viewYear = y;\n viewMode = \"months\";\n render();\n });\n grid.appendChild(btn);\n }\n popup.appendChild(grid);\n }\n\n if (popup.classList.contains(\"is-open\")) {\n requestAnimationFrame(positionPopup);\n }\n };\n\n const handleGridKeydown = (e: KeyboardEvent): void => {\n if (!popup.classList.contains(\"is-open\") || viewMode !== \"days\") return;\n const grid = popup.querySelector(\".vd-datepicker-grid\");\n if (!grid || !grid.contains(e.target as Node)) return;\n\n const key = e.key;\n const handled = [\n \"ArrowLeft\",\n \"ArrowRight\",\n \"ArrowUp\",\n \"ArrowDown\",\n \"Home\",\n \"End\",\n \"PageUp\",\n \"PageDown\",\n \"Enter\",\n \" \",\n \"Escape\",\n ];\n if (!handled.includes(key)) return;\n\n if (key === \"Escape\") {\n e.preventDefault();\n e.stopPropagation();\n skipNextFocusOpen = true;\n close();\n input.focus();\n return;\n }\n\n if (!focusedDate) focusedDate = firstSelectableInMonth(viewYear, viewMonth);\n\n if (key === \"Enter\" || key === \" \") {\n e.preventDefault();\n if (focusedDate && !isDisabled(focusedDate)) {\n selectDate(\n new Date(\n focusedDate.getFullYear(),\n focusedDate.getMonth(),\n focusedDate.getDate(),\n ),\n );\n }\n return;\n }\n\n e.preventDefault();\n\n let next = new Date(\n focusedDate.getFullYear(),\n focusedDate.getMonth(),\n focusedDate.getDate(),\n );\n let skipDir = 1;\n\n if (key === \"ArrowLeft\") {\n next = addDays(next, -1);\n skipDir = -1;\n } else if (key === \"ArrowRight\") {\n next = addDays(next, 1);\n skipDir = 1;\n } else if (key === \"ArrowUp\") {\n next = addDays(next, -7);\n skipDir = -1;\n } else if (key === \"ArrowDown\") {\n next = addDays(next, 7);\n skipDir = 1;\n } else if (key === \"Home\") {\n next = startOfWeekSunday(next);\n skipDir = 1;\n } else if (key === \"End\") {\n next = endOfWeekSunday(next);\n skipDir = -1;\n } else if (key === \"PageUp\") {\n next = addMonthsClamped(next, -1);\n skipDir = -1;\n } else if (key === \"PageDown\") {\n next = addMonthsClamped(next, 1);\n skipDir = 1;\n }\n\n next = skipDisabled(next, skipDir, 400);\n\n if (next.getMonth() !== viewMonth || next.getFullYear() !== viewYear) {\n viewYear = next.getFullYear();\n viewMonth = next.getMonth();\n const cl = ensureMonthInRange(viewYear, viewMonth);\n viewYear = cl.y;\n viewMonth = cl.m;\n }\n\n focusedDate = next;\n render();\n requestAnimationFrame(focusFocusedDay);\n };\n\n const positionPopup = (): void => {\n if (!popup.classList.contains(\"is-open\")) return;\n positionAnchoredPopup(input, popup);\n };\n const repositionHandler = (): void => positionPopup();\n const markIgnoreOutside = (): void => {\n ignoreOutsideUntil = Date.now() + 100;\n };\n\n const open = (): void => {\n markIgnoreOutside();\n viewMode = \"days\";\n if (selectedDate) {\n viewYear = selectedDate.getFullYear();\n viewMonth = selectedDate.getMonth();\n }\n const cl = ensureMonthInRange(viewYear, viewMonth);\n viewYear = cl.y;\n viewMonth = cl.m;\n\n focusedDate = selectedDate\n ? new Date(\n selectedDate.getFullYear(),\n selectedDate.getMonth(),\n selectedDate.getDate(),\n )\n : firstSelectableInMonth(viewYear, viewMonth);\n\n render();\n popup.classList.add(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"true\");\n requestAnimationFrame(() => {\n positionPopup();\n focusFocusedDay();\n });\n };\n\n const close = (): void => {\n popup.classList.remove(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"false\");\n viewMode = \"days\";\n };\n\n const focusHandler = (): void => {\n if (skipNextFocusOpen) {\n skipNextFocusOpen = false;\n return;\n }\n open();\n };\n const clickHandler = (): void => {\n if (!popup.classList.contains(\"is-open\")) open();\n };\n\n const isOpenAnchorTarget = (target: EventTarget | null): boolean => {\n if (!target || !(target instanceof Node)) return false;\n if (target === input || input.contains(target) || popup.contains(target))\n return true;\n const inputId = input.id;\n if (inputId) {\n const label = document.querySelector(\n 'label[for=\"' + inputId.replace(/\"/g, '\\\\\"') + '\"]',\n );\n if (label && (target === label || label.contains(target))) return true;\n }\n return false;\n };\n\n const outsideHandler = (e: Event): void => {\n if (Date.now() < ignoreOutsideUntil) return;\n if (!isOpenAnchorTarget(e.target)) close();\n };\n const escHandler = (e: KeyboardEvent): void => {\n if (e.key === \"Escape\" && popup.classList.contains(\"is-open\")) {\n skipNextFocusOpen = true;\n close();\n input.focus();\n }\n };\n\n input.addEventListener(\"focus\", focusHandler);\n input.addEventListener(\"click\", clickHandler);\n document.addEventListener(\"click\", outsideHandler, true);\n document.addEventListener(\"keydown\", escHandler);\n popup.addEventListener(\"keydown\", handleGridKeydown);\n window.addEventListener(\"resize\", repositionHandler);\n window.addEventListener(\"scroll\", repositionHandler, true);\n\n input.setAttribute(\"aria-haspopup\", \"dialog\");\n input.setAttribute(\"aria-expanded\", \"false\");\n input.setAttribute(\"autocomplete\", \"off\");\n\n cleanups.push(\n () => input.removeEventListener(\"focus\", focusHandler),\n () => input.removeEventListener(\"click\", clickHandler),\n () => document.removeEventListener(\"click\", outsideHandler, true),\n () => document.removeEventListener(\"keydown\", escHandler),\n () => popup.removeEventListener(\"keydown\", handleGridKeydown),\n () => window.removeEventListener(\"resize\", repositionHandler),\n () => window.removeEventListener(\"scroll\", repositionHandler, true),\n () => popup.remove(),\n );\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoDraggable.init(root)` from\n * `framework/js/components/draggable.js`: scans `root` for `.vd-draggable`\n * elements (or with attribute `data-vd-draggable`) and wires pointer drag\n * + drop-target detection. The framework global handles per-instance state;\n * this composable wires on mount and tears down on unmount via `destroyAll()`.\n */\nexport function useDraggable(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoDraggable?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoDraggable && typeof w.VanduoDraggable.init === \"function\") {\n w.VanduoDraggable.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoDraggable?: { destroyAll: () => void };\n };\n if (\n w.VanduoDraggable &&\n typeof w.VanduoDraggable.destroyAll === \"function\"\n ) {\n w.VanduoDraggable.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoDropdown.init(root)` from `framework/js/components/dropdown.js`:\n * scans `root` for `.vd-dropdown` containers, wires toggle / menu / keyboard /\n * outside-click / typeahead, and tears down on unmount.\n *\n * The framework JS already exposes a global, so we do NOT re-implement the\n * logic. Instead, `init(root)` is called once on mount; the framework's own\n * lifecycle (registered via `Vanduo.register('dropdown', …)`) handles each\n * dropdown's per-instance wiring, and `VanduoDropdown.destroyAll()` runs on\n * unmount so Vue's patch-driven DOM doesn't leave stale listeners behind.\n *\n * Notes:\n * - The framework tracks instances in a Map keyed by the `.vd-dropdown`\n * element. Vue's diffing may re-use the same element across re-renders,\n * so calling `init` twice is safe (the Map dedupes).\n * - `VanduoDropdown.destroyAll()` is the canonical teardown path called from\n * `Vanduo.destroy(root)`.\n */\nexport function useDropdown(root: Ref<HTMLElement | null>): void {\n let mountedRoot: HTMLElement | null = null;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const scope = r as unknown as HTMLElement;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoDropdown?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mountedRoot = scope;\n if (w.VanduoDropdown && typeof w.VanduoDropdown.init === \"function\") {\n w.VanduoDropdown.init(scope);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(scope);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\") return;\n const w = window as unknown as {\n VanduoDropdown?: { destroyAll: () => void };\n };\n if (w.VanduoDropdown && typeof w.VanduoDropdown.destroyAll === \"function\") {\n w.VanduoDropdown.destroyAll();\n }\n mountedRoot = null;\n void mountedRoot;\n };\n\n onMounted(() => {\n init();\n });\n\n onUnmounted(() => {\n teardown();\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoExpandingCards.init(root)` from\n * `framework/js/components/expanding-cards.js`: scans `root` for\n * `.vd-expanding-cards` containers and wires the click-to-expand behaviour\n * (one card expands to fill, others shrink to a thumbnail strip). The framework\n * global handles per-container state; this composable wires on mount and tears\n * down on unmount via `destroyAll()`.\n */\nexport function useExpandingCards(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoExpandingCards?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (\n w.VanduoExpandingCards &&\n typeof w.VanduoExpandingCards.init === \"function\"\n ) {\n w.VanduoExpandingCards.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoExpandingCards?: { destroyAll: () => void };\n };\n if (\n w.VanduoExpandingCards &&\n typeof w.VanduoExpandingCards.destroyAll === \"function\"\n ) {\n w.VanduoExpandingCards.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoFlow.init()` from `framework/js/components/flow.js`:\n * scans `root` for `.vd-flow` / `.vd-carousel` carousels and wires slide\n * transitions (slide + fade), prev/next controls, dot indicators, keyboard\n * arrows, pointer/touch swipe, and autoplay (pause on hover/focus).\n *\n * Indicator bridge: the docs markup places bare `<button>`s inside\n * `.vd-flow-indicators`, but the framework CSS/JS target `.vd-flow-indicator`.\n * We add that class here so indicators render as dots and become interactive —\n * matching the component's clear design intent.\n */\nexport function useFlow(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const initInstance = (el: HTMLElement): void => {\n const track = el.querySelector<HTMLElement>(\".vd-flow-track\");\n if (!track) return;\n\n const slides = Array.from(\n track.querySelectorAll<HTMLElement>(\".vd-flow-slide\"),\n );\n if (slides.length === 0) return;\n\n const isFade = el.classList.contains(\"vd-flow-fade\");\n const autoplay = el.hasAttribute(\"data-vd-autoplay\");\n const interval =\n parseInt(el.getAttribute(\"data-vd-interval\") ?? \"\", 10) || 5000;\n const loop = el.getAttribute(\"data-vd-loop\") !== \"false\";\n\n const state = { current: 0, total: slides.length };\n let autoplayTimer: number | null = null;\n let isDragging = false;\n let startX = 0;\n let currentX = 0;\n const threshold = 50;\n\n slides.forEach((slide, i) => {\n slide.setAttribute(\"role\", \"group\");\n slide.setAttribute(\"aria-roledescription\", \"slide\");\n slide.setAttribute(\"aria-label\", `Slide ${i + 1} of ${slides.length}`);\n if (i === 0) slide.classList.add(\"is-active\");\n });\n\n el.setAttribute(\"role\", \"region\");\n el.setAttribute(\"aria-roledescription\", \"carousel\");\n if (!el.getAttribute(\"aria-label\"))\n el.setAttribute(\"aria-label\", \"Carousel\");\n\n const liveRegion = document.createElement(\"div\");\n liveRegion.setAttribute(\"aria-live\", \"polite\");\n liveRegion.setAttribute(\"aria-atomic\", \"true\");\n liveRegion.className = \"sr-only\";\n liveRegion.style.cssText =\n \"position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);\";\n el.appendChild(liveRegion);\n\n // Bridge bare indicator buttons → styled, interactive dots.\n const indicators = Array.from(\n el.querySelectorAll<HTMLElement>(\n \".vd-flow-indicators button, .vd-flow-indicator\",\n ),\n );\n indicators.forEach((ind, i) => {\n ind.classList.add(\"vd-flow-indicator\");\n ind.setAttribute(\"role\", \"tab\");\n ind.setAttribute(\"aria-selected\", i === 0 ? \"true\" : \"false\");\n if (!ind.getAttribute(\"aria-label\"))\n ind.setAttribute(\"aria-label\", `Go to slide ${i + 1}`);\n });\n\n const goTo = (index: number, announce = true): void => {\n const target = loop\n ? ((index % state.total) + state.total) % state.total\n : Math.max(0, Math.min(index, state.total - 1));\n\n const prevIndex = state.current;\n state.current = target;\n\n if (isFade) {\n slides.forEach((s, i) => s.classList.toggle(\"is-active\", i === target));\n } else {\n track.style.transform = `translateX(-${target * 100}%)`;\n }\n\n indicators.forEach((ind, i) => {\n ind.classList.toggle(\"is-active\", i === target);\n ind.setAttribute(\"aria-selected\", i === target ? \"true\" : \"false\");\n ind.setAttribute(\"aria-current\", i === target ? \"true\" : \"false\");\n });\n\n slides.forEach((s, i) => {\n s.setAttribute(\"aria-hidden\", i !== target ? \"true\" : \"false\");\n });\n\n if (announce)\n liveRegion.textContent = `Slide ${target + 1} of ${state.total}`;\n\n el.dispatchEvent(\n new CustomEvent(\"flow:change\", {\n detail: { current: target, previous: prevIndex, total: state.total },\n }),\n );\n };\n\n const next = (): void => goTo(state.current + 1);\n const prev = (): void => goTo(state.current - 1);\n\n const prevBtn = el.querySelector<HTMLElement>(\".vd-flow-prev\");\n const nextBtn = el.querySelector<HTMLElement>(\".vd-flow-next\");\n if (prevBtn) {\n prevBtn.addEventListener(\"click\", prev);\n cleanups.push(() => prevBtn.removeEventListener(\"click\", prev));\n }\n if (nextBtn) {\n nextBtn.addEventListener(\"click\", next);\n cleanups.push(() => nextBtn.removeEventListener(\"click\", next));\n }\n\n indicators.forEach((ind, i) => {\n const h = (): void => goTo(i);\n ind.addEventListener(\"click\", h);\n cleanups.push(() => ind.removeEventListener(\"click\", h));\n });\n\n const keyHandler = (e: KeyboardEvent): void => {\n if (e.key === \"ArrowLeft\") {\n prev();\n e.preventDefault();\n }\n if (e.key === \"ArrowRight\") {\n next();\n e.preventDefault();\n }\n };\n el.setAttribute(\"tabindex\", \"0\");\n el.addEventListener(\"keydown\", keyHandler);\n cleanups.push(() => el.removeEventListener(\"keydown\", keyHandler));\n\n const pointerDown = (e: MouseEvent | TouchEvent): void => {\n isDragging = true;\n startX =\n (e as MouseEvent).clientX ||\n ((e as TouchEvent).touches && (e as TouchEvent).touches[0]?.clientX) ||\n 0;\n currentX = startX;\n el.classList.add(\"is-dragging\");\n };\n const pointerMove = (e: MouseEvent | TouchEvent): void => {\n if (!isDragging) return;\n currentX =\n (e as MouseEvent).clientX ||\n ((e as TouchEvent).touches && (e as TouchEvent).touches[0]?.clientX) ||\n 0;\n };\n const pointerUp = (): void => {\n if (!isDragging) return;\n isDragging = false;\n el.classList.remove(\"is-dragging\");\n const diff = startX - currentX;\n if (Math.abs(diff) > threshold) {\n if (diff > 0) next();\n else prev();\n }\n };\n\n el.addEventListener(\"mousedown\", pointerDown);\n el.addEventListener(\"mousemove\", pointerMove);\n el.addEventListener(\"mouseup\", pointerUp);\n el.addEventListener(\"mouseleave\", pointerUp);\n el.addEventListener(\"touchstart\", pointerDown, { passive: true });\n el.addEventListener(\"touchmove\", pointerMove, { passive: true });\n el.addEventListener(\"touchend\", pointerUp);\n cleanups.push(\n () => el.removeEventListener(\"mousedown\", pointerDown),\n () => el.removeEventListener(\"mousemove\", pointerMove),\n () => el.removeEventListener(\"mouseup\", pointerUp),\n () => el.removeEventListener(\"mouseleave\", pointerUp),\n () => el.removeEventListener(\"touchstart\", pointerDown),\n () => el.removeEventListener(\"touchmove\", pointerMove),\n () => el.removeEventListener(\"touchend\", pointerUp),\n );\n\n const startAutoplay = (): void => {\n stopAutoplay();\n autoplayTimer = window.setInterval(next, interval);\n };\n const stopAutoplay = (): void => {\n if (autoplayTimer != null) {\n window.clearInterval(autoplayTimer);\n autoplayTimer = null;\n }\n };\n if (autoplay) {\n startAutoplay();\n el.addEventListener(\"mouseenter\", stopAutoplay);\n el.addEventListener(\"mouseleave\", startAutoplay);\n el.addEventListener(\"focusin\", stopAutoplay);\n el.addEventListener(\"focusout\", startAutoplay);\n cleanups.push(\n () => el.removeEventListener(\"mouseenter\", stopAutoplay),\n () => el.removeEventListener(\"mouseleave\", startAutoplay),\n () => el.removeEventListener(\"focusin\", stopAutoplay),\n () => el.removeEventListener(\"focusout\", startAutoplay),\n () => stopAutoplay(),\n );\n }\n\n goTo(0, false);\n };\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n el.querySelectorAll<HTMLElement>(\".vd-flow, .vd-carousel\").forEach(\n initInstance,\n );\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, ref, type Ref } from \"vue\";\n\nconst FOCUSABLE_SELECTOR = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(\",\");\n\nexport const useFocusTrap = (\n container: Ref<HTMLElement | null>,\n): {\n active: Ref<boolean>;\n activate: () => void;\n deactivate: () => void;\n} => {\n const active = ref(false);\n\n const onKeydown = (event: KeyboardEvent): void => {\n if (!active.value || event.key !== \"Tab\" || !container.value) return;\n const focusables = Array.from(\n container.value.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR),\n ).filter((el) => !el.hasAttribute(\"disabled\") && el.tabIndex !== -1);\n if (focusables.length === 0) {\n event.preventDefault();\n return;\n }\n const first = focusables[0]!;\n const last = focusables[focusables.length - 1]!;\n const current = document.activeElement as HTMLElement | null;\n if (event.shiftKey && current === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && current === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n const activate = (): void => {\n active.value = true;\n if (container.value) {\n const first =\n container.value.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n first?.focus();\n }\n };\n\n const deactivate = (): void => {\n active.value = false;\n };\n\n onMounted(() => {\n if (typeof window !== \"undefined\") {\n window.addEventListener(\"keydown\", onKeydown);\n }\n });\n\n onUnmounted(() => {\n if (typeof window !== \"undefined\") {\n window.removeEventListener(\"keydown\", onKeydown);\n }\n });\n\n return { active, activate, deactivate };\n};\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `framework/js/components/glass.js`: scroll-aware glass activation.\n * For each `[data-glass-scroll]` element, observes a sentinel (the\n * `data-glass-sentinel` selector, else the previous sibling) and toggles\n * `.is-glass-active` when that sentinel scrolls out of / back into view.\n */\nexport function useGlass(root: Ref<HTMLElement | null>): void {\n const observers: IntersectionObserver[] = [];\n\n onMounted(() => {\n const scope = root.value;\n if (!scope || typeof IntersectionObserver === \"undefined\") return;\n\n scope.querySelectorAll<HTMLElement>(\"[data-glass-scroll]\").forEach((el) => {\n const selector = el.dataset.glassSentinel;\n let sentinel: Element | null = selector\n ? document.querySelector(selector)\n : null;\n if (!sentinel) sentinel = el.previousElementSibling;\n\n if (!sentinel) {\n el.classList.add(\"is-glass-active\");\n return;\n }\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n el.classList.toggle(\"is-glass-active\", !entry.isIntersecting);\n });\n },\n { threshold: 0, rootMargin: \"0px\" },\n );\n observer.observe(sentinel);\n observers.push(observer);\n });\n });\n\n onUnmounted(() => {\n observers.forEach((o) => o.disconnect());\n observers.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoImageBox.init(root)` from\n * `framework/js/components/image-box.js`: scans `root` for `.vd-image-box`\n * elements and wires hover-reveal caption + click-to-zoom behaviour. The\n * framework global handles per-instance state; this composable wires on mount\n * and tears down on unmount via `destroyAll()`.\n */\nexport function useImageBox(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoImageBox?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoImageBox && typeof w.VanduoImageBox.init === \"function\") {\n w.VanduoImageBox.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoImageBox?: { destroyAll: () => void };\n };\n if (w.VanduoImageBox && typeof w.VanduoImageBox.destroyAll === \"function\") {\n w.VanduoImageBox.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { ref, type Ref } from \"vue\";\n\nexport interface UseKeyboardNavOptions {\n itemSelector: string;\n onSelect?: (index: number) => void;\n onEscape?: () => void;\n}\n\nexport const useKeyboardNav = (\n container: Ref<HTMLElement | null>,\n options: UseKeyboardNavOptions,\n): { activeIndex: Ref<number>; setItems: (count: number) => void } => {\n const activeIndex = ref(0);\n let count = 0;\n\n const items = (): HTMLElement[] => {\n if (!container.value) return [];\n return Array.from(\n container.value.querySelectorAll<HTMLElement>(options.itemSelector),\n );\n };\n\n const focusItem = (index: number): void => {\n const list = items();\n const target = list[index];\n if (target) {\n target.focus();\n activeIndex.value = index;\n }\n };\n\n const onKeydown = (event: KeyboardEvent): void => {\n const list = items();\n if (list.length === 0) return;\n const max = list.length - 1;\n let next = activeIndex.value;\n switch (event.key) {\n case \"ArrowDown\":\n case \"ArrowRight\":\n next = Math.min(max, activeIndex.value + 1);\n break;\n case \"ArrowUp\":\n case \"ArrowLeft\":\n next = Math.max(0, activeIndex.value - 1);\n break;\n case \"Home\":\n next = 0;\n break;\n case \"End\":\n next = max;\n break;\n case \"Enter\":\n options.onSelect?.(activeIndex.value);\n return;\n case \"Escape\":\n options.onEscape?.();\n return;\n default:\n return;\n }\n event.preventDefault();\n focusItem(next);\n };\n\n if (typeof window !== \"undefined\" && container.value) {\n container.value.addEventListener(\"keydown\", onKeydown);\n }\n\n const setItems = (next: number): void => {\n count = next;\n if (activeIndex.value >= count) activeIndex.value = Math.max(0, count - 1);\n };\n\n return { activeIndex, setItems };\n};\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\nconst MORPH_DURATION_MS = 750;\n\n/**\n * Reproduces `framework/js/components/morph.js`: a liquid wave content-swap on\n * click for `.vd-morph` / `[data-vd-morph]` elements. Auto-creates the\n * `.vd-morph-wave` / `.vd-morph-shine` layers, originates the wave at the\n * pointer, adds `.is-morphing` for the animation window, then swaps\n * `.vd-morph-current` ⇄ `.vd-morph-next`. `[data-vd-morph=\"manual\"]` opts out\n * of the click handler.\n */\nexport function useMorph(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const ensureLayers = (el: HTMLElement): void => {\n if (!el.querySelector(\".vd-morph-wave\")) {\n const wave = document.createElement(\"span\");\n wave.className = \"vd-morph-wave\";\n wave.setAttribute(\"aria-hidden\", \"true\");\n el.insertBefore(wave, el.firstChild);\n }\n if (!el.querySelector(\".vd-morph-shine\")) {\n const shine = document.createElement(\"span\");\n shine.className = \"vd-morph-shine\";\n shine.setAttribute(\"aria-hidden\", \"true\");\n const waveEl = el.querySelector(\".vd-morph-wave\");\n if (waveEl?.nextSibling) el.insertBefore(shine, waveEl.nextSibling);\n else el.insertBefore(shine, el.firstChild);\n }\n };\n\n const runMorph = (\n el: HTMLElement,\n e: MouseEvent | null,\n done: () => void,\n ): void => {\n const wave = el.querySelector<HTMLElement>(\".vd-morph-wave\");\n if (wave) {\n const rect = el.getBoundingClientRect();\n const cx = rect.left + rect.width / 2;\n const cy = rect.top + rect.height / 2;\n const px = e ? e.clientX || cx : cx;\n const py = e ? e.clientY || cy : cy;\n wave.style.left = `${px - rect.left}px`;\n wave.style.top = `${py - rect.top}px`;\n }\n\n el.classList.add(\"is-morphing\");\n\n let duration = MORPH_DURATION_MS;\n const custom = getComputedStyle(el).getPropertyValue(\"--vd-morph-duration\");\n if (custom) {\n const parsed = parseFloat(custom);\n if (!isNaN(parsed))\n duration = parsed * (custom.includes(\"ms\") ? 1 : 1000);\n }\n\n window.setTimeout(() => {\n el.classList.remove(\"is-morphing\");\n const current = el.querySelector(\".vd-morph-current\");\n const next = el.querySelector(\".vd-morph-next\");\n if (current && next) {\n current.classList.replace(\"vd-morph-current\", \"vd-morph-next\");\n next.classList.replace(\"vd-morph-next\", \"vd-morph-current\");\n }\n done();\n }, duration);\n };\n\n onMounted(() => {\n const scope = root.value;\n if (!scope) return;\n scope\n .querySelectorAll<HTMLElement>(\".vd-morph, [data-vd-morph]\")\n .forEach((el) => {\n if (el.getAttribute(\"data-vd-morph\") === \"manual\") return;\n ensureLayers(el);\n let morphing = false;\n const onClick = (e: MouseEvent): void => {\n if (morphing) return;\n morphing = true;\n runMorph(el, e, () => (morphing = false));\n };\n el.addEventListener(\"click\", onClick);\n cleanups.push(() => el.removeEventListener(\"click\", onClick));\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports the docs-only multi-state morph badge cycling from\n * `docs/js/modules/demos.js` (`initSectionDemos`). Wires\n * `[data-vd-morph=\"manual\"][data-morph-states]` badges to cycle through\n * `data-morph-states` / `-classes` / `-icons` on click, swapping the badge\n * variant class and the current/next content with the morph wave.\n */\nexport function useMorphBadges(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const setContent = (\n target: Element | null,\n icon: string,\n label: string,\n ): void => {\n if (!target) return;\n const safeIcon = String(icon || \"\")\n .replace(/[^a-z0-9-\\s]/gi, \"\")\n .trim();\n while (target.firstChild) target.removeChild(target.firstChild);\n if (safeIcon) {\n const i = document.createElement(\"i\");\n i.className = `ph ${safeIcon}`;\n i.style.marginRight = \"0.35rem\";\n target.appendChild(i);\n }\n target.appendChild(\n document.createTextNode(label == null ? \"\" : String(label)),\n );\n };\n\n onMounted(() => {\n const scope = root.value;\n if (!scope) return;\n\n scope\n .querySelectorAll<HTMLElement>(\n '[data-vd-morph=\"manual\"][data-morph-states]',\n )\n .forEach((badge) => {\n const states: string[] = JSON.parse(\n badge.getAttribute(\"data-morph-states\") || \"[]\",\n );\n const classes: string[] = JSON.parse(\n badge.getAttribute(\"data-morph-classes\") || \"[]\",\n );\n const icons: string[] = JSON.parse(\n badge.getAttribute(\"data-morph-icons\") || \"[]\",\n );\n let idx = 0;\n let morphing = false;\n\n let morphMs = 750;\n const d = getComputedStyle(badge)\n .getPropertyValue(\"--vd-morph-duration\")\n .trim();\n if (d) {\n const parsed = parseFloat(d);\n if (!isNaN(parsed)) morphMs = parsed * (d.includes(\"ms\") ? 1 : 1000);\n }\n\n const onClick = (e: MouseEvent): void => {\n if (morphing || states.length === 0) return;\n morphing = true;\n const nextIdx = (idx + 1) % states.length;\n const afterIdx = (nextIdx + 1) % states.length;\n\n const next = badge.querySelector(\".vd-morph-next\");\n if (next)\n setContent(next, icons[nextIdx] ?? \"\", states[nextIdx] ?? \"\");\n\n const wave = badge.querySelector<HTMLElement>(\".vd-morph-wave\");\n if (wave) {\n const rect = badge.getBoundingClientRect();\n wave.style.left = `${(e.clientX || rect.left + rect.width / 2) - rect.left}px`;\n wave.style.top = `${(e.clientY || rect.top + rect.height / 2) - rect.top}px`;\n }\n\n badge.classList.add(\"is-morphing\");\n window.setTimeout(() => {\n badge.classList.remove(\"is-morphing\");\n classes.forEach((c) => badge.classList.remove(c));\n if (classes[nextIdx]) badge.classList.add(classes[nextIdx]);\n const current = badge.querySelector(\".vd-morph-current\");\n const nextEl = badge.querySelector(\".vd-morph-next\");\n if (current)\n setContent(current, icons[nextIdx] ?? \"\", states[nextIdx] ?? \"\");\n if (nextEl)\n setContent(nextEl, icons[afterIdx] ?? \"\", states[afterIdx] ?? \"\");\n idx = nextIdx;\n morphing = false;\n }, morphMs);\n };\n\n badge.addEventListener(\"click\", onClick);\n cleanups.push(() => badge.removeEventListener(\"click\", onClick));\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, ref, type Ref } from \"vue\";\n\n/**\n * Reproduces `framework/js/components/navbar.js` initScrollWatcher:\n * toggles scroll-aware glass/transparent behaviour for a navbar element.\n * Threshold: `data-scroll-threshold` attribute (px) or the navbar's own height.\n */\nexport function useNavbarGlassScroll(\n navbarRef: Ref<HTMLElement | null>,\n): Ref<boolean> {\n const isScrolled = ref(false);\n let onScroll: (() => void) | null = null;\n\n onMounted(() => {\n const navbar = navbarRef.value;\n if (!navbar) return;\n\n const isGlass = navbar.classList.contains(\"vd-navbar-glass\");\n const isTransparent = navbar.classList.contains(\"vd-navbar-transparent\");\n if (!isGlass && !isTransparent) return;\n\n const getThreshold = (): number => {\n const attr = parseInt(navbar.dataset.scrollThreshold ?? \"\", 10);\n return Number.isNaN(attr) ? navbar.offsetHeight || 60 : attr;\n };\n\n onScroll = (): void => {\n isScrolled.value = window.scrollY > getThreshold();\n };\n\n onScroll();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n });\n\n onUnmounted(() => {\n if (onScroll) {\n window.removeEventListener(\"scroll\", onScroll);\n onScroll = null;\n }\n });\n\n return isScrolled;\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\ninterface ParallaxConfig {\n layers: HTMLElement[];\n speed: number;\n direction: \"horizontal\" | \"vertical\";\n}\n\n/**\n * Reproduces `framework/js/components/parallax.js`: layers inside a\n * `.vd-parallax` container translate at speed-scaled rates on a\n * rAF-throttled scroll listener. Container speed comes from\n * `.vd-parallax-slow|medium|fast` (0.5 / 1 / 1.5); per-layer rate from\n * `data-parallax-speed`. Disabled entirely under prefers-reduced-motion.\n */\nexport function useParallax(root: Ref<HTMLElement | null>): void {\n const elements = new Map<HTMLElement, ParallaxConfig>();\n let ticking = false;\n let onScroll: (() => void) | null = null;\n\n const getSpeed = (el: HTMLElement): number => {\n if (el.classList.contains(\"vd-parallax-slow\")) return 0.5;\n if (el.classList.contains(\"vd-parallax-fast\")) return 1.5;\n return 1;\n };\n\n const updateOne = (el: HTMLElement): void => {\n const config = elements.get(el);\n if (!config) return;\n const rect = el.getBoundingClientRect();\n const winH = window.innerHeight;\n const scrollProgress = Math.max(\n 0,\n Math.min(1, (winH - rect.top) / (winH + rect.height)),\n );\n const offset = (scrollProgress - 0.5) * config.speed * 100;\n config.layers.forEach((layer) => {\n const attr = layer.dataset.parallaxSpeed ?? layer.dataset.speed;\n const layerSpeed = attr ? parseFloat(attr) : 1;\n const layerOffset = offset * layerSpeed;\n layer.style.transform =\n config.direction === \"horizontal\"\n ? `translateX(${layerOffset}px)`\n : `translateY(${layerOffset}px)`;\n });\n };\n\n const updateAll = (): void => elements.forEach((_c, el) => updateOne(el));\n\n const handleScroll = (): void => {\n if (!ticking) {\n window.requestAnimationFrame(() => {\n updateAll();\n ticking = false;\n });\n ticking = true;\n }\n };\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n if (window.matchMedia?.(\"(prefers-reduced-motion: reduce)\").matches) return;\n\n const scope = root.value;\n if (!scope) return;\n\n scope.querySelectorAll<HTMLElement>(\".vd-parallax\").forEach((el) => {\n const layers = Array.from(\n el.querySelectorAll<HTMLElement>(\".vd-parallax-layer, .vd-parallax-bg\"),\n );\n const direction = el.classList.contains(\"vd-parallax-horizontal\")\n ? \"horizontal\"\n : \"vertical\";\n elements.set(el, { layers, speed: getSpeed(el), direction });\n updateOne(el);\n });\n\n onScroll = () => handleScroll();\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n handleScroll();\n });\n\n onUnmounted(() => {\n if (onScroll) window.removeEventListener(\"scroll\", onScroll);\n onScroll = null;\n elements.forEach((config) => {\n config.layers.forEach((l) => (l.style.transform = \"\"));\n });\n elements.clear();\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Wires the framework's bubble/popover component over `root`. The shipped\n * framework registers this as `bubble` (`window.VanduoBubble`) and scans for\n * `[data-vd-bubble]` / `[data-vd-popover]` triggers — building the panel from\n * attributes (`data-vd-bubble`, `-title`, `-placement`). This composable calls\n * `init(root)` on mount and tears down on unmount via `destroyAll()`.\n */\nexport function usePopover(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoBubble?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoBubble && typeof w.VanduoBubble.init === \"function\") {\n w.VanduoBubble.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoBubble?: { destroyAll: () => void };\n };\n if (w.VanduoBubble && typeof w.VanduoBubble.destroyAll === \"function\") {\n w.VanduoBubble.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoRipple.init(root)` from `framework/js/components/ripple.js`:\n * adds a click-spawned ripple element to any element matching `.vd-ripple`\n * (or with the attribute `data-vd-ripple`). The framework global owns the\n * per-element state and cleanup, so this composable simply wires the root on\n * mount and lets the framework tear down on unmount via `destroyAll(root)`.\n */\nexport function useRipple(root: Ref<HTMLElement | null>): void {\n let mountedRoot: HTMLElement | null = null;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoRipple?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mountedRoot = r;\n if (w.VanduoRipple && typeof w.VanduoRipple.init === \"function\") {\n w.VanduoRipple.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\") return;\n const w = window as unknown as {\n VanduoRipple?: { destroyAll: () => void };\n };\n if (w.VanduoRipple && typeof w.VanduoRipple.destroyAll === \"function\") {\n w.VanduoRipple.destroyAll();\n }\n mountedRoot = null;\n void mountedRoot;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, ref, type Ref } from \"vue\";\n\nexport const useScrollspy = (\n ids: string[],\n options: { offset?: number; rootMargin?: string } = {},\n): { activeId: Ref<string | null> } => {\n const activeId = ref<string | null>(ids[0] ?? null);\n const offset = options.offset ?? 96;\n\n let observer: IntersectionObserver | null = null;\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n if (!(\"IntersectionObserver\" in window)) return;\n\n const visible = new Set<string>();\n\n observer = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n if (entry.isIntersecting) visible.add(entry.target.id);\n else visible.delete(entry.target.id);\n }\n const firstVisible = ids.find((id) => visible.has(id));\n if (firstVisible) activeId.value = firstVisible;\n },\n {\n rootMargin: options.rootMargin ?? `-${offset}px 0px -60% 0px`,\n threshold: 0,\n },\n );\n\n for (const id of ids) {\n const el = document.getElementById(id);\n if (el) observer.observe(el);\n }\n });\n\n onUnmounted(() => {\n observer?.disconnect();\n observer = null;\n });\n\n return { activeId };\n};\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Wires the framework search helper against `root`. Sources registered with\n * `VanduoSearch.register()` are independent of mounting; the composable is a\n * thin lifecycle hook so vd2 consumers can mount sources alongside a search\n * overlay container.\n *\n * Per-source `fetch` functions are defined by the caller (see\n * `src/stores/search.ts` for the default vd2 sources). This composable does\n * NOT manage source registration — that happens in app-level code so the\n * registry outlives any single component instance.\n */\nexport function useSearch(root: Ref<HTMLElement | null>): void {\n const init = (): void => {\n if (typeof window === \"undefined\") return;\n const w = window as unknown as {\n VanduoSearch?: { list: () => ReadonlyArray<unknown> };\n };\n if (w.VanduoSearch) {\n // Touch list() to ensure the global exists; no DOM wiring needed at the\n // root level — the overlay (GlobalSearchModal) reads from the registry.\n w.VanduoSearch.list();\n }\n // Suppress unused-arg lint: the root ref is part of the public contract so\n // future versions can scope registration if needed.\n void root;\n };\n\n const teardown = (): void => {\n // No-op: registry is process-global. See note above.\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces the open/close behavior of\n * `framework/js/components/sidenav.js` for `.vd-sidenav` and `.vd-offcanvas`\n * drawers: `[data-sidenav-toggle=\"#id\"]` triggers, a body-level overlay,\n * close button, overlay-click (unless `data-backdrop=\"static\"`), Escape\n * (unless `data-keyboard=\"false\"`), body scroll-lock, `data-vd-position`\n * direction class, and `sidenav:open` / `sidenav:close` events.\n *\n * The Vanilla portal-to-body + push/fixed/resize handling is omitted: the demo\n * drawers are `position: fixed`, so they overlay the viewport without moving in\n * the DOM, which keeps this from fighting Vue's ownership of the elements.\n */\nexport function useSidenav(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n const overlays: HTMLElement[] = [];\n\n const open = (el: HTMLElement, overlay: HTMLElement): void => {\n if (\n !el.classList.contains(\"vd-sidenav-fixed\") &&\n !el.classList.contains(\"vd-offcanvas-fixed\")\n ) {\n overlay.classList.add(\"is-visible\");\n }\n el.classList.add(\"is-open\");\n el.setAttribute(\"aria-hidden\", \"false\");\n document.body.classList.add(\"body-sidenav-open\");\n el.dispatchEvent(new CustomEvent(\"sidenav:open\", { bubbles: true }));\n };\n\n const close = (el: HTMLElement, overlay: HTMLElement): void => {\n overlay.classList.remove(\"is-visible\");\n el.classList.remove(\"is-open\");\n el.setAttribute(\"aria-hidden\", \"true\");\n document.body.classList.remove(\"body-sidenav-open\");\n el.dispatchEvent(new CustomEvent(\"sidenav:close\", { bubbles: true }));\n };\n\n const toggle = (el: HTMLElement, overlay: HTMLElement): void => {\n if (el.classList.contains(\"is-open\")) close(el, overlay);\n else open(el, overlay);\n };\n\n onMounted(() => {\n const scope = root.value;\n if (!scope) return;\n\n const overlayFor = new Map<HTMLElement, HTMLElement>();\n\n scope\n .querySelectorAll<HTMLElement>(\".vd-sidenav, .vd-offcanvas\")\n .forEach((el) => {\n const position = el.getAttribute(\"data-vd-position\");\n if (position) {\n const prefix = el.classList.contains(\"vd-offcanvas\")\n ? \"vd-offcanvas\"\n : \"vd-sidenav\";\n el.classList.add(`${prefix}-${position}`);\n }\n\n const overlay = document.createElement(\"div\");\n overlay.className = \"vd-sidenav-overlay\";\n document.body.appendChild(overlay);\n overlays.push(overlay);\n overlayFor.set(el, overlay);\n\n el.setAttribute(\"role\", \"navigation\");\n el.setAttribute(\"aria-hidden\", \"true\");\n\n const closeBtn = el.querySelector<HTMLElement>(\n \".vd-sidenav-close, .vd-offcanvas-close\",\n );\n if (closeBtn) {\n const h = (): void => close(el, overlay);\n closeBtn.addEventListener(\"click\", h);\n cleanups.push(() => closeBtn.removeEventListener(\"click\", h));\n }\n\n const onOverlay = (): void => {\n if (el.dataset.backdrop !== \"static\") close(el, overlay);\n };\n overlay.addEventListener(\"click\", onOverlay);\n cleanups.push(() => overlay.removeEventListener(\"click\", onOverlay));\n\n const onEsc = (e: KeyboardEvent): void => {\n if (\n e.key === \"Escape\" &&\n el.classList.contains(\"is-open\") &&\n el.dataset.keyboard !== \"false\"\n ) {\n close(el, overlay);\n }\n };\n document.addEventListener(\"keydown\", onEsc);\n cleanups.push(() => document.removeEventListener(\"keydown\", onEsc));\n });\n\n scope\n .querySelectorAll<HTMLElement>(\"[data-sidenav-toggle]\")\n .forEach((btn) => {\n const onClick = (e: Event): void => {\n e.preventDefault();\n const targetId = btn.dataset.sidenavToggle;\n if (!targetId) return;\n const el = document.querySelector<HTMLElement>(targetId);\n const overlay = el ? overlayFor.get(el) : undefined;\n if (el && overlay) toggle(el, overlay);\n };\n btn.addEventListener(\"click\", onClick);\n cleanups.push(() => btn.removeEventListener(\"click\", onClick));\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n overlays.forEach((o) => o.remove());\n overlays.length = 0;\n document.body.classList.remove(\"body-sidenav-open\");\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoSpotlight.init(root)` from\n * `framework/js/components/spotlight.js`: scans `root` for `.vd-spotlight`\n * containers and wires the click-to-spotlight / dismiss behaviour. The\n * framework global handles per-instance state; this composable wires on mount\n * and tears down on unmount via `destroyAll()`.\n */\nexport function useSpotlight(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoSpotlight?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoSpotlight && typeof w.VanduoSpotlight.init === \"function\") {\n w.VanduoSpotlight.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoSpotlight?: { destroyAll: () => void };\n };\n if (\n w.VanduoSpotlight &&\n typeof w.VanduoSpotlight.destroyAll === \"function\"\n ) {\n w.VanduoSpotlight.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\nexport interface StepperApi {\n /** Advance the given stepper element to the next step. */\n next(el: Element | null): void;\n /** Return the given stepper element to the previous step. */\n prev(el: Element | null): void;\n /** Set the active step of the given stepper element (zero-based). */\n setStep(el: Element | null, index: number): void;\n}\n\ninterface Instance {\n setStep(index: number): void;\n next(): void;\n prev(): void;\n}\n\n/**\n * Ports framework/js/components/stepper.js — scans `root` for `.vd-stepper`\n * containers and manages step state. The active index is derived from the\n * initial `.is-active` item; `setStep` marks earlier items `.is-completed`,\n * the target `.is-active`, and dispatches `stepper:change` with\n * `{ current, previous, total }`. `.vd-stepper-clickable` steppers navigate on\n * item click. The returned imperative API lets the page wire the docs\n * `data-stepper-demo-control` Prev/Next buttons.\n */\nexport function useStepper(root: Ref<HTMLElement | null>): StepperApi {\n const instances = new Map<Element, Instance>();\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n const host = root.value;\n if (!host) return;\n\n host.querySelectorAll<HTMLElement>(\".vd-stepper\").forEach((el) => {\n const items = Array.from(\n el.querySelectorAll<HTMLElement>(\".vd-stepper-item\"),\n );\n const isClickable = el.classList.contains(\"vd-stepper-clickable\");\n let currentIndex = items.findIndex((i) =>\n i.classList.contains(\"is-active\"),\n );\n if (currentIndex === -1) currentIndex = 0;\n\n const setStep = (index: number): void => {\n if (index < 0 || index >= items.length) return;\n const prev = currentIndex;\n currentIndex = index;\n items.forEach((item, i) => {\n item.classList.remove(\"is-active\", \"is-completed\");\n item.removeAttribute(\"aria-current\");\n if (i < index) item.classList.add(\"is-completed\");\n else if (i === index) {\n item.classList.add(\"is-active\");\n item.setAttribute(\"aria-current\", \"step\");\n }\n });\n el.dispatchEvent(\n new CustomEvent(\"stepper:change\", {\n detail: { current: index, previous: prev, total: items.length },\n bubbles: true,\n }),\n );\n };\n\n if (isClickable) {\n items.forEach((item, i) => {\n const handler = (): void => setStep(i);\n item.addEventListener(\"click\", handler);\n const keyHandler = (e: KeyboardEvent): void => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n setStep(i);\n }\n };\n item.addEventListener(\"keydown\", keyHandler);\n cleanups.push(() => item.removeEventListener(\"click\", handler));\n cleanups.push(() => item.removeEventListener(\"keydown\", keyHandler));\n });\n }\n\n setStep(currentIndex);\n\n instances.set(el, {\n setStep,\n next: () => setStep(currentIndex + 1),\n prev: () => setStep(currentIndex - 1),\n });\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n instances.clear();\n });\n\n return {\n next: (el) => {\n if (el) instances.get(el)?.next();\n },\n prev: (el) => {\n if (el) instances.get(el)?.prev();\n },\n setStep: (el, index) => {\n if (el) instances.get(el)?.setStep(index);\n },\n };\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/suggest.js — scans `root` for\n * `[data-vd-suggest]` / `[data-vd-autocomplete]` inputs and attaches a\n * type-ahead suggestion dropdown. Supports an inline JSON array or a remote\n * JSON endpoint (`data-vd-suggest-url`, same-origin / allowlisted), a minimum\n * character threshold, debounced search, match highlighting, full keyboard\n * navigation, and ARIA combobox wiring. Fires `suggest:select` with\n * `{ value, item, index }`.\n *\n * The list is appended to the input's `.vd-suggest-wrapper`; the page renders\n * that wrapper so no Vue-managed node is moved (the Vanilla JS created the\n * wrapper itself by relocating the input).\n */\ntype SuggestItem = string | { label?: string; text?: string; value?: string };\n\nfunction isSafeUrl(url: string, allowlist: string[]): boolean {\n try {\n const resolved = new URL(url, window.location.href);\n if (resolved.origin === window.location.origin) return true;\n return allowlist.includes(resolved.origin);\n } catch {\n return false;\n }\n}\n\nconst itemText = (item: SuggestItem): string =>\n typeof item === \"object\"\n ? item.label || item.text || String(item)\n : String(item);\n\nexport function useSuggest(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n host\n .querySelectorAll<HTMLInputElement>(\n \"[data-vd-suggest], [data-vd-autocomplete]\",\n )\n .forEach((input) => {\n const minChars = parseInt(\n input.getAttribute(\"data-vd-suggest-min-chars\") || \"1\",\n 10,\n );\n const url = input.getAttribute(\"data-vd-suggest-url\") || \"\";\n const allowlist = (\n input.getAttribute(\"data-vd-suggest-allowlist\") || \"\"\n )\n .split(\",\")\n .map((v) => v.trim())\n .filter(Boolean);\n const staticData =\n input.getAttribute(\"data-vd-suggest\") ||\n input.getAttribute(\"data-vd-autocomplete\") ||\n \"\";\n\n let items: SuggestItem[] = [];\n try {\n items = JSON.parse(staticData);\n } catch {\n items = staticData\n .split(\",\")\n .map((s) => s.trim())\n .filter(Boolean);\n }\n\n let wrapper = input.closest(\n \".vd-suggest-wrapper, .vd-autocomplete-wrapper\",\n ) as HTMLElement | null;\n if (!wrapper) {\n wrapper = document.createElement(\"div\");\n wrapper.className = \"vd-suggest-wrapper\";\n input.parentNode?.insertBefore(wrapper, input);\n wrapper.appendChild(input);\n }\n\n const list = document.createElement(\"ul\");\n list.className = \"vd-suggest-list\";\n list.setAttribute(\"role\", \"listbox\");\n const listId = \"vd-suggest-\" + Math.random().toString(36).slice(2, 9);\n list.id = listId;\n wrapper.appendChild(list);\n\n input.setAttribute(\"role\", \"combobox\");\n input.setAttribute(\"aria-autocomplete\", \"list\");\n input.setAttribute(\"aria-expanded\", \"false\");\n input.setAttribute(\"aria-controls\", listId);\n input.setAttribute(\"autocomplete\", \"off\");\n\n let highlighted = -1;\n let currentItems: SuggestItem[] = [];\n let debounceTimer: ReturnType<typeof setTimeout> | null = null;\n\n const renderItems = (filtered: SuggestItem[], query: string): void => {\n list.innerHTML = \"\";\n currentItems = filtered;\n highlighted = -1;\n\n if (filtered.length === 0) {\n const empty = document.createElement(\"li\");\n empty.className = \"vd-suggest-empty\";\n empty.textContent = \"No results\";\n list.appendChild(empty);\n return;\n }\n\n filtered.forEach((item, i) => {\n const li = document.createElement(\"li\");\n li.className = \"vd-suggest-item\";\n li.setAttribute(\"role\", \"option\");\n li.id = listId + \"-item-\" + i;\n\n const text = itemText(item);\n if (query) {\n const lowerText = text.toLowerCase();\n const lowerQuery = query.toLowerCase();\n let start = 0;\n let matchIndex = lowerText.indexOf(lowerQuery, start);\n while (matchIndex !== -1) {\n if (matchIndex > start) {\n li.appendChild(\n document.createTextNode(text.slice(start, matchIndex)),\n );\n }\n const matchSpan = document.createElement(\"span\");\n matchSpan.className = \"vd-suggest-match\";\n matchSpan.textContent = text.slice(\n matchIndex,\n matchIndex + query.length,\n );\n li.appendChild(matchSpan);\n start = matchIndex + query.length;\n matchIndex = lowerText.indexOf(lowerQuery, start);\n }\n if (start < text.length) {\n li.appendChild(document.createTextNode(text.slice(start)));\n }\n } else {\n li.textContent = text;\n }\n\n li.addEventListener(\"click\", () => selectItem(i));\n list.appendChild(li);\n });\n };\n\n const open = (): void => {\n list.classList.add(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"true\");\n };\n\n const close = (): void => {\n list.classList.remove(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"false\");\n highlighted = -1;\n input.removeAttribute(\"aria-activedescendant\");\n };\n\n const selectItem = (index: number): void => {\n const item = currentItems[index];\n const value =\n typeof item === \"object\"\n ? item.value || item.label || String(item)\n : String(item);\n input.value = value;\n close();\n input.dispatchEvent(\n new CustomEvent(\"suggest:select\", {\n bubbles: true,\n detail: { value, item, index },\n }),\n );\n };\n\n const highlight = (index: number): void => {\n const listItems =\n list.querySelectorAll<HTMLElement>(\".vd-suggest-item\");\n listItems.forEach((li) => li.classList.remove(\"is-highlighted\"));\n if (index >= 0 && index < listItems.length) {\n highlighted = index;\n listItems[index].classList.add(\"is-highlighted\");\n input.setAttribute(\"aria-activedescendant\", listItems[index].id);\n listItems[index].scrollIntoView({ block: \"nearest\" });\n }\n };\n\n const doSearch = async (query: string): Promise<void> => {\n if (query.length < minChars) {\n close();\n return;\n }\n let filtered: SuggestItem[];\n if (url) {\n try {\n if (!isSafeUrl(url, allowlist)) {\n filtered = [];\n } else {\n const sep = url.includes(\"?\") ? \"&\" : \"?\";\n const res = await window.fetch(\n url + sep + \"q=\" + encodeURIComponent(query),\n );\n filtered = await res.json();\n }\n } catch {\n filtered = [];\n }\n } else {\n const lower = query.toLowerCase();\n filtered = items.filter((item) =>\n itemText(item).toLowerCase().includes(lower),\n );\n }\n renderItems(filtered, query);\n open();\n };\n\n const inputHandler = (): void => {\n if (debounceTimer) clearTimeout(debounceTimer);\n debounceTimer = setTimeout(() => void doSearch(input.value), 200);\n };\n\n const keyHandler = (e: KeyboardEvent): void => {\n if (!list.classList.contains(\"is-open\")) {\n if (e.key === \"ArrowDown\") {\n void doSearch(input.value);\n e.preventDefault();\n }\n return;\n }\n const total = currentItems.length;\n switch (e.key) {\n case \"ArrowDown\":\n e.preventDefault();\n highlight(highlighted < total - 1 ? highlighted + 1 : 0);\n break;\n case \"ArrowUp\":\n e.preventDefault();\n highlight(highlighted > 0 ? highlighted - 1 : total - 1);\n break;\n case \"Enter\":\n e.preventDefault();\n if (highlighted >= 0) selectItem(highlighted);\n break;\n case \"Escape\":\n close();\n break;\n }\n };\n\n const blurHandler = (): void => {\n setTimeout(close, 200);\n };\n const focusHandler = (): void => {\n if (input.value.length >= minChars) void doSearch(input.value);\n };\n\n input.addEventListener(\"input\", inputHandler);\n input.addEventListener(\"keydown\", keyHandler);\n input.addEventListener(\"blur\", blurHandler);\n input.addEventListener(\"focus\", focusHandler);\n\n cleanups.push(\n () => input.removeEventListener(\"input\", inputHandler),\n () => input.removeEventListener(\"keydown\", keyHandler),\n () => input.removeEventListener(\"blur\", blurHandler),\n () => input.removeEventListener(\"focus\", focusHandler),\n () => {\n if (debounceTimer) clearTimeout(debounceTimer);\n },\n () => {\n if (list.parentNode) list.parentNode.removeChild(list);\n },\n );\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces the framework's `VanduoTabs.init()` in Vue: wires\n * `[data-tab-target]` tab links inside each `.vd-tabs` container to toggle\n * `.is-active` on the clicked link and its matching `.vd-tab-pane`.\n */\nexport function useTabs(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n el.querySelectorAll<HTMLElement>(\".vd-tabs\").forEach((tabs) => {\n const links = tabs.querySelectorAll<HTMLElement>(\n \".vd-tab-link[data-tab-target]\",\n );\n links.forEach((link) => {\n const onClick = (): void => {\n if (link.classList.contains(\"disabled\")) return;\n const targetId = link.getAttribute(\"data-tab-target\");\n if (!targetId) return;\n tabs.querySelectorAll(\".vd-tab-link\").forEach((l) => {\n l.classList.remove(\"is-active\");\n l.setAttribute(\"aria-selected\", \"false\");\n });\n tabs\n .querySelectorAll(\".vd-tab-pane\")\n .forEach((p) => p.classList.remove(\"is-active\"));\n link.classList.add(\"is-active\");\n link.setAttribute(\"aria-selected\", \"true\");\n tabs\n .querySelector(`#${CSS.escape(targetId)}`)\n ?.classList.add(\"is-active\");\n };\n link.addEventListener(\"click\", onClick);\n cleanups.push(() => link.removeEventListener(\"click\", onClick));\n });\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Reproduces `VanduoTimeline.init(root)` from\n * `framework/js/components/timeline.js`: scans `root` for `.vd-timeline`\n * containers and wires scroll-driven reveal animations. The framework global\n * handles per-instance state; this composable wires on mount and tears down on\n * unmount via `destroyAll()`.\n */\nexport function useTimeline(root: Ref<HTMLElement | null>): void {\n let mounted = false;\n\n const init = (): void => {\n const r = root.value;\n if (!r || typeof window === \"undefined\") return;\n const w = window as unknown as {\n Vanduo?: { init: (root: HTMLElement) => void };\n VanduoTimeline?: {\n init: (root: HTMLElement) => void;\n destroyAll: () => void;\n };\n };\n mounted = true;\n if (w.VanduoTimeline && typeof w.VanduoTimeline.init === \"function\") {\n w.VanduoTimeline.init(r);\n } else if (w.Vanduo && typeof w.Vanduo.init === \"function\") {\n w.Vanduo.init(r);\n }\n };\n\n const teardown = (): void => {\n if (typeof window === \"undefined\" || !mounted) return;\n const w = window as unknown as {\n VanduoTimeline?: { destroyAll: () => void };\n };\n if (w.VanduoTimeline && typeof w.VanduoTimeline.destroyAll === \"function\") {\n w.VanduoTimeline.destroyAll();\n }\n mounted = false;\n };\n\n onMounted(init);\n onUnmounted(teardown);\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/timepicker.js — scans `root` for\n * `[data-vd-timepicker]` inputs and attaches a scrollable time-selection\n * dropdown (12h/24h format, configurable minute step). The popup is appended to\n * `document.body` (position:fixed) and anchored under the input; opens on focus,\n * selects on click, closes on outside-click / Escape, repositions on\n * scroll/resize.\n *\n * Fix-to-documented-intent: `timepicker:select` fires the documented\n * `{ time, hours, minutes }` detail (the Vanilla JS fired `{ display, value }`,\n * so the documented `event.detail.time/hours/minutes` were undefined).\n */\nfunction positionAnchoredPopup(\n anchor: HTMLElement,\n popup: HTMLElement,\n gap = 4,\n): void {\n const padding = 8;\n const rect = anchor.getBoundingClientRect();\n popup.style.minWidth = Math.max(rect.width, 0) + \"px\";\n\n let top = rect.bottom + gap;\n let left = rect.left;\n popup.style.top = top + \"px\";\n popup.style.left = left + \"px\";\n\n const popRect = popup.getBoundingClientRect();\n if (\n popRect.bottom > window.innerHeight - padding &&\n rect.top - popRect.height > padding\n ) {\n top = rect.top - popRect.height - gap;\n popup.style.top = top + \"px\";\n }\n\n const alignedRect = popup.getBoundingClientRect();\n left = rect.left;\n if (left + alignedRect.width > window.innerWidth - padding) {\n left = window.innerWidth - alignedRect.width - padding;\n }\n popup.style.left = Math.max(padding, left) + \"px\";\n}\n\nexport function useTimepicker(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n host\n .querySelectorAll<HTMLInputElement>(\"[data-vd-timepicker]\")\n .forEach((input) => {\n const is24h = input.getAttribute(\"data-vd-timepicker-format\") === \"24h\";\n const step = parseInt(\n input.getAttribute(\"data-vd-timepicker-step\") || \"30\",\n 10,\n );\n\n const popup = document.createElement(\"div\");\n popup.className = \"vd-timepicker-popup\";\n popup.setAttribute(\"role\", \"listbox\");\n document.body.appendChild(popup);\n\n const times: { display: string; value: string }[] = [];\n for (let h = 0; h < 24; h++) {\n for (let m = 0; m < 60; m += step) {\n const hh24 = String(h).padStart(2, \"0\");\n const mm = String(m).padStart(2, \"0\");\n if (is24h) {\n times.push({ display: hh24 + \":\" + mm, value: hh24 + \":\" + mm });\n } else {\n const period = h < 12 ? \"AM\" : \"PM\";\n const h12 = h === 0 ? 12 : h > 12 ? h - 12 : h;\n times.push({\n display: h12 + \":\" + mm + \" \" + period,\n value: hh24 + \":\" + mm,\n });\n }\n }\n }\n\n const render = (): void => {\n popup.innerHTML = \"\";\n times.forEach((t) => {\n const item = document.createElement(\"div\");\n item.className = \"vd-timepicker-item\";\n item.setAttribute(\"role\", \"option\");\n item.textContent = t.display;\n if (input.value === t.value || input.value === t.display) {\n item.classList.add(\"is-selected\");\n item.setAttribute(\"aria-selected\", \"true\");\n }\n item.addEventListener(\"click\", () => {\n input.value = t.display;\n popup.querySelectorAll(\".vd-timepicker-item\").forEach((i) => {\n i.classList.remove(\"is-selected\");\n i.removeAttribute(\"aria-selected\");\n });\n item.classList.add(\"is-selected\");\n item.setAttribute(\"aria-selected\", \"true\");\n close();\n const [hh, mm] = t.value.split(\":\");\n input.dispatchEvent(\n new CustomEvent(\"timepicker:select\", {\n bubbles: true,\n detail: {\n time: t.display,\n hours: parseInt(hh, 10),\n minutes: parseInt(mm, 10),\n },\n }),\n );\n input.dispatchEvent(new Event(\"change\", { bubbles: true }));\n });\n popup.appendChild(item);\n });\n };\n\n const positionPopup = (): void => {\n if (!popup.classList.contains(\"is-open\")) return;\n positionAnchoredPopup(input, popup);\n };\n\n const open = (): void => {\n render();\n popup.classList.add(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"true\");\n requestAnimationFrame(() => {\n positionPopup();\n const selected = popup.querySelector(\".is-selected\");\n if (selected) selected.scrollIntoView({ block: \"center\" });\n });\n };\n\n const close = (): void => {\n popup.classList.remove(\"is-open\");\n input.setAttribute(\"aria-expanded\", \"false\");\n };\n\n const focusHandler = (): void => open();\n const outsideHandler = (e: Event): void => {\n const target = e.target as Node;\n if (!input.contains(target) && !popup.contains(target)) close();\n };\n const escHandler = (e: KeyboardEvent): void => {\n if (e.key === \"Escape\") close();\n };\n const repositionHandler = (): void => positionPopup();\n\n input.addEventListener(\"focus\", focusHandler);\n document.addEventListener(\"click\", outsideHandler, true);\n document.addEventListener(\"keydown\", escHandler);\n window.addEventListener(\"resize\", repositionHandler);\n window.addEventListener(\"scroll\", repositionHandler, true);\n input.setAttribute(\"aria-haspopup\", \"listbox\");\n input.setAttribute(\"aria-expanded\", \"false\");\n input.setAttribute(\"autocomplete\", \"off\");\n input.readOnly = true;\n\n cleanups.push(\n () => input.removeEventListener(\"focus\", focusHandler),\n () => document.removeEventListener(\"click\", outsideHandler, true),\n () => document.removeEventListener(\"keydown\", escHandler),\n () => window.removeEventListener(\"resize\", repositionHandler),\n () => window.removeEventListener(\"scroll\", repositionHandler, true),\n () => popup.remove(),\n );\n });\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","/**\n * Whitelist HTML sanitizer — dependency-free TS port of the framework's\n * `helpers.js` sanitizeHtml. Used wherever vd2 must mirror the framework's\n * raw-HTML behaviour (e.g. `data-tooltip-html`) without inheriting an XSS sink.\n *\n * Keeps a small set of inline tags, drops everything else to text, and only\n * permits http/https/mailto on `<a href>`. Event-handler attributes and unknown\n * attributes are removed. For stronger guarantees prefer DOMPurify / server-side\n * sanitization; this is a client-side guard.\n *\n * Differs from the framework on one intentional point: `style` is DENIED by\n * default here (the framework defaults it on). Opt in with `allowStyle: true`.\n */\nexport interface SanitizeOptions {\n allowSvg?: boolean;\n /** Permit the inline `style` attribute on kept elements. Default: false. */\n allowStyle?: boolean;\n}\n\nconst BASE_ALLOWED = [\n \"B\",\n \"STRONG\",\n \"I\",\n \"EM\",\n \"BR\",\n \"A\",\n \"SPAN\",\n \"U\",\n \"DIV\",\n \"P\",\n \"KBD\",\n \"CODE\",\n \"SMALL\",\n \"MARK\",\n];\nconst SVG_ALLOWED = [\"SVG\", \"PATH\", \"LINE\", \"CIRCLE\", \"POLYLINE\", \"RECT\", \"G\"];\nconst SAFE_SVG_ATTRS = new Set([\n \"xmlns\",\n \"width\",\n \"height\",\n \"viewBox\",\n \"fill\",\n \"stroke\",\n \"stroke-width\",\n \"stroke-linecap\",\n \"stroke-linejoin\",\n \"d\",\n \"cx\",\n \"cy\",\n \"r\",\n \"x1\",\n \"y1\",\n \"x2\",\n \"y2\",\n \"points\",\n \"transform\",\n \"class\",\n]);\n\n/** Attribute-safe text escape — used as the SSR / no-DOMParser fallback. */\nfunction escapeText(input: string): string {\n return input\n .replace(/&/g, \"&\")\n .replace(/</g, \"<\")\n .replace(/>/g, \">\")\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n}\n\nexport function sanitizeHtml(\n input: string,\n options: SanitizeOptions = {},\n): string {\n if (!input) return \"\";\n // SSR / non-DOM environments: fail closed to escaped text.\n if (typeof DOMParser === \"undefined\") return escapeText(input);\n\n const allowSvg = options.allowSvg === true;\n const allowStyle = options.allowStyle === true;\n const allowed = allowSvg ? BASE_ALLOWED.concat(SVG_ALLOWED) : BASE_ALLOWED;\n\n let doc: Document;\n try {\n doc = new DOMParser().parseFromString(input, \"text/html\");\n } catch {\n return escapeText(input);\n }\n\n const sanitizeNode = (node: Node): void => {\n Array.from(node.childNodes).forEach((child) => {\n if (child.nodeType === Node.TEXT_NODE) return;\n const el = child as Element;\n\n if (!allowed.includes(el.nodeName)) {\n node.replaceChild(document.createTextNode(el.textContent ?? \"\"), child);\n return;\n }\n\n if (el.nodeName === \"A\") {\n const href = el.getAttribute(\"href\") ?? \"\";\n try {\n const url = new URL(href, location.href);\n if (![\"http:\", \"https:\", \"mailto:\"].includes(url.protocol)) {\n el.removeAttribute(\"href\");\n }\n } catch {\n el.removeAttribute(\"href\");\n }\n el.removeAttribute(\"target\");\n el.removeAttribute(\"rel\");\n } else if (allowSvg && (el.nodeName === \"SVG\" || el.closest?.(\"svg\"))) {\n Array.from(el.attributes).forEach((a) => {\n if (!SAFE_SVG_ATTRS.has(a.name)) el.removeAttribute(a.name);\n });\n } else {\n const safe = new Set([\"class\"]);\n if (allowStyle) safe.add(\"style\");\n Array.from(el.attributes).forEach((a) => {\n if (!safe.has(a.name)) el.removeAttribute(a.name);\n });\n }\n\n sanitizeNode(el);\n });\n };\n\n sanitizeNode(doc.body);\n return doc.body.innerHTML;\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\nimport { sanitizeHtml } from \"../utils/sanitizeHtml\";\n\n/**\n * Reproduces the framework's `Vanduo.init()` tooltip wiring in Vue: scans a root\n * element for `[data-tooltip]` / `[data-tooltip-html]` triggers and shows a\n * `.vd-tooltip` (styled by the framework CSS) on hover/focus.\n *\n * `data-tooltip-html` is run through the whitelist sanitizer before insertion —\n * mirroring the framework's tooltips.js, which sanitizes too. (`data-tooltip`\n * stays plain text via textContent.)\n */\nexport function useTooltips(root: Ref<HTMLElement | null>): void {\n let current: HTMLElement | null = null;\n const cleanups: Array<() => void> = [];\n\n const hide = (): void => {\n if (current) {\n current.remove();\n current = null;\n }\n };\n\n const place = (\n trigger: HTMLElement,\n tip: HTMLElement,\n placement: string,\n ): void => {\n const r = trigger.getBoundingClientRect();\n const t = tip.getBoundingClientRect();\n const gap = 8;\n let top: number;\n let left: number;\n switch (placement) {\n case \"bottom\":\n top = r.bottom + gap;\n left = r.left + r.width / 2 - t.width / 2;\n break;\n case \"left\":\n top = r.top + r.height / 2 - t.height / 2;\n left = r.left - t.width - gap;\n break;\n case \"right\":\n top = r.top + r.height / 2 - t.height / 2;\n left = r.right + gap;\n break;\n default:\n top = r.top - t.height - gap;\n left = r.left + r.width / 2 - t.width / 2;\n }\n tip.style.top = `${Math.max(4, top)}px`;\n tip.style.left = `${Math.max(4, left)}px`;\n };\n\n const show = (trigger: HTMLElement): void => {\n hide();\n const text = trigger.getAttribute(\"data-tooltip\");\n const html = trigger.getAttribute(\"data-tooltip-html\");\n if (!text && !html) return;\n const placement = trigger.getAttribute(\"data-tooltip-placement\") ?? \"top\";\n const variant = trigger.getAttribute(\"data-tooltip-variant\");\n const size = trigger.getAttribute(\"data-tooltip-size\");\n\n const tip = document.createElement(\"div\");\n tip.className =\n \"vd-tooltip vd-tooltip-\" +\n placement +\n (variant ? \" vd-tooltip-\" + variant : \"\") +\n (size ? \" vd-tooltip-\" + size : \"\") +\n (html ? \" vd-tooltip-html\" : \"\");\n tip.setAttribute(\"data-placement\", placement);\n tip.style.position = \"fixed\";\n if (html) tip.innerHTML = sanitizeHtml(html, { allowStyle: false });\n else tip.textContent = text;\n\n document.body.appendChild(tip);\n place(trigger, tip, placement);\n requestAnimationFrame(() => tip.classList.add(\"is-visible\"));\n current = tip;\n };\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n const triggers = el.querySelectorAll<HTMLElement>(\n \"[data-tooltip],[data-tooltip-html]\",\n );\n triggers.forEach((trigger) => {\n const onEnter = (): void => show(trigger);\n const onLeave = (): void => hide();\n trigger.addEventListener(\"mouseenter\", onEnter);\n trigger.addEventListener(\"mouseleave\", onLeave);\n trigger.addEventListener(\"focus\", onEnter);\n trigger.addEventListener(\"blur\", onLeave);\n cleanups.push(() => {\n trigger.removeEventListener(\"mouseenter\", onEnter);\n trigger.removeEventListener(\"mouseleave\", onLeave);\n trigger.removeEventListener(\"focus\", onEnter);\n trigger.removeEventListener(\"blur\", onLeave);\n });\n });\n });\n\n onUnmounted(() => {\n hide();\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\ntype Validator = (value: string, param: string) => boolean;\n\n/** Rule validators — ported verbatim from `framework/js/components/validate.js`. */\nconst rules: Record<string, Validator> = {\n required: (v) => v.trim().length > 0,\n email: (v) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(v),\n url: (v) => {\n try {\n new URL(v);\n return true;\n } catch {\n return false;\n }\n },\n number: (v) => !isNaN(parseFloat(v)) && isFinite(Number(v)),\n min: (v, p) => v.length >= parseInt(p, 10),\n max: (v, p) => v.length <= parseInt(p, 10),\n minVal: (v, p) => parseFloat(v) >= parseFloat(p),\n maxVal: (v, p) => parseFloat(v) <= parseFloat(p),\n pattern: (v, p) => {\n try {\n if (p.length > 100) return false;\n return new RegExp(p).test(v);\n } catch {\n return false;\n }\n },\n // Vanilla validate.js looks up by [name]; the docs API + demo reference an\n // element id (`match:val-pass`). Honor both so the demo actually works.\n match: (v, p) => {\n try {\n const esc = typeof CSS !== \"undefined\" && CSS.escape ? CSS.escape(p) : p;\n const other =\n document.getElementById(p) ??\n document.querySelector<HTMLInputElement>(`[name=\"${esc}\"]`);\n return other ? v === (other as HTMLInputElement).value : false;\n } catch {\n return false;\n }\n },\n};\n\nconst messages: Record<string, string> = {\n required: \"This field is required\",\n email: \"Please enter a valid email address\",\n url: \"Please enter a valid URL\",\n number: \"Please enter a valid number\",\n min: \"Minimum {0} characters required\",\n max: \"Maximum {0} characters allowed\",\n minVal: \"Value must be at least {0}\",\n maxVal: \"Value must be at most {0}\",\n pattern: \"Invalid format\",\n match: \"Fields do not match\",\n};\n\nlet errSeq = 0;\n\nfunction setFieldState(field: HTMLInputElement, errors: string[]): void {\n const wrapper = field.closest(\".vd-form-group\") ?? field.parentElement;\n if (!wrapper) return;\n let errorEl = wrapper.querySelector<HTMLElement>(\".vd-validate-error\");\n\n field.classList.remove(\"is-valid\", \"is-invalid\");\n\n if (errors.length > 0) {\n field.classList.add(\"is-invalid\");\n field.setAttribute(\"aria-invalid\", \"true\");\n if (!errorEl) {\n errorEl = document.createElement(\"div\");\n errorEl.className = \"vd-validate-error\";\n errSeq += 1;\n errorEl.id = `vd-err-${errSeq}`;\n errorEl.setAttribute(\"role\", \"alert\");\n wrapper.appendChild(errorEl);\n }\n errorEl.textContent = errors[0] ?? \"\";\n errorEl.style.display = \"\";\n field.setAttribute(\"aria-describedby\", errorEl.id);\n } else if (field.value.trim()) {\n field.classList.add(\"is-valid\");\n field.removeAttribute(\"aria-invalid\");\n if (errorEl) errorEl.style.display = \"none\";\n } else {\n field.removeAttribute(\"aria-invalid\");\n if (errorEl) errorEl.style.display = \"none\";\n }\n}\n\n/**\n * Reproduces `VanduoValidate.init()`: scans `root` for `[data-vd-validate]` /\n * `.vd-validate` forms and wires declarative, attribute-driven validation\n * (rules piped on `data-vd-rules`, modes blur/input/submit, custom\n * `data-vd-msg-*` messages, `.is-valid`/`.is-invalid` + `.vd-validate-error`).\n * Honors per-field `data-vd-validate-mode` overrides, as the docs document.\n */\nexport function useValidate(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n const validateField = (field: HTMLInputElement): boolean => {\n const rulesStr = field.getAttribute(\"data-vd-rules\") ?? \"\";\n const fieldRules = rulesStr\n .split(\"|\")\n .map((r) => r.trim())\n .filter(Boolean);\n const value = field.value;\n const errors: string[] = [];\n\n for (const rule of fieldRules) {\n const [name, ...params] = rule.split(\":\");\n const param = params.join(\":\");\n const validator = name ? rules[name] : undefined;\n if (validator && !validator(value, param)) {\n const customMsg = name\n ? field.getAttribute(`data-vd-msg-${name}`)\n : null;\n let msg = customMsg ?? (name ? messages[name] : undefined) ?? \"Invalid\";\n if (param) msg = msg.replace(\"{0}\", param);\n errors.push(msg);\n break;\n }\n }\n\n setFieldState(field, errors);\n return errors.length === 0;\n };\n\n const initForm = (form: HTMLFormElement): void => {\n const formMode = form.getAttribute(\"data-vd-validate-mode\") ?? \"blur\";\n const fields = Array.from(\n form.querySelectorAll<HTMLInputElement>(\"[data-vd-rules]\"),\n );\n\n const validateAll = (): boolean => {\n let valid = true;\n fields.forEach((f) => {\n if (!validateField(f)) valid = false;\n });\n return valid;\n };\n\n fields.forEach((field) => {\n const mode = field.getAttribute(\"data-vd-validate-mode\") ?? formMode;\n if (mode === \"input\" || mode === \"blur\") {\n const eventType = mode === \"input\" ? \"input\" : \"blur\";\n const handler = (): boolean => validateField(field);\n field.addEventListener(eventType, handler);\n cleanups.push(() => field.removeEventListener(eventType, handler));\n\n if (mode === \"blur\") {\n const inputClear = (): void => {\n if (\n field.classList.contains(\"is-invalid\") ||\n field.classList.contains(\"is-valid\")\n ) {\n validateField(field);\n }\n };\n field.addEventListener(\"input\", inputClear);\n cleanups.push(() => field.removeEventListener(\"input\", inputClear));\n }\n }\n });\n\n const submitHandler = (e: Event): void => {\n const valid = validateAll();\n if (!valid) {\n e.preventDefault();\n e.stopPropagation();\n form.querySelector<HTMLElement>(\".is-invalid\")?.focus();\n }\n form.dispatchEvent(\n new CustomEvent(\"validate:submit\", {\n detail: { valid },\n bubbles: true,\n }),\n );\n };\n form.addEventListener(\"submit\", submitHandler);\n cleanups.push(() => form.removeEventListener(\"submit\", submitHandler));\n };\n\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n el.querySelectorAll<HTMLFormElement>(\n \"[data-vd-validate], .vd-validate\",\n ).forEach(initForm);\n });\n\n onUnmounted(() => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n });\n}\n","import { onMounted, onUnmounted, type Ref } from \"vue\";\n\n/**\n * Ports framework/js/components/waypoint.js — scans `root` for\n * `[data-vd-waypoint-nav]` / `[data-vd-scrollspy-nav]` navs and highlights the\n * link of the topmost visible section as the user scrolls (IntersectionObserver,\n * topmost-wins, smooth-scroll on click, `waypoint:change` event).\n *\n * Two fixes-to-documented-intent vs the Vanilla JS:\n * - The Vanilla observer always ran against the viewport and ignored the\n * attribute value, so a nav pointed at an overflow container (the docs'\n * sidebar demo) never updated. Here the attribute value is resolved to an\n * element and used as the IntersectionObserver `root` — the documented\n * behaviour (\"selector for the scrollable container to observe\") — so\n * overflow-container scrollspy actually works.\n * - The active link also receives `aria-current=\"true\"`, which the docs\n * accessibility notes promise but the Vanilla JS never set.\n */\nexport function useWaypoint(root: Ref<HTMLElement | null>): void {\n const cleanups: Array<() => void> = [];\n\n onMounted(() => {\n if (typeof window === \"undefined\") return;\n const host = root.value;\n if (!host) return;\n\n const navs = host.querySelectorAll<HTMLElement>(\n \"[data-vd-waypoint-nav], [data-vd-scrollspy-nav]\",\n );\n\n navs.forEach((nav) => {\n const links = Array.from(\n nav.querySelectorAll<HTMLAnchorElement>('a[href^=\"#\"]'),\n );\n if (links.length === 0) return;\n\n const offset = parseInt(\n nav.getAttribute(\"data-vd-waypoint-offset\") || \"80\",\n 10,\n );\n\n const selector =\n nav.getAttribute(\"data-vd-waypoint-nav\") ||\n nav.getAttribute(\"data-vd-scrollspy-nav\") ||\n \"\";\n let scrollRoot: Element | null = null;\n if (selector && selector !== \"window\") {\n scrollRoot = document.querySelector(selector);\n }\n\n const sections: {\n id: string;\n link: HTMLAnchorElement;\n section: HTMLElement;\n }[] = [];\n links.forEach((link) => {\n const id = (link.getAttribute(\"href\") || \"\").slice(1);\n const section = id ? document.getElementById(id) : null;\n if (section) {\n section.setAttribute(\"data-vd-waypoint-section\", \"\");\n sections.push({ id, link, section });\n }\n });\n if (sections.length === 0) return;\n\n const visible = new Set<string>();\n\n const setActive = (id: string): void => {\n links.forEach((l) => {\n l.classList.remove(\"is-active\");\n l.removeAttribute(\"aria-current\");\n });\n const target = links.find((l) => l.getAttribute(\"href\") === \"#\" + id);\n if (target) {\n target.classList.add(\"is-active\");\n target.setAttribute(\"aria-current\", \"true\");\n nav.dispatchEvent(\n new CustomEvent(\"waypoint:change\", {\n detail: { activeId: id, link: target },\n }),\n );\n }\n };\n\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (entry.isIntersecting) visible.add(entry.target.id);\n else visible.delete(entry.target.id);\n });\n for (const s of sections) {\n if (visible.has(s.id)) {\n setActive(s.id);\n return;\n }\n }\n },\n {\n root: scrollRoot,\n rootMargin: \"-\" + offset + \"px 0px -40% 0px\",\n threshold: 0,\n },\n );\n\n sections.forEach((s) => observer.observe(s.section));\n\n links.forEach((link) => {\n const onClick = (e: Event): void => {\n e.preventDefault();\n const id = (link.getAttribute(\"href\") || \"\").slice(1);\n const section = id ? document.getElementById(id) : null;\n if (section) {\n section.scrollIntoView({ behavior: \"smooth\" });\n setActive(id);\n }\n };\n link.addEventListener(\"click\", onClick);\n cleanups.push(() => link.removeEventListener(\"click\", onClick));\n });\n\n cleanups.push(() => observer.disconnect());\n });\n });\n\n onUnmounted(() =>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