@stonecrop/desktop 0.10.2 โ 0.10.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/desktop.js +739 -687
- package/dist/desktop.js.map +1 -1
- package/package.json +5 -5
package/dist/desktop.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desktop.js","sources":["../src/components/ActionSet.vue","../src/components/CommandPalette.vue","../../common/temp/node_modules/.pnpm/pinia@3.0.4_typescript@5.9.3_vue@3.5.28_typescript@5.9.3_/node_modules/pinia/dist/pinia.mjs","../../stonecrop/dist/stonecrop.js","../../aform/dist/aform.js","../src/components/SheetNav.vue","../src/components/Desktop.vue","../src/plugins/index.ts"],"sourcesContent":["<template>\n\t<div\n\t\t:class=\"{ 'open-set': isOpen, 'hovered-and-closed': closeClicked }\"\n\t\tclass=\"action-set collapse\"\n\t\t@mouseover=\"onHover\"\n\t\t@mouseleave=\"onHoverLeave\">\n\t\t<div class=\"action-menu-icon\">\n\t\t\t<div id=\"chevron\" @click=\"closeClicked = !closeClicked\">\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"leftBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"54.2,33.4 29.2,58.8 25,54.6 50,29.2 \" />\n\t\t\t\t</svg>\n\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"rightBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"70.8,58.8 45.8,33.4 50,29.2 75,54.6 \" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"margin-right: 30px\"></div>\n\t\t<div v-for=\"(el, index) in elements\" :key=\"el.label\" class=\"action-element\">\n\t\t\t<button\n\t\t\t\tv-if=\"el.type == 'button'\"\n\t\t\t\t:disabled=\"el.disabled\"\n\t\t\t\tclass=\"button-default\"\n\t\t\t\t@click=\"handleClick(el.action, el.label)\">\n\t\t\t\t{{ el.label }}\n\t\t\t</button>\n\t\t\t<div v-if=\"el.type == 'dropdown'\">\n\t\t\t\t<button class=\"button-default\" @click=\"toggleDropdown(index)\">{{ el.label }}</button>\n\t\t\t\t<div v-show=\"dropdownStates[index]\" class=\"dropdown-container\">\n\t\t\t\t\t<div class=\"dropdown\">\n\t\t\t\t\t\t<div v-for=\"(item, itemIndex) in el.actions\" :key=\"item.label\">\n\t\t\t\t\t\t\t<button v-if=\"item.action != null\" class=\"dropdown-item\" @click=\"handleClick(item.action, item.label)\">\n\t\t\t\t\t\t\t\t{{ item.label }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a v-else-if=\"item.link != null\" :href=\"item.link\"\n\t\t\t\t\t\t\t\t><button class=\"dropdown-item\">{{ item.label }}</button></a\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue'\n\nimport type { ActionElements } from '../types'\n\nconst { elements = [] } = defineProps<{ elements?: ActionElements[] }>()\nconst emit = defineEmits<{\n\tactionClick: [label: string, action: (() => void | Promise<void>) | undefined]\n}>()\n\n// Track dropdown open state separately (index -> boolean)\nconst dropdownStates = ref<Record<number, boolean>>({})\n\nconst isOpen = ref(false)\nconst timeoutId = ref<number>(-1)\nconst hover = ref(false)\nconst closeClicked = ref(false)\n\nonMounted(() => {\n\tcloseDropdowns()\n})\n\nconst closeDropdowns = () => {\n\tdropdownStates.value = {}\n}\n\nconst onHover = () => {\n\thover.value = true\n\ttimeoutId.value = setTimeout(() => {\n\t\tif (hover.value) {\n\t\t\tisOpen.value = true\n\t\t}\n\t}, 500)\n}\n\nconst onHoverLeave = () => {\n\thover.value = false\n\tcloseClicked.value = false\n\tclearTimeout(timeoutId.value)\n\tisOpen.value = false\n}\n\nconst toggleDropdown = (index: number) => {\n\tconst showDropdown = !dropdownStates.value[index]\n\tcloseDropdowns()\n\tif (showDropdown) {\n\t\tdropdownStates.value[index] = true\n\t}\n}\n\nconst handleClick = (action: (() => void | Promise<void>) | undefined, label: string) => {\n\t// Emit event to parent - parent will handle execution\n\temit('actionClick', label, action)\n}\n</script>\n\n<style scoped>\n#chevron {\n\tposition: relative;\n\ttransform: rotate(90deg);\n}\n\n.leftBar,\n.rightBar {\n\ttransition-duration: 0.225s;\n\ttransition-property: transform;\n}\n\n.leftBar,\n.action-set.collapse.hovered-and-closed:hover .leftBar {\n\ttransform-origin: 33.4% 50%;\n\ttransform: rotate(90deg);\n}\n\n.rightBar,\n.action-set.collapse.hovered-and-closed:hover .rightBar {\n\ttransform-origin: 67% 50%;\n\ttransform: rotate(-90deg);\n}\n\n.rightBar {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n}\n\n.action-set.collapse:hover .leftBar {\n\ttransform: rotate(0);\n}\n\n.action-set.collapse:hover .rightBar {\n\ttransform: rotate(0);\n}\n\n.action-set {\n\tposition: fixed;\n\ttop: 10px;\n\tright: 10px;\n\tpadding: 20px;\n\tbox-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);\n\tborder-radius: 10px;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tbackground-color: white;\n\toverflow: hidden;\n\tz-index: 1001; /* Above SheetNav (100) and operation log button (999) */\n}\n\n.action-menu-icon {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 4px;\n}\n\n.action-menu-icon svg {\n\tfill: #333333;\n}\n\n.action-set.collapse,\n.action-set.collapse.hovered-and-closed:hover {\n\tmax-width: 25px;\n\toverflow: hidden;\n\n\t-webkit-transition: max-width 0.5s ease-in-out;\n\t-moz-transition: max-width 0.5s ease-in-out;\n\t-o-transition: max-width 0.5s ease-in-out;\n\ttransition: max-width 0.5s ease-in-out;\n}\n\n.action-set.collapse .action-element,\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0;\n\t-webkit-transition: opacity 0.25s ease-in-out;\n\t-moz-transition: opacity 0.25s ease-in-out;\n\t-o-transition: opacity 0.25s ease-in-out;\n\ttransition: opacity 0.25s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.action-set.collapse:hover {\n\tmax-width: 500px;\n}\n\n.action-set.collapse.open-set:hover {\n\toverflow: visible !important;\n}\n\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-set.collapse:hover .action-element {\n\topacity: 100 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-element {\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n\tposition: relative; /* Make this the positioning context for absolute children */\n}\nbutton.button-default {\n\tbackground-color: #ffffff;\n\tpadding: 5px 12px;\n\tborder-radius: 3px;\n\tbox-shadow: rgba(0, 0, 0, 0.05) 0px 0.5px 0px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,\n\t\trgba(0, 0, 0, 0.05) 0px 2px 4px 0px;\n\tborder: none;\n\tcursor: pointer;\n\twhite-space: nowrap;\n}\n\nbutton.button-default:hover {\n\tbackground-color: #f2f2f2;\n}\n\nbutton.button-default:disabled {\n\topacity: 0.5;\n\tcursor: not-allowed;\n\tbackground-color: #f5f5f5;\n\tcolor: #999;\n}\n\nbutton.button-default:disabled:hover {\n\tbackground-color: #f5f5f5;\n}\n\n.dropdown-container {\n\tposition: relative;\n}\n\n.dropdown {\n\tposition: absolute;\n\tright: 0;\n\tmin-width: 200px;\n\tbox-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);\n\tborder-radius: 10px;\n\tbackground-color: #ffffff;\n\tpadding: 10px;\n\tz-index: 1000;\n}\n\nbutton.dropdown-item {\n\twidth: 100%;\n\tpadding: 8px 5px;\n\ttext-align: left;\n\tborder: none;\n\tbackground-color: #ffffff;\n\tcursor: pointer;\n\tborder-radius: 5px;\n}\n\nbutton.dropdown-item:hover {\n\tbackground-color: #f2f2f2;\n}\n</style>\n","<template>\n\t<Teleport to=\"body\">\n\t\t<Transition name=\"fade\">\n\t\t\t<div v-if=\"isOpen\" class=\"command-palette-overlay\" @click=\"closeModal\">\n\t\t\t\t<div class=\"command-palette\" @click.stop>\n\t\t\t\t\t<div class=\"command-palette-header\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"command-palette-input\"\n\t\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\t@keydown=\"handleKeydown\" />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"results.length\" class=\"command-palette-results\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"(result, index) in results\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"command-palette-result\"\n\t\t\t\t\t\t\t:class=\"{ selected: index === selectedIndex }\"\n\t\t\t\t\t\t\t@click=\"selectResult(result)\"\n\t\t\t\t\t\t\t@mouseover=\"selectedIndex = index\">\n\t\t\t\t\t\t\t<div class=\"result-title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"result-content\">\n\t\t\t\t\t\t\t\t<slot name=\"content\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-else-if=\"query && !results.length\" class=\"command-palette-no-results\">\n\t\t\t\t\t\t<slot name=\"empty\"> No results found for \"{{ query }}\" </slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Transition>\n\t</Teleport>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { ref, computed, watch, nextTick, useTemplateRef } from 'vue'\n\ndefineSlots<{\n\ttitle?: { result: T }\n\tcontent?: { result: T }\n\tempty?: null\n}>()\n\nconst {\n\tsearch,\n\tisOpen = false,\n\tplaceholder = 'Type a command or search...',\n\tmaxResults = 10,\n} = defineProps<{\n\tsearch: (query: string) => T[]\n\tisOpen?: boolean\n\tplaceholder?: string\n\tmaxResults?: number\n}>()\n\nconst emit = defineEmits<{\n\tselect: [T]\n\tclose: []\n}>()\n\nconst query = ref('')\nconst selectedIndex = ref(0)\nconst inputRef = useTemplateRef('input')\n\nconst results = computed(() => {\n\tif (!query.value) return []\n\tconst results = search(query.value)\n\treturn results.slice(0, maxResults)\n})\n\n// reset search query when modal opens\nwatch(\n\t() => isOpen,\n\tasync isOpen => {\n\t\tif (isOpen) {\n\t\t\tquery.value = ''\n\t\t\tselectedIndex.value = 0\n\t\t\tawait nextTick()\n\t\t\t;(inputRef.value as HTMLInputElement)?.focus()\n\t\t}\n\t}\n)\n\n// reset selected index when results change\nwatch(results, () => {\n\tselectedIndex.value = 0\n})\n\nconst closeModal = () => {\n\temit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n\tswitch (e.key) {\n\t\tcase 'Escape':\n\t\t\tcloseModal()\n\t\t\tbreak\n\t\tcase 'ArrowDown':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value + 1) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'ArrowUp':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value - 1 + results.value.length) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'Enter':\n\t\t\tif (results.value.length && selectedIndex.value >= 0) {\n\t\t\t\tselectResult(results.value[selectedIndex.value])\n\t\t\t}\n\t\t\tbreak\n\t}\n}\n\nconst selectResult = (result: T) => {\n\temit('select', result)\n\tcloseModal()\n}\n</script>\n\n<style>\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 0.2s ease;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.command-palette-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.5);\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tz-index: 9999;\n\tpadding-top: 100px;\n}\n\n.command-palette {\n\twidth: 600px;\n\tmax-width: 90%;\n\tbackground-color: white;\n\tborder-radius: 8px;\n\tbox-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\toverflow: hidden;\n\tmax-height: 80vh;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.command-palette-header {\n\tdisplay: flex;\n\tborder-bottom: 1px solid #eaeaea;\n\tpadding: 12px;\n}\n\n.command-palette-input {\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tfont-size: 16px;\n\tpadding: 8px 12px;\n\tbackground-color: transparent;\n}\n\n.command-palette-close {\n\tbackground: transparent;\n\tborder: none;\n\tfont-size: 24px;\n\tcursor: pointer;\n\tcolor: #666;\n\tpadding: 0 8px;\n}\n\n.command-palette-close:hover {\n\tcolor: #333;\n}\n\n.command-palette-results {\n\toverflow-y: auto;\n\tmax-height: 60vh;\n}\n\n.command-palette-result {\n\tpadding: 12px 16px;\n\tcursor: pointer;\n\tborder-bottom: 1px solid #f0f0f0;\n}\n\n.command-palette-result:hover,\n.command-palette-result.selected {\n\tbackground-color: #f5f5f5;\n}\n\n.command-palette-result.selected {\n\tbackground-color: rgba(132, 60, 3, 0.1);\n}\n\n.result-title {\n\tfont-weight: 500;\n\tmargin-bottom: 4px;\n\tcolor: #333;\n}\n\n.result-content {\n\tfont-size: 14px;\n\tcolor: #666;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.command-palette-no-results {\n\tpadding: 20px 16px;\n\ttext-align: center;\n\tcolor: #666;\n}\n</style>\n","/*!\n * pinia v3.0.4\n * (c) 2025 Eduardo San Martin Morote\n * @license MIT\n */\nimport { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isRef, isReactive, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, nextTick, computed, toRefs } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\nconst IS_CLIENT = typeof window !== 'undefined';\n\n/**\n * setActivePinia must be called to handle SSR at the top of functions like\n * `fetch`, `setup`, `serverPrefetch` and others\n */\nlet activePinia;\n/**\n * Sets or unsets the active pinia. Used in SSR and internally when calling\n * actions and getters\n *\n * @param pinia - Pinia instance\n */\n// @ts-expect-error: cannot constrain the type of the return\nconst setActivePinia = (pinia) => (activePinia = pinia);\n/**\n * Get the currently active pinia if there is any.\n */\nconst getActivePinia = (process.env.NODE_ENV !== 'production')\n ? () => {\n const pinia = hasInjectionContext() && inject(piniaSymbol);\n if (!pinia && !IS_CLIENT) {\n console.error(`[๐]: Pinia instance not found in context. This falls back to the global activePinia which exposes you to cross-request pollution on the server. Most of the time, it means you are calling \"useStore()\" in the wrong place.\\n` +\n `Read https://vuejs.org/guide/reusability/composables.html to learn more`);\n }\n return pinia || activePinia;\n }\n : () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia;\nconst piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol());\n\nfunction isPlainObject(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\no) {\n return (o &&\n typeof o === 'object' &&\n Object.prototype.toString.call(o) === '[object Object]' &&\n typeof o.toJSON !== 'function');\n}\n// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }\n// TODO: can we change these to numbers?\n/**\n * Possible types for SubscriptionCallback\n */\nvar MutationType;\n(function (MutationType) {\n /**\n * Direct mutation of the state:\n *\n * - `store.name = 'new name'`\n * - `store.$state.name = 'new name'`\n * - `store.list.push('new item')`\n */\n MutationType[\"direct\"] = \"direct\";\n /**\n * Mutated the state with `$patch` and an object\n *\n * - `store.$patch({ name: 'newName' })`\n */\n MutationType[\"patchObject\"] = \"patch object\";\n /**\n * Mutated the state with `$patch` and a function\n *\n * - `store.$patch(state => state.name = 'newName')`\n */\n MutationType[\"patchFunction\"] = \"patch function\";\n // maybe reset? for $state = {} and $reset\n})(MutationType || (MutationType = {}));\n\n/*\n * FileSaver.js A saveAs() FileSaver implementation.\n *\n * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin\n * Morote.\n *\n * License : MIT\n */\n// The one and only way of getting global scope in all environments\n// https://stackoverflow.com/q/3277182/1008999\nconst _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window\n ? window\n : typeof self === 'object' && self.self === self\n ? self\n : typeof global === 'object' && global.global === global\n ? global\n : typeof globalThis === 'object'\n ? globalThis\n : { HTMLElement: null })();\nfunction bom(blob, { autoBom = false } = {}) {\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (autoBom &&\n /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n }\n return blob;\n}\nfunction download(url, name, opts) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.responseType = 'blob';\n xhr.onload = function () {\n saveAs(xhr.response, name, opts);\n };\n xhr.onerror = function () {\n console.error('could not download file');\n };\n xhr.send();\n}\nfunction corsEnabled(url) {\n const xhr = new XMLHttpRequest();\n // use sync to avoid popup blocker\n xhr.open('HEAD', url, false);\n try {\n xhr.send();\n }\n catch (e) { }\n return xhr.status >= 200 && xhr.status <= 299;\n}\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n try {\n node.dispatchEvent(new MouseEvent('click'));\n }\n catch (e) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n detail: 0,\n screenX: 80,\n screenY: 20,\n clientX: 80,\n clientY: 20,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: null,\n });\n node.dispatchEvent(evt);\n }\n}\nconst _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' };\n// Detect WebView inside a native macOS app by ruling out all browsers\n// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too\n// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos\nconst isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) &&\n /AppleWebKit/.test(_navigator.userAgent) &&\n !/Safari/.test(_navigator.userAgent))();\nconst saveAs = !IS_CLIENT\n ? () => { } // noop\n : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program\n typeof HTMLAnchorElement !== 'undefined' &&\n 'download' in HTMLAnchorElement.prototype &&\n !isMacOSWebView\n ? downloadSaveAs\n : // Use msSaveOrOpenBlob as a second approach\n 'msSaveOrOpenBlob' in _navigator\n ? msSaveAs\n : // Fallback to using FileReader and a popup\n fileSaverSaveAs;\nfunction downloadSaveAs(blob, name = 'download', opts) {\n const a = document.createElement('a');\n a.download = name;\n a.rel = 'noopener'; // tabnabbing\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n if (typeof blob === 'string') {\n // Support regular links\n a.href = blob;\n if (a.origin !== location.origin) {\n if (corsEnabled(a.href)) {\n download(blob, name, opts);\n }\n else {\n a.target = '_blank';\n click(a);\n }\n }\n else {\n click(a);\n }\n }\n else {\n // Support blobs\n a.href = URL.createObjectURL(blob);\n setTimeout(function () {\n URL.revokeObjectURL(a.href);\n }, 4e4); // 40s\n setTimeout(function () {\n click(a);\n }, 0);\n }\n}\nfunction msSaveAs(blob, name = 'download', opts) {\n if (typeof blob === 'string') {\n if (corsEnabled(blob)) {\n download(blob, name, opts);\n }\n else {\n const a = document.createElement('a');\n a.href = blob;\n a.target = '_blank';\n setTimeout(function () {\n click(a);\n });\n }\n }\n else {\n // @ts-ignore: works on windows\n navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n }\n}\nfunction fileSaverSaveAs(blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open('', '_blank');\n if (popup) {\n popup.document.title = popup.document.body.innerText = 'downloading...';\n }\n if (typeof blob === 'string')\n return download(blob, name, opts);\n const force = blob.type === 'application/octet-stream';\n const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global;\n const isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n if ((isChromeIOS || (force && isSafari) || isMacOSWebView) &&\n typeof FileReader !== 'undefined') {\n // Safari doesn't allow downloading of blob URLs\n const reader = new FileReader();\n reader.onloadend = function () {\n let url = reader.result;\n if (typeof url !== 'string') {\n popup = null;\n throw new Error('Wrong reader.result type');\n }\n url = isChromeIOS\n ? url\n : url.replace(/^data:[^;]*;/, 'data:attachment/file;');\n if (popup) {\n popup.location.href = url;\n }\n else {\n location.assign(url);\n }\n popup = null; // reverse-tabnabbing #460\n };\n reader.readAsDataURL(blob);\n }\n else {\n const url = URL.createObjectURL(blob);\n if (popup)\n popup.location.assign(url);\n else\n location.href = url;\n popup = null; // reverse-tabnabbing #460\n setTimeout(function () {\n URL.revokeObjectURL(url);\n }, 4e4); // 40s\n }\n}\n\n/**\n * Shows a toast or console.log\n *\n * @param message - message to log\n * @param type - different color of the tooltip\n */\nfunction toastMessage(message, type) {\n const piniaMessage = '๐ ' + message;\n if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') {\n // No longer available :(\n __VUE_DEVTOOLS_TOAST__(piniaMessage, type);\n }\n else if (type === 'error') {\n console.error(piniaMessage);\n }\n else if (type === 'warn') {\n console.warn(piniaMessage);\n }\n else {\n console.log(piniaMessage);\n }\n}\nfunction isPinia(o) {\n return '_a' in o && 'install' in o;\n}\n\n/**\n * This file contain devtools actions, they are not Pinia actions.\n */\n// ---\nfunction checkClipboardAccess() {\n if (!('clipboard' in navigator)) {\n toastMessage(`Your browser doesn't support the Clipboard API`, 'error');\n return true;\n }\n}\nfunction checkNotFocusedError(error) {\n if (error instanceof Error &&\n error.message.toLowerCase().includes('document is not focused')) {\n toastMessage('You need to activate the \"Emulate a focused page\" setting in the \"Rendering\" panel of devtools.', 'warn');\n return true;\n }\n return false;\n}\nasync function actionGlobalCopyState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));\n toastMessage('Global state copied to clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalPasteState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText()));\n toastMessage('Global state pasted from clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalSaveState(pinia) {\n try {\n saveAs(new Blob([JSON.stringify(pinia.state.value)], {\n type: 'text/plain;charset=utf-8',\n }), 'pinia-state.json');\n }\n catch (error) {\n toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nlet fileInput;\nfunction getFileOpener() {\n if (!fileInput) {\n fileInput = document.createElement('input');\n fileInput.type = 'file';\n fileInput.accept = '.json';\n }\n function openFile() {\n return new Promise((resolve, reject) => {\n fileInput.onchange = async () => {\n const files = fileInput.files;\n if (!files)\n return resolve(null);\n const file = files.item(0);\n if (!file)\n return resolve(null);\n return resolve({ text: await file.text(), file });\n };\n // @ts-ignore: TODO: changed from 4.3 to 4.4\n fileInput.oncancel = () => resolve(null);\n fileInput.onerror = reject;\n fileInput.click();\n });\n }\n return openFile;\n}\nasync function actionGlobalOpenStateFile(pinia) {\n try {\n const open = getFileOpener();\n const result = await open();\n if (!result)\n return;\n const { text, file } = result;\n loadStoresState(pinia, JSON.parse(text));\n toastMessage(`Global state imported from \"${file.name}\".`);\n }\n catch (error) {\n toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nfunction loadStoresState(pinia, state) {\n for (const key in state) {\n const storeState = pinia.state.value[key];\n // store is already instantiated, patch it\n if (storeState) {\n Object.assign(storeState, state[key]);\n }\n else {\n // store is not instantiated, set the initial state\n pinia.state.value[key] = state[key];\n }\n }\n}\n\nfunction formatDisplay(display) {\n return {\n _custom: {\n display,\n },\n };\n}\nconst PINIA_ROOT_LABEL = '๐ Pinia (root)';\nconst PINIA_ROOT_ID = '_root';\nfunction formatStoreForInspectorTree(store) {\n return isPinia(store)\n ? {\n id: PINIA_ROOT_ID,\n label: PINIA_ROOT_LABEL,\n }\n : {\n id: store.$id,\n label: store.$id,\n };\n}\nfunction formatStoreForInspectorState(store) {\n if (isPinia(store)) {\n const storeNames = Array.from(store._s.keys());\n const storeMap = store._s;\n const state = {\n state: storeNames.map((storeId) => ({\n editable: true,\n key: storeId,\n value: store.state.value[storeId],\n })),\n getters: storeNames\n .filter((id) => storeMap.get(id)._getters)\n .map((id) => {\n const store = storeMap.get(id);\n return {\n editable: false,\n key: id,\n value: store._getters.reduce((getters, key) => {\n getters[key] = store[key];\n return getters;\n }, {}),\n };\n }),\n };\n return state;\n }\n const state = {\n state: Object.keys(store.$state).map((key) => ({\n editable: true,\n key,\n value: store.$state[key],\n })),\n };\n // avoid adding empty getters\n if (store._getters && store._getters.length) {\n state.getters = store._getters.map((getterName) => ({\n editable: false,\n key: getterName,\n value: store[getterName],\n }));\n }\n if (store._customProperties.size) {\n state.customProperties = Array.from(store._customProperties).map((key) => ({\n editable: true,\n key,\n value: store[key],\n }));\n }\n return state;\n}\nfunction formatEventData(events) {\n if (!events)\n return {};\n if (Array.isArray(events)) {\n // TODO: handle add and delete for arrays and objects\n return events.reduce((data, event) => {\n data.keys.push(event.key);\n data.operations.push(event.type);\n data.oldValue[event.key] = event.oldValue;\n data.newValue[event.key] = event.newValue;\n return data;\n }, {\n oldValue: {},\n keys: [],\n operations: [],\n newValue: {},\n });\n }\n else {\n return {\n operation: formatDisplay(events.type),\n key: formatDisplay(events.key),\n oldValue: events.oldValue,\n newValue: events.newValue,\n };\n }\n}\nfunction formatMutationType(type) {\n switch (type) {\n case MutationType.direct:\n return 'mutation';\n case MutationType.patchFunction:\n return '$patch';\n case MutationType.patchObject:\n return '$patch';\n default:\n return 'unknown';\n }\n}\n\n// timeline can be paused when directly changing the state\nlet isTimelineActive = true;\nconst componentStateTypes = [];\nconst MUTATIONS_LAYER_ID = 'pinia:mutations';\nconst INSPECTOR_ID = 'pinia';\nconst { assign: assign$1 } = Object;\n/**\n * Gets the displayed name of a store in devtools\n *\n * @param id - id of the store\n * @returns a formatted string\n */\nconst getStoreType = (id) => '๐ ' + id;\n/**\n * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab\n * as soon as it is added to the application.\n *\n * @param app - Vue application\n * @param pinia - pinia instance\n */\nfunction registerPiniaDevtools(app, pinia) {\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia ๐',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n }, (api) => {\n if (typeof api.now !== 'function') {\n toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.');\n }\n api.addTimelineLayer({\n id: MUTATIONS_LAYER_ID,\n label: `Pinia ๐`,\n color: 0xe5df88,\n });\n api.addInspector({\n id: INSPECTOR_ID,\n label: 'Pinia ๐',\n icon: 'storage',\n treeFilterPlaceholder: 'Search stores',\n actions: [\n {\n icon: 'content_copy',\n action: () => {\n actionGlobalCopyState(pinia);\n },\n tooltip: 'Serialize and copy the state',\n },\n {\n icon: 'content_paste',\n action: async () => {\n await actionGlobalPasteState(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Replace the state with the content of your clipboard',\n },\n {\n icon: 'save',\n action: () => {\n actionGlobalSaveState(pinia);\n },\n tooltip: 'Save the state as a JSON file',\n },\n {\n icon: 'folder_open',\n action: async () => {\n await actionGlobalOpenStateFile(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Import the state from a JSON file',\n },\n ],\n nodeActions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state (with \"$reset\")',\n action: (nodeId) => {\n const store = pinia._s.get(nodeId);\n if (!store) {\n toastMessage(`Cannot reset \"${nodeId}\" store because it wasn't found.`, 'warn');\n }\n else if (typeof store.$reset !== 'function') {\n toastMessage(`Cannot reset \"${nodeId}\" store because it doesn't have a \"$reset\" method implemented.`, 'warn');\n }\n else {\n store.$reset();\n toastMessage(`Store \"${nodeId}\" reset.`);\n }\n },\n },\n ],\n });\n api.on.inspectComponent((payload) => {\n const proxy = (payload.componentInstance &&\n payload.componentInstance.proxy);\n if (proxy && proxy._pStores) {\n const piniaStores = payload.componentInstance.proxy._pStores;\n Object.values(piniaStores).forEach((store) => {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'state',\n editable: true,\n value: store._isOptionsAPI\n ? {\n _custom: {\n value: toRaw(store.$state),\n actions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state of this store',\n action: () => store.$reset(),\n },\n ],\n },\n }\n : // NOTE: workaround to unwrap transferred refs\n Object.keys(store.$state).reduce((state, key) => {\n state[key] = store.$state[key];\n return state;\n }, {}),\n });\n if (store._getters && store._getters.length) {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'getters',\n editable: false,\n value: store._getters.reduce((getters, key) => {\n try {\n getters[key] = store[key];\n }\n catch (error) {\n // @ts-expect-error: we just want to show it in devtools\n getters[key] = error;\n }\n return getters;\n }, {}),\n });\n }\n });\n }\n });\n api.on.getInspectorTree((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n let stores = [pinia];\n stores = stores.concat(Array.from(pinia._s.values()));\n payload.rootNodes = (payload.filter\n ? stores.filter((store) => '$id' in store\n ? store.$id\n .toLowerCase()\n .includes(payload.filter.toLowerCase())\n : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase()))\n : stores).map(formatStoreForInspectorTree);\n }\n });\n // Expose pinia instance as $pinia to window\n globalThis.$pinia = pinia;\n api.on.getInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n // this could be the selected store restored for a different project\n // so it's better not to say anything here\n return;\n }\n if (inspectedStore) {\n // Expose selected store as $store to window\n if (payload.nodeId !== PINIA_ROOT_ID)\n globalThis.$store = toRaw(inspectedStore);\n payload.state = formatStoreForInspectorState(inspectedStore);\n }\n }\n });\n api.on.editInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n return toastMessage(`store \"${payload.nodeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (!isPinia(inspectedStore)) {\n // access only the state\n if (path.length !== 1 ||\n !inspectedStore._customProperties.has(path[0]) ||\n path[0] in inspectedStore.$state) {\n path.unshift('$state');\n }\n }\n else {\n // Root access, we can omit the `.value` because the devtools API does it for us\n path.unshift('state');\n }\n isTimelineActive = false;\n payload.set(inspectedStore, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n api.on.editComponentState((payload) => {\n if (payload.type.startsWith('๐')) {\n const storeId = payload.type.replace(/^๐\\s*/, '');\n const store = pinia._s.get(storeId);\n if (!store) {\n return toastMessage(`store \"${storeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (path[0] !== 'state') {\n return toastMessage(`Invalid path for store \"${storeId}\":\\n${path}\\nOnly state can be modified.`);\n }\n // rewrite the first entry to be able to directly set the state as\n // well as any other path\n path[0] = '$state';\n isTimelineActive = false;\n payload.set(store, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n });\n}\nfunction addStoreToDevtools(app, store) {\n if (!componentStateTypes.includes(getStoreType(store.$id))) {\n componentStateTypes.push(getStoreType(store.$id));\n }\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia ๐',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n settings: {\n logStoreChanges: {\n label: 'Notify about new/deleted stores',\n type: 'boolean',\n defaultValue: true,\n },\n // useEmojis: {\n // label: 'Use emojis in messages โก๏ธ',\n // type: 'boolean',\n // defaultValue: true,\n // },\n },\n }, (api) => {\n // gracefully handle errors\n const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now;\n store.$onAction(({ after, onError, name, args }) => {\n const groupId = runningActionId++;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '๐ซ ' + name,\n subtitle: 'start',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n },\n groupId,\n },\n });\n after((result) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '๐ฌ ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n result,\n },\n groupId,\n },\n });\n });\n onError((error) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n logType: 'error',\n title: '๐ฅ ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n error,\n },\n groupId,\n },\n });\n });\n }, true);\n store._customProperties.forEach((name) => {\n watch(() => unref(store[name]), (newValue, oldValue) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (isTimelineActive) {\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: 'Change',\n subtitle: name,\n data: {\n newValue,\n oldValue,\n },\n groupId: activeAction,\n },\n });\n }\n }, { deep: true });\n });\n store.$subscribe(({ events, type }, state) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (!isTimelineActive)\n return;\n // rootStore.state[store.id] = state\n const eventData = {\n time: now(),\n title: formatMutationType(type),\n data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)),\n groupId: activeAction,\n };\n if (type === MutationType.patchFunction) {\n eventData.subtitle = 'โคต๏ธ';\n }\n else if (type === MutationType.patchObject) {\n eventData.subtitle = '๐งฉ';\n }\n else if (events && !Array.isArray(events)) {\n eventData.subtitle = events.type;\n }\n if (events) {\n eventData.data['rawEvent(s)'] = {\n _custom: {\n display: 'DebuggerEvent',\n type: 'object',\n tooltip: 'raw DebuggerEvent[]',\n value: events,\n },\n };\n }\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: eventData,\n });\n }, { detached: true, flush: 'sync' });\n const hotUpdate = store._hotUpdate;\n store._hotUpdate = markRaw((newStore) => {\n hotUpdate(newStore);\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '๐ฅ ' + store.$id,\n subtitle: 'HMR update',\n data: {\n store: formatDisplay(store.$id),\n info: formatDisplay(`HMR update`),\n },\n },\n });\n // update the devtools too\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n });\n const { $dispose } = store;\n store.$dispose = () => {\n $dispose();\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`Disposed \"${store.$id}\" store ๐`);\n };\n // trigger an update so it can display new registered stores\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`\"${store.$id}\" store installed ๐`);\n });\n}\nlet runningActionId = 0;\nlet activeAction;\n/**\n * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the\n * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state\n * mutation to the action.\n *\n * @param store - store to patch\n * @param actionNames - list of actionst to patch\n */\nfunction patchActionForGrouping(store, actionNames, wrapWithProxy) {\n // original actions of the store as they are given by pinia. We are going to override them\n const actions = actionNames.reduce((storeActions, actionName) => {\n // use toRaw to avoid tracking #541\n storeActions[actionName] = toRaw(store)[actionName];\n return storeActions;\n }, {});\n for (const actionName in actions) {\n store[actionName] = function () {\n // the running action id is incremented in a before action hook\n const _actionId = runningActionId;\n const trackedStore = wrapWithProxy\n ? new Proxy(store, {\n get(...args) {\n activeAction = _actionId;\n return Reflect.get(...args);\n },\n set(...args) {\n activeAction = _actionId;\n return Reflect.set(...args);\n },\n })\n : store;\n // For Setup Stores we need https://github.com/tc39/proposal-async-context\n activeAction = _actionId;\n const retValue = actions[actionName].apply(trackedStore, arguments);\n // this is safer as async actions in Setup Stores would associate mutations done outside of the action\n activeAction = undefined;\n return retValue;\n };\n }\n}\n/**\n * pinia.use(devtoolsPlugin)\n */\nfunction devtoolsPlugin({ app, store, options }) {\n // HMR module\n if (store.$id.startsWith('__hot:')) {\n return;\n }\n // detect option api vs setup api\n store._isOptionsAPI = !!options.state;\n // Do not overwrite actions mocked by @pinia/testing (#2298)\n if (!store._p._testing) {\n patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);\n // Upgrade the HMR to also update the new actions\n const originalHotUpdate = store._hotUpdate;\n toRaw(store)._hotUpdate = function (newStore) {\n originalHotUpdate.apply(this, arguments);\n patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);\n };\n }\n addStoreToDevtools(app, \n // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?\n store);\n}\n\n/**\n * Creates a Pinia instance to be used by the application\n */\nfunction createPinia() {\n const scope = effectScope(true);\n // NOTE: here we could check the window object for a state and directly set it\n // if there is anything like it with Vue 3 SSR\n const state = scope.run(() => ref({}));\n let _p = [];\n // plugins added before calling app.use(pinia)\n let toBeInstalled = [];\n const pinia = markRaw({\n install(app) {\n // this allows calling useStore() outside of a component setup after\n // installing pinia's plugin\n setActivePinia(pinia);\n pinia._a = app;\n app.provide(piniaSymbol, pinia);\n app.config.globalProperties.$pinia = pinia;\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n registerPiniaDevtools(app, pinia);\n }\n toBeInstalled.forEach((plugin) => _p.push(plugin));\n toBeInstalled = [];\n },\n use(plugin) {\n if (!this._a) {\n toBeInstalled.push(plugin);\n }\n else {\n _p.push(plugin);\n }\n return this;\n },\n _p,\n // it's actually undefined here\n // @ts-expect-error\n _a: null,\n _e: scope,\n _s: new Map(),\n state,\n });\n // pinia devtools rely on dev only features so they cannot be forced unless\n // the dev build of Vue is used. Avoid old browsers like IE11.\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT && typeof Proxy !== 'undefined') {\n pinia.use(devtoolsPlugin);\n }\n return pinia;\n}\n/**\n * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly\n * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.\n * Once disposed, the pinia instance cannot be used anymore.\n *\n * @param pinia - pinia instance\n */\nfunction disposePinia(pinia) {\n pinia._e.stop();\n pinia._s.clear();\n pinia._p.splice(0);\n pinia.state.value = {};\n // @ts-expect-error: non valid\n pinia._a = null;\n}\n\n/**\n * Checks if a function is a `StoreDefinition`.\n *\n * @param fn - object to test\n * @returns true if `fn` is a StoreDefinition\n */\nconst isUseStore = (fn) => {\n return typeof fn === 'function' && typeof fn.$id === 'string';\n};\n/**\n * Mutates in place `newState` with `oldState` to _hot update_ it. It will\n * remove any key not existing in `newState` and recursively merge plain\n * objects.\n *\n * @param newState - new state object to be patched\n * @param oldState - old state that should be used to patch newState\n * @returns - newState\n */\nfunction patchObject(newState, oldState) {\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in oldState) {\n const subPatch = oldState[key];\n // skip the whole sub tree\n if (!(key in newState)) {\n continue;\n }\n const targetValue = newState[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n newState[key] = patchObject(targetValue, subPatch);\n }\n else {\n // objects are either a bit more complex (e.g. refs) or primitives, so we\n // just set the whole thing\n newState[key] = subPatch;\n }\n }\n return newState;\n}\n/**\n * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.\n *\n * @example\n * ```js\n * const useUser = defineStore(...)\n * if (import.meta.hot) {\n * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))\n * }\n * ```\n *\n * @param initialUseStore - return of the defineStore to hot update\n * @param hot - `import.meta.hot`\n */\nfunction acceptHMRUpdate(initialUseStore, hot) {\n // strip as much as possible from iife.prod\n if (!(process.env.NODE_ENV !== 'production')) {\n return () => { };\n }\n return (newModule) => {\n const pinia = hot.data.pinia || initialUseStore._pinia;\n if (!pinia) {\n // this store is still not used\n return;\n }\n // preserve the pinia instance across loads\n hot.data.pinia = pinia;\n // console.log('got data', newStore)\n for (const exportName in newModule) {\n const useStore = newModule[exportName];\n // console.log('checking for', exportName)\n if (isUseStore(useStore) && pinia._s.has(useStore.$id)) {\n // console.log('Accepting update for', useStore.$id)\n const id = useStore.$id;\n if (id !== initialUseStore.$id) {\n console.warn(`The id of the store changed from \"${initialUseStore.$id}\" to \"${id}\". Reloading.`);\n // return import.meta.hot.invalidate()\n return hot.invalidate();\n }\n const existingStore = pinia._s.get(id);\n if (!existingStore) {\n console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);\n return;\n }\n useStore(pinia, existingStore);\n }\n }\n };\n}\n\nconst noop = () => { };\nfunction addSubscription(subscriptions, callback, detached, onCleanup = noop) {\n subscriptions.add(callback);\n const removeSubscription = () => {\n const isDel = subscriptions.delete(callback);\n isDel && onCleanup();\n };\n if (!detached && getCurrentScope()) {\n onScopeDispose(removeSubscription);\n }\n return removeSubscription;\n}\nfunction triggerSubscriptions(subscriptions, ...args) {\n subscriptions.forEach((callback) => {\n callback(...args);\n });\n}\n\nconst fallbackRunWithContext = (fn) => fn();\n/**\n * Marks a function as an action for `$onAction`\n * @internal\n */\nconst ACTION_MARKER = Symbol();\n/**\n * Action name symbol. Allows to add a name to an action after defining it\n * @internal\n */\nconst ACTION_NAME = Symbol();\nfunction mergeReactiveObjects(target, patchToApply) {\n // Handle Map instances\n if (target instanceof Map && patchToApply instanceof Map) {\n patchToApply.forEach((value, key) => target.set(key, value));\n }\n else if (target instanceof Set && patchToApply instanceof Set) {\n // Handle Set instances\n patchToApply.forEach(target.add, target);\n }\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in patchToApply) {\n if (!patchToApply.hasOwnProperty(key))\n continue;\n const subPatch = patchToApply[key];\n const targetValue = target[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n target.hasOwnProperty(key) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might\n // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that\n // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.\n target[key] = mergeReactiveObjects(targetValue, subPatch);\n }\n else {\n // @ts-expect-error: subPatch is a valid value\n target[key] = subPatch;\n }\n }\n return target;\n}\nconst skipHydrateSymbol = (process.env.NODE_ENV !== 'production')\n ? Symbol('pinia:skipHydration')\n : /* istanbul ignore next */ Symbol();\n/**\n * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a\n * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.\n *\n * @param obj - target object\n * @returns obj\n */\nfunction skipHydrate(obj) {\n return Object.defineProperty(obj, skipHydrateSymbol, {});\n}\n/**\n * Returns whether a value should be hydrated\n *\n * @param obj - target variable\n * @returns true if `obj` should be hydrated\n */\nfunction shouldHydrate(obj) {\n return (!isPlainObject(obj) ||\n !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol));\n}\nconst { assign } = Object;\nfunction isComputed(o) {\n return !!(isRef(o) && o.effect);\n}\nfunction createOptionsStore(id, options, pinia, hot) {\n const { state, actions, getters } = options;\n const initialState = pinia.state.value[id];\n let store;\n function setup() {\n if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[id] = state ? state() : {};\n }\n // avoid creating a state in pinia.state.value\n const localState = (process.env.NODE_ENV !== 'production') && hot\n ? // use ref() to unwrap refs inside state TODO: check if this is still necessary\n toRefs(ref(state ? state() : {}).value)\n : toRefs(pinia.state.value[id]);\n return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {\n if ((process.env.NODE_ENV !== 'production') && name in localState) {\n console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${name}\" in store \"${id}\".`);\n }\n computedGetters[name] = markRaw(computed(() => {\n setActivePinia(pinia);\n // it was created just before\n const store = pinia._s.get(id);\n // allow cross using stores\n // @ts-expect-error\n // return getters![name].call(context, context)\n // TODO: avoid reading the getter while assigning with a global variable\n return getters[name].call(store, store);\n }));\n return computedGetters;\n }, {}));\n }\n store = createSetupStore(id, setup, options, pinia, hot, true);\n return store;\n}\nfunction createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {\n let scope;\n const optionsForPlugin = assign({ actions: {} }, options);\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) {\n throw new Error('Pinia destroyed');\n }\n // watcher options for $subscribe\n const $subscribeOptions = { deep: true };\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n $subscribeOptions.onTrigger = (event) => {\n /* istanbul ignore else */\n if (isListening) {\n debuggerEvents = event;\n // avoid triggering this while the store is being built and the state is being set in pinia\n }\n else if (isListening == false && !store._hotUpdating) {\n // let patch send all the events together later\n /* istanbul ignore else */\n if (Array.isArray(debuggerEvents)) {\n debuggerEvents.push(event);\n }\n else {\n console.error('๐ debuggerEvents should be an array. This is most likely an internal Pinia bug.');\n }\n }\n };\n }\n // internal state\n let isListening; // set to true at the end\n let isSyncListening; // set to true at the end\n let subscriptions = new Set();\n let actionSubscriptions = new Set();\n let debuggerEvents;\n const initialState = pinia.state.value[$id];\n // avoid setting the state for option stores if it is set\n // by the setup\n if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[$id] = {};\n }\n const hotState = ref({});\n // avoid triggering too many listeners\n // https://github.com/vuejs/pinia/issues/1129\n let activeListener;\n function $patch(partialStateOrMutator) {\n let subscriptionMutation;\n isListening = isSyncListening = false;\n // reset the debugger events since patches are sync\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n debuggerEvents = [];\n }\n if (typeof partialStateOrMutator === 'function') {\n partialStateOrMutator(pinia.state.value[$id]);\n subscriptionMutation = {\n type: MutationType.patchFunction,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n else {\n mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);\n subscriptionMutation = {\n type: MutationType.patchObject,\n payload: partialStateOrMutator,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n const myListenerId = (activeListener = Symbol());\n nextTick().then(() => {\n if (activeListener === myListenerId) {\n isListening = true;\n }\n });\n isSyncListening = true;\n // because we paused the watcher, we need to manually call the subscriptions\n triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);\n }\n const $reset = isOptionsStore\n ? function $reset() {\n const { state } = options;\n const newState = state ? state() : {};\n // we use a patch to group all changes into one single subscription\n this.$patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, newState);\n });\n }\n : /* istanbul ignore next */\n (process.env.NODE_ENV !== 'production')\n ? () => {\n throw new Error(`๐: Store \"${$id}\" is built using the setup syntax and does not implement $reset().`);\n }\n : noop;\n function $dispose() {\n scope.stop();\n subscriptions.clear();\n actionSubscriptions.clear();\n pinia._s.delete($id);\n }\n /**\n * Helper that wraps function so it can be tracked with $onAction\n * @param fn - action to wrap\n * @param name - name of the action\n */\n const action = (fn, name = '') => {\n if (ACTION_MARKER in fn) {\n fn[ACTION_NAME] = name;\n return fn;\n }\n const wrappedAction = function () {\n setActivePinia(pinia);\n const args = Array.from(arguments);\n const afterCallbackSet = new Set();\n const onErrorCallbackSet = new Set();\n function after(callback) {\n afterCallbackSet.add(callback);\n }\n function onError(callback) {\n onErrorCallbackSet.add(callback);\n }\n // @ts-expect-error\n triggerSubscriptions(actionSubscriptions, {\n args,\n name: wrappedAction[ACTION_NAME],\n store,\n after,\n onError,\n });\n let ret;\n try {\n ret = fn.apply(this && this.$id === $id ? this : store, args);\n // handle sync errors\n }\n catch (error) {\n triggerSubscriptions(onErrorCallbackSet, error);\n throw error;\n }\n if (ret instanceof Promise) {\n return ret\n .then((value) => {\n triggerSubscriptions(afterCallbackSet, value);\n return value;\n })\n .catch((error) => {\n triggerSubscriptions(onErrorCallbackSet, error);\n return Promise.reject(error);\n });\n }\n // trigger after callbacks\n triggerSubscriptions(afterCallbackSet, ret);\n return ret;\n };\n wrappedAction[ACTION_MARKER] = true;\n wrappedAction[ACTION_NAME] = name; // will be set later\n // @ts-expect-error: we are intentionally limiting the returned type to just Fn\n // because all the added properties are internals that are exposed through `$onAction()` only\n return wrappedAction;\n };\n const _hmrPayload = /*#__PURE__*/ markRaw({\n actions: {},\n getters: {},\n state: [],\n hotState,\n });\n const partialStore = {\n _p: pinia,\n // _s: scope,\n $id,\n $onAction: addSubscription.bind(null, actionSubscriptions),\n $patch,\n $reset,\n $subscribe(callback, options = {}) {\n const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());\n const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {\n if (options.flush === 'sync' ? isSyncListening : isListening) {\n callback({\n storeId: $id,\n type: MutationType.direct,\n events: debuggerEvents,\n }, state);\n }\n }, assign({}, $subscribeOptions, options)));\n return removeSubscription;\n },\n $dispose,\n };\n const store = reactive((process.env.NODE_ENV !== 'production') || ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT)\n ? assign({\n _hmrPayload,\n _customProperties: markRaw(new Set()), // devtools custom properties\n }, partialStore\n // must be added later\n // setupStore\n )\n : partialStore);\n // store the partial store now so the setup of stores can instantiate each other before they are finished without\n // creating infinite loops.\n pinia._s.set($id, store);\n const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext;\n // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped\n const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));\n // overwrite existing actions to support $onAction\n for (const key in setupStore) {\n const prop = setupStore[key];\n if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) {\n // mark it as a piece of state to be serialized\n if ((process.env.NODE_ENV !== 'production') && hot) {\n hotState.value[key] = toRef(setupStore, key);\n // createOptionStore directly sets the state in pinia.state.value so we\n // can just skip that\n }\n else if (!isOptionsStore) {\n // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created\n if (initialState && shouldHydrate(prop)) {\n if (isRef(prop)) {\n prop.value = initialState[key];\n }\n else {\n // probably a reactive object, lets recursively assign\n // @ts-expect-error: prop is unknown\n mergeReactiveObjects(prop, initialState[key]);\n }\n }\n // transfer the ref to the pinia state to keep everything in sync\n pinia.state.value[$id][key] = prop;\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.state.push(key);\n }\n // action\n }\n else if (typeof prop === 'function') {\n const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : action(prop, key);\n // this a hot module replacement store because the hotUpdate method needs\n // to do it with the right context\n // @ts-expect-error\n setupStore[key] = actionValue;\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.actions[key] = prop;\n }\n // list actions so they can be used in plugins\n // @ts-expect-error\n optionsForPlugin.actions[key] = prop;\n }\n else if ((process.env.NODE_ENV !== 'production')) {\n // add getters for devtools\n if (isComputed(prop)) {\n _hmrPayload.getters[key] = isOptionsStore\n ? // @ts-expect-error\n options.getters[key]\n : prop;\n if (IS_CLIENT) {\n const getters = setupStore._getters ||\n // @ts-expect-error: same\n (setupStore._getters = markRaw([]));\n getters.push(key);\n }\n }\n }\n }\n // add the state, getters, and action properties\n /* istanbul ignore if */\n assign(store, setupStore);\n // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.\n // Make `storeToRefs()` work with `reactive()` #799\n assign(toRaw(store), setupStore);\n // use this instead of a computed with setter to be able to create it anywhere\n // without linking the computed lifespan to wherever the store is first\n // created.\n Object.defineProperty(store, '$state', {\n get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]),\n set: (state) => {\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && hot) {\n throw new Error('cannot set hotState');\n }\n $patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, state);\n });\n },\n });\n // add the hotUpdate before plugins to allow them to override it\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n store._hotUpdate = markRaw((newStore) => {\n store._hotUpdating = true;\n newStore._hmrPayload.state.forEach((stateKey) => {\n if (stateKey in store.$state) {\n const newStateTarget = newStore.$state[stateKey];\n const oldStateSource = store.$state[stateKey];\n if (typeof newStateTarget === 'object' &&\n isPlainObject(newStateTarget) &&\n isPlainObject(oldStateSource)) {\n patchObject(newStateTarget, oldStateSource);\n }\n else {\n // transfer the ref\n newStore.$state[stateKey] = oldStateSource;\n }\n }\n // patch direct access properties to allow store.stateProperty to work as\n // store.$state.stateProperty\n // @ts-expect-error: any type\n store[stateKey] = toRef(newStore.$state, stateKey);\n });\n // remove deleted state properties\n Object.keys(store.$state).forEach((stateKey) => {\n if (!(stateKey in newStore.$state)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[stateKey];\n }\n });\n // avoid devtools logging this as a mutation\n isListening = false;\n isSyncListening = false;\n pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState');\n isSyncListening = true;\n nextTick().then(() => {\n isListening = true;\n });\n for (const actionName in newStore._hmrPayload.actions) {\n const actionFn = newStore[actionName];\n // @ts-expect-error: actionName is a string\n store[actionName] =\n //\n action(actionFn, actionName);\n }\n // TODO: does this work in both setup and option store?\n for (const getterName in newStore._hmrPayload.getters) {\n const getter = newStore._hmrPayload.getters[getterName];\n const getterValue = isOptionsStore\n ? // special handling of options api\n computed(() => {\n setActivePinia(pinia);\n return getter.call(store, store);\n })\n : getter;\n // @ts-expect-error: getterName is a string\n store[getterName] =\n //\n getterValue;\n }\n // remove deleted getters\n Object.keys(store._hmrPayload.getters).forEach((key) => {\n if (!(key in newStore._hmrPayload.getters)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // remove old actions\n Object.keys(store._hmrPayload.actions).forEach((key) => {\n if (!(key in newStore._hmrPayload.actions)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // update the values used in devtools and to allow deleting new properties later on\n store._hmrPayload = newStore._hmrPayload;\n store._getters = newStore._getters;\n store._hotUpdating = false;\n });\n }\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const nonEnumerable = {\n writable: true,\n configurable: true,\n // avoid warning on devtools trying to display this property\n enumerable: false,\n };\n ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => {\n Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable));\n });\n }\n // apply all plugins\n pinia._p.forEach((extender) => {\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const extensions = scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n }));\n Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));\n assign(store, extensions);\n }\n else {\n assign(store, scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n })));\n }\n });\n if ((process.env.NODE_ENV !== 'production') &&\n store.$state &&\n typeof store.$state === 'object' &&\n typeof store.$state.constructor === 'function' &&\n !store.$state.constructor.toString().includes('[native code]')) {\n console.warn(`[๐]: The \"state\" must be a plain object. It cannot be\\n` +\n `\\tstate: () => new MyClass()\\n` +\n `Found in store \"${store.$id}\".`);\n }\n // only apply hydrate to option stores with an initial state in pinia\n if (initialState &&\n isOptionsStore &&\n options.hydrate) {\n options.hydrate(store.$state, initialState);\n }\n isListening = true;\n isSyncListening = true;\n return store;\n}\n// allows unused stores to be tree shaken\n/*! #__NO_SIDE_EFFECTS__ */\nfunction defineStore(\n// TODO: add proper types from above\nid, setup, setupOptions) {\n let options;\n const isSetupStore = typeof setup === 'function';\n // the option store setup will contain the actual options in this case\n options = isSetupStore ? setupOptions : setup;\n function useStore(pinia, hot) {\n const hasContext = hasInjectionContext();\n pinia =\n // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) ||\n (hasContext ? inject(piniaSymbol, null) : null);\n if (pinia)\n setActivePinia(pinia);\n if ((process.env.NODE_ENV !== 'production') && !activePinia) {\n throw new Error(`[๐]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\\n` +\n `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\\n` +\n `This will fail in production.`);\n }\n pinia = activePinia;\n if (!pinia._s.has(id)) {\n // creating the store registers it in `pinia._s`\n if (isSetupStore) {\n createSetupStore(id, setup, options, pinia);\n }\n else {\n createOptionsStore(id, options, pinia);\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n // @ts-expect-error: not the right inferred type\n useStore._pinia = pinia;\n }\n }\n const store = pinia._s.get(id);\n if ((process.env.NODE_ENV !== 'production') && hot) {\n const hotId = '__hot:' + id;\n const newStore = isSetupStore\n ? createSetupStore(hotId, setup, options, pinia, true)\n : createOptionsStore(hotId, assign({}, options), pinia, true);\n hot._hotUpdate(newStore);\n // cleanup the state properties and the store from the cache\n delete pinia.state.value[hotId];\n pinia._s.delete(hotId);\n }\n if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) {\n const currentInstance = getCurrentInstance();\n // save stores in instances to access them devtools\n if (currentInstance &&\n currentInstance.proxy &&\n // avoid adding stores that are just built for hot module replacement\n !hot) {\n const vm = currentInstance.proxy;\n const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {});\n cache[id] = store;\n }\n }\n // StoreGeneric cannot be casted towards Store\n return store;\n }\n useStore.$id = id;\n return useStore;\n}\n\nlet mapStoreSuffix = 'Store';\n/**\n * Changes the suffix added by `mapStores()`. Can be set to an empty string.\n * Defaults to `\"Store\"`. Make sure to extend the MapStoresCustomization\n * interface if you are using TypeScript.\n *\n * @param suffix - new suffix\n */\nfunction setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS\n) {\n mapStoreSuffix = suffix;\n}\n/**\n * Allows using stores without the composition API (`setup()`) by generating an\n * object to be spread in the `computed` field of a component. It accepts a list\n * of store definitions.\n *\n * @example\n * ```js\n * export default {\n * computed: {\n * // other computed properties\n * ...mapStores(useUserStore, useCartStore)\n * },\n *\n * created() {\n * this.userStore // store with id \"user\"\n * this.cartStore // store with id \"cart\"\n * }\n * }\n * ```\n *\n * @param stores - list of stores to map to an object\n */\nfunction mapStores(...stores) {\n if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) {\n console.warn(`[๐]: Directly pass all stores to \"mapStores()\" without putting them in an array:\\n` +\n `Replace\\n` +\n `\\tmapStores([useAuthStore, useCartStore])\\n` +\n `with\\n` +\n `\\tmapStores(useAuthStore, useCartStore)\\n` +\n `This will fail in production if not fixed.`);\n stores = stores[0];\n }\n return stores.reduce((reduced, useStore) => {\n // @ts-expect-error: $id is added by defineStore\n reduced[useStore.$id + mapStoreSuffix] = function () {\n return useStore(this.$pinia);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = function () {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key];\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function () {\n const store = useStore(this.$pinia);\n const storeKey = keysOrMapper[key];\n // for some reason TS is unable to infer the type of storeKey to be a\n // function\n return typeof storeKey === 'function'\n ? storeKey.call(this, store)\n : // @ts-expect-error: FIXME: should work?\n store[storeKey];\n };\n return reduced;\n }, {});\n}\n/**\n * Alias for `mapState()`. You should use `mapState()` instead.\n * @deprecated use `mapState()` instead.\n */\nconst mapGetters = mapState;\n/**\n * Allows directly using actions from your store without using the composition\n * API (`setup()`) by generating an object to be spread in the `methods` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapActions(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key](...args);\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[keysOrMapper[key]](...args);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapWritableState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[key];\n },\n set(value) {\n return (useStore(this.$pinia)[key] = value);\n },\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[keysOrMapper[key]];\n },\n set(value) {\n return (useStore(this.$pinia)[keysOrMapper[key]] = value);\n },\n };\n return reduced;\n }, {});\n}\n\n/**\n * Creates an object of references with all the state, getters, and plugin-added\n * state properties of the store. Similar to `toRefs()` but specifically\n * designed for Pinia stores so methods and non reactive properties are\n * completely ignored.\n *\n * @param store - store to extract the refs from\n */\nfunction storeToRefs(store) {\n const rawStore = toRaw(store);\n const refs = {};\n for (const key in rawStore) {\n const value = rawStore[key];\n // There is no native method to check for a computed\n // https://github.com/vuejs/core/pull/4165\n if (value.effect) {\n // @ts-expect-error: too hard to type correctly\n refs[key] =\n // ...\n computed({\n get: () => store[key],\n set(value) {\n store[key] = value;\n },\n });\n }\n else if (isRef(value) || isReactive(value)) {\n // @ts-expect-error: the key is state or getter\n refs[key] =\n // ---\n toRef(store, key);\n }\n }\n return refs;\n}\n\nexport { MutationType, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs };\n","import { watch as U, onMounted as me, nextTick as de, readonly as ye, getCurrentInstance as Se, toRef as Ie, customRef as Ee, ref as L, reactive as ue, computed as B, toValue as H, shallowRef as we, unref as Ce, inject as fe, provide as pe } from \"vue\";\nimport { defineStore as ke, storeToRefs as be } from \"pinia\";\nconst De = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Le = Object.prototype.toString, Me = (o) => Le.call(o) === \"[object Object]\", Re = () => {\n};\nfunction Fe(...o) {\n if (o.length !== 1) return Ie(...o);\n const e = o[0];\n return typeof e == \"function\" ? ye(Ee(() => ({\n get: e,\n set: Re\n }))) : L(e);\n}\nfunction xe(o, e) {\n function t(...r) {\n return new Promise((n, i) => {\n Promise.resolve(o(() => e.apply(this, r), {\n fn: e,\n thisArg: this,\n args: r\n })).then(n).catch(i);\n });\n }\n return t;\n}\nconst Ae = (o) => o();\nfunction Ne(o = Ae, e = {}) {\n const { initialState: t = \"active\" } = e, r = Fe(t === \"active\");\n function n() {\n r.value = !1;\n }\n function i() {\n r.value = !0;\n }\n const s = (...a) => {\n r.value && o(...a);\n };\n return {\n isActive: ye(r),\n pause: n,\n resume: i,\n eventFilter: s\n };\n}\nfunction ce(o) {\n return Array.isArray(o) ? o : [o];\n}\nfunction Be(o) {\n return Se();\n}\nfunction _e(o, e, t = {}) {\n const { eventFilter: r = Ae, ...n } = t;\n return U(o, xe(r, e), n);\n}\nfunction Ve(o, e, t = {}) {\n const { eventFilter: r, initialState: n = \"active\", ...i } = t, { eventFilter: s, pause: a, resume: c, isActive: d } = Ne(r, { initialState: n });\n return {\n stop: _e(o, e, {\n ...i,\n eventFilter: s\n }),\n pause: a,\n resume: c,\n isActive: d\n };\n}\nfunction We(o, e = !0, t) {\n Be() ? me(o, t) : e ? o() : de(o);\n}\nfunction ze(o, e, t) {\n return U(o, e, {\n ...t,\n immediate: !0\n });\n}\nfunction X(o, e, t) {\n return U(o, (n, i, s) => {\n n && e(n, i, s);\n }, {\n ...t,\n once: !1\n });\n}\nconst j = De ? window : void 0;\nfunction He(o) {\n var e;\n const t = H(o);\n return (e = t?.$el) !== null && e !== void 0 ? e : t;\n}\nfunction Q(...o) {\n const e = (r, n, i, s) => (r.addEventListener(n, i, s), () => r.removeEventListener(n, i, s)), t = B(() => {\n const r = ce(H(o[0])).filter((n) => n != null);\n return r.every((n) => typeof n != \"string\") ? r : void 0;\n });\n return ze(() => {\n var r, n;\n return [\n (r = (n = t.value) === null || n === void 0 ? void 0 : n.map((i) => He(i))) !== null && r !== void 0 ? r : [j].filter((i) => i != null),\n ce(H(t.value ? o[1] : o[0])),\n ce(Ce(t.value ? o[2] : o[1])),\n H(t.value ? o[3] : o[2])\n ];\n }, ([r, n, i, s], a, c) => {\n if (!r?.length || !n?.length || !i?.length) return;\n const d = Me(s) ? { ...s } : s, h = r.flatMap((S) => n.flatMap(($) => i.map((D) => e(S, $, D, d))));\n c(() => {\n h.forEach((S) => S());\n });\n }, { flush: \"post\" });\n}\nconst ne = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {}, oe = \"__vueuse_ssr_handlers__\", Ue = /* @__PURE__ */ Je();\nfunction Je() {\n return oe in ne || (ne[oe] = ne[oe] || {}), ne[oe];\n}\nfunction qe(o, e) {\n return Ue[o] || e;\n}\nfunction Ke(o) {\n return o == null ? \"any\" : o instanceof Set ? \"set\" : o instanceof Map ? \"map\" : o instanceof Date ? \"date\" : typeof o == \"boolean\" ? \"boolean\" : typeof o == \"string\" ? \"string\" : typeof o == \"object\" ? \"object\" : Number.isNaN(o) ? \"any\" : \"number\";\n}\nconst je = {\n boolean: {\n read: (o) => o === \"true\",\n write: (o) => String(o)\n },\n object: {\n read: (o) => JSON.parse(o),\n write: (o) => JSON.stringify(o)\n },\n number: {\n read: (o) => Number.parseFloat(o),\n write: (o) => String(o)\n },\n any: {\n read: (o) => o,\n write: (o) => String(o)\n },\n string: {\n read: (o) => o,\n write: (o) => String(o)\n },\n map: {\n read: (o) => new Map(JSON.parse(o)),\n write: (o) => JSON.stringify(Array.from(o.entries()))\n },\n set: {\n read: (o) => new Set(JSON.parse(o)),\n write: (o) => JSON.stringify(Array.from(o))\n },\n date: {\n read: (o) => new Date(o),\n write: (o) => o.toISOString()\n }\n}, ge = \"vueuse-storage\";\nfunction Ge(o, e, t, r = {}) {\n var n;\n const { flush: i = \"pre\", deep: s = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: d = !1, shallow: h, window: S = j, eventFilter: $, onError: D = (v) => {\n console.error(v);\n }, initOnMounted: x } = r, F = (h ? we : L)(e), R = B(() => H(o));\n if (!t) try {\n t = qe(\"getDefaultStorage\", () => j?.localStorage)();\n } catch (v) {\n D(v);\n }\n if (!t) return F;\n const O = H(e), b = Ke(O), g = (n = r.serializer) !== null && n !== void 0 ? n : je[b], { pause: E, resume: w } = Ve(F, (v) => N(v), {\n flush: i,\n deep: s,\n eventFilter: $\n });\n U(R, () => _(), { flush: i });\n let A = !1;\n const C = (v) => {\n x && !A || _(v);\n }, M = (v) => {\n x && !A || G(v);\n };\n S && a && (t instanceof Storage ? Q(S, \"storage\", C, { passive: !0 }) : Q(S, ge, M)), x ? We(() => {\n A = !0, _();\n }) : _();\n function W(v, P) {\n if (S) {\n const k = {\n key: R.value,\n oldValue: v,\n newValue: P,\n storageArea: t\n };\n S.dispatchEvent(t instanceof Storage ? new StorageEvent(\"storage\", k) : new CustomEvent(ge, { detail: k }));\n }\n }\n function N(v) {\n try {\n const P = t.getItem(R.value);\n if (v == null)\n W(P, null), t.removeItem(R.value);\n else {\n const k = g.write(v);\n P !== k && (t.setItem(R.value, k), W(P, k));\n }\n } catch (P) {\n D(P);\n }\n }\n function q(v) {\n const P = v ? v.newValue : t.getItem(R.value);\n if (P == null)\n return c && O != null && t.setItem(R.value, g.write(O)), O;\n if (!v && d) {\n const k = g.read(P);\n return typeof d == \"function\" ? d(k, O) : b === \"object\" && !Array.isArray(k) ? {\n ...O,\n ...k\n } : k;\n } else return typeof P != \"string\" ? P : g.read(P);\n }\n function _(v) {\n if (!(v && v.storageArea !== t)) {\n if (v && v.key == null) {\n F.value = O;\n return;\n }\n if (!(v && v.key !== R.value)) {\n E();\n try {\n const P = g.write(F.value);\n (v === void 0 || v?.newValue !== P) && (F.value = q(v));\n } catch (P) {\n D(P);\n } finally {\n v ? de(w) : w();\n }\n }\n }\n }\n function G(v) {\n _(v.detail);\n }\n return F;\n}\nfunction Ze(o, e, t = {}) {\n const { window: r = j } = t;\n return Ge(o, e, r?.localStorage, t);\n}\nconst Qe = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\nfunction Ye(o = {}) {\n const { reactive: e = !1, target: t = j, aliasMap: r = Qe, passive: n = !0, onEventFired: i = Re } = o, s = ue(/* @__PURE__ */ new Set()), a = {\n toJSON() {\n return {};\n },\n current: s\n }, c = e ? ue(a) : a, d = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Map([\n [\"Meta\", d],\n [\"Shift\", /* @__PURE__ */ new Set()],\n [\"Alt\", /* @__PURE__ */ new Set()]\n ]), S = /* @__PURE__ */ new Set();\n function $(b, g) {\n b in c && (e ? c[b] = g : c[b].value = g);\n }\n function D() {\n s.clear();\n for (const b of S) $(b, !1);\n }\n function x(b, g, E) {\n if (!(!b || typeof g.getModifierState != \"function\")) {\n for (const [w, A] of h) if (g.getModifierState(w)) {\n E.forEach((C) => A.add(C));\n break;\n }\n }\n }\n function F(b, g) {\n if (b) return;\n const E = `${g[0].toUpperCase()}${g.slice(1)}`, w = h.get(E);\n if (![\"shift\", \"alt\"].includes(g) || !w) return;\n const A = Array.from(w), C = A.indexOf(g);\n A.forEach((M, W) => {\n W >= C && (s.delete(M), $(M, !1));\n }), w.clear();\n }\n function R(b, g) {\n var E, w;\n const A = (E = b.key) === null || E === void 0 ? void 0 : E.toLowerCase(), C = [(w = b.code) === null || w === void 0 ? void 0 : w.toLowerCase(), A].filter(Boolean);\n if (A) {\n A && (g ? s.add(A) : s.delete(A));\n for (const M of C)\n S.add(M), $(M, g);\n x(g, b, [...s, ...C]), F(g, A), A === \"meta\" && !g && (d.forEach((M) => {\n s.delete(M), $(M, !1);\n }), d.clear());\n }\n }\n Q(t, \"keydown\", (b) => (R(b, !0), i(b)), { passive: n }), Q(t, \"keyup\", (b) => (R(b, !1), i(b)), { passive: n }), Q(\"blur\", D, { passive: n }), Q(\"focus\", D, { passive: n });\n const O = new Proxy(c, { get(b, g, E) {\n if (typeof g != \"string\") return Reflect.get(b, g, E);\n if (g = g.toLowerCase(), g in r && (g = r[g]), !(g in c)) if (/[+_-]/.test(g)) {\n const A = g.split(/[+_-]/g).map((C) => C.trim());\n c[g] = B(() => A.map((C) => H(O[C])).every(Boolean));\n } else c[g] = we(!1);\n const w = Reflect.get(b, g, E);\n return e ? H(w) : w;\n } });\n return O;\n}\nfunction le() {\n return typeof crypto < \"u\" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\nfunction ie(o) {\n const e = {\n type: o.type,\n clientId: o.clientId,\n timestamp: o.timestamp.toISOString()\n };\n return o.operation && (e.operation = {\n ...o.operation,\n timestamp: o.operation.timestamp.toISOString()\n }), o.operations && (e.operations = o.operations.map((t) => ({\n ...t,\n timestamp: t.timestamp.toISOString()\n }))), e;\n}\nfunction Xe(o) {\n const e = {\n type: o.type,\n clientId: o.clientId,\n timestamp: new Date(o.timestamp)\n };\n return o.operation && (e.operation = {\n ...o.operation,\n timestamp: new Date(o.operation.timestamp)\n }), o.operations && (e.operations = o.operations.map((t) => ({\n ...t,\n timestamp: new Date(t.timestamp)\n }))), e;\n}\nconst re = ke(\"hst-operation-log\", () => {\n const o = L({\n maxOperations: 100,\n enableCrossTabSync: !0,\n autoSyncInterval: 3e4,\n enablePersistence: !1,\n persistenceKeyPrefix: \"stonecrop-ops\"\n }), e = L([]), t = L(-1), r = L(le()), n = L(!1), i = L([]), s = L(null), a = B(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = B(() => t.value < e.value.length - 1), d = B(() => {\n let u = 0;\n for (let l = t.value; l >= 0 && e.value[l]?.reversible; l--)\n u++;\n return u;\n }), h = B(() => e.value.length - 1 - t.value), S = B(() => ({\n canUndo: a.value,\n canRedo: c.value,\n undoCount: d.value,\n redoCount: h.value,\n currentIndex: t.value\n }));\n function $(u) {\n o.value = { ...o.value, ...u }, o.value.enablePersistence && (p(), y()), o.value.enableCrossTabSync && q();\n }\n function D(u, l = \"user\") {\n const f = {\n ...u,\n id: le(),\n timestamp: /* @__PURE__ */ new Date(),\n source: l,\n userId: o.value.userId\n };\n if (o.value.operationFilter && !o.value.operationFilter(f))\n return f.id;\n if (n.value)\n return i.value.push(f), f.id;\n if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(f), t.value++, o.value.maxOperations && e.value.length > o.value.maxOperations) {\n const T = e.value.length - o.value.maxOperations;\n e.value = e.value.slice(T), t.value -= T;\n }\n return o.value.enableCrossTabSync && _(f), f.id;\n }\n function x() {\n n.value = !0, i.value = [], s.value = le();\n }\n function F(u) {\n if (!n.value || i.value.length === 0)\n return n.value = !1, i.value = [], s.value = null, null;\n const l = s.value, f = i.value.every((I) => I.reversible), T = {\n id: l,\n type: \"batch\",\n path: \"\",\n // Batch doesn't have a single path\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: i.value[0]?.doctype || \"\",\n timestamp: /* @__PURE__ */ new Date(),\n source: \"user\",\n reversible: f,\n irreversibleReason: f ? void 0 : \"Contains irreversible operations\",\n childOperationIds: i.value.map((I) => I.id),\n metadata: { description: u }\n };\n i.value.forEach((I) => {\n I.parentOperationId = l;\n }), e.value.push(...i.value, T), t.value = e.value.length - 1, o.value.enableCrossTabSync && G(i.value, T);\n const V = l;\n return n.value = !1, i.value = [], s.value = null, V;\n }\n function R() {\n n.value = !1, i.value = [], s.value = null;\n }\n function O(u) {\n if (!a.value) return !1;\n const l = e.value[t.value];\n if (!l.reversible)\n return typeof console < \"u\" && l.irreversibleReason && console.warn(\"Cannot undo irreversible operation:\", l.irreversibleReason), !1;\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (let f = l.childOperationIds.length - 1; f >= 0; f--) {\n const T = l.childOperationIds[f], V = e.value.find((I) => I.id === T);\n V && g(V, u);\n }\n else\n g(l, u);\n return t.value--, o.value.enableCrossTabSync && v(l), !0;\n } catch (f) {\n return typeof console < \"u\" && console.error(\"Undo failed:\", f), !1;\n }\n }\n function b(u) {\n if (!c.value) return !1;\n const l = e.value[t.value + 1];\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (const f of l.childOperationIds) {\n const T = e.value.find((V) => V.id === f);\n T && E(T, u);\n }\n else\n E(l, u);\n return t.value++, o.value.enableCrossTabSync && P(l), !0;\n } catch (f) {\n return typeof console < \"u\" && console.error(\"Redo failed:\", f), !1;\n }\n }\n function g(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.beforeValue, \"undo\");\n }\n function E(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.afterValue, \"redo\");\n }\n function w() {\n const u = e.value.filter((f) => f.reversible).length, l = e.value.map((f) => f.timestamp);\n return {\n operations: [...e.value],\n currentIndex: t.value,\n totalOperations: e.value.length,\n reversibleOperations: u,\n irreversibleOperations: e.value.length - u,\n oldestOperation: l.length > 0 ? new Date(Math.min(...l.map((f) => f.getTime()))) : void 0,\n newestOperation: l.length > 0 ? new Date(Math.max(...l.map((f) => f.getTime()))) : void 0\n };\n }\n function A() {\n e.value = [], t.value = -1;\n }\n function C(u, l) {\n return e.value.filter((f) => f.doctype === u && (l === void 0 || f.recordId === l));\n }\n function M(u, l) {\n const f = e.value.find((T) => T.id === u);\n f && (f.reversible = !1, f.irreversibleReason = l);\n }\n function W(u, l, f, T = \"success\", V) {\n const I = {\n type: \"action\",\n path: f && f.length > 0 ? `${u}.${f[0]}` : u,\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: u,\n recordId: f && f.length > 0 ? f[0] : void 0,\n reversible: !1,\n // Actions are typically not reversible\n actionName: l,\n actionRecordIds: f,\n actionResult: T,\n actionError: V\n };\n return D(I);\n }\n let N = null;\n function q() {\n typeof window > \"u\" || !window.BroadcastChannel || (N = new BroadcastChannel(\"stonecrop-operation-log\"), N.addEventListener(\"message\", (u) => {\n const l = u.data;\n if (!l || typeof l != \"object\") return;\n const f = Xe(l);\n f.clientId !== r.value && (f.type === \"operation\" && f.operation ? (e.value.push({ ...f.operation, source: \"sync\" }), t.value = e.value.length - 1) : f.type === \"operation\" && f.operations && (e.value.push(...f.operations.map((T) => ({ ...T, source: \"sync\" }))), t.value = e.value.length - 1));\n }));\n }\n function _(u) {\n if (!N) return;\n const l = {\n type: \"operation\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(l));\n }\n function G(u, l) {\n if (!N) return;\n const f = {\n type: \"operation\",\n operations: [...u, l],\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(f));\n }\n function v(u) {\n if (!N) return;\n const l = {\n type: \"undo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(l));\n }\n function P(u) {\n if (!N) return;\n const l = {\n type: \"redo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n N.postMessage(ie(l));\n }\n const k = Ze(\"stonecrop-ops-operations\", null, {\n serializer: {\n read: (u) => {\n try {\n return JSON.parse(u);\n } catch {\n return null;\n }\n },\n write: (u) => u ? JSON.stringify(u) : \"\"\n }\n });\n function p() {\n if (!(typeof window > \"u\"))\n try {\n const u = k.value;\n u && Array.isArray(u.operations) && (e.value = u.operations.map((l) => ({\n ...l,\n timestamp: new Date(l.timestamp)\n })), t.value = u.currentIndex ?? -1);\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to load operations from persistence:\", u);\n }\n }\n function m() {\n if (!(typeof window > \"u\"))\n try {\n k.value = {\n operations: e.value.map((u) => ({\n ...u,\n timestamp: u.timestamp.toISOString()\n })),\n currentIndex: t.value\n };\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to save operations to persistence:\", u);\n }\n }\n function y() {\n U(\n [e, t],\n () => {\n o.value.enablePersistence && m();\n },\n { deep: !0 }\n );\n }\n return {\n // State\n operations: e,\n currentIndex: t,\n config: o,\n clientId: r,\n undoRedoState: S,\n // Computed\n canUndo: a,\n canRedo: c,\n undoCount: d,\n redoCount: h,\n // Methods\n configure: $,\n addOperation: D,\n startBatch: x,\n commitBatch: F,\n cancelBatch: R,\n undo: O,\n redo: b,\n clear: A,\n getOperationsFor: C,\n getSnapshot: w,\n markIrreversible: M,\n logAction: W\n };\n});\nclass ee {\n /**\n * The root FieldTriggerEngine instance\n */\n static _root;\n options;\n doctypeActions = /* @__PURE__ */ new Map();\n // doctype -> action/field -> functions\n doctypeTransitions = /* @__PURE__ */ new Map();\n // doctype -> transition -> functions\n fieldRollbackConfig = /* @__PURE__ */ new Map();\n // doctype -> field -> rollback enabled\n globalActions = /* @__PURE__ */ new Map();\n // action name -> function\n globalTransitionActions = /* @__PURE__ */ new Map();\n // transition action name -> function\n /**\n * Creates a new FieldTriggerEngine instance (singleton pattern)\n * @param options - Configuration options for the field trigger engine\n */\n constructor(e = {}) {\n if (ee._root)\n return ee._root;\n ee._root = this, this.options = {\n defaultTimeout: e.defaultTimeout ?? 5e3,\n debug: e.debug ?? !1,\n enableRollback: e.enableRollback ?? !0,\n errorHandler: e.errorHandler\n };\n }\n /**\n * Register a global action function\n * @param name - The name of the action\n * @param fn - The action function\n */\n registerAction(e, t) {\n this.globalActions.set(e, t);\n }\n /**\n * Register a global XState transition action function\n * @param name - The name of the transition action\n * @param fn - The transition action function\n */\n registerTransitionAction(e, t) {\n this.globalTransitionActions.set(e, t);\n }\n /**\n * Configure rollback behavior for a specific field trigger\n * @param doctype - The doctype name\n * @param fieldname - The field name\n * @param enableRollback - Whether to enable rollback\n */\n setFieldRollback(e, t, r) {\n this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(t, r);\n }\n /**\n * Get rollback configuration for a specific field trigger\n */\n getFieldRollback(e, t) {\n return this.fieldRollbackConfig.get(e)?.get(t);\n }\n /**\n * Register actions from a doctype - both regular actions and field triggers\n * Separates XState transitions (uppercase) from field triggers (lowercase)\n * @param doctype - The doctype name\n * @param actions - The actions to register (supports Immutable Map, Map, or plain object)\n */\n registerDoctypeActions(e, t) {\n if (!t) return;\n const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();\n if (typeof t.entrySeq == \"function\")\n t.entrySeq().forEach(([i, s]) => {\n this.categorizeAction(i, s, r, n);\n });\n else if (t instanceof Map)\n for (const [i, s] of t)\n this.categorizeAction(i, s, r, n);\n else t && typeof t == \"object\" && Object.entries(t).forEach(([i, s]) => {\n this.categorizeAction(i, s, r, n);\n });\n this.doctypeActions.set(e, r), this.doctypeTransitions.set(e, n);\n }\n /**\n * Categorize an action as either a field trigger or XState transition\n * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger\n */\n categorizeAction(e, t, r, n) {\n this.isTransitionKey(e) ? n.set(e, t) : r.set(e, t);\n }\n /**\n * Determine if a key represents an XState transition\n * Transitions are identified by being all uppercase\n */\n isTransitionKey(e) {\n return /^[A-Z0-9_]+$/.test(e) && e.length > 0;\n }\n /**\n * Execute field triggers for a changed field\n * @param context - The field change context\n * @param options - Execution options (timeout and enableRollback)\n */\n async executeFieldTriggers(e, t = {}) {\n const { doctype: r, fieldname: n } = e, i = this.findFieldTriggers(r, n);\n if (i.length === 0)\n return {\n path: e.path,\n actionResults: [],\n totalExecutionTime: 0,\n allSucceeded: !0,\n stoppedOnError: !1,\n rolledBack: !1\n };\n const s = performance.now(), a = [];\n let c = !1, d = !1, h;\n const S = this.getFieldRollback(r, n), $ = t.enableRollback ?? S ?? this.options.enableRollback;\n $ && e.store && (h = this.captureSnapshot(e));\n for (const R of i)\n try {\n const O = await this.executeAction(R, e, t.timeout);\n if (a.push(O), !O.success) {\n c = !0;\n break;\n }\n } catch (O) {\n const g = {\n success: !1,\n error: O instanceof Error ? O : new Error(String(O)),\n executionTime: 0,\n action: R\n };\n a.push(g), c = !0;\n break;\n }\n if ($ && c && h && e.store)\n try {\n this.restoreSnapshot(e, h), d = !0;\n } catch (R) {\n console.error(\"[FieldTriggers] Rollback failed:\", R);\n }\n const D = performance.now() - s, x = a.filter((R) => !R.success);\n if (x.length > 0 && this.options.errorHandler)\n for (const R of x)\n try {\n this.options.errorHandler(R.error, e, R.action);\n } catch (O) {\n console.error(\"[FieldTriggers] Error in global error handler:\", O);\n }\n return {\n path: e.path,\n actionResults: a,\n totalExecutionTime: D,\n allSucceeded: a.every((R) => R.success),\n stoppedOnError: c,\n rolledBack: d,\n snapshot: this.options.debug && $ ? h : void 0\n // Only include snapshot in debug mode if rollback is enabled\n };\n }\n /**\n * Execute XState transition actions\n * Similar to field triggers but specifically for FSM state transitions\n * @param context - The transition change context\n * @param options - Execution options (timeout)\n */\n async executeTransitionActions(e, t = {}) {\n const { doctype: r, transition: n } = e, i = this.findTransitionActions(r, n);\n if (i.length === 0)\n return [];\n const s = [];\n for (const c of i)\n try {\n const d = await this.executeTransitionAction(c, e, t.timeout);\n if (s.push(d), !d.success)\n break;\n } catch (d) {\n const S = {\n success: !1,\n error: d instanceof Error ? d : new Error(String(d)),\n executionTime: 0,\n action: c,\n transition: n\n };\n s.push(S);\n break;\n }\n const a = s.filter((c) => !c.success);\n if (a.length > 0 && this.options.errorHandler)\n for (const c of a)\n try {\n this.options.errorHandler(c.error, e, c.action);\n } catch (d) {\n console.error(\"[FieldTriggers] Error in global error handler:\", d);\n }\n return s;\n }\n /**\n * Find transition actions for a specific doctype and transition\n */\n findTransitionActions(e, t) {\n const r = this.doctypeTransitions.get(e);\n return r ? r.get(t) || [] : [];\n }\n /**\n * Execute a single transition action by name\n */\n async executeTransitionAction(e, t, r) {\n const n = performance.now(), i = r ?? this.options.defaultTimeout;\n try {\n let s = this.globalTransitionActions.get(e);\n if (!s) {\n const c = this.globalActions.get(e);\n c && (s = c);\n }\n if (!s)\n throw new Error(`Transition action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(s, t, i), {\n success: !0,\n executionTime: performance.now() - n,\n action: e,\n transition: t.transition\n };\n } catch (s) {\n const a = performance.now() - n;\n return {\n success: !1,\n error: s instanceof Error ? s : new Error(String(s)),\n executionTime: a,\n action: e,\n transition: t.transition\n };\n }\n }\n /**\n * Find field triggers for a specific doctype and field\n * Field triggers are identified by keys that look like field paths (contain dots or match field names)\n */\n findFieldTriggers(e, t) {\n const r = this.doctypeActions.get(e);\n if (!r) return [];\n const n = [];\n for (const [i, s] of r)\n this.isFieldTriggerKey(i, t) && n.push(...s);\n return n;\n }\n /**\n * Determine if an action key represents a field trigger\n * Field triggers can be:\n * - Exact field name match: \"emailAddress\"\n * - Wildcard patterns: \"emailAddress.*\", \"*.is_primary\"\n * - Nested field paths: \"address.street\", \"contact.email\"\n */\n isFieldTriggerKey(e, t) {\n return e === t ? !0 : e.includes(\".\") ? this.matchFieldPattern(e, t) : e.includes(\"*\") ? this.matchFieldPattern(e, t) : !1;\n }\n /**\n * Match a field pattern against a field name\n * Supports wildcards (*) for dynamic segments\n */\n matchFieldPattern(e, t) {\n const r = e.split(\".\"), n = t.split(\".\");\n if (r.length !== n.length)\n return !1;\n for (let i = 0; i < r.length; i++) {\n const s = r[i], a = n[i];\n if (s !== \"*\" && s !== a)\n return !1;\n }\n return !0;\n }\n /**\n * Execute a single action by name\n */\n async executeAction(e, t, r) {\n const n = performance.now(), i = r ?? this.options.defaultTimeout;\n try {\n const s = this.globalActions.get(e);\n if (!s)\n throw new Error(`Action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(s, t, i), {\n success: !0,\n executionTime: performance.now() - n,\n action: e\n };\n } catch (s) {\n const a = performance.now() - n;\n return {\n success: !1,\n error: s instanceof Error ? s : new Error(String(s)),\n executionTime: a,\n action: e\n };\n }\n }\n /**\n * Execute a function with timeout\n */\n async executeWithTimeout(e, t, r) {\n return new Promise((n, i) => {\n const s = setTimeout(() => {\n i(new Error(`Action timeout after ${r}ms`));\n }, r);\n Promise.resolve(e(t)).then((a) => {\n clearTimeout(s), n(a);\n }).catch((a) => {\n clearTimeout(s), i(a);\n });\n });\n }\n /**\n * Capture a snapshot of the record state before executing actions\n * This creates a deep copy of the record data for potential rollback\n */\n captureSnapshot(e) {\n if (!(!e.store || !e.doctype || !e.recordId))\n try {\n const t = `${e.doctype}.${e.recordId}`, r = e.store.get(t);\n return !r || typeof r != \"object\" ? void 0 : JSON.parse(JSON.stringify(r));\n } catch (t) {\n this.options.debug && console.warn(\"[FieldTriggers] Failed to capture snapshot:\", t);\n return;\n }\n }\n /**\n * Restore a previously captured snapshot\n * This reverts the record to its state before actions were executed\n */\n restoreSnapshot(e, t) {\n if (!(!e.store || !e.doctype || !e.recordId || !t))\n try {\n const r = `${e.doctype}.${e.recordId}`;\n e.store.set(r, t), this.options.debug && console.log(`[FieldTriggers] Rolled back ${r} to previous state`);\n } catch (r) {\n throw console.error(\"[FieldTriggers] Failed to restore snapshot:\", r), r;\n }\n }\n}\nfunction J(o) {\n return new ee(o);\n}\nfunction ct(o, e) {\n J().registerAction(o, e);\n}\nfunction lt(o, e) {\n J().registerTransitionAction(o, e);\n}\nfunction ut(o, e, t) {\n J().setFieldRollback(o, e, t);\n}\nasync function ft(o, e, t) {\n const r = J(), n = {\n path: t?.path || (t?.recordId ? `${o}.${t.recordId}` : o),\n fieldname: \"\",\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: o,\n recordId: t?.recordId,\n timestamp: /* @__PURE__ */ new Date(),\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n };\n return await r.executeTransitionActions(n);\n}\nfunction dt(o, e) {\n if (o)\n try {\n re().markIrreversible(o, e);\n } catch {\n }\n}\nfunction he() {\n try {\n return re();\n } catch {\n return null;\n }\n}\nclass Y {\n static instance;\n /**\n * Gets the singleton instance of HST\n * @returns The HST singleton instance\n */\n static getInstance() {\n return Y.instance || (Y.instance = new Y()), Y.instance;\n }\n /**\n * Gets the global registry instance\n * @returns The global registry object or undefined if not found\n */\n getRegistry() {\n if (typeof globalThis < \"u\") {\n const e = globalThis.Registry?._root;\n if (e)\n return e;\n }\n if (typeof window < \"u\") {\n const e = window.Registry?._root;\n if (e)\n return e;\n }\n if (typeof global < \"u\" && global) {\n const e = global.Registry?._root;\n if (e)\n return e;\n }\n }\n /**\n * Helper method to get doctype metadata from the registry\n * @param doctype - The name of the doctype to retrieve metadata for\n * @returns The doctype metadata object or undefined if not found\n */\n getDoctypeMeta(e) {\n const t = this.getRegistry();\n if (t && typeof t == \"object\" && \"registry\" in t)\n return t.registry[e];\n }\n}\nclass se {\n target;\n parentPath;\n rootNode;\n doctype;\n parentDoctype;\n hst;\n constructor(e, t, r = \"\", n = null, i) {\n return this.target = e, this.parentPath = r, this.rootNode = n || this, this.doctype = t, this.parentDoctype = i, this.hst = Y.getInstance(), new Proxy(this, {\n get(s, a) {\n if (a in s) return s[a];\n const c = String(a);\n return s.getNode(c);\n },\n set(s, a, c) {\n const d = String(a);\n return s.set(d, c), !0;\n }\n });\n }\n get(e) {\n return this.resolveValue(e);\n }\n // Method to get a tree-wrapped node for navigation\n getNode(e) {\n const t = this.resolvePath(e), r = this.resolveValue(e), n = t.split(\".\");\n let i = this.doctype;\n return this.doctype === \"StonecropStore\" && n.length >= 1 && (i = n[0]), typeof r == \"object\" && r !== null && !this.isPrimitive(r) ? new se(r, i, t, this.rootNode, this.parentDoctype) : new se(r, i, t, this.rootNode, this.parentDoctype);\n }\n set(e, t, r = \"user\") {\n const n = this.resolvePath(e), i = this.has(e) ? this.get(e) : void 0;\n if (r !== \"undo\" && r !== \"redo\") {\n const s = he();\n if (s && typeof s.addOperation == \"function\") {\n const a = n.split(\".\"), c = this.doctype === \"StonecropStore\" && a.length >= 1 ? a[0] : this.doctype, d = a.length >= 2 ? a[1] : void 0, h = a.slice(2).join(\".\") || a[a.length - 1], $ = t === void 0 && i !== void 0 ? \"delete\" : \"set\";\n s.addOperation(\n {\n type: $,\n path: n,\n fieldname: h,\n beforeValue: i,\n afterValue: t,\n doctype: c,\n recordId: d,\n reversible: !0\n // Default to reversible, can be changed by field triggers\n },\n r\n );\n }\n }\n this.updateValue(e, t), this.triggerFieldActions(n, i, t);\n }\n has(e) {\n try {\n if (e === \"\")\n return !0;\n const t = this.parsePath(e);\n let r = this.target;\n for (let n = 0; n < t.length; n++) {\n const i = t[n];\n if (r == null)\n return !1;\n if (n === t.length - 1)\n return this.isImmutable(r) ? r.has(i) : this.isPiniaStore(r) && r.$state && i in r.$state || i in r;\n r = this.getProperty(r, i);\n }\n return !1;\n } catch {\n return !1;\n }\n }\n // Tree navigation methods\n getParent() {\n if (!this.parentPath) return null;\n const t = this.parentPath.split(\".\").slice(0, -1).join(\".\");\n return t === \"\" ? this.rootNode : this.rootNode.getNode(t);\n }\n getRoot() {\n return this.rootNode;\n }\n getPath() {\n return this.parentPath;\n }\n getDepth() {\n return this.parentPath ? this.parentPath.split(\".\").length : 0;\n }\n getBreadcrumbs() {\n return this.parentPath ? this.parentPath.split(\".\") : [];\n }\n /**\n * Trigger an XState transition with optional context data\n */\n async triggerTransition(e, t) {\n const r = J(), n = this.parentPath.split(\".\");\n let i = this.doctype, s;\n this.doctype === \"StonecropStore\" && n.length >= 1 && (i = n[0]), n.length >= 2 && (s = n[1]);\n const a = {\n path: this.parentPath,\n fieldname: \"\",\n // No specific field for transitions\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: i,\n recordId: s,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0,\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }, c = he();\n return c && typeof c.addOperation == \"function\" && c.addOperation(\n {\n type: \"transition\",\n path: this.parentPath,\n fieldname: e,\n beforeValue: t?.currentState,\n afterValue: t?.targetState,\n doctype: i,\n recordId: s,\n reversible: !1,\n // FSM transitions are generally not reversible\n metadata: {\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }\n },\n \"user\"\n ), await r.executeTransitionActions(a);\n }\n // Private helper methods\n resolvePath(e) {\n return e === \"\" ? this.parentPath : this.parentPath ? `${this.parentPath}.${e}` : e;\n }\n resolveValue(e) {\n if (e === \"\")\n return this.target;\n const t = this.parsePath(e);\n let r = this.target;\n for (const n of t) {\n if (r == null)\n return;\n r = this.getProperty(r, n);\n }\n return r;\n }\n updateValue(e, t) {\n if (e === \"\")\n throw new Error(\"Cannot set value on empty path\");\n const r = this.parsePath(e), n = r.pop();\n let i = this.target;\n for (const s of r)\n if (i = this.getProperty(i, s), i == null)\n throw new Error(`Cannot set property on null/undefined path: ${e}`);\n this.setProperty(i, n, t);\n }\n getProperty(e, t) {\n return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];\n }\n setProperty(e, t, r) {\n if (this.isImmutable(e))\n throw new Error(\"Cannot directly mutate immutable objects. Use immutable update methods instead.\");\n if (this.isPiniaStore(e)) {\n e.$patch ? e.$patch({ [t]: r }) : e[t] = r;\n return;\n }\n e[t] = r;\n }\n async triggerFieldActions(e, t, r) {\n try {\n if (!e || typeof e != \"string\" || Object.is(t, r))\n return;\n const n = e.split(\".\");\n if (n.length < 3)\n return;\n const i = J(), s = n.slice(2).join(\".\") || n[n.length - 1];\n let a = this.doctype;\n this.doctype === \"StonecropStore\" && n.length >= 1 && (a = n[0]);\n let c;\n n.length >= 2 && (c = n[1]);\n const d = {\n path: e,\n fieldname: s,\n beforeValue: t,\n afterValue: r,\n operation: \"set\",\n doctype: a,\n recordId: c,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0\n // Pass the root store for snapshot/rollback capabilities\n };\n await i.executeFieldTriggers(d);\n } catch (n) {\n n instanceof Error && console.warn(\"Field trigger error:\", n.message);\n }\n }\n isVueReactive(e) {\n return e && typeof e == \"object\" && \"__v_isReactive\" in e && e.__v_isReactive === !0;\n }\n isPiniaStore(e) {\n return e && typeof e == \"object\" && (\"$state\" in e || \"$patch\" in e || \"$id\" in e);\n }\n isImmutable(e) {\n if (!e || typeof e != \"object\")\n return !1;\n const t = \"get\" in e && typeof e.get == \"function\", r = \"set\" in e && typeof e.set == \"function\", n = \"has\" in e && typeof e.has == \"function\", i = \"__ownerID\" in e || \"_map\" in e || \"_list\" in e || \"_origin\" in e || \"_capacity\" in e || \"_defaultValues\" in e || \"_tail\" in e || \"_root\" in e || \"size\" in e && t && r;\n let s;\n try {\n const c = e;\n if (\"constructor\" in c && c.constructor && typeof c.constructor == \"object\" && \"name\" in c.constructor) {\n const d = c.constructor.name;\n s = typeof d == \"string\" ? d : void 0;\n }\n } catch {\n s = void 0;\n }\n const a = s && (s.includes(\"Map\") || s.includes(\"List\") || s.includes(\"Set\") || s.includes(\"Stack\") || s.includes(\"Seq\")) && (t || r);\n return !!(t && r && n && i || t && r && a);\n }\n isPrimitive(e) {\n return e == null || typeof e == \"string\" || typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"function\" || typeof e == \"symbol\" || typeof e == \"bigint\";\n }\n /**\n * Parse a path string into segments, handling both dot notation and array bracket notation\n * @param path - The path string to parse (e.g., \"order.456.line_items[0].product\")\n * @returns Array of path segments (e.g., ['order', '456', 'line_items', '0', 'product'])\n */\n parsePath(e) {\n return e ? e.replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter((r) => r.length > 0) : [];\n }\n}\nfunction et(o, e, t) {\n return new se(o, e, \"\", null, t);\n}\nclass Oe {\n hstStore;\n _operationLogStore;\n _operationLogConfig;\n /** The registry instance containing all doctype definitions */\n registry;\n /**\n * Creates a new Stonecrop instance with HST integration\n * @param registry - The Registry instance containing doctype definitions\n * @param operationLogConfig - Optional configuration for the operation log\n */\n constructor(e, t) {\n this.registry = e, this._operationLogConfig = t, this.initializeHSTStore(), this.setupRegistrySync();\n }\n /**\n * Get the operation log store (lazy initialization)\n * @internal\n */\n getOperationLogStore() {\n return this._operationLogStore || (this._operationLogStore = re(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;\n }\n /**\n * Initialize the HST store structure\n */\n initializeHSTStore() {\n const e = {};\n Object.keys(this.registry.registry).forEach((t) => {\n e[t] = {};\n }), this.hstStore = et(ue(e), \"StonecropStore\");\n }\n /**\n * Setup automatic sync with Registry when doctypes are added\n */\n setupRegistrySync() {\n const e = this.registry.addDoctype.bind(this.registry);\n this.registry.addDoctype = (t) => {\n e(t), this.hstStore.has(t.slug) || this.hstStore.set(t.slug, {});\n };\n }\n /**\n * Get records hash for a doctype\n * @param doctype - The doctype to get records for\n * @returns HST node containing records hash\n */\n records(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n return this.ensureDoctypeExists(t), this.hstStore.getNode(t);\n }\n /**\n * Add a record to the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @param recordData - The record data\n */\n addRecord(e, t, r) {\n const n = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(n), this.hstStore.set(`${n}.${t}`, r);\n }\n /**\n * Get a specific record\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @returns HST node for the record or undefined\n */\n getRecordById(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n if (this.ensureDoctypeExists(r), !(!this.hstStore.has(`${r}.${t}`) || this.hstStore.get(`${r}.${t}`) === void 0))\n return this.hstStore.getNode(`${r}.${t}`);\n }\n /**\n * Remove a record from the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n removeRecord(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(r), this.hstStore.has(`${r}.${t}`) && this.hstStore.set(`${r}.${t}`, void 0);\n }\n /**\n * Get all record IDs for a doctype\n * @param doctype - The doctype\n * @returns Array of record IDs\n */\n getRecordIds(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t);\n const r = this.hstStore.get(t);\n return !r || typeof r != \"object\" ? [] : Object.keys(r).filter((n) => r[n] !== void 0);\n }\n /**\n * Clear all records for a doctype\n * @param doctype - The doctype\n */\n clearRecords(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((n) => {\n this.hstStore.set(`${t}.${n}`, void 0);\n });\n }\n /**\n * Setup method for doctype initialization\n * @param doctype - The doctype to setup\n */\n setup(e) {\n this.ensureDoctypeExists(e.slug);\n }\n /**\n * Run action on doctype\n * Executes the action and logs it to the operation log for audit tracking\n * @param doctype - The doctype\n * @param action - The action to run\n * @param args - Action arguments (typically record IDs)\n */\n runAction(e, t, r) {\n const i = this.registry.registry[e.slug]?.actions?.get(t), s = Array.isArray(r) ? r.filter((h) => typeof h == \"string\") : void 0, a = this.getOperationLogStore();\n let c = \"success\", d;\n try {\n i && i.length > 0 && i.forEach((h) => {\n try {\n new Function(\"args\", h)(r);\n } catch (S) {\n throw c = \"failure\", d = S instanceof Error ? S.message : \"Unknown error\", S;\n }\n });\n } catch {\n } finally {\n a.logAction(e.doctype, t, s, c, d);\n }\n }\n /**\n * Get records from server (maintains compatibility)\n * @param doctype - The doctype\n */\n async getRecords(e) {\n (await (await fetch(`/${e.slug}`)).json()).forEach((n) => {\n n.id && this.addRecord(e, n.id, n);\n });\n }\n /**\n * Get single record from server (maintains compatibility)\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n async getRecord(e, t) {\n const n = await (await fetch(`/${e.slug}/${t}`)).json();\n this.addRecord(e, t, n);\n }\n /**\n * Ensure doctype section exists in HST store\n * @param slug - The doctype slug\n */\n ensureDoctypeExists(e) {\n this.hstStore.has(e) || this.hstStore.set(e, {});\n }\n /**\n * Get doctype metadata from the registry\n * @param context - The route context\n * @returns The doctype metadata\n */\n async getMeta(e) {\n if (!this.registry.getMeta)\n throw new Error(\"No getMeta function provided to Registry\");\n return await this.registry.getMeta(e);\n }\n /**\n * Get the root HST store node for advanced usage\n * @returns Root HST node\n */\n getStore() {\n return this.hstStore;\n }\n /**\n * Determine the current workflow state for a record.\n *\n * Reads the record's `status` field from the HST store. If the field is absent or\n * empty the doctype's declared `workflow.initial` state is used as the fallback,\n * giving callers a reliable state name without having to duplicate that logic.\n *\n * @param doctype - The doctype slug or DoctypeMeta instance\n * @param recordId - The record identifier\n * @returns The current state name, or an empty string if the doctype has no workflow\n *\n * @public\n */\n getRecordState(e, t) {\n const r = typeof e == \"string\" ? e : e.slug, n = this.registry.getDoctype(r);\n if (!n?.workflow) return \"\";\n const s = this.getRecordById(r, t)?.get(\"status\"), a = typeof n.workflow.initial == \"string\" ? n.workflow.initial : Object.keys(n.workflow.states ?? {})[0] ?? \"\";\n return s || a;\n }\n}\nfunction pt(o) {\n o || (o = {});\n const e = o.registry || fe(\"$registry\"), t = fe(\"$stonecrop\"), r = L(), n = L(), i = L({}), s = L(), a = L(), c = L([]);\n if (o.doctype && e) {\n const p = o.doctype.schema ? Array.isArray(o.doctype.schema) ? o.doctype.schema : Array.from(o.doctype.schema) : [];\n c.value = e.resolveSchema(p);\n }\n const d = L([]), h = L(-1), S = B(() => r.value?.getOperationLogStore().canUndo ?? !1), $ = B(() => r.value?.getOperationLogStore().canRedo ?? !1), D = B(() => r.value?.getOperationLogStore().undoCount ?? 0), x = B(() => r.value?.getOperationLogStore().redoCount ?? 0), F = B(\n () => r.value?.getOperationLogStore().undoRedoState ?? {\n canUndo: !1,\n canRedo: !1,\n undoCount: 0,\n redoCount: 0,\n currentIndex: -1\n }\n ), R = (p) => r.value?.getOperationLogStore().undo(p) ?? !1, O = (p) => r.value?.getOperationLogStore().redo(p) ?? !1, b = () => {\n r.value?.getOperationLogStore().startBatch();\n }, g = (p) => r.value?.getOperationLogStore().commitBatch(p) ?? null, E = () => {\n r.value?.getOperationLogStore().cancelBatch();\n }, w = () => {\n r.value?.getOperationLogStore().clear();\n }, A = (p, m) => r.value?.getOperationLogStore().getOperationsFor(p, m) ?? [], C = () => r.value?.getOperationLogStore().getSnapshot() ?? {\n operations: [],\n currentIndex: -1,\n totalOperations: 0,\n reversibleOperations: 0,\n irreversibleOperations: 0\n }, M = (p, m) => {\n r.value?.getOperationLogStore().markIrreversible(p, m);\n }, W = (p, m, y, u = \"success\", l) => r.value?.getOperationLogStore().logAction(p, m, y, u, l) ?? \"\", N = (p) => {\n r.value?.getOperationLogStore().configure(p);\n };\n me(async () => {\n if (e) {\n r.value = t || new Oe(e);\n try {\n const p = r.value.getOperationLogStore(), m = be(p);\n d.value = m.operations.value, h.value = m.currentIndex.value, U(\n () => m.operations.value,\n (y) => {\n d.value = y;\n }\n ), U(\n () => m.currentIndex.value,\n (y) => {\n h.value = y;\n }\n );\n } catch {\n }\n if (!o.doctype && e.router) {\n const p = e.router.currentRoute.value;\n if (!p.path) return;\n const m = p.path.split(\"/\").filter((u) => u.length > 0), y = m[1]?.toLowerCase();\n if (m.length > 0) {\n const u = {\n path: p.path,\n segments: m\n }, l = await e.getMeta?.(u);\n if (l) {\n if (e.addDoctype(l), r.value.setup(l), s.value = l, a.value = y, n.value = r.value.getStore(), e) {\n const f = l.schema ? Array.isArray(l.schema) ? l.schema : Array.from(l.schema) : [];\n c.value = e.resolveSchema(f);\n }\n if (y && y !== \"new\") {\n const f = r.value.getRecordById(l, y);\n if (f)\n i.value = f.get(\"\") || {};\n else\n try {\n await r.value.getRecord(l, y);\n const T = r.value.getRecordById(l, y);\n T && (i.value = T.get(\"\") || {});\n } catch {\n i.value = z(l);\n }\n } else\n i.value = z(l);\n n.value && ve(l, y || \"new\", i, n.value), r.value.runAction(l, \"load\", y ? [y] : void 0);\n }\n }\n }\n if (o.doctype) {\n n.value = r.value.getStore();\n const p = o.doctype, m = o.recordId;\n if (m && m !== \"new\") {\n const y = r.value.getRecordById(p, m);\n if (y)\n i.value = y.get(\"\") || {};\n else\n try {\n await r.value.getRecord(p, m);\n const u = r.value.getRecordById(p, m);\n u && (i.value = u.get(\"\") || {});\n } catch {\n i.value = z(p);\n }\n } else\n i.value = z(p);\n n.value && ve(p, m || \"new\", i, n.value);\n }\n }\n });\n const q = (p, m) => {\n const y = o.doctype || s.value;\n if (!y) return \"\";\n const u = m || o.recordId || a.value || \"new\";\n return `${y.slug}.${u}.${p}`;\n }, _ = (p) => {\n const m = o.doctype || s.value;\n if (!(!n.value || !r.value || !m))\n try {\n const y = p.path.split(\".\");\n if (y.length >= 2) {\n const f = y[0], T = y[1];\n if (n.value.has(`${f}.${T}`) || r.value.addRecord(m, T, { ...i.value }), y.length > 3) {\n const V = `${f}.${T}`, I = y.slice(2);\n let K = V;\n for (let Z = 0; Z < I.length - 1; Z++)\n if (K += `.${I[Z]}`, !n.value.has(K)) {\n const ae = I[Z + 1], Pe = !isNaN(Number(ae));\n n.value.set(K, Pe ? [] : {});\n }\n }\n }\n n.value.set(p.path, p.value);\n const u = p.fieldname.split(\".\"), l = { ...i.value };\n u.length === 1 ? l[u[0]] = p.value : tt(l, u, p.value), i.value = l;\n } catch {\n }\n };\n (o.doctype || e?.router) && (pe(\"hstPathProvider\", q), pe(\"hstChangeHandler\", _));\n const G = (p, m, y) => {\n if (!r.value)\n return z(m);\n if (y)\n try {\n const u = n.value?.get(p);\n return u && typeof u == \"object\" ? u : z(m);\n } catch {\n return z(m);\n }\n return z(m);\n }, v = async (p, m) => {\n if (!n.value || !r.value)\n throw new Error(\"HST store not initialized\");\n const y = `${p.slug}.${m}`, l = { ...n.value.get(y) || {} }, f = p.schema ? Array.isArray(p.schema) ? p.schema : Array.from(p.schema) : [], V = (e ? e.resolveSchema(f) : f).filter(\n (I) => \"fieldtype\" in I && I.fieldtype === \"Doctype\" && \"schema\" in I && Array.isArray(I.schema)\n );\n for (const I of V) {\n const K = I, Z = `${y}.${K.fieldname}`, ae = Te(K.schema, Z, n.value);\n l[K.fieldname] = ae;\n }\n return l;\n }, P = (p, m) => ({\n provideHSTPath: (l) => `${p}.${l}`,\n handleHSTChange: (l) => {\n const f = l.path.startsWith(p) ? l.path : `${p}.${l.fieldname}`;\n _({\n ...l,\n path: f\n });\n }\n }), k = {\n operations: d,\n currentIndex: h,\n undoRedoState: F,\n canUndo: S,\n canRedo: $,\n undoCount: D,\n redoCount: x,\n undo: R,\n redo: O,\n startBatch: b,\n commitBatch: g,\n cancelBatch: E,\n clear: w,\n getOperationsFor: A,\n getSnapshot: C,\n markIrreversible: M,\n logAction: W,\n configure: N\n };\n return o.doctype ? {\n stonecrop: r,\n operationLog: k,\n provideHSTPath: q,\n handleHSTChange: _,\n hstStore: n,\n formData: i,\n resolvedSchema: c,\n loadNestedData: G,\n saveRecursive: v,\n createNestedContext: P\n } : !o.doctype && e?.router ? {\n stonecrop: r,\n operationLog: k,\n provideHSTPath: q,\n handleHSTChange: _,\n hstStore: n,\n formData: i,\n resolvedSchema: c,\n loadNestedData: G,\n saveRecursive: v,\n createNestedContext: P\n } : {\n stonecrop: r,\n operationLog: k\n };\n}\nfunction z(o) {\n const e = {};\n return o.schema && o.schema.forEach((t) => {\n switch (\"fieldtype\" in t ? t.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n e[t.fieldname] = \"\";\n break;\n case \"Check\":\n e[t.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n e[t.fieldname] = 0;\n break;\n case \"Table\":\n e[t.fieldname] = [];\n break;\n case \"JSON\":\n e[t.fieldname] = {};\n break;\n default:\n e[t.fieldname] = null;\n }\n }), e;\n}\nfunction ve(o, e, t, r) {\n U(\n t,\n (n) => {\n const i = `${o.slug}.${e}`;\n Object.keys(n).forEach((s) => {\n const a = `${i}.${s}`;\n try {\n r.set(a, n[s]);\n } catch {\n }\n });\n },\n { deep: !0 }\n );\n}\nfunction tt(o, e, t) {\n let r = o;\n for (let i = 0; i < e.length - 1; i++) {\n const s = e[i];\n (!(s in r) || typeof r[s] != \"object\") && (r[s] = isNaN(Number(e[i + 1])) ? {} : []), r = r[s];\n }\n const n = e[e.length - 1];\n r[n] = t;\n}\nfunction Te(o, e, t) {\n const n = { ...t.get(e) || {} }, i = o.filter(\n (s) => \"fieldtype\" in s && s.fieldtype === \"Doctype\" && \"schema\" in s && Array.isArray(s.schema)\n );\n for (const s of i) {\n const a = s, c = `${e}.${a.fieldname}`, d = Te(a.schema, c, t);\n n[a.fieldname] = d;\n }\n return n;\n}\nfunction $e(o) {\n const t = (Se() ? fe(\"$operationLogStore\", void 0) : void 0) || re();\n o && t.configure(o);\n const { operations: r, currentIndex: n, undoRedoState: i, canUndo: s, canRedo: a, undoCount: c, redoCount: d } = be(t);\n function h(w) {\n return t.undo(w);\n }\n function S(w) {\n return t.redo(w);\n }\n function $() {\n t.startBatch();\n }\n function D(w) {\n return t.commitBatch(w);\n }\n function x() {\n t.cancelBatch();\n }\n function F() {\n t.clear();\n }\n function R(w, A) {\n return t.getOperationsFor(w, A);\n }\n function O() {\n return t.getSnapshot();\n }\n function b(w, A) {\n t.markIrreversible(w, A);\n }\n function g(w, A, C, M = \"success\", W) {\n return t.logAction(w, A, C, M, W);\n }\n function E(w) {\n t.configure(w);\n }\n return {\n // State\n operations: r,\n currentIndex: n,\n undoRedoState: i,\n canUndo: s,\n canRedo: a,\n undoCount: c,\n redoCount: d,\n // Methods\n undo: h,\n redo: S,\n startBatch: $,\n commitBatch: D,\n cancelBatch: x,\n clear: F,\n getOperationsFor: R,\n getSnapshot: O,\n markIrreversible: b,\n logAction: g,\n configure: E\n };\n}\nfunction gt(o, e = !0) {\n if (!e) return;\n const { undo: t, redo: r, canUndo: n, canRedo: i } = $e(), s = Ye();\n X(s[\"Ctrl+Z\"], () => {\n n.value && t(o);\n }), X(s[\"Meta+Z\"], () => {\n n.value && t(o);\n }), X(s[\"Ctrl+Shift+Z\"], () => {\n i.value && r(o);\n }), X(s[\"Meta+Shift+Z\"], () => {\n i.value && r(o);\n }), X(s[\"Ctrl+Y\"], () => {\n i.value && r(o);\n });\n}\nasync function ht(o, e) {\n const { startBatch: t, commitBatch: r, cancelBatch: n } = $e();\n t();\n try {\n return await o(), r(e);\n } catch (i) {\n throw n(), i;\n }\n}\nclass vt {\n /**\n * The doctype name\n * @public\n * @readonly\n */\n doctype;\n /**\n * The doctype schema\n * @public\n * @readonly\n */\n schema;\n /**\n * The doctype workflow\n * @public\n * @readonly\n */\n workflow;\n /**\n * The doctype actions and field triggers\n * @public\n * @readonly\n */\n actions;\n /**\n * The doctype component\n * @public\n * @readonly\n */\n component;\n /**\n * Creates a new DoctypeMeta instance\n * @param doctype - The doctype name\n * @param schema - The doctype schema definition\n * @param workflow - The doctype workflow configuration (XState machine)\n * @param actions - The doctype actions and field triggers\n * @param component - Optional Vue component for rendering the doctype\n */\n constructor(e, t, r, n, i) {\n this.doctype = e, this.schema = t, this.workflow = r, this.actions = n, this.component = i;\n }\n /**\n * Returns the transitions available from a given workflow state, derived from the\n * doctype's XState workflow configuration.\n *\n * @param currentState - The state name to read transitions from\n * @returns Array of transition descriptors with `name` and `targetState`\n *\n * @example\n * ```ts\n * const transitions = doctype.getAvailableTransitions('draft')\n * // [{ name: 'SUBMIT', targetState: 'submitted' }]\n * ```\n *\n * @public\n */\n getAvailableTransitions(e) {\n const t = this.workflow?.states;\n if (!t) return [];\n const r = t[e];\n return r?.on ? Object.entries(r.on).map(([n, i]) => ({\n name: n,\n targetState: typeof i == \"string\" ? i : \"unknown\"\n })) : [];\n }\n /**\n * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n * - It replaces camelCase and PascalCase with kebab-case strings\n * - It replaces spaces and underscores with hyphens\n * - It converts the string to lowercase\n *\n * @returns The slugified doctype string\n *\n * @example\n * ```ts\n * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n * console.log(doctype.slug) // 'task-item'\n * ```\n *\n * @public\n */\n get slug() {\n return this.doctype.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[\\s_]+/g, \"-\").toLowerCase();\n }\n}\nclass te {\n /**\n * The root Registry instance\n */\n static _root;\n /**\n * The name of the Registry instance\n *\n * @defaultValue 'Registry'\n */\n name;\n /**\n * The registry property contains a collection of doctypes\n * @see {@link DoctypeMeta}\n */\n registry;\n /**\n * The Vue router instance\n * @see {@link https://router.vuejs.org/}\n */\n router;\n /**\n * Creates a new Registry instance (singleton pattern)\n * @param router - Optional Vue router instance for route management\n * @param getMeta - Optional function to fetch doctype metadata from an API\n */\n constructor(e, t) {\n if (te._root)\n return te._root;\n te._root = this, this.name = \"Registry\", this.registry = {}, this.router = e, this.getMeta = t;\n }\n /**\n * The getMeta function fetches doctype metadata from an API based on route context\n * @see {@link DoctypeMeta}\n */\n getMeta;\n /**\n * Get doctype metadata\n * @param doctype - The doctype to fetch metadata for\n * @returns The doctype metadata\n * @see {@link DoctypeMeta}\n */\n addDoctype(e) {\n e.slug in this.registry || (this.registry[e.slug] = e);\n const t = J();\n t.registerDoctypeActions(e.doctype, e.actions), e.slug !== e.doctype && t.registerDoctypeActions(e.slug, e.actions), e.component && this.router && !this.router.hasRoute(e.doctype) && this.router.addRoute({\n path: `/${e.slug}`,\n name: e.slug,\n component: e.component\n });\n }\n /**\n * Resolve nested Doctype and Table fields in a schema by embedding child schemas inline.\n *\n * @remarks\n * Walks the schema array and for each field with `fieldtype: 'Doctype'` and a string\n * `options` value, looks up the referenced doctype in the registry and embeds its schema\n * as the field's `schema` property. Recurses for deeply nested doctypes.\n *\n * For fields with `fieldtype: 'Table'`, looks up the referenced child doctype and\n * auto-derives `columns` from its schema fields (unless columns are already provided).\n * Also sets sensible defaults for `component` (`'ATable'`) and `config` (`{ view: 'list' }`).\n * Row data is expected to come from the parent form's data model at `data[fieldname]`.\n *\n * Returns a new array โ does not mutate the original schema.\n *\n * @param schema - The schema array to resolve\n * @returns A new schema array with nested Doctype fields resolved\n *\n * @example\n * ```ts\n * registry.addDoctype(addressDoctype)\n * registry.addDoctype(customerDoctype)\n *\n * // Before: customer schema has { fieldname: 'address', fieldtype: 'Doctype', options: 'address' }\n * const resolved = registry.resolveSchema(customerSchema)\n * // After: address field now has schema: [...address fields...]\n * ```\n *\n * @public\n */\n resolveSchema(e, t) {\n const r = t || /* @__PURE__ */ new Set();\n return e.map((n) => {\n if (\"fieldtype\" in n && n.fieldtype === \"Doctype\" && \"options\" in n && typeof n.options == \"string\") {\n const i = n.options;\n if (r.has(i))\n return { ...n };\n const s = this.registry[i];\n if (s && s.schema) {\n const a = Array.isArray(s.schema) ? s.schema : Array.from(s.schema);\n r.add(i);\n const c = this.resolveSchema(a, r);\n return r.delete(i), { ...n, schema: c };\n }\n }\n if (\"fieldtype\" in n && n.fieldtype === \"Table\" && \"options\" in n && typeof n.options == \"string\") {\n const i = n.options;\n if (r.has(i))\n return { ...n };\n const s = this.registry[i];\n if (s && s.schema) {\n const a = Array.isArray(s.schema) ? s.schema : Array.from(s.schema), c = { ...n };\n return (!(\"columns\" in n) || !n.columns) && (c.columns = a.map((d) => ({\n name: d.fieldname,\n fieldname: d.fieldname,\n label: \"label\" in d && d.label || d.fieldname,\n fieldtype: \"fieldtype\" in d ? d.fieldtype : \"Data\",\n align: \"align\" in d && d.align || \"left\",\n edit: \"edit\" in d ? d.edit : !0,\n width: \"width\" in d && d.width || \"20ch\"\n }))), c.component || (c.component = \"ATable\"), (!(\"config\" in n) || !n.config) && (c.config = { view: \"list\" }), (!(\"rows\" in n) || !n.rows) && (c.rows = []), c;\n }\n }\n return { ...n };\n });\n }\n /**\n * Initialize a new record with default values based on a schema.\n *\n * @remarks\n * Creates a plain object with keys from the schema's fieldnames and default values\n * derived from each field's `fieldtype`:\n * - Data, Text โ `''`\n * - Check โ `false`\n * - Int, Float, Decimal, Currency, Quantity โ `0`\n * - Table โ `[]`\n * - JSON, Doctype โ `{}`\n * - All others โ `null`\n *\n * For Doctype fields with a resolved `schema` array, recursively initializes the nested record.\n *\n * @param schema - The schema array to derive defaults from\n * @returns A plain object with default values for each field\n *\n * @example\n * ```ts\n * const defaults = registry.initializeRecord(addressSchema)\n * // { street: '', city: '', state: '', zip_code: '' }\n * ```\n *\n * @public\n */\n initializeRecord(e) {\n const t = {};\n return e.forEach((r) => {\n switch (\"fieldtype\" in r ? r.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n case \"Code\":\n t[r.fieldname] = \"\";\n break;\n case \"Check\":\n t[r.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n case \"Decimal\":\n case \"Currency\":\n case \"Quantity\":\n t[r.fieldname] = 0;\n break;\n case \"Table\":\n t[r.fieldname] = [];\n break;\n case \"JSON\":\n t[r.fieldname] = {};\n break;\n case \"Doctype\":\n \"schema\" in r && Array.isArray(r.schema) ? t[r.fieldname] = this.initializeRecord(r.schema) : t[r.fieldname] = {};\n break;\n default:\n t[r.fieldname] = null;\n }\n }), t;\n }\n /**\n * Get a registered doctype by slug\n * @param slug - The doctype slug to look up\n * @returns The DoctypeMeta instance if found, or undefined\n * @public\n */\n getDoctype(e) {\n return this.registry[e];\n }\n // TODO: should we allow clearing the registry at all?\n // clear() {\n // \tthis.registry = {}\n // \tif (this.router) {\n // \t\tconst routes = this.router.getRoutes()\n // \t\tfor (const route of routes) {\n // \t\t\tif (route.name) {\n // \t\t\t\tthis.router.removeRoute(route.name)\n // \t\t\t}\n // \t\t}\n // \t}\n // }\n}\nasync function rt(o, e, t) {\n await de();\n try {\n await t(o, e);\n } catch {\n }\n}\nconst mt = {\n install: (o, e) => {\n const t = o.config.globalProperties.$router, r = e?.router, n = t || r;\n !t && r && o.use(r);\n const i = new te(n, e?.getMeta);\n o.provide(\"$registry\", i), o.config.globalProperties.$registry = i;\n const s = new Oe(i);\n o.provide(\"$stonecrop\", s), o.config.globalProperties.$stonecrop = s;\n try {\n const a = o.config.globalProperties.$pinia;\n if (a) {\n const c = re(a);\n o.provide(\"$operationLogStore\", c), o.config.globalProperties.$operationLogStore = c;\n }\n } catch (a) {\n console.warn(\"Pinia not available - operation log features will be disabled:\", a);\n }\n if (e?.components)\n for (const [a, c] of Object.entries(e.components))\n o.component(a, c);\n e?.autoInitializeRouter && e.onRouterInitialized && rt(i, s, e.onRouterInitialized);\n }\n};\nvar nt = /* @__PURE__ */ ((o) => (o.ERROR = \"error\", o.WARNING = \"warning\", o.INFO = \"info\", o))(nt || {});\nclass ot {\n options;\n /**\n * Creates a new SchemaValidator instance\n * @param options - Validator configuration options\n */\n constructor(e = {}) {\n this.options = {\n registry: e.registry || null,\n validateLinkTargets: e.validateLinkTargets ?? !0,\n validateActions: e.validateActions ?? !0,\n validateWorkflows: e.validateWorkflows ?? !0,\n validateRequiredProperties: e.validateRequiredProperties ?? !0\n };\n }\n /**\n * Validates a complete doctype schema\n * @param doctype - Doctype name\n * @param schema - Schema fields (List or Array)\n * @param workflow - Optional workflow configuration\n * @param actions - Optional actions map\n * @returns Validation result\n */\n validate(e, t, r, n) {\n const i = [], s = t ? Array.isArray(t) ? t : t.toArray() : [];\n if (this.options.validateRequiredProperties && i.push(...this.validateRequiredProperties(e, s)), this.options.validateLinkTargets && this.options.registry && i.push(...this.validateLinkFields(e, s, this.options.registry)), this.options.validateWorkflows && r && i.push(...this.validateWorkflow(e, r)), this.options.validateActions && n) {\n const h = n instanceof Map ? n : n.toObject();\n i.push(...this.validateActionRegistration(e, h));\n }\n const a = i.filter(\n (h) => h.severity === \"error\"\n /* ERROR */\n ).length, c = i.filter(\n (h) => h.severity === \"warning\"\n /* WARNING */\n ).length, d = i.filter(\n (h) => h.severity === \"info\"\n /* INFO */\n ).length;\n return {\n valid: a === 0,\n issues: i,\n errorCount: a,\n warningCount: c,\n infoCount: d\n };\n }\n /**\n * Validates that required schema properties are present\n * @internal\n */\n validateRequiredProperties(e, t) {\n const r = [];\n for (const n of t) {\n if (!n.fieldname) {\n r.push({\n severity: \"error\",\n rule: \"required-fieldname\",\n message: \"Field is missing required property: fieldname\",\n doctype: e,\n context: { field: n }\n });\n continue;\n }\n if (!n.component && !(\"fieldtype\" in n) && r.push({\n severity: \"error\",\n rule: \"required-component-or-fieldtype\",\n message: `Field \"${n.fieldname}\" must have either component or fieldtype property`,\n doctype: e,\n fieldname: n.fieldname\n }), \"schema\" in n) {\n const i = n.schema, s = Array.isArray(i) ? i : i.toArray?.() || [];\n r.push(...this.validateRequiredProperties(e, s));\n }\n }\n return r;\n }\n /**\n * Validates Link field targets exist in registry\n * @internal\n */\n validateLinkFields(e, t, r) {\n const n = [];\n for (const i of t) {\n if ((\"fieldtype\" in i ? i.fieldtype : void 0) === \"Link\") {\n const a = \"options\" in i ? i.options : void 0;\n if (!a) {\n n.push({\n severity: \"error\",\n rule: \"link-missing-options\",\n message: `Link field \"${i.fieldname}\" is missing options property (target doctype)`,\n doctype: e,\n fieldname: i.fieldname\n });\n continue;\n }\n const c = typeof a == \"string\" ? a : \"\";\n if (!c) {\n n.push({\n severity: \"error\",\n rule: \"link-invalid-options\",\n message: `Link field \"${i.fieldname}\" has invalid options format (expected string doctype name)`,\n doctype: e,\n fieldname: i.fieldname\n });\n continue;\n }\n r.registry[c] || r.registry[c.toLowerCase()] || n.push({\n severity: \"error\",\n rule: \"link-invalid-target\",\n message: `Link field \"${i.fieldname}\" references non-existent doctype: \"${c}\"`,\n doctype: e,\n fieldname: i.fieldname,\n context: { targetDoctype: c }\n });\n }\n if (\"schema\" in i) {\n const a = i.schema, c = Array.isArray(a) ? a : a.toArray?.() || [];\n n.push(...this.validateLinkFields(e, c, r));\n }\n }\n return n;\n }\n /**\n * Validates workflow state machine configuration\n * @internal\n */\n validateWorkflow(e, t) {\n const r = [];\n if (!t.initial && !t.type && r.push({\n severity: \"warning\",\n rule: \"workflow-missing-initial\",\n message: \"Workflow is missing initial state property\",\n doctype: e\n }), !t.states || Object.keys(t.states).length === 0)\n return r.push({\n severity: \"warning\",\n rule: \"workflow-no-states\",\n message: \"Workflow has no states defined\",\n doctype: e\n }), r;\n t.initial && typeof t.initial == \"string\" && !t.states[t.initial] && r.push({\n severity: \"error\",\n rule: \"workflow-invalid-initial\",\n message: `Workflow initial state \"${t.initial}\" does not exist in states`,\n doctype: e,\n context: { initialState: t.initial }\n });\n const n = Object.keys(t.states), i = /* @__PURE__ */ new Set();\n t.initial && typeof t.initial == \"string\" && i.add(t.initial);\n for (const [s, a] of Object.entries(t.states)) {\n const c = a;\n if (c.on) {\n for (const [d, h] of Object.entries(c.on))\n if (typeof h == \"string\")\n i.add(h);\n else if (h && typeof h == \"object\") {\n const S = \"target\" in h ? h.target : void 0;\n typeof S == \"string\" ? i.add(S) : Array.isArray(S) && S.forEach(($) => {\n typeof $ == \"string\" && i.add($);\n });\n }\n }\n }\n for (const s of n)\n i.has(s) || r.push({\n severity: \"warning\",\n rule: \"workflow-unreachable-state\",\n message: `Workflow state \"${s}\" may not be reachable`,\n doctype: e,\n context: { stateName: s }\n });\n return r;\n }\n /**\n * Validates that actions are registered in the FieldTriggerEngine\n * @internal\n */\n validateActionRegistration(e, t) {\n const r = [], n = J();\n for (const [i, s] of Object.entries(t)) {\n if (!Array.isArray(s)) {\n r.push({\n severity: \"error\",\n rule: \"action-invalid-format\",\n message: `Action configuration for \"${i}\" must be an array`,\n doctype: e,\n context: { triggerName: i, actionNames: s }\n });\n continue;\n }\n for (const a of s) {\n const c = n;\n c.globalActions?.has(a) || c.globalTransitionActions?.has(a) || r.push({\n severity: \"warning\",\n rule: \"action-not-registered\",\n message: `Action \"${a}\" referenced in \"${i}\" is not registered in FieldTriggerEngine`,\n doctype: e,\n context: { triggerName: i, actionName: a }\n });\n }\n }\n return r;\n }\n}\nfunction it(o, e) {\n return new ot({\n registry: o,\n ...e\n });\n}\nfunction yt(o, e, t, r, n) {\n return it(t).validate(o, e, r, n);\n}\nexport {\n vt as DoctypeMeta,\n Y as HST,\n te as Registry,\n ot as SchemaValidator,\n Oe as Stonecrop,\n nt as ValidationSeverity,\n et as createHST,\n it as createValidator,\n mt as default,\n J as getGlobalTriggerEngine,\n dt as markOperationIrreversible,\n ct as registerGlobalAction,\n lt as registerTransitionAction,\n ut as setFieldRollback,\n ft as triggerTransition,\n $e as useOperationLog,\n re as useOperationLogStore,\n pt as useStonecrop,\n gt as useUndoRedoShortcuts,\n yt as validateSchema,\n ht as withBatch\n};\n//# sourceMappingURL=stonecrop.js.map\n","import { defineComponent as oe, useTemplateRef as fe, ref as R, computed as T, openBlock as h, createElementBlock as x, unref as V, normalizeClass as se, normalizeStyle as be, createBlock as me, resolveDynamicComponent as Ue, mergeProps as ft, toDisplayString as N, createElementVNode as w, withModifiers as Ie, withDirectives as K, Fragment as X, renderList as ve, vShow as Ce, createCommentVNode as Y, renderSlot as he, createTextVNode as Dt, onMounted as Ee, watch as ne, onBeforeUnmount as an, nextTick as vt, toValue as E, shallowRef as ue, getCurrentScope as pt, onScopeDispose as mt, reactive as sn, vModelText as we, vModelCheckbox as rn, vModelSelect as Mn, getCurrentInstance as ht, watchEffect as gt, useCssVars as Cn, onUnmounted as En, useModel as Me, createVNode as ct, withCtx as $t, mergeModels as xe, isRef as An, toRefs as $n, customRef as St, toRef as un, readonly as Rt, resolveComponent as cn, withKeys as Ze } from \"vue\";\nimport { defineStore as Tn } from \"pinia\";\nimport './assets/index.css';function dn(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\nconst Dn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Sn = (e) => e != null, Rn = Object.prototype.toString, Ln = (e) => Rn.call(e) === \"[object Object]\", Hn = () => {\n};\nfunction st(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction Vn(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst ze = Dn ? window : void 0;\nfunction We(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction Qe(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = st(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return Vn(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => We(r))) !== null && n !== void 0 ? n : [ze].filter((r) => r != null),\n st(E(o.value ? e[1] : e[0])),\n st(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = Ln(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction _n() {\n const e = ue(!1), t = ht();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Pn(e) {\n const t = /* @__PURE__ */ _n();\n return T(() => (t.value, !!e()));\n}\nfunction On(e, t, o = {}) {\n const { window: n = ze, ...a } = o;\n let r;\n const s = /* @__PURE__ */ Pn(() => n && \"MutationObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const p = st(E(e)).map(We).filter(Sn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((y) => r.observe(y, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => r?.takeRecords(), d = () => {\n u(), l();\n };\n return dn(d), {\n isSupported: s,\n stop: d,\n takeRecords: i\n };\n}\nfunction Bn(e, t, o = {}) {\n const { window: n = ze, document: a = n?.document, flush: r = \"sync\" } = o;\n if (!n || !a) return Hn;\n let s;\n const l = (d) => {\n s?.(), s = d;\n }, u = gt(() => {\n const d = We(e);\n if (d) {\n const { stop: p } = On(a, (y) => {\n y.map((k) => [...k.removedNodes]).flat().some((k) => k === d || k.contains(d)) && t(y);\n }, {\n window: n,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), i = () => {\n u(), l();\n };\n return dn(i), i;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Fn(e = {}) {\n var t;\n const { window: o = ze, deep: n = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : o?.document, s = () => {\n let i = r?.activeElement;\n if (n)\n for (var d; i?.shadowRoot; ) i = i == null || (d = i.shadowRoot) === null || d === void 0 ? void 0 : d.activeElement;\n return i;\n }, l = ue(), u = () => {\n l.value = s();\n };\n if (o) {\n const i = {\n capture: !0,\n passive: !0\n };\n Qe(o, \"blur\", (d) => {\n d.relatedTarget === null && u();\n }, i), Qe(o, \"focus\", u, i);\n }\n return a && Bn(l, u, { document: r }), u(), l;\n}\nconst Zn = \"focusin\", Nn = \"focusout\", Un = \":focus-within\";\nfunction Wn(e, t = {}) {\n const { window: o = ze } = t, n = T(() => We(e)), a = ue(!1), r = T(() => a.value);\n if (!o || !(/* @__PURE__ */ Fn(t)).value) return { focused: r };\n const s = { passive: !0 };\n return Qe(n, Zn, () => a.value = !0, s), Qe(n, Nn, () => {\n var l, u, i;\n return a.value = (l = (u = n.value) === null || u === void 0 || (i = u.matches) === null || i === void 0 ? void 0 : i.call(u, Un)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction Gn(e, { window: t = ze, scrollTarget: o } = {}) {\n const n = R(!1), a = () => {\n if (!t) return;\n const r = t.document, s = We(e);\n if (!s)\n n.value = !1;\n else {\n const l = s.getBoundingClientRect();\n n.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return ne(\n () => We(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && Qe(o || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), n;\n}\nconst Ae = (e) => {\n let t = Gn(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, $e = (e) => e.tabIndex >= 0, Wt = (e) => {\n const t = e.target;\n return Lt(t);\n}, Lt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.previousElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.previousElementSibling;\n o && (t = o);\n }\n return t && (!$e(t) || !Ae(t)) ? Lt(t) : t;\n}, zn = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.firstElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.firstElementChild;\n a && (o = a);\n }\n }\n return o && (!$e(o) || !Ae(o)) ? Ht(o) : o;\n}, Gt = (e) => {\n const t = e.target;\n return Ht(t);\n}, Ht = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.nextElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.nextElementSibling;\n o && (t = o);\n }\n return t && (!$e(t) || !Ae(t)) ? Ht(t) : t;\n}, qn = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.lastElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.lastElementChild;\n a && (o = a);\n }\n }\n return o && (!$e(o) || !Ae(o)) ? Lt(o) : o;\n}, zt = (e) => {\n const t = e.target;\n return Vt(t);\n}, Vt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!$e(t) || !Ae(t)) ? Vt(t) : t;\n}, qt = (e) => {\n const t = e.target;\n return _t(t);\n}, _t = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!$e(t) || !Ae(t)) ? _t(t) : t;\n}, Yt = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!$e(t) || !Ae(t)) ? _t(t) : t;\n}, Xt = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!$e(t) || !Ae(t)) ? Vt(t) : t;\n}, nt = [\"alt\", \"control\", \"shift\", \"meta\"], Yn = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, wt = {\n \"keydown.up\": (e) => {\n const t = Wt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Gt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = zt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = qt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = zn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = qn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Gt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Wt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = zt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Pt(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, o = (s) => {\n const l = t(s);\n let u = [];\n if (typeof s.selectors == \"string\")\n u = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const i of s.selectors)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else if (s.selectors instanceof HTMLElement)\n u.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const i of s.selectors.value)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else\n u.push(s.selectors.value);\n return u;\n }, n = (s) => {\n const l = t(s);\n let u = [];\n return s.selectors ? u = o(s) : l && (u = Array.from(l.children).filter((i) => $e(i) && Ae(i))), u;\n }, a = (s) => (l) => {\n const u = Yn[l.key] || l.key.toLowerCase();\n if (nt.includes(u)) return;\n const i = s.handlers || wt;\n for (const d of Object.keys(i)) {\n const [p, ...y] = d.split(\".\");\n if (p === \"keydown\" && y.includes(u)) {\n const k = i[d], g = y.filter((f) => nt.includes(f)), b = nt.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (g.length > 0) {\n if (b) {\n for (const f of nt)\n if (y.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && k(l);\n }\n }\n } else\n b || k(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), u = n(s), i = a(s), d = l ? [l] : u;\n for (const p of d) {\n const { focused: y } = Wn(R(p)), k = ne(y, (g) => {\n g ? p.addEventListener(\"keydown\", i) : p.removeEventListener(\"keydown\", i);\n });\n r.push(k);\n }\n }\n }), an(() => {\n for (const s of r)\n s();\n });\n}\nfunction Ot(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\nconst fn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Xn = (e) => e != null, jn = Object.prototype.toString, Jn = (e) => jn.call(e) === \"[object Object]\", Pe = () => {\n};\nfunction Qn(...e) {\n if (e.length !== 1) return un(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: Pe\n }))) : R(t);\n}\nfunction Kn(e, t) {\n function o(...n) {\n return new Promise((a, r) => {\n Promise.resolve(e(() => t.apply(this, n), {\n fn: t,\n thisArg: this,\n args: n\n })).then(a).catch(r);\n });\n }\n return o;\n}\nfunction eo(e, t = {}) {\n let o, n, a = Pe;\n const r = (l) => {\n clearTimeout(l), a(), a = Pe;\n };\n let s;\n return (l) => {\n const u = E(e), i = E(t.maxWait);\n return o && r(o), u <= 0 || i !== void 0 && i <= 0 ? (n && (r(n), n = void 0), Promise.resolve(l())) : new Promise((d, p) => {\n a = t.rejectOnCancel ? p : d, s = l, i && !n && (n = setTimeout(() => {\n o && r(o), n = void 0, d(s());\n }, i)), o = setTimeout(() => {\n n && r(n), n = void 0, d(l());\n }, u);\n });\n };\n}\nfunction rt(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction to(e) {\n return ht();\n}\n// @__NO_SIDE_EFFECTS__\nfunction no(e, t = 200, o = {}) {\n return Kn(eo(t, o), e);\n}\nfunction oo(e, t = {}) {\n if (!An(e)) return $n(e);\n const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};\n for (const n in e.value) o[n] = St(() => ({\n get() {\n return e.value[n];\n },\n set(a) {\n var r;\n if (!((r = E(t.replaceRef)) !== null && r !== void 0) || r) if (Array.isArray(e.value)) {\n const s = [...e.value];\n s[n] = a, e.value = s;\n } else {\n const s = {\n ...e.value,\n [n]: a\n };\n Object.setPrototypeOf(s, Object.getPrototypeOf(e.value)), e.value = s;\n }\n else e.value[n] = a;\n }\n }));\n return o;\n}\nfunction lo(e, t = !0, o) {\n to() ? Ee(e, o) : t ? e() : vt(e);\n}\nfunction ao(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst et = fn ? window : void 0;\nfunction ye(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction He(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = rt(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return ao(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => ye(r))) !== null && n !== void 0 ? n : [et].filter((r) => r != null),\n rt(E(o.value ? e[1] : e[0])),\n rt(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = Jn(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction Tt(e, t, o = {}) {\n const { window: n = et, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = o;\n if (!n) return l ? {\n stop: Pe,\n cancel: Pe,\n trigger: Pe\n } : Pe;\n let u = !0;\n const i = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(n.document.querySelectorAll(m)).some((I) => I === f.target || f.composedPath().includes(I));\n {\n const I = ye(m);\n return I && (f.target === I || f.composedPath().includes(I));\n }\n });\n function d(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const I = E(f), C = I.$.subTree && I.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some(($) => $.el === m.target || m.composedPath().includes($.el));\n }\n const y = (f) => {\n const m = ye(e);\n if (f.target != null && !(!(m instanceof Element) && d(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (u = !i(f)), !u) {\n u = !0;\n return;\n }\n t(f);\n }\n };\n let k = !1;\n const g = [\n He(n, \"click\", (f) => {\n k || (k = !0, setTimeout(() => {\n k = !1;\n }, 0), y(f));\n }, {\n passive: !0,\n capture: r\n }),\n He(n, \"pointerdown\", (f) => {\n const m = ye(e);\n u = !i(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && He(n, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const I = ye(e);\n ((m = n.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !I?.contains(n.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), b = () => g.forEach((f) => f());\n return l ? {\n stop: b,\n cancel: () => {\n u = !1;\n },\n trigger: (f) => {\n u = !0, y(f), u = !1;\n }\n } : b;\n}\n// @__NO_SIDE_EFFECTS__\nfunction so() {\n const e = ue(!1), t = ht();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction vn(e) {\n const t = /* @__PURE__ */ so();\n return T(() => (t.value, !!e()));\n}\nfunction pn(e, t, o = {}) {\n const { window: n = et, ...a } = o;\n let r;\n const s = /* @__PURE__ */ vn(() => n && \"MutationObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const p = rt(E(e)).map(ye).filter(Xn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((y) => r.observe(y, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => r?.takeRecords(), d = () => {\n u(), l();\n };\n return Ot(d), {\n isSupported: s,\n stop: d,\n takeRecords: i\n };\n}\nconst ot = {\n speed: 2,\n margin: 30,\n direction: \"both\"\n};\nfunction ro(e) {\n e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));\n}\nfunction yt(e, t = {}) {\n var o, n, a, r;\n const { pointerTypes: s, preventDefault: l, stopPropagation: u, exact: i, onMove: d, onEnd: p, onStart: y, initialValue: k, axis: g = \"both\", draggingElement: b = et, containerElement: f, handle: m = e, buttons: I = [0], restrictInView: C, autoScroll: $ = !1 } = t, L = R((o = E(k)) !== null && o !== void 0 ? o : {\n x: 0,\n y: 0\n }), S = R(), O = (D) => s ? s.includes(D.pointerType) : !0, W = (D) => {\n E(l) && D.preventDefault(), E(u) && D.stopPropagation();\n }, pe = E($), j = typeof pe == \"object\" ? {\n speed: (n = E(pe.speed)) !== null && n !== void 0 ? n : ot.speed,\n margin: (a = E(pe.margin)) !== null && a !== void 0 ? a : ot.margin,\n direction: (r = pe.direction) !== null && r !== void 0 ? r : ot.direction\n } : ot, J = (D) => typeof D == \"number\" ? [D, D] : [D.x, D.y], ge = (D, F, G) => {\n const { clientWidth: Q, clientHeight: q, scrollLeft: re, scrollTop: ke, scrollWidth: Le, scrollHeight: P } = D, [B, z] = J(j.margin), [ee, le] = J(j.speed);\n let te = 0, ie = 0;\n (j.direction === \"x\" || j.direction === \"both\") && (G.x < B && re > 0 ? te = -ee : G.x + F.width > Q - B && re < Le - Q && (te = ee)), (j.direction === \"y\" || j.direction === \"both\") && (G.y < z && ke > 0 ? ie = -le : G.y + F.height > q - z && ke < P - q && (ie = le)), (te || ie) && D.scrollBy({\n left: te,\n top: ie,\n behavior: \"auto\"\n });\n };\n let de = null;\n const Oe = () => {\n const D = E(f);\n D && !de && (de = setInterval(() => {\n const F = E(e).getBoundingClientRect(), { x: G, y: Q } = L.value, q = {\n x: G - D.scrollLeft,\n y: Q - D.scrollTop\n };\n q.x >= 0 && q.y >= 0 && (ge(D, F, q), q.x += D.scrollLeft, q.y += D.scrollTop, L.value = q);\n }, 1e3 / 60));\n }, Re = () => {\n de && (clearInterval(de), de = null);\n }, Ye = (D, F, G, Q) => {\n const [q, re] = typeof G == \"number\" ? [G, G] : [G.x, G.y], { clientWidth: ke, clientHeight: Le } = F;\n return D.x < q || D.x + Q.width > ke - q || D.y < re || D.y + Q.height > Le - re;\n }, Xe = () => {\n if (E(t.disabled) || !S.value) return;\n const D = E(f);\n if (!D) return;\n const F = E(e).getBoundingClientRect(), { x: G, y: Q } = L.value;\n Ye({\n x: G - D.scrollLeft,\n y: Q - D.scrollTop\n }, D, j.margin, F) ? Oe() : Re();\n };\n E($) && ne(L, Xe);\n const Be = (D) => {\n var F;\n if (!E(I).includes(D.button) || E(t.disabled) || !O(D) || E(i) && D.target !== E(e)) return;\n const G = E(f), Q = G == null || (F = G.getBoundingClientRect) === null || F === void 0 ? void 0 : F.call(G), q = E(e).getBoundingClientRect(), re = {\n x: D.clientX - (G ? q.left - Q.left + ($ ? 0 : G.scrollLeft) : q.left),\n y: D.clientY - (G ? q.top - Q.top + ($ ? 0 : G.scrollTop) : q.top)\n };\n y?.(re, D) !== !1 && (S.value = re, W(D));\n }, je = (D) => {\n if (E(t.disabled) || !O(D) || !S.value) return;\n const F = E(f);\n F instanceof HTMLElement && ro(F);\n const G = E(e).getBoundingClientRect();\n let { x: Q, y: q } = L.value;\n if ((g === \"x\" || g === \"both\") && (Q = D.clientX - S.value.x, F && (Q = Math.min(Math.max(0, Q), F.scrollWidth - G.width))), (g === \"y\" || g === \"both\") && (q = D.clientY - S.value.y, F && (q = Math.min(Math.max(0, q), F.scrollHeight - G.height))), E($) && F && (de === null && ge(F, G, {\n x: Q,\n y: q\n }), Q += F.scrollLeft, q += F.scrollTop), F && (C || $)) {\n if (g !== \"y\") {\n const re = Q - F.scrollLeft;\n re < 0 ? Q = F.scrollLeft : re > F.clientWidth - G.width && (Q = F.clientWidth - G.width + F.scrollLeft);\n }\n if (g !== \"x\") {\n const re = q - F.scrollTop;\n re < 0 ? q = F.scrollTop : re > F.clientHeight - G.height && (q = F.clientHeight - G.height + F.scrollTop);\n }\n }\n L.value = {\n x: Q,\n y: q\n }, d?.(L.value, D), W(D);\n }, Fe = (D) => {\n E(t.disabled) || !O(D) || S.value && (S.value = void 0, $ && Re(), p?.(L.value, D), W(D));\n };\n if (fn) {\n const D = () => {\n var F;\n return {\n capture: (F = t.capture) !== null && F !== void 0 ? F : !0,\n passive: !E(l)\n };\n };\n He(m, \"pointerdown\", Be, D), He(b, \"pointermove\", je, D), He(b, \"pointerup\", Fe, D);\n }\n return {\n ...oo(L),\n position: L,\n isDragging: T(() => !!S.value),\n style: T(() => `\n left: ${L.value.x}px;\n top: ${L.value.y}px;\n ${$ ? \"text-wrap: nowrap;\" : \"\"}\n `)\n };\n}\nfunction dt(e, t, o = {}) {\n const { window: n = et, ...a } = o;\n let r;\n const s = /* @__PURE__ */ vn(() => n && \"ResizeObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const d = E(e);\n return Array.isArray(d) ? d.map((p) => ye(p)) : [ye(d)];\n }), (d) => {\n if (l(), s.value && n) {\n r = new ResizeObserver(t);\n for (const p of d) p && r.observe(p, a);\n }\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => {\n l(), u();\n };\n return Ot(i), {\n isSupported: s,\n stop: i\n };\n}\nfunction _e(e, t = {}) {\n const { reset: o = !0, windowResize: n = !0, windowScroll: a = !0, immediate: r = !0, updateTiming: s = \"sync\" } = t, l = ue(0), u = ue(0), i = ue(0), d = ue(0), p = ue(0), y = ue(0), k = ue(0), g = ue(0);\n function b() {\n const m = ye(e);\n if (!m) {\n o && (l.value = 0, u.value = 0, i.value = 0, d.value = 0, p.value = 0, y.value = 0, k.value = 0, g.value = 0);\n return;\n }\n const I = m.getBoundingClientRect();\n l.value = I.height, u.value = I.bottom, i.value = I.left, d.value = I.right, p.value = I.top, y.value = I.width, k.value = I.x, g.value = I.y;\n }\n function f() {\n s === \"sync\" ? b() : s === \"next-frame\" && requestAnimationFrame(() => b());\n }\n return dt(e, f), ne(() => ye(e), (m) => !m && f()), pn(e, f, { attributeFilter: [\"style\", \"class\"] }), a && He(\"scroll\", f, {\n capture: !0,\n passive: !0\n }), n && He(\"resize\", f, { passive: !0 }), lo(() => {\n r && f();\n }), {\n height: l,\n bottom: u,\n left: i,\n right: d,\n top: p,\n width: y,\n x: k,\n y: g,\n update: f\n };\n}\nfunction bt(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst xt = /* @__PURE__ */ new WeakMap();\nfunction io(e, t = !1) {\n const o = ue(t);\n let n = \"\";\n ne(Qn(e), (s) => {\n const l = bt(E(s));\n if (l) {\n const u = l;\n if (xt.get(u) || xt.set(u, u.style.overflow), u.style.overflow !== \"hidden\" && (n = u.style.overflow), u.style.overflow === \"hidden\") return o.value = !0;\n if (o.value) return u.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = bt(E(e));\n !s || o.value || (s.style.overflow = \"hidden\", o.value = !0);\n }, r = () => {\n const s = bt(E(e));\n !s || !o.value || (s.style.overflow = n, xt.delete(s), o.value = !1);\n };\n return Ot(r), T({\n get() {\n return o.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst uo = (e) => {\n const t = new DOMParser().parseFromString(e, \"text/html\");\n return Array.from(t.body.childNodes).some((o) => o.nodeType === 1);\n}, co = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(\"\"), fo = [\"data-colindex\", \"data-rowindex\", \"data-editable\", \"contenteditable\", \"tabindex\"], vo = [\"innerHTML\"], po = { key: 2 }, mo = /* @__PURE__ */ oe({\n __name: \"ACell\",\n props: {\n colIndex: {},\n rowIndex: {},\n store: {},\n addNavigation: { type: [Boolean, Object], default: !0 },\n tabIndex: { default: 0 },\n pinned: { type: Boolean, default: !1 },\n debounce: { default: 300 }\n },\n setup(e, { expose: t }) {\n const o = fe(\"cell\"), n = e.store.getCellData(e.colIndex, e.rowIndex), a = R(\"\"), r = R(!1), s = e.store.columns[e.colIndex], l = e.store.rows[e.rowIndex], u = s.align || \"center\", i = s.width || \"40ch\", d = T(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), p = T(() => typeof d.value == \"string\" ? uo(d.value) : !1), y = T(() => ({\n textAlign: u,\n width: i,\n fontWeight: r.value ? \"bold\" : \"inherit\",\n paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)\n })), k = T(() => ({\n \"sticky-column\": e.pinned,\n \"cell-modified\": r.value\n })), g = () => {\n f(), b();\n }, b = () => {\n const { left: S, bottom: O, width: W, height: pe } = _e(o);\n s.mask, s.modalComponent && e.store.$patch((j) => {\n j.modal.visible = !0, j.modal.colIndex = e.colIndex, j.modal.rowIndex = e.rowIndex, j.modal.left = S, j.modal.bottom = O, j.modal.width = W, j.modal.height = pe, j.modal.cell = o.value, typeof s.modalComponent == \"function\" ? j.modal.component = s.modalComponent({ table: j.table, row: l, column: s }) : j.modal.component = s.modalComponent, j.modal.componentProps = s.modalComponentExtraProps;\n });\n };\n if (e.addNavigation) {\n let S = {\n ...wt,\n \"keydown.f2\": b,\n \"keydown.alt.up\": b,\n \"keydown.alt.down\": b,\n \"keydown.alt.left\": b,\n \"keydown.alt.right\": b\n };\n typeof e.addNavigation == \"object\" && (S = {\n ...S,\n ...e.addNavigation\n }), Pt([\n {\n selectors: o,\n handlers: S\n }\n ]);\n }\n const f = () => {\n if (o.value && s.edit) {\n const S = window.getSelection();\n if (S)\n try {\n const O = document.createRange();\n O.selectNodeContents && (O.selectNodeContents(o.value), S.removeAllRanges(), S.addRange(O));\n } catch {\n }\n }\n }, m = () => {\n o.value && (a.value = o.value.textContent, f());\n }, I = () => {\n try {\n const S = window.getSelection();\n if (S && S.rangeCount > 0 && o.value) {\n const O = S.getRangeAt(0), W = O.cloneRange();\n if (W.selectNodeContents && W.setEnd)\n return W.selectNodeContents(o.value), W.setEnd(O.endContainer, O.endOffset), W.toString().length;\n }\n } catch {\n }\n return 0;\n }, C = (S) => {\n if (o.value)\n try {\n const O = window.getSelection();\n if (!O) return;\n let W = 0;\n const pe = document.createTreeWalker ? document.createTreeWalker(o.value, NodeFilter.SHOW_TEXT, null) : null;\n if (!pe) return;\n let j, J = null;\n for (; j = pe.nextNode(); ) {\n const ge = j, de = W + ge.textContent.length;\n if (S <= de && (J = document.createRange(), J.setStart && J.setEnd)) {\n J.setStart(ge, S - W), J.setEnd(ge, S - W);\n break;\n }\n W = de;\n }\n J && O.removeAllRanges && O.addRange && (O.removeAllRanges(), O.addRange(J));\n } catch {\n }\n }, $ = (S) => {\n if (!s.edit) return;\n const O = S.target;\n if (O.textContent === a.value)\n return;\n const W = I();\n a.value = O.textContent, s.format ? (r.value = O.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, n), e.store.setCellText(e.colIndex, e.rowIndex, O.textContent)) : (r.value = O.textContent !== n, e.store.setCellData(e.colIndex, e.rowIndex, O.textContent)), vt().then(() => {\n C(W);\n });\n }, L = /* @__PURE__ */ no($, e.debounce);\n return t({\n currentData: a\n }), (S, O) => (h(), x(\"td\", {\n ref: \"cell\",\n \"data-colindex\": e.colIndex,\n \"data-rowindex\": e.rowIndex,\n \"data-editable\": V(s).edit,\n contenteditable: V(s).edit,\n tabindex: e.tabIndex,\n spellcheck: !1,\n style: be(y.value),\n class: se([\"atable-cell\", k.value]),\n onFocus: m,\n onPaste: $,\n onInput: O[0] || (O[0] = //@ts-ignore\n (...W) => V(L) && V(L)(...W)),\n onClick: g\n }, [\n V(s).cellComponent ? (h(), me(Ue(V(s).cellComponent), ft({\n key: 0,\n value: d.value\n }, V(s).cellComponentProps), null, 16, [\"value\"])) : p.value ? (h(), x(\"span\", {\n key: 1,\n innerHTML: d.value\n }, null, 8, vo)) : (h(), x(\"span\", po, N(d.value), 1))\n ], 46, fo));\n }\n}), ho = [\"tabindex\"], go = [\"tabindex\"], wo = [\"colspan\"], yo = /* @__PURE__ */ oe({\n __name: \"AExpansionRow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: () => wt }\n },\n setup(e) {\n const t = fe(\"rowEl\"), o = T(() => e.store.display[e.rowIndex].expanded ? \"โผ\" : \"โบ\");\n if (e.addNavigation) {\n const n = {\n \"keydown.control.g\": (a) => {\n a.stopPropagation(), a.preventDefault(), e.store.toggleRowExpand(e.rowIndex);\n }\n };\n typeof e.addNavigation == \"object\" && Object.assign(n, e.addNavigation), Pt([\n {\n selectors: t,\n handlers: n\n }\n ]);\n }\n return (n, a) => (h(), x(X, null, [\n w(\"tr\", ft(n.$attrs, {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"expandable-row\"\n }), [\n w(\"td\", {\n tabIndex: -1,\n class: \"row-index\",\n onClick: a[0] || (a[0] = (r) => e.store.toggleRowExpand(e.rowIndex))\n }, N(o.value), 1),\n he(n.$slots, \"row\", {}, void 0, !0)\n ], 16, ho),\n e.store.display[e.rowIndex].expanded ? (h(), x(\"tr\", {\n key: 0,\n ref: \"rowExpanded\",\n tabindex: e.tabIndex,\n class: \"expanded-row\"\n }, [\n w(\"td\", {\n tabIndex: -1,\n colspan: e.store.columns.length + 1,\n class: \"expanded-row-content\"\n }, [\n he(n.$slots, \"content\", {}, void 0, !0)\n ], 8, wo)\n ], 8, go)) : Y(\"\", !0)\n ], 64));\n }\n}), Ve = (e, t) => {\n const o = e.__vccOpts || e;\n for (const [n, a] of t)\n o[n] = a;\n return o;\n}, bo = /* @__PURE__ */ Ve(yo, [[\"__scopeId\", \"data-v-a42297c7\"]]), xo = [\"colspan\"], ko = {\n ref: \"container\",\n class: \"gantt-container\"\n}, Io = [\"data-rowindex\", \"data-colindex\"], Mo = {\n key: 2,\n class: \"gantt-label\"\n}, Co = [\"x1\", \"y1\", \"x2\", \"y2\"], Eo = /* @__PURE__ */ oe({\n __name: \"AGanttCell\",\n props: {\n store: {},\n columnsCount: {},\n rowIndex: {},\n colIndex: {},\n start: { default: 0 },\n end: { default: 0 },\n colspan: { default: 1 },\n label: { default: \"\" },\n color: { default: \"#cccccc\" }\n },\n emits: [\"connection:create\"],\n setup(e, { expose: t, emit: o }) {\n Cn((P) => ({\n v6d722296: a.value,\n v260b36f8: P.colspan\n }));\n const n = o, a = R(e.color.length >= 6 ? e.color : \"#cccccc\"), r = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, s = fe(\"container\"), l = fe(\"bar\"), u = fe(\"leftResizeHandle\"), i = fe(\"rightResizeHandle\"), d = fe(\"leftConnectionHandle\"), p = fe(\"rightConnectionHandle\"), { width: y } = _e(s), { left: k, right: g } = _e(l), b = R(e.start), f = R(e.end || b.value + e.colspan), m = R(!1), I = R(!1), C = R(!1), $ = R(!1), L = R(!1), S = R({ startX: 0, startY: 0, endX: 0, endY: 0 }), O = T(() => Oe.value || ge.value || de.value), W = T(() => e.colspan > 0 ? y.value / e.colspan : 0), pe = T(() => {\n const P = b.value / e.colspan * 100, B = f.value / e.colspan * 100;\n return {\n left: `${P}%`,\n width: `${B - P}%`,\n backgroundColor: a.value\n };\n }), j = T(\n () => ({\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100vw\",\n height: \"100vh\",\n pointerEvents: \"none\",\n zIndex: 1e3\n })\n ), J = R({ startX: 0, startPos: 0 }), { isDragging: ge } = yt(u, {\n axis: \"x\",\n onStart: () => Re(k.value, b.value),\n onMove: ({ x: P }) => Ye(P),\n onEnd: ({ x: P }) => Xe(P)\n }), { isDragging: de } = yt(i, {\n axis: \"x\",\n onStart: () => Re(g.value, f.value),\n onMove: ({ x: P }) => Be(P),\n onEnd: ({ x: P }) => je(P)\n }), { isDragging: Oe } = yt(l, {\n exact: !0,\n axis: \"x\",\n onStart: () => Re(k.value, b.value),\n onMove: ({ x: P }) => Fe(P),\n onEnd: ({ x: P }) => D(P)\n });\n Ee(() => {\n F();\n }), En(() => {\n G();\n });\n function Re(P, B) {\n l.value && (l.value.style.transition = \"none\"), J.value = { startX: P, startPos: B };\n }\n function Ye(P) {\n if (!ge.value || !l.value) return;\n const B = (P - J.value.startX) / W.value, z = Math.max(0, Math.min(f.value - 1, J.value.startPos + B));\n l.value.style.left = `${z / e.colspan * 100}%`, l.value.style.width = `${(f.value - z) / e.colspan * 100}%`;\n }\n function Xe(P) {\n if (!l.value) return;\n const B = P - J.value.startX, z = Math.round(B / W.value), ee = b.value, le = Math.max(0, Math.min(f.value - 1, J.value.startPos + z));\n b.value = le, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"start\",\n oldStart: ee,\n newStart: le,\n end: f.value,\n delta: z,\n oldColspan: f.value - ee,\n newColspan: f.value - le\n });\n }\n function Be(P) {\n if (!de.value || !l.value) return;\n const B = (P - J.value.startX) / W.value, z = Math.max(b.value + 1, Math.min(e.columnsCount, J.value.startPos + B));\n l.value.style.width = `${(z - b.value) / e.colspan * 100}%`;\n }\n function je(P) {\n if (!l.value) return;\n const B = P - J.value.startX, z = Math.round(B / W.value), ee = f.value, le = Math.max(b.value + 1, Math.min(e.columnsCount, J.value.startPos + z));\n f.value = le, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"end\",\n oldEnd: ee,\n newEnd: le,\n start: b.value,\n delta: z,\n oldColspan: ee - b.value,\n newColspan: le - b.value\n });\n }\n function Fe(P) {\n if (!Oe.value || !l.value) return;\n const B = (P - J.value.startX) / W.value, z = f.value - b.value, ee = Math.max(0, Math.min(J.value.startPos + B, e.columnsCount - z));\n l.value.style.left = `${ee / e.colspan * 100}%`;\n }\n function D(P) {\n if (!l.value) return;\n const B = P - J.value.startX, z = Math.round(B / W.value), ee = f.value - b.value, le = b.value, te = f.value;\n let ie = J.value.startPos + z, ce = ie + ee;\n ie < 0 ? (ie = 0, ce = ee) : ce > e.columnsCount && (ce = e.columnsCount, ie = ce - ee), b.value = ie, f.value = ce, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"bar\",\n oldStart: le,\n oldEnd: te,\n newStart: ie,\n newEnd: ce,\n delta: z,\n colspan: ce - ie\n });\n }\n function F() {\n const { x: P, y: B } = _e(l), { x: z, y: ee } = _e(d), { x: le, y: te } = _e(p);\n e.store.registerGanttBar({\n id: r,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n startIndex: b,\n endIndex: f,\n color: a,\n label: e.label,\n position: { x: P, y: B }\n }), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({\n id: `${r}-connection-left`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"left\",\n position: { x: z, y: ee },\n visible: m,\n barId: r\n }), e.store.registerConnectionHandle({\n id: `${r}-connection-right`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"right\",\n position: { x: le, y: te },\n visible: I,\n barId: r\n }));\n }\n function G() {\n e.store.unregisterGanttBar(r), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${r}-connection-left`), e.store.unregisterConnectionHandle(`${r}-connection-right`));\n }\n function Q() {\n e.store.isDependencyGraphEnabled && (m.value = !0, I.value = !0);\n }\n function q() {\n !C.value && !$.value && (m.value = !1, I.value = !1);\n }\n function re(P, B) {\n B.preventDefault(), B.stopPropagation(), L.value = !0, P === \"left\" ? C.value = !0 : $.value = !0;\n const z = P === \"left\" ? d.value : p.value;\n if (z) {\n const te = z.getBoundingClientRect(), ie = te.left + te.width / 2, ce = te.top + te.height / 2;\n S.value = { startX: ie, startY: ce, endX: ie, endY: ce };\n }\n const ee = (te) => {\n S.value.endX = te.clientX, S.value.endY = te.clientY;\n }, le = (te) => {\n ke(te, P), Le(ee, le);\n };\n document.addEventListener(\"mousemove\", ee), document.addEventListener(\"mouseup\", le);\n }\n function ke(P, B) {\n const z = document.elementFromPoint(P.clientX, P.clientY)?.closest(\".connection-handle\");\n if (z && z !== (B === \"left\" ? d.value : p.value)) {\n const ee = z.closest(\".gantt-bar\");\n if (ee) {\n const le = parseInt(ee.getAttribute(\"data-rowindex\") || \"0\"), te = parseInt(ee.getAttribute(\"data-colindex\") || \"0\"), ie = z.classList.contains(\"left-connection-handle\") ? \"left\" : \"right\", ce = `gantt-bar-row-${le}-col-${te}`, c = e.store.createConnection(\n `${r}-connection-${B}`,\n `${ce}-connection-${ie}`\n );\n c && n(\"connection:create\", c);\n }\n }\n }\n function Le(P, B) {\n L.value = !1, C.value = !1, $.value = !1, document.removeEventListener(\"mousemove\", P), document.removeEventListener(\"mouseup\", B), l.value?.matches(\":hover\") || q();\n }\n return t({\n barStyle: pe,\n cleanupConnectionDrag: Le,\n currentEnd: f,\n handleConnectionDrop: ke,\n isLeftConnectionDragging: C,\n isLeftConnectionVisible: m,\n isRightConnectionDragging: $,\n isRightConnectionVisible: I,\n showDragPreview: L\n }), (P, B) => (h(), x(\"td\", {\n class: \"aganttcell\",\n colspan: e.colspan\n }, [\n w(\"div\", ko, [\n w(\"div\", {\n ref: \"bar\",\n \"data-rowindex\": e.rowIndex,\n \"data-colindex\": e.colIndex,\n class: se([\"gantt-bar\", { \"is-dragging\": O.value }]),\n style: be(pe.value),\n onMouseenter: Q,\n onMouseleave: q\n }, [\n e.store.isDependencyGraphEnabled ? (h(), x(\"div\", {\n key: 0,\n ref: \"leftConnectionHandle\",\n class: se([\"connection-handle left-connection-handle\", { visible: m.value, \"is-dragging\": C.value }]),\n onMousedown: B[0] || (B[0] = Ie((z) => re(\"left\", z), [\"stop\"]))\n }, [...B[2] || (B[2] = [\n w(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : Y(\"\", !0),\n e.store.isDependencyGraphEnabled ? (h(), x(\"div\", {\n key: 1,\n ref: \"rightConnectionHandle\",\n class: se([\"connection-handle right-connection-handle\", { visible: I.value, \"is-dragging\": $.value }]),\n onMousedown: B[1] || (B[1] = Ie((z) => re(\"right\", z), [\"stop\"]))\n }, [...B[3] || (B[3] = [\n w(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : Y(\"\", !0),\n w(\"div\", {\n ref: \"leftResizeHandle\",\n class: se([\"resize-handle left-resize-handle\", { \"is-dragging\": V(ge) }])\n }, [...B[4] || (B[4] = [\n w(\"div\", { class: \"handle-grip\" }, null, -1),\n w(\"div\", { class: \"vertical-indicator left-indicator\" }, null, -1)\n ])], 2),\n e.label ? (h(), x(\"label\", Mo, N(e.label), 1)) : Y(\"\", !0),\n w(\"div\", {\n ref: \"rightResizeHandle\",\n class: se([\"resize-handle right-resize-handle\", { \"is-dragging\": V(de) }])\n }, [...B[5] || (B[5] = [\n w(\"div\", { class: \"handle-grip\" }, null, -1),\n w(\"div\", { class: \"vertical-indicator right-indicator\" }, null, -1)\n ])], 2)\n ], 46, Io)\n ], 512),\n e.store.isDependencyGraphEnabled && L.value ? (h(), x(\"svg\", {\n key: 0,\n style: be(j.value)\n }, [\n w(\"line\", {\n x1: S.value.startX,\n y1: S.value.startY,\n x2: S.value.endX,\n y2: S.value.endY,\n stroke: \"#2196f3\",\n \"stroke-width\": \"2\",\n \"stroke-dasharray\": \"5,5\"\n }, null, 8, Co)\n ], 4)) : Y(\"\", !0)\n ], 8, xo));\n }\n}), Ao = /* @__PURE__ */ Ve(Eo, [[\"__scopeId\", \"data-v-8917a8a3\"]]), $o = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"34 18 30 18 30 30 18 30 18 34 30 34 30 46 34 46 34 34 46 34 46 30 34 30 34 18\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>\n`, To = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"46.84 19.99 44.01 17.16 32 29.17 19.99 17.16 17.16 19.99 29.17 32 17.16 44.01 19.99 46.84 32 34.83 44.01 46.84 46.84 44.01 34.83 32 46.84 19.99\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Do = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.67\">\n <path d=\"M68.67,16.67h-14.67V2c0-1.1-.9-2-2-2H2C.9,0,0,.9,0,2v50c0,1.1.9,2,2,2h14.67v14.67c0,1.1.9,2,2,2h50c1.1,0,2-.9,2-2V18.67c0-1.1-.9-2-2-2ZM4,4h46v46H4V4ZM66.67,66.67H20.67v-12.67h31.33c1.1,0,2-.9,2-2v-31.33h12.67v46Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"41 25 29 25 29 13 25 13 25 25 13 25 13 29 25 29 25 41 29 41 29 29 41 29 41 25\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, So = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <path d=\"M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z\"/>\n <g>\n <polygon points=\"70.6 2.5 68.6 2.5 68.6 2 68.1 2 68.1 0 70.6 0 70.6 2.5\"/>\n <path d=\"M65.3,2h-2.9V0h2.9v2ZM59.6,2h-2.9V0h2.9v2ZM53.9,2h-2.9V0h2.9v2ZM48.2,2h-2.9V0h2.9v2ZM42.4,2h-2.9V0h2.9v2ZM36.7,2h-2.9V0h2.9v2ZM31,2h-2.9V0h2.9v2ZM25.3,2h-2.9V0h2.9v2ZM19.6,2h-2.9V0h2.9v2ZM13.9,2h-2.9V0h2.9v2ZM8.2,2h-2.9V0h2.9v2Z\"/>\n <polygon points=\"2 2.5 0 2.5 0 0 2.5 0 2.5 2 2 2 2 2.5\"/>\n <path d=\"M2,13.4H0v-2.7h2v2.7ZM2,8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 18.7 0 18.7 0 16.2 2 16.2 2 16.7 2.5 16.7 2.5 18.7\"/>\n <path d=\"M65.3,18.7h-2.9v-2h2.9v2ZM59.6,18.7h-2.9v-2h2.9v2ZM53.9,18.7h-2.9v-2h2.9v2ZM48.2,18.7h-2.9v-2h2.9v2ZM42.4,18.7h-2.9v-2h2.9v2ZM36.7,18.7h-2.9v-2h2.9v2ZM31,18.7h-2.9v-2h2.9v2ZM25.3,18.7h-2.9v-2h2.9v2ZM19.6,18.7h-2.9v-2h2.9v2ZM13.9,18.7h-2.9v-2h2.9v2ZM8.2,18.7h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 18.7 68.1 18.7 68.1 16.7 68.6 16.7 68.6 16.2 70.6 16.2 70.6 18.7\"/>\n <path d=\"M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z\"/>\n </g>\n</svg>`, Ro = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <g>\n <polygon points=\"70.6 45.3 68.6 45.3 68.6 44.8 68.1 44.8 68.1 42.8 70.6 42.8 70.6 45.3\"/>\n <path d=\"M65.3,44.8h-2.9v-2h2.9v2ZM59.6,44.8h-2.9v-2h2.9v2ZM53.9,44.8h-2.9v-2h2.9v2ZM48.2,44.8h-2.9v-2h2.9v2ZM42.4,44.8h-2.9v-2h2.9v2ZM36.7,44.8h-2.9v-2h2.9v2ZM31,44.8h-2.9v-2h2.9v2ZM25.3,44.8h-2.9v-2h2.9v2ZM19.6,44.8h-2.9v-2h2.9v2ZM13.9,44.8h-2.9v-2h2.9v2ZM8.2,44.8h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"2 45.3 0 45.3 0 42.8 2.5 42.8 2.5 44.8 2 44.8 2 45.3\"/>\n <path d=\"M2,56.3H0v-2.7h2v2.7ZM2,50.8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 61.5 0 61.5 0 59 2 59 2 59.5 2.5 59.5 2.5 61.5\"/>\n <path d=\"M65.3,61.5h-2.9v-2h2.9v2ZM59.6,61.5h-2.9v-2h2.9v2ZM53.9,61.5h-2.9v-2h2.9v2ZM48.2,61.5h-2.9v-2h2.9v2ZM42.4,61.5h-2.9v-2h2.9v2ZM36.7,61.5h-2.9v-2h2.9v2ZM31,61.5h-2.9v-2h2.9v2ZM25.3,61.5h-2.9v-2h2.9v2ZM19.6,61.5h-2.9v-2h2.9v2ZM13.9,61.5h-2.9v-2h2.9v2ZM8.2,61.5h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 61.5 68.1 61.5 68.1 59.5 68.6 59.5 68.6 59 70.6 59 70.6 61.5\"/>\n <path d=\"M70.6,56.3h-2v-2.7h2v2.7ZM70.6,50.8h-2v-2.7h2v2.7Z\"/>\n </g>\n <path d=\"M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z\"/>\n</svg>`, Lo = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.64\">\n <path d=\"M70.08,33.9l-9.75-9.75-2.83,2.83,6.33,6.33h-26.51V6.81l6.33,6.33,2.83-2.83L36.75.56c-.75-.75-2.08-.75-2.83,0l-9.75,9.75,2.83,2.83,6.33-6.33v26.5H6.83l6.33-6.33-2.83-2.83L.59,33.9c-.38.38-.59.88-.59,1.41s.21,1.04.59,1.41l9.75,9.75,2.83-2.83-6.33-6.33h26.5v26.51l-6.33-6.33-2.83,2.83,9.75,9.75c.38.38.88.59,1.41.59s1.04-.21,1.41-.59l9.75-9.75-2.83-2.83-6.33,6.33v-26.51h26.51l-6.33,6.33,2.83,2.83,9.75-9.75c.38-.38.59-.88.59-1.41s-.21-1.04-.59-1.41Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Ho = {\n add: $o,\n delete: To,\n duplicate: Do,\n insertAbove: So,\n insertBelow: Ro,\n move: Lo\n}, Vo = {\n key: 0,\n class: \"row-actions-dropdown\"\n}, _o = [\"aria-expanded\"], Po = [\"onClick\"], Oo = [\"innerHTML\"], Bo = { class: \"action-label\" }, Fo = {\n key: 1,\n class: \"row-actions-icons\"\n}, Zo = [\"title\", \"aria-label\", \"onClick\"], No = [\"innerHTML\"], it = /* @__PURE__ */ oe({\n __name: \"ARowActions\",\n props: {\n rowIndex: {},\n store: {},\n config: {},\n position: {}\n },\n emits: [\"action\"],\n setup(e, { emit: t }) {\n const o = e, n = t, a = fe(\"actionsCell\"), r = fe(\"toggleButton\"), s = R(0), l = R(!1), u = R(!1), i = R({ top: 0, left: 0 }), d = {\n add: \"Add Row\",\n delete: \"Delete Row\",\n duplicate: \"Duplicate Row\",\n insertAbove: \"Insert Above\",\n insertBelow: \"Insert Below\",\n move: \"Move Row\"\n }, p = T(() => {\n const m = [], I = o.config.actions || {}, C = [\"add\", \"delete\", \"duplicate\", \"insertAbove\", \"insertBelow\", \"move\"];\n for (const $ of C) {\n const L = I[$];\n if (L === !1 || L === void 0) continue;\n let S = !0, O = d[$], W = Ho[$];\n typeof L == \"object\" && (S = L.enabled !== !1, O = L.label || O, W = L.icon || W), S && m.push({ type: $, label: O, icon: W });\n }\n return m;\n }), y = T(() => {\n if (o.config.forceDropdown) return !0;\n const m = o.config.dropdownThreshold ?? 150;\n return m === 0 ? !1 : s.value > 0 && s.value < m;\n }), k = T(() => l.value ? u.value ? {\n position: \"fixed\",\n bottom: `${window.innerHeight - i.value.top}px`,\n left: `${i.value.left}px`,\n top: \"auto\"\n } : {\n position: \"fixed\",\n top: `${i.value.top}px`,\n left: `${i.value.left}px`\n } : {});\n dt(a, (m) => {\n const I = m[0];\n I && (s.value = I.contentRect.width);\n });\n const g = () => {\n l.value || b(), l.value = !l.value;\n }, b = () => {\n if (!r.value) return;\n const m = r.value.getBoundingClientRect(), I = window.innerHeight, C = p.value.length * 40 + 16, $ = I - m.bottom, L = m.top;\n u.value = $ < C && L > C, u.value ? i.value = {\n top: m.top,\n left: m.left\n } : i.value = {\n top: m.bottom,\n left: m.left\n };\n };\n Tt(a, () => {\n l.value = !1;\n });\n const f = (m) => {\n l.value = !1;\n const I = o.config.actions?.[m];\n typeof I == \"object\" && I.handler && I.handler(o.rowIndex, o.store) === !1 || n(\"action\", m, o.rowIndex);\n };\n return (m, I) => (h(), x(\"td\", {\n ref: \"actionsCell\",\n class: se([\"atable-row-actions\", { \"sticky-column\": e.position === \"before-index\", \"dropdown-active\": l.value }])\n }, [\n y.value ? (h(), x(\"div\", Vo, [\n w(\"button\", {\n ref: \"toggleButton\",\n type: \"button\",\n class: \"row-actions-toggle\",\n \"aria-expanded\": l.value,\n \"aria-haspopup\": \"true\",\n onClick: Ie(g, [\"stop\"])\n }, [...I[0] || (I[0] = [\n w(\"span\", { class: \"dropdown-icon\" }, \"โฎ\", -1)\n ])], 8, _o),\n K(w(\"div\", {\n class: se([\"row-actions-menu\", { \"menu-flipped\": u.value }]),\n style: be(k.value),\n role: \"menu\"\n }, [\n (h(!0), x(X, null, ve(p.value, (C) => (h(), x(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-menu-item\",\n role: \"menuitem\",\n onClick: Ie(($) => f(C.type), [\"stop\"])\n }, [\n w(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, Oo),\n w(\"span\", Bo, N(C.label), 1)\n ], 8, Po))), 128))\n ], 6), [\n [Ce, l.value]\n ])\n ])) : (h(), x(\"div\", Fo, [\n (h(!0), x(X, null, ve(p.value, (C) => (h(), x(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-btn\",\n title: C.label,\n \"aria-label\": C.label,\n onClick: Ie(($) => f(C.type), [\"stop\"])\n }, [\n w(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, No)\n ], 8, Zo))), 128))\n ]))\n ], 2));\n }\n}), Uo = [\"tabindex\"], Wo = /* @__PURE__ */ oe({\n __name: \"ARow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: !1 }\n },\n emits: [\"row:action\"],\n setup(e, { emit: t }) {\n const o = t, n = fe(\"rowEl\"), a = T(() => e.store.isRowVisible(e.rowIndex)), r = T(() => e.store.getRowExpandSymbol(e.rowIndex)), s = T(() => e.store.config.rowActions || { enabled: !1 }), l = T(() => s.value.enabled), u = T(() => s.value.position || \"before-index\"), i = (d, p) => {\n o(\"row:action\", d, p);\n };\n if (e.addNavigation) {\n let d = wt;\n typeof e.addNavigation == \"object\" && (d = {\n ...d,\n ...e.addNavigation\n }), Pt([\n {\n selectors: n,\n handlers: d\n }\n ]);\n }\n return (d, p) => K((h(), x(\"tr\", {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"atable-row\"\n }, [\n l.value && u.value === \"before-index\" ? (h(), me(it, {\n key: 0,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: u.value,\n onAction: i\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : Y(\"\", !0),\n e.store.config.view !== \"uncounted\" ? he(d.$slots, \"index\", { key: 1 }, () => [\n e.store.config.view === \"list\" ? (h(), x(\"td\", {\n key: 0,\n tabIndex: -1,\n class: se([\"list-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"])\n }, N(e.rowIndex + 1), 3)) : e.store.isTreeView ? (h(), x(\"td\", {\n key: 1,\n tabIndex: -1,\n class: se([\"tree-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"]),\n onClick: p[0] || (p[0] = (y) => e.store.toggleRowExpand(e.rowIndex))\n }, N(r.value), 3)) : Y(\"\", !0)\n ], !0) : Y(\"\", !0),\n l.value && u.value === \"after-index\" ? (h(), me(it, {\n key: 2,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: u.value,\n onAction: i\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : Y(\"\", !0),\n he(d.$slots, \"default\", {}, void 0, !0),\n l.value && u.value === \"end\" ? (h(), me(it, {\n key: 3,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: u.value,\n onAction: i\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : Y(\"\", !0)\n ], 8, Uo)), [\n [Ce, a.value]\n ]);\n }\n}), mn = /* @__PURE__ */ Ve(Wo, [[\"__scopeId\", \"data-v-2e038a9c\"]]), kt = /* @__PURE__ */ new WeakMap(), Go = {\n mounted(e, t) {\n const o = !t.modifiers.bubble;\n let n;\n if (typeof t.value == \"function\") n = Tt(e, t.value, { capture: o });\n else {\n const [a, r] = t.value;\n n = Tt(e, a, Object.assign({ capture: o }, r));\n }\n kt.set(e, n);\n },\n unmounted(e) {\n const t = kt.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), kt.delete(e);\n }\n}, zo = { mounted(e, t) {\n typeof t.value == \"function\" ? dt(e, t.value) : dt(e, ...t.value);\n} };\nfunction qo() {\n let e = !1;\n const t = ue(!1);\n return (o, n) => {\n if (t.value = n.value, e) return;\n e = !0;\n const a = io(o, n.value);\n ne(t, (r) => a.value = r);\n };\n}\nqo();\nconst Yo = { class: \"gantt-connection-overlay\" }, Xo = {\n class: \"connection-svg\",\n style: {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n pointerEvents: \"none\",\n zIndex: 1\n }\n}, jo = [\"d\", \"stroke-width\", \"onDblclick\"], Jo = [\"id\", \"d\", \"stroke\", \"stroke-width\", \"onDblclick\"], Qo = 0.25, lt = 16, Ko = /* @__PURE__ */ oe({\n __name: \"AGanttConnection\",\n props: {\n store: {}\n },\n emits: [\"connection:delete\"],\n setup(e, { emit: t }) {\n const o = t, n = T(() => e.store.connectionPaths.filter((s) => {\n const l = e.store.ganttBars.find((i) => i.id === s.from.barId), u = e.store.ganttBars.find((i) => i.id === s.to.barId);\n return l && u;\n })), a = (s) => {\n const l = e.store.connectionHandles.find(\n (O) => O.barId === s.from.barId && O.side === s.from.side\n ), u = e.store.connectionHandles.find(\n (O) => O.barId === s.to.barId && O.side === s.to.side\n );\n if (!l || !u) return \"\";\n const i = l.position.x + lt / 2, d = l.position.y + lt / 2, p = u.position.x + lt / 2, y = u.position.y + lt / 2, k = Math.abs(p - i), g = Math.max(k * Qo, 50), b = i + (s.from.side === \"left\" ? -g : g), f = p + (s.to.side === \"left\" ? -g : g), m = { x: 0.5 * i + 0.5 * b, y: 0.5 * d + 0.5 * d }, I = { x: 0.5 * b + 0.5 * f, y: 0.5 * d + 0.5 * y }, C = { x: 0.5 * f + 0.5 * p, y: 0.5 * y + 0.5 * y }, $ = { x: 0.5 * m.x + 0.5 * I.x, y: 0.5 * m.y + 0.5 * I.y }, L = { x: 0.5 * I.x + 0.5 * C.x, y: 0.5 * I.y + 0.5 * C.y }, S = { x: 0.5 * $.x + 0.5 * L.x, y: 0.5 * $.y + 0.5 * L.y };\n return `M ${i} ${d} Q ${b} ${d}, ${S.x} ${S.y} Q ${f} ${y}, ${p} ${y}`;\n }, r = (s) => {\n e.store.deleteConnection(s.id) && o(\"connection:delete\", s);\n };\n return (s, l) => (h(), x(\"div\", Yo, [\n (h(), x(\"svg\", Xo, [\n l[0] || (l[0] = w(\"defs\", null, [\n w(\"path\", {\n id: \"arrowhead\",\n d: \"M 0 -7 L 20 0 L 0 7Z\",\n stroke: \"black\",\n \"stroke-width\": \"1\",\n fill: \"currentColor\"\n }),\n w(\"marker\", {\n id: \"arrowhead-marker\",\n markerWidth: \"10\",\n markerHeight: \"7\",\n refX: \"5\",\n refY: \"3.5\",\n orient: \"auto\",\n markerUnits: \"strokeWidth\"\n }, [\n w(\"polygon\", {\n points: \"0 0, 10 3.5, 0 7\",\n fill: \"currentColor\"\n })\n ])\n ], -1)),\n (h(!0), x(X, null, ve(n.value, (u) => (h(), x(\"path\", {\n key: `${u.id}-hitbox`,\n d: a(u),\n stroke: \"transparent\",\n \"stroke-width\": (u.style?.width || 2) + 10,\n fill: \"none\",\n class: \"connection-hitbox\",\n onDblclick: (i) => r(u)\n }, null, 40, jo))), 128)),\n (h(!0), x(X, null, ve(n.value, (u) => (h(), x(\"path\", {\n id: u.id,\n key: u.id,\n d: a(u),\n stroke: u.style?.color || \"#666\",\n \"stroke-width\": u.style?.width || 2,\n fill: \"none\",\n \"marker-mid\": \"url(#arrowhead-marker)\",\n class: \"connection-path animated-path\",\n onDblclick: (i) => r(u)\n }, null, 40, Jo))), 128))\n ]))\n ]));\n }\n}), el = /* @__PURE__ */ Ve(Ko, [[\"__scopeId\", \"data-v-71911260\"]]), tl = { class: \"column-filter\" }, nl = {\n key: 2,\n class: \"checkbox-filter\"\n}, ol = [\"value\"], ll = {\n key: 5,\n class: \"date-range-filter\"\n}, al = /* @__PURE__ */ oe({\n __name: \"ATableColumnFilter\",\n props: {\n column: {},\n colIndex: {},\n store: {}\n },\n setup(e) {\n const t = R(\"\"), o = sn({\n startValue: \"\",\n endValue: \"\"\n }), n = (u) => {\n if (u.filterOptions) return u.filterOptions;\n const i = /* @__PURE__ */ new Set();\n return e.store.rows.forEach((d) => {\n const p = d[u.name];\n p != null && p !== \"\" && i.add(p);\n }), Array.from(i).map((d) => ({\n value: d,\n label: String(d)\n }));\n }, a = T(() => !!(t.value || o.startValue || o.endValue)), r = (u) => {\n !u && e.column.filterType !== \"checkbox\" ? (e.store.clearFilter(e.colIndex), t.value = \"\") : (t.value = u, e.store.setFilter(e.colIndex, { value: u }));\n }, s = (u, i) => {\n u === \"start\" ? o.startValue = i : o.endValue = i, !o.startValue && !o.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {\n value: null,\n startValue: o.startValue,\n endValue: o.endValue\n });\n }, l = () => {\n t.value = \"\", o.startValue = \"\", o.endValue = \"\", e.store.clearFilter(e.colIndex);\n };\n return (u, i) => (h(), x(\"div\", tl, [\n (e.column.filterType || \"text\") === \"text\" ? K((h(), x(\"input\", {\n key: 0,\n \"onUpdate:modelValue\": i[0] || (i[0] = (d) => t.value = d),\n type: \"text\",\n class: \"filter-input\",\n onInput: i[1] || (i[1] = (d) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"number\" ? K((h(), x(\"input\", {\n key: 1,\n \"onUpdate:modelValue\": i[2] || (i[2] = (d) => t.value = d),\n type: \"number\",\n class: \"filter-input\",\n onInput: i[3] || (i[3] = (d) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"checkbox\" ? (h(), x(\"label\", nl, [\n K(w(\"input\", {\n \"onUpdate:modelValue\": i[4] || (i[4] = (d) => t.value = d),\n type: \"checkbox\",\n class: \"filter-checkbox\",\n onChange: i[5] || (i[5] = (d) => r(t.value))\n }, null, 544), [\n [rn, t.value]\n ]),\n w(\"span\", null, N(e.column.label), 1)\n ])) : e.column.filterType === \"select\" ? K((h(), x(\"select\", {\n key: 3,\n \"onUpdate:modelValue\": i[6] || (i[6] = (d) => t.value = d),\n class: \"filter-select\",\n onChange: i[7] || (i[7] = (d) => r(t.value))\n }, [\n i[15] || (i[15] = w(\"option\", { value: \"\" }, \"All\", -1)),\n (h(!0), x(X, null, ve(n(e.column), (d) => (h(), x(\"option\", {\n key: d.value || d,\n value: d.value || d\n }, N(d.label || d), 9, ol))), 128))\n ], 544)), [\n [Mn, t.value]\n ]) : e.column.filterType === \"date\" ? K((h(), x(\"input\", {\n key: 4,\n \"onUpdate:modelValue\": i[8] || (i[8] = (d) => t.value = d),\n type: \"date\",\n class: \"filter-input\",\n onChange: i[9] || (i[9] = (d) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"dateRange\" ? (h(), x(\"div\", ll, [\n K(w(\"input\", {\n \"onUpdate:modelValue\": i[10] || (i[10] = (d) => o.startValue = d),\n type: \"date\",\n class: \"filter-input\",\n onChange: i[11] || (i[11] = (d) => s(\"start\", o.startValue))\n }, null, 544), [\n [we, o.startValue]\n ]),\n i[16] || (i[16] = w(\"span\", { class: \"date-separator\" }, \"-\", -1)),\n K(w(\"input\", {\n \"onUpdate:modelValue\": i[12] || (i[12] = (d) => o.endValue = d),\n type: \"date\",\n class: \"filter-input\",\n onChange: i[13] || (i[13] = (d) => s(\"end\", o.endValue))\n }, null, 544), [\n [we, o.endValue]\n ])\n ])) : e.column.filterType === \"component\" && e.column.filterComponent ? (h(), me(Ue(e.column.filterComponent), {\n key: 6,\n value: t.value,\n column: e.column,\n colIndex: e.colIndex,\n store: e.store,\n \"onUpdate:value\": i[14] || (i[14] = (d) => r(d))\n }, null, 40, [\"value\", \"column\", \"colIndex\", \"store\"])) : Y(\"\", !0),\n a.value ? (h(), x(\"button\", {\n key: 7,\n onClick: l,\n class: \"clear-btn\",\n title: \"Clear\"\n }, \"ร\")) : Y(\"\", !0)\n ]));\n }\n}), sl = /* @__PURE__ */ Ve(al, [[\"__scopeId\", \"data-v-8487462d\"]]), rl = { key: 0 }, il = {\n class: \"atable-header-row\",\n tabindex: \"-1\"\n}, ul = {\n key: 2,\n class: \"row-actions-header\"\n}, cl = [\"data-colindex\", \"onClick\"], dl = {\n key: 3,\n class: \"row-actions-header\"\n}, fl = {\n key: 0,\n class: \"atable-filters-row\"\n}, vl = {\n key: 2,\n class: \"row-actions-header\"\n}, pl = {\n key: 3,\n class: \"row-actions-header\"\n}, hn = /* @__PURE__ */ oe({\n __name: \"ATableHeader\",\n props: {\n columns: {},\n store: {}\n },\n setup(e) {\n const t = e, o = T(() => t.columns.filter((l) => l.filterable)), n = T(() => t.store.config.value?.rowActions?.enabled ?? !1), a = T(() => t.store.config.value?.rowActions?.position ?? \"before-index\"), r = (l) => t.store.sortByColumn(l), s = (l) => {\n for (const u of l) {\n if (u.borderBoxSize.length === 0) continue;\n const i = u.borderBoxSize[0].inlineSize, d = Number(u.target.dataset.colindex), p = t.store.columns[d]?.width;\n typeof p == \"number\" && p !== i && t.store.resizeColumn(d, i);\n }\n };\n return (l, u) => t.columns.length ? (h(), x(\"thead\", rl, [\n w(\"tr\", il, [\n n.value && a.value === \"before-index\" ? (h(), x(\"th\", {\n key: 0,\n class: se([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : Y(\"\", !0),\n t.store.zeroColumn ? (h(), x(\"th\", {\n key: 1,\n id: \"header-index\",\n class: se([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : Y(\"\", !0),\n n.value && a.value === \"after-index\" ? (h(), x(\"th\", ul)) : Y(\"\", !0),\n (h(!0), x(X, null, ve(t.columns, (i, d) => K((h(), x(\"th\", {\n key: i.name,\n \"data-colindex\": d,\n tabindex: \"-1\",\n style: be(t.store.getHeaderCellStyle(i)),\n class: se(`${i.pinned ? \"sticky-column\" : \"\"} ${i.sortable === !1 ? \"\" : \"cursor-pointer\"}`),\n onClick: (p) => i.sortable !== !1 ? r(d) : void 0\n }, [\n he(l.$slots, \"default\", {}, () => [\n Dt(N(i.label || String.fromCharCode(d + 97).toUpperCase()), 1)\n ])\n ], 14, cl)), [\n [V(zo), s]\n ])), 128)),\n n.value && a.value === \"end\" ? (h(), x(\"th\", dl)) : Y(\"\", !0)\n ]),\n o.value.length > 0 ? (h(), x(\"tr\", fl, [\n n.value && a.value === \"before-index\" ? (h(), x(\"th\", {\n key: 0,\n class: se([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : Y(\"\", !0),\n t.store.zeroColumn ? (h(), x(\"th\", {\n key: 1,\n class: se([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : Y(\"\", !0),\n n.value && a.value === \"after-index\" ? (h(), x(\"th\", vl)) : Y(\"\", !0),\n (h(!0), x(X, null, ve(t.columns, (i, d) => (h(), x(\"th\", {\n key: `filter-${i.name}`,\n class: se(`${i.pinned ? \"sticky-column\" : \"\"}`),\n style: be(t.store.getHeaderCellStyle(i))\n }, [\n i.filterable ? (h(), me(sl, {\n key: 0,\n column: i,\n \"col-index\": d,\n store: t.store\n }, null, 8, [\"column\", \"col-index\", \"store\"])) : Y(\"\", !0)\n ], 6))), 128)),\n n.value && a.value === \"end\" ? (h(), x(\"th\", pl)) : Y(\"\", !0)\n ])) : Y(\"\", !0)\n ])) : Y(\"\", !0);\n }\n}), gn = /* @__PURE__ */ oe({\n __name: \"ATableModal\",\n props: {\n store: {}\n },\n setup(e) {\n const t = fe(\"amodal\"), { width: o, height: n } = _e(t), a = T(() => {\n if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;\n const r = e.store.modal.cell?.closest(\"table\");\n if (!r) return {};\n const s = r.offsetHeight || 0, l = r.offsetWidth || 0;\n let u = e.store.modal.cell?.offsetTop || 0;\n const i = r.querySelector(\"thead\")?.offsetHeight || 0;\n u += i, u = u + n.value < s ? u : u - (n.value + e.store.modal.height);\n let d = e.store.modal.cell?.offsetLeft || 0;\n return d = d + o.value <= l ? d : d - (o.value - e.store.modal.width), {\n left: `${d}px`,\n top: `${u}px`\n };\n });\n return (r, s) => (h(), x(\"div\", {\n ref: \"amodal\",\n class: \"amodal\",\n tabindex: \"-1\",\n style: be(a.value),\n onClick: s[0] || (s[0] = Ie(() => {\n }, [\"stop\"])),\n onInput: s[1] || (s[1] = Ie(() => {\n }, [\"stop\"]))\n }, [\n he(r.$slots, \"default\")\n ], 36));\n }\n}), ml = (e) => {\n const t = e.id || co();\n return Tn(`table-${t}`, () => {\n const o = () => {\n const c = [Object.assign({}, { rowModified: !1 })], v = /* @__PURE__ */ new Set();\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A];\n H.parent !== null && H.parent !== void 0 && v.add(H.parent);\n }\n const M = (A) => a.value[A]?.gantt !== void 0, _ = (A) => {\n for (let H = 0; H < a.value.length; H++)\n if (a.value[H].parent === A && (M(H) || _(H)))\n return !0;\n return !1;\n }, Z = (A) => {\n const H = r.value, U = H.view === \"tree\" || H.view === \"tree-gantt\" ? H.defaultTreeExpansion : void 0;\n if (!U) return !0;\n switch (U) {\n case \"root\":\n return !1;\n // Only root nodes are visible, all children start collapsed\n case \"branch\":\n return _(A);\n case \"leaf\":\n return !0;\n // All nodes should be expanded\n default:\n return !0;\n }\n };\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A], U = H.parent === null || H.parent === void 0, ae = v.has(A);\n c[A] = {\n childrenOpen: Z(A),\n expanded: !1,\n indent: H.indent || 0,\n isParent: ae,\n isRoot: U,\n rowModified: !1,\n open: U,\n // This will be recalculated later for non-root nodes\n parent: H.parent\n };\n }\n return c;\n }, n = R(e.columns), a = R(e.rows), r = R(e.config || {}), s = R({}), l = R({}), u = T(() => {\n const c = {};\n for (const [v, M] of n.value.entries())\n for (const [_, Z] of a.value.entries())\n c[`${v}:${_}`] = Z[M.name];\n return c;\n }), i = T({\n get: () => {\n const c = o();\n for (let v = 0; v < c.length; v++)\n s.value[v] && (c[v].rowModified = s.value[v]), l.value[v] && (l.value[v].childrenOpen !== void 0 && (c[v].childrenOpen = l.value[v].childrenOpen), l.value[v].expanded !== void 0 && (c[v].expanded = l.value[v].expanded));\n if (C.value) {\n const v = (M, _) => {\n const Z = _[M];\n if (Z.isRoot || Z.parent === null || Z.parent === void 0)\n return !0;\n const A = Z.parent;\n return A < 0 || A >= _.length ? !1 : (_[A].childrenOpen || !1) && v(A, _);\n };\n for (let M = 0; M < c.length; M++)\n c[M].isRoot || (c[M].open = v(M, c));\n }\n return c;\n },\n set: (c) => {\n JSON.stringify(c) !== JSON.stringify(i.value) && (i.value = c);\n }\n }), d = R(e.modal || { visible: !1 }), p = R({}), y = R([]), k = R([]), g = R([]), b = R({\n column: null,\n direction: null\n }), f = R({}), m = T(() => n.value.some((c) => c.pinned)), I = T(() => r.value.view === \"gantt\" || r.value.view === \"tree-gantt\"), C = T(() => r.value.view === \"tree\" || r.value.view === \"tree-gantt\"), $ = T(() => {\n const c = r.value;\n return c.view === \"gantt\" || c.view === \"tree-gantt\" ? c.dependencyGraph !== !1 : !0;\n }), L = T(() => `${Math.ceil(a.value.length / 100 + 1)}ch`), S = T(\n () => r.value.view ? [\"list\", \"tree\", \"tree-gantt\", \"list-expansion\"].includes(r.value.view) : !1\n ), O = T(() => {\n let c = a.value.map((v, M) => ({\n ...v,\n originalIndex: M\n }));\n if (Object.entries(f.value).forEach(([v, M]) => {\n const _ = parseInt(v), Z = n.value[_];\n !Z || !(M.value || M.startValue || M.endValue || Z.filterType === \"checkbox\" && M.value !== void 0) || (c = c.filter((A) => {\n const H = A[Z.name];\n return le(H, M, Z);\n }));\n }), b.value.column !== null && b.value.direction) {\n const v = n.value[b.value.column], M = b.value.direction;\n c.sort((_, Z) => {\n let A = _[v.name], H = Z[v.name];\n A == null && (A = \"\"), H == null && (H = \"\");\n const U = Number(A), ae = Number(H);\n if (!isNaN(U) && !isNaN(ae) && A !== \"\" && H !== \"\")\n return M === \"asc\" ? U - ae : ae - U;\n {\n const tt = String(A).toLowerCase(), Ut = String(H).toLowerCase();\n return M === \"asc\" ? tt.localeCompare(Ut) : Ut.localeCompare(tt);\n }\n });\n }\n return c;\n }), W = (c, v) => u.value[`${c}:${v}`], pe = (c, v, M) => {\n const _ = `${c}:${v}`, Z = n.value[c];\n u.value[_] !== M && (s.value[v] = !0), u.value[_] = M, a.value[v] = {\n ...a.value[v],\n [Z.name]: M\n };\n }, j = (c) => {\n a.value = c;\n }, J = (c, v, M) => {\n const _ = `${c}:${v}`;\n u.value[_] !== M && (s.value[v] = !0, p.value[_] = M);\n }, ge = (c) => {\n const v = n.value.indexOf(c) === n.value.length - 1, M = r.value.fullWidth ? c.resizable && !v : c.resizable;\n return {\n width: c.width || \"40ch\",\n textAlign: c.align || \"center\",\n ...M && {\n resize: \"horizontal\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\"\n }\n };\n }, de = (c, v) => {\n if (c < 0 || c >= n.value.length) return;\n const M = Math.max(v, 40);\n n.value[c] = {\n ...n.value[c],\n width: `${M}px`\n };\n }, Oe = (c) => {\n const v = a.value[c];\n return I.value && v.gantt !== void 0;\n }, Re = (c) => !C.value || i.value[c].isRoot || i.value[c].open, Ye = (c) => !C.value && r.value.view !== \"list-expansion\" ? \"\" : C.value && (i.value[c].isRoot || i.value[c].isParent) ? i.value[c].childrenOpen ? \"โผ\" : \"โบ\" : r.value.view === \"list-expansion\" ? i.value[c].expanded ? \"โผ\" : \"โบ\" : \"\", Xe = (c) => {\n if (C.value) {\n const v = l.value[c] || {}, M = !(v.childrenOpen ?? i.value[c].childrenOpen);\n l.value[c] = {\n ...v,\n childrenOpen: M\n }, M || Be(c);\n } else if (r.value.view === \"list-expansion\") {\n const v = l.value[c] || {}, M = v.expanded ?? i.value[c].expanded;\n l.value[c] = {\n ...v,\n expanded: !M\n };\n }\n }, Be = (c) => {\n for (let v = 0; v < a.value.length; v++)\n if (i.value[v].parent === c) {\n const M = l.value[v] || {};\n l.value[v] = {\n ...M,\n childrenOpen: !1\n }, Be(v);\n }\n }, je = (c, v) => {\n const M = W(c, v);\n return Fe(c, v, M);\n }, Fe = (c, v, M) => {\n const _ = n.value[c], Z = a.value[v], A = _.format;\n return A ? typeof A == \"function\" ? A(M, { table: u.value, row: Z, column: _ }) : typeof A == \"string\" ? Function(`\"use strict\";return (${A})`)()(M, { table: u.value, row: Z, column: _ }) : M : M;\n }, D = (c) => {\n c.target instanceof Node && d.value.parent?.contains(c.target) || d.value.visible && (d.value.visible = !1);\n }, F = (c, v) => v && c === 0 && v > 0 ? `${v}ch` : \"inherit\", G = (c) => {\n const v = a.value[c.rowIndex]?.gantt;\n v && (c.type === \"resize\" ? c.edge === \"start\" ? (v.startIndex = c.newStart, v.endIndex = c.end, v.colspan = v.endIndex - v.startIndex) : c.edge === \"end\" && (v.startIndex = c.start, v.endIndex = c.newEnd, v.colspan = v.endIndex - v.startIndex) : c.type === \"bar\" && (v.startIndex = c.newStart, v.endIndex = c.newEnd, v.colspan = v.endIndex - v.startIndex));\n }, Q = (c) => {\n const v = y.value.findIndex((M) => M.id === c.id);\n v >= 0 ? y.value[v] = c : y.value.push(c);\n }, q = (c) => {\n const v = y.value.findIndex((M) => M.id === c);\n v >= 0 && y.value.splice(v, 1);\n }, re = (c) => {\n const v = k.value.findIndex((M) => M.id === c.id);\n v >= 0 ? k.value[v] = c : k.value.push(c);\n }, ke = (c) => {\n const v = k.value.findIndex((M) => M.id === c);\n v >= 0 && k.value.splice(v, 1);\n }, Le = (c, v, M) => {\n const _ = k.value.find((H) => H.id === c), Z = k.value.find((H) => H.id === v);\n if (!_ || !Z)\n return console.warn(\"Cannot create connection: handle not found\"), null;\n const A = {\n id: `connection-${c}-${v}`,\n from: {\n barId: _.barId,\n side: _.side\n },\n to: {\n barId: Z.barId,\n side: Z.side\n },\n style: M?.style,\n label: M?.label\n };\n return g.value.push(A), A;\n }, P = (c) => {\n const v = g.value.findIndex((M) => M.id === c);\n return v >= 0 ? (g.value.splice(v, 1), !0) : !1;\n }, B = (c) => g.value.filter((v) => v.from.barId === c || v.to.barId === c), z = (c) => k.value.filter((v) => v.barId === c), ee = (c) => {\n if (n.value[c].sortable === !1) return;\n let v;\n b.value.column === c && b.value.direction === \"asc\" ? v = \"desc\" : v = \"asc\", b.value.column = c, b.value.direction = v;\n }, le = (c, v, M) => {\n const _ = M.filterType || \"text\", Z = v.value;\n if (!Z && _ !== \"dateRange\" && _ !== \"checkbox\") return !0;\n switch (_) {\n case \"text\": {\n let A = \"\";\n return typeof c == \"object\" && c !== null ? A = Object.values(c).join(\" \") : A = String(c || \"\"), A.toLowerCase().includes(String(Z).toLowerCase());\n }\n case \"number\": {\n const A = Number(c), H = Number(Z);\n return !isNaN(A) && !isNaN(H) && A === H;\n }\n case \"select\":\n return c === Z;\n case \"checkbox\":\n return Z === !0 ? !!c : !0;\n case \"date\": {\n let A;\n if (typeof c == \"number\") {\n const U = new Date(c), ae = (/* @__PURE__ */ new Date()).getFullYear();\n A = new Date(ae, U.getMonth(), U.getDate());\n } else\n A = new Date(String(c));\n const H = new Date(String(Z));\n return A.toDateString() === H.toDateString();\n }\n case \"dateRange\": {\n const A = v.startValue, H = v.endValue;\n if (!A && !H) return !0;\n let U;\n if (typeof c == \"number\") {\n const ae = new Date(c), tt = (/* @__PURE__ */ new Date()).getFullYear();\n U = new Date(tt, ae.getMonth(), ae.getDate());\n } else\n U = new Date(String(c));\n return !(A && U < new Date(String(A)) || H && U > new Date(String(H)));\n }\n default:\n return !0;\n }\n }, te = (c, v) => {\n !v.value && !v.startValue && !v.endValue ? delete f.value[c] : f.value[c] = v;\n }, ie = (c) => {\n delete f.value[c];\n }, ce = (c, v = \"end\") => {\n const M = {};\n for (const Z of n.value)\n M[Z.name] = \"\";\n c && Object.assign(M, c);\n let _;\n return v === \"start\" ? (_ = 0, a.value.unshift(M)) : v === \"end\" ? (_ = a.value.length, a.value.push(M)) : (_ = Math.max(0, Math.min(v, a.value.length)), a.value.splice(_, 0, M)), _;\n };\n return {\n // state\n columns: n,\n config: r,\n connectionHandles: k,\n connectionPaths: g,\n display: i,\n filterState: f,\n ganttBars: y,\n modal: d,\n rows: a,\n sortState: b,\n table: u,\n updates: p,\n // getters\n filteredRows: O,\n hasPinnedColumns: m,\n isGanttView: I,\n isTreeView: C,\n isDependencyGraphEnabled: $,\n numberedRowWidth: L,\n zeroColumn: S,\n // actions\n addRow: ce,\n clearFilter: ie,\n closeModal: D,\n createConnection: Le,\n deleteConnection: P,\n deleteRow: (c) => {\n if (c < 0 || c >= a.value.length)\n return null;\n const [v] = a.value.splice(c, 1);\n delete s.value[c], delete l.value[c];\n const M = {}, _ = {};\n for (const [Z, A] of Object.entries(s.value)) {\n const H = parseInt(Z);\n H > c ? M[H - 1] = A : M[H] = A;\n }\n for (const [Z, A] of Object.entries(l.value)) {\n const H = parseInt(Z);\n H > c ? _[H - 1] = A : _[H] = A;\n }\n return s.value = M, l.value = _, v;\n },\n duplicateRow: (c) => {\n if (c < 0 || c >= a.value.length)\n return -1;\n const v = a.value[c], M = JSON.parse(JSON.stringify(v)), _ = c + 1;\n return a.value.splice(_, 0, M), _;\n },\n getCellData: W,\n getCellDisplayValue: je,\n getConnectionsForBar: B,\n getFormattedValue: Fe,\n getHandlesForBar: z,\n getHeaderCellStyle: ge,\n getIndent: F,\n getRowExpandSymbol: Ye,\n insertRowAbove: (c, v) => {\n const M = Math.max(0, c);\n return ce(v, M);\n },\n insertRowBelow: (c, v) => {\n const M = Math.min(c + 1, a.value.length);\n return ce(v, M);\n },\n isRowGantt: Oe,\n isRowVisible: Re,\n moveRow: (c, v) => {\n if (c < 0 || c >= a.value.length || v < 0 || v >= a.value.length || c === v)\n return !1;\n const [M] = a.value.splice(c, 1);\n a.value.splice(v, 0, M);\n const _ = {}, Z = {};\n for (const [A, H] of Object.entries(s.value)) {\n const U = parseInt(A);\n let ae = U;\n U === c ? ae = v : c < v ? U > c && U <= v && (ae = U - 1) : U >= v && U < c && (ae = U + 1), _[ae] = H;\n }\n for (const [A, H] of Object.entries(l.value)) {\n const U = parseInt(A);\n let ae = U;\n U === c ? ae = v : c < v ? U > c && U <= v && (ae = U - 1) : U >= v && U < c && (ae = U + 1), Z[ae] = H;\n }\n return s.value = _, l.value = Z, !0;\n },\n registerConnectionHandle: re,\n registerGanttBar: Q,\n resizeColumn: de,\n setCellData: pe,\n setCellText: J,\n setFilter: te,\n sortByColumn: ee,\n toggleRowExpand: Xe,\n unregisterConnectionHandle: ke,\n unregisterGanttBar: q,\n updateGanttBar: G,\n updateRows: j\n };\n })();\n}, hl = {\n class: \"atable-container\",\n style: { position: \"relative\" }\n}, gl = /* @__PURE__ */ oe({\n __name: \"ATable\",\n props: /* @__PURE__ */ xe({\n id: { default: \"\" },\n config: { default: () => new Object() }\n }, {\n rows: { required: !0 },\n rowsModifiers: {},\n columns: { required: !0 },\n columnsModifiers: {}\n }),\n emits: /* @__PURE__ */ xe([\"cellUpdate\", \"gantt:drag\", \"connection:event\", \"columns:update\", \"row:add\", \"row:delete\", \"row:duplicate\", \"row:insert-above\", \"row:insert-below\", \"row:move\"], [\"update:rows\", \"update:columns\"]),\n setup(e, { expose: t, emit: o }) {\n const n = Me(e, \"rows\"), a = Me(e, \"columns\"), r = o, s = fe(\"table\"), l = ml({ columns: a.value, rows: n.value, id: e.id, config: e.config });\n l.$onAction(({ name: g, store: b, args: f, after: m }) => {\n if (g === \"setCellData\" || g === \"setCellText\") {\n const [I, C, $] = f, L = b.getCellData(I, C);\n m(() => {\n n.value = [...b.rows], r(\"cellUpdate\", { colIndex: I, rowIndex: C, newValue: $, oldValue: L });\n });\n } else if (g === \"updateGanttBar\") {\n const [I] = f;\n let C = !1;\n I.type === \"resize\" ? C = I.oldColspan !== I.newColspan : I.type === \"bar\" && (C = I.oldStart !== I.newStart || I.oldEnd !== I.newEnd), C && m(() => {\n r(\"gantt:drag\", I);\n });\n } else g === \"resizeColumn\" && m(() => {\n a.value = [...b.columns], r(\"columns:update\", [...b.columns]);\n });\n }), ne(\n () => n.value,\n (g) => {\n JSON.stringify(g) !== JSON.stringify(l.rows) && (l.rows = [...g]);\n },\n { deep: !0 }\n ), ne(\n a,\n (g) => {\n JSON.stringify(g) !== JSON.stringify(l.columns) && (l.columns = [...g], r(\"columns:update\", [...g]));\n },\n { deep: !0 }\n ), Ee(() => {\n a.value.some((g) => g.pinned) && (i(), l.isTreeView && pn(s, i, { childList: !0, subtree: !0 }));\n });\n const u = T(() => l.columns.filter((g) => g.pinned).length), i = () => {\n const g = s.value, b = g?.rows[0], f = g?.rows[1], m = b ? Array.from(b.cells) : [];\n for (const [I, C] of m.entries()) {\n const $ = f?.cells[I];\n $ && (C.style.width = `${$.offsetWidth}px`);\n }\n for (const I of g?.rows || []) {\n let C = 0;\n const $ = [];\n for (const L of I.cells)\n (L.classList.contains(\"sticky-column\") || L.classList.contains(\"sticky-index\")) && (L.style.left = `${C}px`, C += L.offsetWidth, $.push(L));\n $.length > 0 && $[$.length - 1].classList.add(\"sticky-column-edge\");\n }\n };\n window.addEventListener(\"keydown\", (g) => {\n if (g.key === \"Escape\" && l.modal.visible) {\n l.modal.visible = !1;\n const b = l.modal.parent;\n b && vt().then(() => {\n b.focus();\n });\n }\n });\n const d = (g) => {\n if (!g.gantt || u.value === 0)\n return l.columns;\n const b = [];\n for (let f = 0; f < u.value; f++) {\n const m = { ...l.columns[f] };\n m.originalIndex = f, b.push(m);\n }\n return b.push({\n ...l.columns[u.value],\n isGantt: !0,\n colspan: g.gantt?.colspan || l.columns.length - u.value,\n originalIndex: u.value,\n width: \"auto\"\n // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable\n }), b;\n }, p = (g) => {\n r(\"connection:event\", { type: \"create\", connection: g });\n }, y = (g) => {\n r(\"connection:event\", { type: \"delete\", connection: g });\n }, k = (g, b) => {\n switch (g) {\n case \"add\": {\n const f = l.addRow({}, b + 1), m = l.rows[f];\n n.value = [...l.rows], r(\"row:add\", { rowIndex: f, row: m });\n break;\n }\n case \"delete\": {\n const f = l.deleteRow(b);\n f && (n.value = [...l.rows], r(\"row:delete\", { rowIndex: b, row: f }));\n break;\n }\n case \"duplicate\": {\n const f = l.duplicateRow(b);\n if (f >= 0) {\n const m = l.rows[f];\n n.value = [...l.rows], r(\"row:duplicate\", { sourceIndex: b, newIndex: f, row: m });\n }\n break;\n }\n case \"insertAbove\": {\n const f = l.insertRowAbove(b), m = l.rows[f];\n n.value = [...l.rows], r(\"row:insert-above\", { targetIndex: b, newIndex: f, row: m });\n break;\n }\n case \"insertBelow\": {\n const f = l.insertRowBelow(b), m = l.rows[f];\n n.value = [...l.rows], r(\"row:insert-below\", { targetIndex: b, newIndex: f, row: m });\n break;\n }\n case \"move\": {\n r(\"row:move\", { fromIndex: b, toIndex: -1 });\n break;\n }\n }\n };\n return t({\n store: l,\n createConnection: l.createConnection,\n deleteConnection: l.deleteConnection,\n getConnectionsForBar: l.getConnectionsForBar,\n getHandlesForBar: l.getHandlesForBar,\n // Row action methods\n addRow: l.addRow,\n deleteRow: l.deleteRow,\n duplicateRow: l.duplicateRow,\n insertRowAbove: l.insertRowAbove,\n insertRowBelow: l.insertRowBelow,\n moveRow: l.moveRow\n }), (g, b) => (h(), x(\"div\", hl, [\n K((h(), x(\"table\", {\n ref: \"table\",\n class: \"atable\",\n style: be({\n width: V(l).config.fullWidth ? \"100%\" : \"auto\"\n })\n }, [\n he(g.$slots, \"header\", { data: V(l) }, () => [\n ct(hn, {\n columns: V(l).columns,\n store: V(l)\n }, null, 8, [\"columns\", \"store\"])\n ], !0),\n w(\"tbody\", null, [\n he(g.$slots, \"body\", { data: V(l) }, () => [\n (h(!0), x(X, null, ve(V(l).filteredRows, (f, m) => (h(), me(mn, {\n key: `${f.originalIndex}-${m}`,\n row: f,\n rowIndex: f.originalIndex,\n store: V(l),\n \"onRow:action\": k\n }, {\n default: $t(() => [\n (h(!0), x(X, null, ve(d(f), (I, C) => (h(), x(X, {\n key: I.name\n }, [\n I.isGantt ? (h(), me(Ue(I.ganttComponent || \"AGanttCell\"), {\n key: 0,\n store: V(l),\n \"columns-count\": V(l).columns.length - u.value,\n color: f.gantt?.color,\n start: f.gantt?.startIndex,\n end: f.gantt?.endIndex,\n colspan: I.colspan,\n pinned: I.pinned,\n rowIndex: f.originalIndex,\n colIndex: I.originalIndex ?? C,\n style: be({\n textAlign: I?.align || \"center\",\n minWidth: I?.width || \"40ch\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n \"onConnection:create\": p\n }, null, 40, [\"store\", \"columns-count\", \"color\", \"start\", \"end\", \"colspan\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"])) : (h(), me(Ue(I.cellComponent || \"ACell\"), {\n key: 1,\n store: V(l),\n pinned: I.pinned,\n rowIndex: f.originalIndex,\n colIndex: C,\n style: be({\n textAlign: I?.align || \"center\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n spellcheck: \"false\"\n }, null, 8, [\"store\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"]))\n ], 64))), 128))\n ]),\n _: 2\n }, 1032, [\"row\", \"rowIndex\", \"store\"]))), 128))\n ], !0)\n ]),\n he(g.$slots, \"footer\", { data: V(l) }, void 0, !0),\n he(g.$slots, \"modal\", { data: V(l) }, () => [\n K(ct(gn, { store: V(l) }, {\n default: $t(() => [\n (h(), me(Ue(V(l).modal.component), ft({\n key: `${V(l).modal.rowIndex}:${V(l).modal.colIndex}`,\n \"col-index\": V(l).modal.colIndex,\n \"row-index\": V(l).modal.rowIndex,\n store: V(l)\n }, V(l).modal.componentProps), null, 16, [\"col-index\", \"row-index\", \"store\"]))\n ]),\n _: 1\n }, 8, [\"store\"]), [\n [Ce, V(l).modal.visible]\n ])\n ], !0)\n ], 4)), [\n [V(Go), V(l).closeModal]\n ]),\n V(l).isGanttView && V(l).isDependencyGraphEnabled ? (h(), me(el, {\n key: 0,\n store: V(l),\n \"onConnection:delete\": y\n }, null, 8, [\"store\"])) : Y(\"\", !0)\n ]));\n }\n}), wl = /* @__PURE__ */ Ve(gl, [[\"__scopeId\", \"data-v-3d00d51b\"]]), yl = {}, bl = { class: \"aloading\" }, xl = { class: \"aloading-header\" };\nfunction kl(e, t) {\n return h(), x(\"div\", bl, [\n w(\"h2\", xl, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = w(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst Il = /* @__PURE__ */ Ve(yl, [[\"render\", kl], [\"__scopeId\", \"data-v-a930a25b\"]]), Ml = {}, Cl = { class: \"aloading\" }, El = { class: \"aloading-header\" };\nfunction Al(e, t) {\n return h(), x(\"div\", Cl, [\n w(\"h2\", El, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = w(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst $l = /* @__PURE__ */ Ve(Ml, [[\"render\", Al], [\"__scopeId\", \"data-v-e1165876\"]]);\nfunction Tl(e) {\n e.component(\"ACell\", mo), e.component(\"AExpansionRow\", bo), e.component(\"AGanttCell\", Ao), e.component(\"ARow\", mn), e.component(\"ARowActions\", it), e.component(\"ATable\", wl), e.component(\"ATableHeader\", hn), e.component(\"ATableLoading\", Il), e.component(\"ATableLoadingBar\", $l), e.component(\"ATableModal\", gn);\n}\nconst Dl = { class: \"aform_form-element\" }, Sl = { class: \"aform_field-label\" }, Rl = { class: \"aform_display-value\" }, Ll = [\"for\"], Hl = { class: \"aform_checkbox-container aform_input-field\" }, Vl = [\"id\", \"disabled\", \"required\"], _l = [\"innerHTML\"], Pl = /* @__PURE__ */ oe({\n __name: \"ACheckbox\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: { type: [Boolean, String, Array, Set] },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\");\n return (o, n) => (h(), x(\"div\", Dl, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"label\", Sl, N(e.label), 1),\n w(\"span\", Rl, N(t.value ? \"โ\" : \"โ\"), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n w(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, N(e.label), 9, Ll),\n w(\"span\", Hl, [\n K(w(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": n[0] || (n[0] = (a) => t.value = a),\n type: \"checkbox\",\n class: \"aform_checkbox\",\n disabled: e.mode === \"read\",\n required: e.required\n }, null, 8, Vl), [\n [rn, t.value]\n ])\n ]),\n K(w(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, _l), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n}), Te = (e, t) => {\n const o = e.__vccOpts || e;\n for (const [n, a] of t)\n o[n] = a;\n return o;\n}, Ol = /* @__PURE__ */ Te(Pl, [[\"__scopeId\", \"data-v-cc185b72\"]]), Bl = /* @__PURE__ */ oe({\n __name: \"AComboBox\",\n props: {\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {},\n event: {},\n cellData: {},\n tableID: {}\n },\n setup(e) {\n return (t, o) => {\n const n = cn(\"ATableModal\");\n return h(), me(n, {\n event: e.event,\n \"cell-data\": e.cellData,\n class: \"amodal\"\n }, {\n default: $t(() => [...o[0] || (o[0] = [\n w(\"div\", null, [\n w(\"input\", { type: \"text\" }),\n w(\"input\", { type: \"text\" }),\n w(\"input\", { type: \"text\" })\n ], -1)\n ])]),\n _: 1\n }, 8, [\"event\", \"cell-data\"]);\n };\n }\n}), Fl = { class: \"aform_display-value\" }, Zl = [\"id\", \"disabled\", \"required\"], Nl = [\"for\"], Ul = [\"innerHTML\"], Wl = /* @__PURE__ */ oe({\n __name: \"ADate\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: { default: \"Date\" },\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: {\n // format the date to be compatible with the native input datepicker\n },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\", {\n // format the date to be compatible with the native input datepicker\n set: (a) => new Date(a).toISOString().split(\"T\")[0]\n }), o = fe(\"date\"), n = () => {\n o.value && \"showPicker\" in HTMLInputElement.prototype && o.value.showPicker();\n };\n return (a, r) => (h(), x(\"div\", null, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", Fl, N(t.value ? new Date(t.value).toLocaleDateString() : \"\"), 1),\n w(\"label\", null, N(e.label), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n K(w(\"input\", {\n id: e.uuid,\n ref: \"date\",\n \"onUpdate:modelValue\": r[0] || (r[0] = (s) => t.value = s),\n type: \"date\",\n disabled: e.mode === \"read\",\n required: e.required,\n onClick: n\n }, null, 8, Zl), [\n [we, t.value]\n ]),\n w(\"label\", { for: e.uuid }, N(e.label), 9, Nl),\n K(w(\"p\", {\n innerHTML: e.validation.errorMessage\n }, null, 8, Ul), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n}), Gl = /* @__PURE__ */ Te(Wl, [[\"__scopeId\", \"data-v-425aef3c\"]]);\nfunction wn(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\n// @__NO_SIDE_EFFECTS__\nfunction jt() {\n const e = /* @__PURE__ */ new Set(), t = (r) => {\n e.delete(r);\n };\n return {\n on: (r) => {\n e.add(r);\n const s = () => t(r);\n return wn(s), { off: s };\n },\n off: t,\n trigger: (...r) => Promise.all(Array.from(e).map((s) => s(...r))),\n clear: () => {\n e.clear();\n }\n };\n}\nconst yn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst zl = Object.prototype.toString, ql = (e) => zl.call(e) === \"[object Object]\", Je = () => {\n}, Yl = (e, t) => Object.prototype.hasOwnProperty.call(e, t);\nfunction Xl(...e) {\n if (e.length !== 1) return un(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: Je\n }))) : R(t);\n}\nfunction It(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction jl(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst bn = yn ? window : void 0, Jl = yn ? window.document : void 0;\nfunction Ne(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction Mt(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = It(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return jl(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => Ne(r))) !== null && n !== void 0 ? n : [bn].filter((r) => r != null),\n It(E(o.value ? e[1] : e[0])),\n It(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = ql(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction Jt(e, t, o = {}) {\n const { window: n = bn, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = o;\n if (!n) return l ? {\n stop: Je,\n cancel: Je,\n trigger: Je\n } : Je;\n let u = !0;\n const i = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(n.document.querySelectorAll(m)).some((I) => I === f.target || f.composedPath().includes(I));\n {\n const I = Ne(m);\n return I && (f.target === I || f.composedPath().includes(I));\n }\n });\n function d(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const I = E(f), C = I.$.subTree && I.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some(($) => $.el === m.target || m.composedPath().includes($.el));\n }\n const y = (f) => {\n const m = Ne(e);\n if (f.target != null && !(!(m instanceof Element) && d(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (u = !i(f)), !u) {\n u = !0;\n return;\n }\n t(f);\n }\n };\n let k = !1;\n const g = [\n Mt(n, \"click\", (f) => {\n k || (k = !0, setTimeout(() => {\n k = !1;\n }, 0), y(f));\n }, {\n passive: !0,\n capture: r\n }),\n Mt(n, \"pointerdown\", (f) => {\n const m = Ne(e);\n u = !i(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && Mt(n, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const I = Ne(e);\n ((m = n.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !I?.contains(n.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), b = () => g.forEach((f) => f());\n return l ? {\n stop: b,\n cancel: () => {\n u = !1;\n },\n trigger: (f) => {\n u = !0, y(f), u = !1;\n }\n } : b;\n}\nconst Ql = {\n multiple: !0,\n accept: \"*\",\n reset: !1,\n directory: !1\n};\nfunction Kl(e) {\n if (!e) return null;\n if (e instanceof FileList) return e;\n const t = new DataTransfer();\n for (const o of e) t.items.add(o);\n return t.files;\n}\nfunction ea(e = {}) {\n const { document: t = Jl } = e, o = R(Kl(e.initialFiles)), { on: n, trigger: a } = /* @__PURE__ */ jt(), { on: r, trigger: s } = /* @__PURE__ */ jt(), l = T(() => {\n var p;\n const y = (p = Ne(e.input)) !== null && p !== void 0 ? p : t ? t.createElement(\"input\") : void 0;\n return y && (y.type = \"file\", y.onchange = (k) => {\n o.value = k.target.files, a(o.value);\n }, y.oncancel = () => {\n s();\n }), y;\n }), u = () => {\n o.value = null, l.value && l.value.value && (l.value.value = \"\", a(null));\n }, i = (p) => {\n const y = l.value;\n y && (y.multiple = E(p.multiple), y.accept = E(p.accept), y.webkitdirectory = E(p.directory), Yl(p, \"capture\") && (y.capture = E(p.capture)));\n }, d = (p) => {\n const y = l.value;\n if (!y) return;\n const k = {\n ...Ql,\n ...e,\n ...p\n };\n i(k), E(k.reset) && u(), y.click();\n };\n return gt(() => {\n i(e);\n }), {\n files: Rt(o),\n open: d,\n reset: u,\n onCancel: r,\n onChange: n\n };\n}\nfunction Ct(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst Et = /* @__PURE__ */ new WeakMap();\nfunction ta(e, t = !1) {\n const o = ue(t);\n let n = \"\";\n ne(Xl(e), (s) => {\n const l = Ct(E(s));\n if (l) {\n const u = l;\n if (Et.get(u) || Et.set(u, u.style.overflow), u.style.overflow !== \"hidden\" && (n = u.style.overflow), u.style.overflow === \"hidden\") return o.value = !0;\n if (o.value) return u.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = Ct(E(e));\n !s || o.value || (s.style.overflow = \"hidden\", o.value = !0);\n }, r = () => {\n const s = Ct(E(e));\n !s || !o.value || (s.style.overflow = n, Et.delete(s), o.value = !1);\n };\n return wn(r), T({\n get() {\n return o.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst At = /* @__PURE__ */ new WeakMap(), na = {\n mounted(e, t) {\n const o = !t.modifiers.bubble;\n let n;\n if (typeof t.value == \"function\") n = Jt(e, t.value, { capture: o });\n else {\n const [a, r] = t.value;\n n = Jt(e, a, Object.assign({ capture: o }, r));\n }\n At.set(e, n);\n },\n unmounted(e) {\n const t = At.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), At.delete(e);\n }\n};\nfunction oa() {\n let e = !1;\n const t = ue(!1);\n return (o, n) => {\n if (t.value = n.value, e) return;\n e = !0;\n const a = ta(o, n.value);\n ne(t, (r) => a.value = r);\n };\n}\noa();\nconst la = {\n key: 0,\n class: \"input-wrapper\"\n}, aa = { class: \"aform_display-value\" }, sa = { class: \"input-wrapper\" }, ra = [\"disabled\"], ia = {\n id: \"autocomplete-results\",\n class: \"autocomplete-results\"\n}, ua = {\n key: 0,\n class: \"loading autocomplete-result\"\n}, ca = [\"onClick\"], da = /* @__PURE__ */ oe({\n __name: \"ADropdown\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {},\n options: { default: () => [] },\n isAsync: { type: Boolean, default: !1 },\n filterFunction: { type: Function, default: void 0 }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\"), o = R(t.value ?? \"\"), n = sn({\n activeItemIndex: null,\n open: !1,\n loading: !1,\n results: e.options\n }), a = () => u(), r = async () => {\n if (n.open = !0, n.activeItemIndex = null, e.filterFunction) {\n e.isAsync && (n.loading = !0);\n try {\n const k = await e.filterFunction(t.value || \"\");\n n.results = k || [];\n } catch {\n n.results = [];\n } finally {\n e.isAsync && (n.loading = !1);\n }\n } else\n i();\n }, s = (k) => {\n t.value = k, o.value = k, u(k);\n }, l = () => {\n const k = e.options?.indexOf(t.value ?? \"\") ?? -1;\n n.activeItemIndex = e.isAsync ? null : k >= 0 ? k : null, n.open = !0, n.results = e.isAsync ? [] : e.options;\n }, u = (k) => {\n n.activeItemIndex = null, n.open = !1, e.options?.includes(k || t.value || \"\") || (t.value = o.value);\n }, i = () => {\n t.value ? n.results = e.options?.filter((k) => k.toLowerCase().includes((t.value ?? \"\").toLowerCase())) : n.results = e.options;\n }, d = () => {\n const k = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const g = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n n.activeItemIndex = (g + 1) % k;\n } else\n n.activeItemIndex = 0;\n }, p = () => {\n const k = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const g = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n g === 0 ? n.activeItemIndex = null : n.activeItemIndex = g - 1;\n } else\n n.activeItemIndex = k - 1;\n }, y = () => {\n if (n.results) {\n const k = n.activeItemIndex || 0, g = n.results[k];\n s(g);\n }\n n.activeItemIndex = 0;\n };\n return (k, g) => e.mode === \"display\" ? (h(), x(\"div\", la, [\n w(\"span\", aa, N(t.value ?? \"\"), 1),\n w(\"label\", null, N(e.label), 1)\n ])) : K((h(), x(\"div\", {\n key: 1,\n class: se([\"autocomplete\", { isOpen: n.open }])\n }, [\n w(\"div\", sa, [\n K(w(\"input\", {\n \"onUpdate:modelValue\": g[0] || (g[0] = (b) => t.value = b),\n type: \"text\",\n disabled: e.mode === \"read\",\n onInput: r,\n onFocus: l,\n onKeydown: [\n Ze(d, [\"down\"]),\n Ze(p, [\"up\"]),\n Ze(y, [\"enter\"]),\n Ze(a, [\"esc\"]),\n Ze(a, [\"tab\"])\n ]\n }, null, 40, ra), [\n [we, t.value]\n ]),\n K(w(\"ul\", ia, [\n n.loading ? (h(), x(\"li\", ua, \"Loading results...\")) : (h(!0), x(X, { key: 1 }, ve(n.results, (b, f) => (h(), x(\"li\", {\n key: b,\n class: se([\"autocomplete-result\", { \"is-active\": f === n.activeItemIndex }]),\n onClick: Ie((m) => s(b), [\"stop\"])\n }, N(b), 11, ca))), 128))\n ], 512), [\n [Ce, n.open]\n ]),\n w(\"label\", null, N(e.label), 1)\n ])\n ], 2)), [\n [V(na), a]\n ]);\n }\n}), fa = /* @__PURE__ */ Te(da, [[\"__scopeId\", \"data-v-e25d4181\"]]);\nfunction xn(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\nconst va = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst pa = (e) => e != null, ma = Object.prototype.toString, ha = (e) => ma.call(e) === \"[object Object]\", ga = () => {\n};\nfunction ut(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction wa(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst qe = va ? window : void 0;\nfunction Ge(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction Ke(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = ut(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return wa(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => Ge(r))) !== null && n !== void 0 ? n : [qe].filter((r) => r != null),\n ut(E(o.value ? e[1] : e[0])),\n ut(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = ha(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction ya() {\n const e = ue(!1), t = ht();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction ba(e) {\n const t = /* @__PURE__ */ ya();\n return T(() => (t.value, !!e()));\n}\nfunction xa(e, t, o = {}) {\n const { window: n = qe, ...a } = o;\n let r;\n const s = /* @__PURE__ */ ba(() => n && \"MutationObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const p = ut(E(e)).map(Ge).filter(pa);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((y) => r.observe(y, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => r?.takeRecords(), d = () => {\n u(), l();\n };\n return xn(d), {\n isSupported: s,\n stop: d,\n takeRecords: i\n };\n}\nfunction ka(e, t, o = {}) {\n const { window: n = qe, document: a = n?.document, flush: r = \"sync\" } = o;\n if (!n || !a) return ga;\n let s;\n const l = (d) => {\n s?.(), s = d;\n }, u = gt(() => {\n const d = Ge(e);\n if (d) {\n const { stop: p } = xa(a, (y) => {\n y.map((k) => [...k.removedNodes]).flat().some((k) => k === d || k.contains(d)) && t(y);\n }, {\n window: n,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), i = () => {\n u(), l();\n };\n return xn(i), i;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Ia(e = {}) {\n var t;\n const { window: o = qe, deep: n = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : o?.document, s = () => {\n let i = r?.activeElement;\n if (n)\n for (var d; i?.shadowRoot; ) i = i == null || (d = i.shadowRoot) === null || d === void 0 ? void 0 : d.activeElement;\n return i;\n }, l = ue(), u = () => {\n l.value = s();\n };\n if (o) {\n const i = {\n capture: !0,\n passive: !0\n };\n Ke(o, \"blur\", (d) => {\n d.relatedTarget === null && u();\n }, i), Ke(o, \"focus\", u, i);\n }\n return a && ka(l, u, { document: r }), u(), l;\n}\nconst Ma = \"focusin\", Ca = \"focusout\", Ea = \":focus-within\";\nfunction Aa(e, t = {}) {\n const { window: o = qe } = t, n = T(() => Ge(e)), a = ue(!1), r = T(() => a.value);\n if (!o || !(/* @__PURE__ */ Ia(t)).value) return { focused: r };\n const s = { passive: !0 };\n return Ke(n, Ma, () => a.value = !0, s), Ke(n, Ca, () => {\n var l, u, i;\n return a.value = (l = (u = n.value) === null || u === void 0 || (i = u.matches) === null || i === void 0 ? void 0 : i.call(u, Ea)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction $a(e, { window: t = qe, scrollTarget: o } = {}) {\n const n = R(!1), a = () => {\n if (!t) return;\n const r = t.document, s = Ge(e);\n if (!s)\n n.value = !1;\n else {\n const l = s.getBoundingClientRect();\n n.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return ne(\n () => Ge(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && Ke(o || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), n;\n}\nconst De = (e) => {\n let t = $a(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, Se = (e) => e.tabIndex >= 0, Qt = (e) => {\n const t = e.target;\n return Bt(t);\n}, Bt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.previousElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.previousElementSibling;\n o && (t = o);\n }\n return t && (!Se(t) || !De(t)) ? Bt(t) : t;\n}, Ta = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.firstElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.firstElementChild;\n a && (o = a);\n }\n }\n return o && (!Se(o) || !De(o)) ? Ft(o) : o;\n}, Kt = (e) => {\n const t = e.target;\n return Ft(t);\n}, Ft = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.nextElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.nextElementSibling;\n o && (t = o);\n }\n return t && (!Se(t) || !De(t)) ? Ft(t) : t;\n}, Da = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.lastElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.lastElementChild;\n a && (o = a);\n }\n }\n return o && (!Se(o) || !De(o)) ? Bt(o) : o;\n}, en = (e) => {\n const t = e.target;\n return Zt(t);\n}, Zt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, tn = (e) => {\n const t = e.target;\n return Nt(t);\n}, Nt = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, nn = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, on = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, at = [\"alt\", \"control\", \"shift\", \"meta\"], Sa = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, kn = {\n \"keydown.up\": (e) => {\n const t = Qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Kt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = en(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = tn(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = Ta(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Da(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Kt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Qt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = tn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = en(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Ra(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, o = (s) => {\n const l = t(s);\n let u = [];\n if (typeof s.selectors == \"string\")\n u = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const i of s.selectors)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else if (s.selectors instanceof HTMLElement)\n u.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const i of s.selectors.value)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else\n u.push(s.selectors.value);\n return u;\n }, n = (s) => {\n const l = t(s);\n let u = [];\n return s.selectors ? u = o(s) : l && (u = Array.from(l.children).filter((i) => Se(i) && De(i))), u;\n }, a = (s) => (l) => {\n const u = Sa[l.key] || l.key.toLowerCase();\n if (at.includes(u)) return;\n const i = s.handlers || kn;\n for (const d of Object.keys(i)) {\n const [p, ...y] = d.split(\".\");\n if (p === \"keydown\" && y.includes(u)) {\n const k = i[d], g = y.filter((f) => at.includes(f)), b = at.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (g.length > 0) {\n if (b) {\n for (const f of at)\n if (y.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && k(l);\n }\n }\n } else\n b || k(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), u = n(s), i = a(s), d = l ? [l] : u;\n for (const p of d) {\n const { focused: y } = Aa(R(p)), k = ne(y, (g) => {\n g ? p.addEventListener(\"keydown\", i) : p.removeEventListener(\"keydown\", i);\n });\n r.push(k);\n }\n }\n }), an(() => {\n for (const s of r)\n s();\n });\n}\nconst La = { class: \"aform_display-value\" }, Ha = { key: 0 }, Va = {\n key: 1,\n ref: \"datepicker\",\n class: \"adatepicker\",\n tabindex: \"0\"\n}, _a = {\n colspan: \"5\",\n tabindex: -1\n}, Pa = [\"onClick\", \"onKeydown\"], Oa = 6, ln = 7, Ba = /* @__PURE__ */ oe({\n __name: \"ADatePicker\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {}\n }, {\n modelValue: { default: /* @__PURE__ */ new Date() },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e, { expose: t }) {\n const o = Me(e, \"modelValue\"), n = R(new Date(o.value)), a = R(n.value.getMonth()), r = R(n.value.getFullYear()), s = R([]), l = fe(\"datepicker\");\n Ee(async () => {\n u(), await vt();\n const C = document.getElementsByClassName(\"selectedDate\");\n if (C.length > 0)\n C[0].focus();\n else {\n const $ = document.getElementsByClassName(\"todaysDate\");\n $.length > 0 && $[0].focus();\n }\n });\n const u = () => {\n s.value = [];\n const C = new Date(r.value, a.value, 1), $ = C.getDay(), L = C.setDate(C.getDate() - $);\n for (const S of Array(43).keys())\n s.value.push(L + S * 864e5);\n };\n ne([a, r], u);\n const i = () => r.value -= 1, d = () => r.value += 1, p = () => {\n a.value == 0 ? (a.value = 11, i()) : a.value -= 1;\n }, y = () => {\n a.value == 11 ? (a.value = 0, d()) : a.value += 1;\n }, k = (C) => {\n const $ = /* @__PURE__ */ new Date();\n if (a.value === $.getMonth())\n return $.toDateString() === new Date(C).toDateString();\n }, g = (C) => new Date(C).toDateString() === new Date(n.value).toDateString(), b = (C, $) => (C - 1) * ln + $, f = (C, $) => s.value[b(C, $)], m = (C) => {\n o.value = n.value = new Date(s.value[C]);\n }, I = T(() => new Date(r.value, a.value, 1).toLocaleDateString(void 0, {\n year: \"numeric\",\n month: \"long\"\n }));\n return Ra([\n {\n parent: l,\n selectors: \"td\",\n handlers: {\n ...kn,\n \"keydown.pageup\": p,\n \"keydown.shift.pageup\": i,\n \"keydown.pagedown\": y,\n \"keydown.shift.pagedown\": d,\n // TODO: this is a hack to override the stonecrop enter handler;\n // store context inside the component so that handlers can be setup consistently\n \"keydown.enter\": () => {\n }\n }\n }\n ]), t({ currentMonth: a, currentYear: r, selectedDate: n }), (C, $) => e.mode === \"display\" || e.mode === \"read\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", La, N(o.value ? new Date(o.value).toLocaleDateString() : \"\"), 1),\n e.label ? (h(), x(\"label\", Ha, N(e.label), 1)) : Y(\"\", !0)\n ], 64)) : (h(), x(\"div\", Va, [\n w(\"table\", null, [\n w(\"tbody\", null, [\n w(\"tr\", null, [\n w(\"td\", {\n id: \"previous-month-btn\",\n tabindex: -1,\n onClick: p\n }, \"<\"),\n w(\"th\", _a, N(I.value), 1),\n w(\"td\", {\n id: \"next-month-btn\",\n tabindex: -1,\n onClick: y\n }, \">\")\n ]),\n $[0] || ($[0] = w(\"tr\", { class: \"days-header\" }, [\n w(\"td\", null, \"M\"),\n w(\"td\", null, \"T\"),\n w(\"td\", null, \"W\"),\n w(\"td\", null, \"T\"),\n w(\"td\", null, \"F\"),\n w(\"td\", null, \"S\"),\n w(\"td\", null, \"S\")\n ], -1)),\n (h(), x(X, null, ve(Oa, (L) => w(\"tr\", { key: L }, [\n (h(), x(X, null, ve(ln, (S) => w(\"td\", {\n ref_for: !0,\n ref: \"celldate\",\n key: b(L, S),\n contenteditable: !1,\n spellcheck: !1,\n tabindex: 0,\n class: se({\n todaysDate: k(f(L, S)),\n selectedDate: g(f(L, S))\n }),\n onClick: Ie((O) => m(b(L, S)), [\"prevent\", \"stop\"]),\n onKeydown: Ze((O) => m(b(L, S)), [\"enter\"])\n }, N(new Date(f(L, S)).getDate()), 43, Pa)), 64))\n ])), 64))\n ])\n ])\n ], 512));\n }\n}), Fa = /* @__PURE__ */ Te(Ba, [[\"__scopeId\", \"data-v-9da05d06\"]]), Za = /* @__PURE__ */ oe({\n __name: \"CollapseButton\",\n props: {\n collapsed: { type: Boolean }\n },\n setup(e) {\n return (t, o) => (h(), x(\"button\", {\n class: se([\"collapse-button\", e.collapsed ? \"rotated\" : \"unrotated\"])\n }, \"ร\", 2));\n }\n}), Na = /* @__PURE__ */ Te(Za, [[\"__scopeId\", \"data-v-6f1c1b45\"]]), Ua = { class: \"aform\" }, Wa = {\n key: 0,\n class: \"aform-nested-section\"\n}, Ga = {\n key: 0,\n class: \"aform-nested-label\"\n}, za = /* @__PURE__ */ oe({\n __name: \"AForm\",\n props: /* @__PURE__ */ xe({\n schema: {},\n mode: { default: \"edit\" }\n }, {\n data: { required: !0 },\n dataModifiers: {}\n }),\n emits: /* @__PURE__ */ xe([\"update:schema\", \"update:data\"], [\"update:data\"]),\n setup(e, { emit: t }) {\n const o = t, n = Me(e, \"data\"), a = R({});\n ne(\n () => n.value,\n (p) => {\n !e.schema || !p || e.schema.forEach((y) => {\n \"schema\" in y && Array.isArray(y.schema) && y.schema.length > 0 && (a.value[y.fieldname] = p[y.fieldname] ?? {});\n });\n },\n { immediate: !0 }\n );\n const r = (p, y) => {\n a.value[p] = y, n.value && (n.value[p] = y, o(\"update:data\", { ...n.value }));\n }, s = (p) => {\n const y = {};\n for (const [k, g] of Object.entries(p))\n [\"component\", \"fieldtype\", \"mode\"].includes(k) || (y[k] = g), k === \"rows\" && (!g || Array.isArray(g) && g.length === 0) && (y.rows = n.value[p.fieldname] || []);\n return y;\n }, l = T(() => e.mode ?? \"edit\");\n function u(p) {\n const y = p.mode;\n return y || l.value;\n }\n const i = R([]);\n gt(() => {\n e.schema && i.value.length !== e.schema.length && (i.value = e.schema.map((p, y) => T({\n get() {\n return n.value?.[e.schema[y].fieldname];\n },\n set: (k) => {\n const g = e.schema[y].fieldname;\n g && n.value && (n.value[g] = k, o(\"update:data\", { ...n.value })), o(\"update:schema\", e.schema);\n }\n })));\n });\n const d = T(() => i.value);\n return (p, y) => {\n const k = cn(\"AForm\", !0);\n return h(), x(\"form\", Ua, [\n (h(!0), x(X, null, ve(e.schema, (g, b) => (h(), x(X, { key: b }, [\n \"schema\" in g && Array.isArray(g.schema) && g.schema.length > 0 ? (h(), x(\"div\", Wa, [\n g.label ? (h(), x(\"h4\", Ga, N(g.label), 1)) : Y(\"\", !0),\n ct(k, {\n data: a.value[g.fieldname],\n mode: u(g),\n schema: g.schema,\n \"onUpdate:data\": (f) => r(g.fieldname, f)\n }, null, 8, [\"data\", \"mode\", \"schema\", \"onUpdate:data\"])\n ])) : (h(), me(Ue(g.component), ft({\n key: 1,\n modelValue: d.value[b].value,\n \"onUpdate:modelValue\": (f) => d.value[b].value = f,\n schema: g,\n data: n.value[g.fieldname],\n mode: u(g)\n }, { ref_for: !0 }, s(g)), null, 16, [\"modelValue\", \"onUpdate:modelValue\", \"schema\", \"data\", \"mode\"]))\n ], 64))), 128))\n ]);\n };\n }\n}), In = /* @__PURE__ */ Te(za, [[\"__scopeId\", \"data-v-5c01cea5\"]]), qa = /* @__PURE__ */ oe({\n __name: \"AFieldset\",\n props: {\n schema: {},\n label: {},\n collapsible: { type: Boolean },\n data: { default: () => ({}) },\n mode: { default: \"edit\" }\n },\n setup(e, { expose: t }) {\n const o = R(!1), n = R(e.data || []), a = R(e.schema), r = (s) => {\n s.preventDefault(), e.collapsible && (o.value = !o.value);\n };\n return t({ collapsed: o }), (s, l) => (h(), x(\"fieldset\", null, [\n w(\"legend\", {\n onClick: r,\n onSubmit: r\n }, [\n Dt(N(e.label) + \" \", 1),\n e.collapsible ? (h(), me(Na, {\n key: 0,\n collapsed: o.value\n }, null, 8, [\"collapsed\"])) : Y(\"\", !0)\n ], 32),\n he(s.$slots, \"default\", { collapsed: o.value }, () => [\n K(ct(In, {\n data: n.value,\n \"onUpdate:data\": l[0] || (l[0] = (u) => n.value = u),\n schema: a.value,\n mode: e.mode\n }, null, 8, [\"data\", \"schema\", \"mode\"]), [\n [Ce, !o.value]\n ])\n ], !0)\n ]));\n }\n}), Ya = /* @__PURE__ */ Te(qa, [[\"__scopeId\", \"data-v-a3606386\"]]), Xa = { class: \"aform_form-element aform_file-attach aform__grid--full\" }, ja = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, Ja = {\n key: 1,\n class: \"aform_display-value\"\n}, Qa = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, Ka = [\"disabled\"], es = [\"disabled\"], ts = /* @__PURE__ */ oe({\n __name: \"AFileAttach\",\n props: {\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {}\n },\n setup(e) {\n const { files: t, open: o, reset: n, onChange: a } = ea(), r = T(() => {\n const s = t.value?.length ?? 0;\n return `${s} ${s === 1 ? \"file\" : \"files\"}`;\n });\n return a((s) => s), (s, l) => (h(), x(\"div\", Xa, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n V(t) ? (h(), x(\"div\", ja, [\n w(\"p\", null, [\n w(\"b\", null, N(r.value), 1)\n ]),\n (h(!0), x(X, null, ve(V(t), (u) => (h(), x(\"li\", {\n key: u.name\n }, N(u.name), 1))), 128))\n ])) : (h(), x(\"span\", Ja, \"No file selected\"))\n ], 64)) : (h(), x(X, { key: 1 }, [\n V(t) ? (h(), x(\"div\", Qa, [\n w(\"p\", null, [\n l[2] || (l[2] = Dt(\" You have selected: \", -1)),\n w(\"b\", null, N(r.value), 1)\n ]),\n (h(!0), x(X, null, ve(V(t), (u) => (h(), x(\"li\", {\n key: u.name\n }, N(u.name), 1))), 128))\n ])) : Y(\"\", !0),\n w(\"button\", {\n type: \"button\",\n class: \"aform_form-btn\",\n disabled: e.mode === \"read\",\n onClick: l[0] || (l[0] = (u) => V(o)())\n }, N(e.label), 9, Ka),\n w(\"button\", {\n type: \"button\",\n disabled: !V(t) || e.mode === \"read\",\n class: \"aform_form-btn\",\n onClick: l[1] || (l[1] = (u) => V(n)())\n }, \"Reset\", 8, es)\n ], 64))\n ]));\n }\n}), ns = /* @__PURE__ */ Te(ts, [[\"__scopeId\", \"data-v-6543d39a\"]]), os = { class: \"aform_form-element\" }, ls = { class: \"aform_display-value\" }, as = { class: \"aform_field-label\" }, ss = [\"id\", \"disabled\", \"required\"], rs = [\"for\"], is = [\"innerHTML\"], us = /* @__PURE__ */ oe({\n __name: \"ANumericInput\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\");\n return (o, n) => (h(), x(\"div\", os, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", ls, N(t.value ?? \"\"), 1),\n w(\"label\", as, N(e.label), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n K(w(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": n[0] || (n[0] = (a) => t.value = a),\n class: \"aform_input-field\",\n type: \"number\",\n disabled: e.mode === \"read\",\n required: e.required\n }, null, 8, ss), [\n [we, t.value]\n ]),\n w(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, N(e.label), 9, rs),\n K(w(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, is), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n});\nfunction cs(e) {\n try {\n return Function(`\"use strict\";return (${e})`)();\n } catch {\n }\n}\nfunction ds(e) {\n const t = e.value;\n if (!t) return;\n const o = cs(t);\n if (o) {\n const n = e.instance?.locale;\n return o(n);\n }\n return t;\n}\nfunction fs(e, t) {\n let o = e;\n const n = [t, \"/\", \"-\", \"(\", \")\", \" \"];\n for (const a of n)\n o = o.replaceAll(a, \"\");\n return o;\n}\nfunction vs(e, t, o) {\n let n = t;\n for (const a of e) {\n const r = n.indexOf(o);\n if (r !== -1) {\n const s = n.substring(0, r), l = n.substring(r + 1);\n n = s + a + l;\n }\n }\n return n.slice(0, t.length);\n}\nfunction ps(e, t) {\n const o = ds(t);\n if (!o) return;\n const n = \"#\", a = e.value, r = fs(a, n);\n if (r) {\n const s = vs(r, o, n);\n t.instance?.maskFilled && (t.instance.maskFilled = !s.includes(n)), e.value = s;\n } else\n e.value = o;\n}\nconst ms = { class: \"aform_form-element\" }, hs = { class: \"aform_display-value\" }, gs = { class: \"aform_field-label\" }, ws = [\"id\", \"disabled\", \"maxlength\", \"required\"], ys = [\"for\"], bs = [\"innerHTML\"], xs = /* @__PURE__ */ oe({\n __name: \"ATextInput\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = R(!0), o = Me(e, \"modelValue\");\n return (n, a) => (h(), x(\"div\", ms, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", hs, N(o.value ?? \"\"), 1),\n w(\"label\", gs, N(e.label), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n K(w(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": a[0] || (a[0] = (r) => o.value = r),\n class: \"aform_input-field\",\n disabled: e.mode === \"read\",\n maxlength: e.mask && t.value ? e.mask.length : void 0,\n required: e.required\n }, null, 8, ws), [\n [we, o.value],\n [V(ps), e.mask]\n ]),\n w(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, N(e.label), 9, ys),\n K(w(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, bs), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n}), ks = { class: \"login-container\" }, Is = { class: \"account-container\" }, Ms = { class: \"account-header\" }, Cs = { id: \"account-title\" }, Es = { id: \"account-subtitle\" }, As = { class: \"login-form-container\" }, $s = { class: \"login-form-email aform_form-element\" }, Ts = [\"disabled\"], Ds = { class: \"login-form-password aform_form-element\" }, Ss = [\"disabled\"], Rs = [\"disabled\"], Ls = {\n key: 0,\n class: \"material-symbols-outlined loading-icon\"\n}, Hs = /* @__PURE__ */ oe({\n __name: \"Login\",\n props: {\n headerTitle: { default: \"Login\" },\n headerSubtitle: { default: \"Enter your email and password to login\" }\n },\n emits: [\"loginFailed\", \"loginSuccess\"],\n setup(e, { emit: t }) {\n const o = t, n = R(\"\"), a = R(\"\"), r = R(!1), s = R(!1);\n function l(u) {\n if (u.preventDefault(), r.value = !0, s.value) {\n r.value = !1, o(\"loginFailed\");\n return;\n }\n r.value = !1, o(\"loginSuccess\");\n }\n return (u, i) => (h(), x(\"div\", ks, [\n w(\"div\", null, [\n w(\"div\", Is, [\n w(\"div\", Ms, [\n w(\"h1\", Cs, N(e.headerTitle), 1),\n w(\"p\", Es, N(e.headerSubtitle), 1)\n ]),\n w(\"form\", { onSubmit: l }, [\n w(\"div\", As, [\n w(\"div\", $s, [\n i[2] || (i[2] = w(\"label\", {\n id: \"login-email\",\n for: \"email\",\n class: \"aform_field-label\"\n }, \"Email\", -1)),\n K(w(\"input\", {\n id: \"email\",\n \"onUpdate:modelValue\": i[0] || (i[0] = (d) => n.value = d),\n class: \"aform_input-field\",\n name: \"email\",\n placeholder: \"name@example.com\",\n type: \"email\",\n \"auto-capitalize\": \"none\",\n \"auto-complete\": \"email\",\n \"auto-correct\": \"off\",\n disabled: r.value\n }, null, 8, Ts), [\n [we, n.value]\n ])\n ]),\n w(\"div\", Ds, [\n i[3] || (i[3] = w(\"label\", {\n id: \"login-password\",\n for: \"password\",\n class: \"aform_field-label\"\n }, \"Password\", -1)),\n K(w(\"input\", {\n id: \"password\",\n \"onUpdate:modelValue\": i[1] || (i[1] = (d) => a.value = d),\n class: \"aform_input-field\",\n name: \"password\",\n type: \"password\",\n disabled: r.value\n }, null, 8, Ss), [\n [we, a.value]\n ])\n ]),\n w(\"button\", {\n class: \"btn\",\n disabled: r.value || !n.value || !a.value,\n onClick: l\n }, [\n r.value ? (h(), x(\"span\", Ls, \"progress_activity\")) : Y(\"\", !0),\n i[4] || (i[4] = w(\"span\", { id: \"login-form-button\" }, \"Login\", -1))\n ], 8, Rs)\n ])\n ], 32),\n i[5] || (i[5] = w(\"button\", { class: \"btn\" }, [\n w(\"span\", { id: \"forgot-password-button\" }, \"Forgot password?\")\n ], -1))\n ])\n ])\n ]));\n }\n}), Ps = /* @__PURE__ */ Te(Hs, [[\"__scopeId\", \"data-v-d9ffd0a7\"]]);\nfunction Os(e) {\n e.use(Tl), e.component(\"ACheckbox\", Ol), e.component(\"ACombobox\", Bl), e.component(\"ADate\", Gl), e.component(\"ADropdown\", fa), e.component(\"ADatePicker\", Fa), e.component(\"AFieldset\", Ya), e.component(\"AFileAttach\", ns), e.component(\"AForm\", In), e.component(\"ANumericInput\", us), e.component(\"ATextInput\", xs);\n}\nexport {\n Ol as ACheckbox,\n Bl as AComboBox,\n Gl as ADate,\n Fa as ADatePicker,\n fa as ADropdown,\n Ya as AFieldset,\n ns as AFileAttach,\n In as AForm,\n us as ANumericInput,\n xs as ATextInput,\n Ps as Login,\n Os as install\n};\n//# sourceMappingURL=aform.js.map\n","<template>\n\t<footer>\n\t\t<ul class=\"tabs\">\n\t\t\t<li class=\"hidebreadcrumbs\" @click=\"toggleBreadcrumbs\" @keydown.enter=\"toggleBreadcrumbs\">\n\t\t\t\t<a tabindex=\"0\"><div :class=\"rotateHideTabIcon\">ร</div></a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tclass=\"hometab\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\"\n\t\t\t\t@click=\"navigateHome\"\n\t\t\t\t@keydown.enter=\"navigateHome\">\n\t\t\t\t<router-link to=\"/\" tabindex=\"0\">\n\t\t\t\t\t<svg class=\"icon\" aria-label=\"Home\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n\t\t\t\t\t\t<path d=\"M3 12l9-9 9 9\" />\n\t\t\t\t\t\t<path d=\"M9 21V12h6v9\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</router-link>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\t:class=\"['searchtab', { 'search-active': searchVisible }]\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<a tabindex=\"0\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tv-show=\"!searchVisible\"\n\t\t\t\t\t\tclass=\"icon search-icon\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Search\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t@click=\"toggleSearch\"\n\t\t\t\t\t\t@keydown.enter=\"toggleSearch\">\n\t\t\t\t\t\t<circle cx=\"11\" cy=\"11\" r=\"7\" />\n\t\t\t\t\t\t<path d=\"M21 21l-4.35-4.35\" />\n\t\t\t\t\t</svg>\n\t\t\t\t\t<input\n\t\t\t\t\t\tv-show=\"searchVisible\"\n\t\t\t\t\t\tref=\"searchinput\"\n\t\t\t\t\t\tv-model=\"searchText\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t\t\t@click.stop\n\t\t\t\t\t\t@input=\"handleSearchInput($event)\"\n\t\t\t\t\t\t@blur=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.escape=\"toggleSearch\" />\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tv-for=\"breadcrumb in breadcrumbs\"\n\t\t\t\t:key=\"breadcrumb.title\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<router-link tabindex=\"0\" :to=\"breadcrumb.to\"> {{ breadcrumb.title }} </router-link>\n\t\t\t</li>\n\t\t</ul>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nconst { breadcrumbs = [] } = defineProps<{ breadcrumbs?: { title: string; to: string }[] }>()\n\nconst breadcrumbsVisibile = ref(true)\nconst searchVisible = ref(false)\nconst searchText = ref('')\nconst inputRef = useTemplateRef<HTMLInputElement>('searchinput')\n\nconst rotateHideTabIcon = computed(() => {\n\treturn breadcrumbsVisibile.value ? 'unrotated' : 'rotated'\n})\n\nconst toggleBreadcrumbs = () => {\n\tbreadcrumbsVisibile.value = !breadcrumbsVisibile.value\n}\n\nconst toggleSearch = async () => {\n\tsearchVisible.value = !searchVisible.value\n\tawait nextTick(() => {\n\t\tinputRef.value?.focus()\n\t})\n}\n\nconst handleSearchInput = (event: Event | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n}\n\nconst handleSearch = async (event: FocusEvent | KeyboardEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tawait toggleSearch()\n}\n\nconst navigateHome = (/* event: MouseEvent | KeyboardEvent */) => {\n\t// navigate home\n}\n</script>\n\n<style scoped>\nfooter {\n\tposition: fixed;\n\tbottom: 0px;\n\twidth: 100%;\n\tbackground-color: transparent;\n\theight: auto;\n\tmin-height: 2.4rem;\n\tz-index: 100;\n\ttext-align: left;\n\tfont-size: 100%;\n\tdisplay: flex;\n\tjustify-content: right;\n\tpadding: 0 0.75rem 0 0;\n\tbox-sizing: border-box;\n}\nul {\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.tabs li {\n\tfloat: left;\n\tlist-style-type: none;\n\tposition: relative;\n\tmargin-left: -1px;\n}\n\n/* Base tab styling */\n.tabs a {\n\tfloat: left;\n\tpadding: 0.5rem 1rem;\n\theight: 2.4rem;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttext-decoration: none;\n\tcolor: var(--sc-gray-60, #666);\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tfont-size: 0.85rem;\n\tfont-family: var(--sc-font-family, system-ui, sans-serif);\n\ttransition: all 0.15s ease;\n\n\t/* Minimal ornamentation - subtle top radius only */\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n}\n\n.tabs a:hover {\n\tbackground: var(--sc-btn-hover, #f2f2f2);\n}\n\n.tabs .router-link-active {\n\tz-index: 3;\n\tbackground: var(--sc-primary-color, #827553) !important;\n\tborder-color: var(--sc-primary-color, #827553) !important;\n\tcolor: var(--sc-primary-text-color, #fff) !important;\n}\n\n/* Pseudo-elements removed - minimal ornamentation style */\n\n/* Hide breadcrumbs tab */\n.hidebreadcrumbs a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n.hidebreadcrumbs a div {\n\tfont-size: 1.2rem;\n}\n\n.rotated {\n\ttransform: rotate(45deg);\n\t-webkit-transform: rotate(45deg);\n\t-moz-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\t-o-transform: rotate(45deg);\n\ttransition: transform 250ms ease;\n}\n.unrotated {\n\ttransform: rotate(0deg);\n\t-webkit-transform: rotate(0deg);\n\t-moz-transform: rotate(0deg);\n\t-ms-transform: rotate(0deg);\n\t-o-transform: rotate(0deg);\n\ttransition: transform 250ms ease;\n}\n\nli:active,\nli:hover,\nli:focus,\nli > a:active,\nli > a:hover,\nli > a:focus {\n\tz-index: 3;\n}\n\na:active,\na:hover,\na:focus {\n\toutline: 2px solid var(--sc-input-active-border-color, black);\n\tz-index: 3;\n}\n\n/* Home tab */\n.hometab a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n/* SVG icon styling */\n.icon {\n\twidth: 1rem;\n\theight: 1rem;\n\tstroke: currentColor;\n\tflex-shrink: 0;\n}\n\n/* Search tab with animation */\n.searchtab {\n\toverflow: hidden;\n}\n\n.searchtab a {\n\tmin-width: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n\toverflow: hidden;\n\t/* Animation for smooth expand/collapse */\n\tmax-width: 2.4rem;\n\ttransition: max-width 0.35s ease-in-out, padding 0.35s ease-in-out, background 0.2s ease;\n}\n\n.searchtab .search-icon {\n\tcursor: pointer;\n}\n\n.searchtab input {\n\toutline: none;\n\tborder: 1px solid var(--sc-input-border-color, #ccc);\n\tborder-radius: 0.25rem;\n\tbackground-color: var(--sc-form-background, #ffffff);\n\tcolor: var(--sc-gray-80, #333);\n\ttext-align: left;\n\tfont-size: 0.875rem;\n\tpadding: 0.25rem 0.5rem;\n\twidth: 180px;\n\theight: 1.5rem;\n\tflex-shrink: 0;\n\topacity: 0;\n\ttransition: opacity 0.2s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.searchtab input:focus {\n\tborder-color: var(--sc-input-active-border-color, #4f46e5);\n\toutline: none;\n}\n\n.searchtab input::placeholder {\n\tcolor: var(--sc-input-label-color, #999);\n}\n\n/* Search active state - expanded with animation */\n.searchtab.search-active a {\n\tmax-width: 200px;\n\tmin-width: auto;\n\twidth: auto;\n\tpadding: 0.5rem 0.75rem;\n}\n\n.searchtab.search-active input {\n\topacity: 1;\n\ttransition-delay: 0.15s;\n}\n</style>\n","<template>\n\t<div class=\"desktop\" @click=\"handleClick\">\n\t\t<!-- Action Set -->\n\t\t<ActionSet :elements=\"actionElements\" @action-click=\"handleActionClick\" />\n\n\t\t<!-- Main content using AForm -->\n\t\t<AForm v-if=\"currentViewSchema.length > 0\" v-model:data=\"currentViewData\" :schema=\"currentViewSchema\" />\n\t\t<div v-else-if=\"!stonecrop\" class=\"loading\"><p>Initializing Stonecrop...</p></div>\n\t\t<div v-else class=\"loading\">\n\t\t\t<p>Loading {{ currentView }} data...</p>\n\t\t</div>\n\n\t\t<!-- Sheet Navigation -->\n\t\t<SheetNav :breadcrumbs=\"navigationBreadcrumbs\" />\n\n\t\t<!-- Command Palette -->\n\t\t<CommandPalette\n\t\t\t:is-open=\"commandPaletteOpen\"\n\t\t\t:search=\"searchCommands\"\n\t\t\tplaceholder=\"Type a command or search...\"\n\t\t\t@select=\"executeCommand\"\n\t\t\t@close=\"commandPaletteOpen = false\">\n\t\t\t<template #title=\"{ result }\">\n\t\t\t\t{{ result.title }}\n\t\t\t</template>\n\t\t\t<template #content=\"{ result }\">\n\t\t\t\t{{ result.description }}\n\t\t\t</template>\n\t\t</CommandPalette>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { useStonecrop } from '@stonecrop/stonecrop'\nimport { AForm, type SchemaTypes, type TableColumn, type TableConfig } from '@stonecrop/aform'\nimport { computed, onMounted, provide, ref, unref, watch } from 'vue'\n\nimport ActionSet from './ActionSet.vue'\nimport SheetNav from './SheetNav.vue'\nimport CommandPalette from './CommandPalette.vue'\nimport type {\n\tActionElements,\n\tRouteAdapter,\n\tNavigationTarget,\n\tActionEventPayload,\n\tRecordOpenEventPayload,\n} from '../types'\n\nconst props = defineProps<{\n\tavailableDoctypes?: string[]\n\t/**\n\t * Pluggable router adapter. When provided, Desktop uses these functions for all\n\t * routing instead of reaching into the registry's internal Vue Router instance.\n\t * Nuxt hosts (or any host with custom route conventions) should supply this.\n\t */\n\trouteAdapter?: RouteAdapter\n\t/**\n\t * Replacement for the native `confirm()` dialog. Desktop calls this before\n\t * performing a destructive action. Return `true` to proceed.\n\t * Defaults to the native `window.confirm` if omitted.\n\t */\n\tconfirmFn?: (message: string) => boolean | Promise<boolean>\n}>()\n\nconst emit = defineEmits<{\n\t/**\n\t * Fired when the user triggers an FSM transition (action button click).\n\t * The host app is responsible for calling the server, persisting state, etc.\n\t */\n\taction: [payload: ActionEventPayload]\n\t/**\n\t * Fired when Desktop wants to navigate to a different view.\n\t * Also calls routeAdapter.navigate() if an adapter is provided.\n\t */\n\tnavigate: [target: NavigationTarget]\n\t/**\n\t * Fired when the user opens a specific record.\n\t */\n\t'record:open': [payload: RecordOpenEventPayload]\n}>()\n\nconst { availableDoctypes = [] } = props\n\nconst { stonecrop } = useStonecrop()\n\n// State\nconst loading = ref(false)\nconst commandPaletteOpen = ref(false)\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed property that reads from HST store for reactive form data\nconst currentViewData = computed<Record<string, any>>({\n\tget() {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn {}\n\t\t}\n\n\t\ttry {\n\t\t\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\t// Return a plain shallow copy so AForm mutations don't propagate directly into\n\t\t\t// the HST reactive object, which would bypass field-trigger diffing and cause\n\t\t\t// setupDeepReactivity to fire triggers for all fields on every keystroke.\n\t\t\treturn { ...(record?.get('') || {}) }\n\t\t} catch {\n\t\t\treturn {}\n\t\t}\n\t},\n\tset(newData: Record<string, any>) {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\t// Only update fields that actually changed to avoid triggering actions for unchanged fields\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\t\t\tfor (const [fieldname, value] of Object.entries(newData)) {\n\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${fieldname}`\n\t\t\t\tconst currentValue = hstStore.has(fieldPath) ? hstStore.get(fieldPath) : undefined\n\t\t\t\tif (currentValue !== value) {\n\t\t\t\t\thstStore.set(fieldPath, value)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST update failed:', error)\n\t\t}\n\t},\n})\n\n// Computed properties for current route context.\n// When a routeAdapter is provided it takes full precedence over the registry's internal router.\nconst route = computed(() => (props.routeAdapter ? null : unref(stonecrop.value?.registry.router?.currentRoute)))\nconst router = computed(() => (props.routeAdapter ? null : stonecrop.value?.registry.router))\nconst currentDoctype = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentDoctype()\n\tif (!route.value) return ''\n\n\t// First check if we have actualDoctype in meta (from registered routes)\n\tif (route.value.meta?.actualDoctype) {\n\t\treturn route.value.meta.actualDoctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\n// The route doctype for display and navigation (e.g., 'todo')\nconst routeDoctype = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentDoctype()\n\tif (!route.value) return ''\n\n\t// Check route meta first\n\tif (route.value.meta?.doctype) {\n\t\treturn route.value.meta.doctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\nconst currentRecordId = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentRecordId()\n\tif (!route.value) return ''\n\n\t// For named routes, use params.recordId\n\tif (route.value.params.recordId) {\n\t\treturn route.value.params.recordId as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 1) {\n\t\treturn pathMatch[1]\n\t}\n\n\treturn ''\n})\nconst isNewRecord = computed(() => currentRecordId.value?.startsWith('new-'))\n\n// Determine current view based on route\nconst currentView = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentView()\n\tif (!route.value) {\n\t\treturn 'doctypes'\n\t}\n\n\t// Home route\n\tif (route.value.name === 'home' || route.value.path === '/') {\n\t\treturn 'doctypes'\n\t}\n\n\t// Named routes from registered doctypes\n\tif (route.value.name && route.value.name !== 'catch-all') {\n\t\tconst routeName = route.value.name as string\n\t\tif (routeName.includes('form') || route.value.params.recordId) {\n\t\t\treturn 'record'\n\t\t} else if (routeName.includes('list') || route.value.params.doctype) {\n\t\t\treturn 'records'\n\t\t}\n\t}\n\n\t// Catch-all route - determine from path structure\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\tconst view = pathMatch.length === 1 ? 'records' : 'record'\n\t\treturn view\n\t}\n\n\treturn 'doctypes'\n})\n\n// Computed properties (now that all helper functions are defined)\n// Helper function to get available transitions for current record.\n// Reads the actual FSM state from the record's `status` field (or falls back to the\n// workflow initial state) so the available action buttons always reflect reality.\nconst getAvailableTransitions = () => {\n\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\treturn []\n\t}\n\n\ttry {\n\t\tconst meta = stonecrop.value.registry.getDoctype(currentDoctype.value)\n\t\tif (!meta?.workflow) return []\n\n\t\t// Delegate state resolution to Stonecrop โ reads record 'status', falls back to workflow.initial\n\t\tconst currentState = stonecrop.value.getRecordState(currentDoctype.value, currentRecordId.value)\n\n\t\t// Delegate transition lookup to DoctypeMeta โ no more manual workflow introspection\n\t\tconst transitions = meta.getAvailableTransitions(currentState)\n\n\t\tconst recordData = currentViewData.value || {}\n\n\t\t// Each transition emits an 'action' event. The host app decides what to do\n\t\t// (call the server, trigger an FSM actor, update HST, etc.).\n\t\treturn transitions.map(({ name, targetState }) => ({\n\t\t\tlabel: `${name} (โ ${targetState})`,\n\t\t\taction: () => {\n\t\t\t\temit('action', {\n\t\t\t\t\tname,\n\t\t\t\t\tdoctype: currentDoctype.value,\n\t\t\t\t\trecordId: currentRecordId.value,\n\t\t\t\t\tdata: recordData,\n\t\t\t\t})\n\t\t\t},\n\t\t}))\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error getting available transitions:', error)\n\t\treturn []\n\t}\n}\n\nconst actionElements = computed<ActionElements[]>(() => {\n\tconst elements: ActionElements[] = []\n\n\tswitch (currentView.value) {\n\t\tcase 'records':\n\t\t\telements.push({\n\t\t\t\ttype: 'button',\n\t\t\t\tlabel: 'New Record',\n\t\t\t\taction: () => void createNewRecord(),\n\t\t\t})\n\t\t\tbreak\n\t\tcase 'record': {\n\t\t\t// Populate the Actions dropdown with every FSM transition available in the\n\t\t\t// record's current state. Clicking a transition emits 'action'.\n\t\t\tconst transitionActions = getAvailableTransitions()\n\t\t\tif (transitionActions.length > 0) {\n\t\t\t\telements.push({\n\t\t\t\t\ttype: 'dropdown',\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tactions: transitionActions,\n\t\t\t\t})\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn elements\n})\n\nconst navigationBreadcrumbs = computed(() => {\n\tconst breadcrumbs: { title: string; to: string }[] = []\n\n\tif (currentView.value === 'records' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` }\n\t\t)\n\t} else if (currentView.value === 'record' && routeDoctype.value) {\n\t\tconst recordPath = currentRecordId.value\n\t\t\t? `/${routeDoctype.value}/${currentRecordId.value}`\n\t\t\t: route.value?.fullPath ?? ''\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` },\n\t\t\t{ title: isNewRecord.value ? 'New Record' : 'Edit Record', to: recordPath }\n\t\t)\n\t}\n\n\treturn breadcrumbs\n})\n\n// Command palette functionality\ntype Command = {\n\ttitle: string\n\tdescription: string\n\taction: () => void\n}\n\nconst searchCommands = (query: string): Command[] => {\n\tconst commands: Command[] = [\n\t\t{\n\t\t\ttitle: 'Go Home',\n\t\t\tdescription: 'Navigate to the home page',\n\t\t\taction: () => void doNavigate({ view: 'doctypes' }),\n\t\t},\n\t\t{\n\t\t\ttitle: 'Toggle Command Palette',\n\t\t\tdescription: 'Open/close the command palette',\n\t\t\taction: () => (commandPaletteOpen.value = !commandPaletteOpen.value),\n\t\t},\n\t]\n\n\t// Add doctype-specific commands\n\tif (routeDoctype.value) {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(routeDoctype.value)} Records`,\n\t\t\tdescription: `Navigate to ${routeDoctype.value} list`,\n\t\t\taction: () => void doNavigate({ view: 'records', doctype: routeDoctype.value }),\n\t\t})\n\n\t\tcommands.push({\n\t\t\ttitle: `Create New ${formatDoctypeName(routeDoctype.value)}`,\n\t\t\tdescription: `Create a new ${routeDoctype.value} record`,\n\t\t\taction: () => void createNewRecord(),\n\t\t})\n\t}\n\n\t// Add available doctypes as commands\n\tavailableDoctypes.forEach(doctype => {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(doctype)}`,\n\t\t\tdescription: `Navigate to ${doctype} list`,\n\t\t\taction: () => void doNavigate({ view: 'records', doctype }),\n\t\t})\n\t})\n\n\t// Filter commands based on query\n\tif (!query) return commands\n\n\treturn commands.filter(\n\t\tcmd =>\n\t\t\tcmd.title.toLowerCase().includes(query.toLowerCase()) ||\n\t\t\tcmd.description.toLowerCase().includes(query.toLowerCase())\n\t)\n}\n\nconst executeCommand = (command: Command) => {\n\tcommand.action()\n\tcommandPaletteOpen.value = false\n}\n\n// Helper functions - moved here to avoid \"before initialization\" errors\nconst formatDoctypeName = (doctype: string): string => {\n\treturn doctype\n\t\t.split('-')\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(' ')\n}\n\nconst getRecordCount = (doctype: string): number => {\n\tif (!stonecrop.value) return 0\n\tconst recordIds = stonecrop.value.getRecordIds(doctype)\n\treturn recordIds.length\n}\n\n// Internal navigation helper: emits 'navigate', then calls the adapter (if any)\n// or falls back to the registry's Vue Router instance.\nconst doNavigate = async (target: NavigationTarget) => {\n\temit('navigate', target)\n\tif (props.routeAdapter) {\n\t\tawait props.routeAdapter.navigate(target)\n\t} else {\n\t\tif (target.view === 'doctypes') {\n\t\t\tawait router.value?.push('/')\n\t\t} else if (target.view === 'records' && target.doctype) {\n\t\t\tawait router.value?.push(`/${target.doctype}`)\n\t\t} else if (target.view === 'record' && target.doctype && target.recordId) {\n\t\t\tawait router.value?.push(`/${target.doctype}/${target.recordId}`)\n\t\t}\n\t}\n}\n\nconst navigateToDoctype = async (doctype: string) => {\n\tawait doNavigate({ view: 'records', doctype })\n}\n\nconst openRecord = async (recordId: string) => {\n\tconst doctype = routeDoctype.value\n\temit('record:open', { doctype, recordId })\n\tawait doNavigate({ view: 'record', doctype, recordId })\n}\n\nconst createNewRecord = async () => {\n\tconst newId = `new-${Date.now()}`\n\tawait doNavigate({ view: 'record', doctype: routeDoctype.value, recordId: newId })\n}\n\n// Schema generator functions - moved here to be available to computed properties\nconst getDoctypesSchema = (): SchemaTypes[] => {\n\tif (!availableDoctypes.length) return []\n\n\tconst rows = availableDoctypes.map(doctype => ({\n\t\tid: doctype,\n\t\tdoctype,\n\t\tdisplay_name: formatDoctypeName(doctype),\n\t\trecord_count: getRecordCount(doctype),\n\t\tactions: 'View Records',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'doctypes_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Doctype',\n\t\t\t\t\tname: 'doctype',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Name',\n\t\t\t\t\tname: 'display_name',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '30ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Records',\n\t\t\t\t\tname: 'record_count',\n\t\t\t\t\tfieldtype: 'Int',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '15ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordsSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\tconst records = getRecords()\n\tconst columns = getColumns()\n\n\t// If no columns are available, let the template fallback handle the loading state\n\tif (columns.length === 0) {\n\t\treturn []\n\t}\n\n\tconst rows = records.map((record: any) => ({\n\t\t...record,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tid: record.id || '',\n\t\tactions: 'Edit | Delete',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'records_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t...columns.map(col => ({\n\t\t\t\t\tlabel: col.label,\n\t\t\t\t\tname: col.fieldname,\n\t\t\t\t\tfieldtype: col.fieldtype,\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t})),\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordFormSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value?.registry\n\t\tconst meta = registry?.registry[currentDoctype.value]\n\n\t\tif (!meta?.schema) {\n\t\t\t// Let the template fallback handle the loading state\n\t\t\treturn []\n\t\t}\n\n\t\t// Data is provided via v-model:data=\"currentViewData\" โ no need to spread values into schema\n\t\treturn 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t} catch {\n\t\treturn []\n\t}\n}\n\n// Additional data helper functions\nconst getRecords = () => {\n\tif (!stonecrop.value || !currentDoctype.value) {\n\t\treturn []\n\t}\n\n\tconst recordsNode = stonecrop.value.records(currentDoctype.value)\n\tconst recordsData = recordsNode?.get('')\n\n\tif (recordsData && typeof recordsData === 'object' && !Array.isArray(recordsData)) {\n\t\treturn Object.values(recordsData as Record<string, any>)\n\t}\n\n\treturn []\n}\n\nconst getColumns = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (meta?.schema) {\n\t\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\t\treturn schemaArray.map(field => ({\n\t\t\t\tfieldname: field.fieldname,\n\t\t\t\tlabel: ('label' in field && field.label) || field.fieldname,\n\t\t\t\tfieldtype: ('fieldtype' in field && field.fieldtype) || 'Data',\n\t\t\t}))\n\t\t}\n\t} catch {\n\t\t// Error getting schema - return empty array\n\t}\n\n\treturn []\n}\n\n// Schema for different views - defined here after all helper functions are available\nconst currentViewSchema = computed<SchemaTypes[]>(() => {\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\treturn getDoctypesSchema()\n\t\tcase 'records':\n\t\t\treturn getRecordsSchema()\n\t\tcase 'record':\n\t\t\treturn getRecordFormSchema()\n\t\tdefault:\n\t\t\treturn []\n\t}\n})\n\nconst handleActionClick = (_label: string, action: (() => void | Promise<void>) | undefined) => {\n\tif (action) {\n\t\tvoid action()\n\t}\n}\n\n// Desktop does NOT own the delete lifecycle โ it asks for confirmation, then emits\n// an 'action' event. The host app is responsible for removing the record from HST\n// and calling the server.\nconst handleDelete = async (recordId?: string) => {\n\tconst targetRecordId = recordId || currentRecordId.value\n\tif (!targetRecordId) return\n\n\tconst confirmed = props.confirmFn\n\t\t? await props.confirmFn('Are you sure you want to delete this record?')\n\t\t: confirm('Are you sure you want to delete this record?')\n\n\tif (confirmed) {\n\t\temit('action', {\n\t\t\tname: 'DELETE',\n\t\t\tdoctype: currentDoctype.value,\n\t\t\trecordId: targetRecordId,\n\t\t\tdata: currentViewData.value || {},\n\t\t})\n\t}\n}\n\n// Event handlers\nconst handleClick = async (event: Event) => {\n\tconst target = event.target as HTMLElement\n\tconst action = target.getAttribute('data-action')\n\n\tif (action === 'create') {\n\t\tawait createNewRecord()\n\t}\n\n\t// Handle table cell clicks for actions\n\tconst cell = target.closest('td, th')\n\tif (cell) {\n\t\tconst cellText = cell.textContent?.trim()\n\t\tconst row = cell.closest('tr')\n\n\t\tif (cellText === 'View Records' && row) {\n\t\t\t// Get the doctype from the row data\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst doctypeCell = cells[1] // Assuming doctype is in second column (first column is index)\n\t\t\t\tconst doctype = doctypeCell.textContent?.trim()\n\t\t\t\tif (doctype) {\n\t\t\t\t\tawait navigateToDoctype(doctype)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Edit') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait openRecord(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Delete') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait handleDelete(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst loadRecordData = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return\n\n\tloading.value = true\n\n\ttry {\n\t\tif (!isNewRecord.value) {\n\t\t\t// For existing records, ensure the record exists in HST.\n\t\t\t// The computed currentViewData will automatically read from HST.\n\t\t\tstonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t}\n\t\t// For new records, currentViewData computed property will return {} automatically.\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error loading record data:', error)\n\t} finally {\n\t\tloading.value = false\n\t}\n}\n\n// Watch for route changes to load appropriate data\nwatch(\n\t[currentView, currentDoctype, currentRecordId],\n\t() => {\n\t\tif (currentView.value === 'record') {\n\t\t\tloadRecordData()\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Stonecrop reactive computed properties update automatically when the instance\n// becomes available โ no manual watcher needed.\n\n// Provide navigation helpers and an emitAction convenience function to child components.\nconst desktopMethods = {\n\tnavigateToDoctype,\n\topenRecord,\n\tcreateNewRecord,\n\thandleDelete,\n\t/**\n\t * Convenience wrapper so child components (e.g. slot content) can emit\n\t * an action event without needing a direct reference to the emit function.\n\t */\n\temitAction: (name: string, data?: Record<string, any>) => {\n\t\temit('action', {\n\t\t\tname,\n\t\t\tdoctype: currentDoctype.value,\n\t\t\trecordId: currentRecordId.value,\n\t\t\tdata: data ?? currentViewData.value ?? {},\n\t\t})\n\t},\n}\n\nprovide('desktopMethods', desktopMethods)\n\nonMounted(() => {\n\t// Add keyboard shortcuts\n\tconst handleKeydown = (event: KeyboardEvent) => {\n\t\t// Ctrl+K or Cmd+K to open command palette\n\t\tif ((event.ctrlKey || event.metaKey) && event.key === 'k') {\n\t\t\tevent.preventDefault()\n\t\t\tcommandPaletteOpen.value = true\n\t\t}\n\t\t// Escape to close command palette\n\t\tif (event.key === 'Escape' && commandPaletteOpen.value) {\n\t\t\tcommandPaletteOpen.value = false\n\t\t}\n\t}\n\n\tdocument.addEventListener('keydown', handleKeydown)\n\n\t// Cleanup event listener on unmount\n\treturn () => {\n\t\tdocument.removeEventListener('keydown', handleKeydown)\n\t}\n})\n</script>\n","import { App, type Plugin } from 'vue'\n\nimport ActionSet from '../components/ActionSet.vue'\nimport CommandPalette from '../components/CommandPalette.vue'\nimport Desktop from '../components/Desktop.vue'\nimport SheetNav from '../components/SheetNav.vue'\n\n/**\n * This is the main plugin that will be used to register all the desktop components.\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App) => {\n\t\tapp.component('ActionSet', ActionSet)\n\t\tapp.component('CommandPalette', CommandPalette)\n\t\tapp.component('Desktop', Desktop)\n\t\tapp.component('SheetNav', SheetNav)\n\t},\n}\n\nexport default plugin\n"],"names":["emit","__emit","dropdownStates","ref","isOpen","timeoutId","hover","closeClicked","onMounted","closeDropdowns","onHover","onHoverLeave","toggleDropdown","index","showDropdown","handleClick","action","label","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_1","_cache","$event","_openBlock","_Fragment","_renderList","__props","el","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_withDirectives","_hoisted_5","_hoisted_6","item","itemIndex","_hoisted_7","_hoisted_9","_vShow","query","selectedIndex","inputRef","useTemplateRef","results","computed","watch","nextTick","closeModal","handleKeydown","e","selectResult","result","_createBlock","_Teleport","_createVNode","_Transition","_renderSlot","_ctx","IS_CLIENT","activePinia","setActivePinia","pinia","piniaSymbol","isPlainObject","MutationType","patchObject","newState","oldState","key","subPatch","targetValue","isRef","isReactive","noop","addSubscription","subscriptions","callback","detached","onCleanup","removeSubscription","getCurrentScope","onScopeDispose","triggerSubscriptions","args","fallbackRunWithContext","fn","ACTION_MARKER","ACTION_NAME","mergeReactiveObjects","target","patchToApply","value","skipHydrateSymbol","shouldHydrate","obj","assign","isComputed","createOptionsStore","id","options","hot","state","actions","getters","initialState","store","setup","localState","toRefs","computedGetters","name","markRaw","createSetupStore","$id","isOptionsStore","scope","optionsForPlugin","$subscribeOptions","event","isListening","debuggerEvents","isSyncListening","actionSubscriptions","hotState","activeListener","$patch","partialStateOrMutator","subscriptionMutation","myListenerId","$reset","$state","$dispose","wrappedAction","afterCallbackSet","onErrorCallbackSet","after","onError","ret","error","_hmrPayload","partialStore","stopWatcher","reactive","setupStore","effectScope","prop","toRef","actionValue","toRaw","newStore","stateKey","newStateTarget","oldStateSource","actionName","actionFn","getterName","getter","getterValue","nonEnumerable","p","extender","extensions","defineStore","setupOptions","isSetupStore","useStore","hasContext","hasInjectionContext","inject","hotId","currentInstance","getCurrentInstance","vm","cache","storeToRefs","rawStore","refs","De","Le","Me","Re","Fe","Ie","ye","Ee","L","xe","r","n","i","Ae","Ne","a","ce","Be","Se","_e","U","Ve","c","d","We","me","de","ze","j","He","H","Q","B","Ce","h","S","$","D","ne","oe","Ue","Je","qe","Ke","je","ge","Ge","v","x","F","we","R","O","b","g","E","w","N","_","A","C","M","G","W","P","k","q","Ze","le","ie","Xe","re","ke","u","l","y","f","T","I","V","m","ee","J","he","Y","se","t","et","Oe","ue","s","pt","fe","be","z","ve","K","Z","ae","Pe","tt","pe","Te","Ot","mt","Qn","un","Rt","St","bt","xt","io","o","qo","wn","Xl","Ct","Et","ta","oa","Ua","Wa","Ga","za","gt","cn","X","ct","ft","In","breadcrumbsVisibile","searchVisible","searchText","rotateHideTabIcon","toggleBreadcrumbs","toggleSearch","handleSearchInput","handleSearch","navigateHome","_component_router_link","_withKeys","breadcrumb","_createTextVNode","props","availableDoctypes","stonecrop","useStonecrop","loading","commandPaletteOpen","currentViewData","currentDoctype","currentRecordId","newData","hstStore","fieldname","fieldPath","route","unref","router","pathMatch","routeDoctype","isNewRecord","currentView","routeName","getAvailableTransitions","meta","currentState","transitions","recordData","targetState","actionElements","elements","createNewRecord","transitionActions","navigationBreadcrumbs","breadcrumbs","formatDoctypeName","recordPath","searchCommands","commands","doNavigate","doctype","cmd","executeCommand","command","word","getRecordCount","navigateToDoctype","openRecord","recordId","newId","getDoctypesSchema","rows","getRecordsSchema","records","getRecords","columns","getColumns","record","col","getRecordFormSchema","recordsData","field","currentViewSchema","handleActionClick","_label","handleDelete","targetRecordId","cell","cellText","row","cells","loadRecordData","provide","data","ActionSet","_unref","AForm","SheetNav","CommandPalette","_withCtx","plugin","app","Desktop"],"mappings":";;;;;;;;AAyEA,UAAMA,IAAOC,GAKPC,IAAiBC,EAA6B,EAAE,GAEhDC,IAASD,EAAI,EAAK,GAClBE,IAAYF,EAAY,EAAE,GAC1BG,IAAQH,EAAI,EAAK,GACjBI,IAAeJ,EAAI,EAAK;AAE9B,IAAAK,GAAU,MAAM;AACf,MAAAC,EAAA;A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AA,QADLV,EAAwC,KAAA,MAArC,aAAQS,EAAGwT,EAAA,KAAW,IAAG,YAAQ,CAAA;AAAA,MAAA,OAFrC7T,KAAAN,EAAkF,OAAlFG,IAAkF,CAAA,GAAAC,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,QAAtCF,EAAgC,WAA7B,6BAAyB,EAAA;AAAA,MAAA;MAMxEoC,GAAiDqV,IAAA,EAAtC,aAAa5C,EAAA,MAAA,GAAqB,MAAA,GAAA,CAAA,aAAA,CAAA;AAAA,MAG7CzS,GAYiBsV,IAAA;AAAA,QAXf,WAASvE,EAAA;AAAA,QACT,QAAQ8B;AAAA,QACT,aAAY;AAAA,QACX,UAAQK;AAAA,QACR,gCAAOnC,EAAA,QAAkB;AAAA,MAAA;QACf,OAAKwE,GACf,CAAkB,EADC,QAAA1V,QAAM;AAAA,UACtB4Q,GAAApS,EAAAwB,EAAO,KAAK,GAAA,CAAA;AAAA,QAAA;QAEL,SAAO0V,GACjB,CAAwB,EADH,QAAA1V,QAAM;AAAA,UACxB4Q,GAAApS,EAAAwB,EAAO,WAAW,GAAA,CAAA;AAAA,QAAA;;;;;ICfnB2V,KAAiB;AAAA,EACtB,SAAS,CAACC,MAAa;AACtB,IAAAA,EAAI,UAAU,aAAaP,EAAS,GACpCO,EAAI,UAAU,kBAAkBH,EAAc,GAC9CG,EAAI,UAAU,WAAWC,EAAO,GAChCD,EAAI,UAAU,YAAYJ,EAAQ;AAAA,EACnC;AACD;","x_google_ignoreList":[2]}
|
|
1
|
+
{"version":3,"file":"desktop.js","sources":["../src/components/ActionSet.vue","../src/components/CommandPalette.vue","../../common/temp/node_modules/.pnpm/pinia@3.0.4_typescript@5.9.3_vue@3.5.28_typescript@5.9.3_/node_modules/pinia/dist/pinia.mjs","../../stonecrop/dist/stonecrop.js","../../aform/dist/aform.js","../src/components/SheetNav.vue","../src/components/Desktop.vue","../src/plugins/index.ts"],"sourcesContent":["<template>\n\t<div\n\t\t:class=\"{ 'open-set': isOpen, 'hovered-and-closed': closeClicked }\"\n\t\tclass=\"action-set collapse\"\n\t\t@mouseover=\"onHover\"\n\t\t@mouseleave=\"onHoverLeave\">\n\t\t<div class=\"action-menu-icon\">\n\t\t\t<div id=\"chevron\" @click=\"closeClicked = !closeClicked\">\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"leftBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"54.2,33.4 29.2,58.8 25,54.6 50,29.2 \" />\n\t\t\t\t</svg>\n\n\t\t\t\t<svg\n\t\t\t\t\tid=\"Layer_1\"\n\t\t\t\t\tclass=\"rightBar\"\n\t\t\t\t\tversion=\"1.1\"\n\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\txmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t\t\t\t\tx=\"0px\"\n\t\t\t\t\ty=\"0px\"\n\t\t\t\t\tviewBox=\"0 0 100 100\"\n\t\t\t\t\txml:space=\"preserve\"\n\t\t\t\t\twidth=\"50\"\n\t\t\t\t\theight=\"50\">\n\t\t\t\t\t<polygon points=\"70.8,58.8 45.8,33.4 50,29.2 75,54.6 \" />\n\t\t\t\t</svg>\n\t\t\t</div>\n\t\t</div>\n\t\t<div style=\"margin-right: 30px\"></div>\n\t\t<div v-for=\"(el, index) in elements\" :key=\"el.label\" class=\"action-element\">\n\t\t\t<button\n\t\t\t\tv-if=\"el.type == 'button'\"\n\t\t\t\t:disabled=\"el.disabled\"\n\t\t\t\tclass=\"button-default\"\n\t\t\t\t@click=\"handleClick(el.action, el.label)\">\n\t\t\t\t{{ el.label }}\n\t\t\t</button>\n\t\t\t<div v-if=\"el.type == 'dropdown'\">\n\t\t\t\t<button class=\"button-default\" @click=\"toggleDropdown(index)\">{{ el.label }}</button>\n\t\t\t\t<div v-show=\"dropdownStates[index]\" class=\"dropdown-container\">\n\t\t\t\t\t<div class=\"dropdown\">\n\t\t\t\t\t\t<div v-for=\"(item, itemIndex) in el.actions\" :key=\"item.label\">\n\t\t\t\t\t\t\t<button v-if=\"item.action != null\" class=\"dropdown-item\" @click=\"handleClick(item.action, item.label)\">\n\t\t\t\t\t\t\t\t{{ item.label }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<a v-else-if=\"item.link != null\" :href=\"item.link\"\n\t\t\t\t\t\t\t\t><button class=\"dropdown-item\">{{ item.label }}</button></a\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { onMounted, ref } from 'vue'\n\nimport type { ActionElements } from '../types'\n\nconst { elements = [] } = defineProps<{ elements?: ActionElements[] }>()\nconst emit = defineEmits<{\n\tactionClick: [label: string, action: (() => void | Promise<void>) | undefined]\n}>()\n\n// Track dropdown open state separately (index -> boolean)\nconst dropdownStates = ref<Record<number, boolean>>({})\n\nconst isOpen = ref(false)\nconst timeoutId = ref<number>(-1)\nconst hover = ref(false)\nconst closeClicked = ref(false)\n\nonMounted(() => {\n\tcloseDropdowns()\n})\n\nconst closeDropdowns = () => {\n\tdropdownStates.value = {}\n}\n\nconst onHover = () => {\n\thover.value = true\n\ttimeoutId.value = setTimeout(() => {\n\t\tif (hover.value) {\n\t\t\tisOpen.value = true\n\t\t}\n\t}, 500)\n}\n\nconst onHoverLeave = () => {\n\thover.value = false\n\tcloseClicked.value = false\n\tclearTimeout(timeoutId.value)\n\tisOpen.value = false\n}\n\nconst toggleDropdown = (index: number) => {\n\tconst showDropdown = !dropdownStates.value[index]\n\tcloseDropdowns()\n\tif (showDropdown) {\n\t\tdropdownStates.value[index] = true\n\t}\n}\n\nconst handleClick = (action: (() => void | Promise<void>) | undefined, label: string) => {\n\t// Emit event to parent - parent will handle execution\n\temit('actionClick', label, action)\n}\n</script>\n\n<style scoped>\n#chevron {\n\tposition: relative;\n\ttransform: rotate(90deg);\n}\n\n.leftBar,\n.rightBar {\n\ttransition-duration: 0.225s;\n\ttransition-property: transform;\n}\n\n.leftBar,\n.action-set.collapse.hovered-and-closed:hover .leftBar {\n\ttransform-origin: 33.4% 50%;\n\ttransform: rotate(90deg);\n}\n\n.rightBar,\n.action-set.collapse.hovered-and-closed:hover .rightBar {\n\ttransform-origin: 67% 50%;\n\ttransform: rotate(-90deg);\n}\n\n.rightBar {\n\tposition: absolute;\n\ttop: 0;\n\tleft: 0;\n}\n\n.action-set.collapse:hover .leftBar {\n\ttransform: rotate(0);\n}\n\n.action-set.collapse:hover .rightBar {\n\ttransform: rotate(0);\n}\n\n.action-set {\n\tposition: fixed;\n\ttop: 10px;\n\tright: 10px;\n\tpadding: 20px;\n\tbox-shadow: 0px 1px 2px rgba(25, 39, 52, 0.05), 0px 0px 4px rgba(25, 39, 52, 0.1);\n\tborder-radius: 10px;\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tbackground-color: white;\n\toverflow: hidden;\n\tz-index: 1001; /* Above SheetNav (100) and operation log button (999) */\n}\n\n.action-menu-icon {\n\tposition: absolute;\n\ttop: 6px;\n\tright: 4px;\n}\n\n.action-menu-icon svg {\n\tfill: #333333;\n}\n\n.action-set.collapse,\n.action-set.collapse.hovered-and-closed:hover {\n\tmax-width: 25px;\n\toverflow: hidden;\n\n\t-webkit-transition: max-width 0.5s ease-in-out;\n\t-moz-transition: max-width 0.5s ease-in-out;\n\t-o-transition: max-width 0.5s ease-in-out;\n\ttransition: max-width 0.5s ease-in-out;\n}\n\n.action-set.collapse .action-element,\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0;\n\t-webkit-transition: opacity 0.25s ease-in-out;\n\t-moz-transition: opacity 0.25s ease-in-out;\n\t-o-transition: opacity 0.25s ease-in-out;\n\ttransition: opacity 0.25s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.action-set.collapse:hover {\n\tmax-width: 500px;\n}\n\n.action-set.collapse.open-set:hover {\n\toverflow: visible !important;\n}\n\n.action-set.collapse.hovered-and-closed:hover .action-element {\n\topacity: 0 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-set.collapse:hover .action-element {\n\topacity: 100 !important;\n\t/* transition-delay: 0.5s; */\n}\n\n.action-element {\n\tmargin-left: 5px;\n\tmargin-right: 5px;\n\tposition: relative; /* Make this the positioning context for absolute children */\n}\nbutton.button-default {\n\tbackground-color: #ffffff;\n\tpadding: 5px 12px;\n\tborder-radius: 3px;\n\tbox-shadow: rgba(0, 0, 0, 0.05) 0px 0.5px 0px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px,\n\t\trgba(0, 0, 0, 0.05) 0px 2px 4px 0px;\n\tborder: none;\n\tcursor: pointer;\n\twhite-space: nowrap;\n}\n\nbutton.button-default:hover {\n\tbackground-color: #f2f2f2;\n}\n\nbutton.button-default:disabled {\n\topacity: 0.5;\n\tcursor: not-allowed;\n\tbackground-color: #f5f5f5;\n\tcolor: #999;\n}\n\nbutton.button-default:disabled:hover {\n\tbackground-color: #f5f5f5;\n}\n\n.dropdown-container {\n\tposition: relative;\n}\n\n.dropdown {\n\tposition: absolute;\n\tright: 0;\n\tmin-width: 200px;\n\tbox-shadow: 0 0.5rem 1rem rgb(0 0 0 / 18%);\n\tborder-radius: 10px;\n\tbackground-color: #ffffff;\n\tpadding: 10px;\n\tz-index: 1000;\n}\n\nbutton.dropdown-item {\n\twidth: 100%;\n\tpadding: 8px 5px;\n\ttext-align: left;\n\tborder: none;\n\tbackground-color: #ffffff;\n\tcursor: pointer;\n\tborder-radius: 5px;\n}\n\nbutton.dropdown-item:hover {\n\tbackground-color: #f2f2f2;\n}\n</style>\n","<template>\n\t<Teleport to=\"body\">\n\t\t<Transition name=\"fade\">\n\t\t\t<div v-if=\"isOpen\" class=\"command-palette-overlay\" @click=\"closeModal\">\n\t\t\t\t<div class=\"command-palette\" @click.stop>\n\t\t\t\t\t<div class=\"command-palette-header\">\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\tref=\"input\"\n\t\t\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\tclass=\"command-palette-input\"\n\t\t\t\t\t\t\t:placeholder=\"placeholder\"\n\t\t\t\t\t\t\tautofocus\n\t\t\t\t\t\t\t@keydown=\"handleKeydown\" />\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div v-if=\"results.length\" class=\"command-palette-results\">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tv-for=\"(result, index) in results\"\n\t\t\t\t\t\t\t:key=\"index\"\n\t\t\t\t\t\t\tclass=\"command-palette-result\"\n\t\t\t\t\t\t\t:class=\"{ selected: index === selectedIndex }\"\n\t\t\t\t\t\t\t@click=\"selectResult(result)\"\n\t\t\t\t\t\t\t@mouseover=\"selectedIndex = index\">\n\t\t\t\t\t\t\t<div class=\"result-title\">\n\t\t\t\t\t\t\t\t<slot name=\"title\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"result-content\">\n\t\t\t\t\t\t\t\t<slot name=\"content\" :result=\"result\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div v-else-if=\"query && !results.length\" class=\"command-palette-no-results\">\n\t\t\t\t\t\t<slot name=\"empty\"> No results found for \"{{ query }}\" </slot>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Transition>\n\t</Teleport>\n</template>\n\n<script setup lang=\"ts\" generic=\"T\">\nimport { ref, computed, watch, nextTick, useTemplateRef } from 'vue'\n\ndefineSlots<{\n\ttitle?: { result: T }\n\tcontent?: { result: T }\n\tempty?: null\n}>()\n\nconst {\n\tsearch,\n\tisOpen = false,\n\tplaceholder = 'Type a command or search...',\n\tmaxResults = 10,\n} = defineProps<{\n\tsearch: (query: string) => T[]\n\tisOpen?: boolean\n\tplaceholder?: string\n\tmaxResults?: number\n}>()\n\nconst emit = defineEmits<{\n\tselect: [T]\n\tclose: []\n}>()\n\nconst query = ref('')\nconst selectedIndex = ref(0)\nconst inputRef = useTemplateRef('input')\n\nconst results = computed(() => {\n\tif (!query.value) return []\n\tconst results = search(query.value)\n\treturn results.slice(0, maxResults)\n})\n\n// reset search query when modal opens\nwatch(\n\t() => isOpen,\n\tasync isOpen => {\n\t\tif (isOpen) {\n\t\t\tquery.value = ''\n\t\t\tselectedIndex.value = 0\n\t\t\tawait nextTick()\n\t\t\t;(inputRef.value as HTMLInputElement)?.focus()\n\t\t}\n\t}\n)\n\n// reset selected index when results change\nwatch(results, () => {\n\tselectedIndex.value = 0\n})\n\nconst closeModal = () => {\n\temit('close')\n}\n\nconst handleKeydown = (e: KeyboardEvent) => {\n\tswitch (e.key) {\n\t\tcase 'Escape':\n\t\t\tcloseModal()\n\t\t\tbreak\n\t\tcase 'ArrowDown':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value + 1) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'ArrowUp':\n\t\t\te.preventDefault()\n\t\t\tif (results.value.length) {\n\t\t\t\tselectedIndex.value = (selectedIndex.value - 1 + results.value.length) % results.value.length\n\t\t\t}\n\t\t\tbreak\n\t\tcase 'Enter':\n\t\t\tif (results.value.length && selectedIndex.value >= 0) {\n\t\t\t\tselectResult(results.value[selectedIndex.value])\n\t\t\t}\n\t\t\tbreak\n\t}\n}\n\nconst selectResult = (result: T) => {\n\temit('select', result)\n\tcloseModal()\n}\n</script>\n\n<style>\n.fade-enter-active,\n.fade-leave-active {\n\ttransition: opacity 0.2s ease;\n}\n\n.fade-enter-from,\n.fade-leave-to {\n\topacity: 0;\n}\n\n.command-palette-overlay {\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tbackground-color: rgba(0, 0, 0, 0.5);\n\tdisplay: flex;\n\talign-items: flex-start;\n\tjustify-content: center;\n\tz-index: 9999;\n\tpadding-top: 100px;\n}\n\n.command-palette {\n\twidth: 600px;\n\tmax-width: 90%;\n\tbackground-color: white;\n\tborder-radius: 8px;\n\tbox-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n\toverflow: hidden;\n\tmax-height: 80vh;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.command-palette-header {\n\tdisplay: flex;\n\tborder-bottom: 1px solid #eaeaea;\n\tpadding: 12px;\n}\n\n.command-palette-input {\n\tflex: 1;\n\tborder: none;\n\toutline: none;\n\tfont-size: 16px;\n\tpadding: 8px 12px;\n\tbackground-color: transparent;\n}\n\n.command-palette-close {\n\tbackground: transparent;\n\tborder: none;\n\tfont-size: 24px;\n\tcursor: pointer;\n\tcolor: #666;\n\tpadding: 0 8px;\n}\n\n.command-palette-close:hover {\n\tcolor: #333;\n}\n\n.command-palette-results {\n\toverflow-y: auto;\n\tmax-height: 60vh;\n}\n\n.command-palette-result {\n\tpadding: 12px 16px;\n\tcursor: pointer;\n\tborder-bottom: 1px solid #f0f0f0;\n}\n\n.command-palette-result:hover,\n.command-palette-result.selected {\n\tbackground-color: #f5f5f5;\n}\n\n.command-palette-result.selected {\n\tbackground-color: rgba(132, 60, 3, 0.1);\n}\n\n.result-title {\n\tfont-weight: 500;\n\tmargin-bottom: 4px;\n\tcolor: #333;\n}\n\n.result-content {\n\tfont-size: 14px;\n\tcolor: #666;\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n}\n\n.command-palette-no-results {\n\tpadding: 20px 16px;\n\ttext-align: center;\n\tcolor: #666;\n}\n</style>\n","/*!\n * pinia v3.0.4\n * (c) 2025 Eduardo San Martin Morote\n * @license MIT\n */\nimport { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isRef, isReactive, getCurrentScope, onScopeDispose, getCurrentInstance, reactive, toRef, nextTick, computed, toRefs } from 'vue';\nimport { setupDevtoolsPlugin } from '@vue/devtools-api';\n\nconst IS_CLIENT = typeof window !== 'undefined';\n\n/**\n * setActivePinia must be called to handle SSR at the top of functions like\n * `fetch`, `setup`, `serverPrefetch` and others\n */\nlet activePinia;\n/**\n * Sets or unsets the active pinia. Used in SSR and internally when calling\n * actions and getters\n *\n * @param pinia - Pinia instance\n */\n// @ts-expect-error: cannot constrain the type of the return\nconst setActivePinia = (pinia) => (activePinia = pinia);\n/**\n * Get the currently active pinia if there is any.\n */\nconst getActivePinia = (process.env.NODE_ENV !== 'production')\n ? () => {\n const pinia = hasInjectionContext() && inject(piniaSymbol);\n if (!pinia && !IS_CLIENT) {\n console.error(`[๐]: Pinia instance not found in context. This falls back to the global activePinia which exposes you to cross-request pollution on the server. Most of the time, it means you are calling \"useStore()\" in the wrong place.\\n` +\n `Read https://vuejs.org/guide/reusability/composables.html to learn more`);\n }\n return pinia || activePinia;\n }\n : () => (hasInjectionContext() && inject(piniaSymbol)) || activePinia;\nconst piniaSymbol = ((process.env.NODE_ENV !== 'production') ? Symbol('pinia') : /* istanbul ignore next */ Symbol());\n\nfunction isPlainObject(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\no) {\n return (o &&\n typeof o === 'object' &&\n Object.prototype.toString.call(o) === '[object Object]' &&\n typeof o.toJSON !== 'function');\n}\n// type DeepReadonly<T> = { readonly [P in keyof T]: DeepReadonly<T[P]> }\n// TODO: can we change these to numbers?\n/**\n * Possible types for SubscriptionCallback\n */\nvar MutationType;\n(function (MutationType) {\n /**\n * Direct mutation of the state:\n *\n * - `store.name = 'new name'`\n * - `store.$state.name = 'new name'`\n * - `store.list.push('new item')`\n */\n MutationType[\"direct\"] = \"direct\";\n /**\n * Mutated the state with `$patch` and an object\n *\n * - `store.$patch({ name: 'newName' })`\n */\n MutationType[\"patchObject\"] = \"patch object\";\n /**\n * Mutated the state with `$patch` and a function\n *\n * - `store.$patch(state => state.name = 'newName')`\n */\n MutationType[\"patchFunction\"] = \"patch function\";\n // maybe reset? for $state = {} and $reset\n})(MutationType || (MutationType = {}));\n\n/*\n * FileSaver.js A saveAs() FileSaver implementation.\n *\n * Originally by Eli Grey, adapted as an ESM module by Eduardo San Martin\n * Morote.\n *\n * License : MIT\n */\n// The one and only way of getting global scope in all environments\n// https://stackoverflow.com/q/3277182/1008999\nconst _global = /*#__PURE__*/ (() => typeof window === 'object' && window.window === window\n ? window\n : typeof self === 'object' && self.self === self\n ? self\n : typeof global === 'object' && global.global === global\n ? global\n : typeof globalThis === 'object'\n ? globalThis\n : { HTMLElement: null })();\nfunction bom(blob, { autoBom = false } = {}) {\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (autoBom &&\n /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n return new Blob([String.fromCharCode(0xfeff), blob], { type: blob.type });\n }\n return blob;\n}\nfunction download(url, name, opts) {\n const xhr = new XMLHttpRequest();\n xhr.open('GET', url);\n xhr.responseType = 'blob';\n xhr.onload = function () {\n saveAs(xhr.response, name, opts);\n };\n xhr.onerror = function () {\n console.error('could not download file');\n };\n xhr.send();\n}\nfunction corsEnabled(url) {\n const xhr = new XMLHttpRequest();\n // use sync to avoid popup blocker\n xhr.open('HEAD', url, false);\n try {\n xhr.send();\n }\n catch (e) { }\n return xhr.status >= 200 && xhr.status <= 299;\n}\n// `a.click()` doesn't work for all browsers (#465)\nfunction click(node) {\n try {\n node.dispatchEvent(new MouseEvent('click'));\n }\n catch (e) {\n const evt = new MouseEvent('click', {\n bubbles: true,\n cancelable: true,\n view: window,\n detail: 0,\n screenX: 80,\n screenY: 20,\n clientX: 80,\n clientY: 20,\n ctrlKey: false,\n altKey: false,\n shiftKey: false,\n metaKey: false,\n button: 0,\n relatedTarget: null,\n });\n node.dispatchEvent(evt);\n }\n}\nconst _navigator = typeof navigator === 'object' ? navigator : { userAgent: '' };\n// Detect WebView inside a native macOS app by ruling out all browsers\n// We just need to check for 'Safari' because all other browsers (besides Firefox) include that too\n// https://www.whatismybrowser.com/guides/the-latest-user-agent/macos\nconst isMacOSWebView = /*#__PURE__*/ (() => /Macintosh/.test(_navigator.userAgent) &&\n /AppleWebKit/.test(_navigator.userAgent) &&\n !/Safari/.test(_navigator.userAgent))();\nconst saveAs = !IS_CLIENT\n ? () => { } // noop\n : // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program\n typeof HTMLAnchorElement !== 'undefined' &&\n 'download' in HTMLAnchorElement.prototype &&\n !isMacOSWebView\n ? downloadSaveAs\n : // Use msSaveOrOpenBlob as a second approach\n 'msSaveOrOpenBlob' in _navigator\n ? msSaveAs\n : // Fallback to using FileReader and a popup\n fileSaverSaveAs;\nfunction downloadSaveAs(blob, name = 'download', opts) {\n const a = document.createElement('a');\n a.download = name;\n a.rel = 'noopener'; // tabnabbing\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n if (typeof blob === 'string') {\n // Support regular links\n a.href = blob;\n if (a.origin !== location.origin) {\n if (corsEnabled(a.href)) {\n download(blob, name, opts);\n }\n else {\n a.target = '_blank';\n click(a);\n }\n }\n else {\n click(a);\n }\n }\n else {\n // Support blobs\n a.href = URL.createObjectURL(blob);\n setTimeout(function () {\n URL.revokeObjectURL(a.href);\n }, 4e4); // 40s\n setTimeout(function () {\n click(a);\n }, 0);\n }\n}\nfunction msSaveAs(blob, name = 'download', opts) {\n if (typeof blob === 'string') {\n if (corsEnabled(blob)) {\n download(blob, name, opts);\n }\n else {\n const a = document.createElement('a');\n a.href = blob;\n a.target = '_blank';\n setTimeout(function () {\n click(a);\n });\n }\n }\n else {\n // @ts-ignore: works on windows\n navigator.msSaveOrOpenBlob(bom(blob, opts), name);\n }\n}\nfunction fileSaverSaveAs(blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open('', '_blank');\n if (popup) {\n popup.document.title = popup.document.body.innerText = 'downloading...';\n }\n if (typeof blob === 'string')\n return download(blob, name, opts);\n const force = blob.type === 'application/octet-stream';\n const isSafari = /constructor/i.test(String(_global.HTMLElement)) || 'safari' in _global;\n const isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent);\n if ((isChromeIOS || (force && isSafari) || isMacOSWebView) &&\n typeof FileReader !== 'undefined') {\n // Safari doesn't allow downloading of blob URLs\n const reader = new FileReader();\n reader.onloadend = function () {\n let url = reader.result;\n if (typeof url !== 'string') {\n popup = null;\n throw new Error('Wrong reader.result type');\n }\n url = isChromeIOS\n ? url\n : url.replace(/^data:[^;]*;/, 'data:attachment/file;');\n if (popup) {\n popup.location.href = url;\n }\n else {\n location.assign(url);\n }\n popup = null; // reverse-tabnabbing #460\n };\n reader.readAsDataURL(blob);\n }\n else {\n const url = URL.createObjectURL(blob);\n if (popup)\n popup.location.assign(url);\n else\n location.href = url;\n popup = null; // reverse-tabnabbing #460\n setTimeout(function () {\n URL.revokeObjectURL(url);\n }, 4e4); // 40s\n }\n}\n\n/**\n * Shows a toast or console.log\n *\n * @param message - message to log\n * @param type - different color of the tooltip\n */\nfunction toastMessage(message, type) {\n const piniaMessage = '๐ ' + message;\n if (typeof __VUE_DEVTOOLS_TOAST__ === 'function') {\n // No longer available :(\n __VUE_DEVTOOLS_TOAST__(piniaMessage, type);\n }\n else if (type === 'error') {\n console.error(piniaMessage);\n }\n else if (type === 'warn') {\n console.warn(piniaMessage);\n }\n else {\n console.log(piniaMessage);\n }\n}\nfunction isPinia(o) {\n return '_a' in o && 'install' in o;\n}\n\n/**\n * This file contain devtools actions, they are not Pinia actions.\n */\n// ---\nfunction checkClipboardAccess() {\n if (!('clipboard' in navigator)) {\n toastMessage(`Your browser doesn't support the Clipboard API`, 'error');\n return true;\n }\n}\nfunction checkNotFocusedError(error) {\n if (error instanceof Error &&\n error.message.toLowerCase().includes('document is not focused')) {\n toastMessage('You need to activate the \"Emulate a focused page\" setting in the \"Rendering\" panel of devtools.', 'warn');\n return true;\n }\n return false;\n}\nasync function actionGlobalCopyState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n await navigator.clipboard.writeText(JSON.stringify(pinia.state.value));\n toastMessage('Global state copied to clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to serialize the state. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalPasteState(pinia) {\n if (checkClipboardAccess())\n return;\n try {\n loadStoresState(pinia, JSON.parse(await navigator.clipboard.readText()));\n toastMessage('Global state pasted from clipboard.');\n }\n catch (error) {\n if (checkNotFocusedError(error))\n return;\n toastMessage(`Failed to deserialize the state from clipboard. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nasync function actionGlobalSaveState(pinia) {\n try {\n saveAs(new Blob([JSON.stringify(pinia.state.value)], {\n type: 'text/plain;charset=utf-8',\n }), 'pinia-state.json');\n }\n catch (error) {\n toastMessage(`Failed to export the state as JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nlet fileInput;\nfunction getFileOpener() {\n if (!fileInput) {\n fileInput = document.createElement('input');\n fileInput.type = 'file';\n fileInput.accept = '.json';\n }\n function openFile() {\n return new Promise((resolve, reject) => {\n fileInput.onchange = async () => {\n const files = fileInput.files;\n if (!files)\n return resolve(null);\n const file = files.item(0);\n if (!file)\n return resolve(null);\n return resolve({ text: await file.text(), file });\n };\n // @ts-ignore: TODO: changed from 4.3 to 4.4\n fileInput.oncancel = () => resolve(null);\n fileInput.onerror = reject;\n fileInput.click();\n });\n }\n return openFile;\n}\nasync function actionGlobalOpenStateFile(pinia) {\n try {\n const open = getFileOpener();\n const result = await open();\n if (!result)\n return;\n const { text, file } = result;\n loadStoresState(pinia, JSON.parse(text));\n toastMessage(`Global state imported from \"${file.name}\".`);\n }\n catch (error) {\n toastMessage(`Failed to import the state from JSON. Check the console for more details.`, 'error');\n console.error(error);\n }\n}\nfunction loadStoresState(pinia, state) {\n for (const key in state) {\n const storeState = pinia.state.value[key];\n // store is already instantiated, patch it\n if (storeState) {\n Object.assign(storeState, state[key]);\n }\n else {\n // store is not instantiated, set the initial state\n pinia.state.value[key] = state[key];\n }\n }\n}\n\nfunction formatDisplay(display) {\n return {\n _custom: {\n display,\n },\n };\n}\nconst PINIA_ROOT_LABEL = '๐ Pinia (root)';\nconst PINIA_ROOT_ID = '_root';\nfunction formatStoreForInspectorTree(store) {\n return isPinia(store)\n ? {\n id: PINIA_ROOT_ID,\n label: PINIA_ROOT_LABEL,\n }\n : {\n id: store.$id,\n label: store.$id,\n };\n}\nfunction formatStoreForInspectorState(store) {\n if (isPinia(store)) {\n const storeNames = Array.from(store._s.keys());\n const storeMap = store._s;\n const state = {\n state: storeNames.map((storeId) => ({\n editable: true,\n key: storeId,\n value: store.state.value[storeId],\n })),\n getters: storeNames\n .filter((id) => storeMap.get(id)._getters)\n .map((id) => {\n const store = storeMap.get(id);\n return {\n editable: false,\n key: id,\n value: store._getters.reduce((getters, key) => {\n getters[key] = store[key];\n return getters;\n }, {}),\n };\n }),\n };\n return state;\n }\n const state = {\n state: Object.keys(store.$state).map((key) => ({\n editable: true,\n key,\n value: store.$state[key],\n })),\n };\n // avoid adding empty getters\n if (store._getters && store._getters.length) {\n state.getters = store._getters.map((getterName) => ({\n editable: false,\n key: getterName,\n value: store[getterName],\n }));\n }\n if (store._customProperties.size) {\n state.customProperties = Array.from(store._customProperties).map((key) => ({\n editable: true,\n key,\n value: store[key],\n }));\n }\n return state;\n}\nfunction formatEventData(events) {\n if (!events)\n return {};\n if (Array.isArray(events)) {\n // TODO: handle add and delete for arrays and objects\n return events.reduce((data, event) => {\n data.keys.push(event.key);\n data.operations.push(event.type);\n data.oldValue[event.key] = event.oldValue;\n data.newValue[event.key] = event.newValue;\n return data;\n }, {\n oldValue: {},\n keys: [],\n operations: [],\n newValue: {},\n });\n }\n else {\n return {\n operation: formatDisplay(events.type),\n key: formatDisplay(events.key),\n oldValue: events.oldValue,\n newValue: events.newValue,\n };\n }\n}\nfunction formatMutationType(type) {\n switch (type) {\n case MutationType.direct:\n return 'mutation';\n case MutationType.patchFunction:\n return '$patch';\n case MutationType.patchObject:\n return '$patch';\n default:\n return 'unknown';\n }\n}\n\n// timeline can be paused when directly changing the state\nlet isTimelineActive = true;\nconst componentStateTypes = [];\nconst MUTATIONS_LAYER_ID = 'pinia:mutations';\nconst INSPECTOR_ID = 'pinia';\nconst { assign: assign$1 } = Object;\n/**\n * Gets the displayed name of a store in devtools\n *\n * @param id - id of the store\n * @returns a formatted string\n */\nconst getStoreType = (id) => '๐ ' + id;\n/**\n * Add the pinia plugin without any store. Allows displaying a Pinia plugin tab\n * as soon as it is added to the application.\n *\n * @param app - Vue application\n * @param pinia - pinia instance\n */\nfunction registerPiniaDevtools(app, pinia) {\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia ๐',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n }, (api) => {\n if (typeof api.now !== 'function') {\n toastMessage('You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html.');\n }\n api.addTimelineLayer({\n id: MUTATIONS_LAYER_ID,\n label: `Pinia ๐`,\n color: 0xe5df88,\n });\n api.addInspector({\n id: INSPECTOR_ID,\n label: 'Pinia ๐',\n icon: 'storage',\n treeFilterPlaceholder: 'Search stores',\n actions: [\n {\n icon: 'content_copy',\n action: () => {\n actionGlobalCopyState(pinia);\n },\n tooltip: 'Serialize and copy the state',\n },\n {\n icon: 'content_paste',\n action: async () => {\n await actionGlobalPasteState(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Replace the state with the content of your clipboard',\n },\n {\n icon: 'save',\n action: () => {\n actionGlobalSaveState(pinia);\n },\n tooltip: 'Save the state as a JSON file',\n },\n {\n icon: 'folder_open',\n action: async () => {\n await actionGlobalOpenStateFile(pinia);\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n },\n tooltip: 'Import the state from a JSON file',\n },\n ],\n nodeActions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state (with \"$reset\")',\n action: (nodeId) => {\n const store = pinia._s.get(nodeId);\n if (!store) {\n toastMessage(`Cannot reset \"${nodeId}\" store because it wasn't found.`, 'warn');\n }\n else if (typeof store.$reset !== 'function') {\n toastMessage(`Cannot reset \"${nodeId}\" store because it doesn't have a \"$reset\" method implemented.`, 'warn');\n }\n else {\n store.$reset();\n toastMessage(`Store \"${nodeId}\" reset.`);\n }\n },\n },\n ],\n });\n api.on.inspectComponent((payload) => {\n const proxy = (payload.componentInstance &&\n payload.componentInstance.proxy);\n if (proxy && proxy._pStores) {\n const piniaStores = payload.componentInstance.proxy._pStores;\n Object.values(piniaStores).forEach((store) => {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'state',\n editable: true,\n value: store._isOptionsAPI\n ? {\n _custom: {\n value: toRaw(store.$state),\n actions: [\n {\n icon: 'restore',\n tooltip: 'Reset the state of this store',\n action: () => store.$reset(),\n },\n ],\n },\n }\n : // NOTE: workaround to unwrap transferred refs\n Object.keys(store.$state).reduce((state, key) => {\n state[key] = store.$state[key];\n return state;\n }, {}),\n });\n if (store._getters && store._getters.length) {\n payload.instanceData.state.push({\n type: getStoreType(store.$id),\n key: 'getters',\n editable: false,\n value: store._getters.reduce((getters, key) => {\n try {\n getters[key] = store[key];\n }\n catch (error) {\n // @ts-expect-error: we just want to show it in devtools\n getters[key] = error;\n }\n return getters;\n }, {}),\n });\n }\n });\n }\n });\n api.on.getInspectorTree((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n let stores = [pinia];\n stores = stores.concat(Array.from(pinia._s.values()));\n payload.rootNodes = (payload.filter\n ? stores.filter((store) => '$id' in store\n ? store.$id\n .toLowerCase()\n .includes(payload.filter.toLowerCase())\n : PINIA_ROOT_LABEL.toLowerCase().includes(payload.filter.toLowerCase()))\n : stores).map(formatStoreForInspectorTree);\n }\n });\n // Expose pinia instance as $pinia to window\n globalThis.$pinia = pinia;\n api.on.getInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n // this could be the selected store restored for a different project\n // so it's better not to say anything here\n return;\n }\n if (inspectedStore) {\n // Expose selected store as $store to window\n if (payload.nodeId !== PINIA_ROOT_ID)\n globalThis.$store = toRaw(inspectedStore);\n payload.state = formatStoreForInspectorState(inspectedStore);\n }\n }\n });\n api.on.editInspectorState((payload) => {\n if (payload.app === app && payload.inspectorId === INSPECTOR_ID) {\n const inspectedStore = payload.nodeId === PINIA_ROOT_ID\n ? pinia\n : pinia._s.get(payload.nodeId);\n if (!inspectedStore) {\n return toastMessage(`store \"${payload.nodeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (!isPinia(inspectedStore)) {\n // access only the state\n if (path.length !== 1 ||\n !inspectedStore._customProperties.has(path[0]) ||\n path[0] in inspectedStore.$state) {\n path.unshift('$state');\n }\n }\n else {\n // Root access, we can omit the `.value` because the devtools API does it for us\n path.unshift('state');\n }\n isTimelineActive = false;\n payload.set(inspectedStore, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n api.on.editComponentState((payload) => {\n if (payload.type.startsWith('๐')) {\n const storeId = payload.type.replace(/^๐\\s*/, '');\n const store = pinia._s.get(storeId);\n if (!store) {\n return toastMessage(`store \"${storeId}\" not found`, 'error');\n }\n const { path } = payload;\n if (path[0] !== 'state') {\n return toastMessage(`Invalid path for store \"${storeId}\":\\n${path}\\nOnly state can be modified.`);\n }\n // rewrite the first entry to be able to directly set the state as\n // well as any other path\n path[0] = '$state';\n isTimelineActive = false;\n payload.set(store, path, payload.state.value);\n isTimelineActive = true;\n }\n });\n });\n}\nfunction addStoreToDevtools(app, store) {\n if (!componentStateTypes.includes(getStoreType(store.$id))) {\n componentStateTypes.push(getStoreType(store.$id));\n }\n setupDevtoolsPlugin({\n id: 'dev.esm.pinia',\n label: 'Pinia ๐',\n logo: 'https://pinia.vuejs.org/logo.svg',\n packageName: 'pinia',\n homepage: 'https://pinia.vuejs.org',\n componentStateTypes,\n app,\n settings: {\n logStoreChanges: {\n label: 'Notify about new/deleted stores',\n type: 'boolean',\n defaultValue: true,\n },\n // useEmojis: {\n // label: 'Use emojis in messages โก๏ธ',\n // type: 'boolean',\n // defaultValue: true,\n // },\n },\n }, (api) => {\n // gracefully handle errors\n const now = typeof api.now === 'function' ? api.now.bind(api) : Date.now;\n store.$onAction(({ after, onError, name, args }) => {\n const groupId = runningActionId++;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '๐ซ ' + name,\n subtitle: 'start',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n },\n groupId,\n },\n });\n after((result) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '๐ฌ ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n result,\n },\n groupId,\n },\n });\n });\n onError((error) => {\n activeAction = undefined;\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n logType: 'error',\n title: '๐ฅ ' + name,\n subtitle: 'end',\n data: {\n store: formatDisplay(store.$id),\n action: formatDisplay(name),\n args,\n error,\n },\n groupId,\n },\n });\n });\n }, true);\n store._customProperties.forEach((name) => {\n watch(() => unref(store[name]), (newValue, oldValue) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (isTimelineActive) {\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: 'Change',\n subtitle: name,\n data: {\n newValue,\n oldValue,\n },\n groupId: activeAction,\n },\n });\n }\n }, { deep: true });\n });\n store.$subscribe(({ events, type }, state) => {\n api.notifyComponentUpdate();\n api.sendInspectorState(INSPECTOR_ID);\n if (!isTimelineActive)\n return;\n // rootStore.state[store.id] = state\n const eventData = {\n time: now(),\n title: formatMutationType(type),\n data: assign$1({ store: formatDisplay(store.$id) }, formatEventData(events)),\n groupId: activeAction,\n };\n if (type === MutationType.patchFunction) {\n eventData.subtitle = 'โคต๏ธ';\n }\n else if (type === MutationType.patchObject) {\n eventData.subtitle = '๐งฉ';\n }\n else if (events && !Array.isArray(events)) {\n eventData.subtitle = events.type;\n }\n if (events) {\n eventData.data['rawEvent(s)'] = {\n _custom: {\n display: 'DebuggerEvent',\n type: 'object',\n tooltip: 'raw DebuggerEvent[]',\n value: events,\n },\n };\n }\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: eventData,\n });\n }, { detached: true, flush: 'sync' });\n const hotUpdate = store._hotUpdate;\n store._hotUpdate = markRaw((newStore) => {\n hotUpdate(newStore);\n api.addTimelineEvent({\n layerId: MUTATIONS_LAYER_ID,\n event: {\n time: now(),\n title: '๐ฅ ' + store.$id,\n subtitle: 'HMR update',\n data: {\n store: formatDisplay(store.$id),\n info: formatDisplay(`HMR update`),\n },\n },\n });\n // update the devtools too\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n });\n const { $dispose } = store;\n store.$dispose = () => {\n $dispose();\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`Disposed \"${store.$id}\" store ๐`);\n };\n // trigger an update so it can display new registered stores\n api.notifyComponentUpdate();\n api.sendInspectorTree(INSPECTOR_ID);\n api.sendInspectorState(INSPECTOR_ID);\n api.getSettings().logStoreChanges &&\n toastMessage(`\"${store.$id}\" store installed ๐`);\n });\n}\nlet runningActionId = 0;\nlet activeAction;\n/**\n * Patches a store to enable action grouping in devtools by wrapping the store with a Proxy that is passed as the\n * context of all actions, allowing us to set `runningAction` on each access and effectively associating any state\n * mutation to the action.\n *\n * @param store - store to patch\n * @param actionNames - list of actionst to patch\n */\nfunction patchActionForGrouping(store, actionNames, wrapWithProxy) {\n // original actions of the store as they are given by pinia. We are going to override them\n const actions = actionNames.reduce((storeActions, actionName) => {\n // use toRaw to avoid tracking #541\n storeActions[actionName] = toRaw(store)[actionName];\n return storeActions;\n }, {});\n for (const actionName in actions) {\n store[actionName] = function () {\n // the running action id is incremented in a before action hook\n const _actionId = runningActionId;\n const trackedStore = wrapWithProxy\n ? new Proxy(store, {\n get(...args) {\n activeAction = _actionId;\n return Reflect.get(...args);\n },\n set(...args) {\n activeAction = _actionId;\n return Reflect.set(...args);\n },\n })\n : store;\n // For Setup Stores we need https://github.com/tc39/proposal-async-context\n activeAction = _actionId;\n const retValue = actions[actionName].apply(trackedStore, arguments);\n // this is safer as async actions in Setup Stores would associate mutations done outside of the action\n activeAction = undefined;\n return retValue;\n };\n }\n}\n/**\n * pinia.use(devtoolsPlugin)\n */\nfunction devtoolsPlugin({ app, store, options }) {\n // HMR module\n if (store.$id.startsWith('__hot:')) {\n return;\n }\n // detect option api vs setup api\n store._isOptionsAPI = !!options.state;\n // Do not overwrite actions mocked by @pinia/testing (#2298)\n if (!store._p._testing) {\n patchActionForGrouping(store, Object.keys(options.actions), store._isOptionsAPI);\n // Upgrade the HMR to also update the new actions\n const originalHotUpdate = store._hotUpdate;\n toRaw(store)._hotUpdate = function (newStore) {\n originalHotUpdate.apply(this, arguments);\n patchActionForGrouping(store, Object.keys(newStore._hmrPayload.actions), !!store._isOptionsAPI);\n };\n }\n addStoreToDevtools(app, \n // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?\n store);\n}\n\n/**\n * Creates a Pinia instance to be used by the application\n */\nfunction createPinia() {\n const scope = effectScope(true);\n // NOTE: here we could check the window object for a state and directly set it\n // if there is anything like it with Vue 3 SSR\n const state = scope.run(() => ref({}));\n let _p = [];\n // plugins added before calling app.use(pinia)\n let toBeInstalled = [];\n const pinia = markRaw({\n install(app) {\n // this allows calling useStore() outside of a component setup after\n // installing pinia's plugin\n setActivePinia(pinia);\n pinia._a = app;\n app.provide(piniaSymbol, pinia);\n app.config.globalProperties.$pinia = pinia;\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n registerPiniaDevtools(app, pinia);\n }\n toBeInstalled.forEach((plugin) => _p.push(plugin));\n toBeInstalled = [];\n },\n use(plugin) {\n if (!this._a) {\n toBeInstalled.push(plugin);\n }\n else {\n _p.push(plugin);\n }\n return this;\n },\n _p,\n // it's actually undefined here\n // @ts-expect-error\n _a: null,\n _e: scope,\n _s: new Map(),\n state,\n });\n // pinia devtools rely on dev only features so they cannot be forced unless\n // the dev build of Vue is used. Avoid old browsers like IE11.\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT && typeof Proxy !== 'undefined') {\n pinia.use(devtoolsPlugin);\n }\n return pinia;\n}\n/**\n * Dispose a Pinia instance by stopping its effectScope and removing the state, plugins and stores. This is mostly\n * useful in tests, with both a testing pinia or a regular pinia and in applications that use multiple pinia instances.\n * Once disposed, the pinia instance cannot be used anymore.\n *\n * @param pinia - pinia instance\n */\nfunction disposePinia(pinia) {\n pinia._e.stop();\n pinia._s.clear();\n pinia._p.splice(0);\n pinia.state.value = {};\n // @ts-expect-error: non valid\n pinia._a = null;\n}\n\n/**\n * Checks if a function is a `StoreDefinition`.\n *\n * @param fn - object to test\n * @returns true if `fn` is a StoreDefinition\n */\nconst isUseStore = (fn) => {\n return typeof fn === 'function' && typeof fn.$id === 'string';\n};\n/**\n * Mutates in place `newState` with `oldState` to _hot update_ it. It will\n * remove any key not existing in `newState` and recursively merge plain\n * objects.\n *\n * @param newState - new state object to be patched\n * @param oldState - old state that should be used to patch newState\n * @returns - newState\n */\nfunction patchObject(newState, oldState) {\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in oldState) {\n const subPatch = oldState[key];\n // skip the whole sub tree\n if (!(key in newState)) {\n continue;\n }\n const targetValue = newState[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n newState[key] = patchObject(targetValue, subPatch);\n }\n else {\n // objects are either a bit more complex (e.g. refs) or primitives, so we\n // just set the whole thing\n newState[key] = subPatch;\n }\n }\n return newState;\n}\n/**\n * Creates an _accept_ function to pass to `import.meta.hot` in Vite applications.\n *\n * @example\n * ```js\n * const useUser = defineStore(...)\n * if (import.meta.hot) {\n * import.meta.hot.accept(acceptHMRUpdate(useUser, import.meta.hot))\n * }\n * ```\n *\n * @param initialUseStore - return of the defineStore to hot update\n * @param hot - `import.meta.hot`\n */\nfunction acceptHMRUpdate(initialUseStore, hot) {\n // strip as much as possible from iife.prod\n if (!(process.env.NODE_ENV !== 'production')) {\n return () => { };\n }\n return (newModule) => {\n const pinia = hot.data.pinia || initialUseStore._pinia;\n if (!pinia) {\n // this store is still not used\n return;\n }\n // preserve the pinia instance across loads\n hot.data.pinia = pinia;\n // console.log('got data', newStore)\n for (const exportName in newModule) {\n const useStore = newModule[exportName];\n // console.log('checking for', exportName)\n if (isUseStore(useStore) && pinia._s.has(useStore.$id)) {\n // console.log('Accepting update for', useStore.$id)\n const id = useStore.$id;\n if (id !== initialUseStore.$id) {\n console.warn(`The id of the store changed from \"${initialUseStore.$id}\" to \"${id}\". Reloading.`);\n // return import.meta.hot.invalidate()\n return hot.invalidate();\n }\n const existingStore = pinia._s.get(id);\n if (!existingStore) {\n console.log(`[Pinia]: skipping hmr because store doesn't exist yet`);\n return;\n }\n useStore(pinia, existingStore);\n }\n }\n };\n}\n\nconst noop = () => { };\nfunction addSubscription(subscriptions, callback, detached, onCleanup = noop) {\n subscriptions.add(callback);\n const removeSubscription = () => {\n const isDel = subscriptions.delete(callback);\n isDel && onCleanup();\n };\n if (!detached && getCurrentScope()) {\n onScopeDispose(removeSubscription);\n }\n return removeSubscription;\n}\nfunction triggerSubscriptions(subscriptions, ...args) {\n subscriptions.forEach((callback) => {\n callback(...args);\n });\n}\n\nconst fallbackRunWithContext = (fn) => fn();\n/**\n * Marks a function as an action for `$onAction`\n * @internal\n */\nconst ACTION_MARKER = Symbol();\n/**\n * Action name symbol. Allows to add a name to an action after defining it\n * @internal\n */\nconst ACTION_NAME = Symbol();\nfunction mergeReactiveObjects(target, patchToApply) {\n // Handle Map instances\n if (target instanceof Map && patchToApply instanceof Map) {\n patchToApply.forEach((value, key) => target.set(key, value));\n }\n else if (target instanceof Set && patchToApply instanceof Set) {\n // Handle Set instances\n patchToApply.forEach(target.add, target);\n }\n // no need to go through symbols because they cannot be serialized anyway\n for (const key in patchToApply) {\n if (!patchToApply.hasOwnProperty(key))\n continue;\n const subPatch = patchToApply[key];\n const targetValue = target[key];\n if (isPlainObject(targetValue) &&\n isPlainObject(subPatch) &&\n target.hasOwnProperty(key) &&\n !isRef(subPatch) &&\n !isReactive(subPatch)) {\n // NOTE: here I wanted to warn about inconsistent types but it's not possible because in setup stores one might\n // start the value of a property as a certain type e.g. a Map, and then for some reason, during SSR, change that\n // to `undefined`. When trying to hydrate, we want to override the Map with `undefined`.\n target[key] = mergeReactiveObjects(targetValue, subPatch);\n }\n else {\n // @ts-expect-error: subPatch is a valid value\n target[key] = subPatch;\n }\n }\n return target;\n}\nconst skipHydrateSymbol = (process.env.NODE_ENV !== 'production')\n ? Symbol('pinia:skipHydration')\n : /* istanbul ignore next */ Symbol();\n/**\n * Tells Pinia to skip the hydration process of a given object. This is useful in setup stores (only) when you return a\n * stateful object in the store but it isn't really state. e.g. returning a router instance in a setup store.\n *\n * @param obj - target object\n * @returns obj\n */\nfunction skipHydrate(obj) {\n return Object.defineProperty(obj, skipHydrateSymbol, {});\n}\n/**\n * Returns whether a value should be hydrated\n *\n * @param obj - target variable\n * @returns true if `obj` should be hydrated\n */\nfunction shouldHydrate(obj) {\n return (!isPlainObject(obj) ||\n !Object.prototype.hasOwnProperty.call(obj, skipHydrateSymbol));\n}\nconst { assign } = Object;\nfunction isComputed(o) {\n return !!(isRef(o) && o.effect);\n}\nfunction createOptionsStore(id, options, pinia, hot) {\n const { state, actions, getters } = options;\n const initialState = pinia.state.value[id];\n let store;\n function setup() {\n if (!initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[id] = state ? state() : {};\n }\n // avoid creating a state in pinia.state.value\n const localState = (process.env.NODE_ENV !== 'production') && hot\n ? // use ref() to unwrap refs inside state TODO: check if this is still necessary\n toRefs(ref(state ? state() : {}).value)\n : toRefs(pinia.state.value[id]);\n return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => {\n if ((process.env.NODE_ENV !== 'production') && name in localState) {\n console.warn(`[๐]: A getter cannot have the same name as another state property. Rename one of them. Found with \"${name}\" in store \"${id}\".`);\n }\n computedGetters[name] = markRaw(computed(() => {\n setActivePinia(pinia);\n // it was created just before\n const store = pinia._s.get(id);\n // allow cross using stores\n // @ts-expect-error\n // return getters![name].call(context, context)\n // TODO: avoid reading the getter while assigning with a global variable\n return getters[name].call(store, store);\n }));\n return computedGetters;\n }, {}));\n }\n store = createSetupStore(id, setup, options, pinia, hot, true);\n return store;\n}\nfunction createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {\n let scope;\n const optionsForPlugin = assign({ actions: {} }, options);\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && !pinia._e.active) {\n throw new Error('Pinia destroyed');\n }\n // watcher options for $subscribe\n const $subscribeOptions = { deep: true };\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n $subscribeOptions.onTrigger = (event) => {\n /* istanbul ignore else */\n if (isListening) {\n debuggerEvents = event;\n // avoid triggering this while the store is being built and the state is being set in pinia\n }\n else if (isListening == false && !store._hotUpdating) {\n // let patch send all the events together later\n /* istanbul ignore else */\n if (Array.isArray(debuggerEvents)) {\n debuggerEvents.push(event);\n }\n else {\n console.error('๐ debuggerEvents should be an array. This is most likely an internal Pinia bug.');\n }\n }\n };\n }\n // internal state\n let isListening; // set to true at the end\n let isSyncListening; // set to true at the end\n let subscriptions = new Set();\n let actionSubscriptions = new Set();\n let debuggerEvents;\n const initialState = pinia.state.value[$id];\n // avoid setting the state for option stores if it is set\n // by the setup\n if (!isOptionsStore && !initialState && (!(process.env.NODE_ENV !== 'production') || !hot)) {\n /* istanbul ignore if */\n pinia.state.value[$id] = {};\n }\n const hotState = ref({});\n // avoid triggering too many listeners\n // https://github.com/vuejs/pinia/issues/1129\n let activeListener;\n function $patch(partialStateOrMutator) {\n let subscriptionMutation;\n isListening = isSyncListening = false;\n // reset the debugger events since patches are sync\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n debuggerEvents = [];\n }\n if (typeof partialStateOrMutator === 'function') {\n partialStateOrMutator(pinia.state.value[$id]);\n subscriptionMutation = {\n type: MutationType.patchFunction,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n else {\n mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator);\n subscriptionMutation = {\n type: MutationType.patchObject,\n payload: partialStateOrMutator,\n storeId: $id,\n events: debuggerEvents,\n };\n }\n const myListenerId = (activeListener = Symbol());\n nextTick().then(() => {\n if (activeListener === myListenerId) {\n isListening = true;\n }\n });\n isSyncListening = true;\n // because we paused the watcher, we need to manually call the subscriptions\n triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]);\n }\n const $reset = isOptionsStore\n ? function $reset() {\n const { state } = options;\n const newState = state ? state() : {};\n // we use a patch to group all changes into one single subscription\n this.$patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, newState);\n });\n }\n : /* istanbul ignore next */\n (process.env.NODE_ENV !== 'production')\n ? () => {\n throw new Error(`๐: Store \"${$id}\" is built using the setup syntax and does not implement $reset().`);\n }\n : noop;\n function $dispose() {\n scope.stop();\n subscriptions.clear();\n actionSubscriptions.clear();\n pinia._s.delete($id);\n }\n /**\n * Helper that wraps function so it can be tracked with $onAction\n * @param fn - action to wrap\n * @param name - name of the action\n */\n const action = (fn, name = '') => {\n if (ACTION_MARKER in fn) {\n fn[ACTION_NAME] = name;\n return fn;\n }\n const wrappedAction = function () {\n setActivePinia(pinia);\n const args = Array.from(arguments);\n const afterCallbackSet = new Set();\n const onErrorCallbackSet = new Set();\n function after(callback) {\n afterCallbackSet.add(callback);\n }\n function onError(callback) {\n onErrorCallbackSet.add(callback);\n }\n // @ts-expect-error\n triggerSubscriptions(actionSubscriptions, {\n args,\n name: wrappedAction[ACTION_NAME],\n store,\n after,\n onError,\n });\n let ret;\n try {\n ret = fn.apply(this && this.$id === $id ? this : store, args);\n // handle sync errors\n }\n catch (error) {\n triggerSubscriptions(onErrorCallbackSet, error);\n throw error;\n }\n if (ret instanceof Promise) {\n return ret\n .then((value) => {\n triggerSubscriptions(afterCallbackSet, value);\n return value;\n })\n .catch((error) => {\n triggerSubscriptions(onErrorCallbackSet, error);\n return Promise.reject(error);\n });\n }\n // trigger after callbacks\n triggerSubscriptions(afterCallbackSet, ret);\n return ret;\n };\n wrappedAction[ACTION_MARKER] = true;\n wrappedAction[ACTION_NAME] = name; // will be set later\n // @ts-expect-error: we are intentionally limiting the returned type to just Fn\n // because all the added properties are internals that are exposed through `$onAction()` only\n return wrappedAction;\n };\n const _hmrPayload = /*#__PURE__*/ markRaw({\n actions: {},\n getters: {},\n state: [],\n hotState,\n });\n const partialStore = {\n _p: pinia,\n // _s: scope,\n $id,\n $onAction: addSubscription.bind(null, actionSubscriptions),\n $patch,\n $reset,\n $subscribe(callback, options = {}) {\n const removeSubscription = addSubscription(subscriptions, callback, options.detached, () => stopWatcher());\n const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => {\n if (options.flush === 'sync' ? isSyncListening : isListening) {\n callback({\n storeId: $id,\n type: MutationType.direct,\n events: debuggerEvents,\n }, state);\n }\n }, assign({}, $subscribeOptions, options)));\n return removeSubscription;\n },\n $dispose,\n };\n const store = reactive((process.env.NODE_ENV !== 'production') || ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT)\n ? assign({\n _hmrPayload,\n _customProperties: markRaw(new Set()), // devtools custom properties\n }, partialStore\n // must be added later\n // setupStore\n )\n : partialStore);\n // store the partial store now so the setup of stores can instantiate each other before they are finished without\n // creating infinite loops.\n pinia._s.set($id, store);\n const runWithContext = (pinia._a && pinia._a.runWithContext) || fallbackRunWithContext;\n // TODO: idea create skipSerialize that marks properties as non serializable and they are skipped\n const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action }))));\n // overwrite existing actions to support $onAction\n for (const key in setupStore) {\n const prop = setupStore[key];\n if ((isRef(prop) && !isComputed(prop)) || isReactive(prop)) {\n // mark it as a piece of state to be serialized\n if ((process.env.NODE_ENV !== 'production') && hot) {\n hotState.value[key] = toRef(setupStore, key);\n // createOptionStore directly sets the state in pinia.state.value so we\n // can just skip that\n }\n else if (!isOptionsStore) {\n // in setup stores we must hydrate the state and sync pinia state tree with the refs the user just created\n if (initialState && shouldHydrate(prop)) {\n if (isRef(prop)) {\n prop.value = initialState[key];\n }\n else {\n // probably a reactive object, lets recursively assign\n // @ts-expect-error: prop is unknown\n mergeReactiveObjects(prop, initialState[key]);\n }\n }\n // transfer the ref to the pinia state to keep everything in sync\n pinia.state.value[$id][key] = prop;\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.state.push(key);\n }\n // action\n }\n else if (typeof prop === 'function') {\n const actionValue = (process.env.NODE_ENV !== 'production') && hot ? prop : action(prop, key);\n // this a hot module replacement store because the hotUpdate method needs\n // to do it with the right context\n // @ts-expect-error\n setupStore[key] = actionValue;\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n _hmrPayload.actions[key] = prop;\n }\n // list actions so they can be used in plugins\n // @ts-expect-error\n optionsForPlugin.actions[key] = prop;\n }\n else if ((process.env.NODE_ENV !== 'production')) {\n // add getters for devtools\n if (isComputed(prop)) {\n _hmrPayload.getters[key] = isOptionsStore\n ? // @ts-expect-error\n options.getters[key]\n : prop;\n if (IS_CLIENT) {\n const getters = setupStore._getters ||\n // @ts-expect-error: same\n (setupStore._getters = markRaw([]));\n getters.push(key);\n }\n }\n }\n }\n // add the state, getters, and action properties\n /* istanbul ignore if */\n assign(store, setupStore);\n // allows retrieving reactive objects with `storeToRefs()`. Must be called after assigning to the reactive object.\n // Make `storeToRefs()` work with `reactive()` #799\n assign(toRaw(store), setupStore);\n // use this instead of a computed with setter to be able to create it anywhere\n // without linking the computed lifespan to wherever the store is first\n // created.\n Object.defineProperty(store, '$state', {\n get: () => ((process.env.NODE_ENV !== 'production') && hot ? hotState.value : pinia.state.value[$id]),\n set: (state) => {\n /* istanbul ignore if */\n if ((process.env.NODE_ENV !== 'production') && hot) {\n throw new Error('cannot set hotState');\n }\n $patch(($state) => {\n // @ts-expect-error: FIXME: shouldn't error?\n assign($state, state);\n });\n },\n });\n // add the hotUpdate before plugins to allow them to override it\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n store._hotUpdate = markRaw((newStore) => {\n store._hotUpdating = true;\n newStore._hmrPayload.state.forEach((stateKey) => {\n if (stateKey in store.$state) {\n const newStateTarget = newStore.$state[stateKey];\n const oldStateSource = store.$state[stateKey];\n if (typeof newStateTarget === 'object' &&\n isPlainObject(newStateTarget) &&\n isPlainObject(oldStateSource)) {\n patchObject(newStateTarget, oldStateSource);\n }\n else {\n // transfer the ref\n newStore.$state[stateKey] = oldStateSource;\n }\n }\n // patch direct access properties to allow store.stateProperty to work as\n // store.$state.stateProperty\n // @ts-expect-error: any type\n store[stateKey] = toRef(newStore.$state, stateKey);\n });\n // remove deleted state properties\n Object.keys(store.$state).forEach((stateKey) => {\n if (!(stateKey in newStore.$state)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[stateKey];\n }\n });\n // avoid devtools logging this as a mutation\n isListening = false;\n isSyncListening = false;\n pinia.state.value[$id] = toRef(newStore._hmrPayload, 'hotState');\n isSyncListening = true;\n nextTick().then(() => {\n isListening = true;\n });\n for (const actionName in newStore._hmrPayload.actions) {\n const actionFn = newStore[actionName];\n // @ts-expect-error: actionName is a string\n store[actionName] =\n //\n action(actionFn, actionName);\n }\n // TODO: does this work in both setup and option store?\n for (const getterName in newStore._hmrPayload.getters) {\n const getter = newStore._hmrPayload.getters[getterName];\n const getterValue = isOptionsStore\n ? // special handling of options api\n computed(() => {\n setActivePinia(pinia);\n return getter.call(store, store);\n })\n : getter;\n // @ts-expect-error: getterName is a string\n store[getterName] =\n //\n getterValue;\n }\n // remove deleted getters\n Object.keys(store._hmrPayload.getters).forEach((key) => {\n if (!(key in newStore._hmrPayload.getters)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // remove old actions\n Object.keys(store._hmrPayload.actions).forEach((key) => {\n if (!(key in newStore._hmrPayload.actions)) {\n // @ts-expect-error: noop if doesn't exist\n delete store[key];\n }\n });\n // update the values used in devtools and to allow deleting new properties later on\n store._hmrPayload = newStore._hmrPayload;\n store._getters = newStore._getters;\n store._hotUpdating = false;\n });\n }\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const nonEnumerable = {\n writable: true,\n configurable: true,\n // avoid warning on devtools trying to display this property\n enumerable: false,\n };\n ['_p', '_hmrPayload', '_getters', '_customProperties'].forEach((p) => {\n Object.defineProperty(store, p, assign({ value: store[p] }, nonEnumerable));\n });\n }\n // apply all plugins\n pinia._p.forEach((extender) => {\n /* istanbul ignore else */\n if ((((process.env.NODE_ENV !== 'production') || (typeof __VUE_PROD_DEVTOOLS__ !== 'undefined' && __VUE_PROD_DEVTOOLS__)) && !(process.env.NODE_ENV === 'test')) && IS_CLIENT) {\n const extensions = scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n }));\n Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key));\n assign(store, extensions);\n }\n else {\n assign(store, scope.run(() => extender({\n store: store,\n app: pinia._a,\n pinia,\n options: optionsForPlugin,\n })));\n }\n });\n if ((process.env.NODE_ENV !== 'production') &&\n store.$state &&\n typeof store.$state === 'object' &&\n typeof store.$state.constructor === 'function' &&\n !store.$state.constructor.toString().includes('[native code]')) {\n console.warn(`[๐]: The \"state\" must be a plain object. It cannot be\\n` +\n `\\tstate: () => new MyClass()\\n` +\n `Found in store \"${store.$id}\".`);\n }\n // only apply hydrate to option stores with an initial state in pinia\n if (initialState &&\n isOptionsStore &&\n options.hydrate) {\n options.hydrate(store.$state, initialState);\n }\n isListening = true;\n isSyncListening = true;\n return store;\n}\n// allows unused stores to be tree shaken\n/*! #__NO_SIDE_EFFECTS__ */\nfunction defineStore(\n// TODO: add proper types from above\nid, setup, setupOptions) {\n let options;\n const isSetupStore = typeof setup === 'function';\n // the option store setup will contain the actual options in this case\n options = isSetupStore ? setupOptions : setup;\n function useStore(pinia, hot) {\n const hasContext = hasInjectionContext();\n pinia =\n // in test mode, ignore the argument provided as we can always retrieve a\n // pinia instance with getActivePinia()\n ((process.env.NODE_ENV === 'test') && activePinia && activePinia._testing ? null : pinia) ||\n (hasContext ? inject(piniaSymbol, null) : null);\n if (pinia)\n setActivePinia(pinia);\n if ((process.env.NODE_ENV !== 'production') && !activePinia) {\n throw new Error(`[๐]: \"getActivePinia()\" was called but there was no active Pinia. Are you trying to use a store before calling \"app.use(pinia)\"?\\n` +\n `See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.\\n` +\n `This will fail in production.`);\n }\n pinia = activePinia;\n if (!pinia._s.has(id)) {\n // creating the store registers it in `pinia._s`\n if (isSetupStore) {\n createSetupStore(id, setup, options, pinia);\n }\n else {\n createOptionsStore(id, options, pinia);\n }\n /* istanbul ignore else */\n if ((process.env.NODE_ENV !== 'production')) {\n // @ts-expect-error: not the right inferred type\n useStore._pinia = pinia;\n }\n }\n const store = pinia._s.get(id);\n if ((process.env.NODE_ENV !== 'production') && hot) {\n const hotId = '__hot:' + id;\n const newStore = isSetupStore\n ? createSetupStore(hotId, setup, options, pinia, true)\n : createOptionsStore(hotId, assign({}, options), pinia, true);\n hot._hotUpdate(newStore);\n // cleanup the state properties and the store from the cache\n delete pinia.state.value[hotId];\n pinia._s.delete(hotId);\n }\n if ((process.env.NODE_ENV !== 'production') && IS_CLIENT) {\n const currentInstance = getCurrentInstance();\n // save stores in instances to access them devtools\n if (currentInstance &&\n currentInstance.proxy &&\n // avoid adding stores that are just built for hot module replacement\n !hot) {\n const vm = currentInstance.proxy;\n const cache = '_pStores' in vm ? vm._pStores : (vm._pStores = {});\n cache[id] = store;\n }\n }\n // StoreGeneric cannot be casted towards Store\n return store;\n }\n useStore.$id = id;\n return useStore;\n}\n\nlet mapStoreSuffix = 'Store';\n/**\n * Changes the suffix added by `mapStores()`. Can be set to an empty string.\n * Defaults to `\"Store\"`. Make sure to extend the MapStoresCustomization\n * interface if you are using TypeScript.\n *\n * @param suffix - new suffix\n */\nfunction setMapStoreSuffix(suffix // could be 'Store' but that would be annoying for JS\n) {\n mapStoreSuffix = suffix;\n}\n/**\n * Allows using stores without the composition API (`setup()`) by generating an\n * object to be spread in the `computed` field of a component. It accepts a list\n * of store definitions.\n *\n * @example\n * ```js\n * export default {\n * computed: {\n * // other computed properties\n * ...mapStores(useUserStore, useCartStore)\n * },\n *\n * created() {\n * this.userStore // store with id \"user\"\n * this.cartStore // store with id \"cart\"\n * }\n * }\n * ```\n *\n * @param stores - list of stores to map to an object\n */\nfunction mapStores(...stores) {\n if ((process.env.NODE_ENV !== 'production') && Array.isArray(stores[0])) {\n console.warn(`[๐]: Directly pass all stores to \"mapStores()\" without putting them in an array:\\n` +\n `Replace\\n` +\n `\\tmapStores([useAuthStore, useCartStore])\\n` +\n `with\\n` +\n `\\tmapStores(useAuthStore, useCartStore)\\n` +\n `This will fail in production if not fixed.`);\n stores = stores[0];\n }\n return stores.reduce((reduced, useStore) => {\n // @ts-expect-error: $id is added by defineStore\n reduced[useStore.$id + mapStoreSuffix] = function () {\n return useStore(this.$pinia);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = function () {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key];\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function () {\n const store = useStore(this.$pinia);\n const storeKey = keysOrMapper[key];\n // for some reason TS is unable to infer the type of storeKey to be a\n // function\n return typeof storeKey === 'function'\n ? storeKey.call(this, store)\n : // @ts-expect-error: FIXME: should work?\n store[storeKey];\n };\n return reduced;\n }, {});\n}\n/**\n * Alias for `mapState()`. You should use `mapState()` instead.\n * @deprecated use `mapState()` instead.\n */\nconst mapGetters = mapState;\n/**\n * Allows directly using actions from your store without using the composition\n * API (`setup()`) by generating an object to be spread in the `methods` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapActions(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[key](...args);\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n // @ts-expect-error\n reduced[key] = function (...args) {\n // @ts-expect-error: FIXME: should work?\n return useStore(this.$pinia)[keysOrMapper[key]](...args);\n };\n return reduced;\n }, {});\n}\n/**\n * Allows using state and getters from one store without using the composition\n * API (`setup()`) by generating an object to be spread in the `computed` field\n * of a component.\n *\n * @param useStore - store to map from\n * @param keysOrMapper - array or object\n */\nfunction mapWritableState(useStore, keysOrMapper) {\n return Array.isArray(keysOrMapper)\n ? keysOrMapper.reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[key];\n },\n set(value) {\n return (useStore(this.$pinia)[key] = value);\n },\n };\n return reduced;\n }, {})\n : Object.keys(keysOrMapper).reduce((reduced, key) => {\n reduced[key] = {\n get() {\n return useStore(this.$pinia)[keysOrMapper[key]];\n },\n set(value) {\n return (useStore(this.$pinia)[keysOrMapper[key]] = value);\n },\n };\n return reduced;\n }, {});\n}\n\n/**\n * Creates an object of references with all the state, getters, and plugin-added\n * state properties of the store. Similar to `toRefs()` but specifically\n * designed for Pinia stores so methods and non reactive properties are\n * completely ignored.\n *\n * @param store - store to extract the refs from\n */\nfunction storeToRefs(store) {\n const rawStore = toRaw(store);\n const refs = {};\n for (const key in rawStore) {\n const value = rawStore[key];\n // There is no native method to check for a computed\n // https://github.com/vuejs/core/pull/4165\n if (value.effect) {\n // @ts-expect-error: too hard to type correctly\n refs[key] =\n // ...\n computed({\n get: () => store[key],\n set(value) {\n store[key] = value;\n },\n });\n }\n else if (isRef(value) || isReactive(value)) {\n // @ts-expect-error: the key is state or getter\n refs[key] =\n // ---\n toRef(store, key);\n }\n }\n return refs;\n}\n\nexport { MutationType, acceptHMRUpdate, createPinia, defineStore, disposePinia, getActivePinia, mapActions, mapGetters, mapState, mapStores, mapWritableState, setActivePinia, setMapStoreSuffix, shouldHydrate, skipHydrate, storeToRefs };\n","import { watch as U, onMounted as ve, nextTick as de, readonly as ye, getCurrentInstance as Se, toRef as Pe, customRef as Ie, ref as L, reactive as ue, computed as _, toValue as H, shallowRef as we, unref as Ee, inject as fe, provide as he } from \"vue\";\nimport { defineStore as ke, storeToRefs as be } from \"pinia\";\nconst De = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Le = Object.prototype.toString, Me = (o) => Le.call(o) === \"[object Object]\", Re = () => {\n};\nfunction Fe(...o) {\n if (o.length !== 1) return Pe(...o);\n const e = o[0];\n return typeof e == \"function\" ? ye(Ie(() => ({\n get: e,\n set: Re\n }))) : L(e);\n}\nfunction Ne(o, e) {\n function t(...r) {\n return new Promise((n, i) => {\n Promise.resolve(o(() => e.apply(this, r), {\n fn: e,\n thisArg: this,\n args: r\n })).then(n).catch(i);\n });\n }\n return t;\n}\nconst Ae = (o) => o();\nfunction xe(o = Ae, e = {}) {\n const { initialState: t = \"active\" } = e, r = Fe(t === \"active\");\n function n() {\n r.value = !1;\n }\n function i() {\n r.value = !0;\n }\n const s = (...a) => {\n r.value && o(...a);\n };\n return {\n isActive: ye(r),\n pause: n,\n resume: i,\n eventFilter: s\n };\n}\nfunction ce(o) {\n return Array.isArray(o) ? o : [o];\n}\nfunction _e(o) {\n return Se();\n}\nfunction Be(o, e, t = {}) {\n const { eventFilter: r = Ae, ...n } = t;\n return U(o, Ne(r, e), n);\n}\nfunction Ve(o, e, t = {}) {\n const { eventFilter: r, initialState: n = \"active\", ...i } = t, { eventFilter: s, pause: a, resume: c, isActive: d } = xe(r, { initialState: n });\n return {\n stop: Be(o, e, {\n ...i,\n eventFilter: s\n }),\n pause: a,\n resume: c,\n isActive: d\n };\n}\nfunction We(o, e = !0, t) {\n _e() ? ve(o, t) : e ? o() : de(o);\n}\nfunction ze(o, e, t) {\n return U(o, e, {\n ...t,\n immediate: !0\n });\n}\nfunction X(o, e, t) {\n return U(o, (n, i, s) => {\n n && e(n, i, s);\n }, {\n ...t,\n once: !1\n });\n}\nconst j = De ? window : void 0;\nfunction He(o) {\n var e;\n const t = H(o);\n return (e = t?.$el) !== null && e !== void 0 ? e : t;\n}\nfunction Q(...o) {\n const e = (r, n, i, s) => (r.addEventListener(n, i, s), () => r.removeEventListener(n, i, s)), t = _(() => {\n const r = ce(H(o[0])).filter((n) => n != null);\n return r.every((n) => typeof n != \"string\") ? r : void 0;\n });\n return ze(() => {\n var r, n;\n return [\n (r = (n = t.value) === null || n === void 0 ? void 0 : n.map((i) => He(i))) !== null && r !== void 0 ? r : [j].filter((i) => i != null),\n ce(H(t.value ? o[1] : o[0])),\n ce(Ee(t.value ? o[2] : o[1])),\n H(t.value ? o[3] : o[2])\n ];\n }, ([r, n, i, s], a, c) => {\n if (!r?.length || !n?.length || !i?.length) return;\n const d = Me(s) ? { ...s } : s, p = r.flatMap((S) => n.flatMap(($) => i.map((D) => e(S, $, D, d))));\n c(() => {\n p.forEach((S) => S());\n });\n }, { flush: \"post\" });\n}\nconst ne = typeof globalThis < \"u\" ? globalThis : typeof window < \"u\" ? window : typeof global < \"u\" ? global : typeof self < \"u\" ? self : {}, oe = \"__vueuse_ssr_handlers__\", Ue = /* @__PURE__ */ qe();\nfunction qe() {\n return oe in ne || (ne[oe] = ne[oe] || {}), ne[oe];\n}\nfunction Je(o, e) {\n return Ue[o] || e;\n}\nfunction Ke(o) {\n return o == null ? \"any\" : o instanceof Set ? \"set\" : o instanceof Map ? \"map\" : o instanceof Date ? \"date\" : typeof o == \"boolean\" ? \"boolean\" : typeof o == \"string\" ? \"string\" : typeof o == \"object\" ? \"object\" : Number.isNaN(o) ? \"any\" : \"number\";\n}\nconst je = {\n boolean: {\n read: (o) => o === \"true\",\n write: (o) => String(o)\n },\n object: {\n read: (o) => JSON.parse(o),\n write: (o) => JSON.stringify(o)\n },\n number: {\n read: (o) => Number.parseFloat(o),\n write: (o) => String(o)\n },\n any: {\n read: (o) => o,\n write: (o) => String(o)\n },\n string: {\n read: (o) => o,\n write: (o) => String(o)\n },\n map: {\n read: (o) => new Map(JSON.parse(o)),\n write: (o) => JSON.stringify(Array.from(o.entries()))\n },\n set: {\n read: (o) => new Set(JSON.parse(o)),\n write: (o) => JSON.stringify(Array.from(o))\n },\n date: {\n read: (o) => new Date(o),\n write: (o) => o.toISOString()\n }\n}, ge = \"vueuse-storage\";\nfunction Ge(o, e, t, r = {}) {\n var n;\n const { flush: i = \"pre\", deep: s = !0, listenToStorageChanges: a = !0, writeDefaults: c = !0, mergeDefaults: d = !1, shallow: p, window: S = j, eventFilter: $, onError: D = (m) => {\n console.error(m);\n }, initOnMounted: N } = r, F = (p ? we : L)(e), R = _(() => H(o));\n if (!t) try {\n t = Je(\"getDefaultStorage\", () => j?.localStorage)();\n } catch (m) {\n D(m);\n }\n if (!t) return F;\n const O = H(e), b = Ke(O), g = (n = r.serializer) !== null && n !== void 0 ? n : je[b], { pause: I, resume: w } = Ve(F, (m) => x(m), {\n flush: i,\n deep: s,\n eventFilter: $\n });\n U(R, () => B(), { flush: i });\n let A = !1;\n const E = (m) => {\n N && !A || B(m);\n }, M = (m) => {\n N && !A || G(m);\n };\n S && a && (t instanceof Storage ? Q(S, \"storage\", E, { passive: !0 }) : Q(S, ge, M)), N ? We(() => {\n A = !0, B();\n }) : B();\n function W(m, C) {\n if (S) {\n const k = {\n key: R.value,\n oldValue: m,\n newValue: C,\n storageArea: t\n };\n S.dispatchEvent(t instanceof Storage ? new StorageEvent(\"storage\", k) : new CustomEvent(ge, { detail: k }));\n }\n }\n function x(m) {\n try {\n const C = t.getItem(R.value);\n if (m == null)\n W(C, null), t.removeItem(R.value);\n else {\n const k = g.write(m);\n C !== k && (t.setItem(R.value, k), W(C, k));\n }\n } catch (C) {\n D(C);\n }\n }\n function J(m) {\n const C = m ? m.newValue : t.getItem(R.value);\n if (C == null)\n return c && O != null && t.setItem(R.value, g.write(O)), O;\n if (!m && d) {\n const k = g.read(C);\n return typeof d == \"function\" ? d(k, O) : b === \"object\" && !Array.isArray(k) ? {\n ...O,\n ...k\n } : k;\n } else return typeof C != \"string\" ? C : g.read(C);\n }\n function B(m) {\n if (!(m && m.storageArea !== t)) {\n if (m && m.key == null) {\n F.value = O;\n return;\n }\n if (!(m && m.key !== R.value)) {\n I();\n try {\n const C = g.write(F.value);\n (m === void 0 || m?.newValue !== C) && (F.value = J(m));\n } catch (C) {\n D(C);\n } finally {\n m ? de(w) : w();\n }\n }\n }\n }\n function G(m) {\n B(m.detail);\n }\n return F;\n}\nfunction Ze(o, e, t = {}) {\n const { window: r = j } = t;\n return Ge(o, e, r?.localStorage, t);\n}\nconst Qe = {\n ctrl: \"control\",\n command: \"meta\",\n cmd: \"meta\",\n option: \"alt\",\n up: \"arrowup\",\n down: \"arrowdown\",\n left: \"arrowleft\",\n right: \"arrowright\"\n};\nfunction Ye(o = {}) {\n const { reactive: e = !1, target: t = j, aliasMap: r = Qe, passive: n = !0, onEventFired: i = Re } = o, s = ue(/* @__PURE__ */ new Set()), a = {\n toJSON() {\n return {};\n },\n current: s\n }, c = e ? ue(a) : a, d = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Map([\n [\"Meta\", d],\n [\"Shift\", /* @__PURE__ */ new Set()],\n [\"Alt\", /* @__PURE__ */ new Set()]\n ]), S = /* @__PURE__ */ new Set();\n function $(b, g) {\n b in c && (e ? c[b] = g : c[b].value = g);\n }\n function D() {\n s.clear();\n for (const b of S) $(b, !1);\n }\n function N(b, g, I) {\n if (!(!b || typeof g.getModifierState != \"function\")) {\n for (const [w, A] of p) if (g.getModifierState(w)) {\n I.forEach((E) => A.add(E));\n break;\n }\n }\n }\n function F(b, g) {\n if (b) return;\n const I = `${g[0].toUpperCase()}${g.slice(1)}`, w = p.get(I);\n if (![\"shift\", \"alt\"].includes(g) || !w) return;\n const A = Array.from(w), E = A.indexOf(g);\n A.forEach((M, W) => {\n W >= E && (s.delete(M), $(M, !1));\n }), w.clear();\n }\n function R(b, g) {\n var I, w;\n const A = (I = b.key) === null || I === void 0 ? void 0 : I.toLowerCase(), E = [(w = b.code) === null || w === void 0 ? void 0 : w.toLowerCase(), A].filter(Boolean);\n if (A) {\n A && (g ? s.add(A) : s.delete(A));\n for (const M of E)\n S.add(M), $(M, g);\n N(g, b, [...s, ...E]), F(g, A), A === \"meta\" && !g && (d.forEach((M) => {\n s.delete(M), $(M, !1);\n }), d.clear());\n }\n }\n Q(t, \"keydown\", (b) => (R(b, !0), i(b)), { passive: n }), Q(t, \"keyup\", (b) => (R(b, !1), i(b)), { passive: n }), Q(\"blur\", D, { passive: n }), Q(\"focus\", D, { passive: n });\n const O = new Proxy(c, { get(b, g, I) {\n if (typeof g != \"string\") return Reflect.get(b, g, I);\n if (g = g.toLowerCase(), g in r && (g = r[g]), !(g in c)) if (/[+_-]/.test(g)) {\n const A = g.split(/[+_-]/g).map((E) => E.trim());\n c[g] = _(() => A.map((E) => H(O[E])).every(Boolean));\n } else c[g] = we(!1);\n const w = Reflect.get(b, g, I);\n return e ? H(w) : w;\n } });\n return O;\n}\nfunction le() {\n return typeof crypto < \"u\" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;\n}\nfunction ie(o) {\n const e = {\n type: o.type,\n clientId: o.clientId,\n timestamp: o.timestamp.toISOString()\n };\n return o.operation && (e.operation = {\n ...o.operation,\n timestamp: o.operation.timestamp.toISOString()\n }), o.operations && (e.operations = o.operations.map((t) => ({\n ...t,\n timestamp: t.timestamp.toISOString()\n }))), e;\n}\nfunction Xe(o) {\n const e = {\n type: o.type,\n clientId: o.clientId,\n timestamp: new Date(o.timestamp)\n };\n return o.operation && (e.operation = {\n ...o.operation,\n timestamp: new Date(o.operation.timestamp)\n }), o.operations && (e.operations = o.operations.map((t) => ({\n ...t,\n timestamp: new Date(t.timestamp)\n }))), e;\n}\nconst re = ke(\"hst-operation-log\", () => {\n const o = L({\n maxOperations: 100,\n enableCrossTabSync: !0,\n autoSyncInterval: 3e4,\n enablePersistence: !1,\n persistenceKeyPrefix: \"stonecrop-ops\"\n }), e = L([]), t = L(-1), r = L(le()), n = L(!1), i = L([]), s = L(null), a = _(() => t.value < 0 ? !1 : e.value[t.value]?.reversible ?? !1), c = _(() => t.value < e.value.length - 1), d = _(() => {\n let u = 0;\n for (let l = t.value; l >= 0 && e.value[l]?.reversible; l--)\n u++;\n return u;\n }), p = _(() => e.value.length - 1 - t.value), S = _(() => ({\n canUndo: a.value,\n canRedo: c.value,\n undoCount: d.value,\n redoCount: p.value,\n currentIndex: t.value\n }));\n function $(u) {\n o.value = { ...o.value, ...u }, o.value.enablePersistence && (h(), y()), o.value.enableCrossTabSync && J();\n }\n function D(u, l = \"user\") {\n const f = {\n ...u,\n id: le(),\n timestamp: /* @__PURE__ */ new Date(),\n source: l,\n userId: o.value.userId\n };\n if (o.value.operationFilter && !o.value.operationFilter(f))\n return f.id;\n if (n.value)\n return i.value.push(f), f.id;\n if (t.value < e.value.length - 1 && (e.value = e.value.slice(0, t.value + 1)), e.value.push(f), t.value++, o.value.maxOperations && e.value.length > o.value.maxOperations) {\n const T = e.value.length - o.value.maxOperations;\n e.value = e.value.slice(T), t.value -= T;\n }\n return o.value.enableCrossTabSync && B(f), f.id;\n }\n function N() {\n n.value = !0, i.value = [], s.value = le();\n }\n function F(u) {\n if (!n.value || i.value.length === 0)\n return n.value = !1, i.value = [], s.value = null, null;\n const l = s.value, f = i.value.every((P) => P.reversible), T = {\n id: l,\n type: \"batch\",\n path: \"\",\n // Batch doesn't have a single path\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: i.value[0]?.doctype || \"\",\n timestamp: /* @__PURE__ */ new Date(),\n source: \"user\",\n reversible: f,\n irreversibleReason: f ? void 0 : \"Contains irreversible operations\",\n childOperationIds: i.value.map((P) => P.id),\n metadata: { description: u }\n };\n i.value.forEach((P) => {\n P.parentOperationId = l;\n }), e.value.push(...i.value, T), t.value = e.value.length - 1, o.value.enableCrossTabSync && G(i.value, T);\n const V = l;\n return n.value = !1, i.value = [], s.value = null, V;\n }\n function R() {\n n.value = !1, i.value = [], s.value = null;\n }\n function O(u) {\n if (!a.value) return !1;\n const l = e.value[t.value];\n if (!l.reversible)\n return typeof console < \"u\" && l.irreversibleReason && console.warn(\"Cannot undo irreversible operation:\", l.irreversibleReason), !1;\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (let f = l.childOperationIds.length - 1; f >= 0; f--) {\n const T = l.childOperationIds[f], V = e.value.find((P) => P.id === T);\n V && g(V, u);\n }\n else\n g(l, u);\n return t.value--, o.value.enableCrossTabSync && m(l), !0;\n } catch (f) {\n return typeof console < \"u\" && console.error(\"Undo failed:\", f), !1;\n }\n }\n function b(u) {\n if (!c.value) return !1;\n const l = e.value[t.value + 1];\n try {\n if (l.type === \"batch\" && l.childOperationIds)\n for (const f of l.childOperationIds) {\n const T = e.value.find((V) => V.id === f);\n T && I(T, u);\n }\n else\n I(l, u);\n return t.value++, o.value.enableCrossTabSync && C(l), !0;\n } catch (f) {\n return typeof console < \"u\" && console.error(\"Redo failed:\", f), !1;\n }\n }\n function g(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.beforeValue, \"undo\");\n }\n function I(u, l) {\n (u.type === \"set\" || u.type === \"delete\") && l && typeof l.set == \"function\" && l.set(u.path, u.afterValue, \"redo\");\n }\n function w() {\n const u = e.value.filter((f) => f.reversible).length, l = e.value.map((f) => f.timestamp);\n return {\n operations: [...e.value],\n currentIndex: t.value,\n totalOperations: e.value.length,\n reversibleOperations: u,\n irreversibleOperations: e.value.length - u,\n oldestOperation: l.length > 0 ? new Date(Math.min(...l.map((f) => f.getTime()))) : void 0,\n newestOperation: l.length > 0 ? new Date(Math.max(...l.map((f) => f.getTime()))) : void 0\n };\n }\n function A() {\n e.value = [], t.value = -1;\n }\n function E(u, l) {\n return e.value.filter((f) => f.doctype === u && (l === void 0 || f.recordId === l));\n }\n function M(u, l) {\n const f = e.value.find((T) => T.id === u);\n f && (f.reversible = !1, f.irreversibleReason = l);\n }\n function W(u, l, f, T = \"success\", V) {\n const P = {\n type: \"action\",\n path: f && f.length > 0 ? `${u}.${f[0]}` : u,\n fieldname: \"\",\n beforeValue: null,\n afterValue: null,\n doctype: u,\n recordId: f && f.length > 0 ? f[0] : void 0,\n reversible: !1,\n // Actions are typically not reversible\n actionName: l,\n actionRecordIds: f,\n actionResult: T,\n actionError: V\n };\n return D(P);\n }\n let x = null;\n function J() {\n typeof window > \"u\" || !window.BroadcastChannel || (x = new BroadcastChannel(\"stonecrop-operation-log\"), x.addEventListener(\"message\", (u) => {\n const l = u.data;\n if (!l || typeof l != \"object\") return;\n const f = Xe(l);\n f.clientId !== r.value && (f.type === \"operation\" && f.operation ? (e.value.push({ ...f.operation, source: \"sync\" }), t.value = e.value.length - 1) : f.type === \"operation\" && f.operations && (e.value.push(...f.operations.map((T) => ({ ...T, source: \"sync\" }))), t.value = e.value.length - 1));\n }));\n }\n function B(u) {\n if (!x) return;\n const l = {\n type: \"operation\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n x.postMessage(ie(l));\n }\n function G(u, l) {\n if (!x) return;\n const f = {\n type: \"operation\",\n operations: [...u, l],\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n x.postMessage(ie(f));\n }\n function m(u) {\n if (!x) return;\n const l = {\n type: \"undo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n x.postMessage(ie(l));\n }\n function C(u) {\n if (!x) return;\n const l = {\n type: \"redo\",\n operation: u,\n clientId: r.value,\n timestamp: /* @__PURE__ */ new Date()\n };\n x.postMessage(ie(l));\n }\n const k = Ze(\"stonecrop-ops-operations\", null, {\n serializer: {\n read: (u) => {\n try {\n return JSON.parse(u);\n } catch {\n return null;\n }\n },\n write: (u) => u ? JSON.stringify(u) : \"\"\n }\n });\n function h() {\n if (!(typeof window > \"u\"))\n try {\n const u = k.value;\n u && Array.isArray(u.operations) && (e.value = u.operations.map((l) => ({\n ...l,\n timestamp: new Date(l.timestamp)\n })), t.value = u.currentIndex ?? -1);\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to load operations from persistence:\", u);\n }\n }\n function v() {\n if (!(typeof window > \"u\"))\n try {\n k.value = {\n operations: e.value.map((u) => ({\n ...u,\n timestamp: u.timestamp.toISOString()\n })),\n currentIndex: t.value\n };\n } catch (u) {\n typeof console < \"u\" && console.error(\"Failed to save operations to persistence:\", u);\n }\n }\n function y() {\n U(\n [e, t],\n () => {\n o.value.enablePersistence && v();\n },\n { deep: !0 }\n );\n }\n return {\n // State\n operations: e,\n currentIndex: t,\n config: o,\n clientId: r,\n undoRedoState: S,\n // Computed\n canUndo: a,\n canRedo: c,\n undoCount: d,\n redoCount: p,\n // Methods\n configure: $,\n addOperation: D,\n startBatch: N,\n commitBatch: F,\n cancelBatch: R,\n undo: O,\n redo: b,\n clear: A,\n getOperationsFor: E,\n getSnapshot: w,\n markIrreversible: M,\n logAction: W\n };\n});\nclass ee {\n /**\n * The root FieldTriggerEngine instance\n */\n static _root;\n options;\n doctypeActions = /* @__PURE__ */ new Map();\n // doctype -> action/field -> functions\n doctypeTransitions = /* @__PURE__ */ new Map();\n // doctype -> transition -> functions\n fieldRollbackConfig = /* @__PURE__ */ new Map();\n // doctype -> field -> rollback enabled\n globalActions = /* @__PURE__ */ new Map();\n // action name -> function\n globalTransitionActions = /* @__PURE__ */ new Map();\n // transition action name -> function\n /**\n * Creates a new FieldTriggerEngine instance (singleton pattern)\n * @param options - Configuration options for the field trigger engine\n */\n constructor(e = {}) {\n if (ee._root)\n return ee._root;\n ee._root = this, this.options = {\n defaultTimeout: e.defaultTimeout ?? 5e3,\n debug: e.debug ?? !1,\n enableRollback: e.enableRollback ?? !0,\n errorHandler: e.errorHandler\n };\n }\n /**\n * Register a global action function\n * @param name - The name of the action\n * @param fn - The action function\n */\n registerAction(e, t) {\n this.globalActions.set(e, t);\n }\n /**\n * Register a global XState transition action function\n * @param name - The name of the transition action\n * @param fn - The transition action function\n */\n registerTransitionAction(e, t) {\n this.globalTransitionActions.set(e, t);\n }\n /**\n * Configure rollback behavior for a specific field trigger\n * @param doctype - The doctype name\n * @param fieldname - The field name\n * @param enableRollback - Whether to enable rollback\n */\n setFieldRollback(e, t, r) {\n this.fieldRollbackConfig.has(e) || this.fieldRollbackConfig.set(e, /* @__PURE__ */ new Map()), this.fieldRollbackConfig.get(e).set(t, r);\n }\n /**\n * Get rollback configuration for a specific field trigger\n */\n getFieldRollback(e, t) {\n return this.fieldRollbackConfig.get(e)?.get(t);\n }\n /**\n * Register actions from a doctype - both regular actions and field triggers\n * Separates XState transitions (uppercase) from field triggers (lowercase)\n * @param doctype - The doctype name\n * @param actions - The actions to register (supports Immutable Map, Map, or plain object)\n */\n registerDoctypeActions(e, t) {\n if (!t) return;\n const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();\n if (typeof t.entrySeq == \"function\")\n t.entrySeq().forEach(([i, s]) => {\n this.categorizeAction(i, s, r, n);\n });\n else if (t instanceof Map)\n for (const [i, s] of t)\n this.categorizeAction(i, s, r, n);\n else t && typeof t == \"object\" && Object.entries(t).forEach(([i, s]) => {\n this.categorizeAction(i, s, r, n);\n });\n this.doctypeActions.set(e, r), this.doctypeTransitions.set(e, n);\n }\n /**\n * Categorize an action as either a field trigger or XState transition\n * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger\n */\n categorizeAction(e, t, r, n) {\n this.isTransitionKey(e) ? n.set(e, t) : r.set(e, t);\n }\n /**\n * Determine if a key represents an XState transition\n * Transitions are identified by being all uppercase\n */\n isTransitionKey(e) {\n return /^[A-Z0-9_]+$/.test(e) && e.length > 0;\n }\n /**\n * Execute field triggers for a changed field\n * @param context - The field change context\n * @param options - Execution options (timeout and enableRollback)\n */\n async executeFieldTriggers(e, t = {}) {\n const { doctype: r, fieldname: n } = e, i = this.findFieldTriggers(r, n);\n if (i.length === 0)\n return {\n path: e.path,\n actionResults: [],\n totalExecutionTime: 0,\n allSucceeded: !0,\n stoppedOnError: !1,\n rolledBack: !1\n };\n const s = performance.now(), a = [];\n let c = !1, d = !1, p;\n const S = this.getFieldRollback(r, n), $ = t.enableRollback ?? S ?? this.options.enableRollback;\n $ && e.store && (p = this.captureSnapshot(e));\n for (const R of i)\n try {\n const O = await this.executeAction(R, e, t.timeout);\n if (a.push(O), !O.success) {\n c = !0;\n break;\n }\n } catch (O) {\n const g = {\n success: !1,\n error: O instanceof Error ? O : new Error(String(O)),\n executionTime: 0,\n action: R\n };\n a.push(g), c = !0;\n break;\n }\n if ($ && c && p && e.store)\n try {\n this.restoreSnapshot(e, p), d = !0;\n } catch (R) {\n console.error(\"[FieldTriggers] Rollback failed:\", R);\n }\n const D = performance.now() - s, N = a.filter((R) => !R.success);\n if (N.length > 0 && this.options.errorHandler)\n for (const R of N)\n try {\n this.options.errorHandler(R.error, e, R.action);\n } catch (O) {\n console.error(\"[FieldTriggers] Error in global error handler:\", O);\n }\n return {\n path: e.path,\n actionResults: a,\n totalExecutionTime: D,\n allSucceeded: a.every((R) => R.success),\n stoppedOnError: c,\n rolledBack: d,\n snapshot: this.options.debug && $ ? p : void 0\n // Only include snapshot in debug mode if rollback is enabled\n };\n }\n /**\n * Execute XState transition actions\n * Similar to field triggers but specifically for FSM state transitions\n * @param context - The transition change context\n * @param options - Execution options (timeout)\n */\n async executeTransitionActions(e, t = {}) {\n const { doctype: r, transition: n } = e, i = this.findTransitionActions(r, n);\n if (i.length === 0)\n return [];\n const s = [];\n for (const c of i)\n try {\n const d = await this.executeTransitionAction(c, e, t.timeout);\n if (s.push(d), !d.success)\n break;\n } catch (d) {\n const S = {\n success: !1,\n error: d instanceof Error ? d : new Error(String(d)),\n executionTime: 0,\n action: c,\n transition: n\n };\n s.push(S);\n break;\n }\n const a = s.filter((c) => !c.success);\n if (a.length > 0 && this.options.errorHandler)\n for (const c of a)\n try {\n this.options.errorHandler(c.error, e, c.action);\n } catch (d) {\n console.error(\"[FieldTriggers] Error in global error handler:\", d);\n }\n return s;\n }\n /**\n * Find transition actions for a specific doctype and transition\n */\n findTransitionActions(e, t) {\n const r = this.doctypeTransitions.get(e);\n return r ? r.get(t) || [] : [];\n }\n /**\n * Execute a single transition action by name\n */\n async executeTransitionAction(e, t, r) {\n const n = performance.now(), i = r ?? this.options.defaultTimeout;\n try {\n let s = this.globalTransitionActions.get(e);\n if (!s) {\n const c = this.globalActions.get(e);\n c && (s = c);\n }\n if (!s)\n throw new Error(`Transition action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(s, t, i), {\n success: !0,\n executionTime: performance.now() - n,\n action: e,\n transition: t.transition\n };\n } catch (s) {\n const a = performance.now() - n;\n return {\n success: !1,\n error: s instanceof Error ? s : new Error(String(s)),\n executionTime: a,\n action: e,\n transition: t.transition\n };\n }\n }\n /**\n * Find field triggers for a specific doctype and field\n * Field triggers are identified by keys that look like field paths (contain dots or match field names)\n */\n findFieldTriggers(e, t) {\n const r = this.doctypeActions.get(e);\n if (!r) return [];\n const n = [];\n for (const [i, s] of r)\n this.isFieldTriggerKey(i, t) && n.push(...s);\n return n;\n }\n /**\n * Determine if an action key represents a field trigger\n * Field triggers can be:\n * - Exact field name match: \"emailAddress\"\n * - Wildcard patterns: \"emailAddress.*\", \"*.is_primary\"\n * - Nested field paths: \"address.street\", \"contact.email\"\n */\n isFieldTriggerKey(e, t) {\n return e === t ? !0 : e.includes(\".\") ? this.matchFieldPattern(e, t) : e.includes(\"*\") ? this.matchFieldPattern(e, t) : !1;\n }\n /**\n * Match a field pattern against a field name\n * Supports wildcards (*) for dynamic segments\n */\n matchFieldPattern(e, t) {\n const r = e.split(\".\"), n = t.split(\".\");\n if (r.length !== n.length)\n return !1;\n for (let i = 0; i < r.length; i++) {\n const s = r[i], a = n[i];\n if (s !== \"*\" && s !== a)\n return !1;\n }\n return !0;\n }\n /**\n * Execute a single action by name\n */\n async executeAction(e, t, r) {\n const n = performance.now(), i = r ?? this.options.defaultTimeout;\n try {\n const s = this.globalActions.get(e);\n if (!s)\n throw new Error(`Action \"${e}\" not found in registry`);\n return await this.executeWithTimeout(s, t, i), {\n success: !0,\n executionTime: performance.now() - n,\n action: e\n };\n } catch (s) {\n const a = performance.now() - n;\n return {\n success: !1,\n error: s instanceof Error ? s : new Error(String(s)),\n executionTime: a,\n action: e\n };\n }\n }\n /**\n * Execute a function with timeout\n */\n async executeWithTimeout(e, t, r) {\n return new Promise((n, i) => {\n const s = setTimeout(() => {\n i(new Error(`Action timeout after ${r}ms`));\n }, r);\n Promise.resolve(e(t)).then((a) => {\n clearTimeout(s), n(a);\n }).catch((a) => {\n clearTimeout(s), i(a);\n });\n });\n }\n /**\n * Capture a snapshot of the record state before executing actions\n * This creates a deep copy of the record data for potential rollback\n */\n captureSnapshot(e) {\n if (!(!e.store || !e.doctype || !e.recordId))\n try {\n const t = `${e.doctype}.${e.recordId}`, r = e.store.get(t);\n return !r || typeof r != \"object\" ? void 0 : JSON.parse(JSON.stringify(r));\n } catch (t) {\n this.options.debug && console.warn(\"[FieldTriggers] Failed to capture snapshot:\", t);\n return;\n }\n }\n /**\n * Restore a previously captured snapshot\n * This reverts the record to its state before actions were executed\n */\n restoreSnapshot(e, t) {\n if (!(!e.store || !e.doctype || !e.recordId || !t))\n try {\n const r = `${e.doctype}.${e.recordId}`;\n e.store.set(r, t), this.options.debug && console.log(`[FieldTriggers] Rolled back ${r} to previous state`);\n } catch (r) {\n throw console.error(\"[FieldTriggers] Failed to restore snapshot:\", r), r;\n }\n }\n}\nfunction q(o) {\n return new ee(o);\n}\nfunction ct(o, e) {\n q().registerAction(o, e);\n}\nfunction lt(o, e) {\n q().registerTransitionAction(o, e);\n}\nfunction ut(o, e, t) {\n q().setFieldRollback(o, e, t);\n}\nasync function ft(o, e, t) {\n const r = q(), n = {\n path: t?.path || (t?.recordId ? `${o}.${t.recordId}` : o),\n fieldname: \"\",\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: o,\n recordId: t?.recordId,\n timestamp: /* @__PURE__ */ new Date(),\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n };\n return await r.executeTransitionActions(n);\n}\nfunction dt(o, e) {\n if (o)\n try {\n re().markIrreversible(o, e);\n } catch {\n }\n}\nfunction pe() {\n try {\n return re();\n } catch {\n return null;\n }\n}\nclass Y {\n static instance;\n /**\n * Gets the singleton instance of HST\n * @returns The HST singleton instance\n */\n static getInstance() {\n return Y.instance || (Y.instance = new Y()), Y.instance;\n }\n /**\n * Gets the global registry instance\n * @returns The global registry object or undefined if not found\n */\n getRegistry() {\n if (typeof globalThis < \"u\") {\n const e = globalThis.Registry?._root;\n if (e)\n return e;\n }\n if (typeof window < \"u\") {\n const e = window.Registry?._root;\n if (e)\n return e;\n }\n if (typeof global < \"u\" && global) {\n const e = global.Registry?._root;\n if (e)\n return e;\n }\n }\n /**\n * Helper method to get doctype metadata from the registry\n * @param doctype - The name of the doctype to retrieve metadata for\n * @returns The doctype metadata object or undefined if not found\n */\n getDoctypeMeta(e) {\n const t = this.getRegistry();\n if (t && typeof t == \"object\" && \"registry\" in t)\n return t.registry[e];\n }\n}\nclass se {\n target;\n parentPath;\n rootNode;\n doctype;\n parentDoctype;\n hst;\n constructor(e, t, r = \"\", n = null, i) {\n return this.target = e, this.parentPath = r, this.rootNode = n || this, this.doctype = t, this.parentDoctype = i, this.hst = Y.getInstance(), new Proxy(this, {\n get(s, a) {\n if (a in s) return s[a];\n const c = String(a);\n return s.getNode(c);\n },\n set(s, a, c) {\n const d = String(a);\n return s.set(d, c), !0;\n }\n });\n }\n get(e) {\n return this.resolveValue(e);\n }\n // Method to get a tree-wrapped node for navigation\n getNode(e) {\n const t = this.resolvePath(e), r = this.resolveValue(e), n = t.split(\".\");\n let i = this.doctype;\n return this.doctype === \"StonecropStore\" && n.length >= 1 && (i = n[0]), typeof r == \"object\" && r !== null && !this.isPrimitive(r) ? new se(r, i, t, this.rootNode, this.parentDoctype) : new se(r, i, t, this.rootNode, this.parentDoctype);\n }\n set(e, t, r = \"user\") {\n const n = this.resolvePath(e), i = this.has(e) ? this.get(e) : void 0;\n if (r !== \"undo\" && r !== \"redo\") {\n const s = pe();\n if (s && typeof s.addOperation == \"function\") {\n const a = n.split(\".\"), c = this.doctype === \"StonecropStore\" && a.length >= 1 ? a[0] : this.doctype, d = a.length >= 2 ? a[1] : void 0, p = a.slice(2).join(\".\") || a[a.length - 1], $ = t === void 0 && i !== void 0 ? \"delete\" : \"set\";\n s.addOperation(\n {\n type: $,\n path: n,\n fieldname: p,\n beforeValue: i,\n afterValue: t,\n doctype: c,\n recordId: d,\n reversible: !0\n // Default to reversible, can be changed by field triggers\n },\n r\n );\n }\n }\n this.updateValue(e, t), this.triggerFieldActions(n, i, t);\n }\n has(e) {\n try {\n if (e === \"\")\n return !0;\n const t = this.parsePath(e);\n let r = this.target;\n for (let n = 0; n < t.length; n++) {\n const i = t[n];\n if (r == null)\n return !1;\n if (n === t.length - 1)\n return this.isImmutable(r) ? r.has(i) : this.isPiniaStore(r) && r.$state && i in r.$state || i in r;\n r = this.getProperty(r, i);\n }\n return !1;\n } catch {\n return !1;\n }\n }\n // Tree navigation methods\n getParent() {\n if (!this.parentPath) return null;\n const t = this.parentPath.split(\".\").slice(0, -1).join(\".\");\n return t === \"\" ? this.rootNode : this.rootNode.getNode(t);\n }\n getRoot() {\n return this.rootNode;\n }\n getPath() {\n return this.parentPath;\n }\n getDepth() {\n return this.parentPath ? this.parentPath.split(\".\").length : 0;\n }\n getBreadcrumbs() {\n return this.parentPath ? this.parentPath.split(\".\") : [];\n }\n /**\n * Trigger an XState transition with optional context data\n */\n async triggerTransition(e, t) {\n const r = q(), n = this.parentPath.split(\".\");\n let i = this.doctype, s;\n this.doctype === \"StonecropStore\" && n.length >= 1 && (i = n[0]), n.length >= 2 && (s = n[1]);\n const a = {\n path: this.parentPath,\n fieldname: \"\",\n // No specific field for transitions\n beforeValue: void 0,\n afterValue: void 0,\n operation: \"set\",\n doctype: i,\n recordId: s,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0,\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }, c = pe();\n return c && typeof c.addOperation == \"function\" && c.addOperation(\n {\n type: \"transition\",\n path: this.parentPath,\n fieldname: e,\n beforeValue: t?.currentState,\n afterValue: t?.targetState,\n doctype: i,\n recordId: s,\n reversible: !1,\n // FSM transitions are generally not reversible\n metadata: {\n transition: e,\n currentState: t?.currentState,\n targetState: t?.targetState,\n fsmContext: t?.fsmContext\n }\n },\n \"user\"\n ), await r.executeTransitionActions(a);\n }\n // Private helper methods\n resolvePath(e) {\n return e === \"\" ? this.parentPath : this.parentPath ? `${this.parentPath}.${e}` : e;\n }\n resolveValue(e) {\n if (e === \"\")\n return this.target;\n const t = this.parsePath(e);\n let r = this.target;\n for (const n of t) {\n if (r == null)\n return;\n r = this.getProperty(r, n);\n }\n return r;\n }\n updateValue(e, t) {\n if (e === \"\")\n throw new Error(\"Cannot set value on empty path\");\n const r = this.parsePath(e), n = r.pop();\n let i = this.target;\n for (const s of r)\n if (i = this.getProperty(i, s), i == null)\n throw new Error(`Cannot set property on null/undefined path: ${e}`);\n this.setProperty(i, n, t);\n }\n getProperty(e, t) {\n return this.isImmutable(e) ? e.get(t) : this.isVueReactive(e) ? e[t] : this.isPiniaStore(e) ? e.$state?.[t] ?? e[t] : e[t];\n }\n setProperty(e, t, r) {\n if (this.isImmutable(e))\n throw new Error(\"Cannot directly mutate immutable objects. Use immutable update methods instead.\");\n if (this.isPiniaStore(e)) {\n e.$patch ? e.$patch({ [t]: r }) : e[t] = r;\n return;\n }\n e[t] = r;\n }\n async triggerFieldActions(e, t, r) {\n try {\n if (!e || typeof e != \"string\" || Object.is(t, r))\n return;\n const n = e.split(\".\");\n if (n.length < 3)\n return;\n const i = q(), s = n.slice(2).join(\".\") || n[n.length - 1];\n let a = this.doctype;\n this.doctype === \"StonecropStore\" && n.length >= 1 && (a = n[0]);\n let c;\n n.length >= 2 && (c = n[1]);\n const d = {\n path: e,\n fieldname: s,\n beforeValue: t,\n afterValue: r,\n operation: \"set\",\n doctype: a,\n recordId: c,\n timestamp: /* @__PURE__ */ new Date(),\n store: this.rootNode || void 0\n // Pass the root store for snapshot/rollback capabilities\n };\n await i.executeFieldTriggers(d);\n } catch (n) {\n n instanceof Error && console.warn(\"Field trigger error:\", n.message);\n }\n }\n isVueReactive(e) {\n return e && typeof e == \"object\" && \"__v_isReactive\" in e && e.__v_isReactive === !0;\n }\n isPiniaStore(e) {\n return e && typeof e == \"object\" && (\"$state\" in e || \"$patch\" in e || \"$id\" in e);\n }\n isImmutable(e) {\n if (!e || typeof e != \"object\")\n return !1;\n const t = \"get\" in e && typeof e.get == \"function\", r = \"set\" in e && typeof e.set == \"function\", n = \"has\" in e && typeof e.has == \"function\", i = \"__ownerID\" in e || \"_map\" in e || \"_list\" in e || \"_origin\" in e || \"_capacity\" in e || \"_defaultValues\" in e || \"_tail\" in e || \"_root\" in e || \"size\" in e && t && r;\n let s;\n try {\n const c = e;\n if (\"constructor\" in c && c.constructor && typeof c.constructor == \"object\" && \"name\" in c.constructor) {\n const d = c.constructor.name;\n s = typeof d == \"string\" ? d : void 0;\n }\n } catch {\n s = void 0;\n }\n const a = s && (s.includes(\"Map\") || s.includes(\"List\") || s.includes(\"Set\") || s.includes(\"Stack\") || s.includes(\"Seq\")) && (t || r);\n return !!(t && r && n && i || t && r && a);\n }\n isPrimitive(e) {\n return e == null || typeof e == \"string\" || typeof e == \"number\" || typeof e == \"boolean\" || typeof e == \"function\" || typeof e == \"symbol\" || typeof e == \"bigint\";\n }\n /**\n * Parse a path string into segments, handling both dot notation and array bracket notation\n * @param path - The path string to parse (e.g., \"order.456.line_items[0].product\")\n * @returns Array of path segments (e.g., ['order', '456', 'line_items', '0', 'product'])\n */\n parsePath(e) {\n return e ? e.replace(/\\[(\\d+)\\]/g, \".$1\").split(\".\").filter((r) => r.length > 0) : [];\n }\n}\nfunction et(o, e, t) {\n return new se(o, e, \"\", null, t);\n}\nclass Oe {\n hstStore;\n _operationLogStore;\n _operationLogConfig;\n _client;\n /** The registry instance containing all doctype definitions */\n registry;\n /**\n * Creates a new Stonecrop instance with HST integration\n * @param registry - The Registry instance containing doctype definitions\n * @param operationLogConfig - Optional configuration for the operation log\n * @param options - Options including the data client (can be set later via setClient)\n */\n constructor(e, t, r) {\n this.registry = e, this._operationLogConfig = t, this._client = r?.client, this.initializeHSTStore(), this.setupRegistrySync();\n }\n /**\n * Set the data client for fetching doctype metadata and records.\n * Use this for deferred configuration in Nuxt/Vue plugin setups.\n *\n * @param client - DataClient implementation (e.g., StonecropClient from \\@stonecrop/graphql-client)\n *\n * @example\n * ```ts\n * const { setClient } = useStonecropRegistry()\n * const client = new StonecropClient({ endpoint: '/graphql' })\n * setClient(client)\n * ```\n */\n setClient(e) {\n this._client = e;\n }\n /**\n * Get the current data client\n * @returns The DataClient instance or undefined if not set\n */\n getClient() {\n return this._client;\n }\n /**\n * Get the operation log store (lazy initialization)\n * @internal\n */\n getOperationLogStore() {\n return this._operationLogStore || (this._operationLogStore = re(), this._operationLogConfig && this._operationLogStore.configure(this._operationLogConfig)), this._operationLogStore;\n }\n /**\n * Initialize the HST store structure\n */\n initializeHSTStore() {\n const e = {};\n Object.keys(this.registry.registry).forEach((t) => {\n e[t] = {};\n }), this.hstStore = et(ue(e), \"StonecropStore\");\n }\n /**\n * Setup automatic sync with Registry when doctypes are added\n */\n setupRegistrySync() {\n const e = this.registry.addDoctype.bind(this.registry);\n this.registry.addDoctype = (t) => {\n e(t), this.hstStore.has(t.slug) || this.hstStore.set(t.slug, {});\n };\n }\n /**\n * Get records hash for a doctype\n * @param doctype - The doctype to get records for\n * @returns HST node containing records hash\n */\n records(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n return this.ensureDoctypeExists(t), this.hstStore.getNode(t);\n }\n /**\n * Add a record to the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @param recordData - The record data\n */\n addRecord(e, t, r) {\n const n = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(n), this.hstStore.set(`${n}.${t}`, r);\n }\n /**\n * Get a specific record\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @returns HST node for the record or undefined\n */\n getRecordById(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n if (this.ensureDoctypeExists(r), !(!this.hstStore.has(`${r}.${t}`) || this.hstStore.get(`${r}.${t}`) === void 0))\n return this.hstStore.getNode(`${r}.${t}`);\n }\n /**\n * Remove a record from the store\n * @param doctype - The doctype\n * @param recordId - The record ID\n */\n removeRecord(e, t) {\n const r = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(r), this.hstStore.has(`${r}.${t}`) && this.hstStore.set(`${r}.${t}`, void 0);\n }\n /**\n * Get all record IDs for a doctype\n * @param doctype - The doctype\n * @returns Array of record IDs\n */\n getRecordIds(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t);\n const r = this.hstStore.get(t);\n return !r || typeof r != \"object\" ? [] : Object.keys(r).filter((n) => r[n] !== void 0);\n }\n /**\n * Clear all records for a doctype\n * @param doctype - The doctype\n */\n clearRecords(e) {\n const t = typeof e == \"string\" ? e : e.slug;\n this.ensureDoctypeExists(t), this.getRecordIds(t).forEach((n) => {\n this.hstStore.set(`${t}.${n}`, void 0);\n });\n }\n /**\n * Setup method for doctype initialization\n * @param doctype - The doctype to setup\n */\n setup(e) {\n this.ensureDoctypeExists(e.slug);\n }\n /**\n * Run action on doctype\n * Executes the action and logs it to the operation log for audit tracking\n * @param doctype - The doctype\n * @param action - The action to run\n * @param args - Action arguments (typically record IDs)\n */\n runAction(e, t, r) {\n const i = this.registry.registry[e.slug]?.actions?.get(t), s = Array.isArray(r) ? r.filter((p) => typeof p == \"string\") : void 0, a = this.getOperationLogStore();\n let c = \"success\", d;\n try {\n i && i.length > 0 && i.forEach((p) => {\n try {\n new Function(\"args\", p)(r);\n } catch (S) {\n throw c = \"failure\", d = S instanceof Error ? S.message : \"Unknown error\", S;\n }\n });\n } catch {\n } finally {\n a.logAction(e.doctype, t, s, c, d);\n }\n }\n /**\n * Get records from server using the configured data client.\n * @param doctype - The doctype\n * @throws Error if no data client has been configured\n */\n async getRecords(e) {\n if (!this._client)\n throw new Error(\n \"No data client configured. Call setClient() with a DataClient implementation (e.g., StonecropClient from @stonecrop/graphql-client) before fetching records.\"\n );\n (await this._client.getRecords(e)).forEach((r) => {\n r.id && this.addRecord(e, r.id, r);\n });\n }\n /**\n * Get single record from server using the configured data client.\n * @param doctype - The doctype\n * @param recordId - The record ID\n * @throws Error if no data client has been configured\n */\n async getRecord(e, t) {\n if (!this._client)\n throw new Error(\n \"No data client configured. Call setClient() with a DataClient implementation (e.g., StonecropClient from @stonecrop/graphql-client) before fetching records.\"\n );\n const r = await this._client.getRecord(e, t);\n r && this.addRecord(e, t, r);\n }\n /**\n * Dispatch an action to the server via the configured data client.\n * All state changes flow through this single mutation endpoint.\n *\n * @param doctype - The doctype\n * @param action - Action name to execute (e.g., 'SUBMIT', 'APPROVE', 'save')\n * @param args - Action arguments (typically record ID and/or form data)\n * @returns Action result with success status, response data, and any error\n * @throws Error if no data client has been configured\n */\n async dispatchAction(e, t, r) {\n if (!this._client)\n throw new Error(\n \"No data client configured. Call setClient() with a DataClient implementation (e.g., StonecropClient from @stonecrop/graphql-client) before dispatching actions.\"\n );\n return this._client.runAction(e, t, r);\n }\n /**\n * Ensure doctype section exists in HST store\n * @param slug - The doctype slug\n */\n ensureDoctypeExists(e) {\n this.hstStore.has(e) || this.hstStore.set(e, {});\n }\n /**\n * Get doctype metadata from the registry\n * @param context - The route context\n * @returns The doctype metadata\n */\n async getMeta(e) {\n if (!this.registry.getMeta)\n throw new Error(\"No getMeta function provided to Registry\");\n return await this.registry.getMeta(e);\n }\n /**\n * Get the root HST store node for advanced usage\n * @returns Root HST node\n */\n getStore() {\n return this.hstStore;\n }\n /**\n * Determine the current workflow state for a record.\n *\n * Reads the record's `status` field from the HST store. If the field is absent or\n * empty the doctype's declared `workflow.initial` state is used as the fallback,\n * giving callers a reliable state name without having to duplicate that logic.\n *\n * @param doctype - The doctype slug or DoctypeMeta instance\n * @param recordId - The record identifier\n * @returns The current state name, or an empty string if the doctype has no workflow\n *\n * @public\n */\n getRecordState(e, t) {\n const r = typeof e == \"string\" ? e : e.slug, n = this.registry.getDoctype(r);\n if (!n?.workflow) return \"\";\n const s = this.getRecordById(r, t)?.get(\"status\"), a = typeof n.workflow.initial == \"string\" ? n.workflow.initial : Object.keys(n.workflow.states ?? {})[0] ?? \"\";\n return s || a;\n }\n}\nfunction ht(o) {\n o || (o = {});\n const e = o.registry || fe(\"$registry\"), t = fe(\"$stonecrop\"), r = L(), n = L(), i = L({}), s = L(), a = L(), c = L([]);\n if (o.doctype && e) {\n const h = o.doctype.schema ? Array.isArray(o.doctype.schema) ? o.doctype.schema : Array.from(o.doctype.schema) : [];\n c.value = e.resolveSchema(h);\n }\n const d = L([]), p = L(-1), S = _(() => r.value?.getOperationLogStore().canUndo ?? !1), $ = _(() => r.value?.getOperationLogStore().canRedo ?? !1), D = _(() => r.value?.getOperationLogStore().undoCount ?? 0), N = _(() => r.value?.getOperationLogStore().redoCount ?? 0), F = _(\n () => r.value?.getOperationLogStore().undoRedoState ?? {\n canUndo: !1,\n canRedo: !1,\n undoCount: 0,\n redoCount: 0,\n currentIndex: -1\n }\n ), R = (h) => r.value?.getOperationLogStore().undo(h) ?? !1, O = (h) => r.value?.getOperationLogStore().redo(h) ?? !1, b = () => {\n r.value?.getOperationLogStore().startBatch();\n }, g = (h) => r.value?.getOperationLogStore().commitBatch(h) ?? null, I = () => {\n r.value?.getOperationLogStore().cancelBatch();\n }, w = () => {\n r.value?.getOperationLogStore().clear();\n }, A = (h, v) => r.value?.getOperationLogStore().getOperationsFor(h, v) ?? [], E = () => r.value?.getOperationLogStore().getSnapshot() ?? {\n operations: [],\n currentIndex: -1,\n totalOperations: 0,\n reversibleOperations: 0,\n irreversibleOperations: 0\n }, M = (h, v) => {\n r.value?.getOperationLogStore().markIrreversible(h, v);\n }, W = (h, v, y, u = \"success\", l) => r.value?.getOperationLogStore().logAction(h, v, y, u, l) ?? \"\", x = (h) => {\n r.value?.getOperationLogStore().configure(h);\n };\n ve(async () => {\n if (e) {\n r.value = t || new Oe(e);\n try {\n const h = r.value.getOperationLogStore(), v = be(h);\n d.value = v.operations.value, p.value = v.currentIndex.value, U(\n () => v.operations.value,\n (y) => {\n d.value = y;\n }\n ), U(\n () => v.currentIndex.value,\n (y) => {\n p.value = y;\n }\n );\n } catch {\n }\n if (!o.doctype && e.router) {\n const h = e.router.currentRoute.value;\n if (!h.path) return;\n const v = h.path.split(\"/\").filter((u) => u.length > 0), y = v[1]?.toLowerCase();\n if (v.length > 0) {\n const u = {\n path: h.path,\n segments: v\n }, l = await e.getMeta?.(u);\n if (l) {\n if (e.addDoctype(l), r.value.setup(l), s.value = l, a.value = y, n.value = r.value.getStore(), e) {\n const f = l.schema ? Array.isArray(l.schema) ? l.schema : Array.from(l.schema) : [];\n c.value = e.resolveSchema(f);\n }\n if (y && y !== \"new\") {\n const f = r.value.getRecordById(l, y);\n if (f)\n i.value = f.get(\"\") || {};\n else\n try {\n await r.value.getRecord(l, y);\n const T = r.value.getRecordById(l, y);\n T && (i.value = T.get(\"\") || {});\n } catch {\n i.value = z(l);\n }\n } else\n i.value = z(l);\n n.value && me(l, y || \"new\", i, n.value), r.value.runAction(l, \"load\", y ? [y] : void 0);\n }\n }\n }\n if (o.doctype) {\n n.value = r.value.getStore();\n const h = o.doctype, v = o.recordId;\n if (v && v !== \"new\") {\n const y = r.value.getRecordById(h, v);\n if (y)\n i.value = y.get(\"\") || {};\n else\n try {\n await r.value.getRecord(h, v);\n const u = r.value.getRecordById(h, v);\n u && (i.value = u.get(\"\") || {});\n } catch {\n i.value = z(h);\n }\n } else\n i.value = z(h);\n n.value && me(h, v || \"new\", i, n.value);\n }\n }\n });\n const J = (h, v) => {\n const y = o.doctype || s.value;\n if (!y) return \"\";\n const u = v || o.recordId || a.value || \"new\";\n return `${y.slug}.${u}.${h}`;\n }, B = (h) => {\n const v = o.doctype || s.value;\n if (!(!n.value || !r.value || !v))\n try {\n const y = h.path.split(\".\");\n if (y.length >= 2) {\n const f = y[0], T = y[1];\n if (n.value.has(`${f}.${T}`) || r.value.addRecord(v, T, { ...i.value }), y.length > 3) {\n const V = `${f}.${T}`, P = y.slice(2);\n let K = V;\n for (let Z = 0; Z < P.length - 1; Z++)\n if (K += `.${P[Z]}`, !n.value.has(K)) {\n const ae = P[Z + 1], Ce = !isNaN(Number(ae));\n n.value.set(K, Ce ? [] : {});\n }\n }\n }\n n.value.set(h.path, h.value);\n const u = h.fieldname.split(\".\"), l = { ...i.value };\n u.length === 1 ? l[u[0]] = h.value : tt(l, u, h.value), i.value = l;\n } catch {\n }\n };\n (o.doctype || e?.router) && (he(\"hstPathProvider\", J), he(\"hstChangeHandler\", B));\n const G = (h, v, y) => {\n if (!r.value)\n return z(v);\n if (y)\n try {\n const u = n.value?.get(h);\n return u && typeof u == \"object\" ? u : z(v);\n } catch {\n return z(v);\n }\n return z(v);\n }, m = (h, v) => {\n if (!n.value || !r.value)\n throw new Error(\"HST store not initialized\");\n const y = `${h.slug}.${v}`, l = { ...n.value.get(y) || {} }, f = h.schema ? Array.isArray(h.schema) ? h.schema : Array.from(h.schema) : [], V = (e ? e.resolveSchema(f) : f).filter(\n (P) => \"fieldtype\" in P && P.fieldtype === \"Doctype\" && \"schema\" in P && Array.isArray(P.schema)\n );\n for (const P of V) {\n const K = P, Z = `${y}.${K.fieldname}`, ae = Te(K.schema, Z, n.value);\n l[K.fieldname] = ae;\n }\n return l;\n }, C = (h, v) => ({\n provideHSTPath: (l) => `${h}.${l}`,\n handleHSTChange: (l) => {\n const f = l.path.startsWith(h) ? l.path : `${h}.${l.fieldname}`;\n B({\n ...l,\n path: f\n });\n }\n }), k = {\n operations: d,\n currentIndex: p,\n undoRedoState: F,\n canUndo: S,\n canRedo: $,\n undoCount: D,\n redoCount: N,\n undo: R,\n redo: O,\n startBatch: b,\n commitBatch: g,\n cancelBatch: I,\n clear: w,\n getOperationsFor: A,\n getSnapshot: E,\n markIrreversible: M,\n logAction: W,\n configure: x\n };\n return o.doctype ? {\n stonecrop: r,\n operationLog: k,\n provideHSTPath: J,\n handleHSTChange: B,\n hstStore: n,\n formData: i,\n resolvedSchema: c,\n loadNestedData: G,\n saveRecursive: m,\n createNestedContext: C\n } : !o.doctype && e?.router ? {\n stonecrop: r,\n operationLog: k,\n provideHSTPath: J,\n handleHSTChange: B,\n hstStore: n,\n formData: i,\n resolvedSchema: c,\n loadNestedData: G,\n saveRecursive: m,\n createNestedContext: C\n } : {\n stonecrop: r,\n operationLog: k\n };\n}\nfunction z(o) {\n const e = {};\n return o.schema && o.schema.forEach((t) => {\n switch (\"fieldtype\" in t ? t.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n e[t.fieldname] = \"\";\n break;\n case \"Check\":\n e[t.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n e[t.fieldname] = 0;\n break;\n case \"Table\":\n e[t.fieldname] = [];\n break;\n case \"JSON\":\n e[t.fieldname] = {};\n break;\n default:\n e[t.fieldname] = null;\n }\n }), e;\n}\nfunction me(o, e, t, r) {\n U(\n t,\n (n) => {\n const i = `${o.slug}.${e}`;\n Object.keys(n).forEach((s) => {\n const a = `${i}.${s}`;\n try {\n r.set(a, n[s]);\n } catch {\n }\n });\n },\n { deep: !0 }\n );\n}\nfunction tt(o, e, t) {\n let r = o;\n for (let i = 0; i < e.length - 1; i++) {\n const s = e[i];\n (!(s in r) || typeof r[s] != \"object\") && (r[s] = isNaN(Number(e[i + 1])) ? {} : []), r = r[s];\n }\n const n = e[e.length - 1];\n r[n] = t;\n}\nfunction Te(o, e, t) {\n const n = { ...t.get(e) || {} }, i = o.filter(\n (s) => \"fieldtype\" in s && s.fieldtype === \"Doctype\" && \"schema\" in s && Array.isArray(s.schema)\n );\n for (const s of i) {\n const a = s, c = `${e}.${a.fieldname}`, d = Te(a.schema, c, t);\n n[a.fieldname] = d;\n }\n return n;\n}\nfunction $e(o) {\n const t = (Se() ? fe(\"$operationLogStore\", void 0) : void 0) || re();\n o && t.configure(o);\n const { operations: r, currentIndex: n, undoRedoState: i, canUndo: s, canRedo: a, undoCount: c, redoCount: d } = be(t);\n function p(w) {\n return t.undo(w);\n }\n function S(w) {\n return t.redo(w);\n }\n function $() {\n t.startBatch();\n }\n function D(w) {\n return t.commitBatch(w);\n }\n function N() {\n t.cancelBatch();\n }\n function F() {\n t.clear();\n }\n function R(w, A) {\n return t.getOperationsFor(w, A);\n }\n function O() {\n return t.getSnapshot();\n }\n function b(w, A) {\n t.markIrreversible(w, A);\n }\n function g(w, A, E, M = \"success\", W) {\n return t.logAction(w, A, E, M, W);\n }\n function I(w) {\n t.configure(w);\n }\n return {\n // State\n operations: r,\n currentIndex: n,\n undoRedoState: i,\n canUndo: s,\n canRedo: a,\n undoCount: c,\n redoCount: d,\n // Methods\n undo: p,\n redo: S,\n startBatch: $,\n commitBatch: D,\n cancelBatch: N,\n clear: F,\n getOperationsFor: R,\n getSnapshot: O,\n markIrreversible: b,\n logAction: g,\n configure: I\n };\n}\nfunction gt(o, e = !0) {\n if (!e) return;\n const { undo: t, redo: r, canUndo: n, canRedo: i } = $e(), s = Ye();\n X(s[\"Ctrl+Z\"], () => {\n n.value && t(o);\n }), X(s[\"Meta+Z\"], () => {\n n.value && t(o);\n }), X(s[\"Ctrl+Shift+Z\"], () => {\n i.value && r(o);\n }), X(s[\"Meta+Shift+Z\"], () => {\n i.value && r(o);\n }), X(s[\"Ctrl+Y\"], () => {\n i.value && r(o);\n });\n}\nasync function pt(o, e) {\n const { startBatch: t, commitBatch: r, cancelBatch: n } = $e();\n t();\n try {\n return await o(), r(e);\n } catch (i) {\n throw n(), i;\n }\n}\nclass mt {\n /**\n * The doctype name\n * @public\n * @readonly\n */\n doctype;\n /**\n * Alias for doctype (for DoctypeLike interface compatibility)\n * @public\n * @readonly\n */\n get name() {\n return this.doctype;\n }\n /**\n * The doctype schema\n * @public\n * @readonly\n */\n schema;\n /**\n * The doctype workflow\n * @public\n * @readonly\n */\n workflow;\n /**\n * The doctype actions and field triggers\n * @public\n * @readonly\n */\n actions;\n /**\n * The doctype component\n * @public\n * @readonly\n */\n component;\n /**\n * Creates a new DoctypeMeta instance\n * @param doctype - The doctype name\n * @param schema - The doctype schema definition\n * @param workflow - The doctype workflow configuration (XState machine)\n * @param actions - The doctype actions and field triggers\n * @param component - Optional Vue component for rendering the doctype\n */\n constructor(e, t, r, n, i) {\n this.doctype = e, this.schema = t, this.workflow = r, this.actions = n, this.component = i;\n }\n /**\n * Returns the transitions available from a given workflow state, derived from the\n * doctype's XState workflow configuration.\n *\n * @param currentState - The state name to read transitions from\n * @returns Array of transition descriptors with `name` and `targetState`\n *\n * @example\n * ```ts\n * const transitions = doctype.getAvailableTransitions('draft')\n * // [{ name: 'SUBMIT', targetState: 'submitted' }]\n * ```\n *\n * @public\n */\n getAvailableTransitions(e) {\n const t = this.workflow?.states;\n if (!t) return [];\n const r = t[e];\n return r?.on ? Object.entries(r.on).map(([n, i]) => ({\n name: n,\n targetState: typeof i == \"string\" ? i : \"unknown\"\n })) : [];\n }\n /**\n * Converts the registered doctype string to a slug (kebab-case). The following conversions are made:\n * - It replaces camelCase and PascalCase with kebab-case strings\n * - It replaces spaces and underscores with hyphens\n * - It converts the string to lowercase\n *\n * @returns The slugified doctype string\n *\n * @example\n * ```ts\n * const doctype = new DoctypeMeta('TaskItem', schema, workflow, actions\n * console.log(doctype.slug) // 'task-item'\n * ```\n *\n * @public\n */\n get slug() {\n return this.doctype.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[\\s_]+/g, \"-\").toLowerCase();\n }\n}\nclass te {\n /**\n * The root Registry instance\n */\n static _root;\n /**\n * The name of the Registry instance\n *\n * @defaultValue 'Registry'\n */\n name;\n /**\n * The registry property contains a collection of doctypes\n * @see {@link DoctypeMeta}\n */\n registry;\n /**\n * The Vue router instance\n * @see {@link https://router.vuejs.org/}\n */\n router;\n /**\n * Creates a new Registry instance (singleton pattern)\n * @param router - Optional Vue router instance for route management\n * @param getMeta - Optional function to fetch doctype metadata from an API\n */\n constructor(e, t) {\n if (te._root)\n return te._root;\n te._root = this, this.name = \"Registry\", this.registry = {}, this.router = e, this.getMeta = t;\n }\n /**\n * The getMeta function fetches doctype metadata from an API based on route context\n * @see {@link DoctypeMeta}\n */\n getMeta;\n /**\n * Get doctype metadata\n * @param doctype - The doctype to fetch metadata for\n * @returns The doctype metadata\n * @see {@link DoctypeMeta}\n */\n addDoctype(e) {\n e.slug in this.registry || (this.registry[e.slug] = e);\n const t = q();\n t.registerDoctypeActions(e.doctype, e.actions), e.slug !== e.doctype && t.registerDoctypeActions(e.slug, e.actions), e.component && this.router && !this.router.hasRoute(e.doctype) && this.router.addRoute({\n path: `/${e.slug}`,\n name: e.slug,\n component: e.component\n });\n }\n /**\n * Resolve nested Doctype and Table fields in a schema by embedding child schemas inline.\n *\n * @remarks\n * Walks the schema array and for each field with `fieldtype: 'Doctype'` and a string\n * `options` value, looks up the referenced doctype in the registry and embeds its schema\n * as the field's `schema` property. Recurses for deeply nested doctypes.\n *\n * For fields with `fieldtype: 'Table'`, looks up the referenced child doctype and\n * auto-derives `columns` from its schema fields (unless columns are already provided).\n * Also sets sensible defaults for `component` (`'ATable'`) and `config` (`{ view: 'list' }`).\n * Row data is expected to come from the parent form's data model at `data[fieldname]`.\n *\n * Returns a new array โ does not mutate the original schema.\n *\n * @param schema - The schema array to resolve\n * @returns A new schema array with nested Doctype fields resolved\n *\n * @example\n * ```ts\n * registry.addDoctype(addressDoctype)\n * registry.addDoctype(customerDoctype)\n *\n * // Before: customer schema has { fieldname: 'address', fieldtype: 'Doctype', options: 'address' }\n * const resolved = registry.resolveSchema(customerSchema)\n * // After: address field now has schema: [...address fields...]\n * ```\n *\n * @public\n */\n resolveSchema(e, t) {\n const r = t || /* @__PURE__ */ new Set();\n return e.map((n) => {\n if (\"fieldtype\" in n && n.fieldtype === \"Doctype\" && \"options\" in n && typeof n.options == \"string\") {\n const i = n.options;\n if (r.has(i))\n return { ...n };\n const s = this.registry[i];\n if (s && s.schema) {\n const a = Array.isArray(s.schema) ? s.schema : Array.from(s.schema);\n r.add(i);\n const c = this.resolveSchema(a, r);\n return r.delete(i), { ...n, schema: c };\n }\n }\n if (\"fieldtype\" in n && n.fieldtype === \"Table\" && \"options\" in n && typeof n.options == \"string\") {\n const i = n.options;\n if (r.has(i))\n return { ...n };\n const s = this.registry[i];\n if (s && s.schema) {\n const a = Array.isArray(s.schema) ? s.schema : Array.from(s.schema), c = { ...n };\n return (!(\"columns\" in n) || !n.columns) && (c.columns = a.map((d) => ({\n name: d.fieldname,\n fieldname: d.fieldname,\n label: \"label\" in d && d.label || d.fieldname,\n fieldtype: \"fieldtype\" in d ? d.fieldtype : \"Data\",\n align: \"align\" in d && d.align || \"left\",\n edit: \"edit\" in d ? d.edit : !0,\n width: \"width\" in d && d.width || \"20ch\"\n }))), c.component || (c.component = \"ATable\"), (!(\"config\" in n) || !n.config) && (c.config = { view: \"list\" }), (!(\"rows\" in n) || !n.rows) && (c.rows = []), c;\n }\n }\n return { ...n };\n });\n }\n /**\n * Initialize a new record with default values based on a schema.\n *\n * @remarks\n * Creates a plain object with keys from the schema's fieldnames and default values\n * derived from each field's `fieldtype`:\n * - Data, Text โ `''`\n * - Check โ `false`\n * - Int, Float, Decimal, Currency, Quantity โ `0`\n * - Table โ `[]`\n * - JSON, Doctype โ `{}`\n * - All others โ `null`\n *\n * For Doctype fields with a resolved `schema` array, recursively initializes the nested record.\n *\n * @param schema - The schema array to derive defaults from\n * @returns A plain object with default values for each field\n *\n * @example\n * ```ts\n * const defaults = registry.initializeRecord(addressSchema)\n * // { street: '', city: '', state: '', zip_code: '' }\n * ```\n *\n * @public\n */\n initializeRecord(e) {\n const t = {};\n return e.forEach((r) => {\n switch (\"fieldtype\" in r ? r.fieldtype : \"Data\") {\n case \"Data\":\n case \"Text\":\n case \"Code\":\n t[r.fieldname] = \"\";\n break;\n case \"Check\":\n t[r.fieldname] = !1;\n break;\n case \"Int\":\n case \"Float\":\n case \"Decimal\":\n case \"Currency\":\n case \"Quantity\":\n t[r.fieldname] = 0;\n break;\n case \"Table\":\n t[r.fieldname] = [];\n break;\n case \"JSON\":\n t[r.fieldname] = {};\n break;\n case \"Doctype\":\n \"schema\" in r && Array.isArray(r.schema) ? t[r.fieldname] = this.initializeRecord(r.schema) : t[r.fieldname] = {};\n break;\n default:\n t[r.fieldname] = null;\n }\n }), t;\n }\n /**\n * Get a registered doctype by slug\n * @param slug - The doctype slug to look up\n * @returns The DoctypeMeta instance if found, or undefined\n * @public\n */\n getDoctype(e) {\n return this.registry[e];\n }\n // TODO: should we allow clearing the registry at all?\n // clear() {\n // \tthis.registry = {}\n // \tif (this.router) {\n // \t\tconst routes = this.router.getRoutes()\n // \t\tfor (const route of routes) {\n // \t\t\tif (route.name) {\n // \t\t\t\tthis.router.removeRoute(route.name)\n // \t\t\t}\n // \t\t}\n // \t}\n // }\n}\nasync function rt(o, e, t) {\n await de();\n try {\n await t(o, e);\n } catch {\n }\n}\nconst vt = {\n install: (o, e) => {\n const t = o.config.globalProperties.$router, r = e?.router, n = t || r;\n !t && r && o.use(r);\n const i = new te(n, e?.getMeta);\n o.provide(\"$registry\", i), o.config.globalProperties.$registry = i;\n const s = new Oe(i, void 0, e?.client ? { client: e.client } : void 0);\n o.provide(\"$stonecrop\", s), o.config.globalProperties.$stonecrop = s;\n try {\n const a = o.config.globalProperties.$pinia;\n if (a) {\n const c = re(a);\n o.provide(\"$operationLogStore\", c), o.config.globalProperties.$operationLogStore = c;\n }\n } catch (a) {\n console.warn(\"Pinia not available - operation log features will be disabled:\", a);\n }\n if (e?.components)\n for (const [a, c] of Object.entries(e.components))\n o.component(a, c);\n e?.autoInitializeRouter && e.onRouterInitialized && rt(i, s, e.onRouterInitialized);\n }\n};\nvar nt = /* @__PURE__ */ ((o) => (o.ERROR = \"error\", o.WARNING = \"warning\", o.INFO = \"info\", o))(nt || {});\nclass ot {\n options;\n /**\n * Creates a new SchemaValidator instance\n * @param options - Validator configuration options\n */\n constructor(e = {}) {\n this.options = {\n registry: e.registry || null,\n validateLinkTargets: e.validateLinkTargets ?? !0,\n validateActions: e.validateActions ?? !0,\n validateWorkflows: e.validateWorkflows ?? !0,\n validateRequiredProperties: e.validateRequiredProperties ?? !0\n };\n }\n /**\n * Validates a complete doctype schema\n * @param doctype - Doctype name\n * @param schema - Schema fields (List or Array)\n * @param workflow - Optional workflow configuration\n * @param actions - Optional actions map\n * @returns Validation result\n */\n validate(e, t, r, n) {\n const i = [], s = t ? Array.isArray(t) ? t : t.toArray() : [];\n if (this.options.validateRequiredProperties && i.push(...this.validateRequiredProperties(e, s)), this.options.validateLinkTargets && this.options.registry && i.push(...this.validateLinkFields(e, s, this.options.registry)), this.options.validateWorkflows && r && i.push(...this.validateWorkflow(e, r)), this.options.validateActions && n) {\n const p = n instanceof Map ? n : n.toObject();\n i.push(...this.validateActionRegistration(e, p));\n }\n const a = i.filter(\n (p) => p.severity === \"error\"\n /* ERROR */\n ).length, c = i.filter(\n (p) => p.severity === \"warning\"\n /* WARNING */\n ).length, d = i.filter(\n (p) => p.severity === \"info\"\n /* INFO */\n ).length;\n return {\n valid: a === 0,\n issues: i,\n errorCount: a,\n warningCount: c,\n infoCount: d\n };\n }\n /**\n * Validates that required schema properties are present\n * @internal\n */\n validateRequiredProperties(e, t) {\n const r = [];\n for (const n of t) {\n if (!n.fieldname) {\n r.push({\n severity: \"error\",\n rule: \"required-fieldname\",\n message: \"Field is missing required property: fieldname\",\n doctype: e,\n context: { field: n }\n });\n continue;\n }\n if (!n.component && !(\"fieldtype\" in n) && r.push({\n severity: \"error\",\n rule: \"required-component-or-fieldtype\",\n message: `Field \"${n.fieldname}\" must have either component or fieldtype property`,\n doctype: e,\n fieldname: n.fieldname\n }), \"schema\" in n) {\n const i = n.schema, s = Array.isArray(i) ? i : i.toArray?.() || [];\n r.push(...this.validateRequiredProperties(e, s));\n }\n }\n return r;\n }\n /**\n * Validates Link field targets exist in registry\n * @internal\n */\n validateLinkFields(e, t, r) {\n const n = [];\n for (const i of t) {\n if ((\"fieldtype\" in i ? i.fieldtype : void 0) === \"Link\") {\n const a = \"options\" in i ? i.options : void 0;\n if (!a) {\n n.push({\n severity: \"error\",\n rule: \"link-missing-options\",\n message: `Link field \"${i.fieldname}\" is missing options property (target doctype)`,\n doctype: e,\n fieldname: i.fieldname\n });\n continue;\n }\n const c = typeof a == \"string\" ? a : \"\";\n if (!c) {\n n.push({\n severity: \"error\",\n rule: \"link-invalid-options\",\n message: `Link field \"${i.fieldname}\" has invalid options format (expected string doctype name)`,\n doctype: e,\n fieldname: i.fieldname\n });\n continue;\n }\n r.registry[c] || r.registry[c.toLowerCase()] || n.push({\n severity: \"error\",\n rule: \"link-invalid-target\",\n message: `Link field \"${i.fieldname}\" references non-existent doctype: \"${c}\"`,\n doctype: e,\n fieldname: i.fieldname,\n context: { targetDoctype: c }\n });\n }\n if (\"schema\" in i) {\n const a = i.schema, c = Array.isArray(a) ? a : a.toArray?.() || [];\n n.push(...this.validateLinkFields(e, c, r));\n }\n }\n return n;\n }\n /**\n * Validates workflow state machine configuration\n * @internal\n */\n validateWorkflow(e, t) {\n const r = [];\n if (!t.initial && !t.type && r.push({\n severity: \"warning\",\n rule: \"workflow-missing-initial\",\n message: \"Workflow is missing initial state property\",\n doctype: e\n }), !t.states || Object.keys(t.states).length === 0)\n return r.push({\n severity: \"warning\",\n rule: \"workflow-no-states\",\n message: \"Workflow has no states defined\",\n doctype: e\n }), r;\n t.initial && typeof t.initial == \"string\" && !t.states[t.initial] && r.push({\n severity: \"error\",\n rule: \"workflow-invalid-initial\",\n message: `Workflow initial state \"${t.initial}\" does not exist in states`,\n doctype: e,\n context: { initialState: t.initial }\n });\n const n = Object.keys(t.states), i = /* @__PURE__ */ new Set();\n t.initial && typeof t.initial == \"string\" && i.add(t.initial);\n for (const [s, a] of Object.entries(t.states)) {\n const c = a;\n if (c.on) {\n for (const [d, p] of Object.entries(c.on))\n if (typeof p == \"string\")\n i.add(p);\n else if (p && typeof p == \"object\") {\n const S = \"target\" in p ? p.target : void 0;\n typeof S == \"string\" ? i.add(S) : Array.isArray(S) && S.forEach(($) => {\n typeof $ == \"string\" && i.add($);\n });\n }\n }\n }\n for (const s of n)\n i.has(s) || r.push({\n severity: \"warning\",\n rule: \"workflow-unreachable-state\",\n message: `Workflow state \"${s}\" may not be reachable`,\n doctype: e,\n context: { stateName: s }\n });\n return r;\n }\n /**\n * Validates that actions are registered in the FieldTriggerEngine\n * @internal\n */\n validateActionRegistration(e, t) {\n const r = [], n = q();\n for (const [i, s] of Object.entries(t)) {\n if (!Array.isArray(s)) {\n r.push({\n severity: \"error\",\n rule: \"action-invalid-format\",\n message: `Action configuration for \"${i}\" must be an array`,\n doctype: e,\n context: { triggerName: i, actionNames: s }\n });\n continue;\n }\n for (const a of s) {\n const c = n;\n c.globalActions?.has(a) || c.globalTransitionActions?.has(a) || r.push({\n severity: \"warning\",\n rule: \"action-not-registered\",\n message: `Action \"${a}\" referenced in \"${i}\" is not registered in FieldTriggerEngine`,\n doctype: e,\n context: { triggerName: i, actionName: a }\n });\n }\n }\n return r;\n }\n}\nfunction it(o, e) {\n return new ot({\n registry: o,\n ...e\n });\n}\nfunction yt(o, e, t, r, n) {\n return it(t).validate(o, e, r, n);\n}\nexport {\n mt as DoctypeMeta,\n Y as HST,\n te as Registry,\n ot as SchemaValidator,\n Oe as Stonecrop,\n nt as ValidationSeverity,\n et as createHST,\n it as createValidator,\n vt as default,\n q as getGlobalTriggerEngine,\n dt as markOperationIrreversible,\n ct as registerGlobalAction,\n lt as registerTransitionAction,\n ut as setFieldRollback,\n ft as triggerTransition,\n $e as useOperationLog,\n re as useOperationLogStore,\n ht as useStonecrop,\n gt as useUndoRedoShortcuts,\n yt as validateSchema,\n pt as withBatch\n};\n//# sourceMappingURL=stonecrop.js.map\n","import { defineComponent as oe, useTemplateRef as fe, ref as R, computed as T, openBlock as h, createElementBlock as x, unref as V, normalizeClass as se, normalizeStyle as be, createBlock as me, resolveDynamicComponent as Ue, mergeProps as ft, toDisplayString as N, createElementVNode as w, withModifiers as Ie, withDirectives as K, Fragment as X, renderList as ve, vShow as Ce, createCommentVNode as Y, renderSlot as he, createTextVNode as Dt, onMounted as Ee, watch as ne, onBeforeUnmount as an, nextTick as vt, toValue as E, shallowRef as ue, getCurrentScope as pt, onScopeDispose as mt, reactive as sn, vModelText as we, vModelCheckbox as rn, vModelSelect as Mn, getCurrentInstance as ht, watchEffect as gt, useCssVars as Cn, onUnmounted as En, useModel as Me, createVNode as ct, withCtx as $t, mergeModels as xe, isRef as An, toRefs as $n, customRef as St, toRef as un, readonly as Rt, resolveComponent as cn, withKeys as Ze } from \"vue\";\nimport { defineStore as Tn } from \"pinia\";\nimport './assets/index.css';function dn(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\nconst Dn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Sn = (e) => e != null, Rn = Object.prototype.toString, Ln = (e) => Rn.call(e) === \"[object Object]\", Hn = () => {\n};\nfunction st(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction Vn(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst ze = Dn ? window : void 0;\nfunction We(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction Qe(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = st(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return Vn(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => We(r))) !== null && n !== void 0 ? n : [ze].filter((r) => r != null),\n st(E(o.value ? e[1] : e[0])),\n st(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = Ln(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction _n() {\n const e = ue(!1), t = ht();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Pn(e) {\n const t = /* @__PURE__ */ _n();\n return T(() => (t.value, !!e()));\n}\nfunction On(e, t, o = {}) {\n const { window: n = ze, ...a } = o;\n let r;\n const s = /* @__PURE__ */ Pn(() => n && \"MutationObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const p = st(E(e)).map(We).filter(Sn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((y) => r.observe(y, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => r?.takeRecords(), d = () => {\n u(), l();\n };\n return dn(d), {\n isSupported: s,\n stop: d,\n takeRecords: i\n };\n}\nfunction Bn(e, t, o = {}) {\n const { window: n = ze, document: a = n?.document, flush: r = \"sync\" } = o;\n if (!n || !a) return Hn;\n let s;\n const l = (d) => {\n s?.(), s = d;\n }, u = gt(() => {\n const d = We(e);\n if (d) {\n const { stop: p } = On(a, (y) => {\n y.map((k) => [...k.removedNodes]).flat().some((k) => k === d || k.contains(d)) && t(y);\n }, {\n window: n,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), i = () => {\n u(), l();\n };\n return dn(i), i;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Fn(e = {}) {\n var t;\n const { window: o = ze, deep: n = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : o?.document, s = () => {\n let i = r?.activeElement;\n if (n)\n for (var d; i?.shadowRoot; ) i = i == null || (d = i.shadowRoot) === null || d === void 0 ? void 0 : d.activeElement;\n return i;\n }, l = ue(), u = () => {\n l.value = s();\n };\n if (o) {\n const i = {\n capture: !0,\n passive: !0\n };\n Qe(o, \"blur\", (d) => {\n d.relatedTarget === null && u();\n }, i), Qe(o, \"focus\", u, i);\n }\n return a && Bn(l, u, { document: r }), u(), l;\n}\nconst Zn = \"focusin\", Nn = \"focusout\", Un = \":focus-within\";\nfunction Wn(e, t = {}) {\n const { window: o = ze } = t, n = T(() => We(e)), a = ue(!1), r = T(() => a.value);\n if (!o || !(/* @__PURE__ */ Fn(t)).value) return { focused: r };\n const s = { passive: !0 };\n return Qe(n, Zn, () => a.value = !0, s), Qe(n, Nn, () => {\n var l, u, i;\n return a.value = (l = (u = n.value) === null || u === void 0 || (i = u.matches) === null || i === void 0 ? void 0 : i.call(u, Un)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction Gn(e, { window: t = ze, scrollTarget: o } = {}) {\n const n = R(!1), a = () => {\n if (!t) return;\n const r = t.document, s = We(e);\n if (!s)\n n.value = !1;\n else {\n const l = s.getBoundingClientRect();\n n.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return ne(\n () => We(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && Qe(o || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), n;\n}\nconst Ae = (e) => {\n let t = Gn(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, $e = (e) => e.tabIndex >= 0, Wt = (e) => {\n const t = e.target;\n return Lt(t);\n}, Lt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.previousElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.previousElementSibling;\n o && (t = o);\n }\n return t && (!$e(t) || !Ae(t)) ? Lt(t) : t;\n}, zn = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.firstElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.firstElementChild;\n a && (o = a);\n }\n }\n return o && (!$e(o) || !Ae(o)) ? Ht(o) : o;\n}, Gt = (e) => {\n const t = e.target;\n return Ht(t);\n}, Ht = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.nextElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.nextElementSibling;\n o && (t = o);\n }\n return t && (!$e(t) || !Ae(t)) ? Ht(t) : t;\n}, qn = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.lastElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.lastElementChild;\n a && (o = a);\n }\n }\n return o && (!$e(o) || !Ae(o)) ? Lt(o) : o;\n}, zt = (e) => {\n const t = e.target;\n return Vt(t);\n}, Vt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!$e(t) || !Ae(t)) ? Vt(t) : t;\n}, qt = (e) => {\n const t = e.target;\n return _t(t);\n}, _t = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!$e(t) || !Ae(t)) ? _t(t) : t;\n}, Yt = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!$e(t) || !Ae(t)) ? _t(t) : t;\n}, Xt = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!$e(t) || !Ae(t)) ? Vt(t) : t;\n}, nt = [\"alt\", \"control\", \"shift\", \"meta\"], Yn = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, wt = {\n \"keydown.up\": (e) => {\n const t = Wt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Gt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = zt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = qt(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = zn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = qn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = Xt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Gt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Wt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = Yt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = zt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Pt(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, o = (s) => {\n const l = t(s);\n let u = [];\n if (typeof s.selectors == \"string\")\n u = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const i of s.selectors)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else if (s.selectors instanceof HTMLElement)\n u.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const i of s.selectors.value)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else\n u.push(s.selectors.value);\n return u;\n }, n = (s) => {\n const l = t(s);\n let u = [];\n return s.selectors ? u = o(s) : l && (u = Array.from(l.children).filter((i) => $e(i) && Ae(i))), u;\n }, a = (s) => (l) => {\n const u = Yn[l.key] || l.key.toLowerCase();\n if (nt.includes(u)) return;\n const i = s.handlers || wt;\n for (const d of Object.keys(i)) {\n const [p, ...y] = d.split(\".\");\n if (p === \"keydown\" && y.includes(u)) {\n const k = i[d], g = y.filter((f) => nt.includes(f)), b = nt.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (g.length > 0) {\n if (b) {\n for (const f of nt)\n if (y.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && k(l);\n }\n }\n } else\n b || k(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), u = n(s), i = a(s), d = l ? [l] : u;\n for (const p of d) {\n const { focused: y } = Wn(R(p)), k = ne(y, (g) => {\n g ? p.addEventListener(\"keydown\", i) : p.removeEventListener(\"keydown\", i);\n });\n r.push(k);\n }\n }\n }), an(() => {\n for (const s of r)\n s();\n });\n}\nfunction Ot(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\nconst fn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst Xn = (e) => e != null, jn = Object.prototype.toString, Jn = (e) => jn.call(e) === \"[object Object]\", Pe = () => {\n};\nfunction Qn(...e) {\n if (e.length !== 1) return un(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: Pe\n }))) : R(t);\n}\nfunction Kn(e, t) {\n function o(...n) {\n return new Promise((a, r) => {\n Promise.resolve(e(() => t.apply(this, n), {\n fn: t,\n thisArg: this,\n args: n\n })).then(a).catch(r);\n });\n }\n return o;\n}\nfunction eo(e, t = {}) {\n let o, n, a = Pe;\n const r = (l) => {\n clearTimeout(l), a(), a = Pe;\n };\n let s;\n return (l) => {\n const u = E(e), i = E(t.maxWait);\n return o && r(o), u <= 0 || i !== void 0 && i <= 0 ? (n && (r(n), n = void 0), Promise.resolve(l())) : new Promise((d, p) => {\n a = t.rejectOnCancel ? p : d, s = l, i && !n && (n = setTimeout(() => {\n o && r(o), n = void 0, d(s());\n }, i)), o = setTimeout(() => {\n n && r(n), n = void 0, d(l());\n }, u);\n });\n };\n}\nfunction rt(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction to(e) {\n return ht();\n}\n// @__NO_SIDE_EFFECTS__\nfunction no(e, t = 200, o = {}) {\n return Kn(eo(t, o), e);\n}\nfunction oo(e, t = {}) {\n if (!An(e)) return $n(e);\n const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {};\n for (const n in e.value) o[n] = St(() => ({\n get() {\n return e.value[n];\n },\n set(a) {\n var r;\n if (!((r = E(t.replaceRef)) !== null && r !== void 0) || r) if (Array.isArray(e.value)) {\n const s = [...e.value];\n s[n] = a, e.value = s;\n } else {\n const s = {\n ...e.value,\n [n]: a\n };\n Object.setPrototypeOf(s, Object.getPrototypeOf(e.value)), e.value = s;\n }\n else e.value[n] = a;\n }\n }));\n return o;\n}\nfunction lo(e, t = !0, o) {\n to() ? Ee(e, o) : t ? e() : vt(e);\n}\nfunction ao(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst et = fn ? window : void 0;\nfunction ye(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction He(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = rt(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return ao(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => ye(r))) !== null && n !== void 0 ? n : [et].filter((r) => r != null),\n rt(E(o.value ? e[1] : e[0])),\n rt(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = Jn(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction Tt(e, t, o = {}) {\n const { window: n = et, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = o;\n if (!n) return l ? {\n stop: Pe,\n cancel: Pe,\n trigger: Pe\n } : Pe;\n let u = !0;\n const i = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(n.document.querySelectorAll(m)).some((I) => I === f.target || f.composedPath().includes(I));\n {\n const I = ye(m);\n return I && (f.target === I || f.composedPath().includes(I));\n }\n });\n function d(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const I = E(f), C = I.$.subTree && I.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some(($) => $.el === m.target || m.composedPath().includes($.el));\n }\n const y = (f) => {\n const m = ye(e);\n if (f.target != null && !(!(m instanceof Element) && d(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (u = !i(f)), !u) {\n u = !0;\n return;\n }\n t(f);\n }\n };\n let k = !1;\n const g = [\n He(n, \"click\", (f) => {\n k || (k = !0, setTimeout(() => {\n k = !1;\n }, 0), y(f));\n }, {\n passive: !0,\n capture: r\n }),\n He(n, \"pointerdown\", (f) => {\n const m = ye(e);\n u = !i(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && He(n, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const I = ye(e);\n ((m = n.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !I?.contains(n.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), b = () => g.forEach((f) => f());\n return l ? {\n stop: b,\n cancel: () => {\n u = !1;\n },\n trigger: (f) => {\n u = !0, y(f), u = !1;\n }\n } : b;\n}\n// @__NO_SIDE_EFFECTS__\nfunction so() {\n const e = ue(!1), t = ht();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction vn(e) {\n const t = /* @__PURE__ */ so();\n return T(() => (t.value, !!e()));\n}\nfunction pn(e, t, o = {}) {\n const { window: n = et, ...a } = o;\n let r;\n const s = /* @__PURE__ */ vn(() => n && \"MutationObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const p = rt(E(e)).map(ye).filter(Xn);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((y) => r.observe(y, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => r?.takeRecords(), d = () => {\n u(), l();\n };\n return Ot(d), {\n isSupported: s,\n stop: d,\n takeRecords: i\n };\n}\nconst ot = {\n speed: 2,\n margin: 30,\n direction: \"both\"\n};\nfunction ro(e) {\n e.scrollLeft > e.scrollWidth - e.clientWidth && (e.scrollLeft = Math.max(0, e.scrollWidth - e.clientWidth)), e.scrollTop > e.scrollHeight - e.clientHeight && (e.scrollTop = Math.max(0, e.scrollHeight - e.clientHeight));\n}\nfunction yt(e, t = {}) {\n var o, n, a, r;\n const { pointerTypes: s, preventDefault: l, stopPropagation: u, exact: i, onMove: d, onEnd: p, onStart: y, initialValue: k, axis: g = \"both\", draggingElement: b = et, containerElement: f, handle: m = e, buttons: I = [0], restrictInView: C, autoScroll: $ = !1 } = t, L = R((o = E(k)) !== null && o !== void 0 ? o : {\n x: 0,\n y: 0\n }), S = R(), O = (D) => s ? s.includes(D.pointerType) : !0, W = (D) => {\n E(l) && D.preventDefault(), E(u) && D.stopPropagation();\n }, pe = E($), j = typeof pe == \"object\" ? {\n speed: (n = E(pe.speed)) !== null && n !== void 0 ? n : ot.speed,\n margin: (a = E(pe.margin)) !== null && a !== void 0 ? a : ot.margin,\n direction: (r = pe.direction) !== null && r !== void 0 ? r : ot.direction\n } : ot, J = (D) => typeof D == \"number\" ? [D, D] : [D.x, D.y], ge = (D, F, G) => {\n const { clientWidth: Q, clientHeight: q, scrollLeft: re, scrollTop: ke, scrollWidth: Le, scrollHeight: P } = D, [B, z] = J(j.margin), [ee, le] = J(j.speed);\n let te = 0, ie = 0;\n (j.direction === \"x\" || j.direction === \"both\") && (G.x < B && re > 0 ? te = -ee : G.x + F.width > Q - B && re < Le - Q && (te = ee)), (j.direction === \"y\" || j.direction === \"both\") && (G.y < z && ke > 0 ? ie = -le : G.y + F.height > q - z && ke < P - q && (ie = le)), (te || ie) && D.scrollBy({\n left: te,\n top: ie,\n behavior: \"auto\"\n });\n };\n let de = null;\n const Oe = () => {\n const D = E(f);\n D && !de && (de = setInterval(() => {\n const F = E(e).getBoundingClientRect(), { x: G, y: Q } = L.value, q = {\n x: G - D.scrollLeft,\n y: Q - D.scrollTop\n };\n q.x >= 0 && q.y >= 0 && (ge(D, F, q), q.x += D.scrollLeft, q.y += D.scrollTop, L.value = q);\n }, 1e3 / 60));\n }, Re = () => {\n de && (clearInterval(de), de = null);\n }, Ye = (D, F, G, Q) => {\n const [q, re] = typeof G == \"number\" ? [G, G] : [G.x, G.y], { clientWidth: ke, clientHeight: Le } = F;\n return D.x < q || D.x + Q.width > ke - q || D.y < re || D.y + Q.height > Le - re;\n }, Xe = () => {\n if (E(t.disabled) || !S.value) return;\n const D = E(f);\n if (!D) return;\n const F = E(e).getBoundingClientRect(), { x: G, y: Q } = L.value;\n Ye({\n x: G - D.scrollLeft,\n y: Q - D.scrollTop\n }, D, j.margin, F) ? Oe() : Re();\n };\n E($) && ne(L, Xe);\n const Be = (D) => {\n var F;\n if (!E(I).includes(D.button) || E(t.disabled) || !O(D) || E(i) && D.target !== E(e)) return;\n const G = E(f), Q = G == null || (F = G.getBoundingClientRect) === null || F === void 0 ? void 0 : F.call(G), q = E(e).getBoundingClientRect(), re = {\n x: D.clientX - (G ? q.left - Q.left + ($ ? 0 : G.scrollLeft) : q.left),\n y: D.clientY - (G ? q.top - Q.top + ($ ? 0 : G.scrollTop) : q.top)\n };\n y?.(re, D) !== !1 && (S.value = re, W(D));\n }, je = (D) => {\n if (E(t.disabled) || !O(D) || !S.value) return;\n const F = E(f);\n F instanceof HTMLElement && ro(F);\n const G = E(e).getBoundingClientRect();\n let { x: Q, y: q } = L.value;\n if ((g === \"x\" || g === \"both\") && (Q = D.clientX - S.value.x, F && (Q = Math.min(Math.max(0, Q), F.scrollWidth - G.width))), (g === \"y\" || g === \"both\") && (q = D.clientY - S.value.y, F && (q = Math.min(Math.max(0, q), F.scrollHeight - G.height))), E($) && F && (de === null && ge(F, G, {\n x: Q,\n y: q\n }), Q += F.scrollLeft, q += F.scrollTop), F && (C || $)) {\n if (g !== \"y\") {\n const re = Q - F.scrollLeft;\n re < 0 ? Q = F.scrollLeft : re > F.clientWidth - G.width && (Q = F.clientWidth - G.width + F.scrollLeft);\n }\n if (g !== \"x\") {\n const re = q - F.scrollTop;\n re < 0 ? q = F.scrollTop : re > F.clientHeight - G.height && (q = F.clientHeight - G.height + F.scrollTop);\n }\n }\n L.value = {\n x: Q,\n y: q\n }, d?.(L.value, D), W(D);\n }, Fe = (D) => {\n E(t.disabled) || !O(D) || S.value && (S.value = void 0, $ && Re(), p?.(L.value, D), W(D));\n };\n if (fn) {\n const D = () => {\n var F;\n return {\n capture: (F = t.capture) !== null && F !== void 0 ? F : !0,\n passive: !E(l)\n };\n };\n He(m, \"pointerdown\", Be, D), He(b, \"pointermove\", je, D), He(b, \"pointerup\", Fe, D);\n }\n return {\n ...oo(L),\n position: L,\n isDragging: T(() => !!S.value),\n style: T(() => `\n left: ${L.value.x}px;\n top: ${L.value.y}px;\n ${$ ? \"text-wrap: nowrap;\" : \"\"}\n `)\n };\n}\nfunction dt(e, t, o = {}) {\n const { window: n = et, ...a } = o;\n let r;\n const s = /* @__PURE__ */ vn(() => n && \"ResizeObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const d = E(e);\n return Array.isArray(d) ? d.map((p) => ye(p)) : [ye(d)];\n }), (d) => {\n if (l(), s.value && n) {\n r = new ResizeObserver(t);\n for (const p of d) p && r.observe(p, a);\n }\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => {\n l(), u();\n };\n return Ot(i), {\n isSupported: s,\n stop: i\n };\n}\nfunction _e(e, t = {}) {\n const { reset: o = !0, windowResize: n = !0, windowScroll: a = !0, immediate: r = !0, updateTiming: s = \"sync\" } = t, l = ue(0), u = ue(0), i = ue(0), d = ue(0), p = ue(0), y = ue(0), k = ue(0), g = ue(0);\n function b() {\n const m = ye(e);\n if (!m) {\n o && (l.value = 0, u.value = 0, i.value = 0, d.value = 0, p.value = 0, y.value = 0, k.value = 0, g.value = 0);\n return;\n }\n const I = m.getBoundingClientRect();\n l.value = I.height, u.value = I.bottom, i.value = I.left, d.value = I.right, p.value = I.top, y.value = I.width, k.value = I.x, g.value = I.y;\n }\n function f() {\n s === \"sync\" ? b() : s === \"next-frame\" && requestAnimationFrame(() => b());\n }\n return dt(e, f), ne(() => ye(e), (m) => !m && f()), pn(e, f, { attributeFilter: [\"style\", \"class\"] }), a && He(\"scroll\", f, {\n capture: !0,\n passive: !0\n }), n && He(\"resize\", f, { passive: !0 }), lo(() => {\n r && f();\n }), {\n height: l,\n bottom: u,\n left: i,\n right: d,\n top: p,\n width: y,\n x: k,\n y: g,\n update: f\n };\n}\nfunction bt(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst xt = /* @__PURE__ */ new WeakMap();\nfunction io(e, t = !1) {\n const o = ue(t);\n let n = \"\";\n ne(Qn(e), (s) => {\n const l = bt(E(s));\n if (l) {\n const u = l;\n if (xt.get(u) || xt.set(u, u.style.overflow), u.style.overflow !== \"hidden\" && (n = u.style.overflow), u.style.overflow === \"hidden\") return o.value = !0;\n if (o.value) return u.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = bt(E(e));\n !s || o.value || (s.style.overflow = \"hidden\", o.value = !0);\n }, r = () => {\n const s = bt(E(e));\n !s || !o.value || (s.style.overflow = n, xt.delete(s), o.value = !1);\n };\n return Ot(r), T({\n get() {\n return o.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst uo = (e) => {\n const t = new DOMParser().parseFromString(e, \"text/html\");\n return Array.from(t.body.childNodes).some((o) => o.nodeType === 1);\n}, co = (e = 8) => Array.from({ length: e }, () => Math.floor(Math.random() * 16).toString(16)).join(\"\"), fo = [\"data-colindex\", \"data-rowindex\", \"data-editable\", \"contenteditable\", \"tabindex\"], vo = [\"innerHTML\"], po = { key: 2 }, mo = /* @__PURE__ */ oe({\n __name: \"ACell\",\n props: {\n colIndex: {},\n rowIndex: {},\n store: {},\n addNavigation: { type: [Boolean, Object], default: !0 },\n tabIndex: { default: 0 },\n pinned: { type: Boolean, default: !1 },\n debounce: { default: 300 }\n },\n setup(e, { expose: t }) {\n const o = fe(\"cell\"), n = e.store.getCellData(e.colIndex, e.rowIndex), a = R(\"\"), r = R(!1), s = e.store.columns[e.colIndex], l = e.store.rows[e.rowIndex], u = s.align || \"center\", i = s.width || \"40ch\", d = T(() => e.store.getCellDisplayValue(e.colIndex, e.rowIndex)), p = T(() => typeof d.value == \"string\" ? uo(d.value) : !1), y = T(() => ({\n textAlign: u,\n width: i,\n fontWeight: r.value ? \"bold\" : \"inherit\",\n paddingLeft: e.store.getIndent(e.colIndex, e.store.display[e.rowIndex]?.indent)\n })), k = T(() => ({\n \"sticky-column\": e.pinned,\n \"cell-modified\": r.value\n })), g = () => {\n f(), b();\n }, b = () => {\n const { left: S, bottom: O, width: W, height: pe } = _e(o);\n s.mask, s.modalComponent && e.store.$patch((j) => {\n j.modal.visible = !0, j.modal.colIndex = e.colIndex, j.modal.rowIndex = e.rowIndex, j.modal.left = S, j.modal.bottom = O, j.modal.width = W, j.modal.height = pe, j.modal.cell = o.value, typeof s.modalComponent == \"function\" ? j.modal.component = s.modalComponent({ table: j.table, row: l, column: s }) : j.modal.component = s.modalComponent, j.modal.componentProps = s.modalComponentExtraProps;\n });\n };\n if (e.addNavigation) {\n let S = {\n ...wt,\n \"keydown.f2\": b,\n \"keydown.alt.up\": b,\n \"keydown.alt.down\": b,\n \"keydown.alt.left\": b,\n \"keydown.alt.right\": b\n };\n typeof e.addNavigation == \"object\" && (S = {\n ...S,\n ...e.addNavigation\n }), Pt([\n {\n selectors: o,\n handlers: S\n }\n ]);\n }\n const f = () => {\n if (o.value && s.edit) {\n const S = window.getSelection();\n if (S)\n try {\n const O = document.createRange();\n O.selectNodeContents && (O.selectNodeContents(o.value), S.removeAllRanges(), S.addRange(O));\n } catch {\n }\n }\n }, m = () => {\n o.value && (a.value = o.value.textContent, f());\n }, I = () => {\n try {\n const S = window.getSelection();\n if (S && S.rangeCount > 0 && o.value) {\n const O = S.getRangeAt(0), W = O.cloneRange();\n if (W.selectNodeContents && W.setEnd)\n return W.selectNodeContents(o.value), W.setEnd(O.endContainer, O.endOffset), W.toString().length;\n }\n } catch {\n }\n return 0;\n }, C = (S) => {\n if (o.value)\n try {\n const O = window.getSelection();\n if (!O) return;\n let W = 0;\n const pe = document.createTreeWalker ? document.createTreeWalker(o.value, NodeFilter.SHOW_TEXT, null) : null;\n if (!pe) return;\n let j, J = null;\n for (; j = pe.nextNode(); ) {\n const ge = j, de = W + ge.textContent.length;\n if (S <= de && (J = document.createRange(), J.setStart && J.setEnd)) {\n J.setStart(ge, S - W), J.setEnd(ge, S - W);\n break;\n }\n W = de;\n }\n J && O.removeAllRanges && O.addRange && (O.removeAllRanges(), O.addRange(J));\n } catch {\n }\n }, $ = (S) => {\n if (!s.edit) return;\n const O = S.target;\n if (O.textContent === a.value)\n return;\n const W = I();\n a.value = O.textContent, s.format ? (r.value = O.textContent !== e.store.getFormattedValue(e.colIndex, e.rowIndex, n), e.store.setCellText(e.colIndex, e.rowIndex, O.textContent)) : (r.value = O.textContent !== n, e.store.setCellData(e.colIndex, e.rowIndex, O.textContent)), vt().then(() => {\n C(W);\n });\n }, L = /* @__PURE__ */ no($, e.debounce);\n return t({\n currentData: a\n }), (S, O) => (h(), x(\"td\", {\n ref: \"cell\",\n \"data-colindex\": e.colIndex,\n \"data-rowindex\": e.rowIndex,\n \"data-editable\": V(s).edit,\n contenteditable: V(s).edit,\n tabindex: e.tabIndex,\n spellcheck: !1,\n style: be(y.value),\n class: se([\"atable-cell\", k.value]),\n onFocus: m,\n onPaste: $,\n onInput: O[0] || (O[0] = //@ts-ignore\n (...W) => V(L) && V(L)(...W)),\n onClick: g\n }, [\n V(s).cellComponent ? (h(), me(Ue(V(s).cellComponent), ft({\n key: 0,\n value: d.value\n }, V(s).cellComponentProps), null, 16, [\"value\"])) : p.value ? (h(), x(\"span\", {\n key: 1,\n innerHTML: d.value\n }, null, 8, vo)) : (h(), x(\"span\", po, N(d.value), 1))\n ], 46, fo));\n }\n}), ho = [\"tabindex\"], go = [\"tabindex\"], wo = [\"colspan\"], yo = /* @__PURE__ */ oe({\n __name: \"AExpansionRow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: () => wt }\n },\n setup(e) {\n const t = fe(\"rowEl\"), o = T(() => e.store.display[e.rowIndex].expanded ? \"โผ\" : \"โบ\");\n if (e.addNavigation) {\n const n = {\n \"keydown.control.g\": (a) => {\n a.stopPropagation(), a.preventDefault(), e.store.toggleRowExpand(e.rowIndex);\n }\n };\n typeof e.addNavigation == \"object\" && Object.assign(n, e.addNavigation), Pt([\n {\n selectors: t,\n handlers: n\n }\n ]);\n }\n return (n, a) => (h(), x(X, null, [\n w(\"tr\", ft(n.$attrs, {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"expandable-row\"\n }), [\n w(\"td\", {\n tabIndex: -1,\n class: \"row-index\",\n onClick: a[0] || (a[0] = (r) => e.store.toggleRowExpand(e.rowIndex))\n }, N(o.value), 1),\n he(n.$slots, \"row\", {}, void 0, !0)\n ], 16, ho),\n e.store.display[e.rowIndex].expanded ? (h(), x(\"tr\", {\n key: 0,\n ref: \"rowExpanded\",\n tabindex: e.tabIndex,\n class: \"expanded-row\"\n }, [\n w(\"td\", {\n tabIndex: -1,\n colspan: e.store.columns.length + 1,\n class: \"expanded-row-content\"\n }, [\n he(n.$slots, \"content\", {}, void 0, !0)\n ], 8, wo)\n ], 8, go)) : Y(\"\", !0)\n ], 64));\n }\n}), Ve = (e, t) => {\n const o = e.__vccOpts || e;\n for (const [n, a] of t)\n o[n] = a;\n return o;\n}, bo = /* @__PURE__ */ Ve(yo, [[\"__scopeId\", \"data-v-a42297c7\"]]), xo = [\"colspan\"], ko = {\n ref: \"container\",\n class: \"gantt-container\"\n}, Io = [\"data-rowindex\", \"data-colindex\"], Mo = {\n key: 2,\n class: \"gantt-label\"\n}, Co = [\"x1\", \"y1\", \"x2\", \"y2\"], Eo = /* @__PURE__ */ oe({\n __name: \"AGanttCell\",\n props: {\n store: {},\n columnsCount: {},\n rowIndex: {},\n colIndex: {},\n start: { default: 0 },\n end: { default: 0 },\n colspan: { default: 1 },\n label: { default: \"\" },\n color: { default: \"#cccccc\" }\n },\n emits: [\"connection:create\"],\n setup(e, { expose: t, emit: o }) {\n Cn((P) => ({\n v6d722296: a.value,\n v260b36f8: P.colspan\n }));\n const n = o, a = R(e.color.length >= 6 ? e.color : \"#cccccc\"), r = `gantt-bar-row-${e.rowIndex}-col-${e.colIndex}`, s = fe(\"container\"), l = fe(\"bar\"), u = fe(\"leftResizeHandle\"), i = fe(\"rightResizeHandle\"), d = fe(\"leftConnectionHandle\"), p = fe(\"rightConnectionHandle\"), { width: y } = _e(s), { left: k, right: g } = _e(l), b = R(e.start), f = R(e.end || b.value + e.colspan), m = R(!1), I = R(!1), C = R(!1), $ = R(!1), L = R(!1), S = R({ startX: 0, startY: 0, endX: 0, endY: 0 }), O = T(() => Oe.value || ge.value || de.value), W = T(() => e.colspan > 0 ? y.value / e.colspan : 0), pe = T(() => {\n const P = b.value / e.colspan * 100, B = f.value / e.colspan * 100;\n return {\n left: `${P}%`,\n width: `${B - P}%`,\n backgroundColor: a.value\n };\n }), j = T(\n () => ({\n position: \"fixed\",\n top: 0,\n left: 0,\n width: \"100vw\",\n height: \"100vh\",\n pointerEvents: \"none\",\n zIndex: 1e3\n })\n ), J = R({ startX: 0, startPos: 0 }), { isDragging: ge } = yt(u, {\n axis: \"x\",\n onStart: () => Re(k.value, b.value),\n onMove: ({ x: P }) => Ye(P),\n onEnd: ({ x: P }) => Xe(P)\n }), { isDragging: de } = yt(i, {\n axis: \"x\",\n onStart: () => Re(g.value, f.value),\n onMove: ({ x: P }) => Be(P),\n onEnd: ({ x: P }) => je(P)\n }), { isDragging: Oe } = yt(l, {\n exact: !0,\n axis: \"x\",\n onStart: () => Re(k.value, b.value),\n onMove: ({ x: P }) => Fe(P),\n onEnd: ({ x: P }) => D(P)\n });\n Ee(() => {\n F();\n }), En(() => {\n G();\n });\n function Re(P, B) {\n l.value && (l.value.style.transition = \"none\"), J.value = { startX: P, startPos: B };\n }\n function Ye(P) {\n if (!ge.value || !l.value) return;\n const B = (P - J.value.startX) / W.value, z = Math.max(0, Math.min(f.value - 1, J.value.startPos + B));\n l.value.style.left = `${z / e.colspan * 100}%`, l.value.style.width = `${(f.value - z) / e.colspan * 100}%`;\n }\n function Xe(P) {\n if (!l.value) return;\n const B = P - J.value.startX, z = Math.round(B / W.value), ee = b.value, le = Math.max(0, Math.min(f.value - 1, J.value.startPos + z));\n b.value = le, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"start\",\n oldStart: ee,\n newStart: le,\n end: f.value,\n delta: z,\n oldColspan: f.value - ee,\n newColspan: f.value - le\n });\n }\n function Be(P) {\n if (!de.value || !l.value) return;\n const B = (P - J.value.startX) / W.value, z = Math.max(b.value + 1, Math.min(e.columnsCount, J.value.startPos + B));\n l.value.style.width = `${(z - b.value) / e.colspan * 100}%`;\n }\n function je(P) {\n if (!l.value) return;\n const B = P - J.value.startX, z = Math.round(B / W.value), ee = f.value, le = Math.max(b.value + 1, Math.min(e.columnsCount, J.value.startPos + z));\n f.value = le, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"resize\",\n edge: \"end\",\n oldEnd: ee,\n newEnd: le,\n start: b.value,\n delta: z,\n oldColspan: ee - b.value,\n newColspan: le - b.value\n });\n }\n function Fe(P) {\n if (!Oe.value || !l.value) return;\n const B = (P - J.value.startX) / W.value, z = f.value - b.value, ee = Math.max(0, Math.min(J.value.startPos + B, e.columnsCount - z));\n l.value.style.left = `${ee / e.colspan * 100}%`;\n }\n function D(P) {\n if (!l.value) return;\n const B = P - J.value.startX, z = Math.round(B / W.value), ee = f.value - b.value, le = b.value, te = f.value;\n let ie = J.value.startPos + z, ce = ie + ee;\n ie < 0 ? (ie = 0, ce = ee) : ce > e.columnsCount && (ce = e.columnsCount, ie = ce - ee), b.value = ie, f.value = ce, e.store.updateGanttBar({\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n type: \"bar\",\n oldStart: le,\n oldEnd: te,\n newStart: ie,\n newEnd: ce,\n delta: z,\n colspan: ce - ie\n });\n }\n function F() {\n const { x: P, y: B } = _e(l), { x: z, y: ee } = _e(d), { x: le, y: te } = _e(p);\n e.store.registerGanttBar({\n id: r,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n startIndex: b,\n endIndex: f,\n color: a,\n label: e.label,\n position: { x: P, y: B }\n }), e.store.isDependencyGraphEnabled && (e.store.registerConnectionHandle({\n id: `${r}-connection-left`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"left\",\n position: { x: z, y: ee },\n visible: m,\n barId: r\n }), e.store.registerConnectionHandle({\n id: `${r}-connection-right`,\n rowIndex: e.rowIndex,\n colIndex: e.colIndex,\n side: \"right\",\n position: { x: le, y: te },\n visible: I,\n barId: r\n }));\n }\n function G() {\n e.store.unregisterGanttBar(r), e.store.isDependencyGraphEnabled && (e.store.unregisterConnectionHandle(`${r}-connection-left`), e.store.unregisterConnectionHandle(`${r}-connection-right`));\n }\n function Q() {\n e.store.isDependencyGraphEnabled && (m.value = !0, I.value = !0);\n }\n function q() {\n !C.value && !$.value && (m.value = !1, I.value = !1);\n }\n function re(P, B) {\n B.preventDefault(), B.stopPropagation(), L.value = !0, P === \"left\" ? C.value = !0 : $.value = !0;\n const z = P === \"left\" ? d.value : p.value;\n if (z) {\n const te = z.getBoundingClientRect(), ie = te.left + te.width / 2, ce = te.top + te.height / 2;\n S.value = { startX: ie, startY: ce, endX: ie, endY: ce };\n }\n const ee = (te) => {\n S.value.endX = te.clientX, S.value.endY = te.clientY;\n }, le = (te) => {\n ke(te, P), Le(ee, le);\n };\n document.addEventListener(\"mousemove\", ee), document.addEventListener(\"mouseup\", le);\n }\n function ke(P, B) {\n const z = document.elementFromPoint(P.clientX, P.clientY)?.closest(\".connection-handle\");\n if (z && z !== (B === \"left\" ? d.value : p.value)) {\n const ee = z.closest(\".gantt-bar\");\n if (ee) {\n const le = parseInt(ee.getAttribute(\"data-rowindex\") || \"0\"), te = parseInt(ee.getAttribute(\"data-colindex\") || \"0\"), ie = z.classList.contains(\"left-connection-handle\") ? \"left\" : \"right\", ce = `gantt-bar-row-${le}-col-${te}`, c = e.store.createConnection(\n `${r}-connection-${B}`,\n `${ce}-connection-${ie}`\n );\n c && n(\"connection:create\", c);\n }\n }\n }\n function Le(P, B) {\n L.value = !1, C.value = !1, $.value = !1, document.removeEventListener(\"mousemove\", P), document.removeEventListener(\"mouseup\", B), l.value?.matches(\":hover\") || q();\n }\n return t({\n barStyle: pe,\n cleanupConnectionDrag: Le,\n currentEnd: f,\n handleConnectionDrop: ke,\n isLeftConnectionDragging: C,\n isLeftConnectionVisible: m,\n isRightConnectionDragging: $,\n isRightConnectionVisible: I,\n showDragPreview: L\n }), (P, B) => (h(), x(\"td\", {\n class: \"aganttcell\",\n colspan: e.colspan\n }, [\n w(\"div\", ko, [\n w(\"div\", {\n ref: \"bar\",\n \"data-rowindex\": e.rowIndex,\n \"data-colindex\": e.colIndex,\n class: se([\"gantt-bar\", { \"is-dragging\": O.value }]),\n style: be(pe.value),\n onMouseenter: Q,\n onMouseleave: q\n }, [\n e.store.isDependencyGraphEnabled ? (h(), x(\"div\", {\n key: 0,\n ref: \"leftConnectionHandle\",\n class: se([\"connection-handle left-connection-handle\", { visible: m.value, \"is-dragging\": C.value }]),\n onMousedown: B[0] || (B[0] = Ie((z) => re(\"left\", z), [\"stop\"]))\n }, [...B[2] || (B[2] = [\n w(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : Y(\"\", !0),\n e.store.isDependencyGraphEnabled ? (h(), x(\"div\", {\n key: 1,\n ref: \"rightConnectionHandle\",\n class: se([\"connection-handle right-connection-handle\", { visible: I.value, \"is-dragging\": $.value }]),\n onMousedown: B[1] || (B[1] = Ie((z) => re(\"right\", z), [\"stop\"]))\n }, [...B[3] || (B[3] = [\n w(\"div\", { class: \"connection-dot\" }, null, -1)\n ])], 34)) : Y(\"\", !0),\n w(\"div\", {\n ref: \"leftResizeHandle\",\n class: se([\"resize-handle left-resize-handle\", { \"is-dragging\": V(ge) }])\n }, [...B[4] || (B[4] = [\n w(\"div\", { class: \"handle-grip\" }, null, -1),\n w(\"div\", { class: \"vertical-indicator left-indicator\" }, null, -1)\n ])], 2),\n e.label ? (h(), x(\"label\", Mo, N(e.label), 1)) : Y(\"\", !0),\n w(\"div\", {\n ref: \"rightResizeHandle\",\n class: se([\"resize-handle right-resize-handle\", { \"is-dragging\": V(de) }])\n }, [...B[5] || (B[5] = [\n w(\"div\", { class: \"handle-grip\" }, null, -1),\n w(\"div\", { class: \"vertical-indicator right-indicator\" }, null, -1)\n ])], 2)\n ], 46, Io)\n ], 512),\n e.store.isDependencyGraphEnabled && L.value ? (h(), x(\"svg\", {\n key: 0,\n style: be(j.value)\n }, [\n w(\"line\", {\n x1: S.value.startX,\n y1: S.value.startY,\n x2: S.value.endX,\n y2: S.value.endY,\n stroke: \"#2196f3\",\n \"stroke-width\": \"2\",\n \"stroke-dasharray\": \"5,5\"\n }, null, 8, Co)\n ], 4)) : Y(\"\", !0)\n ], 8, xo));\n }\n}), Ao = /* @__PURE__ */ Ve(Eo, [[\"__scopeId\", \"data-v-8917a8a3\"]]), $o = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"34 18 30 18 30 30 18 30 18 34 30 34 30 46 34 46 34 34 46 34 46 30 34 30 34 18\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>\n`, To = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 64 64\">\n <path d=\"M32,64C14.35,64,0,49.65,0,32S14.35,0,32,0s32,14.35,32,32-14.35,32-32,32ZM32,4c-15.44,0-28,12.56-28,28s12.56,28,28,28,28-12.56,28-28S47.44,4,32,4Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"46.84 19.99 44.01 17.16 32 29.17 19.99 17.16 17.16 19.99 29.17 32 17.16 44.01 19.99 46.84 32 34.83 44.01 46.84 46.84 44.01 34.83 32 46.84 19.99\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Do = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.67\">\n <path d=\"M68.67,16.67h-14.67V2c0-1.1-.9-2-2-2H2C.9,0,0,.9,0,2v50c0,1.1.9,2,2,2h14.67v14.67c0,1.1.9,2,2,2h50c1.1,0,2-.9,2-2V18.67c0-1.1-.9-2-2-2ZM4,4h46v46H4V4ZM66.67,66.67H20.67v-12.67h31.33c1.1,0,2-.9,2-2v-31.33h12.67v46Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n <polygon points=\"41 25 29 25 29 13 25 13 25 25 13 25 13 29 25 29 25 41 29 41 29 29 41 29 41 25\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, So = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <path d=\"M68.6,45.8v13.7H2v-13.7h66.6M70.6,43.8H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,24.2v13.7H2v-13.7h66.6M70.6,22.2H0v17.7h70.6v-17.7h0Z\"/>\n <g>\n <polygon points=\"70.6 2.5 68.6 2.5 68.6 2 68.1 2 68.1 0 70.6 0 70.6 2.5\"/>\n <path d=\"M65.3,2h-2.9V0h2.9v2ZM59.6,2h-2.9V0h2.9v2ZM53.9,2h-2.9V0h2.9v2ZM48.2,2h-2.9V0h2.9v2ZM42.4,2h-2.9V0h2.9v2ZM36.7,2h-2.9V0h2.9v2ZM31,2h-2.9V0h2.9v2ZM25.3,2h-2.9V0h2.9v2ZM19.6,2h-2.9V0h2.9v2ZM13.9,2h-2.9V0h2.9v2ZM8.2,2h-2.9V0h2.9v2Z\"/>\n <polygon points=\"2 2.5 0 2.5 0 0 2.5 0 2.5 2 2 2 2 2.5\"/>\n <path d=\"M2,13.4H0v-2.7h2v2.7ZM2,8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 18.7 0 18.7 0 16.2 2 16.2 2 16.7 2.5 16.7 2.5 18.7\"/>\n <path d=\"M65.3,18.7h-2.9v-2h2.9v2ZM59.6,18.7h-2.9v-2h2.9v2ZM53.9,18.7h-2.9v-2h2.9v2ZM48.2,18.7h-2.9v-2h2.9v2ZM42.4,18.7h-2.9v-2h2.9v2ZM36.7,18.7h-2.9v-2h2.9v2ZM31,18.7h-2.9v-2h2.9v2ZM25.3,18.7h-2.9v-2h2.9v2ZM19.6,18.7h-2.9v-2h2.9v2ZM13.9,18.7h-2.9v-2h2.9v2ZM8.2,18.7h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 18.7 68.1 18.7 68.1 16.7 68.6 16.7 68.6 16.2 70.6 16.2 70.6 18.7\"/>\n <path d=\"M70.6,13.4h-2v-2.7h2v2.7ZM70.6,8h-2v-2.7h2v2.7Z\"/>\n </g>\n</svg>`, Ro = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" viewBox=\"0 0 70.6 61.5\">\n <g>\n <polygon points=\"70.6 45.3 68.6 45.3 68.6 44.8 68.1 44.8 68.1 42.8 70.6 42.8 70.6 45.3\"/>\n <path d=\"M65.3,44.8h-2.9v-2h2.9v2ZM59.6,44.8h-2.9v-2h2.9v2ZM53.9,44.8h-2.9v-2h2.9v2ZM48.2,44.8h-2.9v-2h2.9v2ZM42.4,44.8h-2.9v-2h2.9v2ZM36.7,44.8h-2.9v-2h2.9v2ZM31,44.8h-2.9v-2h2.9v2ZM25.3,44.8h-2.9v-2h2.9v2ZM19.6,44.8h-2.9v-2h2.9v2ZM13.9,44.8h-2.9v-2h2.9v2ZM8.2,44.8h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"2 45.3 0 45.3 0 42.8 2.5 42.8 2.5 44.8 2 44.8 2 45.3\"/>\n <path d=\"M2,56.3H0v-2.7h2v2.7ZM2,50.8H0v-2.7h2v2.7Z\"/>\n <polygon points=\"2.5 61.5 0 61.5 0 59 2 59 2 59.5 2.5 59.5 2.5 61.5\"/>\n <path d=\"M65.3,61.5h-2.9v-2h2.9v2ZM59.6,61.5h-2.9v-2h2.9v2ZM53.9,61.5h-2.9v-2h2.9v2ZM48.2,61.5h-2.9v-2h2.9v2ZM42.4,61.5h-2.9v-2h2.9v2ZM36.7,61.5h-2.9v-2h2.9v2ZM31,61.5h-2.9v-2h2.9v2ZM25.3,61.5h-2.9v-2h2.9v2ZM19.6,61.5h-2.9v-2h2.9v2ZM13.9,61.5h-2.9v-2h2.9v2ZM8.2,61.5h-2.9v-2h2.9v2Z\"/>\n <polygon points=\"70.6 61.5 68.1 61.5 68.1 59.5 68.6 59.5 68.6 59 70.6 59 70.6 61.5\"/>\n <path d=\"M70.6,56.3h-2v-2.7h2v2.7ZM70.6,50.8h-2v-2.7h2v2.7Z\"/>\n </g>\n <path d=\"M68.6,23.7v13.7H2v-13.7h66.6M70.6,21.7H0v17.7h70.6v-17.7h0Z\"/>\n <path d=\"M68.6,2v13.7H2V2h66.6M70.6,0H0v17.7h70.6V0h0Z\"/>\n</svg>`, Lo = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg id=\"Layer_1\" data-name=\"Layer 1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 70.67 70.64\">\n <path d=\"M70.08,33.9l-9.75-9.75-2.83,2.83,6.33,6.33h-26.51V6.81l6.33,6.33,2.83-2.83L36.75.56c-.75-.75-2.08-.75-2.83,0l-9.75,9.75,2.83,2.83,6.33-6.33v26.5H6.83l6.33-6.33-2.83-2.83L.59,33.9c-.38.38-.59.88-.59,1.41s.21,1.04.59,1.41l9.75,9.75,2.83-2.83-6.33-6.33h26.5v26.51l-6.33-6.33-2.83,2.83,9.75,9.75c.38.38.88.59,1.41.59s1.04-.21,1.41-.59l9.75-9.75-2.83-2.83-6.33,6.33v-26.51h26.51l-6.33,6.33,2.83,2.83,9.75-9.75c.38-.38.59-.88.59-1.41s-.21-1.04-.59-1.41Z\" style=\"fill: #000; stroke-width: 0px;\"/>\n</svg>`, Ho = {\n add: $o,\n delete: To,\n duplicate: Do,\n insertAbove: So,\n insertBelow: Ro,\n move: Lo\n}, Vo = {\n key: 0,\n class: \"row-actions-dropdown\"\n}, _o = [\"aria-expanded\"], Po = [\"onClick\"], Oo = [\"innerHTML\"], Bo = { class: \"action-label\" }, Fo = {\n key: 1,\n class: \"row-actions-icons\"\n}, Zo = [\"title\", \"aria-label\", \"onClick\"], No = [\"innerHTML\"], it = /* @__PURE__ */ oe({\n __name: \"ARowActions\",\n props: {\n rowIndex: {},\n store: {},\n config: {},\n position: {}\n },\n emits: [\"action\"],\n setup(e, { emit: t }) {\n const o = e, n = t, a = fe(\"actionsCell\"), r = fe(\"toggleButton\"), s = R(0), l = R(!1), u = R(!1), i = R({ top: 0, left: 0 }), d = {\n add: \"Add Row\",\n delete: \"Delete Row\",\n duplicate: \"Duplicate Row\",\n insertAbove: \"Insert Above\",\n insertBelow: \"Insert Below\",\n move: \"Move Row\"\n }, p = T(() => {\n const m = [], I = o.config.actions || {}, C = [\"add\", \"delete\", \"duplicate\", \"insertAbove\", \"insertBelow\", \"move\"];\n for (const $ of C) {\n const L = I[$];\n if (L === !1 || L === void 0) continue;\n let S = !0, O = d[$], W = Ho[$];\n typeof L == \"object\" && (S = L.enabled !== !1, O = L.label || O, W = L.icon || W), S && m.push({ type: $, label: O, icon: W });\n }\n return m;\n }), y = T(() => {\n if (o.config.forceDropdown) return !0;\n const m = o.config.dropdownThreshold ?? 150;\n return m === 0 ? !1 : s.value > 0 && s.value < m;\n }), k = T(() => l.value ? u.value ? {\n position: \"fixed\",\n bottom: `${window.innerHeight - i.value.top}px`,\n left: `${i.value.left}px`,\n top: \"auto\"\n } : {\n position: \"fixed\",\n top: `${i.value.top}px`,\n left: `${i.value.left}px`\n } : {});\n dt(a, (m) => {\n const I = m[0];\n I && (s.value = I.contentRect.width);\n });\n const g = () => {\n l.value || b(), l.value = !l.value;\n }, b = () => {\n if (!r.value) return;\n const m = r.value.getBoundingClientRect(), I = window.innerHeight, C = p.value.length * 40 + 16, $ = I - m.bottom, L = m.top;\n u.value = $ < C && L > C, u.value ? i.value = {\n top: m.top,\n left: m.left\n } : i.value = {\n top: m.bottom,\n left: m.left\n };\n };\n Tt(a, () => {\n l.value = !1;\n });\n const f = (m) => {\n l.value = !1;\n const I = o.config.actions?.[m];\n typeof I == \"object\" && I.handler && I.handler(o.rowIndex, o.store) === !1 || n(\"action\", m, o.rowIndex);\n };\n return (m, I) => (h(), x(\"td\", {\n ref: \"actionsCell\",\n class: se([\"atable-row-actions\", { \"sticky-column\": e.position === \"before-index\", \"dropdown-active\": l.value }])\n }, [\n y.value ? (h(), x(\"div\", Vo, [\n w(\"button\", {\n ref: \"toggleButton\",\n type: \"button\",\n class: \"row-actions-toggle\",\n \"aria-expanded\": l.value,\n \"aria-haspopup\": \"true\",\n onClick: Ie(g, [\"stop\"])\n }, [...I[0] || (I[0] = [\n w(\"span\", { class: \"dropdown-icon\" }, \"โฎ\", -1)\n ])], 8, _o),\n K(w(\"div\", {\n class: se([\"row-actions-menu\", { \"menu-flipped\": u.value }]),\n style: be(k.value),\n role: \"menu\"\n }, [\n (h(!0), x(X, null, ve(p.value, (C) => (h(), x(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-menu-item\",\n role: \"menuitem\",\n onClick: Ie(($) => f(C.type), [\"stop\"])\n }, [\n w(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, Oo),\n w(\"span\", Bo, N(C.label), 1)\n ], 8, Po))), 128))\n ], 6), [\n [Ce, l.value]\n ])\n ])) : (h(), x(\"div\", Fo, [\n (h(!0), x(X, null, ve(p.value, (C) => (h(), x(\"button\", {\n key: C.type,\n type: \"button\",\n class: \"row-action-btn\",\n title: C.label,\n \"aria-label\": C.label,\n onClick: Ie(($) => f(C.type), [\"stop\"])\n }, [\n w(\"span\", {\n class: \"action-icon\",\n innerHTML: C.icon\n }, null, 8, No)\n ], 8, Zo))), 128))\n ]))\n ], 2));\n }\n}), Uo = [\"tabindex\"], Wo = /* @__PURE__ */ oe({\n __name: \"ARow\",\n props: {\n rowIndex: {},\n store: {},\n tabIndex: { default: () => -1 },\n addNavigation: { type: [Boolean, Object], default: !1 }\n },\n emits: [\"row:action\"],\n setup(e, { emit: t }) {\n const o = t, n = fe(\"rowEl\"), a = T(() => e.store.isRowVisible(e.rowIndex)), r = T(() => e.store.getRowExpandSymbol(e.rowIndex)), s = T(() => e.store.config.rowActions || { enabled: !1 }), l = T(() => s.value.enabled), u = T(() => s.value.position || \"before-index\"), i = (d, p) => {\n o(\"row:action\", d, p);\n };\n if (e.addNavigation) {\n let d = wt;\n typeof e.addNavigation == \"object\" && (d = {\n ...d,\n ...e.addNavigation\n }), Pt([\n {\n selectors: n,\n handlers: d\n }\n ]);\n }\n return (d, p) => K((h(), x(\"tr\", {\n ref: \"rowEl\",\n tabindex: e.tabIndex,\n class: \"atable-row\"\n }, [\n l.value && u.value === \"before-index\" ? (h(), me(it, {\n key: 0,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: u.value,\n onAction: i\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : Y(\"\", !0),\n e.store.config.view !== \"uncounted\" ? he(d.$slots, \"index\", { key: 1 }, () => [\n e.store.config.view === \"list\" ? (h(), x(\"td\", {\n key: 0,\n tabIndex: -1,\n class: se([\"list-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"])\n }, N(e.rowIndex + 1), 3)) : e.store.isTreeView ? (h(), x(\"td\", {\n key: 1,\n tabIndex: -1,\n class: se([\"tree-index\", e.store.hasPinnedColumns ? \"sticky-index\" : \"\"]),\n onClick: p[0] || (p[0] = (y) => e.store.toggleRowExpand(e.rowIndex))\n }, N(r.value), 3)) : Y(\"\", !0)\n ], !0) : Y(\"\", !0),\n l.value && u.value === \"after-index\" ? (h(), me(it, {\n key: 2,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: u.value,\n onAction: i\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : Y(\"\", !0),\n he(d.$slots, \"default\", {}, void 0, !0),\n l.value && u.value === \"end\" ? (h(), me(it, {\n key: 3,\n \"row-index\": e.rowIndex,\n store: e.store,\n config: s.value,\n position: u.value,\n onAction: i\n }, null, 8, [\"row-index\", \"store\", \"config\", \"position\"])) : Y(\"\", !0)\n ], 8, Uo)), [\n [Ce, a.value]\n ]);\n }\n}), mn = /* @__PURE__ */ Ve(Wo, [[\"__scopeId\", \"data-v-2e038a9c\"]]), kt = /* @__PURE__ */ new WeakMap(), Go = {\n mounted(e, t) {\n const o = !t.modifiers.bubble;\n let n;\n if (typeof t.value == \"function\") n = Tt(e, t.value, { capture: o });\n else {\n const [a, r] = t.value;\n n = Tt(e, a, Object.assign({ capture: o }, r));\n }\n kt.set(e, n);\n },\n unmounted(e) {\n const t = kt.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), kt.delete(e);\n }\n}, zo = { mounted(e, t) {\n typeof t.value == \"function\" ? dt(e, t.value) : dt(e, ...t.value);\n} };\nfunction qo() {\n let e = !1;\n const t = ue(!1);\n return (o, n) => {\n if (t.value = n.value, e) return;\n e = !0;\n const a = io(o, n.value);\n ne(t, (r) => a.value = r);\n };\n}\nqo();\nconst Yo = { class: \"gantt-connection-overlay\" }, Xo = {\n class: \"connection-svg\",\n style: {\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n pointerEvents: \"none\",\n zIndex: 1\n }\n}, jo = [\"d\", \"stroke-width\", \"onDblclick\"], Jo = [\"id\", \"d\", \"stroke\", \"stroke-width\", \"onDblclick\"], Qo = 0.25, lt = 16, Ko = /* @__PURE__ */ oe({\n __name: \"AGanttConnection\",\n props: {\n store: {}\n },\n emits: [\"connection:delete\"],\n setup(e, { emit: t }) {\n const o = t, n = T(() => e.store.connectionPaths.filter((s) => {\n const l = e.store.ganttBars.find((i) => i.id === s.from.barId), u = e.store.ganttBars.find((i) => i.id === s.to.barId);\n return l && u;\n })), a = (s) => {\n const l = e.store.connectionHandles.find(\n (O) => O.barId === s.from.barId && O.side === s.from.side\n ), u = e.store.connectionHandles.find(\n (O) => O.barId === s.to.barId && O.side === s.to.side\n );\n if (!l || !u) return \"\";\n const i = l.position.x + lt / 2, d = l.position.y + lt / 2, p = u.position.x + lt / 2, y = u.position.y + lt / 2, k = Math.abs(p - i), g = Math.max(k * Qo, 50), b = i + (s.from.side === \"left\" ? -g : g), f = p + (s.to.side === \"left\" ? -g : g), m = { x: 0.5 * i + 0.5 * b, y: 0.5 * d + 0.5 * d }, I = { x: 0.5 * b + 0.5 * f, y: 0.5 * d + 0.5 * y }, C = { x: 0.5 * f + 0.5 * p, y: 0.5 * y + 0.5 * y }, $ = { x: 0.5 * m.x + 0.5 * I.x, y: 0.5 * m.y + 0.5 * I.y }, L = { x: 0.5 * I.x + 0.5 * C.x, y: 0.5 * I.y + 0.5 * C.y }, S = { x: 0.5 * $.x + 0.5 * L.x, y: 0.5 * $.y + 0.5 * L.y };\n return `M ${i} ${d} Q ${b} ${d}, ${S.x} ${S.y} Q ${f} ${y}, ${p} ${y}`;\n }, r = (s) => {\n e.store.deleteConnection(s.id) && o(\"connection:delete\", s);\n };\n return (s, l) => (h(), x(\"div\", Yo, [\n (h(), x(\"svg\", Xo, [\n l[0] || (l[0] = w(\"defs\", null, [\n w(\"path\", {\n id: \"arrowhead\",\n d: \"M 0 -7 L 20 0 L 0 7Z\",\n stroke: \"black\",\n \"stroke-width\": \"1\",\n fill: \"currentColor\"\n }),\n w(\"marker\", {\n id: \"arrowhead-marker\",\n markerWidth: \"10\",\n markerHeight: \"7\",\n refX: \"5\",\n refY: \"3.5\",\n orient: \"auto\",\n markerUnits: \"strokeWidth\"\n }, [\n w(\"polygon\", {\n points: \"0 0, 10 3.5, 0 7\",\n fill: \"currentColor\"\n })\n ])\n ], -1)),\n (h(!0), x(X, null, ve(n.value, (u) => (h(), x(\"path\", {\n key: `${u.id}-hitbox`,\n d: a(u),\n stroke: \"transparent\",\n \"stroke-width\": (u.style?.width || 2) + 10,\n fill: \"none\",\n class: \"connection-hitbox\",\n onDblclick: (i) => r(u)\n }, null, 40, jo))), 128)),\n (h(!0), x(X, null, ve(n.value, (u) => (h(), x(\"path\", {\n id: u.id,\n key: u.id,\n d: a(u),\n stroke: u.style?.color || \"#666\",\n \"stroke-width\": u.style?.width || 2,\n fill: \"none\",\n \"marker-mid\": \"url(#arrowhead-marker)\",\n class: \"connection-path animated-path\",\n onDblclick: (i) => r(u)\n }, null, 40, Jo))), 128))\n ]))\n ]));\n }\n}), el = /* @__PURE__ */ Ve(Ko, [[\"__scopeId\", \"data-v-71911260\"]]), tl = { class: \"column-filter\" }, nl = {\n key: 2,\n class: \"checkbox-filter\"\n}, ol = [\"value\"], ll = {\n key: 5,\n class: \"date-range-filter\"\n}, al = /* @__PURE__ */ oe({\n __name: \"ATableColumnFilter\",\n props: {\n column: {},\n colIndex: {},\n store: {}\n },\n setup(e) {\n const t = R(\"\"), o = sn({\n startValue: \"\",\n endValue: \"\"\n }), n = (u) => {\n if (u.filterOptions) return u.filterOptions;\n const i = /* @__PURE__ */ new Set();\n return e.store.rows.forEach((d) => {\n const p = d[u.name];\n p != null && p !== \"\" && i.add(p);\n }), Array.from(i).map((d) => ({\n value: d,\n label: String(d)\n }));\n }, a = T(() => !!(t.value || o.startValue || o.endValue)), r = (u) => {\n !u && e.column.filterType !== \"checkbox\" ? (e.store.clearFilter(e.colIndex), t.value = \"\") : (t.value = u, e.store.setFilter(e.colIndex, { value: u }));\n }, s = (u, i) => {\n u === \"start\" ? o.startValue = i : o.endValue = i, !o.startValue && !o.endValue ? e.store.clearFilter(e.colIndex) : e.store.setFilter(e.colIndex, {\n value: null,\n startValue: o.startValue,\n endValue: o.endValue\n });\n }, l = () => {\n t.value = \"\", o.startValue = \"\", o.endValue = \"\", e.store.clearFilter(e.colIndex);\n };\n return (u, i) => (h(), x(\"div\", tl, [\n (e.column.filterType || \"text\") === \"text\" ? K((h(), x(\"input\", {\n key: 0,\n \"onUpdate:modelValue\": i[0] || (i[0] = (d) => t.value = d),\n type: \"text\",\n class: \"filter-input\",\n onInput: i[1] || (i[1] = (d) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"number\" ? K((h(), x(\"input\", {\n key: 1,\n \"onUpdate:modelValue\": i[2] || (i[2] = (d) => t.value = d),\n type: \"number\",\n class: \"filter-input\",\n onInput: i[3] || (i[3] = (d) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"checkbox\" ? (h(), x(\"label\", nl, [\n K(w(\"input\", {\n \"onUpdate:modelValue\": i[4] || (i[4] = (d) => t.value = d),\n type: \"checkbox\",\n class: \"filter-checkbox\",\n onChange: i[5] || (i[5] = (d) => r(t.value))\n }, null, 544), [\n [rn, t.value]\n ]),\n w(\"span\", null, N(e.column.label), 1)\n ])) : e.column.filterType === \"select\" ? K((h(), x(\"select\", {\n key: 3,\n \"onUpdate:modelValue\": i[6] || (i[6] = (d) => t.value = d),\n class: \"filter-select\",\n onChange: i[7] || (i[7] = (d) => r(t.value))\n }, [\n i[15] || (i[15] = w(\"option\", { value: \"\" }, \"All\", -1)),\n (h(!0), x(X, null, ve(n(e.column), (d) => (h(), x(\"option\", {\n key: d.value || d,\n value: d.value || d\n }, N(d.label || d), 9, ol))), 128))\n ], 544)), [\n [Mn, t.value]\n ]) : e.column.filterType === \"date\" ? K((h(), x(\"input\", {\n key: 4,\n \"onUpdate:modelValue\": i[8] || (i[8] = (d) => t.value = d),\n type: \"date\",\n class: \"filter-input\",\n onChange: i[9] || (i[9] = (d) => r(t.value))\n }, null, 544)), [\n [we, t.value]\n ]) : e.column.filterType === \"dateRange\" ? (h(), x(\"div\", ll, [\n K(w(\"input\", {\n \"onUpdate:modelValue\": i[10] || (i[10] = (d) => o.startValue = d),\n type: \"date\",\n class: \"filter-input\",\n onChange: i[11] || (i[11] = (d) => s(\"start\", o.startValue))\n }, null, 544), [\n [we, o.startValue]\n ]),\n i[16] || (i[16] = w(\"span\", { class: \"date-separator\" }, \"-\", -1)),\n K(w(\"input\", {\n \"onUpdate:modelValue\": i[12] || (i[12] = (d) => o.endValue = d),\n type: \"date\",\n class: \"filter-input\",\n onChange: i[13] || (i[13] = (d) => s(\"end\", o.endValue))\n }, null, 544), [\n [we, o.endValue]\n ])\n ])) : e.column.filterType === \"component\" && e.column.filterComponent ? (h(), me(Ue(e.column.filterComponent), {\n key: 6,\n value: t.value,\n column: e.column,\n colIndex: e.colIndex,\n store: e.store,\n \"onUpdate:value\": i[14] || (i[14] = (d) => r(d))\n }, null, 40, [\"value\", \"column\", \"colIndex\", \"store\"])) : Y(\"\", !0),\n a.value ? (h(), x(\"button\", {\n key: 7,\n onClick: l,\n class: \"clear-btn\",\n title: \"Clear\"\n }, \"ร\")) : Y(\"\", !0)\n ]));\n }\n}), sl = /* @__PURE__ */ Ve(al, [[\"__scopeId\", \"data-v-8487462d\"]]), rl = { key: 0 }, il = {\n class: \"atable-header-row\",\n tabindex: \"-1\"\n}, ul = {\n key: 2,\n class: \"row-actions-header\"\n}, cl = [\"data-colindex\", \"onClick\"], dl = {\n key: 3,\n class: \"row-actions-header\"\n}, fl = {\n key: 0,\n class: \"atable-filters-row\"\n}, vl = {\n key: 2,\n class: \"row-actions-header\"\n}, pl = {\n key: 3,\n class: \"row-actions-header\"\n}, hn = /* @__PURE__ */ oe({\n __name: \"ATableHeader\",\n props: {\n columns: {},\n store: {}\n },\n setup(e) {\n const t = e, o = T(() => t.columns.filter((l) => l.filterable)), n = T(() => t.store.config.value?.rowActions?.enabled ?? !1), a = T(() => t.store.config.value?.rowActions?.position ?? \"before-index\"), r = (l) => t.store.sortByColumn(l), s = (l) => {\n for (const u of l) {\n if (u.borderBoxSize.length === 0) continue;\n const i = u.borderBoxSize[0].inlineSize, d = Number(u.target.dataset.colindex), p = t.store.columns[d]?.width;\n typeof p == \"number\" && p !== i && t.store.resizeColumn(d, i);\n }\n };\n return (l, u) => t.columns.length ? (h(), x(\"thead\", rl, [\n w(\"tr\", il, [\n n.value && a.value === \"before-index\" ? (h(), x(\"th\", {\n key: 0,\n class: se([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : Y(\"\", !0),\n t.store.zeroColumn ? (h(), x(\"th\", {\n key: 1,\n id: \"header-index\",\n class: se([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : Y(\"\", !0),\n n.value && a.value === \"after-index\" ? (h(), x(\"th\", ul)) : Y(\"\", !0),\n (h(!0), x(X, null, ve(t.columns, (i, d) => K((h(), x(\"th\", {\n key: i.name,\n \"data-colindex\": d,\n tabindex: \"-1\",\n style: be(t.store.getHeaderCellStyle(i)),\n class: se(`${i.pinned ? \"sticky-column\" : \"\"} ${i.sortable === !1 ? \"\" : \"cursor-pointer\"}`),\n onClick: (p) => i.sortable !== !1 ? r(d) : void 0\n }, [\n he(l.$slots, \"default\", {}, () => [\n Dt(N(i.label || String.fromCharCode(d + 97).toUpperCase()), 1)\n ])\n ], 14, cl)), [\n [V(zo), s]\n ])), 128)),\n n.value && a.value === \"end\" ? (h(), x(\"th\", dl)) : Y(\"\", !0)\n ]),\n o.value.length > 0 ? (h(), x(\"tr\", fl, [\n n.value && a.value === \"before-index\" ? (h(), x(\"th\", {\n key: 0,\n class: se([\"row-actions-header\", { \"sticky-column\": a.value === \"before-index\" }])\n }, null, 2)) : Y(\"\", !0),\n t.store.zeroColumn ? (h(), x(\"th\", {\n key: 1,\n class: se([[\n t.store.hasPinnedColumns ? \"sticky-index\" : \"\",\n t.store.isTreeView ? \"tree-index\" : \"\",\n t.store.config.view === \"list-expansion\" ? \"list-expansion-index\" : \"\"\n ], \"list-index\"])\n }, null, 2)) : Y(\"\", !0),\n n.value && a.value === \"after-index\" ? (h(), x(\"th\", vl)) : Y(\"\", !0),\n (h(!0), x(X, null, ve(t.columns, (i, d) => (h(), x(\"th\", {\n key: `filter-${i.name}`,\n class: se(`${i.pinned ? \"sticky-column\" : \"\"}`),\n style: be(t.store.getHeaderCellStyle(i))\n }, [\n i.filterable ? (h(), me(sl, {\n key: 0,\n column: i,\n \"col-index\": d,\n store: t.store\n }, null, 8, [\"column\", \"col-index\", \"store\"])) : Y(\"\", !0)\n ], 6))), 128)),\n n.value && a.value === \"end\" ? (h(), x(\"th\", pl)) : Y(\"\", !0)\n ])) : Y(\"\", !0)\n ])) : Y(\"\", !0);\n }\n}), gn = /* @__PURE__ */ oe({\n __name: \"ATableModal\",\n props: {\n store: {}\n },\n setup(e) {\n const t = fe(\"amodal\"), { width: o, height: n } = _e(t), a = T(() => {\n if (!(e.store.modal.height && e.store.modal.width && e.store.modal.left && e.store.modal.bottom)) return;\n const r = e.store.modal.cell?.closest(\"table\");\n if (!r) return {};\n const s = r.offsetHeight || 0, l = r.offsetWidth || 0;\n let u = e.store.modal.cell?.offsetTop || 0;\n const i = r.querySelector(\"thead\")?.offsetHeight || 0;\n u += i, u = u + n.value < s ? u : u - (n.value + e.store.modal.height);\n let d = e.store.modal.cell?.offsetLeft || 0;\n return d = d + o.value <= l ? d : d - (o.value - e.store.modal.width), {\n left: `${d}px`,\n top: `${u}px`\n };\n });\n return (r, s) => (h(), x(\"div\", {\n ref: \"amodal\",\n class: \"amodal\",\n tabindex: \"-1\",\n style: be(a.value),\n onClick: s[0] || (s[0] = Ie(() => {\n }, [\"stop\"])),\n onInput: s[1] || (s[1] = Ie(() => {\n }, [\"stop\"]))\n }, [\n he(r.$slots, \"default\")\n ], 36));\n }\n}), ml = (e) => {\n const t = e.id || co();\n return Tn(`table-${t}`, () => {\n const o = () => {\n const c = [Object.assign({}, { rowModified: !1 })], v = /* @__PURE__ */ new Set();\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A];\n H.parent !== null && H.parent !== void 0 && v.add(H.parent);\n }\n const M = (A) => a.value[A]?.gantt !== void 0, _ = (A) => {\n for (let H = 0; H < a.value.length; H++)\n if (a.value[H].parent === A && (M(H) || _(H)))\n return !0;\n return !1;\n }, Z = (A) => {\n const H = r.value, U = H.view === \"tree\" || H.view === \"tree-gantt\" ? H.defaultTreeExpansion : void 0;\n if (!U) return !0;\n switch (U) {\n case \"root\":\n return !1;\n // Only root nodes are visible, all children start collapsed\n case \"branch\":\n return _(A);\n case \"leaf\":\n return !0;\n // All nodes should be expanded\n default:\n return !0;\n }\n };\n for (let A = 0; A < a.value.length; A++) {\n const H = a.value[A], U = H.parent === null || H.parent === void 0, ae = v.has(A);\n c[A] = {\n childrenOpen: Z(A),\n expanded: !1,\n indent: H.indent || 0,\n isParent: ae,\n isRoot: U,\n rowModified: !1,\n open: U,\n // This will be recalculated later for non-root nodes\n parent: H.parent\n };\n }\n return c;\n }, n = R(e.columns), a = R(e.rows), r = R(e.config || {}), s = R({}), l = R({}), u = T(() => {\n const c = {};\n for (const [v, M] of n.value.entries())\n for (const [_, Z] of a.value.entries())\n c[`${v}:${_}`] = Z[M.name];\n return c;\n }), i = T({\n get: () => {\n const c = o();\n for (let v = 0; v < c.length; v++)\n s.value[v] && (c[v].rowModified = s.value[v]), l.value[v] && (l.value[v].childrenOpen !== void 0 && (c[v].childrenOpen = l.value[v].childrenOpen), l.value[v].expanded !== void 0 && (c[v].expanded = l.value[v].expanded));\n if (C.value) {\n const v = (M, _) => {\n const Z = _[M];\n if (Z.isRoot || Z.parent === null || Z.parent === void 0)\n return !0;\n const A = Z.parent;\n return A < 0 || A >= _.length ? !1 : (_[A].childrenOpen || !1) && v(A, _);\n };\n for (let M = 0; M < c.length; M++)\n c[M].isRoot || (c[M].open = v(M, c));\n }\n return c;\n },\n set: (c) => {\n JSON.stringify(c) !== JSON.stringify(i.value) && (i.value = c);\n }\n }), d = R(e.modal || { visible: !1 }), p = R({}), y = R([]), k = R([]), g = R([]), b = R({\n column: null,\n direction: null\n }), f = R({}), m = T(() => n.value.some((c) => c.pinned)), I = T(() => r.value.view === \"gantt\" || r.value.view === \"tree-gantt\"), C = T(() => r.value.view === \"tree\" || r.value.view === \"tree-gantt\"), $ = T(() => {\n const c = r.value;\n return c.view === \"gantt\" || c.view === \"tree-gantt\" ? c.dependencyGraph !== !1 : !0;\n }), L = T(() => `${Math.ceil(a.value.length / 100 + 1)}ch`), S = T(\n () => r.value.view ? [\"list\", \"tree\", \"tree-gantt\", \"list-expansion\"].includes(r.value.view) : !1\n ), O = T(() => {\n let c = a.value.map((v, M) => ({\n ...v,\n originalIndex: M\n }));\n if (Object.entries(f.value).forEach(([v, M]) => {\n const _ = parseInt(v), Z = n.value[_];\n !Z || !(M.value || M.startValue || M.endValue || Z.filterType === \"checkbox\" && M.value !== void 0) || (c = c.filter((A) => {\n const H = A[Z.name];\n return le(H, M, Z);\n }));\n }), b.value.column !== null && b.value.direction) {\n const v = n.value[b.value.column], M = b.value.direction;\n c.sort((_, Z) => {\n let A = _[v.name], H = Z[v.name];\n A == null && (A = \"\"), H == null && (H = \"\");\n const U = Number(A), ae = Number(H);\n if (!isNaN(U) && !isNaN(ae) && A !== \"\" && H !== \"\")\n return M === \"asc\" ? U - ae : ae - U;\n {\n const tt = String(A).toLowerCase(), Ut = String(H).toLowerCase();\n return M === \"asc\" ? tt.localeCompare(Ut) : Ut.localeCompare(tt);\n }\n });\n }\n return c;\n }), W = (c, v) => u.value[`${c}:${v}`], pe = (c, v, M) => {\n const _ = `${c}:${v}`, Z = n.value[c];\n u.value[_] !== M && (s.value[v] = !0), u.value[_] = M, a.value[v] = {\n ...a.value[v],\n [Z.name]: M\n };\n }, j = (c) => {\n a.value = c;\n }, J = (c, v, M) => {\n const _ = `${c}:${v}`;\n u.value[_] !== M && (s.value[v] = !0, p.value[_] = M);\n }, ge = (c) => {\n const v = n.value.indexOf(c) === n.value.length - 1, M = r.value.fullWidth ? c.resizable && !v : c.resizable;\n return {\n width: c.width || \"40ch\",\n textAlign: c.align || \"center\",\n ...M && {\n resize: \"horizontal\",\n overflow: \"hidden\",\n whiteSpace: \"nowrap\"\n }\n };\n }, de = (c, v) => {\n if (c < 0 || c >= n.value.length) return;\n const M = Math.max(v, 40);\n n.value[c] = {\n ...n.value[c],\n width: `${M}px`\n };\n }, Oe = (c) => {\n const v = a.value[c];\n return I.value && v.gantt !== void 0;\n }, Re = (c) => !C.value || i.value[c].isRoot || i.value[c].open, Ye = (c) => !C.value && r.value.view !== \"list-expansion\" ? \"\" : C.value && (i.value[c].isRoot || i.value[c].isParent) ? i.value[c].childrenOpen ? \"โผ\" : \"โบ\" : r.value.view === \"list-expansion\" ? i.value[c].expanded ? \"โผ\" : \"โบ\" : \"\", Xe = (c) => {\n if (C.value) {\n const v = l.value[c] || {}, M = !(v.childrenOpen ?? i.value[c].childrenOpen);\n l.value[c] = {\n ...v,\n childrenOpen: M\n }, M || Be(c);\n } else if (r.value.view === \"list-expansion\") {\n const v = l.value[c] || {}, M = v.expanded ?? i.value[c].expanded;\n l.value[c] = {\n ...v,\n expanded: !M\n };\n }\n }, Be = (c) => {\n for (let v = 0; v < a.value.length; v++)\n if (i.value[v].parent === c) {\n const M = l.value[v] || {};\n l.value[v] = {\n ...M,\n childrenOpen: !1\n }, Be(v);\n }\n }, je = (c, v) => {\n const M = W(c, v);\n return Fe(c, v, M);\n }, Fe = (c, v, M) => {\n const _ = n.value[c], Z = a.value[v], A = _.format;\n return A ? typeof A == \"function\" ? A(M, { table: u.value, row: Z, column: _ }) : typeof A == \"string\" ? Function(`\"use strict\";return (${A})`)()(M, { table: u.value, row: Z, column: _ }) : M : M;\n }, D = (c) => {\n c.target instanceof Node && d.value.parent?.contains(c.target) || d.value.visible && (d.value.visible = !1);\n }, F = (c, v) => v && c === 0 && v > 0 ? `${v}ch` : \"inherit\", G = (c) => {\n const v = a.value[c.rowIndex]?.gantt;\n v && (c.type === \"resize\" ? c.edge === \"start\" ? (v.startIndex = c.newStart, v.endIndex = c.end, v.colspan = v.endIndex - v.startIndex) : c.edge === \"end\" && (v.startIndex = c.start, v.endIndex = c.newEnd, v.colspan = v.endIndex - v.startIndex) : c.type === \"bar\" && (v.startIndex = c.newStart, v.endIndex = c.newEnd, v.colspan = v.endIndex - v.startIndex));\n }, Q = (c) => {\n const v = y.value.findIndex((M) => M.id === c.id);\n v >= 0 ? y.value[v] = c : y.value.push(c);\n }, q = (c) => {\n const v = y.value.findIndex((M) => M.id === c);\n v >= 0 && y.value.splice(v, 1);\n }, re = (c) => {\n const v = k.value.findIndex((M) => M.id === c.id);\n v >= 0 ? k.value[v] = c : k.value.push(c);\n }, ke = (c) => {\n const v = k.value.findIndex((M) => M.id === c);\n v >= 0 && k.value.splice(v, 1);\n }, Le = (c, v, M) => {\n const _ = k.value.find((H) => H.id === c), Z = k.value.find((H) => H.id === v);\n if (!_ || !Z)\n return console.warn(\"Cannot create connection: handle not found\"), null;\n const A = {\n id: `connection-${c}-${v}`,\n from: {\n barId: _.barId,\n side: _.side\n },\n to: {\n barId: Z.barId,\n side: Z.side\n },\n style: M?.style,\n label: M?.label\n };\n return g.value.push(A), A;\n }, P = (c) => {\n const v = g.value.findIndex((M) => M.id === c);\n return v >= 0 ? (g.value.splice(v, 1), !0) : !1;\n }, B = (c) => g.value.filter((v) => v.from.barId === c || v.to.barId === c), z = (c) => k.value.filter((v) => v.barId === c), ee = (c) => {\n if (n.value[c].sortable === !1) return;\n let v;\n b.value.column === c && b.value.direction === \"asc\" ? v = \"desc\" : v = \"asc\", b.value.column = c, b.value.direction = v;\n }, le = (c, v, M) => {\n const _ = M.filterType || \"text\", Z = v.value;\n if (!Z && _ !== \"dateRange\" && _ !== \"checkbox\") return !0;\n switch (_) {\n case \"text\": {\n let A = \"\";\n return typeof c == \"object\" && c !== null ? A = Object.values(c).join(\" \") : A = String(c || \"\"), A.toLowerCase().includes(String(Z).toLowerCase());\n }\n case \"number\": {\n const A = Number(c), H = Number(Z);\n return !isNaN(A) && !isNaN(H) && A === H;\n }\n case \"select\":\n return c === Z;\n case \"checkbox\":\n return Z === !0 ? !!c : !0;\n case \"date\": {\n let A;\n if (typeof c == \"number\") {\n const U = new Date(c), ae = (/* @__PURE__ */ new Date()).getFullYear();\n A = new Date(ae, U.getMonth(), U.getDate());\n } else\n A = new Date(String(c));\n const H = new Date(String(Z));\n return A.toDateString() === H.toDateString();\n }\n case \"dateRange\": {\n const A = v.startValue, H = v.endValue;\n if (!A && !H) return !0;\n let U;\n if (typeof c == \"number\") {\n const ae = new Date(c), tt = (/* @__PURE__ */ new Date()).getFullYear();\n U = new Date(tt, ae.getMonth(), ae.getDate());\n } else\n U = new Date(String(c));\n return !(A && U < new Date(String(A)) || H && U > new Date(String(H)));\n }\n default:\n return !0;\n }\n }, te = (c, v) => {\n !v.value && !v.startValue && !v.endValue ? delete f.value[c] : f.value[c] = v;\n }, ie = (c) => {\n delete f.value[c];\n }, ce = (c, v = \"end\") => {\n const M = {};\n for (const Z of n.value)\n M[Z.name] = \"\";\n c && Object.assign(M, c);\n let _;\n return v === \"start\" ? (_ = 0, a.value.unshift(M)) : v === \"end\" ? (_ = a.value.length, a.value.push(M)) : (_ = Math.max(0, Math.min(v, a.value.length)), a.value.splice(_, 0, M)), _;\n };\n return {\n // state\n columns: n,\n config: r,\n connectionHandles: k,\n connectionPaths: g,\n display: i,\n filterState: f,\n ganttBars: y,\n modal: d,\n rows: a,\n sortState: b,\n table: u,\n updates: p,\n // getters\n filteredRows: O,\n hasPinnedColumns: m,\n isGanttView: I,\n isTreeView: C,\n isDependencyGraphEnabled: $,\n numberedRowWidth: L,\n zeroColumn: S,\n // actions\n addRow: ce,\n clearFilter: ie,\n closeModal: D,\n createConnection: Le,\n deleteConnection: P,\n deleteRow: (c) => {\n if (c < 0 || c >= a.value.length)\n return null;\n const [v] = a.value.splice(c, 1);\n delete s.value[c], delete l.value[c];\n const M = {}, _ = {};\n for (const [Z, A] of Object.entries(s.value)) {\n const H = parseInt(Z);\n H > c ? M[H - 1] = A : M[H] = A;\n }\n for (const [Z, A] of Object.entries(l.value)) {\n const H = parseInt(Z);\n H > c ? _[H - 1] = A : _[H] = A;\n }\n return s.value = M, l.value = _, v;\n },\n duplicateRow: (c) => {\n if (c < 0 || c >= a.value.length)\n return -1;\n const v = a.value[c], M = JSON.parse(JSON.stringify(v)), _ = c + 1;\n return a.value.splice(_, 0, M), _;\n },\n getCellData: W,\n getCellDisplayValue: je,\n getConnectionsForBar: B,\n getFormattedValue: Fe,\n getHandlesForBar: z,\n getHeaderCellStyle: ge,\n getIndent: F,\n getRowExpandSymbol: Ye,\n insertRowAbove: (c, v) => {\n const M = Math.max(0, c);\n return ce(v, M);\n },\n insertRowBelow: (c, v) => {\n const M = Math.min(c + 1, a.value.length);\n return ce(v, M);\n },\n isRowGantt: Oe,\n isRowVisible: Re,\n moveRow: (c, v) => {\n if (c < 0 || c >= a.value.length || v < 0 || v >= a.value.length || c === v)\n return !1;\n const [M] = a.value.splice(c, 1);\n a.value.splice(v, 0, M);\n const _ = {}, Z = {};\n for (const [A, H] of Object.entries(s.value)) {\n const U = parseInt(A);\n let ae = U;\n U === c ? ae = v : c < v ? U > c && U <= v && (ae = U - 1) : U >= v && U < c && (ae = U + 1), _[ae] = H;\n }\n for (const [A, H] of Object.entries(l.value)) {\n const U = parseInt(A);\n let ae = U;\n U === c ? ae = v : c < v ? U > c && U <= v && (ae = U - 1) : U >= v && U < c && (ae = U + 1), Z[ae] = H;\n }\n return s.value = _, l.value = Z, !0;\n },\n registerConnectionHandle: re,\n registerGanttBar: Q,\n resizeColumn: de,\n setCellData: pe,\n setCellText: J,\n setFilter: te,\n sortByColumn: ee,\n toggleRowExpand: Xe,\n unregisterConnectionHandle: ke,\n unregisterGanttBar: q,\n updateGanttBar: G,\n updateRows: j\n };\n })();\n}, hl = {\n class: \"atable-container\",\n style: { position: \"relative\" }\n}, gl = /* @__PURE__ */ oe({\n __name: \"ATable\",\n props: /* @__PURE__ */ xe({\n id: { default: \"\" },\n config: { default: () => new Object() }\n }, {\n rows: { required: !0 },\n rowsModifiers: {},\n columns: { required: !0 },\n columnsModifiers: {}\n }),\n emits: /* @__PURE__ */ xe([\"cellUpdate\", \"gantt:drag\", \"connection:event\", \"columns:update\", \"row:add\", \"row:delete\", \"row:duplicate\", \"row:insert-above\", \"row:insert-below\", \"row:move\"], [\"update:rows\", \"update:columns\"]),\n setup(e, { expose: t, emit: o }) {\n const n = Me(e, \"rows\"), a = Me(e, \"columns\"), r = o, s = fe(\"table\"), l = ml({ columns: a.value, rows: n.value, id: e.id, config: e.config });\n l.$onAction(({ name: g, store: b, args: f, after: m }) => {\n if (g === \"setCellData\" || g === \"setCellText\") {\n const [I, C, $] = f, L = b.getCellData(I, C);\n m(() => {\n n.value = [...b.rows], r(\"cellUpdate\", { colIndex: I, rowIndex: C, newValue: $, oldValue: L });\n });\n } else if (g === \"updateGanttBar\") {\n const [I] = f;\n let C = !1;\n I.type === \"resize\" ? C = I.oldColspan !== I.newColspan : I.type === \"bar\" && (C = I.oldStart !== I.newStart || I.oldEnd !== I.newEnd), C && m(() => {\n r(\"gantt:drag\", I);\n });\n } else g === \"resizeColumn\" && m(() => {\n a.value = [...b.columns], r(\"columns:update\", [...b.columns]);\n });\n }), ne(\n () => n.value,\n (g) => {\n JSON.stringify(g) !== JSON.stringify(l.rows) && (l.rows = [...g]);\n },\n { deep: !0 }\n ), ne(\n a,\n (g) => {\n JSON.stringify(g) !== JSON.stringify(l.columns) && (l.columns = [...g], r(\"columns:update\", [...g]));\n },\n { deep: !0 }\n ), Ee(() => {\n a.value.some((g) => g.pinned) && (i(), l.isTreeView && pn(s, i, { childList: !0, subtree: !0 }));\n });\n const u = T(() => l.columns.filter((g) => g.pinned).length), i = () => {\n const g = s.value, b = g?.rows[0], f = g?.rows[1], m = b ? Array.from(b.cells) : [];\n for (const [I, C] of m.entries()) {\n const $ = f?.cells[I];\n $ && (C.style.width = `${$.offsetWidth}px`);\n }\n for (const I of g?.rows || []) {\n let C = 0;\n const $ = [];\n for (const L of I.cells)\n (L.classList.contains(\"sticky-column\") || L.classList.contains(\"sticky-index\")) && (L.style.left = `${C}px`, C += L.offsetWidth, $.push(L));\n $.length > 0 && $[$.length - 1].classList.add(\"sticky-column-edge\");\n }\n };\n window.addEventListener(\"keydown\", (g) => {\n if (g.key === \"Escape\" && l.modal.visible) {\n l.modal.visible = !1;\n const b = l.modal.parent;\n b && vt().then(() => {\n b.focus();\n });\n }\n });\n const d = (g) => {\n if (!g.gantt || u.value === 0)\n return l.columns;\n const b = [];\n for (let f = 0; f < u.value; f++) {\n const m = { ...l.columns[f] };\n m.originalIndex = f, b.push(m);\n }\n return b.push({\n ...l.columns[u.value],\n isGantt: !0,\n colspan: g.gantt?.colspan || l.columns.length - u.value,\n originalIndex: u.value,\n width: \"auto\"\n // TODO: refactor to API that can detect when data exists in a cell. Might have be custom and not generalizable\n }), b;\n }, p = (g) => {\n r(\"connection:event\", { type: \"create\", connection: g });\n }, y = (g) => {\n r(\"connection:event\", { type: \"delete\", connection: g });\n }, k = (g, b) => {\n switch (g) {\n case \"add\": {\n const f = l.addRow({}, b + 1), m = l.rows[f];\n n.value = [...l.rows], r(\"row:add\", { rowIndex: f, row: m });\n break;\n }\n case \"delete\": {\n const f = l.deleteRow(b);\n f && (n.value = [...l.rows], r(\"row:delete\", { rowIndex: b, row: f }));\n break;\n }\n case \"duplicate\": {\n const f = l.duplicateRow(b);\n if (f >= 0) {\n const m = l.rows[f];\n n.value = [...l.rows], r(\"row:duplicate\", { sourceIndex: b, newIndex: f, row: m });\n }\n break;\n }\n case \"insertAbove\": {\n const f = l.insertRowAbove(b), m = l.rows[f];\n n.value = [...l.rows], r(\"row:insert-above\", { targetIndex: b, newIndex: f, row: m });\n break;\n }\n case \"insertBelow\": {\n const f = l.insertRowBelow(b), m = l.rows[f];\n n.value = [...l.rows], r(\"row:insert-below\", { targetIndex: b, newIndex: f, row: m });\n break;\n }\n case \"move\": {\n r(\"row:move\", { fromIndex: b, toIndex: -1 });\n break;\n }\n }\n };\n return t({\n store: l,\n createConnection: l.createConnection,\n deleteConnection: l.deleteConnection,\n getConnectionsForBar: l.getConnectionsForBar,\n getHandlesForBar: l.getHandlesForBar,\n // Row action methods\n addRow: l.addRow,\n deleteRow: l.deleteRow,\n duplicateRow: l.duplicateRow,\n insertRowAbove: l.insertRowAbove,\n insertRowBelow: l.insertRowBelow,\n moveRow: l.moveRow\n }), (g, b) => (h(), x(\"div\", hl, [\n K((h(), x(\"table\", {\n ref: \"table\",\n class: \"atable\",\n style: be({\n width: V(l).config.fullWidth ? \"100%\" : \"auto\"\n })\n }, [\n he(g.$slots, \"header\", { data: V(l) }, () => [\n ct(hn, {\n columns: V(l).columns,\n store: V(l)\n }, null, 8, [\"columns\", \"store\"])\n ], !0),\n w(\"tbody\", null, [\n he(g.$slots, \"body\", { data: V(l) }, () => [\n (h(!0), x(X, null, ve(V(l).filteredRows, (f, m) => (h(), me(mn, {\n key: `${f.originalIndex}-${m}`,\n row: f,\n rowIndex: f.originalIndex,\n store: V(l),\n \"onRow:action\": k\n }, {\n default: $t(() => [\n (h(!0), x(X, null, ve(d(f), (I, C) => (h(), x(X, {\n key: I.name\n }, [\n I.isGantt ? (h(), me(Ue(I.ganttComponent || \"AGanttCell\"), {\n key: 0,\n store: V(l),\n \"columns-count\": V(l).columns.length - u.value,\n color: f.gantt?.color,\n start: f.gantt?.startIndex,\n end: f.gantt?.endIndex,\n colspan: I.colspan,\n pinned: I.pinned,\n rowIndex: f.originalIndex,\n colIndex: I.originalIndex ?? C,\n style: be({\n textAlign: I?.align || \"center\",\n minWidth: I?.width || \"40ch\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n \"onConnection:create\": p\n }, null, 40, [\"store\", \"columns-count\", \"color\", \"start\", \"end\", \"colspan\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"])) : (h(), me(Ue(I.cellComponent || \"ACell\"), {\n key: 1,\n store: V(l),\n pinned: I.pinned,\n rowIndex: f.originalIndex,\n colIndex: C,\n style: be({\n textAlign: I?.align || \"center\",\n width: V(l).config.fullWidth ? \"auto\" : null\n }),\n spellcheck: \"false\"\n }, null, 8, [\"store\", \"pinned\", \"rowIndex\", \"colIndex\", \"style\"]))\n ], 64))), 128))\n ]),\n _: 2\n }, 1032, [\"row\", \"rowIndex\", \"store\"]))), 128))\n ], !0)\n ]),\n he(g.$slots, \"footer\", { data: V(l) }, void 0, !0),\n he(g.$slots, \"modal\", { data: V(l) }, () => [\n K(ct(gn, { store: V(l) }, {\n default: $t(() => [\n (h(), me(Ue(V(l).modal.component), ft({\n key: `${V(l).modal.rowIndex}:${V(l).modal.colIndex}`,\n \"col-index\": V(l).modal.colIndex,\n \"row-index\": V(l).modal.rowIndex,\n store: V(l)\n }, V(l).modal.componentProps), null, 16, [\"col-index\", \"row-index\", \"store\"]))\n ]),\n _: 1\n }, 8, [\"store\"]), [\n [Ce, V(l).modal.visible]\n ])\n ], !0)\n ], 4)), [\n [V(Go), V(l).closeModal]\n ]),\n V(l).isGanttView && V(l).isDependencyGraphEnabled ? (h(), me(el, {\n key: 0,\n store: V(l),\n \"onConnection:delete\": y\n }, null, 8, [\"store\"])) : Y(\"\", !0)\n ]));\n }\n}), wl = /* @__PURE__ */ Ve(gl, [[\"__scopeId\", \"data-v-3d00d51b\"]]), yl = {}, bl = { class: \"aloading\" }, xl = { class: \"aloading-header\" };\nfunction kl(e, t) {\n return h(), x(\"div\", bl, [\n w(\"h2\", xl, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = w(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst Il = /* @__PURE__ */ Ve(yl, [[\"render\", kl], [\"__scopeId\", \"data-v-a930a25b\"]]), Ml = {}, Cl = { class: \"aloading\" }, El = { class: \"aloading-header\" };\nfunction Al(e, t) {\n return h(), x(\"div\", Cl, [\n w(\"h2\", El, [\n he(e.$slots, \"default\", {}, void 0, !0)\n ]),\n t[0] || (t[0] = w(\"div\", { class: \"aloading-bar\" }, null, -1))\n ]);\n}\nconst $l = /* @__PURE__ */ Ve(Ml, [[\"render\", Al], [\"__scopeId\", \"data-v-e1165876\"]]);\nfunction Tl(e) {\n e.component(\"ACell\", mo), e.component(\"AExpansionRow\", bo), e.component(\"AGanttCell\", Ao), e.component(\"ARow\", mn), e.component(\"ARowActions\", it), e.component(\"ATable\", wl), e.component(\"ATableHeader\", hn), e.component(\"ATableLoading\", Il), e.component(\"ATableLoadingBar\", $l), e.component(\"ATableModal\", gn);\n}\nconst Dl = { class: \"aform_form-element\" }, Sl = { class: \"aform_field-label\" }, Rl = { class: \"aform_display-value\" }, Ll = [\"for\"], Hl = { class: \"aform_checkbox-container aform_input-field\" }, Vl = [\"id\", \"disabled\", \"required\"], _l = [\"innerHTML\"], Pl = /* @__PURE__ */ oe({\n __name: \"ACheckbox\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: { type: [Boolean, String, Array, Set] },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\");\n return (o, n) => (h(), x(\"div\", Dl, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"label\", Sl, N(e.label), 1),\n w(\"span\", Rl, N(t.value ? \"โ\" : \"โ\"), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n w(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, N(e.label), 9, Ll),\n w(\"span\", Hl, [\n K(w(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": n[0] || (n[0] = (a) => t.value = a),\n type: \"checkbox\",\n class: \"aform_checkbox\",\n disabled: e.mode === \"read\",\n required: e.required\n }, null, 8, Vl), [\n [rn, t.value]\n ])\n ]),\n K(w(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, _l), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n}), Te = (e, t) => {\n const o = e.__vccOpts || e;\n for (const [n, a] of t)\n o[n] = a;\n return o;\n}, Ol = /* @__PURE__ */ Te(Pl, [[\"__scopeId\", \"data-v-cc185b72\"]]), Bl = /* @__PURE__ */ oe({\n __name: \"AComboBox\",\n props: {\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {},\n event: {},\n cellData: {},\n tableID: {}\n },\n setup(e) {\n return (t, o) => {\n const n = cn(\"ATableModal\");\n return h(), me(n, {\n event: e.event,\n \"cell-data\": e.cellData,\n class: \"amodal\"\n }, {\n default: $t(() => [...o[0] || (o[0] = [\n w(\"div\", null, [\n w(\"input\", { type: \"text\" }),\n w(\"input\", { type: \"text\" }),\n w(\"input\", { type: \"text\" })\n ], -1)\n ])]),\n _: 1\n }, 8, [\"event\", \"cell-data\"]);\n };\n }\n}), Fl = { class: \"aform_display-value\" }, Zl = [\"id\", \"disabled\", \"required\"], Nl = [\"for\"], Ul = [\"innerHTML\"], Wl = /* @__PURE__ */ oe({\n __name: \"ADate\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: { default: \"Date\" },\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: {\n // format the date to be compatible with the native input datepicker\n },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\", {\n // format the date to be compatible with the native input datepicker\n set: (a) => new Date(a).toISOString().split(\"T\")[0]\n }), o = fe(\"date\"), n = () => {\n o.value && \"showPicker\" in HTMLInputElement.prototype && o.value.showPicker();\n };\n return (a, r) => (h(), x(\"div\", null, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", Fl, N(t.value ? new Date(t.value).toLocaleDateString() : \"\"), 1),\n w(\"label\", null, N(e.label), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n K(w(\"input\", {\n id: e.uuid,\n ref: \"date\",\n \"onUpdate:modelValue\": r[0] || (r[0] = (s) => t.value = s),\n type: \"date\",\n disabled: e.mode === \"read\",\n required: e.required,\n onClick: n\n }, null, 8, Zl), [\n [we, t.value]\n ]),\n w(\"label\", { for: e.uuid }, N(e.label), 9, Nl),\n K(w(\"p\", {\n innerHTML: e.validation.errorMessage\n }, null, 8, Ul), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n}), Gl = /* @__PURE__ */ Te(Wl, [[\"__scopeId\", \"data-v-425aef3c\"]]);\nfunction wn(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\n// @__NO_SIDE_EFFECTS__\nfunction jt() {\n const e = /* @__PURE__ */ new Set(), t = (r) => {\n e.delete(r);\n };\n return {\n on: (r) => {\n e.add(r);\n const s = () => t(r);\n return wn(s), { off: s };\n },\n off: t,\n trigger: (...r) => Promise.all(Array.from(e).map((s) => s(...r))),\n clear: () => {\n e.clear();\n }\n };\n}\nconst yn = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst zl = Object.prototype.toString, ql = (e) => zl.call(e) === \"[object Object]\", Je = () => {\n}, Yl = (e, t) => Object.prototype.hasOwnProperty.call(e, t);\nfunction Xl(...e) {\n if (e.length !== 1) return un(...e);\n const t = e[0];\n return typeof t == \"function\" ? Rt(St(() => ({\n get: t,\n set: Je\n }))) : R(t);\n}\nfunction It(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction jl(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst bn = yn ? window : void 0, Jl = yn ? window.document : void 0;\nfunction Ne(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction Mt(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = It(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return jl(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => Ne(r))) !== null && n !== void 0 ? n : [bn].filter((r) => r != null),\n It(E(o.value ? e[1] : e[0])),\n It(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = ql(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\nfunction Jt(e, t, o = {}) {\n const { window: n = bn, ignore: a = [], capture: r = !0, detectIframe: s = !1, controls: l = !1 } = o;\n if (!n) return l ? {\n stop: Je,\n cancel: Je,\n trigger: Je\n } : Je;\n let u = !0;\n const i = (f) => E(a).some((m) => {\n if (typeof m == \"string\") return Array.from(n.document.querySelectorAll(m)).some((I) => I === f.target || f.composedPath().includes(I));\n {\n const I = Ne(m);\n return I && (f.target === I || f.composedPath().includes(I));\n }\n });\n function d(f) {\n const m = E(f);\n return m && m.$.subTree.shapeFlag === 16;\n }\n function p(f, m) {\n const I = E(f), C = I.$.subTree && I.$.subTree.children;\n return C == null || !Array.isArray(C) ? !1 : C.some(($) => $.el === m.target || m.composedPath().includes($.el));\n }\n const y = (f) => {\n const m = Ne(e);\n if (f.target != null && !(!(m instanceof Element) && d(e) && p(e, f)) && !(!m || m === f.target || f.composedPath().includes(m))) {\n if (\"detail\" in f && f.detail === 0 && (u = !i(f)), !u) {\n u = !0;\n return;\n }\n t(f);\n }\n };\n let k = !1;\n const g = [\n Mt(n, \"click\", (f) => {\n k || (k = !0, setTimeout(() => {\n k = !1;\n }, 0), y(f));\n }, {\n passive: !0,\n capture: r\n }),\n Mt(n, \"pointerdown\", (f) => {\n const m = Ne(e);\n u = !i(f) && !!(m && !f.composedPath().includes(m));\n }, { passive: !0 }),\n s && Mt(n, \"blur\", (f) => {\n setTimeout(() => {\n var m;\n const I = Ne(e);\n ((m = n.document.activeElement) === null || m === void 0 ? void 0 : m.tagName) === \"IFRAME\" && !I?.contains(n.document.activeElement) && t(f);\n }, 0);\n }, { passive: !0 })\n ].filter(Boolean), b = () => g.forEach((f) => f());\n return l ? {\n stop: b,\n cancel: () => {\n u = !1;\n },\n trigger: (f) => {\n u = !0, y(f), u = !1;\n }\n } : b;\n}\nconst Ql = {\n multiple: !0,\n accept: \"*\",\n reset: !1,\n directory: !1\n};\nfunction Kl(e) {\n if (!e) return null;\n if (e instanceof FileList) return e;\n const t = new DataTransfer();\n for (const o of e) t.items.add(o);\n return t.files;\n}\nfunction ea(e = {}) {\n const { document: t = Jl } = e, o = R(Kl(e.initialFiles)), { on: n, trigger: a } = /* @__PURE__ */ jt(), { on: r, trigger: s } = /* @__PURE__ */ jt(), l = T(() => {\n var p;\n const y = (p = Ne(e.input)) !== null && p !== void 0 ? p : t ? t.createElement(\"input\") : void 0;\n return y && (y.type = \"file\", y.onchange = (k) => {\n o.value = k.target.files, a(o.value);\n }, y.oncancel = () => {\n s();\n }), y;\n }), u = () => {\n o.value = null, l.value && l.value.value && (l.value.value = \"\", a(null));\n }, i = (p) => {\n const y = l.value;\n y && (y.multiple = E(p.multiple), y.accept = E(p.accept), y.webkitdirectory = E(p.directory), Yl(p, \"capture\") && (y.capture = E(p.capture)));\n }, d = (p) => {\n const y = l.value;\n if (!y) return;\n const k = {\n ...Ql,\n ...e,\n ...p\n };\n i(k), E(k.reset) && u(), y.click();\n };\n return gt(() => {\n i(e);\n }), {\n files: Rt(o),\n open: d,\n reset: u,\n onCancel: r,\n onChange: n\n };\n}\nfunction Ct(e) {\n return typeof Window < \"u\" && e instanceof Window ? e.document.documentElement : typeof Document < \"u\" && e instanceof Document ? e.documentElement : e;\n}\nconst Et = /* @__PURE__ */ new WeakMap();\nfunction ta(e, t = !1) {\n const o = ue(t);\n let n = \"\";\n ne(Xl(e), (s) => {\n const l = Ct(E(s));\n if (l) {\n const u = l;\n if (Et.get(u) || Et.set(u, u.style.overflow), u.style.overflow !== \"hidden\" && (n = u.style.overflow), u.style.overflow === \"hidden\") return o.value = !0;\n if (o.value) return u.style.overflow = \"hidden\";\n }\n }, { immediate: !0 });\n const a = () => {\n const s = Ct(E(e));\n !s || o.value || (s.style.overflow = \"hidden\", o.value = !0);\n }, r = () => {\n const s = Ct(E(e));\n !s || !o.value || (s.style.overflow = n, Et.delete(s), o.value = !1);\n };\n return wn(r), T({\n get() {\n return o.value;\n },\n set(s) {\n s ? a() : r();\n }\n });\n}\nconst At = /* @__PURE__ */ new WeakMap(), na = {\n mounted(e, t) {\n const o = !t.modifiers.bubble;\n let n;\n if (typeof t.value == \"function\") n = Jt(e, t.value, { capture: o });\n else {\n const [a, r] = t.value;\n n = Jt(e, a, Object.assign({ capture: o }, r));\n }\n At.set(e, n);\n },\n unmounted(e) {\n const t = At.get(e);\n t && typeof t == \"function\" ? t() : t?.stop(), At.delete(e);\n }\n};\nfunction oa() {\n let e = !1;\n const t = ue(!1);\n return (o, n) => {\n if (t.value = n.value, e) return;\n e = !0;\n const a = ta(o, n.value);\n ne(t, (r) => a.value = r);\n };\n}\noa();\nconst la = {\n key: 0,\n class: \"input-wrapper\"\n}, aa = { class: \"aform_display-value\" }, sa = { class: \"input-wrapper\" }, ra = [\"disabled\"], ia = {\n id: \"autocomplete-results\",\n class: \"autocomplete-results\"\n}, ua = {\n key: 0,\n class: \"loading autocomplete-result\"\n}, ca = [\"onClick\"], da = /* @__PURE__ */ oe({\n __name: \"ADropdown\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {},\n options: { default: () => [] },\n isAsync: { type: Boolean, default: !1 },\n filterFunction: { type: Function, default: void 0 }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\"), o = R(t.value ?? \"\"), n = sn({\n activeItemIndex: null,\n open: !1,\n loading: !1,\n results: e.options\n }), a = () => u(), r = async () => {\n if (n.open = !0, n.activeItemIndex = null, e.filterFunction) {\n e.isAsync && (n.loading = !0);\n try {\n const k = await e.filterFunction(t.value || \"\");\n n.results = k || [];\n } catch {\n n.results = [];\n } finally {\n e.isAsync && (n.loading = !1);\n }\n } else\n i();\n }, s = (k) => {\n t.value = k, o.value = k, u(k);\n }, l = () => {\n const k = e.options?.indexOf(t.value ?? \"\") ?? -1;\n n.activeItemIndex = e.isAsync ? null : k >= 0 ? k : null, n.open = !0, n.results = e.isAsync ? [] : e.options;\n }, u = (k) => {\n n.activeItemIndex = null, n.open = !1, e.options?.includes(k || t.value || \"\") || (t.value = o.value);\n }, i = () => {\n t.value ? n.results = e.options?.filter((k) => k.toLowerCase().includes((t.value ?? \"\").toLowerCase())) : n.results = e.options;\n }, d = () => {\n const k = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const g = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n n.activeItemIndex = (g + 1) % k;\n } else\n n.activeItemIndex = 0;\n }, p = () => {\n const k = n.results?.length || 0;\n if (n.activeItemIndex != null) {\n const g = isNaN(n.activeItemIndex) ? 0 : n.activeItemIndex;\n g === 0 ? n.activeItemIndex = null : n.activeItemIndex = g - 1;\n } else\n n.activeItemIndex = k - 1;\n }, y = () => {\n if (n.results) {\n const k = n.activeItemIndex || 0, g = n.results[k];\n s(g);\n }\n n.activeItemIndex = 0;\n };\n return (k, g) => e.mode === \"display\" ? (h(), x(\"div\", la, [\n w(\"span\", aa, N(t.value ?? \"\"), 1),\n w(\"label\", null, N(e.label), 1)\n ])) : K((h(), x(\"div\", {\n key: 1,\n class: se([\"autocomplete\", { isOpen: n.open }])\n }, [\n w(\"div\", sa, [\n K(w(\"input\", {\n \"onUpdate:modelValue\": g[0] || (g[0] = (b) => t.value = b),\n type: \"text\",\n disabled: e.mode === \"read\",\n onInput: r,\n onFocus: l,\n onKeydown: [\n Ze(d, [\"down\"]),\n Ze(p, [\"up\"]),\n Ze(y, [\"enter\"]),\n Ze(a, [\"esc\"]),\n Ze(a, [\"tab\"])\n ]\n }, null, 40, ra), [\n [we, t.value]\n ]),\n K(w(\"ul\", ia, [\n n.loading ? (h(), x(\"li\", ua, \"Loading results...\")) : (h(!0), x(X, { key: 1 }, ve(n.results, (b, f) => (h(), x(\"li\", {\n key: b,\n class: se([\"autocomplete-result\", { \"is-active\": f === n.activeItemIndex }]),\n onClick: Ie((m) => s(b), [\"stop\"])\n }, N(b), 11, ca))), 128))\n ], 512), [\n [Ce, n.open]\n ]),\n w(\"label\", null, N(e.label), 1)\n ])\n ], 2)), [\n [V(na), a]\n ]);\n }\n}), fa = /* @__PURE__ */ Te(da, [[\"__scopeId\", \"data-v-e25d4181\"]]);\nfunction xn(e, t) {\n return pt() ? (mt(e, t), !0) : !1;\n}\nconst va = typeof window < \"u\" && typeof document < \"u\";\ntypeof WorkerGlobalScope < \"u\" && globalThis instanceof WorkerGlobalScope;\nconst pa = (e) => e != null, ma = Object.prototype.toString, ha = (e) => ma.call(e) === \"[object Object]\", ga = () => {\n};\nfunction ut(e) {\n return Array.isArray(e) ? e : [e];\n}\nfunction wa(e, t, o) {\n return ne(e, t, {\n ...o,\n immediate: !0\n });\n}\nconst qe = va ? window : void 0;\nfunction Ge(e) {\n var t;\n const o = E(e);\n return (t = o?.$el) !== null && t !== void 0 ? t : o;\n}\nfunction Ke(...e) {\n const t = (n, a, r, s) => (n.addEventListener(a, r, s), () => n.removeEventListener(a, r, s)), o = T(() => {\n const n = ut(E(e[0])).filter((a) => a != null);\n return n.every((a) => typeof a != \"string\") ? n : void 0;\n });\n return wa(() => {\n var n, a;\n return [\n (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((r) => Ge(r))) !== null && n !== void 0 ? n : [qe].filter((r) => r != null),\n ut(E(o.value ? e[1] : e[0])),\n ut(V(o.value ? e[2] : e[1])),\n E(o.value ? e[3] : e[2])\n ];\n }, ([n, a, r, s], l, u) => {\n if (!n?.length || !a?.length || !r?.length) return;\n const i = ha(s) ? { ...s } : s, d = n.flatMap((p) => a.flatMap((y) => r.map((k) => t(p, y, k, i))));\n u(() => {\n d.forEach((p) => p());\n });\n }, { flush: \"post\" });\n}\n// @__NO_SIDE_EFFECTS__\nfunction ya() {\n const e = ue(!1), t = ht();\n return t && Ee(() => {\n e.value = !0;\n }, t), e;\n}\n// @__NO_SIDE_EFFECTS__\nfunction ba(e) {\n const t = /* @__PURE__ */ ya();\n return T(() => (t.value, !!e()));\n}\nfunction xa(e, t, o = {}) {\n const { window: n = qe, ...a } = o;\n let r;\n const s = /* @__PURE__ */ ba(() => n && \"MutationObserver\" in n), l = () => {\n r && (r.disconnect(), r = void 0);\n }, u = ne(T(() => {\n const p = ut(E(e)).map(Ge).filter(pa);\n return new Set(p);\n }), (p) => {\n l(), s.value && p.size && (r = new MutationObserver(t), p.forEach((y) => r.observe(y, a)));\n }, {\n immediate: !0,\n flush: \"post\"\n }), i = () => r?.takeRecords(), d = () => {\n u(), l();\n };\n return xn(d), {\n isSupported: s,\n stop: d,\n takeRecords: i\n };\n}\nfunction ka(e, t, o = {}) {\n const { window: n = qe, document: a = n?.document, flush: r = \"sync\" } = o;\n if (!n || !a) return ga;\n let s;\n const l = (d) => {\n s?.(), s = d;\n }, u = gt(() => {\n const d = Ge(e);\n if (d) {\n const { stop: p } = xa(a, (y) => {\n y.map((k) => [...k.removedNodes]).flat().some((k) => k === d || k.contains(d)) && t(y);\n }, {\n window: n,\n childList: !0,\n subtree: !0\n });\n l(p);\n }\n }, { flush: r }), i = () => {\n u(), l();\n };\n return xn(i), i;\n}\n// @__NO_SIDE_EFFECTS__\nfunction Ia(e = {}) {\n var t;\n const { window: o = qe, deep: n = !0, triggerOnRemoval: a = !1 } = e, r = (t = e.document) !== null && t !== void 0 ? t : o?.document, s = () => {\n let i = r?.activeElement;\n if (n)\n for (var d; i?.shadowRoot; ) i = i == null || (d = i.shadowRoot) === null || d === void 0 ? void 0 : d.activeElement;\n return i;\n }, l = ue(), u = () => {\n l.value = s();\n };\n if (o) {\n const i = {\n capture: !0,\n passive: !0\n };\n Ke(o, \"blur\", (d) => {\n d.relatedTarget === null && u();\n }, i), Ke(o, \"focus\", u, i);\n }\n return a && ka(l, u, { document: r }), u(), l;\n}\nconst Ma = \"focusin\", Ca = \"focusout\", Ea = \":focus-within\";\nfunction Aa(e, t = {}) {\n const { window: o = qe } = t, n = T(() => Ge(e)), a = ue(!1), r = T(() => a.value);\n if (!o || !(/* @__PURE__ */ Ia(t)).value) return { focused: r };\n const s = { passive: !0 };\n return Ke(n, Ma, () => a.value = !0, s), Ke(n, Ca, () => {\n var l, u, i;\n return a.value = (l = (u = n.value) === null || u === void 0 || (i = u.matches) === null || i === void 0 ? void 0 : i.call(u, Ea)) !== null && l !== void 0 ? l : !1;\n }, s), { focused: r };\n}\nfunction $a(e, { window: t = qe, scrollTarget: o } = {}) {\n const n = R(!1), a = () => {\n if (!t) return;\n const r = t.document, s = Ge(e);\n if (!s)\n n.value = !1;\n else {\n const l = s.getBoundingClientRect();\n n.value = l.top <= (t.innerHeight || r.documentElement.clientHeight) && l.left <= (t.innerWidth || r.documentElement.clientWidth) && l.bottom >= 0 && l.right >= 0;\n }\n };\n return ne(\n () => Ge(e),\n () => a(),\n { immediate: !0, flush: \"post\" }\n ), t && Ke(o || t, \"scroll\", a, {\n capture: !1,\n passive: !0\n }), n;\n}\nconst De = (e) => {\n let t = $a(e).value;\n return t = t && e.offsetHeight > 0, t;\n}, Se = (e) => e.tabIndex >= 0, Qt = (e) => {\n const t = e.target;\n return Bt(t);\n}, Bt = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.previousElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.previousElementSibling;\n o && (t = o);\n }\n return t && (!Se(t) || !De(t)) ? Bt(t) : t;\n}, Ta = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.firstElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.firstElementChild;\n a && (o = a);\n }\n }\n return o && (!Se(o) || !De(o)) ? Ft(o) : o;\n}, Kt = (e) => {\n const t = e.target;\n return Ft(t);\n}, Ft = (e) => {\n let t;\n if (e instanceof HTMLTableCellElement) {\n const o = e.parentElement?.nextElementSibling;\n if (o) {\n const n = Array.from(o.children)[e.cellIndex];\n n && (t = n);\n }\n } else if (e instanceof HTMLTableRowElement) {\n const o = e.nextElementSibling;\n o && (t = o);\n }\n return t && (!Se(t) || !De(t)) ? Ft(t) : t;\n}, Da = (e) => {\n const t = e.target;\n let o;\n if (t instanceof HTMLTableCellElement) {\n const n = t.parentElement?.parentElement;\n if (n) {\n const a = n.lastElementChild?.children[t.cellIndex];\n a && (o = a);\n }\n } else if (t instanceof HTMLTableRowElement) {\n const n = t.parentElement;\n if (n) {\n const a = n.lastElementChild;\n a && (o = a);\n }\n }\n return o && (!Se(o) || !De(o)) ? Bt(o) : o;\n}, en = (e) => {\n const t = e.target;\n return Zt(t);\n}, Zt = (e) => {\n let t;\n return e.previousElementSibling ? t = e.previousElementSibling : t = e.parentElement?.previousElementSibling?.lastElementChild, t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, tn = (e) => {\n const t = e.target;\n return Nt(t);\n}, Nt = (e) => {\n let t;\n return e.nextElementSibling ? t = e.nextElementSibling : t = e.parentElement?.nextElementSibling?.firstElementChild, t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, nn = (e) => {\n const t = e.target.parentElement?.firstElementChild;\n return t && (!Se(t) || !De(t)) ? Nt(t) : t;\n}, on = (e) => {\n const t = e.target.parentElement?.lastElementChild;\n return t && (!Se(t) || !De(t)) ? Zt(t) : t;\n}, at = [\"alt\", \"control\", \"shift\", \"meta\"], Sa = {\n ArrowUp: \"up\",\n ArrowDown: \"down\",\n ArrowLeft: \"left\",\n ArrowRight: \"right\"\n}, kn = {\n \"keydown.up\": (e) => {\n const t = Qt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.down\": (e) => {\n const t = Kt(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.left\": (e) => {\n const t = en(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.right\": (e) => {\n const t = tn(e);\n e.preventDefault(), e.stopPropagation(), t && t.focus();\n },\n \"keydown.control.up\": (e) => {\n const t = Ta(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.down\": (e) => {\n const t = Da(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.left\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.control.right\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.end\": (e) => {\n const t = on(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Kt(e);\n t && t.focus();\n }\n },\n \"keydown.shift.enter\": (e) => {\n if (e.target instanceof HTMLTableCellElement) {\n e.preventDefault(), e.stopPropagation();\n const t = Qt(e);\n t && t.focus();\n }\n },\n \"keydown.home\": (e) => {\n const t = nn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.tab\": (e) => {\n const t = tn(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n },\n \"keydown.shift.tab\": (e) => {\n const t = en(e);\n t && (e.preventDefault(), e.stopPropagation(), t.focus());\n }\n};\nfunction Ra(e) {\n const t = (s) => {\n let l = null;\n return s.parent && (typeof s.parent == \"string\" ? l = document.querySelector(s.parent) : s.parent instanceof HTMLElement ? l = s.parent : l = s.parent.value), l;\n }, o = (s) => {\n const l = t(s);\n let u = [];\n if (typeof s.selectors == \"string\")\n u = Array.from(l ? l.querySelectorAll(s.selectors) : document.querySelectorAll(s.selectors));\n else if (Array.isArray(s.selectors))\n for (const i of s.selectors)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else if (s.selectors instanceof HTMLElement)\n u.push(s.selectors);\n else if (s.selectors?.value)\n if (Array.isArray(s.selectors.value))\n for (const i of s.selectors.value)\n i instanceof HTMLElement ? u.push(i) : u.push(i.$el);\n else\n u.push(s.selectors.value);\n return u;\n }, n = (s) => {\n const l = t(s);\n let u = [];\n return s.selectors ? u = o(s) : l && (u = Array.from(l.children).filter((i) => Se(i) && De(i))), u;\n }, a = (s) => (l) => {\n const u = Sa[l.key] || l.key.toLowerCase();\n if (at.includes(u)) return;\n const i = s.handlers || kn;\n for (const d of Object.keys(i)) {\n const [p, ...y] = d.split(\".\");\n if (p === \"keydown\" && y.includes(u)) {\n const k = i[d], g = y.filter((f) => at.includes(f)), b = at.some((f) => {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n return l.getModifierState(m);\n });\n if (g.length > 0) {\n if (b) {\n for (const f of at)\n if (y.includes(f)) {\n const m = f.charAt(0).toUpperCase() + f.slice(1);\n l.getModifierState(m) && k(l);\n }\n }\n } else\n b || k(l);\n }\n }\n }, r = [];\n Ee(() => {\n for (const s of e) {\n const l = t(s), u = n(s), i = a(s), d = l ? [l] : u;\n for (const p of d) {\n const { focused: y } = Aa(R(p)), k = ne(y, (g) => {\n g ? p.addEventListener(\"keydown\", i) : p.removeEventListener(\"keydown\", i);\n });\n r.push(k);\n }\n }\n }), an(() => {\n for (const s of r)\n s();\n });\n}\nconst La = { class: \"aform_display-value\" }, Ha = { key: 0 }, Va = {\n key: 1,\n ref: \"datepicker\",\n class: \"adatepicker\",\n tabindex: \"0\"\n}, _a = {\n colspan: \"5\",\n tabindex: -1\n}, Pa = [\"onClick\", \"onKeydown\"], Oa = 6, ln = 7, Ba = /* @__PURE__ */ oe({\n __name: \"ADatePicker\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {}\n }, {\n modelValue: { default: /* @__PURE__ */ new Date() },\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e, { expose: t }) {\n const o = Me(e, \"modelValue\"), n = R(new Date(o.value)), a = R(n.value.getMonth()), r = R(n.value.getFullYear()), s = R([]), l = fe(\"datepicker\");\n Ee(async () => {\n u(), await vt();\n const C = document.getElementsByClassName(\"selectedDate\");\n if (C.length > 0)\n C[0].focus();\n else {\n const $ = document.getElementsByClassName(\"todaysDate\");\n $.length > 0 && $[0].focus();\n }\n });\n const u = () => {\n s.value = [];\n const C = new Date(r.value, a.value, 1), $ = C.getDay(), L = C.setDate(C.getDate() - $);\n for (const S of Array(43).keys())\n s.value.push(L + S * 864e5);\n };\n ne([a, r], u);\n const i = () => r.value -= 1, d = () => r.value += 1, p = () => {\n a.value == 0 ? (a.value = 11, i()) : a.value -= 1;\n }, y = () => {\n a.value == 11 ? (a.value = 0, d()) : a.value += 1;\n }, k = (C) => {\n const $ = /* @__PURE__ */ new Date();\n if (a.value === $.getMonth())\n return $.toDateString() === new Date(C).toDateString();\n }, g = (C) => new Date(C).toDateString() === new Date(n.value).toDateString(), b = (C, $) => (C - 1) * ln + $, f = (C, $) => s.value[b(C, $)], m = (C) => {\n o.value = n.value = new Date(s.value[C]);\n }, I = T(() => new Date(r.value, a.value, 1).toLocaleDateString(void 0, {\n year: \"numeric\",\n month: \"long\"\n }));\n return Ra([\n {\n parent: l,\n selectors: \"td\",\n handlers: {\n ...kn,\n \"keydown.pageup\": p,\n \"keydown.shift.pageup\": i,\n \"keydown.pagedown\": y,\n \"keydown.shift.pagedown\": d,\n // TODO: this is a hack to override the stonecrop enter handler;\n // store context inside the component so that handlers can be setup consistently\n \"keydown.enter\": () => {\n }\n }\n }\n ]), t({ currentMonth: a, currentYear: r, selectedDate: n }), (C, $) => e.mode === \"display\" || e.mode === \"read\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", La, N(o.value ? new Date(o.value).toLocaleDateString() : \"\"), 1),\n e.label ? (h(), x(\"label\", Ha, N(e.label), 1)) : Y(\"\", !0)\n ], 64)) : (h(), x(\"div\", Va, [\n w(\"table\", null, [\n w(\"tbody\", null, [\n w(\"tr\", null, [\n w(\"td\", {\n id: \"previous-month-btn\",\n tabindex: -1,\n onClick: p\n }, \"<\"),\n w(\"th\", _a, N(I.value), 1),\n w(\"td\", {\n id: \"next-month-btn\",\n tabindex: -1,\n onClick: y\n }, \">\")\n ]),\n $[0] || ($[0] = w(\"tr\", { class: \"days-header\" }, [\n w(\"td\", null, \"M\"),\n w(\"td\", null, \"T\"),\n w(\"td\", null, \"W\"),\n w(\"td\", null, \"T\"),\n w(\"td\", null, \"F\"),\n w(\"td\", null, \"S\"),\n w(\"td\", null, \"S\")\n ], -1)),\n (h(), x(X, null, ve(Oa, (L) => w(\"tr\", { key: L }, [\n (h(), x(X, null, ve(ln, (S) => w(\"td\", {\n ref_for: !0,\n ref: \"celldate\",\n key: b(L, S),\n contenteditable: !1,\n spellcheck: !1,\n tabindex: 0,\n class: se({\n todaysDate: k(f(L, S)),\n selectedDate: g(f(L, S))\n }),\n onClick: Ie((O) => m(b(L, S)), [\"prevent\", \"stop\"]),\n onKeydown: Ze((O) => m(b(L, S)), [\"enter\"])\n }, N(new Date(f(L, S)).getDate()), 43, Pa)), 64))\n ])), 64))\n ])\n ])\n ], 512));\n }\n}), Fa = /* @__PURE__ */ Te(Ba, [[\"__scopeId\", \"data-v-9da05d06\"]]), Za = /* @__PURE__ */ oe({\n __name: \"CollapseButton\",\n props: {\n collapsed: { type: Boolean }\n },\n setup(e) {\n return (t, o) => (h(), x(\"button\", {\n class: se([\"collapse-button\", e.collapsed ? \"rotated\" : \"unrotated\"])\n }, \"ร\", 2));\n }\n}), Na = /* @__PURE__ */ Te(Za, [[\"__scopeId\", \"data-v-6f1c1b45\"]]), Ua = { class: \"aform\" }, Wa = {\n key: 0,\n class: \"aform-nested-section\"\n}, Ga = {\n key: 0,\n class: \"aform-nested-label\"\n}, za = /* @__PURE__ */ oe({\n __name: \"AForm\",\n props: /* @__PURE__ */ xe({\n schema: {},\n mode: { default: \"edit\" }\n }, {\n data: { required: !0 },\n dataModifiers: {}\n }),\n emits: /* @__PURE__ */ xe([\"update:schema\", \"update:data\"], [\"update:data\"]),\n setup(e, { emit: t }) {\n const o = t, n = Me(e, \"data\"), a = R({});\n ne(\n () => n.value,\n (p) => {\n !e.schema || !p || e.schema.forEach((y) => {\n \"schema\" in y && Array.isArray(y.schema) && y.schema.length > 0 && (a.value[y.fieldname] = p[y.fieldname] ?? {});\n });\n },\n { immediate: !0 }\n );\n const r = (p, y) => {\n a.value[p] = y, n.value && (n.value[p] = y, o(\"update:data\", { ...n.value }));\n }, s = (p) => {\n const y = {};\n for (const [k, g] of Object.entries(p))\n [\"component\", \"fieldtype\", \"mode\"].includes(k) || (y[k] = g), k === \"rows\" && (!g || Array.isArray(g) && g.length === 0) && (y.rows = n.value[p.fieldname] || []);\n return y;\n }, l = T(() => e.mode ?? \"edit\");\n function u(p) {\n const y = p.mode;\n return y || l.value;\n }\n const i = R([]);\n gt(() => {\n e.schema && i.value.length !== e.schema.length && (i.value = e.schema.map((p, y) => T({\n get() {\n return n.value?.[e.schema[y].fieldname];\n },\n set: (k) => {\n const g = e.schema[y].fieldname;\n g && n.value && (n.value[g] = k, o(\"update:data\", { ...n.value })), o(\"update:schema\", e.schema);\n }\n })));\n });\n const d = T(() => i.value);\n return (p, y) => {\n const k = cn(\"AForm\", !0);\n return h(), x(\"form\", Ua, [\n (h(!0), x(X, null, ve(e.schema, (g, b) => (h(), x(X, { key: b }, [\n \"schema\" in g && Array.isArray(g.schema) && g.schema.length > 0 ? (h(), x(\"div\", Wa, [\n g.label ? (h(), x(\"h4\", Ga, N(g.label), 1)) : Y(\"\", !0),\n ct(k, {\n data: a.value[g.fieldname],\n mode: u(g),\n schema: g.schema,\n \"onUpdate:data\": (f) => r(g.fieldname, f)\n }, null, 8, [\"data\", \"mode\", \"schema\", \"onUpdate:data\"])\n ])) : (h(), me(Ue(g.component), ft({\n key: 1,\n modelValue: d.value[b].value,\n \"onUpdate:modelValue\": (f) => d.value[b].value = f,\n schema: g,\n data: n.value[g.fieldname],\n mode: u(g)\n }, { ref_for: !0 }, s(g)), null, 16, [\"modelValue\", \"onUpdate:modelValue\", \"schema\", \"data\", \"mode\"]))\n ], 64))), 128))\n ]);\n };\n }\n}), In = /* @__PURE__ */ Te(za, [[\"__scopeId\", \"data-v-5c01cea5\"]]), qa = /* @__PURE__ */ oe({\n __name: \"AFieldset\",\n props: {\n schema: {},\n label: {},\n collapsible: { type: Boolean },\n data: { default: () => ({}) },\n mode: { default: \"edit\" }\n },\n setup(e, { expose: t }) {\n const o = R(!1), n = R(e.data || []), a = R(e.schema), r = (s) => {\n s.preventDefault(), e.collapsible && (o.value = !o.value);\n };\n return t({ collapsed: o }), (s, l) => (h(), x(\"fieldset\", null, [\n w(\"legend\", {\n onClick: r,\n onSubmit: r\n }, [\n Dt(N(e.label) + \" \", 1),\n e.collapsible ? (h(), me(Na, {\n key: 0,\n collapsed: o.value\n }, null, 8, [\"collapsed\"])) : Y(\"\", !0)\n ], 32),\n he(s.$slots, \"default\", { collapsed: o.value }, () => [\n K(ct(In, {\n data: n.value,\n \"onUpdate:data\": l[0] || (l[0] = (u) => n.value = u),\n schema: a.value,\n mode: e.mode\n }, null, 8, [\"data\", \"schema\", \"mode\"]), [\n [Ce, !o.value]\n ])\n ], !0)\n ]));\n }\n}), Ya = /* @__PURE__ */ Te(qa, [[\"__scopeId\", \"data-v-a3606386\"]]), Xa = { class: \"aform_form-element aform_file-attach aform__grid--full\" }, ja = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, Ja = {\n key: 1,\n class: \"aform_display-value\"\n}, Qa = {\n key: 0,\n class: \"aform_file-attach-feedback\"\n}, Ka = [\"disabled\"], es = [\"disabled\"], ts = /* @__PURE__ */ oe({\n __name: \"AFileAttach\",\n props: {\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: {}\n },\n setup(e) {\n const { files: t, open: o, reset: n, onChange: a } = ea(), r = T(() => {\n const s = t.value?.length ?? 0;\n return `${s} ${s === 1 ? \"file\" : \"files\"}`;\n });\n return a((s) => s), (s, l) => (h(), x(\"div\", Xa, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n V(t) ? (h(), x(\"div\", ja, [\n w(\"p\", null, [\n w(\"b\", null, N(r.value), 1)\n ]),\n (h(!0), x(X, null, ve(V(t), (u) => (h(), x(\"li\", {\n key: u.name\n }, N(u.name), 1))), 128))\n ])) : (h(), x(\"span\", Ja, \"No file selected\"))\n ], 64)) : (h(), x(X, { key: 1 }, [\n V(t) ? (h(), x(\"div\", Qa, [\n w(\"p\", null, [\n l[2] || (l[2] = Dt(\" You have selected: \", -1)),\n w(\"b\", null, N(r.value), 1)\n ]),\n (h(!0), x(X, null, ve(V(t), (u) => (h(), x(\"li\", {\n key: u.name\n }, N(u.name), 1))), 128))\n ])) : Y(\"\", !0),\n w(\"button\", {\n type: \"button\",\n class: \"aform_form-btn\",\n disabled: e.mode === \"read\",\n onClick: l[0] || (l[0] = (u) => V(o)())\n }, N(e.label), 9, Ka),\n w(\"button\", {\n type: \"button\",\n disabled: !V(t) || e.mode === \"read\",\n class: \"aform_form-btn\",\n onClick: l[1] || (l[1] = (u) => V(n)())\n }, \"Reset\", 8, es)\n ], 64))\n ]));\n }\n}), ns = /* @__PURE__ */ Te(ts, [[\"__scopeId\", \"data-v-6543d39a\"]]), os = { class: \"aform_form-element\" }, ls = { class: \"aform_display-value\" }, as = { class: \"aform_field-label\" }, ss = [\"id\", \"disabled\", \"required\"], rs = [\"for\"], is = [\"innerHTML\"], us = /* @__PURE__ */ oe({\n __name: \"ANumericInput\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = Me(e, \"modelValue\");\n return (o, n) => (h(), x(\"div\", os, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", ls, N(t.value ?? \"\"), 1),\n w(\"label\", as, N(e.label), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n K(w(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": n[0] || (n[0] = (a) => t.value = a),\n class: \"aform_input-field\",\n type: \"number\",\n disabled: e.mode === \"read\",\n required: e.required\n }, null, 8, ss), [\n [we, t.value]\n ]),\n w(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, N(e.label), 9, rs),\n K(w(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, is), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n});\nfunction cs(e) {\n try {\n return Function(`\"use strict\";return (${e})`)();\n } catch {\n }\n}\nfunction ds(e) {\n const t = e.value;\n if (!t) return;\n const o = cs(t);\n if (o) {\n const n = e.instance?.locale;\n return o(n);\n }\n return t;\n}\nfunction fs(e, t) {\n let o = e;\n const n = [t, \"/\", \"-\", \"(\", \")\", \" \"];\n for (const a of n)\n o = o.replaceAll(a, \"\");\n return o;\n}\nfunction vs(e, t, o) {\n let n = t;\n for (const a of e) {\n const r = n.indexOf(o);\n if (r !== -1) {\n const s = n.substring(0, r), l = n.substring(r + 1);\n n = s + a + l;\n }\n }\n return n.slice(0, t.length);\n}\nfunction ps(e, t) {\n const o = ds(t);\n if (!o) return;\n const n = \"#\", a = e.value, r = fs(a, n);\n if (r) {\n const s = vs(r, o, n);\n t.instance?.maskFilled && (t.instance.maskFilled = !s.includes(n)), e.value = s;\n } else\n e.value = o;\n}\nconst ms = { class: \"aform_form-element\" }, hs = { class: \"aform_display-value\" }, gs = { class: \"aform_field-label\" }, ws = [\"id\", \"disabled\", \"maxlength\", \"required\"], ys = [\"for\"], bs = [\"innerHTML\"], xs = /* @__PURE__ */ oe({\n __name: \"ATextInput\",\n props: /* @__PURE__ */ xe({\n schema: {},\n label: {},\n mask: {},\n required: { type: Boolean },\n mode: {},\n uuid: {},\n validation: { default: () => ({ errorMessage: \" \" }) }\n }, {\n modelValue: {},\n modelModifiers: {}\n }),\n emits: [\"update:modelValue\"],\n setup(e) {\n const t = R(!0), o = Me(e, \"modelValue\");\n return (n, a) => (h(), x(\"div\", ms, [\n e.mode === \"display\" ? (h(), x(X, { key: 0 }, [\n w(\"span\", hs, N(o.value ?? \"\"), 1),\n w(\"label\", gs, N(e.label), 1)\n ], 64)) : (h(), x(X, { key: 1 }, [\n K(w(\"input\", {\n id: e.uuid,\n \"onUpdate:modelValue\": a[0] || (a[0] = (r) => o.value = r),\n class: \"aform_input-field\",\n disabled: e.mode === \"read\",\n maxlength: e.mask && t.value ? e.mask.length : void 0,\n required: e.required\n }, null, 8, ws), [\n [we, o.value],\n [V(ps), e.mask]\n ]),\n w(\"label\", {\n class: \"aform_field-label\",\n for: e.uuid\n }, N(e.label), 9, ys),\n K(w(\"p\", {\n class: \"aform_error\",\n innerHTML: e.validation.errorMessage\n }, null, 8, bs), [\n [Ce, e.validation.errorMessage]\n ])\n ], 64))\n ]));\n }\n}), ks = { class: \"login-container\" }, Is = { class: \"account-container\" }, Ms = { class: \"account-header\" }, Cs = { id: \"account-title\" }, Es = { id: \"account-subtitle\" }, As = { class: \"login-form-container\" }, $s = { class: \"login-form-email aform_form-element\" }, Ts = [\"disabled\"], Ds = { class: \"login-form-password aform_form-element\" }, Ss = [\"disabled\"], Rs = [\"disabled\"], Ls = {\n key: 0,\n class: \"material-symbols-outlined loading-icon\"\n}, Hs = /* @__PURE__ */ oe({\n __name: \"Login\",\n props: {\n headerTitle: { default: \"Login\" },\n headerSubtitle: { default: \"Enter your email and password to login\" }\n },\n emits: [\"loginFailed\", \"loginSuccess\"],\n setup(e, { emit: t }) {\n const o = t, n = R(\"\"), a = R(\"\"), r = R(!1), s = R(!1);\n function l(u) {\n if (u.preventDefault(), r.value = !0, s.value) {\n r.value = !1, o(\"loginFailed\");\n return;\n }\n r.value = !1, o(\"loginSuccess\");\n }\n return (u, i) => (h(), x(\"div\", ks, [\n w(\"div\", null, [\n w(\"div\", Is, [\n w(\"div\", Ms, [\n w(\"h1\", Cs, N(e.headerTitle), 1),\n w(\"p\", Es, N(e.headerSubtitle), 1)\n ]),\n w(\"form\", { onSubmit: l }, [\n w(\"div\", As, [\n w(\"div\", $s, [\n i[2] || (i[2] = w(\"label\", {\n id: \"login-email\",\n for: \"email\",\n class: \"aform_field-label\"\n }, \"Email\", -1)),\n K(w(\"input\", {\n id: \"email\",\n \"onUpdate:modelValue\": i[0] || (i[0] = (d) => n.value = d),\n class: \"aform_input-field\",\n name: \"email\",\n placeholder: \"name@example.com\",\n type: \"email\",\n \"auto-capitalize\": \"none\",\n \"auto-complete\": \"email\",\n \"auto-correct\": \"off\",\n disabled: r.value\n }, null, 8, Ts), [\n [we, n.value]\n ])\n ]),\n w(\"div\", Ds, [\n i[3] || (i[3] = w(\"label\", {\n id: \"login-password\",\n for: \"password\",\n class: \"aform_field-label\"\n }, \"Password\", -1)),\n K(w(\"input\", {\n id: \"password\",\n \"onUpdate:modelValue\": i[1] || (i[1] = (d) => a.value = d),\n class: \"aform_input-field\",\n name: \"password\",\n type: \"password\",\n disabled: r.value\n }, null, 8, Ss), [\n [we, a.value]\n ])\n ]),\n w(\"button\", {\n class: \"btn\",\n disabled: r.value || !n.value || !a.value,\n onClick: l\n }, [\n r.value ? (h(), x(\"span\", Ls, \"progress_activity\")) : Y(\"\", !0),\n i[4] || (i[4] = w(\"span\", { id: \"login-form-button\" }, \"Login\", -1))\n ], 8, Rs)\n ])\n ], 32),\n i[5] || (i[5] = w(\"button\", { class: \"btn\" }, [\n w(\"span\", { id: \"forgot-password-button\" }, \"Forgot password?\")\n ], -1))\n ])\n ])\n ]));\n }\n}), Ps = /* @__PURE__ */ Te(Hs, [[\"__scopeId\", \"data-v-d9ffd0a7\"]]);\nfunction Os(e) {\n e.use(Tl), e.component(\"ACheckbox\", Ol), e.component(\"ACombobox\", Bl), e.component(\"ADate\", Gl), e.component(\"ADropdown\", fa), e.component(\"ADatePicker\", Fa), e.component(\"AFieldset\", Ya), e.component(\"AFileAttach\", ns), e.component(\"AForm\", In), e.component(\"ANumericInput\", us), e.component(\"ATextInput\", xs);\n}\nexport {\n Ol as ACheckbox,\n Bl as AComboBox,\n Gl as ADate,\n Fa as ADatePicker,\n fa as ADropdown,\n Ya as AFieldset,\n ns as AFileAttach,\n In as AForm,\n us as ANumericInput,\n xs as ATextInput,\n Ps as Login,\n Os as install\n};\n//# sourceMappingURL=aform.js.map\n","<template>\n\t<footer>\n\t\t<ul class=\"tabs\">\n\t\t\t<li class=\"hidebreadcrumbs\" @click=\"toggleBreadcrumbs\" @keydown.enter=\"toggleBreadcrumbs\">\n\t\t\t\t<a tabindex=\"0\"><div :class=\"rotateHideTabIcon\">ร</div></a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tclass=\"hometab\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\"\n\t\t\t\t@click=\"navigateHome\"\n\t\t\t\t@keydown.enter=\"navigateHome\">\n\t\t\t\t<router-link to=\"/\" tabindex=\"0\">\n\t\t\t\t\t<svg class=\"icon\" aria-label=\"Home\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\">\n\t\t\t\t\t\t<path d=\"M3 12l9-9 9 9\" />\n\t\t\t\t\t\t<path d=\"M9 21V12h6v9\" />\n\t\t\t\t\t</svg>\n\t\t\t\t</router-link>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\t:class=\"['searchtab', { 'search-active': searchVisible }]\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<a tabindex=\"0\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tv-show=\"!searchVisible\"\n\t\t\t\t\t\tclass=\"icon search-icon\"\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\taria-label=\"Search\"\n\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\t\t@click=\"toggleSearch\"\n\t\t\t\t\t\t@keydown.enter=\"toggleSearch\">\n\t\t\t\t\t\t<circle cx=\"11\" cy=\"11\" r=\"7\" />\n\t\t\t\t\t\t<path d=\"M21 21l-4.35-4.35\" />\n\t\t\t\t\t</svg>\n\t\t\t\t\t<input\n\t\t\t\t\t\tv-show=\"searchVisible\"\n\t\t\t\t\t\tref=\"searchinput\"\n\t\t\t\t\t\tv-model=\"searchText\"\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tplaceholder=\"Search...\"\n\t\t\t\t\t\t@click.stop\n\t\t\t\t\t\t@input=\"handleSearchInput($event)\"\n\t\t\t\t\t\t@blur=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.enter=\"handleSearch($event)\"\n\t\t\t\t\t\t@keydown.escape=\"toggleSearch\" />\n\t\t\t\t</a>\n\t\t\t</li>\n\t\t\t<li\n\t\t\t\tv-for=\"breadcrumb in breadcrumbs\"\n\t\t\t\t:key=\"breadcrumb.title\"\n\t\t\t\t:style=\"{ display: breadcrumbsVisibile ? 'block' : 'none' }\">\n\t\t\t\t<router-link tabindex=\"0\" :to=\"breadcrumb.to\"> {{ breadcrumb.title }} </router-link>\n\t\t\t</li>\n\t\t</ul>\n\t</footer>\n</template>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, ref, useTemplateRef } from 'vue'\n\nconst { breadcrumbs = [] } = defineProps<{ breadcrumbs?: { title: string; to: string }[] }>()\n\nconst breadcrumbsVisibile = ref(true)\nconst searchVisible = ref(false)\nconst searchText = ref('')\nconst inputRef = useTemplateRef<HTMLInputElement>('searchinput')\n\nconst rotateHideTabIcon = computed(() => {\n\treturn breadcrumbsVisibile.value ? 'unrotated' : 'rotated'\n})\n\nconst toggleBreadcrumbs = () => {\n\tbreadcrumbsVisibile.value = !breadcrumbsVisibile.value\n}\n\nconst toggleSearch = async () => {\n\tsearchVisible.value = !searchVisible.value\n\tawait nextTick(() => {\n\t\tinputRef.value?.focus()\n\t})\n}\n\nconst handleSearchInput = (event: Event | MouseEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n}\n\nconst handleSearch = async (event: FocusEvent | KeyboardEvent) => {\n\tevent.preventDefault()\n\tevent.stopPropagation()\n\tawait toggleSearch()\n}\n\nconst navigateHome = (/* event: MouseEvent | KeyboardEvent */) => {\n\t// navigate home\n}\n</script>\n\n<style scoped>\nfooter {\n\tposition: fixed;\n\tbottom: 0px;\n\twidth: 100%;\n\tbackground-color: transparent;\n\theight: auto;\n\tmin-height: 2.4rem;\n\tz-index: 100;\n\ttext-align: left;\n\tfont-size: 100%;\n\tdisplay: flex;\n\tjustify-content: right;\n\tpadding: 0 0.75rem 0 0;\n\tbox-sizing: border-box;\n}\nul {\n\tdisplay: flex;\n\tflex-direction: row-reverse;\n\tmargin: 0;\n\tpadding: 0;\n\tlist-style: none;\n}\n\n.tabs li {\n\tfloat: left;\n\tlist-style-type: none;\n\tposition: relative;\n\tmargin-left: -1px;\n}\n\n/* Base tab styling */\n.tabs a {\n\tfloat: left;\n\tpadding: 0.5rem 1rem;\n\theight: 2.4rem;\n\tbox-sizing: border-box;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\ttext-decoration: none;\n\tcolor: var(--sc-gray-60, #666);\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tfont-size: 0.85rem;\n\tfont-family: var(--sc-font-family, system-ui, sans-serif);\n\ttransition: all 0.15s ease;\n\n\t/* Minimal ornamentation - subtle top radius only */\n\tborder-top-left-radius: 2px;\n\tborder-top-right-radius: 2px;\n}\n\n.tabs a:hover {\n\tbackground: var(--sc-btn-hover, #f2f2f2);\n}\n\n.tabs .router-link-active {\n\tz-index: 3;\n\tbackground: var(--sc-primary-color, #827553) !important;\n\tborder-color: var(--sc-primary-color, #827553) !important;\n\tcolor: var(--sc-primary-text-color, #fff) !important;\n}\n\n/* Pseudo-elements removed - minimal ornamentation style */\n\n/* Hide breadcrumbs tab */\n.hidebreadcrumbs a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n.hidebreadcrumbs a div {\n\tfont-size: 1.2rem;\n}\n\n.rotated {\n\ttransform: rotate(45deg);\n\t-webkit-transform: rotate(45deg);\n\t-moz-transform: rotate(45deg);\n\t-ms-transform: rotate(45deg);\n\t-o-transform: rotate(45deg);\n\ttransition: transform 250ms ease;\n}\n.unrotated {\n\ttransform: rotate(0deg);\n\t-webkit-transform: rotate(0deg);\n\t-moz-transform: rotate(0deg);\n\t-ms-transform: rotate(0deg);\n\t-o-transform: rotate(0deg);\n\ttransition: transform 250ms ease;\n}\n\nli:active,\nli:hover,\nli:focus,\nli > a:active,\nli > a:hover,\nli > a:focus {\n\tz-index: 3;\n}\n\na:active,\na:hover,\na:focus {\n\toutline: 2px solid var(--sc-input-active-border-color, black);\n\tz-index: 3;\n}\n\n/* Home tab */\n.hometab a {\n\tmin-width: 2.4rem;\n\twidth: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n}\n\n/* SVG icon styling */\n.icon {\n\twidth: 1rem;\n\theight: 1rem;\n\tstroke: currentColor;\n\tflex-shrink: 0;\n}\n\n/* Search tab with animation */\n.searchtab {\n\toverflow: hidden;\n}\n\n.searchtab a {\n\tmin-width: 2.4rem;\n\theight: 2.4rem;\n\tpadding: 0.5rem;\n\tbackground: var(--sc-btn-color, #ffffff);\n\tborder: 1px solid var(--sc-btn-border, #ccc);\n\tcolor: var(--sc-gray-60, #666);\n\toverflow: hidden;\n\t/* Animation for smooth expand/collapse */\n\tmax-width: 2.4rem;\n\ttransition: max-width 0.35s ease-in-out, padding 0.35s ease-in-out, background 0.2s ease;\n}\n\n.searchtab .search-icon {\n\tcursor: pointer;\n}\n\n.searchtab input {\n\toutline: none;\n\tborder: 1px solid var(--sc-input-border-color, #ccc);\n\tborder-radius: 0.25rem;\n\tbackground-color: var(--sc-form-background, #ffffff);\n\tcolor: var(--sc-gray-80, #333);\n\ttext-align: left;\n\tfont-size: 0.875rem;\n\tpadding: 0.25rem 0.5rem;\n\twidth: 180px;\n\theight: 1.5rem;\n\tflex-shrink: 0;\n\topacity: 0;\n\ttransition: opacity 0.2s ease-in-out;\n\ttransition-delay: 0s;\n}\n\n.searchtab input:focus {\n\tborder-color: var(--sc-input-active-border-color, #4f46e5);\n\toutline: none;\n}\n\n.searchtab input::placeholder {\n\tcolor: var(--sc-input-label-color, #999);\n}\n\n/* Search active state - expanded with animation */\n.searchtab.search-active a {\n\tmax-width: 200px;\n\tmin-width: auto;\n\twidth: auto;\n\tpadding: 0.5rem 0.75rem;\n}\n\n.searchtab.search-active input {\n\topacity: 1;\n\ttransition-delay: 0.15s;\n}\n</style>\n","<template>\n\t<div class=\"desktop\" @click=\"handleClick\">\n\t\t<!-- Action Set -->\n\t\t<ActionSet :elements=\"actionElements\" @action-click=\"handleActionClick\" />\n\n\t\t<!-- Main content using AForm -->\n\t\t<AForm v-if=\"currentViewSchema.length > 0\" v-model:data=\"currentViewData\" :schema=\"currentViewSchema\" />\n\t\t<div v-else-if=\"!stonecrop\" class=\"loading\"><p>Initializing Stonecrop...</p></div>\n\t\t<div v-else class=\"loading\">\n\t\t\t<p>Loading {{ currentView }} data...</p>\n\t\t</div>\n\n\t\t<!-- Sheet Navigation -->\n\t\t<SheetNav :breadcrumbs=\"navigationBreadcrumbs\" />\n\n\t\t<!-- Command Palette -->\n\t\t<CommandPalette\n\t\t\t:is-open=\"commandPaletteOpen\"\n\t\t\t:search=\"searchCommands\"\n\t\t\tplaceholder=\"Type a command or search...\"\n\t\t\t@select=\"executeCommand\"\n\t\t\t@close=\"commandPaletteOpen = false\">\n\t\t\t<template #title=\"{ result }\">\n\t\t\t\t{{ result.title }}\n\t\t\t</template>\n\t\t\t<template #content=\"{ result }\">\n\t\t\t\t{{ result.description }}\n\t\t\t</template>\n\t\t</CommandPalette>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { useStonecrop } from '@stonecrop/stonecrop'\nimport { AForm, type SchemaTypes, type TableColumn, type TableConfig } from '@stonecrop/aform'\nimport { computed, onMounted, provide, ref, unref, watch } from 'vue'\n\nimport ActionSet from './ActionSet.vue'\nimport SheetNav from './SheetNav.vue'\nimport CommandPalette from './CommandPalette.vue'\nimport type {\n\tActionElements,\n\tRouteAdapter,\n\tNavigationTarget,\n\tActionEventPayload,\n\tRecordOpenEventPayload,\n} from '../types'\n\nconst props = defineProps<{\n\tavailableDoctypes?: string[]\n\t/**\n\t * Pluggable router adapter. When provided, Desktop uses these functions for all\n\t * routing instead of reaching into the registry's internal Vue Router instance.\n\t * Nuxt hosts (or any host with custom route conventions) should supply this.\n\t */\n\trouteAdapter?: RouteAdapter\n\t/**\n\t * Replacement for the native `confirm()` dialog. Desktop calls this before\n\t * performing a destructive action. Return `true` to proceed.\n\t * Defaults to the native `window.confirm` if omitted.\n\t */\n\tconfirmFn?: (message: string) => boolean | Promise<boolean>\n}>()\n\nconst emit = defineEmits<{\n\t/**\n\t * Fired when the user triggers an FSM transition (action button click).\n\t * The host app is responsible for calling the server, persisting state, etc.\n\t */\n\taction: [payload: ActionEventPayload]\n\t/**\n\t * Fired when Desktop wants to navigate to a different view.\n\t * Also calls routeAdapter.navigate() if an adapter is provided.\n\t */\n\tnavigate: [target: NavigationTarget]\n\t/**\n\t * Fired when the user opens a specific record.\n\t */\n\t'record:open': [payload: RecordOpenEventPayload]\n}>()\n\nconst { availableDoctypes = [] } = props\n\nconst { stonecrop } = useStonecrop()\n\n// State\nconst loading = ref(false)\nconst commandPaletteOpen = ref(false)\n\n// HST-based form data management - field triggers are handled automatically by HST\n\n// Computed property that reads from HST store for reactive form data\nconst currentViewData = computed<Record<string, any>>({\n\tget() {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn {}\n\t\t}\n\n\t\ttry {\n\t\t\tconst record = stonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t\t// Return a plain shallow copy so AForm mutations don't propagate directly into\n\t\t\t// the HST reactive object, which would bypass field-trigger diffing and cause\n\t\t\t// setupDeepReactivity to fire triggers for all fields on every keystroke.\n\t\t\treturn { ...(record?.get('') || {}) }\n\t\t} catch {\n\t\t\treturn {}\n\t\t}\n\t},\n\tset(newData: Record<string, any>) {\n\t\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\t\treturn\n\t\t}\n\n\t\ttry {\n\t\t\t// Only update fields that actually changed to avoid triggering actions for unchanged fields\n\t\t\tconst hstStore = stonecrop.value.getStore()\n\t\t\tfor (const [fieldname, value] of Object.entries(newData)) {\n\t\t\t\tconst fieldPath = `${currentDoctype.value}.${currentRecordId.value}.${fieldname}`\n\t\t\t\tconst currentValue = hstStore.has(fieldPath) ? hstStore.get(fieldPath) : undefined\n\t\t\t\tif (currentValue !== value) {\n\t\t\t\t\thstStore.set(fieldPath, value)\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (error) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('HST update failed:', error)\n\t\t}\n\t},\n})\n\n// Computed properties for current route context.\n// When a routeAdapter is provided it takes full precedence over the registry's internal router.\nconst route = computed(() => (props.routeAdapter ? null : unref(stonecrop.value?.registry.router?.currentRoute)))\nconst router = computed(() => (props.routeAdapter ? null : stonecrop.value?.registry.router))\nconst currentDoctype = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentDoctype()\n\tif (!route.value) return ''\n\n\t// First check if we have actualDoctype in meta (from registered routes)\n\tif (route.value.meta?.actualDoctype) {\n\t\treturn route.value.meta.actualDoctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\n// The route doctype for display and navigation (e.g., 'todo')\nconst routeDoctype = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentDoctype()\n\tif (!route.value) return ''\n\n\t// Check route meta first\n\tif (route.value.meta?.doctype) {\n\t\treturn route.value.meta.doctype as string\n\t}\n\n\t// For named routes, use params.doctype\n\tif (route.value.params.doctype) {\n\t\treturn route.value.params.doctype as string\n\t}\n\n\t// For catch-all routes, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\treturn pathMatch[0]\n\t}\n\n\treturn ''\n})\n\nconst currentRecordId = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentRecordId()\n\tif (!route.value) return ''\n\n\t// For named routes, use params.recordId\n\tif (route.value.params.recordId) {\n\t\treturn route.value.params.recordId as string\n\t}\n\n\t// For catch-all routes that haven't been registered yet, extract from path\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 1) {\n\t\treturn pathMatch[1]\n\t}\n\n\treturn ''\n})\nconst isNewRecord = computed(() => currentRecordId.value?.startsWith('new-'))\n\n// Determine current view based on route\nconst currentView = computed(() => {\n\tif (props.routeAdapter) return props.routeAdapter.getCurrentView()\n\tif (!route.value) {\n\t\treturn 'doctypes'\n\t}\n\n\t// Home route\n\tif (route.value.name === 'home' || route.value.path === '/') {\n\t\treturn 'doctypes'\n\t}\n\n\t// Named routes from registered doctypes\n\tif (route.value.name && route.value.name !== 'catch-all') {\n\t\tconst routeName = route.value.name as string\n\t\tif (routeName.includes('form') || route.value.params.recordId) {\n\t\t\treturn 'record'\n\t\t} else if (routeName.includes('list') || route.value.params.doctype) {\n\t\t\treturn 'records'\n\t\t}\n\t}\n\n\t// Catch-all route - determine from path structure\n\tconst pathMatch = route.value.params.pathMatch as string[] | undefined\n\tif (pathMatch && pathMatch.length > 0) {\n\t\tconst view = pathMatch.length === 1 ? 'records' : 'record'\n\t\treturn view\n\t}\n\n\treturn 'doctypes'\n})\n\n// Computed properties (now that all helper functions are defined)\n// Helper function to get available transitions for current record.\n// Reads the actual FSM state from the record's `status` field (or falls back to the\n// workflow initial state) so the available action buttons always reflect reality.\nconst getAvailableTransitions = () => {\n\tif (!stonecrop.value || !currentDoctype.value || !currentRecordId.value) {\n\t\treturn []\n\t}\n\n\ttry {\n\t\tconst meta = stonecrop.value.registry.getDoctype(currentDoctype.value)\n\t\tif (!meta?.workflow) return []\n\n\t\t// Delegate state resolution to Stonecrop โ reads record 'status', falls back to workflow.initial\n\t\tconst currentState = stonecrop.value.getRecordState(currentDoctype.value, currentRecordId.value)\n\n\t\t// Delegate transition lookup to DoctypeMeta โ no more manual workflow introspection\n\t\tconst transitions = meta.getAvailableTransitions(currentState)\n\n\t\tconst recordData = currentViewData.value || {}\n\n\t\t// Each transition emits an 'action' event. The host app decides what to do\n\t\t// (call the server, trigger an FSM actor, update HST, etc.).\n\t\treturn transitions.map(({ name, targetState }) => ({\n\t\t\tlabel: `${name} (โ ${targetState})`,\n\t\t\taction: () => {\n\t\t\t\temit('action', {\n\t\t\t\t\tname,\n\t\t\t\t\tdoctype: currentDoctype.value,\n\t\t\t\t\trecordId: currentRecordId.value,\n\t\t\t\t\tdata: recordData,\n\t\t\t\t})\n\t\t\t},\n\t\t}))\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error getting available transitions:', error)\n\t\treturn []\n\t}\n}\n\nconst actionElements = computed<ActionElements[]>(() => {\n\tconst elements: ActionElements[] = []\n\n\tswitch (currentView.value) {\n\t\tcase 'records':\n\t\t\telements.push({\n\t\t\t\ttype: 'button',\n\t\t\t\tlabel: 'New Record',\n\t\t\t\taction: () => void createNewRecord(),\n\t\t\t})\n\t\t\tbreak\n\t\tcase 'record': {\n\t\t\t// Populate the Actions dropdown with every FSM transition available in the\n\t\t\t// record's current state. Clicking a transition emits 'action'.\n\t\t\tconst transitionActions = getAvailableTransitions()\n\t\t\tif (transitionActions.length > 0) {\n\t\t\t\telements.push({\n\t\t\t\t\ttype: 'dropdown',\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tactions: transitionActions,\n\t\t\t\t})\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn elements\n})\n\nconst navigationBreadcrumbs = computed(() => {\n\tconst breadcrumbs: { title: string; to: string }[] = []\n\n\tif (currentView.value === 'records' && routeDoctype.value) {\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` }\n\t\t)\n\t} else if (currentView.value === 'record' && routeDoctype.value) {\n\t\tconst recordPath = currentRecordId.value\n\t\t\t? `/${routeDoctype.value}/${currentRecordId.value}`\n\t\t\t: route.value?.fullPath ?? ''\n\t\tbreadcrumbs.push(\n\t\t\t{ title: 'Home', to: '/' },\n\t\t\t{ title: formatDoctypeName(routeDoctype.value), to: `/${routeDoctype.value}` },\n\t\t\t{ title: isNewRecord.value ? 'New Record' : 'Edit Record', to: recordPath }\n\t\t)\n\t}\n\n\treturn breadcrumbs\n})\n\n// Command palette functionality\ntype Command = {\n\ttitle: string\n\tdescription: string\n\taction: () => void\n}\n\nconst searchCommands = (query: string): Command[] => {\n\tconst commands: Command[] = [\n\t\t{\n\t\t\ttitle: 'Go Home',\n\t\t\tdescription: 'Navigate to the home page',\n\t\t\taction: () => void doNavigate({ view: 'doctypes' }),\n\t\t},\n\t\t{\n\t\t\ttitle: 'Toggle Command Palette',\n\t\t\tdescription: 'Open/close the command palette',\n\t\t\taction: () => (commandPaletteOpen.value = !commandPaletteOpen.value),\n\t\t},\n\t]\n\n\t// Add doctype-specific commands\n\tif (routeDoctype.value) {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(routeDoctype.value)} Records`,\n\t\t\tdescription: `Navigate to ${routeDoctype.value} list`,\n\t\t\taction: () => void doNavigate({ view: 'records', doctype: routeDoctype.value }),\n\t\t})\n\n\t\tcommands.push({\n\t\t\ttitle: `Create New ${formatDoctypeName(routeDoctype.value)}`,\n\t\t\tdescription: `Create a new ${routeDoctype.value} record`,\n\t\t\taction: () => void createNewRecord(),\n\t\t})\n\t}\n\n\t// Add available doctypes as commands\n\tavailableDoctypes.forEach(doctype => {\n\t\tcommands.push({\n\t\t\ttitle: `View ${formatDoctypeName(doctype)}`,\n\t\t\tdescription: `Navigate to ${doctype} list`,\n\t\t\taction: () => void doNavigate({ view: 'records', doctype }),\n\t\t})\n\t})\n\n\t// Filter commands based on query\n\tif (!query) return commands\n\n\treturn commands.filter(\n\t\tcmd =>\n\t\t\tcmd.title.toLowerCase().includes(query.toLowerCase()) ||\n\t\t\tcmd.description.toLowerCase().includes(query.toLowerCase())\n\t)\n}\n\nconst executeCommand = (command: Command) => {\n\tcommand.action()\n\tcommandPaletteOpen.value = false\n}\n\n// Helper functions - moved here to avoid \"before initialization\" errors\nconst formatDoctypeName = (doctype: string): string => {\n\treturn doctype\n\t\t.split('-')\n\t\t.map(word => word.charAt(0).toUpperCase() + word.slice(1))\n\t\t.join(' ')\n}\n\nconst getRecordCount = (doctype: string): number => {\n\tif (!stonecrop.value) return 0\n\tconst recordIds = stonecrop.value.getRecordIds(doctype)\n\treturn recordIds.length\n}\n\n// Internal navigation helper: emits 'navigate', then calls the adapter (if any)\n// or falls back to the registry's Vue Router instance.\nconst doNavigate = async (target: NavigationTarget) => {\n\temit('navigate', target)\n\tif (props.routeAdapter) {\n\t\tawait props.routeAdapter.navigate(target)\n\t} else {\n\t\tif (target.view === 'doctypes') {\n\t\t\tawait router.value?.push('/')\n\t\t} else if (target.view === 'records' && target.doctype) {\n\t\t\tawait router.value?.push(`/${target.doctype}`)\n\t\t} else if (target.view === 'record' && target.doctype && target.recordId) {\n\t\t\tawait router.value?.push(`/${target.doctype}/${target.recordId}`)\n\t\t}\n\t}\n}\n\nconst navigateToDoctype = async (doctype: string) => {\n\tawait doNavigate({ view: 'records', doctype })\n}\n\nconst openRecord = async (recordId: string) => {\n\tconst doctype = routeDoctype.value\n\temit('record:open', { doctype, recordId })\n\tawait doNavigate({ view: 'record', doctype, recordId })\n}\n\nconst createNewRecord = async () => {\n\tconst newId = `new-${Date.now()}`\n\tawait doNavigate({ view: 'record', doctype: routeDoctype.value, recordId: newId })\n}\n\n// Schema generator functions - moved here to be available to computed properties\nconst getDoctypesSchema = (): SchemaTypes[] => {\n\tif (!availableDoctypes.length) return []\n\n\tconst rows = availableDoctypes.map(doctype => ({\n\t\tid: doctype,\n\t\tdoctype,\n\t\tdisplay_name: formatDoctypeName(doctype),\n\t\trecord_count: getRecordCount(doctype),\n\t\tactions: 'View Records',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'doctypes_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Doctype',\n\t\t\t\t\tname: 'doctype',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Name',\n\t\t\t\t\tname: 'display_name',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '30ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Records',\n\t\t\t\t\tname: 'record_count',\n\t\t\t\t\tfieldtype: 'Int',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '15ch',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordsSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\tconst records = getRecords()\n\tconst columns = getColumns()\n\n\t// If no columns are available, let the template fallback handle the loading state\n\tif (columns.length === 0) {\n\t\treturn []\n\t}\n\n\tconst rows = records.map((record: any) => ({\n\t\t...record,\n\t\t// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n\t\tid: record.id || '',\n\t\tactions: 'Edit | Delete',\n\t}))\n\n\treturn [\n\t\t{\n\t\t\tfieldname: 'records_table',\n\t\t\tcomponent: 'ATable',\n\t\t\tcolumns: [\n\t\t\t\t...columns.map(col => ({\n\t\t\t\t\tlabel: col.label,\n\t\t\t\t\tname: col.fieldname,\n\t\t\t\t\tfieldtype: col.fieldtype,\n\t\t\t\t\talign: 'left',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t})),\n\t\t\t\t{\n\t\t\t\t\tlabel: 'Actions',\n\t\t\t\t\tname: 'actions',\n\t\t\t\t\tfieldtype: 'Data',\n\t\t\t\t\talign: 'center',\n\t\t\t\t\tedit: false,\n\t\t\t\t\twidth: '20ch',\n\t\t\t\t},\n\t\t\t] as TableColumn[],\n\t\t\tconfig: {\n\t\t\t\tview: 'list',\n\t\t\t\tfullWidth: true,\n\t\t\t} as TableConfig,\n\t\t\trows,\n\t\t},\n\t]\n}\n\nconst getRecordFormSchema = (): SchemaTypes[] => {\n\tif (!currentDoctype.value) return []\n\tif (!stonecrop.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value?.registry\n\t\tconst meta = registry?.registry[currentDoctype.value]\n\n\t\tif (!meta?.schema) {\n\t\t\t// Let the template fallback handle the loading state\n\t\t\treturn []\n\t\t}\n\n\t\t// Data is provided via v-model:data=\"currentViewData\" โ no need to spread values into schema\n\t\treturn 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t} catch {\n\t\treturn []\n\t}\n}\n\n// Additional data helper functions\nconst getRecords = () => {\n\tif (!stonecrop.value || !currentDoctype.value) {\n\t\treturn []\n\t}\n\n\tconst recordsNode = stonecrop.value.records(currentDoctype.value)\n\tconst recordsData = recordsNode?.get('')\n\n\tif (recordsData && typeof recordsData === 'object' && !Array.isArray(recordsData)) {\n\t\treturn Object.values(recordsData as Record<string, any>)\n\t}\n\n\treturn []\n}\n\nconst getColumns = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return []\n\n\ttry {\n\t\tconst registry = stonecrop.value.registry\n\t\tconst meta = registry.registry[currentDoctype.value]\n\n\t\tif (meta?.schema) {\n\t\t\tconst schemaArray = 'toArray' in meta.schema ? meta.schema.toArray() : meta.schema\n\t\t\treturn schemaArray.map(field => ({\n\t\t\t\tfieldname: field.fieldname,\n\t\t\t\tlabel: ('label' in field && field.label) || field.fieldname,\n\t\t\t\tfieldtype: ('fieldtype' in field && field.fieldtype) || 'Data',\n\t\t\t}))\n\t\t}\n\t} catch {\n\t\t// Error getting schema - return empty array\n\t}\n\n\treturn []\n}\n\n// Schema for different views - defined here after all helper functions are available\nconst currentViewSchema = computed<SchemaTypes[]>(() => {\n\tswitch (currentView.value) {\n\t\tcase 'doctypes':\n\t\t\treturn getDoctypesSchema()\n\t\tcase 'records':\n\t\t\treturn getRecordsSchema()\n\t\tcase 'record':\n\t\t\treturn getRecordFormSchema()\n\t\tdefault:\n\t\t\treturn []\n\t}\n})\n\nconst handleActionClick = (_label: string, action: (() => void | Promise<void>) | undefined) => {\n\tif (action) {\n\t\tvoid action()\n\t}\n}\n\n// Desktop does NOT own the delete lifecycle โ it asks for confirmation, then emits\n// an 'action' event. The host app is responsible for removing the record from HST\n// and calling the server.\nconst handleDelete = async (recordId?: string) => {\n\tconst targetRecordId = recordId || currentRecordId.value\n\tif (!targetRecordId) return\n\n\tconst confirmed = props.confirmFn\n\t\t? await props.confirmFn('Are you sure you want to delete this record?')\n\t\t: confirm('Are you sure you want to delete this record?')\n\n\tif (confirmed) {\n\t\temit('action', {\n\t\t\tname: 'DELETE',\n\t\t\tdoctype: currentDoctype.value,\n\t\t\trecordId: targetRecordId,\n\t\t\tdata: currentViewData.value || {},\n\t\t})\n\t}\n}\n\n// Event handlers\nconst handleClick = async (event: Event) => {\n\tconst target = event.target as HTMLElement\n\tconst action = target.getAttribute('data-action')\n\n\tif (action === 'create') {\n\t\tawait createNewRecord()\n\t}\n\n\t// Handle table cell clicks for actions\n\tconst cell = target.closest('td, th')\n\tif (cell) {\n\t\tconst cellText = cell.textContent?.trim()\n\t\tconst row = cell.closest('tr')\n\n\t\tif (cellText === 'View Records' && row) {\n\t\t\t// Get the doctype from the row data\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst doctypeCell = cells[1] // Assuming doctype is in second column (first column is index)\n\t\t\t\tconst doctype = doctypeCell.textContent?.trim()\n\t\t\t\tif (doctype) {\n\t\t\t\t\tawait navigateToDoctype(doctype)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Edit') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait openRecord(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (cellText?.includes('Delete') && row) {\n\t\t\t// Get the record ID from the row\n\t\t\tconst cells = row.querySelectorAll('td')\n\t\t\tif (cells.length > 0) {\n\t\t\t\tconst idCell = cells[0] // Assuming ID is in first column\n\t\t\t\tconst recordId = idCell.textContent?.trim()\n\t\t\t\tif (recordId) {\n\t\t\t\t\tawait handleDelete(recordId)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst loadRecordData = () => {\n\tif (!stonecrop.value || !currentDoctype.value) return\n\n\tloading.value = true\n\n\ttry {\n\t\tif (!isNewRecord.value) {\n\t\t\t// For existing records, ensure the record exists in HST.\n\t\t\t// The computed currentViewData will automatically read from HST.\n\t\t\tstonecrop.value.getRecordById(currentDoctype.value, currentRecordId.value)\n\t\t}\n\t\t// For new records, currentViewData computed property will return {} automatically.\n\t} catch (error) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn('Error loading record data:', error)\n\t} finally {\n\t\tloading.value = false\n\t}\n}\n\n// Watch for route changes to load appropriate data\nwatch(\n\t[currentView, currentDoctype, currentRecordId],\n\t() => {\n\t\tif (currentView.value === 'record') {\n\t\t\tloadRecordData()\n\t\t}\n\t},\n\t{ immediate: true }\n)\n\n// Stonecrop reactive computed properties update automatically when the instance\n// becomes available โ no manual watcher needed.\n\n// Provide navigation helpers and an emitAction convenience function to child components.\nconst desktopMethods = {\n\tnavigateToDoctype,\n\topenRecord,\n\tcreateNewRecord,\n\thandleDelete,\n\t/**\n\t * Convenience wrapper so child components (e.g. slot content) can emit\n\t * an action event without needing a direct reference to the emit function.\n\t */\n\temitAction: (name: string, data?: Record<string, any>) => {\n\t\temit('action', {\n\t\t\tname,\n\t\t\tdoctype: currentDoctype.value,\n\t\t\trecordId: currentRecordId.value,\n\t\t\tdata: data ?? currentViewData.value ?? {},\n\t\t})\n\t},\n}\n\nprovide('desktopMethods', desktopMethods)\n\nonMounted(() => {\n\t// Add keyboard shortcuts\n\tconst handleKeydown = (event: KeyboardEvent) => {\n\t\t// Ctrl+K or Cmd+K to open command palette\n\t\tif ((event.ctrlKey || event.metaKey) && event.key === 'k') {\n\t\t\tevent.preventDefault()\n\t\t\tcommandPaletteOpen.value = true\n\t\t}\n\t\t// Escape to close command palette\n\t\tif (event.key === 'Escape' && commandPaletteOpen.value) {\n\t\t\tcommandPaletteOpen.value = false\n\t\t}\n\t}\n\n\tdocument.addEventListener('keydown', handleKeydown)\n\n\t// Cleanup event listener on unmount\n\treturn () => {\n\t\tdocument.removeEventListener('keydown', handleKeydown)\n\t}\n})\n</script>\n","import { App, type Plugin } from 'vue'\n\nimport ActionSet from '../components/ActionSet.vue'\nimport CommandPalette from '../components/CommandPalette.vue'\nimport Desktop from '../components/Desktop.vue'\nimport SheetNav from '../components/SheetNav.vue'\n\n/**\n * This is the main plugin that will be used to register all the desktop components.\n * @public\n */\nconst plugin: Plugin = {\n\tinstall: (app: App) => {\n\t\tapp.component('ActionSet', ActionSet)\n\t\tapp.component('CommandPalette', CommandPalette)\n\t\tapp.component('Desktop', Desktop)\n\t\tapp.component('SheetNav', SheetNav)\n\t},\n}\n\nexport default plugin\n"],"names":["emit","__emit","dropdownStates","ref","isOpen","timeoutId","hover","closeClicked","onMounted","closeDropdowns","onHover","onHoverLeave","toggleDropdown","index","showDropdown","handleClick","action","label","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_1","_cache","$event","_openBlock","_Fragment","_renderList","__props","el","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_withDirectives","_hoisted_5","_hoisted_6","item","itemIndex","_hoisted_7","_hoisted_9","_vShow","query","selectedIndex","inputRef","useTemplateRef","results","computed","watch","nextTick","closeModal","handleKeydown","e","selectResult","result","_createBlock","_Teleport","_createVNode","_Transition","_renderSlot","_ctx","IS_CLIENT","activePinia","setActivePinia","pinia","piniaSymbol","isPlainObject","o","MutationType","patchObject","newState","oldState","key","subPatch","targetValue","isRef","isReactive","noop","addSubscription","subscriptions","callback","detached","onCleanup","removeSubscription","getCurrentScope","onScopeDispose","triggerSubscriptions","args","fallbackRunWithContext","fn","ACTION_MARKER","ACTION_NAME","mergeReactiveObjects","target","patchToApply","value","skipHydrateSymbol","shouldHydrate","obj","assign","isComputed","createOptionsStore","id","options","hot","state","actions","getters","initialState","store","setup","localState","toRefs","computedGetters","name","markRaw","createSetupStore","$id","isOptionsStore","scope","optionsForPlugin","$subscribeOptions","event","isListening","debuggerEvents","isSyncListening","actionSubscriptions","hotState","activeListener","$patch","partialStateOrMutator","subscriptionMutation","myListenerId","$reset","$state","$dispose","wrappedAction","afterCallbackSet","onErrorCallbackSet","after","onError","ret","error","_hmrPayload","partialStore","stopWatcher","reactive","setupStore","effectScope","prop","toRef","actionValue","toRaw","newStore","stateKey","newStateTarget","oldStateSource","actionName","actionFn","getterName","getter","getterValue","nonEnumerable","p","extender","extensions","defineStore","setupOptions","isSetupStore","useStore","hasContext","hasInjectionContext","inject","hotId","currentInstance","getCurrentInstance","vm","cache","storeToRefs","rawStore","refs","De","Le","Me","Re","Fe","Pe","ye","Ie","L","Ne","r","n","i","Ae","xe","a","ce","_e","Se","Be","U","Ve","c","d","We","ve","de","ze","j","He","H","Q","_","Ee","S","$","D","ne","oe","Ue","qe","Je","Ke","je","ge","Ge","m","N","F","we","R","O","b","g","I","w","x","B","A","M","G","W","C","k","J","Ze","le","ie","Xe","re","ke","u","l","h","y","f","T","P","V","v","ee","q","pe","Y","se","t","et","Oe","ue","s","ht","fe","be","z","me","K","Z","ae","Ce","tt","he","Te","Ot","pt","mt","Qn","un","Rt","St","bt","xt","io","E","qo","wn","Xl","Ct","Et","ta","oa","Ua","Wa","Ga","za","gt","cn","X","ct","ft","In","breadcrumbsVisibile","searchVisible","searchText","rotateHideTabIcon","toggleBreadcrumbs","toggleSearch","handleSearchInput","handleSearch","navigateHome","_component_router_link","_withKeys","breadcrumb","_createTextVNode","props","availableDoctypes","stonecrop","useStonecrop","loading","commandPaletteOpen","currentViewData","currentDoctype","currentRecordId","newData","hstStore","fieldname","fieldPath","route","unref","router","pathMatch","routeDoctype","isNewRecord","currentView","routeName","getAvailableTransitions","meta","currentState","transitions","recordData","targetState","actionElements","elements","createNewRecord","transitionActions","navigationBreadcrumbs","breadcrumbs","formatDoctypeName","recordPath","searchCommands","commands","doNavigate","doctype","cmd","executeCommand","command","word","getRecordCount","navigateToDoctype","openRecord","recordId","newId","getDoctypesSchema","rows","getRecordsSchema","records","getRecords","columns","getColumns","record","col","getRecordFormSchema","recordsData","field","currentViewSchema","handleActionClick","_label","handleDelete","targetRecordId","cell","cellText","row","cells","loadRecordData","provide","data","ActionSet","_unref","AForm","SheetNav","CommandPalette","_withCtx","plugin","app","Desktop"],"mappings":";;;;;;;;AAyEA,UAAMA,IAAOC,GAKPC,IAAiBC,EAA6B,EAAE,GAEhDC,IAASD,EAAI,EAAK,GAClBE,IAAYF,EAAY,EAAE,GAC1BG,IAAQH,EAAI,EAAK,GACjBI,IAAeJ,EAAI,EAAK;AAE9B,IAAAK,GAAU,MAAM;AACf,MAAAC,EAAA;AAAA,IACD,CAAC;AAED,UAAMA,IAAiB,MAAM;AAC5B,MAAAP,EAAe,QAAQ,CAAA;AAAA,IACxB,GAEMQ,IAAU,MAAM;AACrB,MAAAJ,EAAM,QAAQ,IACdD,EAAU,QAAQ,WAAW,MAAM;AAClC,QAAIC,EAAM,UACTF,EAAO,QAAQ;AAAA,MAEjB,GAAG,GAAG;AAAA,IACP,GAEMO,IAAe,MAAM;AAC1B,MAAAL,EAAM,QAAQ,IACdC,EAAa,QAAQ,IACrB,aAAaF,EAAU,KAAK,GAC5BD,EAAO,QAAQ;AAAA,IAChB,GAEMQ,IAAiB,CAACC,MAAkB;AACzC,YAAMC,IAAe,CAACZ,EAAe,MAAMW,CAAK;AAChD,MAAAJ,EAAA,GACIK,MACHZ,EAAe,MAAMW,CAAK,IAAI;AAAA,IAEhC,GAEME,IAAc,CAACC,GAAkDC,MAAkB;AAExF,MAAAjB,EAAK,eAAeiB,GAAOD,CAAM;AAAA,IAClC;2BAvHCE,EA+DM,OAAA;AAAA,MA9DJ,OAAKC,GAAA,CAAA,EAAA,YAAgBf,EAAA,OAAM,sBAAwBG,EAAA,MAAA,GAC9C,qBAAqB,CAAA;AAAA,MAC1B,aAAWG;AAAA,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