orion-design 0.1.31 → 0.1.33
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/Throne/hooks/use-throne-context.d.ts +5 -0
- package/dist/Throne/hooks/use-throne-context.js +15 -0
- package/dist/Throne/hooks/use-throne-context.js.map +1 -0
- package/dist/Throne/index.d.ts +1 -1
- package/dist/Throne/index.js +14 -30
- package/dist/Throne/index.js.map +1 -1
- package/dist/components/Button/ButtonGroup/ButtonGroup.d.ts +2 -0
- package/dist/components/Button/index.js +36 -41
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Flex/index.js +89 -122
- package/dist/components/Flex/index.js.map +1 -1
- package/dist/components/Form/FileInput/FileInput.vue.d.ts +4 -4
- package/dist/components/Form/Form.js +2 -2
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/LovInput/LovInput.js +2 -2
- package/dist/components/Form/LovInput/LovInput.js.map +1 -1
- package/dist/components/Form/LovInput/LovInput.vue.d.ts +894 -0
- package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
- package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
- package/dist/components/Form/LovInput/index.js +4 -4
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.d.ts +26 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.js +5 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.js.map +1 -0
- package/dist/components/Form/MultiTableSelect/MultiTableSelect.vue.d.ts +6249 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.d.ts +1 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js +9 -0
- package/dist/components/Form/MultiTableSelect/hooks/useMultiTableSelect.js.map +1 -0
- package/dist/components/Form/MultiTableSelect/index.d.ts +2 -0
- package/dist/components/Form/MultiTableSelect/index.js +7 -0
- package/dist/components/Form/MultiTableSelect/index.js.map +1 -0
- package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
- package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
- package/dist/components/Form/hooks/index.js +69 -127
- package/dist/components/Form/hooks/index.js.map +1 -1
- package/dist/components/Form/index.d.ts +3 -0
- package/dist/components/Form/index.js +790 -829
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Form/utils/index.js +18 -30
- package/dist/components/Form/utils/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +510 -6
- package/dist/components/LovTable/LovQuerytable.vue.d.ts +468 -4
- package/dist/components/LovTable/index.d.ts +489 -5
- package/dist/components/LovTable/index.js +104 -179
- package/dist/components/LovTable/index.js.map +1 -1
- package/dist/components/Modal/index.js +56 -111
- package/dist/components/Modal/index.js.map +1 -1
- package/dist/components/Modal/types.d.ts +1 -1
- package/dist/components/Modal/types.js +3 -4
- package/dist/components/Modal/types.js.map +1 -1
- package/dist/components/Modal/useModal.js +5 -5
- package/dist/components/Modal/useModal.js.map +1 -1
- package/dist/components/MultiTableSelectPagetable/MultiTableSelectPagetable.vue.d.ts +880 -0
- package/dist/components/MultiTableSelectPagetable/index.d.ts +462 -0
- package/dist/components/MultiTableSelectPagetable/index.js +164 -0
- package/dist/components/MultiTableSelectPagetable/index.js.map +1 -0
- package/dist/components/Pagetable/Pagetable.d.ts +96 -3
- package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +1 -1
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +14 -1
- package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +14 -1
- package/dist/components/Pagetable/hooks/useCode.d.ts +2 -0
- package/dist/components/Pagetable/hooks/useCode.js +24 -0
- package/dist/components/Pagetable/hooks/useCode.js.map +1 -0
- package/dist/components/Pagetable/hooks/useColumns.js +85 -88
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +159 -2
- package/dist/components/Pagetable/index.js +601 -684
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +54 -92
- package/dist/components/Pagetable/utils/index.js.map +1 -1
- package/dist/components/Querytable/Querytable.d.ts +80 -2
- package/dist/components/Querytable/columns/QuerytableColumnButtongroup.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnDate.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnDiy.d.ts +1 -1
- package/dist/components/Querytable/columns/QuerytableColumnLink.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnMultiselect.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnNumber.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnSingleselect.d.ts +14 -1
- package/dist/components/Querytable/columns/QuerytableColumnString.d.ts +14 -1
- package/dist/components/Querytable/hooks/useColumns.js +79 -82
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.d.ts +147 -1
- package/dist/components/Querytable/index.js +526 -579
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/Querytable/utils/index.js +54 -92
- package/dist/components/Querytable/utils/index.js.map +1 -1
- package/dist/components/RichTextEditor/index.js +74 -100
- package/dist/components/RichTextEditor/index.js.map +1 -1
- package/dist/components/Tabs/constants.js +2 -2
- package/dist/components/Tabs/constants.js.map +1 -1
- package/dist/components/Tabs/index.js +358 -603
- package/dist/components/Tabs/index.js.map +1 -1
- package/dist/components/Tabs/tab-bar.js +6 -6
- package/dist/components/Tabs/tab-bar.js.map +1 -1
- package/dist/components/Tabs/tab-pane.js +3 -3
- package/dist/components/Tabs/tab-pane.js.map +1 -1
- package/dist/components/Throne/ThroneContextProvider.d.ts +25 -0
- package/dist/components/_constants/aria.js +2 -2
- package/dist/components/_constants/aria.js.map +1 -1
- package/dist/components/_constants/event.js +4 -6
- package/dist/components/_constants/event.js.map +1 -1
- package/dist/components/_constants/index.js +6 -6
- package/dist/components/_hooks/index.js +7 -7
- package/dist/components/_hooks/use-namespace/index.js +39 -74
- package/dist/components/_hooks/use-namespace/index.js.map +1 -1
- package/dist/components/_hooks/use-ordered-children/index.js +19 -29
- package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
- package/dist/components/_util/arrays.js +5 -9
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js +6 -6
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/classNames.js +17 -22
- package/dist/components/_util/classNames.js.map +1 -1
- package/dist/components/_util/dom/aria.js +39 -74
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js +8 -9
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js +7 -14
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/index.js +36 -36
- package/dist/components/_util/dom/position.js +25 -49
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js +61 -103
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js +50 -65
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js +4 -8
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js +11 -12
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/functions.js +3 -3
- package/dist/components/_util/i18n.js +2 -2
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/index.js +137 -137
- package/dist/components/_util/isValid.js +2 -4
- package/dist/components/_util/isValid.js.map +1 -1
- package/dist/components/_util/objects.js +14 -18
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/props-util/index.js +20 -46
- package/dist/components/_util/props-util/index.js.map +1 -1
- package/dist/components/_util/props-util/initDefaultProps.js +10 -18
- package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
- package/dist/components/_util/raf.js +4 -5
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js +3 -4
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js +8 -9
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js +10 -16
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/type.js +38 -41
- package/dist/components/_util/type.js.map +1 -1
- package/dist/components/_util/types.js +22 -41
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js +2 -2
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/util.js +43 -85
- package/dist/components/_util/util.js.map +1 -1
- package/dist/components/_util/vue/global-node.js +15 -27
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js +25 -29
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/index.js +41 -41
- package/dist/components/_util/vue/install.js +18 -35
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/index.js +6 -6
- package/dist/components/_util/vue/props/runtime.js +30 -46
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js +6 -12
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js +3 -5
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js +4 -5
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js +54 -100
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/_util/vue-types/index.js +220 -231
- package/dist/components/_util/vue-types/index.js.map +1 -1
- package/dist/components/components.d.ts +2 -0
- package/dist/components/components.js +24 -20
- package/dist/components/components.js.map +1 -1
- package/dist/components/index.js +43 -38
- package/dist/components/index.js.map +1 -1
- package/dist/components-DP9bnDLm.js +48 -0
- package/dist/components-DP9bnDLm.js.map +1 -0
- package/dist/error/OrionError.js +4 -8
- package/dist/error/OrionError.js.map +1 -1
- package/dist/{index-C6P_0wAy.js → index-ChkLOmNK.js} +76 -46
- package/dist/{index-C6P_0wAy.js.map → index-ChkLOmNK.js.map} +1 -1
- package/dist/index.css +1 -797
- package/dist/index.d.ts +1 -0
- package/dist/index.js +46 -36
- package/dist/index.js.map +1 -1
- package/dist/print/LodopFuncs.js +43 -101
- package/dist/print/LodopFuncs.js.map +1 -1
- package/dist/print/index.js +108 -200
- package/dist/print/index.js.map +1 -1
- package/dist/request/ErrorHandlerChain.js +14 -17
- package/dist/request/ErrorHandlerChain.js.map +1 -1
- package/dist/request/RequestFilterChain.js +13 -16
- package/dist/request/RequestFilterChain.js.map +1 -1
- package/dist/request/ResponseParserChain.js +14 -17
- package/dist/request/ResponseParserChain.js.map +1 -1
- package/dist/request/disivion/DateSerializer.js +22 -47
- package/dist/request/disivion/DateSerializer.js.map +1 -1
- package/dist/request/disivion/DivisionErrorHandler.js +25 -40
- package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
- package/dist/request/disivion/DivisionResponseParser.js +10 -16
- package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
- package/dist/request/disivion/index.js +201 -305
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/error/BizExceptionResponseError.js +5 -11
- package/dist/request/error/BizExceptionResponseError.js.map +1 -1
- package/dist/request/error/ExceptionResponseError.js +5 -11
- package/dist/request/error/ExceptionResponseError.js.map +1 -1
- package/dist/request/error/ResponseError.js +4 -9
- package/dist/request/error/ResponseError.js.map +1 -1
- package/dist/request/error/SessionExceptionResponseError.js +5 -11
- package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
- package/dist/request/index.js +11 -11
- package/dist/utils/DateUtil.js +33 -48
- package/dist/utils/DateUtil.js.map +1 -1
- package/dist/utils/NumberUtil.js +6 -6
- package/dist/utils/NumberUtil.js.map +1 -1
- package/dist/utils/cloneDeep.js +2 -2
- package/dist/utils/delay.js +3 -3
- package/dist/utils/delay.js.map +1 -1
- package/dist/utils/functions.js +3 -3
- package/dist/utils/index.js +12 -12
- package/dist/utils/md5.js +93 -191
- package/dist/utils/md5.js.map +1 -1
- package/dist/utils/uuid.js +25 -35
- package/dist/utils/uuid.js.map +1 -1
- package/dist/version/index.js +2 -2
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +2 -2
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
- package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
- package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
- package/dist/components-8oZ2kpUC.js +0 -27
- package/dist/components-8oZ2kpUC.js.map +0 -1
- package/dist/components-B3d9m_tn.js +0 -27
- package/dist/components-B3d9m_tn.js.map +0 -1
- package/dist/functions-BeMkokbY.js +0 -63
- package/dist/functions-BeMkokbY.js.map +0 -1
- package/dist/index-BOKLZnqH.js +0 -54
- package/dist/index-BOKLZnqH.js.map +0 -1
- package/dist/index-D1m0KTpK.js +0 -69
- package/dist/index-D1m0KTpK.js.map +0 -1
- package/dist/index-DR5ZP7mD.js +0 -160
- package/dist/index-DR5ZP7mD.js.map +0 -1
- package/dist/index-DkwIULcN.js +0 -200
- package/dist/index-DkwIULcN.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../node_modules/@vueuse/core/index.mjs","../../../src/components/Tabs/tab-bar.vue","../../../src/components/Tabs/tab-nav.tsx","../../../src/components/Tabs/tabs.tsx","../../../src/components/Tabs/tab-pane.vue","../../../src/components/Tabs/index.ts"],"sourcesContent":["import { noop, resolveUnref, isClient, isString, tryOnScopeDispose, isIOS, tryOnMounted, computedWithControl, promiseTimeout, isFunction, resolveRef, increaseWithUnit, useTimeoutFn, pausableWatch, createEventHook, timestamp, pausableFilter, watchIgnorable, debounceFilter, createFilterWrapper, bypassFilter, createSingletonPromise, toRefs, containsProp, until, hasOwn, throttleFilter, useDebounceFn, useThrottleFn, isObject, isNumber, useIntervalFn, clamp, syncRef, objectPick, tryOnUnmounted, watchWithFilter, identity, isDef } from '@vueuse/shared';\nexport * from '@vueuse/shared';\nimport { isRef, ref, shallowRef, watchEffect, computed, inject, unref, watch, getCurrentInstance, customRef, onUpdated, reactive, nextTick, onMounted, markRaw, readonly, getCurrentScope, isVue2, set, del, isReadonly, onBeforeUpdate } from 'vue-demi';\n\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n let options;\n if (isRef(optionsOrRef)) {\n options = {\n evaluating: optionsOrRef\n };\n } else {\n options = optionsOrRef || {};\n }\n const {\n lazy = false,\n evaluating = void 0,\n shallow = false,\n onError = noop\n } = options;\n const started = ref(!lazy);\n const current = shallow ? shallowRef(initialState) : ref(initialState);\n let counter = 0;\n watchEffect(async (onInvalidate) => {\n if (!started.value)\n return;\n counter++;\n const counterAtBeginning = counter;\n let hasFinished = false;\n if (evaluating) {\n Promise.resolve().then(() => {\n evaluating.value = true;\n });\n }\n try {\n const result = await evaluationCallback((cancelCallback) => {\n onInvalidate(() => {\n if (evaluating)\n evaluating.value = false;\n if (!hasFinished)\n cancelCallback();\n });\n });\n if (counterAtBeginning === counter)\n current.value = result;\n } catch (e) {\n onError(e);\n } finally {\n if (evaluating && counterAtBeginning === counter)\n evaluating.value = false;\n hasFinished = true;\n }\n });\n if (lazy) {\n return computed(() => {\n started.value = true;\n return current.value;\n });\n } else {\n return current;\n }\n}\n\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n let source = inject(key);\n if (defaultSource)\n source = inject(key, defaultSource);\n if (treatDefaultAsFactory)\n source = inject(key, defaultSource, treatDefaultAsFactory);\n if (typeof options === \"function\") {\n return computed((ctx) => options(source, ctx));\n } else {\n return computed({\n get: (ctx) => options.get(source, ctx),\n set: options.set\n });\n }\n}\n\nconst createUnrefFn = (fn) => {\n return function(...args) {\n return fn.apply(this, args.map((i) => unref(i)));\n };\n};\n\nfunction unrefElement(elRef) {\n var _a;\n const plain = resolveUnref(elRef);\n return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;\n}\n\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n\nfunction useEventListener(...args) {\n let target;\n let events;\n let listeners;\n let options;\n if (isString(args[0]) || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n if (!target)\n return noop;\n if (!Array.isArray(events))\n events = [events];\n if (!Array.isArray(listeners))\n listeners = [listeners];\n const cleanups = [];\n const cleanup = () => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n };\n const register = (el, event, listener, options2) => {\n el.addEventListener(event, listener, options2);\n return () => el.removeEventListener(event, listener, options2);\n };\n const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {\n cleanup();\n if (!el)\n return;\n cleanups.push(...events.flatMap((event) => {\n return listeners.map((listener) => register(el, event, listener, options2));\n }));\n }, { immediate: true, flush: \"post\" });\n const stop = () => {\n stopWatch();\n cleanup();\n };\n tryOnScopeDispose(stop);\n return stop;\n}\n\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n if (!window)\n return;\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n Array.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop));\n }\n let shouldListen = true;\n const shouldIgnore = (event) => {\n return ignore.some((target2) => {\n if (typeof target2 === \"string\") {\n return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));\n } else {\n const el = unrefElement(target2);\n return el && (event.target === el || event.composedPath().includes(el));\n }\n });\n };\n const listener = (event) => {\n const el = unrefElement(target);\n if (!el || el === event.target || event.composedPath().includes(el))\n return;\n if (event.detail === 0)\n shouldListen = !shouldIgnore(event);\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n handler(event);\n };\n const cleanup = [\n useEventListener(window, \"click\", listener, { passive: true, capture }),\n useEventListener(window, \"pointerdown\", (e) => {\n const el = unrefElement(target);\n if (el)\n shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);\n }, { passive: true }),\n detectIframe && useEventListener(window, \"blur\", (event) => {\n var _a;\n const el = unrefElement(target);\n if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === \"IFRAME\" && !(el == null ? void 0 : el.contains(window.document.activeElement)))\n handler(event);\n })\n ].filter(Boolean);\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nvar __defProp$n = Object.defineProperty;\nvar __defProps$9 = Object.defineProperties;\nvar __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$p = Object.getOwnPropertySymbols;\nvar __hasOwnProp$p = Object.prototype.hasOwnProperty;\nvar __propIsEnum$p = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$n = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$p.call(b, prop))\n __defNormalProp$n(a, prop, b[prop]);\n if (__getOwnPropSymbols$p)\n for (var prop of __getOwnPropSymbols$p(b)) {\n if (__propIsEnum$p.call(b, prop))\n __defNormalProp$n(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));\nconst createKeyPredicate = (keyFilter) => {\n if (typeof keyFilter === \"function\")\n return keyFilter;\n else if (typeof keyFilter === \"string\")\n return (event) => event.key === keyFilter;\n else if (Array.isArray(keyFilter))\n return (event) => keyFilter.includes(event.key);\n return () => true;\n};\nfunction onKeyStroke(...args) {\n let key;\n let handler;\n let options = {};\n if (args.length === 3) {\n key = args[0];\n handler = args[1];\n options = args[2];\n } else if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n key = true;\n handler = args[0];\n options = args[1];\n } else {\n key = args[0];\n handler = args[1];\n }\n } else {\n key = true;\n handler = args[0];\n }\n const { target = defaultWindow, eventName = \"keydown\", passive = false } = options;\n const predicate = createKeyPredicate(key);\n const listener = (e) => {\n if (predicate(e))\n handler(e);\n };\n return useEventListener(target, eventName, listener, passive);\n}\nfunction onKeyDown(key, handler, options = {}) {\n return onKeyStroke(key, handler, __spreadProps$9(__spreadValues$n({}, options), { eventName: \"keydown\" }));\n}\nfunction onKeyPressed(key, handler, options = {}) {\n return onKeyStroke(key, handler, __spreadProps$9(__spreadValues$n({}, options), { eventName: \"keypress\" }));\n}\nfunction onKeyUp(key, handler, options = {}) {\n return onKeyStroke(key, handler, __spreadProps$9(__spreadValues$n({}, options), { eventName: \"keyup\" }));\n}\n\nconst DEFAULT_DELAY = 500;\nfunction onLongPress(target, handler, options) {\n var _a, _b;\n const elementRef = computed(() => unrefElement(target));\n let timeout;\n function clear() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = void 0;\n }\n }\n function onDown(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n clear();\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n timeout = setTimeout(() => handler(ev), (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY);\n }\n const listenerOptions = {\n capture: (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.capture,\n once: (_b = options == null ? void 0 : options.modifiers) == null ? void 0 : _b.once\n };\n useEventListener(elementRef, \"pointerdown\", onDown, listenerOptions);\n useEventListener(elementRef, \"pointerup\", clear, listenerOptions);\n useEventListener(elementRef, \"pointerleave\", clear, listenerOptions);\n}\n\nconst isFocusedElementEditable = () => {\n const { activeElement, body } = document;\n if (!activeElement)\n return false;\n if (activeElement === body)\n return false;\n switch (activeElement.tagName) {\n case \"INPUT\":\n case \"TEXTAREA\":\n return true;\n }\n return activeElement.hasAttribute(\"contenteditable\");\n};\nconst isTypedCharValid = ({\n keyCode,\n metaKey,\n ctrlKey,\n altKey\n}) => {\n if (metaKey || ctrlKey || altKey)\n return false;\n if (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105)\n return true;\n if (keyCode >= 65 && keyCode <= 90)\n return true;\n return false;\n};\nfunction onStartTyping(callback, options = {}) {\n const { document: document2 = defaultDocument } = options;\n const keydown = (event) => {\n !isFocusedElementEditable() && isTypedCharValid(event) && callback(event);\n };\n if (document2)\n useEventListener(document2, \"keydown\", keydown, { passive: true });\n}\n\nfunction templateRef(key, initialValue = null) {\n const instance = getCurrentInstance();\n let _trigger = () => {\n };\n const element = customRef((track, trigger) => {\n _trigger = trigger;\n return {\n get() {\n var _a, _b;\n track();\n return (_b = (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.$refs[key]) != null ? _b : initialValue;\n },\n set() {\n }\n };\n });\n tryOnMounted(_trigger);\n onUpdated(_trigger);\n return element;\n}\n\nfunction useActiveElement(options = {}) {\n var _a;\n const { window = defaultWindow } = options;\n const document = (_a = options.document) != null ? _a : window == null ? void 0 : window.document;\n const activeElement = computedWithControl(() => null, () => document == null ? void 0 : document.activeElement);\n if (window) {\n useEventListener(window, \"blur\", (event) => {\n if (event.relatedTarget !== null)\n return;\n activeElement.trigger();\n }, true);\n useEventListener(window, \"focus\", activeElement.trigger, true);\n }\n return activeElement;\n}\n\nfunction useAsyncQueue(tasks, options = {}) {\n const {\n interrupt = true,\n onError = noop,\n onFinished = noop\n } = options;\n const promiseState = {\n pending: \"pending\",\n rejected: \"rejected\",\n fulfilled: \"fulfilled\"\n };\n const initialResult = Array.from(new Array(tasks.length), () => ({ state: promiseState.pending, data: null }));\n const result = reactive(initialResult);\n const activeIndex = ref(-1);\n if (!tasks || tasks.length === 0) {\n onFinished();\n return {\n activeIndex,\n result\n };\n }\n function updateResult(state, res) {\n activeIndex.value++;\n result[activeIndex.value].data = res;\n result[activeIndex.value].state = state;\n }\n tasks.reduce((prev, curr) => {\n return prev.then((prevRes) => {\n var _a;\n if (((_a = result[activeIndex.value]) == null ? void 0 : _a.state) === promiseState.rejected && interrupt) {\n onFinished();\n return;\n }\n return curr(prevRes).then((currentRes) => {\n updateResult(promiseState.fulfilled, currentRes);\n activeIndex.value === tasks.length - 1 && onFinished();\n return currentRes;\n });\n }).catch((e) => {\n updateResult(promiseState.rejected, e);\n onError();\n return e;\n });\n }, Promise.resolve());\n return {\n activeIndex,\n result\n };\n}\n\nfunction useAsyncState(promise, initialState, options) {\n const {\n immediate = true,\n delay = 0,\n onError = noop,\n onSuccess = noop,\n resetOnExecute = true,\n shallow = true,\n throwError\n } = options != null ? options : {};\n const state = shallow ? shallowRef(initialState) : ref(initialState);\n const isReady = ref(false);\n const isLoading = ref(false);\n const error = ref(void 0);\n async function execute(delay2 = 0, ...args) {\n if (resetOnExecute)\n state.value = initialState;\n error.value = void 0;\n isReady.value = false;\n isLoading.value = true;\n if (delay2 > 0)\n await promiseTimeout(delay2);\n const _promise = typeof promise === \"function\" ? promise(...args) : promise;\n try {\n const data = await _promise;\n state.value = data;\n isReady.value = true;\n onSuccess(data);\n } catch (e) {\n error.value = e;\n onError(e);\n if (throwError)\n throw error;\n } finally {\n isLoading.value = false;\n }\n return state.value;\n }\n if (immediate)\n execute(delay);\n return {\n state,\n isReady,\n isLoading,\n error,\n execute\n };\n}\n\nconst defaults = {\n array: (v) => JSON.stringify(v),\n object: (v) => JSON.stringify(v),\n set: (v) => JSON.stringify(Array.from(v)),\n map: (v) => JSON.stringify(Object.fromEntries(v)),\n null: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n if (!target)\n return defaults.null;\n if (target instanceof Map)\n return defaults.map;\n else if (target instanceof Set)\n return defaults.set;\n else if (Array.isArray(target))\n return defaults.array;\n else\n return defaults.object;\n}\n\nfunction useBase64(target, options) {\n const base64 = ref(\"\");\n const promise = ref();\n function execute() {\n if (!isClient)\n return;\n promise.value = new Promise((resolve, reject) => {\n try {\n const _target = resolveUnref(target);\n if (_target == null) {\n resolve(\"\");\n } else if (typeof _target === \"string\") {\n resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n } else if (_target instanceof Blob) {\n resolve(blobToBase64(_target));\n } else if (_target instanceof ArrayBuffer) {\n resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n } else if (_target instanceof HTMLCanvasElement) {\n resolve(_target.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n } else if (_target instanceof HTMLImageElement) {\n const img = _target.cloneNode(false);\n img.crossOrigin = \"Anonymous\";\n imgLoaded(img).then(() => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n resolve(canvas.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n }).catch(reject);\n } else if (typeof _target === \"object\") {\n const _serializeFn = (options == null ? void 0 : options.serializer) || getDefaultSerialization(_target);\n const serialized = _serializeFn(_target);\n return resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n } else {\n reject(new Error(\"target is unsupported types\"));\n }\n } catch (error) {\n reject(error);\n }\n });\n promise.value.then((res) => base64.value = res);\n return promise.value;\n }\n if (isRef(target) || isFunction(target))\n watch(target, execute, { immediate: true });\n else\n execute();\n return {\n base64,\n promise,\n execute\n };\n}\nfunction imgLoaded(img) {\n return new Promise((resolve, reject) => {\n if (!img.complete) {\n img.onload = () => {\n resolve();\n };\n img.onerror = reject;\n } else {\n resolve();\n }\n });\n}\nfunction blobToBase64(blob) {\n return new Promise((resolve, reject) => {\n const fr = new FileReader();\n fr.onload = (e) => {\n resolve(e.target.result);\n };\n fr.onerror = reject;\n fr.readAsDataURL(blob);\n });\n}\n\nfunction useSupported(callback, sync = false) {\n const isSupported = ref();\n const update = () => isSupported.value = Boolean(callback());\n update();\n tryOnMounted(update, sync);\n return isSupported;\n}\n\nfunction useBattery({ navigator = defaultNavigator } = {}) {\n const events = [\"chargingchange\", \"chargingtimechange\", \"dischargingtimechange\", \"levelchange\"];\n const isSupported = useSupported(() => navigator && \"getBattery\" in navigator);\n const charging = ref(false);\n const chargingTime = ref(0);\n const dischargingTime = ref(0);\n const level = ref(1);\n let battery;\n function updateBatteryInfo() {\n charging.value = this.charging;\n chargingTime.value = this.chargingTime || 0;\n dischargingTime.value = this.dischargingTime || 0;\n level.value = this.level;\n }\n if (isSupported.value) {\n navigator.getBattery().then((_battery) => {\n battery = _battery;\n updateBatteryInfo.call(battery);\n for (const event of events)\n useEventListener(battery, event, updateBatteryInfo, { passive: true });\n });\n }\n return {\n isSupported,\n charging,\n chargingTime,\n dischargingTime,\n level\n };\n}\n\nfunction useBluetooth(options) {\n let {\n acceptAllDevices = false\n } = options || {};\n const {\n filters = void 0,\n optionalServices = void 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => navigator && \"bluetooth\" in navigator);\n const device = shallowRef(void 0);\n const error = shallowRef(null);\n watch(device, () => {\n connectToBluetoothGATTServer();\n });\n async function requestDevice() {\n if (!isSupported.value)\n return;\n error.value = null;\n if (filters && filters.length > 0)\n acceptAllDevices = false;\n try {\n device.value = await (navigator == null ? void 0 : navigator.bluetooth.requestDevice({\n acceptAllDevices,\n filters,\n optionalServices\n }));\n } catch (err) {\n error.value = err;\n }\n }\n const server = ref();\n const isConnected = computed(() => {\n var _a;\n return ((_a = server.value) == null ? void 0 : _a.connected) || false;\n });\n async function connectToBluetoothGATTServer() {\n error.value = null;\n if (device.value && device.value.gatt) {\n device.value.addEventListener(\"gattserverdisconnected\", () => {\n });\n try {\n server.value = await device.value.gatt.connect();\n } catch (err) {\n error.value = err;\n }\n }\n }\n tryOnMounted(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.connect();\n });\n tryOnScopeDispose(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.disconnect();\n });\n return {\n isSupported,\n isConnected,\n device,\n requestDevice,\n server,\n error\n };\n}\n\nfunction useMediaQuery(query, options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n let mediaQuery;\n const matches = ref(false);\n const cleanup = () => {\n if (!mediaQuery)\n return;\n if (\"removeEventListener\" in mediaQuery)\n mediaQuery.removeEventListener(\"change\", update);\n else\n mediaQuery.removeListener(update);\n };\n const update = () => {\n if (!isSupported.value)\n return;\n cleanup();\n mediaQuery = window.matchMedia(resolveRef(query).value);\n matches.value = mediaQuery.matches;\n if (\"addEventListener\" in mediaQuery)\n mediaQuery.addEventListener(\"change\", update);\n else\n mediaQuery.addListener(update);\n };\n watchEffect(update);\n tryOnScopeDispose(() => cleanup());\n return matches;\n}\n\nconst breakpointsTailwind = {\n \"sm\": 640,\n \"md\": 768,\n \"lg\": 1024,\n \"xl\": 1280,\n \"2xl\": 1536\n};\nconst breakpointsBootstrapV5 = {\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400\n};\nconst breakpointsVuetify = {\n xs: 600,\n sm: 960,\n md: 1264,\n lg: 1904\n};\nconst breakpointsAntDesign = {\n xs: 480,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1600\n};\nconst breakpointsQuasar = {\n xs: 600,\n sm: 1024,\n md: 1440,\n lg: 1920\n};\nconst breakpointsSematic = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 425,\n tablet: 768,\n laptop: 1024,\n laptopL: 1440,\n desktop4K: 2560\n};\nconst breakpointsMasterCss = {\n \"3xs\": 360,\n \"2xs\": 480,\n \"xs\": 600,\n \"sm\": 768,\n \"md\": 1024,\n \"lg\": 1280,\n \"xl\": 1440,\n \"2xl\": 1600,\n \"3xl\": 1920,\n \"4xl\": 2560\n};\n\nvar __defProp$m = Object.defineProperty;\nvar __getOwnPropSymbols$o = Object.getOwnPropertySymbols;\nvar __hasOwnProp$o = Object.prototype.hasOwnProperty;\nvar __propIsEnum$o = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$m = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$o.call(b, prop))\n __defNormalProp$m(a, prop, b[prop]);\n if (__getOwnPropSymbols$o)\n for (var prop of __getOwnPropSymbols$o(b)) {\n if (__propIsEnum$o.call(b, prop))\n __defNormalProp$m(a, prop, b[prop]);\n }\n return a;\n};\nfunction useBreakpoints(breakpoints, options = {}) {\n function getValue(k, delta) {\n let v = breakpoints[k];\n if (delta != null)\n v = increaseWithUnit(v, delta);\n if (typeof v === \"number\")\n v = `${v}px`;\n return v;\n }\n const { window = defaultWindow } = options;\n function match(query) {\n if (!window)\n return false;\n return window.matchMedia(query).matches;\n }\n const greaterOrEqual = (k) => {\n return useMediaQuery(`(min-width: ${getValue(k)})`, options);\n };\n const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n Object.defineProperty(shortcuts, k, {\n get: () => greaterOrEqual(k),\n enumerable: true,\n configurable: true\n });\n return shortcuts;\n }, {});\n return __spreadValues$m({\n greater(k) {\n return useMediaQuery(`(min-width: ${getValue(k, 0.1)})`, options);\n },\n greaterOrEqual,\n smaller(k) {\n return useMediaQuery(`(max-width: ${getValue(k, -0.1)})`, options);\n },\n smallerOrEqual(k) {\n return useMediaQuery(`(max-width: ${getValue(k)})`, options);\n },\n between(a, b) {\n return useMediaQuery(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`, options);\n },\n isGreater(k) {\n return match(`(min-width: ${getValue(k, 0.1)})`);\n },\n isGreaterOrEqual(k) {\n return match(`(min-width: ${getValue(k)})`);\n },\n isSmaller(k) {\n return match(`(max-width: ${getValue(k, -0.1)})`);\n },\n isSmallerOrEqual(k) {\n return match(`(max-width: ${getValue(k)})`);\n },\n isInBetween(a, b) {\n return match(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`);\n }\n }, shortcutMethods);\n}\n\nconst useBroadcastChannel = (options) => {\n const {\n name,\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"BroadcastChannel\" in window);\n const isClosed = ref(false);\n const channel = ref();\n const data = ref();\n const error = ref(null);\n const post = (data2) => {\n if (channel.value)\n channel.value.postMessage(data2);\n };\n const close = () => {\n if (channel.value)\n channel.value.close();\n isClosed.value = true;\n };\n if (isSupported.value) {\n tryOnMounted(() => {\n error.value = null;\n channel.value = new BroadcastChannel(name);\n channel.value.addEventListener(\"message\", (e) => {\n data.value = e.data;\n }, { passive: true });\n channel.value.addEventListener(\"messageerror\", (e) => {\n error.value = e;\n }, { passive: true });\n channel.value.addEventListener(\"close\", () => {\n isClosed.value = true;\n });\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n isSupported,\n channel,\n data,\n post,\n close,\n error,\n isClosed\n };\n};\n\nfunction useBrowserLocation({ window = defaultWindow } = {}) {\n const buildState = (trigger) => {\n const { state: state2, length } = (window == null ? void 0 : window.history) || {};\n const { hash, host, hostname, href, origin, pathname, port, protocol, search } = (window == null ? void 0 : window.location) || {};\n return {\n trigger,\n state: state2,\n length,\n hash,\n host,\n hostname,\n href,\n origin,\n pathname,\n port,\n protocol,\n search\n };\n };\n const state = ref(buildState(\"load\"));\n if (window) {\n useEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), { passive: true });\n useEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), { passive: true });\n }\n return state;\n}\n\nfunction useCached(refValue, comparator = (a, b) => a === b, watchOptions) {\n const cachedValue = ref(refValue.value);\n watch(() => refValue.value, (value) => {\n if (!comparator(value, cachedValue.value))\n cachedValue.value = value;\n }, watchOptions);\n return cachedValue;\n}\n\nfunction useClipboard(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500,\n legacy = false\n } = options;\n const events = [\"copy\", \"cut\"];\n const isClipboardApiSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const isSupported = computed(() => isClipboardApiSupported.value || legacy);\n const text = ref(\"\");\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateText() {\n if (isClipboardApiSupported.value) {\n navigator.clipboard.readText().then((value) => {\n text.value = value;\n });\n } else {\n text.value = legacyRead();\n }\n }\n if (isSupported.value && read) {\n for (const event of events)\n useEventListener(event, updateText);\n }\n async function copy(value = resolveUnref(source)) {\n if (isSupported.value && value != null) {\n if (isClipboardApiSupported.value)\n await navigator.clipboard.writeText(value);\n else\n legacyCopy(value);\n text.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n function legacyCopy(value) {\n const ta = document.createElement(\"textarea\");\n ta.value = value != null ? value : \"\";\n ta.style.position = \"absolute\";\n ta.style.opacity = \"0\";\n document.body.appendChild(ta);\n ta.select();\n document.execCommand(\"copy\");\n ta.remove();\n }\n function legacyRead() {\n var _a, _b, _c;\n return (_c = (_b = (_a = document == null ? void 0 : document.getSelection) == null ? void 0 : _a.call(document)) == null ? void 0 : _b.toString()) != null ? _c : \"\";\n }\n return {\n isSupported,\n text,\n copied,\n copy\n };\n}\n\nvar __defProp$l = Object.defineProperty;\nvar __defProps$8 = Object.defineProperties;\nvar __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$n = Object.getOwnPropertySymbols;\nvar __hasOwnProp$n = Object.prototype.hasOwnProperty;\nvar __propIsEnum$n = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$l = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$n.call(b, prop))\n __defNormalProp$l(a, prop, b[prop]);\n if (__getOwnPropSymbols$n)\n for (var prop of __getOwnPropSymbols$n(b)) {\n if (__propIsEnum$n.call(b, prop))\n __defNormalProp$l(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));\nfunction cloneFnJSON(source) {\n return JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n const cloned = ref({});\n const {\n manual,\n clone = cloneFnJSON,\n deep = true,\n immediate = true\n } = options;\n function sync() {\n cloned.value = clone(unref(source));\n }\n if (!manual && isRef(source)) {\n watch(source, sync, __spreadProps$8(__spreadValues$l({}, options), {\n deep,\n immediate\n }));\n } else {\n sync();\n }\n return { cloned, sync };\n}\n\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\n_global[globalKey] = _global[globalKey] || {};\nconst handlers = _global[globalKey];\nfunction getSSRHandler(key, fallback) {\n return handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n handlers[key] = fn;\n}\n\nfunction guessSerializerType(rawInit) {\n return rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n\nvar __defProp$k = Object.defineProperty;\nvar __getOwnPropSymbols$m = Object.getOwnPropertySymbols;\nvar __hasOwnProp$m = Object.prototype.hasOwnProperty;\nvar __propIsEnum$m = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$k = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$m.call(b, prop))\n __defNormalProp$k(a, prop, b[prop]);\n if (__getOwnPropSymbols$m)\n for (var prop of __getOwnPropSymbols$m(b)) {\n if (__propIsEnum$m.call(b, prop))\n __defNormalProp$k(a, prop, b[prop]);\n }\n return a;\n};\nconst StorageSerializers = {\n boolean: {\n read: (v) => v === \"true\",\n write: (v) => String(v)\n },\n object: {\n read: (v) => JSON.parse(v),\n write: (v) => JSON.stringify(v)\n },\n number: {\n read: (v) => Number.parseFloat(v),\n write: (v) => String(v)\n },\n any: {\n read: (v) => v,\n write: (v) => String(v)\n },\n string: {\n read: (v) => v,\n write: (v) => String(v)\n },\n map: {\n read: (v) => new Map(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v.entries()))\n },\n set: {\n read: (v) => new Set(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v))\n },\n date: {\n read: (v) => new Date(v),\n write: (v) => v.toISOString()\n }\n};\nconst customStorageEventName = \"vueuse-storage\";\nfunction useStorage(key, defaults, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const data = (shallow ? shallowRef : ref)(defaults);\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n if (!storage)\n return data;\n const rawInit = resolveUnref(defaults);\n const type = guessSerializerType(rawInit);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(data, () => write(data.value), { flush, deep, eventFilter });\n if (window && listenToStorageChanges) {\n useEventListener(window, \"storage\", update);\n useEventListener(window, customStorageEventName, updateFromCustomEvent);\n }\n update();\n return data;\n function write(v) {\n try {\n if (v == null) {\n storage.removeItem(key);\n } else {\n const serialized = serializer.write(v);\n const oldValue = storage.getItem(key);\n if (oldValue !== serialized) {\n storage.setItem(key, serialized);\n if (window) {\n window.dispatchEvent(new CustomEvent(customStorageEventName, {\n detail: {\n key,\n oldValue,\n newValue: serialized,\n storageArea: storage\n }\n }));\n }\n }\n }\n } catch (e) {\n onError(e);\n }\n }\n function read(event) {\n const rawValue = event ? event.newValue : storage.getItem(key);\n if (rawValue == null) {\n if (writeDefaults && rawInit !== null)\n storage.setItem(key, serializer.write(rawInit));\n return rawInit;\n } else if (!event && mergeDefaults) {\n const value = serializer.read(rawValue);\n if (isFunction(mergeDefaults))\n return mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n return __spreadValues$k(__spreadValues$k({}, rawInit), value);\n return value;\n } else if (typeof rawValue !== \"string\") {\n return rawValue;\n } else {\n return serializer.read(rawValue);\n }\n }\n function updateFromCustomEvent(event) {\n update(event.detail);\n }\n function update(event) {\n if (event && event.storageArea !== storage)\n return;\n if (event && event.key == null) {\n data.value = rawInit;\n return;\n }\n if (event && event.key !== key)\n return;\n pauseWatch();\n try {\n data.value = read(event);\n } catch (e) {\n onError(e);\n } finally {\n if (event)\n nextTick(resumeWatch);\n else\n resumeWatch();\n }\n }\n}\n\nfunction usePreferredDark(options) {\n return useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n\nvar __defProp$j = Object.defineProperty;\nvar __getOwnPropSymbols$l = Object.getOwnPropertySymbols;\nvar __hasOwnProp$l = Object.prototype.hasOwnProperty;\nvar __propIsEnum$l = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$j = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$l.call(b, prop))\n __defNormalProp$j(a, prop, b[prop]);\n if (__getOwnPropSymbols$l)\n for (var prop of __getOwnPropSymbols$l(b)) {\n if (__propIsEnum$l.call(b, prop))\n __defNormalProp$j(a, prop, b[prop]);\n }\n return a;\n};\nfunction useColorMode(options = {}) {\n const {\n selector = \"html\",\n attribute = \"class\",\n initialValue = \"auto\",\n window = defaultWindow,\n storage,\n storageKey = \"vueuse-color-scheme\",\n listenToStorageChanges = true,\n storageRef,\n emitAuto\n } = options;\n const modes = __spreadValues$j({\n auto: \"\",\n light: \"light\",\n dark: \"dark\"\n }, options.modes || {});\n const preferredDark = usePreferredDark({ window });\n const preferredMode = computed(() => preferredDark.value ? \"dark\" : \"light\");\n const store = storageRef || (storageKey == null ? ref(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));\n const state = computed({\n get() {\n return store.value === \"auto\" && !emitAuto ? preferredMode.value : store.value;\n },\n set(v) {\n store.value = v;\n }\n });\n const updateHTMLAttrs = getSSRHandler(\"updateHTMLAttrs\", (selector2, attribute2, value) => {\n const el = window == null ? void 0 : window.document.querySelector(selector2);\n if (!el)\n return;\n if (attribute2 === \"class\") {\n const current = value.split(/\\s/g);\n Object.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n if (current.includes(v))\n el.classList.add(v);\n else\n el.classList.remove(v);\n });\n } else {\n el.setAttribute(attribute2, value);\n }\n });\n function defaultOnChanged(mode) {\n var _a;\n const resolvedMode = mode === \"auto\" ? preferredMode.value : mode;\n updateHTMLAttrs(selector, attribute, (_a = modes[resolvedMode]) != null ? _a : resolvedMode);\n }\n function onChanged(mode) {\n if (options.onChanged)\n options.onChanged(mode, defaultOnChanged);\n else\n defaultOnChanged(mode);\n }\n watch(state, onChanged, { flush: \"post\", immediate: true });\n if (emitAuto)\n watch(preferredMode, () => onChanged(state.value), { flush: \"post\" });\n tryOnMounted(() => onChanged(state.value));\n return state;\n}\n\nfunction useConfirmDialog(revealed = ref(false)) {\n const confirmHook = createEventHook();\n const cancelHook = createEventHook();\n const revealHook = createEventHook();\n let _resolve = noop;\n const reveal = (data) => {\n revealHook.trigger(data);\n revealed.value = true;\n return new Promise((resolve) => {\n _resolve = resolve;\n });\n };\n const confirm = (data) => {\n revealed.value = false;\n confirmHook.trigger(data);\n _resolve({ data, isCanceled: false });\n };\n const cancel = (data) => {\n revealed.value = false;\n cancelHook.trigger(data);\n _resolve({ data, isCanceled: true });\n };\n return {\n isRevealed: computed(() => revealed.value),\n reveal,\n confirm,\n cancel,\n onReveal: revealHook.on,\n onConfirm: confirmHook.on,\n onCancel: cancelHook.on\n };\n}\n\nfunction useCssVar(prop, target, { window = defaultWindow, initialValue = \"\" } = {}) {\n const variable = ref(initialValue);\n const elRef = computed(() => {\n var _a;\n return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);\n });\n watch([elRef, () => resolveUnref(prop)], ([el, prop2]) => {\n var _a;\n if (el && window) {\n const value = (_a = window.getComputedStyle(el).getPropertyValue(prop2)) == null ? void 0 : _a.trim();\n variable.value = value || initialValue;\n }\n }, { immediate: true });\n watch(variable, (val) => {\n var _a;\n if ((_a = elRef.value) == null ? void 0 : _a.style)\n elRef.value.style.setProperty(resolveUnref(prop), val);\n });\n return variable;\n}\n\nfunction useCurrentElement() {\n const vm = getCurrentInstance();\n const currentElement = computedWithControl(() => null, () => vm.proxy.$el);\n onUpdated(currentElement.trigger);\n onMounted(currentElement.trigger);\n return currentElement;\n}\n\nfunction useCycleList(list, options) {\n var _a;\n const state = shallowRef((_a = options == null ? void 0 : options.initialValue) != null ? _a : list[0]);\n const index = computed({\n get() {\n var _a2;\n let index2 = (options == null ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, list) : list.indexOf(state.value);\n if (index2 < 0)\n index2 = (_a2 = options == null ? void 0 : options.fallbackIndex) != null ? _a2 : 0;\n return index2;\n },\n set(v) {\n set(v);\n }\n });\n function set(i) {\n const length = list.length;\n const index2 = (i % length + length) % length;\n const value = list[index2];\n state.value = value;\n return value;\n }\n function shift(delta = 1) {\n return set(index.value + delta);\n }\n function next(n = 1) {\n return shift(n);\n }\n function prev(n = 1) {\n return shift(-n);\n }\n return {\n state,\n index,\n next,\n prev\n };\n}\n\nvar __defProp$i = Object.defineProperty;\nvar __defProps$7 = Object.defineProperties;\nvar __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$k = Object.getOwnPropertySymbols;\nvar __hasOwnProp$k = Object.prototype.hasOwnProperty;\nvar __propIsEnum$k = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$i = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$k.call(b, prop))\n __defNormalProp$i(a, prop, b[prop]);\n if (__getOwnPropSymbols$k)\n for (var prop of __getOwnPropSymbols$k(b)) {\n if (__propIsEnum$k.call(b, prop))\n __defNormalProp$i(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));\nfunction useDark(options = {}) {\n const {\n valueDark = \"dark\",\n valueLight = \"\",\n window = defaultWindow\n } = options;\n const mode = useColorMode(__spreadProps$7(__spreadValues$i({}, options), {\n onChanged: (mode2, defaultHandler) => {\n var _a;\n if (options.onChanged)\n (_a = options.onChanged) == null ? void 0 : _a.call(options, mode2 === \"dark\");\n else\n defaultHandler(mode2);\n },\n modes: {\n dark: valueDark,\n light: valueLight\n }\n }));\n const preferredDark = usePreferredDark({ window });\n const isDark = computed({\n get() {\n return mode.value === \"dark\";\n },\n set(v) {\n if (v === preferredDark.value)\n mode.value = \"auto\";\n else\n mode.value = v ? \"dark\" : \"light\";\n }\n });\n return isDark;\n}\n\nconst fnBypass = (v) => v;\nconst fnSetSource = (source, value) => source.value = value;\nfunction defaultDump(clone) {\n return clone ? isFunction(clone) ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n return clone ? isFunction(clone) ? clone : cloneFnJSON : fnBypass;\n}\nfunction useManualRefHistory(source, options = {}) {\n const {\n clone = false,\n dump = defaultDump(clone),\n parse = defaultParse(clone),\n setSource = fnSetSource\n } = options;\n function _createHistoryRecord() {\n return markRaw({\n snapshot: dump(source.value),\n timestamp: timestamp()\n });\n }\n const last = ref(_createHistoryRecord());\n const undoStack = ref([]);\n const redoStack = ref([]);\n const _setSource = (record) => {\n setSource(source, parse(record.snapshot));\n last.value = record;\n };\n const commit = () => {\n undoStack.value.unshift(last.value);\n last.value = _createHistoryRecord();\n if (options.capacity && undoStack.value.length > options.capacity)\n undoStack.value.splice(options.capacity, Infinity);\n if (redoStack.value.length)\n redoStack.value.splice(0, redoStack.value.length);\n };\n const clear = () => {\n undoStack.value.splice(0, undoStack.value.length);\n redoStack.value.splice(0, redoStack.value.length);\n };\n const undo = () => {\n const state = undoStack.value.shift();\n if (state) {\n redoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const redo = () => {\n const state = redoStack.value.shift();\n if (state) {\n undoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const reset = () => {\n _setSource(last.value);\n };\n const history = computed(() => [last.value, ...undoStack.value]);\n const canUndo = computed(() => undoStack.value.length > 0);\n const canRedo = computed(() => redoStack.value.length > 0);\n return {\n source,\n undoStack,\n redoStack,\n last,\n history,\n canUndo,\n canRedo,\n clear,\n commit,\n reset,\n undo,\n redo\n };\n}\n\nvar __defProp$h = Object.defineProperty;\nvar __defProps$6 = Object.defineProperties;\nvar __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$j = Object.getOwnPropertySymbols;\nvar __hasOwnProp$j = Object.prototype.hasOwnProperty;\nvar __propIsEnum$j = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$h = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$j.call(b, prop))\n __defNormalProp$h(a, prop, b[prop]);\n if (__getOwnPropSymbols$j)\n for (var prop of __getOwnPropSymbols$j(b)) {\n if (__propIsEnum$j.call(b, prop))\n __defNormalProp$h(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));\nfunction useRefHistory(source, options = {}) {\n const {\n deep = false,\n flush = \"pre\",\n eventFilter\n } = options;\n const {\n eventFilter: composedFilter,\n pause,\n resume: resumeTracking,\n isActive: isTracking\n } = pausableFilter(eventFilter);\n const {\n ignoreUpdates,\n ignorePrevAsyncUpdates,\n stop\n } = watchIgnorable(source, commit, { deep, flush, eventFilter: composedFilter });\n function setSource(source2, value) {\n ignorePrevAsyncUpdates();\n ignoreUpdates(() => {\n source2.value = value;\n });\n }\n const manualHistory = useManualRefHistory(source, __spreadProps$6(__spreadValues$h({}, options), { clone: options.clone || deep, setSource }));\n const { clear, commit: manualCommit } = manualHistory;\n function commit() {\n ignorePrevAsyncUpdates();\n manualCommit();\n }\n function resume(commitNow) {\n resumeTracking();\n if (commitNow)\n commit();\n }\n function batch(fn) {\n let canceled = false;\n const cancel = () => canceled = true;\n ignoreUpdates(() => {\n fn(cancel);\n });\n if (!canceled)\n commit();\n }\n function dispose() {\n stop();\n clear();\n }\n return __spreadProps$6(__spreadValues$h({}, manualHistory), {\n isTracking,\n pause,\n resume,\n commit,\n batch,\n dispose\n });\n}\n\nvar __defProp$g = Object.defineProperty;\nvar __defProps$5 = Object.defineProperties;\nvar __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$i = Object.getOwnPropertySymbols;\nvar __hasOwnProp$i = Object.prototype.hasOwnProperty;\nvar __propIsEnum$i = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$g = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$i.call(b, prop))\n __defNormalProp$g(a, prop, b[prop]);\n if (__getOwnPropSymbols$i)\n for (var prop of __getOwnPropSymbols$i(b)) {\n if (__propIsEnum$i.call(b, prop))\n __defNormalProp$g(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));\nfunction useDebouncedRefHistory(source, options = {}) {\n const filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n const history = useRefHistory(source, __spreadProps$5(__spreadValues$g({}, options), { eventFilter: filter }));\n return __spreadValues$g({}, history);\n}\n\nfunction useDeviceMotion(options = {}) {\n const {\n window = defaultWindow,\n eventFilter = bypassFilter\n } = options;\n const acceleration = ref({ x: null, y: null, z: null });\n const rotationRate = ref({ alpha: null, beta: null, gamma: null });\n const interval = ref(0);\n const accelerationIncludingGravity = ref({\n x: null,\n y: null,\n z: null\n });\n if (window) {\n const onDeviceMotion = createFilterWrapper(eventFilter, (event) => {\n acceleration.value = event.acceleration;\n accelerationIncludingGravity.value = event.accelerationIncludingGravity;\n rotationRate.value = event.rotationRate;\n interval.value = event.interval;\n });\n useEventListener(window, \"devicemotion\", onDeviceMotion);\n }\n return {\n acceleration,\n accelerationIncludingGravity,\n rotationRate,\n interval\n };\n}\n\nfunction useDeviceOrientation(options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"DeviceOrientationEvent\" in window);\n const isAbsolute = ref(false);\n const alpha = ref(null);\n const beta = ref(null);\n const gamma = ref(null);\n if (window && isSupported.value) {\n useEventListener(window, \"deviceorientation\", (event) => {\n isAbsolute.value = event.absolute;\n alpha.value = event.alpha;\n beta.value = event.beta;\n gamma.value = event.gamma;\n });\n }\n return {\n isSupported,\n isAbsolute,\n alpha,\n beta,\n gamma\n };\n}\n\nfunction useDevicePixelRatio({\n window = defaultWindow\n} = {}) {\n const pixelRatio = ref(1);\n if (window) {\n let observe = function() {\n pixelRatio.value = window.devicePixelRatio;\n cleanup();\n media = window.matchMedia(`(resolution: ${pixelRatio.value}dppx)`);\n media.addEventListener(\"change\", observe, { once: true });\n }, cleanup = function() {\n media == null ? void 0 : media.removeEventListener(\"change\", observe);\n };\n let media;\n observe();\n tryOnScopeDispose(cleanup);\n }\n return { pixelRatio };\n}\n\nfunction usePermission(permissionDesc, options = {}) {\n const {\n controls = false,\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"permissions\" in navigator);\n let permissionStatus;\n const desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n const state = ref();\n const onChange = () => {\n if (permissionStatus)\n state.value = permissionStatus.state;\n };\n const query = createSingletonPromise(async () => {\n if (!isSupported.value)\n return;\n if (!permissionStatus) {\n try {\n permissionStatus = await navigator.permissions.query(desc);\n useEventListener(permissionStatus, \"change\", onChange);\n onChange();\n } catch (e) {\n state.value = \"prompt\";\n }\n }\n return permissionStatus;\n });\n query();\n if (controls) {\n return {\n state,\n isSupported,\n query\n };\n } else {\n return state;\n }\n}\n\nfunction useDevicesList(options = {}) {\n const {\n navigator = defaultNavigator,\n requestPermissions = false,\n constraints = { audio: true, video: true },\n onUpdated\n } = options;\n const devices = ref([]);\n const videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n const audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n const audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n const isSupported = useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n const permissionGranted = ref(false);\n async function update() {\n if (!isSupported.value)\n return;\n devices.value = await navigator.mediaDevices.enumerateDevices();\n onUpdated == null ? void 0 : onUpdated(devices.value);\n }\n async function ensurePermissions() {\n if (!isSupported.value)\n return false;\n if (permissionGranted.value)\n return true;\n const { state, query } = usePermission(\"camera\", { controls: true });\n await query();\n if (state.value !== \"granted\") {\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n stream.getTracks().forEach((t) => t.stop());\n update();\n permissionGranted.value = true;\n } else {\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n }\n if (isSupported.value) {\n if (requestPermissions)\n ensurePermissions();\n useEventListener(navigator.mediaDevices, \"devicechange\", update);\n update();\n }\n return {\n devices,\n ensurePermissions,\n permissionGranted,\n videoInputs,\n audioInputs,\n audioOutputs,\n isSupported\n };\n}\n\nfunction useDisplayMedia(options = {}) {\n var _a;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const video = options.video;\n const audio = options.audio;\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getDisplayMedia;\n });\n const constraint = { audio, video };\n const stream = shallowRef();\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n return stream.value;\n }\n async function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n watch(enabled, (v) => {\n if (v)\n _start();\n else\n _stop();\n }, { immediate: true });\n return {\n isSupported,\n stream,\n start,\n stop,\n enabled\n };\n}\n\nfunction useDocumentVisibility({ document = defaultDocument } = {}) {\n if (!document)\n return ref(\"visible\");\n const visibility = ref(document.visibilityState);\n useEventListener(document, \"visibilitychange\", () => {\n visibility.value = document.visibilityState;\n });\n return visibility;\n}\n\nvar __defProp$f = Object.defineProperty;\nvar __defProps$4 = Object.defineProperties;\nvar __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$h = Object.getOwnPropertySymbols;\nvar __hasOwnProp$h = Object.prototype.hasOwnProperty;\nvar __propIsEnum$h = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$f = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$h.call(b, prop))\n __defNormalProp$f(a, prop, b[prop]);\n if (__getOwnPropSymbols$h)\n for (var prop of __getOwnPropSymbols$h(b)) {\n if (__propIsEnum$h.call(b, prop))\n __defNormalProp$f(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));\nfunction useDraggable(target, options = {}) {\n var _a, _b, _c;\n const draggingElement = (_a = options.draggingElement) != null ? _a : defaultWindow;\n const draggingHandle = (_b = options.handle) != null ? _b : target;\n const position = ref((_c = resolveUnref(options.initialValue)) != null ? _c : { x: 0, y: 0 });\n const pressedDelta = ref();\n const filterEvent = (e) => {\n if (options.pointerTypes)\n return options.pointerTypes.includes(e.pointerType);\n return true;\n };\n const handleEvent = (e) => {\n if (resolveUnref(options.preventDefault))\n e.preventDefault();\n if (resolveUnref(options.stopPropagation))\n e.stopPropagation();\n };\n const start = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (resolveUnref(options.exact) && e.target !== resolveUnref(target))\n return;\n const rect = resolveUnref(target).getBoundingClientRect();\n const pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (((_a2 = options.onStart) == null ? void 0 : _a2.call(options, pos, e)) === false)\n return;\n pressedDelta.value = pos;\n handleEvent(e);\n };\n const move = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n position.value = {\n x: e.clientX - pressedDelta.value.x,\n y: e.clientY - pressedDelta.value.y\n };\n (_a2 = options.onMove) == null ? void 0 : _a2.call(options, position.value, e);\n handleEvent(e);\n };\n const end = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n pressedDelta.value = void 0;\n (_a2 = options.onEnd) == null ? void 0 : _a2.call(options, position.value, e);\n handleEvent(e);\n };\n if (isClient) {\n useEventListener(draggingHandle, \"pointerdown\", start, true);\n useEventListener(draggingElement, \"pointermove\", move, true);\n useEventListener(draggingElement, \"pointerup\", end, true);\n }\n return __spreadProps$4(__spreadValues$f({}, toRefs(position)), {\n position,\n isDragging: computed(() => !!pressedDelta.value),\n style: computed(() => `left:${position.value.x}px;top:${position.value.y}px;`)\n });\n}\n\nfunction useDropZone(target, onDrop) {\n const isOverDropZone = ref(false);\n let counter = 0;\n if (isClient) {\n useEventListener(target, \"dragenter\", (event) => {\n event.preventDefault();\n counter += 1;\n isOverDropZone.value = true;\n });\n useEventListener(target, \"dragover\", (event) => {\n event.preventDefault();\n });\n useEventListener(target, \"dragleave\", (event) => {\n event.preventDefault();\n counter -= 1;\n if (counter === 0)\n isOverDropZone.value = false;\n });\n useEventListener(target, \"drop\", (event) => {\n var _a, _b;\n event.preventDefault();\n counter = 0;\n isOverDropZone.value = false;\n const files = Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);\n onDrop == null ? void 0 : onDrop(files.length === 0 ? null : files);\n });\n }\n return {\n isOverDropZone\n };\n}\n\nvar __getOwnPropSymbols$g = Object.getOwnPropertySymbols;\nvar __hasOwnProp$g = Object.prototype.hasOwnProperty;\nvar __propIsEnum$g = Object.prototype.propertyIsEnumerable;\nvar __objRest$2 = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols$g)\n for (var prop of __getOwnPropSymbols$g(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction useResizeObserver(target, callback, options = {}) {\n const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest$2(_a, [\"window\"]);\n let observer;\n const isSupported = useSupported(() => window && \"ResizeObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const stopWatch = watch(() => unrefElement(target), (el) => {\n cleanup();\n if (isSupported.value && window && el) {\n observer = new ResizeObserver(callback);\n observer.observe(el, observerOptions);\n }\n }, { immediate: true, flush: \"post\" });\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nfunction useElementBounding(target, options = {}) {\n const {\n reset = true,\n windowResize = true,\n windowScroll = true,\n immediate = true\n } = options;\n const height = ref(0);\n const bottom = ref(0);\n const left = ref(0);\n const right = ref(0);\n const top = ref(0);\n const width = ref(0);\n const x = ref(0);\n const y = ref(0);\n function update() {\n const el = unrefElement(target);\n if (!el) {\n if (reset) {\n height.value = 0;\n bottom.value = 0;\n left.value = 0;\n right.value = 0;\n top.value = 0;\n width.value = 0;\n x.value = 0;\n y.value = 0;\n }\n return;\n }\n const rect = el.getBoundingClientRect();\n height.value = rect.height;\n bottom.value = rect.bottom;\n left.value = rect.left;\n right.value = rect.right;\n top.value = rect.top;\n width.value = rect.width;\n x.value = rect.x;\n y.value = rect.y;\n }\n useResizeObserver(target, update);\n watch(() => unrefElement(target), (ele) => !ele && update());\n if (windowScroll)\n useEventListener(\"scroll\", update, { capture: true, passive: true });\n if (windowResize)\n useEventListener(\"resize\", update, { passive: true });\n tryOnMounted(() => {\n if (immediate)\n update();\n });\n return {\n height,\n bottom,\n left,\n right,\n top,\n width,\n x,\n y,\n update\n };\n}\n\nfunction useRafFn(fn, options = {}) {\n const {\n immediate = true,\n window = defaultWindow\n } = options;\n const isActive = ref(false);\n let previousFrameTimestamp = 0;\n let rafId = null;\n function loop(timestamp) {\n if (!isActive.value || !window)\n return;\n const delta = timestamp - previousFrameTimestamp;\n fn({ delta, timestamp });\n previousFrameTimestamp = timestamp;\n rafId = window.requestAnimationFrame(loop);\n }\n function resume() {\n if (!isActive.value && window) {\n isActive.value = true;\n rafId = window.requestAnimationFrame(loop);\n }\n }\n function pause() {\n isActive.value = false;\n if (rafId != null && window) {\n window.cancelAnimationFrame(rafId);\n rafId = null;\n }\n }\n if (immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive: readonly(isActive),\n pause,\n resume\n };\n}\n\nvar __defProp$e = Object.defineProperty;\nvar __getOwnPropSymbols$f = Object.getOwnPropertySymbols;\nvar __hasOwnProp$f = Object.prototype.hasOwnProperty;\nvar __propIsEnum$f = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$e = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$f.call(b, prop))\n __defNormalProp$e(a, prop, b[prop]);\n if (__getOwnPropSymbols$f)\n for (var prop of __getOwnPropSymbols$f(b)) {\n if (__propIsEnum$f.call(b, prop))\n __defNormalProp$e(a, prop, b[prop]);\n }\n return a;\n};\nfunction useElementByPoint(options) {\n const element = ref(null);\n const { x, y, document = defaultDocument } = options;\n const controls = useRafFn(() => {\n element.value = (document == null ? void 0 : document.elementFromPoint(resolveUnref(x), resolveUnref(y))) || null;\n });\n return __spreadValues$e({\n element\n }, controls);\n}\n\nfunction useElementHover(el, options = {}) {\n const delayEnter = options ? options.delayEnter : 0;\n const delayLeave = options ? options.delayLeave : 0;\n const isHovered = ref(false);\n let timer;\n const toggle = (entering) => {\n const delay = entering ? delayEnter : delayLeave;\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n }\n if (delay)\n timer = setTimeout(() => isHovered.value = entering, delay);\n else\n isHovered.value = entering;\n };\n if (!window)\n return isHovered;\n useEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n useEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n return isHovered;\n}\n\nfunction useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {\n const { window = defaultWindow, box = \"content-box\" } = options;\n const isSVG = computed(() => {\n var _a, _b;\n return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes(\"svg\");\n });\n const width = ref(initialSize.width);\n const height = ref(initialSize.height);\n useResizeObserver(target, ([entry]) => {\n const boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n if (window && isSVG.value) {\n const $elem = unrefElement(target);\n if ($elem) {\n const styles = window.getComputedStyle($elem);\n width.value = parseFloat(styles.width);\n height.value = parseFloat(styles.height);\n }\n } else {\n if (boxSize) {\n const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];\n width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n } else {\n width.value = entry.contentRect.width;\n height.value = entry.contentRect.height;\n }\n }\n }, options);\n watch(() => unrefElement(target), (ele) => {\n width.value = ele ? initialSize.width : 0;\n height.value = ele ? initialSize.height : 0;\n });\n return {\n width,\n height\n };\n}\n\nfunction useElementVisibility(element, { window = defaultWindow, scrollTarget } = {}) {\n const elementIsVisible = ref(false);\n const testBounding = () => {\n if (!window)\n return;\n const document = window.document;\n const el = unrefElement(element);\n if (!el) {\n elementIsVisible.value = false;\n } else {\n const rect = el.getBoundingClientRect();\n elementIsVisible.value = rect.top <= (window.innerHeight || document.documentElement.clientHeight) && rect.left <= (window.innerWidth || document.documentElement.clientWidth) && rect.bottom >= 0 && rect.right >= 0;\n }\n };\n watch(() => unrefElement(element), () => testBounding(), { immediate: true, flush: \"post\" });\n if (window) {\n useEventListener(scrollTarget || window, \"scroll\", testBounding, {\n capture: false,\n passive: true\n });\n }\n return elementIsVisible;\n}\n\nconst events = new Map();\n\nfunction useEventBus(key) {\n const scope = getCurrentScope();\n function on(listener) {\n var _a;\n const listeners = events.get(key) || [];\n listeners.push(listener);\n events.set(key, listeners);\n const _off = () => off(listener);\n (_a = scope == null ? void 0 : scope.cleanups) == null ? void 0 : _a.push(_off);\n return _off;\n }\n function once(listener) {\n function _listener(...args) {\n off(_listener);\n listener(...args);\n }\n return on(_listener);\n }\n function off(listener) {\n const listeners = events.get(key);\n if (!listeners)\n return;\n const index = listeners.indexOf(listener);\n if (index > -1)\n listeners.splice(index, 1);\n if (!listeners.length)\n events.delete(key);\n }\n function reset() {\n events.delete(key);\n }\n function emit(event, payload) {\n var _a;\n (_a = events.get(key)) == null ? void 0 : _a.forEach((v) => v(event, payload));\n }\n return { on, once, off, emit, reset };\n}\n\nfunction useEventSource(url, events = [], options = {}) {\n const event = ref(null);\n const data = ref(null);\n const status = ref(\"CONNECTING\");\n const eventSource = ref(null);\n const error = ref(null);\n const {\n withCredentials = false\n } = options;\n const close = () => {\n if (eventSource.value) {\n eventSource.value.close();\n eventSource.value = null;\n status.value = \"CLOSED\";\n }\n };\n const es = new EventSource(url, { withCredentials });\n eventSource.value = es;\n es.onopen = () => {\n status.value = \"OPEN\";\n error.value = null;\n };\n es.onerror = (e) => {\n status.value = \"CLOSED\";\n error.value = e;\n };\n es.onmessage = (e) => {\n event.value = null;\n data.value = e.data;\n };\n for (const event_name of events) {\n useEventListener(es, event_name, (e) => {\n event.value = event_name;\n data.value = e.data || null;\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n eventSource,\n event,\n data,\n status,\n error,\n close\n };\n}\n\nfunction useEyeDropper(options = {}) {\n const { initialValue = \"\" } = options;\n const isSupported = useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n const sRGBHex = ref(initialValue);\n async function open(openOptions) {\n if (!isSupported.value)\n return;\n const eyeDropper = new window.EyeDropper();\n const result = await eyeDropper.open(openOptions);\n sRGBHex.value = result.sRGBHex;\n return result;\n }\n return { isSupported, sRGBHex, open };\n}\n\nfunction useFavicon(newIcon = null, options = {}) {\n const {\n baseUrl = \"\",\n rel = \"icon\",\n document = defaultDocument\n } = options;\n const favicon = resolveRef(newIcon);\n const applyIcon = (icon) => {\n document == null ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`).forEach((el) => el.href = `${baseUrl}${icon}`);\n };\n watch(favicon, (i, o) => {\n if (isString(i) && i !== o)\n applyIcon(i);\n }, { immediate: true });\n return favicon;\n}\n\nvar __defProp$d = Object.defineProperty;\nvar __defProps$3 = Object.defineProperties;\nvar __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$e = Object.getOwnPropertySymbols;\nvar __hasOwnProp$e = Object.prototype.hasOwnProperty;\nvar __propIsEnum$e = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$d = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$e.call(b, prop))\n __defNormalProp$d(a, prop, b[prop]);\n if (__getOwnPropSymbols$e)\n for (var prop of __getOwnPropSymbols$e(b)) {\n if (__propIsEnum$e.call(b, prop))\n __defNormalProp$d(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));\nconst payloadMapping = {\n json: \"application/json\",\n text: \"text/plain\"\n};\nfunction isFetchOptions(obj) {\n return obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\");\n}\nfunction isAbsoluteURL(url) {\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\nfunction headersToObject(headers) {\n if (typeof Headers !== \"undefined\" && headers instanceof Headers)\n return Object.fromEntries([...headers.entries()]);\n return headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n if (combination === \"overwrite\") {\n return async (ctx) => {\n const callback = callbacks[callbacks.length - 1];\n if (callback !== void 0)\n await callback(ctx);\n return ctx;\n };\n } else {\n return async (ctx) => {\n await callbacks.reduce((prevCallback, callback) => prevCallback.then(async () => {\n if (callback)\n ctx = __spreadValues$d(__spreadValues$d({}, ctx), await callback(ctx));\n }), Promise.resolve());\n return ctx;\n };\n }\n}\nfunction createFetch(config = {}) {\n const _combination = config.combination || \"chain\";\n const _options = config.options || {};\n const _fetchOptions = config.fetchOptions || {};\n function useFactoryFetch(url, ...args) {\n const computedUrl = computed(() => {\n const baseUrl = resolveUnref(config.baseUrl);\n const targetUrl = resolveUnref(url);\n return baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n });\n let options = _options;\n let fetchOptions = _fetchOptions;\n if (args.length > 0) {\n if (isFetchOptions(args[0])) {\n options = __spreadProps$3(__spreadValues$d(__spreadValues$d({}, options), args[0]), {\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n });\n } else {\n fetchOptions = __spreadProps$3(__spreadValues$d(__spreadValues$d({}, fetchOptions), args[0]), {\n headers: __spreadValues$d(__spreadValues$d({}, headersToObject(fetchOptions.headers) || {}), headersToObject(args[0].headers) || {})\n });\n }\n }\n if (args.length > 1 && isFetchOptions(args[1])) {\n options = __spreadProps$3(__spreadValues$d(__spreadValues$d({}, options), args[1]), {\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n });\n }\n return useFetch(computedUrl, fetchOptions, options);\n }\n return useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n var _a;\n const supportsAbort = typeof AbortController === \"function\";\n let fetchOptions = {};\n let options = { immediate: true, refetch: false, timeout: 0 };\n const config = {\n method: \"GET\",\n type: \"text\",\n payload: void 0\n };\n if (args.length > 0) {\n if (isFetchOptions(args[0]))\n options = __spreadValues$d(__spreadValues$d({}, options), args[0]);\n else\n fetchOptions = args[0];\n }\n if (args.length > 1) {\n if (isFetchOptions(args[1]))\n options = __spreadValues$d(__spreadValues$d({}, options), args[1]);\n }\n const {\n fetch = (_a = defaultWindow) == null ? void 0 : _a.fetch,\n initialData,\n timeout\n } = options;\n const responseEvent = createEventHook();\n const errorEvent = createEventHook();\n const finallyEvent = createEventHook();\n const isFinished = ref(false);\n const isFetching = ref(false);\n const aborted = ref(false);\n const statusCode = ref(null);\n const response = shallowRef(null);\n const error = shallowRef(null);\n const data = shallowRef(initialData);\n const canAbort = computed(() => supportsAbort && isFetching.value);\n let controller;\n let timer;\n const abort = () => {\n if (supportsAbort && controller) {\n controller.abort();\n controller = void 0;\n }\n };\n const loading = (isLoading) => {\n isFetching.value = isLoading;\n isFinished.value = !isLoading;\n };\n if (timeout)\n timer = useTimeoutFn(abort, timeout, { immediate: false });\n const execute = async (throwOnFailed = false) => {\n var _a2;\n loading(true);\n error.value = null;\n statusCode.value = null;\n aborted.value = false;\n if (supportsAbort) {\n abort();\n controller = new AbortController();\n controller.signal.onabort = () => aborted.value = true;\n fetchOptions = __spreadProps$3(__spreadValues$d({}, fetchOptions), {\n signal: controller.signal\n });\n }\n const defaultFetchOptions = {\n method: config.method,\n headers: {}\n };\n if (config.payload) {\n const headers = headersToObject(defaultFetchOptions.headers);\n if (config.payloadType)\n headers[\"Content-Type\"] = (_a2 = payloadMapping[config.payloadType]) != null ? _a2 : config.payloadType;\n const payload = resolveUnref(config.payload);\n defaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n }\n let isCanceled = false;\n const context = {\n url: resolveUnref(url),\n options: __spreadValues$d(__spreadValues$d({}, defaultFetchOptions), fetchOptions),\n cancel: () => {\n isCanceled = true;\n }\n };\n if (options.beforeFetch)\n Object.assign(context, await options.beforeFetch(context));\n if (isCanceled || !fetch) {\n loading(false);\n return Promise.resolve(null);\n }\n let responseData = null;\n if (timer)\n timer.start();\n return new Promise((resolve, reject) => {\n var _a3;\n fetch(context.url, __spreadProps$3(__spreadValues$d(__spreadValues$d({}, defaultFetchOptions), context.options), {\n headers: __spreadValues$d(__spreadValues$d({}, headersToObject(defaultFetchOptions.headers)), headersToObject((_a3 = context.options) == null ? void 0 : _a3.headers))\n })).then(async (fetchResponse) => {\n response.value = fetchResponse;\n statusCode.value = fetchResponse.status;\n responseData = await fetchResponse[config.type]();\n if (options.afterFetch && statusCode.value >= 200 && statusCode.value < 300)\n ({ data: responseData } = await options.afterFetch({ data: responseData, response: fetchResponse }));\n data.value = responseData;\n if (!fetchResponse.ok)\n throw new Error(fetchResponse.statusText);\n responseEvent.trigger(fetchResponse);\n return resolve(fetchResponse);\n }).catch(async (fetchError) => {\n let errorData = fetchError.message || fetchError.name;\n if (options.onFetchError)\n ({ data: responseData, error: errorData } = await options.onFetchError({ data: responseData, error: fetchError, response: response.value }));\n data.value = responseData;\n error.value = errorData;\n errorEvent.trigger(fetchError);\n if (throwOnFailed)\n return reject(fetchError);\n return resolve(null);\n }).finally(() => {\n loading(false);\n if (timer)\n timer.stop();\n finallyEvent.trigger(null);\n });\n });\n };\n const refetch = resolveRef(options.refetch);\n watch([\n refetch,\n resolveRef(url)\n ], ([refetch2]) => refetch2 && execute(), { deep: true });\n const shell = {\n isFinished,\n statusCode,\n response,\n error,\n data,\n isFetching,\n canAbort,\n aborted,\n abort,\n execute,\n onFetchResponse: responseEvent.on,\n onFetchError: errorEvent.on,\n onFetchFinally: finallyEvent.on,\n get: setMethod(\"GET\"),\n put: setMethod(\"PUT\"),\n post: setMethod(\"POST\"),\n delete: setMethod(\"DELETE\"),\n patch: setMethod(\"PATCH\"),\n head: setMethod(\"HEAD\"),\n options: setMethod(\"OPTIONS\"),\n json: setType(\"json\"),\n text: setType(\"text\"),\n blob: setType(\"blob\"),\n arrayBuffer: setType(\"arrayBuffer\"),\n formData: setType(\"formData\")\n };\n function setMethod(method) {\n return (payload, payloadType) => {\n if (!isFetching.value) {\n config.method = method;\n config.payload = payload;\n config.payloadType = payloadType;\n if (isRef(config.payload)) {\n watch([\n refetch,\n resolveRef(config.payload)\n ], ([refetch2]) => refetch2 && execute(), { deep: true });\n }\n const rawPayload = resolveUnref(config.payload);\n if (!payloadType && rawPayload && Object.getPrototypeOf(rawPayload) === Object.prototype && !(rawPayload instanceof FormData))\n config.payloadType = \"json\";\n return __spreadProps$3(__spreadValues$d({}, shell), {\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n });\n }\n return void 0;\n };\n }\n function waitUntilFinished() {\n return new Promise((resolve, reject) => {\n until(isFinished).toBe(true).then(() => resolve(shell)).catch((error2) => reject(error2));\n });\n }\n function setType(type) {\n return () => {\n if (!isFetching.value) {\n config.type = type;\n return __spreadProps$3(__spreadValues$d({}, shell), {\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n });\n }\n return void 0;\n };\n }\n if (options.immediate)\n setTimeout(execute, 0);\n return __spreadProps$3(__spreadValues$d({}, shell), {\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n });\n}\nfunction joinPaths(start, end) {\n if (!start.endsWith(\"/\") && !end.startsWith(\"/\"))\n return `${start}/${end}`;\n return `${start}${end}`;\n}\n\nvar __defProp$c = Object.defineProperty;\nvar __getOwnPropSymbols$d = Object.getOwnPropertySymbols;\nvar __hasOwnProp$d = Object.prototype.hasOwnProperty;\nvar __propIsEnum$d = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$c = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$d.call(b, prop))\n __defNormalProp$c(a, prop, b[prop]);\n if (__getOwnPropSymbols$d)\n for (var prop of __getOwnPropSymbols$d(b)) {\n if (__propIsEnum$d.call(b, prop))\n __defNormalProp$c(a, prop, b[prop]);\n }\n return a;\n};\nconst DEFAULT_OPTIONS = {\n multiple: true,\n accept: \"*\"\n};\nfunction useFileDialog(options = {}) {\n const {\n document = defaultDocument\n } = options;\n const files = ref(null);\n let input;\n if (document) {\n input = document.createElement(\"input\");\n input.type = \"file\";\n input.onchange = (event) => {\n const result = event.target;\n files.value = result.files;\n };\n }\n const open = (localOptions) => {\n if (!input)\n return;\n const _options = __spreadValues$c(__spreadValues$c(__spreadValues$c({}, DEFAULT_OPTIONS), options), localOptions);\n input.multiple = _options.multiple;\n input.accept = _options.accept;\n if (hasOwn(_options, \"capture\"))\n input.capture = _options.capture;\n input.click();\n };\n const reset = () => {\n files.value = null;\n if (input)\n input.value = \"\";\n };\n return {\n files: readonly(files),\n open,\n reset\n };\n}\n\nvar __defProp$b = Object.defineProperty;\nvar __getOwnPropSymbols$c = Object.getOwnPropertySymbols;\nvar __hasOwnProp$c = Object.prototype.hasOwnProperty;\nvar __propIsEnum$c = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$b = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$c.call(b, prop))\n __defNormalProp$b(a, prop, b[prop]);\n if (__getOwnPropSymbols$c)\n for (var prop of __getOwnPropSymbols$c(b)) {\n if (__propIsEnum$c.call(b, prop))\n __defNormalProp$b(a, prop, b[prop]);\n }\n return a;\n};\nfunction useFileSystemAccess(options = {}) {\n const {\n window: _window = defaultWindow,\n dataType = \"Text\"\n } = unref(options);\n const window = _window;\n const isSupported = useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n const fileHandle = ref();\n const data = ref();\n const file = ref();\n const fileName = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.name) != null ? _b : \"\";\n });\n const fileMIME = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.type) != null ? _b : \"\";\n });\n const fileSize = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.size) != null ? _b : 0;\n });\n const fileLastModified = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.lastModified) != null ? _b : 0;\n });\n async function open(_options = {}) {\n if (!isSupported.value)\n return;\n const [handle] = await window.showOpenFilePicker(__spreadValues$b(__spreadValues$b({}, unref(options)), _options));\n fileHandle.value = handle;\n await updateFile();\n await updateData();\n }\n async function create(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker(__spreadValues$b(__spreadValues$b({}, unref(options)), _options));\n data.value = void 0;\n await updateFile();\n await updateData();\n }\n async function save(_options = {}) {\n if (!isSupported.value)\n return;\n if (!fileHandle.value)\n return saveAs(_options);\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function saveAs(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker(__spreadValues$b(__spreadValues$b({}, unref(options)), _options));\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function updateFile() {\n var _a;\n file.value = await ((_a = fileHandle.value) == null ? void 0 : _a.getFile());\n }\n async function updateData() {\n var _a, _b;\n if (unref(dataType) === \"Text\")\n data.value = await ((_a = file.value) == null ? void 0 : _a.text());\n if (unref(dataType) === \"ArrayBuffer\")\n data.value = await ((_b = file.value) == null ? void 0 : _b.arrayBuffer());\n if (unref(dataType) === \"Blob\")\n data.value = file.value;\n }\n watch(() => unref(dataType), updateData);\n return {\n isSupported,\n data,\n file,\n fileName,\n fileMIME,\n fileSize,\n fileLastModified,\n open,\n create,\n save,\n saveAs,\n updateData\n };\n}\n\nfunction useFocus(target, options = {}) {\n const { initialValue = false } = options;\n const innerFocused = ref(false);\n const targetElement = computed(() => unrefElement(target));\n useEventListener(targetElement, \"focus\", () => innerFocused.value = true);\n useEventListener(targetElement, \"blur\", () => innerFocused.value = false);\n const focused = computed({\n get: () => innerFocused.value,\n set(value) {\n var _a, _b;\n if (!value && innerFocused.value)\n (_a = targetElement.value) == null ? void 0 : _a.blur();\n else if (value && !innerFocused.value)\n (_b = targetElement.value) == null ? void 0 : _b.focus();\n }\n });\n watch(targetElement, () => {\n focused.value = initialValue;\n }, { immediate: true, flush: \"post\" });\n return { focused };\n}\n\nfunction useFocusWithin(target, options = {}) {\n const activeElement = useActiveElement(options);\n const targetElement = computed(() => unrefElement(target));\n const focused = computed(() => targetElement.value && activeElement.value ? targetElement.value.contains(activeElement.value) : false);\n return { focused };\n}\n\nfunction useFps(options) {\n var _a;\n const fps = ref(0);\n if (typeof performance === \"undefined\")\n return fps;\n const every = (_a = options == null ? void 0 : options.every) != null ? _a : 10;\n let last = performance.now();\n let ticks = 0;\n useRafFn(() => {\n ticks += 1;\n if (ticks >= every) {\n const now = performance.now();\n const diff = now - last;\n fps.value = Math.round(1e3 / (diff / ticks));\n last = now;\n ticks = 0;\n }\n });\n return fps;\n}\n\nconst functionsMap = [\n [\n \"requestFullscreen\",\n \"exitFullscreen\",\n \"fullscreenElement\",\n \"fullscreenEnabled\",\n \"fullscreenchange\",\n \"fullscreenerror\"\n ],\n [\n \"webkitRequestFullscreen\",\n \"webkitExitFullscreen\",\n \"webkitFullscreenElement\",\n \"webkitFullscreenEnabled\",\n \"webkitfullscreenchange\",\n \"webkitfullscreenerror\"\n ],\n [\n \"webkitRequestFullScreen\",\n \"webkitCancelFullScreen\",\n \"webkitCurrentFullScreenElement\",\n \"webkitCancelFullScreen\",\n \"webkitfullscreenchange\",\n \"webkitfullscreenerror\"\n ],\n [\n \"mozRequestFullScreen\",\n \"mozCancelFullScreen\",\n \"mozFullScreenElement\",\n \"mozFullScreenEnabled\",\n \"mozfullscreenchange\",\n \"mozfullscreenerror\"\n ],\n [\n \"msRequestFullscreen\",\n \"msExitFullscreen\",\n \"msFullscreenElement\",\n \"msFullscreenEnabled\",\n \"MSFullscreenChange\",\n \"MSFullscreenError\"\n ]\n];\nfunction useFullscreen(target, options = {}) {\n const { document = defaultDocument, autoExit = false } = options;\n const targetRef = target || (document == null ? void 0 : document.querySelector(\"html\"));\n const isFullscreen = ref(false);\n let map = functionsMap[0];\n const isSupported = useSupported(() => {\n if (!document) {\n return false;\n } else {\n for (const m of functionsMap) {\n if (m[1] in document) {\n map = m;\n return true;\n }\n }\n }\n return false;\n });\n const [REQUEST, EXIT, ELEMENT, , EVENT] = map;\n async function exit() {\n if (!isSupported.value)\n return;\n if (document == null ? void 0 : document[ELEMENT])\n await document[EXIT]();\n isFullscreen.value = false;\n }\n async function enter() {\n if (!isSupported.value)\n return;\n await exit();\n const target2 = unrefElement(targetRef);\n if (target2) {\n await target2[REQUEST]();\n isFullscreen.value = true;\n }\n }\n async function toggle() {\n if (isFullscreen.value)\n await exit();\n else\n await enter();\n }\n if (document) {\n useEventListener(document, EVENT, () => {\n isFullscreen.value = !!(document == null ? void 0 : document[ELEMENT]);\n }, false);\n }\n if (autoExit)\n tryOnScopeDispose(exit);\n return {\n isSupported,\n isFullscreen,\n enter,\n exit,\n toggle\n };\n}\n\nfunction mapGamepadToXbox360Controller(gamepad) {\n return computed(() => {\n if (gamepad.value) {\n return {\n buttons: {\n a: gamepad.value.buttons[0],\n b: gamepad.value.buttons[1],\n x: gamepad.value.buttons[2],\n y: gamepad.value.buttons[3]\n },\n bumper: {\n left: gamepad.value.buttons[4],\n right: gamepad.value.buttons[5]\n },\n triggers: {\n left: gamepad.value.buttons[6],\n right: gamepad.value.buttons[7]\n },\n stick: {\n left: {\n horizontal: gamepad.value.axes[0],\n vertical: gamepad.value.axes[1],\n button: gamepad.value.buttons[10]\n },\n right: {\n horizontal: gamepad.value.axes[2],\n vertical: gamepad.value.axes[3],\n button: gamepad.value.buttons[11]\n }\n },\n dpad: {\n up: gamepad.value.buttons[12],\n down: gamepad.value.buttons[13],\n left: gamepad.value.buttons[14],\n right: gamepad.value.buttons[15]\n },\n back: gamepad.value.buttons[8],\n start: gamepad.value.buttons[9]\n };\n }\n return null;\n });\n}\nfunction useGamepad(options = {}) {\n const {\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"getGamepads\" in navigator);\n const gamepads = ref([]);\n const onConnectedHook = createEventHook();\n const onDisconnectedHook = createEventHook();\n const stateFromGamepad = (gamepad) => {\n const hapticActuators = [];\n const vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n if (vibrationActuator)\n hapticActuators.push(vibrationActuator);\n if (gamepad.hapticActuators)\n hapticActuators.push(...gamepad.hapticActuators);\n return {\n id: gamepad.id,\n hapticActuators,\n index: gamepad.index,\n mapping: gamepad.mapping,\n connected: gamepad.connected,\n timestamp: gamepad.timestamp,\n axes: gamepad.axes.map((axes) => axes),\n buttons: gamepad.buttons.map((button) => ({ pressed: button.pressed, touched: button.touched, value: button.value }))\n };\n };\n const updateGamepadState = () => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n for (let i = 0; i < _gamepads.length; ++i) {\n const gamepad = _gamepads[i];\n if (gamepad) {\n const index = gamepads.value.findIndex(({ index: index2 }) => index2 === gamepad.index);\n if (index > -1)\n gamepads.value[index] = stateFromGamepad(gamepad);\n }\n }\n };\n const { isActive, pause, resume } = useRafFn(updateGamepadState);\n const onGamepadConnected = (gamepad) => {\n if (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n gamepads.value.push(stateFromGamepad(gamepad));\n onConnectedHook.trigger(gamepad.index);\n }\n resume();\n };\n const onGamepadDisconnected = (gamepad) => {\n gamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n onDisconnectedHook.trigger(gamepad.index);\n };\n useEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad));\n useEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad));\n tryOnMounted(() => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n if (_gamepads) {\n for (let i = 0; i < _gamepads.length; ++i) {\n const gamepad = _gamepads[i];\n if (gamepad)\n onGamepadConnected(gamepad);\n }\n }\n });\n pause();\n return {\n isSupported,\n onConnected: onConnectedHook.on,\n onDisconnected: onDisconnectedHook.on,\n gamepads,\n pause,\n resume,\n isActive\n };\n}\n\nfunction useGeolocation(options = {}) {\n const {\n enableHighAccuracy = true,\n maximumAge = 3e4,\n timeout = 27e3,\n navigator = defaultNavigator,\n immediate = true\n } = options;\n const isSupported = useSupported(() => navigator && \"geolocation\" in navigator);\n const locatedAt = ref(null);\n const error = ref(null);\n const coords = ref({\n accuracy: 0,\n latitude: Infinity,\n longitude: Infinity,\n altitude: null,\n altitudeAccuracy: null,\n heading: null,\n speed: null\n });\n function updatePosition(position) {\n locatedAt.value = position.timestamp;\n coords.value = position.coords;\n error.value = null;\n }\n let watcher;\n function resume() {\n if (isSupported.value) {\n watcher = navigator.geolocation.watchPosition(updatePosition, (err) => error.value = err, {\n enableHighAccuracy,\n maximumAge,\n timeout\n });\n }\n }\n if (immediate)\n resume();\n function pause() {\n if (watcher && navigator)\n navigator.geolocation.clearWatch(watcher);\n }\n tryOnScopeDispose(() => {\n pause();\n });\n return {\n isSupported,\n coords,\n locatedAt,\n error,\n resume,\n pause\n };\n}\n\nconst defaultEvents$1 = [\"mousemove\", \"mousedown\", \"resize\", \"keydown\", \"touchstart\", \"wheel\"];\nconst oneMinute = 6e4;\nfunction useIdle(timeout = oneMinute, options = {}) {\n const {\n initialState = false,\n listenForVisibilityChange = true,\n events = defaultEvents$1,\n window = defaultWindow,\n eventFilter = throttleFilter(50)\n } = options;\n const idle = ref(initialState);\n const lastActive = ref(timestamp());\n let timer;\n const onEvent = createFilterWrapper(eventFilter, () => {\n idle.value = false;\n lastActive.value = timestamp();\n clearTimeout(timer);\n timer = setTimeout(() => idle.value = true, timeout);\n });\n if (window) {\n const document = window.document;\n for (const event of events)\n useEventListener(window, event, onEvent, { passive: true });\n if (listenForVisibilityChange) {\n useEventListener(document, \"visibilitychange\", () => {\n if (!document.hidden)\n onEvent();\n });\n }\n }\n timer = setTimeout(() => idle.value = true, timeout);\n return { idle, lastActive };\n}\n\nvar __defProp$a = Object.defineProperty;\nvar __getOwnPropSymbols$b = Object.getOwnPropertySymbols;\nvar __hasOwnProp$b = Object.prototype.hasOwnProperty;\nvar __propIsEnum$b = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$a = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$b.call(b, prop))\n __defNormalProp$a(a, prop, b[prop]);\n if (__getOwnPropSymbols$b)\n for (var prop of __getOwnPropSymbols$b(b)) {\n if (__propIsEnum$b.call(b, prop))\n __defNormalProp$a(a, prop, b[prop]);\n }\n return a;\n};\nasync function loadImage(options) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n const { src, srcset, sizes } = options;\n img.src = src;\n if (srcset)\n img.srcset = srcset;\n if (sizes)\n img.sizes = sizes;\n img.onload = () => resolve(img);\n img.onerror = reject;\n });\n}\nconst useImage = (options, asyncStateOptions = {}) => {\n const state = useAsyncState(() => loadImage(resolveUnref(options)), void 0, __spreadValues$a({\n resetOnExecute: true\n }, asyncStateOptions));\n watch(() => resolveUnref(options), () => state.execute(asyncStateOptions.delay), { deep: true });\n return state;\n};\n\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\nfunction useScroll(element, options = {}) {\n const {\n throttle = 0,\n idle = 200,\n onStop = noop,\n onScroll = noop,\n offset = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n },\n eventListenerOptions = {\n capture: false,\n passive: true\n },\n behavior = \"auto\"\n } = options;\n const internalX = ref(0);\n const internalY = ref(0);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo(x2, void 0);\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo(void 0, y2);\n }\n });\n function scrollTo(_x, _y) {\n var _a, _b, _c;\n const _element = resolveUnref(element);\n if (!_element)\n return;\n (_c = _element instanceof Document ? document.body : _element) == null ? void 0 : _c.scrollTo({\n top: (_a = resolveUnref(_y)) != null ? _a : y.value,\n left: (_b = resolveUnref(_x)) != null ? _b : x.value,\n behavior: resolveUnref(behavior)\n });\n }\n const isScrolling = ref(false);\n const arrivedState = reactive({\n left: true,\n right: false,\n top: true,\n bottom: false\n });\n const directions = reactive({\n left: false,\n right: false,\n top: false,\n bottom: false\n });\n const onScrollEnd = (e) => {\n if (!isScrolling.value)\n return;\n isScrolling.value = false;\n directions.left = false;\n directions.right = false;\n directions.top = false;\n directions.bottom = false;\n onStop(e);\n };\n const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n const onScrollHandler = (e) => {\n const eventTarget = e.target === document ? e.target.documentElement : e.target;\n const scrollLeft = eventTarget.scrollLeft;\n directions.left = scrollLeft < internalX.value;\n directions.right = scrollLeft > internalY.value;\n arrivedState.left = scrollLeft <= 0 + (offset.left || 0);\n arrivedState.right = scrollLeft + eventTarget.clientWidth >= eventTarget.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n internalX.value = scrollLeft;\n let scrollTop = eventTarget.scrollTop;\n if (e.target === document && !scrollTop)\n scrollTop = document.body.scrollTop;\n directions.top = scrollTop < internalY.value;\n directions.bottom = scrollTop > internalY.value;\n arrivedState.top = scrollTop <= 0 + (offset.top || 0);\n arrivedState.bottom = scrollTop + eventTarget.clientHeight >= eventTarget.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n internalY.value = scrollTop;\n isScrolling.value = true;\n onScrollEndDebounced(e);\n onScroll(e);\n };\n useEventListener(element, \"scroll\", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);\n useEventListener(element, \"scrollend\", onScrollEnd, eventListenerOptions);\n return {\n x,\n y,\n isScrolling,\n arrivedState,\n directions\n };\n}\n\nvar __defProp$9 = Object.defineProperty;\nvar __defProps$2 = Object.defineProperties;\nvar __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$a = Object.getOwnPropertySymbols;\nvar __hasOwnProp$a = Object.prototype.hasOwnProperty;\nvar __propIsEnum$a = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$9 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$a.call(b, prop))\n __defNormalProp$9(a, prop, b[prop]);\n if (__getOwnPropSymbols$a)\n for (var prop of __getOwnPropSymbols$a(b)) {\n if (__propIsEnum$a.call(b, prop))\n __defNormalProp$9(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n var _a, _b;\n const direction = (_a = options.direction) != null ? _a : \"bottom\";\n const state = reactive(useScroll(element, __spreadProps$2(__spreadValues$9({}, options), {\n offset: __spreadValues$9({\n [direction]: (_b = options.distance) != null ? _b : 0\n }, options.offset)\n })));\n watch(() => state.arrivedState[direction], async (v) => {\n var _a2, _b2;\n if (v) {\n const elem = resolveUnref(element);\n const previous = {\n height: (_a2 = elem == null ? void 0 : elem.scrollHeight) != null ? _a2 : 0,\n width: (_b2 = elem == null ? void 0 : elem.scrollWidth) != null ? _b2 : 0\n };\n await onLoadMore(state);\n if (options.preserveScrollPosition && elem) {\n nextTick(() => {\n elem.scrollTo({\n top: elem.scrollHeight - previous.height,\n left: elem.scrollWidth - previous.width\n });\n });\n }\n }\n });\n}\n\nfunction useIntersectionObserver(target, callback, options = {}) {\n const {\n root,\n rootMargin = \"0px\",\n threshold = 0.1,\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"IntersectionObserver\" in window);\n let cleanup = noop;\n const stopWatch = isSupported.value ? watch(() => ({\n el: unrefElement(target),\n root: unrefElement(root)\n }), ({ el, root: root2 }) => {\n cleanup();\n if (!el)\n return;\n const observer = new IntersectionObserver(callback, {\n root: root2,\n rootMargin,\n threshold\n });\n observer.observe(el);\n cleanup = () => {\n observer.disconnect();\n cleanup = noop;\n };\n }, { immediate: true, flush: \"post\" }) : noop;\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nconst defaultEvents = [\"mousedown\", \"mouseup\", \"keydown\", \"keyup\"];\nfunction useKeyModifier(modifier, options = {}) {\n const {\n events = defaultEvents,\n document = defaultDocument,\n initial = null\n } = options;\n const state = ref(initial);\n if (document) {\n events.forEach((listenerEvent) => {\n useEventListener(document, listenerEvent, (evt) => {\n if (typeof evt.getModifierState === \"function\")\n state.value = evt.getModifierState(modifier);\n });\n });\n }\n return state;\n}\n\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.localStorage, options);\n}\n\nconst DefaultMagicKeysAliasMap = {\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};\n\nfunction useMagicKeys(options = {}) {\n const {\n reactive: useReactive = false,\n target = defaultWindow,\n aliasMap = DefaultMagicKeysAliasMap,\n passive = true,\n onEventFired = noop\n } = options;\n const current = reactive(new Set());\n const obj = {\n toJSON() {\n return {};\n },\n current\n };\n const refs = useReactive ? reactive(obj) : obj;\n const metaDeps = new Set();\n const usedKeys = new Set();\n function setRefs(key, value) {\n if (key in refs) {\n if (useReactive)\n refs[key] = value;\n else\n refs[key].value = value;\n }\n }\n function reset() {\n current.clear();\n for (const key of usedKeys)\n setRefs(key, false);\n }\n function updateRefs(e, value) {\n var _a, _b;\n const key = (_a = e.key) == null ? void 0 : _a.toLowerCase();\n const code = (_b = e.code) == null ? void 0 : _b.toLowerCase();\n const values = [code, key].filter(Boolean);\n if (key) {\n if (value)\n current.add(key);\n else\n current.delete(key);\n }\n for (const key2 of values) {\n usedKeys.add(key2);\n setRefs(key2, value);\n }\n if (key === \"meta\" && !value) {\n metaDeps.forEach((key2) => {\n current.delete(key2);\n setRefs(key2, false);\n });\n metaDeps.clear();\n } else if (typeof e.getModifierState === \"function\" && e.getModifierState(\"Meta\") && value) {\n [...current, ...values].forEach((key2) => metaDeps.add(key2));\n }\n }\n useEventListener(target, \"keydown\", (e) => {\n updateRefs(e, true);\n return onEventFired(e);\n }, { passive });\n useEventListener(target, \"keyup\", (e) => {\n updateRefs(e, false);\n return onEventFired(e);\n }, { passive });\n useEventListener(\"blur\", reset, { passive: true });\n useEventListener(\"focus\", reset, { passive: true });\n const proxy = new Proxy(refs, {\n get(target2, prop, rec) {\n if (typeof prop !== \"string\")\n return Reflect.get(target2, prop, rec);\n prop = prop.toLowerCase();\n if (prop in aliasMap)\n prop = aliasMap[prop];\n if (!(prop in refs)) {\n if (/[+_-]/.test(prop)) {\n const keys = prop.split(/[+_-]/g).map((i) => i.trim());\n refs[prop] = computed(() => keys.every((key) => unref(proxy[key])));\n } else {\n refs[prop] = ref(false);\n }\n }\n const r = Reflect.get(target2, prop, rec);\n return useReactive ? unref(r) : r;\n }\n });\n return proxy;\n}\n\nvar __defProp$8 = Object.defineProperty;\nvar __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$9 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$9 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$8 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$9.call(b, prop))\n __defNormalProp$8(a, prop, b[prop]);\n if (__getOwnPropSymbols$9)\n for (var prop of __getOwnPropSymbols$9(b)) {\n if (__propIsEnum$9.call(b, prop))\n __defNormalProp$8(a, prop, b[prop]);\n }\n return a;\n};\nfunction usingElRef(source, cb) {\n if (resolveUnref(source))\n cb(resolveUnref(source));\n}\nfunction timeRangeToArray(timeRanges) {\n let ranges = [];\n for (let i = 0; i < timeRanges.length; ++i)\n ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n return ranges;\n}\nfunction tracksToArray(tracks) {\n return Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({ id, label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }));\n}\nconst defaultOptions = {\n src: \"\",\n tracks: []\n};\nfunction useMediaControls(target, options = {}) {\n options = __spreadValues$8(__spreadValues$8({}, defaultOptions), options);\n const {\n document = defaultDocument\n } = options;\n const currentTime = ref(0);\n const duration = ref(0);\n const seeking = ref(false);\n const volume = ref(1);\n const waiting = ref(false);\n const ended = ref(false);\n const playing = ref(false);\n const rate = ref(1);\n const stalled = ref(false);\n const buffered = ref([]);\n const tracks = ref([]);\n const selectedTrack = ref(-1);\n const isPictureInPicture = ref(false);\n const muted = ref(false);\n const supportsPictureInPicture = document && \"pictureInPictureEnabled\" in document;\n const sourceErrorEvent = createEventHook();\n const disableTrack = (track) => {\n usingElRef(target, (el) => {\n if (track) {\n const id = isNumber(track) ? track : track.id;\n el.textTracks[id].mode = \"disabled\";\n } else {\n for (let i = 0; i < el.textTracks.length; ++i)\n el.textTracks[i].mode = \"disabled\";\n }\n selectedTrack.value = -1;\n });\n };\n const enableTrack = (track, disableTracks = true) => {\n usingElRef(target, (el) => {\n const id = isNumber(track) ? track : track.id;\n if (disableTracks)\n disableTrack();\n el.textTracks[id].mode = \"showing\";\n selectedTrack.value = id;\n });\n };\n const togglePictureInPicture = () => {\n return new Promise((resolve, reject) => {\n usingElRef(target, async (el) => {\n if (supportsPictureInPicture) {\n if (!isPictureInPicture.value) {\n el.requestPictureInPicture().then(resolve).catch(reject);\n } else {\n document.exitPictureInPicture().then(resolve).catch(reject);\n }\n }\n });\n });\n };\n watchEffect(() => {\n if (!document)\n return;\n const el = resolveUnref(target);\n if (!el)\n return;\n const src = resolveUnref(options.src);\n let sources = [];\n if (!src)\n return;\n if (isString(src))\n sources = [{ src }];\n else if (Array.isArray(src))\n sources = src;\n else if (isObject(src))\n sources = [src];\n el.querySelectorAll(\"source\").forEach((e) => {\n e.removeEventListener(\"error\", sourceErrorEvent.trigger);\n e.remove();\n });\n sources.forEach(({ src: src2, type }) => {\n const source = document.createElement(\"source\");\n source.setAttribute(\"src\", src2);\n source.setAttribute(\"type\", type || \"\");\n source.addEventListener(\"error\", sourceErrorEvent.trigger);\n el.appendChild(source);\n });\n el.load();\n });\n tryOnScopeDispose(() => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.querySelectorAll(\"source\").forEach((e) => e.removeEventListener(\"error\", sourceErrorEvent.trigger));\n });\n watch(volume, (vol) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.volume = vol;\n });\n watch(muted, (mute) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.muted = mute;\n });\n watch(rate, (rate2) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.playbackRate = rate2;\n });\n watchEffect(() => {\n if (!document)\n return;\n const textTracks = resolveUnref(options.tracks);\n const el = resolveUnref(target);\n if (!textTracks || !textTracks.length || !el)\n return;\n el.querySelectorAll(\"track\").forEach((e) => e.remove());\n textTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n const track = document.createElement(\"track\");\n track.default = isDefault || false;\n track.kind = kind;\n track.label = label;\n track.src = src;\n track.srclang = srcLang;\n if (track.default)\n selectedTrack.value = i;\n el.appendChild(track);\n });\n });\n const { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.currentTime = time;\n });\n const { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n isPlaying ? el.play() : el.pause();\n });\n useEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = resolveUnref(target).currentTime));\n useEventListener(target, \"durationchange\", () => duration.value = resolveUnref(target).duration);\n useEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(resolveUnref(target).buffered));\n useEventListener(target, \"seeking\", () => seeking.value = true);\n useEventListener(target, \"seeked\", () => seeking.value = false);\n useEventListener(target, \"waiting\", () => waiting.value = true);\n useEventListener(target, \"playing\", () => {\n waiting.value = false;\n ended.value = false;\n });\n useEventListener(target, \"ratechange\", () => rate.value = resolveUnref(target).playbackRate);\n useEventListener(target, \"stalled\", () => stalled.value = true);\n useEventListener(target, \"ended\", () => ended.value = true);\n useEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false));\n useEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true));\n useEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true);\n useEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false);\n useEventListener(target, \"volumechange\", () => {\n const el = resolveUnref(target);\n if (!el)\n return;\n volume.value = el.volume;\n muted.value = el.muted;\n });\n const listeners = [];\n const stop = watch([target], () => {\n const el = resolveUnref(target);\n if (!el)\n return;\n stop();\n listeners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks));\n });\n tryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n return {\n currentTime,\n duration,\n waiting,\n seeking,\n ended,\n stalled,\n buffered,\n playing,\n rate,\n volume,\n muted,\n tracks,\n selectedTrack,\n enableTrack,\n disableTrack,\n supportsPictureInPicture,\n togglePictureInPicture,\n isPictureInPicture,\n onSourceError: sourceErrorEvent.on\n };\n}\n\nconst getMapVue2Compat = () => {\n const data = reactive({});\n return {\n get: (key) => data[key],\n set: (key, value) => set(data, key, value),\n has: (key) => hasOwn(data, key),\n delete: (key) => del(data, key),\n clear: () => {\n Object.keys(data).forEach((key) => {\n del(data, key);\n });\n }\n };\n};\nfunction useMemoize(resolver, options) {\n const initCache = () => {\n if (options == null ? void 0 : options.cache)\n return reactive(options.cache);\n if (isVue2)\n return getMapVue2Compat();\n return reactive(new Map());\n };\n const cache = initCache();\n const generateKey = (...args) => (options == null ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n const _loadData = (key, ...args) => {\n cache.set(key, resolver(...args));\n return cache.get(key);\n };\n const loadData = (...args) => _loadData(generateKey(...args), ...args);\n const deleteData = (...args) => {\n cache.delete(generateKey(...args));\n };\n const clearData = () => {\n cache.clear();\n };\n const memoized = (...args) => {\n const key = generateKey(...args);\n if (cache.has(key))\n return cache.get(key);\n return _loadData(key, ...args);\n };\n memoized.load = loadData;\n memoized.delete = deleteData;\n memoized.clear = clearData;\n memoized.generateKey = generateKey;\n memoized.cache = cache;\n return memoized;\n}\n\nfunction useMemory(options = {}) {\n const memory = ref();\n const isSupported = useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n if (isSupported.value) {\n const { interval = 1e3 } = options;\n useIntervalFn(() => {\n memory.value = performance.memory;\n }, interval, { immediate: options.immediate, immediateCallback: options.immediateCallback });\n }\n return { isSupported, memory };\n}\n\nfunction useMounted() {\n const isMounted = ref(false);\n onMounted(() => {\n isMounted.value = true;\n });\n return isMounted;\n}\n\nfunction useMouse(options = {}) {\n const {\n type = \"page\",\n touch = true,\n resetOnTouchEnds = false,\n initialValue = { x: 0, y: 0 },\n window = defaultWindow,\n eventFilter\n } = options;\n const x = ref(initialValue.x);\n const y = ref(initialValue.y);\n const sourceType = ref(null);\n const mouseHandler = (event) => {\n if (type === \"page\") {\n x.value = event.pageX;\n y.value = event.pageY;\n } else if (type === \"client\") {\n x.value = event.clientX;\n y.value = event.clientY;\n } else if (type === \"movement\") {\n x.value = event.movementX;\n y.value = event.movementY;\n }\n sourceType.value = \"mouse\";\n };\n const reset = () => {\n x.value = initialValue.x;\n y.value = initialValue.y;\n };\n const touchHandler = (event) => {\n if (event.touches.length > 0) {\n const touch2 = event.touches[0];\n if (type === \"page\") {\n x.value = touch2.pageX;\n y.value = touch2.pageY;\n } else if (type === \"client\") {\n x.value = touch2.clientX;\n y.value = touch2.clientY;\n }\n sourceType.value = \"touch\";\n }\n };\n const mouseHandlerWrapper = (event) => {\n return eventFilter === void 0 ? mouseHandler(event) : eventFilter(() => mouseHandler(event), {});\n };\n const touchHandlerWrapper = (event) => {\n return eventFilter === void 0 ? touchHandler(event) : eventFilter(() => touchHandler(event), {});\n };\n if (window) {\n useEventListener(window, \"mousemove\", mouseHandlerWrapper, { passive: true });\n useEventListener(window, \"dragover\", mouseHandlerWrapper, { passive: true });\n if (touch && type !== \"movement\") {\n useEventListener(window, \"touchstart\", touchHandlerWrapper, { passive: true });\n useEventListener(window, \"touchmove\", touchHandlerWrapper, { passive: true });\n if (resetOnTouchEnds)\n useEventListener(window, \"touchend\", reset, { passive: true });\n }\n }\n return {\n x,\n y,\n sourceType\n };\n}\n\nfunction useMouseInElement(target, options = {}) {\n const {\n handleOutside = true,\n window = defaultWindow\n } = options;\n const { x, y, sourceType } = useMouse(options);\n const targetRef = ref(target != null ? target : window == null ? void 0 : window.document.body);\n const elementX = ref(0);\n const elementY = ref(0);\n const elementPositionX = ref(0);\n const elementPositionY = ref(0);\n const elementHeight = ref(0);\n const elementWidth = ref(0);\n const isOutside = ref(true);\n let stop = () => {\n };\n if (window) {\n stop = watch([targetRef, x, y], () => {\n const el = unrefElement(targetRef);\n if (!el)\n return;\n const {\n left,\n top,\n width,\n height\n } = el.getBoundingClientRect();\n elementPositionX.value = left + window.pageXOffset;\n elementPositionY.value = top + window.pageYOffset;\n elementHeight.value = height;\n elementWidth.value = width;\n const elX = x.value - elementPositionX.value;\n const elY = y.value - elementPositionY.value;\n isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n if (handleOutside || !isOutside.value) {\n elementX.value = elX;\n elementY.value = elY;\n }\n }, { immediate: true });\n useEventListener(document, \"mouseleave\", () => {\n isOutside.value = true;\n });\n }\n return {\n x,\n y,\n sourceType,\n elementX,\n elementY,\n elementPositionX,\n elementPositionY,\n elementHeight,\n elementWidth,\n isOutside,\n stop\n };\n}\n\nfunction useMousePressed(options = {}) {\n const {\n touch = true,\n drag = true,\n initialValue = false,\n window = defaultWindow\n } = options;\n const pressed = ref(initialValue);\n const sourceType = ref(null);\n if (!window) {\n return {\n pressed,\n sourceType\n };\n }\n const onPressed = (srcType) => () => {\n pressed.value = true;\n sourceType.value = srcType;\n };\n const onReleased = () => {\n pressed.value = false;\n sourceType.value = null;\n };\n const target = computed(() => unrefElement(options.target) || window);\n useEventListener(target, \"mousedown\", onPressed(\"mouse\"), { passive: true });\n useEventListener(window, \"mouseleave\", onReleased, { passive: true });\n useEventListener(window, \"mouseup\", onReleased, { passive: true });\n if (drag) {\n useEventListener(target, \"dragstart\", onPressed(\"mouse\"), { passive: true });\n useEventListener(window, \"drop\", onReleased, { passive: true });\n useEventListener(window, \"dragend\", onReleased, { passive: true });\n }\n if (touch) {\n useEventListener(target, \"touchstart\", onPressed(\"touch\"), { passive: true });\n useEventListener(window, \"touchend\", onReleased, { passive: true });\n useEventListener(window, \"touchcancel\", onReleased, { passive: true });\n }\n return {\n pressed,\n sourceType\n };\n}\n\nvar __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$8 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$8 = Object.prototype.propertyIsEnumerable;\nvar __objRest$1 = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols$8)\n for (var prop of __getOwnPropSymbols$8(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction useMutationObserver(target, callback, options = {}) {\n const _a = options, { window = defaultWindow } = _a, mutationOptions = __objRest$1(_a, [\"window\"]);\n let observer;\n const isSupported = useSupported(() => window && \"MutationObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const stopWatch = watch(() => unrefElement(target), (el) => {\n cleanup();\n if (isSupported.value && window && el) {\n observer = new MutationObserver(callback);\n observer.observe(el, mutationOptions);\n }\n }, { immediate: true });\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nconst useNavigatorLanguage = (options = {}) => {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"language\" in navigator);\n const language = ref(navigator == null ? void 0 : navigator.language);\n useEventListener(window, \"languagechange\", () => {\n if (navigator)\n language.value = navigator.language;\n });\n return {\n isSupported,\n language\n };\n};\n\nfunction useNetwork(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"connection\" in navigator);\n const isOnline = ref(true);\n const saveData = ref(false);\n const offlineAt = ref(void 0);\n const onlineAt = ref(void 0);\n const downlink = ref(void 0);\n const downlinkMax = ref(void 0);\n const rtt = ref(void 0);\n const effectiveType = ref(void 0);\n const type = ref(\"unknown\");\n const connection = isSupported.value && navigator.connection;\n function updateNetworkInformation() {\n if (!navigator)\n return;\n isOnline.value = navigator.onLine;\n offlineAt.value = isOnline.value ? void 0 : Date.now();\n onlineAt.value = isOnline.value ? Date.now() : void 0;\n if (connection) {\n downlink.value = connection.downlink;\n downlinkMax.value = connection.downlinkMax;\n effectiveType.value = connection.effectiveType;\n rtt.value = connection.rtt;\n saveData.value = connection.saveData;\n type.value = connection.type;\n }\n }\n if (window) {\n useEventListener(window, \"offline\", () => {\n isOnline.value = false;\n offlineAt.value = Date.now();\n });\n useEventListener(window, \"online\", () => {\n isOnline.value = true;\n onlineAt.value = Date.now();\n });\n }\n if (connection)\n useEventListener(connection, \"change\", updateNetworkInformation, false);\n updateNetworkInformation();\n return {\n isSupported,\n isOnline,\n saveData,\n offlineAt,\n onlineAt,\n downlink,\n downlinkMax,\n effectiveType,\n rtt,\n type\n };\n}\n\nvar __defProp$7 = Object.defineProperty;\nvar __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$7 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$7 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$7 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$7.call(b, prop))\n __defNormalProp$7(a, prop, b[prop]);\n if (__getOwnPropSymbols$7)\n for (var prop of __getOwnPropSymbols$7(b)) {\n if (__propIsEnum$7.call(b, prop))\n __defNormalProp$7(a, prop, b[prop]);\n }\n return a;\n};\nfunction useNow(options = {}) {\n const {\n controls: exposeControls = false,\n interval = \"requestAnimationFrame\"\n } = options;\n const now = ref(new Date());\n const update = () => now.value = new Date();\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(update, { immediate: true }) : useIntervalFn(update, interval, { immediate: true });\n if (exposeControls) {\n return __spreadValues$7({\n now\n }, controls);\n } else {\n return now;\n }\n}\n\nfunction useObjectUrl(object) {\n const url = ref();\n const release = () => {\n if (url.value)\n URL.revokeObjectURL(url.value);\n url.value = void 0;\n };\n watch(() => unref(object), (newObject) => {\n release();\n if (newObject)\n url.value = URL.createObjectURL(newObject);\n }, { immediate: true });\n tryOnScopeDispose(release);\n return readonly(url);\n}\n\nfunction useClamp(value, min, max) {\n if (isFunction(value) || isReadonly(value))\n return computed(() => clamp(resolveUnref(value), resolveUnref(min), resolveUnref(max)));\n const _value = ref(value);\n return computed({\n get() {\n return _value.value = clamp(_value.value, resolveUnref(min), resolveUnref(max));\n },\n set(value2) {\n _value.value = clamp(value2, resolveUnref(min), resolveUnref(max));\n }\n });\n}\n\nfunction useOffsetPagination(options) {\n const {\n total = Infinity,\n pageSize = 10,\n page = 1,\n onPageChange = noop,\n onPageSizeChange = noop,\n onPageCountChange = noop\n } = options;\n const currentPageSize = useClamp(pageSize, 1, Infinity);\n const pageCount = computed(() => Math.max(1, Math.ceil(unref(total) / unref(currentPageSize))));\n const currentPage = useClamp(page, 1, pageCount);\n const isFirstPage = computed(() => currentPage.value === 1);\n const isLastPage = computed(() => currentPage.value === pageCount.value);\n if (isRef(page))\n syncRef(page, currentPage);\n if (isRef(pageSize))\n syncRef(pageSize, currentPageSize);\n function prev() {\n currentPage.value--;\n }\n function next() {\n currentPage.value++;\n }\n const returnValue = {\n currentPage,\n currentPageSize,\n pageCount,\n isFirstPage,\n isLastPage,\n prev,\n next\n };\n watch(currentPage, () => {\n onPageChange(reactive(returnValue));\n });\n watch(currentPageSize, () => {\n onPageSizeChange(reactive(returnValue));\n });\n watch(pageCount, () => {\n onPageCountChange(reactive(returnValue));\n });\n return returnValue;\n}\n\nfunction useOnline(options = {}) {\n const { isOnline } = useNetwork(options);\n return isOnline;\n}\n\nfunction usePageLeave(options = {}) {\n const { window = defaultWindow } = options;\n const isLeft = ref(false);\n const handler = (event) => {\n if (!window)\n return;\n event = event || window.event;\n const from = event.relatedTarget || event.toElement;\n isLeft.value = !from;\n };\n if (window) {\n useEventListener(window, \"mouseout\", handler, { passive: true });\n useEventListener(window.document, \"mouseleave\", handler, { passive: true });\n useEventListener(window.document, \"mouseenter\", handler, { passive: true });\n }\n return isLeft;\n}\n\nfunction useParallax(target, options = {}) {\n const {\n deviceOrientationTiltAdjust = (i) => i,\n deviceOrientationRollAdjust = (i) => i,\n mouseTiltAdjust = (i) => i,\n mouseRollAdjust = (i) => i,\n window = defaultWindow\n } = options;\n const orientation = reactive(useDeviceOrientation({ window }));\n const {\n elementX: x,\n elementY: y,\n elementWidth: width,\n elementHeight: height\n } = useMouseInElement(target, { handleOutside: false, window });\n const source = computed(() => {\n if (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0))\n return \"deviceOrientation\";\n return \"mouse\";\n });\n const roll = computed(() => {\n if (source.value === \"deviceOrientation\") {\n const value = -orientation.beta / 90;\n return deviceOrientationRollAdjust(value);\n } else {\n const value = -(y.value - height.value / 2) / height.value;\n return mouseRollAdjust(value);\n }\n });\n const tilt = computed(() => {\n if (source.value === \"deviceOrientation\") {\n const value = orientation.gamma / 90;\n return deviceOrientationTiltAdjust(value);\n } else {\n const value = (x.value - width.value / 2) / width.value;\n return mouseTiltAdjust(value);\n }\n });\n return { roll, tilt, source };\n}\n\nvar __defProp$6 = Object.defineProperty;\nvar __defProps$1 = Object.defineProperties;\nvar __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$6 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$6 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$6 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$6.call(b, prop))\n __defNormalProp$6(a, prop, b[prop]);\n if (__getOwnPropSymbols$6)\n for (var prop of __getOwnPropSymbols$6(b)) {\n if (__propIsEnum$6.call(b, prop))\n __defNormalProp$6(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));\nconst defaultState = {\n x: 0,\n y: 0,\n pointerId: 0,\n pressure: 0,\n tiltX: 0,\n tiltY: 0,\n width: 0,\n height: 0,\n twist: 0,\n pointerType: null\n};\nconst keys = /* @__PURE__ */ Object.keys(defaultState);\nfunction usePointer(options = {}) {\n const {\n target = defaultWindow\n } = options;\n const isInside = ref(false);\n const state = ref(options.initialValue || {});\n Object.assign(state.value, defaultState, state.value);\n const handler = (event) => {\n isInside.value = true;\n if (options.pointerTypes && !options.pointerTypes.includes(event.pointerType))\n return;\n state.value = objectPick(event, keys, false);\n };\n if (target) {\n useEventListener(target, \"pointerdown\", handler, { passive: true });\n useEventListener(target, \"pointermove\", handler, { passive: true });\n useEventListener(target, \"pointerleave\", () => isInside.value = false, { passive: true });\n }\n return __spreadProps$1(__spreadValues$6({}, toRefs(state)), {\n isInside\n });\n}\n\nfunction usePointerLock(target, options = {}) {\n const { document = defaultDocument, pointerLockOptions } = options;\n const isSupported = useSupported(() => document && \"pointerLockElement\" in document);\n const element = ref();\n const triggerElement = ref();\n let targetElement;\n if (isSupported.value) {\n useEventListener(document, \"pointerlockchange\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n element.value = document.pointerLockElement;\n if (!element.value)\n targetElement = triggerElement.value = null;\n }\n });\n useEventListener(document, \"pointerlockerror\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n const action = document.pointerLockElement ? \"release\" : \"acquire\";\n throw new Error(`Failed to ${action} pointer lock.`);\n }\n });\n }\n async function lock(e, options2) {\n var _a;\n if (!isSupported.value)\n throw new Error(\"Pointer Lock API is not supported by your browser.\");\n triggerElement.value = e instanceof Event ? e.currentTarget : null;\n targetElement = e instanceof Event ? (_a = unrefElement(target)) != null ? _a : triggerElement.value : unrefElement(e);\n if (!targetElement)\n throw new Error(\"Target element undefined.\");\n targetElement.requestPointerLock(options2 != null ? options2 : pointerLockOptions);\n return await until(element).toBe(targetElement);\n }\n async function unlock() {\n if (!element.value)\n return false;\n document.exitPointerLock();\n await until(element).toBeNull();\n return true;\n }\n return {\n isSupported,\n element,\n triggerElement,\n lock,\n unlock\n };\n}\n\nvar SwipeDirection;\n(function(SwipeDirection2) {\n SwipeDirection2[\"UP\"] = \"UP\";\n SwipeDirection2[\"RIGHT\"] = \"RIGHT\";\n SwipeDirection2[\"DOWN\"] = \"DOWN\";\n SwipeDirection2[\"LEFT\"] = \"LEFT\";\n SwipeDirection2[\"NONE\"] = \"NONE\";\n})(SwipeDirection || (SwipeDirection = {}));\nfunction useSwipe(target, options = {}) {\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart,\n passive = true,\n window = defaultWindow\n } = options;\n const coordsStart = reactive({ x: 0, y: 0 });\n const coordsEnd = reactive({ x: 0, y: 0 });\n const diffX = computed(() => coordsStart.x - coordsEnd.x);\n const diffY = computed(() => coordsStart.y - coordsEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n const isSwiping = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return SwipeDirection.NONE;\n if (abs(diffX.value) > abs(diffY.value)) {\n return diffX.value > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT;\n } else {\n return diffY.value > 0 ? SwipeDirection.UP : SwipeDirection.DOWN;\n }\n });\n const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n const updateCoordsStart = (x, y) => {\n coordsStart.x = x;\n coordsStart.y = y;\n };\n const updateCoordsEnd = (x, y) => {\n coordsEnd.x = x;\n coordsEnd.y = y;\n };\n let listenerOptions;\n const isPassiveEventSupported = checkPassiveEventSupport(window == null ? void 0 : window.document);\n if (!passive)\n listenerOptions = isPassiveEventSupported ? { passive: false, capture: true } : { capture: true };\n else\n listenerOptions = isPassiveEventSupported ? { passive: true } : { capture: false };\n const onTouchEnd = (e) => {\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isSwiping.value = false;\n };\n const stops = [\n useEventListener(target, \"touchstart\", (e) => {\n if (listenerOptions.capture && !listenerOptions.passive)\n e.preventDefault();\n const [x, y] = getTouchEventCoords(e);\n updateCoordsStart(x, y);\n updateCoordsEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }, listenerOptions),\n useEventListener(target, \"touchmove\", (e) => {\n const [x, y] = getTouchEventCoords(e);\n updateCoordsEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }, listenerOptions),\n useEventListener(target, \"touchend\", onTouchEnd, listenerOptions),\n useEventListener(target, \"touchcancel\", onTouchEnd, listenerOptions)\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isPassiveEventSupported,\n isSwiping,\n direction,\n coordsStart,\n coordsEnd,\n lengthX: diffX,\n lengthY: diffY,\n stop\n };\n}\nfunction checkPassiveEventSupport(document) {\n if (!document)\n return false;\n let supportsPassive = false;\n const optionsBlock = {\n get passive() {\n supportsPassive = true;\n return false;\n }\n };\n document.addEventListener(\"x\", noop, optionsBlock);\n document.removeEventListener(\"x\", noop);\n return supportsPassive;\n}\n\nfunction usePointerSwipe(target, options = {}) {\n const targetRef = resolveRef(target);\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart\n } = options;\n const posStart = reactive({ x: 0, y: 0 });\n const updatePosStart = (x, y) => {\n posStart.x = x;\n posStart.y = y;\n };\n const posEnd = reactive({ x: 0, y: 0 });\n const updatePosEnd = (x, y) => {\n posEnd.x = x;\n posEnd.y = y;\n };\n const distanceX = computed(() => posStart.x - posEnd.x);\n const distanceY = computed(() => posStart.y - posEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n const isSwiping = ref(false);\n const isPointerDown = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return SwipeDirection.NONE;\n if (abs(distanceX.value) > abs(distanceY.value)) {\n return distanceX.value > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT;\n } else {\n return distanceY.value > 0 ? SwipeDirection.UP : SwipeDirection.DOWN;\n }\n });\n const eventIsAllowed = (e) => {\n var _a, _b, _c;\n const isReleasingButton = e.buttons === 0;\n const isPrimaryButton = e.buttons === 1;\n return (_c = (_b = (_a = options.pointerTypes) == null ? void 0 : _a.includes(e.pointerType)) != null ? _b : isReleasingButton || isPrimaryButton) != null ? _c : true;\n };\n const stops = [\n useEventListener(target, \"pointerdown\", (e) => {\n var _a, _b;\n if (!eventIsAllowed(e))\n return;\n isPointerDown.value = true;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"none\");\n const eventTarget = e.target;\n eventTarget == null ? void 0 : eventTarget.setPointerCapture(e.pointerId);\n const { clientX: x, clientY: y } = e;\n updatePosStart(x, y);\n updatePosEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }),\n useEventListener(target, \"pointermove\", (e) => {\n if (!eventIsAllowed(e))\n return;\n if (!isPointerDown.value)\n return;\n const { clientX: x, clientY: y } = e;\n updatePosEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }),\n useEventListener(target, \"pointerup\", (e) => {\n var _a, _b;\n if (!eventIsAllowed(e))\n return;\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isPointerDown.value = false;\n isSwiping.value = false;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"initial\");\n })\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isSwiping: readonly(isSwiping),\n direction: readonly(direction),\n posStart: readonly(posStart),\n posEnd: readonly(posEnd),\n distanceX,\n distanceY,\n stop\n };\n}\n\nfunction usePreferredColorScheme(options) {\n const isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n const isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n return computed(() => {\n if (isDark.value)\n return \"dark\";\n if (isLight.value)\n return \"light\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredContrast(options) {\n const isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n const isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n const isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n return computed(() => {\n if (isMore.value)\n return \"more\";\n if (isLess.value)\n return \"less\";\n if (isCustom.value)\n return \"custom\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredLanguages(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref([\"en\"]);\n const navigator = window.navigator;\n const value = ref(navigator.languages);\n useEventListener(window, \"languagechange\", () => {\n value.value = navigator.languages;\n });\n return value;\n}\n\nfunction usePreferredReducedMotion(options) {\n const isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n return computed(() => {\n if (isReduced.value)\n return \"reduce\";\n return \"no-preference\";\n });\n}\n\nfunction usePrevious(value, initialValue) {\n const previous = shallowRef(initialValue);\n watch(resolveRef(value), (_, oldValue) => {\n previous.value = oldValue;\n }, { flush: \"sync\" });\n return readonly(previous);\n}\n\nconst useScreenOrientation = (options = {}) => {\n const {\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n const screenOrientation = isSupported.value ? window.screen.orientation : {};\n const orientation = ref(screenOrientation.type);\n const angle = ref(screenOrientation.angle || 0);\n if (isSupported.value) {\n useEventListener(window, \"orientationchange\", () => {\n orientation.value = screenOrientation.type;\n angle.value = screenOrientation.angle;\n });\n }\n const lockOrientation = (type) => {\n if (!isSupported.value)\n return Promise.reject(new Error(\"Not supported\"));\n return screenOrientation.lock(type);\n };\n const unlockOrientation = () => {\n if (isSupported.value)\n screenOrientation.unlock();\n };\n return {\n isSupported,\n orientation,\n angle,\n lockOrientation,\n unlockOrientation\n };\n};\n\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\nfunction useScreenSafeArea() {\n const top = ref(\"\");\n const right = ref(\"\");\n const bottom = ref(\"\");\n const left = ref(\"\");\n if (isClient) {\n const topCssVar = useCssVar(topVarName);\n const rightCssVar = useCssVar(rightVarName);\n const bottomCssVar = useCssVar(bottomVarName);\n const leftCssVar = useCssVar(leftVarName);\n topCssVar.value = \"env(safe-area-inset-top, 0px)\";\n rightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n bottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n leftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n update();\n useEventListener(\"resize\", useDebounceFn(update));\n }\n function update() {\n top.value = getValue(topVarName);\n right.value = getValue(rightVarName);\n bottom.value = getValue(bottomVarName);\n left.value = getValue(leftVarName);\n }\n return {\n top,\n right,\n bottom,\n left,\n update\n };\n}\nfunction getValue(position) {\n return getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n const {\n immediate = true,\n manual = false,\n type = \"text/javascript\",\n async = true,\n crossOrigin,\n referrerPolicy,\n noModule,\n defer,\n document = defaultDocument,\n attrs = {}\n } = options;\n const scriptTag = ref(null);\n let _promise = null;\n const loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n const resolveWithElement = (el2) => {\n scriptTag.value = el2;\n resolve(el2);\n return el2;\n };\n if (!document) {\n resolve(false);\n return;\n }\n let shouldAppend = false;\n let el = document.querySelector(`script[src=\"${resolveUnref(src)}\"]`);\n if (!el) {\n el = document.createElement(\"script\");\n el.type = type;\n el.async = async;\n el.src = resolveUnref(src);\n if (defer)\n el.defer = defer;\n if (crossOrigin)\n el.crossOrigin = crossOrigin;\n if (noModule)\n el.noModule = noModule;\n if (referrerPolicy)\n el.referrerPolicy = referrerPolicy;\n Object.entries(attrs).forEach(([name, value]) => el == null ? void 0 : el.setAttribute(name, value));\n shouldAppend = true;\n } else if (el.hasAttribute(\"data-loaded\")) {\n resolveWithElement(el);\n }\n el.addEventListener(\"error\", (event) => reject(event));\n el.addEventListener(\"abort\", (event) => reject(event));\n el.addEventListener(\"load\", () => {\n el.setAttribute(\"data-loaded\", \"true\");\n onLoaded(el);\n resolveWithElement(el);\n });\n if (shouldAppend)\n el = document.head.appendChild(el);\n if (!waitForScriptLoad)\n resolveWithElement(el);\n });\n const load = (waitForScriptLoad = true) => {\n if (!_promise)\n _promise = loadScript(waitForScriptLoad);\n return _promise;\n };\n const unload = () => {\n if (!document)\n return;\n _promise = null;\n if (scriptTag.value)\n scriptTag.value = null;\n const el = document.querySelector(`script[src=\"${resolveUnref(src)}\"]`);\n if (el)\n document.head.removeChild(el);\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnUnmounted(unload);\n return { scriptTag, load, unload };\n}\n\nfunction checkOverflowScroll(ele) {\n const style = window.getComputedStyle(ele);\n if (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientHeight < ele.scrollHeight || style.overflowY === \"auto\" && ele.clientWidth < ele.scrollWidth) {\n return true;\n } else {\n const parent = ele.parentNode;\n if (!parent || parent.tagName === \"BODY\")\n return false;\n return checkOverflowScroll(parent);\n }\n}\nfunction preventDefault(rawEvent) {\n const e = rawEvent || window.event;\n const _target = e.target;\n if (checkOverflowScroll(_target))\n return false;\n if (e.touches.length > 1)\n return true;\n if (e.preventDefault)\n e.preventDefault();\n return false;\n}\nfunction useScrollLock(element, initialState = false) {\n const isLocked = ref(initialState);\n let stopTouchMoveListener = null;\n let initialOverflow;\n watch(resolveRef(element), (el) => {\n if (el) {\n const ele = el;\n initialOverflow = ele.style.overflow;\n if (isLocked.value)\n ele.style.overflow = \"hidden\";\n }\n }, {\n immediate: true\n });\n const lock = () => {\n const ele = resolveUnref(element);\n if (!ele || isLocked.value)\n return;\n if (isIOS) {\n stopTouchMoveListener = useEventListener(ele, \"touchmove\", (e) => {\n preventDefault(e);\n }, { passive: false });\n }\n ele.style.overflow = \"hidden\";\n isLocked.value = true;\n };\n const unlock = () => {\n const ele = resolveUnref(element);\n if (!ele || !isLocked.value)\n return;\n isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());\n ele.style.overflow = initialOverflow;\n isLocked.value = false;\n };\n tryOnScopeDispose(unlock);\n return computed({\n get() {\n return isLocked.value;\n },\n set(v) {\n if (v)\n lock();\n else\n unlock();\n }\n });\n}\n\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.sessionStorage, options);\n}\n\nvar __defProp$5 = Object.defineProperty;\nvar __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$5 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$5 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$5 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$5.call(b, prop))\n __defNormalProp$5(a, prop, b[prop]);\n if (__getOwnPropSymbols$5)\n for (var prop of __getOwnPropSymbols$5(b)) {\n if (__propIsEnum$5.call(b, prop))\n __defNormalProp$5(a, prop, b[prop]);\n }\n return a;\n};\nfunction useShare(shareOptions = {}, options = {}) {\n const { navigator = defaultNavigator } = options;\n const _navigator = navigator;\n const isSupported = useSupported(() => _navigator && \"canShare\" in _navigator);\n const share = async (overrideOptions = {}) => {\n if (isSupported.value) {\n const data = __spreadValues$5(__spreadValues$5({}, resolveUnref(shareOptions)), resolveUnref(overrideOptions));\n let granted = true;\n if (data.files && _navigator.canShare)\n granted = _navigator.canShare({ files: data.files });\n if (granted)\n return _navigator.share(data);\n }\n };\n return {\n isSupported,\n share\n };\n}\n\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n var _a, _b, _c, _d;\n const [source] = args;\n let compareFn = defaultCompare;\n let options = {};\n if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n options = args[1];\n compareFn = (_a = options.compareFn) != null ? _a : defaultCompare;\n } else {\n compareFn = (_b = args[1]) != null ? _b : defaultCompare;\n }\n } else if (args.length > 2) {\n compareFn = (_c = args[1]) != null ? _c : defaultCompare;\n options = (_d = args[2]) != null ? _d : {};\n }\n const {\n dirty = false,\n sortFn = defaultSortFn\n } = options;\n if (!dirty)\n return computed(() => sortFn([...unref(source)], compareFn));\n watchEffect(() => {\n const result = sortFn(unref(source), compareFn);\n if (isRef(source))\n source.value = result;\n else\n source.splice(0, source.length, ...result);\n });\n return source;\n}\n\nfunction useSpeechRecognition(options = {}) {\n const {\n interimResults = true,\n continuous = true,\n window = defaultWindow\n } = options;\n const lang = resolveRef(options.lang || \"en-US\");\n const isListening = ref(false);\n const isFinal = ref(false);\n const result = ref(\"\");\n const error = shallowRef(void 0);\n const toggle = (value = !isListening.value) => {\n isListening.value = value;\n };\n const start = () => {\n isListening.value = true;\n };\n const stop = () => {\n isListening.value = false;\n };\n const SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n const isSupported = useSupported(() => SpeechRecognition);\n let recognition;\n if (isSupported.value) {\n recognition = new SpeechRecognition();\n recognition.continuous = continuous;\n recognition.interimResults = interimResults;\n recognition.lang = unref(lang);\n recognition.onstart = () => {\n isFinal.value = false;\n };\n watch(lang, (lang2) => {\n if (recognition && !isListening.value)\n recognition.lang = lang2;\n });\n recognition.onresult = (event) => {\n const transcript = Array.from(event.results).map((result2) => {\n isFinal.value = result2.isFinal;\n return result2[0];\n }).map((result2) => result2.transcript).join(\"\");\n result.value = transcript;\n error.value = void 0;\n };\n recognition.onerror = (event) => {\n error.value = event;\n };\n recognition.onend = () => {\n isListening.value = false;\n recognition.lang = unref(lang);\n };\n watch(isListening, () => {\n if (isListening.value)\n recognition.start();\n else\n recognition.stop();\n });\n }\n tryOnScopeDispose(() => {\n isListening.value = false;\n });\n return {\n isSupported,\n isListening,\n isFinal,\n recognition,\n result,\n error,\n toggle,\n start,\n stop\n };\n}\n\nfunction useSpeechSynthesis(text, options = {}) {\n const {\n pitch = 1,\n rate = 1,\n volume = 1,\n window = defaultWindow\n } = options;\n const synth = window && window.speechSynthesis;\n const isSupported = useSupported(() => synth);\n const isPlaying = ref(false);\n const status = ref(\"init\");\n const spokenText = resolveRef(text || \"\");\n const lang = resolveRef(options.lang || \"en-US\");\n const error = shallowRef(void 0);\n const toggle = (value = !isPlaying.value) => {\n isPlaying.value = value;\n };\n const bindEventsForUtterance = (utterance2) => {\n utterance2.lang = unref(lang);\n utterance2.voice = unref(options.voice) || null;\n utterance2.pitch = pitch;\n utterance2.rate = rate;\n utterance2.volume = volume;\n utterance2.onstart = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onpause = () => {\n isPlaying.value = false;\n status.value = \"pause\";\n };\n utterance2.onresume = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onend = () => {\n isPlaying.value = false;\n status.value = \"end\";\n };\n utterance2.onerror = (event) => {\n error.value = event;\n };\n };\n const utterance = computed(() => {\n isPlaying.value = false;\n status.value = \"init\";\n const newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n bindEventsForUtterance(newUtterance);\n return newUtterance;\n });\n const speak = () => {\n synth.cancel();\n utterance && synth.speak(utterance.value);\n };\n const stop = () => {\n synth.cancel();\n isPlaying.value = false;\n };\n if (isSupported.value) {\n bindEventsForUtterance(utterance.value);\n watch(lang, (lang2) => {\n if (utterance.value && !isPlaying.value)\n utterance.value.lang = lang2;\n });\n if (options.voice) {\n watch(options.voice, () => {\n synth.cancel();\n });\n }\n watch(isPlaying, () => {\n if (isPlaying.value)\n synth.resume();\n else\n synth.pause();\n });\n }\n tryOnScopeDispose(() => {\n isPlaying.value = false;\n });\n return {\n isSupported,\n isPlaying,\n status,\n utterance,\n error,\n stop,\n toggle,\n speak\n };\n}\n\nfunction useStepper(steps, initialStep) {\n const stepsRef = ref(steps);\n const stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n const index = ref(stepNames.value.indexOf(initialStep != null ? initialStep : stepNames.value[0]));\n const current = computed(() => at(index.value));\n const isFirst = computed(() => index.value === 0);\n const isLast = computed(() => index.value === stepNames.value.length - 1);\n const next = computed(() => stepNames.value[index.value + 1]);\n const previous = computed(() => stepNames.value[index.value - 1]);\n function at(index2) {\n if (Array.isArray(stepsRef.value))\n return stepsRef.value[index2];\n return stepsRef.value[stepNames.value[index2]];\n }\n function get(step) {\n if (!stepNames.value.includes(step))\n return;\n return at(stepNames.value.indexOf(step));\n }\n function goTo(step) {\n if (stepNames.value.includes(step))\n index.value = stepNames.value.indexOf(step);\n }\n function goToNext() {\n if (isLast.value)\n return;\n index.value++;\n }\n function goToPrevious() {\n if (isFirst.value)\n return;\n index.value--;\n }\n function goBackTo(step) {\n if (isAfter(step))\n goTo(step);\n }\n function isNext(step) {\n return stepNames.value.indexOf(step) === index.value + 1;\n }\n function isPrevious(step) {\n return stepNames.value.indexOf(step) === index.value - 1;\n }\n function isCurrent(step) {\n return stepNames.value.indexOf(step) === index.value;\n }\n function isBefore(step) {\n return index.value < stepNames.value.indexOf(step);\n }\n function isAfter(step) {\n return index.value > stepNames.value.indexOf(step);\n }\n return {\n steps: stepsRef,\n stepNames,\n index,\n current,\n next,\n previous,\n isFirst,\n isLast,\n at,\n get,\n goTo,\n goToNext,\n goToPrevious,\n goBackTo,\n isNext,\n isPrevious,\n isCurrent,\n isBefore,\n isAfter\n };\n}\n\nvar __defProp$4 = Object.defineProperty;\nvar __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$4 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$4 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$4 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$4.call(b, prop))\n __defNormalProp$4(a, prop, b[prop]);\n if (__getOwnPropSymbols$4)\n for (var prop of __getOwnPropSymbols$4(b)) {\n if (__propIsEnum$4.call(b, prop))\n __defNormalProp$4(a, prop, b[prop]);\n }\n return a;\n};\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const rawInit = resolveUnref(initialValue);\n const type = guessSerializerType(rawInit);\n const data = (shallow ? shallowRef : ref)(initialValue);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n async function read(event) {\n if (!storage || event && event.key !== key)\n return;\n try {\n const rawValue = event ? event.newValue : await storage.getItem(key);\n if (rawValue == null) {\n data.value = rawInit;\n if (writeDefaults && rawInit !== null)\n await storage.setItem(key, await serializer.write(rawInit));\n } else if (mergeDefaults) {\n const value = await serializer.read(rawValue);\n if (isFunction(mergeDefaults))\n data.value = mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n data.value = __spreadValues$4(__spreadValues$4({}, rawInit), value);\n else\n data.value = value;\n } else {\n data.value = await serializer.read(rawValue);\n }\n } catch (e) {\n onError(e);\n }\n }\n read();\n if (window && listenToStorageChanges)\n useEventListener(window, \"storage\", (e) => setTimeout(() => read(e), 0));\n if (storage) {\n watchWithFilter(data, async () => {\n try {\n if (data.value == null)\n await storage.removeItem(key);\n else\n await storage.setItem(key, await serializer.write(data.value));\n } catch (e) {\n onError(e);\n }\n }, {\n flush,\n deep,\n eventFilter\n });\n }\n return data;\n}\n\nlet _id = 0;\nfunction useStyleTag(css, options = {}) {\n const isLoaded = ref(false);\n const {\n document = defaultDocument,\n immediate = true,\n manual = false,\n id = `vueuse_styletag_${++_id}`\n } = options;\n const cssRef = ref(css);\n let stop = () => {\n };\n const load = () => {\n if (!document)\n return;\n const el = document.getElementById(id) || document.createElement(\"style\");\n if (!el.isConnected) {\n el.type = \"text/css\";\n el.id = id;\n if (options.media)\n el.media = options.media;\n document.head.appendChild(el);\n }\n if (isLoaded.value)\n return;\n stop = watch(cssRef, (value) => {\n el.textContent = value;\n }, { immediate: true });\n isLoaded.value = true;\n };\n const unload = () => {\n if (!document || !isLoaded.value)\n return;\n stop();\n document.head.removeChild(document.getElementById(id));\n isLoaded.value = false;\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnScopeDispose(unload);\n return {\n id,\n css: cssRef,\n unload,\n load,\n isLoaded: readonly(isLoaded)\n };\n}\n\nfunction useTemplateRefsList() {\n const refs = ref([]);\n refs.value.set = (el) => {\n if (el)\n refs.value.push(el);\n };\n onBeforeUpdate(() => {\n refs.value.length = 0;\n });\n return refs;\n}\n\nfunction useTextDirection(options = {}) {\n const {\n document = defaultDocument,\n selector = \"html\",\n observe = false,\n initialValue = \"ltr\"\n } = options;\n function getValue() {\n var _a, _b;\n return (_b = (_a = document == null ? void 0 : document.querySelector(selector)) == null ? void 0 : _a.getAttribute(\"dir\")) != null ? _b : initialValue;\n }\n const dir = ref(getValue());\n tryOnMounted(() => dir.value = getValue());\n if (observe && document) {\n useMutationObserver(document.querySelector(selector), () => dir.value = getValue(), { attributes: true });\n }\n return computed({\n get() {\n return dir.value;\n },\n set(v) {\n var _a, _b;\n dir.value = v;\n if (!document)\n return;\n if (dir.value)\n (_a = document.querySelector(selector)) == null ? void 0 : _a.setAttribute(\"dir\", dir.value);\n else\n (_b = document.querySelector(selector)) == null ? void 0 : _b.removeAttribute(\"dir\");\n }\n });\n}\n\nfunction getRangesFromSelection(selection) {\n var _a;\n const rangeCount = (_a = selection.rangeCount) != null ? _a : 0;\n const ranges = new Array(rangeCount);\n for (let i = 0; i < rangeCount; i++) {\n const range = selection.getRangeAt(i);\n ranges[i] = range;\n }\n return ranges;\n}\nfunction useTextSelection(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const selection = ref(null);\n const text = computed(() => {\n var _a, _b;\n return (_b = (_a = selection.value) == null ? void 0 : _a.toString()) != null ? _b : \"\";\n });\n const ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n const rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n function onSelectionChange() {\n selection.value = null;\n if (window)\n selection.value = window.getSelection();\n }\n if (window)\n useEventListener(window.document, \"selectionchange\", onSelectionChange);\n return {\n text,\n rects,\n ranges,\n selection\n };\n}\n\nfunction useTextareaAutosize(options) {\n const textarea = ref(options == null ? void 0 : options.element);\n const input = ref(options == null ? void 0 : options.input);\n function triggerResize() {\n var _a, _b;\n if (!textarea.value)\n return;\n textarea.value.style.height = \"1px\";\n textarea.value.style.height = `${(_a = textarea.value) == null ? void 0 : _a.scrollHeight}px`;\n (_b = options == null ? void 0 : options.onResize) == null ? void 0 : _b.call(options);\n }\n watch([input, textarea], triggerResize, { immediate: true });\n useResizeObserver(textarea, () => triggerResize());\n if (options == null ? void 0 : options.watch)\n watch(options.watch, triggerResize, { immediate: true, deep: true });\n return {\n textarea,\n input,\n triggerResize\n };\n}\n\nvar __defProp$3 = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$3 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$3 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$3 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$3.call(b, prop))\n __defNormalProp$3(a, prop, b[prop]);\n if (__getOwnPropSymbols$3)\n for (var prop of __getOwnPropSymbols$3(b)) {\n if (__propIsEnum$3.call(b, prop))\n __defNormalProp$3(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction useThrottledRefHistory(source, options = {}) {\n const { throttle = 200, trailing = true } = options;\n const filter = throttleFilter(throttle, trailing);\n const history = useRefHistory(source, __spreadProps(__spreadValues$3({}, options), { eventFilter: filter }));\n return __spreadValues$3({}, history);\n}\n\nvar __defProp$2 = Object.defineProperty;\nvar __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$2 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$2 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$2 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$2.call(b, prop))\n __defNormalProp$2(a, prop, b[prop]);\n if (__getOwnPropSymbols$2)\n for (var prop of __getOwnPropSymbols$2(b)) {\n if (__propIsEnum$2.call(b, prop))\n __defNormalProp$2(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols$2)\n for (var prop of __getOwnPropSymbols$2(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst DEFAULT_UNITS = [\n { max: 6e4, value: 1e3, name: \"second\" },\n { max: 276e4, value: 6e4, name: \"minute\" },\n { max: 72e6, value: 36e5, name: \"hour\" },\n { max: 5184e5, value: 864e5, name: \"day\" },\n { max: 24192e5, value: 6048e5, name: \"week\" },\n { max: 28512e6, value: 2592e6, name: \"month\" },\n { max: Infinity, value: 31536e6, name: \"year\" }\n];\nconst DEFAULT_MESSAGES = {\n justNow: \"just now\",\n past: (n) => n.match(/\\d/) ? `${n} ago` : n,\n future: (n) => n.match(/\\d/) ? `in ${n}` : n,\n month: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n year: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n day: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n week: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n hour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n minute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n second: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n invalid: \"\"\n};\nconst DEFAULT_FORMATTER = (date) => date.toISOString().slice(0, 10);\nfunction useTimeAgo(time, options = {}) {\n const {\n controls: exposeControls = false,\n updateInterval = 3e4\n } = options;\n const _a = useNow({ interval: updateInterval, controls: true }), { now } = _a, controls = __objRest(_a, [\"now\"]);\n const timeAgo = computed(() => formatTimeAgo(new Date(resolveUnref(time)), options, unref(now.value)));\n if (exposeControls) {\n return __spreadValues$2({\n timeAgo\n }, controls);\n } else {\n return timeAgo;\n }\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n var _a;\n const {\n max,\n messages = DEFAULT_MESSAGES,\n fullDateFormatter = DEFAULT_FORMATTER,\n units = DEFAULT_UNITS,\n showSecond = false,\n rounding = \"round\"\n } = options;\n const roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n const diff = +now - +from;\n const absDiff = Math.abs(diff);\n function getValue(diff2, unit) {\n return roundFn(Math.abs(diff2) / unit.value);\n }\n function format(diff2, unit) {\n const val = getValue(diff2, unit);\n const past = diff2 > 0;\n const str = applyFormat(unit.name, val, past);\n return applyFormat(past ? \"past\" : \"future\", str, past);\n }\n function applyFormat(name, val, isPast) {\n const formatter = messages[name];\n if (typeof formatter === \"function\")\n return formatter(val, isPast);\n return formatter.replace(\"{0}\", val.toString());\n }\n if (absDiff < 6e4 && !showSecond)\n return messages.justNow;\n if (typeof max === \"number\" && absDiff > max)\n return fullDateFormatter(new Date(from));\n if (typeof max === \"string\") {\n const unitMax = (_a = units.find((i) => i.name === max)) == null ? void 0 : _a.max;\n if (unitMax && absDiff > unitMax)\n return fullDateFormatter(new Date(from));\n }\n for (const [idx, unit] of units.entries()) {\n const val = getValue(diff, unit);\n if (val <= 0 && units[idx - 1])\n return format(diff, units[idx - 1]);\n if (absDiff < unit.max)\n return format(diff, unit);\n }\n return messages.invalid;\n}\n\nfunction useTimeoutPoll(fn, interval, timeoutPollOptions) {\n const { start } = useTimeoutFn(loop, interval);\n const isActive = ref(false);\n async function loop() {\n if (!isActive.value)\n return;\n await fn();\n start();\n }\n function resume() {\n if (!isActive.value) {\n isActive.value = true;\n loop();\n }\n }\n function pause() {\n isActive.value = false;\n }\n if (timeoutPollOptions == null ? void 0 : timeoutPollOptions.immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nvar __defProp$1 = Object.defineProperty;\nvar __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$1 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$1 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$1 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$1.call(b, prop))\n __defNormalProp$1(a, prop, b[prop]);\n if (__getOwnPropSymbols$1)\n for (var prop of __getOwnPropSymbols$1(b)) {\n if (__propIsEnum$1.call(b, prop))\n __defNormalProp$1(a, prop, b[prop]);\n }\n return a;\n};\nfunction useTimestamp(options = {}) {\n const {\n controls: exposeControls = false,\n offset = 0,\n immediate = true,\n interval = \"requestAnimationFrame\",\n callback\n } = options;\n const ts = ref(timestamp() + offset);\n const update = () => ts.value = timestamp() + offset;\n const cb = callback ? () => {\n update();\n callback(ts.value);\n } : update;\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n if (exposeControls) {\n return __spreadValues$1({\n timestamp: ts\n }, controls);\n } else {\n return ts;\n }\n}\n\nfunction useTitle(newTitle = null, options = {}) {\n var _a, _b;\n const {\n document = defaultDocument\n } = options;\n const title = resolveRef((_a = newTitle != null ? newTitle : document == null ? void 0 : document.title) != null ? _a : null);\n const isReadonly = newTitle && isFunction(newTitle);\n function format(t) {\n if (!(\"titleTemplate\" in options))\n return t;\n const template = options.titleTemplate || \"%s\";\n return isFunction(template) ? template(t) : unref(template).replace(/%s/g, t);\n }\n watch(title, (t, o) => {\n if (t !== o && document)\n document.title = format(isString(t) ? t : \"\");\n }, { immediate: true });\n if (options.observe && !options.titleTemplate && document && !isReadonly) {\n useMutationObserver((_b = document.head) == null ? void 0 : _b.querySelector(\"title\"), () => {\n if (document && document.title !== title.value)\n title.value = format(document.title);\n }, { childList: true });\n }\n return title;\n}\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst _TransitionPresets = {\n easeInSine: [0.12, 0, 0.39, 0],\n easeOutSine: [0.61, 1, 0.88, 1],\n easeInOutSine: [0.37, 0, 0.63, 1],\n easeInQuad: [0.11, 0, 0.5, 0],\n easeOutQuad: [0.5, 1, 0.89, 1],\n easeInOutQuad: [0.45, 0, 0.55, 1],\n easeInCubic: [0.32, 0, 0.67, 0],\n easeOutCubic: [0.33, 1, 0.68, 1],\n easeInOutCubic: [0.65, 0, 0.35, 1],\n easeInQuart: [0.5, 0, 0.75, 0],\n easeOutQuart: [0.25, 1, 0.5, 1],\n easeInOutQuart: [0.76, 0, 0.24, 1],\n easeInQuint: [0.64, 0, 0.78, 0],\n easeOutQuint: [0.22, 1, 0.36, 1],\n easeInOutQuint: [0.83, 0, 0.17, 1],\n easeInExpo: [0.7, 0, 0.84, 0],\n easeOutExpo: [0.16, 1, 0.3, 1],\n easeInOutExpo: [0.87, 0, 0.13, 1],\n easeInCirc: [0.55, 0, 1, 0.45],\n easeOutCirc: [0, 0.55, 0.45, 1],\n easeInOutCirc: [0.85, 0, 0.15, 1],\n easeInBack: [0.36, 0, 0.66, -0.56],\n easeOutBack: [0.34, 1.56, 0.64, 1],\n easeInOutBack: [0.68, -0.6, 0.32, 1.6]\n};\nconst TransitionPresets = __spreadValues({\n linear: identity\n}, _TransitionPresets);\nfunction createEasingFunction([p0, p1, p2, p3]) {\n const a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n const b = (a1, a2) => 3 * a2 - 6 * a1;\n const c = (a1) => 3 * a1;\n const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n const getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n const getTforX = (x) => {\n let aGuessT = x;\n for (let i = 0; i < 4; ++i) {\n const currentSlope = getSlope(aGuessT, p0, p2);\n if (currentSlope === 0)\n return aGuessT;\n const currentX = calcBezier(aGuessT, p0, p2) - x;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n };\n return (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction useTransition(source, options = {}) {\n const {\n delay = 0,\n disabled = false,\n duration = 1e3,\n onFinished = noop,\n onStarted = noop,\n transition = identity\n } = options;\n const currentTransition = computed(() => {\n const t = unref(transition);\n return isFunction(t) ? t : createEasingFunction(t);\n });\n const sourceValue = computed(() => {\n const s = unref(source);\n return isNumber(s) ? s : s.map(unref);\n });\n const sourceVector = computed(() => isNumber(sourceValue.value) ? [sourceValue.value] : sourceValue.value);\n const outputVector = ref(sourceVector.value.slice(0));\n let currentDuration;\n let diffVector;\n let endAt;\n let startAt;\n let startVector;\n const { resume, pause } = useRafFn(() => {\n const now = Date.now();\n const progress = clamp(1 - (endAt - now) / currentDuration, 0, 1);\n outputVector.value = startVector.map((val, i) => {\n var _a;\n return val + ((_a = diffVector[i]) != null ? _a : 0) * currentTransition.value(progress);\n });\n if (progress >= 1) {\n pause();\n onFinished();\n }\n }, { immediate: false });\n const start = () => {\n pause();\n currentDuration = unref(duration);\n diffVector = outputVector.value.map((n, i) => {\n var _a, _b;\n return ((_a = sourceVector.value[i]) != null ? _a : 0) - ((_b = outputVector.value[i]) != null ? _b : 0);\n });\n startVector = outputVector.value.slice(0);\n startAt = Date.now();\n endAt = startAt + currentDuration;\n resume();\n onStarted();\n };\n const timeout = useTimeoutFn(start, delay, { immediate: false });\n watch(sourceVector, () => {\n if (unref(disabled))\n return;\n if (unref(delay) <= 0)\n start();\n else\n timeout.start();\n }, { deep: true });\n watch(() => unref(disabled), (v) => {\n if (v) {\n outputVector.value = sourceVector.value.slice(0);\n pause();\n }\n });\n return computed(() => {\n const targetVector = unref(disabled) ? sourceVector : outputVector;\n return isNumber(sourceValue.value) ? targetVector.value[0] : targetVector.value;\n });\n}\n\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n const {\n initialValue = {},\n removeNullishValues = true,\n removeFalsyValues = false,\n write: enableWrite = true,\n window = defaultWindow\n } = options;\n if (!window)\n return reactive(initialValue);\n const state = reactive({});\n function getRawParams() {\n if (mode === \"history\") {\n return window.location.search || \"\";\n } else if (mode === \"hash\") {\n const hash = window.location.hash || \"\";\n const index = hash.indexOf(\"?\");\n return index > 0 ? hash.slice(index) : \"\";\n } else {\n return (window.location.hash || \"\").replace(/^#/, \"\");\n }\n }\n function constructQuery(params) {\n const stringified = params.toString();\n if (mode === \"history\")\n return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n if (mode === \"hash-params\")\n return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n const hash = window.location.hash || \"#\";\n const index = hash.indexOf(\"?\");\n if (index > 0)\n return `${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n return `${hash}${stringified ? `?${stringified}` : \"\"}`;\n }\n function read() {\n return new URLSearchParams(getRawParams());\n }\n function updateState(params) {\n const unusedKeys = new Set(Object.keys(state));\n for (const key of params.keys()) {\n const paramsForKey = params.getAll(key);\n state[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n unusedKeys.delete(key);\n }\n Array.from(unusedKeys).forEach((key) => delete state[key]);\n }\n const { pause, resume } = pausableWatch(state, () => {\n const params = new URLSearchParams(\"\");\n Object.keys(state).forEach((key) => {\n const mapEntry = state[key];\n if (Array.isArray(mapEntry))\n mapEntry.forEach((value) => params.append(key, value));\n else if (removeNullishValues && mapEntry == null)\n params.delete(key);\n else if (removeFalsyValues && !mapEntry)\n params.delete(key);\n else\n params.set(key, mapEntry);\n });\n write(params);\n }, { deep: true });\n function write(params, shouldUpdate) {\n pause();\n if (shouldUpdate)\n updateState(params);\n window.history.replaceState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n resume();\n }\n function onChanged() {\n if (!enableWrite)\n return;\n write(read(), true);\n }\n useEventListener(window, \"popstate\", onChanged, false);\n if (mode !== \"history\")\n useEventListener(window, \"hashchange\", onChanged, false);\n const initial = read();\n if (initial.keys().next().value)\n updateState(initial);\n else\n Object.assign(state, initialValue);\n return state;\n}\n\nfunction useUserMedia(options = {}) {\n var _a, _b;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const autoSwitch = ref((_b = options.autoSwitch) != null ? _b : true);\n const videoDeviceId = ref(options.videoDeviceId);\n const audioDeviceId = ref(options.audioDeviceId);\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getUserMedia;\n });\n const stream = shallowRef();\n function getDeviceOptions(device) {\n if (device.value === \"none\" || device.value === false)\n return false;\n if (device.value == null)\n return true;\n return {\n deviceId: device.value\n };\n }\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getUserMedia({\n video: getDeviceOptions(videoDeviceId),\n audio: getDeviceOptions(audioDeviceId)\n });\n return stream.value;\n }\n async function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n async function restart() {\n _stop();\n return await start();\n }\n watch(enabled, (v) => {\n if (v)\n _start();\n else\n _stop();\n }, { immediate: true });\n watch([videoDeviceId, audioDeviceId], () => {\n if (autoSwitch.value && stream.value)\n restart();\n }, { immediate: true });\n return {\n isSupported,\n stream,\n start,\n stop,\n restart,\n videoDeviceId,\n audioDeviceId,\n enabled,\n autoSwitch\n };\n}\n\nfunction useVModel(props, key, emit, options = {}) {\n var _a, _b, _c, _d, _e;\n const {\n clone = false,\n passive = false,\n eventName,\n deep = false,\n defaultValue\n } = options;\n const vm = getCurrentInstance();\n const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));\n let event = eventName;\n if (!key) {\n if (isVue2) {\n const modelOptions = (_e = (_d = vm == null ? void 0 : vm.proxy) == null ? void 0 : _d.$options) == null ? void 0 : _e.model;\n key = (modelOptions == null ? void 0 : modelOptions.value) || \"value\";\n if (!eventName)\n event = (modelOptions == null ? void 0 : modelOptions.event) || \"input\";\n } else {\n key = \"modelValue\";\n }\n }\n event = eventName || event || `update:${key.toString()}`;\n const cloneFn = (val) => !clone ? val : isFunction(clone) ? clone(val) : cloneFnJSON(val);\n const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n if (passive) {\n const initialValue = getValue();\n const proxy = ref(initialValue);\n watch(() => props[key], (v) => proxy.value = cloneFn(v));\n watch(proxy, (v) => {\n if (v !== props[key] || deep)\n _emit(event, v);\n }, { deep });\n return proxy;\n } else {\n return computed({\n get() {\n return getValue();\n },\n set(value) {\n _emit(event, value);\n }\n });\n }\n}\n\nfunction useVModels(props, emit, options = {}) {\n const ret = {};\n for (const key in props)\n ret[key] = useVModel(props, key, emit, options);\n return ret;\n}\n\nfunction useVibrate(options) {\n const {\n pattern = [],\n interval = 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n const patternRef = resolveRef(pattern);\n let intervalControls;\n const vibrate = (pattern2 = patternRef.value) => {\n if (isSupported.value)\n navigator.vibrate(pattern2);\n };\n const stop = () => {\n if (isSupported.value)\n navigator.vibrate(0);\n intervalControls == null ? void 0 : intervalControls.pause();\n };\n if (interval > 0) {\n intervalControls = useIntervalFn(vibrate, interval, {\n immediate: false,\n immediateCallback: false\n });\n }\n return {\n isSupported,\n pattern,\n intervalControls,\n vibrate,\n stop\n };\n}\n\nfunction useVirtualList(list, options) {\n const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n return {\n list: currentList,\n scrollTo,\n containerProps: {\n ref: containerRef,\n onScroll: () => {\n calculateRange();\n },\n style: containerStyle\n },\n wrapperProps\n };\n}\nfunction useVirtualListResources(list) {\n const containerRef = ref(null);\n const size = useElementSize(containerRef);\n const currentList = ref([]);\n const source = shallowRef(list);\n const state = ref({ start: 0, end: 10 });\n return { state, source, currentList, size, containerRef };\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n return (containerSize) => {\n if (typeof itemSize === \"number\")\n return Math.ceil(containerSize / itemSize);\n const { start = 0 } = state.value;\n let sum = 0;\n let capacity = 0;\n for (let i = start; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n capacity = i;\n if (sum > containerSize)\n break;\n }\n return capacity - start;\n };\n}\nfunction createGetOffset(source, itemSize) {\n return (scrollDirection) => {\n if (typeof itemSize === \"number\")\n return Math.floor(scrollDirection / itemSize) + 1;\n let sum = 0;\n let offset = 0;\n for (let i = 0; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n if (sum >= scrollDirection) {\n offset = i;\n break;\n }\n }\n return offset + 1;\n };\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n return () => {\n const element = containerRef.value;\n if (element) {\n const offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n const viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n const from = offset - overscan;\n const to = offset + viewCapacity + overscan;\n state.value = {\n start: from < 0 ? 0 : from,\n end: to > source.value.length ? source.value.length : to\n };\n currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n data: ele,\n index: index + state.value.start\n }));\n }\n };\n}\nfunction createGetDistance(itemSize, source) {\n return (index) => {\n if (typeof itemSize === \"number\") {\n const size2 = index * itemSize;\n return size2;\n }\n const size = source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n return size;\n };\n}\nfunction useWatchForSizes(size, list, calculateRange) {\n watch([size.width, size.height, list], () => {\n calculateRange();\n });\n}\nfunction createComputedTotalSize(itemSize, source) {\n return computed(() => {\n if (typeof itemSize === \"number\")\n return source.value.length * itemSize;\n return source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n });\n}\nconst scrollToDictionaryForElementScrollKey = {\n horizontal: \"scrollLeft\",\n vertical: \"scrollTop\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef) {\n return (index) => {\n if (containerRef.value) {\n containerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);\n calculateRange();\n }\n };\n}\nfunction useHorizontalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowX: \"auto\" };\n const { itemWidth, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n const getOffset = createGetOffset(source, itemWidth);\n const calculateRange = createCalculateRange(\"horizontal\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceLeft = createGetDistance(itemWidth, source);\n const offsetLeft = computed(() => getDistanceLeft(state.value.start));\n const totalWidth = createComputedTotalSize(itemWidth, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n height: \"100%\",\n width: `${totalWidth.value - offsetLeft.value}px`,\n marginLeft: `${offsetLeft.value}px`,\n display: \"flex\"\n }\n };\n });\n return {\n scrollTo,\n calculateRange,\n wrapperProps,\n containerStyle,\n currentList,\n containerRef\n };\n}\nfunction useVerticalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowY: \"auto\" };\n const { itemHeight, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n const getOffset = createGetOffset(source, itemHeight);\n const calculateRange = createCalculateRange(\"vertical\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceTop = createGetDistance(itemHeight, source);\n const offsetTop = computed(() => getDistanceTop(state.value.start));\n const totalHeight = createComputedTotalSize(itemHeight, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n width: \"100%\",\n height: `${totalHeight.value - offsetTop.value}px`,\n marginTop: `${offsetTop.value}px`\n }\n };\n });\n return {\n calculateRange,\n scrollTo,\n containerStyle,\n wrapperProps,\n currentList,\n containerRef\n };\n}\n\nconst useWakeLock = (options = {}) => {\n const {\n navigator = defaultNavigator,\n document = defaultDocument\n } = options;\n let wakeLock;\n const isSupported = useSupported(() => navigator && \"wakeLock\" in navigator);\n const isActive = ref(false);\n async function onVisibilityChange() {\n if (!isSupported.value || !wakeLock)\n return;\n if (document && document.visibilityState === \"visible\")\n wakeLock = await navigator.wakeLock.request(\"screen\");\n isActive.value = !wakeLock.released;\n }\n if (document)\n useEventListener(document, \"visibilitychange\", onVisibilityChange, { passive: true });\n async function request(type) {\n if (!isSupported.value)\n return;\n wakeLock = await navigator.wakeLock.request(type);\n isActive.value = !wakeLock.released;\n }\n async function release() {\n if (!isSupported.value || !wakeLock)\n return;\n await wakeLock.release();\n isActive.value = !wakeLock.released;\n wakeLock = null;\n }\n return {\n isSupported,\n isActive,\n request,\n release\n };\n};\n\nconst useWebNotification = (defaultOptions = {}) => {\n const {\n window = defaultWindow\n } = defaultOptions;\n const isSupported = useSupported(() => !!window && \"Notification\" in window);\n const notification = ref(null);\n const requestPermission = async () => {\n if (!isSupported.value)\n return;\n if (\"permission\" in Notification && Notification.permission !== \"denied\")\n await Notification.requestPermission();\n };\n const onClick = createEventHook();\n const onShow = createEventHook();\n const onError = createEventHook();\n const onClose = createEventHook();\n const show = async (overrides) => {\n if (!isSupported.value)\n return;\n await requestPermission();\n const options = Object.assign({}, defaultOptions, overrides);\n notification.value = new Notification(options.title || \"\", options);\n notification.value.onclick = (event) => onClick.trigger(event);\n notification.value.onshow = (event) => onShow.trigger(event);\n notification.value.onerror = (event) => onError.trigger(event);\n notification.value.onclose = (event) => onClose.trigger(event);\n return notification.value;\n };\n const close = () => {\n if (notification.value)\n notification.value.close();\n notification.value = null;\n };\n tryOnMounted(async () => {\n if (isSupported.value)\n await requestPermission();\n });\n tryOnScopeDispose(close);\n if (isSupported.value && window) {\n const document = window.document;\n useEventListener(document, \"visibilitychange\", (e) => {\n e.preventDefault();\n if (document.visibilityState === \"visible\") {\n close();\n }\n });\n }\n return {\n isSupported,\n notification,\n show,\n close,\n onClick,\n onShow,\n onError,\n onClose\n };\n};\n\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n if (options === true)\n return {};\n return options;\n}\nfunction useWebSocket(url, options = {}) {\n const {\n onConnected,\n onDisconnected,\n onError,\n onMessage,\n immediate = true,\n autoClose = true,\n protocols = []\n } = options;\n const data = ref(null);\n const status = ref(\"CLOSED\");\n const wsRef = ref();\n const urlRef = resolveRef(url);\n let heartbeatPause;\n let heartbeatResume;\n let explicitlyClosed = false;\n let retried = 0;\n let bufferedData = [];\n let pongTimeoutWait;\n const close = (code = 1e3, reason) => {\n if (!wsRef.value)\n return;\n explicitlyClosed = true;\n heartbeatPause == null ? void 0 : heartbeatPause();\n wsRef.value.close(code, reason);\n };\n const _sendBuffer = () => {\n if (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n for (const buffer of bufferedData)\n wsRef.value.send(buffer);\n bufferedData = [];\n }\n };\n const resetHeartbeat = () => {\n clearTimeout(pongTimeoutWait);\n pongTimeoutWait = void 0;\n };\n const send = (data2, useBuffer = true) => {\n if (!wsRef.value || status.value !== \"OPEN\") {\n if (useBuffer)\n bufferedData.push(data2);\n return false;\n }\n _sendBuffer();\n wsRef.value.send(data2);\n return true;\n };\n const _init = () => {\n if (explicitlyClosed || typeof urlRef.value === \"undefined\")\n return;\n const ws = new WebSocket(urlRef.value, protocols);\n wsRef.value = ws;\n status.value = \"CONNECTING\";\n ws.onopen = () => {\n status.value = \"OPEN\";\n onConnected == null ? void 0 : onConnected(ws);\n heartbeatResume == null ? void 0 : heartbeatResume();\n _sendBuffer();\n };\n ws.onclose = (ev) => {\n status.value = \"CLOSED\";\n wsRef.value = void 0;\n onDisconnected == null ? void 0 : onDisconnected(ws, ev);\n if (!explicitlyClosed && options.autoReconnect) {\n const {\n retries = -1,\n delay = 1e3,\n onFailed\n } = resolveNestedOptions(options.autoReconnect);\n retried += 1;\n if (typeof retries === \"number\" && (retries < 0 || retried < retries))\n setTimeout(_init, delay);\n else if (typeof retries === \"function\" && retries())\n setTimeout(_init, delay);\n else\n onFailed == null ? void 0 : onFailed();\n }\n };\n ws.onerror = (e) => {\n onError == null ? void 0 : onError(ws, e);\n };\n ws.onmessage = (e) => {\n if (options.heartbeat) {\n resetHeartbeat();\n const {\n message = DEFAULT_PING_MESSAGE\n } = resolveNestedOptions(options.heartbeat);\n if (e.data === message)\n return;\n }\n data.value = e.data;\n onMessage == null ? void 0 : onMessage(ws, e);\n };\n };\n if (options.heartbeat) {\n const {\n message = DEFAULT_PING_MESSAGE,\n interval = 1e3,\n pongTimeout = 1e3\n } = resolveNestedOptions(options.heartbeat);\n const { pause, resume } = useIntervalFn(() => {\n send(message, false);\n if (pongTimeoutWait != null)\n return;\n pongTimeoutWait = setTimeout(() => {\n close();\n }, pongTimeout);\n }, interval, { immediate: false });\n heartbeatPause = pause;\n heartbeatResume = resume;\n }\n if (autoClose) {\n useEventListener(window, \"beforeunload\", () => close());\n tryOnScopeDispose(close);\n }\n const open = () => {\n close();\n explicitlyClosed = false;\n retried = 0;\n _init();\n };\n if (immediate)\n watch(urlRef, open, { immediate: true });\n return {\n data,\n status,\n close,\n send,\n open,\n ws: wsRef\n };\n}\n\nfunction useWebWorker(arg0, workerOptions, options) {\n const {\n window = defaultWindow\n } = options != null ? options : {};\n const data = ref(null);\n const worker = shallowRef();\n const post = function post2(val) {\n if (!worker.value)\n return;\n worker.value.postMessage(val);\n };\n const terminate = function terminate2() {\n if (!worker.value)\n return;\n worker.value.terminate();\n };\n if (window) {\n if (isString(arg0))\n worker.value = new Worker(arg0, workerOptions);\n else if (isFunction(arg0))\n worker.value = arg0();\n else\n worker.value = arg0;\n worker.value.onmessage = (e) => {\n data.value = e.data;\n };\n tryOnScopeDispose(() => {\n if (worker.value)\n worker.value.terminate();\n });\n }\n return {\n data,\n post,\n terminate,\n worker\n };\n}\n\nconst jobRunner = (userFunc) => (e) => {\n const userFuncArgs = e.data[0];\n return Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n postMessage([\"SUCCESS\", result]);\n }).catch((error) => {\n postMessage([\"ERROR\", error]);\n });\n};\n\nconst depsParser = (deps) => {\n if (deps.length === 0)\n return \"\";\n const depsString = deps.map((dep) => `'${dep}'`).toString();\n return `importScripts(${depsString})`;\n};\n\nconst createWorkerBlobUrl = (fn, deps) => {\n const blobCode = `${depsParser(deps)}; onmessage=(${jobRunner})(${fn})`;\n const blob = new Blob([blobCode], { type: \"text/javascript\" });\n const url = URL.createObjectURL(blob);\n return url;\n};\n\nconst useWebWorkerFn = (fn, options = {}) => {\n const {\n dependencies = [],\n timeout,\n window = defaultWindow\n } = options;\n const worker = ref();\n const workerStatus = ref(\"PENDING\");\n const promise = ref({});\n const timeoutId = ref();\n const workerTerminate = (status = \"PENDING\") => {\n if (worker.value && worker.value._url && window) {\n worker.value.terminate();\n URL.revokeObjectURL(worker.value._url);\n promise.value = {};\n worker.value = void 0;\n window.clearTimeout(timeoutId.value);\n workerStatus.value = status;\n }\n };\n workerTerminate();\n tryOnScopeDispose(workerTerminate);\n const generateWorker = () => {\n const blobUrl = createWorkerBlobUrl(fn, dependencies);\n const newWorker = new Worker(blobUrl);\n newWorker._url = blobUrl;\n newWorker.onmessage = (e) => {\n const { resolve = () => {\n }, reject = () => {\n } } = promise.value;\n const [status, result] = e.data;\n switch (status) {\n case \"SUCCESS\":\n resolve(result);\n workerTerminate(status);\n break;\n default:\n reject(result);\n workerTerminate(\"ERROR\");\n break;\n }\n };\n newWorker.onerror = (e) => {\n const { reject = () => {\n } } = promise.value;\n reject(e);\n workerTerminate(\"ERROR\");\n };\n if (timeout) {\n timeoutId.value = setTimeout(() => workerTerminate(\"TIMEOUT_EXPIRED\"), timeout);\n }\n return newWorker;\n };\n const callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n promise.value = {\n resolve,\n reject\n };\n worker.value && worker.value.postMessage([[...fnArgs]]);\n workerStatus.value = \"RUNNING\";\n });\n const workerFn = (...fnArgs) => {\n if (workerStatus.value === \"RUNNING\") {\n console.error(\"[useWebWorkerFn] You can only run one instance of the worker at a time.\");\n return Promise.reject();\n }\n worker.value = generateWorker();\n return callWorker(...fnArgs);\n };\n return {\n workerFn,\n workerStatus,\n workerTerminate\n };\n};\n\nfunction useWindowFocus({ window = defaultWindow } = {}) {\n if (!window)\n return ref(false);\n const focused = ref(window.document.hasFocus());\n useEventListener(window, \"blur\", () => {\n focused.value = false;\n });\n useEventListener(window, \"focus\", () => {\n focused.value = true;\n });\n return focused;\n}\n\nfunction useWindowScroll({ window = defaultWindow } = {}) {\n if (!window) {\n return {\n x: ref(0),\n y: ref(0)\n };\n }\n const x = ref(window.scrollX);\n const y = ref(window.scrollY);\n useEventListener(window, \"scroll\", () => {\n x.value = window.scrollX;\n y.value = window.scrollY;\n }, {\n capture: false,\n passive: true\n });\n return { x, y };\n}\n\nfunction useWindowSize(options = {}) {\n const {\n window = defaultWindow,\n initialWidth = Infinity,\n initialHeight = Infinity,\n listenOrientation = true,\n includeScrollbar = true\n } = options;\n const width = ref(initialWidth);\n const height = ref(initialHeight);\n const update = () => {\n if (window) {\n if (includeScrollbar) {\n width.value = window.innerWidth;\n height.value = window.innerHeight;\n } else {\n width.value = window.document.documentElement.clientWidth;\n height.value = window.document.documentElement.clientHeight;\n }\n }\n };\n update();\n tryOnMounted(update);\n useEventListener(\"resize\", update, { passive: true });\n if (listenOrientation)\n useEventListener(\"orientationchange\", update, { passive: true });\n return { width, height };\n}\n\nexport { DefaultMagicKeysAliasMap, StorageSerializers, SwipeDirection, TransitionPresets, computedAsync as asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, cloneFnJSON, computedAsync, computedInject, createFetch, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","<template>\r\n <div ref=\"barRef\" :class=\"[ns.e('active-bar'), ns.is(rootTabs.props.tabPosition)]\" :style=\"barStyle\" />\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { getCurrentInstance, inject, nextTick, onBeforeUnmount, ref, watch } from 'vue'\r\nimport { useResizeObserver } from '@vueuse/core'\r\nimport { capitalize, throwError } from '../_util'\r\nimport { useNamespace } from '../_hooks'\r\nimport { tabsRootContextKey } from './constants'\r\nimport { tabBarProps } from './tab-bar'\r\n\r\nimport type { CSSProperties } from 'vue'\r\n\r\nconst COMPONENT_NAME = 'OTabBar'\r\ndefineOptions({\r\n name: COMPONENT_NAME,\r\n})\r\nconst props = defineProps(tabBarProps)\r\n\r\nconst instance = getCurrentInstance()!\r\nconst rootTabs = inject(tabsRootContextKey)\r\nif (!rootTabs) throwError(COMPONENT_NAME, '<o-tabs><o-tab-bar /></p-tabs>')\r\n\r\nconst ns = useNamespace('tabs')\r\n\r\nconst barRef = ref<HTMLDivElement>()\r\nconst barStyle = ref<CSSProperties>()\r\n\r\nconst getBarStyle = (): CSSProperties => {\r\n let offset = 0\r\n let tabSize = 0\r\n\r\n const sizeName = ['top', 'bottom'].includes(rootTabs.props.tabPosition) ? 'width' : 'height'\r\n const sizeDir = sizeName === 'width' ? 'x' : 'y'\r\n const position = sizeDir === 'x' ? 'left' : 'top'\r\n\r\n props.tabs.every((tab) => {\r\n const $el = instance.parent?.refs?.[`tab-${tab.uid}`] as HTMLElement\r\n if (!$el) return false\r\n\r\n if (!tab.active) {\r\n return true\r\n }\r\n\r\n offset = $el[`offset${capitalize(position)}`]\r\n tabSize = $el[`client${capitalize(sizeName)}`]\r\n\r\n const tabStyles = window.getComputedStyle($el)\r\n\r\n if (sizeName === 'width') {\r\n tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight)\r\n offset += Number.parseFloat(tabStyles.paddingLeft)\r\n }\r\n return false\r\n })\r\n\r\n return {\r\n [sizeName]: `${tabSize}px`,\r\n transform: `translate${capitalize(sizeDir)}(${offset}px)`,\r\n }\r\n}\r\n\r\nconst update = () => (barStyle.value = getBarStyle())\r\n\r\nconst saveObserver = [] as ReturnType<typeof useResizeObserver>[]\r\nconst observerTabs = () => {\r\n saveObserver.forEach((observer) => observer.stop())\r\n saveObserver.length = 0\r\n const list = instance.parent?.refs as Record<string, HTMLElement>\r\n if (!list) return\r\n for (const key in list) {\r\n if (key.startsWith('tab-')) {\r\n const _el = list[key]\r\n if (_el) {\r\n saveObserver.push(useResizeObserver(_el, update))\r\n }\r\n }\r\n }\r\n}\r\n\r\nwatch(\r\n () => props.tabs,\r\n async () => {\r\n await nextTick()\r\n update()\r\n\r\n observerTabs()\r\n },\r\n { immediate: true }\r\n)\r\nconst barObserever = useResizeObserver(barRef, () => update())\r\n\r\nonBeforeUnmount(() => {\r\n saveObserver.forEach((observer) => observer.stop())\r\n saveObserver.length = 0\r\n barObserever.stop()\r\n})\r\n\r\ndefineExpose({\r\n /** @description tab root html element */\r\n ref: barRef,\r\n /** @description method to manually update tab bar style */\r\n update,\r\n})\r\n</script>\r\n","import { computed, defineComponent, inject, nextTick, onMounted, onUpdated, ref, watch } from 'vue'\r\nimport { useDocumentVisibility, useResizeObserver, useWindowFocus } from '@vueuse/core'\r\nimport { buildProps, capitalize, definePropType, mutable, throwError } from '../_util'\r\nimport { EVENT_CODE } from '../_constants'\r\nimport { ElIcon } from 'element-plus'\r\nimport { ArrowLeft, ArrowRight, Close } from '@element-plus/icons-vue'\r\nimport { useNamespace } from '../_hooks'\r\nimport TabBar from './tab-bar.vue'\r\nimport { tabsRootContextKey } from './constants'\r\n\r\nimport type { CSSProperties, ExtractPropTypes } from 'vue'\r\nimport type { TabsPaneContext } from './constants'\r\nimport type { TabPaneName } from './tabs'\r\n\r\ninterface Scrollable {\r\n next?: boolean\r\n prev?: number\r\n}\r\n\r\nexport const tabNavProps = buildProps({\r\n panes: {\r\n type: definePropType<TabsPaneContext[]>(Array),\r\n default: () => mutable([] as const),\r\n },\r\n currentName: {\r\n type: [String, Number],\r\n default: '',\r\n },\r\n type: {\r\n type: String,\r\n values: ['card', 'border-card', ''],\r\n default: 'card',\r\n },\r\n stretch: Boolean,\r\n} as const)\r\n\r\nexport const tabNavEmits = {\r\n tabClick: (tab: TabsPaneContext, tabName: TabPaneName, ev: Event) => ev instanceof Event,\r\n tabRemove: (tab: TabsPaneContext, ev: Event) => ev instanceof Event,\r\n}\r\n\r\nexport type TabNavProps = ExtractPropTypes<typeof tabNavProps>\r\nexport type TabNavEmits = typeof tabNavEmits\r\n\r\nconst COMPONENT_NAME = 'OTabNav'\r\nconst TabNav = defineComponent({\r\n name: COMPONENT_NAME,\r\n props: tabNavProps,\r\n emits: tabNavEmits,\r\n setup(props, { expose, emit }) {\r\n const rootTabs = inject(tabsRootContextKey)\r\n if (!rootTabs) throwError(COMPONENT_NAME, `<o-tabs><o-tab-nav /></o-tabs>`)\r\n\r\n const ns = useNamespace('tabs')\r\n const visibility = useDocumentVisibility()\r\n const focused = useWindowFocus()\r\n\r\n const navScroll$ = ref<HTMLDivElement>()\r\n const nav$ = ref<HTMLDivElement>()\r\n const el$ = ref<HTMLDivElement>()\r\n\r\n const tabBarRef = ref<InstanceType<typeof TabBar>>()\r\n\r\n const scrollable = ref<false | Scrollable>(false)\r\n const navOffset = ref(0)\r\n const isFocus = ref(false)\r\n const focusable = ref(true)\r\n\r\n const sizeName = computed(() => (['top', 'bottom'].includes(rootTabs.props.tabPosition) ? 'width' : 'height'))\r\n const navStyle = computed<CSSProperties>(() => {\r\n const dir = sizeName.value === 'width' ? 'X' : 'Y'\r\n return {\r\n transform: `translate${dir}(-${navOffset.value}px)`,\r\n }\r\n })\r\n\r\n const scrollPrev = () => {\r\n if (!navScroll$.value) return\r\n\r\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`]\r\n const currentOffset = navOffset.value\r\n\r\n if (!currentOffset) return\r\n\r\n const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0\r\n\r\n navOffset.value = newOffset\r\n }\r\n\r\n const scrollNext = () => {\r\n if (!navScroll$.value || !nav$.value) return\r\n\r\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\r\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`]\r\n const currentOffset = navOffset.value\r\n\r\n if (navSize - currentOffset <= containerSize) return\r\n\r\n const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize\r\n\r\n navOffset.value = newOffset\r\n }\r\n\r\n const scrollToActiveTab = async () => {\r\n const nav = nav$.value\r\n if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return\r\n\r\n await nextTick()\r\n\r\n const activeTab = el$.value.querySelector('.is-active')\r\n if (!activeTab) return\r\n\r\n const navScroll = navScroll$.value\r\n const isHorizontal = ['top', 'bottom'].includes(rootTabs.props.tabPosition)\r\n const activeTabBounding = activeTab.getBoundingClientRect()\r\n const navScrollBounding = navScroll.getBoundingClientRect()\r\n const maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height\r\n const currentOffset = navOffset.value\r\n let newOffset = currentOffset\r\n\r\n if (isHorizontal) {\r\n if (activeTabBounding.left < navScrollBounding.left) {\r\n newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left)\r\n }\r\n if (activeTabBounding.right > navScrollBounding.right) {\r\n newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right\r\n }\r\n } else {\r\n if (activeTabBounding.top < navScrollBounding.top) {\r\n newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top)\r\n }\r\n if (activeTabBounding.bottom > navScrollBounding.bottom) {\r\n newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom)\r\n }\r\n }\r\n newOffset = Math.max(newOffset, 0)\r\n navOffset.value = Math.min(newOffset, maxOffset)\r\n }\r\n\r\n const update = () => {\r\n if (!nav$.value || !navScroll$.value) return\r\n\r\n props.stretch && tabBarRef.value?.update()\r\n\r\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\r\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`]\r\n const currentOffset = navOffset.value\r\n\r\n if (containerSize < navSize) {\r\n scrollable.value = scrollable.value || {}\r\n scrollable.value.prev = currentOffset\r\n scrollable.value.next = currentOffset + containerSize < navSize\r\n if (navSize - currentOffset < containerSize) {\r\n navOffset.value = navSize - containerSize\r\n }\r\n } else {\r\n scrollable.value = false\r\n if (currentOffset > 0) {\r\n navOffset.value = 0\r\n }\r\n }\r\n }\r\n\r\n const changeTab = (e: KeyboardEvent) => {\r\n const code = e.code\r\n\r\n const { up, down, left, right } = EVENT_CODE\r\n if (![up, down, left, right].includes(code)) return\r\n\r\n // 左右上下键更换tab\r\n const tabList = Array.from((e.currentTarget as HTMLDivElement).querySelectorAll<HTMLDivElement>('[role=tab]:not(.is-disabled)'))\r\n const currentIndex = tabList.indexOf(e.target as HTMLDivElement)\r\n\r\n let nextIndex: number\r\n if (code === left || code === up) {\r\n // left\r\n if (currentIndex === 0) {\r\n // first\r\n nextIndex = tabList.length - 1\r\n } else {\r\n nextIndex = currentIndex - 1\r\n }\r\n } else {\r\n // right\r\n if (currentIndex < tabList.length - 1) {\r\n // not last\r\n nextIndex = currentIndex + 1\r\n } else {\r\n nextIndex = 0\r\n }\r\n }\r\n tabList[nextIndex].focus({ preventScroll: true }) // 改变焦点元素\r\n tabList[nextIndex].click() // 选中下一个tab\r\n setFocus()\r\n }\r\n\r\n const setFocus = () => {\r\n if (focusable.value) isFocus.value = true\r\n }\r\n const removeFocus = () => (isFocus.value = false)\r\n\r\n watch(visibility, (visibility) => {\r\n if (visibility === 'hidden') {\r\n focusable.value = false\r\n } else if (visibility === 'visible') {\r\n setTimeout(() => (focusable.value = true), 50)\r\n }\r\n })\r\n watch(focused, (focused) => {\r\n if (focused) {\r\n setTimeout(() => (focusable.value = true), 50)\r\n } else {\r\n focusable.value = false\r\n }\r\n })\r\n\r\n useResizeObserver(el$, update)\r\n\r\n onMounted(() => setTimeout(() => scrollToActiveTab(), 0))\r\n onUpdated(() => update())\r\n\r\n expose({\r\n scrollToActiveTab,\r\n removeFocus,\r\n })\r\n\r\n return () => {\r\n const scrollBtn = scrollable.value\r\n ? [\r\n <span class={[ns.e('nav-prev'), ns.is('disabled', !scrollable.value.prev)]} onClick={scrollPrev}>\r\n <ElIcon>\r\n <ArrowLeft />\r\n </ElIcon>\r\n </span>,\r\n <span class={[ns.e('nav-next'), ns.is('disabled', !scrollable.value.next)]} onClick={scrollNext}>\r\n <ElIcon>\r\n <ArrowRight />\r\n </ElIcon>\r\n </span>,\r\n ]\r\n : null\r\n\r\n const tabs = props.panes.map((pane, index) => {\r\n const uid = pane.uid\r\n const disabled = pane.props.disabled\r\n const tabName = pane.props.name ?? pane.index ?? `${index}`\r\n pane.index = `${index}`\r\n\r\n const tabLabelContent = pane.slots.label?.() || pane.props.label\r\n const tabindex = !disabled && pane.active ? 0 : -1\r\n\r\n return (\r\n <div\r\n ref={`tab-${uid}`}\r\n class={[ns.e('item'), ns.is(rootTabs.props.tabPosition), ns.is('active', pane.active), ns.is('disabled', disabled), ns.is('focus', isFocus.value)]}\r\n id={`tab-${tabName}`}\r\n key={`tab-${uid}`}\r\n aria-controls={`pane-${tabName}`}\r\n role=\"tab\"\r\n aria-selected={pane.active}\r\n tabindex={tabindex}\r\n onFocus={() => setFocus()}\r\n onBlur={() => removeFocus()}\r\n onClick={(ev: MouseEvent) => {\r\n removeFocus()\r\n emit('tabClick', pane, tabName, ev)\r\n }}\r\n >\r\n {...[tabLabelContent]}\r\n </div>\r\n )\r\n })\r\n\r\n return (\r\n <div ref={el$} class={[ns.e('nav-wrap'), ns.is('scrollable', !!scrollable.value), ns.is(rootTabs.props.tabPosition)]}>\r\n {scrollBtn}\r\n <div class={ns.e('nav-scroll')} ref={navScroll$}>\r\n <div\r\n class={[\r\n ns.e('nav'),\r\n ns.is(rootTabs.props.tabPosition),\r\n ns.is('stretch', props.stretch && ['top', 'bottom'].includes(rootTabs.props.tabPosition)),\r\n ]}\r\n ref={nav$}\r\n style={navStyle.value}\r\n role=\"tablist\"\r\n onKeydown={changeTab}\r\n >\r\n {...[!props.type ? <TabBar ref={tabBarRef} tabs={[...props.panes]} /> : null, tabs]}\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport type TabNavInstance = InstanceType<typeof TabNav> & {\r\n scrollToActiveTab: () => Promise<void>\r\n removeFocus: () => void\r\n}\r\nexport default TabNav\r\n","import { computed, createVNode, defineComponent, getCurrentInstance, nextTick, provide, ref, renderSlot, watch } from 'vue'\r\nimport { buildProps, definePropType, isNumber, isString, isUndefined } from '../_util'\r\nimport { UPDATE_MODEL_EVENT } from '../_constants'\r\nimport { useNamespace, useOrderedChildren } from '../_hooks'\r\nimport { tabsRootContextKey } from './constants'\r\nimport TabNav from './tab-nav'\r\n\r\nimport type { TabNavInstance } from './tab-nav'\r\nimport type { TabsPaneContext } from './constants'\r\nimport type { ExtractPropTypes, FunctionalComponent, VNode } from 'vue'\r\nimport type { Awaitable } from '../_util'\r\n\r\nexport type TabPaneName = string | number\r\n\r\nexport const tabsProps = buildProps({\r\n /**\r\n * @description type of Tab\r\n */\r\n type: {\r\n type: String,\r\n values: ['card', 'border-card', ''],\r\n default: 'card',\r\n },\r\n /**\r\n * @description binding value, name of the selected tab\r\n */\r\n modelValue: {\r\n type: [String, Number],\r\n },\r\n /**\r\n * @description position of tabs\r\n */\r\n tabPosition: {\r\n type: String,\r\n values: ['top', 'right', 'bottom', 'left'],\r\n default: 'top',\r\n },\r\n /**\r\n * @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented\r\n */\r\n beforeLeave: {\r\n type: definePropType<(newName: TabPaneName, oldName: TabPaneName) => Awaitable<void | boolean>>(Function),\r\n default: () => true,\r\n },\r\n /**\r\n * @description whether width of tab automatically fits its container\r\n */\r\n stretch: Boolean,\r\n} as const)\r\nexport type TabsProps = ExtractPropTypes<typeof tabsProps>\r\n\r\nconst isPaneName = (value: unknown): value is string | number => isString(value) || isNumber(value)\r\n\r\nexport const tabsEmits = {\r\n [UPDATE_MODEL_EVENT]: (name: TabPaneName) => isPaneName(name),\r\n tabClick: (pane: TabsPaneContext, ev: Event) => ev instanceof Event,\r\n tabChange: (name: TabPaneName) => isPaneName(name),\r\n}\r\nexport type TabsEmits = typeof tabsEmits\r\n\r\nexport type TabsPanes = Record<number, TabsPaneContext>\r\n\r\nconst Tabs = defineComponent({\r\n name: 'OTabs',\r\n\r\n props: tabsProps,\r\n emits: tabsEmits,\r\n\r\n setup(props, { emit, slots, expose }) {\r\n const ns = useNamespace('tabs')\r\n\r\n const isVertical = computed(() => ['left', 'right'].includes(props.tabPosition))\r\n\r\n const { children: panes, addChild: sortPane, removeChild: unregisterPane } = useOrderedChildren<TabsPaneContext>(getCurrentInstance()!, 'OTabPane')\r\n\r\n const nav$ = ref<TabNavInstance>()\r\n const currentName = ref<TabPaneName>(props.modelValue ?? '0')\r\n\r\n const setCurrentName = async (value?: TabPaneName, trigger = false) => {\r\n // should do nothing.\r\n if (currentName.value === value || isUndefined(value)) return\r\n\r\n try {\r\n const canLeave = await props.beforeLeave?.(value, currentName.value)\r\n if (canLeave !== false) {\r\n currentName.value = value\r\n if (trigger) {\r\n emit(UPDATE_MODEL_EVENT, value)\r\n emit('tabChange', value)\r\n }\r\n\r\n nav$.value?.removeFocus?.()\r\n }\r\n } catch {}\r\n }\r\n\r\n const handleTabClick = (tab: TabsPaneContext, tabName: TabPaneName, event: Event) => {\r\n if (tab.props.disabled) return\r\n setCurrentName(tabName, true)\r\n emit('tabClick', tab, event)\r\n }\r\n\r\n watch(\r\n () => props.modelValue,\r\n (modelValue) => setCurrentName(modelValue)\r\n )\r\n\r\n watch(currentName, async () => {\r\n await nextTick()\r\n nav$.value?.scrollToActiveTab()\r\n })\r\n\r\n provide(tabsRootContextKey, {\r\n props,\r\n currentName,\r\n registerPane: (pane: TabsPaneContext) => {\r\n panes.value.push(pane)\r\n },\r\n sortPane,\r\n unregisterPane,\r\n })\r\n\r\n expose({\r\n currentName,\r\n })\r\n const TabNavRenderer: FunctionalComponent<{ render: () => VNode }> = ({ render }) => {\r\n return render()\r\n }\r\n return () => {\r\n const leftExtra = slots['left-extra']\r\n const rightExtra = slots['right-extra']\r\n\r\n const header = (\r\n <div class={[ns.e('header'), isVertical.value && ns.e('header-vertical'), ns.is(props.tabPosition)]}>\r\n {leftExtra && <div class={ns.e('extra-content-left')}>{renderSlot(slots, 'left-extra')}</div>}\r\n\r\n <TabNavRenderer\r\n render={() => {\r\n const hasLabelSlot = panes.value.some((pane) => pane.slots.label)\r\n return createVNode(\r\n TabNav,\r\n {\r\n ref: nav$,\r\n currentName: currentName.value,\r\n type: props.type,\r\n panes: panes.value,\r\n stretch: props.stretch,\r\n onTabClick: handleTabClick,\r\n },\r\n { $stable: !hasLabelSlot }\r\n )\r\n }}\r\n />\r\n\r\n {rightExtra && <div class={ns.e('extra-content-right')}>{renderSlot(slots, 'right-extra')}</div>}\r\n </div>\r\n )\r\n\r\n const panels = <div class={ns.e('content')}>{renderSlot(slots, 'default')}</div>\r\n\r\n return (\r\n <div\r\n class={[\r\n ns.b(),\r\n ns.m(props.tabPosition),\r\n {\r\n [ns.m('card')]: props.type === 'card',\r\n [ns.m('border-card')]: props.type === 'border-card',\r\n },\r\n ]}\r\n >\r\n {panels}\r\n {header}\r\n </div>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport type TabsInstance = InstanceType<typeof Tabs> & {\r\n currentName: TabPaneName\r\n}\r\n\r\nexport default Tabs\r\n","<template>\r\n <div\r\n v-if=\"shouldBeRender\"\r\n v-show=\"active\"\r\n :id=\"`pane-${paneName}`\"\r\n :class=\"ns.b()\"\r\n role=\"tabpanel\"\r\n :aria-hidden=\"!active\"\r\n :aria-labelledby=\"`tab-${paneName}`\"\r\n >\r\n <slot />\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { computed, getCurrentInstance, inject, onMounted, onUnmounted, reactive, ref, useSlots, watch } from 'vue'\r\nimport { eagerComputed } from '@vueuse/core'\r\nimport { throwError } from '../_util'\r\nimport { useNamespace } from '../_hooks'\r\nimport { tabsRootContextKey } from './constants'\r\nimport { tabPaneProps } from './tab-pane'\r\n\r\nconst COMPONENT_NAME = 'OTabPane'\r\ndefineOptions({\r\n name: COMPONENT_NAME,\r\n})\r\nconst props = defineProps(tabPaneProps)\r\n\r\nconst instance = getCurrentInstance()!\r\nconst slots = useSlots()\r\n\r\nconst tabsRoot = inject(tabsRootContextKey)\r\nif (!tabsRoot) throwError(COMPONENT_NAME, 'usage: <o-tabs><o-tab-pane /></o-tabs/>')\r\n\r\nconst ns = useNamespace('tab-pane')\r\n\r\nconst index = ref<string>()\r\nconst active = eagerComputed(() => tabsRoot.currentName.value === (props.name ?? index.value))\r\nconst loaded = ref(active.value)\r\nconst paneName = computed(() => props.name ?? index.value)\r\nconst shouldBeRender = eagerComputed(() => !props.lazy || loaded.value || active.value)\r\n\r\nwatch(active, (val) => {\r\n if (val) loaded.value = true\r\n})\r\n\r\nconst pane = reactive({\r\n uid: instance.uid,\r\n slots,\r\n props,\r\n paneName,\r\n active,\r\n index,\r\n})\r\n\r\ntabsRoot.registerPane(pane)\r\nonMounted(() => {\r\n tabsRoot.sortPane(pane)\r\n})\r\n\r\nonUnmounted(() => {\r\n tabsRoot.unregisterPane(pane.uid)\r\n})\r\n</script>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Tabs from './tabs'\r\nimport TabPane from './tab-pane.vue'\r\n\r\nexport default withInstall<typeof Tabs, {\r\n TabPane: typeof TabPane\r\n}>(Tabs, {\r\n TabPane,\r\n})\r\n\r\nexport * from './tabs'\r\nexport * from './tab-bar'\r\nexport * from './tab-nav'\r\nexport * from './tab-pane'\r\nexport * from './constants'\r\n"],"names":["window","COMPONENT_NAME","tabNavProps","buildProps","panes","type","definePropType","Array","default","mutable","currentName","String","Number","values","stretch","Boolean","tabNavEmits","tabClick","tab","tabName","ev","Event","tabRemove","TabNav","defineComponent","name","props","emits","setup","expose","emit","rootTabs","inject","tabsRootContextKey","throwError","ns","useNamespace","visibility","useDocumentVisibility","focused","useWindowFocus","navScroll$","ref","nav$","el$","tabBarRef","scrollable","navOffset","isFocus","focusable","sizeName","computed","includes","tabPosition","navStyle","dir","value","transform","scrollPrev","containerSize","capitalize","currentOffset","newOffset","scrollNext","navSize","scrollToActiveTab","nav","nextTick","activeTab","querySelector","navScroll","isHorizontal","activeTabBounding","getBoundingClientRect","navScrollBounding","maxOffset","offsetWidth","width","offsetHeight","height","left","right","top","bottom","Math","max","min","update","prev","next","changeTab","e","code","up","down","EVENT_CODE","tabList","from","currentTarget","querySelectorAll","currentIndex","indexOf","target","nextIndex","length","focus","preventScroll","click","setFocus","removeFocus","watch","setTimeout","useResizeObserver","onMounted","onUpdated","scrollBtn","_createVNode","is","ElIcon","ArrowLeft","ArrowRight","tabs","map","pane","index","uid","disabled","tabLabelContent","slots","label","tabindex","active","onFocus","onBlur","TabBar","tabsProps","modelValue","beforeLeave","Function","isPaneName","isString","isNumber","tabsEmits","UPDATE_MODEL_EVENT","tabChange","Tabs","isVertical","children","addChild","sortPane","removeChild","unregisterPane","useOrderedChildren","getCurrentInstance","setCurrentName","trigger","isUndefined","canLeave","handleTabClick","event","provide","registerPane","push","TabNavRenderer","render","leftExtra","rightExtra","header","renderSlot","hasLabelSlot","some","createVNode","onTabClick","$stable","panels","b","m","eagerComputed","TabPane"],"mappings":";;;;;;;;;;;;;;;;;;;AAoFA,SAAS,aAA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AAS,SAAS,IAAI;AAAA,IAAA,CACvB;AAED,gBAAY,MAAM;AACP,eAAA,eAAe,KAAK,GAAG;AAAA,IAAA,CACjC;;;;;;;;;;;;;;;;;ACzDD,MAAe,QAAA,YAEZ,MAAM;AAAA,EAAA,SACPsD;AACF,CAAC;","x_google_ignoreList":[0]}
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../node_modules/@vueuse/core/index.mjs","../../../src/components/Tabs/tab-bar.vue","../../../src/components/Tabs/tab-nav.tsx","../../../src/components/Tabs/tabs.tsx","../../../src/components/Tabs/tab-pane.vue","../../../src/components/Tabs/index.ts"],"sourcesContent":["import { noop, resolveUnref, isClient, isString, tryOnScopeDispose, isIOS, tryOnMounted, computedWithControl, promiseTimeout, isFunction, resolveRef, increaseWithUnit, useTimeoutFn, pausableWatch, createEventHook, timestamp, pausableFilter, watchIgnorable, debounceFilter, createFilterWrapper, bypassFilter, createSingletonPromise, toRefs, containsProp, until, hasOwn, throttleFilter, useDebounceFn, useThrottleFn, isObject, isNumber, useIntervalFn, clamp, syncRef, objectPick, tryOnUnmounted, watchWithFilter, identity, isDef } from '@vueuse/shared';\nexport * from '@vueuse/shared';\nimport { isRef, ref, shallowRef, watchEffect, computed, inject, unref, watch, getCurrentInstance, customRef, onUpdated, reactive, nextTick, onMounted, markRaw, readonly, getCurrentScope, isVue2, set, del, isReadonly, onBeforeUpdate } from 'vue-demi';\n\nfunction computedAsync(evaluationCallback, initialState, optionsOrRef) {\n let options;\n if (isRef(optionsOrRef)) {\n options = {\n evaluating: optionsOrRef\n };\n } else {\n options = optionsOrRef || {};\n }\n const {\n lazy = false,\n evaluating = void 0,\n shallow = false,\n onError = noop\n } = options;\n const started = ref(!lazy);\n const current = shallow ? shallowRef(initialState) : ref(initialState);\n let counter = 0;\n watchEffect(async (onInvalidate) => {\n if (!started.value)\n return;\n counter++;\n const counterAtBeginning = counter;\n let hasFinished = false;\n if (evaluating) {\n Promise.resolve().then(() => {\n evaluating.value = true;\n });\n }\n try {\n const result = await evaluationCallback((cancelCallback) => {\n onInvalidate(() => {\n if (evaluating)\n evaluating.value = false;\n if (!hasFinished)\n cancelCallback();\n });\n });\n if (counterAtBeginning === counter)\n current.value = result;\n } catch (e) {\n onError(e);\n } finally {\n if (evaluating && counterAtBeginning === counter)\n evaluating.value = false;\n hasFinished = true;\n }\n });\n if (lazy) {\n return computed(() => {\n started.value = true;\n return current.value;\n });\n } else {\n return current;\n }\n}\n\nfunction computedInject(key, options, defaultSource, treatDefaultAsFactory) {\n let source = inject(key);\n if (defaultSource)\n source = inject(key, defaultSource);\n if (treatDefaultAsFactory)\n source = inject(key, defaultSource, treatDefaultAsFactory);\n if (typeof options === \"function\") {\n return computed((ctx) => options(source, ctx));\n } else {\n return computed({\n get: (ctx) => options.get(source, ctx),\n set: options.set\n });\n }\n}\n\nconst createUnrefFn = (fn) => {\n return function(...args) {\n return fn.apply(this, args.map((i) => unref(i)));\n };\n};\n\nfunction unrefElement(elRef) {\n var _a;\n const plain = resolveUnref(elRef);\n return (_a = plain == null ? void 0 : plain.$el) != null ? _a : plain;\n}\n\nconst defaultWindow = isClient ? window : void 0;\nconst defaultDocument = isClient ? window.document : void 0;\nconst defaultNavigator = isClient ? window.navigator : void 0;\nconst defaultLocation = isClient ? window.location : void 0;\n\nfunction useEventListener(...args) {\n let target;\n let events;\n let listeners;\n let options;\n if (isString(args[0]) || Array.isArray(args[0])) {\n [events, listeners, options] = args;\n target = defaultWindow;\n } else {\n [target, events, listeners, options] = args;\n }\n if (!target)\n return noop;\n if (!Array.isArray(events))\n events = [events];\n if (!Array.isArray(listeners))\n listeners = [listeners];\n const cleanups = [];\n const cleanup = () => {\n cleanups.forEach((fn) => fn());\n cleanups.length = 0;\n };\n const register = (el, event, listener, options2) => {\n el.addEventListener(event, listener, options2);\n return () => el.removeEventListener(event, listener, options2);\n };\n const stopWatch = watch(() => [unrefElement(target), resolveUnref(options)], ([el, options2]) => {\n cleanup();\n if (!el)\n return;\n cleanups.push(...events.flatMap((event) => {\n return listeners.map((listener) => register(el, event, listener, options2));\n }));\n }, { immediate: true, flush: \"post\" });\n const stop = () => {\n stopWatch();\n cleanup();\n };\n tryOnScopeDispose(stop);\n return stop;\n}\n\nlet _iOSWorkaround = false;\nfunction onClickOutside(target, handler, options = {}) {\n const { window = defaultWindow, ignore = [], capture = true, detectIframe = false } = options;\n if (!window)\n return;\n if (isIOS && !_iOSWorkaround) {\n _iOSWorkaround = true;\n Array.from(window.document.body.children).forEach((el) => el.addEventListener(\"click\", noop));\n }\n let shouldListen = true;\n const shouldIgnore = (event) => {\n return ignore.some((target2) => {\n if (typeof target2 === \"string\") {\n return Array.from(window.document.querySelectorAll(target2)).some((el) => el === event.target || event.composedPath().includes(el));\n } else {\n const el = unrefElement(target2);\n return el && (event.target === el || event.composedPath().includes(el));\n }\n });\n };\n const listener = (event) => {\n const el = unrefElement(target);\n if (!el || el === event.target || event.composedPath().includes(el))\n return;\n if (event.detail === 0)\n shouldListen = !shouldIgnore(event);\n if (!shouldListen) {\n shouldListen = true;\n return;\n }\n handler(event);\n };\n const cleanup = [\n useEventListener(window, \"click\", listener, { passive: true, capture }),\n useEventListener(window, \"pointerdown\", (e) => {\n const el = unrefElement(target);\n if (el)\n shouldListen = !e.composedPath().includes(el) && !shouldIgnore(e);\n }, { passive: true }),\n detectIframe && useEventListener(window, \"blur\", (event) => {\n var _a;\n const el = unrefElement(target);\n if (((_a = window.document.activeElement) == null ? void 0 : _a.tagName) === \"IFRAME\" && !(el == null ? void 0 : el.contains(window.document.activeElement)))\n handler(event);\n })\n ].filter(Boolean);\n const stop = () => cleanup.forEach((fn) => fn());\n return stop;\n}\n\nvar __defProp$n = Object.defineProperty;\nvar __defProps$9 = Object.defineProperties;\nvar __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$p = Object.getOwnPropertySymbols;\nvar __hasOwnProp$p = Object.prototype.hasOwnProperty;\nvar __propIsEnum$p = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$n = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$p.call(b, prop))\n __defNormalProp$n(a, prop, b[prop]);\n if (__getOwnPropSymbols$p)\n for (var prop of __getOwnPropSymbols$p(b)) {\n if (__propIsEnum$p.call(b, prop))\n __defNormalProp$n(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));\nconst createKeyPredicate = (keyFilter) => {\n if (typeof keyFilter === \"function\")\n return keyFilter;\n else if (typeof keyFilter === \"string\")\n return (event) => event.key === keyFilter;\n else if (Array.isArray(keyFilter))\n return (event) => keyFilter.includes(event.key);\n return () => true;\n};\nfunction onKeyStroke(...args) {\n let key;\n let handler;\n let options = {};\n if (args.length === 3) {\n key = args[0];\n handler = args[1];\n options = args[2];\n } else if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n key = true;\n handler = args[0];\n options = args[1];\n } else {\n key = args[0];\n handler = args[1];\n }\n } else {\n key = true;\n handler = args[0];\n }\n const { target = defaultWindow, eventName = \"keydown\", passive = false } = options;\n const predicate = createKeyPredicate(key);\n const listener = (e) => {\n if (predicate(e))\n handler(e);\n };\n return useEventListener(target, eventName, listener, passive);\n}\nfunction onKeyDown(key, handler, options = {}) {\n return onKeyStroke(key, handler, __spreadProps$9(__spreadValues$n({}, options), { eventName: \"keydown\" }));\n}\nfunction onKeyPressed(key, handler, options = {}) {\n return onKeyStroke(key, handler, __spreadProps$9(__spreadValues$n({}, options), { eventName: \"keypress\" }));\n}\nfunction onKeyUp(key, handler, options = {}) {\n return onKeyStroke(key, handler, __spreadProps$9(__spreadValues$n({}, options), { eventName: \"keyup\" }));\n}\n\nconst DEFAULT_DELAY = 500;\nfunction onLongPress(target, handler, options) {\n var _a, _b;\n const elementRef = computed(() => unrefElement(target));\n let timeout;\n function clear() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = void 0;\n }\n }\n function onDown(ev) {\n var _a2, _b2, _c, _d;\n if (((_a2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _a2.self) && ev.target !== elementRef.value)\n return;\n clear();\n if ((_b2 = options == null ? void 0 : options.modifiers) == null ? void 0 : _b2.prevent)\n ev.preventDefault();\n if ((_c = options == null ? void 0 : options.modifiers) == null ? void 0 : _c.stop)\n ev.stopPropagation();\n timeout = setTimeout(() => handler(ev), (_d = options == null ? void 0 : options.delay) != null ? _d : DEFAULT_DELAY);\n }\n const listenerOptions = {\n capture: (_a = options == null ? void 0 : options.modifiers) == null ? void 0 : _a.capture,\n once: (_b = options == null ? void 0 : options.modifiers) == null ? void 0 : _b.once\n };\n useEventListener(elementRef, \"pointerdown\", onDown, listenerOptions);\n useEventListener(elementRef, \"pointerup\", clear, listenerOptions);\n useEventListener(elementRef, \"pointerleave\", clear, listenerOptions);\n}\n\nconst isFocusedElementEditable = () => {\n const { activeElement, body } = document;\n if (!activeElement)\n return false;\n if (activeElement === body)\n return false;\n switch (activeElement.tagName) {\n case \"INPUT\":\n case \"TEXTAREA\":\n return true;\n }\n return activeElement.hasAttribute(\"contenteditable\");\n};\nconst isTypedCharValid = ({\n keyCode,\n metaKey,\n ctrlKey,\n altKey\n}) => {\n if (metaKey || ctrlKey || altKey)\n return false;\n if (keyCode >= 48 && keyCode <= 57 || keyCode >= 96 && keyCode <= 105)\n return true;\n if (keyCode >= 65 && keyCode <= 90)\n return true;\n return false;\n};\nfunction onStartTyping(callback, options = {}) {\n const { document: document2 = defaultDocument } = options;\n const keydown = (event) => {\n !isFocusedElementEditable() && isTypedCharValid(event) && callback(event);\n };\n if (document2)\n useEventListener(document2, \"keydown\", keydown, { passive: true });\n}\n\nfunction templateRef(key, initialValue = null) {\n const instance = getCurrentInstance();\n let _trigger = () => {\n };\n const element = customRef((track, trigger) => {\n _trigger = trigger;\n return {\n get() {\n var _a, _b;\n track();\n return (_b = (_a = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a.$refs[key]) != null ? _b : initialValue;\n },\n set() {\n }\n };\n });\n tryOnMounted(_trigger);\n onUpdated(_trigger);\n return element;\n}\n\nfunction useActiveElement(options = {}) {\n var _a;\n const { window = defaultWindow } = options;\n const document = (_a = options.document) != null ? _a : window == null ? void 0 : window.document;\n const activeElement = computedWithControl(() => null, () => document == null ? void 0 : document.activeElement);\n if (window) {\n useEventListener(window, \"blur\", (event) => {\n if (event.relatedTarget !== null)\n return;\n activeElement.trigger();\n }, true);\n useEventListener(window, \"focus\", activeElement.trigger, true);\n }\n return activeElement;\n}\n\nfunction useAsyncQueue(tasks, options = {}) {\n const {\n interrupt = true,\n onError = noop,\n onFinished = noop\n } = options;\n const promiseState = {\n pending: \"pending\",\n rejected: \"rejected\",\n fulfilled: \"fulfilled\"\n };\n const initialResult = Array.from(new Array(tasks.length), () => ({ state: promiseState.pending, data: null }));\n const result = reactive(initialResult);\n const activeIndex = ref(-1);\n if (!tasks || tasks.length === 0) {\n onFinished();\n return {\n activeIndex,\n result\n };\n }\n function updateResult(state, res) {\n activeIndex.value++;\n result[activeIndex.value].data = res;\n result[activeIndex.value].state = state;\n }\n tasks.reduce((prev, curr) => {\n return prev.then((prevRes) => {\n var _a;\n if (((_a = result[activeIndex.value]) == null ? void 0 : _a.state) === promiseState.rejected && interrupt) {\n onFinished();\n return;\n }\n return curr(prevRes).then((currentRes) => {\n updateResult(promiseState.fulfilled, currentRes);\n activeIndex.value === tasks.length - 1 && onFinished();\n return currentRes;\n });\n }).catch((e) => {\n updateResult(promiseState.rejected, e);\n onError();\n return e;\n });\n }, Promise.resolve());\n return {\n activeIndex,\n result\n };\n}\n\nfunction useAsyncState(promise, initialState, options) {\n const {\n immediate = true,\n delay = 0,\n onError = noop,\n onSuccess = noop,\n resetOnExecute = true,\n shallow = true,\n throwError\n } = options != null ? options : {};\n const state = shallow ? shallowRef(initialState) : ref(initialState);\n const isReady = ref(false);\n const isLoading = ref(false);\n const error = ref(void 0);\n async function execute(delay2 = 0, ...args) {\n if (resetOnExecute)\n state.value = initialState;\n error.value = void 0;\n isReady.value = false;\n isLoading.value = true;\n if (delay2 > 0)\n await promiseTimeout(delay2);\n const _promise = typeof promise === \"function\" ? promise(...args) : promise;\n try {\n const data = await _promise;\n state.value = data;\n isReady.value = true;\n onSuccess(data);\n } catch (e) {\n error.value = e;\n onError(e);\n if (throwError)\n throw error;\n } finally {\n isLoading.value = false;\n }\n return state.value;\n }\n if (immediate)\n execute(delay);\n return {\n state,\n isReady,\n isLoading,\n error,\n execute\n };\n}\n\nconst defaults = {\n array: (v) => JSON.stringify(v),\n object: (v) => JSON.stringify(v),\n set: (v) => JSON.stringify(Array.from(v)),\n map: (v) => JSON.stringify(Object.fromEntries(v)),\n null: () => \"\"\n};\nfunction getDefaultSerialization(target) {\n if (!target)\n return defaults.null;\n if (target instanceof Map)\n return defaults.map;\n else if (target instanceof Set)\n return defaults.set;\n else if (Array.isArray(target))\n return defaults.array;\n else\n return defaults.object;\n}\n\nfunction useBase64(target, options) {\n const base64 = ref(\"\");\n const promise = ref();\n function execute() {\n if (!isClient)\n return;\n promise.value = new Promise((resolve, reject) => {\n try {\n const _target = resolveUnref(target);\n if (_target == null) {\n resolve(\"\");\n } else if (typeof _target === \"string\") {\n resolve(blobToBase64(new Blob([_target], { type: \"text/plain\" })));\n } else if (_target instanceof Blob) {\n resolve(blobToBase64(_target));\n } else if (_target instanceof ArrayBuffer) {\n resolve(window.btoa(String.fromCharCode(...new Uint8Array(_target))));\n } else if (_target instanceof HTMLCanvasElement) {\n resolve(_target.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n } else if (_target instanceof HTMLImageElement) {\n const img = _target.cloneNode(false);\n img.crossOrigin = \"Anonymous\";\n imgLoaded(img).then(() => {\n const canvas = document.createElement(\"canvas\");\n const ctx = canvas.getContext(\"2d\");\n canvas.width = img.width;\n canvas.height = img.height;\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n resolve(canvas.toDataURL(options == null ? void 0 : options.type, options == null ? void 0 : options.quality));\n }).catch(reject);\n } else if (typeof _target === \"object\") {\n const _serializeFn = (options == null ? void 0 : options.serializer) || getDefaultSerialization(_target);\n const serialized = _serializeFn(_target);\n return resolve(blobToBase64(new Blob([serialized], { type: \"application/json\" })));\n } else {\n reject(new Error(\"target is unsupported types\"));\n }\n } catch (error) {\n reject(error);\n }\n });\n promise.value.then((res) => base64.value = res);\n return promise.value;\n }\n if (isRef(target) || isFunction(target))\n watch(target, execute, { immediate: true });\n else\n execute();\n return {\n base64,\n promise,\n execute\n };\n}\nfunction imgLoaded(img) {\n return new Promise((resolve, reject) => {\n if (!img.complete) {\n img.onload = () => {\n resolve();\n };\n img.onerror = reject;\n } else {\n resolve();\n }\n });\n}\nfunction blobToBase64(blob) {\n return new Promise((resolve, reject) => {\n const fr = new FileReader();\n fr.onload = (e) => {\n resolve(e.target.result);\n };\n fr.onerror = reject;\n fr.readAsDataURL(blob);\n });\n}\n\nfunction useSupported(callback, sync = false) {\n const isSupported = ref();\n const update = () => isSupported.value = Boolean(callback());\n update();\n tryOnMounted(update, sync);\n return isSupported;\n}\n\nfunction useBattery({ navigator = defaultNavigator } = {}) {\n const events = [\"chargingchange\", \"chargingtimechange\", \"dischargingtimechange\", \"levelchange\"];\n const isSupported = useSupported(() => navigator && \"getBattery\" in navigator);\n const charging = ref(false);\n const chargingTime = ref(0);\n const dischargingTime = ref(0);\n const level = ref(1);\n let battery;\n function updateBatteryInfo() {\n charging.value = this.charging;\n chargingTime.value = this.chargingTime || 0;\n dischargingTime.value = this.dischargingTime || 0;\n level.value = this.level;\n }\n if (isSupported.value) {\n navigator.getBattery().then((_battery) => {\n battery = _battery;\n updateBatteryInfo.call(battery);\n for (const event of events)\n useEventListener(battery, event, updateBatteryInfo, { passive: true });\n });\n }\n return {\n isSupported,\n charging,\n chargingTime,\n dischargingTime,\n level\n };\n}\n\nfunction useBluetooth(options) {\n let {\n acceptAllDevices = false\n } = options || {};\n const {\n filters = void 0,\n optionalServices = void 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => navigator && \"bluetooth\" in navigator);\n const device = shallowRef(void 0);\n const error = shallowRef(null);\n watch(device, () => {\n connectToBluetoothGATTServer();\n });\n async function requestDevice() {\n if (!isSupported.value)\n return;\n error.value = null;\n if (filters && filters.length > 0)\n acceptAllDevices = false;\n try {\n device.value = await (navigator == null ? void 0 : navigator.bluetooth.requestDevice({\n acceptAllDevices,\n filters,\n optionalServices\n }));\n } catch (err) {\n error.value = err;\n }\n }\n const server = ref();\n const isConnected = computed(() => {\n var _a;\n return ((_a = server.value) == null ? void 0 : _a.connected) || false;\n });\n async function connectToBluetoothGATTServer() {\n error.value = null;\n if (device.value && device.value.gatt) {\n device.value.addEventListener(\"gattserverdisconnected\", () => {\n });\n try {\n server.value = await device.value.gatt.connect();\n } catch (err) {\n error.value = err;\n }\n }\n }\n tryOnMounted(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.connect();\n });\n tryOnScopeDispose(() => {\n var _a;\n if (device.value)\n (_a = device.value.gatt) == null ? void 0 : _a.disconnect();\n });\n return {\n isSupported,\n isConnected,\n device,\n requestDevice,\n server,\n error\n };\n}\n\nfunction useMediaQuery(query, options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"matchMedia\" in window && typeof window.matchMedia === \"function\");\n let mediaQuery;\n const matches = ref(false);\n const cleanup = () => {\n if (!mediaQuery)\n return;\n if (\"removeEventListener\" in mediaQuery)\n mediaQuery.removeEventListener(\"change\", update);\n else\n mediaQuery.removeListener(update);\n };\n const update = () => {\n if (!isSupported.value)\n return;\n cleanup();\n mediaQuery = window.matchMedia(resolveRef(query).value);\n matches.value = mediaQuery.matches;\n if (\"addEventListener\" in mediaQuery)\n mediaQuery.addEventListener(\"change\", update);\n else\n mediaQuery.addListener(update);\n };\n watchEffect(update);\n tryOnScopeDispose(() => cleanup());\n return matches;\n}\n\nconst breakpointsTailwind = {\n \"sm\": 640,\n \"md\": 768,\n \"lg\": 1024,\n \"xl\": 1280,\n \"2xl\": 1536\n};\nconst breakpointsBootstrapV5 = {\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1400\n};\nconst breakpointsVuetify = {\n xs: 600,\n sm: 960,\n md: 1264,\n lg: 1904\n};\nconst breakpointsAntDesign = {\n xs: 480,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1600\n};\nconst breakpointsQuasar = {\n xs: 600,\n sm: 1024,\n md: 1440,\n lg: 1920\n};\nconst breakpointsSematic = {\n mobileS: 320,\n mobileM: 375,\n mobileL: 425,\n tablet: 768,\n laptop: 1024,\n laptopL: 1440,\n desktop4K: 2560\n};\nconst breakpointsMasterCss = {\n \"3xs\": 360,\n \"2xs\": 480,\n \"xs\": 600,\n \"sm\": 768,\n \"md\": 1024,\n \"lg\": 1280,\n \"xl\": 1440,\n \"2xl\": 1600,\n \"3xl\": 1920,\n \"4xl\": 2560\n};\n\nvar __defProp$m = Object.defineProperty;\nvar __getOwnPropSymbols$o = Object.getOwnPropertySymbols;\nvar __hasOwnProp$o = Object.prototype.hasOwnProperty;\nvar __propIsEnum$o = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$m = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$o.call(b, prop))\n __defNormalProp$m(a, prop, b[prop]);\n if (__getOwnPropSymbols$o)\n for (var prop of __getOwnPropSymbols$o(b)) {\n if (__propIsEnum$o.call(b, prop))\n __defNormalProp$m(a, prop, b[prop]);\n }\n return a;\n};\nfunction useBreakpoints(breakpoints, options = {}) {\n function getValue(k, delta) {\n let v = breakpoints[k];\n if (delta != null)\n v = increaseWithUnit(v, delta);\n if (typeof v === \"number\")\n v = `${v}px`;\n return v;\n }\n const { window = defaultWindow } = options;\n function match(query) {\n if (!window)\n return false;\n return window.matchMedia(query).matches;\n }\n const greaterOrEqual = (k) => {\n return useMediaQuery(`(min-width: ${getValue(k)})`, options);\n };\n const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {\n Object.defineProperty(shortcuts, k, {\n get: () => greaterOrEqual(k),\n enumerable: true,\n configurable: true\n });\n return shortcuts;\n }, {});\n return __spreadValues$m({\n greater(k) {\n return useMediaQuery(`(min-width: ${getValue(k, 0.1)})`, options);\n },\n greaterOrEqual,\n smaller(k) {\n return useMediaQuery(`(max-width: ${getValue(k, -0.1)})`, options);\n },\n smallerOrEqual(k) {\n return useMediaQuery(`(max-width: ${getValue(k)})`, options);\n },\n between(a, b) {\n return useMediaQuery(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`, options);\n },\n isGreater(k) {\n return match(`(min-width: ${getValue(k, 0.1)})`);\n },\n isGreaterOrEqual(k) {\n return match(`(min-width: ${getValue(k)})`);\n },\n isSmaller(k) {\n return match(`(max-width: ${getValue(k, -0.1)})`);\n },\n isSmallerOrEqual(k) {\n return match(`(max-width: ${getValue(k)})`);\n },\n isInBetween(a, b) {\n return match(`(min-width: ${getValue(a)}) and (max-width: ${getValue(b, -0.1)})`);\n }\n }, shortcutMethods);\n}\n\nconst useBroadcastChannel = (options) => {\n const {\n name,\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"BroadcastChannel\" in window);\n const isClosed = ref(false);\n const channel = ref();\n const data = ref();\n const error = ref(null);\n const post = (data2) => {\n if (channel.value)\n channel.value.postMessage(data2);\n };\n const close = () => {\n if (channel.value)\n channel.value.close();\n isClosed.value = true;\n };\n if (isSupported.value) {\n tryOnMounted(() => {\n error.value = null;\n channel.value = new BroadcastChannel(name);\n channel.value.addEventListener(\"message\", (e) => {\n data.value = e.data;\n }, { passive: true });\n channel.value.addEventListener(\"messageerror\", (e) => {\n error.value = e;\n }, { passive: true });\n channel.value.addEventListener(\"close\", () => {\n isClosed.value = true;\n });\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n isSupported,\n channel,\n data,\n post,\n close,\n error,\n isClosed\n };\n};\n\nfunction useBrowserLocation({ window = defaultWindow } = {}) {\n const buildState = (trigger) => {\n const { state: state2, length } = (window == null ? void 0 : window.history) || {};\n const { hash, host, hostname, href, origin, pathname, port, protocol, search } = (window == null ? void 0 : window.location) || {};\n return {\n trigger,\n state: state2,\n length,\n hash,\n host,\n hostname,\n href,\n origin,\n pathname,\n port,\n protocol,\n search\n };\n };\n const state = ref(buildState(\"load\"));\n if (window) {\n useEventListener(window, \"popstate\", () => state.value = buildState(\"popstate\"), { passive: true });\n useEventListener(window, \"hashchange\", () => state.value = buildState(\"hashchange\"), { passive: true });\n }\n return state;\n}\n\nfunction useCached(refValue, comparator = (a, b) => a === b, watchOptions) {\n const cachedValue = ref(refValue.value);\n watch(() => refValue.value, (value) => {\n if (!comparator(value, cachedValue.value))\n cachedValue.value = value;\n }, watchOptions);\n return cachedValue;\n}\n\nfunction useClipboard(options = {}) {\n const {\n navigator = defaultNavigator,\n read = false,\n source,\n copiedDuring = 1500,\n legacy = false\n } = options;\n const events = [\"copy\", \"cut\"];\n const isClipboardApiSupported = useSupported(() => navigator && \"clipboard\" in navigator);\n const isSupported = computed(() => isClipboardApiSupported.value || legacy);\n const text = ref(\"\");\n const copied = ref(false);\n const timeout = useTimeoutFn(() => copied.value = false, copiedDuring);\n function updateText() {\n if (isClipboardApiSupported.value) {\n navigator.clipboard.readText().then((value) => {\n text.value = value;\n });\n } else {\n text.value = legacyRead();\n }\n }\n if (isSupported.value && read) {\n for (const event of events)\n useEventListener(event, updateText);\n }\n async function copy(value = resolveUnref(source)) {\n if (isSupported.value && value != null) {\n if (isClipboardApiSupported.value)\n await navigator.clipboard.writeText(value);\n else\n legacyCopy(value);\n text.value = value;\n copied.value = true;\n timeout.start();\n }\n }\n function legacyCopy(value) {\n const ta = document.createElement(\"textarea\");\n ta.value = value != null ? value : \"\";\n ta.style.position = \"absolute\";\n ta.style.opacity = \"0\";\n document.body.appendChild(ta);\n ta.select();\n document.execCommand(\"copy\");\n ta.remove();\n }\n function legacyRead() {\n var _a, _b, _c;\n return (_c = (_b = (_a = document == null ? void 0 : document.getSelection) == null ? void 0 : _a.call(document)) == null ? void 0 : _b.toString()) != null ? _c : \"\";\n }\n return {\n isSupported,\n text,\n copied,\n copy\n };\n}\n\nvar __defProp$l = Object.defineProperty;\nvar __defProps$8 = Object.defineProperties;\nvar __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$n = Object.getOwnPropertySymbols;\nvar __hasOwnProp$n = Object.prototype.hasOwnProperty;\nvar __propIsEnum$n = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$l = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$n.call(b, prop))\n __defNormalProp$l(a, prop, b[prop]);\n if (__getOwnPropSymbols$n)\n for (var prop of __getOwnPropSymbols$n(b)) {\n if (__propIsEnum$n.call(b, prop))\n __defNormalProp$l(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));\nfunction cloneFnJSON(source) {\n return JSON.parse(JSON.stringify(source));\n}\nfunction useCloned(source, options = {}) {\n const cloned = ref({});\n const {\n manual,\n clone = cloneFnJSON,\n deep = true,\n immediate = true\n } = options;\n function sync() {\n cloned.value = clone(unref(source));\n }\n if (!manual && isRef(source)) {\n watch(source, sync, __spreadProps$8(__spreadValues$l({}, options), {\n deep,\n immediate\n }));\n } else {\n sync();\n }\n return { cloned, sync };\n}\n\nconst _global = typeof globalThis !== \"undefined\" ? globalThis : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : typeof self !== \"undefined\" ? self : {};\nconst globalKey = \"__vueuse_ssr_handlers__\";\n_global[globalKey] = _global[globalKey] || {};\nconst handlers = _global[globalKey];\nfunction getSSRHandler(key, fallback) {\n return handlers[key] || fallback;\n}\nfunction setSSRHandler(key, fn) {\n handlers[key] = fn;\n}\n\nfunction guessSerializerType(rawInit) {\n return rawInit == null ? \"any\" : rawInit instanceof Set ? \"set\" : rawInit instanceof Map ? \"map\" : rawInit instanceof Date ? \"date\" : typeof rawInit === \"boolean\" ? \"boolean\" : typeof rawInit === \"string\" ? \"string\" : typeof rawInit === \"object\" ? \"object\" : !Number.isNaN(rawInit) ? \"number\" : \"any\";\n}\n\nvar __defProp$k = Object.defineProperty;\nvar __getOwnPropSymbols$m = Object.getOwnPropertySymbols;\nvar __hasOwnProp$m = Object.prototype.hasOwnProperty;\nvar __propIsEnum$m = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$k = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$m.call(b, prop))\n __defNormalProp$k(a, prop, b[prop]);\n if (__getOwnPropSymbols$m)\n for (var prop of __getOwnPropSymbols$m(b)) {\n if (__propIsEnum$m.call(b, prop))\n __defNormalProp$k(a, prop, b[prop]);\n }\n return a;\n};\nconst StorageSerializers = {\n boolean: {\n read: (v) => v === \"true\",\n write: (v) => String(v)\n },\n object: {\n read: (v) => JSON.parse(v),\n write: (v) => JSON.stringify(v)\n },\n number: {\n read: (v) => Number.parseFloat(v),\n write: (v) => String(v)\n },\n any: {\n read: (v) => v,\n write: (v) => String(v)\n },\n string: {\n read: (v) => v,\n write: (v) => String(v)\n },\n map: {\n read: (v) => new Map(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v.entries()))\n },\n set: {\n read: (v) => new Set(JSON.parse(v)),\n write: (v) => JSON.stringify(Array.from(v))\n },\n date: {\n read: (v) => new Date(v),\n write: (v) => v.toISOString()\n }\n};\nconst customStorageEventName = \"vueuse-storage\";\nfunction useStorage(key, defaults, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const data = (shallow ? shallowRef : ref)(defaults);\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n if (!storage)\n return data;\n const rawInit = resolveUnref(defaults);\n const type = guessSerializerType(rawInit);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n const { pause: pauseWatch, resume: resumeWatch } = pausableWatch(data, () => write(data.value), { flush, deep, eventFilter });\n if (window && listenToStorageChanges) {\n useEventListener(window, \"storage\", update);\n useEventListener(window, customStorageEventName, updateFromCustomEvent);\n }\n update();\n return data;\n function write(v) {\n try {\n if (v == null) {\n storage.removeItem(key);\n } else {\n const serialized = serializer.write(v);\n const oldValue = storage.getItem(key);\n if (oldValue !== serialized) {\n storage.setItem(key, serialized);\n if (window) {\n window.dispatchEvent(new CustomEvent(customStorageEventName, {\n detail: {\n key,\n oldValue,\n newValue: serialized,\n storageArea: storage\n }\n }));\n }\n }\n }\n } catch (e) {\n onError(e);\n }\n }\n function read(event) {\n const rawValue = event ? event.newValue : storage.getItem(key);\n if (rawValue == null) {\n if (writeDefaults && rawInit !== null)\n storage.setItem(key, serializer.write(rawInit));\n return rawInit;\n } else if (!event && mergeDefaults) {\n const value = serializer.read(rawValue);\n if (isFunction(mergeDefaults))\n return mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n return __spreadValues$k(__spreadValues$k({}, rawInit), value);\n return value;\n } else if (typeof rawValue !== \"string\") {\n return rawValue;\n } else {\n return serializer.read(rawValue);\n }\n }\n function updateFromCustomEvent(event) {\n update(event.detail);\n }\n function update(event) {\n if (event && event.storageArea !== storage)\n return;\n if (event && event.key == null) {\n data.value = rawInit;\n return;\n }\n if (event && event.key !== key)\n return;\n pauseWatch();\n try {\n data.value = read(event);\n } catch (e) {\n onError(e);\n } finally {\n if (event)\n nextTick(resumeWatch);\n else\n resumeWatch();\n }\n }\n}\n\nfunction usePreferredDark(options) {\n return useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n}\n\nvar __defProp$j = Object.defineProperty;\nvar __getOwnPropSymbols$l = Object.getOwnPropertySymbols;\nvar __hasOwnProp$l = Object.prototype.hasOwnProperty;\nvar __propIsEnum$l = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$j = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$l.call(b, prop))\n __defNormalProp$j(a, prop, b[prop]);\n if (__getOwnPropSymbols$l)\n for (var prop of __getOwnPropSymbols$l(b)) {\n if (__propIsEnum$l.call(b, prop))\n __defNormalProp$j(a, prop, b[prop]);\n }\n return a;\n};\nfunction useColorMode(options = {}) {\n const {\n selector = \"html\",\n attribute = \"class\",\n initialValue = \"auto\",\n window = defaultWindow,\n storage,\n storageKey = \"vueuse-color-scheme\",\n listenToStorageChanges = true,\n storageRef,\n emitAuto\n } = options;\n const modes = __spreadValues$j({\n auto: \"\",\n light: \"light\",\n dark: \"dark\"\n }, options.modes || {});\n const preferredDark = usePreferredDark({ window });\n const preferredMode = computed(() => preferredDark.value ? \"dark\" : \"light\");\n const store = storageRef || (storageKey == null ? ref(initialValue) : useStorage(storageKey, initialValue, storage, { window, listenToStorageChanges }));\n const state = computed({\n get() {\n return store.value === \"auto\" && !emitAuto ? preferredMode.value : store.value;\n },\n set(v) {\n store.value = v;\n }\n });\n const updateHTMLAttrs = getSSRHandler(\"updateHTMLAttrs\", (selector2, attribute2, value) => {\n const el = window == null ? void 0 : window.document.querySelector(selector2);\n if (!el)\n return;\n if (attribute2 === \"class\") {\n const current = value.split(/\\s/g);\n Object.values(modes).flatMap((i) => (i || \"\").split(/\\s/g)).filter(Boolean).forEach((v) => {\n if (current.includes(v))\n el.classList.add(v);\n else\n el.classList.remove(v);\n });\n } else {\n el.setAttribute(attribute2, value);\n }\n });\n function defaultOnChanged(mode) {\n var _a;\n const resolvedMode = mode === \"auto\" ? preferredMode.value : mode;\n updateHTMLAttrs(selector, attribute, (_a = modes[resolvedMode]) != null ? _a : resolvedMode);\n }\n function onChanged(mode) {\n if (options.onChanged)\n options.onChanged(mode, defaultOnChanged);\n else\n defaultOnChanged(mode);\n }\n watch(state, onChanged, { flush: \"post\", immediate: true });\n if (emitAuto)\n watch(preferredMode, () => onChanged(state.value), { flush: \"post\" });\n tryOnMounted(() => onChanged(state.value));\n return state;\n}\n\nfunction useConfirmDialog(revealed = ref(false)) {\n const confirmHook = createEventHook();\n const cancelHook = createEventHook();\n const revealHook = createEventHook();\n let _resolve = noop;\n const reveal = (data) => {\n revealHook.trigger(data);\n revealed.value = true;\n return new Promise((resolve) => {\n _resolve = resolve;\n });\n };\n const confirm = (data) => {\n revealed.value = false;\n confirmHook.trigger(data);\n _resolve({ data, isCanceled: false });\n };\n const cancel = (data) => {\n revealed.value = false;\n cancelHook.trigger(data);\n _resolve({ data, isCanceled: true });\n };\n return {\n isRevealed: computed(() => revealed.value),\n reveal,\n confirm,\n cancel,\n onReveal: revealHook.on,\n onConfirm: confirmHook.on,\n onCancel: cancelHook.on\n };\n}\n\nfunction useCssVar(prop, target, { window = defaultWindow, initialValue = \"\" } = {}) {\n const variable = ref(initialValue);\n const elRef = computed(() => {\n var _a;\n return unrefElement(target) || ((_a = window == null ? void 0 : window.document) == null ? void 0 : _a.documentElement);\n });\n watch([elRef, () => resolveUnref(prop)], ([el, prop2]) => {\n var _a;\n if (el && window) {\n const value = (_a = window.getComputedStyle(el).getPropertyValue(prop2)) == null ? void 0 : _a.trim();\n variable.value = value || initialValue;\n }\n }, { immediate: true });\n watch(variable, (val) => {\n var _a;\n if ((_a = elRef.value) == null ? void 0 : _a.style)\n elRef.value.style.setProperty(resolveUnref(prop), val);\n });\n return variable;\n}\n\nfunction useCurrentElement() {\n const vm = getCurrentInstance();\n const currentElement = computedWithControl(() => null, () => vm.proxy.$el);\n onUpdated(currentElement.trigger);\n onMounted(currentElement.trigger);\n return currentElement;\n}\n\nfunction useCycleList(list, options) {\n var _a;\n const state = shallowRef((_a = options == null ? void 0 : options.initialValue) != null ? _a : list[0]);\n const index = computed({\n get() {\n var _a2;\n let index2 = (options == null ? void 0 : options.getIndexOf) ? options.getIndexOf(state.value, list) : list.indexOf(state.value);\n if (index2 < 0)\n index2 = (_a2 = options == null ? void 0 : options.fallbackIndex) != null ? _a2 : 0;\n return index2;\n },\n set(v) {\n set(v);\n }\n });\n function set(i) {\n const length = list.length;\n const index2 = (i % length + length) % length;\n const value = list[index2];\n state.value = value;\n return value;\n }\n function shift(delta = 1) {\n return set(index.value + delta);\n }\n function next(n = 1) {\n return shift(n);\n }\n function prev(n = 1) {\n return shift(-n);\n }\n return {\n state,\n index,\n next,\n prev\n };\n}\n\nvar __defProp$i = Object.defineProperty;\nvar __defProps$7 = Object.defineProperties;\nvar __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$k = Object.getOwnPropertySymbols;\nvar __hasOwnProp$k = Object.prototype.hasOwnProperty;\nvar __propIsEnum$k = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$i = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$k.call(b, prop))\n __defNormalProp$i(a, prop, b[prop]);\n if (__getOwnPropSymbols$k)\n for (var prop of __getOwnPropSymbols$k(b)) {\n if (__propIsEnum$k.call(b, prop))\n __defNormalProp$i(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));\nfunction useDark(options = {}) {\n const {\n valueDark = \"dark\",\n valueLight = \"\",\n window = defaultWindow\n } = options;\n const mode = useColorMode(__spreadProps$7(__spreadValues$i({}, options), {\n onChanged: (mode2, defaultHandler) => {\n var _a;\n if (options.onChanged)\n (_a = options.onChanged) == null ? void 0 : _a.call(options, mode2 === \"dark\");\n else\n defaultHandler(mode2);\n },\n modes: {\n dark: valueDark,\n light: valueLight\n }\n }));\n const preferredDark = usePreferredDark({ window });\n const isDark = computed({\n get() {\n return mode.value === \"dark\";\n },\n set(v) {\n if (v === preferredDark.value)\n mode.value = \"auto\";\n else\n mode.value = v ? \"dark\" : \"light\";\n }\n });\n return isDark;\n}\n\nconst fnBypass = (v) => v;\nconst fnSetSource = (source, value) => source.value = value;\nfunction defaultDump(clone) {\n return clone ? isFunction(clone) ? clone : cloneFnJSON : fnBypass;\n}\nfunction defaultParse(clone) {\n return clone ? isFunction(clone) ? clone : cloneFnJSON : fnBypass;\n}\nfunction useManualRefHistory(source, options = {}) {\n const {\n clone = false,\n dump = defaultDump(clone),\n parse = defaultParse(clone),\n setSource = fnSetSource\n } = options;\n function _createHistoryRecord() {\n return markRaw({\n snapshot: dump(source.value),\n timestamp: timestamp()\n });\n }\n const last = ref(_createHistoryRecord());\n const undoStack = ref([]);\n const redoStack = ref([]);\n const _setSource = (record) => {\n setSource(source, parse(record.snapshot));\n last.value = record;\n };\n const commit = () => {\n undoStack.value.unshift(last.value);\n last.value = _createHistoryRecord();\n if (options.capacity && undoStack.value.length > options.capacity)\n undoStack.value.splice(options.capacity, Infinity);\n if (redoStack.value.length)\n redoStack.value.splice(0, redoStack.value.length);\n };\n const clear = () => {\n undoStack.value.splice(0, undoStack.value.length);\n redoStack.value.splice(0, redoStack.value.length);\n };\n const undo = () => {\n const state = undoStack.value.shift();\n if (state) {\n redoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const redo = () => {\n const state = redoStack.value.shift();\n if (state) {\n undoStack.value.unshift(last.value);\n _setSource(state);\n }\n };\n const reset = () => {\n _setSource(last.value);\n };\n const history = computed(() => [last.value, ...undoStack.value]);\n const canUndo = computed(() => undoStack.value.length > 0);\n const canRedo = computed(() => redoStack.value.length > 0);\n return {\n source,\n undoStack,\n redoStack,\n last,\n history,\n canUndo,\n canRedo,\n clear,\n commit,\n reset,\n undo,\n redo\n };\n}\n\nvar __defProp$h = Object.defineProperty;\nvar __defProps$6 = Object.defineProperties;\nvar __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$j = Object.getOwnPropertySymbols;\nvar __hasOwnProp$j = Object.prototype.hasOwnProperty;\nvar __propIsEnum$j = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$h = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$j.call(b, prop))\n __defNormalProp$h(a, prop, b[prop]);\n if (__getOwnPropSymbols$j)\n for (var prop of __getOwnPropSymbols$j(b)) {\n if (__propIsEnum$j.call(b, prop))\n __defNormalProp$h(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));\nfunction useRefHistory(source, options = {}) {\n const {\n deep = false,\n flush = \"pre\",\n eventFilter\n } = options;\n const {\n eventFilter: composedFilter,\n pause,\n resume: resumeTracking,\n isActive: isTracking\n } = pausableFilter(eventFilter);\n const {\n ignoreUpdates,\n ignorePrevAsyncUpdates,\n stop\n } = watchIgnorable(source, commit, { deep, flush, eventFilter: composedFilter });\n function setSource(source2, value) {\n ignorePrevAsyncUpdates();\n ignoreUpdates(() => {\n source2.value = value;\n });\n }\n const manualHistory = useManualRefHistory(source, __spreadProps$6(__spreadValues$h({}, options), { clone: options.clone || deep, setSource }));\n const { clear, commit: manualCommit } = manualHistory;\n function commit() {\n ignorePrevAsyncUpdates();\n manualCommit();\n }\n function resume(commitNow) {\n resumeTracking();\n if (commitNow)\n commit();\n }\n function batch(fn) {\n let canceled = false;\n const cancel = () => canceled = true;\n ignoreUpdates(() => {\n fn(cancel);\n });\n if (!canceled)\n commit();\n }\n function dispose() {\n stop();\n clear();\n }\n return __spreadProps$6(__spreadValues$h({}, manualHistory), {\n isTracking,\n pause,\n resume,\n commit,\n batch,\n dispose\n });\n}\n\nvar __defProp$g = Object.defineProperty;\nvar __defProps$5 = Object.defineProperties;\nvar __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$i = Object.getOwnPropertySymbols;\nvar __hasOwnProp$i = Object.prototype.hasOwnProperty;\nvar __propIsEnum$i = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$g = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$i.call(b, prop))\n __defNormalProp$g(a, prop, b[prop]);\n if (__getOwnPropSymbols$i)\n for (var prop of __getOwnPropSymbols$i(b)) {\n if (__propIsEnum$i.call(b, prop))\n __defNormalProp$g(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));\nfunction useDebouncedRefHistory(source, options = {}) {\n const filter = options.debounce ? debounceFilter(options.debounce) : void 0;\n const history = useRefHistory(source, __spreadProps$5(__spreadValues$g({}, options), { eventFilter: filter }));\n return __spreadValues$g({}, history);\n}\n\nfunction useDeviceMotion(options = {}) {\n const {\n window = defaultWindow,\n eventFilter = bypassFilter\n } = options;\n const acceleration = ref({ x: null, y: null, z: null });\n const rotationRate = ref({ alpha: null, beta: null, gamma: null });\n const interval = ref(0);\n const accelerationIncludingGravity = ref({\n x: null,\n y: null,\n z: null\n });\n if (window) {\n const onDeviceMotion = createFilterWrapper(eventFilter, (event) => {\n acceleration.value = event.acceleration;\n accelerationIncludingGravity.value = event.accelerationIncludingGravity;\n rotationRate.value = event.rotationRate;\n interval.value = event.interval;\n });\n useEventListener(window, \"devicemotion\", onDeviceMotion);\n }\n return {\n acceleration,\n accelerationIncludingGravity,\n rotationRate,\n interval\n };\n}\n\nfunction useDeviceOrientation(options = {}) {\n const { window = defaultWindow } = options;\n const isSupported = useSupported(() => window && \"DeviceOrientationEvent\" in window);\n const isAbsolute = ref(false);\n const alpha = ref(null);\n const beta = ref(null);\n const gamma = ref(null);\n if (window && isSupported.value) {\n useEventListener(window, \"deviceorientation\", (event) => {\n isAbsolute.value = event.absolute;\n alpha.value = event.alpha;\n beta.value = event.beta;\n gamma.value = event.gamma;\n });\n }\n return {\n isSupported,\n isAbsolute,\n alpha,\n beta,\n gamma\n };\n}\n\nfunction useDevicePixelRatio({\n window = defaultWindow\n} = {}) {\n const pixelRatio = ref(1);\n if (window) {\n let observe = function() {\n pixelRatio.value = window.devicePixelRatio;\n cleanup();\n media = window.matchMedia(`(resolution: ${pixelRatio.value}dppx)`);\n media.addEventListener(\"change\", observe, { once: true });\n }, cleanup = function() {\n media == null ? void 0 : media.removeEventListener(\"change\", observe);\n };\n let media;\n observe();\n tryOnScopeDispose(cleanup);\n }\n return { pixelRatio };\n}\n\nfunction usePermission(permissionDesc, options = {}) {\n const {\n controls = false,\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"permissions\" in navigator);\n let permissionStatus;\n const desc = typeof permissionDesc === \"string\" ? { name: permissionDesc } : permissionDesc;\n const state = ref();\n const onChange = () => {\n if (permissionStatus)\n state.value = permissionStatus.state;\n };\n const query = createSingletonPromise(async () => {\n if (!isSupported.value)\n return;\n if (!permissionStatus) {\n try {\n permissionStatus = await navigator.permissions.query(desc);\n useEventListener(permissionStatus, \"change\", onChange);\n onChange();\n } catch (e) {\n state.value = \"prompt\";\n }\n }\n return permissionStatus;\n });\n query();\n if (controls) {\n return {\n state,\n isSupported,\n query\n };\n } else {\n return state;\n }\n}\n\nfunction useDevicesList(options = {}) {\n const {\n navigator = defaultNavigator,\n requestPermissions = false,\n constraints = { audio: true, video: true },\n onUpdated\n } = options;\n const devices = ref([]);\n const videoInputs = computed(() => devices.value.filter((i) => i.kind === \"videoinput\"));\n const audioInputs = computed(() => devices.value.filter((i) => i.kind === \"audioinput\"));\n const audioOutputs = computed(() => devices.value.filter((i) => i.kind === \"audiooutput\"));\n const isSupported = useSupported(() => navigator && navigator.mediaDevices && navigator.mediaDevices.enumerateDevices);\n const permissionGranted = ref(false);\n async function update() {\n if (!isSupported.value)\n return;\n devices.value = await navigator.mediaDevices.enumerateDevices();\n onUpdated == null ? void 0 : onUpdated(devices.value);\n }\n async function ensurePermissions() {\n if (!isSupported.value)\n return false;\n if (permissionGranted.value)\n return true;\n const { state, query } = usePermission(\"camera\", { controls: true });\n await query();\n if (state.value !== \"granted\") {\n const stream = await navigator.mediaDevices.getUserMedia(constraints);\n stream.getTracks().forEach((t) => t.stop());\n update();\n permissionGranted.value = true;\n } else {\n permissionGranted.value = true;\n }\n return permissionGranted.value;\n }\n if (isSupported.value) {\n if (requestPermissions)\n ensurePermissions();\n useEventListener(navigator.mediaDevices, \"devicechange\", update);\n update();\n }\n return {\n devices,\n ensurePermissions,\n permissionGranted,\n videoInputs,\n audioInputs,\n audioOutputs,\n isSupported\n };\n}\n\nfunction useDisplayMedia(options = {}) {\n var _a;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const video = options.video;\n const audio = options.audio;\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getDisplayMedia;\n });\n const constraint = { audio, video };\n const stream = shallowRef();\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getDisplayMedia(constraint);\n return stream.value;\n }\n async function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n watch(enabled, (v) => {\n if (v)\n _start();\n else\n _stop();\n }, { immediate: true });\n return {\n isSupported,\n stream,\n start,\n stop,\n enabled\n };\n}\n\nfunction useDocumentVisibility({ document = defaultDocument } = {}) {\n if (!document)\n return ref(\"visible\");\n const visibility = ref(document.visibilityState);\n useEventListener(document, \"visibilitychange\", () => {\n visibility.value = document.visibilityState;\n });\n return visibility;\n}\n\nvar __defProp$f = Object.defineProperty;\nvar __defProps$4 = Object.defineProperties;\nvar __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$h = Object.getOwnPropertySymbols;\nvar __hasOwnProp$h = Object.prototype.hasOwnProperty;\nvar __propIsEnum$h = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$f = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$h.call(b, prop))\n __defNormalProp$f(a, prop, b[prop]);\n if (__getOwnPropSymbols$h)\n for (var prop of __getOwnPropSymbols$h(b)) {\n if (__propIsEnum$h.call(b, prop))\n __defNormalProp$f(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));\nfunction useDraggable(target, options = {}) {\n var _a, _b, _c;\n const draggingElement = (_a = options.draggingElement) != null ? _a : defaultWindow;\n const draggingHandle = (_b = options.handle) != null ? _b : target;\n const position = ref((_c = resolveUnref(options.initialValue)) != null ? _c : { x: 0, y: 0 });\n const pressedDelta = ref();\n const filterEvent = (e) => {\n if (options.pointerTypes)\n return options.pointerTypes.includes(e.pointerType);\n return true;\n };\n const handleEvent = (e) => {\n if (resolveUnref(options.preventDefault))\n e.preventDefault();\n if (resolveUnref(options.stopPropagation))\n e.stopPropagation();\n };\n const start = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (resolveUnref(options.exact) && e.target !== resolveUnref(target))\n return;\n const rect = resolveUnref(target).getBoundingClientRect();\n const pos = {\n x: e.clientX - rect.left,\n y: e.clientY - rect.top\n };\n if (((_a2 = options.onStart) == null ? void 0 : _a2.call(options, pos, e)) === false)\n return;\n pressedDelta.value = pos;\n handleEvent(e);\n };\n const move = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n position.value = {\n x: e.clientX - pressedDelta.value.x,\n y: e.clientY - pressedDelta.value.y\n };\n (_a2 = options.onMove) == null ? void 0 : _a2.call(options, position.value, e);\n handleEvent(e);\n };\n const end = (e) => {\n var _a2;\n if (!filterEvent(e))\n return;\n if (!pressedDelta.value)\n return;\n pressedDelta.value = void 0;\n (_a2 = options.onEnd) == null ? void 0 : _a2.call(options, position.value, e);\n handleEvent(e);\n };\n if (isClient) {\n useEventListener(draggingHandle, \"pointerdown\", start, true);\n useEventListener(draggingElement, \"pointermove\", move, true);\n useEventListener(draggingElement, \"pointerup\", end, true);\n }\n return __spreadProps$4(__spreadValues$f({}, toRefs(position)), {\n position,\n isDragging: computed(() => !!pressedDelta.value),\n style: computed(() => `left:${position.value.x}px;top:${position.value.y}px;`)\n });\n}\n\nfunction useDropZone(target, onDrop) {\n const isOverDropZone = ref(false);\n let counter = 0;\n if (isClient) {\n useEventListener(target, \"dragenter\", (event) => {\n event.preventDefault();\n counter += 1;\n isOverDropZone.value = true;\n });\n useEventListener(target, \"dragover\", (event) => {\n event.preventDefault();\n });\n useEventListener(target, \"dragleave\", (event) => {\n event.preventDefault();\n counter -= 1;\n if (counter === 0)\n isOverDropZone.value = false;\n });\n useEventListener(target, \"drop\", (event) => {\n var _a, _b;\n event.preventDefault();\n counter = 0;\n isOverDropZone.value = false;\n const files = Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);\n onDrop == null ? void 0 : onDrop(files.length === 0 ? null : files);\n });\n }\n return {\n isOverDropZone\n };\n}\n\nvar __getOwnPropSymbols$g = Object.getOwnPropertySymbols;\nvar __hasOwnProp$g = Object.prototype.hasOwnProperty;\nvar __propIsEnum$g = Object.prototype.propertyIsEnumerable;\nvar __objRest$2 = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp$g.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols$g)\n for (var prop of __getOwnPropSymbols$g(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum$g.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction useResizeObserver(target, callback, options = {}) {\n const _a = options, { window = defaultWindow } = _a, observerOptions = __objRest$2(_a, [\"window\"]);\n let observer;\n const isSupported = useSupported(() => window && \"ResizeObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const stopWatch = watch(() => unrefElement(target), (el) => {\n cleanup();\n if (isSupported.value && window && el) {\n observer = new ResizeObserver(callback);\n observer.observe(el, observerOptions);\n }\n }, { immediate: true, flush: \"post\" });\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nfunction useElementBounding(target, options = {}) {\n const {\n reset = true,\n windowResize = true,\n windowScroll = true,\n immediate = true\n } = options;\n const height = ref(0);\n const bottom = ref(0);\n const left = ref(0);\n const right = ref(0);\n const top = ref(0);\n const width = ref(0);\n const x = ref(0);\n const y = ref(0);\n function update() {\n const el = unrefElement(target);\n if (!el) {\n if (reset) {\n height.value = 0;\n bottom.value = 0;\n left.value = 0;\n right.value = 0;\n top.value = 0;\n width.value = 0;\n x.value = 0;\n y.value = 0;\n }\n return;\n }\n const rect = el.getBoundingClientRect();\n height.value = rect.height;\n bottom.value = rect.bottom;\n left.value = rect.left;\n right.value = rect.right;\n top.value = rect.top;\n width.value = rect.width;\n x.value = rect.x;\n y.value = rect.y;\n }\n useResizeObserver(target, update);\n watch(() => unrefElement(target), (ele) => !ele && update());\n if (windowScroll)\n useEventListener(\"scroll\", update, { capture: true, passive: true });\n if (windowResize)\n useEventListener(\"resize\", update, { passive: true });\n tryOnMounted(() => {\n if (immediate)\n update();\n });\n return {\n height,\n bottom,\n left,\n right,\n top,\n width,\n x,\n y,\n update\n };\n}\n\nfunction useRafFn(fn, options = {}) {\n const {\n immediate = true,\n window = defaultWindow\n } = options;\n const isActive = ref(false);\n let previousFrameTimestamp = 0;\n let rafId = null;\n function loop(timestamp) {\n if (!isActive.value || !window)\n return;\n const delta = timestamp - previousFrameTimestamp;\n fn({ delta, timestamp });\n previousFrameTimestamp = timestamp;\n rafId = window.requestAnimationFrame(loop);\n }\n function resume() {\n if (!isActive.value && window) {\n isActive.value = true;\n rafId = window.requestAnimationFrame(loop);\n }\n }\n function pause() {\n isActive.value = false;\n if (rafId != null && window) {\n window.cancelAnimationFrame(rafId);\n rafId = null;\n }\n }\n if (immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive: readonly(isActive),\n pause,\n resume\n };\n}\n\nvar __defProp$e = Object.defineProperty;\nvar __getOwnPropSymbols$f = Object.getOwnPropertySymbols;\nvar __hasOwnProp$f = Object.prototype.hasOwnProperty;\nvar __propIsEnum$f = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$e = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$f.call(b, prop))\n __defNormalProp$e(a, prop, b[prop]);\n if (__getOwnPropSymbols$f)\n for (var prop of __getOwnPropSymbols$f(b)) {\n if (__propIsEnum$f.call(b, prop))\n __defNormalProp$e(a, prop, b[prop]);\n }\n return a;\n};\nfunction useElementByPoint(options) {\n const element = ref(null);\n const { x, y, document = defaultDocument } = options;\n const controls = useRafFn(() => {\n element.value = (document == null ? void 0 : document.elementFromPoint(resolveUnref(x), resolveUnref(y))) || null;\n });\n return __spreadValues$e({\n element\n }, controls);\n}\n\nfunction useElementHover(el, options = {}) {\n const delayEnter = options ? options.delayEnter : 0;\n const delayLeave = options ? options.delayLeave : 0;\n const isHovered = ref(false);\n let timer;\n const toggle = (entering) => {\n const delay = entering ? delayEnter : delayLeave;\n if (timer) {\n clearTimeout(timer);\n timer = void 0;\n }\n if (delay)\n timer = setTimeout(() => isHovered.value = entering, delay);\n else\n isHovered.value = entering;\n };\n if (!window)\n return isHovered;\n useEventListener(el, \"mouseenter\", () => toggle(true), { passive: true });\n useEventListener(el, \"mouseleave\", () => toggle(false), { passive: true });\n return isHovered;\n}\n\nfunction useElementSize(target, initialSize = { width: 0, height: 0 }, options = {}) {\n const { window = defaultWindow, box = \"content-box\" } = options;\n const isSVG = computed(() => {\n var _a, _b;\n return (_b = (_a = unrefElement(target)) == null ? void 0 : _a.namespaceURI) == null ? void 0 : _b.includes(\"svg\");\n });\n const width = ref(initialSize.width);\n const height = ref(initialSize.height);\n useResizeObserver(target, ([entry]) => {\n const boxSize = box === \"border-box\" ? entry.borderBoxSize : box === \"content-box\" ? entry.contentBoxSize : entry.devicePixelContentBoxSize;\n if (window && isSVG.value) {\n const $elem = unrefElement(target);\n if ($elem) {\n const styles = window.getComputedStyle($elem);\n width.value = parseFloat(styles.width);\n height.value = parseFloat(styles.height);\n }\n } else {\n if (boxSize) {\n const formatBoxSize = Array.isArray(boxSize) ? boxSize : [boxSize];\n width.value = formatBoxSize.reduce((acc, { inlineSize }) => acc + inlineSize, 0);\n height.value = formatBoxSize.reduce((acc, { blockSize }) => acc + blockSize, 0);\n } else {\n width.value = entry.contentRect.width;\n height.value = entry.contentRect.height;\n }\n }\n }, options);\n watch(() => unrefElement(target), (ele) => {\n width.value = ele ? initialSize.width : 0;\n height.value = ele ? initialSize.height : 0;\n });\n return {\n width,\n height\n };\n}\n\nfunction useElementVisibility(element, { window = defaultWindow, scrollTarget } = {}) {\n const elementIsVisible = ref(false);\n const testBounding = () => {\n if (!window)\n return;\n const document = window.document;\n const el = unrefElement(element);\n if (!el) {\n elementIsVisible.value = false;\n } else {\n const rect = el.getBoundingClientRect();\n elementIsVisible.value = rect.top <= (window.innerHeight || document.documentElement.clientHeight) && rect.left <= (window.innerWidth || document.documentElement.clientWidth) && rect.bottom >= 0 && rect.right >= 0;\n }\n };\n watch(() => unrefElement(element), () => testBounding(), { immediate: true, flush: \"post\" });\n if (window) {\n useEventListener(scrollTarget || window, \"scroll\", testBounding, {\n capture: false,\n passive: true\n });\n }\n return elementIsVisible;\n}\n\nconst events = new Map();\n\nfunction useEventBus(key) {\n const scope = getCurrentScope();\n function on(listener) {\n var _a;\n const listeners = events.get(key) || [];\n listeners.push(listener);\n events.set(key, listeners);\n const _off = () => off(listener);\n (_a = scope == null ? void 0 : scope.cleanups) == null ? void 0 : _a.push(_off);\n return _off;\n }\n function once(listener) {\n function _listener(...args) {\n off(_listener);\n listener(...args);\n }\n return on(_listener);\n }\n function off(listener) {\n const listeners = events.get(key);\n if (!listeners)\n return;\n const index = listeners.indexOf(listener);\n if (index > -1)\n listeners.splice(index, 1);\n if (!listeners.length)\n events.delete(key);\n }\n function reset() {\n events.delete(key);\n }\n function emit(event, payload) {\n var _a;\n (_a = events.get(key)) == null ? void 0 : _a.forEach((v) => v(event, payload));\n }\n return { on, once, off, emit, reset };\n}\n\nfunction useEventSource(url, events = [], options = {}) {\n const event = ref(null);\n const data = ref(null);\n const status = ref(\"CONNECTING\");\n const eventSource = ref(null);\n const error = ref(null);\n const {\n withCredentials = false\n } = options;\n const close = () => {\n if (eventSource.value) {\n eventSource.value.close();\n eventSource.value = null;\n status.value = \"CLOSED\";\n }\n };\n const es = new EventSource(url, { withCredentials });\n eventSource.value = es;\n es.onopen = () => {\n status.value = \"OPEN\";\n error.value = null;\n };\n es.onerror = (e) => {\n status.value = \"CLOSED\";\n error.value = e;\n };\n es.onmessage = (e) => {\n event.value = null;\n data.value = e.data;\n };\n for (const event_name of events) {\n useEventListener(es, event_name, (e) => {\n event.value = event_name;\n data.value = e.data || null;\n });\n }\n tryOnScopeDispose(() => {\n close();\n });\n return {\n eventSource,\n event,\n data,\n status,\n error,\n close\n };\n}\n\nfunction useEyeDropper(options = {}) {\n const { initialValue = \"\" } = options;\n const isSupported = useSupported(() => typeof window !== \"undefined\" && \"EyeDropper\" in window);\n const sRGBHex = ref(initialValue);\n async function open(openOptions) {\n if (!isSupported.value)\n return;\n const eyeDropper = new window.EyeDropper();\n const result = await eyeDropper.open(openOptions);\n sRGBHex.value = result.sRGBHex;\n return result;\n }\n return { isSupported, sRGBHex, open };\n}\n\nfunction useFavicon(newIcon = null, options = {}) {\n const {\n baseUrl = \"\",\n rel = \"icon\",\n document = defaultDocument\n } = options;\n const favicon = resolveRef(newIcon);\n const applyIcon = (icon) => {\n document == null ? void 0 : document.head.querySelectorAll(`link[rel*=\"${rel}\"]`).forEach((el) => el.href = `${baseUrl}${icon}`);\n };\n watch(favicon, (i, o) => {\n if (isString(i) && i !== o)\n applyIcon(i);\n }, { immediate: true });\n return favicon;\n}\n\nvar __defProp$d = Object.defineProperty;\nvar __defProps$3 = Object.defineProperties;\nvar __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$e = Object.getOwnPropertySymbols;\nvar __hasOwnProp$e = Object.prototype.hasOwnProperty;\nvar __propIsEnum$e = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$d = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$e.call(b, prop))\n __defNormalProp$d(a, prop, b[prop]);\n if (__getOwnPropSymbols$e)\n for (var prop of __getOwnPropSymbols$e(b)) {\n if (__propIsEnum$e.call(b, prop))\n __defNormalProp$d(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));\nconst payloadMapping = {\n json: \"application/json\",\n text: \"text/plain\"\n};\nfunction isFetchOptions(obj) {\n return obj && containsProp(obj, \"immediate\", \"refetch\", \"initialData\", \"timeout\", \"beforeFetch\", \"afterFetch\", \"onFetchError\", \"fetch\");\n}\nfunction isAbsoluteURL(url) {\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\nfunction headersToObject(headers) {\n if (typeof Headers !== \"undefined\" && headers instanceof Headers)\n return Object.fromEntries([...headers.entries()]);\n return headers;\n}\nfunction combineCallbacks(combination, ...callbacks) {\n if (combination === \"overwrite\") {\n return async (ctx) => {\n const callback = callbacks[callbacks.length - 1];\n if (callback !== void 0)\n await callback(ctx);\n return ctx;\n };\n } else {\n return async (ctx) => {\n await callbacks.reduce((prevCallback, callback) => prevCallback.then(async () => {\n if (callback)\n ctx = __spreadValues$d(__spreadValues$d({}, ctx), await callback(ctx));\n }), Promise.resolve());\n return ctx;\n };\n }\n}\nfunction createFetch(config = {}) {\n const _combination = config.combination || \"chain\";\n const _options = config.options || {};\n const _fetchOptions = config.fetchOptions || {};\n function useFactoryFetch(url, ...args) {\n const computedUrl = computed(() => {\n const baseUrl = resolveUnref(config.baseUrl);\n const targetUrl = resolveUnref(url);\n return baseUrl && !isAbsoluteURL(targetUrl) ? joinPaths(baseUrl, targetUrl) : targetUrl;\n });\n let options = _options;\n let fetchOptions = _fetchOptions;\n if (args.length > 0) {\n if (isFetchOptions(args[0])) {\n options = __spreadProps$3(__spreadValues$d(__spreadValues$d({}, options), args[0]), {\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[0].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[0].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[0].onFetchError)\n });\n } else {\n fetchOptions = __spreadProps$3(__spreadValues$d(__spreadValues$d({}, fetchOptions), args[0]), {\n headers: __spreadValues$d(__spreadValues$d({}, headersToObject(fetchOptions.headers) || {}), headersToObject(args[0].headers) || {})\n });\n }\n }\n if (args.length > 1 && isFetchOptions(args[1])) {\n options = __spreadProps$3(__spreadValues$d(__spreadValues$d({}, options), args[1]), {\n beforeFetch: combineCallbacks(_combination, _options.beforeFetch, args[1].beforeFetch),\n afterFetch: combineCallbacks(_combination, _options.afterFetch, args[1].afterFetch),\n onFetchError: combineCallbacks(_combination, _options.onFetchError, args[1].onFetchError)\n });\n }\n return useFetch(computedUrl, fetchOptions, options);\n }\n return useFactoryFetch;\n}\nfunction useFetch(url, ...args) {\n var _a;\n const supportsAbort = typeof AbortController === \"function\";\n let fetchOptions = {};\n let options = { immediate: true, refetch: false, timeout: 0 };\n const config = {\n method: \"GET\",\n type: \"text\",\n payload: void 0\n };\n if (args.length > 0) {\n if (isFetchOptions(args[0]))\n options = __spreadValues$d(__spreadValues$d({}, options), args[0]);\n else\n fetchOptions = args[0];\n }\n if (args.length > 1) {\n if (isFetchOptions(args[1]))\n options = __spreadValues$d(__spreadValues$d({}, options), args[1]);\n }\n const {\n fetch = (_a = defaultWindow) == null ? void 0 : _a.fetch,\n initialData,\n timeout\n } = options;\n const responseEvent = createEventHook();\n const errorEvent = createEventHook();\n const finallyEvent = createEventHook();\n const isFinished = ref(false);\n const isFetching = ref(false);\n const aborted = ref(false);\n const statusCode = ref(null);\n const response = shallowRef(null);\n const error = shallowRef(null);\n const data = shallowRef(initialData);\n const canAbort = computed(() => supportsAbort && isFetching.value);\n let controller;\n let timer;\n const abort = () => {\n if (supportsAbort && controller) {\n controller.abort();\n controller = void 0;\n }\n };\n const loading = (isLoading) => {\n isFetching.value = isLoading;\n isFinished.value = !isLoading;\n };\n if (timeout)\n timer = useTimeoutFn(abort, timeout, { immediate: false });\n const execute = async (throwOnFailed = false) => {\n var _a2;\n loading(true);\n error.value = null;\n statusCode.value = null;\n aborted.value = false;\n if (supportsAbort) {\n abort();\n controller = new AbortController();\n controller.signal.onabort = () => aborted.value = true;\n fetchOptions = __spreadProps$3(__spreadValues$d({}, fetchOptions), {\n signal: controller.signal\n });\n }\n const defaultFetchOptions = {\n method: config.method,\n headers: {}\n };\n if (config.payload) {\n const headers = headersToObject(defaultFetchOptions.headers);\n if (config.payloadType)\n headers[\"Content-Type\"] = (_a2 = payloadMapping[config.payloadType]) != null ? _a2 : config.payloadType;\n const payload = resolveUnref(config.payload);\n defaultFetchOptions.body = config.payloadType === \"json\" ? JSON.stringify(payload) : payload;\n }\n let isCanceled = false;\n const context = {\n url: resolveUnref(url),\n options: __spreadValues$d(__spreadValues$d({}, defaultFetchOptions), fetchOptions),\n cancel: () => {\n isCanceled = true;\n }\n };\n if (options.beforeFetch)\n Object.assign(context, await options.beforeFetch(context));\n if (isCanceled || !fetch) {\n loading(false);\n return Promise.resolve(null);\n }\n let responseData = null;\n if (timer)\n timer.start();\n return new Promise((resolve, reject) => {\n var _a3;\n fetch(context.url, __spreadProps$3(__spreadValues$d(__spreadValues$d({}, defaultFetchOptions), context.options), {\n headers: __spreadValues$d(__spreadValues$d({}, headersToObject(defaultFetchOptions.headers)), headersToObject((_a3 = context.options) == null ? void 0 : _a3.headers))\n })).then(async (fetchResponse) => {\n response.value = fetchResponse;\n statusCode.value = fetchResponse.status;\n responseData = await fetchResponse[config.type]();\n if (options.afterFetch && statusCode.value >= 200 && statusCode.value < 300)\n ({ data: responseData } = await options.afterFetch({ data: responseData, response: fetchResponse }));\n data.value = responseData;\n if (!fetchResponse.ok)\n throw new Error(fetchResponse.statusText);\n responseEvent.trigger(fetchResponse);\n return resolve(fetchResponse);\n }).catch(async (fetchError) => {\n let errorData = fetchError.message || fetchError.name;\n if (options.onFetchError)\n ({ data: responseData, error: errorData } = await options.onFetchError({ data: responseData, error: fetchError, response: response.value }));\n data.value = responseData;\n error.value = errorData;\n errorEvent.trigger(fetchError);\n if (throwOnFailed)\n return reject(fetchError);\n return resolve(null);\n }).finally(() => {\n loading(false);\n if (timer)\n timer.stop();\n finallyEvent.trigger(null);\n });\n });\n };\n const refetch = resolveRef(options.refetch);\n watch([\n refetch,\n resolveRef(url)\n ], ([refetch2]) => refetch2 && execute(), { deep: true });\n const shell = {\n isFinished,\n statusCode,\n response,\n error,\n data,\n isFetching,\n canAbort,\n aborted,\n abort,\n execute,\n onFetchResponse: responseEvent.on,\n onFetchError: errorEvent.on,\n onFetchFinally: finallyEvent.on,\n get: setMethod(\"GET\"),\n put: setMethod(\"PUT\"),\n post: setMethod(\"POST\"),\n delete: setMethod(\"DELETE\"),\n patch: setMethod(\"PATCH\"),\n head: setMethod(\"HEAD\"),\n options: setMethod(\"OPTIONS\"),\n json: setType(\"json\"),\n text: setType(\"text\"),\n blob: setType(\"blob\"),\n arrayBuffer: setType(\"arrayBuffer\"),\n formData: setType(\"formData\")\n };\n function setMethod(method) {\n return (payload, payloadType) => {\n if (!isFetching.value) {\n config.method = method;\n config.payload = payload;\n config.payloadType = payloadType;\n if (isRef(config.payload)) {\n watch([\n refetch,\n resolveRef(config.payload)\n ], ([refetch2]) => refetch2 && execute(), { deep: true });\n }\n const rawPayload = resolveUnref(config.payload);\n if (!payloadType && rawPayload && Object.getPrototypeOf(rawPayload) === Object.prototype && !(rawPayload instanceof FormData))\n config.payloadType = \"json\";\n return __spreadProps$3(__spreadValues$d({}, shell), {\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n });\n }\n return void 0;\n };\n }\n function waitUntilFinished() {\n return new Promise((resolve, reject) => {\n until(isFinished).toBe(true).then(() => resolve(shell)).catch((error2) => reject(error2));\n });\n }\n function setType(type) {\n return () => {\n if (!isFetching.value) {\n config.type = type;\n return __spreadProps$3(__spreadValues$d({}, shell), {\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n });\n }\n return void 0;\n };\n }\n if (options.immediate)\n setTimeout(execute, 0);\n return __spreadProps$3(__spreadValues$d({}, shell), {\n then(onFulfilled, onRejected) {\n return waitUntilFinished().then(onFulfilled, onRejected);\n }\n });\n}\nfunction joinPaths(start, end) {\n if (!start.endsWith(\"/\") && !end.startsWith(\"/\"))\n return `${start}/${end}`;\n return `${start}${end}`;\n}\n\nvar __defProp$c = Object.defineProperty;\nvar __getOwnPropSymbols$d = Object.getOwnPropertySymbols;\nvar __hasOwnProp$d = Object.prototype.hasOwnProperty;\nvar __propIsEnum$d = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$c = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$d.call(b, prop))\n __defNormalProp$c(a, prop, b[prop]);\n if (__getOwnPropSymbols$d)\n for (var prop of __getOwnPropSymbols$d(b)) {\n if (__propIsEnum$d.call(b, prop))\n __defNormalProp$c(a, prop, b[prop]);\n }\n return a;\n};\nconst DEFAULT_OPTIONS = {\n multiple: true,\n accept: \"*\"\n};\nfunction useFileDialog(options = {}) {\n const {\n document = defaultDocument\n } = options;\n const files = ref(null);\n let input;\n if (document) {\n input = document.createElement(\"input\");\n input.type = \"file\";\n input.onchange = (event) => {\n const result = event.target;\n files.value = result.files;\n };\n }\n const open = (localOptions) => {\n if (!input)\n return;\n const _options = __spreadValues$c(__spreadValues$c(__spreadValues$c({}, DEFAULT_OPTIONS), options), localOptions);\n input.multiple = _options.multiple;\n input.accept = _options.accept;\n if (hasOwn(_options, \"capture\"))\n input.capture = _options.capture;\n input.click();\n };\n const reset = () => {\n files.value = null;\n if (input)\n input.value = \"\";\n };\n return {\n files: readonly(files),\n open,\n reset\n };\n}\n\nvar __defProp$b = Object.defineProperty;\nvar __getOwnPropSymbols$c = Object.getOwnPropertySymbols;\nvar __hasOwnProp$c = Object.prototype.hasOwnProperty;\nvar __propIsEnum$c = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$b = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$c.call(b, prop))\n __defNormalProp$b(a, prop, b[prop]);\n if (__getOwnPropSymbols$c)\n for (var prop of __getOwnPropSymbols$c(b)) {\n if (__propIsEnum$c.call(b, prop))\n __defNormalProp$b(a, prop, b[prop]);\n }\n return a;\n};\nfunction useFileSystemAccess(options = {}) {\n const {\n window: _window = defaultWindow,\n dataType = \"Text\"\n } = unref(options);\n const window = _window;\n const isSupported = useSupported(() => window && \"showSaveFilePicker\" in window && \"showOpenFilePicker\" in window);\n const fileHandle = ref();\n const data = ref();\n const file = ref();\n const fileName = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.name) != null ? _b : \"\";\n });\n const fileMIME = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.type) != null ? _b : \"\";\n });\n const fileSize = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.size) != null ? _b : 0;\n });\n const fileLastModified = computed(() => {\n var _a, _b;\n return (_b = (_a = file.value) == null ? void 0 : _a.lastModified) != null ? _b : 0;\n });\n async function open(_options = {}) {\n if (!isSupported.value)\n return;\n const [handle] = await window.showOpenFilePicker(__spreadValues$b(__spreadValues$b({}, unref(options)), _options));\n fileHandle.value = handle;\n await updateFile();\n await updateData();\n }\n async function create(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker(__spreadValues$b(__spreadValues$b({}, unref(options)), _options));\n data.value = void 0;\n await updateFile();\n await updateData();\n }\n async function save(_options = {}) {\n if (!isSupported.value)\n return;\n if (!fileHandle.value)\n return saveAs(_options);\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function saveAs(_options = {}) {\n if (!isSupported.value)\n return;\n fileHandle.value = await window.showSaveFilePicker(__spreadValues$b(__spreadValues$b({}, unref(options)), _options));\n if (data.value) {\n const writableStream = await fileHandle.value.createWritable();\n await writableStream.write(data.value);\n await writableStream.close();\n }\n await updateFile();\n }\n async function updateFile() {\n var _a;\n file.value = await ((_a = fileHandle.value) == null ? void 0 : _a.getFile());\n }\n async function updateData() {\n var _a, _b;\n if (unref(dataType) === \"Text\")\n data.value = await ((_a = file.value) == null ? void 0 : _a.text());\n if (unref(dataType) === \"ArrayBuffer\")\n data.value = await ((_b = file.value) == null ? void 0 : _b.arrayBuffer());\n if (unref(dataType) === \"Blob\")\n data.value = file.value;\n }\n watch(() => unref(dataType), updateData);\n return {\n isSupported,\n data,\n file,\n fileName,\n fileMIME,\n fileSize,\n fileLastModified,\n open,\n create,\n save,\n saveAs,\n updateData\n };\n}\n\nfunction useFocus(target, options = {}) {\n const { initialValue = false } = options;\n const innerFocused = ref(false);\n const targetElement = computed(() => unrefElement(target));\n useEventListener(targetElement, \"focus\", () => innerFocused.value = true);\n useEventListener(targetElement, \"blur\", () => innerFocused.value = false);\n const focused = computed({\n get: () => innerFocused.value,\n set(value) {\n var _a, _b;\n if (!value && innerFocused.value)\n (_a = targetElement.value) == null ? void 0 : _a.blur();\n else if (value && !innerFocused.value)\n (_b = targetElement.value) == null ? void 0 : _b.focus();\n }\n });\n watch(targetElement, () => {\n focused.value = initialValue;\n }, { immediate: true, flush: \"post\" });\n return { focused };\n}\n\nfunction useFocusWithin(target, options = {}) {\n const activeElement = useActiveElement(options);\n const targetElement = computed(() => unrefElement(target));\n const focused = computed(() => targetElement.value && activeElement.value ? targetElement.value.contains(activeElement.value) : false);\n return { focused };\n}\n\nfunction useFps(options) {\n var _a;\n const fps = ref(0);\n if (typeof performance === \"undefined\")\n return fps;\n const every = (_a = options == null ? void 0 : options.every) != null ? _a : 10;\n let last = performance.now();\n let ticks = 0;\n useRafFn(() => {\n ticks += 1;\n if (ticks >= every) {\n const now = performance.now();\n const diff = now - last;\n fps.value = Math.round(1e3 / (diff / ticks));\n last = now;\n ticks = 0;\n }\n });\n return fps;\n}\n\nconst functionsMap = [\n [\n \"requestFullscreen\",\n \"exitFullscreen\",\n \"fullscreenElement\",\n \"fullscreenEnabled\",\n \"fullscreenchange\",\n \"fullscreenerror\"\n ],\n [\n \"webkitRequestFullscreen\",\n \"webkitExitFullscreen\",\n \"webkitFullscreenElement\",\n \"webkitFullscreenEnabled\",\n \"webkitfullscreenchange\",\n \"webkitfullscreenerror\"\n ],\n [\n \"webkitRequestFullScreen\",\n \"webkitCancelFullScreen\",\n \"webkitCurrentFullScreenElement\",\n \"webkitCancelFullScreen\",\n \"webkitfullscreenchange\",\n \"webkitfullscreenerror\"\n ],\n [\n \"mozRequestFullScreen\",\n \"mozCancelFullScreen\",\n \"mozFullScreenElement\",\n \"mozFullScreenEnabled\",\n \"mozfullscreenchange\",\n \"mozfullscreenerror\"\n ],\n [\n \"msRequestFullscreen\",\n \"msExitFullscreen\",\n \"msFullscreenElement\",\n \"msFullscreenEnabled\",\n \"MSFullscreenChange\",\n \"MSFullscreenError\"\n ]\n];\nfunction useFullscreen(target, options = {}) {\n const { document = defaultDocument, autoExit = false } = options;\n const targetRef = target || (document == null ? void 0 : document.querySelector(\"html\"));\n const isFullscreen = ref(false);\n let map = functionsMap[0];\n const isSupported = useSupported(() => {\n if (!document) {\n return false;\n } else {\n for (const m of functionsMap) {\n if (m[1] in document) {\n map = m;\n return true;\n }\n }\n }\n return false;\n });\n const [REQUEST, EXIT, ELEMENT, , EVENT] = map;\n async function exit() {\n if (!isSupported.value)\n return;\n if (document == null ? void 0 : document[ELEMENT])\n await document[EXIT]();\n isFullscreen.value = false;\n }\n async function enter() {\n if (!isSupported.value)\n return;\n await exit();\n const target2 = unrefElement(targetRef);\n if (target2) {\n await target2[REQUEST]();\n isFullscreen.value = true;\n }\n }\n async function toggle() {\n if (isFullscreen.value)\n await exit();\n else\n await enter();\n }\n if (document) {\n useEventListener(document, EVENT, () => {\n isFullscreen.value = !!(document == null ? void 0 : document[ELEMENT]);\n }, false);\n }\n if (autoExit)\n tryOnScopeDispose(exit);\n return {\n isSupported,\n isFullscreen,\n enter,\n exit,\n toggle\n };\n}\n\nfunction mapGamepadToXbox360Controller(gamepad) {\n return computed(() => {\n if (gamepad.value) {\n return {\n buttons: {\n a: gamepad.value.buttons[0],\n b: gamepad.value.buttons[1],\n x: gamepad.value.buttons[2],\n y: gamepad.value.buttons[3]\n },\n bumper: {\n left: gamepad.value.buttons[4],\n right: gamepad.value.buttons[5]\n },\n triggers: {\n left: gamepad.value.buttons[6],\n right: gamepad.value.buttons[7]\n },\n stick: {\n left: {\n horizontal: gamepad.value.axes[0],\n vertical: gamepad.value.axes[1],\n button: gamepad.value.buttons[10]\n },\n right: {\n horizontal: gamepad.value.axes[2],\n vertical: gamepad.value.axes[3],\n button: gamepad.value.buttons[11]\n }\n },\n dpad: {\n up: gamepad.value.buttons[12],\n down: gamepad.value.buttons[13],\n left: gamepad.value.buttons[14],\n right: gamepad.value.buttons[15]\n },\n back: gamepad.value.buttons[8],\n start: gamepad.value.buttons[9]\n };\n }\n return null;\n });\n}\nfunction useGamepad(options = {}) {\n const {\n navigator = defaultNavigator\n } = options;\n const isSupported = useSupported(() => navigator && \"getGamepads\" in navigator);\n const gamepads = ref([]);\n const onConnectedHook = createEventHook();\n const onDisconnectedHook = createEventHook();\n const stateFromGamepad = (gamepad) => {\n const hapticActuators = [];\n const vibrationActuator = \"vibrationActuator\" in gamepad ? gamepad.vibrationActuator : null;\n if (vibrationActuator)\n hapticActuators.push(vibrationActuator);\n if (gamepad.hapticActuators)\n hapticActuators.push(...gamepad.hapticActuators);\n return {\n id: gamepad.id,\n hapticActuators,\n index: gamepad.index,\n mapping: gamepad.mapping,\n connected: gamepad.connected,\n timestamp: gamepad.timestamp,\n axes: gamepad.axes.map((axes) => axes),\n buttons: gamepad.buttons.map((button) => ({ pressed: button.pressed, touched: button.touched, value: button.value }))\n };\n };\n const updateGamepadState = () => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n for (let i = 0; i < _gamepads.length; ++i) {\n const gamepad = _gamepads[i];\n if (gamepad) {\n const index = gamepads.value.findIndex(({ index: index2 }) => index2 === gamepad.index);\n if (index > -1)\n gamepads.value[index] = stateFromGamepad(gamepad);\n }\n }\n };\n const { isActive, pause, resume } = useRafFn(updateGamepadState);\n const onGamepadConnected = (gamepad) => {\n if (!gamepads.value.some(({ index }) => index === gamepad.index)) {\n gamepads.value.push(stateFromGamepad(gamepad));\n onConnectedHook.trigger(gamepad.index);\n }\n resume();\n };\n const onGamepadDisconnected = (gamepad) => {\n gamepads.value = gamepads.value.filter((x) => x.index !== gamepad.index);\n onDisconnectedHook.trigger(gamepad.index);\n };\n useEventListener(\"gamepadconnected\", (e) => onGamepadConnected(e.gamepad));\n useEventListener(\"gamepaddisconnected\", (e) => onGamepadDisconnected(e.gamepad));\n tryOnMounted(() => {\n const _gamepads = (navigator == null ? void 0 : navigator.getGamepads()) || [];\n if (_gamepads) {\n for (let i = 0; i < _gamepads.length; ++i) {\n const gamepad = _gamepads[i];\n if (gamepad)\n onGamepadConnected(gamepad);\n }\n }\n });\n pause();\n return {\n isSupported,\n onConnected: onConnectedHook.on,\n onDisconnected: onDisconnectedHook.on,\n gamepads,\n pause,\n resume,\n isActive\n };\n}\n\nfunction useGeolocation(options = {}) {\n const {\n enableHighAccuracy = true,\n maximumAge = 3e4,\n timeout = 27e3,\n navigator = defaultNavigator,\n immediate = true\n } = options;\n const isSupported = useSupported(() => navigator && \"geolocation\" in navigator);\n const locatedAt = ref(null);\n const error = ref(null);\n const coords = ref({\n accuracy: 0,\n latitude: Infinity,\n longitude: Infinity,\n altitude: null,\n altitudeAccuracy: null,\n heading: null,\n speed: null\n });\n function updatePosition(position) {\n locatedAt.value = position.timestamp;\n coords.value = position.coords;\n error.value = null;\n }\n let watcher;\n function resume() {\n if (isSupported.value) {\n watcher = navigator.geolocation.watchPosition(updatePosition, (err) => error.value = err, {\n enableHighAccuracy,\n maximumAge,\n timeout\n });\n }\n }\n if (immediate)\n resume();\n function pause() {\n if (watcher && navigator)\n navigator.geolocation.clearWatch(watcher);\n }\n tryOnScopeDispose(() => {\n pause();\n });\n return {\n isSupported,\n coords,\n locatedAt,\n error,\n resume,\n pause\n };\n}\n\nconst defaultEvents$1 = [\"mousemove\", \"mousedown\", \"resize\", \"keydown\", \"touchstart\", \"wheel\"];\nconst oneMinute = 6e4;\nfunction useIdle(timeout = oneMinute, options = {}) {\n const {\n initialState = false,\n listenForVisibilityChange = true,\n events = defaultEvents$1,\n window = defaultWindow,\n eventFilter = throttleFilter(50)\n } = options;\n const idle = ref(initialState);\n const lastActive = ref(timestamp());\n let timer;\n const onEvent = createFilterWrapper(eventFilter, () => {\n idle.value = false;\n lastActive.value = timestamp();\n clearTimeout(timer);\n timer = setTimeout(() => idle.value = true, timeout);\n });\n if (window) {\n const document = window.document;\n for (const event of events)\n useEventListener(window, event, onEvent, { passive: true });\n if (listenForVisibilityChange) {\n useEventListener(document, \"visibilitychange\", () => {\n if (!document.hidden)\n onEvent();\n });\n }\n }\n timer = setTimeout(() => idle.value = true, timeout);\n return { idle, lastActive };\n}\n\nvar __defProp$a = Object.defineProperty;\nvar __getOwnPropSymbols$b = Object.getOwnPropertySymbols;\nvar __hasOwnProp$b = Object.prototype.hasOwnProperty;\nvar __propIsEnum$b = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$a = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$b.call(b, prop))\n __defNormalProp$a(a, prop, b[prop]);\n if (__getOwnPropSymbols$b)\n for (var prop of __getOwnPropSymbols$b(b)) {\n if (__propIsEnum$b.call(b, prop))\n __defNormalProp$a(a, prop, b[prop]);\n }\n return a;\n};\nasync function loadImage(options) {\n return new Promise((resolve, reject) => {\n const img = new Image();\n const { src, srcset, sizes } = options;\n img.src = src;\n if (srcset)\n img.srcset = srcset;\n if (sizes)\n img.sizes = sizes;\n img.onload = () => resolve(img);\n img.onerror = reject;\n });\n}\nconst useImage = (options, asyncStateOptions = {}) => {\n const state = useAsyncState(() => loadImage(resolveUnref(options)), void 0, __spreadValues$a({\n resetOnExecute: true\n }, asyncStateOptions));\n watch(() => resolveUnref(options), () => state.execute(asyncStateOptions.delay), { deep: true });\n return state;\n};\n\nconst ARRIVED_STATE_THRESHOLD_PIXELS = 1;\nfunction useScroll(element, options = {}) {\n const {\n throttle = 0,\n idle = 200,\n onStop = noop,\n onScroll = noop,\n offset = {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n },\n eventListenerOptions = {\n capture: false,\n passive: true\n },\n behavior = \"auto\"\n } = options;\n const internalX = ref(0);\n const internalY = ref(0);\n const x = computed({\n get() {\n return internalX.value;\n },\n set(x2) {\n scrollTo(x2, void 0);\n }\n });\n const y = computed({\n get() {\n return internalY.value;\n },\n set(y2) {\n scrollTo(void 0, y2);\n }\n });\n function scrollTo(_x, _y) {\n var _a, _b, _c;\n const _element = resolveUnref(element);\n if (!_element)\n return;\n (_c = _element instanceof Document ? document.body : _element) == null ? void 0 : _c.scrollTo({\n top: (_a = resolveUnref(_y)) != null ? _a : y.value,\n left: (_b = resolveUnref(_x)) != null ? _b : x.value,\n behavior: resolveUnref(behavior)\n });\n }\n const isScrolling = ref(false);\n const arrivedState = reactive({\n left: true,\n right: false,\n top: true,\n bottom: false\n });\n const directions = reactive({\n left: false,\n right: false,\n top: false,\n bottom: false\n });\n const onScrollEnd = (e) => {\n if (!isScrolling.value)\n return;\n isScrolling.value = false;\n directions.left = false;\n directions.right = false;\n directions.top = false;\n directions.bottom = false;\n onStop(e);\n };\n const onScrollEndDebounced = useDebounceFn(onScrollEnd, throttle + idle);\n const onScrollHandler = (e) => {\n const eventTarget = e.target === document ? e.target.documentElement : e.target;\n const scrollLeft = eventTarget.scrollLeft;\n directions.left = scrollLeft < internalX.value;\n directions.right = scrollLeft > internalY.value;\n arrivedState.left = scrollLeft <= 0 + (offset.left || 0);\n arrivedState.right = scrollLeft + eventTarget.clientWidth >= eventTarget.scrollWidth - (offset.right || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n internalX.value = scrollLeft;\n let scrollTop = eventTarget.scrollTop;\n if (e.target === document && !scrollTop)\n scrollTop = document.body.scrollTop;\n directions.top = scrollTop < internalY.value;\n directions.bottom = scrollTop > internalY.value;\n arrivedState.top = scrollTop <= 0 + (offset.top || 0);\n arrivedState.bottom = scrollTop + eventTarget.clientHeight >= eventTarget.scrollHeight - (offset.bottom || 0) - ARRIVED_STATE_THRESHOLD_PIXELS;\n internalY.value = scrollTop;\n isScrolling.value = true;\n onScrollEndDebounced(e);\n onScroll(e);\n };\n useEventListener(element, \"scroll\", throttle ? useThrottleFn(onScrollHandler, throttle, true, false) : onScrollHandler, eventListenerOptions);\n useEventListener(element, \"scrollend\", onScrollEnd, eventListenerOptions);\n return {\n x,\n y,\n isScrolling,\n arrivedState,\n directions\n };\n}\n\nvar __defProp$9 = Object.defineProperty;\nvar __defProps$2 = Object.defineProperties;\nvar __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$a = Object.getOwnPropertySymbols;\nvar __hasOwnProp$a = Object.prototype.hasOwnProperty;\nvar __propIsEnum$a = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$9 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$a.call(b, prop))\n __defNormalProp$9(a, prop, b[prop]);\n if (__getOwnPropSymbols$a)\n for (var prop of __getOwnPropSymbols$a(b)) {\n if (__propIsEnum$a.call(b, prop))\n __defNormalProp$9(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));\nfunction useInfiniteScroll(element, onLoadMore, options = {}) {\n var _a, _b;\n const direction = (_a = options.direction) != null ? _a : \"bottom\";\n const state = reactive(useScroll(element, __spreadProps$2(__spreadValues$9({}, options), {\n offset: __spreadValues$9({\n [direction]: (_b = options.distance) != null ? _b : 0\n }, options.offset)\n })));\n watch(() => state.arrivedState[direction], async (v) => {\n var _a2, _b2;\n if (v) {\n const elem = resolveUnref(element);\n const previous = {\n height: (_a2 = elem == null ? void 0 : elem.scrollHeight) != null ? _a2 : 0,\n width: (_b2 = elem == null ? void 0 : elem.scrollWidth) != null ? _b2 : 0\n };\n await onLoadMore(state);\n if (options.preserveScrollPosition && elem) {\n nextTick(() => {\n elem.scrollTo({\n top: elem.scrollHeight - previous.height,\n left: elem.scrollWidth - previous.width\n });\n });\n }\n }\n });\n}\n\nfunction useIntersectionObserver(target, callback, options = {}) {\n const {\n root,\n rootMargin = \"0px\",\n threshold = 0.1,\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"IntersectionObserver\" in window);\n let cleanup = noop;\n const stopWatch = isSupported.value ? watch(() => ({\n el: unrefElement(target),\n root: unrefElement(root)\n }), ({ el, root: root2 }) => {\n cleanup();\n if (!el)\n return;\n const observer = new IntersectionObserver(callback, {\n root: root2,\n rootMargin,\n threshold\n });\n observer.observe(el);\n cleanup = () => {\n observer.disconnect();\n cleanup = noop;\n };\n }, { immediate: true, flush: \"post\" }) : noop;\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nconst defaultEvents = [\"mousedown\", \"mouseup\", \"keydown\", \"keyup\"];\nfunction useKeyModifier(modifier, options = {}) {\n const {\n events = defaultEvents,\n document = defaultDocument,\n initial = null\n } = options;\n const state = ref(initial);\n if (document) {\n events.forEach((listenerEvent) => {\n useEventListener(document, listenerEvent, (evt) => {\n if (typeof evt.getModifierState === \"function\")\n state.value = evt.getModifierState(modifier);\n });\n });\n }\n return state;\n}\n\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.localStorage, options);\n}\n\nconst DefaultMagicKeysAliasMap = {\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};\n\nfunction useMagicKeys(options = {}) {\n const {\n reactive: useReactive = false,\n target = defaultWindow,\n aliasMap = DefaultMagicKeysAliasMap,\n passive = true,\n onEventFired = noop\n } = options;\n const current = reactive(new Set());\n const obj = {\n toJSON() {\n return {};\n },\n current\n };\n const refs = useReactive ? reactive(obj) : obj;\n const metaDeps = new Set();\n const usedKeys = new Set();\n function setRefs(key, value) {\n if (key in refs) {\n if (useReactive)\n refs[key] = value;\n else\n refs[key].value = value;\n }\n }\n function reset() {\n current.clear();\n for (const key of usedKeys)\n setRefs(key, false);\n }\n function updateRefs(e, value) {\n var _a, _b;\n const key = (_a = e.key) == null ? void 0 : _a.toLowerCase();\n const code = (_b = e.code) == null ? void 0 : _b.toLowerCase();\n const values = [code, key].filter(Boolean);\n if (key) {\n if (value)\n current.add(key);\n else\n current.delete(key);\n }\n for (const key2 of values) {\n usedKeys.add(key2);\n setRefs(key2, value);\n }\n if (key === \"meta\" && !value) {\n metaDeps.forEach((key2) => {\n current.delete(key2);\n setRefs(key2, false);\n });\n metaDeps.clear();\n } else if (typeof e.getModifierState === \"function\" && e.getModifierState(\"Meta\") && value) {\n [...current, ...values].forEach((key2) => metaDeps.add(key2));\n }\n }\n useEventListener(target, \"keydown\", (e) => {\n updateRefs(e, true);\n return onEventFired(e);\n }, { passive });\n useEventListener(target, \"keyup\", (e) => {\n updateRefs(e, false);\n return onEventFired(e);\n }, { passive });\n useEventListener(\"blur\", reset, { passive: true });\n useEventListener(\"focus\", reset, { passive: true });\n const proxy = new Proxy(refs, {\n get(target2, prop, rec) {\n if (typeof prop !== \"string\")\n return Reflect.get(target2, prop, rec);\n prop = prop.toLowerCase();\n if (prop in aliasMap)\n prop = aliasMap[prop];\n if (!(prop in refs)) {\n if (/[+_-]/.test(prop)) {\n const keys = prop.split(/[+_-]/g).map((i) => i.trim());\n refs[prop] = computed(() => keys.every((key) => unref(proxy[key])));\n } else {\n refs[prop] = ref(false);\n }\n }\n const r = Reflect.get(target2, prop, rec);\n return useReactive ? unref(r) : r;\n }\n });\n return proxy;\n}\n\nvar __defProp$8 = Object.defineProperty;\nvar __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$9 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$9 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$8 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$9.call(b, prop))\n __defNormalProp$8(a, prop, b[prop]);\n if (__getOwnPropSymbols$9)\n for (var prop of __getOwnPropSymbols$9(b)) {\n if (__propIsEnum$9.call(b, prop))\n __defNormalProp$8(a, prop, b[prop]);\n }\n return a;\n};\nfunction usingElRef(source, cb) {\n if (resolveUnref(source))\n cb(resolveUnref(source));\n}\nfunction timeRangeToArray(timeRanges) {\n let ranges = [];\n for (let i = 0; i < timeRanges.length; ++i)\n ranges = [...ranges, [timeRanges.start(i), timeRanges.end(i)]];\n return ranges;\n}\nfunction tracksToArray(tracks) {\n return Array.from(tracks).map(({ label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }, id) => ({ id, label, kind, language, mode, activeCues, cues, inBandMetadataTrackDispatchType }));\n}\nconst defaultOptions = {\n src: \"\",\n tracks: []\n};\nfunction useMediaControls(target, options = {}) {\n options = __spreadValues$8(__spreadValues$8({}, defaultOptions), options);\n const {\n document = defaultDocument\n } = options;\n const currentTime = ref(0);\n const duration = ref(0);\n const seeking = ref(false);\n const volume = ref(1);\n const waiting = ref(false);\n const ended = ref(false);\n const playing = ref(false);\n const rate = ref(1);\n const stalled = ref(false);\n const buffered = ref([]);\n const tracks = ref([]);\n const selectedTrack = ref(-1);\n const isPictureInPicture = ref(false);\n const muted = ref(false);\n const supportsPictureInPicture = document && \"pictureInPictureEnabled\" in document;\n const sourceErrorEvent = createEventHook();\n const disableTrack = (track) => {\n usingElRef(target, (el) => {\n if (track) {\n const id = isNumber(track) ? track : track.id;\n el.textTracks[id].mode = \"disabled\";\n } else {\n for (let i = 0; i < el.textTracks.length; ++i)\n el.textTracks[i].mode = \"disabled\";\n }\n selectedTrack.value = -1;\n });\n };\n const enableTrack = (track, disableTracks = true) => {\n usingElRef(target, (el) => {\n const id = isNumber(track) ? track : track.id;\n if (disableTracks)\n disableTrack();\n el.textTracks[id].mode = \"showing\";\n selectedTrack.value = id;\n });\n };\n const togglePictureInPicture = () => {\n return new Promise((resolve, reject) => {\n usingElRef(target, async (el) => {\n if (supportsPictureInPicture) {\n if (!isPictureInPicture.value) {\n el.requestPictureInPicture().then(resolve).catch(reject);\n } else {\n document.exitPictureInPicture().then(resolve).catch(reject);\n }\n }\n });\n });\n };\n watchEffect(() => {\n if (!document)\n return;\n const el = resolveUnref(target);\n if (!el)\n return;\n const src = resolveUnref(options.src);\n let sources = [];\n if (!src)\n return;\n if (isString(src))\n sources = [{ src }];\n else if (Array.isArray(src))\n sources = src;\n else if (isObject(src))\n sources = [src];\n el.querySelectorAll(\"source\").forEach((e) => {\n e.removeEventListener(\"error\", sourceErrorEvent.trigger);\n e.remove();\n });\n sources.forEach(({ src: src2, type }) => {\n const source = document.createElement(\"source\");\n source.setAttribute(\"src\", src2);\n source.setAttribute(\"type\", type || \"\");\n source.addEventListener(\"error\", sourceErrorEvent.trigger);\n el.appendChild(source);\n });\n el.load();\n });\n tryOnScopeDispose(() => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.querySelectorAll(\"source\").forEach((e) => e.removeEventListener(\"error\", sourceErrorEvent.trigger));\n });\n watch(volume, (vol) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.volume = vol;\n });\n watch(muted, (mute) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.muted = mute;\n });\n watch(rate, (rate2) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.playbackRate = rate2;\n });\n watchEffect(() => {\n if (!document)\n return;\n const textTracks = resolveUnref(options.tracks);\n const el = resolveUnref(target);\n if (!textTracks || !textTracks.length || !el)\n return;\n el.querySelectorAll(\"track\").forEach((e) => e.remove());\n textTracks.forEach(({ default: isDefault, kind, label, src, srcLang }, i) => {\n const track = document.createElement(\"track\");\n track.default = isDefault || false;\n track.kind = kind;\n track.label = label;\n track.src = src;\n track.srclang = srcLang;\n if (track.default)\n selectedTrack.value = i;\n el.appendChild(track);\n });\n });\n const { ignoreUpdates: ignoreCurrentTimeUpdates } = watchIgnorable(currentTime, (time) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n el.currentTime = time;\n });\n const { ignoreUpdates: ignorePlayingUpdates } = watchIgnorable(playing, (isPlaying) => {\n const el = resolveUnref(target);\n if (!el)\n return;\n isPlaying ? el.play() : el.pause();\n });\n useEventListener(target, \"timeupdate\", () => ignoreCurrentTimeUpdates(() => currentTime.value = resolveUnref(target).currentTime));\n useEventListener(target, \"durationchange\", () => duration.value = resolveUnref(target).duration);\n useEventListener(target, \"progress\", () => buffered.value = timeRangeToArray(resolveUnref(target).buffered));\n useEventListener(target, \"seeking\", () => seeking.value = true);\n useEventListener(target, \"seeked\", () => seeking.value = false);\n useEventListener(target, \"waiting\", () => waiting.value = true);\n useEventListener(target, \"playing\", () => {\n waiting.value = false;\n ended.value = false;\n });\n useEventListener(target, \"ratechange\", () => rate.value = resolveUnref(target).playbackRate);\n useEventListener(target, \"stalled\", () => stalled.value = true);\n useEventListener(target, \"ended\", () => ended.value = true);\n useEventListener(target, \"pause\", () => ignorePlayingUpdates(() => playing.value = false));\n useEventListener(target, \"play\", () => ignorePlayingUpdates(() => playing.value = true));\n useEventListener(target, \"enterpictureinpicture\", () => isPictureInPicture.value = true);\n useEventListener(target, \"leavepictureinpicture\", () => isPictureInPicture.value = false);\n useEventListener(target, \"volumechange\", () => {\n const el = resolveUnref(target);\n if (!el)\n return;\n volume.value = el.volume;\n muted.value = el.muted;\n });\n const listeners = [];\n const stop = watch([target], () => {\n const el = resolveUnref(target);\n if (!el)\n return;\n stop();\n listeners[0] = useEventListener(el.textTracks, \"addtrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[1] = useEventListener(el.textTracks, \"removetrack\", () => tracks.value = tracksToArray(el.textTracks));\n listeners[2] = useEventListener(el.textTracks, \"change\", () => tracks.value = tracksToArray(el.textTracks));\n });\n tryOnScopeDispose(() => listeners.forEach((listener) => listener()));\n return {\n currentTime,\n duration,\n waiting,\n seeking,\n ended,\n stalled,\n buffered,\n playing,\n rate,\n volume,\n muted,\n tracks,\n selectedTrack,\n enableTrack,\n disableTrack,\n supportsPictureInPicture,\n togglePictureInPicture,\n isPictureInPicture,\n onSourceError: sourceErrorEvent.on\n };\n}\n\nconst getMapVue2Compat = () => {\n const data = reactive({});\n return {\n get: (key) => data[key],\n set: (key, value) => set(data, key, value),\n has: (key) => hasOwn(data, key),\n delete: (key) => del(data, key),\n clear: () => {\n Object.keys(data).forEach((key) => {\n del(data, key);\n });\n }\n };\n};\nfunction useMemoize(resolver, options) {\n const initCache = () => {\n if (options == null ? void 0 : options.cache)\n return reactive(options.cache);\n if (isVue2)\n return getMapVue2Compat();\n return reactive(new Map());\n };\n const cache = initCache();\n const generateKey = (...args) => (options == null ? void 0 : options.getKey) ? options.getKey(...args) : JSON.stringify(args);\n const _loadData = (key, ...args) => {\n cache.set(key, resolver(...args));\n return cache.get(key);\n };\n const loadData = (...args) => _loadData(generateKey(...args), ...args);\n const deleteData = (...args) => {\n cache.delete(generateKey(...args));\n };\n const clearData = () => {\n cache.clear();\n };\n const memoized = (...args) => {\n const key = generateKey(...args);\n if (cache.has(key))\n return cache.get(key);\n return _loadData(key, ...args);\n };\n memoized.load = loadData;\n memoized.delete = deleteData;\n memoized.clear = clearData;\n memoized.generateKey = generateKey;\n memoized.cache = cache;\n return memoized;\n}\n\nfunction useMemory(options = {}) {\n const memory = ref();\n const isSupported = useSupported(() => typeof performance !== \"undefined\" && \"memory\" in performance);\n if (isSupported.value) {\n const { interval = 1e3 } = options;\n useIntervalFn(() => {\n memory.value = performance.memory;\n }, interval, { immediate: options.immediate, immediateCallback: options.immediateCallback });\n }\n return { isSupported, memory };\n}\n\nfunction useMounted() {\n const isMounted = ref(false);\n onMounted(() => {\n isMounted.value = true;\n });\n return isMounted;\n}\n\nfunction useMouse(options = {}) {\n const {\n type = \"page\",\n touch = true,\n resetOnTouchEnds = false,\n initialValue = { x: 0, y: 0 },\n window = defaultWindow,\n eventFilter\n } = options;\n const x = ref(initialValue.x);\n const y = ref(initialValue.y);\n const sourceType = ref(null);\n const mouseHandler = (event) => {\n if (type === \"page\") {\n x.value = event.pageX;\n y.value = event.pageY;\n } else if (type === \"client\") {\n x.value = event.clientX;\n y.value = event.clientY;\n } else if (type === \"movement\") {\n x.value = event.movementX;\n y.value = event.movementY;\n }\n sourceType.value = \"mouse\";\n };\n const reset = () => {\n x.value = initialValue.x;\n y.value = initialValue.y;\n };\n const touchHandler = (event) => {\n if (event.touches.length > 0) {\n const touch2 = event.touches[0];\n if (type === \"page\") {\n x.value = touch2.pageX;\n y.value = touch2.pageY;\n } else if (type === \"client\") {\n x.value = touch2.clientX;\n y.value = touch2.clientY;\n }\n sourceType.value = \"touch\";\n }\n };\n const mouseHandlerWrapper = (event) => {\n return eventFilter === void 0 ? mouseHandler(event) : eventFilter(() => mouseHandler(event), {});\n };\n const touchHandlerWrapper = (event) => {\n return eventFilter === void 0 ? touchHandler(event) : eventFilter(() => touchHandler(event), {});\n };\n if (window) {\n useEventListener(window, \"mousemove\", mouseHandlerWrapper, { passive: true });\n useEventListener(window, \"dragover\", mouseHandlerWrapper, { passive: true });\n if (touch && type !== \"movement\") {\n useEventListener(window, \"touchstart\", touchHandlerWrapper, { passive: true });\n useEventListener(window, \"touchmove\", touchHandlerWrapper, { passive: true });\n if (resetOnTouchEnds)\n useEventListener(window, \"touchend\", reset, { passive: true });\n }\n }\n return {\n x,\n y,\n sourceType\n };\n}\n\nfunction useMouseInElement(target, options = {}) {\n const {\n handleOutside = true,\n window = defaultWindow\n } = options;\n const { x, y, sourceType } = useMouse(options);\n const targetRef = ref(target != null ? target : window == null ? void 0 : window.document.body);\n const elementX = ref(0);\n const elementY = ref(0);\n const elementPositionX = ref(0);\n const elementPositionY = ref(0);\n const elementHeight = ref(0);\n const elementWidth = ref(0);\n const isOutside = ref(true);\n let stop = () => {\n };\n if (window) {\n stop = watch([targetRef, x, y], () => {\n const el = unrefElement(targetRef);\n if (!el)\n return;\n const {\n left,\n top,\n width,\n height\n } = el.getBoundingClientRect();\n elementPositionX.value = left + window.pageXOffset;\n elementPositionY.value = top + window.pageYOffset;\n elementHeight.value = height;\n elementWidth.value = width;\n const elX = x.value - elementPositionX.value;\n const elY = y.value - elementPositionY.value;\n isOutside.value = width === 0 || height === 0 || elX < 0 || elY < 0 || elX > width || elY > height;\n if (handleOutside || !isOutside.value) {\n elementX.value = elX;\n elementY.value = elY;\n }\n }, { immediate: true });\n useEventListener(document, \"mouseleave\", () => {\n isOutside.value = true;\n });\n }\n return {\n x,\n y,\n sourceType,\n elementX,\n elementY,\n elementPositionX,\n elementPositionY,\n elementHeight,\n elementWidth,\n isOutside,\n stop\n };\n}\n\nfunction useMousePressed(options = {}) {\n const {\n touch = true,\n drag = true,\n initialValue = false,\n window = defaultWindow\n } = options;\n const pressed = ref(initialValue);\n const sourceType = ref(null);\n if (!window) {\n return {\n pressed,\n sourceType\n };\n }\n const onPressed = (srcType) => () => {\n pressed.value = true;\n sourceType.value = srcType;\n };\n const onReleased = () => {\n pressed.value = false;\n sourceType.value = null;\n };\n const target = computed(() => unrefElement(options.target) || window);\n useEventListener(target, \"mousedown\", onPressed(\"mouse\"), { passive: true });\n useEventListener(window, \"mouseleave\", onReleased, { passive: true });\n useEventListener(window, \"mouseup\", onReleased, { passive: true });\n if (drag) {\n useEventListener(target, \"dragstart\", onPressed(\"mouse\"), { passive: true });\n useEventListener(window, \"drop\", onReleased, { passive: true });\n useEventListener(window, \"dragend\", onReleased, { passive: true });\n }\n if (touch) {\n useEventListener(target, \"touchstart\", onPressed(\"touch\"), { passive: true });\n useEventListener(window, \"touchend\", onReleased, { passive: true });\n useEventListener(window, \"touchcancel\", onReleased, { passive: true });\n }\n return {\n pressed,\n sourceType\n };\n}\n\nvar __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$8 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$8 = Object.prototype.propertyIsEnumerable;\nvar __objRest$1 = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp$8.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols$8)\n for (var prop of __getOwnPropSymbols$8(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum$8.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction useMutationObserver(target, callback, options = {}) {\n const _a = options, { window = defaultWindow } = _a, mutationOptions = __objRest$1(_a, [\"window\"]);\n let observer;\n const isSupported = useSupported(() => window && \"MutationObserver\" in window);\n const cleanup = () => {\n if (observer) {\n observer.disconnect();\n observer = void 0;\n }\n };\n const stopWatch = watch(() => unrefElement(target), (el) => {\n cleanup();\n if (isSupported.value && window && el) {\n observer = new MutationObserver(callback);\n observer.observe(el, mutationOptions);\n }\n }, { immediate: true });\n const stop = () => {\n cleanup();\n stopWatch();\n };\n tryOnScopeDispose(stop);\n return {\n isSupported,\n stop\n };\n}\n\nconst useNavigatorLanguage = (options = {}) => {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"language\" in navigator);\n const language = ref(navigator == null ? void 0 : navigator.language);\n useEventListener(window, \"languagechange\", () => {\n if (navigator)\n language.value = navigator.language;\n });\n return {\n isSupported,\n language\n };\n};\n\nfunction useNetwork(options = {}) {\n const { window = defaultWindow } = options;\n const navigator = window == null ? void 0 : window.navigator;\n const isSupported = useSupported(() => navigator && \"connection\" in navigator);\n const isOnline = ref(true);\n const saveData = ref(false);\n const offlineAt = ref(void 0);\n const onlineAt = ref(void 0);\n const downlink = ref(void 0);\n const downlinkMax = ref(void 0);\n const rtt = ref(void 0);\n const effectiveType = ref(void 0);\n const type = ref(\"unknown\");\n const connection = isSupported.value && navigator.connection;\n function updateNetworkInformation() {\n if (!navigator)\n return;\n isOnline.value = navigator.onLine;\n offlineAt.value = isOnline.value ? void 0 : Date.now();\n onlineAt.value = isOnline.value ? Date.now() : void 0;\n if (connection) {\n downlink.value = connection.downlink;\n downlinkMax.value = connection.downlinkMax;\n effectiveType.value = connection.effectiveType;\n rtt.value = connection.rtt;\n saveData.value = connection.saveData;\n type.value = connection.type;\n }\n }\n if (window) {\n useEventListener(window, \"offline\", () => {\n isOnline.value = false;\n offlineAt.value = Date.now();\n });\n useEventListener(window, \"online\", () => {\n isOnline.value = true;\n onlineAt.value = Date.now();\n });\n }\n if (connection)\n useEventListener(connection, \"change\", updateNetworkInformation, false);\n updateNetworkInformation();\n return {\n isSupported,\n isOnline,\n saveData,\n offlineAt,\n onlineAt,\n downlink,\n downlinkMax,\n effectiveType,\n rtt,\n type\n };\n}\n\nvar __defProp$7 = Object.defineProperty;\nvar __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$7 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$7 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$7 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$7.call(b, prop))\n __defNormalProp$7(a, prop, b[prop]);\n if (__getOwnPropSymbols$7)\n for (var prop of __getOwnPropSymbols$7(b)) {\n if (__propIsEnum$7.call(b, prop))\n __defNormalProp$7(a, prop, b[prop]);\n }\n return a;\n};\nfunction useNow(options = {}) {\n const {\n controls: exposeControls = false,\n interval = \"requestAnimationFrame\"\n } = options;\n const now = ref(new Date());\n const update = () => now.value = new Date();\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(update, { immediate: true }) : useIntervalFn(update, interval, { immediate: true });\n if (exposeControls) {\n return __spreadValues$7({\n now\n }, controls);\n } else {\n return now;\n }\n}\n\nfunction useObjectUrl(object) {\n const url = ref();\n const release = () => {\n if (url.value)\n URL.revokeObjectURL(url.value);\n url.value = void 0;\n };\n watch(() => unref(object), (newObject) => {\n release();\n if (newObject)\n url.value = URL.createObjectURL(newObject);\n }, { immediate: true });\n tryOnScopeDispose(release);\n return readonly(url);\n}\n\nfunction useClamp(value, min, max) {\n if (isFunction(value) || isReadonly(value))\n return computed(() => clamp(resolveUnref(value), resolveUnref(min), resolveUnref(max)));\n const _value = ref(value);\n return computed({\n get() {\n return _value.value = clamp(_value.value, resolveUnref(min), resolveUnref(max));\n },\n set(value2) {\n _value.value = clamp(value2, resolveUnref(min), resolveUnref(max));\n }\n });\n}\n\nfunction useOffsetPagination(options) {\n const {\n total = Infinity,\n pageSize = 10,\n page = 1,\n onPageChange = noop,\n onPageSizeChange = noop,\n onPageCountChange = noop\n } = options;\n const currentPageSize = useClamp(pageSize, 1, Infinity);\n const pageCount = computed(() => Math.max(1, Math.ceil(unref(total) / unref(currentPageSize))));\n const currentPage = useClamp(page, 1, pageCount);\n const isFirstPage = computed(() => currentPage.value === 1);\n const isLastPage = computed(() => currentPage.value === pageCount.value);\n if (isRef(page))\n syncRef(page, currentPage);\n if (isRef(pageSize))\n syncRef(pageSize, currentPageSize);\n function prev() {\n currentPage.value--;\n }\n function next() {\n currentPage.value++;\n }\n const returnValue = {\n currentPage,\n currentPageSize,\n pageCount,\n isFirstPage,\n isLastPage,\n prev,\n next\n };\n watch(currentPage, () => {\n onPageChange(reactive(returnValue));\n });\n watch(currentPageSize, () => {\n onPageSizeChange(reactive(returnValue));\n });\n watch(pageCount, () => {\n onPageCountChange(reactive(returnValue));\n });\n return returnValue;\n}\n\nfunction useOnline(options = {}) {\n const { isOnline } = useNetwork(options);\n return isOnline;\n}\n\nfunction usePageLeave(options = {}) {\n const { window = defaultWindow } = options;\n const isLeft = ref(false);\n const handler = (event) => {\n if (!window)\n return;\n event = event || window.event;\n const from = event.relatedTarget || event.toElement;\n isLeft.value = !from;\n };\n if (window) {\n useEventListener(window, \"mouseout\", handler, { passive: true });\n useEventListener(window.document, \"mouseleave\", handler, { passive: true });\n useEventListener(window.document, \"mouseenter\", handler, { passive: true });\n }\n return isLeft;\n}\n\nfunction useParallax(target, options = {}) {\n const {\n deviceOrientationTiltAdjust = (i) => i,\n deviceOrientationRollAdjust = (i) => i,\n mouseTiltAdjust = (i) => i,\n mouseRollAdjust = (i) => i,\n window = defaultWindow\n } = options;\n const orientation = reactive(useDeviceOrientation({ window }));\n const {\n elementX: x,\n elementY: y,\n elementWidth: width,\n elementHeight: height\n } = useMouseInElement(target, { handleOutside: false, window });\n const source = computed(() => {\n if (orientation.isSupported && (orientation.alpha != null && orientation.alpha !== 0 || orientation.gamma != null && orientation.gamma !== 0))\n return \"deviceOrientation\";\n return \"mouse\";\n });\n const roll = computed(() => {\n if (source.value === \"deviceOrientation\") {\n const value = -orientation.beta / 90;\n return deviceOrientationRollAdjust(value);\n } else {\n const value = -(y.value - height.value / 2) / height.value;\n return mouseRollAdjust(value);\n }\n });\n const tilt = computed(() => {\n if (source.value === \"deviceOrientation\") {\n const value = orientation.gamma / 90;\n return deviceOrientationTiltAdjust(value);\n } else {\n const value = (x.value - width.value / 2) / width.value;\n return mouseTiltAdjust(value);\n }\n });\n return { roll, tilt, source };\n}\n\nvar __defProp$6 = Object.defineProperty;\nvar __defProps$1 = Object.defineProperties;\nvar __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$6 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$6 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$6 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$6.call(b, prop))\n __defNormalProp$6(a, prop, b[prop]);\n if (__getOwnPropSymbols$6)\n for (var prop of __getOwnPropSymbols$6(b)) {\n if (__propIsEnum$6.call(b, prop))\n __defNormalProp$6(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));\nconst defaultState = {\n x: 0,\n y: 0,\n pointerId: 0,\n pressure: 0,\n tiltX: 0,\n tiltY: 0,\n width: 0,\n height: 0,\n twist: 0,\n pointerType: null\n};\nconst keys = /* @__PURE__ */ Object.keys(defaultState);\nfunction usePointer(options = {}) {\n const {\n target = defaultWindow\n } = options;\n const isInside = ref(false);\n const state = ref(options.initialValue || {});\n Object.assign(state.value, defaultState, state.value);\n const handler = (event) => {\n isInside.value = true;\n if (options.pointerTypes && !options.pointerTypes.includes(event.pointerType))\n return;\n state.value = objectPick(event, keys, false);\n };\n if (target) {\n useEventListener(target, \"pointerdown\", handler, { passive: true });\n useEventListener(target, \"pointermove\", handler, { passive: true });\n useEventListener(target, \"pointerleave\", () => isInside.value = false, { passive: true });\n }\n return __spreadProps$1(__spreadValues$6({}, toRefs(state)), {\n isInside\n });\n}\n\nfunction usePointerLock(target, options = {}) {\n const { document = defaultDocument, pointerLockOptions } = options;\n const isSupported = useSupported(() => document && \"pointerLockElement\" in document);\n const element = ref();\n const triggerElement = ref();\n let targetElement;\n if (isSupported.value) {\n useEventListener(document, \"pointerlockchange\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n element.value = document.pointerLockElement;\n if (!element.value)\n targetElement = triggerElement.value = null;\n }\n });\n useEventListener(document, \"pointerlockerror\", () => {\n var _a;\n const currentElement = (_a = document.pointerLockElement) != null ? _a : element.value;\n if (targetElement && currentElement === targetElement) {\n const action = document.pointerLockElement ? \"release\" : \"acquire\";\n throw new Error(`Failed to ${action} pointer lock.`);\n }\n });\n }\n async function lock(e, options2) {\n var _a;\n if (!isSupported.value)\n throw new Error(\"Pointer Lock API is not supported by your browser.\");\n triggerElement.value = e instanceof Event ? e.currentTarget : null;\n targetElement = e instanceof Event ? (_a = unrefElement(target)) != null ? _a : triggerElement.value : unrefElement(e);\n if (!targetElement)\n throw new Error(\"Target element undefined.\");\n targetElement.requestPointerLock(options2 != null ? options2 : pointerLockOptions);\n return await until(element).toBe(targetElement);\n }\n async function unlock() {\n if (!element.value)\n return false;\n document.exitPointerLock();\n await until(element).toBeNull();\n return true;\n }\n return {\n isSupported,\n element,\n triggerElement,\n lock,\n unlock\n };\n}\n\nvar SwipeDirection;\n(function(SwipeDirection2) {\n SwipeDirection2[\"UP\"] = \"UP\";\n SwipeDirection2[\"RIGHT\"] = \"RIGHT\";\n SwipeDirection2[\"DOWN\"] = \"DOWN\";\n SwipeDirection2[\"LEFT\"] = \"LEFT\";\n SwipeDirection2[\"NONE\"] = \"NONE\";\n})(SwipeDirection || (SwipeDirection = {}));\nfunction useSwipe(target, options = {}) {\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart,\n passive = true,\n window = defaultWindow\n } = options;\n const coordsStart = reactive({ x: 0, y: 0 });\n const coordsEnd = reactive({ x: 0, y: 0 });\n const diffX = computed(() => coordsStart.x - coordsEnd.x);\n const diffY = computed(() => coordsStart.y - coordsEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(diffX.value), abs(diffY.value)) >= threshold);\n const isSwiping = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return SwipeDirection.NONE;\n if (abs(diffX.value) > abs(diffY.value)) {\n return diffX.value > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT;\n } else {\n return diffY.value > 0 ? SwipeDirection.UP : SwipeDirection.DOWN;\n }\n });\n const getTouchEventCoords = (e) => [e.touches[0].clientX, e.touches[0].clientY];\n const updateCoordsStart = (x, y) => {\n coordsStart.x = x;\n coordsStart.y = y;\n };\n const updateCoordsEnd = (x, y) => {\n coordsEnd.x = x;\n coordsEnd.y = y;\n };\n let listenerOptions;\n const isPassiveEventSupported = checkPassiveEventSupport(window == null ? void 0 : window.document);\n if (!passive)\n listenerOptions = isPassiveEventSupported ? { passive: false, capture: true } : { capture: true };\n else\n listenerOptions = isPassiveEventSupported ? { passive: true } : { capture: false };\n const onTouchEnd = (e) => {\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isSwiping.value = false;\n };\n const stops = [\n useEventListener(target, \"touchstart\", (e) => {\n if (listenerOptions.capture && !listenerOptions.passive)\n e.preventDefault();\n const [x, y] = getTouchEventCoords(e);\n updateCoordsStart(x, y);\n updateCoordsEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }, listenerOptions),\n useEventListener(target, \"touchmove\", (e) => {\n const [x, y] = getTouchEventCoords(e);\n updateCoordsEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }, listenerOptions),\n useEventListener(target, \"touchend\", onTouchEnd, listenerOptions),\n useEventListener(target, \"touchcancel\", onTouchEnd, listenerOptions)\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isPassiveEventSupported,\n isSwiping,\n direction,\n coordsStart,\n coordsEnd,\n lengthX: diffX,\n lengthY: diffY,\n stop\n };\n}\nfunction checkPassiveEventSupport(document) {\n if (!document)\n return false;\n let supportsPassive = false;\n const optionsBlock = {\n get passive() {\n supportsPassive = true;\n return false;\n }\n };\n document.addEventListener(\"x\", noop, optionsBlock);\n document.removeEventListener(\"x\", noop);\n return supportsPassive;\n}\n\nfunction usePointerSwipe(target, options = {}) {\n const targetRef = resolveRef(target);\n const {\n threshold = 50,\n onSwipe,\n onSwipeEnd,\n onSwipeStart\n } = options;\n const posStart = reactive({ x: 0, y: 0 });\n const updatePosStart = (x, y) => {\n posStart.x = x;\n posStart.y = y;\n };\n const posEnd = reactive({ x: 0, y: 0 });\n const updatePosEnd = (x, y) => {\n posEnd.x = x;\n posEnd.y = y;\n };\n const distanceX = computed(() => posStart.x - posEnd.x);\n const distanceY = computed(() => posStart.y - posEnd.y);\n const { max, abs } = Math;\n const isThresholdExceeded = computed(() => max(abs(distanceX.value), abs(distanceY.value)) >= threshold);\n const isSwiping = ref(false);\n const isPointerDown = ref(false);\n const direction = computed(() => {\n if (!isThresholdExceeded.value)\n return SwipeDirection.NONE;\n if (abs(distanceX.value) > abs(distanceY.value)) {\n return distanceX.value > 0 ? SwipeDirection.LEFT : SwipeDirection.RIGHT;\n } else {\n return distanceY.value > 0 ? SwipeDirection.UP : SwipeDirection.DOWN;\n }\n });\n const eventIsAllowed = (e) => {\n var _a, _b, _c;\n const isReleasingButton = e.buttons === 0;\n const isPrimaryButton = e.buttons === 1;\n return (_c = (_b = (_a = options.pointerTypes) == null ? void 0 : _a.includes(e.pointerType)) != null ? _b : isReleasingButton || isPrimaryButton) != null ? _c : true;\n };\n const stops = [\n useEventListener(target, \"pointerdown\", (e) => {\n var _a, _b;\n if (!eventIsAllowed(e))\n return;\n isPointerDown.value = true;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"none\");\n const eventTarget = e.target;\n eventTarget == null ? void 0 : eventTarget.setPointerCapture(e.pointerId);\n const { clientX: x, clientY: y } = e;\n updatePosStart(x, y);\n updatePosEnd(x, y);\n onSwipeStart == null ? void 0 : onSwipeStart(e);\n }),\n useEventListener(target, \"pointermove\", (e) => {\n if (!eventIsAllowed(e))\n return;\n if (!isPointerDown.value)\n return;\n const { clientX: x, clientY: y } = e;\n updatePosEnd(x, y);\n if (!isSwiping.value && isThresholdExceeded.value)\n isSwiping.value = true;\n if (isSwiping.value)\n onSwipe == null ? void 0 : onSwipe(e);\n }),\n useEventListener(target, \"pointerup\", (e) => {\n var _a, _b;\n if (!eventIsAllowed(e))\n return;\n if (isSwiping.value)\n onSwipeEnd == null ? void 0 : onSwipeEnd(e, direction.value);\n isPointerDown.value = false;\n isSwiping.value = false;\n (_b = (_a = targetRef.value) == null ? void 0 : _a.style) == null ? void 0 : _b.setProperty(\"touch-action\", \"initial\");\n })\n ];\n const stop = () => stops.forEach((s) => s());\n return {\n isSwiping: readonly(isSwiping),\n direction: readonly(direction),\n posStart: readonly(posStart),\n posEnd: readonly(posEnd),\n distanceX,\n distanceY,\n stop\n };\n}\n\nfunction usePreferredColorScheme(options) {\n const isLight = useMediaQuery(\"(prefers-color-scheme: light)\", options);\n const isDark = useMediaQuery(\"(prefers-color-scheme: dark)\", options);\n return computed(() => {\n if (isDark.value)\n return \"dark\";\n if (isLight.value)\n return \"light\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredContrast(options) {\n const isMore = useMediaQuery(\"(prefers-contrast: more)\", options);\n const isLess = useMediaQuery(\"(prefers-contrast: less)\", options);\n const isCustom = useMediaQuery(\"(prefers-contrast: custom)\", options);\n return computed(() => {\n if (isMore.value)\n return \"more\";\n if (isLess.value)\n return \"less\";\n if (isCustom.value)\n return \"custom\";\n return \"no-preference\";\n });\n}\n\nfunction usePreferredLanguages(options = {}) {\n const { window = defaultWindow } = options;\n if (!window)\n return ref([\"en\"]);\n const navigator = window.navigator;\n const value = ref(navigator.languages);\n useEventListener(window, \"languagechange\", () => {\n value.value = navigator.languages;\n });\n return value;\n}\n\nfunction usePreferredReducedMotion(options) {\n const isReduced = useMediaQuery(\"(prefers-reduced-motion: reduce)\", options);\n return computed(() => {\n if (isReduced.value)\n return \"reduce\";\n return \"no-preference\";\n });\n}\n\nfunction usePrevious(value, initialValue) {\n const previous = shallowRef(initialValue);\n watch(resolveRef(value), (_, oldValue) => {\n previous.value = oldValue;\n }, { flush: \"sync\" });\n return readonly(previous);\n}\n\nconst useScreenOrientation = (options = {}) => {\n const {\n window = defaultWindow\n } = options;\n const isSupported = useSupported(() => window && \"screen\" in window && \"orientation\" in window.screen);\n const screenOrientation = isSupported.value ? window.screen.orientation : {};\n const orientation = ref(screenOrientation.type);\n const angle = ref(screenOrientation.angle || 0);\n if (isSupported.value) {\n useEventListener(window, \"orientationchange\", () => {\n orientation.value = screenOrientation.type;\n angle.value = screenOrientation.angle;\n });\n }\n const lockOrientation = (type) => {\n if (!isSupported.value)\n return Promise.reject(new Error(\"Not supported\"));\n return screenOrientation.lock(type);\n };\n const unlockOrientation = () => {\n if (isSupported.value)\n screenOrientation.unlock();\n };\n return {\n isSupported,\n orientation,\n angle,\n lockOrientation,\n unlockOrientation\n };\n};\n\nconst topVarName = \"--vueuse-safe-area-top\";\nconst rightVarName = \"--vueuse-safe-area-right\";\nconst bottomVarName = \"--vueuse-safe-area-bottom\";\nconst leftVarName = \"--vueuse-safe-area-left\";\nfunction useScreenSafeArea() {\n const top = ref(\"\");\n const right = ref(\"\");\n const bottom = ref(\"\");\n const left = ref(\"\");\n if (isClient) {\n const topCssVar = useCssVar(topVarName);\n const rightCssVar = useCssVar(rightVarName);\n const bottomCssVar = useCssVar(bottomVarName);\n const leftCssVar = useCssVar(leftVarName);\n topCssVar.value = \"env(safe-area-inset-top, 0px)\";\n rightCssVar.value = \"env(safe-area-inset-right, 0px)\";\n bottomCssVar.value = \"env(safe-area-inset-bottom, 0px)\";\n leftCssVar.value = \"env(safe-area-inset-left, 0px)\";\n update();\n useEventListener(\"resize\", useDebounceFn(update));\n }\n function update() {\n top.value = getValue(topVarName);\n right.value = getValue(rightVarName);\n bottom.value = getValue(bottomVarName);\n left.value = getValue(leftVarName);\n }\n return {\n top,\n right,\n bottom,\n left,\n update\n };\n}\nfunction getValue(position) {\n return getComputedStyle(document.documentElement).getPropertyValue(position);\n}\n\nfunction useScriptTag(src, onLoaded = noop, options = {}) {\n const {\n immediate = true,\n manual = false,\n type = \"text/javascript\",\n async = true,\n crossOrigin,\n referrerPolicy,\n noModule,\n defer,\n document = defaultDocument,\n attrs = {}\n } = options;\n const scriptTag = ref(null);\n let _promise = null;\n const loadScript = (waitForScriptLoad) => new Promise((resolve, reject) => {\n const resolveWithElement = (el2) => {\n scriptTag.value = el2;\n resolve(el2);\n return el2;\n };\n if (!document) {\n resolve(false);\n return;\n }\n let shouldAppend = false;\n let el = document.querySelector(`script[src=\"${resolveUnref(src)}\"]`);\n if (!el) {\n el = document.createElement(\"script\");\n el.type = type;\n el.async = async;\n el.src = resolveUnref(src);\n if (defer)\n el.defer = defer;\n if (crossOrigin)\n el.crossOrigin = crossOrigin;\n if (noModule)\n el.noModule = noModule;\n if (referrerPolicy)\n el.referrerPolicy = referrerPolicy;\n Object.entries(attrs).forEach(([name, value]) => el == null ? void 0 : el.setAttribute(name, value));\n shouldAppend = true;\n } else if (el.hasAttribute(\"data-loaded\")) {\n resolveWithElement(el);\n }\n el.addEventListener(\"error\", (event) => reject(event));\n el.addEventListener(\"abort\", (event) => reject(event));\n el.addEventListener(\"load\", () => {\n el.setAttribute(\"data-loaded\", \"true\");\n onLoaded(el);\n resolveWithElement(el);\n });\n if (shouldAppend)\n el = document.head.appendChild(el);\n if (!waitForScriptLoad)\n resolveWithElement(el);\n });\n const load = (waitForScriptLoad = true) => {\n if (!_promise)\n _promise = loadScript(waitForScriptLoad);\n return _promise;\n };\n const unload = () => {\n if (!document)\n return;\n _promise = null;\n if (scriptTag.value)\n scriptTag.value = null;\n const el = document.querySelector(`script[src=\"${resolveUnref(src)}\"]`);\n if (el)\n document.head.removeChild(el);\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnUnmounted(unload);\n return { scriptTag, load, unload };\n}\n\nfunction checkOverflowScroll(ele) {\n const style = window.getComputedStyle(ele);\n if (style.overflowX === \"scroll\" || style.overflowY === \"scroll\" || style.overflowX === \"auto\" && ele.clientHeight < ele.scrollHeight || style.overflowY === \"auto\" && ele.clientWidth < ele.scrollWidth) {\n return true;\n } else {\n const parent = ele.parentNode;\n if (!parent || parent.tagName === \"BODY\")\n return false;\n return checkOverflowScroll(parent);\n }\n}\nfunction preventDefault(rawEvent) {\n const e = rawEvent || window.event;\n const _target = e.target;\n if (checkOverflowScroll(_target))\n return false;\n if (e.touches.length > 1)\n return true;\n if (e.preventDefault)\n e.preventDefault();\n return false;\n}\nfunction useScrollLock(element, initialState = false) {\n const isLocked = ref(initialState);\n let stopTouchMoveListener = null;\n let initialOverflow;\n watch(resolveRef(element), (el) => {\n if (el) {\n const ele = el;\n initialOverflow = ele.style.overflow;\n if (isLocked.value)\n ele.style.overflow = \"hidden\";\n }\n }, {\n immediate: true\n });\n const lock = () => {\n const ele = resolveUnref(element);\n if (!ele || isLocked.value)\n return;\n if (isIOS) {\n stopTouchMoveListener = useEventListener(ele, \"touchmove\", (e) => {\n preventDefault(e);\n }, { passive: false });\n }\n ele.style.overflow = \"hidden\";\n isLocked.value = true;\n };\n const unlock = () => {\n const ele = resolveUnref(element);\n if (!ele || !isLocked.value)\n return;\n isIOS && (stopTouchMoveListener == null ? void 0 : stopTouchMoveListener());\n ele.style.overflow = initialOverflow;\n isLocked.value = false;\n };\n tryOnScopeDispose(unlock);\n return computed({\n get() {\n return isLocked.value;\n },\n set(v) {\n if (v)\n lock();\n else\n unlock();\n }\n });\n}\n\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { window = defaultWindow } = options;\n return useStorage(key, initialValue, window == null ? void 0 : window.sessionStorage, options);\n}\n\nvar __defProp$5 = Object.defineProperty;\nvar __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$5 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$5 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$5 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$5.call(b, prop))\n __defNormalProp$5(a, prop, b[prop]);\n if (__getOwnPropSymbols$5)\n for (var prop of __getOwnPropSymbols$5(b)) {\n if (__propIsEnum$5.call(b, prop))\n __defNormalProp$5(a, prop, b[prop]);\n }\n return a;\n};\nfunction useShare(shareOptions = {}, options = {}) {\n const { navigator = defaultNavigator } = options;\n const _navigator = navigator;\n const isSupported = useSupported(() => _navigator && \"canShare\" in _navigator);\n const share = async (overrideOptions = {}) => {\n if (isSupported.value) {\n const data = __spreadValues$5(__spreadValues$5({}, resolveUnref(shareOptions)), resolveUnref(overrideOptions));\n let granted = true;\n if (data.files && _navigator.canShare)\n granted = _navigator.canShare({ files: data.files });\n if (granted)\n return _navigator.share(data);\n }\n };\n return {\n isSupported,\n share\n };\n}\n\nconst defaultSortFn = (source, compareFn) => source.sort(compareFn);\nconst defaultCompare = (a, b) => a - b;\nfunction useSorted(...args) {\n var _a, _b, _c, _d;\n const [source] = args;\n let compareFn = defaultCompare;\n let options = {};\n if (args.length === 2) {\n if (typeof args[1] === \"object\") {\n options = args[1];\n compareFn = (_a = options.compareFn) != null ? _a : defaultCompare;\n } else {\n compareFn = (_b = args[1]) != null ? _b : defaultCompare;\n }\n } else if (args.length > 2) {\n compareFn = (_c = args[1]) != null ? _c : defaultCompare;\n options = (_d = args[2]) != null ? _d : {};\n }\n const {\n dirty = false,\n sortFn = defaultSortFn\n } = options;\n if (!dirty)\n return computed(() => sortFn([...unref(source)], compareFn));\n watchEffect(() => {\n const result = sortFn(unref(source), compareFn);\n if (isRef(source))\n source.value = result;\n else\n source.splice(0, source.length, ...result);\n });\n return source;\n}\n\nfunction useSpeechRecognition(options = {}) {\n const {\n interimResults = true,\n continuous = true,\n window = defaultWindow\n } = options;\n const lang = resolveRef(options.lang || \"en-US\");\n const isListening = ref(false);\n const isFinal = ref(false);\n const result = ref(\"\");\n const error = shallowRef(void 0);\n const toggle = (value = !isListening.value) => {\n isListening.value = value;\n };\n const start = () => {\n isListening.value = true;\n };\n const stop = () => {\n isListening.value = false;\n };\n const SpeechRecognition = window && (window.SpeechRecognition || window.webkitSpeechRecognition);\n const isSupported = useSupported(() => SpeechRecognition);\n let recognition;\n if (isSupported.value) {\n recognition = new SpeechRecognition();\n recognition.continuous = continuous;\n recognition.interimResults = interimResults;\n recognition.lang = unref(lang);\n recognition.onstart = () => {\n isFinal.value = false;\n };\n watch(lang, (lang2) => {\n if (recognition && !isListening.value)\n recognition.lang = lang2;\n });\n recognition.onresult = (event) => {\n const transcript = Array.from(event.results).map((result2) => {\n isFinal.value = result2.isFinal;\n return result2[0];\n }).map((result2) => result2.transcript).join(\"\");\n result.value = transcript;\n error.value = void 0;\n };\n recognition.onerror = (event) => {\n error.value = event;\n };\n recognition.onend = () => {\n isListening.value = false;\n recognition.lang = unref(lang);\n };\n watch(isListening, () => {\n if (isListening.value)\n recognition.start();\n else\n recognition.stop();\n });\n }\n tryOnScopeDispose(() => {\n isListening.value = false;\n });\n return {\n isSupported,\n isListening,\n isFinal,\n recognition,\n result,\n error,\n toggle,\n start,\n stop\n };\n}\n\nfunction useSpeechSynthesis(text, options = {}) {\n const {\n pitch = 1,\n rate = 1,\n volume = 1,\n window = defaultWindow\n } = options;\n const synth = window && window.speechSynthesis;\n const isSupported = useSupported(() => synth);\n const isPlaying = ref(false);\n const status = ref(\"init\");\n const spokenText = resolveRef(text || \"\");\n const lang = resolveRef(options.lang || \"en-US\");\n const error = shallowRef(void 0);\n const toggle = (value = !isPlaying.value) => {\n isPlaying.value = value;\n };\n const bindEventsForUtterance = (utterance2) => {\n utterance2.lang = unref(lang);\n utterance2.voice = unref(options.voice) || null;\n utterance2.pitch = pitch;\n utterance2.rate = rate;\n utterance2.volume = volume;\n utterance2.onstart = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onpause = () => {\n isPlaying.value = false;\n status.value = \"pause\";\n };\n utterance2.onresume = () => {\n isPlaying.value = true;\n status.value = \"play\";\n };\n utterance2.onend = () => {\n isPlaying.value = false;\n status.value = \"end\";\n };\n utterance2.onerror = (event) => {\n error.value = event;\n };\n };\n const utterance = computed(() => {\n isPlaying.value = false;\n status.value = \"init\";\n const newUtterance = new SpeechSynthesisUtterance(spokenText.value);\n bindEventsForUtterance(newUtterance);\n return newUtterance;\n });\n const speak = () => {\n synth.cancel();\n utterance && synth.speak(utterance.value);\n };\n const stop = () => {\n synth.cancel();\n isPlaying.value = false;\n };\n if (isSupported.value) {\n bindEventsForUtterance(utterance.value);\n watch(lang, (lang2) => {\n if (utterance.value && !isPlaying.value)\n utterance.value.lang = lang2;\n });\n if (options.voice) {\n watch(options.voice, () => {\n synth.cancel();\n });\n }\n watch(isPlaying, () => {\n if (isPlaying.value)\n synth.resume();\n else\n synth.pause();\n });\n }\n tryOnScopeDispose(() => {\n isPlaying.value = false;\n });\n return {\n isSupported,\n isPlaying,\n status,\n utterance,\n error,\n stop,\n toggle,\n speak\n };\n}\n\nfunction useStepper(steps, initialStep) {\n const stepsRef = ref(steps);\n const stepNames = computed(() => Array.isArray(stepsRef.value) ? stepsRef.value : Object.keys(stepsRef.value));\n const index = ref(stepNames.value.indexOf(initialStep != null ? initialStep : stepNames.value[0]));\n const current = computed(() => at(index.value));\n const isFirst = computed(() => index.value === 0);\n const isLast = computed(() => index.value === stepNames.value.length - 1);\n const next = computed(() => stepNames.value[index.value + 1]);\n const previous = computed(() => stepNames.value[index.value - 1]);\n function at(index2) {\n if (Array.isArray(stepsRef.value))\n return stepsRef.value[index2];\n return stepsRef.value[stepNames.value[index2]];\n }\n function get(step) {\n if (!stepNames.value.includes(step))\n return;\n return at(stepNames.value.indexOf(step));\n }\n function goTo(step) {\n if (stepNames.value.includes(step))\n index.value = stepNames.value.indexOf(step);\n }\n function goToNext() {\n if (isLast.value)\n return;\n index.value++;\n }\n function goToPrevious() {\n if (isFirst.value)\n return;\n index.value--;\n }\n function goBackTo(step) {\n if (isAfter(step))\n goTo(step);\n }\n function isNext(step) {\n return stepNames.value.indexOf(step) === index.value + 1;\n }\n function isPrevious(step) {\n return stepNames.value.indexOf(step) === index.value - 1;\n }\n function isCurrent(step) {\n return stepNames.value.indexOf(step) === index.value;\n }\n function isBefore(step) {\n return index.value < stepNames.value.indexOf(step);\n }\n function isAfter(step) {\n return index.value > stepNames.value.indexOf(step);\n }\n return {\n steps: stepsRef,\n stepNames,\n index,\n current,\n next,\n previous,\n isFirst,\n isLast,\n at,\n get,\n goTo,\n goToNext,\n goToPrevious,\n goBackTo,\n isNext,\n isPrevious,\n isCurrent,\n isBefore,\n isAfter\n };\n}\n\nvar __defProp$4 = Object.defineProperty;\nvar __getOwnPropSymbols$4 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$4 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$4 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$4 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$4.call(b, prop))\n __defNormalProp$4(a, prop, b[prop]);\n if (__getOwnPropSymbols$4)\n for (var prop of __getOwnPropSymbols$4(b)) {\n if (__propIsEnum$4.call(b, prop))\n __defNormalProp$4(a, prop, b[prop]);\n }\n return a;\n};\nfunction useStorageAsync(key, initialValue, storage, options = {}) {\n var _a;\n const {\n flush = \"pre\",\n deep = true,\n listenToStorageChanges = true,\n writeDefaults = true,\n mergeDefaults = false,\n shallow,\n window = defaultWindow,\n eventFilter,\n onError = (e) => {\n console.error(e);\n }\n } = options;\n const rawInit = resolveUnref(initialValue);\n const type = guessSerializerType(rawInit);\n const data = (shallow ? shallowRef : ref)(initialValue);\n const serializer = (_a = options.serializer) != null ? _a : StorageSerializers[type];\n if (!storage) {\n try {\n storage = getSSRHandler(\"getDefaultStorage\", () => {\n var _a2;\n return (_a2 = defaultWindow) == null ? void 0 : _a2.localStorage;\n })();\n } catch (e) {\n onError(e);\n }\n }\n async function read(event) {\n if (!storage || event && event.key !== key)\n return;\n try {\n const rawValue = event ? event.newValue : await storage.getItem(key);\n if (rawValue == null) {\n data.value = rawInit;\n if (writeDefaults && rawInit !== null)\n await storage.setItem(key, await serializer.write(rawInit));\n } else if (mergeDefaults) {\n const value = await serializer.read(rawValue);\n if (isFunction(mergeDefaults))\n data.value = mergeDefaults(value, rawInit);\n else if (type === \"object\" && !Array.isArray(value))\n data.value = __spreadValues$4(__spreadValues$4({}, rawInit), value);\n else\n data.value = value;\n } else {\n data.value = await serializer.read(rawValue);\n }\n } catch (e) {\n onError(e);\n }\n }\n read();\n if (window && listenToStorageChanges)\n useEventListener(window, \"storage\", (e) => setTimeout(() => read(e), 0));\n if (storage) {\n watchWithFilter(data, async () => {\n try {\n if (data.value == null)\n await storage.removeItem(key);\n else\n await storage.setItem(key, await serializer.write(data.value));\n } catch (e) {\n onError(e);\n }\n }, {\n flush,\n deep,\n eventFilter\n });\n }\n return data;\n}\n\nlet _id = 0;\nfunction useStyleTag(css, options = {}) {\n const isLoaded = ref(false);\n const {\n document = defaultDocument,\n immediate = true,\n manual = false,\n id = `vueuse_styletag_${++_id}`\n } = options;\n const cssRef = ref(css);\n let stop = () => {\n };\n const load = () => {\n if (!document)\n return;\n const el = document.getElementById(id) || document.createElement(\"style\");\n if (!el.isConnected) {\n el.type = \"text/css\";\n el.id = id;\n if (options.media)\n el.media = options.media;\n document.head.appendChild(el);\n }\n if (isLoaded.value)\n return;\n stop = watch(cssRef, (value) => {\n el.textContent = value;\n }, { immediate: true });\n isLoaded.value = true;\n };\n const unload = () => {\n if (!document || !isLoaded.value)\n return;\n stop();\n document.head.removeChild(document.getElementById(id));\n isLoaded.value = false;\n };\n if (immediate && !manual)\n tryOnMounted(load);\n if (!manual)\n tryOnScopeDispose(unload);\n return {\n id,\n css: cssRef,\n unload,\n load,\n isLoaded: readonly(isLoaded)\n };\n}\n\nfunction useTemplateRefsList() {\n const refs = ref([]);\n refs.value.set = (el) => {\n if (el)\n refs.value.push(el);\n };\n onBeforeUpdate(() => {\n refs.value.length = 0;\n });\n return refs;\n}\n\nfunction useTextDirection(options = {}) {\n const {\n document = defaultDocument,\n selector = \"html\",\n observe = false,\n initialValue = \"ltr\"\n } = options;\n function getValue() {\n var _a, _b;\n return (_b = (_a = document == null ? void 0 : document.querySelector(selector)) == null ? void 0 : _a.getAttribute(\"dir\")) != null ? _b : initialValue;\n }\n const dir = ref(getValue());\n tryOnMounted(() => dir.value = getValue());\n if (observe && document) {\n useMutationObserver(document.querySelector(selector), () => dir.value = getValue(), { attributes: true });\n }\n return computed({\n get() {\n return dir.value;\n },\n set(v) {\n var _a, _b;\n dir.value = v;\n if (!document)\n return;\n if (dir.value)\n (_a = document.querySelector(selector)) == null ? void 0 : _a.setAttribute(\"dir\", dir.value);\n else\n (_b = document.querySelector(selector)) == null ? void 0 : _b.removeAttribute(\"dir\");\n }\n });\n}\n\nfunction getRangesFromSelection(selection) {\n var _a;\n const rangeCount = (_a = selection.rangeCount) != null ? _a : 0;\n const ranges = new Array(rangeCount);\n for (let i = 0; i < rangeCount; i++) {\n const range = selection.getRangeAt(i);\n ranges[i] = range;\n }\n return ranges;\n}\nfunction useTextSelection(options = {}) {\n const {\n window = defaultWindow\n } = options;\n const selection = ref(null);\n const text = computed(() => {\n var _a, _b;\n return (_b = (_a = selection.value) == null ? void 0 : _a.toString()) != null ? _b : \"\";\n });\n const ranges = computed(() => selection.value ? getRangesFromSelection(selection.value) : []);\n const rects = computed(() => ranges.value.map((range) => range.getBoundingClientRect()));\n function onSelectionChange() {\n selection.value = null;\n if (window)\n selection.value = window.getSelection();\n }\n if (window)\n useEventListener(window.document, \"selectionchange\", onSelectionChange);\n return {\n text,\n rects,\n ranges,\n selection\n };\n}\n\nfunction useTextareaAutosize(options) {\n const textarea = ref(options == null ? void 0 : options.element);\n const input = ref(options == null ? void 0 : options.input);\n function triggerResize() {\n var _a, _b;\n if (!textarea.value)\n return;\n textarea.value.style.height = \"1px\";\n textarea.value.style.height = `${(_a = textarea.value) == null ? void 0 : _a.scrollHeight}px`;\n (_b = options == null ? void 0 : options.onResize) == null ? void 0 : _b.call(options);\n }\n watch([input, textarea], triggerResize, { immediate: true });\n useResizeObserver(textarea, () => triggerResize());\n if (options == null ? void 0 : options.watch)\n watch(options.watch, triggerResize, { immediate: true, deep: true });\n return {\n textarea,\n input,\n triggerResize\n };\n}\n\nvar __defProp$3 = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$3 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$3 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$3 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$3.call(b, prop))\n __defNormalProp$3(a, prop, b[prop]);\n if (__getOwnPropSymbols$3)\n for (var prop of __getOwnPropSymbols$3(b)) {\n if (__propIsEnum$3.call(b, prop))\n __defNormalProp$3(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction useThrottledRefHistory(source, options = {}) {\n const { throttle = 200, trailing = true } = options;\n const filter = throttleFilter(throttle, trailing);\n const history = useRefHistory(source, __spreadProps(__spreadValues$3({}, options), { eventFilter: filter }));\n return __spreadValues$3({}, history);\n}\n\nvar __defProp$2 = Object.defineProperty;\nvar __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$2 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$2 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$2 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$2.call(b, prop))\n __defNormalProp$2(a, prop, b[prop]);\n if (__getOwnPropSymbols$2)\n for (var prop of __getOwnPropSymbols$2(b)) {\n if (__propIsEnum$2.call(b, prop))\n __defNormalProp$2(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp$2.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols$2)\n for (var prop of __getOwnPropSymbols$2(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum$2.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst DEFAULT_UNITS = [\n { max: 6e4, value: 1e3, name: \"second\" },\n { max: 276e4, value: 6e4, name: \"minute\" },\n { max: 72e6, value: 36e5, name: \"hour\" },\n { max: 5184e5, value: 864e5, name: \"day\" },\n { max: 24192e5, value: 6048e5, name: \"week\" },\n { max: 28512e6, value: 2592e6, name: \"month\" },\n { max: Infinity, value: 31536e6, name: \"year\" }\n];\nconst DEFAULT_MESSAGES = {\n justNow: \"just now\",\n past: (n) => n.match(/\\d/) ? `${n} ago` : n,\n future: (n) => n.match(/\\d/) ? `in ${n}` : n,\n month: (n, past) => n === 1 ? past ? \"last month\" : \"next month\" : `${n} month${n > 1 ? \"s\" : \"\"}`,\n year: (n, past) => n === 1 ? past ? \"last year\" : \"next year\" : `${n} year${n > 1 ? \"s\" : \"\"}`,\n day: (n, past) => n === 1 ? past ? \"yesterday\" : \"tomorrow\" : `${n} day${n > 1 ? \"s\" : \"\"}`,\n week: (n, past) => n === 1 ? past ? \"last week\" : \"next week\" : `${n} week${n > 1 ? \"s\" : \"\"}`,\n hour: (n) => `${n} hour${n > 1 ? \"s\" : \"\"}`,\n minute: (n) => `${n} minute${n > 1 ? \"s\" : \"\"}`,\n second: (n) => `${n} second${n > 1 ? \"s\" : \"\"}`,\n invalid: \"\"\n};\nconst DEFAULT_FORMATTER = (date) => date.toISOString().slice(0, 10);\nfunction useTimeAgo(time, options = {}) {\n const {\n controls: exposeControls = false,\n updateInterval = 3e4\n } = options;\n const _a = useNow({ interval: updateInterval, controls: true }), { now } = _a, controls = __objRest(_a, [\"now\"]);\n const timeAgo = computed(() => formatTimeAgo(new Date(resolveUnref(time)), options, unref(now.value)));\n if (exposeControls) {\n return __spreadValues$2({\n timeAgo\n }, controls);\n } else {\n return timeAgo;\n }\n}\nfunction formatTimeAgo(from, options = {}, now = Date.now()) {\n var _a;\n const {\n max,\n messages = DEFAULT_MESSAGES,\n fullDateFormatter = DEFAULT_FORMATTER,\n units = DEFAULT_UNITS,\n showSecond = false,\n rounding = \"round\"\n } = options;\n const roundFn = typeof rounding === \"number\" ? (n) => +n.toFixed(rounding) : Math[rounding];\n const diff = +now - +from;\n const absDiff = Math.abs(diff);\n function getValue(diff2, unit) {\n return roundFn(Math.abs(diff2) / unit.value);\n }\n function format(diff2, unit) {\n const val = getValue(diff2, unit);\n const past = diff2 > 0;\n const str = applyFormat(unit.name, val, past);\n return applyFormat(past ? \"past\" : \"future\", str, past);\n }\n function applyFormat(name, val, isPast) {\n const formatter = messages[name];\n if (typeof formatter === \"function\")\n return formatter(val, isPast);\n return formatter.replace(\"{0}\", val.toString());\n }\n if (absDiff < 6e4 && !showSecond)\n return messages.justNow;\n if (typeof max === \"number\" && absDiff > max)\n return fullDateFormatter(new Date(from));\n if (typeof max === \"string\") {\n const unitMax = (_a = units.find((i) => i.name === max)) == null ? void 0 : _a.max;\n if (unitMax && absDiff > unitMax)\n return fullDateFormatter(new Date(from));\n }\n for (const [idx, unit] of units.entries()) {\n const val = getValue(diff, unit);\n if (val <= 0 && units[idx - 1])\n return format(diff, units[idx - 1]);\n if (absDiff < unit.max)\n return format(diff, unit);\n }\n return messages.invalid;\n}\n\nfunction useTimeoutPoll(fn, interval, timeoutPollOptions) {\n const { start } = useTimeoutFn(loop, interval);\n const isActive = ref(false);\n async function loop() {\n if (!isActive.value)\n return;\n await fn();\n start();\n }\n function resume() {\n if (!isActive.value) {\n isActive.value = true;\n loop();\n }\n }\n function pause() {\n isActive.value = false;\n }\n if (timeoutPollOptions == null ? void 0 : timeoutPollOptions.immediate)\n resume();\n tryOnScopeDispose(pause);\n return {\n isActive,\n pause,\n resume\n };\n}\n\nvar __defProp$1 = Object.defineProperty;\nvar __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;\nvar __hasOwnProp$1 = Object.prototype.hasOwnProperty;\nvar __propIsEnum$1 = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues$1 = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp$1.call(b, prop))\n __defNormalProp$1(a, prop, b[prop]);\n if (__getOwnPropSymbols$1)\n for (var prop of __getOwnPropSymbols$1(b)) {\n if (__propIsEnum$1.call(b, prop))\n __defNormalProp$1(a, prop, b[prop]);\n }\n return a;\n};\nfunction useTimestamp(options = {}) {\n const {\n controls: exposeControls = false,\n offset = 0,\n immediate = true,\n interval = \"requestAnimationFrame\",\n callback\n } = options;\n const ts = ref(timestamp() + offset);\n const update = () => ts.value = timestamp() + offset;\n const cb = callback ? () => {\n update();\n callback(ts.value);\n } : update;\n const controls = interval === \"requestAnimationFrame\" ? useRafFn(cb, { immediate }) : useIntervalFn(cb, interval, { immediate });\n if (exposeControls) {\n return __spreadValues$1({\n timestamp: ts\n }, controls);\n } else {\n return ts;\n }\n}\n\nfunction useTitle(newTitle = null, options = {}) {\n var _a, _b;\n const {\n document = defaultDocument\n } = options;\n const title = resolveRef((_a = newTitle != null ? newTitle : document == null ? void 0 : document.title) != null ? _a : null);\n const isReadonly = newTitle && isFunction(newTitle);\n function format(t) {\n if (!(\"titleTemplate\" in options))\n return t;\n const template = options.titleTemplate || \"%s\";\n return isFunction(template) ? template(t) : unref(template).replace(/%s/g, t);\n }\n watch(title, (t, o) => {\n if (t !== o && document)\n document.title = format(isString(t) ? t : \"\");\n }, { immediate: true });\n if (options.observe && !options.titleTemplate && document && !isReadonly) {\n useMutationObserver((_b = document.head) == null ? void 0 : _b.querySelector(\"title\"), () => {\n if (document && document.title !== title.value)\n title.value = format(document.title);\n }, { childList: true });\n }\n return title;\n}\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst _TransitionPresets = {\n easeInSine: [0.12, 0, 0.39, 0],\n easeOutSine: [0.61, 1, 0.88, 1],\n easeInOutSine: [0.37, 0, 0.63, 1],\n easeInQuad: [0.11, 0, 0.5, 0],\n easeOutQuad: [0.5, 1, 0.89, 1],\n easeInOutQuad: [0.45, 0, 0.55, 1],\n easeInCubic: [0.32, 0, 0.67, 0],\n easeOutCubic: [0.33, 1, 0.68, 1],\n easeInOutCubic: [0.65, 0, 0.35, 1],\n easeInQuart: [0.5, 0, 0.75, 0],\n easeOutQuart: [0.25, 1, 0.5, 1],\n easeInOutQuart: [0.76, 0, 0.24, 1],\n easeInQuint: [0.64, 0, 0.78, 0],\n easeOutQuint: [0.22, 1, 0.36, 1],\n easeInOutQuint: [0.83, 0, 0.17, 1],\n easeInExpo: [0.7, 0, 0.84, 0],\n easeOutExpo: [0.16, 1, 0.3, 1],\n easeInOutExpo: [0.87, 0, 0.13, 1],\n easeInCirc: [0.55, 0, 1, 0.45],\n easeOutCirc: [0, 0.55, 0.45, 1],\n easeInOutCirc: [0.85, 0, 0.15, 1],\n easeInBack: [0.36, 0, 0.66, -0.56],\n easeOutBack: [0.34, 1.56, 0.64, 1],\n easeInOutBack: [0.68, -0.6, 0.32, 1.6]\n};\nconst TransitionPresets = __spreadValues({\n linear: identity\n}, _TransitionPresets);\nfunction createEasingFunction([p0, p1, p2, p3]) {\n const a = (a1, a2) => 1 - 3 * a2 + 3 * a1;\n const b = (a1, a2) => 3 * a2 - 6 * a1;\n const c = (a1) => 3 * a1;\n const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;\n const getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);\n const getTforX = (x) => {\n let aGuessT = x;\n for (let i = 0; i < 4; ++i) {\n const currentSlope = getSlope(aGuessT, p0, p2);\n if (currentSlope === 0)\n return aGuessT;\n const currentX = calcBezier(aGuessT, p0, p2) - x;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n };\n return (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);\n}\nfunction useTransition(source, options = {}) {\n const {\n delay = 0,\n disabled = false,\n duration = 1e3,\n onFinished = noop,\n onStarted = noop,\n transition = identity\n } = options;\n const currentTransition = computed(() => {\n const t = unref(transition);\n return isFunction(t) ? t : createEasingFunction(t);\n });\n const sourceValue = computed(() => {\n const s = unref(source);\n return isNumber(s) ? s : s.map(unref);\n });\n const sourceVector = computed(() => isNumber(sourceValue.value) ? [sourceValue.value] : sourceValue.value);\n const outputVector = ref(sourceVector.value.slice(0));\n let currentDuration;\n let diffVector;\n let endAt;\n let startAt;\n let startVector;\n const { resume, pause } = useRafFn(() => {\n const now = Date.now();\n const progress = clamp(1 - (endAt - now) / currentDuration, 0, 1);\n outputVector.value = startVector.map((val, i) => {\n var _a;\n return val + ((_a = diffVector[i]) != null ? _a : 0) * currentTransition.value(progress);\n });\n if (progress >= 1) {\n pause();\n onFinished();\n }\n }, { immediate: false });\n const start = () => {\n pause();\n currentDuration = unref(duration);\n diffVector = outputVector.value.map((n, i) => {\n var _a, _b;\n return ((_a = sourceVector.value[i]) != null ? _a : 0) - ((_b = outputVector.value[i]) != null ? _b : 0);\n });\n startVector = outputVector.value.slice(0);\n startAt = Date.now();\n endAt = startAt + currentDuration;\n resume();\n onStarted();\n };\n const timeout = useTimeoutFn(start, delay, { immediate: false });\n watch(sourceVector, () => {\n if (unref(disabled))\n return;\n if (unref(delay) <= 0)\n start();\n else\n timeout.start();\n }, { deep: true });\n watch(() => unref(disabled), (v) => {\n if (v) {\n outputVector.value = sourceVector.value.slice(0);\n pause();\n }\n });\n return computed(() => {\n const targetVector = unref(disabled) ? sourceVector : outputVector;\n return isNumber(sourceValue.value) ? targetVector.value[0] : targetVector.value;\n });\n}\n\nfunction useUrlSearchParams(mode = \"history\", options = {}) {\n const {\n initialValue = {},\n removeNullishValues = true,\n removeFalsyValues = false,\n write: enableWrite = true,\n window = defaultWindow\n } = options;\n if (!window)\n return reactive(initialValue);\n const state = reactive({});\n function getRawParams() {\n if (mode === \"history\") {\n return window.location.search || \"\";\n } else if (mode === \"hash\") {\n const hash = window.location.hash || \"\";\n const index = hash.indexOf(\"?\");\n return index > 0 ? hash.slice(index) : \"\";\n } else {\n return (window.location.hash || \"\").replace(/^#/, \"\");\n }\n }\n function constructQuery(params) {\n const stringified = params.toString();\n if (mode === \"history\")\n return `${stringified ? `?${stringified}` : \"\"}${window.location.hash || \"\"}`;\n if (mode === \"hash-params\")\n return `${window.location.search || \"\"}${stringified ? `#${stringified}` : \"\"}`;\n const hash = window.location.hash || \"#\";\n const index = hash.indexOf(\"?\");\n if (index > 0)\n return `${hash.slice(0, index)}${stringified ? `?${stringified}` : \"\"}`;\n return `${hash}${stringified ? `?${stringified}` : \"\"}`;\n }\n function read() {\n return new URLSearchParams(getRawParams());\n }\n function updateState(params) {\n const unusedKeys = new Set(Object.keys(state));\n for (const key of params.keys()) {\n const paramsForKey = params.getAll(key);\n state[key] = paramsForKey.length > 1 ? paramsForKey : params.get(key) || \"\";\n unusedKeys.delete(key);\n }\n Array.from(unusedKeys).forEach((key) => delete state[key]);\n }\n const { pause, resume } = pausableWatch(state, () => {\n const params = new URLSearchParams(\"\");\n Object.keys(state).forEach((key) => {\n const mapEntry = state[key];\n if (Array.isArray(mapEntry))\n mapEntry.forEach((value) => params.append(key, value));\n else if (removeNullishValues && mapEntry == null)\n params.delete(key);\n else if (removeFalsyValues && !mapEntry)\n params.delete(key);\n else\n params.set(key, mapEntry);\n });\n write(params);\n }, { deep: true });\n function write(params, shouldUpdate) {\n pause();\n if (shouldUpdate)\n updateState(params);\n window.history.replaceState(window.history.state, window.document.title, window.location.pathname + constructQuery(params));\n resume();\n }\n function onChanged() {\n if (!enableWrite)\n return;\n write(read(), true);\n }\n useEventListener(window, \"popstate\", onChanged, false);\n if (mode !== \"history\")\n useEventListener(window, \"hashchange\", onChanged, false);\n const initial = read();\n if (initial.keys().next().value)\n updateState(initial);\n else\n Object.assign(state, initialValue);\n return state;\n}\n\nfunction useUserMedia(options = {}) {\n var _a, _b;\n const enabled = ref((_a = options.enabled) != null ? _a : false);\n const autoSwitch = ref((_b = options.autoSwitch) != null ? _b : true);\n const videoDeviceId = ref(options.videoDeviceId);\n const audioDeviceId = ref(options.audioDeviceId);\n const { navigator = defaultNavigator } = options;\n const isSupported = useSupported(() => {\n var _a2;\n return (_a2 = navigator == null ? void 0 : navigator.mediaDevices) == null ? void 0 : _a2.getUserMedia;\n });\n const stream = shallowRef();\n function getDeviceOptions(device) {\n if (device.value === \"none\" || device.value === false)\n return false;\n if (device.value == null)\n return true;\n return {\n deviceId: device.value\n };\n }\n async function _start() {\n if (!isSupported.value || stream.value)\n return;\n stream.value = await navigator.mediaDevices.getUserMedia({\n video: getDeviceOptions(videoDeviceId),\n audio: getDeviceOptions(audioDeviceId)\n });\n return stream.value;\n }\n async function _stop() {\n var _a2;\n (_a2 = stream.value) == null ? void 0 : _a2.getTracks().forEach((t) => t.stop());\n stream.value = void 0;\n }\n function stop() {\n _stop();\n enabled.value = false;\n }\n async function start() {\n await _start();\n if (stream.value)\n enabled.value = true;\n return stream.value;\n }\n async function restart() {\n _stop();\n return await start();\n }\n watch(enabled, (v) => {\n if (v)\n _start();\n else\n _stop();\n }, { immediate: true });\n watch([videoDeviceId, audioDeviceId], () => {\n if (autoSwitch.value && stream.value)\n restart();\n }, { immediate: true });\n return {\n isSupported,\n stream,\n start,\n stop,\n restart,\n videoDeviceId,\n audioDeviceId,\n enabled,\n autoSwitch\n };\n}\n\nfunction useVModel(props, key, emit, options = {}) {\n var _a, _b, _c, _d, _e;\n const {\n clone = false,\n passive = false,\n eventName,\n deep = false,\n defaultValue\n } = options;\n const vm = getCurrentInstance();\n const _emit = emit || (vm == null ? void 0 : vm.emit) || ((_a = vm == null ? void 0 : vm.$emit) == null ? void 0 : _a.bind(vm)) || ((_c = (_b = vm == null ? void 0 : vm.proxy) == null ? void 0 : _b.$emit) == null ? void 0 : _c.bind(vm == null ? void 0 : vm.proxy));\n let event = eventName;\n if (!key) {\n if (isVue2) {\n const modelOptions = (_e = (_d = vm == null ? void 0 : vm.proxy) == null ? void 0 : _d.$options) == null ? void 0 : _e.model;\n key = (modelOptions == null ? void 0 : modelOptions.value) || \"value\";\n if (!eventName)\n event = (modelOptions == null ? void 0 : modelOptions.event) || \"input\";\n } else {\n key = \"modelValue\";\n }\n }\n event = eventName || event || `update:${key.toString()}`;\n const cloneFn = (val) => !clone ? val : isFunction(clone) ? clone(val) : cloneFnJSON(val);\n const getValue = () => isDef(props[key]) ? cloneFn(props[key]) : defaultValue;\n if (passive) {\n const initialValue = getValue();\n const proxy = ref(initialValue);\n watch(() => props[key], (v) => proxy.value = cloneFn(v));\n watch(proxy, (v) => {\n if (v !== props[key] || deep)\n _emit(event, v);\n }, { deep });\n return proxy;\n } else {\n return computed({\n get() {\n return getValue();\n },\n set(value) {\n _emit(event, value);\n }\n });\n }\n}\n\nfunction useVModels(props, emit, options = {}) {\n const ret = {};\n for (const key in props)\n ret[key] = useVModel(props, key, emit, options);\n return ret;\n}\n\nfunction useVibrate(options) {\n const {\n pattern = [],\n interval = 0,\n navigator = defaultNavigator\n } = options || {};\n const isSupported = useSupported(() => typeof navigator !== \"undefined\" && \"vibrate\" in navigator);\n const patternRef = resolveRef(pattern);\n let intervalControls;\n const vibrate = (pattern2 = patternRef.value) => {\n if (isSupported.value)\n navigator.vibrate(pattern2);\n };\n const stop = () => {\n if (isSupported.value)\n navigator.vibrate(0);\n intervalControls == null ? void 0 : intervalControls.pause();\n };\n if (interval > 0) {\n intervalControls = useIntervalFn(vibrate, interval, {\n immediate: false,\n immediateCallback: false\n });\n }\n return {\n isSupported,\n pattern,\n intervalControls,\n vibrate,\n stop\n };\n}\n\nfunction useVirtualList(list, options) {\n const { containerStyle, wrapperProps, scrollTo, calculateRange, currentList, containerRef } = \"itemHeight\" in options ? useVerticalVirtualList(options, list) : useHorizontalVirtualList(options, list);\n return {\n list: currentList,\n scrollTo,\n containerProps: {\n ref: containerRef,\n onScroll: () => {\n calculateRange();\n },\n style: containerStyle\n },\n wrapperProps\n };\n}\nfunction useVirtualListResources(list) {\n const containerRef = ref(null);\n const size = useElementSize(containerRef);\n const currentList = ref([]);\n const source = shallowRef(list);\n const state = ref({ start: 0, end: 10 });\n return { state, source, currentList, size, containerRef };\n}\nfunction createGetViewCapacity(state, source, itemSize) {\n return (containerSize) => {\n if (typeof itemSize === \"number\")\n return Math.ceil(containerSize / itemSize);\n const { start = 0 } = state.value;\n let sum = 0;\n let capacity = 0;\n for (let i = start; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n capacity = i;\n if (sum > containerSize)\n break;\n }\n return capacity - start;\n };\n}\nfunction createGetOffset(source, itemSize) {\n return (scrollDirection) => {\n if (typeof itemSize === \"number\")\n return Math.floor(scrollDirection / itemSize) + 1;\n let sum = 0;\n let offset = 0;\n for (let i = 0; i < source.value.length; i++) {\n const size = itemSize(i);\n sum += size;\n if (sum >= scrollDirection) {\n offset = i;\n break;\n }\n }\n return offset + 1;\n };\n}\nfunction createCalculateRange(type, overscan, getOffset, getViewCapacity, { containerRef, state, currentList, source }) {\n return () => {\n const element = containerRef.value;\n if (element) {\n const offset = getOffset(type === \"vertical\" ? element.scrollTop : element.scrollLeft);\n const viewCapacity = getViewCapacity(type === \"vertical\" ? element.clientHeight : element.clientWidth);\n const from = offset - overscan;\n const to = offset + viewCapacity + overscan;\n state.value = {\n start: from < 0 ? 0 : from,\n end: to > source.value.length ? source.value.length : to\n };\n currentList.value = source.value.slice(state.value.start, state.value.end).map((ele, index) => ({\n data: ele,\n index: index + state.value.start\n }));\n }\n };\n}\nfunction createGetDistance(itemSize, source) {\n return (index) => {\n if (typeof itemSize === \"number\") {\n const size2 = index * itemSize;\n return size2;\n }\n const size = source.value.slice(0, index).reduce((sum, _, i) => sum + itemSize(i), 0);\n return size;\n };\n}\nfunction useWatchForSizes(size, list, calculateRange) {\n watch([size.width, size.height, list], () => {\n calculateRange();\n });\n}\nfunction createComputedTotalSize(itemSize, source) {\n return computed(() => {\n if (typeof itemSize === \"number\")\n return source.value.length * itemSize;\n return source.value.reduce((sum, _, index) => sum + itemSize(index), 0);\n });\n}\nconst scrollToDictionaryForElementScrollKey = {\n horizontal: \"scrollLeft\",\n vertical: \"scrollTop\"\n};\nfunction createScrollTo(type, calculateRange, getDistance, containerRef) {\n return (index) => {\n if (containerRef.value) {\n containerRef.value[scrollToDictionaryForElementScrollKey[type]] = getDistance(index);\n calculateRange();\n }\n };\n}\nfunction useHorizontalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowX: \"auto\" };\n const { itemWidth, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemWidth);\n const getOffset = createGetOffset(source, itemWidth);\n const calculateRange = createCalculateRange(\"horizontal\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceLeft = createGetDistance(itemWidth, source);\n const offsetLeft = computed(() => getDistanceLeft(state.value.start));\n const totalWidth = createComputedTotalSize(itemWidth, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"horizontal\", calculateRange, getDistanceLeft, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n height: \"100%\",\n width: `${totalWidth.value - offsetLeft.value}px`,\n marginLeft: `${offsetLeft.value}px`,\n display: \"flex\"\n }\n };\n });\n return {\n scrollTo,\n calculateRange,\n wrapperProps,\n containerStyle,\n currentList,\n containerRef\n };\n}\nfunction useVerticalVirtualList(options, list) {\n const resources = useVirtualListResources(list);\n const { state, source, currentList, size, containerRef } = resources;\n const containerStyle = { overflowY: \"auto\" };\n const { itemHeight, overscan = 5 } = options;\n const getViewCapacity = createGetViewCapacity(state, source, itemHeight);\n const getOffset = createGetOffset(source, itemHeight);\n const calculateRange = createCalculateRange(\"vertical\", overscan, getOffset, getViewCapacity, resources);\n const getDistanceTop = createGetDistance(itemHeight, source);\n const offsetTop = computed(() => getDistanceTop(state.value.start));\n const totalHeight = createComputedTotalSize(itemHeight, source);\n useWatchForSizes(size, list, calculateRange);\n const scrollTo = createScrollTo(\"vertical\", calculateRange, getDistanceTop, containerRef);\n const wrapperProps = computed(() => {\n return {\n style: {\n width: \"100%\",\n height: `${totalHeight.value - offsetTop.value}px`,\n marginTop: `${offsetTop.value}px`\n }\n };\n });\n return {\n calculateRange,\n scrollTo,\n containerStyle,\n wrapperProps,\n currentList,\n containerRef\n };\n}\n\nconst useWakeLock = (options = {}) => {\n const {\n navigator = defaultNavigator,\n document = defaultDocument\n } = options;\n let wakeLock;\n const isSupported = useSupported(() => navigator && \"wakeLock\" in navigator);\n const isActive = ref(false);\n async function onVisibilityChange() {\n if (!isSupported.value || !wakeLock)\n return;\n if (document && document.visibilityState === \"visible\")\n wakeLock = await navigator.wakeLock.request(\"screen\");\n isActive.value = !wakeLock.released;\n }\n if (document)\n useEventListener(document, \"visibilitychange\", onVisibilityChange, { passive: true });\n async function request(type) {\n if (!isSupported.value)\n return;\n wakeLock = await navigator.wakeLock.request(type);\n isActive.value = !wakeLock.released;\n }\n async function release() {\n if (!isSupported.value || !wakeLock)\n return;\n await wakeLock.release();\n isActive.value = !wakeLock.released;\n wakeLock = null;\n }\n return {\n isSupported,\n isActive,\n request,\n release\n };\n};\n\nconst useWebNotification = (defaultOptions = {}) => {\n const {\n window = defaultWindow\n } = defaultOptions;\n const isSupported = useSupported(() => !!window && \"Notification\" in window);\n const notification = ref(null);\n const requestPermission = async () => {\n if (!isSupported.value)\n return;\n if (\"permission\" in Notification && Notification.permission !== \"denied\")\n await Notification.requestPermission();\n };\n const onClick = createEventHook();\n const onShow = createEventHook();\n const onError = createEventHook();\n const onClose = createEventHook();\n const show = async (overrides) => {\n if (!isSupported.value)\n return;\n await requestPermission();\n const options = Object.assign({}, defaultOptions, overrides);\n notification.value = new Notification(options.title || \"\", options);\n notification.value.onclick = (event) => onClick.trigger(event);\n notification.value.onshow = (event) => onShow.trigger(event);\n notification.value.onerror = (event) => onError.trigger(event);\n notification.value.onclose = (event) => onClose.trigger(event);\n return notification.value;\n };\n const close = () => {\n if (notification.value)\n notification.value.close();\n notification.value = null;\n };\n tryOnMounted(async () => {\n if (isSupported.value)\n await requestPermission();\n });\n tryOnScopeDispose(close);\n if (isSupported.value && window) {\n const document = window.document;\n useEventListener(document, \"visibilitychange\", (e) => {\n e.preventDefault();\n if (document.visibilityState === \"visible\") {\n close();\n }\n });\n }\n return {\n isSupported,\n notification,\n show,\n close,\n onClick,\n onShow,\n onError,\n onClose\n };\n};\n\nconst DEFAULT_PING_MESSAGE = \"ping\";\nfunction resolveNestedOptions(options) {\n if (options === true)\n return {};\n return options;\n}\nfunction useWebSocket(url, options = {}) {\n const {\n onConnected,\n onDisconnected,\n onError,\n onMessage,\n immediate = true,\n autoClose = true,\n protocols = []\n } = options;\n const data = ref(null);\n const status = ref(\"CLOSED\");\n const wsRef = ref();\n const urlRef = resolveRef(url);\n let heartbeatPause;\n let heartbeatResume;\n let explicitlyClosed = false;\n let retried = 0;\n let bufferedData = [];\n let pongTimeoutWait;\n const close = (code = 1e3, reason) => {\n if (!wsRef.value)\n return;\n explicitlyClosed = true;\n heartbeatPause == null ? void 0 : heartbeatPause();\n wsRef.value.close(code, reason);\n };\n const _sendBuffer = () => {\n if (bufferedData.length && wsRef.value && status.value === \"OPEN\") {\n for (const buffer of bufferedData)\n wsRef.value.send(buffer);\n bufferedData = [];\n }\n };\n const resetHeartbeat = () => {\n clearTimeout(pongTimeoutWait);\n pongTimeoutWait = void 0;\n };\n const send = (data2, useBuffer = true) => {\n if (!wsRef.value || status.value !== \"OPEN\") {\n if (useBuffer)\n bufferedData.push(data2);\n return false;\n }\n _sendBuffer();\n wsRef.value.send(data2);\n return true;\n };\n const _init = () => {\n if (explicitlyClosed || typeof urlRef.value === \"undefined\")\n return;\n const ws = new WebSocket(urlRef.value, protocols);\n wsRef.value = ws;\n status.value = \"CONNECTING\";\n ws.onopen = () => {\n status.value = \"OPEN\";\n onConnected == null ? void 0 : onConnected(ws);\n heartbeatResume == null ? void 0 : heartbeatResume();\n _sendBuffer();\n };\n ws.onclose = (ev) => {\n status.value = \"CLOSED\";\n wsRef.value = void 0;\n onDisconnected == null ? void 0 : onDisconnected(ws, ev);\n if (!explicitlyClosed && options.autoReconnect) {\n const {\n retries = -1,\n delay = 1e3,\n onFailed\n } = resolveNestedOptions(options.autoReconnect);\n retried += 1;\n if (typeof retries === \"number\" && (retries < 0 || retried < retries))\n setTimeout(_init, delay);\n else if (typeof retries === \"function\" && retries())\n setTimeout(_init, delay);\n else\n onFailed == null ? void 0 : onFailed();\n }\n };\n ws.onerror = (e) => {\n onError == null ? void 0 : onError(ws, e);\n };\n ws.onmessage = (e) => {\n if (options.heartbeat) {\n resetHeartbeat();\n const {\n message = DEFAULT_PING_MESSAGE\n } = resolveNestedOptions(options.heartbeat);\n if (e.data === message)\n return;\n }\n data.value = e.data;\n onMessage == null ? void 0 : onMessage(ws, e);\n };\n };\n if (options.heartbeat) {\n const {\n message = DEFAULT_PING_MESSAGE,\n interval = 1e3,\n pongTimeout = 1e3\n } = resolveNestedOptions(options.heartbeat);\n const { pause, resume } = useIntervalFn(() => {\n send(message, false);\n if (pongTimeoutWait != null)\n return;\n pongTimeoutWait = setTimeout(() => {\n close();\n }, pongTimeout);\n }, interval, { immediate: false });\n heartbeatPause = pause;\n heartbeatResume = resume;\n }\n if (autoClose) {\n useEventListener(window, \"beforeunload\", () => close());\n tryOnScopeDispose(close);\n }\n const open = () => {\n close();\n explicitlyClosed = false;\n retried = 0;\n _init();\n };\n if (immediate)\n watch(urlRef, open, { immediate: true });\n return {\n data,\n status,\n close,\n send,\n open,\n ws: wsRef\n };\n}\n\nfunction useWebWorker(arg0, workerOptions, options) {\n const {\n window = defaultWindow\n } = options != null ? options : {};\n const data = ref(null);\n const worker = shallowRef();\n const post = function post2(val) {\n if (!worker.value)\n return;\n worker.value.postMessage(val);\n };\n const terminate = function terminate2() {\n if (!worker.value)\n return;\n worker.value.terminate();\n };\n if (window) {\n if (isString(arg0))\n worker.value = new Worker(arg0, workerOptions);\n else if (isFunction(arg0))\n worker.value = arg0();\n else\n worker.value = arg0;\n worker.value.onmessage = (e) => {\n data.value = e.data;\n };\n tryOnScopeDispose(() => {\n if (worker.value)\n worker.value.terminate();\n });\n }\n return {\n data,\n post,\n terminate,\n worker\n };\n}\n\nconst jobRunner = (userFunc) => (e) => {\n const userFuncArgs = e.data[0];\n return Promise.resolve(userFunc.apply(void 0, userFuncArgs)).then((result) => {\n postMessage([\"SUCCESS\", result]);\n }).catch((error) => {\n postMessage([\"ERROR\", error]);\n });\n};\n\nconst depsParser = (deps) => {\n if (deps.length === 0)\n return \"\";\n const depsString = deps.map((dep) => `'${dep}'`).toString();\n return `importScripts(${depsString})`;\n};\n\nconst createWorkerBlobUrl = (fn, deps) => {\n const blobCode = `${depsParser(deps)}; onmessage=(${jobRunner})(${fn})`;\n const blob = new Blob([blobCode], { type: \"text/javascript\" });\n const url = URL.createObjectURL(blob);\n return url;\n};\n\nconst useWebWorkerFn = (fn, options = {}) => {\n const {\n dependencies = [],\n timeout,\n window = defaultWindow\n } = options;\n const worker = ref();\n const workerStatus = ref(\"PENDING\");\n const promise = ref({});\n const timeoutId = ref();\n const workerTerminate = (status = \"PENDING\") => {\n if (worker.value && worker.value._url && window) {\n worker.value.terminate();\n URL.revokeObjectURL(worker.value._url);\n promise.value = {};\n worker.value = void 0;\n window.clearTimeout(timeoutId.value);\n workerStatus.value = status;\n }\n };\n workerTerminate();\n tryOnScopeDispose(workerTerminate);\n const generateWorker = () => {\n const blobUrl = createWorkerBlobUrl(fn, dependencies);\n const newWorker = new Worker(blobUrl);\n newWorker._url = blobUrl;\n newWorker.onmessage = (e) => {\n const { resolve = () => {\n }, reject = () => {\n } } = promise.value;\n const [status, result] = e.data;\n switch (status) {\n case \"SUCCESS\":\n resolve(result);\n workerTerminate(status);\n break;\n default:\n reject(result);\n workerTerminate(\"ERROR\");\n break;\n }\n };\n newWorker.onerror = (e) => {\n const { reject = () => {\n } } = promise.value;\n reject(e);\n workerTerminate(\"ERROR\");\n };\n if (timeout) {\n timeoutId.value = setTimeout(() => workerTerminate(\"TIMEOUT_EXPIRED\"), timeout);\n }\n return newWorker;\n };\n const callWorker = (...fnArgs) => new Promise((resolve, reject) => {\n promise.value = {\n resolve,\n reject\n };\n worker.value && worker.value.postMessage([[...fnArgs]]);\n workerStatus.value = \"RUNNING\";\n });\n const workerFn = (...fnArgs) => {\n if (workerStatus.value === \"RUNNING\") {\n console.error(\"[useWebWorkerFn] You can only run one instance of the worker at a time.\");\n return Promise.reject();\n }\n worker.value = generateWorker();\n return callWorker(...fnArgs);\n };\n return {\n workerFn,\n workerStatus,\n workerTerminate\n };\n};\n\nfunction useWindowFocus({ window = defaultWindow } = {}) {\n if (!window)\n return ref(false);\n const focused = ref(window.document.hasFocus());\n useEventListener(window, \"blur\", () => {\n focused.value = false;\n });\n useEventListener(window, \"focus\", () => {\n focused.value = true;\n });\n return focused;\n}\n\nfunction useWindowScroll({ window = defaultWindow } = {}) {\n if (!window) {\n return {\n x: ref(0),\n y: ref(0)\n };\n }\n const x = ref(window.scrollX);\n const y = ref(window.scrollY);\n useEventListener(window, \"scroll\", () => {\n x.value = window.scrollX;\n y.value = window.scrollY;\n }, {\n capture: false,\n passive: true\n });\n return { x, y };\n}\n\nfunction useWindowSize(options = {}) {\n const {\n window = defaultWindow,\n initialWidth = Infinity,\n initialHeight = Infinity,\n listenOrientation = true,\n includeScrollbar = true\n } = options;\n const width = ref(initialWidth);\n const height = ref(initialHeight);\n const update = () => {\n if (window) {\n if (includeScrollbar) {\n width.value = window.innerWidth;\n height.value = window.innerHeight;\n } else {\n width.value = window.document.documentElement.clientWidth;\n height.value = window.document.documentElement.clientHeight;\n }\n }\n };\n update();\n tryOnMounted(update);\n useEventListener(\"resize\", update, { passive: true });\n if (listenOrientation)\n useEventListener(\"orientationchange\", update, { passive: true });\n return { width, height };\n}\n\nexport { DefaultMagicKeysAliasMap, StorageSerializers, SwipeDirection, TransitionPresets, computedAsync as asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, cloneFnJSON, computedAsync, computedInject, createFetch, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };\n","<template>\r\n <div ref=\"barRef\" :class=\"[ns.e('active-bar'), ns.is(rootTabs.props.tabPosition)]\" :style=\"barStyle\" />\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { getCurrentInstance, inject, nextTick, onBeforeUnmount, ref, watch } from 'vue'\r\nimport { useResizeObserver } from '@vueuse/core'\r\nimport { capitalize, throwError } from '../_util'\r\nimport { useNamespace } from '../_hooks'\r\nimport { tabsRootContextKey } from './constants'\r\nimport { tabBarProps } from './tab-bar'\r\n\r\nimport type { CSSProperties } from 'vue'\r\n\r\nconst COMPONENT_NAME = 'OTabBar'\r\ndefineOptions({\r\n name: COMPONENT_NAME,\r\n})\r\nconst props = defineProps(tabBarProps)\r\n\r\nconst instance = getCurrentInstance()!\r\nconst rootTabs = inject(tabsRootContextKey)\r\nif (!rootTabs) throwError(COMPONENT_NAME, '<o-tabs><o-tab-bar /></p-tabs>')\r\n\r\nconst ns = useNamespace('tabs')\r\n\r\nconst barRef = ref<HTMLDivElement>()\r\nconst barStyle = ref<CSSProperties>()\r\n\r\nconst getBarStyle = (): CSSProperties => {\r\n let offset = 0\r\n let tabSize = 0\r\n\r\n const sizeName = ['top', 'bottom'].includes(rootTabs.props.tabPosition) ? 'width' : 'height'\r\n const sizeDir = sizeName === 'width' ? 'x' : 'y'\r\n const position = sizeDir === 'x' ? 'left' : 'top'\r\n\r\n props.tabs.every((tab) => {\r\n const $el = instance.parent?.refs?.[`tab-${tab.uid}`] as HTMLElement\r\n if (!$el) return false\r\n\r\n if (!tab.active) {\r\n return true\r\n }\r\n\r\n offset = $el[`offset${capitalize(position)}`]\r\n tabSize = $el[`client${capitalize(sizeName)}`]\r\n\r\n const tabStyles = window.getComputedStyle($el)\r\n\r\n if (sizeName === 'width') {\r\n tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight)\r\n offset += Number.parseFloat(tabStyles.paddingLeft)\r\n }\r\n return false\r\n })\r\n\r\n return {\r\n [sizeName]: `${tabSize}px`,\r\n transform: `translate${capitalize(sizeDir)}(${offset}px)`,\r\n }\r\n}\r\n\r\nconst update = () => (barStyle.value = getBarStyle())\r\n\r\nconst saveObserver = [] as ReturnType<typeof useResizeObserver>[]\r\nconst observerTabs = () => {\r\n saveObserver.forEach((observer) => observer.stop())\r\n saveObserver.length = 0\r\n const list = instance.parent?.refs as Record<string, HTMLElement>\r\n if (!list) return\r\n for (const key in list) {\r\n if (key.startsWith('tab-')) {\r\n const _el = list[key]\r\n if (_el) {\r\n saveObserver.push(useResizeObserver(_el, update))\r\n }\r\n }\r\n }\r\n}\r\n\r\nwatch(\r\n () => props.tabs,\r\n async () => {\r\n await nextTick()\r\n update()\r\n\r\n observerTabs()\r\n },\r\n { immediate: true }\r\n)\r\nconst barObserever = useResizeObserver(barRef, () => update())\r\n\r\nonBeforeUnmount(() => {\r\n saveObserver.forEach((observer) => observer.stop())\r\n saveObserver.length = 0\r\n barObserever.stop()\r\n})\r\n\r\ndefineExpose({\r\n /** @description tab root html element */\r\n ref: barRef,\r\n /** @description method to manually update tab bar style */\r\n update,\r\n})\r\n</script>\r\n","import { computed, defineComponent, inject, nextTick, onMounted, onUpdated, ref, watch } from 'vue'\r\nimport { useDocumentVisibility, useResizeObserver, useWindowFocus } from '@vueuse/core'\r\nimport { buildProps, capitalize, definePropType, mutable, throwError } from '../_util'\r\nimport { EVENT_CODE } from '../_constants'\r\nimport { ElIcon } from 'element-plus'\r\nimport { ArrowLeft, ArrowRight, Close } from '@element-plus/icons-vue'\r\nimport { useNamespace } from '../_hooks'\r\nimport TabBar from './tab-bar.vue'\r\nimport { tabsRootContextKey } from './constants'\r\n\r\nimport type { CSSProperties, ExtractPropTypes } from 'vue'\r\nimport type { TabsPaneContext } from './constants'\r\nimport type { TabPaneName } from './tabs'\r\n\r\ninterface Scrollable {\r\n next?: boolean\r\n prev?: number\r\n}\r\n\r\nexport const tabNavProps = buildProps({\r\n panes: {\r\n type: definePropType<TabsPaneContext[]>(Array),\r\n default: () => mutable([] as const),\r\n },\r\n currentName: {\r\n type: [String, Number],\r\n default: '',\r\n },\r\n type: {\r\n type: String,\r\n values: ['card', 'border-card', ''],\r\n default: 'card',\r\n },\r\n stretch: Boolean,\r\n} as const)\r\n\r\nexport const tabNavEmits = {\r\n tabClick: (tab: TabsPaneContext, tabName: TabPaneName, ev: Event) => ev instanceof Event,\r\n tabRemove: (tab: TabsPaneContext, ev: Event) => ev instanceof Event,\r\n}\r\n\r\nexport type TabNavProps = ExtractPropTypes<typeof tabNavProps>\r\nexport type TabNavEmits = typeof tabNavEmits\r\n\r\nconst COMPONENT_NAME = 'OTabNav'\r\nconst TabNav = defineComponent({\r\n name: COMPONENT_NAME,\r\n props: tabNavProps,\r\n emits: tabNavEmits,\r\n setup(props, { expose, emit }) {\r\n const rootTabs = inject(tabsRootContextKey)\r\n if (!rootTabs) throwError(COMPONENT_NAME, `<o-tabs><o-tab-nav /></o-tabs>`)\r\n\r\n const ns = useNamespace('tabs')\r\n const visibility = useDocumentVisibility()\r\n const focused = useWindowFocus()\r\n\r\n const navScroll$ = ref<HTMLDivElement>()\r\n const nav$ = ref<HTMLDivElement>()\r\n const el$ = ref<HTMLDivElement>()\r\n\r\n const tabBarRef = ref<InstanceType<typeof TabBar>>()\r\n\r\n const scrollable = ref<false | Scrollable>(false)\r\n const navOffset = ref(0)\r\n const isFocus = ref(false)\r\n const focusable = ref(true)\r\n\r\n const sizeName = computed(() => (['top', 'bottom'].includes(rootTabs.props.tabPosition) ? 'width' : 'height'))\r\n const navStyle = computed<CSSProperties>(() => {\r\n const dir = sizeName.value === 'width' ? 'X' : 'Y'\r\n return {\r\n transform: `translate${dir}(-${navOffset.value}px)`,\r\n }\r\n })\r\n\r\n const scrollPrev = () => {\r\n if (!navScroll$.value) return\r\n\r\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`]\r\n const currentOffset = navOffset.value\r\n\r\n if (!currentOffset) return\r\n\r\n const newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0\r\n\r\n navOffset.value = newOffset\r\n }\r\n\r\n const scrollNext = () => {\r\n if (!navScroll$.value || !nav$.value) return\r\n\r\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\r\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`]\r\n const currentOffset = navOffset.value\r\n\r\n if (navSize - currentOffset <= containerSize) return\r\n\r\n const newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize\r\n\r\n navOffset.value = newOffset\r\n }\r\n\r\n const scrollToActiveTab = async () => {\r\n const nav = nav$.value\r\n if (!scrollable.value || !el$.value || !navScroll$.value || !nav) return\r\n\r\n await nextTick()\r\n\r\n const activeTab = el$.value.querySelector('.is-active')\r\n if (!activeTab) return\r\n\r\n const navScroll = navScroll$.value\r\n const isHorizontal = ['top', 'bottom'].includes(rootTabs.props.tabPosition)\r\n const activeTabBounding = activeTab.getBoundingClientRect()\r\n const navScrollBounding = navScroll.getBoundingClientRect()\r\n const maxOffset = isHorizontal ? nav.offsetWidth - navScrollBounding.width : nav.offsetHeight - navScrollBounding.height\r\n const currentOffset = navOffset.value\r\n let newOffset = currentOffset\r\n\r\n if (isHorizontal) {\r\n if (activeTabBounding.left < navScrollBounding.left) {\r\n newOffset = currentOffset - (navScrollBounding.left - activeTabBounding.left)\r\n }\r\n if (activeTabBounding.right > navScrollBounding.right) {\r\n newOffset = currentOffset + activeTabBounding.right - navScrollBounding.right\r\n }\r\n } else {\r\n if (activeTabBounding.top < navScrollBounding.top) {\r\n newOffset = currentOffset - (navScrollBounding.top - activeTabBounding.top)\r\n }\r\n if (activeTabBounding.bottom > navScrollBounding.bottom) {\r\n newOffset = currentOffset + (activeTabBounding.bottom - navScrollBounding.bottom)\r\n }\r\n }\r\n newOffset = Math.max(newOffset, 0)\r\n navOffset.value = Math.min(newOffset, maxOffset)\r\n }\r\n\r\n const update = () => {\r\n if (!nav$.value || !navScroll$.value) return\r\n\r\n props.stretch && tabBarRef.value?.update()\r\n\r\n const navSize = nav$.value[`offset${capitalize(sizeName.value)}`]\r\n const containerSize = navScroll$.value[`offset${capitalize(sizeName.value)}`]\r\n const currentOffset = navOffset.value\r\n\r\n if (containerSize < navSize) {\r\n scrollable.value = scrollable.value || {}\r\n scrollable.value.prev = currentOffset\r\n scrollable.value.next = currentOffset + containerSize < navSize\r\n if (navSize - currentOffset < containerSize) {\r\n navOffset.value = navSize - containerSize\r\n }\r\n } else {\r\n scrollable.value = false\r\n if (currentOffset > 0) {\r\n navOffset.value = 0\r\n }\r\n }\r\n }\r\n\r\n const changeTab = (e: KeyboardEvent) => {\r\n const code = e.code\r\n\r\n const { up, down, left, right } = EVENT_CODE\r\n if (![up, down, left, right].includes(code)) return\r\n\r\n // 左右上下键更换tab\r\n const tabList = Array.from((e.currentTarget as HTMLDivElement).querySelectorAll<HTMLDivElement>('[role=tab]:not(.is-disabled)'))\r\n const currentIndex = tabList.indexOf(e.target as HTMLDivElement)\r\n\r\n let nextIndex: number\r\n if (code === left || code === up) {\r\n // left\r\n if (currentIndex === 0) {\r\n // first\r\n nextIndex = tabList.length - 1\r\n } else {\r\n nextIndex = currentIndex - 1\r\n }\r\n } else {\r\n // right\r\n if (currentIndex < tabList.length - 1) {\r\n // not last\r\n nextIndex = currentIndex + 1\r\n } else {\r\n nextIndex = 0\r\n }\r\n }\r\n tabList[nextIndex].focus({ preventScroll: true }) // 改变焦点元素\r\n tabList[nextIndex].click() // 选中下一个tab\r\n setFocus()\r\n }\r\n\r\n const setFocus = () => {\r\n if (focusable.value) isFocus.value = true\r\n }\r\n const removeFocus = () => (isFocus.value = false)\r\n\r\n watch(visibility, (visibility) => {\r\n if (visibility === 'hidden') {\r\n focusable.value = false\r\n } else if (visibility === 'visible') {\r\n setTimeout(() => (focusable.value = true), 50)\r\n }\r\n })\r\n watch(focused, (focused) => {\r\n if (focused) {\r\n setTimeout(() => (focusable.value = true), 50)\r\n } else {\r\n focusable.value = false\r\n }\r\n })\r\n\r\n useResizeObserver(el$, update)\r\n\r\n onMounted(() => setTimeout(() => scrollToActiveTab(), 0))\r\n onUpdated(() => update())\r\n\r\n expose({\r\n scrollToActiveTab,\r\n removeFocus,\r\n })\r\n\r\n return () => {\r\n const scrollBtn = scrollable.value\r\n ? [\r\n <span class={[ns.e('nav-prev'), ns.is('disabled', !scrollable.value.prev)]} onClick={scrollPrev}>\r\n <ElIcon>\r\n <ArrowLeft />\r\n </ElIcon>\r\n </span>,\r\n <span class={[ns.e('nav-next'), ns.is('disabled', !scrollable.value.next)]} onClick={scrollNext}>\r\n <ElIcon>\r\n <ArrowRight />\r\n </ElIcon>\r\n </span>,\r\n ]\r\n : null\r\n\r\n const tabs = props.panes.map((pane, index) => {\r\n const uid = pane.uid\r\n const disabled = pane.props.disabled\r\n const tabName = pane.props.name ?? pane.index ?? `${index}`\r\n pane.index = `${index}`\r\n\r\n const tabLabelContent = pane.slots.label?.() || pane.props.label\r\n const tabindex = !disabled && pane.active ? 0 : -1\r\n\r\n return (\r\n <div\r\n ref={`tab-${uid}`}\r\n class={[ns.e('item'), ns.is(rootTabs.props.tabPosition), ns.is('active', pane.active), ns.is('disabled', disabled), ns.is('focus', isFocus.value)]}\r\n id={`tab-${tabName}`}\r\n key={`tab-${uid}`}\r\n aria-controls={`pane-${tabName}`}\r\n role=\"tab\"\r\n aria-selected={pane.active}\r\n tabindex={tabindex}\r\n onFocus={() => setFocus()}\r\n onBlur={() => removeFocus()}\r\n onClick={(ev: MouseEvent) => {\r\n removeFocus()\r\n emit('tabClick', pane, tabName, ev)\r\n }}\r\n >\r\n {...[tabLabelContent]}\r\n </div>\r\n )\r\n })\r\n\r\n return (\r\n <div ref={el$} class={[ns.e('nav-wrap'), ns.is('scrollable', !!scrollable.value), ns.is(rootTabs.props.tabPosition)]}>\r\n {scrollBtn}\r\n <div class={ns.e('nav-scroll')} ref={navScroll$}>\r\n <div\r\n class={[\r\n ns.e('nav'),\r\n ns.is(rootTabs.props.tabPosition),\r\n ns.is('stretch', props.stretch && ['top', 'bottom'].includes(rootTabs.props.tabPosition)),\r\n ]}\r\n ref={nav$}\r\n style={navStyle.value}\r\n role=\"tablist\"\r\n onKeydown={changeTab}\r\n >\r\n {...[!props.type ? <TabBar ref={tabBarRef} tabs={[...props.panes]} /> : null, tabs]}\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport type TabNavInstance = InstanceType<typeof TabNav> & {\r\n scrollToActiveTab: () => Promise<void>\r\n removeFocus: () => void\r\n}\r\nexport default TabNav\r\n","import { computed, createVNode, defineComponent, getCurrentInstance, nextTick, provide, ref, renderSlot, watch } from 'vue'\r\nimport { buildProps, definePropType, isNumber, isString, isUndefined } from '../_util'\r\nimport { UPDATE_MODEL_EVENT } from '../_constants'\r\nimport { useNamespace, useOrderedChildren } from '../_hooks'\r\nimport { tabsRootContextKey } from './constants'\r\nimport TabNav from './tab-nav'\r\n\r\nimport type { TabNavInstance } from './tab-nav'\r\nimport type { TabsPaneContext } from './constants'\r\nimport type { ExtractPropTypes, FunctionalComponent, VNode } from 'vue'\r\nimport type { Awaitable } from '../_util'\r\n\r\nexport type TabPaneName = string | number\r\n\r\nexport const tabsProps = buildProps({\r\n /**\r\n * @description type of Tab\r\n */\r\n type: {\r\n type: String,\r\n values: ['card', 'border-card', ''],\r\n default: 'card',\r\n },\r\n /**\r\n * @description binding value, name of the selected tab\r\n */\r\n modelValue: {\r\n type: [String, Number],\r\n },\r\n /**\r\n * @description position of tabs\r\n */\r\n tabPosition: {\r\n type: String,\r\n values: ['top', 'right', 'bottom', 'left'],\r\n default: 'top',\r\n },\r\n /**\r\n * @description hook function before switching tab. If `false` is returned or a `Promise` is returned and then is rejected, switching will be prevented\r\n */\r\n beforeLeave: {\r\n type: definePropType<(newName: TabPaneName, oldName: TabPaneName) => Awaitable<void | boolean>>(Function),\r\n default: () => true,\r\n },\r\n /**\r\n * @description whether width of tab automatically fits its container\r\n */\r\n stretch: Boolean,\r\n} as const)\r\nexport type TabsProps = ExtractPropTypes<typeof tabsProps>\r\n\r\nconst isPaneName = (value: unknown): value is string | number => isString(value) || isNumber(value)\r\n\r\nexport const tabsEmits = {\r\n [UPDATE_MODEL_EVENT]: (name: TabPaneName) => isPaneName(name),\r\n tabClick: (pane: TabsPaneContext, ev: Event) => ev instanceof Event,\r\n tabChange: (name: TabPaneName) => isPaneName(name),\r\n}\r\nexport type TabsEmits = typeof tabsEmits\r\n\r\nexport type TabsPanes = Record<number, TabsPaneContext>\r\n\r\nconst Tabs = defineComponent({\r\n name: 'OTabs',\r\n\r\n props: tabsProps,\r\n emits: tabsEmits,\r\n\r\n setup(props, { emit, slots, expose }) {\r\n const ns = useNamespace('tabs')\r\n\r\n const isVertical = computed(() => ['left', 'right'].includes(props.tabPosition))\r\n\r\n const { children: panes, addChild: sortPane, removeChild: unregisterPane } = useOrderedChildren<TabsPaneContext>(getCurrentInstance()!, 'OTabPane')\r\n\r\n const nav$ = ref<TabNavInstance>()\r\n const currentName = ref<TabPaneName>(props.modelValue ?? '0')\r\n\r\n const setCurrentName = async (value?: TabPaneName, trigger = false) => {\r\n // should do nothing.\r\n if (currentName.value === value || isUndefined(value)) return\r\n\r\n try {\r\n const canLeave = await props.beforeLeave?.(value, currentName.value)\r\n if (canLeave !== false) {\r\n currentName.value = value\r\n if (trigger) {\r\n emit(UPDATE_MODEL_EVENT, value)\r\n emit('tabChange', value)\r\n }\r\n\r\n nav$.value?.removeFocus?.()\r\n }\r\n } catch {}\r\n }\r\n\r\n const handleTabClick = (tab: TabsPaneContext, tabName: TabPaneName, event: Event) => {\r\n if (tab.props.disabled) return\r\n setCurrentName(tabName, true)\r\n emit('tabClick', tab, event)\r\n }\r\n\r\n watch(\r\n () => props.modelValue,\r\n (modelValue) => setCurrentName(modelValue)\r\n )\r\n\r\n watch(currentName, async () => {\r\n await nextTick()\r\n nav$.value?.scrollToActiveTab()\r\n })\r\n\r\n provide(tabsRootContextKey, {\r\n props,\r\n currentName,\r\n registerPane: (pane: TabsPaneContext) => {\r\n panes.value.push(pane)\r\n },\r\n sortPane,\r\n unregisterPane,\r\n })\r\n\r\n expose({\r\n currentName,\r\n })\r\n const TabNavRenderer: FunctionalComponent<{ render: () => VNode }> = ({ render }) => {\r\n return render()\r\n }\r\n return () => {\r\n const leftExtra = slots['left-extra']\r\n const rightExtra = slots['right-extra']\r\n\r\n const header = (\r\n <div class={[ns.e('header'), isVertical.value && ns.e('header-vertical'), ns.is(props.tabPosition)]}>\r\n {leftExtra && <div class={ns.e('extra-content-left')}>{renderSlot(slots, 'left-extra')}</div>}\r\n\r\n <TabNavRenderer\r\n render={() => {\r\n const hasLabelSlot = panes.value.some((pane) => pane.slots.label)\r\n return createVNode(\r\n TabNav,\r\n {\r\n ref: nav$,\r\n currentName: currentName.value,\r\n type: props.type,\r\n panes: panes.value,\r\n stretch: props.stretch,\r\n onTabClick: handleTabClick,\r\n },\r\n { $stable: !hasLabelSlot }\r\n )\r\n }}\r\n />\r\n\r\n {rightExtra && <div class={ns.e('extra-content-right')}>{renderSlot(slots, 'right-extra')}</div>}\r\n </div>\r\n )\r\n\r\n const panels = <div class={ns.e('content')}>{renderSlot(slots, 'default')}</div>\r\n\r\n return (\r\n <div\r\n class={[\r\n ns.b(),\r\n ns.m(props.tabPosition),\r\n {\r\n [ns.m('card')]: props.type === 'card',\r\n [ns.m('border-card')]: props.type === 'border-card',\r\n },\r\n ]}\r\n >\r\n {panels}\r\n {header}\r\n </div>\r\n )\r\n }\r\n },\r\n})\r\n\r\nexport type TabsInstance = InstanceType<typeof Tabs> & {\r\n currentName: TabPaneName\r\n}\r\n\r\nexport default Tabs\r\n","<template>\r\n <div\r\n v-if=\"shouldBeRender\"\r\n v-show=\"active\"\r\n :id=\"`pane-${paneName}`\"\r\n :class=\"ns.b()\"\r\n role=\"tabpanel\"\r\n :aria-hidden=\"!active\"\r\n :aria-labelledby=\"`tab-${paneName}`\"\r\n >\r\n <slot />\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { computed, getCurrentInstance, inject, onMounted, onUnmounted, reactive, ref, useSlots, watch } from 'vue'\r\nimport { eagerComputed } from '@vueuse/core'\r\nimport { throwError } from '../_util'\r\nimport { useNamespace } from '../_hooks'\r\nimport { tabsRootContextKey } from './constants'\r\nimport { tabPaneProps } from './tab-pane'\r\n\r\nconst COMPONENT_NAME = 'OTabPane'\r\ndefineOptions({\r\n name: COMPONENT_NAME,\r\n})\r\nconst props = defineProps(tabPaneProps)\r\n\r\nconst instance = getCurrentInstance()!\r\nconst slots = useSlots()\r\n\r\nconst tabsRoot = inject(tabsRootContextKey)\r\nif (!tabsRoot) throwError(COMPONENT_NAME, 'usage: <o-tabs><o-tab-pane /></o-tabs/>')\r\n\r\nconst ns = useNamespace('tab-pane')\r\n\r\nconst index = ref<string>()\r\nconst active = eagerComputed(() => tabsRoot.currentName.value === (props.name ?? index.value))\r\nconst loaded = ref(active.value)\r\nconst paneName = computed(() => props.name ?? index.value)\r\nconst shouldBeRender = eagerComputed(() => !props.lazy || loaded.value || active.value)\r\n\r\nwatch(active, (val) => {\r\n if (val) loaded.value = true\r\n})\r\n\r\nconst pane = reactive({\r\n uid: instance.uid,\r\n slots,\r\n props,\r\n paneName,\r\n active,\r\n index,\r\n})\r\n\r\ntabsRoot.registerPane(pane)\r\nonMounted(() => {\r\n tabsRoot.sortPane(pane)\r\n})\r\n\r\nonUnmounted(() => {\r\n tabsRoot.unregisterPane(pane.uid)\r\n})\r\n</script>\r\n","import { withInstall } from '../_util'\r\n\r\nimport Tabs from './tabs'\r\nimport TabPane from './tab-pane.vue'\r\n\r\nexport default withInstall<typeof Tabs, {\r\n TabPane: typeof TabPane\r\n}>(Tabs, {\r\n TabPane,\r\n})\r\n\r\nexport * from './tabs'\r\nexport * from './tab-bar'\r\nexport * from './tab-nav'\r\nexport * from './tab-pane'\r\nexport * from './constants'\r\n"],"names":["unrefElement","elRef","_a","plain","resolveUnref","defaultWindow","isClient","defaultDocument","useEventListener","args","target","events","listeners","options","isString","noop","cleanups","cleanup","fn","register","el","event","listener","options2","stopWatch","watch","stop","tryOnScopeDispose","useSupported","callback","sync","isSupported","ref","update","tryOnMounted","_global","globalKey","useDocumentVisibility","document","visibility","__getOwnPropSymbols$g","__hasOwnProp$g","__propIsEnum$g","__objRest$2","source","exclude","prop","useResizeObserver","window","observerOptions","observer","SwipeDirection","SwipeDirection2","__defProp","__getOwnPropSymbols","__hasOwnProp","__propIsEnum","__defNormalProp","obj","key","value","__spreadValues","a","b","_TransitionPresets","identity","useWindowFocus","focused","COMPONENT_NAME","props","__props","instance","getCurrentInstance","rootTabs","inject","tabsRootContextKey","throwError","ns","useNamespace","barRef","barStyle","getBarStyle","offset","tabSize","sizeName","sizeDir","position","tab","$el","_b","capitalize","tabStyles","saveObserver","observerTabs","list","_el","nextTick","barObserever","onBeforeUnmount","__expose","tabNavProps","buildProps","panes","type","definePropType","Array","default","mutable","currentName","String","Number","values","stretch","Boolean","tabNavEmits","tabClick","tabName","ev","Event","tabRemove","TabNav","defineComponent","name","emits","setup","expose","emit","navScroll$","nav$","el$","tabBarRef","scrollable","navOffset","isFocus","focusable","computed","includes","tabPosition","navStyle","transform","scrollPrev","containerSize","currentOffset","newOffset","scrollNext","navSize","scrollToActiveTab","nav","activeTab","querySelector","navScroll","isHorizontal","activeTabBounding","getBoundingClientRect","navScrollBounding","maxOffset","offsetWidth","width","offsetHeight","height","left","right","top","bottom","Math","max","min","prev","next","changeTab","e","code","up","down","EVENT_CODE","tabList","from","currentTarget","querySelectorAll","currentIndex","indexOf","nextIndex","length","focus","preventScroll","click","setFocus","removeFocus","setTimeout","onMounted","onUpdated","scrollBtn","_createVNode","is","ElIcon","ArrowLeft","ArrowRight","tabs","map","pane","index","uid","disabled","tabLabelContent","slots","label","tabindex","active","onFocus","onBlur","TabBar","tabsProps","modelValue","beforeLeave","Function","isPaneName","isNumber","tabsEmits","UPDATE_MODEL_EVENT","tabChange","Tabs","isVertical","children","addChild","sortPane","removeChild","unregisterPane","useOrderedChildren","setCurrentName","trigger","isUndefined","handleTabClick","provide","registerPane","push","TabNavRenderer","render","leftExtra","rightExtra","header","renderSlot","hasLabelSlot","some","createVNode","onTabClick","$stable","panels","m","useSlots","tabsRoot","eagerComputed","loaded","paneName","shouldBeRender","val","reactive","onUnmounted","withInstall","TabPane"],"mappings":";;;;;;;;;;;;;;;;;;;AAoFA,SAASA,GAAaC,GAAO;AAC3B,MAAIC;AACJ,QAAMC,IAAQC,GAAaH,CAAK;AAChC,UAAQC,IAAKC,KAAS,OAAO,SAASA,EAAM,QAAQ,OAAOD,IAAKC;AACl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